:root {
  --bg: #f6f8fb; --panel: #ffffff; --fg: #1c2430; --muted: #5f6b7a; --line: #e2e7ee; --hover: #f1f4f8; --active: #e7f0fd;
  --accent: #1a6fd6; --accent-fg: #ffffff; --in-bubble: #eef1f5; --out-bubble: #1a6fd6; --out-fg: #ffffff;
  --needs: #b45309; --needs-bg: #fff3e0; --queued: #5b4bd6; --queued-bg: #efecfe; --sent: #1a6fd6; --sent-bg: #e7f0fd;
  --wait: #0f766e; --wait-bg: #e1f5f2; --stop: #b42318; --stop-bg: #fdecea; --closed: #5f6b7a; --closed-bg: #eef1f5;
  --warn-bg: #fff6e0; --warn-fg: #7a4a00; --ok-bg: #e6f4ea; --ok-fg: #1e6b3a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141a; --panel: #161d25; --fg: #e6ebf1; --muted: #95a2b3; --line: #26313d; --hover: #1c2530; --active: #1b2a3d;
    --accent: #5aa2f0; --accent-fg: #071a2e; --in-bubble: #222c38; --out-bubble: #2f6fbf; --out-fg: #ffffff;
    --needs: #f3b25f; --needs-bg: #3a2a12; --queued: #b3a8ff; --queued-bg: #2a2550; --sent: #8cc0f7; --sent-bg: #1b2a3d;
    --wait: #6fd3c4; --wait-bg: #133330; --stop: #ff8a80; --stop-bg: #3d1a18; --closed: #95a2b3; --closed-bg: #222c38;
    --warn-bg: #3a2a12; --warn-fg: #f3c98a; --ok-bg: #16301f; --ok-fg: #8fd6a8; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141a; --panel: #161d25; --fg: #e6ebf1; --muted: #95a2b3; --line: #26313d; --hover: #1c2530; --active: #1b2a3d;
  --accent: #5aa2f0; --accent-fg: #071a2e; --in-bubble: #222c38; --out-bubble: #2f6fbf; --out-fg: #ffffff;
  --needs: #f3b25f; --needs-bg: #3a2a12; --queued: #b3a8ff; --queued-bg: #2a2550; --sent: #8cc0f7; --sent-bg: #1b2a3d;
  --wait: #6fd3c4; --wait-bg: #133330; --stop: #ff8a80; --stop-bg: #3d1a18; --closed: #95a2b3; --closed-bg: #222c38;
  --warn-bg: #3a2a12; --warn-fg: #f3c98a; --ok-bg: #16301f; --ok-fg: #8fd6a8; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1, h2, h3 { margin: 0; }

/* shell */
.shell { display: grid; grid-template-columns: 220px 1fr; height: 100dvh; }
.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; flex: none; }
.logo svg { width: 20px; height: 20px; fill: var(--accent-fg); }
.brand-name { font-weight: 650; font-size: 16px; }
.brand-line { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.navlist { display: flex; flex-direction: column; gap: 2px; }
.navbtn { display: flex; align-items: center; gap: 12px; border: 0; background: none; border-radius: 999px; padding: 10px 14px; text-align: left; font-weight: 550; color: var(--fg); }
.navbtn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.navbtn:hover { background: var(--hover); }
.navbtn[aria-current="page"] { background: var(--active); color: var(--accent); }
.badge { margin-left: auto; background: var(--accent); color: var(--accent-fg); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.badge.warn { background: var(--needs); color: #fff; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 58px; }
.top h1 { font-size: 18px; font-weight: 650; }
.today { flex: 1; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today b { color: var(--fg); font-weight: 650; }
.top-actions { display: flex; gap: 8px; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabbar { display: none; }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 14px; min-height: 38px; font-weight: 600; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--hover); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.pri:hover { filter: brightness(1.06); }
.btn.danger { color: var(--stop); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.linkbtn { border: 0; background: none; color: var(--accent); padding: 0; font-size: 13px; font-weight: 600; }

.banner { padding: 8px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line); background: var(--warn-bg); color: var(--warn-fg); }
.banner.ok { background: var(--ok-bg); color: var(--ok-fg); }
code { font-size: 12.5px; background: rgba(127,127,127,.15); padding: 1px 5px; border-radius: 4px; }

/* lists + chips */
.split { flex: 1; display: grid; grid-template-columns: minmax(300px, 380px) 1fr; min-height: 0; }
.list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.search { padding: 12px 12px 6px; }
.search input, input.search-in { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 9px 14px; outline: none; }
.search input:focus, input.search-in:focus { border-color: var(--accent); }
.filters { display: flex; gap: 6px; padding: 6px 12px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: none; }
.filters::-webkit-scrollbar { display: none; }
.chipbtn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 10px; font-size: 13px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; min-height: 30px; }
.chipbtn .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chipbtn[aria-pressed="true"] { background: var(--active); border-color: var(--accent); color: var(--accent); }
.chipbtn[aria-pressed="true"] .n { color: var(--accent); }
.convos { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.convo { display: flex; gap: 12px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.convo:hover { background: var(--hover); }
.convo.active { background: var(--active); }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 650; font-size: 14px; color: #fff; }
.convo .mid { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.convo .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo.unread .name, .convo.unread .snippet { font-weight: 700; color: var(--fg); }
.time { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.snippet { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row3 { display: flex; gap: 6px; align-items: center; min-width: 0; flex-wrap: wrap; }
.house-tag { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { font-size: 11.5px; font-weight: 650; border-radius: 999px; padding: 2px 8px; white-space: nowrap; display: inline-block; }
.chip.needs { color: var(--needs); background: var(--needs-bg); }
.chip.queued { color: var(--queued); background: var(--queued-bg); }
.chip.sent { color: var(--sent); background: var(--sent-bg); }
.chip.waiting { color: var(--wait); background: var(--wait-bg); }
.chip.optout { color: var(--stop); background: var(--stop-bg); }
.chip.closed, .chip.plain { color: var(--closed); background: var(--closed-bg); }
.chip.email { color: var(--wait); background: var(--wait-bg); font-weight: 600; }
.empty-list { padding: 32px 20px; color: var(--muted); text-align: center; font-size: 14px; list-style: none; }

/* thread */
.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.thead { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.back { display: none; }
.who { flex: 1; min-width: 0; }
.who .name { font-weight: 650; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who .meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.who .phone { font-variant-numeric: tabular-nums; color: var(--fg); }
.thead select { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 8px; font-size: 13.5px; }
.context { background: var(--panel); border-bottom: 1px solid var(--line); padding: 6px 16px; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; max-height: 64px; overflow-y: auto; }
.context b { color: var(--fg); font-weight: 600; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; color: var(--muted); font-size: 12px; margin: 12px 0 6px; font-weight: 600; }
.bubble-wrap { display: flex; flex-direction: column; max-width: min(520px, 78%); }
.bubble-wrap.in { align-self: flex-start; }
.bubble-wrap.out { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 9px 13px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.in .bubble { background: var(--in-bubble); border-bottom-left-radius: 6px; }
.out .bubble { background: var(--out-bubble); color: var(--out-fg); border-bottom-right-radius: 6px; }
.out .bubble a { color: inherit; }
.bubble-meta { font-size: 11.5px; color: var(--muted); margin: 2px 6px 6px; }
.bubble-meta.bad { color: var(--stop); font-weight: 600; }
.sys { align-self: center; max-width: 86%; text-align: center; color: var(--muted); font-size: 12.5px; background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; padding: 6px 12px; margin: 6px 0; }
.call { align-self: center; color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.call svg { width: 15px; height: 15px; fill: currentColor; }
.ecard { flex: none; align-self: center; width: min(500px, 92%); background: var(--in-bubble); border-radius: 18px; margin: 8px 0; overflow: hidden; }
.ecard > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: 12px; padding: 12px 14px; -webkit-tap-highlight-color: transparent; }
.ecard > summary::-webkit-details-marker { display: none; }
.ecard > summary:hover { background: rgba(127, 127, 127, .07); }
.ec-icon { grid-row: 1 / span 3; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.ec-icon svg { width: 16px; height: 16px; }
.ec-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-when { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 3px; padding-left: 8px; white-space: nowrap; }
.ec-chev { width: 13px; height: 13px; transition: transform .2s ease; }
.ecard[open] .ec-chev { transform: rotate(90deg); }
.ec-snip { grid-column: 2 / 4; margin-top: 1px; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ec-meta { grid-column: 2 / 4; margin-top: 4px; font-size: 12px; color: var(--muted); }
.ec-meta b { color: var(--wait); font-weight: 600; }
.ecard[open] .ec-snip { display: none; }
.ecard[open] .ec-title { white-space: normal; }
.ec-body { padding: 0 14px 4px 56px; animation: ec-in .22s ease; }
@keyframes ec-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ec-msg { padding: 11px 0 12px; border-top: 1px solid rgba(127, 127, 127, .18); }
.ec-from { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.ec-from b { color: var(--fg); font-weight: 600; }
.ec-text { margin-top: 3px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ec-ev { padding: 8px 0; border-top: 1px solid rgba(127, 127, 127, .18); font-size: 12.5px; color: var(--muted); }
.ecap { flex: none; align-self: center; max-width: 86%; text-align: center; font-size: 12px; color: var(--muted); margin: 3px 0; overflow-wrap: anywhere; }
details.ecap > summary { list-style: none; cursor: pointer; }
details.ecap > summary::-webkit-details-marker { display: none; }
details.ecap > summary::after { content: ' ›'; }
details.ecap[open] > summary::after { content: ' ⌄'; }
.ecap-line { margin-top: 3px; }
.ec-text a { color: var(--accent); }
@media (max-width: 600px) { .ec-body { padding-left: 14px; } }
@media (prefers-reduced-motion: reduce) { .ec-body { animation: none; } .ec-chev { transition: none; } }
.composer { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.pending-strip { display: flex; gap: 8px; align-items: center; font-size: 13px; background: var(--queued-bg); color: var(--queued); border-radius: 10px; padding: 6px 10px; flex-wrap: wrap; }
.pending-strip .why { color: var(--fg); opacity: .8; }
.comp-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.comp-tools select { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 8px; font-size: 13px; max-width: 100%; }
.comp-tools .count { margin-left: auto; font-variant-numeric: tabular-nums; }
.comp-row { display: flex; gap: 10px; align-items: flex-end; }
.comp-row textarea { flex: 1; resize: none; border: 1px solid var(--line); background: var(--bg); border-radius: 18px; padding: 10px 14px; min-height: 44px; max-height: 220px; outline: none; line-height: 1.4; }
.comp-row textarea:focus { border-color: var(--accent); }
.sendbtn { min-height: 44px; padding: 0 18px; }
.comp-foot { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.comp-foot .saved { margin-left: auto; }
.blocked-note { color: var(--stop); font-weight: 600; font-size: 13px; }
.empty-pane { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.empty-pane .big { font-size: 17px; color: var(--fg); font-weight: 600; margin-bottom: 6px; }

/* forms */
.newform { background: var(--panel); border-bottom: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 10px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; flex: 1 1 160px; }
label.f input, label.f select, label.f textarea, .in { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px; font-size: 15px; font-weight: 400; color: var(--fg); }
label.f input:focus, label.f select:focus, label.f textarea:focus, .in:focus { border-color: var(--accent); outline: none; }
label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); font-weight: 500; }
label.check input { width: 18px; height: 18px; }
.exists { font-size: 13px; color: var(--muted); }

/* page views (approvals, prospects, drips, settings) */
.page { flex: 1; overflow-y: auto; padding: 16px; }
.page-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { font-size: 16px; }
.card h3 { font-size: 14px; }
.card .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card .row .grow { flex: 1; }
.card textarea.body { width: 100%; resize: vertical; min-height: 64px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; line-height: 1.4; }
.card textarea.body:focus { border-color: var(--accent); outline: none; }
.quote { font-size: 13.5px; background: var(--bg); border-left: 3px solid var(--line); padding: 6px 10px; border-radius: 0 8px 8px 0; color: var(--fg); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.statusdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--closed); }
.statusdot.on { background: #22a35a; }
.statusdot.off { background: var(--stop); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.tile:hover { background: var(--hover); }
.tile b { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 13.5px; }
.tile.warn { border-color: var(--needs); }
.tile.warn b { color: var(--needs); }
.hrow { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.hrow:first-of-type { border-top: 0; }
.hrow .grow { flex: 1; min-width: 0; }

.ptable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ptable td, .ptable th { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ptable th { font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 0; background: var(--panel); }
.ptable tr:hover td { background: var(--hover); }
.ptable .nm { font-weight: 600; }
.ptable input[type=checkbox] { width: 18px; height: 18px; }
.selbar { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; box-shadow: 0 -4px 16px rgba(16,24,40,.06); }
.selbar .grow { flex: 1; }
.step { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.step .row input[type=number] { width: 70px; }
.preview-line { font-size: 13px; color: var(--muted); }
.token { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; user-select: all; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--panel); color: var(--fg); width: min(640px, calc(100vw - 32px)); box-shadow: var(--shadow); max-height: calc(100dvh - 40px); }
dialog::backdrop { background: rgba(10, 15, 25, .45); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dlg h2 { font-size: 18px; }
.dlg > label.f { flex: none; }
.dlg p { margin: 0; font-size: 13.5px; }
.dlg textarea.csv { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px; }
.dlg summary { cursor: pointer; font-size: 13.5px; color: var(--accent); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { color: var(--muted); font-size: 12.5px !important; }
.preview { font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.preview .sum { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.preview .sum b { font-variant-numeric: tabular-nums; }
.preview .sample { background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.preview .sample .who { font-weight: 600; font-size: 12.5px; color: var(--muted); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 6px 12px; font-size: 13.5px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--active); color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1c2430; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); z-index: 10; }
.toast.err { background: #b42318; }

/* phone */
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; height: calc(100dvh - 62px - env(safe-area-inset-bottom)); }
  .rail { display: none; }
  .top { padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); gap: 10px; min-height: 52px; }
  .today { display: none; }
  .top-actions { margin-left: auto; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line); z-index: 5; }
  .tabbar .navbtn { flex: 1; flex-direction: column; gap: 2px; border-radius: 0; padding: 8px 2px; font-size: 11px; font-weight: 600; justify-content: center; align-items: center; position: relative; }
  .tabbar .navbtn[aria-current="page"] { background: none; }
  .tabbar .badge { position: absolute; top: 4px; left: 52%; margin: 0; font-size: 10.5px; padding: 0 6px; }
  .split { grid-template-columns: 1fr; }
  .split .thread { display: none; }
  body.show-thread .split .list { display: none; }
  body.show-thread .split .thread { display: flex; }
  .back { display: inline-flex; }
  .bubble-wrap { max-width: 86%; }
  .grid2 { grid-template-columns: 1fr; }
  .thead { padding: 8px 12px; gap: 8px; }
  .thead select { max-width: 112px; font-size: 12.5px; padding: 5px 6px; }
  .back { padding: 4px 6px; }
  .msgs { padding: 12px; }
  .composer { padding-left: 12px; padding-right: 12px; }
  .page { padding: 12px; }
  .hide-phone { display: none !important; }
  .tiles { gap: 8px; grid-template-columns: 1fr 1fr; }
  .tile { padding: 10px 12px; }
  .tile b { font-size: 22px; }
  .tile span { font-size: 12px; }
  .tabbar .navbtn span { font-size: 10.5px; }
  .ptable .hide-phone { display: none; }
}
