:root {
  /* Official Duolingo Design Tokens (Light / Snow Default) */
  --snow: #ffffff;
  --polar: #f7f7f7;
  --swan: #e5e5e5;
  --hare: #afafaf;
  --wolf: #777777;
  --eel: #4b4b4b;

  --owl: #58cc02;
  --mask-green: #89e219;
  --tree-frog: #58a700;
  --owl-soft: #d7ffb8;

  --macaw: #1cb0f6;
  --macaw-lip: #1899d6;

  --cardinal: #ff4b4b;
  --fire-ant: #ea2b2b;
  --cardinal-soft: #ffdfe0;

  --bee: #ffc800;
  --bee-lip: #e5a400;
  --bee-soft: #fff5cc;

  --fox: #ff9600;
  --beetle: #ce82ff;

  --bg: var(--snow);
  --surface: var(--snow);
  --surface-sub: var(--polar);
  --border: var(--swan);
  --text: var(--eel);
  --muted: var(--wolf);
  --font-base: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.dark-mode {
  --bg: #131f24;
  --surface: #1b2b34;
  --surface-sub: #20333e;
  --border: #37464f;
  --text: #f7f9fa;
  --muted: #afafaf;
  --cardinal-soft: #2b1a1d;
  --bee-soft: #292214;
  --owl-soft: #1b3312;
}

body.large-text {
  --font-base: 19px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: var(--font-base);
}

body {
  margin: 0;
  font-family: "DIN Round", ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Myanmar", "Noto Sans Thai", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

/* Motion: settle from 0.95 -> 1 over 260ms (never scale from 0) */
@keyframes duoSettle {
  0% { opacity: 0; transform: scale(0.95) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes eqBounce {
  0%, 100% { height: 5px; }
  50% { height: 15px; }
}

@keyframes dotHop {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: 84px;
  position: relative;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 10px;
  border-bottom: 2px solid var(--border);
  background: var(--surface);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--tree-frog);
  line-height: 1.1;
}

.freshness-badge {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0;
  text-align: left;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.freshness-badge::before {
  content: "●";
  color: var(--owl);
  margin-right: 4px;
}

.freshness-badge.is-offline::before {
  color: var(--fox);
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-select,
.icon-pill {
  height: 38px;
  border-radius: 12px;
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
  transition: transform 0.1s var(--ease), border-bottom-color 0.1s var(--ease);
}

.icon-pill:active {
  transform: translateY(2px);
  border-bottom-color: transparent;
}

.screen {
  display: none;
  padding: 16px 20px 20px;
}

.screen.active {
  display: block;
  animation: duoSettle 0.26s var(--ease);
}

.hidden {
  display: none !important;
}

.toast {
  margin: 10px 20px 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--macaw);
  color: #ffffff;
  border-bottom: 4px solid var(--macaw-lip);
  font-size: 0.88rem;
  font-weight: 700;
  animation: duoSettle 0.22s var(--ease);
}

/* HOUSEHOLD PROFILE BAR */
.profile-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 2px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.profile-prefix {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
}

.profile-select {
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 5px 14px;
  cursor: pointer;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-bar .text-action {
  margin-left: auto;
  font-size: 0.78rem;
}

/* HERO CARD */
.hero-card {
  position: relative;
  background: var(--owl);
  color: #ffffff;
  border-radius: 20px;
  border-bottom: 5px solid var(--tree-frog);
  padding: 24px 20px 18px;
  margin-bottom: 16px;
}

.alerts-fab {
  position: fixed;
  right: 18px;
  bottom: 84px;
  width: 52px;
  height: 52px;
  border: 2px solid var(--tree-frog);
  border-bottom-width: 4px;
  border-radius: 999px;
  background: var(--owl);
  color: #ffffff;
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.alerts-fab:hover {
  background: var(--mask-green);
}

.alert-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--cardinal);
  color: #ffffff;
  border: 2px solid var(--owl);
  font-size: 0.62rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-card h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-card p {
  margin: 0 0 18px;
  font-size: 0.94rem;
  font-weight: 600;
  opacity: 0.95;
}

/* Tactile Duolingo button with zero-reflow 4px bottom lip */
.hero-scan-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border-radius: 16px;
  background: #ffffff;
  color: var(--tree-frog);
  border: 2px solid #ffffff;
  border-bottom: 4px solid #d7e8c8;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.1s var(--ease), border-bottom-color 0.1s var(--ease);
}

.hero-scan-btn:active {
  transform: translateY(4px);
  border-bottom-color: transparent;
}

.hero-status {
  margin: 8px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  min-height: 1.1em;
}

.hero-link {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  margin-top: 8px;
  cursor: pointer;
}

.hero-link-sub {
  margin-top: 2px;
  opacity: 0.85;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.78rem;
}

.profile-caution {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--bee);
  background: var(--bee-soft);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

/* TYPE FORM */
.type-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: duoSettle 0.24s var(--ease);
}

.type-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input[type="text"],
input[type="search"],
select {
  font-family: inherit;
}

.type-card input,
.filter-bar input,
.filter-bar select,
.chat-bar input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface-sub);
  color: var(--text);
  padding: 12px 16px;
  font-size: 0.94rem;
  font-weight: 600;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.type-card input:focus,
.filter-bar input:focus,
.chat-bar input:focus {
  outline: none;
  border-color: var(--macaw);
  box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.2);
}

.btn-row {
  display: flex;
  gap: 8px;
}

/* Primary (Owl Green #58CC02 + #58A700 4px lip + #89E219 hover) */
.btn-green {
  width: 100%;
  min-height: 50px;
  padding: 14px 24px;
  border-radius: 16px;
  border: none;
  border-bottom: 4px solid var(--tree-frog);
  background: var(--owl);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.1s var(--ease), border-bottom-color 0.1s var(--ease), background-color 0.15s;
}

.btn-green:hover {
  background: var(--mask-green);
}

.btn-green:active {
  transform: translateY(4px);
  border-bottom-color: transparent;
}

/* Secondary (White with 2px Swan border + 4px bottom lip) */
.btn-outline {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 16px;
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s var(--ease), border-bottom-color 0.1s var(--ease), color 0.15s, border-color 0.15s;
}

.btn-outline:hover {
  color: var(--text);
  border-color: var(--hare);
}

.btn-outline:active {
  transform: translateY(4px);
  border-bottom-color: transparent;
}

.sample-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sample-lbl {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.sample-chip {
  padding: 6px 12px;
  border-radius: 12px;
  border: 2px solid var(--border);
  border-bottom: 3px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s var(--ease), border-bottom-color 0.1s var(--ease);
}

.sample-chip:active {
  transform: translateY(2px);
  border-bottom-color: transparent;
}

/* 2 LESSON TILES */
.two-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tile {
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  min-height: 112px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  font-family: inherit;
  background: var(--surface);
  transition: transform 0.12s var(--ease), border-bottom-color 0.12s var(--ease), border-color 0.15s;
}

.tile:hover {
  border-color: var(--macaw);
}

.tile:active {
  transform: translateY(3px);
  border-bottom-color: transparent;
}

.tile-sky { border-color: #bce4fa; border-bottom-color: var(--macaw); }
.tile-rose { border-color: #f9c2ce; border-bottom-color: var(--cardinal); }

.tile-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.tile-sub {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

/* CURVED HEADER & FLOAT CARD */
.verdict-view {
  margin: -16px -20px 0;
  animation: duoSettle 0.26s var(--ease);
}

.curved-head {
  background: var(--owl);
  color: #ffffff;
  padding: 18px 22px 60px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

.curved-head.RED { background: var(--cardinal); }
.curved-head.AMBER { background: var(--bee); color: #3c3c3c; }
.curved-head.SLATE_GRAY { background: var(--hare); color: #ffffff; }

.head-eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  display: block;
  margin-bottom: 4px;
}

.helper-side-note {
  display: none;
  margin: 16px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  opacity: 0.92;
}

.helper-agencies {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.helper-agencies span {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.back-link {
  background: transparent;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0;
  margin-bottom: 10px;
  cursor: pointer;
}

.curved-head h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.float-card {
  margin: -38px 20px 18px;
  background: var(--surface);
  border-radius: 20px;
  padding: 18px;
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
}

.card-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
}

.card-body {
  margin: 0 0 16px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--muted);
}

.verdict-actions {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiet-details {
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

.quiet-details summary {
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  padding: 8px 0;
}

.meta-box {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface-sub);
  font-size: 0.84rem;
  color: var(--text);
}

.field-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.break-row {
  padding: 9px 11px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface);
}

.break-row.is-low {
  border-color: var(--cardinal);
  background: var(--cardinal-soft);
}

.break-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
  color: var(--text);
}

.break-meta {
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  overflow-wrap: anywhere;
}

#field-details .btn-outline {
  margin-top: 4px;
}

.meta-box a {
  color: var(--tree-frog);
  font-weight: 800;
}

.muted-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 8px 0 0;
}

/* HELPER (A2UI) */
#tab-helper .curved-head {
  margin: -16px -20px 0;
}

#tab-helper .float-card {
  margin: -36px 0 0;
}

.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 430px;
  overflow-y: auto;
  margin-bottom: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--swan) transparent;
}

.chat-feed::-webkit-scrollbar {
  width: 6px;
}

.chat-feed::-webkit-scrollbar-thumb {
  background: var(--swan);
  border-radius: 999px;
}

.chat-user-msg {
  align-self: flex-end;
  max-width: 84%;
  background: var(--owl-soft);
  color: #2b6b00;
  border: 2px solid #b8f28a;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  animation: duoSettle 0.22s var(--ease);
}

.chat-bot-turn {
  align-self: stretch;
  width: 100%;
  animation: duoSettle 0.26s var(--ease);
}

.chat-bar {
  display: flex;
  gap: 8px;
}

.chat-mic {
  width: auto;
  padding: 0 14px;
  min-height: 46px;
}

.chat-bar input {
  flex: 1;
}

.chat-send {
  width: auto;
  padding: 0 18px;
  min-height: 46px;
}

/* A2UI NATIVE WIDGETS */
.a2ui-surface { width: 100%; }
.a2ui-col { display: flex; flex-direction: column; gap: 10px; }
.a2ui-row { display: flex; flex-wrap: wrap; gap: 8px; }
.a2ui-card {
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.a2ui-tone-red { border-color: var(--cardinal); border-bottom-color: var(--fire-ant); background: var(--cardinal-soft); }
.a2ui-tone-amber { border-color: var(--bee); border-bottom-color: var(--bee-lip); background: var(--bee-soft); }
.a2ui-tone-gray { border-color: var(--hare); border-bottom-color: var(--wolf); background: var(--surface-sub); }
.a2ui-text { margin: 0; }
.a2ui-text-h2 { font-size: 1.2rem; font-weight: 800; }
.a2ui-text-h3 { font-size: 1rem; font-weight: 800; }
.a2ui-text-body { font-size: 0.88rem; color: var(--muted); font-weight: 600; }
.a2ui-text-caption { font-size: 0.78rem; color: var(--muted); }
.a2ui-badge {
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 9999px;
  border: 2px solid var(--border);
  background: var(--surface);
  overflow-wrap: anywhere;
}
.a2ui-badge-red { color: var(--fire-ant); border-color: var(--cardinal); }
.a2ui-badge-amber { color: var(--bee-lip); border-color: var(--bee); background: var(--bee-soft); }
.a2ui-badge-gray { color: var(--muted); border-color: var(--hare); }
.a2ui-badge-neutral { color: var(--macaw); border-color: var(--macaw); }
.a2ui-divider { border: none; border-top: 2px solid var(--border); margin: 2px 0; width: 100%; }
.a2ui-btn {
  width: auto;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.1s var(--ease), border-bottom-color 0.1s var(--ease), background-color 0.15s, color 0.15s;
}
.a2ui-btn.btn-primary {
  background: var(--owl);
  border-color: var(--owl);
  border-bottom-color: var(--tree-frog);
  color: #ffffff;
}
.a2ui-btn.btn-primary:hover { background: var(--mask-green); }
.a2ui-btn.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--border);
  color: var(--text);
}
.a2ui-btn.btn-secondary:hover {
  border-color: var(--hare);
  color: var(--tree-frog);
}
.a2ui-btn:active {
  transform: translateY(2px);
  border-bottom-color: transparent;
}
.a2ui-btn:focus-visible,
.bnav:focus-visible,
.icon-pill:focus-visible,
.lang-select:focus-visible,
.hero-scan-btn:focus-visible,
.sample-chip:focus-visible,
.text-action:focus-visible,
.back-link:focus-visible {
  outline: 3px solid var(--macaw);
  outline-offset: 2px;
}

.retry-note {
  align-self: flex-start;
  border: 2px dashed var(--cardinal);
  border-radius: 12px;
  background: var(--cardinal-soft);
  color: var(--fire-ant);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
}

/* CABINET */
.pad-page { padding-top: 4px; }

.head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.head-row h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
}

.text-action {
  background: transparent;
  border: none;
  color: var(--tree-frog);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-row {
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.item-row.RED {
  border-color: var(--cardinal);
  border-bottom-color: var(--fire-ant);
  background: var(--cardinal-soft);
}

.item-row > div { min-width: 0; }
.item-name { font-size: 0.95rem; font-weight: 800; overflow-wrap: anywhere; }
.item-sub { font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.registry-source-link { display: inline-block; margin-top: 5px; font-size: 0.72rem; font-weight: 800; color: var(--macaw-lip); }
.status-tag { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.status-tag.RED { color: var(--fire-ant); }
.status-tag.AMBER { color: var(--bee-lip); }

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 66px;
  background: var(--surface);
  border-top: 2px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.bnav {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  cursor: pointer;
}

.bnav.active {
  color: var(--macaw);
}

.eq-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 15px;
  margin-right: 8px;
}

.eq-bars i {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: var(--owl);
  animation: eqBounce 0.7s ease-in-out infinite;
}

.eq-bars i:nth-child(2) { animation-delay: 0.16s; }
.eq-bars i:nth-child(3) { animation-delay: 0.32s; }
#btn-speak.is-speaking .eq-bars { display: inline-flex; }

.typing-bubble {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--surface-sub);
}

.typing-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--owl);
  animation: dotHop 1.1s ease-in-out infinite;
}

.typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.3s; }

/* FORWARDED MESSAGE / RUMOR CHECK */
.rumor-side-note {
  display: block;
  max-width: 72ch;
}

.claim-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.claim-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 800;
}

.claim-form textarea {
  width: 100%;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface-sub);
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  resize: vertical;
  min-height: 116px;
}

.claim-form textarea:focus {
  outline: none;
  border-color: var(--macaw);
  box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.2);
}

.claim-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.claim-file-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  background: var(--surface-sub);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.claim-result {
  margin-top: 18px;
  border-radius: 16px;
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  padding: 16px;
  background: var(--surface);
}

.claim-result.VERIFIED {
  border-color: var(--owl);
  border-bottom-color: var(--tree-frog);
  background: var(--owl-soft);
}

.claim-result.PARTIAL {
  border-color: var(--bee);
  border-bottom-color: var(--bee-lip);
  background: var(--bee-soft);
}

.claim-result.UNVERIFIED {
  border-color: var(--hare);
  border-bottom-color: var(--wolf);
  background: var(--surface-sub);
}

.claim-result.NOT_A_RECALL_CLAIM {
  border-color: var(--macaw);
  border-bottom-color: var(--macaw-lip);
  background: var(--surface-sub);
}

.claim-verdict {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid currentColor;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.claim-verdict.VERIFIED { color: var(--tree-frog); }
.claim-verdict.PARTIAL { color: var(--bee-lip); }
.claim-verdict.UNVERIFIED { color: var(--muted); }
.claim-verdict.NOT_A_RECALL_CLAIM { color: var(--macaw-lip); }

.claim-result h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.claim-result .claim-copy {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
}

.claim-extracted {
  margin: 10px 0 14px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 150px;
  overflow: auto;
  border-left: 3px solid var(--border);
  padding-left: 10px;
}

.claim-result .verdict-actions {
  padding: 0;
}

/* ALERTS + DIALOGS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 90;
}

.alerts-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--surface);
  border-left: 2px solid var(--border);
  z-index: 100;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: duoSettle 0.22s var(--ease);
}

.alerts-head,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alerts-head h2,
.dialog-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.alerts-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.alerts-actions > * {
  flex: 1;
}

.alerts-inline-count {
  color: var(--cardinal);
  font-size: 0.78rem;
  font-weight: 800;
  margin-left: 4px;
}

.alert-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--cardinal);
  border-bottom: 4px solid var(--fire-ant);
  background: var(--cardinal-soft);
}

.alert-item.is-read {
  border-color: var(--border);
  border-bottom-color: var(--border);
  background: var(--surface-sub);
}

.alert-item .alert-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.alert-item .alert-name {
  font-weight: 800;
  font-size: 0.9rem;
}

.alert-item .alert-meta {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.alert-item .alert-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.alert-item .alert-actions button,
.alert-item .alert-actions a {
  font-size: 0.74rem;
  padding: 5px 10px;
  border-radius: 10px;
  border: 2px solid var(--border);
  border-bottom-width: 3px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.app-dialog {
  border: 2px solid var(--border);
  border-bottom: 5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  width: min(520px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 20px;
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface-sub);
}

.profile-row.is-active {
  border-color: var(--macaw);
  background: var(--surface);
}

.profile-row button {
  margin-left: auto;
}

.profile-role {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.profile-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-add input,
.profile-add select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface-sub);
  color: var(--text);
  padding: 9px 12px;
  font-family: inherit;
  font-weight: 600;
}

/* IMPACT + VOICE SETTINGS */
.cabinet-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.impact-card,
.settings-card {
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 16px;
}

.impact-card .head-row {
  margin-bottom: 4px;
}

.impact-card h2,
.settings-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.impact-tile {
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface-sub);
  padding: 9px 11px;
}

.impact-number {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.1;
}

.impact-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.switch-row,
.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.switch-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--owl);
}

.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--owl);
}

.rate-label {
  min-width: 44px;
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.settings-card .btn-outline {
  margin-top: 12px;
}

.data-note {
  margin-top: -4px;
}

.data-note a {
  color: var(--muted);
}

/* TABLET: give the phone layout a little more breathing room */
@media (min-width: 600px) and (max-width: 759.98px) {
  .shell { max-width: 600px; }
  .bottom-nav { max-width: 600px; }
}

/* DESKTOP / LAPTOP: real wide layout instead of a phone-width column */
@media (min-width: 760px) {
  body {
    background: var(--surface-sub);
  }

  .shell {
    max-width: 1120px;
    display: flex;
    flex-direction: column;
    border-left: 2px solid var(--border);
    border-right: 2px solid var(--border);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
    padding-bottom: 0;
  }

  .topbar {
    order: 0;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 18px 36px;
    backdrop-filter: blur(10px);
  }

  .brand {
    font-size: 1.45rem;
  }

  .alerts-fab {
    right: 32px;
    bottom: 28px;
  }

  .toast {
    order: 0;
    position: fixed;
    top: 152px;
    left: 50%;
    transform: translateX(-50%);
    width: min(540px, calc(100vw - 48px));
    margin: 0;
    z-index: 60;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  }

  .bottom-nav {
    order: 1;
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: none;
    height: auto;
    padding: 10px 24px;
    border-top: 0;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 8px;
  }

  .bnav {
    flex: 0 1 200px;
    min-height: 44px;
    border-radius: 12px;
    border: 2px solid var(--border);
    border-bottom-width: 4px;
    background: var(--surface);
    font-size: 0.82rem;
  }

  .bnav:hover {
    color: var(--text);
    border-color: var(--hare);
  }

  .bnav.active {
    color: var(--macaw);
    background: var(--surface-sub);
    border-color: var(--macaw);
    border-bottom-color: var(--macaw);
  }

  .screen {
    order: 2;
    flex: 1;
    padding: 28px 36px 48px;
  }

  /* Scanner: hero + form on the left, shortcuts on the right */
  #scanner-home {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    grid-template-areas:
      "profile profile"
      "hero tiles"
      "form tiles";
    gap: 20px;
    align-items: start;
  }

  .profile-bar {
    grid-area: profile;
    margin-bottom: 0;
  }

  .hero-card {
    grid-area: hero;
    margin-bottom: 0;
    padding: 32px 28px 24px;
  }

  .hero-card h1 {
    font-size: 2.1rem;
  }

  .hero-card p {
    font-size: 1rem;
    max-width: 52ch;
  }

  .hero-scan-btn {
    height: 58px;
    font-size: 1rem;
  }

  .type-card {
    grid-area: form;
    margin-bottom: 0;
  }

  .two-tiles {
    grid-area: tiles;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tile {
    min-height: 150px;
    padding: 20px;
  }

  .tile-title {
    font-size: 1.1rem;
  }

  /* Verdict: centred reading column */
  .verdict-view {
    max-width: 880px;
    margin: 0 auto;
  }

  .verdict-view .curved-head {
    border-radius: 24px;
    padding: 24px 28px 58px;
  }

  .verdict-view .curved-head h1 {
    font-size: 1.9rem;
  }

  .verdict-view .float-card {
    margin: -36px 24px 20px;
    padding: 22px;
  }

  .verdict-actions {
    padding: 0 24px;
  }

  /* Helper: intro panel + a tall, comfortable chat surface */
  #tab-helper.active {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
  }

  #tab-helper .curved-head {
    margin: 0;
    height: 100%;
    min-height: 240px;
    border-radius: 24px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
  }

  #tab-helper .curved-head::before {
    content: "";
    position: absolute;
    top: -150px;
    left: -100px;
    width: 340px;
    height: 340px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    box-shadow:
      0 0 0 55px rgba(255, 255, 255, 0.08),
      0 0 0 110px rgba(255, 255, 255, 0.05);
    pointer-events: none;
  }

  #tab-helper .curved-head > * {
    position: relative;
    z-index: 1;
  }

  #tab-helper .curved-head h1 {
    font-size: 2rem;
    line-height: 1.1;
  }

  #tab-helper .helper-side-note {
    display: block;
  }

  #tab-helper .helper-agencies {
    display: flex;
  }

  #tab-helper .float-card {
    margin: 0;
    height: clamp(480px, calc(100vh - 250px), 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #tab-helper .chat-feed {
    flex: 1;
    min-height: 0;
    max-height: none;
    padding-right: 4px;
  }

  #tab-helper .chat-bar {
    flex-shrink: 0;
  }

  /* Rumor check: same useful intro + result split */
  #tab-rumor.active {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  #tab-rumor .curved-head {
    margin: 0;
    border-radius: 24px;
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
  }

  #tab-rumor .curved-head::before {
    content: "";
    position: absolute;
    top: -150px;
    left: -100px;
    width: 340px;
    height: 340px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    box-shadow:
      0 0 0 55px rgba(255, 255, 255, 0.08),
      0 0 0 110px rgba(255, 255, 255, 0.05);
    pointer-events: none;
  }

  #tab-rumor .curved-head > * {
    position: relative;
    z-index: 1;
  }

  #tab-rumor .curved-head h1 {
    font-size: 1.9rem;
    line-height: 1.1;
  }

  #tab-rumor .float-card {
    margin: 0;
  }

  /* Cabinet: saved items + local tools on the left, official list on the right */
  #tab-cabinet .pad-page {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-areas:
      "head head"
      "cabinetside recalls";
    gap: 20px 24px;
    align-items: start;
  }

  #tab-cabinet .head-row {
    grid-area: head;
    margin-bottom: 0;
  }

  #tab-cabinet .cabinet-column {
    grid-area: cabinetside;
  }

  #tab-cabinet .recalls-section {
    grid-area: recalls;
    margin-top: 0 !important;
  }

  #tab-cabinet .quiet-details summary {
    text-align: left;
    padding-top: 4px;
  }

  .filter-bar {
    grid-template-columns: minmax(0, 1fr) 200px;
  }

  #registry-list .item-row {
    align-items: flex-start;
  }
}

.source-coverage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.source-coverage-card {
  padding: 14px;
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  border-radius: 15px;
  background: var(--surface-sub);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-coverage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.source-coverage-meta,
.source-no-link {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.source-coverage-card a {
  align-self: flex-start;
  color: var(--macaw-lip);
  font-size: 0.82rem;
  font-weight: 800;
}

.source-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-status.ok { color: var(--tree-frog); }
.source-status.demo,
.source-status.not_configured { color: var(--fox); }
.source-status.error,
.source-status.failed { color: var(--fire-ant); }

.source-errors {
  margin: 0;
  padding-left: 18px;
  color: var(--fire-ant);
  font-size: 0.78rem;
}

.registry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.report-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-form select,
.report-form textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface-sub);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.report-form textarea { resize: vertical; }
.report-form select:focus,
.report-form textarea:focus { outline: 3px solid rgba(28, 176, 246, 0.25); border-color: var(--macaw); }
