/* YEC Portal design system: the component layer.
   Every color, size and space here is a token from tokens.css, so a theme
   change (html[data-theme="dark"]) or an accent swap needs no edit below.
   Class prefix y-. Breakpoints are literal (CSS cannot read a custom
   property in a media query): 700 = tables stack, 900 = phone shell,
   1200 = two columns. Square is the brand: radius-0 unless noted. */

/* ---------- base ---------- */
:where([class*="y-"]), :where([class*="y-"])::before, :where([class*="y-"])::after { box-sizing: border-box; }
/* Shipped copy (S1-04): no preview helpers (.y-stack stays: the boards lay pages out with it), and no
   light body rule, so legacy pages keep today's type. Dark pages still get a dark ground over
   chrome.css body.pshell cream (INTEGRATION.md #1). */
[data-theme="dark"] body, [data-theme="dark"] body.pshell { background: var(--bg); color: var(--ink); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* On navy (sidebar, drawer, toast) the teal ring fails 3:1; use the accent or on-strong there. */
.y-side :focus-visible, .y-drawer :focus-visible { outline-color: var(--accent); }
.y-toast :focus-visible { outline-color: var(--on-strong); }
.y-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.y-icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.y-icon--sm { width: 16px; height: 16px; }
.y-icon--lg { width: 24px; height: 24px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; } }
/* Accessibility (Account page, js/members/theme.js sets these on <html>):
   Reduce motion does what the device setting does; Larger text scales the
   whole page 115% (zoom, so px type grows too; a full-screen sheet keeps to
   the screen); Underline links underlines every link in the content. */
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after { animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
html[data-text="large"] { zoom: 1.15; }
html[data-text="large"] .y-sheet--full { height: calc(100dvh / 1.15); max-height: calc(100dvh / 1.15); }
html[data-links="underline"] main a:not(.btn):not(.y-btn):not(.y-row):not(.y-card) { text-decoration: underline; text-underline-offset: 2px; }

.y-stack { display: flex; flex-direction: column; gap: var(--space-3); }

/* ---------- type ---------- */
.y-kicker { margin: 0; font: 600 12px/16px var(--font-kicker); letter-spacing: .14em; text-transform: uppercase; color: var(--kicker); }
.y-h1 { margin: 0; font: 600 23px/29px var(--font-sans); letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.y-h2 { margin: 0; font: 600 20px/26px var(--font-sans); color: var(--ink); text-wrap: balance; }
.y-h3 { margin: 0; font: 600 16px/22px var(--font-sans); color: var(--ink); }
.y-lead { margin: 0; font-size: 16px; line-height: 24px; color: var(--ink-2); max-width: var(--measure); }
.y-small { font-size: 14px; line-height: 20px; color: var(--ink-2); }
.y-meta { font: 500 12px/16px var(--font-kicker); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.y-text a, a.y-link { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (min-width: 901px) { .y-h1 { font-size: 28px; line-height: 34px; } }

/* ---------- page layout ---------- */
.y-page { max-width: var(--content-max); margin: 0 auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-6); container-type: inline-size; }
.y-page-head { display: flex; flex-direction: column; gap: var(--space-2); }
.y-form { max-width: var(--form-max); display: flex; flex-direction: column; gap: var(--space-5); }
.y-cols { display: grid; gap: var(--space-6); }
@container (min-width: 1100px) { .y-cols { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; } }
.y-grid { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@container (min-width: 620px) { .y-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 1000px) { .y-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 901px) { .y-page { padding: var(--space-6) var(--space-8); } }

/* ---------- buttons ---------- */
.y-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 var(--space-5);
  font: 600 13px/16px var(--font-kicker); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; border-radius: var(--radius-0); cursor: pointer; transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard); }
.y-btn--primary { background: var(--strong); color: var(--on-strong); }
.y-btn--primary:hover { background: color-mix(in srgb, var(--strong) 86%, var(--surface)); }
.y-btn--accent { background: var(--accent); color: var(--on-accent); }
.y-btn--accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--on-accent)); }
.y-btn--secondary { background: transparent; color: var(--ink); border-color: currentColor; }
.y-btn--quiet { background: var(--surface); color: var(--ink); border-color: var(--field-line); }
.y-btn--secondary:hover, .y-btn--quiet:hover { background: var(--raised); }
.y-btn--danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.y-btn--danger:hover { background: var(--tint-bad); }
.y-btn--link { min-height: var(--target-min); padding: 0; border: 0; background: none; color: var(--link); font: 600 16px/24px var(--font-sans); letter-spacing: 0; text-transform: none; text-decoration: underline; text-underline-offset: 3px; }
.y-btn--inline { min-height: auto; display: inline; font-size: inherit; }
.y-btn--sm { min-height: 36px; padding: 0 var(--space-4); font-size: 12px; }
.y-btn--block { width: 100%; }
.y-btn[disabled], .y-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.y-btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: var(--radius-full); animation: y-spin .8s linear infinite; }
@keyframes y-spin { to { transform: rotate(360deg); } }
@media (pointer: coarse), (max-width: 900px) { .y-btn--sm { min-height: var(--target-min); } }
@media (max-width: 600px) { .y-btn--block-phone { width: 100%; } .y-btn { white-space: normal; text-align: center; line-height: 18px; padding-top: 8px; padding-bottom: 8px; } }
.y-btn { max-width: 100%; }
.y-iconbtn { width: var(--target-min); height: var(--target-min); display: inline-grid; place-items: center; position: relative; background: none; border: 0; border-radius: var(--radius-0); color: inherit; cursor: pointer; text-decoration: none; }
.y-iconbtn:hover, .y-iconbtn[aria-pressed="true"] { background: var(--raised); }
.y-iconbtn[disabled] { opacity: .45; cursor: not-allowed; }
.y-back { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--target-min); padding: 0; background: none; border: 0; cursor: pointer; color: var(--link); font: 600 14px/20px var(--font-sans); text-decoration: none; }
.y-back:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- fields ---------- */
.y-field { display: flex; flex-direction: column; gap: var(--space-2); }
.y-label { font: 600 12px/16px var(--font-kicker); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.y-req { color: var(--bad); margin-left: 2px; }
.y-hint { font-size: 14px; line-height: 20px; color: var(--ink-2); margin: 0; }
.y-input, .y-select, .y-textarea { box-sizing: border-box; width: 100%; min-height: var(--target-min); padding: 10px 12px; font: 400 16px/24px var(--font-sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--radius-0); }
.y-textarea { min-height: 128px; resize: vertical; }
.y-input::placeholder, .y-textarea::placeholder { color: var(--ink-2); opacity: 1; }
.y-input:focus-visible, .y-select:focus-visible, .y-textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.y-input[aria-invalid="true"], .y-textarea[aria-invalid="true"], .y-select[aria-invalid="true"] { border: 2px solid var(--bad); }
.y-input[disabled], .y-textarea[disabled], .y-select[disabled] { background: var(--raised); color: var(--ink-2); cursor: not-allowed; }
.y-error { display: flex; gap: var(--space-2); align-items: flex-start; margin: 0; font-size: 14px; line-height: 20px; color: var(--bad); }
.y-charcount { font: 500 12px/16px var(--font-kicker); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.y-search { position: relative; display: flex; align-items: center; }
.y-search .y-icon { position: absolute; left: 12px; color: var(--ink-2); pointer-events: none; }
.y-search .y-input { padding-left: 42px; -webkit-appearance: none; appearance: none; }
.y-selectwrap { position: relative; }
.y-selectwrap .y-select { -webkit-appearance: none; appearance: none; padding-right: 40px; }
.y-selectwrap .y-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-2); }
.y-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.y-fieldset > legend { padding: 0; margin-bottom: var(--space-2); }
.y-check { display: flex; gap: var(--space-3); align-items: flex-start; min-height: var(--target-min); padding: 10px 0; cursor: pointer; }
.y-check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--strong); cursor: pointer; }
.y-check:has(input:disabled) { color: var(--ink-2); cursor: not-allowed; }
.y-check input[aria-invalid="true"] { outline: 2px solid var(--bad); outline-offset: 2px; }
.y-check--end { flex-direction: row-reverse; justify-content: space-between; }
.y-check__text { display: flex; flex-direction: column; gap: 2px; }
.y-check__title { font-weight: 600; line-height: 22px; }
.y-check__desc { font-size: 14px; line-height: 20px; color: var(--ink-2); }
.y-checklist-rows > .y-check + .y-check { border-top: 1px solid var(--line); }
.y-sticky-bar { position: sticky; bottom: 0; display: flex; gap: var(--space-3); justify-content: flex-end; align-items: center;
  padding: var(--space-3) var(--space-4); padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); z-index: 5; flex-wrap: wrap; }
.y-sticky-bar .y-btn { flex: none; }
/* Pages that show the phone tab bar add class y-has-tabs to body: sticky bars and toasts then sit above it. */
@media (max-width: 900px) { body.y-has-tabs { --tabbar-offset: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); } body.y-has-tabs .y-sticky-bar { bottom: var(--tabbar-offset); padding-bottom: var(--space-3); } }
@media (max-width: 600px) { .y-sticky-bar .y-status { flex-basis: 100%; } .y-sticky-bar--stack .y-btn { flex: 1 1 100%; } }
.y-section-label { margin: 0; padding-top: var(--space-3); border-top: 2px solid var(--strong); font: 600 12px/16px var(--font-kicker); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }

/* ---------- tabs, segmented, chips, pager ---------- */
.y-tabs { display: flex; flex-wrap: wrap; gap: 0 var(--space-6); box-shadow: inset 0 -1px 0 var(--line); }
.y-tab { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 2px; background: none; border: 0; cursor: pointer;
  font: 600 13px/16px var(--font-kicker); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.y-tab:hover { color: var(--ink); }
.y-tab:focus-visible { outline-offset: -3px; }
.y-tab[aria-disabled="true"] { opacity: .6; cursor: default; }
.y-tab[aria-disabled="true"]:hover { color: var(--ink-2); }
.y-tab[aria-current="page"], .y-tab[aria-selected="true"] { color: var(--ink); }
.y-tab[aria-current="page"]::after, .y-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--mark); }
.y-seg { display: inline-flex; border: 1px solid var(--field-line); border-radius: var(--radius-sm); }
.y-seg button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); } .y-seg button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.y-seg button { min-height: 40px; padding: 0 var(--space-4); background: transparent; color: var(--ink-2); border: 0; font: 600 14px/20px var(--font-sans); cursor: pointer; }
.y-seg button:hover:not([aria-pressed="true"]) { background: var(--raised); color: var(--ink); }
.y-seg button:focus-visible { outline-offset: 2px; position: relative; z-index: 1; }
.y-seg button + button { border-left: 1px solid var(--field-line); }
.y-seg button[aria-pressed="true"] { background: var(--strong); color: var(--on-strong); }
.y-seg .n { font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }
.y-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.y-chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--target-min); min-height: 36px; padding: 0 var(--space-3); background: var(--surface); color: var(--ink);
  border: 1px solid var(--field-line); border-radius: var(--radius-sm); font: 600 14px/20px var(--font-sans); cursor: pointer; }
.y-chip:hover { background: var(--raised); }
.y-chip .n { font-weight: 400; margin-left: 2px; font-variant-numeric: tabular-nums; }
.y-chip[aria-pressed="true"], .y-chip[aria-expanded="true"], .y-chip.is-set { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
@media (pointer: coarse), (max-width: 900px) { .y-seg button, .y-chip { min-height: var(--target-min); } }
.y-pager { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; }

/* ---------- badges, counts, dots, soon ---------- */
.y-badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--raised); color: var(--ink); border: 1px solid var(--line);
  font: 600 12px/14px var(--font-kicker); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.y-badge[hidden] { display: none; }
.y-badge .y-icon { width: 12px; height: 12px; stroke-width: 3; }
.y-badge--good { background: var(--tint-good); color: var(--good); border-color: transparent; }
.y-badge--bad { background: var(--tint-bad); color: var(--bad); border-color: transparent; }
.y-badge--warn { background: var(--tint-warn); color: var(--warn); border-color: transparent; }
.y-badge--info { background: var(--tint-info); color: var(--link); border-color: transparent; }
.y-badge--solid { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.y-badge--outline { background: transparent; border-color: var(--field-line); }
.y-num { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent);
  font: 700 12px/20px var(--font-kicker); text-align: center; font-variant-numeric: tabular-nums; }
.y-dot { display: inline-block; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--mark); flex: none; }
.y-soon { display: inline-block; padding: 2px 6px; border: 1px solid currentColor; border-radius: var(--radius-sm); font: 600 12px/14px var(--font-kicker); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- cards, rows, tables ---------- */
.y-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-0); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.y-card--raised { background: var(--raised); }
.y-body { margin: 0; font-size: 16px; line-height: 24px; color: var(--ink); }
p.y-small { margin: 0; }
.y-self-start { align-self: flex-start; }
.y-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.y-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
@media (min-width: 901px) { .y-card { padding: var(--space-5); } }
.y-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.y-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; min-height: var(--row-min); padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
a.y-row:hover, button.y-row:hover, .y-row[aria-current="true"], .y-row.is-selected { background: var(--raised); }
.y-row--2 { grid-template-columns: minmax(0, 1fr) auto; }
.y-row.is-needs { box-shadow: inset 3px 0 0 var(--mark); padding-left: var(--space-3); }
a.y-row[aria-disabled="true"], .y-side__foot a[aria-disabled="true"] { opacity: .6; cursor: default; }
button.y-row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; text-align: left; cursor: pointer; }
.y-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.y-row__title { font-weight: 600; line-height: 22px; overflow-wrap: anywhere; }
.y-row__sub { font-size: 14px; line-height: 20px; color: var(--ink-2); }
.y-row__one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.y-row__clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.y-row__end { display: flex; align-items: center; gap: var(--space-2); color: var(--ink-2); }
.y-table-wrap { container-type: inline-size; width: 100%; min-width: 0; }
.y-table-wrap .y-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.y-table-wrap .y-table th { padding: var(--space-2) var(--space-3); border-bottom: 2px solid var(--line); text-align: left; vertical-align: bottom;
  font: 600 12px/16px var(--font-kicker); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.y-table-wrap .y-table td { padding: var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.y-table-wrap .y-table .num { text-align: right; font-variant-numeric: tabular-nums; }
@container (max-width: 700px) {
  .y-table-wrap .y-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  /* th too: a header row left as table cells lays out past the screen edge inside the hidden thead. */
  .y-table-wrap .y-table, .y-table-wrap .y-table tbody, .y-table-wrap .y-table tr, .y-table-wrap .y-table th, .y-table-wrap .y-table td { display: block; }
  .y-table-wrap .y-table tr { border: 1px solid var(--line); background: var(--surface); padding: var(--space-3); margin-bottom: var(--space-3); }
  .y-table-wrap .y-table td { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: var(--space-3); border: 0; padding: var(--space-1) 0; }
  .y-table-wrap .y-table td > * { justify-self: start; grid-column: 2; }
  .y-table-wrap .y-table .num { text-align: left; }
  .y-table-wrap .y-table td::before { content: attr(data-label); font: 600 12px/20px var(--font-kicker); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
}

/* ---------- stat, date, face, progress ---------- */
.y-stats { display: flex; flex-wrap: wrap; gap: var(--space-6); margin: 0; }
.y-stat { display: flex; flex-direction: column-reverse; gap: var(--space-1); }
.y-stat dt { font: 600 12px/16px var(--font-kicker); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.y-stat dd { margin: 0; font: 300 38px/40px var(--font-sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.y-date { width: 52px; flex: none; padding: 6px 0; text-align: center; background: var(--raised); border: 1px solid var(--line); color: var(--ink); }
.y-date__m { display: block; font: 600 12px/14px var(--font-kicker); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.y-date__d { display: block; font: 700 20px/24px var(--font-kicker); font-variant-numeric: tabular-nums; }
.y-face { --face: 40px; width: var(--face); height: var(--face); flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: var(--radius-full);
  background: var(--raised); color: var(--ink); border: 1px solid var(--line); font: 700 14px/1 var(--font-kicker); }
.y-face img { width: 100%; height: 100%; object-fit: cover; }
.y-face--logo { border-radius: var(--radius-0); background: var(--surface); }
.y-face--sm { --face: 32px; font-size: 12px; }
.y-face--lg { --face: 64px; font-size: 20px; }
.y-face--xl { --face: 96px; font-size: 28px; }
.y-progress { height: 4px; background: var(--line); overflow: hidden; }
.y-progress > span { display: block; height: 100%; background: var(--strong); }

/* ---------- notices, empty, disclosure, status, toast, skeleton ---------- */
.y-notice > .y-icon { color: var(--link); }
.y-notice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); background: var(--tint-info); color: var(--ink); }
.y-notice--warn { background: var(--tint-warn); }
.y-notice--good { background: var(--tint-good); }
.y-notice--bad { background: var(--tint-bad); }
.y-notice--info > .y-icon { color: var(--link); } .y-notice--warn > .y-icon { color: var(--warn); } .y-notice--good > .y-icon { color: var(--good); } .y-notice--bad > .y-icon { color: var(--bad); }
.y-notice__body { display: flex; flex-direction: column; gap: 2px; }
.y-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); text-align: center; border: 1px dashed var(--field-line); color: var(--ink-2); }
.y-empty strong { color: var(--ink); font-weight: 600; }
.y-disclosure { border-bottom: 1px solid var(--line); }
.y-disclosure--top { border-top: 1px solid var(--line); }
.y-disclosure > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); min-height: var(--target-min); cursor: pointer; font-weight: 600; }
.y-disclosure > summary::-webkit-details-marker { display: none; }
.y-disclosure > summary .y-icon { transition: transform var(--dur-base) var(--ease-standard); color: var(--ink-2); }
.y-disclosure[open] > summary .y-icon { transform: rotate(180deg); }
.y-disclosure__body { padding: 0 0 var(--space-4); }
.y-status { display: flex; gap: var(--space-2); align-items: center; min-height: 20px; margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.y-status--good { color: var(--good); } .y-status--bad { color: var(--bad); }
.y-toast { display: flex; gap: var(--space-3); align-items: center; max-width: min(480px, calc(100vw - 32px)); padding: var(--space-3) var(--space-4);
  background: var(--strong); color: var(--on-strong); box-shadow: var(--shadow-2); font-size: 14px; line-height: 20px; }
.y-toast .y-btn--link { color: var(--on-strong); font-size: 14px; }
.y-toast--fixed { position: fixed; left: 0; right: 0; margin-inline: auto; width: max-content; bottom: calc(var(--tabbar-offset, 0px) + var(--space-4)); z-index: var(--z-toast); }
.y-skel { display: block; min-height: 14px; background: linear-gradient(90deg, var(--line) 25%, var(--raised) 50%, var(--line) 75%); background-size: 200% 100%; animation: y-shimmer 1.4s linear infinite; }
.y-skel--60 { width: 60%; } .y-skel--40 { width: 40%; }
@keyframes y-shimmer { to { background-position: -200% 0; } }

/* ---------- step tracker ---------- */
.y-track { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.y-track li { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: var(--space-3); padding-bottom: var(--space-4); }
.y-track li:last-child { padding-bottom: 0; }
.y-track li::before { content: ""; width: 10px; height: 10px; margin-top: 6px; border: 2px solid var(--field-line); background: var(--surface); box-sizing: border-box; }
.y-track li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.y-track li[data-state="done"]::before { background: var(--strong); border-color: var(--strong); }
.y-track li[data-state="now"]::before { border: 3px solid var(--mark); background: var(--surface); }
.y-track li[data-state="warn"]::before { border-color: var(--warn); background: var(--warn); }
.y-track li[data-state="stop"]::before { border-color: var(--bad); background: var(--bad); }
.y-track__label { font-weight: 600; line-height: 22px; }
.y-track li[data-state="todo"] .y-track__label { color: var(--ink-2); font-weight: 400; }
.y-track__sub { font-size: 14px; line-height: 20px; color: var(--ink-2); }

/* ---------- sheets, dialogs, popovers ---------- */
/* margin: auto is the dialog's own centring, restored: css/styles.css "* { margin: 0 }" strips it. */
.y-sheet { box-sizing: border-box; width: min(480px, calc(100vw - 32px)); max-height: 85dvh; margin: auto; padding: 0; border: 0; border-radius: var(--radius-0);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); display: flex; flex-direction: column; }
.y-sheet:not([open]) { display: none; }
.y-sheet::backdrop { background: rgba(23, 32, 41, .55); background: var(--overlay, rgba(23, 32, 41, .55)); }
.y-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); }
.y-sheet__body { padding: var(--space-4); overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--space-4); }
.y-sheet__foot { display: flex; gap: var(--space-3); justify-content: flex-end; padding: var(--space-3) var(--space-4); padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .y-sheet { width: 100%; max-width: 100%; margin: auto 0 0; }
  .y-sheet--full { height: 100dvh; max-height: 100dvh; margin: 0; }
  .y-sheet__foot > .y-btn { flex: 1; }
}
.y-popover { box-sizing: border-box; width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.y-popover__head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); }
.y-popover__body { padding: 0 var(--space-4); }
.y-popover__body > :last-child { border-bottom: 0; }
.y-menu { list-style: none; margin: 0; padding: var(--space-1) 0; min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.y-menu__item { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: var(--target-min); padding: 0 var(--space-4); background: none; border: 0; font: 400 16px/20px var(--font-sans); color: inherit; text-decoration: none; text-align: left; cursor: pointer; }
.y-menu__item:hover { background: var(--raised); }
.y-menu__item[aria-checked="true"]::after { content: ""; margin-left: auto; width: 10px; height: 6px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translateY(-2px); }
.y-menu__sep { height: 1px; background: var(--line); margin: var(--space-1) 0; }
.y-popover__foot { display: flex; justify-content: space-between; padding: var(--space-2) var(--space-4); border-top: 1px solid var(--line); }

/* ---------- shell: sidebar, top bar, tab bar, more sheet, bare header ---------- */
.y-side { box-sizing: border-box; width: var(--sidebar-w); min-height: 100%; display: flex; flex-direction: column; padding: var(--space-4) 0 var(--space-3); background: var(--sidebar-bg); color: var(--sidebar-ink); }
.y-side__logo { display: block; padding: 4px var(--space-5) var(--space-5); }
.y-side__logo img { height: 26px; width: auto; display: block; }
.y-nav { list-style: none; margin: 0; padding: 0; }
.y-nav a { display: flex; align-items: center; gap: var(--space-3); min-height: var(--target-min); padding: 0 var(--space-5) 0 17px; border-left: 3px solid transparent;
  color: var(--sidebar-ink); text-decoration: none; font: 400 16px/20px var(--font-sans); }
.y-nav a:hover { color: var(--sidebar-ink-strong); background: rgba(255, 255, 255, .06); }
.y-nav a[aria-current="page"] { color: var(--sidebar-ink-strong); font-weight: 600; background: var(--sidebar-active); border-left-color: var(--accent); }
.y-nav a[aria-disabled="true"] { opacity: .6; cursor: default; }
.y-nav a .y-soon { margin-left: auto; }
.y-side__foot { margin-top: auto; padding: var(--space-3) var(--space-4) 0; border-top: 1px solid var(--sidebar-line); display: flex; flex-direction: column; }
.y-side__foot a { display: flex; align-items: center; min-height: 36px; color: var(--sidebar-label); font-size: 14px; text-decoration: none; }
.y-side__foot a:hover { color: var(--sidebar-ink-strong); text-decoration: underline; }
.y-who { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0 0; margin-top: var(--space-2); border-top: 1px solid var(--sidebar-line); }
.y-who__name { color: var(--sidebar-ink-strong); font-weight: 600; font-size: 14px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y-who__role { color: var(--sidebar-label); font-size: 12px; line-height: 16px; }
.y-wordmark { display: inline-block; font: 700 26px/1 var(--font-kicker); letter-spacing: .02em; color: var(--sidebar-ink-strong); }
.y-who .y-face { background: rgba(255, 255, 255, .1); color: var(--sidebar-ink-strong); border-color: var(--sidebar-line); }
.y-who .y-iconbtn { color: var(--sidebar-ink); } .y-who .y-iconbtn:hover { background: rgba(255, 255, 255, .06); }
.y-top { box-sizing: border-box; height: var(--topbar-h); display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-2) 0 var(--space-4);
  background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ink); }
.y-top__title { flex: 1; min-width: 0; margin: 0; font: 600 16px/20px var(--font-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y-top .y-search { width: clamp(200px, 26vw, 380px); }
.y-top .y-search .y-input { min-height: 40px; }
.y-bell-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--mark); box-shadow: 0 0 0 2px var(--surface); }
.y-tabbar { box-sizing: border-box; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.y-tabbar--fixed { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-header); }
.y-tabbar a, .y-tabbar button { position: relative; flex: 1; min-width: 0; min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: none; border: 0; color: var(--ink-2); font: 600 12px/14px var(--font-sans); text-decoration: none; cursor: pointer; }
.y-tabbar [aria-current="page"] { color: var(--ink); }
.y-tabbar [aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 20%; right: 20%; height: 2px; background: var(--mark); }
.y-bare { box-sizing: border-box; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-2) 0 var(--space-4); background: var(--surface); border-bottom: 1px solid var(--line); }
.y-bare img { height: 22px; width: auto; display: block; }

/* ---------- domain pieces ---------- */
.y-event { background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.y-event__band { padding: var(--space-3) var(--space-4); background: var(--strong); color: var(--on-strong); font: 600 12px/16px var(--font-kicker); letter-spacing: .12em; text-transform: uppercase; }
.y-event__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.y-event__link { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ink-2); }
.y-event__link:hover { text-decoration-color: currentColor; }
.y-person { display: grid; grid-template-columns: 48px minmax(0, 1fr) 20px; gap: var(--space-3); align-items: center; min-height: 64px; padding: var(--space-2) 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.y-person:hover { background: var(--raised); }
.y-person .y-face { --face: 48px; }
.y-notif { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; min-height: 64px; padding: var(--space-3) 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.y-notif .y-icon { color: var(--ink-2); margin-top: 2px; }
a.y-notif:hover { background: var(--raised); }
.y-notif__title { line-height: 22px; }
.y-notif.is-unread .y-notif__title { font-weight: 600; }
.y-notif__end { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.y-steps { list-style: none; margin: 0; padding: 0; }
.y-steps > li { border-top: 1px solid var(--line); }
.y-steps > li:last-child { border-bottom: 1px solid var(--line); }
.y-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; min-height: var(--row-min); }
.y-step__box { width: 20px; height: 20px; border: 2px solid var(--field-line); box-sizing: border-box; display: grid; place-items: center; }
.y-step.is-done .y-step__box { background: var(--good); border-color: var(--good); color: var(--surface); }
.y-step.is-done .y-step__title { color: var(--ink-2); font-weight: 400; }
.y-step__title { font-weight: 600; line-height: 22px; }
summary.y-step { list-style: none; cursor: pointer; }
summary.y-step::-webkit-details-marker { display: none; }
.y-step--tall { align-items: start; padding: var(--space-3) 0; }
.y-step__time { font: 500 12px/16px var(--font-kicker); color: var(--ink-2); white-space: nowrap; }
