/* Team and admin pages (/app, /admin). Tokens copied from the public page (spec 03 §3 "Design tokens");
   mobile-first, 16 px side gutter, no horizontal page scroll. Same-origin only (CSP).
   13.11.2026: grey surface (design-coordinator, lang-mumpsik §10) — no amber or brown anywhere. The accent is black,
   the LED is green, meaning sits in a muted background tint and the text stays black. */
:root {
  color-scheme: light;
  --bg: #D9DADC;
  --bg-2: #F2F2F3;
  --bg-3: #E4E5E7;
  --rule: #C3C5C9;
  --ink-faint: #9A9DA2;
  --ink-mute: #46494F;
  --ink-soft: #222428;
  --ink: #000000;
  --accent: #1F2023;
  --accent-dim: rgba(0, 0, 0, .06);
  --led: #22C55E;
  --glow: rgba(34, 197, 94, .55);
  --pos: #146C34;
  --neg: #B91C1C;
  --pos-dim: #C2E5CE;
  --neg-dim: #F0CCCC;
  --warn-dim: #F3EFBA;
  --note: #F6F3D3;
  --radius: 9px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); }
a { color: var(--ink); }
main, .mast, footer { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.mast { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 14px; font-size: 14px; }
.brand { color: var(--ink); text-decoration: none; font-weight: 500; letter-spacing: .02em; }
.led { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px var(--glow); vertical-align: middle; }
.who { color: var(--ink-mute); text-align: right; overflow-wrap: anywhere; }
h1 { font-weight: 300; font-size: 28px; margin: 8px 0 12px; }
h2 { font-weight: 500; font-size: 16px; margin: 0 0 8px; }
.lede { color: var(--ink-soft); }
.muted { color: var(--ink-mute); font-size: 14px; }
.banner { background: var(--note); border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.card { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
@media (min-width: 641px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.tile-label { display: block; font-size: 12px; color: var(--ink-mute); }
.tile-value { display: block; font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }
.num, .tile-value { font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--bg-3); overflow-wrap: anywhere; }
.list li:last-child { border-bottom: 0; }
.list li.unread { font-weight: 500; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--bg-3); }
.pill.buy { background: var(--pos-dim); color: var(--ink); }
.pill.sell { background: var(--neg-dim); color: var(--ink); }
.pill.warn { background: var(--warn-dim); color: var(--ink); }
.details { margin: 0; }
.kv { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--bg-3); }
.kv dt { color: var(--ink-mute); font-size: 14px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.btn { display: inline-block; border: 1px solid var(--ink); background: var(--ink); color: var(--bg-2); border-radius: 999px; padding: 10px 18px; font: inherit; text-decoration: none; cursor: pointer; min-height: 44px; }
.btn.danger { background: var(--neg); border-color: var(--neg); }
.btn[disabled] { opacity: .5; cursor: progress; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--bg-3); overflow-wrap: anywhere; }
.echo { display: block; font-size: 13px; color: var(--ink-mute); min-height: 1.2em; }
.echo.bad { color: var(--neg); }
.draft-note { background: var(--bg-3); border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; }
footer { color: var(--ink-mute); font-size: 12px; padding-top: 24px; padding-bottom: 24px; }

/* ---- team area: menu, forms, confirmation (src/views/app, src/views/components) ---- */
[hidden] { display: none !important; }
.tabs { max-width: 720px; margin: 0 auto; padding: 0 16px 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border-radius: 999px; background: var(--bg-3); color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.tab.current { background: var(--ink); color: var(--bg-2); }
.badge { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: var(--bg-2); font-size: 12px; text-align: center; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btn.ghost { background: var(--bg-2); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.field { display: block; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 500; margin: 0 0 6px; padding: 0; }
.field input[type=text], .field input[type=search], .field input[type=date], .field select, .field textarea {
  display: block; width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--bg-2); color: var(--ink); min-height: 44px; }
.field textarea { resize: vertical; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--neg); }
.hint { display: block; font-size: 13px; color: var(--ink-mute); margin-top: 4px; }
.err { display: block; font-size: 14px; color: var(--neg); margin-top: 4px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices.stacked { flex-direction: column; }
.choice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-2); cursor: pointer; min-height: 44px; }
.choice small { color: var(--ink-mute); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input, .check input, .pick input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.check, .field > .check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; margin: 0; }
.picker input[type=search] { margin-bottom: 8px; }
.picker-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.pick { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-2); cursor: pointer; overflow-wrap: anywhere; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--accent); }
.pick-label { font-size: 14px; }
.markers { color: var(--ink); }
.notice { border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; font-size: 14px; border: 1px solid var(--rule); background: var(--bg-2); overflow-wrap: anywhere; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice.info { background: var(--bg-3); border-color: var(--rule); }
.notice.warn { background: var(--warn-dim); border-color: var(--rule); }
.notice.bad { background: var(--neg-dim); border-color: var(--rule); }
.notice.ok { background: var(--pos-dim); border-color: var(--rule); }
.echoes { list-style: none; margin: 10px 0; padding: 0; }
.echo-line { padding: 6px 0; border-bottom: 1px solid var(--bg-3); }
.echo-line.warn .echo-warning { color: var(--neg); }
.reason { font-size: 14px; color: var(--ink-soft); }
.cancel-link { font-size: 13px; white-space: nowrap; }
.list li.removed { opacity: .6; }
.pos-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.pos-val { margin-left: auto; font-weight: 500; }
.pos-meta { margin-top: 2px; }

/* the unread badge sits on a black chip when its tab is current */
.tab.current .badge { background: var(--bg-2); color: var(--ink); }
/* ---- admin: wide tables need room (13.11.2026: 720 px broke words mid-way in a 1300 px window) ---- */
body[data-area=admin] main, body[data-area=admin] .mast, body[data-area=admin] footer { max-width: 1100px; }
body[data-area=admin] .tbl th { white-space: nowrap; }
body[data-area=admin] .tbl th, body[data-area=admin] .tbl td { overflow-wrap: break-word; vertical-align: top; }
body[data-area=admin] .tbl td.nowrap { white-space: nowrap; }
body[data-area=admin] .adm-form { max-width: 640px; }
