/* JAMES OS v3 — component styles (no external fonts or assets; CSP-safe). */
*, *::before, *::after { box-sizing: border-box; }
svg[aria-hidden="true"] { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font-body); letter-spacing: .005em;
  background-image: var(--glow), linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px; background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ice); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface-raised); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { max-width: 780px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--outline);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand img { width: 36px; height: 34px; flex: none; }
.brand-word { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word b { font-family: var(--font-display); font-size: 17px; letter-spacing: .26em; font-weight: 700; }
.brand-word b i { font-style: normal; color: var(--brass); margin: 0 .18em; letter-spacing: 0; }
.brand-word b span { font-family: var(--font-mono); color: var(--emerald); letter-spacing: .18em; font-size: 14px; }
.brand-word small { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--outline); font: 600 11px/1 var(--font-mono); color: var(--muted); letter-spacing: .04em; background: var(--surface-sunk); white-space: nowrap; }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status-pill.online .dot { background: var(--emerald); }
.status-pill.offline .dot { background: var(--warning); }
.icon-btn { width: 40px; height: 40px; min-width: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--outline); background: var(--surface); color: var(--text); cursor: pointer; position: relative; }
.icon-btn:hover { border-color: var(--outline-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.badge-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brass); color: var(--brass-ink); font: 700 11px/18px var(--font-mono); text-align: center; }
main { padding: 14px 16px 24px; outline: none; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 780px; margin: 0 auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--outline);
}
.nav-item { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font: 600 11.5px/1 var(--font-body); letter-spacing: .02em; border-radius: 14px; cursor: pointer; text-decoration: none; position: relative; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item[aria-current="page"] { color: var(--text); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; top: 2px; width: 28px; height: 3px; border-radius: 3px; background: var(--brass); }
.nav-item[aria-current="page"] svg { color: var(--emerald); }

/* ---------- typography & layout ---------- */
h1, h2, h3 { margin: 0; line-height: 1.2; }
.page-head { margin: 6px 0 16px; }
.eyebrow { font: 600 11px/1.3 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.page-head h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: -.005em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.section-head h2 { font-size: 13px; font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.section-head h2 .n { color: var(--text); margin-left: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack > * + * { margin-top: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 360px) { .grid-3 { grid-template-columns: 1fr 1fr; } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.card.raised { background: var(--surface-raised); }
.card.flush { padding: 0; overflow: hidden; }
.card + .card { margin-top: 10px; }
.card h3 { font-size: 16px; }
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 20px 18px 18px; border: 1px solid var(--outline);
  background: linear-gradient(140deg, color-mix(in srgb, var(--surface-raised) 92%, var(--brass) 8%), var(--surface) 62%);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 240px; height: 120px; border: 1.5px solid color-mix(in srgb, var(--emerald) 45%, transparent); border-radius: 50%; transform: rotate(-24deg); pointer-events: none; }
.hero h1 { font-family: var(--font-display); font-size: 27px; font-weight: 700; margin: 6px 0 4px; max-width: 92%; }
.hero p { margin: 0; color: var(--muted); max-width: 95%; }
.hero .meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font: 12px var(--font-mono); color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.kpi { background: var(--surface-sunk); border: 1px solid var(--outline); border-radius: 12px; padding: 10px 8px; text-align: left; cursor: pointer; color: inherit; min-height: 64px; }
.kpi b { display: block; font: 700 22px/1.1 var(--font-mono); }
.kpi span { font-size: 11.5px; color: var(--muted); }
.kpi.alert b { color: var(--danger); }
.kpi.warn b { color: var(--warning); }
@media (max-width: 380px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

.suggestion { border: 1px solid color-mix(in srgb, var(--emerald) 45%, var(--outline)); background: linear-gradient(180deg, color-mix(in srgb, var(--emerald) 7%, var(--surface)), var(--surface)); }
.suggestion .label { font: 600 11px var(--font-mono); letter-spacing: .12em; color: var(--emerald); text-transform: uppercase; }
.suggestion h3 { font-size: 18px; margin: 6px 0 4px; }

/* ---------- lists ---------- */
.list { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r-lg); overflow: hidden; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--outline); min-height: 56px; }
.item:first-child { border-top: 0; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.item-title button, .linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.linkish:hover { text-decoration: underline; text-decoration-color: var(--outline-strong); }
.item-sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.item-why { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--brass); padding-left: 8px; }
.item-done .item-title { text-decoration: line-through; color: var(--faint); }
.check { width: 30px; height: 30px; min-width: 30px; border-radius: 9px; border: 1.5px solid var(--outline-strong); background: transparent; display: grid; place-items: center; cursor: pointer; margin-top: 1px; color: var(--emerald-ink); position: relative; }
.check::after { content: ""; position: absolute; inset: -9px; }
.check.on { background: var(--emerald); border-color: var(--emerald); }
.check svg { width: 16px; height: 16px; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--outline); border-radius: var(--r-lg); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- chips & tags ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font: 600 11.5px/1 var(--font-body); border: 1px solid var(--outline); color: var(--muted); background: var(--surface-sunk); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.em { color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 50%, var(--outline)); }
.chip.brass { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 50%, var(--outline)); }
.chip.ice { color: var(--ice); border-color: color-mix(in srgb, var(--ice) 45%, var(--outline)); }
.chip.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, var(--outline)); }
.chip.warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 50%, var(--outline)); }
.chip svg { width: 12px; height: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ws-dot { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--ice); display: inline-block; }
.ws-dot.emerald { background: var(--emerald); } .ws-dot.brass { background: var(--brass); } .ws-dot.danger { background: var(--danger); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--outline); background: var(--surface-raised); color: var(--text); font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--outline-strong); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--emerald); color: var(--emerald-ink); border-color: var(--emerald); }
.btn.brass { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, var(--outline)); }
.btn.danger.solid { background: var(--danger); color: var(--danger-ink); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.text-btn { background: none; border: 0; color: var(--ice); font: 600 13px var(--font-body); cursor: pointer; padding: 6px 2px; min-height: 32px; }

/* ---------- capture ---------- */
.capture { background: var(--surface); border: 1px solid var(--outline-strong); border-radius: var(--r-lg); padding: 10px; }
.capture textarea { width: 100%; min-height: 54px; max-height: 200px; resize: vertical; border: 0; background: transparent; outline: none; padding: 6px 6px; font-size: 16px; }
.capture-types { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--outline); border-radius: 11px; overflow: hidden; background: var(--surface-sunk); flex-wrap: wrap; }
.seg button { min-height: 36px; padding: 0 11px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-raised); color: var(--text); box-shadow: inset 0 -2px 0 var(--brass); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--outline); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"], .tab[aria-pressed="true"] { color: var(--text); border-color: var(--brass); background: color-mix(in srgb, var(--brass) 12%, var(--surface)); }

/* ---------- proposals ---------- */
.proposal { border: 1px solid color-mix(in srgb, var(--brass) 55%, var(--outline)); border-radius: var(--r-lg); background: color-mix(in srgb, var(--brass) 6%, var(--surface)); padding: 14px; }
.proposal .label { font: 600 11px var(--font-mono); letter-spacing: .12em; color: var(--brass); text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.proposal dl { display: grid; grid-template-columns: minmax(84px, 30%) 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: 14px; }
.proposal dt { color: var(--muted); }
.proposal dd { margin: 0; overflow-wrap: anywhere; }
.proposal .warn { margin-top: 8px; font-size: 13px; color: var(--warning); }
.proposal.done { opacity: .75; border-style: dashed; }
.toggle-line { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }

/* ---------- assistant ---------- */
.assist-banner { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 11px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.msg small { display: block; font: 600 10.5px var(--font-mono); letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.msg.user { align-self: flex-end; background: color-mix(in srgb, var(--emerald) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--emerald) 35%, var(--outline)); border-bottom-right-radius: 4px; }
.msg.agent { align-self: flex-start; background: var(--surface); border: 1px solid var(--outline); border-bottom-left-radius: 4px; }
.refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; white-space: normal; }
.ref { min-height: 30px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--outline); background: var(--surface-sunk); color: var(--ice); font-size: 12.5px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 6px); display: flex; gap: 8px; align-items: flex-end; margin-top: 14px; padding: 8px; background: var(--surface); border: 1px solid var(--outline-strong); border-radius: 16px; box-shadow: var(--shadow); }
.composer textarea { flex: 1; min-height: 44px; max-height: 160px; border: 0; background: transparent; resize: none; outline: none; padding: 10px 6px; font-size: 16px; }
.prompt-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 4px -16px 12px; padding: 0 16px; }
.prompt-chips button { flex: none; }

/* ---------- forms ---------- */
.field { display: block; margin-top: 12px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; letter-spacing: .01em; }
.field input, .field select, .field textarea, .input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--outline-strong); background: var(--surface-sunk); color: var(--text); font-size: 16px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input[type="checkbox"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--emerald); }
.field.inline { display: flex; align-items: center; gap: 10px; }
.field.inline > span { margin: 0; color: var(--text); font-weight: 500; font-size: 15px; }
.field small { display: block; color: var(--faint); margin-top: 4px; font-size: 12px; }
.fieldset { border: 1px solid var(--outline); border-radius: 12px; padding: 4px 12px 12px; margin-top: 12px; }
.fieldset legend { font: 600 11px var(--font-mono); letter-spacing: .1em; color: var(--brass); text-transform: uppercase; padding: 0 6px; }
.search-box { display: flex; gap: 8px; }
.search-box input { flex: 1; }

/* ---------- dialog ---------- */
dialog { width: min(600px, calc(100vw - 20px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--outline-strong); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(4,8,12,.62); backdrop-filter: blur(3px); }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 26px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 10px; border-bottom: 1px solid var(--outline); }
.dlg-head h2 { font-family: var(--font-display); font-size: 20px; }
.dlg-body { padding: 4px 16px 16px; overflow-y: auto; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--outline); }
@media (max-width: 560px) { dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 11px 14px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.35); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 9px; min-height: 32px; padding: 0 10px; font-weight: 700; cursor: pointer; }

/* ---------- notices ---------- */
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--outline); background: var(--surface-sunk); color: var(--muted); font-size: 13.5px; margin-top: 12px; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--ice); }
.notice.warn { border-color: color-mix(in srgb, var(--warning) 50%, var(--outline)); }
.notice.warn svg { color: var(--warning); }
.notice.danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--outline)); color: var(--text); }
.notice.danger svg { color: var(--danger); }
.notice strong { color: var(--text); }
.banner { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 14px; margin: 10px 16px 0; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ice) 45%, var(--outline)); background: color-mix(in srgb, var(--ice) 8%, var(--surface)); font-size: 13.5px; }

/* ---------- progress / bars ---------- */
.bar { height: 8px; border-radius: 6px; background: var(--surface-sunk); border: 1px solid var(--outline); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--emerald), var(--ice)); border-radius: 6px; }
.score { display: grid; grid-template-columns: 110px 1fr 46px; gap: 6px 10px; align-items: center; font-size: 13px; }
.score .bar { height: 6px; }
.blur-amount { filter: blur(6px); user-select: none; }
.hidden-amount { letter-spacing: .1em; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--outline); background: var(--surface); color: inherit; cursor: pointer; min-height: 96px; text-decoration: none; }
.tile:hover { border-color: var(--outline-strong); }
.tile svg { width: 22px; height: 22px; color: var(--brass); }
.tile b { font-size: 15px; }
.tile small { color: var(--muted); font-size: 12.5px; }
.ws-tile { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--outline); background: var(--surface); cursor: pointer; text-align: left; color: inherit; }
.ws-tile .short { font: 700 11px var(--font-mono); letter-spacing: .08em; color: var(--brass); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--outline); background: var(--surface-sunk); }
.ws-tile b { font-size: 14.5px; }
.ws-tile small { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.ws-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 380px) { .ws-tiles, .tiles { grid-template-columns: 1fr; } }

/* ---------- details / disclosure ---------- */
details.why summary { cursor: pointer; color: var(--ice); font-size: 13px; font-weight: 600; list-style: none; min-height: 32px; display: inline-flex; align-items: center; }
details.why summary::-webkit-details-marker { display: none; }
details.why[open] summary { margin-bottom: 6px; }
pre.md { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-sunk); border: 1px solid var(--outline); border-radius: 12px; padding: 12px; font: 12.5px/1.5 var(--font-mono); max-height: 420px; overflow-y: auto; }
.kv { display: grid; grid-template-columns: minmax(100px, 34%) 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
table.truth { width: 100%; border-collapse: collapse; font-size: 13px; }
table.truth th, table.truth td { border-bottom: 1px solid var(--outline); padding: 8px 6px; text-align: left; vertical-align: top; }
table.truth th { color: var(--muted); font-weight: 600; }

/* ---------- lock & splash ---------- */
.lock { max-width: 440px; margin: 8vh auto 0; text-align: center; padding: 0 16px; }
.lock img { width: 96px; height: 88px; }
.lock h1 { font-family: var(--font-display); font-size: 26px; margin: 12px 0 6px; }
.lock form { text-align: left; margin-top: 18px; }
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 90; }
.splash img { width: 92px; height: 84px; animation: orbitIn 900ms var(--ease) both; }
@keyframes orbitIn { from { opacity: 0; transform: rotate(-14deg) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes savedPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--emerald) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.pulse { animation: savedPulse 700ms var(--ease) 1; }
.fade-in { animation: fadeIn var(--dur) var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { :root:not([data-motion="full"]) .splash img, :root:not([data-motion="full"]) .pulse, :root:not([data-motion="full"]) .fade-in { animation: none; } }
:root[data-motion="reduce"] .splash img, :root[data-motion="reduce"] .pulse, :root[data-motion="reduce"] .fade-in { animation: none; }

.footer-note { text-align: center; color: var(--faint); font: 11px var(--font-mono); margin: 28px 0 8px; letter-spacing: .04em; }
.hr { height: 1px; background: var(--outline); margin: 14px 0; border: 0; }
.prio-critical, .prio-high { color: var(--danger); }
.prio-medium { color: var(--warning); }
.prio-low { color: var(--muted); }
.span-all { grid-column: 1 / -1; margin: -2px 0 6px; }
.brass { color: var(--brass); }
a.kpi { text-decoration: none; display: block; }
.hero::after { right: -110px; top: -86px; }
.item input[type="checkbox"] { width: 22px; height: 22px; margin-top: 4px; accent-color: var(--emerald); flex: none; }
label.item { cursor: pointer; }
.chip input[type="checkbox"] { width: 16px; height: 16px; margin: 0 4px 0 0; accent-color: var(--emerald); }
label.chip { height: 34px; cursor: pointer; }
.ws-tile.short { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; font: 700 11px var(--font-mono); color: var(--brass); }
dialog.wide { width: min(760px, calc(100vw - 20px)); }
ol { padding-left: 20px; }
.tab[aria-current="page"] { color: var(--text); border-color: var(--brass); background: color-mix(in srgb, var(--brass) 12%, var(--surface)); }
.ws-tile .short { background: var(--surface); }
.linkish { display: inline-block; min-height: 26px; padding: 2px 0; }
.item-title .linkish { text-align: left; }

.text-btn svg { width: 16px; height: 16px; }
.capture .spread { flex-wrap: wrap; align-items: stretch; }
.capture .seg { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.capture .seg::-webkit-scrollbar { display: none; }
.capture .seg button { flex: 1 0 auto; }
.capture .spread > .btn { margin-left: auto; }
.prompt-chips .tab { min-height: 40px; }
.capture .seg button { padding: 0 10px; font-size: 13px; }
a.ws-tile, a.tile { text-decoration: none; }

/* ---------- v3.1: denser, explainable task cards and visible horizontal scroll ---------- */
.task-reason { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.task-reason summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; min-height: 30px; font-size: 12px; }
.task-reason summary::-webkit-details-marker { display: none; }
.task-reason summary::before { content: '▸'; color: var(--brass); font-size: 13px; }
.task-reason[open] summary::before { content: '▾'; }
.task-reason .item-why { margin: 5px 0 0 10px; }
.score-dot { color: var(--brass); font-weight: 600; }
.reason-hint { color: var(--faint); }
.task-filter-tabs { scrollbar-width: thin; scrollbar-color: var(--outline-strong) transparent; padding-bottom: 8px; }
.task-filter-tabs::-webkit-scrollbar { display: block; height: 3px; }
.task-filter-tabs::-webkit-scrollbar-thumb { background: var(--outline-strong); border-radius: 9px; }
.item-main .chips { gap: 4px; }
.item-main .chip { height: 23px; padding: 0 7px; font-size: 11px; }
.motto { display: block; margin-top: 9px; font-size: 11px; letter-spacing: .21em; color: var(--brass); font-family: var(--font-mono); }
@media (max-width: 430px) {
  .item { padding: 11px; gap: 9px; }
  .item-main .chips { margin-top: 5px; }
  .topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .brand { gap: 7px; }
  .brand img { width: 30px; height: 29px; }
  .brand-word b { font-size: 15px; letter-spacing: .18em; }
  .brand-word b span { font-size: 12px; }
  .brand-word small { font-size: 9.5px; }
  .top-actions { gap: 4px; }
  .top-actions .icon-btn { width: 38px; min-width: 38px; height: 38px; }
  .status-pill { padding: 0 7px; font-size: 10px; }
}

/* Sovereign Dynasty responsive shell */
body{background:var(--bg);font-variant-numeric:tabular-nums}
.card,.item,.hero{box-shadow:none;border-radius:13px}
.page-head h1{font-weight:500;font-size:clamp(26px,5vw,36px);letter-spacing:-.035em}
.page-head .eyebrow{letter-spacing:.13em;font-size:11px}
.bottom-nav[hidden]{display:none}
.nav-orbit img{background:var(--bg);border:1px solid var(--brass);border-radius:50%;padding:5px;width:45px;height:45px;object-fit:contain;margin-top:-17px}
.nav-orbit span{color:var(--brass);font-size:10px;letter-spacing:1px}
.nav-orbit[aria-current="page"]::before{display:none}
.desktop-nav{display:none}
.sovereign-hero{background:var(--surface-raised);border:1px solid var(--outline);padding:20px;border-radius:16px;display:grid;gap:10px;align-content:start}
.sovereign-hero h2{font-family:var(--font-display);font-size:25px;font-weight:500}
.sovereign-hero p{margin:0;overflow-wrap:anywhere}
.sovereign-controls{margin-bottom:14px}.sovereign-controls summary{cursor:pointer;min-height:35px;font-weight:600;color:var(--brass)}
.sovereign-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}
.sovereign-grid label{display:grid;gap:5px;min-width:0;font-size:12px;color:var(--muted)}
.sovereign-grid select{min-width:0;width:100%;min-height:44px;background:var(--surface);color:var(--text);border:1px solid var(--outline-strong);border-radius:8px;padding:6px}
.sovereign-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}
.sovereign-kpis a{display:grid;text-decoration:none;min-width:0;padding:12px;gap:5px}.sovereign-kpis b{font-family:var(--font-display);font-size:27px;color:var(--brass);font-weight:500}.sovereign-kpis small{color:var(--muted);font-size:11px}
.dashboard-panels{display:grid;gap:12px;grid-template-columns:minmax(0,1fr);margin-top:14px}.dashboard-panels .card{margin:0}.sovereign-panel{min-width:0;display:grid;gap:10px;align-content:start}.sovereign-panel h2,.sovereign-dossier h3{font-size:15px;font-weight:600;color:var(--text)}
.workspace-card{display:grid;gap:3px;background:var(--surface-raised);border:1px solid var(--outline);border-radius:10px;padding:12px;text-decoration:none;min-height:85px;min-width:0;overflow-wrap:anywhere}.workspace-card small{color:var(--brass);font-size:10px}.workspace-card b{color:var(--text);font-size:14px}.workspace-card span{color:var(--muted);font-size:11px}
.sovereign-project{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;border-bottom:1px solid var(--outline);padding:12px 2px;text-decoration:none;min-width:0}.sovereign-project b,.sovereign-project small{display:block;overflow-wrap:anywhere}.sovereign-project small{color:var(--muted);font-size:11px}.sovereign-project strong{font-size:12px;color:var(--brass)}.sovereign-project progress{grid-column:1/-1}
progress{appearance:none;width:100%;height:6px;border:0;border-radius:8px;background:var(--surface-sunk);accent-color:var(--emerald);overflow:hidden}progress::-webkit-progress-bar{background:var(--surface-sunk)}progress::-webkit-progress-value{background:var(--emerald);border-radius:8px}progress::-moz-progress-bar{background:var(--emerald)}
.orbital{position:relative;border-radius:18px;display:grid;justify-items:center;overflow:hidden;background:var(--surface)}.orbit-centre{display:grid;place-items:center;width:105px;height:105px;border:1px dashed var(--brass);border-radius:50%;margin:12px auto}.orbit-centre img{width:74px;height:74px}.orbit-nodes{width:100%}.editorial-rule{font-family:var(--font-display);padding:14px 0;border-top:1px solid var(--brass);border-bottom:1px solid var(--outline);color:var(--brass)}.editorial .sovereign-panel{border:0;border-bottom:1px solid var(--outline);border-radius:0;background:transparent}.editorial .sovereign-panel h2{font-family:var(--font-display);font-size:21px}
.sovereign-dossier{display:grid;gap:12px;margin:12px 0}.sovereign-dossier h2{font-family:var(--font-display);color:var(--brass);font-size:32px}.sovereign-dossier h2 small{color:var(--muted);font:14px var(--font-body)}.sovereign-dossier .item{margin:0;min-width:0}.splash{pointer-events:none;animation:sovereignReveal 450ms ease both}.splash img{animation:none}@keyframes sovereignReveal{0%{opacity:1}70%{opacity:.96}100%{opacity:0}}.icon-btn{min-width:44px;min-height:44px}
@media(prefers-reduced-motion:reduce){.splash{display:none}}:root[data-motion="reduce"] .splash{display:none}
@media(min-width:900px){.shell{max-width:1280px;margin-left:210px;min-height:100dvh;padding-bottom:18px}.bottom-nav{position:fixed;left:0;right:auto;top:0;bottom:0;width:210px;max-width:210px;display:flex;flex-direction:column;justify-content:flex-start;gap:4px;border-right:1px solid var(--outline);border-top:none;padding:24px 12px;margin:0}.nav-item{flex-direction:row;justify-content:flex-start;gap:12px;padding:8px 14px;min-height:48px}.nav-item[aria-current="page"]{background:var(--surface-raised)}.nav-item[aria-current="page"]::before{display:none}.nav-orbit img{width:32px;height:32px;margin:0}.desktop-nav{display:grid;border-top:1px solid var(--outline);padding-top:10px}.dashboard-panels{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-panels .sovereign-hero{grid-column:1/-1}.topbar{max-width:none}.shell main{padding:24px}.orbital .sovereign-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:360px){.sovereign-kpis a{padding:8px}.sovereign-kpis small{font-size:10px}.brand-word small{display:none}.status-pill{padding:0 5px}}

html{hyphens:none}

.orbit-map{width:100%;max-width:430px;display:block}.month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;text-align:center}.calendar-date{min-width:0;min-height:48px;display:grid;align-content:center;border:1px solid var(--outline);border-radius:6px;text-decoration:none;color:var(--text)}.calendar-date small{font-size:9px;color:var(--muted)}.calendar-date.today{border-color:var(--brass);color:var(--brass)}

.header-scope{max-width:150px;min-width:0;font-size:12px;padding:7px;border:1px solid var(--outline);background:var(--surface);color:var(--text);border-radius:8px}
@media(max-width:600px){.topbar{flex-wrap:wrap}.top-actions{flex:1;justify-content:flex-end;min-width:0}.header-scope{max-width:100px}.brand-word small{display:none}}
@media(max-width:400px){.top-actions{flex-basis:100%;justify-content:space-between}.header-scope{flex:1;max-width:none}.topbar{gap:2px}.brand-word small{display:block}}
