:root {
  color-scheme: dark;
  --bg: #07090b;
  --bg-2: #0b0e11;
  --panel: #111418;
  --panel-soft: #171b20;
  --panel-raised: #1a1f25;
  --ink: #eef2f4;
  --ink-soft: #c8d0d6;
  --muted: #7d8992;
  --border: #242a31;
  --border-strong: #343c45;
  --accent: #58b8a9;
  --accent-strong: #77d5c6;
  --accent-soft: rgba(88, 184, 169, 0.12);
  --amber: #d6a84f;
  --amber-soft: rgba(214, 168, 79, 0.13);
  --red: #f07065;
  --red-soft: rgba(240, 112, 101, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-2: #e9edf1;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --panel-raised: #ffffff;
  --ink: #111820;
  --ink-soft: #34414d;
  --muted: #6c7783;
  --border: #d9e0e6;
  --border-strong: #c7d0d8;
  --accent: #0f8178;
  --accent-strong: #0b6e67;
  --accent-soft: rgba(15, 129, 120, 0.1);
  --amber: #9a6700;
  --amber-soft: rgba(154, 103, 0, 0.1);
  --red: #b42318;
  --red-soft: rgba(180, 35, 24, 0.09);
  --shadow: 0 22px 60px rgba(17, 24, 32, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(88, 184, 169, 0.08), transparent 34rem),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 720;
  letter-spacing: 0;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}

.topbar,
.workspace {
  width: min(1560px, 100%);
  margin: 0 auto;
}

.topbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.2fr) minmax(260px, auto);
  align-items: center;
  gap: 16px;
  min-height: 58px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: var(--shadow);
  padding: 10px 12px;
}

.brand-lockup,
.topbar-actions,
.status-pill,
.topbar-center,
.module-header {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background:
    linear-gradient(135deg, transparent 0 37%, var(--accent) 38% 48%, transparent 49%),
    linear-gradient(45deg, transparent 0 42%, var(--ink-soft) 43% 51%, transparent 52%),
    var(--panel-raised);
}

.kicker,
.label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.15;
}

.topbar-center {
  justify-content: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.topbar-center span {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 8px;
}

.status-pill,
.badge {
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  padding: 7px 10px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: var(--border);
  background: var(--panel-soft);
  color: var(--ink-soft);
}

.theme-icon {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 999px;
  box-shadow: inset 6px -5px 0 currentColor;
}

.help-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

[data-theme="light"] .theme-icon {
  box-shadow: inset -5px -5px 0 transparent;
}

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.74fr) minmax(430px, 1.46fr) minmax(300px, 0.88fr);
  gap: 12px;
}

.panel {
  display: flex;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
}

.panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 14px;
}

.primary-button {
  background: var(--accent);
  color: #061110;
}

[data-theme="light"] .primary-button {
  color: #fff;
}

.secondary-button {
  border-color: var(--border);
  background: var(--panel-soft);
  color: var(--ink-soft);
}

.approve-button {
  background: var(--accent);
  color: #061110;
}

[data-theme="light"] .approve-button {
  color: #fff;
}

.danger-button {
  border-color: color-mix(in srgb, var(--red) 45%, var(--border));
  background: var(--red-soft);
  color: var(--red);
}

.queue-filters {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 10px;
}

.queue-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.queue-filter span {
  color: var(--muted);
  font-size: 0.76rem;
}

.queue-filter.active {
  border-color: var(--border);
  background: var(--panel-soft);
  color: var(--ink);
}

.email-card,
.result-pane,
.review-box,
.timeline-module,
.sidebar-note,
.review-copy {
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.email-card {
  flex: 1 1 auto;
  min-height: 0;
  margin: 12px;
  overflow: auto;
  border-radius: 7px;
  padding: 14px;
}

.empty {
  display: grid;
  place-items: center;
  text-align: center;
}

.muted {
  color: var(--muted);
}

.email-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.email-subject {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.2;
}

.email-body {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.65;
}

.email-skeleton {
  display: grid;
  gap: 14px;
}

.email-skeleton span {
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--panel-raised), var(--border), var(--panel-raised));
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
}

.email-skeleton span:nth-child(1) {
  width: 54%;
}

.email-skeleton span:nth-child(2) {
  width: 82%;
  height: 18px;
  margin-top: 10px;
}

.email-skeleton span:nth-child(3) {
  width: 96%;
}

.email-skeleton span:nth-child(4) {
  width: 74%;
}

.sidebar-note {
  flex: 0 0 auto;
  margin: 0 12px 12px;
  border-radius: 7px;
  padding: 12px;
}

.sidebar-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.evidence-panel {
  gap: 12px;
  padding-bottom: 12px;
}

.evidence-panel > .panel-header {
  margin-bottom: 0;
}

.result-pane {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 12px;
  overflow: auto;
  border-radius: 7px;
  padding: 14px;
}

.result-grid {
  display: grid;
  gap: 12px;
}

.info-block {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.info-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.step-block {
  animation: step-in 180ms ease-out both;
}

.pending-block {
  color: var(--muted);
}

.stream-log {
  display: grid;
  gap: 7px;
  max-height: 120px;
  margin-top: 12px;
  overflow: auto;
}

.stream-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.stream-line span {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.info-block h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.84rem;
}

.info-block h4 {
  margin: 12px 0 6px;
  color: var(--ink);
  font-size: 0.8rem;
}

.info-block p,
.info-block li {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.info-block ul {
  margin-bottom: 0;
  padding-left: 18px;
}

.step-note {
  margin-top: 10px;
  color: var(--muted);
}

.typewriter-line::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: -0.16em;
  animation: cursor-blink 0.8s steps(2, start) infinite;
}

.timeline-module {
  flex: 0 0 auto;
  margin: 0 12px;
  overflow: hidden;
  border-radius: 7px;
}

.module-header {
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}

.module-header .label {
  margin: 0;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
}

.timeline li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-right: 1px solid var(--border);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline li:last-child {
  border-right: 0;
}

.timeline span {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
}

.timeline li.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.timeline li.active span {
  border-color: var(--accent);
  background: var(--accent);
}

.timeline li.running {
  background: var(--amber-soft);
  color: var(--amber);
}

.timeline li.running span {
  border-color: var(--amber);
  background: var(--amber);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip,
.citation-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-raised);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 760;
}

.chip {
  padding: 5px 8px;
}

.citation-button {
  min-height: 26px;
  margin-right: 8px;
  padding: 0 9px;
  color: var(--accent-strong);
  vertical-align: baseline;
}

.metric-bars {
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
}

.metric-bar {
  display: grid;
  gap: 6px;
}

.metric-bar-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.metric-bar-label span,
.metric-bar-label strong {
  overflow-wrap: anywhere;
}

.metric-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-raised);
}

.metric-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.decision-panel {
  gap: 12px;
  padding-bottom: 12px;
}

.review-badge {
  color: var(--amber);
}

.review-copy {
  margin: 0 12px;
  border-radius: 7px;
  padding: 12px;
}

.review-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.review-box {
  flex: 0 0 auto;
  margin: 0 12px;
  border-radius: 7px;
  padding: 12px;
}

textarea {
  width: 100%;
  min-height: 94px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  padding: 10px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.45;
  outline: none;
}

textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.metrics-strip {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: auto 12px 0;
}

.metrics-strip div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-soft);
  padding: 12px;
}

.metrics-strip p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metrics-strip strong {
  color: var(--ink);
  font-size: 1.32rem;
  line-height: 1;
}

.handoff-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.handoff-events {
  display: grid;
  gap: 9px;
  margin: 12px 0 14px;
  padding: 0;
  list-style: none;
}

.handoff-event {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-raised);
  padding: 11px;
  opacity: 0.5;
  transform: translateY(5px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.handoff-event.complete {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  opacity: 1;
  transform: translateY(0);
}

.event-time {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}

.event-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.event-heading strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.event-heading span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 3px 7px;
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 800;
}

.handoff-event p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.handoff-card {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-raised);
  padding: 12px;
}

.handoff-card p {
  margin-bottom: 8px;
}

.handoff-card pre {
  white-space: pre-wrap;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 10px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

.handoff-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.handoff-meta span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 4px 8px;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 760;
}

.document-drawer {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.48);
  padding: 16px;
  z-index: 20;
}

.document-drawer.open {
  display: flex;
}

.document-panel {
  width: min(620px, 100%);
  height: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.document-disclaimer {
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--border));
  border-radius: 7px;
  background: var(--amber-soft);
  padding: 10px;
  color: var(--amber);
  font-size: 0.84rem;
  font-weight: 700;
}

.document-content {
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-soft);
  padding: 14px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.6;
}

.intro-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.56);
  padding: 18px;
  z-index: 30;
}

.intro-modal.open {
  display: flex;
}

.intro-panel {
  width: min(560px, 100%);
  max-height: min(720px, 100%);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: modal-in 180ms ease-out both;
}

.intro-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.intro-panel > p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.intro-steps {
  display: grid;
  gap: 9px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.intro-steps li {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-soft);
  padding: 12px;
}

.intro-steps strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.intro-steps span,
.intro-note {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.intro-note {
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--border));
  border-radius: 7px;
  background: var(--amber-soft);
  padding: 10px;
  color: var(--amber);
  font-weight: 700;
}

.intro-panel .primary-button {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

@keyframes cursor-blink {
  50% {
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-center {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .panel {
    min-height: auto;
    overflow: visible;
  }

  .email-card,
  .result-pane {
    max-height: 68vh;
  }

  .timeline {
    grid-template-columns: repeat(7, minmax(150px, 1fr));
  }

  .metrics-strip {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  body {
    background: var(--bg);
  }

  .app-shell {
    gap: 10px;
    padding: 10px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    min-height: 0;
    margin-bottom: 0;
    padding: 10px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .kicker,
  .label {
    font-size: 0.62rem;
  }

  h1 {
    font-size: 1rem;
  }

  h2 {
    font-size: 0.96rem;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .status-pill {
    display: none;
  }

  .icon-button {
    width: 38px;
    min-height: 38px;
  }

  .workspace {
    gap: 10px;
  }

  .panel {
    border-radius: 7px;
  }

  .panel-header,
  .document-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .topbar-center {
    display: none;
  }

  .panel-header button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .queue-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .queue-filter {
    justify-content: center;
    gap: 8px;
    padding-inline: 10px;
    min-width: 0;
    font-size: 0.78rem;
  }

  .email-card,
  .result-pane,
  .review-box,
  .review-copy,
  .timeline-module,
  .sidebar-note,
  .metrics-strip {
    margin-left: 10px;
    margin-right: 10px;
  }

  .email-card {
    min-height: 220px;
    max-height: none;
  }

  .result-pane {
    min-height: 260px;
    max-height: none;
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .timeline li {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 11px 10px;
  }

  .timeline li:nth-last-child(-n + 1) {
    border-bottom: 0;
  }

  .timeline li:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .badge {
    align-self: flex-start;
  }

  .review-copy p,
  .info-block p,
  .info-block li,
  .email-body {
    font-size: 0.9rem;
  }

  textarea {
    min-height: 112px;
    font-size: 1rem;
  }

  .review-actions {
    grid-template-columns: 1fr;
  }

  .review-actions button {
    min-height: 44px;
  }

  .handoff-event {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .metrics-strip div {
    padding: 11px;
  }

  .document-drawer {
    padding: 10px;
  }

  .document-panel {
    width: 100%;
    border-radius: 7px;
    padding: 12px;
  }

  .document-content {
    font-size: 0.8rem;
  }

  .intro-modal {
    align-items: flex-end;
    padding: 10px;
  }

  .intro-panel {
    max-height: calc(100vh - 20px);
    border-radius: 7px;
    padding: 14px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 8px;
  }

  .topbar {
    border-radius: 0;
    margin: -8px -8px 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
  }

  .panel {
    border-radius: 6px;
  }

  .email-card,
  .result-pane,
  .review-box,
  .review-copy,
  .timeline-module,
  .sidebar-note,
  .metrics-strip {
    margin-left: 8px;
    margin-right: 8px;
  }

  .timeline {
    grid-template-columns: 1fr;
  }

  .timeline li:nth-child(odd) {
    border-right: 0;
  }

  .timeline li:last-child {
    border-bottom: 0;
  }
}
