:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #ececf0;
  --border: rgba(29, 29, 31, 0.12);
  --border-strong: rgba(29, 29, 31, 0.26);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0066cc;
  --accent-hover: #0071e3;
  --accent-contrast: #ffffff;
  --header-bg: rgba(245, 245, 247, 0.82);
  --high: #d33a34;
  --high-bg: #fff0ef;
  --medium: #9b6200;
  --medium-bg: #fff6dc;
  --low: #147a4b;
  --low-bg: #eaf8f1;
  --stage-bg: #000000;
  --stage-surface: #111113;
  --stage-raised: #18181b;
  --stage-muted-surface: #202024;
  --stage-text: #f5f5f7;
  --stage-muted: #a1a1a6;
  --stage-border: rgba(255, 255, 255, 0.14);
  --stage-border-strong: rgba(255, 255, 255, 0.3);
  --stage-high: #ff7069;
  --stage-high-bg: #2d1717;
  --stage-medium: #ffc45b;
  --stage-medium-bg: #2c2414;
  --stage-low: #62d99a;
  --stage-low-bg: #142a20;
  --radius-tool: 20px;
  --radius-control: 12px;
  --max-width: 1280px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --page: #000000;
  --surface: #101012;
  --surface-raised: #17171a;
  --surface-muted: #202024;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.3);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --accent: #2997ff;
  --accent-hover: #55adff;
  --accent-contrast: #00172b;
  --header-bg: rgba(0, 0, 0, 0.8);
  --high: #ff7069;
  --high-bg: #2d1717;
  --medium: #ffc45b;
  --medium-bg: #2c2414;
  --low: #62d99a;
  --low-bg: #142a20;
  --stage-bg: #f5f5f7;
  --stage-surface: #ffffff;
  --stage-raised: #ffffff;
  --stage-muted-surface: #ececf0;
  --stage-text: #1d1d1f;
  --stage-muted: #6e6e73;
  --stage-border: rgba(29, 29, 31, 0.12);
  --stage-border-strong: rgba(29, 29, 31, 0.26);
  --stage-high: #d33a34;
  --stage-high-bg: #fff0ef;
  --stage-medium: #9b6200;
  --stage-medium-bg: #fff6dc;
  --stage-low: #147a4b;
  --stage-low-bg: #eaf8f1;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--page);
  color: var(--text);
  font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button, textarea, input, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: 72px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(20px);
}

.header-inner {
  width: min(var(--max-width), calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  display: block;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: contain;
}

.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { font-size: 15px; font-weight: 650; line-height: 1.1; }
.brand-copy span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.2; }

.header-nav { display: flex; align-items: center; gap: 36px; }
.header-nav a {
  position: relative;
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: color 220ms ease;
}
.header-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.header-nav a:hover { color: var(--text); }
.header-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.service-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--medium); }
.service-status.online .status-dot { background: var(--low); box-shadow: 0 0 0 4px color-mix(in srgb, var(--low) 14%, transparent); }
.service-status.offline .status-dot { background: var(--high); }

.icon-button, .bare-icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.icon-button { width: 36px; height: 36px; border-radius: 50%; }
.icon-button svg, .bare-icon-button svg, button svg { width: 17px; height: 17px; }
.language-button { width: auto; min-width: 42px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 650; }
.bare-icon-button { width: 34px; height: 34px; border-radius: 50%; }
.icon-button:hover, .bare-icon-button:hover { border-color: var(--border-strong); background: var(--surface-muted); }
.icon-button:active, .bare-icon-button:active { transform: scale(0.94); }

.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - 32px);
  overflow: hidden;
  background: var(--page);
}

#signal-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.78;
  pointer-events: none;
}

.hero-frame {
  position: relative;
  z-index: 1;
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 130px 0 46px;
}

.hero-copy { max-width: 900px; }
.hero-overline {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.hero-ready { display: inline-flex; align-items: center; gap: 8px; }
.hero-ready > span:first-child { width: 24px; height: 1px; background: var(--accent); }
.hero h1 {
  margin: 17px 0 0;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 104px;
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0;
}
.hero-copy > p {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 28px;
  font-weight: 300;
  line-height: 1.25;
}

.panel { min-width: 0; }

.analyzer-panel {
  width: min(100%, 1040px);
  margin: 50px 0 0 auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-tool);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(24px) saturate(120%);
}

.panel-heading, .history-heading, .section-heading, .email-input-header, .input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 24px; font-weight: 650; line-height: 1.2; letter-spacing: 0; }
h3 { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.35; letter-spacing: 0; }

.segmented-control {
  min-width: 280px;
  display: grid;
  grid-template-columns: repeat(2, minmax(128px, 1fr));
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-muted);
}

.segment {
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.segment.active { color: var(--text); background: var(--surface-raised); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14); }
.segment:active { transform: scale(0.98); }

.input-pane { margin-top: 24px; }
.field-label { display: inline-block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 600; }

.input-area {
  display: block;
  width: 100%;
  min-height: 176px;
  resize: vertical;
  padding: 18px 19px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: color-mix(in srgb, var(--page) 82%, var(--surface));
  font-family: inherit;
  font-size: 15px;
  line-height: 1.65;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
.email-area { min-height: 228px; font-family: "SFMono-Regular", "Cascadia Code", Consolas, monospace; font-size: 12px; }
.input-area:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); background: var(--surface-raised); }
.input-area::placeholder { color: color-mix(in srgb, var(--muted) 74%, transparent); }

.secondary-button, .primary-button {
  min-height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 19px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.secondary-button { background: transparent; }
.secondary-button:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.primary-button { min-width: 152px; background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.primary-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.secondary-button:active, .primary-button:active { transform: scale(0.98); }
.primary-button:disabled { opacity: 0.56; cursor: progress; }

.drop-zone.dragging .input-area { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.file-line { min-height: 36px; margin-top: 10px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.file-line > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input-footer { margin-top: 16px; }
.character-count { color: var(--muted); font-size: 11px; }
.inline-error { margin: 11px 0 0; color: var(--high); font-size: 12px; }

.spinner { width: 15px; height: 15px; border: 2px solid color-mix(in srgb, currentColor 35%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.telemetry-row {
  width: min(100%, 1040px);
  margin: 18px 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.telemetry-row > div { min-width: 0; padding: 15px 18px; border-right: 1px solid var(--border); }
.telemetry-row > div:last-child { border-right: 0; }
.telemetry-row dt { color: var(--muted); font-size: 9px; font-weight: 650; }
.telemetry-row dd { margin: 5px 0 0; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }

.results-stage {
  --page: var(--stage-bg);
  --surface: var(--stage-surface);
  --surface-raised: var(--stage-raised);
  --surface-muted: var(--stage-muted-surface);
  --border: var(--stage-border);
  --border-strong: var(--stage-border-strong);
  --text: var(--stage-text);
  --muted: var(--stage-muted);
  --high: var(--stage-high);
  --high-bg: var(--stage-high-bg);
  --medium: var(--stage-medium);
  --medium-bg: var(--stage-medium-bg);
  --low: var(--stage-low);
  --low-bg: var(--stage-low-bg);
  min-height: 58vh;
  padding: 112px 0 124px;
  background: var(--page);
  color: var(--text);
}

.stage-heading {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.stage-heading h2 { font-size: 44px; line-height: 1.05; }
.stage-heading > span { color: var(--muted); font-size: 10px; }

.workspace {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 24px;
}
.workspace:not(:has(.result-panel:not(.hidden))) { grid-template-columns: minmax(0, 760px); justify-content: center; }
.workspace:not(:has(.result-panel:not(.hidden))) .main-column { display: none; }
.main-column { min-width: 0; }

.result-panel, .history-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-tool);
  background: var(--surface);
}
.result-panel { padding: 30px; }

.result-banner {
  min-height: 142px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface-muted);
}
.result-banner.high { background: var(--high-bg); }
.result-banner.medium { background: var(--medium-bg); }
.result-banner.low { background: var(--low-bg); }
.result-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); }
.result-icon svg { width: 26px; height: 26px; }
.result-banner.high .result-icon, .result-banner.high h2 { color: var(--high); }
.result-banner.medium .result-icon, .result-banner.medium h2 { color: var(--medium); }
.result-banner.low .result-icon, .result-banner.low h2 { color: var(--low); }
.result-title-block p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.score-block { min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.score-block span { font-size: 42px; font-weight: 650; }
.score-block small { color: var(--muted); font-size: 11px; }

.result-meta { min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 11px 4px 0; color: var(--muted); font-size: 10px; }
.result-section, .email-summary { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--border); }
.section-heading span { color: var(--muted); font-size: 10px; }

.email-summary dl {
  margin: 15px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--border);
}
.summary-item { min-width: 0; padding: 15px; background: var(--surface-muted); }
.summary-item dt { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 650; text-transform: uppercase; }
.summary-item dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }

.evidence-list { margin-top: 15px; display: grid; gap: 8px; }
.evidence-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 50px;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--surface-muted);
}
.evidence-source { color: var(--muted); font-size: 9px; font-weight: 650; text-transform: uppercase; }
.evidence-copy strong { display: block; font-size: 12px; line-height: 1.4; }
.evidence-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.evidence-score { text-align: right; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.evidence-score.positive { color: var(--high); }
.evidence-score.negative { color: var(--low); }
.no-evidence { padding: 28px 0; color: var(--muted); font-size: 13px; text-align: center; }

.recommendation-list { margin: 15px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.recommendation-list li { position: relative; padding-left: 24px; font-size: 13px; line-height: 1.55; }
.recommendation-list li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 11px; height: 1px; background: var(--accent); }

.feedback-verdicts { margin-top: 15px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.feedback-verdict {
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.feedback-verdict:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.feedback-verdict.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.feedback-verdict:active { transform: scale(0.98); }
.feedback-verdict:disabled { opacity: 0.4; cursor: not-allowed; }
.feedback-form, .feedback-preview { margin-top: 20px; }
.feedback-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feedback-fields label, .feedback-notes-label { min-width: 0; color: var(--muted); font-size: 10px; font-weight: 650; }
.feedback-fields label > span, .feedback-notes-label > span { display: block; margin-bottom: 7px; }
.feedback-fields select, .feedback-notes-label textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--text);
  background: var(--surface-muted);
}
.feedback-fields select { height: 44px; padding: 0 12px; }
.feedback-notes-label { display: block; margin-top: 14px; }
.feedback-notes-label textarea { min-height: 82px; resize: vertical; padding: 11px 12px; font-size: 12px; line-height: 1.5; }
.consent-row { margin-top: 14px; display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.consent-row input { width: 17px; height: 17px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.feedback-actions { margin-top: 16px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.feedback-preview-grid { margin: 15px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 14px; background: var(--border); }
.feedback-preview-grid > div { min-width: 0; padding: 12px; background: var(--surface-muted); }
.feedback-preview-grid dt { color: var(--muted); font-size: 9px; font-weight: 650; text-transform: uppercase; }
.feedback-preview-grid dd { margin: 5px 0 0; font-size: 11px; overflow-wrap: anywhere; }
.sanitized-preview { margin-top: 14px; }
.sanitized-preview > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 650; }
.sanitized-preview pre { max-height: 230px; margin: 0; overflow: auto; padding: 14px; border-radius: 14px; background: var(--surface-muted); color: var(--text); font: 11px/1.55 "SFMono-Regular", "Cascadia Code", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-notice { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.feedback-success { margin: 16px 0 0; padding: 11px 13px; border-radius: 10px; background: var(--low-bg); color: var(--low); font-size: 12px; }

.history-panel { position: sticky; top: 96px; padding: 24px; max-height: calc(100vh - 120px); overflow: auto; }
.history-heading { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.history-list { display: grid; gap: 9px; margin-top: 14px; }
.history-item { min-width: 0; padding: 13px 14px; border-radius: 12px; background: var(--surface-muted); }
.history-item.high { box-shadow: inset 3px 0 0 var(--high); }
.history-item.medium { box-shadow: inset 3px 0 0 var(--medium); }
.history-item.low { box-shadow: inset 3px 0 0 var(--low); }
.history-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 650; }
.history-score { color: var(--muted); font-variant-numeric: tabular-nums; }
.history-summary { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.history-time { margin-top: 8px; color: var(--muted); font-size: 9px; }
.empty-history { margin: 32px 0 14px; color: var(--muted); font-size: 12px; text-align: center; }
.feedback-data { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.feedback-data .section-heading > span { font-weight: 650; font-variant-numeric: tabular-nums; }
.feedback-data > p { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.feedback-data-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 7px; }
.feedback-data-actions button:disabled { opacity: 0.32; cursor: not-allowed; }

.app-footer {
  min-height: 220px;
  padding: 58px max(24px, calc((100% - var(--max-width)) / 2));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  background: var(--page);
  color: var(--text);
  border-top: 1px solid var(--border);
}
.app-footer strong { font-size: 32px; font-weight: 700; }
.app-footer p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.footer-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 24px; color: var(--muted); font-size: 10px; }

.motion-ready [data-reveal] {
  opacity: 0;
  filter: blur(7px);
  transform: translateY(18px) scale(0.995);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), filter 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.motion-ready [data-reveal].is-visible { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }

.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .workspace:not(:has(.result-panel:not(.hidden))) { grid-template-columns: minmax(0, 760px); }
  .history-panel { position: static; max-height: none; }
}

@media (max-width: 900px) {
  .header-inner, .hero-frame, .stage-heading, .workspace { width: min(100% - 32px, var(--max-width)); }
  .header-nav { display: none; }
  .header-inner { grid-template-columns: 1fr auto; }
  .hero-frame { padding-top: 118px; }
  .hero h1 { font-size: 80px; }
  .hero-copy > p { font-size: 24px; }
  .analyzer-panel { margin-top: 40px; }
  .stage-heading h2 { font-size: 38px; }
}

@media (max-width: 640px) {
  .app-header { height: 64px; }
  .header-inner, .hero-frame, .stage-heading, .workspace { width: min(100% - 24px, var(--max-width)); }
  .brand img { width: 34px; height: 34px; }
  .brand-copy span { display: none; }
  .service-status { display: none; }
  .hero { min-height: calc(100svh - 24px); }
  .hero-frame { padding: 96px 0 12px; }
  .hero h1 { margin-top: 13px; font-size: 56px; }
  .hero-copy > p { margin-top: 14px; font-size: 20px; }
  .hero-overline { font-size: 10px; }
  .analyzer-panel { margin-top: 28px; padding: 20px; border-radius: 18px; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .segmented-control { width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segment { min-width: 0; }
  .input-pane { margin-top: 18px; }
  .input-area { min-height: 150px; padding: 15px; font-size: 14px; border-radius: 14px; }
  .email-area { min-height: 196px; }
  .telemetry-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .telemetry-row > div:nth-child(2) { border-right: 0; }
  .telemetry-row > div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .results-stage { padding: 78px 0 84px; }
  .stage-heading { align-items: flex-start; margin-bottom: 26px; }
  .stage-heading h2 { font-size: 32px; }
  .stage-heading > span { margin-top: 4px; }
  .result-panel, .history-panel { border-radius: 18px; }
  .result-panel { padding: 18px; }
  .history-panel { padding: 20px; }
  .result-banner { grid-template-columns: 42px minmax(0, 1fr); gap: 13px; padding: 18px; }
  .result-icon { width: 42px; height: 42px; }
  .score-block { grid-column: 2; min-width: 0; text-align: left; }
  .score-block span { font-size: 30px; }
  .email-summary dl { grid-template-columns: 1fr 1fr; }
  .evidence-row { grid-template-columns: 72px minmax(0, 1fr) 40px; gap: 8px; padding: 11px; }
  .feedback-preview-grid { grid-template-columns: 1fr 1fr; }
  .app-footer { min-height: 180px; padding: 44px 18px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 48px; }
  .hero-ready { display: none; }
  .input-footer { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .telemetry-row > div { padding: 12px; }
  .stage-heading > span { display: none; }
  .email-input-header { align-items: flex-start; }
  .email-summary dl { grid-template-columns: 1fr; }
  .feedback-verdicts, .feedback-fields, .feedback-preview-grid { grid-template-columns: 1fr; }
  .feedback-actions { align-items: stretch; flex-direction: column-reverse; }
  .feedback-actions .secondary-button { width: 100%; }
  .app-footer { align-items: flex-start; flex-direction: column; }
  .footer-meta { justify-content: flex-start; }
}

@media (max-width: 360px) {
  .telemetry-row { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .motion-ready [data-reveal] { opacity: 1; filter: none; transform: none; }
}
