:root {
  color-scheme: light dark;
  --paper: #ffffff;
  --canvas: #f5f7f8;
  --surface: #f0f3f5;
  --surface-hover: #e8edf0;
  --ink: #1f2933;
  --muted: #66737d;
  --line: #dce2e6;
  --line-strong: #bec8cf;
  --accent: #416f8a;
  --accent-hover: #315a71;
  --accent-soft: #e7f0f4;
  --focus: #497f9d;
  --success: #26724b;
  --success-soft: #e6f3eb;
  --warning: #8a6308;
  --warning-soft: #fff4d9;
  --danger: #b23832;
  --danger-hover: #922e2a;
  --danger-soft: #fbeceb;
  --shadow: 0 12px 34px rgba(31, 41, 51, .09);
  --shadow-small: 0 5px 18px rgba(31, 41, 51, .1);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; letter-spacing: 0; }
html { min-width: 300px; min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100%; background: var(--canvas); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 58%, transparent); outline-offset: 2px; }
.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; }

.boot, .empty-state, .error-state { min-height: 46vh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 32px; color: var(--muted); text-align: center; }
.error-state h2, .empty-state h2 { margin: 0; color: var(--ink); font-size: 20px; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar { height: 64px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-logo { width: 30px; height: 30px; flex: none; }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
.account-actions { display: flex; align-items: center; gap: 8px; }
.message-button, .avatar-button { width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: transparent; text-decoration: none; list-style: none; }
.message-button:hover, .avatar-button:hover { background: var(--surface); }
.message-button .icon { width: 21px; height: 21px; }
.account-menu { position: relative; }
.account-menu > summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); font-weight: 700; border: 1px solid var(--line); }
.account-popover { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 244px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow-small); z-index: 50; }
.account-menu[open] .account-popover { display: grid; }
.account-summary { display: grid; gap: 1px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.account-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary span, .account-summary small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary span { font-size: 13px; }
.account-summary small { font-size: 12px; }
.menu-item { width: 100%; min-height: 40px; border: 0; border-radius: 6px; padding: 8px 9px; display: grid; grid-template-columns: 20px minmax(0, 1fr) 18px; align-items: center; gap: 8px; text-align: left; color: var(--ink); background: transparent; text-decoration: none; }
.menu-item:hover { background: var(--surface); }
.menu-item .icon:last-child { color: var(--muted); }
.menu-danger { color: var(--danger); }
.icon { width: 19px; height: 19px; display: inline-grid; place-items: center; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

.workspace { max-width: 1500px; min-height: calc(100vh - 64px); margin: 0 auto; display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
.sidebar { border-right: 1px solid var(--line); padding: 22px 16px; background: color-mix(in srgb, var(--canvas) 68%, var(--paper)); min-width: 0; }
.sidebar-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; padding: 0 4px; }
.sidebar-head h1 { font-size: 16px; margin: 0; }
.sidebar-head .action-group { flex-wrap: nowrap; }
.survey-list { display: grid; gap: 4px; }
.survey-item { width: 100%; border: 0; background: transparent; color: var(--ink); text-align: left; padding: 11px 12px; border-radius: 7px; display: grid; gap: 5px; }
.survey-item:hover { background: var(--surface); }
.survey-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.survey-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 620; }
.survey-item-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.content { min-width: 0; padding: 28px clamp(20px, 4vw, 56px) 64px; background: var(--paper); }
.content-inner { max-width: 1060px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-head > * { min-width: 0; }
.page-title { margin: 0; font-size: 25px; line-height: 1.3; overflow-wrap: anywhere; }
.page-description { color: var(--muted); margin: 7px 0 0; max-width: 720px; white-space: pre-wrap; }
.action-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; margin-bottom: 28px; }
.tab { min-height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 9px 14px; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }

.btn { min-height: 40px; max-width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-align: center; text-decoration: none; font-weight: 620; line-height: 1.25; }
.btn:hover { background: var(--surface); }
.btn-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger-solid:hover { background: var(--danger-hover); }
.btn-icon { width: 40px; padding: 0; font-size: 20px; font-weight: 500; }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn-wide { width: 100%; min-height: 46px; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.status-published { background: var(--success-soft); color: var(--success); }
.status-paused, .status-upcoming { background: var(--warning-soft); color: var(--warning); }
.status-closed, .status-archived, .status-deleted { background: var(--surface); color: var(--muted); }

.section { padding: 4px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.section:last-child { border-bottom: 0; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.section h2 { font-size: 17px; margin: 0; }
.section h3 { font-size: 15px; margin: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 5px 0 0; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > span:first-child, .field-label { font-size: 13px; font-weight: 650; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); padding: 9px 11px; min-height: 42px; }
.input:hover, .textarea:hover, .select:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--ink)); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--focus); }
.textarea { resize: vertical; min-height: 96px; }
.input:invalid:not(:placeholder-shown), .textarea:invalid:not(:placeholder-shown), .select:invalid { border-color: var(--danger); }
.check { display: flex; align-items: flex-start; gap: 9px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.segmented button { border: 0; border-right: 1px solid var(--line); background: var(--paper); min-height: 38px; padding: 6px 12px; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { color: #fff; background: var(--accent); }

.question-list { display: grid; gap: 12px; }
.question-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--paper); display: grid; gap: 14px; }
.question-card:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 18%, transparent); }
.question-toolbar { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.question-actions { display: flex; gap: 4px; }
.question-index { color: var(--muted); font-size: 12px; }
.builder-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 16px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); margin-bottom: 26px; }
.metric { padding: 17px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-value { font-size: 24px; font-variant-numeric: tabular-nums; font-weight: 700; }
.metric-label { color: var(--muted); font-size: 12px; }
.stat-list { display: grid; gap: 20px; }
.stat-item { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.bar-row { display: grid; grid-template-columns: minmax(90px, 180px) minmax(100px, 1fr) 70px; align-items: center; gap: 10px; margin-top: 9px; font-size: 13px; }
.bar-row > span:last-child { white-space: nowrap; text-align: right; }
.bar-track { height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.table { width: 100%; min-width: 660px; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: var(--surface); font-size: 12px; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table td { overflow-wrap: anywhere; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)) auto; gap: 10px; margin-bottom: 16px; align-items: end; }
.filters-compact { grid-template-columns: repeat(2, minmax(160px, 260px)) auto; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }

.public-shell { min-height: 100vh; background: var(--canvas); padding: 22px 16px 0; }
.public-header { max-width: 760px; margin: 0 auto 16px; display: flex; justify-content: space-between; align-items: center; }
.public-form { width: min(760px, 100%); margin: 0 auto 36px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.public-title { padding: 28px clamp(18px, 5vw, 42px); border-top: 4px solid var(--accent); border-bottom: 1px solid var(--line); }
.public-title h1 { margin: 0; font-size: 26px; overflow-wrap: anywhere; }
.public-title p { margin: 10px 0 0; color: var(--muted); white-space: pre-wrap; }
.public-logo { display: block; width: auto; max-width: min(220px, 70%); height: auto; max-height: 72px; object-fit: contain; margin-bottom: 18px; }
.public-questions { padding: 8px clamp(18px, 5vw, 42px) 26px; }
.public-form-compact .public-title { padding-top: 20px; padding-bottom: 20px; }
.public-form-compact .public-question { padding-top: 15px; padding-bottom: 15px; }
.public-question { min-width: 0; padding: 22px 0; border: 0; border-bottom: 1px solid var(--line); }
.public-question:last-child { border-bottom: 0; }
.public-question legend, .public-question > label:first-child { display: block; font-weight: 650; margin-bottom: 9px; }
.required { color: var(--danger); margin-left: 4px; }
.option-list { display: grid; gap: 9px; }
.option { display: flex; gap: 9px; align-items: flex-start; }
.option input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.public-actions { position: sticky; bottom: 0; padding: 14px clamp(18px, 5vw, 42px); background: color-mix(in srgb, var(--paper) 96%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.save-state { color: var(--muted); font-size: 12px; min-height: 20px; }
.matrix-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.matrix { border-collapse: collapse; min-width: 560px; width: 100%; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); padding: 9px; text-align: center; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--paper); text-align: left; min-width: 140px; }
.matrix th { background: var(--surface); font-size: 12px; }

.login-page { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; align-items: center; padding: 24px; background: var(--canvas); }
.login-panel { width: min(430px, calc(100vw - 32px)); margin: 48px auto; background: transparent; border: 0; padding: 18px 8px; }
.login-logo { display: block; width: 178px; height: auto; margin-bottom: 30px; }
.login-panel h1 { margin: 0 0 7px; font-size: 27px; }
.login-panel p { margin: 0 0 26px; color: var(--muted); }
.login-panel > .input { margin-bottom: 14px; }
.mock-logins { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.result-panel { text-align: center; }
.result-panel .result-icon { margin-inline: auto; }
.result-panel .action-group { justify-content: center; }
.stats-panel { width: min(680px, calc(100vw - 32px)); }
.result-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 750; }
.result-success { background: var(--success-soft); color: var(--success); }
.result-danger { background: var(--danger-soft); color: var(--danger); }

.notice { border-left: 3px solid var(--warning); background: var(--warning-soft); border-radius: 0 6px 6px 0; padding: 11px 13px; margin: 14px 0; }
.notice-error { border-color: var(--danger); background: var(--danger-soft); }
.notice-success { border-color: var(--success); background: var(--success-soft); }
.toast-region { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; width: min(360px, calc(100vw - 36px)); }
.toast { background: #27313a; color: #fff; padding: 11px 14px; border-radius: 7px; box-shadow: var(--shadow-small); animation: toast-in .18s ease-out; }
.toast-error { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
dialog { color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 0; box-shadow: var(--shadow); width: min(560px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(25, 34, 42, .45); }
.preview-form { max-height: min(72vh, 760px); overflow: auto; padding-right: 4px; }
.preview-form .public-question { padding-left: 2px; padding-right: 2px; }
.dialog-body { padding: 22px; display: grid; gap: 16px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2, .result-dialog h2 { margin: 0; font-size: 19px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.result-dialog { width: min(460px, calc(100vw - 28px)); }
.result-dialog-body { grid-template-columns: 48px minmax(0, 1fr); align-items: start; }
.result-dialog-body .dialog-actions { grid-column: 1 / -1; }
.result-dialog-body p { margin: 6px 0 0; color: var(--muted); }

.consent-bar { position: fixed; z-index: 70; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(760px, calc(100vw - 28px)); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow-small); }
.consent-bar p { margin: 0; color: var(--muted); font-size: 13px; }
.consent-bar .action-group { flex-wrap: nowrap; flex: none; }
.site-footer { min-height: 66px; padding: 20px max(18px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: var(--canvas); color: var(--muted); display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 24px; font-size: 12px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
.footer-links a { color: var(--muted); }

.legal-topbar { height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.legal-layout { width: min(1120px, calc(100% - 36px)); margin: 0 auto; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(36px, 7vw, 88px); padding: 48px 0 72px; }
.legal-nav { position: sticky; top: 88px; align-self: start; display: grid; gap: 3px; }
.legal-nav a { min-height: 38px; padding: 8px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.legal-nav a:hover { color: var(--ink); background: var(--surface); }
.legal-nav a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.legal-content { max-width: 720px; min-width: 0; }
.legal-kicker { margin: 0 0 5px; color: var(--accent); font-weight: 650; }
.legal-content > h1 { margin: 0; font-size: 30px; }
.legal-lead { margin: 9px 0 38px; color: var(--muted); font-size: 16px; }
.legal-content section { margin: 0 0 30px; }
.legal-content section h2 { margin: 0 0 8px; font-size: 18px; }
.legal-content section p { margin: 0; color: color-mix(in srgb, var(--ink) 84%, var(--muted)); }
.legal-date { margin-top: 46px; color: var(--muted); font-size: 13px; }
.legal-form { display: grid; gap: 18px; margin: 28px 0; }
.legal-form .btn { justify-self: start; }
.legal-receipt { min-height: 52vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; }
.legal-receipt h1, .legal-receipt p { margin: 0; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .content { padding-left: 22px; padding-right: 22px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .legal-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 36px; }
}

@media (max-width: 680px) {
  .topbar, .legal-topbar { height: 56px; padding: 0 13px; }
  .brand-sub { display: none; }
  .brand { font-size: 16px; }
  .brand-logo { width: 28px; height: 28px; }
  .message-button, .avatar-button { width: 40px; height: 40px; }
  .account-popover { position: fixed; top: 62px; right: 10px; width: min(260px, calc(100vw - 20px)); }
  .workspace { display: block; min-height: calc(100vh - 56px); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .sidebar-head { margin-bottom: 8px; }
  .survey-list { display: flex; overflow-x: auto; gap: 7px; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .survey-item { width: min(210px, 72vw); min-width: min(210px, 72vw); border: 1px solid var(--line); scroll-snap-align: start; }
  .survey-item.active { box-shadow: inset 0 -3px var(--accent); }
  .content { padding: 22px 15px 54px; }
  .page-head { display: grid; gap: 14px; }
  .page-title { font-size: 22px; }
  .action-group { justify-content: flex-start; }
  .field-grid, .question-toolbar, .filters, .filters-compact { grid-template-columns: minmax(0, 1fr); }
  .question-toolbar { align-items: stretch; }
  .question-actions { justify-content: flex-end; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 14px; }
  .bar-row { grid-template-columns: minmax(72px, 100px) minmax(70px, 1fr) minmax(78px, auto); gap: 8px; }
  .public-shell { padding: 12px 0 0; }
  .public-header { padding: 0 13px; }
  .public-form { width: 100%; border-left: 0; border-right: 0; border-radius: 0; margin-bottom: 24px; }
  .public-title h1 { font-size: 22px; }
  .public-actions { align-items: stretch; flex-direction: column; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .public-actions .btn { width: 100%; min-height: 46px; }
  .login-page { padding: 16px; }
  .login-panel { margin: 28px auto; padding: 14px 4px; }
  .login-logo { width: 164px; margin-bottom: 26px; }
  .mock-logins { grid-template-columns: 1fr; }
  .toast-region { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .section-head { align-items: flex-start; flex-direction: column; }
  .section-head .action-group, .section-head > .btn { width: 100%; }
  .section-head > .btn { justify-content: center; }
  .builder-footer { align-items: stretch; flex-direction: column; }
  .builder-footer .btn { width: 100%; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .consent-bar { align-items: stretch; flex-direction: column; }
  .consent-bar .action-group { justify-content: flex-end; }
  .result-dialog-body { grid-template-columns: 40px minmax(0, 1fr); }
  .result-dialog-body .result-icon { width: 40px; height: 40px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .btn { min-width: 110px; flex: 1; }
  .legal-layout { width: min(100% - 28px, 720px); display: block; padding: 22px 0 52px; }
  .legal-nav { position: static; display: flex; overflow-x: auto; gap: 5px; margin-bottom: 30px; padding-bottom: 4px; }
  .legal-nav a { flex: none; white-space: nowrap; }
  .legal-content > h1 { font-size: 26px; }
  .legal-lead { margin-bottom: 30px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171c20;
    --canvas: #111518;
    --surface: #22292e;
    --surface-hover: #293238;
    --ink: #edf2f4;
    --muted: #a3afb7;
    --line: #303a41;
    --line-strong: #4a5861;
    --accent: #78a7bf;
    --accent-hover: #8bb8ce;
    --accent-soft: #243944;
    --focus: #85b7d0;
    --success: #78bd94;
    --success-soft: #20392b;
    --warning: #dfb65c;
    --warning-soft: #3d321b;
    --danger: #e17a75;
    --danger-hover: #ee908b;
    --danger-soft: #422725;
    --shadow: 0 12px 34px rgba(0, 0, 0, .32);
    --shadow-small: 0 5px 18px rgba(0, 0, 0, .34);
  }
  .btn-primary, .btn-danger-solid { color: #fff; }
  .toast { background: #e6edf0; color: #182027; }
  .toast-error { background: #8f302d; color: #fff; }
  .brand-logo, .login-logo { filter: saturate(.86) brightness(1.08); }
}

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