/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px;
  border-radius: var(--r-pill);
  font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background .15s, color .15s, opacity .15s, transform .05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover:not(:disabled) { background: var(--ink-2); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-ink); }
.btn-gold { background: var(--gold); color: var(--on-ink); }
.btn-gold:hover:not(:disabled) { filter: brightness(.94); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover:not(:disabled) { background: var(--surface-3); }
.btn-ghost { color: var(--ink-2); padding: 0 14px; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-danger:hover:not(:disabled) { background: var(--bad); color: #fff; }
.btn-outline { border: 1.5px dashed var(--line-2); color: var(--ink); background: transparent; }
.btn-outline:hover:not(:disabled) { border-color: var(--ink-2); }
.btn:disabled { opacity: .42; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 46px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }
.btn .kbd { background: rgba(255,255,255,.16); color: inherit; border-color: transparent; }

.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); font-family: var(--f-display); font-size: 11.5px; color: var(--muted); direction: ltr; }

/* ---------- Cards & sections ---------- */
.card { background: var(--surface); border-radius: var(--r-xl); padding: var(--s6); min-width: 0; }
.card-tight { padding: var(--s5); }
.card-flush { padding: 0; overflow: hidden; }
.card-dark { background: var(--ink); color: var(--on-ink); }
.card-dark .muted { color: color-mix(in srgb, var(--on-ink) 65%, transparent); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.card-title { font-family: var(--f-display); font-size: var(--fs-xl); font-weight: 600; line-height: 1.35; }
.card-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.card-link { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.card-link:hover { background: var(--surface-3); }
.inset { background: var(--surface-2); border-radius: var(--r-lg); padding: var(--s4); }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.bold { font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: var(--s4) 0; }

/* Page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s6); flex-wrap: wrap; }
.page-head h1 { font-family: var(--f-display); font-size: var(--fs-3xl); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.page-head .lead { color: var(--muted); font-size: var(--fs-lg); margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs svg { opacity: .6; }

/* ---------- Pills: filters, tabs, segmented ---------- */
.pills { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  font-weight: 500; font-size: 14px; white-space: nowrap;
}
.pill:hover { color: var(--ink); background: var(--surface-3); }
.pill[aria-pressed="true"], .pill[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.pill .count { font-family: var(--f-display); font-size: 12px; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; background: var(--surface-2); color: var(--ink-2); }
.pill[aria-pressed="true"] .count, .pill[aria-selected="true"] .count { background: rgba(255,255,255,.18); color: inherit; }
:root[data-theme="dark"] .pill[aria-pressed="true"] .count, :root[data-theme="dark"] .pill[aria-selected="true"] .count { background: rgba(0,0,0,.12); }
.pills.on-soft .pill { background: var(--surface-2); }

.tabs { display: flex; gap: 4px; padding: 5px; background: var(--surface-2); border-radius: var(--r-pill); width: max-content; max-width: 100%; overflow-x: auto; }
.tab { height: 40px; padding: 0 18px; border-radius: var(--r-pill); color: var(--ink-2); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.tabs.on-surface { background: var(--surface); }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); }
.seg button { height: 34px; min-width: 44px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.seg button:hover { color: var(--ink); background: var(--surface-3); }
.seg button[aria-pressed="true"] { color: #fff; }
.seg button[data-v="present"][aria-pressed="true"] { background: var(--ok); }
.seg button[data-v="late"][aria-pressed="true"] { background: var(--warn); }
.seg button[data-v="absent"][aria-pressed="true"] { background: var(--bad); }
.seg button[data-v="excused"][aria-pressed="true"] { background: var(--info); }
.seg button[data-v="partial"][aria-pressed="true"] { background: var(--ink-2); }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 12.5px; color: var(--bad); display: flex; align-items: center; gap: 6px; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 16px;
  border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface);
  transition: border-color .15s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 16px; resize: vertical; line-height: 1.7; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 20px 20px, 15px 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 36px; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; right: 16px; color: var(--muted); pointer-events: none; }
.search .input { padding-right: 44px; border-radius: var(--r-pill); background: var(--surface); border-color: transparent; height: 42px; }
.search.on-soft .input { background: var(--surface-2); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; margin: 0; flex: none; cursor: pointer; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--on-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input:indeterminate { background: var(--ink); border-color: var(--ink); }
.check input:indeterminate::after { content: ""; width: 10px; height: 2px; background: var(--on-ink); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { appearance: none; position: absolute; inset: 0; margin: 0; border-radius: 13px; background: var(--line-2); cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); transition: right .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { right: 21px; }

/* Option cards (from the export dialog reference) */
.options { display: grid; gap: var(--s3); }
.option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-height: 60px;
  border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface);
  text-align: start; cursor: pointer;
}
.option:hover { border-color: var(--line-2); }
.option[aria-checked="true"], .option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.option .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.option[aria-checked="true"] .radio { border-color: var(--accent); }
.option[aria-checked="true"] .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.option .o-body { display: flex; flex-direction: column; min-width: 0; }
.option .o-title { font-weight: 600; }
.option .o-sub { font-size: 12.5px; color: var(--muted); }

/* ---------- Badges, dots, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.ink { background: var(--ink); color: var(--on-ink); }
.badge.sm { height: 22px; padding: 0 9px; font-size: 11.5px; }
.badge.proposed { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); font-weight: 500; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-family: var(--f-display); font-size: 14px; flex: none; color: #fff; background: var(--accent); }
.avatar.sm { width: 32px; height: 32px; font-size: 12.5px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }
/* Avatars stay within the brand palette: brand blue-green, its dark shade, and greys */
.avatar[data-tone="0"], .avatar[data-tone="4"] { background: #2e7a93; }
.avatar[data-tone="1"], .avatar[data-tone="5"] { background: #235d71; }
.avatar[data-tone="2"], .avatar[data-tone="6"] { background: #3d4347; }
.avatar[data-tone="3"], .avatar[data-tone="7"] { background: #6b7378; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-inline-start: -10px; }
.avatar-stack .avatar:first-child { margin-inline-start: 0; }
.avatar-stack .more { background: var(--ink); color: var(--on-ink); }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .p-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.person .p-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .p-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.person:hover .p-name, a.person:hover .p-name { text-decoration: underline; text-underline-offset: 3px; }

.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend-row .grow { flex: 1; }
.ldot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); flex: none; }
.ldot.accent { background: var(--accent); }
.ldot.hatch { background: var(--hatch); border: 1px solid var(--line-2); }
.ldot.muted { background: var(--line-2); }

/* ---------- Progress ---------- */
.bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; display: flex; gap: 4px; }
.bar.thick { height: 14px; border-radius: 7px; }
.bar.thin { height: 6px; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.bar > span.accent { background: var(--accent); }
.bar > span.hatch { background: var(--hatch-accent); }
.bar > span.ok { background: var(--ok); }
.bar > span.warn { background: var(--warn); }
.bar > span.gold { background: var(--gold); }
.bar.split { background: transparent; }
.bar.split > span.rest { background: var(--hatch); }
.ring { --p: 0; --c: var(--accent); width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.ring > * { position: relative; text-align: center; line-height: 1.2; }
.ring b { font-family: var(--f-display); font-size: 22px; }
.ring.sm { width: 64px; height: 64px; }
.ring.sm::before { inset: 7px; }
.ring.sm b { font-size: 15px; }
.ring.lg { width: 150px; height: 150px; }
.ring.lg::before { inset: 16px; }
.ring.lg b { font-size: 34px; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; gap: var(--s4); }
.stat { background: var(--surface); border-radius: var(--r-xl); padding: var(--s5); display: flex; flex-direction: column; gap: 10px; min-width: 0; text-align: start; transition: transform .15s; }
a.stat:hover, button.stat:hover { transform: translateY(-2px); }
.stat .s-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .s-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.stat .s-ico.accent { background: var(--accent); color: #fff; }
.stat .s-label { color: var(--muted); font-size: 13.5px; }
.stat .s-val { display: flex; align-items: baseline; gap: 8px; }
.stat .s-val b { font-family: var(--f-display); font-size: 34px; font-weight: 600; line-height: 1.1; }
.stat .s-val span { color: var(--muted); font-size: 13.5px; }
.stat .s-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); gap: 8px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-xl); background: var(--surface); }
.tbl { width: 100%; font-size: 14px; }
.tbl th { text-align: start; font-weight: 500; color: var(--muted); font-size: 13px; padding: 14px 16px; white-space: nowrap; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.tbl th button.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font-weight: inherit; }
.tbl th button.sort:hover { color: var(--ink); }
.tbl th button.sort[data-active="true"] { color: var(--ink); font-weight: 600; }
.tbl td { padding: 0 16px; height: var(--row-h); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: var(--surface-2); }
.tbl tbody tr[aria-selected="true"] td { background: var(--accent-soft); }
.tbl td.num, .tbl th.num { text-align: start; }
.tbl .col-check { width: 44px; padding-inline-end: 0; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); gap: 12px; }
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.bulkbar { display: flex; align-items: center; gap: var(--s2); padding: 8px 8px 8px 18px; border-radius: var(--r-pill); background: var(--ink); color: var(--on-ink); }
.bulkbar .btn-soft { background: rgba(255,255,255,.12); color: inherit; }
:root[data-theme="dark"] .bulkbar .btn-soft { background: rgba(0,0,0,.12); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
button.list-row, a.list-row { text-align: start; width: 100%; border-radius: var(--r-md); padding-inline: 10px; }
button.list-row:hover, a.list-row:hover { background: var(--surface-2); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- Banners & empty states ---------- */
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: var(--r-lg); background: var(--info-soft); color: var(--ink); font-size: 14px; }
.banner svg { color: var(--info); margin-top: 2px; }
.banner.warn { background: var(--warn-soft); } .banner.warn svg { color: var(--warn); }
.banner.bad { background: var(--bad-soft); } .banner.bad svg { color: var(--bad); }
.banner.ok { background: var(--ok-soft); } .banner.ok svg { color: var(--ok); }
.banner.proto { background: transparent; border: 1.5px dashed var(--line-2); color: var(--ink-2); }
.banner.proto svg { color: var(--muted); }
.banner .grow { flex: 1; }
.banner b { font-weight: 600; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 48px 24px; color: var(--muted); }
.empty .e-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); }
.empty h3 { color: var(--ink); font-family: var(--f-display); font-size: 18px; font-weight: 600; }
.empty p { max-width: 42ch; font-size: 14px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Overlays: modal, drawer, panel, popover ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  animation: pop .18s ease;
}
.modal.wide { width: min(760px, calc(100vw - 32px)); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 8px; }
.modal-head h2 { font-family: var(--f-display); font-size: 22px; font-weight: 600; line-height: 1.35; }
.modal-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.modal-body { padding: 16px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 16px 28px 24px; border-top: 1px solid var(--line); flex-direction: row-reverse; }
.modal-foot .grow { flex: 1; }
.close-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.close-btn:hover { background: var(--surface-3); color: var(--ink); }

.drawer {
  position: fixed; top: 12px; bottom: 12px; left: 12px;
  width: min(480px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  animation: slide .2s ease;
}
.drawer.wide { width: min(620px, calc(100vw - 24px)); }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } }
.drawer .modal-body { flex: 1; }

.panel {
  position: fixed; top: 96px; bottom: 16px; left: 24px;
  width: 400px;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  animation: slide .2s ease; z-index: 40;
}
.panel .modal-body { flex: 1; }

.popover { position: fixed; z-index: 70; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 8px; min-width: 220px; animation: fade .12s ease; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14px; text-align: start; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item .kbd { margin-inline-start: auto; }
.menu-item.danger { color: var(--bad); }
.menu-label { font-size: 11.5px; color: var(--muted); padding: 8px 12px 4px; }

/* Toasts */
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: var(--r-lg); background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-pop); font-size: 14px; animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.toast .t-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); flex: none; }
.toast.ok .t-ico { background: var(--ok); color: #fff; }
.toast.bad .t-ico { background: var(--bad); color: #fff; }
.toast.warn .t-ico { background: var(--warn); color: #fff; }
.toast .grow { flex: 1; line-height: 1.45; }
.toast .t-sub { font-size: 12.5px; opacity: .7; }
.toast .t-act { height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: rgba(255,255,255,.16); font-weight: 600; font-size: 13px; color: inherit; white-space: nowrap; }
:root[data-theme="dark"] .toast .t-act, :root[data-theme="dark"] .toast .t-ico { background: rgba(0,0,0,.12); }
.toast .t-x { opacity: .6; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: inherit; }
.toast .t-x:hover { opacity: 1; }

/* Command palette */
.palette { position: fixed; top: 12vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); overflow: hidden; animation: fade .12s ease; }
.palette .p-input { display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 64px; border-bottom: 1px solid var(--line); }
.palette .p-input input { flex: 1; border: 0; background: transparent; height: 100%; font-size: 17px; outline: none; }
.palette .p-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette .p-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r-md); text-align: start; }
.palette .p-item[aria-selected="true"], .palette .p-item:hover { background: var(--surface-2); }
.palette .p-item .p-kind { margin-inline-start: auto; font-size: 12px; color: var(--muted); }

/* Steps */
.steps { display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; align-items: flex-start; gap: 14px; padding: 12px; border-radius: var(--r-md); text-align: start; width: 100%; }
.step .s-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; background: var(--surface-2); color: var(--ink-2); flex: none; }
.step .s-body { display: flex; flex-direction: column; line-height: 1.4; padding-top: 5px; min-width: 0; }
.step .s-title { font-weight: 600; }
.step .s-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.step[data-state="done"] .s-num { background: var(--ok); color: #fff; }
.step[data-state="current"] { background: var(--surface-2); }
.step[data-state="current"] .s-num { background: var(--ink); color: var(--on-ink); }
.step[data-state="locked"] { opacity: .55; }
button.step:not(:disabled):hover { background: var(--surface-2); }

.hstepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hstep { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 6px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.hstep b { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--f-display); font-size: 12.5px; }
.hstep[data-state="done"] b { background: var(--ok); color: #fff; }
.hstep[data-state="current"] { background: var(--ink); color: var(--on-ink); }
.hstep[data-state="current"] b { background: var(--on-ink); color: var(--ink); }
.hstep-sep { width: 18px; height: 1.5px; background: var(--line-2); }

/* Charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--f-display); font-size: 11px; fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 5; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--on-ink); padding: 10px 12px; border-radius: 14px; font-size: 12.5px; line-height: 1.6; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: var(--shadow-pop); }
.chart-tip b { font-family: var(--f-display); }
.chart-box { position: relative; }

.vbars { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding-top: 28px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.vbar .v-col { width: 100%; max-width: 64px; border-radius: 16px 16px 10px 10px; background: var(--hatch); border: 1px solid var(--line); position: relative; transition: background .15s; }
.vbar .v-col.on { background: var(--hatch-accent); border-color: transparent; }
.vbar .v-col .v-val { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-family: var(--f-display); font-size: 13px; font-weight: 600; white-space: nowrap; }
.vbar .v-col.on .v-val { background: var(--ink); color: var(--on-ink); padding: 1px 8px; border-radius: 8px; top: -30px; }
.vbar .v-lab { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.3; }
button.vbar:hover .v-col:not(.on) { background: repeating-linear-gradient(135deg, var(--muted) 0 3px, transparent 3px 7px); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s6); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
