/* Session board: dark like Albert, four columns on desktop, one column with tabs on the phone. */
:root {
  --bg: #0b0e12; --bg-2: #11161c; --card: #151b22; --card-2: #1a222b; --line: #232d38;
  --text: #e4e8ec; --muted: #8b97a3; --faint: #5c6874;
  --teal: #56c2b4; --amber: #e7b15a; --violet: #9b8cf0; --green: #6cc48a; --red: #e2756b;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; min-height: 100dvh; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.4em; }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; cursor: pointer;
}
button:hover { border-color: var(--faint); }
button.primary { background: var(--teal); color: #06231f; border-color: var(--teal); font-weight: 600; }
button.ok { background: transparent; border-color: var(--green); color: var(--green); font-weight: 600; }
button.small { padding: 3px 9px; font-size: 13px; border-radius: 8px; }
input, select, textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%;
}

.login-view { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.login { width: min(340px, 100%); display: grid; gap: 12px; text-align: center; }
.login h1 { margin: 0; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 18px; }
.sources { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; flex: 1; }
.sources .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--faint); }
.sources .on { background: var(--green); }
.sources .off { background: var(--red); }
.actions { display: flex; gap: 8px; align-items: center; }
.actions input { width: 180px; }

.tabs { display: none; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 12px 16px 40px; align-items: start; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; min-height: 120px; }
.col h2 {
  margin: 0; padding: 10px 12px; font-size: 14px; display: flex; justify-content: space-between;
  border-bottom: 1px solid var(--line); position: sticky; top: 58px; background: var(--bg-2); border-radius: 14px 14px 0 0;
}
.col[data-col=running] h2 { color: var(--teal); }
.col[data-col=waiting] h2 { color: var(--amber); }
.col[data-col=review] h2 { color: var(--violet); }
.col[data-col=done] h2 { color: var(--green); }
.col .list { display: grid; gap: 8px; padding: 10px; }
.empty { color: var(--faint); font-size: 13px; padding: 6px 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; display: grid; gap: 5px; }
.card.stale { opacity: .75; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; font-size: 11.5px; color: var(--muted); }
.badge.src-claude { color: #f0a77a; border-color: #5a3d2c; }
.badge.src-antigravity { color: #8ab4f8; border-color: #2c3f5a; }
.badge.src-manual { color: var(--teal); border-color: #22504a; }
.badge.test { color: var(--red); border-color: #5a2c2c; }
.card .topic { font-weight: 600; font-size: 14.5px; }
.card .title { font-size: 12.5px; color: var(--muted); }
.card .text { font-size: 13px; color: #c3cbd3; white-space: pre-wrap; word-break: break-word; }
.card .text b { color: var(--text); font-weight: 600; }
.card .note { font-size: 13px; border-left: 3px solid var(--amber); padding-left: 8px; color: #e9dcc2; white-space: pre-wrap; }
.card .done-info { font-size: 12.5px; color: var(--green); }
.card .btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.card .id { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--faint); cursor: copy; }

dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 18px; width: min(440px, 94vw); }
dialog.wide { width: min(860px, 96vw); max-height: 88dvh; }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog form { display: grid; gap: 10px; }
dialog h2 { margin: 0 0 4px; font-size: 17px; }
dialog label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; }
.archive-head { display: flex; gap: 10px; align-items: center; }
.archive-head h2 { margin: 0; }
.archive-head input { flex: 1; }
.archive-list { display: grid; gap: 8px; overflow: auto; max-height: 66dvh; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--card-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; z-index: 50; max-width: 92vw;
}

@media (max-width: 860px) {
  .actions { width: 100%; }
  .actions input { flex: 1; width: auto; }
  .tabs { display: flex; gap: 6px; padding: 10px 12px 0; overflow-x: auto; position: sticky; top: 104px; background: var(--bg); z-index: 4; }
  .tabs button { white-space: nowrap; }
  .tabs button[aria-selected=true] { border-color: var(--teal); color: var(--teal); }
  .board { grid-template-columns: 1fr; padding: 10px 12px 40px; }
  .col { display: none; }
  .col.active { display: block; }
  .col h2 { position: static; }
}
