/* One Talibon: design tokens, shared components, public and app layouts, print rules.
   Coastal civic: deep sea teal, sand, one gold accent. Light theme only (projectors). */

/* ------------------------------------------------------------------ tokens */
:root {
  --sea-950: #071f29; --sea-900: #0b2e3c; --sea-800: #0c4a66; --sea-700: #0f5266; --sea-600: #14697e; --sea-500: #1b7f96;
  --sea-300: #7dbccd; --sea-200: #b9dce5; --sea-100: #e0f0f4; --sea-50: #f0f8fa;
  --page: #fbfaf6; --sand: #f6f1e7; --sand-200: #ece4d2; --surface: #ffffff;
  --line: #e2ded3; --line-strong: #cfc9ba;
  --ink: #17262b; --ink-2: #33474e; --muted: #5d6f75;
  --gold: #c8962e; --gold-600: #a87a1c; --gold-100: #f6ecd2; --gold-ink: #6e5010;
  --ok: #2e8b57; --ok-ink: #1f6b41; --ok-bg: #e3f2e9;
  --due: #d98e1f; --due-ink: #7a4a00; --due-bg: #fcefd6;
  --overdue: #d9553f; --overdue-ink: #a8341f; --overdue-bg: #fbe5e0;
  --info-bg: #e0f0f4; --info-ink: #0f5266;
  --focus: #0a84a3; --focus-dark: #f0c35b;
  --c1: #0a84a3; --c2: #c8962e; --c3: #8a5a9c; --c4: #d9553f; --c5: #3f6fc4;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --fs-xs: 12px; --fs-sm: 13.5px; --fs-base: 15px; --fs-md: 16.5px; --fs-lg: 20px; --fs-xl: 26px; --fs-2xl: 34px; --fs-hero: 52px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(11, 46, 60, .06);
  --shadow-md: 0 1px 2px rgba(11, 46, 60, .05), 0 8px 24px -10px rgba(11, 46, 60, .16);
  --shadow-lg: 0 2px 6px rgba(11, 46, 60, .08), 0 24px 60px -16px rgba(11, 46, 60, .32);
  --rail-w: 248px; --topbar-h: 68px; --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --head: var(--sea-900); --link: var(--sea-700);
  --head: var(--sea-900); --link: var(--sea-700);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: var(--fs-base)/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--head); letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-xl); font-weight: 700; }
h3 { font-size: var(--fs-lg); font-weight: 650; }
h4 { font-size: var(--fs-md); font-weight: 650; }
p { margin: 0 0 var(--s3); }
p:last-child { margin-bottom: 0; }
a { color: var(--sea-600); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--head); }
img, svg { max-width: 100%; }
small, .small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.rail :focus-visible, .pubfoot :focus-visible, .tabbar :focus-visible, .on-dark :focus-visible { outline-color: var(--focus-dark); }
::selection { background: var(--sea-200); }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 200; background: var(--sea-900); color: #fff; padding: 10px 16px; border-radius: var(--r-md); text-decoration: none; font-weight: 600; transition: top .15s; }
.skip:focus { top: 12px; }
.tnum, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.serif { font-family: var(--font-serif); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.eyebrow.gold { color: var(--gold-ink); }

/* utilities for layout */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.stack > * + * { margin-top: var(--s4); }
.stack-lg > * + * { margin-top: var(--s6); }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.grow { flex: 1 1 0; min-width: 0; }
.grid { display: grid; gap: var(--s4); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; }
.grid.side-main { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.7fr); align-items: start; }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid.main-side, .grid.side-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); } .container { padding: 0 18px; } }

/* ------------------------------------------------------------------ icons, avatar, logo */
.icon { display: inline-block; flex: none; vertical-align: -0.2em; }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--sea-100); color: var(--link); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.logo { position: relative; display: inline-block; flex: none; line-height: 0; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.logo svg { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: var(--fs-base); line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--sea-50); border-color: var(--sea-300); color: var(--head); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--sea-700); border-color: var(--sea-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--sea-900); border-color: var(--head); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--sea-950); }
.btn-gold:hover { background: var(--gold); border-color: var(--gold); color: var(--sea-950); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--link); }
.btn-ghost:hover { background: var(--sea-100); border-color: transparent; }
.btn-danger { background: #c4432e; border-color: #c4432e; color: #fff; }
.btn-danger:hover { background: #a8341f; border-color: #a8341f; color: #fff; }
.btn-ok { background: var(--ok-ink); border-color: var(--ok-ink); color: #fff; }
.btn-ok:hover { background: #17542f; border-color: #17542f; color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); gap: 6px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: var(--fs-md); border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--sea-100); color: var(--head); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .btn-sm { min-height: 44px; } }

/* ------------------------------------------------------------------ card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: var(--s5); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); padding: var(--s5) var(--s5) 0; }
.card-head + .card-body { padding-top: var(--s4); }
.card-title { font-size: var(--fs-md); font-weight: 650; color: var(--head); letter-spacing: -.005em; }
.card-sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.card.flush .card-body { padding: 0; }
.card.tone-sand { background: var(--sand); border-color: var(--sand-200); box-shadow: none; }
.card.tone-sea { background: linear-gradient(160deg, var(--sea-900), var(--sea-700)); color: var(--deep-text); border: 0; }
.card.tone-sea .card-title, .card.tone-sea h3, .card.tone-sea h4 { color: #fff; }
.card.tone-sea .card-sub { color: #a9c6cf; }
.card.is-link { transition: box-shadow .18s, transform .18s, border-color .18s; text-decoration: none; color: inherit; display: block; }
.card.is-link:hover { box-shadow: var(--shadow-md); border-color: var(--sea-300); transform: translateY(-1px); }
@media (max-width: 640px) { .card-body { padding: var(--s4); } .card-head { padding: var(--s4) var(--s4) 0; } }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin: 0 0 var(--s4); flex-wrap: wrap; }
.section-head h2, .section-head h3 { font-size: var(--fs-lg); font-weight: 650; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-intro .lede { margin: 0; max-width: 62ch; color: var(--ink-2); font-size: var(--fs-md); }
.page-intro .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* ------------------------------------------------------------------ badges and chips */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 650;
  line-height: 1.5; background: var(--sand); color: var(--ink-2); white-space: nowrap; vertical-align: middle;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge .icon { width: 13px; height: 13px; }
.b-ok { background: var(--ok-bg); color: var(--ok-ink); }
.b-due { background: var(--due-bg); color: var(--due-ink); }
.b-overdue { background: var(--overdue-bg); color: var(--overdue-ink); }
.b-info { background: var(--info-bg); color: var(--info-ink); }
.b-gold { background: var(--gold-100); color: var(--gold-ink); }
.b-sea { background: var(--sea-900); color: #fff; }
.b-neutral { background: var(--sand); color: var(--ink-2); }
.badge-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--gold); color: var(--sea-950); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 550; text-decoration: none; }
a.chip:hover, button.chip:hover { border-color: var(--sea-500); color: var(--head); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--sea-900); border-color: var(--head); color: #fff; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.xfade { --fade-l: 0px; --fade-r: 0px; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%); }
.xfade[data-fade~="l"] { --fade-l: 28px; }
.xfade[data-fade~="r"] { --fade-r: 36px; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--muted); font-weight: 600; white-space: nowrap; position: relative; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--head); }
.tab[aria-selected="true"] { color: var(--head); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold); }
.tab .count { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: var(--sand); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .count { background: var(--sea-900); color: #fff; }
.tabs.pills { border: 0; gap: 8px; }
.tabs.pills .tab { border: 1px solid var(--line-strong); border-radius: 999px; min-height: 40px; background: var(--surface); }
.tabs.pills .tab[aria-selected="true"] { background: var(--sea-900); border-color: var(--head); color: #fff; }
.tabs.pills .tab[aria-selected="true"]::after { display: none; }
.tabs.pills .tab[aria-selected="true"] .count { background: rgba(255, 255, 255, .2); color: #fff; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: var(--fs-sm); font-weight: 650; color: var(--ink); }
.field .req { color: var(--overdue-ink); margin-left: 2px; }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.field .err { display: none; font-size: var(--fs-sm); color: var(--overdue-ink); font-weight: 550; }
.field.has-error .err { display: block; }
.field.has-error .input { border-color: var(--overdue); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d6f75' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input::placeholder, .textarea::placeholder { color: #8a979c; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--sea-300); }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid rgba(10, 132, 163, .35); outline-offset: 0; border-color: var(--sea-500); }
.input[readonly], .input[disabled], .select[disabled] { background: var(--sand); color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--sea-700); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.form-grid .full { grid-column: 1 / -1; }
.form { display: flex; flex-direction: column; gap: var(--s4); }
.form-error { display: none; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--overdue-bg); color: var(--overdue-ink); font-weight: 550; font-size: var(--fs-sm); border: 1px solid #f1c3ba; }
.form-error.show { display: flex; }
.form-actions { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--s2); }
.search { position: relative; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 18px; height: 18px; }
.search .input { padding-left: 40px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .input, .select, .textarea { font-size: 16px; } }

/* ------------------------------------------------------------------ table */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.tbl-wrap.bare { border: 0; border-radius: 0; background: transparent; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl caption { text-align: left; padding: 12px 16px; color: var(--muted); }
.tbl th { text-align: left; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; background: var(--page); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; text-transform: inherit; letter-spacing: inherit; font-weight: inherit; }
.tbl th button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.dense td { padding: 8px 16px; }
.tbl tbody tr:hover { background: var(--sea-50); }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:focus-visible { outline-offset: -3px; }
.tbl .r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; font-size: var(--fs-sm); color: var(--muted); border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl.stack td { padding: 3px 0; border: 0; display: flex; gap: 12px; justify-content: space-between; }
  .tbl.stack td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
  .tbl.stack td:empty, .tbl.stack td.no-stack { display: none; }
}

/* ------------------------------------------------------------------ timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-item { position: relative; padding: 0 0 var(--s5) 44px; min-height: 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-item.done::before { background: var(--sea-500); transform-origin: top; animation: tl-grow .5s ease-out both; animation-delay: calc(var(--i, 0) * .12s); }
.tl-dot { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); }
.tl-dot .icon { width: 16px; height: 16px; }
.tl-item.done .tl-dot { background: var(--sea-700); border-color: var(--sea-700); color: #fff; }
.tl-item.current .tl-dot { background: #fff; border-color: var(--gold); color: var(--gold-ink); box-shadow: 0 0 0 5px rgba(242, 180, 65, .22); }
.tl-item.current .tl-dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--gold); animation: ping 2s ease-out infinite; }
.tl-item.warn .tl-dot { border-color: var(--overdue); color: var(--overdue-ink); }
.tl-head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.tl-title { font-weight: 650; color: var(--head); }
.tl-item.todo .tl-title { color: var(--muted); font-weight: 550; }
.tl-meta { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-sub { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.tl-body { margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
@keyframes tl-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 80%, 100% { transform: scale(1.5); opacity: 0; } }

/* ------------------------------------------------------------------ progress and deadline meter */
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .track { height: 8px; border-radius: 4px; background: var(--sea-100); overflow: hidden; }
.progress .fill { height: 100%; border-radius: 4px; background: var(--sea-500); transform-origin: left; animation: grow-x .8s cubic-bezier(.2, .7, .2, 1) both; }
.progress.t-ok .fill { background: var(--ok); } .progress.t-due .fill { background: var(--due); } .progress.t-overdue .fill { background: var(--overdue); } .progress.t-gold .fill { background: var(--gold); }
.progress .cap { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.progress .cap b { font-variant-numeric: tabular-nums; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.meter { display: flex; flex-direction: column; gap: 8px; }
.meter .segs { display: flex; gap: 3px; }
.meter .seg { flex: 1 1 0; height: 10px; border-radius: 3px; background: var(--sea-100); min-width: 3px; }
.meter .seg.on { background: var(--sea-500); }
.meter.s-ok .seg.on { background: var(--ok); } .meter.s-due .seg.on { background: var(--due); } .meter.s-overdue .seg.on { background: var(--overdue); } .meter.s-done .seg.on { background: var(--sea-700); }
.meter .seg.on { animation: seg-in .35s ease-out both; animation-delay: calc(var(--i, 0) * 25ms); }
.meter .mrow { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: var(--fs-sm); }
.meter .mrow .lead { color: var(--muted); }
.meter .mrow .state { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.meter.s-ok .state { color: var(--ok-ink); } .meter.s-due .state { color: var(--due-ink); } .meter.s-overdue .state { color: var(--overdue-ink); } .meter.s-done .state { color: var(--link); }
@keyframes seg-in { from { opacity: 0; transform: scaleY(.3); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ stat tile */
.stat { display: flex; flex-direction: column; gap: 6px; padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); position: relative; min-width: 0; text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--sea-300); box-shadow: var(--shadow-md); }
.stat .s-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.stat .s-label .icon { width: 18px; height: 18px; color: var(--sea-500); }
.stat .s-value { font-size: 36px; font-weight: 700; line-height: 1.05; color: var(--head); letter-spacing: -.02em; }
.stat .s-value small { font-size: var(--fs-md); font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat.big .s-value { font-size: var(--fs-hero); }
.stat .s-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); color: var(--muted); min-height: 24px; }
.stat .s-delta { font-weight: 650; display: inline-flex; gap: 4px; align-items: center; }
.stat .s-delta.good { color: var(--ok-ink); } .stat .s-delta.bad { color: var(--overdue-ink); } .stat .s-delta.flat { color: var(--muted); }
.stat.t-overdue .s-value { color: var(--overdue-ink); } .stat.t-due .s-value { color: var(--due-ink); } .stat.t-ok .s-value { color: var(--ok-ink); }
.stat .spark { flex: none; }
@media (max-width: 640px) { .stat { padding: var(--s4); } .stat .s-value { font-size: 30px; } }

/* ------------------------------------------------------------------ empty state, kv, toast, modal */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: var(--s7) var(--s5); }
.empty .e-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--sea-100); color: var(--sea-600); margin-bottom: 4px; }
.empty .e-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: var(--fs-lg); }
.empty p { color: var(--muted); max-width: 44ch; margin: 0; }
.empty .btn { margin-top: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 10px; } }

.toasts { position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 460px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 12px 16px; border-radius: var(--r-md); background: var(--sea-900); color: #fff; box-shadow: var(--shadow-lg); font-size: var(--fs-sm); font-weight: 550; animation: toast-in .25s ease-out both; }
.toast .icon { margin-top: 1px; color: var(--gold); }
.toast.ok .icon { color: #7fd6a2; } .toast.error { background: #7d2415; } .toast.error .icon { color: #ffc9bd; }
.toast.out { animation: toast-out .2s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.modal-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(7, 31, 41, .55); backdrop-filter: blur(3px); animation: fade .18s ease-out both; }
.modal { width: min(560px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .8, .2, 1) both; }
.modal.lg { width: min(820px, 100%); } .modal.sm { width: min(420px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 8px; }
.modal-head h2 { font-size: var(--fs-lg); }
.modal-body { padding: 8px 24px 24px; overflow-y: auto; }
.modal-foot { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .modal-back { align-items: end; padding: 0; }
  .modal, .modal.lg, .modal.sm { width: 100%; max-height: 92vh; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheet .26s cubic-bezier(.2, .8, .2, 1) both; }
  .modal-body { padding-bottom: calc(24px + var(--safe-b)); }
  .toasts { bottom: calc(var(--tabbar-h) + 52px + var(--safe-b)); }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ change flash, pill, page enter */
.ot-flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background-color: rgba(242, 180, 65, .45); box-shadow: 0 0 0 3px rgba(242, 180, 65, .4); } 100% { background-color: transparent; box-shadow: 0 0 0 3px transparent; } }
.card.ot-flash, .stat.ot-flash { animation-name: flash-card; }
@keyframes flash-card { 0% { box-shadow: 0 0 0 3px rgba(242, 180, 65, .65), var(--shadow-sm); border-color: var(--gold); } 100% { box-shadow: 0 0 0 3px transparent, var(--shadow-sm); } }
.page-in { animation: page-in .28s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.poc-pill { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; background: rgba(4, 10, 18, .94); color: #fff; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .01em; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 6px 20px -6px rgba(4, 10, 18, .5); pointer-events: none; user-select: none; }
.poc-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
@media (max-width: 860px) {
  body[data-layout="app"] .poc-pill { bottom: calc(var(--tabbar-h) + 10px + var(--safe-b)); right: 10px; font-size: 11px; padding: 5px 11px 5px 9px; }
  body[data-layout="public"] .poc-pill { bottom: 10px; right: 10px; font-size: 11px; padding: 5px 11px 5px 9px; }
}

/* ------------------------------------------------------------------ public layout */
.pubhead { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.pubhead .bar { display: flex; align-items: center; gap: var(--s5); height: 72px; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--head); min-width: 0; }
.brand:hover { color: var(--head); }
.brand .words { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand .word { font-family: var(--font-serif); font-size: 23px; font-weight: 700; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.brand .sub { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); line-height: 1; white-space: nowrap; }
.pubnav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.pubnav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--r-md); color: var(--ink); font-weight: 600; text-decoration: none; }
.pubnav a:hover { background: var(--sea-100); color: var(--head); }
.pubnav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--gold); }
.pubnav a.login { margin-left: 10px; padding: 0 20px; background: var(--sea-900); color: #fff; gap: 8px; }
.pubnav a.login:hover { background: var(--sea-700); }
.pubnav a.login[aria-current="page"]::after { display: none; }
.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); place-items: center; color: var(--head); }
@media (max-width: 860px) {
  .pubhead .bar { height: 64px; padding: 0 16px; gap: 12px; }
  .brand .word { font-size: 20px; }
  .menu-btn { display: inline-grid; }
  .pubnav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 18px; background: var(--page); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); }
  .pubnav.open { display: flex; }
  .pubnav a { min-height: 48px; font-size: var(--fs-md); }
  .pubnav a[aria-current="page"] { background: var(--sea-100); }
  .pubnav a[aria-current="page"]::after { display: none; }
  .pubnav a.login { margin: 8px 0 0; justify-content: center; }
}
.pub-main { min-height: 60vh; }

.pubfoot { background: var(--sea-900); color: var(--deep-muted); position: relative; margin-top: var(--s8); }
.pubfoot::before { content: ""; position: absolute; left: 0; right: 0; top: -39px; height: 40px; background: var(--sea-900);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40V22c100 0 100-16 200-16s100 16 200 16 100-16 200-16 100 16 200 16 100-16 200-16 100 16 200 16v18z'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40V22c100 0 100-16 200-16s100 16 200 16 100-16 200-16 100 16 200 16 100-16 200-16 100 16 200 16v18z'/%3E%3C/svg%3E") center/100% 100% no-repeat; }
.pubfoot .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s6); max-width: 1240px; margin: 0 auto; padding: var(--s7) 28px var(--s6); }
.pubfoot .brand, .pubfoot .brand .word { color: #fff; } .pubfoot .brand .sub { color: var(--deep-muted); }
.pubfoot h4 { color: #fff; font-size: var(--fs-sm); letter-spacing: .1em; text-transform: uppercase; margin-bottom: var(--s3); font-weight: 700; }
.pubfoot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pubfoot a { color: var(--deep-text); text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.pubfoot a:hover { color: var(--gold); text-decoration: underline; }
.pubfoot .tag { font-family: var(--font-serif); font-size: var(--fs-md); color: #e8f1f4; margin: var(--s4) 0 var(--s3); max-width: 30ch; line-height: 1.4; }
.pubfoot .legal { border-top: 1px solid rgba(255, 255, 255, .12); }
.pubfoot .legal .in { max-width: 1240px; margin: 0 auto; padding: 18px 28px 26px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--deep-muted); }
@media (max-width: 860px) { .pubfoot .cols { grid-template-columns: 1fr 1fr; padding: var(--s6) 18px var(--s5); } .pubfoot .cols > :first-child { grid-column: 1 / -1; } .pubfoot .legal .in { padding: 16px 18px calc(96px + var(--safe-b)); } }

/* ------------------------------------------------------------------ app layout */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s5); padding: 22px 14px 16px; background: linear-gradient(185deg, var(--sea-900) 0%, var(--sea-950) 100%); color: var(--deep-text); overflow-y: auto; }
.rail .brand { padding: 0 8px; } .rail .brand .word { color: #fff; font-size: 21px; } .rail .brand .sub { color: var(--deep-muted); letter-spacing: .12em; }
.rail .nav { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; }
.rail .nav-label { padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6f95a3; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: var(--r-md); color: var(--deep-text); text-decoration: none; font-weight: 600; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.nav a .icon { width: 20px; height: 20px; opacity: .9; }
.nav a .badge-count { margin-left: auto; }
.rail .rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: var(--s4); border-top: 1px solid rgba(255, 255, 255, .1); }
.rail .rail-foot a, .rail .rail-foot button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: var(--r-md); color: #9fbcc6; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.rail .rail-foot a:hover, .rail .rail-foot button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.rail .rail-foot a:focus-visible, .rail .rail-foot button:focus-visible { outline: 3px solid var(--focus-dark); outline-offset: 2px; }
.rail .rail-foot .icon { width: 18px; height: 18px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--s4); height: var(--topbar-h); padding: 0 36px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 21px; font-weight: 700; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar h1:focus { outline: none; }
.topbar .brand-mini { display: none; }
.topbar .spacer { flex: 1; }
.sync { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-xs); font-weight: 650; color: var(--ink-2); }
.sync .dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #9aa8ad; }
.sync[data-state="live"] .dot { background: var(--ok); }
.sync[data-state="live"] .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: beat 2.6s ease-out infinite; }
.sync.got .dot::after { animation: beat .8s ease-out 3; opacity: 1; }
@keyframes beat { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
.persona { position: relative; }
.persona-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 12px 4px 5px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); text-align: left; }
.persona-btn:hover { border-color: var(--sea-500); }
.persona-btn .avatar { width: 34px; height: 34px; background: var(--sea-700); color: #fff; }
.persona-btn .who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.persona-btn .who b { font-size: var(--fs-sm); font-weight: 650; white-space: nowrap; }
.persona-btn .who span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.persona-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 330px; max-height: min(78vh, 640px); overflow-y: auto; z-index: 95; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 8px; animation: pop .16s ease-out both; }
.persona-menu .pm-title { padding: 8px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.persona-menu button.pm-item { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; min-height: 48px; }
.persona-menu button.pm-item:hover { background: var(--sea-50); }
.persona-menu button.pm-item:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; }
.persona-menu button.pm-item[aria-checked="true"] { background: var(--sea-100); }
.persona-menu .pm-item .avatar { width: 34px; height: 34px; }
.persona-menu .pm-item .t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.persona-menu .pm-item .t b { font-size: var(--fs-sm); font-weight: 650; } .persona-menu .pm-item .t span { font-size: 12px; color: var(--muted); }
.persona-menu .pm-item .icon { color: var(--link); }
.persona-menu hr { margin: 6px 0; }
.page { padding: 30px 36px 80px; max-width: 1440px; width: 100%; }
.page:focus, .pub-main:focus { outline: none; }

.tabbar { display: none; }
@media (max-width: 860px) {
  .app { display: block; }
  .rail { display: none; }
  .topbar { height: 60px; padding: 0 12px 0 16px; gap: 10px; }
  .topbar h1 { font-size: 18px; }
  .topbar .brand-mini { display: inline-flex; }
  .sync .txt, .persona-btn .who { display: none; }
  .sync { padding: 0 10px; } .persona-btn { padding: 4px; }
  .persona-menu { position: fixed; left: 10px; right: 10px; top: 66px; width: auto; }
  .page { padding: 18px 16px calc(var(--tabbar-h) + 88px + var(--safe-b)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 4px var(--safe-b); background: rgba(4, 10, 18, .97); backdrop-filter: blur(10px); box-shadow: 0 -6px 24px -10px rgba(7, 31, 41, .5); }
  .tabbar a, .tabbar button { all: unset; box-sizing: border-box; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #9fbcc6; font-size: 11px; font-weight: 650; position: relative; cursor: pointer; border-radius: var(--r-md); -webkit-tap-highlight-color: transparent; }
  .tabbar a:focus-visible, .tabbar button:focus-visible { outline: 3px solid var(--focus-dark); outline-offset: -3px; }
  .tabbar a[aria-current="page"] { color: #fff; }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar .badge-count { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
}
.more-list { display: flex; flex-direction: column; gap: 4px; }
.more-list a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px; border-radius: var(--r-md); color: var(--ink); font-weight: 600; text-decoration: none; background: var(--page); }
.more-list a[aria-current="page"] { background: var(--sea-100); }

/* ------------------------------------------------------------------ coming-next placeholder, not found */
.coming-next { max-width: 720px; margin: var(--s6) auto; text-align: center; padding: var(--s7) var(--s5); }
.coming-next .badge { margin-bottom: var(--s4); }
.coming-next h2 { margin-bottom: var(--s3); }
.coming-next p { color: var(--muted); max-width: 52ch; margin: 0 auto var(--s4); }
.coming-next ul { list-style: none; padding: 0; margin: var(--s5) auto 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ------------------------------------------------------------------ charts */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; overflow: visible; }
.chart text { font-family: var(--font-sans); fill: var(--ink-2); font-size: 12.5px; }
.chart text.t-muted { fill: var(--muted); font-size: 11.5px; }
.chart text.t-strong { fill: var(--ink); font-weight: 650; }
.chart text.t-on { fill: #fff; font-weight: 650; }
.chart text.t-flag { fill: var(--overdue-ink); font-weight: 650; font-size: 12px; }
.chart text.t-center-v { font-size: 30px; font-weight: 700; fill: var(--head); letter-spacing: -.02em; }
.chart text.t-center-l { font-size: 12px; fill: var(--muted); }
.chart [data-tip] { cursor: default; }
.chart .mark { transition: opacity .15s; }
.chart:hover .mark.dim, .chart.hovering .mark.dim { opacity: .45; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-line { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: var(--s3); font-size: var(--fs-sm); color: var(--ink-2); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.chart-legend .lg b { font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap; }
.donut-wrap .chart { width: auto; flex: none; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1 1 180px; min-width: 0; font-size: var(--fs-sm); }
.donut-legend li { display: flex; align-items: center; gap: 10px; }
.donut-legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.donut-legend .nm { flex: 1; color: var(--ink-2); min-width: 0; }
.donut-legend .vl { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.donut-legend .pc { width: 44px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ot-tip { position: fixed; z-index: 150; pointer-events: none; max-width: 260px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--sea-950); color: #fff; font-size: 12.5px; line-height: 1.4; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .12s; }
.ot-tip.show { opacity: 1; }
.ot-tip b { display: block; font-weight: 700; }
.ot-tip span { display: block; color: var(--deep-text); }

/* ------------------------------------------------------------------ map */
.otmap { position: relative; width: 100%; }
.otmap svg { display: block; width: 100%; height: auto; border-radius: var(--r-lg); background: linear-gradient(180deg, #e8f4f7, #dcedf2); }
.otmap .region { fill: var(--sand-200); stroke: var(--page); stroke-width: 1; stroke-linejoin: round; transition: fill .2s, stroke .15s; cursor: pointer; outline: none; }
.otmap .region:hover, .otmap .region.hover { stroke: var(--head); stroke-width: 1.6; }
.otmap .region:focus-visible { stroke: var(--head); stroke-width: 2.4; }
.otmap .region.sel { stroke: var(--gold); stroke-width: 3; paint-order: stroke; }
.otmap .halo { fill: rgba(255, 255, 255, .5); stroke: var(--sea-300); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.otmap .hit { fill: transparent; stroke: none; cursor: pointer; }
.otmap .halo.hover { stroke: var(--head); fill: rgba(255, 255, 255, .85); }
.otmap .lbl { font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; fill: var(--head); paint-order: stroke; stroke: rgba(255, 255, 255, .92); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.otmap .lbl.isl { fill: var(--sea-700); font-size: 10px; }
.otmap .pin { cursor: pointer; }
.otmap .pin .dot { stroke: #fff; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(7, 31, 41, .35)); }
.otmap .pin:hover .dot, .otmap .pin:focus-visible .dot { stroke: var(--head); }
.otmap .pin:focus-visible { outline: none; }
.otmap .pin:focus-visible .ring { opacity: 1; }
.otmap .pin .ring { fill: none; stroke: var(--focus); stroke-width: 3; opacity: 0; }
.otmap .pin.ot-flash .dot { animation: pin-flash 1.4s ease-out; }
@keyframes pin-flash { 0%, 50% { r: 11px; } 100% { r: 7px; } }
.otmap .pin-drop { animation: pin-drop .5s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--d, 0) * 35ms + .15s); }
@keyframes pin-drop { from { opacity: 0; transform: translateY(-22px); } to { opacity: 1; transform: none; } }
.otmap .map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: var(--s3); font-size: var(--fs-sm); color: var(--ink-2); }
.otmap .map-legend:empty { display: none; }
.otmap .map-legend .lg { display: inline-flex; align-items: center; gap: 8px; }
.otmap .map-legend .sw { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.otmap .map-legend .sw.sq { border-radius: 3px; }
.otmap .attrib { margin: 8px 0 0; font-size: 10.5px; line-height: 1.35; color: var(--muted); max-width: 70ch; }
.otmap .map-tip { position: absolute; z-index: 5; pointer-events: none; padding: 7px 11px; border-radius: var(--r-sm); background: var(--sea-950); color: #fff; font-size: 12.5px; line-height: 1.35; white-space: nowrap; opacity: 0; transform: translate(-50%, -100%); transition: opacity .1s; box-shadow: var(--shadow-md); }
.otmap .map-tip.show { opacity: 1; }
.otmap .map-tip b { display: block; } .otmap .map-tip span { color: var(--deep-text); }
.otmap.deco { pointer-events: none; }
.otmap.deco svg { background: none; border-radius: 0; }
.otmap.deco .region { fill: rgba(255, 255, 255, .14); stroke: rgba(255, 255, 255, .38); cursor: default; }
.otmap.deco.light .region { fill: var(--sand-200); stroke: #fff; }
.otmap.deco .halo { fill: none; stroke: rgba(255, 255, 255, .35); }
.otmap.deco .attrib { color: var(--deep-muted); }
.otmap.deco.light .attrib { color: var(--muted); }
.otmap.schematic svg { background: var(--sea-50); }
@media (max-width: 640px) { .otmap .lbl { font-size: 9.5px; } }

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .ot-flash { animation: none !important; box-shadow: 0 0 0 3px rgba(242, 180, 65, .5); }
}

/* ------------------------------------------------------------------ print */
#ot-print-root { display: none; }
@media print {
  html, body { background: #fff !important; }
  body.printing > *:not(#ot-print-root) { display: none !important; }
  body.printing #ot-print-root { display: block !important; }
  .poc-pill, .toasts, .modal-back, .ot-tip, .skip { display: none !important; }
  * { animation: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body:not(.printing) .rail, body:not(.printing) .topbar, body:not(.printing) .tabbar, body:not(.printing) .pubhead, body:not(.printing) .pubfoot { display: none !important; }
  body:not(.printing) .app { display: block; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
}
