:root {
  --bg: oklch(97.8% 0.006 235);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(95.8% 0.009 235);
  --fg: oklch(21% 0.025 245);
  --muted: oklch(50% 0.02 245);
  --border: oklch(89% 0.012 235);
  --accent: oklch(55% 0.13 170);
  --accent-strong: oklch(44% 0.12 170);
  --domain: oklch(57% 0.12 245);
  --success: oklch(52% 0.13 150);
  --warn: oklch(64% 0.14 75);
  --danger: oklch(55% 0.17 25);
  --sidebar: oklch(18% 0.025 225);
  --sidebar-muted: oklch(76% 0.016 225);
  --shadow: 0 18px 45px color-mix(in oklch, var(--fg) 7%, transparent);
  --radius: 8px;
  --font-display: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { letter-spacing: 0.02em; }

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 600; }
h2 { font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 600; }
h3 { font-size: 17px; line-height: 1.35; font-weight: 600; }

.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.small { font-size: 13px; letter-spacing: 0.01em; }
.eyebrow {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover { background: var(--surface-2); border-color: color-mix(in oklch, var(--border) 60%, var(--fg)); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-strong); color: white; border-color: var(--accent-strong); }
.btn-primary:hover { background: color-mix(in oklch, var(--accent-strong) 88%, black); border-color: transparent; }
.btn-dark { background: var(--fg); color: white; border-color: var(--fg); }
.btn-danger { color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-icon { width: 40px; padding: 0; }
.btn svg { width: 17px; height: 17px; stroke-width: 1.8; }
.btn[disabled] { opacity: .48; cursor: not-allowed; transform: none; }

.field { display: grid; gap: 7px; }
.field > label { font-size: 13px; font-weight: 550; letter-spacing: 0.02em; }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  padding: 9px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.textarea { min-height: 140px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: color-mix(in oklch, var(--muted) 70%, white); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 16%, transparent);
  outline: none;
}
.field-error { min-height: 18px; color: var(--danger); font-size: 12px; letter-spacing: 0.01em; }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(420px, .9fr); background: var(--surface); }
.login-story {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background: var(--sidebar);
  color: white;
  padding: clamp(40px, 6vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-story::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .12;
  background-image: linear-gradient(color-mix(in oklch, white 24%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in oklch, white 24%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}
.login-story > * { position: relative; z-index: 1; }
.brand-lockup {
  position: relative;
  display: block;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-size: contain;
}
.brand-lockup > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.login-story .brand-lockup {
  width: 112px;
  height: 112px;
  background-image: url("LOGO_竖版带名字.png");
  background-position: left top;
}
.story-copy { max-width: 660px; display: grid; gap: 22px; }
.story-copy h1 { font-size: clamp(44px, 5vw, 72px); line-height: 1.02; letter-spacing: -0.03em; max-width: 10ch; }
.story-copy p { max-width: 56ch; color: color-mix(in oklch, white 72%, var(--sidebar)); font-size: 17px; }
.flow-preview { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 22px; max-width: 640px; }
.flow-step { border-top: 1px solid color-mix(in oklch, white 25%, transparent); padding-top: 12px; color: color-mix(in oklch, white 64%, var(--sidebar)); font-size: 12px; letter-spacing: 0.02em; }
.flow-step.is-active { border-color: var(--accent); color: white; }
.login-meta { color: color-mix(in oklch, white 52%, var(--sidebar)); font-size: 12px; letter-spacing: 0.02em; }
.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 36px; background: var(--bg); }
.login-card { width: min(420px, 100%); display: grid; gap: 26px; }
.login-card header { display: grid; gap: 10px; }
.login-card form { display: grid; gap: 16px; }
.login-actions { display: grid; gap: 10px; margin-top: 4px; }
.login-actions .btn { min-height: 46px; }
.demo-note { border-top: 1px solid var(--border); padding-top: 18px; display: flex; gap: 10px; color: var(--muted); font-size: 13px; }
.demo-note svg { width: 17px; flex: 0 0 auto; margin-top: 2px; }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 244px; z-index: 30;
  background: var(--sidebar); color: white; padding: 22px 14px; display: flex; flex-direction: column;
}
.sidebar .brand-lockup {
  width: 190px;
  height: 68px;
  margin: 0 8px 8px;
  background-image: url("LOGO_横版带名字.png");
  background-position: left center;
}
.side-nav { display: grid; gap: 3px; margin-top: 12px; }
.nav-label { padding: 18px 11px 8px; color: color-mix(in oklch, white 42%, var(--sidebar)); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav-link {
  min-height: 42px; padding: 0 11px; border-radius: 6px; display: flex; align-items: center; gap: 11px;
  color: var(--sidebar-muted); font-size: 14px; font-weight: 510; letter-spacing: 0.01em;
}
.nav-link svg { width: 18px; height: 18px; stroke-width: 1.7; }
.nav-link:hover { color: white; background: color-mix(in oklch, white 7%, transparent); }
.nav-link.active { color: white; background: color-mix(in oklch, var(--accent) 18%, transparent); }
.sidebar-foot { margin-top: auto; border-top: 1px solid color-mix(in oklch, white 9%, transparent); padding: 16px 8px 0; display: grid; gap: 12px; }
.account-mini { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: color-mix(in oklch, var(--domain) 55%, white); color: white; display: grid; place-items: center; font-weight: 600; flex: 0 0 auto; }
.account-mini div { min-width: 0; }
.account-mini strong, .account-mini span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-mini strong { font-size: 13px; font-weight: 550; }
.account-mini span { color: color-mix(in oklch, white 45%, var(--sidebar)); font-size: 11px; letter-spacing: .01em; }
.app-body { grid-column: 2; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 66px; border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--bg) 88%, transparent); backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 28px;
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mobile-menu { display: none; }
.project-switch { max-width: 260px; }
.guest-chip { display: none; align-items: center; gap: 6px; min-height: 30px; border: 1px solid color-mix(in oklch, var(--warn) 45%, var(--border)); background: color-mix(in oklch, var(--warn) 12%, white); color: color-mix(in oklch, var(--warn) 62%, var(--fg)); border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 550; }
.guest-chip svg { width: 14px; }
.guest-chip.is-visible { display: inline-flex; }
.content { width: min(1440px, 100%); margin: 0 auto; padding: 30px 28px 54px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading-copy { display: grid; gap: 7px; }
.page-heading-copy p { max-width: 65ch; color: var(--muted); }
.heading-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-header { min-height: 58px; padding: 16px 19px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.card-header-copy { display: grid; gap: 3px; }
.card-header-copy p { color: var(--muted); font-size: 12px; letter-spacing: 0.01em; }
.card-body { padding: 19px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { min-height: 132px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.metric-top svg { width: 18px; height: 18px; }
.metric-value { font: 600 32px/1.1 var(--font-mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric-foot { color: var(--muted); font-size: 12px; letter-spacing: 0.01em; }
.status-up { color: var(--success); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 12px; margin-top: 12px; }
.chart-card { min-height: 340px; }
.trend-chart { height: 220px; display: flex; align-items: flex-end; gap: clamp(10px, 2vw, 22px); padding: 12px 4px 0; border-bottom: 1px solid var(--border); background-image: linear-gradient(to bottom, transparent calc(25% - 1px), var(--border) 25%, transparent calc(25% + 1px), transparent calc(50% - 1px), var(--border) 50%, transparent calc(50% + 1px), transparent calc(75% - 1px), var(--border) 75%, transparent calc(75% + 1px)); }
.trend-bar { flex: 1; min-width: 12px; max-width: 42px; height: var(--h); background: color-mix(in oklch, var(--domain) 65%, white); border-radius: 3px 3px 0 0; position: relative; transition: height 400ms ease; }
.trend-bar:nth-child(3n) { background: var(--accent); }
.trend-bar::after { content: attr(data-label); position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%); color: var(--muted); font: 10px/1 var(--font-mono); letter-spacing: .01em; }
.chart-legend { display: flex; gap: 18px; align-items: center; margin-top: 28px; color: var(--muted); font-size: 12px; }
.legend-key { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--domain); }
.legend-dot.accent { background: var(--accent); }
.distribution { display: grid; gap: 18px; }
.platform-row { display: grid; grid-template-columns: 72px minmax(0,1fr) 36px; gap: 12px; align-items: center; }
.platform-row strong { font-size: 13px; font-weight: 550; }
.progress { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; width: var(--value); height: 100%; background: var(--domain); border-radius: inherit; }
.platform-row:nth-child(2) .progress > span { background: var(--accent); }
.platform-row code { text-align: right; color: var(--muted); font: 12px var(--font-mono); }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 12px; margin-top: 12px; }
.pipeline-list { display: grid; }
.pipeline-item { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.pipeline-item:last-child { border-bottom: 0; }
.step-index { width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 50%; display: grid; place-items: center; font: 11px var(--font-mono); color: var(--muted); }
.step-index.done { background: color-mix(in oklch, var(--success) 12%, white); border-color: color-mix(in oklch, var(--success) 32%, var(--border)); color: var(--success); }
.pipeline-item strong { display: block; font-size: 13px; font-weight: 550; }
.pipeline-item p { color: var(--muted); font-size: 12px; }
.keyword-list { display: grid; gap: 1px; }
.keyword-row { display: grid; grid-template-columns: minmax(0,1fr) 80px 68px; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--border); align-items: center; }
.keyword-row:last-child { border-bottom: 0; }
.keyword-row strong { font-size: 13px; font-weight: 550; }
.keyword-row span { color: var(--muted); font-size: 12px; }

/* Tables and workspace */
.filters { padding: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input { width: min(300px, 100%); }
.filters .select { width: auto; min-width: 150px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); background: color-mix(in oklch, var(--bg) 68%, white); font-size: 11px; font-weight: 550; letter-spacing: 0.06em; text-transform: uppercase; }
.data-table td { font-size: 13px; }
.data-table tbody tr:hover { background: color-mix(in oklch, var(--bg) 70%, white); }
.table-title { display: grid; gap: 2px; }
.table-title strong { font-weight: 550; }
.table-title span { color: var(--muted); font: 11px var(--font-mono); }
.table-actions { display: flex; gap: 5px; justify-content: flex-end; }
.table-actions .btn { min-height: 34px; padding: 0 10px; font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 550; letter-spacing: .02em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { color: var(--success); background: color-mix(in oklch, var(--success) 8%, white); border-color: color-mix(in oklch, var(--success) 25%, var(--border)); }
.badge-warn { color: color-mix(in oklch, var(--warn) 75%, var(--fg)); background: color-mix(in oklch, var(--warn) 10%, white); border-color: color-mix(in oklch, var(--warn) 28%, var(--border)); }
.badge-danger { color: var(--danger); background: color-mix(in oklch, var(--danger) 7%, white); border-color: color-mix(in oklch, var(--danger) 22%, var(--border)); }
.badge-info { color: var(--domain); background: color-mix(in oklch, var(--domain) 8%, white); border-color: color-mix(in oklch, var(--domain) 22%, var(--border)); }
.completion { display: flex; align-items: center; gap: 9px; }
.completion .progress { width: 70px; }
.empty-state { display: none; padding: 64px 24px; text-align: center; color: var(--muted); }
.empty-state svg { width: 32px; height: 32px; margin-bottom: 10px; }

.workspace-grid { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(460px, 1.28fr); gap: 12px; align-items: start; }
.config-panel { position: sticky; top: 84px; }
.form-stack { display: grid; gap: 15px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; background: var(--surface-2); border-radius: 7px; }
.segmented button { min-height: 36px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 550; }
.segmented button.active { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px color-mix(in oklch, var(--fg) 10%, transparent); }
.platform-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.check-tile { min-height: 48px; border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; gap: 9px; padding: 10px; cursor: pointer; }
.check-tile:has(input:checked) { border-color: var(--accent-strong); background: color-mix(in oklch, var(--accent) 7%, white); }
.check-tile input { accent-color: var(--accent-strong); }
.readiness { display: grid; gap: 12px; padding: 14px; background: var(--surface-2); border-radius: 7px; }
.readiness-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.readiness-top strong { font: 600 18px var(--font-mono); }
.readiness-list { display: flex; flex-wrap: wrap; gap: 7px; }
.readiness-list span { font-size: 11px; color: var(--muted); }
.work-stage { min-height: 640px; }
.stage-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 7px; }
.stage-tabs button { min-height: 38px; flex: 1; border: 0; background: transparent; border-radius: 5px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 550; }
.stage-tabs button.active { background: var(--surface); color: var(--fg); box-shadow: 0 1px 4px color-mix(in oklch, var(--fg) 9%, transparent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: reveal 240ms ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.generation-idle { min-height: 480px; display: grid; place-items: center; text-align: center; padding: 40px; }
.idle-content { max-width: 440px; display: grid; justify-items: center; gap: 12px; }
.signal-mark { width: 54px; height: 54px; border: 1px solid color-mix(in oklch, var(--accent) 35%, var(--border)); border-radius: 12px; color: var(--accent-strong); display: grid; place-items: center; background: color-mix(in oklch, var(--accent) 7%, white); }
.signal-mark svg { width: 24px; height: 24px; }
.generation-progress { display: none; padding: 26px; }
.generation-progress.is-visible { display: block; }
.progress-steps { display: grid; gap: 13px; margin-top: 22px; }
.progress-step { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.progress-step svg { width: 18px; }
.progress-step.done { color: var(--success); }
.progress-step.current { color: var(--fg); }
.article-preview { display: grid; gap: 18px; }
.article-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.article-score { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 7px; }
.score-ring { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) 0 86%, var(--surface-2) 86%); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 7px; background: var(--surface); border-radius: 50%; }
.score-ring strong { position: relative; z-index: 1; font: 600 18px var(--font-mono); }
.score-bars { display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: 88px minmax(0,1fr) 30px; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.article-editor { min-height: 310px; border: 1px solid var(--border); border-radius: 7px; padding: 22px; outline: none; line-height: 1.75; }
.article-editor:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 14%, transparent); }
.article-editor h3 { margin-bottom: 14px; }
.article-editor p + p { margin-top: 12px; }
.review-actions, .publish-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.timeline { display: grid; }
.timeline-item { display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--border); box-shadow: 0 0 0 4px var(--surface-2); }
.timeline-item.done .timeline-dot { background: var(--success); }
.timeline-item.current .timeline-dot { background: var(--warn); }
.timeline-item strong { display: block; font-size: 13px; font-weight: 550; }
.timeline-item p, .timeline-item time { color: var(--muted); font-size: 12px; }

/* Dialog, toast, responsive */
.dialog { width: min(440px, calc(100% - 28px)); border: 0; border-radius: 10px; padding: 0; box-shadow: 0 30px 90px color-mix(in oklch, var(--fg) 25%, transparent); color: var(--fg); }
.dialog::backdrop { background: color-mix(in oklch, var(--sidebar) 58%, transparent); backdrop-filter: blur(3px); }
.dialog-head { padding: 20px 20px 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-body { padding: 8px 20px 20px; color: var(--muted); }
.dialog-foot { border-top: 1px solid var(--border); padding: 14px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; min-width: 260px; max-width: calc(100% - 44px); background: var(--fg); color: white; border-radius: 7px; padding: 13px 15px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); transform: translateY(18px); opacity: 0; pointer-events: none; transition: 180ms ease; }
.toast.is-visible { transform: none; opacity: 1; }
.toast svg { width: 17px; color: var(--accent); }
.sidebar-scrim { display: none; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid, .lower-grid { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .config-panel { position: static; }
}

@media (max-width: 820px) {
  .login-page { grid-template-columns: 1fr; }
  .login-story { min-height: 44vh; padding: 34px 26px; }
  .login-story .brand-lockup { width: 88px; height: 88px; }
  .story-copy h1 { font-size: 42px; }
  .login-meta { display: none; }
  .login-panel { min-height: 56vh; padding: 34px 22px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform 180ms ease; }
  body.nav-open .sidebar { transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: color-mix(in oklch, var(--sidebar) 58%, transparent); }
  body.nav-open .sidebar-scrim { display: block; }
  .app-body { grid-column: 1; }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 0 18px; }
  .content { padding: 24px 18px 44px; }
  .project-switch { max-width: 190px; }
}

@media (max-width: 600px) {
  .flow-preview { grid-template-columns: repeat(3, 1fr); }
  .flow-step:nth-child(n+4) { display: none; }
  .page-heading { flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .btn { flex: 1; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 112px; padding: 14px; }
  .metric-value { font-size: 26px; }
  .topbar-actions .btn:not(.btn-icon) { display: none; }
  .guest-chip span { display: none; }
  .filters { align-items: stretch; }
  .filters .input, .filters .select { width: 100%; }
  .platform-checks { grid-template-columns: 1fr; }
  .stage-tabs { overflow-x: auto; }
  .stage-tabs button { min-width: 88px; }
  .article-score { grid-template-columns: 1fr; }
  .score-ring { margin: auto; }
}
