:root {
  --bg: #f4f5f2;
  --panel: #ffffff;
  --panel-2: #f9faf7;
  --ink: #1b1f1c;
  --ink-2: #5b635d;
  --ink-3: #8a918b;
  --line: #e3e6e0;
  --accent: #1f7a55;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ea;
  --warn: #b26a00;
  --warn-soft: #fdf1dc;
  --bad: #b3261e;
  --bad-soft: #fbe5e3;
  --me: #e3f1ea;
  --them: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.06), 0 2px 8px rgba(20, 30, 25, 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121513;
    --panel: #1a1e1b;
    --panel-2: #20251f;
    --ink: #e8ebe7;
    --ink-2: #a8b0a9;
    --ink-3: #7b847d;
    --line: #2c322d;
    --accent: #4cc38a;
    --accent-ink: #0d1f16;
    --accent-soft: #1d3a2b;
    --warn: #f0b04a;
    --warn-soft: #3a2c12;
    --bad: #f2867e;
    --bad-soft: #3d1c1a;
    --me: #1d3a2b;
    --them: #20251f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

.app { display: grid; grid-template-columns: 210px 1fr; height: 100vh; }
.nav {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand { font-weight: 650; font-size: 15px; padding: 4px 10px 16px; letter-spacing: -0.01em; }
.brand small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.nav a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none;
}
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--ink); font-weight: 550; }
.nav .spacer { flex: 1; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 99px; font-size: 11px; padding: 0 7px; min-width: 18px; text-align: center; }

main { overflow: auto; padding: 24px 28px; }
main.flush { padding: 0; overflow: hidden; }
h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -0.01em; }
.sub { color: var(--ink-2); margin: 0 0 20px; }
h2 { font-size: 15px; margin: 0 0 10px; }

.btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; }
input[type=text], input[type=number], input[type=password], input[type=url], input[type=time], select, textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 10px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 550; margin-bottom: 4px; }
label.field > em { display: block; font-style: normal; color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; word-break: break-all; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0; font-size: 15px; }
.card .meta { color: var(--ink-2); font-size: 13px; margin: 2px 0 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; margin: 10px 0 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border-radius: 99px; padding: 2px 9px; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.pill.open { background: var(--accent-soft); color: var(--ink); border-color: transparent; }
.pill.open::before { background: var(--accent); }
.pill.qr, .pill.connecting, .pill.replaced, .pill.elsewhere { background: var(--warn-soft); color: var(--ink); border-color: transparent; }
.pill.qr::before, .pill.connecting::before, .pill.replaced::before, .pill.elsewhere::before { background: var(--warn); }
.pill.logged_out { background: var(--bad-soft); color: var(--ink); border-color: transparent; }
.pill.logged_out::before { background: var(--bad); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); margin: 0 3px 3px 0; }

.progress { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width 0.4s; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); display: grid; place-items: center; z-index: 10; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; padding: 22px; width: min(460px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.qrbox { display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 12px; margin: 12px 0; min-height: 200px; }
.qrbox img { width: 260px; height: 260px; image-rendering: pixelated; }
.code { font: 600 30px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.12em; text-align: center; padding: 16px; background: var(--panel-2); border-radius: 10px; margin: 12px 0; }
ol.steps { padding-left: 18px; color: var(--ink-2); margin: 8px 0; }

/* inbox */
.inbox { display: grid; grid-template-columns: 340px 1fr; height: 100vh; }
.inbox .side { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.inbox .side .tools { padding: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: transparent; padding: 5px 4px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.seg button.on { background: var(--accent-soft); color: var(--ink); font-weight: 550; }
.chatlist { overflow: auto; flex: 1; }
.chatitem { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.chatitem:hover { background: var(--panel-2); }
.chatitem.on { background: var(--accent-soft); }
.chatitem .top { display: flex; justify-content: space-between; gap: 8px; }
.chatitem .name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatitem .time { color: var(--ink-3); font-size: 12px; flex-shrink: 0; }
.chatitem .prev { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; height: 100vh; }
.thread header { padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; gap: 12px; }
.thread header .who { flex: 1; min-width: 0; }
.thread header .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs { overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: min(620px, 78%); padding: 7px 10px; border-radius: 10px; background: var(--them); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--me); border-color: transparent; }
.msg .s { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.msg .t { font-size: 11px; color: var(--ink-3); text-align: right; margin-top: 2px; }
.msg .q { font-size: 12.5px; color: var(--ink-2); border-left: 3px solid var(--line); padding-left: 7px; margin-bottom: 4px; }
.msg.deleted { font-style: italic; color: var(--ink-3); }
.daysep { align-self: center; font-size: 12px; color: var(--ink-3); padding: 6px 0; }
.composer { border-top: 1px solid var(--line); background: var(--panel); padding: 10px 14px; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 40px; max-height: 160px; }
.empty { display: grid; place-items: center; height: 100%; color: var(--ink-3); text-align: center; padding: 30px; }
.contactpanel { border-top: 1px solid var(--line); padding: 12px 18px; background: var(--panel-2); display: grid; gap: 8px; }

table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
table.list th { color: var(--ink-3); font-weight: 550; background: var(--panel-2); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; align-items: start; }
.daypick { display: flex; gap: 4px; flex-wrap: wrap; }
.daypick label { border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; cursor: pointer; font-size: 13px; }
.daypick input { display: none; }
.daypick label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.switch { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; cursor: pointer; }
.switch input { margin-top: 3px; accent-color: var(--accent); }
.switch em { display: block; font-style: normal; color: var(--ink-3); font-size: 12px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 9px; z-index: 20; box-shadow: var(--shadow); }
.login { display: grid; place-items: center; height: 100vh; padding: 16px; }
.login .card { width: min(360px, 100%); }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .nav { flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand, .nav .spacer { display: none; }
  main { padding: 16px; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox.has-chat .side { display: none; }
  .inbox:not(.has-chat) .thread { display: none; }
  .thread { height: calc(100vh - 54px); }
}

/* board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; align-items: start; padding-bottom: 6px; }
.board .col { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 120px; display: grid; gap: 10px; align-content: start; }
.board .col h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 0; }
.taskcard { padding: 12px; }
.small-select { width: auto; padding: 4px 8px; font-size: 13px; }
@media (max-width: 760px) { .board { grid-auto-flow: row; grid-auto-columns: auto; } }

/* lists: person cards (mobile friendly) */
.people { display: grid; gap: 8px; }
.person { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 4px; }
.person.closed { opacity: .6; }
.p-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.p-meta { font-size: 12px; }
.p-reply { font-size: 13px; background: var(--panel-2); border-radius: 8px; padding: 6px 8px; }
.p-edit { display: grid; grid-template-columns: 150px 210px 1fr; gap: 6px; align-items: end; }
/* the two date boxes look the same (a phone shows no tooltip): each carries its name */
.p-date { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--ink-3); min-width: 0; }
.p-date input { width: 100%; }
.p-edit select, .p-edit input { padding: 5px 8px; font-size: 13px; }
.funnel { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.funnel .tag { cursor: pointer; font-size: 12.5px; padding: 3px 9px; }
.funnel .tag.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---- phones ---- */
main { min-width: 0; }
.seg { overflow-x: auto; scrollbar-width: none; }
.seg button { white-space: nowrap; }
@media (max-width: 760px) {
  body { font-size: 15px; }
  .nav { position: sticky; top: 0; z-index: 5; gap: 2px; scrollbar-width: none; }
  .nav a { white-space: nowrap; padding: 8px 10px; flex-shrink: 0; }
  main { padding: 14px 12px 40px; overflow-x: hidden; }
  h1 { font-size: 19px; }
  .card { padding: 12px; }
  .p-edit { grid-template-columns: 1fr; }
  .p-edit input, .p-edit select, input, select, textarea { font-size: 16px; } /* stops iPhone zooming into fields */
  .row > .btn { flex-shrink: 0; }
  .btn { padding: 9px 12px; } /* bigger touch targets */
  .btn.small { padding: 7px 10px; }
  .modal { padding: 16px; }
  .qrbox img { width: min(260px, 70vw); height: auto; }
  table.list { display: block; overflow-x: auto; }
  .thread header { flex-wrap: wrap; gap: 6px; padding: 10px; }
  .thread header .who { flex-basis: 60%; }
  .composer { padding: 8px; }
  .composer select { max-width: 96px; }
  .msg { max-width: 88%; }
  .kv { grid-template-columns: 1fr; gap: 0 12px; }
  .kv dt { margin-top: 6px; }
}

/* ===== Layout v2 (22 Oct 2026): top bar + ☰ menu, full-height pages, phone-first ===== */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; grid-template-columns: none; grid-template-rows: none; }
.topbar {
  flex: 0 0 auto; height: 52px; display: flex; align-items: center; gap: 4px; padding: 0 10px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 6;
}
.topbar .brand { font-weight: 650; font-size: 15px; padding: 0 10px 0 4px; white-space: nowrap; }
.topbar .tabs { display: flex; gap: 2px; }
.topbar .tab {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; white-space: nowrap; font-weight: 500;
}
.topbar .tab:hover { background: var(--panel-2); color: var(--ink); }
.topbar .tab.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.ico { display: inline-block; line-height: 1; }
.menu { position: relative; }
.menu-btn {
  display: flex; align-items: center; gap: 6px; font-size: 20px; line-height: 1; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer;
}
.menu-btn.active { background: var(--accent-soft); border-color: transparent; }
.menu-btn .menu-current { font-size: 16px; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.18); padding: 6px; z-index: 30;
  display: grid; gap: 2px;
}
.menu-panel[hidden] { display: none; }
.menu-panel a, .menu-panel .btn { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; border: 0; background: none; text-align: left; width: 100%; }
.menu-panel a:hover, .menu-panel .btn:hover { background: var(--panel-2); }
.menu-panel a.active { background: var(--accent-soft); font-weight: 600; }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
main { flex: 1 1 auto; min-height: 0; overflow: auto; }
main.flush { padding: 0; overflow: hidden; display: flex; }
main.flush > * { flex: 1; min-width: 0; }

/* inbox: fills the space under the top bar; the composer is always visible */
.inbox { height: 100%; min-height: 0; grid-template-columns: 340px minmax(0, 1fr); }
.inbox .side { min-height: 0; }
.thread { height: 100%; min-height: 0; min-width: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
.thread header { min-width: 0; }
.thread header .who { min-width: 0; }
.thread header .jid { display: block; font-size: 11.5px; }
.thread header .menu-panel { min-width: 220px; }
.msgs { min-height: 0; overflow-x: hidden; }
.msg { overflow-wrap: anywhere; }
.composer { gap: 6px; align-items: flex-end; }
.composer .grow { min-width: 0; }
.composer textarea { width: 100%; }
.btn.icon { padding: 7px 9px; font-size: 16px; line-height: 1; }
.icon-select { width: 46px; padding: 7px 4px; font-size: 16px; text-align: center; flex: 0 0 auto; }
.fold > summary, details.fold > summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
details.card.fold > summary { color: var(--ink); font-size: 14px; }
details.card.fold[open] > summary { margin-bottom: 10px; }

/* board: sections, compact cards */
.filters { gap: 6px; }
.filters .small-select { max-width: 170px; }
details.section {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 0 12px;
  box-shadow: var(--shadow);
}
details.section > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; padding: 12px 0; flex-wrap: wrap;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::before { content: '▸'; color: var(--ink-3); transition: transform .15s; display: inline-block; }
details.section[open] > summary::before { transform: rotate(90deg); }
details.section[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
details.section > :last-child { margin-bottom: 12px; }
.sec-title { font-weight: 650; font-size: 15px; }
.section .count { background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; font-size: 12px; padding: 0 8px; }
.sec-hint { font-size: 12px; }
.cardlist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); align-items: start; }
.taskcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.taskcard.prio { border-left: 4px solid var(--bad); background: var(--bad-soft); }
.taskcard.overdue .tc-title { color: var(--bad); }
.tc-head { display: flex; gap: 6px; align-items: flex-start; }
.tc-title { overflow-wrap: anywhere; font-weight: 600; }
.tc-meta { font-size: 12px; margin-top: 3px; }
.tc-note { font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.tc-actions { margin-top: 8px; gap: 6px; align-items: flex-start; }
/* closed: a small pill next to ✓ Done (one row per card); open: the full width below */
details.more { flex: 0 0 auto; }
/* open: never wider than the card — a long link, number or note used to push it (and the card) off a phone screen (6 Nov) */
details.more[open] { flex-basis: 100%; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
details.more[open] select, details.more[open] textarea, details.more[open] input { max-width: 100%; }
details.more > summary { cursor: pointer; color: var(--ink-3); font-size: 12.5px; }
details.more[open] { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
details.day { border-top: 1px solid var(--line); padding: 6px 0; }
details.day:first-child { border-top: 0; }
details.day > summary { cursor: pointer; padding: 4px 0; }
details.day .day-peek { font-size: 12px; }
details.day[open] .day-peek { display: none; }
details.day .cardlist { margin: 6px 0; }
.tag.own { background: var(--warn-soft); color: var(--ink); border-color: transparent; font-weight: 600; }

@media (max-width: 760px) {
  .app { height: 100vh; height: 100dvh; }
  .topbar { padding: 0 6px; gap: 2px; position: sticky; top: 0; }
  .topbar .brand { display: none; }
  .topbar .tab { padding: 7px 9px; gap: 4px; font-size: 14px; }
  main { padding: 12px 10px 40px; }
  main.flush { padding: 0; }
  .inbox { grid-template-columns: minmax(0, 1fr); height: 100%; }
  .thread { height: 100%; }
  .thread header { flex-wrap: nowrap; padding: 8px; gap: 6px; }
  .thread header .who { flex: 1 1 auto; flex-basis: auto; }
  .thread header .jid { display: none; }
  .composer { padding: 6px; }
  .composer .send .tab-label { display: none; }
  .composer textarea { min-height: 40px; font-size: 16px; }
  .btn.icon { padding: 8px; }
  .msgs { padding: 10px; }
  .filters { width: 100%; }
  .filters .small-select { flex: 1 1 40%; max-width: none; }
  .cardlist { grid-template-columns: minmax(0, 1fr); }
  .inbox .side .tools { padding: 8px; gap: 6px; }
}
@media (max-width: 360px) {
  .topbar .tab .tab-label { font-size: 13px; }
  .topbar .tab { padding: 6px 7px; }
}

/* ===== Side pane menu (☰ top left, slides in from the left) ===== */
.topbar .menu-btn { font-size: 22px; border: 0; background: transparent; padding: 6px 10px; margin-right: 2px; }
.topbar .menu-btn:hover { background: var(--panel-2); }
.app { position: relative; }
.drawer {
  position: fixed; top: 52px; left: 0; bottom: 0; width: min(300px, 86vw); background: var(--panel);
  border-right: 1px solid var(--line); box-shadow: 4px 0 24px rgba(0,0,0,.14); z-index: 40;
  display: flex; flex-direction: column; transform: translateX(-102%); transition: transform .2s ease; visibility: hidden;
}
.app.drawer-open .drawer { transform: none; visibility: visible; }
.scrim { position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,.28); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
.app.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.drawer-nav { flex: 1; overflow: auto; padding: 10px 8px; display: grid; gap: 2px; align-content: start; }
.drawer-nav a, .drawer-foot a {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 10px; color: var(--ink);
  text-decoration: none; font-size: 15px;
}
.drawer-nav a .ico, .drawer-foot a .ico { font-size: 19px; width: 24px; text-align: center; }
.drawer-nav a:hover, .drawer-foot a:hover { background: var(--panel-2); }
.drawer-nav a.active { background: var(--accent-soft); font-weight: 600; }
.drawer-nav hr { border: 0; border-top: 1px solid var(--line); margin: 6px 8px; }
.drawer-foot { border-top: 1px solid var(--line); background: var(--panel-2); padding: 8px; }
@media (prefers-reduced-motion: reduce) { .drawer, .scrim { transition: none; } }

/* board: room between ✓ Done and More; select cards for one note */
.tc-actions { gap: 10px; }
details.more > summary { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); }
.tc-head .pick { width: 18px; height: 18px; margin: 1px 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; cursor: pointer; }
.taskcard.picked { outline: 2px solid var(--accent); outline-offset: 1px; }
.pickbar {
  position: sticky; bottom: 10px; z-index: 20; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); margin-top: 10px;
}
.pickbar[hidden] { display: none; }
.pickbar .btn:not(.primary) { background: transparent; color: var(--bg); border-color: rgba(255,255,255,.4); }
/* card text stays selectable (copy a number, a note); only the card's empty space and icons start a long-press selection */
.taskcard { touch-action: manipulation; }
.taskcard .tc-head .ico, .taskcard .pick { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.taskcard .tc-title, .taskcard .tc-note, .taskcard .tc-meta, .taskcard details.more { -webkit-user-select: text; user-select: text; }
.taskcard a.tel { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.selall { margin-left: auto; }
details.day > summary .selall { margin-left: 8px; }

/* campaign focus */
.campaign-pick { width: auto; max-width: 260px; padding: 6px 8px; font-size: 13px; border-radius: 99px; background: var(--panel-2); }
.app.focused .topbar { box-shadow: inset 0 -3px 0 var(--accent); }
.app.focused .campaign-pick { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.tag.campaign-tag { background: var(--accent-soft); color: var(--ink); border-color: transparent; }
@media (max-width: 760px) {
  .campaign-pick { max-width: 132px; font-size: 12px; padding: 5px 6px; }
  /* phones: icon with a tiny word under it — icons alone (📁 💬 ✉️) didn't say what they open */
  .topbar .tab { flex-direction: column; gap: 1px; padding: 3px 8px; font-size: 17px; }
  .topbar .tab .tab-label { display: block; font-size: 10px; font-weight: 600; line-height: 1.1; }
}
.callrow[hidden] { display: none; }
.callrow { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 2px; }
/* Drafts: long-press selection like the Board; the action bar stays at the bottom of the screen */
.card.draftcard { touch-action: manipulation; }
.card.draftcard.picked { outline: 2px solid var(--accent); outline-offset: 1px; }
.card.draftcard .pick { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; cursor: pointer; }
.pickbar select { width: auto; max-width: 180px; color: var(--ink); background: var(--panel); }

/* empty lists: say what will appear here and why it is empty */
.empty { text-align: center; padding: 28px 16px; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel); }
.empty p { margin: 4px 0; }
.empty-ico { font-size: 30px; margin-bottom: 6px; }

/* Board: a card opened beside its chat (2 Nov). Phones: a full-screen sheet; wide screens: a panel to the right */
.tc-title[role="button"] { cursor: pointer; }
.tc-title[role="button"]:hover { text-decoration: underline; }
.tc-summary { font-size: 13px; margin-top: 4px; }
.tc-next { font-size: 13px; margin-top: 2px; color: var(--ink); font-weight: 600; }
.tc-story { font-size: 12.5px; margin: 6px 0; padding-left: 18px; color: var(--ink-2); }
.chat-card { font-size: 12px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-pane {
  position: fixed; top: 52px; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 45; background: var(--panel);
  border-left: 1px solid var(--line); box-shadow: -6px 0 24px rgba(0,0,0,.14); display: flex; flex-direction: column;
}
.pane-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pane-head b { font-size: 15px; overflow-wrap: anywhere; }
.pane-body { flex: 1; overflow: auto; padding: 12px 14px 24px; display: grid; gap: 12px; align-content: start; }
.pane-summary { margin: 0; font-weight: 600; }
.pane-label { font-size: 11px; letter-spacing: .06em; font-weight: 700; margin-bottom: 4px; }
.pane-next { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.pane-story ul { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; }
.pane-resched > summary { list-style: none; display: inline-flex; }
.pane-resched > summary::-webkit-details-marker { display: none; }
.pane-draft { border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 8px; display: grid; gap: 6px; margin-bottom: 6px; }
.pane-draft textarea, .pane-body textarea { width: 100%; }
.pane-msgs { max-height: 42vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--panel-2); border-radius: 10px; margin-bottom: 6px; }
.pane-msg { max-width: 85%; padding: 6px 9px; border-radius: 10px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pane-msg.them { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); }
.pane-msg.me { align-self: flex-end; background: var(--accent-soft); }
@media (min-width: 1100px) {
  /* the Board stays readable to the left of the pane */
  .app.pane-open main { padding-right: min(580px, 46vw); }
  .board-pane { width: min(560px, 44vw); }
}

/* profile pictures (8 Nov 2026): inbox list, chat header, draft cards */
.avatar { border-radius: 50%; object-fit: cover; background: var(--panel-2); flex: none; }
.chatitem .top { align-items: center; }
.chatitem .top .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
