@font-face { font-family: 'Host Grotesk'; src: url('/fonts/HostGrotesk-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Host Grotesk'; src: url('/fonts/HostGrotesk-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --navy: #002A38;
  --navy-2: #01445A;
  --cyan: #0195C6;
  --lime: #DCE24B;
  --bg: #F2F5F6;
  --card: #FFFFFF;
  --text: #0E2530;
  --muted: #5B6B73;
  --border: #DFE6E9;
  --radius: 12px;

  --planned: #7C8B93;  --planned-bg: #EDF1F3;
  --draft: #0179A1;    --draft-bg: #DDF1F9;
  --today: #6F7400;    --today-bg: #F3F6C2;  --today-line: #C9CF2F;
  --late: #C23434;     --late-bg: #FBE4E4;
  --posted: #1A8048;   --posted-bg: #DDF3E6;
  --warn: #B86B00;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Host Grotesk', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); }
h1, h2, h3, h4, h5 { line-height: 1.2; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 16px; }
.boot { padding: 40px; color: var(--muted); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 8px 14px;
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.success { background: var(--posted); color: #fff; }
.btn.success:hover { background: #146B3B; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--cyan); }
.btn.disabled { opacity: .4; pointer-events: none; }
.btn.danger-ghost { background: #fff; color: var(--late); border-color: #F0C4C4; }
.link-btn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 4px 6px; opacity: .85; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { opacity: 1; }
.icon-btn { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }

input, select, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
textarea { resize: vertical; line-height: 1.55; }
textarea.tall { min-height: 260px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
textarea.tall.xl { min-height: 480px; }
.select { width: auto; min-width: 140px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field > input, .field > select, .field > textarea { font-weight: 400; font-size: 15px; color: var(--text); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.actions { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.form-error { color: var(--late); margin: 0; min-height: 1em; font-size: 14px; }

/* ---------- auth ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 0%, #01506A 0%, var(--navy) 60%);
}
.auth-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 28px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.auth-card h1 { font-size: 24px; }
.auth-card p { margin: 0; }
.auth-logo { width: 130px; height: auto; background: var(--navy); border-radius: 10px; padding: 10px 14px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 60px;
  background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.brand img { height: 28px; width: auto; }
.brand span { opacity: .8; font-size: 14px; border-left: 1px solid rgba(255, 255, 255, .25); padding-left: 10px; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tab {
  display: flex; align-items: center; padding: 0 16px; color: rgba(255, 255, 255, .75); text-decoration: none; font-weight: 700;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--lime); }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.user-name { font-weight: 700; margin-right: 6px; }
.main { max-width: 1320px; margin: 0 auto; padding: 24px 24px 96px; } /* bottom room for the Assistant button */

.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  color: #fff; font-size: 12px; font-weight: 700; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .6);
}
.avatar.small { width: 22px; height: 22px; font-size: 10px; box-shadow: none; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0, 42, 56, .04); }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.box-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); }
.box-tools { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.box-body { padding: 18px; }
.box-foot { padding: 14px 18px; border-top: 1px solid var(--border); background: #FAFCFC; border-radius: 0 0 var(--radius) var(--radius); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-label { margin-left: 6px; font-size: 16px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #E3F0F5; color: var(--navy); font-size: 12px; font-weight: 700; }
.pill.outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }

/* status colours */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.s-planned { background: var(--planned-bg); color: var(--planned); }
.s-draft { background: var(--draft-bg); color: var(--draft); }
.s-today { background: var(--today-bg); color: var(--today); }
.s-late { background: var(--late-bg); color: var(--late); }
.s-posted { background: var(--posted-bg); color: var(--posted); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; }
.swatch.s-planned { background: var(--planned); }
.swatch.s-draft { background: var(--cyan); }
.swatch.s-today { background: var(--lime); box-shadow: inset 0 0 0 1px var(--today-line); }
.swatch.s-late { background: var(--late); }
.swatch.s-posted { background: var(--posted); }

/* ---------- post tab ---------- */
.post-head { margin-bottom: 16px; }
.post-head h1 { font-size: 26px; margin-bottom: 8px; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.meta strong { color: var(--text); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.box { display: flex; flex-direction: column; min-height: 520px; }
.box > .box-body { flex: 1; }
.prose { font-size: 15px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 4px; }
.prose h2 { font-size: 18px; margin: 18px 0 8px; color: var(--navy); }
.prose h3 { font-size: 15px; margin: 16px 0 6px; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; }
.prose h4 { font-size: 14px; margin: 14px 0 6px; color: var(--cyan); }
.prose h2:first-child, .prose h3:first-child, .prose h4:first-child { margin-top: 0; }
.prose strong { color: var(--navy); }
.prose table { border-collapse: collapse; width: 100%; margin-bottom: 12px; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }
.draft-body { display: flex; flex-direction: column; gap: 6px; }
.draft { flex: 1; min-height: 380px; border: 1px solid var(--border); font-size: 15px; padding: 12px 14px; }
.draft[readonly] { background: #F8FAFB; }
.draft-foot { display: flex; justify-content: flex-end; font-size: 12px; }
.counter.over { color: var(--late); font-weight: 700; }
.mark-form { display: flex; gap: 10px; }
.mark-form input { flex: 1; }
.posted-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--posted-bg); color: var(--posted); border-radius: 8px; padding: 10px 14px; }
.posted-box strong { color: var(--posted); }
.posted-actions { display: flex; align-items: center; gap: 8px; }
.late-tag, .ontime-tag { margin-left: 8px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.late-tag { background: #FFF1DB; color: var(--warn); }
.ontime-tag { background: #fff; color: var(--posted); }

.comments-card { margin-top: 20px; }
.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.comment { display: flex; gap: 10px; }
.comment-meta { display: flex; gap: 8px; font-size: 13px; align-items: baseline; }
.comment-body { white-space: pre-wrap; }
.comment-form { display: flex; gap: 10px; align-items: flex-end; }

/* ---------- schedule ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; padding: 7px 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--navy); color: #fff; }

.tt-wrap { overflow-x: auto; }
.tt { display: grid; grid-template-columns: 56px repeat(5, minmax(150px, 1fr)) repeat(2, minmax(90px, .55fr)); min-width: 980px; }
.tt-corner, .tt-day { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--border); }
.tt-day { padding: 10px; display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--muted); border-left: 1px solid var(--border); }
.tt-day strong { font-size: 18px; color: var(--text); }
.tt-day.today strong { background: var(--lime); color: var(--navy); border-radius: 6px; padding: 0 6px; }
.tt-hour { font-size: 11px; color: var(--muted); padding: 4px 8px 0 0; text-align: right; border-bottom: 1px solid #EEF2F4; }
.tt-cell { min-height: 44px; padding: 4px; border-left: 1px solid var(--border); border-bottom: 1px solid #EEF2F4; display: flex; flex-direction: column; gap: 4px; }
.tt-cell.today, .month-cell.today { background: #FBFCEB; }
.weekend { background: #FAFBFC; }

.chip {
  display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 8px; text-decoration: none;
  border: 1px solid transparent; font-size: 12px; line-height: 1.3; cursor: pointer; transition: transform .1s, box-shadow .1s;
}
.chip:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 42, 56, .12); }
.chip.s-planned { border-color: #D6DEE2; }
.chip.s-draft { border-color: #A9DCEF; }
.chip.s-today { border-color: var(--today-line); }
.chip.s-late { border-color: #F0B4B4; }
.chip.s-posted { border-color: #A8DDBF; }
.chip.posted-late { box-shadow: inset 4px 0 0 #F2A93B; }
.chip-top { display: flex; align-items: center; gap: 5px; }
.chip-time { font-weight: 700; }
.chip-who { font-weight: 700; color: var(--text); }
.chip-msg {
  margin-left: auto; min-width: 18px; height: 16px; padding: 0 5px; border-radius: 8px 8px 8px 2px;
  background: var(--navy); color: #fff; font-size: 10px; font-weight: 700; display: inline-grid; place-items: center;
}
.chip-title { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip.compact { padding: 3px 6px; }
.chip.compact .chip-title { -webkit-line-clamp: 1; }

.month-wrap { overflow-x: auto; }
.month { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)) repeat(2, minmax(80px, .6fr)); min-width: 860px; }
.month-head { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.month-cell { min-height: 110px; padding: 6px; border-right: 1px solid #EEF2F4; border-bottom: 1px solid #EEF2F4; display: flex; flex-direction: column; gap: 4px; }
.month-cell.other { opacity: .45; }
.month-date { font-size: 12px; font-weight: 700; color: var(--muted); }
.month-cell.today .month-date { color: var(--navy); background: var(--lime); border-radius: 4px; padding: 0 5px; align-self: flex-start; }

.agenda { padding: 4px 0; }
.agenda-day { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-bottom: 1px solid #EEF2F4; }
.agenda-day:last-child { border-bottom: 0; }
.agenda-day.today { background: #FBFCEB; }
.agenda-date { font-weight: 700; font-size: 14px; }
.agenda-day.today .agenda-date::after { content: 'Today'; margin-left: 8px; background: var(--lime); color: var(--navy); font-size: 11px; padding: 1px 6px; border-radius: 4px; }

.scoreboard { margin-top: 20px; }
.scoreboard table.board { min-width: 680px; }
table.board { width: 100%; border-collapse: collapse; font-size: 14px; }
table.board th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); }
table.board td { padding: 10px 14px; border-bottom: 1px solid #EEF2F4; vertical-align: middle; }
table.board tr:last-child td { border-bottom: 0; }
.who { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.num { font-weight: 700; color: var(--muted); }
.num.ok { color: var(--posted); }
.num.warn { color: var(--warn); }
.num.bad { color: #fff; background: var(--late); border-radius: 999px; padding: 1px 9px; }
.next-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.next-link:hover { color: var(--cyan); }

/* ---------- plan ---------- */
.plan-title { display: flex; align-items: center; gap: 14px; }
.plan-title .avatar { width: 46px; height: 46px; font-size: 16px; box-shadow: none; }
.plan-title h1 { font-size: 24px; }
.plan-title p { margin: 2px 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; }
.stat strong { font-size: 32px; line-height: 1.1; color: var(--navy); }
.stat span { color: var(--muted); font-size: 13px; }
.stat.ok strong { color: var(--posted); }
.stat.warn strong { color: var(--warn); }
.stat.bad { background: var(--late-bg); border-color: #F0C4C4; }
.stat.bad strong { color: var(--late); }
.plan-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; align-items: start; }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 20, 28, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; padding: 0 22px 22px; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 12px; position: sticky; top: 0; background: #fff; }
.modal-head h2 { font-size: 18px; }
.modal h3 { font-size: 15px; margin-top: 8px; }
.secret { display: block; font-size: 20px; padding: 14px; background: var(--bg); border-radius: 8px; text-align: center; letter-spacing: .03em; user-select: all; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 14px;
  transition: opacity .2s, transform .2s; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--posted); }
.toast.error { background: var(--late); }

.empty { text-align: center; padding: 60px 16px; }
.empty p { color: var(--muted); }

/* ---------- AI ---------- */
.btn.ai { background: linear-gradient(135deg, var(--navy) 0%, #01506A 100%); color: #fff; }
.btn.ai:hover { background: var(--navy-2); }
.btn.ai::first-letter { color: var(--lime); }
.ai-panel { padding: 16px 18px; border-bottom: 1px solid var(--border); background: #F6FAFB; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.settings-grid .span-all { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.check input { width: auto; }
.ai-pill { background: #EDE9FB; color: #5B3FC4; }
.card-hint { margin: 0; padding: 10px 18px 0; }
.page-title { font-size: 24px; }

.stats-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.stats-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.stats-inputs { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.stat-input { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); width: 110px; }
.stat-input input { padding: 6px 8px; }

/* ---------- brief ---------- */
.brief-status { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.brief-status.running { color: var(--draft); font-weight: 700; }
.stories { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.story { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.story h3 { font-size: 18px; line-height: 1.35; }
.story .meta { margin: 0; color: var(--muted); font-size: 13px; }
.story-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rank { font-weight: 700; color: var(--muted); font-size: 13px; }
.score { background: var(--navy); color: var(--lime); font-weight: 700; border-radius: 8px; padding: 2px 9px; font-size: 14px; }
.score.small { font-size: 12px; padding: 1px 7px; }
.fit { display: flex; align-items: flex-start; gap: 8px; background: #F3F8FA; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.story-more summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--navy); padding: 2px 0; }
.story-more .prose { margin-top: 6px; font-size: 14px; }
.draft-preview { white-space: pre-wrap; font-size: 14px; background: #FAFCFC; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-top: 6px; }
.story-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.story-add { border-top: 1px solid var(--border); padding-top: 12px; }
.clickable { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.story.clickable:hover { border-color: #B9D9E6; box-shadow: 0 6px 20px rgba(0, 42, 56, .08); }
.archive-row.clickable:hover { background: #F6FAFB; }
.story-link { color: inherit; text-decoration: none; }
.story-link:hover { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.story-snippet { margin: 0; color: var(--text); font-size: 14px; }

.story-detail-head h1 { margin: 10px 0 8px; line-height: 1.3; }
.source-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #F3F8FA; border: 1px solid #DCEBF1; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.source-card strong { display: block; color: var(--navy); }
.source-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.story-view .prose h3 { font-size: 13px; margin: 18px 0 6px; }
.story-view .prose .fit { margin-top: 16px; }
.story-draft { margin-top: 0; font-size: 15px; line-height: 1.6; max-height: 560px; overflow-y: auto; background: #fff; }
.scheduled-list { display: flex; flex-direction: column; gap: 6px; }
.archive { margin-top: 12px; }
.archive-row { display: grid; grid-template-columns: 34px 46px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #EEF2F4; font-size: 14px; }
.archive-row:last-child { border-bottom: 0; }

/* ---------- stats ---------- */
.stats-view { display: flex; flex-direction: column; gap: 20px; }
.stats-view .toolbar { margin-bottom: 0; }
.stats-table tr.selected td { background: #F6F9DD; }
.li-link {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: #0A66C2; color: #fff;
  font-size: 11px; font-weight: 700; text-decoration: none; flex: none;
}
.li-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; max-width: 640px; }
.num.bad-text { color: var(--late); }
.followers-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; }
.inline-form input { width: auto; }
.inline-form input[type=number] { width: 150px; }
.ext { text-decoration: none; }

/* ---------- assistant ---------- */
.assistant-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px;
  background: var(--navy); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 700;
  cursor: pointer; box-shadow: 0 10px 30px rgba(0, 42, 56, .35);
}
.assistant-fab:hover { background: var(--navy-2); }
.assistant-fab .star { color: var(--lime); font-size: 18px; }
.as-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 45; width: 420px; max-width: calc(100vw - 32px);
  height: min(720px, calc(100vh - 92px)); background: #fff; border-radius: 16px; border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 20, 28, .3); display: flex; flex-direction: column; overflow: hidden;
}
.as-panel[hidden], .assistant-root[hidden], .assistant-fab[hidden] { display: none; }
.as-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--navy); color: #fff; }
.as-head strong { white-space: nowrap; }
.as-head .icon-btn { color: #fff; }
.as-chats { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; }
.as-ctx { padding: 6px 14px; border-bottom: 1px solid var(--border); background: #F6FAFB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.as-msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.as-msg.user { align-self: flex-end; background: var(--navy); color: #fff; white-space: pre-wrap; border-bottom-right-radius: 4px; }
.as-msg.bot { align-self: flex-start; background: #F1F5F7; border-bottom-left-radius: 4px; }
.as-msg.bot p:last-child { margin-bottom: 0; }
.as-msg.error { align-self: flex-start; background: var(--late-bg); color: var(--late); }
.as-action { align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--posted); background: var(--posted-bg); border-radius: 8px; padding: 6px 10px; text-decoration: none; }
a.as-action:hover { text-decoration: underline; }
.as-typing { align-self: flex-start; }
.as-empty p { margin: 0 0 10px; font-size: 14px; }
.as-suggest { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pill-btn { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.pill-btn:hover { border-color: var(--cyan); }
.as-settings { border-top: 1px solid var(--border); padding: 8px 14px; font-size: 13px; }
.as-settings summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.as-settings .settings-grid { grid-template-columns: 1fr 1fr; margin-top: 8px; }
.as-composer { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--border); align-items: flex-end; }
.as-composer textarea { resize: none; max-height: 140px; }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .two-col, .plan-grid { grid-template-columns: 1fr; }
  .box { min-height: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 8px 14px; }
  .tabs { order: 3; width: 100%; height: 40px; overflow-x: auto; scrollbar-width: none; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .as-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100%; border-radius: 0; }
  .assistant-fab { right: 14px; bottom: 14px; padding: 0; width: 52px; height: 52px; justify-content: center; }
  .assistant-fab span:not(.star) { display: none; }
  .box-head { flex-wrap: wrap; }
  .save-state { white-space: nowrap; font-size: 12px; }
  .inline-form { margin-left: 0; }
  .archive-row { grid-template-columns: 30px 40px 1fr; }
  .archive-row > :last-child { grid-column: 3; }
  .tab { padding: 0 12px; }
  .brand span { display: none; }
  .user-name { display: none; }
  .main { padding: 16px 16px 88px; }
  .row3 { grid-template-columns: 1fr; }
  .mark-form, .comment-form { flex-direction: column; align-items: stretch; }
  .post-head h1 { font-size: 21px; }
}
