/* Components. Every box sits on one 12-column grid with one gap and one radius so edges always line up. */
@media (pointer: coarse) { .b { min-height: 44px; } .b--sm { min-height: 40px; } .ib { width: 44px; height: 44px; } .nv { min-height: 46px; } }

/* ---------- Page header ---------- */
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-16) var(--sp-24); padding: var(--sp-8) 0 var(--sp-22); }
.ph__t { min-width: 0; flex: 1 1 360px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-6); font-size: var(--fs-13); color: var(--c-ink-3); margin-bottom: var(--sp-8); }
.crumbs a { color: var(--c-ink-2); border-radius: 6px; } .crumbs a:hover { color: var(--c-brand-ink); }
.crumbs .i { width: var(--ic-12); height: var(--ic-12); }
.ph h1 { font-size: clamp(1.7rem, 1.25rem + 1.2vw, 2.25rem); font-weight: var(--w-light); letter-spacing: -0.035em; line-height: 1.1; }
.ph h1 em { font-style: normal; color: var(--c-brand-ink); }
.ph__s { margin-top: var(--sp-8); color: var(--c-ink-2); font-size: var(--fs-15); max-width: 70ch; }
.ph__a { display: flex; flex-wrap: wrap; gap: var(--sp-10); align-items: center; }
.ph__meta { display: flex; flex-wrap: wrap; gap: var(--sp-8) var(--sp-16); margin-top: var(--sp-10); font-size: var(--fs-13); color: var(--c-ink-2); align-items: center; }
.ph__meta > span { display: inline-flex; align-items: center; gap: var(--sp-6); }
.ph__meta .i { width: var(--ic-16); height: var(--ic-16); color: var(--c-ink-3); }
@media (max-width: 767.98px) { .ph { padding: var(--sp-4) 0 var(--sp-16); } .ph__a { width: 100%; } .ph__a > .btn { flex: 1; } }

/* ---------- Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.page > .grid + .grid, .page > .grid + .tile, .page > .tile + .grid, .page > .tile + .tile, .page > .grid + .stack, .page > .stack + .grid { margin-top: var(--gap); }
.s-12 { grid-column: span 12; } .s-9 { grid-column: span 9; } .s-8 { grid-column: span 8; } .s-7 { grid-column: span 7; } .s-6 { grid-column: span 6; } .s-5 { grid-column: span 5; } .s-4 { grid-column: span 4; } .s-3 { grid-column: span 3; }
@media (max-width: 1279.98px) { .s-3 { grid-column: span 6; } .s-9, .s-8, .s-7 { grid-column: span 12; } .s-5, .s-4 { grid-column: span 6; } .md-12 { grid-column: span 12; } }
@media (max-width: 767.98px) { .grid > * { grid-column: span 12; } .s-3.xs-6 { grid-column: span 6; } }
.stack { display: grid; gap: var(--gap); align-content: start; }
.row { display: flex; align-items: center; gap: var(--sp-10); flex-wrap: wrap; }
.row--sb { justify-content: space-between; }
.sp { flex: 1; }
.gap-6 { gap: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); } .mt-12 { margin-top: var(--sp-12); } .mt-16 { margin-top: var(--sp-16); } .mt-24 { margin-top: var(--sp-24); }

/* ---------- Tile ---------- */
.tile { position: relative; min-width: 0; background: var(--c-white); border-radius: var(--tile-r); box-shadow: var(--sh-1), inset 0 0 0 1px var(--c-line); padding: var(--tile-p); display: flex; flex-direction: column; gap: var(--sp-14); }
.tile--flush { padding: 0; gap: 0; overflow: hidden; }
.tile--flush > .th { padding: var(--tile-p) var(--tile-p) 0; margin-bottom: var(--sp-12); }
.tile--tint { background: linear-gradient(160deg, var(--c-tint-hi), var(--c-white) 60%); }
.tile--lav { background: linear-gradient(160deg, var(--c-lav-hi), var(--c-white) 65%); }
.tile--ink { background: var(--c-ink); color: var(--c-white); box-shadow: var(--sh-2); }
.tile--ink .mute, .tile--ink .th__s { color: color-mix(in oklab, var(--c-white) 70%, transparent); }
.tile--link { transition: box-shadow 200ms, transform 200ms; }
.tile--link:hover { box-shadow: var(--sh-2), inset 0 0 0 1px color-mix(in oklab, var(--c-brand) 30%, transparent); }
.th { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); min-height: 32px; }
.th__k { display: flex; align-items: center; gap: var(--sp-10); font-size: var(--fs-14); font-weight: var(--w-med); min-width: 0; }
.th__k > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th__s { font-size: var(--fs-12); color: var(--c-ink-3); white-space: nowrap; }
.th__a { display: flex; align-items: center; gap: var(--sp-8); flex: none; }
.ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--c-tint-hi); color: var(--c-brand); flex: none; }
.ic .i { width: var(--ic-18); height: var(--ic-18); }
.ic--ok { background: var(--st-ok-bg); color: var(--c-ok); } .ic--warn { background: var(--st-wait-bg); color: var(--c-warn); } .ic--err { background: var(--st-err-bg); color: var(--c-err); } .ic--lav { background: var(--c-lav-hi); color: var(--c-violet); } .ic--ink { background: var(--c-ink); color: var(--c-brand); } .ic--rose { background: color-mix(in oklab, var(--c-rose) 12%, var(--c-white)); color: var(--c-rose); } .ic--mute { background: var(--c-bg); color: var(--c-ink-2); }
.ic--lg { width: 44px; height: 44px; border-radius: 14px; } .ic--lg .i { width: var(--ic-22); height: var(--ic-22); }
.tile__f { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-10); font-size: var(--fs-13); color: var(--c-ink-2); }
.sep { height: 1px; background: var(--c-line); border: 0; margin: var(--sp-4) 0; }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: var(--sp-6); }
.kpi__l { font-size: var(--fs-13); color: var(--c-ink-2); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); }
.kpi__v { font-size: clamp(1.85rem, 1.4rem + 1vw, 2.4rem); font-weight: var(--w-light); letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: var(--sp-6); }
.kpi__v small { font-size: var(--fs-14); letter-spacing: 0; color: var(--c-ink-3); font-weight: var(--w-reg); }
.kpi__f { display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap; font-size: var(--fs-12); color: var(--c-ink-3); }
.delta { display: inline-flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-12); font-weight: var(--w-med); padding: var(--sp-2) var(--sp-8); border-radius: 99px; background: var(--st-ok-bg); color: var(--c-ok); }
.delta--down { background: var(--st-err-bg); color: var(--c-err); }
.delta--flat { background: var(--c-bg-2); color: var(--c-ink-2); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis > .kpi { padding: var(--tile-p); }
.kpis > .kpi + .kpi { box-shadow: -1px 0 0 var(--c-line); }
@media (max-width: 1023.98px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis > .kpi:nth-child(3) { box-shadow: 0 -1px 0 var(--c-line); } .kpis > .kpi:nth-child(4) { box-shadow: -1px 0 0 var(--c-line), 0 -1px 0 var(--c-line); } }
.big { font-size: clamp(2.2rem, 1.6rem + 1.6vw, 3.1rem); font-weight: var(--w-light); letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Badges (canonical status names, one mapping) ---------- */
.bdg { display: inline-flex; align-items: center; gap: var(--sp-6); height: 24px; padding: 0 var(--sp-10); border-radius: 99px; font-size: var(--fs-12); font-weight: var(--w-med); white-space: nowrap; background: var(--st-mute-bg); color: var(--st-mute); }
.bdg::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.bdg--ok { background: var(--st-ok-bg); color: var(--st-ok); } .bdg--info { background: var(--st-info-bg); color: var(--st-info); } .bdg--wait { background: var(--st-wait-bg); color: var(--st-wait); } .bdg--err { background: var(--st-err-bg); color: var(--st-err); } .bdg--lav { background: var(--st-lav-bg); color: var(--st-lav); }
.bdg--plain::before { display: none; }
.bdg--solid { background: var(--c-ink); color: var(--c-white); }
.tag { display: inline-flex; align-items: center; gap: var(--sp-5); height: 22px; padding: 0 var(--sp-8); border-radius: 7px; font-size: var(--fs-11); font-weight: var(--w-med); background: var(--c-bg); color: var(--c-ink-2); box-shadow: inset 0 0 0 1px var(--c-line); white-space: nowrap; }
.tag .i { width: var(--ic-12); height: var(--ic-12); }
.tag--rx { background: var(--c-lav-hi); color: var(--c-violet); box-shadow: none; }
.tag--cold { background: var(--c-tint-hi); color: var(--c-brand-ink); box-shadow: none; }
.tag--ai { background: var(--c-lav-hi); color: var(--c-violet); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-violet) 20%, transparent); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--sp-4); overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--c-line); margin-bottom: var(--sp-18); }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: var(--sp-8); min-height: 44px; padding: 0 var(--sp-12); font-size: var(--fs-14); color: var(--c-ink-2); white-space: nowrap; border-radius: 10px 10px 0 0; }
.tab:hover { color: var(--c-ink); }
.tab.on { color: var(--c-ink); font-weight: var(--w-med); }
.tab.on::after { content: ""; position: absolute; left: var(--sp-10); right: var(--sp-10); bottom: 0; height: 2px; border-radius: 2px; background: var(--c-ink); }
.tab__n { min-width: 20px; height: 20px; padding: 0 var(--sp-6); border-radius: 99px; display: grid; place-items: center; font-size: var(--fs-11); background: var(--c-bg-2); color: var(--c-ink-2); font-variant-numeric: tabular-nums; font-weight: var(--w-med); }
.tab.on .tab__n { background: var(--c-ink); color: var(--c-white); }
.seg { display: inline-flex; padding: var(--sp-4); gap: var(--sp-2); border-radius: 99px; background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-line); flex: none; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button, .seg a { min-height: 32px; padding: 0 var(--sp-14); border-radius: 99px; font-size: var(--fs-13); color: var(--c-ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: var(--sp-6); transition: background 160ms, color 160ms; }
.seg button:hover, .seg a:hover { color: var(--c-ink); }
.seg .on { background: var(--c-white); color: var(--c-ink); font-weight: var(--w-med); box-shadow: var(--sh-1), 0 0 0 1px var(--c-line); }
.seg .i { width: var(--ic-16); height: var(--ic-16); }
.tile--ink .seg { background: color-mix(in oklab, var(--c-white) 8%, transparent); box-shadow: none; }
.tile--ink .seg button { color: color-mix(in oklab, var(--c-white) 70%, transparent); }
.tile--ink .seg .on { background: var(--c-white); color: var(--c-ink); }

/* ---------- Toolbar, chips ---------- */
.tbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-10); margin-bottom: var(--sp-14); }
.tbar .inw { flex: 1 1 260px; max-width: 420px; }
.tbar .in { min-height: 42px; border-radius: 12px; }
.tbar select.in { width: auto; min-width: 150px; flex: 0 1 auto; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.chip { display: inline-flex; align-items: center; gap: var(--sp-8); min-height: 36px; padding: 0 var(--sp-14); border-radius: 99px; font-size: var(--fs-13); background: var(--c-white); color: var(--c-ink-2); box-shadow: inset 0 0 0 1px var(--c-line-2); white-space: nowrap; transition: background 160ms, color 160ms, box-shadow 160ms; }
.chip:hover { color: var(--c-ink); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-ink) 30%, transparent); }
.chip.on { background: var(--c-ink); color: var(--c-white); box-shadow: none; }
.chip b { font-variant-numeric: tabular-nums; }
.chip .i { width: var(--ic-16); height: var(--ic-16); }
.sumchips { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-10); margin-bottom: var(--sp-16); }
.sumchip { text-align: left; padding: var(--sp-14) var(--sp-16); border-radius: 16px; background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line); display: grid; gap: var(--sp-2); transition: box-shadow 160ms; }
.sumchip:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-brand) 34%, transparent); }
.sumchip.on { box-shadow: inset 0 0 0 1.5px var(--c-ink); }
.sumchip small { font-size: var(--fs-12); color: var(--c-ink-2); }
.sumchip b { font-size: var(--fs-24); font-weight: var(--w-light); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ---------- Table (R-UI-10): sticky head, sortable, pagination, count; cards on phones ---------- */
.tbl { width: 100%; overflow-x: auto; }
.tbl table { min-width: 640px; font-size: var(--fs-14); }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--c-white); text-align: left; font-size: var(--fs-12); font-weight: var(--w-med); color: var(--c-ink-3); padding: 0 var(--sp-14); height: 44px; white-space: nowrap; box-shadow: inset 0 -1px 0 var(--c-line); }
.tbl th:first-child, .tbl td:first-child { padding-left: var(--tile-p); }
.tbl th:last-child, .tbl td:last-child { padding-right: var(--tile-p); }
.tbl th button { display: inline-flex; align-items: center; gap: var(--sp-4); color: inherit; font: inherit; border-radius: 6px; }
.tbl th button:hover { color: var(--c-ink); }
.tbl th .i { width: var(--ic-12); height: var(--ic-12); opacity: 0.6; }
.tbl th[aria-sort] { color: var(--c-ink); }
.tbl td { padding: var(--sp-10) var(--sp-14); height: var(--row-h); border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background 120ms; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr:hover { background: var(--c-hover); }
.tbl tr.is-sel { background: var(--c-sel); }
.tbl .t-r { text-align: right; }
.tbl .t-act { text-align: right; white-space: nowrap; width: 1%; }
.tbl .t-act .row { flex-wrap: nowrap; justify-content: flex-end; gap: var(--sp-6); }
.tbl .t-left { text-align: left; white-space: nowrap; width: 1%; }
.pat-acts { display: inline-flex; align-items: center; justify-content: flex-start; gap: var(--sp-6); }
.tbl .t-chk { width: 44px; }
.cell { display: flex; align-items: center; gap: var(--sp-12); min-width: 0; }
.cell__t { min-width: 0; line-height: 1.3; } .cell__t b { display: block; font-weight: var(--w-med); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cell__t small { display: block; font-size: var(--fs-12); color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-10); padding: var(--sp-12) var(--tile-p); border-top: 1px solid var(--c-line); font-size: var(--fs-13); color: var(--c-ink-2); }
.pager .row { gap: var(--sp-6); }
.pager select.in { min-height: 34px; width: auto; padding: 0 var(--sp-34) 0 var(--sp-10); border-radius: 10px; font-size: var(--fs-13); background-position: right 10px center; }
@media (max-width: 767.98px) {
  .tbl--cards table { min-width: 0; }
  .tbl--cards thead { display: none; }
  .tbl--cards tbody, .tbl--cards tr, .tbl--cards td { display: block; }
  .tbl--cards tr { padding: var(--sp-14) var(--tile-p); border-bottom: 1px solid var(--c-line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-6) var(--sp-12); }
  .tbl--cards td { height: auto; padding: 0 !important; border: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-10); font-size: var(--fs-14); min-width: 0; }
  .tbl--cards td[data-l]::before { content: attr(data-l); font-size: var(--fs-12); color: var(--c-ink-3); }
  .tbl--cards td.t-main { grid-column: 1 / 2; justify-content: flex-start; }
  .tbl--cards td.t-main::before, .tbl--cards td.t-stat::before { display: none; }
  .tbl--cards td.t-stat { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .tbl--cards td:not(.t-main):not(.t-stat) { grid-column: 1 / -1; }
  .tbl--cards td.t-act { width: auto; justify-content: flex-end; padding-top: var(--sp-6) !important; }
  .tbl--cards td.t-left { justify-content: flex-start; }
  .tbl--cards td.t-act::before { display: none; }
  .tbl--cards td.t-chk { display: none; }
  .tbl--cards td.t-hide-xs { display: none; }
  .tbl--cards td.t-r { text-align: left; }
}

/* ---------- Lists ---------- */
.list { display: grid; }
.li { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-12) 0; border-bottom: 1px solid var(--c-line); min-width: 0; }
.li:last-child { border-bottom: 0; padding-bottom: 0; }
.li:first-child { padding-top: 0; }
a.li, button.li { width: 100%; text-align: left; border-radius: 0; transition: background 120ms; }
.li__t { flex: 1; min-width: 0; line-height: 1.35; }
.li__t b { display: block; font-weight: var(--w-med); font-size: var(--fs-14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li__t small { display: block; font-size: var(--fs-12); color: var(--c-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li__r { display: flex; align-items: center; gap: var(--sp-8); flex: none; text-align: right; font-size: var(--fs-13); }
.li--pad { padding-left: var(--tile-p); padding-right: var(--tile-p); }
.list--hover a.li:hover, .list--hover button.li:hover { background: var(--c-hover); }
.dl { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: var(--sp-10) var(--sp-16); font-size: var(--fs-14); }
.dl dt { color: var(--c-ink-3); } .dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl--row { grid-template-columns: 1fr auto; } .dl--row dd { text-align: right; }
.totals { display: grid; gap: var(--sp-10); font-size: var(--fs-14); }
.totals > div { display: flex; justify-content: space-between; gap: var(--sp-12); }
.totals > div > span:first-child { color: var(--c-ink-2); }
.totals .tot { padding-top: var(--sp-12); border-top: 1px solid var(--c-line); font-size: var(--fs-16); font-weight: var(--w-med); }
.totals .tot > span:first-child { color: var(--c-ink); }

/* ---------- Avatar ---------- */
.av { --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; flex: none; font-size: calc(var(--s) * 0.36); font-weight: var(--w-med); letter-spacing: 0.02em; color: var(--c-ink); background: var(--av, var(--c-tint)); text-transform: uppercase; }
.av--sm { --s: 28px; } .av--lg { --s: 48px; } .av--xl { --s: 64px; }
.av--ink { background: var(--c-ink); color: var(--c-white); }
.av-0 { --av: var(--c-x-dbe7fe); } .av-1 { --av: var(--c-x-ece7fe); } .av-2 { --av: var(--c-x-d9f0f1); } .av-3 { --av: var(--c-x-fde8e6); } .av-4 { --av: var(--c-x-e9edf5); } .av-5 { --av: var(--c-x-fdf1dc); }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avs { display: flex; } .avs .av { box-shadow: 0 0 0 2px var(--c-white); } .avs .av + .av { margin-left: calc(-1 * var(--sp-8)); }

/* ---------- Empty, error, skeleton, stale ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--sp-10); padding: clamp(var(--sp-28), 4vw, var(--sp-48)) var(--sp-20); }
.empty .ic { width: 56px; height: 56px; border-radius: 18px; } .empty .ic .i { width: var(--ic-26); height: var(--ic-26); }
.empty b { font-size: var(--fs-16); font-weight: var(--w-med); margin-top: var(--sp-6); }
.empty p { color: var(--c-ink-2); font-size: var(--fs-14); max-width: 46ch; }
.empty .row { justify-content: center; margin-top: var(--sp-8); }
.empty--sm { padding: var(--sp-20) var(--sp-12); } .empty--sm .ic { width: 44px; height: 44px; border-radius: 14px; }
.reqid { font-family: var(--mono); font-size: var(--fs-12); color: var(--c-ink-3); }
.sk { display: block; border-radius: 10px; background: var(--c-bg-2); position: relative; overflow: hidden; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--c-white) 70%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-t { height: 12px; } .sk-h { height: 30px; width: 40%; } .sk-b { height: 160px; border-radius: 16px; }
.stale { display: inline-flex; align-items: center; gap: var(--sp-6); font-size: var(--fs-12); color: var(--c-warn); }
.stale .i { width: var(--ic-14); height: var(--ic-14); }
.synced { font-size: var(--fs-12); color: var(--c-ink-3); display: inline-flex; align-items: center; gap: var(--sp-6); }
.synced .i { width: var(--ic-14); height: var(--ic-14); }
.note { display: flex; gap: var(--sp-10); padding: var(--sp-12) var(--sp-14); border-radius: 14px; font-size: var(--fs-13); background: var(--c-bg); color: var(--c-ink-2); line-height: 1.5; }
.note--center { justify-content: center; text-align: center; }
.note .i { flex: none; width: var(--ic-18); height: var(--ic-18); color: var(--c-brand); margin-top: var(--sp-1); }
.note--warn { background: var(--st-wait-bg); color: color-mix(in oklab, var(--c-warn) 80%, var(--c-ink)); } .note--warn .i { color: var(--c-warn); }
.note--err { background: var(--st-err-bg); color: color-mix(in oklab, var(--c-err) 85%, var(--c-ink)); } .note--err .i { color: var(--c-err); }
.note--ok { background: var(--st-ok-bg); color: color-mix(in oklab, var(--c-ok) 85%, var(--c-ink)); } .note--ok .i { color: var(--c-ok); }
.note--lav { background: var(--c-lav-hi); color: color-mix(in oklab, var(--c-violet) 80%, var(--c-ink)); } .note--lav .i { color: var(--c-violet); }
.note b { color: var(--c-ink); }

/* ---------- Progress, meter, stepper, timeline ---------- */
.prog { height: 8px; border-radius: 99px; background: var(--c-bg-2); overflow: hidden; }
.prog i { display: block; height: 100%; width: calc(var(--p, 0) * 1%); border-radius: inherit; background: var(--c-brand); transition: width 600ms var(--ease-expo); }
.prog--ok i { background: var(--c-ok); } .prog--ink i { background: var(--c-ink); }
.segs { display: grid; grid-auto-flow: column; gap: var(--sp-4); } .segs i { height: 6px; border-radius: 99px; background: var(--c-bg-2); } .segs i.on { background: var(--c-brand); } .segs i.cur { background: var(--c-ink); }
.steps { display: flex; gap: var(--sp-6); overflow-x: auto; scrollbar-width: none; counter-reset: st; }
.steps::-webkit-scrollbar { display: none; }
.step { display: flex; align-items: center; gap: var(--sp-10); flex: 1 0 auto; min-height: 44px; padding: var(--sp-6) var(--sp-14) var(--sp-6) var(--sp-6); border-radius: 99px; font-size: var(--fs-13); color: var(--c-ink-3); background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line); white-space: nowrap; }
.step__n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-12); font-weight: var(--w-semi); background: var(--c-bg); color: var(--c-ink-2); flex: none; }
.step__n .i { width: var(--ic-14); height: var(--ic-14); }
.step.done { color: var(--c-ink-2); } .step.done .step__n { background: var(--st-ok-bg); color: var(--c-ok); }
.step.on { color: var(--c-ink); font-weight: var(--w-med); box-shadow: inset 0 0 0 1.5px var(--c-ink); } .step.on .step__n { background: var(--c-ink); color: var(--c-white); }
a.step:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-brand) 40%, transparent); }
.tl { display: grid; gap: 0; }
.tl li { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: var(--sp-12); padding-bottom: var(--sp-16); font-size: var(--fs-14); }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ""; position: absolute; left: var(--sp-9); top: var(--sp-20); bottom: 0; width: 2px; background: var(--c-line-2); }
.tl li:last-child::before { display: none; }
.tl li.done::before { background: color-mix(in oklab, var(--c-brand) 50%, transparent); }
.tl__d { width: 20px; height: 20px; border-radius: 50%; background: var(--c-white); box-shadow: inset 0 0 0 2px var(--c-line-2); display: grid; place-items: center; position: relative; z-index: 1; }
.tl li.done .tl__d { background: var(--c-brand); box-shadow: none; color: var(--c-white); }
.tl li.done .tl__d .i { width: var(--ic-12); height: var(--ic-12); }
.tl li.now .tl__d { box-shadow: inset 0 0 0 2px var(--c-brand); }
.tl li.now .tl__d::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-brand); }
.tl li.bad .tl__d { background: var(--c-err); box-shadow: none; color: var(--c-white); }
.tl__t b { display: block; font-weight: var(--w-med); } .tl__t small { display: block; color: var(--c-ink-3); font-size: var(--fs-12); }
.tl time { font-size: var(--fs-12); color: var(--c-ink-3); white-space: nowrap; }

/* ---------- Overlays: popover, modal, sheet, drawer, toast, tooltip ---------- */
.pop { position: fixed; z-index: var(--z-pop); min-width: 220px; max-width: min(380px, calc(100vw - 24px)); padding: var(--sp-6); border-radius: 16px; background: var(--c-white); box-shadow: var(--sh-3), 0 0 0 1px var(--c-line); animation: popIn 200ms var(--ease-expo); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.pop__i { width: 100%; display: flex; align-items: center; gap: var(--sp-10); min-height: 40px; padding: 0 var(--sp-10); border-radius: 10px; font-size: var(--fs-14); text-align: left; }
.pop__i:hover, .pop__i:focus-visible { background: var(--c-bg); }
.pop__i .i { width: var(--ic-18); height: var(--ic-18); color: var(--c-ink-3); }
.pop__i--danger { color: var(--c-err); } .pop__i--danger .i { color: var(--c-err); }
.pop__h { padding: var(--sp-10) var(--sp-10) var(--sp-6); font-size: var(--fs-12); color: var(--c-ink-3); }
.pop__sep { height: 1px; background: var(--c-line); margin: var(--sp-6) var(--sp-4); }
.ovl { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--sp-20); background: var(--c-scrim); animation: fade 200ms; }
@keyframes fade { from { opacity: 0; } }
.mdl { width: min(100%, 560px); max-height: min(88dvh, 860px); display: flex; flex-direction: column; background: var(--c-white); border-radius: 26px; box-shadow: var(--sh-3); animation: mdlIn 320ms var(--ease-expo); overflow: hidden; }
.mdl--lg { width: min(100%, 820px); } .mdl--sm { width: min(100%, 440px); }
@keyframes mdlIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.mdl__h { display: flex; align-items: flex-start; gap: var(--sp-14); padding: var(--sp-22) var(--sp-22) var(--sp-6); }
.mdl__h h2 { font-size: var(--fs-20); font-weight: var(--w-reg); letter-spacing: -0.02em; flex: 1; }
.mdl__h p { color: var(--c-ink-2); font-size: var(--fs-14); margin-top: var(--sp-6); }
.mdl__b { padding: var(--sp-14) var(--sp-22) var(--sp-8); overflow-y: auto; overscroll-behavior: contain; }
.mdl__f { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-10); padding: var(--sp-16) var(--sp-22) var(--sp-22); }
@media (max-width: 767.98px) {
  .ovl { place-items: end stretch; padding: 0; }
  .mdl, .mdl--lg, .mdl--sm { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; animation: sheetIn 360ms var(--ease-expo); padding-bottom: env(safe-area-inset-bottom); }
  .mdl__f > * { flex: 1; }
  @keyframes sheetIn { from { transform: translateY(100%); } }
}
.drw { position: fixed; top: var(--sp-10); right: var(--sp-10); bottom: var(--sp-10); width: min(560px, calc(100vw - 20px)); z-index: var(--z-modal); background: var(--c-white); border-radius: 24px; box-shadow: var(--sh-3); display: flex; flex-direction: column; animation: drwIn 380ms var(--ease-expo); }
@keyframes drwIn { from { transform: translateX(104%); } }
.toasts { position: fixed; left: 50%; bottom: var(--sp-24); transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: var(--sp-8); justify-items: center; pointer-events: none; width: min(92vw, 520px); }
@media (max-width: 767.98px) { .toasts { bottom: calc(var(--bnav-h) + var(--sp-16) + env(safe-area-inset-bottom)); } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-12) var(--sp-12) var(--sp-12) var(--sp-16); border-radius: 16px; background: var(--c-ink); color: var(--c-white); font-size: var(--fs-14); box-shadow: var(--sh-3); animation: toastIn 360ms var(--ease-expo); max-width: 100%; }
.toast .i { color: var(--c-brand); flex: none; }
.toast--ok .i { color: var(--c-x-6ee7d8); } .toast--err .i { color: var(--c-x-ff8a80); }
.toast button { color: var(--c-tint-2); font-weight: var(--w-med); padding: var(--sp-6) var(--sp-8); border-radius: 8px; }
.toast button:hover { background: color-mix(in oklab, var(--c-white) 10%, transparent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.tip { position: fixed; z-index: var(--z-toast); padding: var(--sp-6) var(--sp-10); border-radius: 9px; background: var(--c-ink); color: var(--c-white); font-size: var(--fs-12); pointer-events: none; white-space: nowrap; }

/* ---------- Command palette ---------- */
.cmdk { width: min(100%, 640px); align-self: start; margin-top: 10vh; }
.cmdk .mdl__b { padding: var(--sp-6) var(--sp-8) var(--sp-10); max-height: 56dvh; }
.cmdk__in { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-16) var(--sp-20); border-bottom: 1px solid var(--c-line); }
.cmdk__in input { flex: 1; border: 0; background: none; font-size: var(--fs-16); min-width: 0; }
.cmdk__in .i { color: var(--c-ink-3); }
.cmdk__g { padding: var(--sp-12) var(--sp-12) var(--sp-4); font-size: var(--fs-11); font-weight: var(--w-med); letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--c-ink-3); }
.cmdk__i { width: 100%; display: flex; align-items: center; gap: var(--sp-12); min-height: 48px; padding: 0 var(--sp-12); border-radius: 12px; text-align: left; font-size: var(--fs-14); }
.cmdk__i small { color: var(--c-ink-3); margin-left: auto; font-size: var(--fs-12); }
.cmdk__i.on, .cmdk__i:hover { background: var(--c-bg); }
@media (max-width: 767.98px) { .cmdk { margin-top: 0; align-self: end; } }

/* ---------- Notifications ---------- */
.nf { width: min(400px, calc(100vw - 24px)); padding: 0; }
.nf__h { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-14) var(--sp-16) var(--sp-8); }
.nf__h b { font-size: var(--fs-16); font-weight: var(--w-med); }
.nf__l { max-height: 420px; overflow-y: auto; padding: 0 var(--sp-6) var(--sp-6); }
.nfi { width: 100%; display: flex; gap: var(--sp-12); padding: var(--sp-12) var(--sp-10); border-radius: 14px; text-align: left; }
.nfi:hover { background: var(--c-bg); }
.nfi__t { flex: 1; min-width: 0; font-size: var(--fs-14); line-height: 1.4; }
.nfi__t small { display: block; color: var(--c-ink-3); font-size: var(--fs-12); margin-top: var(--sp-2); }
.nfi.unread .nfi__t b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c-brand); margin-left: var(--sp-8); vertical-align: middle; }
.nf__f { border-top: 1px solid var(--c-line); padding: var(--sp-8); display: flex; }
.nf__f a { flex: 1; text-align: center; padding: var(--sp-10); border-radius: 12px; font-size: var(--fs-14); font-weight: var(--w-med); color: var(--c-brand-ink); }
.nf__f a:hover { background: var(--c-bg); }

/* ---------- Charts (hand-rolled SVG, no library) ---------- */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .gl { stroke: var(--c-line); stroke-width: 1; }
.chart .ax { font-size: 0.6875rem; fill: var(--c-ink-3); font-family: var(--font); }
.chart .ln { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .ln-1 { stroke: var(--c-brand); } .chart .ln-2 { stroke: var(--c-lavender); } .chart .ln-3 { stroke: var(--c-ink); } .chart .ln-4 { stroke: var(--c-ok); }
.chart .ar-1 { fill: url(#gArea1); } .chart .ar-2 { fill: url(#gArea2); }
.chart .bar { fill: var(--c-tint); transition: fill 160ms; } .chart .bar.on, .chart .bar:hover { fill: var(--c-brand); }
.chart .bar-2 { fill: var(--c-lav-2); }
.chart .dotp { fill: var(--c-white); stroke: var(--c-brand); stroke-width: 2.4; }
.chart .hl { stroke: var(--c-ink-3); stroke-dasharray: 3 4; }
.chart__tip { position: absolute; top: 0; transform: translate(-50%, -110%); padding: var(--sp-8) var(--sp-10); border-radius: 10px; background: var(--c-ink); color: var(--c-white); font-size: var(--fs-12); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 120ms; z-index: 2; line-height: 1.45; }
.chart__tip.on { opacity: 1; }
.chart__tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: var(--sp-6); }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-14); font-size: var(--fs-12); color: var(--c-ink-2); }
.legend span { display: inline-flex; align-items: center; gap: var(--sp-6); }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.spark { width: 100%; height: 40px; }
.spark path { fill: none; stroke: var(--c-brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark .sa { fill: url(#gArea1); stroke: none; }
.ring { width: 64px; height: 64px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 6; }
.ring .t { stroke: var(--c-bg-2); } .ring .p { stroke: var(--c-brand); stroke-linecap: round; stroke-dasharray: calc(var(--p) * 1) 100; transition: stroke-dasharray 800ms var(--ease-expo); }
.hbar { display: grid; gap: var(--sp-10); }
.hbar__r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-6) var(--sp-12); font-size: var(--fs-13); align-items: center; }
.hbar__r .prog { grid-column: 1 / -1; height: 6px; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-4); }
.cal__h { font-size: var(--fs-11); font-weight: var(--w-med); color: var(--c-ink-3); text-align: center; padding: var(--sp-6) 0; letter-spacing: 0.06em; text-transform: uppercase; }
.cal__d { min-height: 92px; padding: var(--sp-8); border-radius: 12px; background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line); display: flex; flex-direction: column; gap: var(--sp-4); font-size: var(--fs-12); text-align: left; min-width: 0; }
.cal__d.out { background: transparent; box-shadow: none; color: var(--c-ink-3); }
.cal__d.today { box-shadow: inset 0 0 0 1.5px var(--c-brand); }
.cal__n { font-size: var(--fs-13); font-weight: var(--w-med); }
.cal__e { display: block; padding: var(--sp-2) var(--sp-6); border-radius: 6px; background: var(--c-tint-hi); color: var(--c-brand-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.6875rem; }
.cal__e--wait { background: var(--st-wait-bg); color: var(--c-warn); }
@media (max-width: 767.98px) { .cal__d { min-height: 52px; padding: var(--sp-6); } .cal__e { width: 6px; height: 6px; padding: 0; border-radius: 50%; font-size: 0; background: var(--c-brand); } .cal__e--wait { background: var(--c-warn); } .cal__d .cal__ev { display: flex; gap: var(--sp-3); flex-wrap: wrap; } }
.dstrip { display: flex; gap: var(--sp-8); overflow-x: auto; scrollbar-width: none; padding: var(--sp-2); }
.dstrip::-webkit-scrollbar { display: none; }
.dday { text-align: center; flex: none; width: 58px; min-height: 70px; border-radius: 16px; display: grid; place-items: center; align-content: center; gap: var(--sp-2); background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line); font-size: var(--fs-12); color: var(--c-ink-2); }
.dday b { font-size: var(--fs-18); color: var(--c-ink); font-weight: var(--w-reg); font-variant-numeric: tabular-nums; }
.dday:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-brand) 40%, transparent); }
.dday.on { background: var(--c-ink); color: color-mix(in oklab, var(--c-white) 75%, transparent); box-shadow: none; } .dday.on b { color: var(--c-white); }
.dday:disabled { opacity: 0.4; pointer-events: none; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-8); }
.slot { text-align: center; min-height: 44px; border-radius: 12px; background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line-2); font-size: var(--fs-14); font-variant-numeric: tabular-nums; transition: box-shadow 160ms, background 160ms; }
.slot:hover { box-shadow: inset 0 0 0 1px var(--c-brand); }
.slot.on { background: var(--c-ink); color: var(--c-white); box-shadow: none; }
.slot:disabled { opacity: 0.35; text-decoration: line-through; pointer-events: none; }

/* ---------- Chat ---------- */
.chat { display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; height: calc(100dvh - var(--top-h) - 40px); min-height: 520px; padding: 0; overflow: hidden; gap: 0; }
.chat--2 { grid-template-columns: 320px minmax(0, 1fr); }
.chat--1 { grid-template-columns: minmax(0, 1fr); }
.chat__list { border-right: 1px solid var(--c-line); display: flex; flex-direction: column; min-height: 0; }
.chat__lh { padding: var(--sp-16); display: grid; gap: var(--sp-10); border-bottom: 1px solid var(--c-line); }
.chat__ll { overflow-y: auto; flex: 1; padding: var(--sp-6); }
.cv { width: 100%; display: flex; gap: var(--sp-12); padding: var(--sp-12) var(--sp-10); border-radius: 14px; text-align: left; align-items: center; }
.cv:hover { background: var(--c-bg); } .cv.on { background: var(--c-sel); }
.cv__t { flex: 1; min-width: 0; line-height: 1.35; } .cv__t b { display: flex; justify-content: space-between; gap: var(--sp-8); font-size: var(--fs-14); font-weight: var(--w-med); } .cv__t b time { font-size: var(--fs-11); color: var(--c-ink-3); font-weight: var(--w-reg); flex: none; } .cv__t small { display: block; color: var(--c-ink-3); font-size: var(--fs-13); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv__u { min-width: 20px; height: 20px; border-radius: 99px; background: var(--c-brand); color: var(--c-white); font-size: 0.6875rem; display: grid; place-items: center; padding: 0 var(--sp-6); font-weight: var(--w-semi); }
.chat__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat__h { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-12) var(--sp-16); border-bottom: 1px solid var(--c-line); min-height: 68px; }
.chat__msgs { flex: 1; overflow-y: auto; padding: var(--sp-20) clamp(var(--sp-14), 2vw, var(--sp-28)); display: flex; flex-direction: column; gap: var(--sp-6); background: linear-gradient(180deg, var(--c-bg), var(--c-white) 30%); }
.msg { max-width: min(78%, 560px); padding: var(--sp-10) var(--sp-14); border-radius: 18px 18px 18px 6px; background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line); font-size: var(--fs-14); line-height: 1.5; align-self: flex-start; overflow-wrap: anywhere; }
.msg--me { align-self: flex-end; background: var(--c-ink); color: var(--c-white); box-shadow: none; border-radius: 18px 18px 6px 18px; }
.msg__m { display: block; font-size: 0.6875rem; margin-top: var(--sp-4); color: var(--c-ink-3); }
.msg--me .msg__m { color: color-mix(in oklab, var(--c-white) 60%, transparent); text-align: right; }
.msg--sys { align-self: center; background: none; box-shadow: none; font-size: var(--fs-12); color: var(--c-ink-3); padding: var(--sp-6); }
.msg--ret { font-style: italic; color: var(--c-ink-3); background: transparent; }
.msg__att { display: flex; align-items: center; gap: var(--sp-10); padding: var(--sp-8) var(--sp-10); margin-top: var(--sp-6); border-radius: 12px; background: color-mix(in oklab, currentColor 8%, transparent); font-size: var(--fs-13); }
.msg__day { align-self: center; font-size: var(--fs-11); color: var(--c-ink-3); padding: var(--sp-10) 0 var(--sp-4); letter-spacing: 0.04em; text-transform: uppercase; }
.chat__notice { display: flex; gap: var(--sp-8); align-items: center; padding: var(--sp-8) var(--sp-16); font-size: var(--fs-12); color: var(--c-ink-2); background: var(--st-wait-bg); }
.chat__notice .i { width: var(--ic-16); height: var(--ic-16); color: var(--c-warn); }
.comp { display: flex; align-items: flex-end; gap: var(--sp-6); padding: var(--sp-10) var(--sp-12); border-top: 1px solid var(--c-line); }
.comp textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; border: 0; padding: var(--sp-11) var(--sp-14); border-radius: 22px; background: var(--c-bg); font-size: var(--fs-14); line-height: 1.4; }
.comp textarea:focus { box-shadow: inset 0 0 0 1.5px var(--c-brand); }
.comp .ib { width: 44px; height: 44px; }
.comp__send { background: var(--c-ink); color: var(--c-white); }
.comp__send:hover { background: var(--c-brand-2); }
.comp__rec { display: none; }
.comp.is-rec { flex-wrap: wrap; }
.comp.is-rec .comp__rec { display: flex; align-items: center; gap: var(--sp-8); flex: 1 0 100%; min-height: 36px; margin-bottom: var(--sp-4); padding: 0 var(--sp-14); border-radius: 18px; background: var(--st-err-bg); color: var(--c-err); font-size: var(--fs-13); font-weight: var(--w-semi); }
.comp__rec b { font-variant-numeric: tabular-nums; }
.comp__rec .mute-3 { margin-left: auto; font-weight: var(--w-reg); }
.comp__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-err); animation: recPulse 1.2s ease-out infinite; }
@keyframes recPulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--c-err) 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.comp.is-rec [data-voice] { background: var(--c-err); }
.comp.is-rec [data-voice] .i { color: var(--c-white); }
.chat__side { border-left: 1px solid var(--c-line); overflow-y: auto; padding: var(--sp-18); display: grid; gap: var(--sp-16); align-content: start; }
@media (max-width: 1279.98px) { .chat { grid-template-columns: 300px minmax(0, 1fr); } .chat__side { display: none; } }
@media (max-width: 767.98px) {
  .chat, .chat--2 { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 64px - var(--bnav-h) - 24px - env(safe-area-inset-bottom)); border-radius: 18px; }
  .chat.is-thread .chat__list { display: none; } .chat:not(.is-thread) .chat__main { display: none; }
  .msg { max-width: 86%; }
}

/* ---------- Product card ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: var(--gap); }
.pc { position: relative; display: flex; flex-direction: column; background: var(--c-white); border-radius: var(--tile-r); box-shadow: var(--sh-1), inset 0 0 0 1px var(--c-line); overflow: hidden; transition: box-shadow 200ms; min-width: 0; }
.pc:hover { box-shadow: var(--sh-2), inset 0 0 0 1px color-mix(in oklab, var(--c-brand) 28%, transparent); }
.pc.is-sel { box-shadow: inset 0 0 0 2px var(--c-ink); }
.pc__img { position: relative; height: 210px; overflow: hidden; background: radial-gradient(70% 70% at 50% 60%, var(--c-white), var(--c-bg) 75%); display: grid; place-items: center; padding: var(--sp-16); }
.pc__img img { position: absolute; inset: var(--sp-18) 12%; width: 76%; height: calc(100% - 36px); object-fit: contain;  transition: transform 500ms var(--ease-expo); }
.pc:hover .pc__img img { transform: translateY(-3px) scale(1.02); }
.pc__tags { position: absolute; top: var(--sp-12); left: var(--sp-12); right: var(--sp-12); display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.pc__chk { position: absolute; top: var(--sp-10); right: var(--sp-10); }
.pc__b { padding: var(--sp-14) var(--sp-16) var(--sp-16); display: grid; gap: var(--sp-10); flex: 1; align-content: start; }
.pc__n { font-size: var(--fs-15); font-weight: var(--w-med); line-height: 1.3; }
.pc__n small { display: block; font-size: var(--fs-12); color: var(--c-ink-3); font-weight: var(--w-reg); margin-top: var(--sp-2); }
.pc__p { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-8); }
.pc__p b { font-size: var(--fs-18); font-weight: var(--w-reg); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pc__f { display: flex; gap: var(--sp-8); margin-top: auto; padding-top: var(--sp-4); }
.pc__f > * { flex: 1; }
.pc--row { flex-direction: row; } .pc--row .pc__img { width: 120px; aspect-ratio: 1; flex: none; }
.var { display: flex; flex-wrap: wrap; gap: var(--sp-6); }
.var button { min-height: 32px; padding: 0 var(--sp-10); border-radius: 10px; font-size: var(--fs-12); box-shadow: inset 0 0 0 1px var(--c-line-2); background: var(--c-white); font-variant-numeric: tabular-nums; }
.var button:hover { box-shadow: inset 0 0 0 1px var(--c-brand); }
.var button.on { background: var(--c-ink); color: var(--c-white); box-shadow: none; }
.var button:disabled { opacity: 0.4; }
.qty { display: inline-flex; align-items: center; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--c-line-2); background: var(--c-white); }
.qty button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; }
.qty button:hover { background: var(--c-bg); }
.qty button .i { width: var(--ic-14); height: var(--ic-14); }
.qty input { width: 44px; text-align: center; border: 0; background: none; font-variant-numeric: tabular-nums; font-size: var(--fs-14); }
.bulk { position: sticky; bottom: var(--sp-16); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-10); padding: var(--sp-10) var(--sp-10) var(--sp-10) var(--sp-18); margin-top: var(--gap); border-radius: 20px; background: var(--c-ink); color: var(--c-white); box-shadow: var(--sh-3); animation: toastIn 320ms var(--ease-expo); }
.bulk .b { background: transparent; color: var(--c-white); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-white) 26%, transparent); }
.bulk .b:hover { background: color-mix(in oklab, var(--c-white) 10%, transparent); }
.bulk .b .i { color: var(--c-tint-2); }
.bulk .b--ink { background: var(--c-white); color: var(--c-ink); box-shadow: none; } .bulk .b--ink .i { color: var(--c-brand); }
@media (max-width: 767.98px) { .bulk { bottom: calc(var(--bnav-h) + var(--sp-12) + env(safe-area-inset-bottom)); } }

/* ---------- Media tiles ---------- */
.media { position: relative; border-radius: var(--tile-r); overflow: hidden; background: var(--g-skeleton); min-height: 220px; color: var(--c-white); display: flex; flex-direction: column; justify-content: flex-end; padding: var(--tile-p); }
.media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, color-mix(in oklab, var(--c-deep) 72%, transparent)); z-index: 0; }
.media > *:not(img) { position: relative; z-index: 1; }
.glass { background: color-mix(in oklab, var(--c-white) 16%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c-white) 26%, transparent); border-radius: 18px; padding: var(--sp-14) var(--sp-16); }
.dev { display: grid; justify-items: center; gap: var(--sp-8); padding: var(--sp-14) var(--sp-10); border-radius: 18px; background: var(--c-bg); text-align: center; font-size: var(--fs-13); min-width: 0; }
.dev img { height: 64px; width: auto; object-fit: contain; }
.dev.on { background: var(--c-tint-hi); }

/* Health metric card */
.met { display: flex; flex-direction: column; gap: var(--sp-8); }
.met__v { font-size: var(--fs-30); font-weight: var(--w-light); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1; }
.met__v small { font-size: var(--fs-13); color: var(--c-ink-3); letter-spacing: 0; margin-left: var(--sp-4); }

/* Wizard frame */
.wiz { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.wiz__nav { position: sticky; top: calc(var(--top-h) + var(--sp-8)); display: grid; gap: var(--sp-4); padding: var(--sp-10); }
.wiz__s { display: flex; align-items: center; gap: var(--sp-12); min-height: 48px; padding: 0 var(--sp-10); border-radius: 14px; font-size: var(--fs-14); color: var(--c-ink-2); text-align: left; width: 100%; }
.wiz__s:hover { background: var(--c-bg); }
.wiz__s.on { background: var(--c-bg); color: var(--c-ink); font-weight: var(--w-med); }
.wiz__s .step__n { width: 28px; height: 28px; }
.wiz__s.done .step__n { background: var(--st-ok-bg); color: var(--c-ok); }
.wiz__s.on .step__n { background: var(--c-ink); color: var(--c-white); }
.wiz__f { display: flex; flex-wrap: wrap; gap: var(--sp-10); justify-content: space-between; align-items: center; padding-top: var(--sp-18); border-top: 1px solid var(--c-line); margin-top: var(--sp-8); }
@media (max-width: 1023.98px) { .wiz { grid-template-columns: minmax(0, 1fr); } .wiz__nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; padding: var(--sp-6); } .wiz__s { width: auto; flex: none; } .wiz__s span:not(.step__n) { display: none; } .wiz__s.on span:not(.step__n) { display: inline; } }
.opt { display: flex; gap: var(--sp-12); align-items: flex-start; padding: var(--sp-14) var(--sp-16); border-radius: 16px; background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line-2); cursor: pointer; transition: box-shadow 160ms, background 160ms; font-size: var(--fs-14); }
.opt:hover { box-shadow: inset 0 0 0 1px var(--c-brand); }
.opt:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--c-ink); background: var(--c-bg); }
.opt input { margin-top: var(--sp-2); }
.opt b { display: block; font-weight: var(--w-med); } .opt small { display: block; color: var(--c-ink-2); font-size: var(--fs-13); margin-top: var(--sp-2); }
.opts { display: grid; gap: var(--sp-10); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.drop { display: grid; justify-items: center; gap: var(--sp-6); padding: var(--sp-22); border-radius: 16px; background: var(--c-bg); box-shadow: inset 0 0 0 1.5px dashed var(--c-line-2); text-align: center; font-size: var(--fs-13); color: var(--c-ink-2); outline: 1.5px dashed var(--c-line-2); outline-offset: -1.5px; }
.drop b { color: var(--c-ink); font-weight: var(--w-med); }
.drop .i { width: var(--ic-26); height: var(--ic-26); color: var(--c-brand); }
.fileli { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-10) var(--sp-12); border-radius: 14px; background: var(--c-bg); font-size: var(--fs-14); }

/* Line chart: HTML axes + stretched SVG plot */
:root { --lg1: var(--c-brand); --lg2: var(--c-lavender); --lg3: var(--c-ink); --lg4: var(--c-ok); }
.lc__w { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-10); }
.lc__y { position: relative; width: 44px; height: var(--h); font-size: 0.6875rem; color: var(--c-ink-3); text-align: right; }
.lc__y span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lc__p { position: relative; height: var(--h); }
.lc__p svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lc__x { position: relative; height: 18px; margin: var(--sp-8) 0 0 var(--sp-54); font-size: 0.6875rem; color: var(--c-ink-3); }
.lc__x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.lc__x span:first-child { transform: none; }
.lc__dot { position: absolute; width: 12px; height: 12px; margin: calc(-1 * var(--sp-6)) 0 0 calc(-1 * var(--sp-6)); border-radius: 50%; background: var(--c-white); box-shadow: 0 0 0 2.5px var(--c-brand); opacity: 0; pointer-events: none; transition: opacity 120ms; }
.lc__now { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--c-white); box-shadow: 0 0 0 2px var(--c, var(--c-brand)); pointer-events: none; }
.lc__x span.cur { color: var(--c-ink); font-weight: var(--w-med); }
/* Bar chart */
.bc__p { position: relative; height: var(--h); display: flex; align-items: flex-end; gap: clamp(var(--sp-3), 0.6vw, var(--sp-8)); }
.bc__b { flex: 1; height: 100%; display: flex; align-items: flex-end; border-radius: 8px; }
.bc__b i { display: block; width: 100%; height: max(4px, var(--v)); border-radius: 8px 8px 4px 4px; background: var(--c-tint); transition: background 160ms, height 600ms var(--ease-expo); }
.bc__b:hover i, .bc__b.on i { background: var(--c-brand); }
.bc__x { display: flex; gap: clamp(var(--sp-3), 0.6vw, var(--sp-8)); margin-top: var(--sp-8); font-size: 0.6875rem; color: var(--c-ink-3); }
.bc__x span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; }
.b--danger-ink { background: var(--c-err); color: var(--c-white); box-shadow: none; }
.b--danger-ink:hover { background: color-mix(in oklab, var(--c-err) 85%, var(--c-black)); }

.tbl td .cell__t b { white-space: normal; }
.f > .seg, fieldset > .seg, .f > .var { justify-self: start; }
@media (max-width: 767.98px) { .pgrid:not([style]) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-10); } .pgrid:not([style]) .pc__img { height: 150px; } .pgrid:not([style]) .pc__b { padding: var(--sp-12); gap: var(--sp-8); } .pgrid:not([style]) .pc__n { font-size: var(--fs-14); } .pgrid:not([style]) .pc__f .b { padding: 0 var(--sp-8); font-size: 0.75rem; } .pgrid:not([style]) .pc__p { flex-wrap: wrap; } }
