:root {
  color-scheme: light;
  --canvas: #f3f4ee;
  --surface: #fcfcf8;
  --ink: #18211d;
  --muted: #58665e;
  --line: #d7ded7;
  --accent: #176b53;
  --accent-hover: #10563f;
  --accent-soft: #e0eee5;
  --attention: #8b5423;
  --attention-soft: #f5e8d6;
  --danger: #a33e35;
  --danger-soft: #f8e5e1;
  --sidebar: #182823;
  --sidebar-ink: #edf5ef;
  --sidebar-muted: #b0c1b6;
  --sidebar-line: #34483d;
  --focus: #267d61;
  --radius: 10px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #151b19;
  --surface: #1d2522;
  --ink: #eff3ee;
  --muted: #b3c0b7;
  --line: #38443d;
  --accent: #83d2ae;
  --accent-hover: #a2e4c4;
  --accent-soft: #263d33;
  --attention: #ffc879;
  --attention-soft: #463522;
  --danger: #ff9187;
  --danger-soft: #452825;
  --sidebar: #101614;
  --sidebar-ink: #eff3ee;
  --sidebar-muted: #aebbb3;
  --sidebar-line: #2c3932;
  --focus: #9ce5bf;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  transition: background-color 180ms ease-out, color 180ms ease-out;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { color: #fff; background: #176b53; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid var(--canvas); border-radius: 8px; }
[hidden] { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 500px) minmax(0, 1fr);
  grid-template-rows: 100px 1fr 80px;
  align-items: center;
  padding: 0 clamp(22px, 5vw, 72px);
  background: var(--canvas);
}

.login-mark, .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--sidebar-ink); text-decoration: none; font-weight: 750; letter-spacing: -.035em; }
.login-mark { grid-column: 1 / 2; grid-row: 1; color: var(--accent); font-size: 22px; }
.login-mark svg { width: 36px; height: 36px; }
.brand-period { color: #86c9a7; }
.login-panel { grid-column: 2; grid-row: 2; width: 100%; padding: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.login-context { margin: 0 0 10px; color: var(--accent); font-weight: 700; }
.login-panel h1 { margin: 0 0 10px; font-size: clamp(28px, 3vw, 36px); line-height: 1.14; letter-spacing: -.04em; }
.login-copy { max-width: 37ch; margin: 0 0 30px; color: var(--muted); }
.login-panel form { display: grid; gap: 9px; }
.login-panel label, .editor-form label { margin-top: 12px; font-weight: 650; }
.login-panel input, .field { min-width: 0; width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.login-panel input:hover, .field:hover { border-color: var(--muted); }
.login-submit { margin-top: 12px; justify-content: space-between; }
.login-footnote { margin: 22px 0 0; color: var(--muted); font-size: 12px; }
.login-side-note { grid-column: 3; grid-row: 3; justify-self: end; color: var(--muted); font-size: 12px; }
.rule-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; background: var(--accent); border-radius: 50%; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; display: flex; width: 248px; flex-direction: column; padding: 25px 18px 18px; color: var(--sidebar-ink); background: var(--sidebar); }
.brand { margin: 0 0 44px 4px; font-size: 22px; }
.brand svg { width: 35px; height: 35px; color: #91d4ad; }
.nav-label { margin: 0 0 10px 10px; color: var(--sidebar-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.primary-nav { display: grid; gap: 5px; }
.nav-item { display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 0 11px; color: var(--sidebar-muted); background: transparent; border: 0; border-radius: 8px; text-align: left; cursor: pointer; }
.nav-item svg, .text-button svg, .button svg, .icon-button svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:first-child svg { stroke: none; fill: currentColor; }
.nav-item:hover { color: var(--sidebar-ink); background: #26372f; }
.nav-item.is-active { color: #f6fbf5; background: #2b4337; font-weight: 650; }
.nav-item[aria-disabled="true"] { cursor: default; }
.nav-item-muted { opacity: .7; }
.nav-soon { margin-left: auto; color: var(--sidebar-muted); font-size: 10px; }
.sidebar-spacer { flex: 1; }
.sidebar-account { display: flex; align-items: center; gap: 10px; padding: 15px 2px; border-top: 1px solid var(--sidebar-line); }
.account-avatar, .preview-avatar { display: grid; width: 34px; height: 34px; flex: none; place-items: center; color: #133c2b; background: #aad9bb; border-radius: 50%; font-size: 13px; font-weight: 800; }
.account-copy { min-width: 0; display: grid; gap: 2px; }
.account-copy strong { overflow: hidden; color: var(--sidebar-ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy span { color: var(--sidebar-muted); font-size: 11px; }
.connection-dot { display: inline-block; width: 8px; height: 8px; flex: none; background: #a66b45; border: 1px solid currentColor; border-radius: 50%; }
.sidebar-account .connection-dot { margin-left: auto; }
.sidebar-bottom { display: grid; gap: 3px; padding-top: 11px; border-top: 1px solid var(--sidebar-line); }
.text-button { display: inline-flex; min-height: 38px; align-items: center; gap: 11px; padding: 0 8px; color: var(--sidebar-muted); background: transparent; border: 0; border-radius: 7px; cursor: pointer; text-align: left; }
.text-button:hover { color: var(--sidebar-ink); background: #26372f; }

.app-main { min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; z-index: 4; top: 0; display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(24px, 4vw, 58px); background: color-mix(in srgb, var(--canvas) 95%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.breadcrumb-slash { color: var(--line); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.connection-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.connection-label .connection-dot { background: #d29a5b; }
.content-area { width: min(100%, 1440px); margin: 0 auto; padding: 38px clamp(24px, 4vw, 58px) 72px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.page-heading h1 { margin: 0 0 6px; font-size: clamp(27px, 2.8vw, 36px); line-height: 1.15; letter-spacing: -.04em; }
.page-heading p { max-width: 65ch; margin: 0; color: var(--muted); }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.select-label { color: var(--muted); font-size: 12px; }
.field-select { width: auto; min-width: 115px; min-height: 40px; padding: 8px 30px 8px 10px; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 9px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 650; white-space: nowrap; cursor: pointer; transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out; }
.button-primary { color: #f9fcf8; background: #176b53; }
.button-primary:hover { background: #10563f; }
:root[data-theme="dark"] .button-primary { color: #10231b; background: #83d2ae; }
:root[data-theme="dark"] .button-primary:hover { background: #a2e4c4; }
.button-outline { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-outline:hover { border-color: var(--muted); }
.button:disabled { color: var(--muted); background: var(--line); border-color: var(--line); cursor: not-allowed; opacity: .8; }
.button-quiet { color: var(--muted); background: transparent; border-color: var(--line); }
.button-quiet:hover { color: var(--ink); background: var(--surface); }
.icon-button { display: grid; width: 38px; height: 38px; flex: none; place-items: center; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: var(--surface); border-color: var(--line); }

.notice { display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; }
.notice-demo { color: var(--attention); background: var(--attention-soft); border-color: color-mix(in srgb, var(--attention) 25%, var(--line)); }
.notice-mark { display: grid; width: 28px; height: 28px; flex: none; place-items: center; }
.notice-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notice strong { color: var(--ink); font-size: 13px; }
.notice p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.demo-chip { margin-left: auto; padding: 3px 7px; color: var(--attention); border: 1px solid currentColor; border-radius: 4px; font-size: 10px; font-weight: 750; letter-spacing: .08em; }

.metrics-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { min-width: 0; padding: 18px 20px 17px 0; }
.metric:not(:nth-child(3n + 1)) { padding-left: 20px; border-left: 1px solid var(--line); }
.metric:nth-child(n + 4) { border-top: 1px solid var(--line); }
.metric-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.metric-value { display: block; margin-top: 8px; color: var(--ink); font-size: clamp(25px, 3vw, 35px); font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.metric-source { display: grid; gap: 2px; margin-top: 9px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.metric-source strong { color: var(--attention); font-weight: 700; }
.data-note { display: flex; align-items: center; gap: 10px; margin: 12px 0 34px; color: var(--muted); font-size: 11px; }
.note-line { width: 18px; height: 1px; background: var(--accent); }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); gap: 42px; }
.section-block { min-width: 0; padding-top: 18px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2, .preview-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.inline-link { padding: 4px 0; color: var(--accent); background: transparent; border: 0; font-size: 12px; font-weight: 650; cursor: pointer; }
.inline-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.upcoming-list { min-height: 116px; }
.empty-state { display: flex; min-height: 118px; align-items: center; justify-content: center; flex-direction: column; gap: 6px; padding: 18px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 9px; text-align: center; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state p { max-width: 42ch; margin: 0; font-size: 12px; }
.empty-state button { margin-top: 4px; }
.upcoming-item, .queue-item, .saved-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.upcoming-date { display: grid; width: 48px; flex: none; gap: 1px; color: var(--accent); font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; }
.upcoming-date strong { color: var(--ink); font-size: 20px; line-height: 1; }
.upcoming-copy { min-width: 0; flex: 1; }
.upcoming-copy strong, .saved-copy strong, .queue-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-copy span, .saved-copy span, .queue-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.account-readiness { padding-left: 26px; border-left: 1px solid var(--line); border-top: 0; }
.account-readiness > p { max-width: 45ch; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.status-tag { display: inline-flex; align-items: center; padding: 4px 8px; color: var(--muted); background: var(--line); border-radius: 5px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-muted { color: var(--muted); background: color-mix(in srgb, var(--line) 65%, transparent); }
.status-idea { color: #53665d; background: #e6ece6; }
.status-draft { color: #425e85; background: #e0e8f2; }
.status-review { color: #7b5726; background: #f4ead8; }
.status-ready { color: #24644d; background: #dceee3; }
.status-scheduled { color: #315f71; background: #dcecf0; }
.status-published { color: #386a43; background: #e0efdd; }
.status-error { color: #943f37; background: #f7e2df; }
:root[data-theme="dark"] .status-idea { color: #c2d0c6; background: #2d3932; }
:root[data-theme="dark"] .status-draft { color: #bfd5ff; background: #28374e; }
:root[data-theme="dark"] .status-review { color: #f5d39b; background: #493a26; }
:root[data-theme="dark"] .status-ready, :root[data-theme="dark"] .status-published { color: #a8e4b2; background: #293e2c; }
:root[data-theme="dark"] .status-scheduled { color: #b9dce6; background: #273c43; }
:root[data-theme="dark"] .status-error { color: #ffb1a7; background: #482c29; }
.setup-list { display: grid; gap: 9px; margin: 14px 0; padding: 0; list-style: none; color: var(--ink); font-size: 12px; }
.setup-list li { display: flex; align-items: center; gap: 9px; }
.setup-number { display: grid; width: 21px; height: 21px; flex: none; place-items: center; color: var(--accent); border: 1px solid var(--line); border-radius: 50%; font-size: 10px; }
.small-note, .preview-note { color: var(--muted); font-size: 10px; line-height: 1.5; }
.post-queue-block { margin-top: 38px; }
.draft-queue { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; }
.queue-item { min-width: 0; }
.queue-index { display: grid; width: 31px; height: 31px; flex: none; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 50%; font-size: 11px; font-weight: 700; }
.queue-copy { min-width: 0; flex: 1; }
.queue-open { padding: 6px; color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.queue-open:hover { color: var(--accent); }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 18px; }
.calendar-mode { display: inline-flex; gap: 3px; padding: 3px; background: color-mix(in srgb, var(--line) 55%, transparent); border-radius: 8px; }
.calendar-mode button { min-width: 56px; padding: 7px 11px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; font-size: 12px; cursor: pointer; }
.calendar-mode button.is-selected { color: var(--ink); background: var(--surface); }
.calendar-date-nav { display: flex; align-items: center; gap: 5px; }
.calendar-date-nav strong { min-width: 150px; margin-left: 7px; font-size: 14px; text-align: right; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-day-heading { min-height: 36px; padding: 10px 9px; color: var(--muted); background: color-mix(in srgb, var(--line) 24%, var(--canvas)); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.calendar-day { min-height: 120px; padding: 6px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color 130ms ease-out; }
.calendar-day.is-outside { color: var(--muted); background: color-mix(in srgb, var(--canvas) 65%, var(--surface)); }
.calendar-day.is-today { box-shadow: inset 0 2px 0 var(--accent); }
.calendar-day.is-drop-target { background: var(--accent-soft); }
.day-number { display: flex; width: 27px; height: 27px; align-items: center; justify-content: center; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 11px; cursor: pointer; }
.calendar-day.is-today .day-number { color: #fff; background: var(--accent); }
:root[data-theme="dark"] .calendar-day.is-today .day-number { color: #14241c; }
.day-number:hover { color: var(--accent); background: var(--accent-soft); }
.calendar-item { display: flex; align-items: flex-start; gap: 5px; margin: 4px 0; padding: 5px 6px; color: var(--ink); background: var(--accent-soft); border-radius: 5px; font-size: 10px; line-height: 1.25; cursor: pointer; }
.calendar-item:hover { outline: 1px solid var(--accent); }
.calendar-item[draggable="true"] { cursor: grab; }
.calendar-item-title { overflow: hidden; flex: 1; text-overflow: ellipsis; }
.calendar-item-time { color: var(--muted); white-space: nowrap; }
.calendar-add { display: block; margin: 3px 0 0 2px; padding: 2px 3px; color: var(--muted); background: transparent; border: 0; font-size: 10px; cursor: pointer; opacity: 0; }
.calendar-day:hover .calendar-add, .calendar-add:focus-visible { opacity: 1; }
.calendar-week .calendar-day-heading { min-height: 45px; }
.calendar-week .calendar-day-heading span { display: block; margin-top: 2px; color: var(--ink); font-size: 12px; letter-spacing: 0; }
.calendar-week .calendar-day { min-height: 280px; }
.calendar-week .calendar-item { padding: 8px; font-size: 11px; }
.calendar-week .calendar-item-title { white-space: normal; }
.calendar-day-view { grid-template-columns: 1fr; }
.calendar-day-view .calendar-day-heading { display: none; }
.calendar-day-view .calendar-day { min-height: 360px; padding: 14px; }
.calendar-day-view .calendar-item { max-width: 520px; padding: 11px; font-size: 12px; }
.calendar-day-view .calendar-add { opacity: 1; }
.calendar-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.calendar-legend > span:not(.calendar-drag-hint) { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.legend-scheduled { background: var(--accent); }
.legend-draft { background: #a17a45; }
.calendar-drag-hint { margin-left: auto; }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .75fr); gap: clamp(28px, 5vw, 66px); align-items: start; }
.editor-form { display: grid; gap: 8px; }
.editor-form label { display: block; margin: 10px 0 1px; }
.field-hint { margin-left: 6px; color: var(--muted); font-size: 10px; font-weight: 400; }
.field-textarea { min-height: 160px; resize: vertical; line-height: 1.55; }
.editor-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.editor-row > div { min-width: 0; }
.editor-row .field { margin-top: 2px; }
.schedule-time-row { align-items: end; }
.field-help { padding: 0 0 12px; color: var(--muted); font-size: 11px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.form-error { margin: 2px 0; color: var(--danger); font-size: 12px; }
.preview-panel { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.preview-heading h2 { font-size: 15px; }
.preview-heading > span { color: var(--muted); font-size: 10px; }
.preview-post { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.preview-account { display: flex; align-items: center; gap: 9px; padding: 10px; }
.preview-account > div:nth-child(2) { min-width: 0; display: grid; }
.preview-account strong { font-size: 11px; }
.preview-account span { color: var(--muted); font-size: 9px; }
.preview-account > svg { width: 18px; height: 18px; margin-left: auto; fill: currentColor; }
.preview-avatar { width: 29px; height: 29px; font-size: 11px; }
.preview-image { display: grid; min-height: 190px; place-items: center; align-content: center; gap: 2px; color: #55705d; background: #e3e9df; }
.preview-image svg { width: 100px; height: 75px; fill: #8fae91; stroke: #55705d; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.preview-image span { font-size: 10px; }
.preview-caption { min-height: 78px; padding: 11px 12px; }
.preview-caption strong { font-size: 11px; }
.preview-caption p { display: -webkit-box; overflow: hidden; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.preview-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.preview-note { margin: 11px 0 0; }
.saved-posts-section { margin-top: 38px; }
.count-label { color: var(--muted); font-size: 11px; }
.saved-item { gap: 12px; }
.saved-copy { min-width: 0; flex: 1; }
.saved-actions { display: flex; align-items: center; gap: 7px; }
.saved-actions button { padding: 6px 8px; color: var(--accent); background: transparent; border: 0; border-radius: 5px; font-size: 11px; cursor: pointer; }
.saved-actions button:hover { background: var(--accent-soft); }
.history-panel { max-width: 720px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.history-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.history-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.history-list time { margin-left: auto; white-space: nowrap; }
.history-marker { width: 7px; height: 7px; flex: none; background: var(--accent); border-radius: 50%; }
.unavailable-view { max-width: 800px; }

.toast { position: fixed; z-index: 20; right: 24px; bottom: 22px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 16px; color: #f9fcf8; background: #213a2e; border-radius: 8px; font-size: 12px; }
.toast.is-error { background: #743d36; }
.mobile-topbar, .mobile-nav { display: none; }

@media (max-width: 1100px) {
  .content-area { padding-right: 28px; padding-left: 28px; }
  .topbar { padding-right: 28px; padding-left: 28px; }
  .overview-columns { grid-template-columns: minmax(0, 1fr) minmax(250px, .85fr); gap: 26px; }
  .account-readiness { padding-left: 20px; }
  .calendar-day { min-height: 98px; }
}

@media (max-width: 820px) {
  .sidebar { display: none; }
  .app-main { margin-left: 0; }
  .mobile-topbar { position: sticky; z-index: 6; top: 0; display: flex; height: 58px; align-items: center; justify-content: space-between; padding: 0 18px; background: var(--sidebar); }
  .mobile-topbar .brand { margin: 0; font-size: 19px; }
  .mobile-topbar .brand svg { width: 31px; height: 31px; }
  .mobile-topbar .icon-button { color: var(--sidebar-ink); }
  .topbar { top: 58px; min-height: 52px; padding: 0 18px; }
  .connection-label { font-size: 0; }
  .connection-label .connection-dot { width: 9px; height: 9px; }
  .topbar-right { gap: 8px; }
  .topbar-right .button { min-height: 34px; padding: 0 10px; font-size: 11px; }
  .content-area { padding: 27px 18px 100px; }
  .mobile-nav { position: fixed; z-index: 10; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); min-height: 66px; padding: 6px 10px max(6px, env(safe-area-inset-bottom)); background: var(--sidebar); border-top: 1px solid var(--sidebar-line); }
  .mobile-nav .nav-item { min-height: 52px; justify-content: center; flex-direction: column; gap: 2px; padding: 5px; border-radius: 7px; font-size: 10px; }
  .mobile-nav .nav-item svg { width: 18px; height: 18px; }
  .mobile-nav .nav-item.is-active { color: #f6fbf5; background: #2b4337; }
  .overview-columns { grid-template-columns: 1fr; gap: 24px; }
  .account-readiness { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .calendar-day { min-height: 82px; padding: 3px; }
  .calendar-item { padding: 4px; }
  .calendar-add { width: 100%; height: 16px; padding: 0; opacity: 1; font-size: 0; line-height: 16px; text-align: center; }
  .calendar-add::before { color: var(--accent); content: "+"; font-size: 12px; font-weight: 700; }
  .calendar-week .calendar-day { min-height: 190px; }
  .calendar-week .calendar-item { padding: 5px; }
  .editor-grid { grid-template-columns: 1fr; gap: 24px; }
  .preview-panel { max-width: 530px; }
}

@media (max-width: 580px) {
  .login-screen { display: flex; min-height: 100svh; align-items: stretch; justify-content: center; flex-direction: column; gap: 28px; padding: 28px 18px; }
  .login-mark { font-size: 20px; }
  .login-panel { padding: 26px 20px; }
  .login-side-note { align-self: flex-end; margin-top: auto; }
  .breadcrumb { font-size: 11px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 28px; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .heading-actions .button-primary { margin-left: auto; }
  .overview-heading .select-label { margin-left: 0; }
  .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 17px; }
  .metric { padding: 14px 10px 13px 0; }
  .metric:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .metric:nth-child(even) { padding-left: 13px; border-left: 1px solid var(--line); }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .metric:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .metric-value { font-size: 28px; }
  .notice { align-items: flex-start; gap: 8px; padding: 12px; }
  .notice-mark { width: 22px; height: 22px; }
  .demo-chip { display: none; }
  .data-note { align-items: flex-start; }
  .data-note .note-line { margin-top: 7px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 16px; }
  .draft-queue { grid-template-columns: 1fr; }
  .calendar-heading { flex-direction: row; align-items: flex-end; }
  .calendar-heading .button { min-width: 39px; width: 40px; overflow: hidden; padding: 0; font-size: 0; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .calendar-date-nav { width: 100%; }
  .calendar-date-nav strong { margin-left: auto; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(36px, 1fr)); overflow-x: auto; }
  .calendar-day-heading { padding: 8px 2px; font-size: 8px; text-align: center; }
  .calendar-day { min-height: 75px; }
  .day-number { width: 23px; height: 23px; margin: 0 auto; }
  .calendar-item { display: block; overflow: hidden; max-height: 25px; font-size: 0; }
  .calendar-item::before { display: inline-block; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; content: ""; }
  .calendar-item-time { display: none; }
  .calendar-week { grid-template-columns: 1fr; }
  .calendar-week .calendar-day-heading { min-height: 36px; }
  .calendar-week .calendar-day { min-height: 84px; }
  .calendar-week .calendar-item { display: flex; max-height: none; font-size: 10px; }
  .calendar-week .calendar-item::before { display: none; }
  .calendar-week .calendar-item-time { display: inline; }
  .calendar-day-view .calendar-day { min-height: 260px; }
  .calendar-drag-hint { margin-left: 0; }
  .calendar-legend { gap: 11px; }
  .editor-row { grid-template-columns: 1fr; gap: 7px; }
  .schedule-time-row { grid-template-columns: minmax(0, 1fr) 1fr; }
  .field-help { padding-bottom: 6px; }
  .saved-item { align-items: flex-start; flex-wrap: wrap; }
  .saved-actions { width: 100%; justify-content: flex-end; }
  .saved-item > .status-tag { margin-left: auto; }
  .toast { right: 12px; bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
