@font-face { font-family: "JetBrains Mono"; src: url("/app/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
/* Dash dark tokens, same as the public site; amber is MemoryBank's accent. */
:root {
  color-scheme: dark;
  --page: #0a0a0b; --inset: #0e0e10; --raised: #17171a; --hover: #1b1b1f;
  --line-soft: #1c1c1f; --line: #232327;
  --text: #fff; --text-2: #ffffffb8; --text-3: #ffffff99; --text-5: #ffffff75;
  --good: #4ec98a; --accent: #f5b14c; --bad: #f07d76;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}
* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--text); font: 13px/1.4 -apple-system, BlinkMacSystemFont, Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, a { font: inherit; }
::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid #d7d7dc; outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 20; padding: 8px 12px; border-radius: 6px; background: var(--text); color: var(--page); text-decoration: none; }
.skip:focus { top: 10px; }
.boot { min-height: 100dvh; display: grid; place-items: center; margin: 0; color: var(--text-3); }
.muted { color: var(--text-3); }
code, .mono { font: 12px var(--mono); }

/* Wordmark, same drawing as the site. */
.wordmark { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.wordmark-tld { margin-left: -6px; color: var(--text-5); font-weight: 400; }
.mark { width: 22px; height: 18px; overflow: visible; }
.mark rect, .mark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.mark .m-row { stroke: var(--text); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); background: var(--raised); color: var(--text); font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color 150ms ease, transform 150ms var(--ease); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-primary { background: var(--text); color: var(--page); box-shadow: none; }
.btn-primary:hover { background: #d4d4d8; }
.btn-danger { background: #2a1716; color: var(--bad); box-shadow: inset 0 0 0 1px #f07d7644; }
.btn-danger:hover { background: #371c1b; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---- Signed-out landing ---------------------------------------------------------- */
.landing { min-height: 100dvh; display: flex; flex-direction: column; }
.landing .bar { display: flex; align-items: center; height: 56px; padding-inline: clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--line-soft); }
.landing main { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: clamp(48px, 12vh, 112px) clamp(16px, 3vw, 32px) 48px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; color: var(--text-3); font: 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot-amber { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot-off { background: var(--text-5); box-shadow: none; }
.landing h1 { margin: 0; font-size: clamp(32px, 6vw, 46px); font-weight: 600; line-height: 1.04; letter-spacing: -0.04em; text-wrap: balance; }
.lede { max-width: 560px; margin: 18px 0 0; color: var(--text-2); font-size: 16px; line-height: 1.55; text-wrap: pretty; }
.landing .actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.landing .btn { height: 36px; padding: 0 18px; }
.facts { margin: 36px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--text-3); }
.facts li { display: flex; gap: 9px; align-items: baseline; }
.facts li::before { content: ""; position: relative; top: -2px; width: 9px; height: 5px; flex: none; border-left: 1.5px solid var(--good); border-bottom: 1.5px solid var(--good); transform: rotate(-45deg); }
.facts li.no::before { border-color: var(--text-5); }
.stub-note { margin-top: 22px; padding: 10px 12px; border-radius: 6px; box-shadow: inset 0 0 0 1px #f5b14c55; color: var(--accent); font: 11px/1.5 var(--mono); max-width: 560px; }

/* ---- Console shell ---------------------------------------------------------------- */
.console { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.console aside { position: sticky; top: 0; align-self: start; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; padding: 16px 10px; border-right: 1px solid var(--line-soft); }
.console aside .wordmark { padding: 4px 10px 18px; }
.console nav ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 1px; }
.console nav a { display: flex; align-items: center; padding: 7px 10px; border-radius: 6px; color: var(--text-3); text-decoration: none; transition: color 150ms ease, background-color 150ms ease; }
.console nav a:hover { color: var(--text); background: #ffffff08; }
.console nav a[aria-current="page"] { background: var(--hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.who { display: grid; gap: 8px; padding: 12px 10px 0; border-top: 1px solid var(--line-soft); }
.who span { font: 12px var(--mono); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console main { width: 100%; max-width: 1040px; padding: 32px clamp(16px, 3vw, 32px) 64px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.page-head h1:focus { outline: none; }
.page-head .row { display: flex; flex-wrap: wrap; gap: 8px; }
.crumb { margin: 0 0 6px; font-size: 12px; }
.crumb a { color: var(--text-3); text-decoration: none; }
.crumb a:hover { color: var(--text); text-decoration: underline; }
.sub { margin: 6px 0 0; color: var(--text-3); max-width: 62ch; }

.panel { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.panel h2 { margin: 0 0 12px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.card { border-radius: 8px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { height: 32px; padding: 0 12px; text-align: left; white-space: nowrap; font-size: 11px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--line-soft); }
td { height: 42px; padding: 6px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
td a.row-link { color: inherit; text-decoration: none; font-weight: 500; }
td a.row-link:hover { text-decoration: underline; }
td .goal { display: block; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 12px; }
td.num, th.num { text-align: right; }
td.actions { text-align: right; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 8px; font: 11px var(--mono); color: var(--text-2); white-space: nowrap; }
.stale { display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 4px; box-shadow: inset 0 0 0 1px #f5b14c66; color: var(--accent); font: 10px var(--mono); }
.state { padding: 28px 16px; color: var(--text-3); }
.state h2 { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.state p { margin: 0 0 14px; max-width: 56ch; }
.error-state { color: var(--bad); }
.note { margin: 0 0 14px; padding: 10px 12px; border-radius: 6px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-3); max-width: 70ch; }

dl.fields { display: grid; grid-template-columns: 130px minmax(0, 1fr); margin: 0; font-size: 13px; }
dl.fields dt { padding: 7px 0; color: var(--text-3); border-top: 1px solid var(--line-soft); }
dl.fields dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--line-soft); overflow-wrap: anywhere; }
dl.fields dt:first-of-type, dl.fields dt:first-of-type + dd { border-top: 0; }
pre.preview { margin: 0; padding: 14px 12px; max-height: 320px; overflow: auto; font: 12px/1.6 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.code-head { display: flex; justify-content: space-between; align-items: center; height: 32px; padding: 0 12px; border-bottom: 1px solid var(--line-soft); font: 11px var(--mono); color: var(--text-2); }

form.stack { display: grid; gap: 14px; max-width: 520px; }
label { display: grid; gap: 6px; font-size: 12px; color: var(--text-3); }
input, select { width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--page); color: var(--text); font: 13px var(--mono); box-shadow: inset 0 0 0 1px var(--line); }
input:focus-visible, select:focus-visible { outline: 2px solid #d7d7dc; outline-offset: 1px; }
input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--bad); }
.hint { font-size: 12px; color: var(--text-5); }
.field-error { min-height: 1.4em; margin: 0; color: var(--bad); font-size: 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; max-width: 520px; }
.inline-form label { flex: 1 1 200px; }

/* ---- Dialog (native, from the Signway console) ------------------------------------------ */
.dlg { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; border-radius: 12px; background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), 0 24px 80px #000a; overflow: auto; }
.dlg[data-wide] { width: min(720px, calc(100vw - 32px)); }
.dlg::backdrop { background: #05050699; backdrop-filter: blur(2px); }
.dlg-head { display: flex; gap: 16px; align-items: start; justify-content: space-between; padding: 16px 16px 12px; border-bottom: 1px solid var(--line-soft); }
.dlg-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.dlg-head p { margin: 6px 0 0; color: var(--text-3); line-height: 1.5; }
.dlg-close { all: unset; padding: 2px 8px; border-radius: 5px; color: var(--text-3); cursor: pointer; }
.dlg-close:hover { color: var(--text); background: var(--hover); }
.dlg-close:focus-visible { outline: 2px solid #d7d7dc; outline-offset: 2px; }
.dlg-body { padding: 16px; display: grid; gap: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .dlg[open] { animation: dlg-in 180ms var(--ease); }
  .mark rect, .mark path { stroke-dasharray: 1; animation: draw 520ms var(--ease) backwards; }
  .mark .m-row { animation-delay: 220ms; }
  .mark .m-row + .m-row { animation-delay: 300ms; }
  .toast { animation: dlg-in 180ms var(--ease); }
}
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
.toast { position: fixed; left: 0; right: 0; width: max-content; max-width: calc(100vw - 32px); margin-inline: auto; bottom: 20px; z-index: 30; padding: 9px 14px; border-radius: 8px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line), 0 12px 40px #000a; font-size: 12px; }

/* ---- Phones: the sidebar becomes a top bar --------------------------------------------- */
@media (max-width: 760px) {
  .console { grid-template-columns: minmax(0, 1fr); }
  .console aside { position: static; height: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .console aside .wordmark { padding: 0; margin-right: auto; }
  .console nav { order: 3; width: 100%; }
  .console nav ul { display: flex; }
  .who { order: 2; display: flex; align-items: center; border: 0; padding: 0; }
  .who span { display: none; }
  .console main { padding-top: 20px; }
  dl.fields { grid-template-columns: 100px minmax(0, 1fr); }
  .hide-sm { display: none; }
  td.actions .btn + .btn { margin-top: 0; }
}
.row.top { margin-top: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .dlg::backdrop { animation: fade 180ms ease-out; }
  .dlg[data-closing] { opacity: 0; transform: scale(0.97); transition: opacity 120ms var(--ease), transform 120ms var(--ease); }
  .dlg[data-closing]::backdrop { opacity: 0; transition: opacity 120ms var(--ease); }
  .toast[data-leaving] { opacity: 0; transition: opacity 150ms var(--ease); }
}
@keyframes fade { from { opacity: 0; } }
