:root {
  color-scheme: light;
  --canvas: #f5f6f3;
  --canvas-2: #eef1ec;
  --surface: #ffffff;
  --surface-muted: #f4f6f3;
  --surface-strong: #e8ede8;
  --ink: #1a1f1b;
  --ink-2: #526057;
  --ink-3: #728078;
  --border: #d8ded9;
  --border-strong: #bdc7c0;
  --accent: #137a49;
  --accent-hover: #0f633b;
  --accent-soft: #e2f1e8;
  --danger: #a83b36;
  --danger-soft: #f8e9e7;
  --warning: #916313;
  --warning-soft: #fbf1dd;
  --info: #2e5f89;
  --info-soft: #e8f0f7;
  --action: #1a1f1b;
  --action-hover: #303733;
  --focus: #0f6a3d;
  --shadow: 0 16px 42px rgba(24, 37, 28, .055);
  --shadow-menu: 0 24px 70px rgba(19, 31, 23, .18);
  --radius-panel: 14px;
  --radius-card: 12px;
  --radius-control: 8px;
  --sidebar: 224px;
  --topbar: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  font-family: var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #151916;
  --canvas-2: #1a201c;
  --surface: #202622;
  --surface-muted: #252c27;
  --surface-strong: #2c352f;
  --ink: #f2f4f1;
  --ink-2: #bdc6bf;
  --ink-3: #8f9b92;
  --border: #374039;
  --border-strong: #505b53;
  --accent: #78c998;
  --accent-hover: #9bd9b4;
  --accent-soft: #253b2e;
  --danger: #efaaa4;
  --danger-soft: #472b29;
  --warning: #e8c273;
  --warning-soft: #42351f;
  --info: #a8c8e5;
  --info-soft: #293847;
  --action: #f1f3ef;
  --action-hover: #d8ddd9;
  --focus: #9bd9b4;
  --shadow: 0 18px 50px rgba(0, 0, 0, .12);
  --shadow-menu: 0 28px 80px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; }
body { margin: 0; min-width: 0; background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
body.menu-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent); outline-offset: 3px; }
::selection { background: var(--accent-soft); color: var(--ink); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 12px; z-index: 1000; transform: translateY(-160%); padding: 10px 14px; border-radius: var(--radius-control); background: var(--ink); color: var(--surface); text-align: left; background: transparent; cursor: pointer; text-decoration: none; transition: transform .16s ease; }
.skip-link:focus { transform: translateY(0); }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.logo { width: 36px; height: 36px; border-radius: 8px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 19px; font-weight: 760; letter-spacing: -.025em; text-decoration: none; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.tabular { font-variant-numeric: tabular-nums; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-control); text-decoration: none; font-size: 14px; font-weight: 680; white-space: nowrap; cursor: pointer; transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease, opacity .16s ease; }
.button:active { transform: scale(.98); }
.button:disabled { cursor: not-allowed; opacity: .56; transform: none; }
.button-primary { background: var(--action); border-color: var(--action); color: var(--surface); }
html[data-theme="dark"] .button-primary { color: #172019; }
.button-primary:hover:not(:disabled) { background: var(--action-hover); border-color: var(--action-hover); }
.button-secondary { background: var(--surface); border-color: var(--border); color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: var(--surface-muted); border-color: var(--border-strong); }
.button-quiet { background: transparent; color: var(--ink-2); }
.button-quiet:hover { background: var(--surface-muted); color: var(--ink); }
.button-danger { background: var(--danger); color: white; }
.button-small { min-height: 34px; padding-inline: 12px; font-size: 13px; }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--ink); cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .12s ease; }
.icon-button:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.icon-button:active { transform: scale(.96); }

.app-layout { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); grid-template-rows: var(--topbar) minmax(0, 1fr); }
.app-sidebar { grid-row: 1 / -1; position: sticky; top: 0; height: 100dvh; overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface); z-index: 30; }
.sidebar-head { height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.sidebar-product { padding: 5px 8px; border-radius: 6px; background: var(--surface-muted); color: var(--ink-2); font-size: 11px; font-weight: 700; white-space: nowrap; }
.sidebar-nav { padding: 18px 10px 28px; }
.nav-group + .nav-group { margin-top: 24px; }
.nav-label { margin: 0 10px 8px; color: var(--ink-3); font-size: 12px; font-weight: 680; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius-control); color: var(--ink-2); font-size: 14px; font-weight: 580; text-decoration: none; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.nav-item:hover { background: var(--surface-muted); color: var(--ink); }
.nav-item.active { border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); background: var(--accent-soft); color: var(--accent); }
.nav-item .icon { width: 16px; height: 16px; }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 99px; background: var(--surface-strong); color: var(--ink-2); font-size: 11px; font-weight: 750; }

.app-topbar { grid-column: 2; position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 16px; padding: 0 30px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); }
.topbar-menu { display: none; }
.breadcrumb { min-width: 0; display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 14px; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-menu { display: inline-flex; align-items: center; gap: 10px; padding-left: 8px; }
.avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800; }
.user-copy { line-height: 1.25; }
.user-copy strong { display: block; font-size: 13px; }
.user-copy span { color: var(--ink-3); font-size: 11px; }

.app-main { grid-column: 2; min-width: 0; padding: 30px; }
.page-shell { width: min(100%, 1180px); margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-title h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; letter-spacing: -.04em; text-wrap: balance; }
.page-title p { max-width: 64ch; margin: 9px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); box-shadow: 0 1px 1px rgba(20, 34, 24, .03); }
.metric-card small { display: block; color: var(--ink-2); font-size: 13px; font-weight: 650; }
.metric-value { display: block; margin-top: 16px; font-size: 32px; line-height: 1; font-weight: 760; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-trend { display: flex; align-items: center; gap: 5px; margin-top: 12px; color: var(--ink-3); font-size: 12px; }
.metric-trend.positive { color: var(--accent); }
.metric-trend.warning { color: var(--warning); }
.metric-card .spark { height: 28px; display: flex; align-items: flex-end; gap: 3px; margin-top: 15px; }
.metric-card .spark i { flex: 1; min-width: 3px; border-radius: 3px 3px 1px 1px; background: color-mix(in srgb, var(--accent) 22%, var(--surface-strong)); }
.metric-card .spark i:last-child { background: var(--accent); }

.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); box-shadow: 0 1px 1px rgba(20, 34, 24, .03); overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.panel-head { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.panel-head p { margin: 5px 0 0; color: var(--ink-3); font-size: 12px; }
.panel-body { padding: 20px; }
.panel-actions { display: flex; align-items: center; gap: 8px; }

.table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 14px; background: var(--surface-muted); color: var(--ink-2); text-align: left; font-size: 12px; font-weight: 700; white-space: nowrap; }
td { padding: 14px; border-top: 1px solid var(--border); color: var(--ink-2); vertical-align: middle; }
td strong { display: block; color: var(--ink); font-size: 13px; }
td small { display: block; margin-top: 3px; color: var(--ink-3); }
.row-action { min-height: 32px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 650; cursor: pointer; }
.row-action:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.status.success::before { background: var(--accent); }
.status.warning::before { background: var(--warning); }
.status.info::before { background: var(--info); }
.status.danger::before { background: var(--danger); }

.next-step { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; }
.next-step h2 { margin: 0; font-size: 17px; }
.next-step p { margin: 7px 0 0; color: var(--ink-2); font-size: 13px; }
.next-step__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.input, .select { min-height: 42px; width: 100%; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.input::placeholder { color: var(--ink-3); }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent); outline: 0; }
.search-field { position: relative; min-width: min(280px, 100%); }
.search-field .icon { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: var(--ink-3); }
.search-field .input { padding-left: 38px; }
.select { width: auto; min-width: 130px; padding-right: 34px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 16px; }
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.activity-item strong { display: block; font-size: 13px; }
.activity-item p { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.55; }
.activity-item time { color: var(--ink-3); font-size: 11px; white-space: nowrap; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 210px; padding-top: 20px; }
.bar-column { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-column i { width: min(28px, 72%); min-height: 8px; border-radius: 5px 5px 2px 2px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border)); transition: height .3s ease, background .2s ease; }
.bar-column:hover i { background: color-mix(in srgb, var(--accent) 35%, var(--accent-soft)); }
.bar-column span { color: var(--ink-3); font-size: 11px; }
.chart-legend { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--ink-3); font-size: 12px; }
.chart-legend strong { color: var(--ink); font-size: 17px; }

.empty-state { padding: 54px 22px; text-align: center; }
.empty-state .empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 14px; background: var(--surface-muted); color: var(--ink-3); }
.empty-state h3 { margin: 0; font-size: 17px; }
.empty-state p { max-width: 42ch; margin: 9px auto 18px; color: var(--ink-2); font-size: 13px; line-height: 1.65; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 40; border: 0; background: rgba(11, 17, 13, .42); }
.sidebar-backdrop.open { display: block; }

.modal { width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-menu); overflow: hidden; }
.modal::backdrop { background: rgba(11, 17, 13, .46); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.modal-head p { margin: 7px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 20px; }
.close-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
.form-group + .form-group { margin-top: 16px; }
.form-label { display: block; margin-bottom: 7px; color: var(--ink-2); font-size: 13px; font-weight: 650; }
.form-help { margin: 7px 0 0; color: var(--ink-3); font-size: 11px; line-height: 1.5; }
.form-error { min-height: 18px; margin: 5px 0 0; color: var(--danger); font-size: 12px; }
.drop-zone { display: grid; place-items: center; min-height: 160px; padding: 22px; border: 1px dashed var(--border-strong); border-radius: var(--radius-card); background: var(--surface-muted); text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone strong { margin-top: 12px; font-size: 14px; }
.drop-zone span { margin-top: 5px; color: var(--ink-3); font-size: 11px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: min(340px, calc(100vw - 36px)); display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-menu); animation: toast-in .2s ease both; }
.toast .icon { color: var(--accent); margin-top: 1px; }
.toast strong { display: block; font-size: 13px; }
.toast p { margin: 3px 0 0; color: var(--ink-2); font-size: 12px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.auth-page { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(420px, .95fr); background: var(--surface); }
.auth-brand-pane { min-height: 100dvh; position: relative; display: flex; flex-direction: column; padding: clamp(36px, 6vw, 78px); background: #1b2520; color: #f2f5f2; overflow: hidden; }
.auth-brand-pane::after { content: ""; position: absolute; right: -12%; bottom: -28%; width: 62%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.018), 0 0 0 160px rgba(255,255,255,.012); }
.auth-brand-pane .brand { position: relative; z-index: 1; color: #fff; }
.auth-message { position: relative; z-index: 1; max-width: 650px; margin: auto 0; }
.auth-message h1 { max-width: 9ch; margin: 0; font-size: clamp(52px, 7vw, 88px); line-height: .92; letter-spacing: -.065em; text-wrap: balance; }
.auth-message p { max-width: 38ch; margin: 28px 0 0; color: #bdc9c1; font-size: 17px; line-height: 1.8; }
.auth-caption { position: relative; z-index: 1; color: #a7b5ab; font-size: 12px; font-weight: 650; }
.auth-form-pane { min-height: 100dvh; display: grid; place-items: center; padding: 38px; background: var(--surface); }
.auth-card { width: min(100%, 390px); }
.auth-title { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-title img { width: 38px; height: 38px; border-radius: 9px; }
.auth-title h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.auth-tab { min-height: 46px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-3); font-size: 14px; font-weight: 650; cursor: pointer; }
.auth-tab.active { border-color: var(--accent); color: var(--accent); }
.auth-form [hidden] { display: none !important; }
.auth-form .button-primary { width: 100%; margin-top: 8px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 11px 0 20px; color: var(--ink-2); font-size: 12px; }
.form-row a, .auth-meta a { color: var(--accent); text-decoration: none; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }
.auth-meta { margin-top: 20px; text-align: center; color: var(--ink-3); font-size: 12px; line-height: 1.8; }
.code-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.code-field .button { min-width: 112px; }
.loading-dot { display: none; width: 14px; height: 14px; border: 2px solid color-mix(in srgb, currentColor 35%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .loading-dot { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.preview-page { min-height: 100dvh; padding: 48px 24px; background: var(--canvas); }
.preview-shell { width: min(100%, 1120px); margin: 0 auto; }
.preview-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 24px 0 44px; }
.preview-head h1 { max-width: 700px; margin: 16px 0 0; font-size: clamp(42px, 7vw, 82px); line-height: .98; letter-spacing: -.06em; text-wrap: balance; }
.preview-head p { max-width: 40ch; margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.preview-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 14px; }
.preview-card { min-height: 270px; grid-column: span 4; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.preview-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.preview-card.wide { grid-column: span 8; }
.preview-card.accent { background: var(--accent-soft); }
.preview-card small { color: var(--ink-3); font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; letter-spacing: .08em; }
.preview-card h2 { margin: auto 0 12px; font-size: 30px; letter-spacing: -.04em; }
.preview-card p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.preview-card .arrow { align-self: flex-end; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; }
.preview-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--ink-3); font-size: 12px; }

@media (max-width: 1080px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr 430px; }
  .auth-message h1 { font-size: clamp(48px, 7vw, 72px); }
}

@media (max-width: 900px) {
  :root { --topbar: 60px; }
  .app-layout { display: block; min-height: 100dvh; }
  .app-sidebar { position: fixed; top: 0; left: 0; z-index: 50; width: min(310px, calc(100vw - 54px)); height: 100dvh; transform: translateX(-105%); box-shadow: var(--shadow-menu); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
  .app-sidebar.open { transform: translateX(0); }
  .app-topbar { position: sticky; grid-column: auto; padding: 0 16px; }
  .topbar-menu { display: inline-grid; }
  .breadcrumb span:not(:last-child), .breadcrumb i { display: none; }
  .user-copy { display: none; }
  .app-main { grid-column: auto; padding: 24px 16px 36px; }
  .sidebar-backdrop { z-index: 45; }
  .page-header { align-items: stretch; flex-direction: column; }
  .page-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page-actions .button { width: 100%; }
  .preview-card, .preview-card.wide { grid-column: span 6; }
}

@media (max-width: 700px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 122px; }
  .page-title h1 { font-size: 26px; }
  .panel-head { align-items: flex-start; }
  .next-step { align-items: stretch; flex-direction: column; }
  .next-step__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .search-field, .select { width: 100%; }
  .auth-page { display: block; background: #1b2520; }
  .auth-brand-pane { display: none; }
  .auth-form-pane { min-height: 100dvh; padding: 28px 20px; border-radius: 22px 22px 0 0; }
  .auth-card { width: 100%; }
  .preview-page { padding: 26px 14px 40px; }
  .preview-head { align-items: flex-start; flex-direction: column; padding-bottom: 30px; }
  .preview-head h1 { font-size: 48px; }
  .preview-card, .preview-card.wide { grid-column: 1 / -1; min-height: 220px; }
  .preview-footer { flex-direction: column; }
}

@media (max-width: 440px) {
  .app-main { padding-inline: 12px; }
  .app-topbar { padding-inline: 12px; }
  .topbar-actions .icon-button { display: none; }
  .page-actions { grid-template-columns: 1fr 1fr; }
  .button { padding-inline: 13px; }
  .panel-head, .panel-body { padding-inline: 16px; }
  .next-step { padding: 18px 16px; }
  th, td { padding-inline: 12px; }
  .toast-region { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; width: 100%; }
  .code-field { grid-template-columns: 1fr; }
  .code-field .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
