/* ─── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  --bg:           #f7f7f5;
  --white:        #ffffff;
  --surface-2:    #f0f0ed;
  --ink:          #0f0f0f;
  --ink-2:        #3a3a3a;
  --muted:        #9a9a9a;
  --border:       #e8e8e4;
  --border-2:     #d4d4ce;
  --accent:       #1a6b4a;
  --accent-mid:   #2d8a60;
  --accent-light: #e8f5ee;
  --danger:       #c0392b;
  --danger-light: #fdf0ee;
  --warn:         #b7770d;
  --warn-light:   #fdf6e3;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.10);
  --radius:       16px;
  --radius-sm:    10px;
  --radius-lg:    24px;
  --transition:   0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Focus Styles (Accessibility) ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible { border-radius: var(--radius-sm); }

/* ─── App Shell ──────────────────────────────────────────────────────────── */
.app {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 16px 80px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 40px; height: 40px;
  background: var(--ink);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
.brand-tag  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.hist-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  font-family: 'Sora', sans-serif;
  transition: all var(--transition);
}
.hist-btn:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); }
.hist-btn:active { background: var(--bg); }
.hist-count {
  background: var(--ink); color: #fff;
  border-radius: 99px; padding: 1px 7px;
  font-size: 10px; font-weight: 700;
  display: none;
}
.hist-count.on { display: inline-block; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.layout { flex: 1; display: flex; flex-direction: column; }
.panel-left, .panel-right { width: 100%; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 0 0 24px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-light); color: var(--accent);
  border-radius: 99px; padding: 5px 14px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}
.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: 36px; font-weight: 400;
  line-height: 1.12; letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.tab {
  padding: 11px;
  border-radius: 10px; border: none;
  background: transparent;
  font-family: 'Sora', sans-serif;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.tab.on { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.tab:hover:not(.on) { color: var(--ink-2); }

/* ─── Input Stack ────────────────────────────────────────────────────────── */
.input-stack { display: flex; flex-direction: column; gap: 10px; }

/* Upload Zone */
.upload-zone {
  background: var(--white);
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.upload-zone:hover { border-color: var(--accent); border-style: solid; background: var(--accent-light); }
.upload-zone.loaded { border-color: var(--accent); border-style: solid; }
.upload-zone input {
  position: absolute; inset: 0;
  opacity: 0; width: 100%; height: 100%;
  cursor: pointer; z-index: 5;
}
.upload-icon-wrap {
  width: 54px; height: 54px;
  background: var(--bg);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 24px;
  border: 1px solid var(--border);
}
.upload-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.upload-sub   { font-size: 13px; color: var(--muted); }
.upload-preview { display: none; }
.upload-preview.on { display: block; }
.upload-default.off { display: none; }
.preview-img {
  width: 100%; max-height: 200px;
  object-fit: cover; border-radius: 12px;
  margin-bottom: 12px; display: block;
}
.preview-footer { display: flex; align-items: center; justify-content: space-between; }
.preview-label { font-size: 12px; font-weight: 600; color: var(--accent); }
.remove-btn {
  font-size: 12px; color: var(--danger);
  background: var(--danger-light); border: none;
  border-radius: 8px; padding: 8px 12px;
  cursor: pointer; font-family: 'Sora', sans-serif; font-weight: 500;
  transition: all var(--transition);
  position: relative; z-index: 10;
  min-height: 44px; min-width: 44px;
}
.remove-btn:hover { background: var(--danger); color: #fff; }

/* Mic Zone */
.mic-zone {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.mic-zone.recording { border-color: var(--danger); background: var(--danger-light); }
.mic-row { display: flex; align-items: center; gap: 14px; }
.mic-btn {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
  transition: all var(--transition); flex-shrink: 0;
}
.mic-btn.recording {
  background: var(--danger); border-color: var(--danger);
  animation: mic-pulse 1.5s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.35); }
  50%      { box-shadow: 0 0 0 12px rgba(192,57,43,0); }
}
.mic-info { flex: 1; min-width: 0; }
.mic-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.mic-sub   { font-size: 12px; color: var(--muted); line-height: 1.4; }
.mic-sub.rec { color: var(--danger); }
.mic-timer {
  font-size: 18px; font-weight: 700; color: var(--danger);
  display: none; font-variant-numeric: tabular-nums;
}
.mic-timer.on { display: block; }
.waveform {
  display: none; align-items: center; justify-content: center;
  gap: 3px; height: 22px; margin-top: 12px;
}
.waveform.on { display: flex; }
.w-bar {
  width: 3px; border-radius: 99px;
  background: var(--danger);
  animation: wave 0.7s ease-in-out infinite;
  height: 4px;
}
.w-bar:nth-child(2) { animation-delay: .08s; }
.w-bar:nth-child(3) { animation-delay: .16s; }
.w-bar:nth-child(4) { animation-delay: .24s; }
.w-bar:nth-child(5) { animation-delay: .32s; }
.w-bar:nth-child(6) { animation-delay: .24s; }
.w-bar:nth-child(7) { animation-delay: .16s; }
.w-bar:nth-child(8) { animation-delay: .08s; }
@keyframes wave {
  0%,100% { height: 3px; }
  50%      { height: 18px; }
}

/* Error */
.error-msg {
  background: var(--danger-light);
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px; color: var(--danger);
  display: none; font-weight: 500; line-height: 1.5;
}
.error-msg.on { display: block; }

/* Analyze Button */
.btn-analyze {
  width: 100%; padding: 17px;
  background: var(--ink); color: #fff;
  border: none; border-radius: var(--radius);
  font-family: 'Sora', sans-serif;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(15,15,15,0.18);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-analyze:hover { background: #1a1a1a; box-shadow: 0 6px 24px rgba(15,15,15,0.25); transform: translateY(-1px); }
.btn-analyze:active { transform: scale(0.98); box-shadow: none; }
.btn-analyze:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-arrow { transition: transform var(--transition); }
.btn-analyze:hover .btn-arrow { transform: translateX(3px); }

/* ─── Loading ─────────────────────────────────────────────────────────────── */
.loading {
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px; gap: 28px;
}
.loading.on { display: flex; }
.loader-ring {
  width: 68px; height: 68px; position: relative; flex-shrink: 0;
}
.loader-ring::before {
  content: ''; position: absolute; inset: 0;
  border: 2.5px solid var(--border);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loader-ring::after {
  content: ''; position: absolute; inset: 10px;
  border: 2px solid var(--border);
  border-bottom-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-emoji {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.load-steps {
  display: flex; flex-direction: column;
  gap: 12px; width: 100%; max-width: 230px;
}
.load-step-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--border-2); font-weight: 500;
  transition: color 0.35s;
}
.load-step-item.done   { color: var(--accent); }
.load-step-item.active { color: var(--ink); }
.step-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}

/* ─── Result ─────────────────────────────────────────────────────────────── */
.result { display: none; animation: fade-up 0.35s ease; }
.result.on { display: block; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Verdict Card */
.verdict-card {
  border-radius: var(--radius-lg);
  padding: 24px 20px; margin-bottom: 12px;
  border: 1.5px solid;
}
.verdict-card.green  { background: var(--accent-light); border-color: rgba(26,107,74,0.2); }
.verdict-card.red    { background: var(--danger-light); border-color: rgba(192,57,43,0.2); }
.verdict-card.yellow { background: var(--warn-light);   border-color: rgba(183,119,13,0.2); }
.verdict-card.gray   { background: var(--bg);           border-color: var(--border); }

.verdict-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.verdict-icon { font-size: 32px; }
.conf-pill {
  border-radius: 99px; padding: 4px 12px;
  font-size: 11px; font-weight: 700;
}
.verdict-card.green  .conf-pill { background: rgba(26,107,74,0.12);  color: var(--accent); }
.verdict-card.red    .conf-pill { background: rgba(192,57,43,0.12); color: var(--danger); }
.verdict-card.yellow .conf-pill { background: rgba(183,119,13,0.12); color: var(--warn); }
.verdict-card.gray   .conf-pill { background: rgba(0,0,0,0.06);      color: var(--muted); }

.verdict-label {
  font-family: 'Instrument Serif', serif;
  font-size: 30px; font-weight: 400; line-height: 1.1; margin-bottom: 4px;
}
.verdict-card.green  .verdict-label { color: var(--accent); }
.verdict-card.red    .verdict-label { color: var(--danger); }
.verdict-card.yellow .verdict-label { color: var(--warn); }
.verdict-card.gray   .verdict-label { color: var(--muted); }
.verdict-mode {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; opacity: 0.5;
}
.verdict-card.green  .verdict-mode { color: var(--accent); }
.verdict-card.red    .verdict-mode { color: var(--danger); }
.verdict-card.yellow .verdict-mode { color: var(--warn); }

/* Confidence Bar */
.conf-track {
  height: 4px; background: var(--border);
  border-radius: 99px; overflow: hidden; margin-bottom: 14px;
}
.conf-fill {
  height: 100%; border-radius: 99px;
  width: 0; transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.conf-fill.green  { background: var(--accent); }
.conf-fill.red    { background: var(--danger); }
.conf-fill.yellow { background: var(--warn); }
.conf-fill.gray   { background: var(--muted); }

/* Extracted Pill */
.extracted-pill {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 10px;
  display: none; border-left: 3px solid var(--accent);
}
.extracted-pill.on { display: block; }
.extracted-tag {
  font-size: 10px; font-weight: 700; color: var(--accent);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px;
}
.extracted-text {
  font-size: 13px; color: var(--ink-2);
  line-height: 1.55; max-height: 80px; overflow: hidden;
}

/* Info Cards */
.info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.card-label {
  font-size: 10px; font-weight: 700;
  color: var(--muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px;
}
.card-body { font-size: 14px; line-height: 1.7; color: var(--ink-2); }

/* Signals */
.signals { list-style: none; }
.signal {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; line-height: 1.55; color: var(--ink-2);
}
.signal:last-child { border-bottom: none; }
.signal-pip {
  width: 6px; height: 6px; border-radius: 50%;
  margin-top: 5px; flex-shrink: 0;
}
.signal-pip.green  { background: var(--accent); }
.signal-pip.red    { background: var(--danger); }
.signal-pip.yellow { background: var(--warn); }

/* Sources */
.source-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.source-item:last-child { border-bottom: none; }
.source-num {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent-light); color: var(--accent);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.source-title   { font-size: 13px; color: var(--ink); font-weight: 500; margin-bottom: 3px; }
.source-finding { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* Warning */
.warning-card {
  background: var(--warn-light);
  border: 1px solid rgba(183,119,13,0.2);
  border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
  display: none;
}
.warning-card.on { display: block; }
.warning-label {
  font-size: 10px; font-weight: 700;
  color: var(--warn); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 6px;
}
.warning-text { font-size: 13px; color: var(--ink-2); line-height: 1.65; }

/* Action Buttons */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.btn-share {
  padding: 13px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 2px 10px rgba(26,107,74,0.22);
}
.btn-share:hover { background: var(--accent-mid); transform: translateY(-1px); }
.btn-share:active { transform: scale(0.97); }
.btn-new {
  padding: 13px;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--shadow-sm);
}
.btn-new:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); }
.btn-new:active { background: var(--bg); }

/* Report Button — prominent */
.btn-report {
  width: 100%; padding: 13px;
  background: var(--danger-light);
  color: var(--danger);
  border: 1.5px solid rgba(192,57,43,0.25);
  border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-report:hover {
  background: var(--danger); color: #fff;
  border-color: var(--danger);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(192,57,43,0.2);
}
.btn-report:active { transform: scale(0.98); }

/* ─── Result Empty State ──────────────────────────────────────────────────── */
.result-empty {
  display: none;
  text-align: center; padding: 80px 32px;
}
.result-empty-icon { font-size: 48px; margin-bottom: 16px; display: block; }
.result-empty-title {
  font-family: 'Instrument Serif', serif;
  font-size: 24px; color: var(--ink-2); margin-bottom: 8px;
}
.result-empty-sub { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ─── Sheets & Overlay ───────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15,15,15,0.45);
  z-index: 100; display: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.overlay.on { display: block; animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 480px; margin: 0 auto;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border);
  max-height: 84dvh; overflow-y: auto;
  z-index: 101;
  padding: 0 20px 52px;
  display: none;
  animation: slide-up 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
}
.sheet.on { display: block; }
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border); border-radius: 99px;
  margin: 14px auto 22px;
}
.sheet-title {
  font-family: 'Instrument Serif', serif;
  font-size: 26px; margin-bottom: 4px;
}
.sheet-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* ─── History Sheet ──────────────────────────────────────────────────────── */
.h-empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.h-empty-icon { font-size: 38px; display: block; margin-bottom: 12px; }
.h-empty-title { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.h-empty-sub { font-size: 13px; }
.h-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px; margin-bottom: 8px;
  cursor: pointer; transition: all var(--transition);
}
.h-item:hover { border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.h-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.h-pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.h-pill.green  { background: var(--accent-light); color: var(--accent); }
.h-pill.red    { background: var(--danger-light);  color: var(--danger); }
.h-pill.yellow { background: var(--warn-light);    color: var(--warn); }
.h-pill.gray   { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.h-time { font-size: 11px; color: var(--muted); }
.h-meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.h-preview {
  font-size: 13px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.h-reported { font-size: 11px; color: var(--danger); margin-top: 5px; font-weight: 500; }
.btn-clear {
  width: 100%; padding: 13px;
  background: transparent; color: var(--danger);
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; margin-top: 8px; transition: all var(--transition);
}
.btn-clear:hover { background: var(--danger-light); }

/* ─── Report Sheet ───────────────────────────────────────────────────────── */
.report-title {
  font-family: 'Instrument Serif', serif;
  font-size: 24px; margin-bottom: 6px;
}
.report-sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; line-height: 1.6; }
.report-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.report-opt {
  padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--ink);
  cursor: pointer; text-align: left;
  font-family: 'Sora', sans-serif;
  transition: all var(--transition); line-height: 1.4;
}
.report-opt:hover { border-color: var(--border-2); background: var(--white); }
.report-opt.selected {
  border-color: var(--danger);
  background: var(--danger-light); color: var(--danger);
}
.report-details {
  width: 100%; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif; font-size: 13px; color: var(--ink);
  resize: vertical; min-height: 80px; max-height: 160px;
  display: none; transition: border-color var(--transition);
  margin-bottom: 14px; line-height: 1.55;
}
.report-details.on { display: block; }
.report-details:focus { outline: none; border-color: var(--accent); }
.btn-submit {
  width: 100%; padding: 15px;
  background: var(--danger); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  margin-top: 4px;
}
.btn-submit:hover:not(:disabled) { background: #a93226; transform: translateY(-1px); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.35; cursor: not-allowed; }

/* Thank You Screen */
.report-thanks {
  display: none; text-align: center;
  padding: 40px 20px 24px;
  animation: fade-up 0.4s ease;
}
.report-thanks.on { display: block; }
.thanks-icon { font-size: 56px; margin-bottom: 20px; display: block; }
.thanks-title {
  font-family: 'Instrument Serif', serif;
  font-size: 30px; margin-bottom: 12px;
}
.thanks-body {
  font-size: 14px; color: var(--ink-2);
  line-height: 1.75; margin-bottom: 28px; max-width: 300px; margin-left: auto; margin-right: auto;
}
.btn-done {
  width: 100%; padding: 15px;
  background: var(--ink); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-done:hover { background: #1a1a1a; }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px;
  left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: #fff;
  padding: 11px 22px; border-radius: 99px;
  font-size: 13px; font-weight: 500;
  opacity: 0; transition: all 0.25s ease;
  z-index: 300; white-space: nowrap;
  pointer-events: none; box-shadow: var(--shadow-md);
  max-width: calc(100vw - 40px);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Desktop Layout (≥ 768px) ───────────────────────────────────────────── */
@media (min-width: 768px) {
  .app {
    max-width: 1140px;
    padding: 0 48px 80px;
  }

  header {
    padding: 28px 0 22px;
    margin-bottom: 32px;
  }

  .hist-btn { padding: 9px 20px; font-size: 14px; }

  .layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 48px;
    align-items: start;
  }

  .panel-left {
    position: sticky;
    top: 24px;
  }

  .hero { text-align: left; padding: 0 0 28px; }
  .hero-title { font-size: 42px; }

  .result-empty { display: block; }

  .loading {
    padding: 80px 20px;
    min-height: 480px;
  }

  .sheet { max-width: 520px; }
}

@media (min-width: 1024px) {
  .layout { grid-template-columns: 420px 1fr; gap: 56px; }
  .hero-title { font-size: 46px; }
}

/* ─── High Contrast Mode ─────────────────────────────────────────────────── */
@media (forced-colors: active) {
  .conf-fill, .live-dot, .step-dot { forced-color-adjust: none; }
  .btn-analyze, .btn-share, .btn-submit { border: 2px solid ButtonText; }
}
