@import url("../tokens/fonts.css");

/* ==========================================================================
   Wayfinder — transit & wayfinding signage
   Every colour, radius, space and shadow comes from tokens.css.
   Motion lives here. Animate transform and opacity only.
   ========================================================================== */

:root {
  --wf-snap: cubic-bezier(.2, .9, .3, 1);          /* most travel: fast out, settles */
  --wf-shutter: cubic-bezier(.3, .8, .25, 1.12);   /* shutters, indicators: tiny mechanical overshoot */
  --wf-pop: cubic-bezier(.34, 1.5, .6, 1);         /* roundels, chips, ticks: pop in */
  --wf-fold-in: cubic-bezier(.55, 0, .9, .45);     /* flap leaf falling */
  --wf-fold-out: cubic-bezier(.1, .55, .45, 1);    /* flap leaf landing */
  --wf-t-press: 120ms;
  --wf-t-quick: 180ms;
  --wf-t-move: 260ms;
  --wf-t-enter: 320ms;
  --wf-t-glint: 400ms;
  --wf-t-flap: 180ms;
  --wf-hair: color-mix(in oklab, var(--ink) 14%, transparent);
  --wf-well: color-mix(in oklab, var(--ink) 7%, var(--board));
  --wf-glint: #ffffff8c;
  color-scheme: light;
}
[data-theme="dark"] { color-scheme: dark; --wf-glint: #ffffff1f; }

body {
  margin: 0; background: var(--board); color: var(--ink);
  font-family: var(--font-sign); font-size: 16px; line-height: 24px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* ---------- helpers ---------- */
.wf-stage { box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); padding: var(--space-6); }
.wf-stage--top { align-items: flex-start; }
.wf-col { display: flex; flex-direction: column; gap: var(--space-3); }
.wf-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.wf-spacer { flex: 1; }
.wf-label { font-family: var(--font-sign); font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.wf-display { margin: 0; font-size: 44px; line-height: 48px; font-weight: 800; letter-spacing: -.01em; }
.wf-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.005em; }
.wf-small { margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-soft); }
.wf-p { margin: 0; }
.wf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.wf-icon { width: 20px; height: 20px; flex: none; display: block; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
:where(.wf-btn, .wf-iconbtn, .wf-tabs__opt, .wf-toggle input, .wf-check input, .wf-field input):focus-visible { outline: none; }

/* focus: an ink ring with a board gap, like a sign's keyline */
.wf-btn:focus-visible, .wf-iconbtn:focus-visible, .wf-tabs__opt:focus-visible,
.wf-toggle input:focus-visible + .wf-toggle__track,
.wf-check input:focus-visible + .wf-check__box { box-shadow: 0 0 0 2px var(--board), 0 0 0 4px var(--ink) !important; }

/* ---------- Button: an enamel plate that sinks 2px ---------- */
.wf-btn {
  --wf-fill: var(--panel); --wf-fg: var(--ink); --wf-sh: var(--shadow-plate-soft);
  position: relative; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 44px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-md);
  background: var(--wf-fill); color: var(--wf-fg); box-shadow: var(--wf-sh);
  font: 700 13px/16px var(--font-sign); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transform: translateY(0); transition: transform var(--wf-t-press) var(--wf-snap);
}
.wf-btn .wf-btn__label { padding-top: 2px; }
.wf-btn--primary { --wf-fill: var(--ink); --wf-fg: var(--board); --wf-sh: var(--shadow-plate); }
.wf-btn--danger { --wf-fill: var(--line-red); --wf-fg: var(--white); --wf-sh: inset 0 1px 0 #ffffff40, 0 3px 0 color-mix(in oklab, var(--line-red) 55%, #000), 0 6px 10px -6px #00000080; }
.wf-btn--ghost { --wf-fill: transparent; --wf-sh: none; }
.wf-btn--sm { height: 36px; padding: 0 var(--space-3); font-size: 12px; }
.wf-btn--lg { height: 52px; padding: 0 var(--space-6); font-size: 14px; }
.wf-btn--block { display: flex; width: 100%; }
@media (hover: hover) {
  .wf-btn:not(:disabled):hover { transform: translateY(-1px); }
  .wf-btn--ghost:not(:disabled):hover { background: var(--wf-well); }
}
.wf-btn:not(:disabled):active, .wf-btn.is-pressed { transform: translateY(2px); box-shadow: var(--shadow-pressed); }
.wf-btn--ghost:not(:disabled):active, .wf-btn--ghost.is-pressed { box-shadow: none; background: var(--wf-hair); }
.wf-btn:disabled { cursor: not-allowed; --wf-fill: var(--wf-well); --wf-fg: var(--ink-soft); --wf-sh: inset 0 0 0 1px var(--wf-hair); }

/* ---------- IconButton ---------- */
.wf-iconbtn { width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-md); display: inline-grid; place-items: center;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow-plate-soft); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform var(--wf-t-press) var(--wf-snap); position: relative; }
.wf-iconbtn--primary { background: var(--ink); color: var(--board); box-shadow: var(--shadow-plate); }
.wf-iconbtn--ghost { background: transparent; box-shadow: none; }
.wf-iconbtn--sm { width: 36px; height: 36px; }
.wf-iconbtn--sm .wf-icon { width: 18px; height: 18px; }
.wf-iconbtn--round { border-radius: var(--radius-full); }
.wf-iconbtn[aria-pressed="true"] { background: var(--line-yellow); color: var(--navy); }
.wf-iconbtn .wf-icon { transition: transform var(--wf-t-move) var(--wf-pop); }
.wf-iconbtn.is-bumped .wf-icon { animation: wf-pop var(--wf-t-enter) var(--wf-pop); }
@media (hover: hover) { .wf-iconbtn:not(:disabled):hover { transform: translateY(-1px); } .wf-iconbtn--ghost:not(:disabled):hover { background: var(--wf-well); } }
.wf-iconbtn:not(:disabled):active, .wf-iconbtn.is-pressed { transform: translateY(2px); box-shadow: var(--shadow-pressed); }
.wf-iconbtn--ghost:active { box-shadow: none; background: var(--wf-hair); }
.wf-iconbtn:disabled { cursor: not-allowed; background: var(--wf-well); color: var(--ink-soft); box-shadow: none; }
.wf-iconbtn > .wf-badge { position: absolute; top: -6px; right: -6px; }

/* ---------- Toggle: a sign shutter ---------- */
.wf-toggle { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; position: relative; user-select: none; }
.wf-toggle__track { position: relative; width: 64px; height: 32px; flex: none; border-radius: 6px; overflow: hidden;
  background: var(--wf-well); box-shadow: inset 0 2px 3px #0b18302e, inset 0 0 0 1px var(--wf-hair);
  font: 700 11px/32px var(--font-sign); letter-spacing: .08em; transition: background-color var(--wf-t-quick); }
.wf-toggle__on, .wf-toggle__off { position: absolute; top: 1px; width: 32px; text-align: center; }
.wf-toggle__on { left: 0; color: var(--white); }
.wf-toggle__off { right: 0; color: var(--ink-soft); }
.wf-toggle__shutter { position: absolute; top: 3px; left: 3px; width: 28px; height: 26px; border-radius: 4px; background: var(--panel); box-shadow: var(--shadow-plate-soft);
  transition: transform var(--wf-t-move) var(--wf-shutter);
  background-image: repeating-linear-gradient(180deg, transparent 0 5px, var(--wf-hair) 5px 6px); background-size: 14px 18px; background-position: center; background-repeat: no-repeat; }
.wf-toggle input:checked + .wf-toggle__track { background: var(--line-green); }
.wf-toggle input:checked + .wf-toggle__track .wf-toggle__shutter { transform: translateX(30px); }
.wf-toggle input:active + .wf-toggle__track .wf-toggle__shutter { box-shadow: var(--shadow-pressed); }
.wf-toggle input:disabled + .wf-toggle__track { opacity: .5; }
.wf-toggle:has(input:disabled) { cursor: not-allowed; }
.wf-toggle__text { font-size: 16px; line-height: 24px; }

/* ---------- Checkbox & Radio ---------- */
.wf-check { display: inline-flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; position: relative; user-select: none; }
.wf-check__box { width: 22px; height: 22px; flex: none; box-sizing: border-box; margin-top: 1px; border: 2px solid var(--ink-soft); border-radius: var(--radius-sm);
  background: var(--panel); display: grid; place-items: center; color: var(--board); transition: transform var(--wf-t-press) var(--wf-snap); }
.wf-check__box .wf-icon { width: 16px; height: 16px; stroke-width: 3; transform: scale(0); opacity: 0; transition: transform var(--wf-t-move) var(--wf-pop), opacity var(--wf-t-press); }
.wf-check input:checked + .wf-check__box { background: var(--ink); border-color: var(--ink); }
.wf-check input:checked + .wf-check__box .wf-icon { transform: scale(1); opacity: 1; }
.wf-check:active .wf-check__box { transform: scale(.9); }
.wf-check--radio .wf-check__box { border-radius: var(--radius-full); }
.wf-check__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--board); transform: scale(0); transition: transform var(--wf-t-move) var(--wf-pop); }
.wf-check--radio input:checked + .wf-check__box .wf-check__dot { transform: scale(1); }
.wf-check input:disabled + .wf-check__box { opacity: .45; }
.wf-check:has(input:disabled) { cursor: not-allowed; color: var(--ink-soft); }
.wf-check__text { display: flex; flex-direction: column; }
.wf-check__hint { font-size: 14px; line-height: 20px; color: var(--ink-soft); }
.wf-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.wf-fieldset > legend { padding: 0; margin-bottom: var(--space-3); }

/* ---------- TextField ---------- */
.wf-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.wf-field__box { display: flex; align-items: center; gap: var(--space-2); height: 48px; padding: 0 var(--space-3); box-sizing: border-box;
  background: var(--panel); border-radius: var(--radius-md); box-shadow: inset 0 0 0 1.5px var(--ink-soft), inset 0 2px 2px #0b183014; color: var(--ink-soft); }
.wf-field__box:focus-within { box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 3px color-mix(in oklab, var(--line-sky) 45%, transparent); color: var(--ink); }
.wf-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 16px/24px var(--font-sign); padding: 2px 0 0; }
.wf-field input::placeholder { color: var(--ink-soft); opacity: 1; }
.wf-field__msg { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-soft); }
.wf-field.is-error .wf-field__box { box-shadow: inset 0 0 0 2px var(--line-red); }
.wf-field.is-error .wf-field__msg { color: var(--ink); animation: wf-rise var(--wf-t-move) var(--wf-snap); }
.wf-field__err { width: 20px; height: 20px; border-radius: var(--radius-sm); background: var(--line-red); color: var(--white); display: grid; place-items: center; flex: none; }
.wf-field__err .wf-icon { width: 14px; height: 14px; stroke-width: 2.6; }
.wf-field.is-error .wf-field__box { animation: wf-nudge 300ms var(--wf-snap); }

/* ---------- Tabs (segmented + line) ---------- */
.wf-tabs { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 4px; border-radius: var(--radius-md);
  background: var(--wf-well); box-shadow: inset 0 2px 3px #0b183024, inset 0 0 0 1px var(--wf-hair); }
.wf-tabs__ind { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 6px; background: var(--ink); box-shadow: 0 2px 0 #0b183059;
  transition: transform var(--wf-t-move) var(--wf-shutter); }
.wf-tabs__opt { position: relative; z-index: 1; height: 36px; padding: 2px var(--space-4) 0; border: 0; background: none; border-radius: 6px; cursor: pointer;
  font: 700 13px/16px var(--font-sign); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap;
  transition: color var(--wf-t-quick); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
.wf-tabs__opt[aria-selected="true"] { color: var(--board); }
.wf-tabs__opt:active { transform: translateY(1px); }
.wf-tabs--block { display: grid; width: 100%; }
.wf-tabs--line { display: flex; gap: var(--space-6); padding: 0; background: none; box-shadow: inset 0 -2px 0 var(--wf-hair); border-radius: 0; }
.wf-tabs--line .wf-tabs__opt { padding: 2px 0 0; height: 44px; }
.wf-tabs--line .wf-tabs__opt[aria-selected="true"] { color: var(--ink); }
.wf-tabs--line .wf-tabs__ind { top: auto; bottom: 0; left: 0; width: 1px; height: 4px; border-radius: 0; box-shadow: none; transform-origin: 0 0; }
.wf-tabs__count { min-width: 20px; height: 20px; border-radius: var(--radius-sm); background: var(--wf-hair); font-size: 11px; line-height: 21px; letter-spacing: 0; }

/* ---------- Card: an enamel panel with a glint ---------- */
.wf-card { position: relative; box-sizing: border-box; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6);
  background: var(--panel); color: var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel), inset 0 1px 0 var(--wf-glint); min-width: 0; }
.wf-card--line { padding-top: calc(var(--space-6) + 8px); }
.wf-card__band { position: absolute; left: 0; right: 0; top: 0; height: 8px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--wf-line, var(--ink)); }
.wf-card__head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.wf-card__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wf-card__titles .wf-title { overflow-wrap: anywhere; }
.wf-card__actions { display: flex; gap: var(--space-2); flex: none; }
.wf-card--interactive { cursor: pointer; transition: transform var(--wf-t-move) var(--wf-snap); }
@media (hover: hover) { .wf-card--interactive:hover { transform: translateY(-2px); } }
.wf-card--interactive:active { transform: translateY(1px); }
.wf-glint { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.wf-glint::before { content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent 0%, var(--wf-glint) 50%, transparent 100%);
  transform: translateX(-120%) skewX(-12deg); opacity: 0; }
@media (hover: hover) {
  .wf-card:hover > .wf-glint::before, .wf-glinty:hover > .wf-glint::before { transform: translateX(260%) skewX(-12deg); opacity: 1;
    transition: transform var(--wf-t-glint) var(--wf-snap), opacity 120ms; }
}

/* ---------- Badge, Tag, Roundel ---------- */
.wf-line-yellow { --wf-line: var(--line-yellow); --wf-on: var(--navy); }
.wf-line-sky    { --wf-line: var(--line-sky);    --wf-on: var(--navy); }
.wf-line-orange { --wf-line: var(--line-orange); --wf-on: var(--navy); }
.wf-line-green  { --wf-line: var(--line-green);  --wf-on: var(--white); }
.wf-line-red    { --wf-line: var(--line-red);    --wf-on: var(--white); }
.wf-line-violet { --wf-line: var(--line-violet); --wf-on: var(--white); }
.wf-line-ink    { --wf-line: var(--ink);         --wf-on: var(--board); }
.wf-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 2px 10px 0; box-sizing: border-box; border-radius: var(--radius-sm);
  background: var(--wf-line, var(--ink)); color: var(--wf-on, var(--board)); font: 700 12px/16px var(--font-sign); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.wf-tag .wf-icon { width: 14px; height: 14px; stroke-width: 2.6; margin-top: -2px; }
.wf-tag--outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--wf-hair); padding-left: 8px; }
.wf-tag--outline::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--wf-line, var(--ink)); margin-top: -2px; }
.wf-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 1px 6px 0; box-sizing: border-box; border-radius: var(--radius-sm);
  background: var(--wf-line, var(--line-red)); color: var(--wf-on, var(--white)); font: 700 12px/1 var(--font-flap); box-shadow: 0 0 0 2px var(--board); }
.wf-roundel { --wf-size: 32px; width: var(--wf-size); height: var(--wf-size); border-radius: 50%; display: inline-grid; place-items: center; flex: none; box-sizing: border-box;
  background: var(--wf-line, var(--ink)); color: var(--wf-on, var(--board)); font: 800 calc(var(--wf-size) * .47)/1 var(--font-sign); padding-top: calc(var(--wf-size) * .06); }
.wf-roundel--ring { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 calc(var(--wf-size) * .14) var(--wf-line, var(--ink)); }
.wf-roundel--sm { --wf-size: 24px; } .wf-roundel--lg { --wf-size: 48px; }
.wf-roundel .wf-icon { width: 56%; height: 56%; margin-top: -6%; stroke-width: 2.6; }
.wf-pop { animation: wf-pop var(--wf-t-enter) var(--wf-pop) both; }

/* ---------- Avatar ---------- */
.wf-avatar { --wf-size: 40px; position: relative; width: var(--wf-size); height: var(--wf-size); flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--wf-line, var(--ink)); color: var(--wf-on, var(--board)); font: 800 calc(var(--wf-size) * .38)/1 var(--font-sign); padding-top: 2px; box-sizing: border-box; }
.wf-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.wf-avatar--sm { --wf-size: 32px; } .wf-avatar--lg { --wf-size: 56px; }
.wf-avatar__status { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 3px; background: var(--line-green); box-shadow: 0 0 0 2px var(--panel); }
.wf-avatar__status--away { background: var(--line-yellow); } .wf-avatar__status--busy { background: var(--line-red); } .wf-avatar__status--off { background: var(--ink-soft); }
.wf-avatars { display: inline-flex; }
.wf-avatars > * { box-shadow: 0 0 0 2px var(--panel); }
.wf-avatars > * + * { margin-left: -10px; }

/* ---------- Toast ---------- */
.wf-toasts { position: fixed; z-index: 60; right: var(--space-6); bottom: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); width: min(380px, calc(100vw - 32px)); pointer-events: none; }
@media (max-width: 560px) { .wf-toasts { right: 16px; bottom: 16px; } }
.wf-toast { position: relative; display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-3) var(--space-4) calc(var(--space-4) + 6px);
  background: var(--panel); color: var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-float); pointer-events: auto; overflow: hidden;
  animation: wf-toast-in var(--wf-t-enter) var(--wf-snap) both; }
.wf-toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--wf-line, var(--ink)); }
.wf-toast__body { flex: 1; min-width: 0; padding-top: 2px; }
.wf-toast__title { margin: 0; font-weight: 700; font-size: 16px; line-height: 22px; }
.wf-toast.is-leaving { animation: wf-toast-out var(--wf-t-quick) ease-in both; }

/* ---------- Modal ---------- */
.wf-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--space-4); background: #0b1830a6; animation: wf-fade var(--wf-t-quick) ease-out both; }
.wf-overlay.is-leaving { animation: wf-fade var(--wf-t-quick) ease-in reverse both; }
.wf-modal { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box; background: var(--panel); color: var(--ink);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-float); }
.wf-overlay .wf-modal { animation: wf-rise var(--wf-t-enter) var(--wf-snap) both; }
.wf-overlay.is-leaving .wf-modal { animation: wf-sink var(--wf-t-quick) ease-in both; }
.wf-modal__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-4) var(--space-6); background: var(--ink); color: var(--board); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.wf-modal__head .wf-title { flex: 1; padding-top: 3px; }
.wf-modal__head .wf-iconbtn { background: transparent; color: var(--board); box-shadow: none; }
.wf-modal__head .wf-iconbtn:hover { background: color-mix(in oklab, var(--board) 14%, transparent); }
.wf-modal__body { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.wf-modal__foot { display: flex; justify-content: flex-end; gap: var(--space-3); padding: 0 var(--space-6) var(--space-6); flex-wrap: wrap; }

/* ---------- Progress: a route line ---------- */
.wf-route { --wf-dot: 18px; list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.wf-route__stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; min-width: 0; }
.wf-route__seg { position: absolute; top: calc(var(--wf-dot) / 2 - 3px); left: -50%; width: 100%; height: 6px; background: var(--wf-hair); overflow: hidden; }
.wf-route__stop:first-child .wf-route__seg { display: none; }
.wf-route__seg::after { content: ""; position: absolute; inset: 0; background: var(--wf-line, var(--ink)); transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--wf-t-move) var(--wf-snap); transition-delay: var(--wf-delay, 0ms); }
.wf-route__dot { position: relative; z-index: 1; width: var(--wf-dot); height: var(--wf-dot); box-sizing: border-box; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 3px var(--wf-hair); display: grid; place-items: center; }
.wf-route__dot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 4px var(--wf-line, var(--ink)); transform: scale(.3); opacity: 0;
  transition: transform var(--wf-t-move) var(--wf-pop), opacity var(--wf-t-press); transition-delay: var(--wf-delay, 0ms); }
.wf-route__stop.is-done .wf-route__seg::after { transform: scaleX(1); }
.wf-route__stop.is-done .wf-route__dot::before { transform: scale(1); opacity: 1; }
.wf-route__stop.is-current .wf-route__dot::before { background: var(--wf-line, var(--ink)); box-shadow: inset 0 0 0 4px var(--wf-line, var(--ink)), 0 0 0 4px color-mix(in oklab, var(--wf-line, var(--ink)) 30%, transparent); transform: scale(1.25); }
.wf-route__name { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--ink-soft); overflow-wrap: anywhere; padding: 0 2px; }
.wf-route__stop.is-done .wf-route__name { color: var(--ink); }
.wf-route__stop.is-current .wf-route__name { font-weight: 800; color: var(--ink); }
.wf-bar { display: flex; flex-direction: column; gap: var(--space-2); }
.wf-bar__top { display: flex; justify-content: space-between; gap: var(--space-3); }
.wf-bar__val { font: 600 14px/20px var(--font-flap); font-variant-numeric: tabular-nums; }
.wf-bar__track { position: relative; height: 10px; border-radius: 3px; background: var(--wf-well); box-shadow: inset 0 1px 2px #0b183024; overflow: hidden;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--panel) calc(10% - 2px) 10%); }
.wf-bar__fill { position: absolute; inset: 0; background: var(--wf-line, var(--ink)); transform-origin: 0 50%; transform: scaleX(var(--wf-v, 0)); transition: transform var(--wf-t-enter) var(--wf-snap); }

/* ---------- SplitFlap ---------- */
.wf-flap { --wf-fs: 24px; display: inline-flex; gap: 3px; font: 600 var(--wf-fs)/1 var(--font-flap); font-variant-numeric: tabular-nums; vertical-align: middle; }
.wf-flap--sm { --wf-fs: 15px; gap: 2px; } .wf-flap--lg { --wf-fs: 40px; gap: 4px; }
.wf-flap__cell { position: relative; width: .92em; height: 1.4em; perspective: 6em; border-radius: max(3px, .1em); color: var(--flap-ink); }
.wf-flap__half, .wf-flap__leaf { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; background: var(--wf-tile, var(--flap)); backface-visibility: hidden; }
.wf-flap__half--top, .wf-flap__leaf--top { top: 0; border-radius: max(3px, .1em) max(3px, .1em) 0 0; transform-origin: 50% 100%;
  background: linear-gradient(180deg, color-mix(in oklab, var(--wf-tile, var(--flap)) 88%, #fff), var(--wf-tile, var(--flap))); }
.wf-flap__half--bot, .wf-flap__leaf--bot { bottom: 0; border-radius: 0 0 max(3px, .1em) max(3px, .1em); transform-origin: 50% 0; }
.wf-flap__half > span, .wf-flap__leaf > span { position: absolute; left: 0; right: 0; height: 1.4em; line-height: 1.48em; text-align: center; }
.wf-flap__half--bot > span, .wf-flap__leaf--bot > span { top: -.7em; }
.wf-flap__cell::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - .5px); height: 1px; background: #0000008c; z-index: 3; }
.wf-flap__leaf { z-index: 2; visibility: hidden; }
.wf-flap__cell.is-flipping .wf-flap__leaf { visibility: visible; }
.wf-flap__cell.is-flipping .wf-flap__leaf--top { animation: wf-fold-top var(--wf-t-flap) var(--wf-fold-in) both; }
.wf-flap__cell.is-flipping .wf-flap__leaf--bot { animation: wf-fold-bot var(--wf-t-flap) var(--wf-fold-out) both; }
.wf-flap__cell.is-blank > * > span { opacity: 0; }

/* ---------- widgets ---------- */
.wf-widget { width: 100%; max-width: 640px; container-type: inline-size; }
.wf-board { display: flex; flex-direction: column; border-radius: var(--radius-md); background: var(--flap); color: var(--flap-ink); padding: var(--space-2) var(--space-4); }
.wf-board__row { display: grid; grid-template-columns: auto 28px minmax(0, 1fr) 44px auto; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid color-mix(in oklab, var(--flap-ink) 16%, transparent); }
.wf-board__row--head { border-top: 0; padding: var(--space-2) 0 var(--space-1); font: 700 11px/16px var(--font-sign); letter-spacing: .08em; text-transform: uppercase; color: color-mix(in oklab, var(--flap-ink) 75%, var(--flap)); }
.wf-board__row--head > :nth-child(1) { grid-column: 1; } .wf-board__row--head > :nth-child(2) { grid-column: 3; } .wf-board__row--head > :nth-child(3) { grid-column: 4; text-align: center; } .wf-board__row--head > :nth-child(4) { grid-column: 5; }
.wf-board__what { min-width: 0; display: flex; flex-direction: column; }
.wf-board__title { font-weight: 700; font-size: 16px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 2px; }
.wf-board__meta { font-size: 13px; line-height: 18px; color: color-mix(in oklab, var(--flap-ink) 78%, var(--flap)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-board__ref { font: 700 18px/1 var(--font-flap); text-align: center; }
.wf-board__status { display: flex; align-items: center; gap: 6px; }
.wf-board__lamp { width: 8px; height: 22px; border-radius: 2px; background: var(--wf-line, var(--line-green)); transition: background-color var(--wf-t-quick); }
.wf-board .wf-flap { --wf-tile: color-mix(in oklab, var(--flap) 78%, #000); }
[data-theme="dark"] .wf-board { background: color-mix(in oklab, var(--flap) 55%, #000); } [data-theme="dark"] .wf-board .wf-flap { --wf-tile: var(--flap); }
@container (max-width: 470px) {
  .wf-board__row { grid-template-columns: auto 24px minmax(0, 1fr); row-gap: var(--space-2); }
  .wf-board__ref, .wf-board__row--head > :nth-child(3), .wf-board__row--head > :nth-child(4) { display: none; }
  .wf-board__status { grid-column: 3; }
  .wf-board__row .wf-roundel { --wf-size: 24px; }
}
.wf-stat__value { display: flex; align-items: flex-end; gap: var(--space-2); flex-wrap: wrap; }
.wf-stat__unit { font-size: 16px; line-height: 24px; font-weight: 700; color: var(--ink-soft); padding-bottom: 4px; }
.wf-stat__foot { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.wf-spark { display: block; width: 100%; height: 64px; overflow: visible; }
.wf-spark__line { fill: none; stroke: var(--wf-line, var(--ink)); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.wf-spark__stop { fill: var(--panel); stroke: var(--wf-line, var(--ink)); stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: wf-pop var(--wf-t-enter) var(--wf-pop) both; }
.wf-spark__stop--end { fill: var(--wf-line, var(--ink)); }

/* ---------- keyframes ---------- */
@keyframes wf-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes wf-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wf-sink { to { transform: translateY(12px); opacity: 0; } }
@keyframes wf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wf-toast-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wf-toast-out { to { transform: translateX(24px); opacity: 0; } }
@keyframes wf-nudge { 0%, 100% { transform: none; } 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }
@keyframes wf-fold-top { 0% { transform: rotateX(0); } 50%, 100% { transform: rotateX(-90deg); } }
@keyframes wf-fold-bot { 0%, 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .wf-btn:active, .wf-btn.is-pressed, .wf-iconbtn:active, .wf-btn:hover, .wf-iconbtn:hover, .wf-card--interactive:hover { transform: none !important; }
  .wf-glint { display: none; }
}
