:root {
  --bg: #f6f3ee; --side: #efebe3; --panel: #fffdf9; --soft: #f1ede6; --line: #e4ded3; --line-2: #d8d0c3;
  --ink: #1d1b18; --ink-2: #45413a; --muted: #686258;
  --accent: #e0562f; --accent-2: #c94a26; --accent-soft: #fbe7df;
  --ok: #23784a; --ok-soft: #e2f2e8; --warn: #8f5d0f; --warn-soft: #fbf0db; --bad: #b3362f; --bad-soft: #f9e2df; --info: #2f5fc4; --info-soft: #e3ebfb;
  --r: 16px; --r-sm: 10px;
  --shadow: 0 1px 0 rgba(29,27,24,.03), 0 8px 28px -12px rgba(29,27,24,.18);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513; --side: #1d1c19; --panel: #22201d; --soft: #2a2824; --line: #33302b; --line-2: #45413a;
    --ink: #f1ede6; --ink-2: #d6cfc3; --muted: #aca597;
    --accent: #f06a42; --accent-2: #ff7d57; --accent-soft: #3a2219;
    --ok: #5cc28b; --warn: #e0a548; --bad: #f07a6e; --info: #7ea6f5;
    --ok-soft: #173326; --warn-soft: #3a2d14; --bad-soft: #3b1c19; --info-soft: #1b2741;
    --shadow: 0 10px 30px -14px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { font-size: 16px; }
html.big { font-size: 18.5px; }
body { font: 1rem/1.55 var(--sans); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
.error { color: var(--bad); min-height: 1.2em; margin: 0; font-size: 14px; }
h1, h2, h3 { margin: 0; }

/* ---------- buttons & inputs ---------- */
.btn { appearance: none; border: 1px solid var(--line-2); background: var(--panel); padding: 8px 14px; border-radius: 999px; font-weight: 550; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; min-height: 40px; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 7px 13px; font-size: 13.5px; min-height: 36px; }
.btn.wide { width: 100%; padding: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
input, textarea, select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; min-height: 44px; }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
label.f { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); }

/* ---------- login ---------- */
.login { height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent), var(--bg); }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; text-align: center; }
.login-card h1 { font-size: 38px; }
.login-card p { margin: -6px 0 8px; }
.mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); position: relative; flex: none; display: block; }
.mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border: 2.6px solid #fff; border-right: 0; border-bottom: 0; transform: translate(-50%, -25%) rotate(45deg); border-radius: 1px; }
.mark.big { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto; }
.mark.big::after { width: 18px; height: 18px; border-width: 4.5px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr) 320px; height: 100%; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.new-chat { justify-content: flex-start; border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; box-shadow: var(--shadow); }
.new-chat span { color: var(--accent); font-weight: 800; }
.nav { display: grid; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 10px; min-height: 42px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav a.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.side-label { font-size: 11.5px; color: var(--muted); font-weight: 650; padding: 16px 10px 4px; text-transform: uppercase; letter-spacing: .07em; }
.chats { overflow: auto; display: grid; gap: 1px; align-content: start; min-height: 0; }
.chats a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; font-size: 14px; color: var(--ink-2); }
.chats a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.chats a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.chats a.on { background: var(--panel); color: var(--ink); }
.chats a button { width: 28px; height: 28px; opacity: 0; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; }
.chats a:hover button, .chats a:focus-within button { opacity: 1; }
@media (hover: none) { .chats a button { opacity: .7; } }
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.main { flex: 1; min-height: 0; overflow: auto; }
.page { max-width: 1040px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 40px) 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -.015em; }
.topbar { display: none; }
.today-pill { display: none; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: 100%; }
.thread { flex: 1; overflow: auto; padding: 28px 16px 12px; }
.thread-in { max-width: 760px; margin: 0 auto; display: grid; gap: 22px; }
.msg-user { justify-self: end; max-width: 82%; display: grid; gap: 8px; justify-items: end; }
.bubble { background: var(--soft); border: 1px solid var(--line); padding: 10px 15px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.att-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.att { width: 74px; height: 96px; border-radius: 12px; overflow: hidden; background: #000; position: relative; border: 1px solid var(--line); }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att .kind { position: absolute; left: 5px; bottom: 5px; font-size: 10px; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); padding: 1px 6px; border-radius: 99px; }
.msg-ai { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
.msg-ai > .mark { margin-top: 2px; }
.ai-text { line-height: 1.65; overflow-wrap: anywhere; }
.ai-text p { margin: 0 0 10px; } .ai-text p:last-child { margin: 0; }
.ai-text ul { margin: 4px 0 10px; padding-left: 20px; }
.ai-col { display: grid; gap: 12px; min-width: 0; }
.err-line { color: var(--bad); background: var(--bad-soft); padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.thinking { display: flex; gap: 5px; padding: 10px 0; align-items: center; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
.thinking span { margin-left: 8px; color: var(--muted); font-size: 13.5px; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.hello { max-width: 760px; margin: 0 auto; padding: 8vh 4px 20px; }
.hello h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 5vw, 46px); letter-spacing: -.02em; line-height: 1.1; }
.hello h1 em { font-style: italic; color: var(--accent); }
.hello .sub { color: var(--muted); font-size: 17px; margin: 10px 0 26px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 26px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat.ok b { color: var(--ok); } .stat.bad b { color: var(--bad); } .stat.info b { color: var(--info); }
.sugs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sug { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px 14px; cursor: pointer; font-size: 14px; color: var(--ink-2); line-height: 1.4; transition: border-color .15s, transform .15s; }
.sug:hover { border-color: var(--line-2); transform: translateY(-1px); color: var(--ink); }
.sug b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

.composer-wrap { padding: 8px 16px calc(14px + env(safe-area-inset-bottom)); }
.composer { max-width: 760px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow); padding: 10px 10px 8px 14px; transition: border-color .15s, background .15s; }
.composer:focus-within { border-color: var(--ink-2); }
.composer.drag { border-color: var(--accent); background: var(--accent-soft); }
.composer textarea { border: 0; padding: 4px 2px; min-height: 26px; max-height: 220px; resize: none; background: transparent; box-shadow: none; font-size: 15.5px; }
.composer textarea:focus { box-shadow: none; }
.comp-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.comp-atts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.comp-atts:empty { display: none; }
.catt { width: 56px; height: 70px; border-radius: 10px; overflow: hidden; position: relative; background: #000; }
.catt img, .catt video { width: 100%; height: 100%; object-fit: cover; }
.catt .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .2s; }
.catt button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; cursor: pointer; line-height: 1; padding: 0; }
.send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.send:disabled { background: var(--line-2); cursor: default; }
.send svg { stroke-width: 2.3; }
.hint { max-width: 760px; margin: 7px auto 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- cards in chat ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-h .t { font-weight: 650; }
.card-b { padding: 2px 16px; }
.card-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--soft); flex-wrap: wrap; align-items: center; }
.plan-media { display: flex; gap: 6px; padding: 12px 16px 0; }
.prow { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.prow-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prow-top .u { font-weight: 650; }
.prow-top .tm { color: var(--muted); font-size: 13px; }
.cap { font-size: 14px; color: var(--ink-2); white-space: pre-wrap; margin-top: 4px; max-height: 4.7em; overflow: hidden; position: relative; cursor: pointer; overflow-wrap: anywhere; }
.cap.open { max-height: none; }
.cap:not(.open)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.6em; background: linear-gradient(transparent, var(--panel)); }
.cap-edit { margin-top: 6px; display: grid; gap: 6px; }
.note { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ok); background: var(--ok-soft); padding: 7px 13px; border-radius: 99px; justify-self: start; font-weight: 550; }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.done-line { color: var(--ok); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; margin-right: auto; }
.done-line.gone { color: var(--muted); }

/* ---------- shared bits ---------- */
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--muted); font-size: 13px; border: 1px solid var(--line); }
.av.sm { width: 22px; height: 22px; font-size: 10px; }
.thumb { width: 40px; height: 50px; border-radius: 8px; object-fit: cover; background: var(--soft); flex: none; display: block; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.s-posted, .s-connected { background: var(--ok-soft); color: var(--ok); }
.s-scheduled { background: var(--info-soft); color: var(--info); }
.s-processing, .s-draft { background: var(--warn-soft); color: var(--warn); }
.s-failed, .s-reconnect { background: var(--bad-soft); color: var(--bad); }
.client-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; flex-wrap: wrap; }
.list .li:first-child { border-top: 0; }
.li .grow { flex: 1; min-width: 150px; }
.li .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; font-size: 14px; }
.notice { border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-soft); padding: 12px 16px; border-radius: 14px; font-size: 14px; color: var(--ink-2); }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.panel h2 { font-size: 15px; margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }

/* ---------- today panel ---------- */
.today { border-left: 1px solid var(--line); background: var(--side); overflow: auto; padding: 22px 18px 30px; display: grid; gap: 22px; align-content: start; }
.today-head { display: flex; justify-content: space-between; align-items: center; }
.today h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.today .date { font-family: var(--serif); font-size: 22px; }
.ring-row { display: flex; align-items: center; gap: 16px; }
.ring { width: 76px; height: 76px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-wrap { position: relative; }
.ring-wrap b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; font-weight: 700; }
.legend { display: grid; gap: 4px; font-size: 13.5px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.tl .it { display: grid; grid-template-columns: 4.4em 1fr auto; gap: 8px; padding: 6px 0; font-size: 13.5px; align-items: center; }
.tl .tm { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.tl .who { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tl .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl .it.done .who span { color: var(--muted); }
.ev { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; padding: 4px 0; }
.ev .d { font-weight: 650; min-width: 50px; color: var(--accent); font-size: 12.5px; }
.attn { background: var(--bad-soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; display: grid; gap: 6px; }
.attn button { color: var(--bad); font-weight: 650; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--soft); padding: 8px; font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.cal .day { background: var(--panel); min-height: 108px; padding: 6px; cursor: pointer; min-width: 0; }
.cal .day:hover { background: color-mix(in srgb, var(--panel) 94%, var(--accent)); }
.cal .day.out { background: var(--soft); }
.cal .day.out .num { opacity: .45; }
.cal .day.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.cal .day.drop { background: var(--accent-soft); }
.cal .num { font-size: 12.5px; font-weight: 650; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal .day.today .num { background: var(--accent); color: #fff; }
.chip { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 6px; margin-top: 3px; background: var(--soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-left: 3px solid var(--c, var(--accent)); }
.chip.ev { background: var(--warn-soft); border-left-color: var(--warn); }
.chip.st-failed { background: var(--bad-soft); }
.chip.st-posted { opacity: .6; }
.chip.st-draft { border-left-style: dashed; }
.chip[draggable=true] { cursor: grab; }
.more { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---------- toast & modal ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; opacity: 0; transition: .2s; pointer-events: none; z-index: 60; max-width: 90vw; font-size: 14px; font-weight: 500; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad); color: #fff; }
.modal { position: fixed; inset: 0; background: rgba(20,18,15,.45); display: grid; place-items: center; padding: 16px; z-index: 50; backdrop-filter: blur(2px); }
.modal-card { background: var(--panel); border-radius: 20px; padding: 22px; width: min(520px, 100%); max-height: 90vh; overflow: auto; display: grid; gap: 14px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); }
.modal-card h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 9px 6px; border-top: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 600; border-top: 0; }
.scrim { display: none; }
.only-m { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .app { grid-template-columns: 248px minmax(0, 1fr); }
  .today { position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 88vw); z-index: 45; transform: translateX(105%); transition: transform .25s; box-shadow: -20px 0 60px -20px rgba(0,0,0,.3); }
  .today.open { transform: none; }
  .scrim.on { display: block; position: fixed; inset: 0; background: rgba(20,18,15,.35); z-index: 44; }
  .today-pill { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 99px; padding: 6px 13px 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
  .topbar { display: flex; position: absolute; right: 14px; top: 12px; z-index: 5; }
  .topbar #openSide, .topbar .top-title { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .only-m { display: grid !important; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 45; transform: translateX(-105%); transition: transform .25s; box-shadow: 20px 0 60px -20px rgba(0,0,0,.3); }
  .side.open { transform: none; }
  .topbar { position: static; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .topbar #openSide { display: grid; }
  .topbar .top-title { display: block; font-family: var(--serif); font-size: 18px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .today-pill { box-shadow: none; }
  .hello { padding-top: 4vh; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sugs { grid-template-columns: 1fr; }
  .sug:nth-child(n+4) { display: none; }
  .page { padding: 20px 14px 60px; }
  .page-head h1 { font-size: 26px; }
  .grid2 { grid-template-columns: 1fr; }
  .cal .day { min-height: 58px; padding: 3px; }
  .cal .chip { font-size: 0; padding: 0; height: 5px; border-left: 0; background: var(--c, var(--accent)); margin-top: 2px; }
  .cal .chip.ev { background: var(--warn); }
  .cal .more { font-size: 9.5px; }
  .hide-m { display: none !important; }
  .msg-user { max-width: 90%; }
  .msg-ai { grid-template-columns: 1fr; }
  .msg-ai > .mark { display: none; }
  .thread { padding-top: 18px; }
}

/* ---------- accessibility ---------- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
.composer textarea:focus-visible { outline: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 80; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }
.main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .btn, .pill, .check, .step-n { border: 1px solid CanvasText; } }

/* ---------- ask buttons, banners ---------- */
.btn.ask { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.btn.ask svg { width: 15px; height: 15px; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; padding: 0 6px; }
.setup-banner { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 12px 16px; margin-bottom: 20px; box-shadow: var(--shadow); }
.setup-banner b { display: block; }
.setup-banner:hover { border-color: var(--accent); }
.sb-ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ok) calc(var(--p) * 360deg), var(--line) 0); }
.sb-ring b { width: 36px; height: 36px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 12.5px; }
.sb-go { color: var(--accent-2); font-weight: 650; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- setup steps ---------- */
.page.narrow { max-width: 820px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.step.done { background: color-mix(in srgb, var(--panel) 85%, var(--ok-soft)); }
.step-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; background: var(--soft); border: 2px solid var(--line-2); }
.step.done .step-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step h2 { font-size: 1.08rem; margin: 0; }
.step p { margin: 6px 0 10px; }
.step .now { font-weight: 600; color: var(--ink-2); margin-top: -4px; }
.how { margin-bottom: 12px; background: var(--soft); border-radius: 12px; padding: 10px 14px; }
.how summary, details summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.how ol { margin: 8px 0 4px; padding-left: 20px; display: grid; gap: 6px; }
.token-row { display: flex; gap: 8px; flex-wrap: wrap; }
.token-row input { flex: 1; min-width: 220px; }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; min-height: 44px; }
.switch input { width: 22px; height: 22px; min-height: 0; }
.opt { background: var(--soft); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.opt p { margin: 0; }

/* ---------- account selection ---------- */
.tick { display: grid; place-items: center; width: 32px; height: 40px; cursor: pointer; flex: none; }
.tick input { width: 20px; height: 20px; min-height: 0; margin: 0; }
.list .li.picked { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; }
.bulk { position: sticky; bottom: 12px; margin-top: 16px; display: none; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--ink); color: var(--bg); padding: 10px 12px; border-radius: 16px; box-shadow: 0 16px 40px -14px rgba(0,0,0,.45); z-index: 6; }
.bulk.on { display: flex; }
.bulk select, .bulk input { width: auto; flex: 1; min-width: 140px; background: var(--panel); }
.bulk .btn:not(.accent) { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }

/* ---------- phone tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 6px 0; min-height: 52px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; border-radius: 12px; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--accent-2); }
  .center { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .composer-wrap { padding-bottom: 10px; }
  .bulk { bottom: 72px; }
  .toast { bottom: 84px; }
  .step { grid-template-columns: 1fr; }
  .step-n { width: 32px; height: 32px; }
}

/* ---------- YouTube + client chats ---------- */
svg.yt { width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: 4px; }
.clients-nav a { gap: 9px; }
.clients-nav small { color: var(--muted); font-size: 12px; }
.client-head { display: flex; gap: 14px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.client-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; }
.ch-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 10px; flex: none; }
.ch-accs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.client-hello { padding-top: 8px; }
.yt-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; margin-top: 6px; }
.yt-thumb { display: grid; gap: 6px; align-content: start; }
.yt-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.yt-title { font-weight: 650; line-height: 1.35; }
.opt-head { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; }
@media (max-width: 760px) { .yt-body { grid-template-columns: 1fr; } .yt-thumb img { max-width: 320px; } }

/* ---------- voice-over card ---------- */
.card-b.vo { display: grid; gap: 12px; padding: 14px 16px; }
.vo textarea { min-height: 110px; font-size: 15px; }
.vo-video { width: 100%; max-height: 420px; background: #000; border-radius: 12px; }
