/* Ported from the prototype boards (portal-v2/project/*.dc.html, build/nav.py).
   Values are the boards' own; light only, as on the boards. */
:root {
  color-scheme: light;
  --serif: 'Newsreader', Georgia, serif; --sans: 'Geist', ui-sans-serif, sans-serif; --mono: 'Geist Mono', ui-monospace, monospace;
  --paper: #F6F2EA; --side: #EFEADF; --card: #FFFDF8; --ink: #1F2328; --ink2: #33373D; --ink3: #4A4F57; --ink4: #5C6169;
  --line: rgba(31,35,40,.12); --field: #B8BCC2; --accent: #2F4B7C; --accent-hover: #1E3358; --accent-soft: rgba(47,75,124,.10);
  --sage: #4E6B4A; --done-bg: rgba(78,107,74,.12); --done-ink: #33502F; --warn: #8A5A14; --warn-line: #B8742A; --danger: #8A2E1F;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); }
a { color: var(--accent); } a:hover { color: var(--accent-hover); }
button, input, select, textarea { font-family: inherit; }
.kbd { font-family: var(--mono); font-size: 11px; line-height: 16px; padding: 0 5px; border-radius: 4px; border: 1px solid rgba(31,35,40,.18); color: var(--ink3); background: rgba(255,255,255,.6); }
.kbd.inv { color: #fff; border-color: rgba(255,255,255,.5); background: transparent; }
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }

/* left column */
nav.main { flex: 1 1 210px; max-width: 230px; padding: 18px 12px; display: flex; flex-direction: column; gap: 16px; border-right: 1px solid var(--line); background: var(--side); }
.brand { padding: 2px 10px; font-family: var(--serif); font-size: 19px; }
.start { display: flex; justify-content: space-between; align-items: center; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
.items { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.items a, .items .soon { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.items a.on { font-weight: 600; background: var(--accent-soft); }
.items .soon { color: var(--ink4); cursor: default; }
.items .meta { color: var(--ink3); font-weight: 400; font-size: 12px; }
.projects { display: flex; flex-direction: column; gap: 1px; }
.label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink4); padding: 0 10px 4px; }
.dom { padding: 3px 10px; font-size: 12px; color: var(--accent); font-weight: 500; }
.dom.personal { color: var(--sage); }
.proj { padding: 3px 10px 3px 18px; font-size: 13px; color: var(--ink2); }
.signout { margin-top: auto; padding: 6px 10px; font-size: 12px; color: var(--ink4); text-decoration: none; }

/* centre */
main { flex: 999 1 520px; min-width: 0; padding: 26px 36px 32px; display: flex; flex-direction: column; gap: 20px; max-width: 840px; }
h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.15; }
.sub { font-size: 13px; color: var(--ink3); }
header.page { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
header.page > div { display: flex; flex-direction: column; gap: 2px; }
.chip { display: flex; gap: 12px; align-items: baseline; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 12px; background: rgba(255,255,255,.5); }
.chip b { font-weight: 600; font-family: var(--mono); } .chip .k { color: var(--ink3); }
section.rows { display: flex; flex-direction: column; gap: 2px; }
section.rows h2 { margin: 0 0 4px; display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
section.rows h2 span { font-weight: 400; letter-spacing: 0; text-transform: none; }
.empty { padding: 6px 10px; font-size: 13px; color: var(--ink3); }
.row { display: flex; flex-direction: column; border-radius: 8px; background: transparent; border: 1px solid transparent; }
.row.on { background: var(--card); border-color: var(--line); }
.row > button { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; text-align: left; cursor: pointer; color: var(--ink); background: transparent; }
.row > button:focus { outline: none; } .row > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row .tag { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.row .text { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.on .text { font-weight: 600; }
.row .meta { font-size: 12px; color: var(--ink3); white-space: nowrap; }
.row .more { padding: 4px 14px 14px 90px; display: flex; flex-direction: column; gap: 12px; }
.row .more p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink2); }
.done { padding: 8px 12px; border-radius: 8px; background: var(--done-bg); font-size: 14px; color: var(--done-ink); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 6px; text-decoration: none; font-size: 14px; cursor: pointer; background: transparent; color: var(--ink); border: 1px solid var(--field); }
.btn.primary { background: var(--accent); color: #fff; border: 0; }
.btn.outline { color: var(--accent); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 44px; padding: 0 18px; border-radius: 8px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.foot { padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink3); }
input[type=text], select, textarea { font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--field); border-radius: 8px; padding: 0 10px; min-height: 40px; }
textarea { padding: 8px 10px; width: 100%; min-height: 90px; resize: vertical; }

/* right column */
aside.ctx { flex: 1 1 280px; max-width: 360px; padding: 26px 22px; border-left: 1px solid var(--line); background: var(--side); display: flex; flex-direction: column; gap: 14px; }
aside.ctx .kv { display: flex; flex-direction: column; gap: 3px; }
aside.ctx .kv span:first-child { font-size: 12px; color: var(--ink4); }
aside.ctx .kv span:last-child { font-size: 14px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
aside.ctx .rule { height: 1px; background: var(--line); }
.pcard { border-radius: 10px; background: var(--card); border: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.pcard.new { border-color: var(--warn-line); } .pcard .s { font-size: 12px; color: var(--ink3); } .pcard.new .s { color: var(--warn); }

/* inbox (board 3) */
nav.queue { flex: 1 1 230px; max-width: 250px; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); background: var(--side); }
nav.queue .back { padding: 2px 10px 8px; font-size: 13px; text-decoration: none; }
nav.queue .title { padding: 0 10px 8px; font-family: var(--serif); font-size: 22px; }
nav.queue .title span { font-family: var(--sans); font-size: 13px; color: var(--ink3); }
nav.queue button { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ink); }
nav.queue button.on { background: var(--accent-soft); } nav.queue button.on .t { font-weight: 600; }
nav.queue .t { font-size: 13px; } nav.queue .s { font-size: 12px; color: var(--ink4); }
main.inbox { flex: 999 1 540px; padding: 26px 40px 48px; gap: 18px; max-width: none; }
article.email, section.filed { max-width: 820px; padding: 30px 34px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
section.filed { background: #FBFAF4; gap: 10px; }
article.email h1 { font-size: 28px; line-height: 1.25; }
article.email .gist { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink2); }
.parts { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.parts legend { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink4); padding-bottom: 8px; }
.part { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 8px; background: var(--paper); }
.part .n { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; } .part .w, .part .m { font-size: 12px; color: var(--ink3); }
.filed .big-t { font-family: var(--serif); font-size: 26px; }

/* activity drawer: not on the boards — the S1 fallback for script output (SPEC §2.2) */
#activity { position: fixed; right: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); max-height: 60vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.10); z-index: 20; }
#activity header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 13px; }
#activity .body { overflow: auto; padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); }
#activity.closed .body { display: none; }
#activity .msg { font-size: 14px; } #activity .msg .ch { font-size: 11px; color: var(--ink4); font-family: var(--mono); }
#activity .msg.me { border-left: 3px solid var(--accent); padding-left: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink4); } .dot.live { background: var(--sage); }
.blocks { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.blocks .ctx2 { font-size: 12px; color: var(--ink3); }
.pre { white-space: pre-wrap; }
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); width: min(560px, calc(100vw - 32px)); padding: 22px; }
dialog::backdrop { background: rgba(31,35,40,.25); }
dialog h2 { margin: 0 0 12px; font-family: var(--serif); font-weight: 400; font-size: 22px; }
dialog .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
dialog .field label { font-size: 13px; color: var(--ink2); }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 30; }
#toast.show { opacity: 1; }
code { font-family: var(--mono); font-size: .92em; }
@media (max-width: 760px) { nav.main, nav.queue { max-width: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); } main, main.inbox { padding: 18px 16px 120px; } .row .more { padding-left: 14px; } aside.ctx { max-width: none; } }
/* login */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.card h2 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink4); }
.card input[type=text] { width: 100%; }
.err { color: var(--danger); font-size: 13px; }
