/* Your Flow kit v1, kit-controls.css (lane A): buttons, fields, chips, option
   rows, the stepper, tabs, links and the sheet. Ported from the approved
   prototype's flow.css. Every colour is a token from kit.css, and only
   transform and opacity move: a control answers a press with a small scale,
   and a colour change is instant. Selected states are drawn off aria-pressed,
   aria-selected, :has(input:checked) and a plain .is-selected, so whichever
   the control sets, the visual follows. */

/* ---- buttons, with the busy and done states drawn in CSS (no image, no glyph) ---- */
.yf-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 44px; padding: 0.8em 1.4em; border-radius: var(--yf-radius-pill); border: 1.5px solid transparent;
  font-family: var(--yf-font-body); font-weight: 700; font-size: 15px; line-height: 1.25; text-align: center; cursor: pointer;
  transition: transform var(--yf-dur-1) var(--yf-ease), opacity var(--yf-dur-1) var(--yf-ease);
}
.yf-btn:active:not(:disabled) { transform: scale(0.98); }
.yf-btn:disabled { opacity: 0.5; cursor: default; }
.yf-btn--primary { background: var(--yf-action); border-color: var(--yf-action); color: var(--yf-action-ink); }
.yf-btn--primary:hover:not(:disabled), .yf-btn--primary:focus-visible { background: var(--yf-action-hover); border-color: var(--yf-action-hover); }
.yf-btn--ghost { background: transparent; border-color: var(--yf-line-strong); color: var(--yf-ink); }
.yf-btn--ghost:hover:not(:disabled), .yf-btn--ghost:focus-visible { border-color: var(--yf-ink-soft); }
.yf-btn--quiet { background: transparent; border-color: transparent; color: var(--yf-ink-soft); }
.yf-btn--quiet:hover:not(:disabled), .yf-btn--quiet:focus-visible { color: var(--yf-ink); text-decoration: underline; }

.yf-btn.is-busy, .yf-btn[aria-busy="true"], .yf-btn.is-done { color: transparent; pointer-events: none; }
.yf-btn.is-done { opacity: 1; }
.yf-btn.is-busy:not(.is-done)::after, .yf-btn[aria-busy="true"]:not(.is-done)::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--yf-ink-soft); border-top-color: transparent; animation: yf-spin 0.7s linear infinite;
}
.yf-btn--primary.is-busy:not(.is-done)::after, .yf-btn--primary[aria-busy="true"]:not(.is-done)::after { border-color: var(--yf-action-ink); border-top-color: transparent; }
.yf-btn.is-done::after {
  content: ""; position: absolute; width: 13px; height: 7px;
  border-left: 2px solid var(--yf-ink-soft); border-bottom: 2px solid var(--yf-ink-soft); transform: translateY(-2px) rotate(-45deg);
}
.yf-btn--primary.is-done::after { border-color: var(--yf-action-ink); }
.yf-btn__label { min-width: 0; }
.yf[data-motion="off"] .yf-btn.is-busy::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .yf-btn.is-busy::after { animation: none; } }
@keyframes yf-spin { to { transform: rotate(360deg); } }

/* ---- text fields ---- */
.yf-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.yf-label { font-size: 13px; font-weight: 700; color: var(--yf-ink-soft); }
.yf-input {
  min-height: 44px; width: 100%; padding: 0 14px; border-radius: var(--yf-radius-control); border: 1.5px solid var(--yf-line-strong);
  background: var(--yf-surface); color: var(--yf-ink); font-family: var(--yf-font-body); font-size: 16px; line-height: 1.4;
}
.yf-input:where(textarea) { min-height: 96px; padding: 10px 14px; resize: vertical; }
.yf-input::placeholder { color: var(--yf-muted); opacity: 1; }
.yf-input:focus-visible { border-color: var(--yf-action); }
.yf-input[aria-invalid="true"] { border-color: var(--yf-danger); }
.yf-hint { margin: 0; font-size: 12.5px; color: var(--yf-muted); }
.yf-error { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--yf-danger); }

/* ---- chips ---- */
.yf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.yf-chip {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: var(--yf-radius-pill);
  border: 1.5px solid var(--yf-line-strong); background: var(--yf-surface); color: var(--yf-ink);
  font-size: 14px; font-weight: 700; cursor: pointer; transition: transform var(--yf-dur-1) var(--yf-ease);
}
.yf-chip:active:not(:disabled) { transform: scale(0.98); }
.yf-chip[aria-pressed="true"], .yf-chip.is-selected {
  background: var(--yf-action); border-color: var(--yf-action); color: var(--yf-action-ink); box-shadow: inset 0 0 0 1.5px var(--yf-action-ink);
}

/* ---- option rows: radio and checkbox lists, and the tasting times ---- */
.yf-option {
  position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 12px 14px; margin-bottom: 8px;
  border-radius: var(--yf-radius-control); border: 1.5px solid var(--yf-line-strong); background: var(--yf-surface); cursor: pointer;
  transition: transform var(--yf-dur-1) var(--yf-ease);
}
.yf-option:active { transform: scale(0.98); }
.yf-option input { margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--yf-action); }
.yf-option__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yf-option__title { font-weight: 700; font-size: 15px; color: var(--yf-ink); }
.yf-option__detail { font-size: 13px; color: var(--yf-muted); }
.yf-option__aside { flex: none; align-self: center; font-weight: 700; font-size: 14px; color: var(--yf-ink); }
/* A chosen row reads as border, inset ring and tint together, not one of the three.
   Two rules, so a browser without :has() still honours .is-selected. */
.yf-option.is-selected { border-color: var(--yf-action); background: var(--yf-ground-2); box-shadow: inset 0 0 0 1.5px var(--yf-action); }
.yf-option:has(input:checked) { border-color: var(--yf-action); background: var(--yf-ground-2); box-shadow: inset 0 0 0 1.5px var(--yf-action); }
.yf-option:has(input:focus-visible) { outline: 2.5px solid var(--yf-focus); outline-offset: 2px; }
.yf-option:has(input:disabled) { opacity: 0.5; cursor: default; }
@container yf (max-width: 320px) {
  .yf-option { flex-wrap: wrap; }
  .yf-option__aside { flex-basis: 100%; margin-left: 30px; align-self: flex-start; }
}

/* ---- stepper ---- */
.yf-stepper { display: inline-flex; align-items: center; gap: 14px; }
.yf-stepper__btn {
  width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 1.5px solid var(--yf-line-strong); background: var(--yf-surface); color: var(--yf-ink); padding: 0; cursor: pointer;
  transition: transform var(--yf-dur-1) var(--yf-ease), opacity var(--yf-dur-1) var(--yf-ease);
}
.yf-stepper__btn:hover:not(:disabled) { border-color: var(--yf-ink-soft); }
.yf-stepper__btn:active:not(:disabled) { transform: scale(0.98); }
.yf-stepper__btn:disabled { opacity: 0.4; cursor: default; }
.yf-stepper__value { min-width: 2.5ch; text-align: center; font-size: 18px; font-weight: 700; color: var(--yf-ink); font-variant-numeric: tabular-nums; }

/* ---- tabs: menus and days ---- */
/* A row that scrolls sideways clips whatever sticks out of it, so the chosen tab's underline (which reaches
   1.5px below the row) gets 2px of room, and a tab's focus ring is drawn inside the tab's own padding. The
   thin selection marks use --wp-accent, which reads at 4.5:1 on every surface; --yf-action is for fills. */
.yf-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; border-bottom: 1.5px solid var(--yf-line); scrollbar-width: none; }
.yf-tabs::-webkit-scrollbar { display: none; }
.yf-tab {
  flex: none; min-height: 44px; padding: 10px 16px; margin-bottom: -1.5px; background: transparent; border: none; border-bottom: 2.5px solid transparent;
  font-size: 14px; font-weight: 700; color: var(--yf-muted); cursor: pointer; transition: transform var(--yf-dur-1) var(--yf-ease);
}
.yf-tab:active { transform: scale(0.98); }
.yf .yf-tab:focus-visible { outline-offset: -4px; }
.yf-tab[aria-selected="true"] { color: var(--yf-ink); border-bottom-color: var(--wp-accent); }
.yf-tab__label { display: block; }
.yf-tab__sublabel { display: block; font-size: 12px; font-weight: 600; color: var(--yf-muted); }

/* ---- links: inline in a sentence, or a button that reads as one ---- */
.yf-link { color: var(--yf-ink); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.25em; cursor: pointer; }
.yf-link:hover { color: var(--yf-signature-deep); }
.yf-link:where(button) { display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0; background: none; border: none; font-size: 14px; }

/* ---- the sheet: a bottom sheet on a phone, a side panel from 768 px ---- */
.yf-sheet { position: fixed; inset: 0; z-index: 40; opacity: 0; transition: opacity var(--yf-dur-3) var(--yf-ease); }
.yf-sheet.is-open { opacity: 1; }
.yf-sheet__backdrop { position: absolute; inset: 0; background: var(--yf-backdrop); }
.yf-sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 85%; overflow-y: auto; background: var(--yf-surface); color: var(--yf-ink);
  border-radius: var(--yf-radius) var(--yf-radius) 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform var(--yf-dur-3) var(--yf-ease);
}
.yf-sheet.is-open .yf-sheet__panel { transform: translateY(0); }
.yf-sheet__title { margin: 0 56px 14px 0; font-family: var(--yf-font-display); font-weight: var(--yf-weight-display); font-size: 19px; }
.yf-sheet__close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  padding: 0; border-radius: 50%; border: 1.5px solid var(--yf-line-strong); background: transparent; color: var(--yf-ink-soft); cursor: pointer;
  transition: transform var(--yf-dur-1) var(--yf-ease);
}
.yf-sheet__close:hover, .yf-sheet__close:focus-visible { color: var(--yf-ink); border-color: var(--yf-ink-soft); }
.yf-sheet__close:active { transform: scale(0.98); }
@media (min-width: 768px) {
  .yf-sheet__panel { left: auto; top: 0; width: min(420px, 90%); max-height: none; border-radius: var(--yf-radius) 0 0 var(--yf-radius); transform: translateX(100%); }
  .yf-sheet.is-open .yf-sheet__panel { transform: translateX(0); }
}

/* ---- forced colours: keep every control's edge visible, and say which one is chosen ---- */
@media (forced-colors: active) {
  .yf-btn, .yf-chip, .yf-option, .yf-tab, .yf-stepper__btn, .yf-input, .yf-sheet__close { border: 1.5px solid ButtonText; }
  .yf-btn:disabled, .yf-stepper__btn:disabled { border-color: GrayText; }
  .yf-chip[aria-pressed="true"], .yf-tab[aria-selected="true"], .yf-option.is-selected { border-color: Highlight; }
  .yf-option:has(input:checked) { border-color: Highlight; }
}
