﻿/* ── Self-hosted Heebo (variable 300–900) ───────────── */
@font-face {
  font-family: "Heebo";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fonts/heebo-hebrew.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: "Heebo";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fonts/heebo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Design tokens ──────────────────────────────────── */
:root {
  color-scheme: light;
  --bg: #eef1f7;
  --surface: #ffffff;
  --surface-soft: #f3f6fb;
  --ink: #14233b;
  --ink-soft: #46566f;
  --muted: #8492a8;
  --line: #e4e9f1;
  --line-strong: #d3dbe7;
  --primary: #0f5f58;
  --primary-strong: #0e4f4a;
  --primary-soft: #e4efed;
  --blue: #2563c9;
  --blue-soft: #eaf1fc;
  --navy: #0e4f4a;
  /* Brand accent — stays a deep teal in both light & dark so buttons keep
     white text. */
  --accent: #0e4f4a;
  --accent-hover: #14635b;
  --on-accent: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdf1f0;
  --success: #15803d;
  --warning: #b45309;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-xl: 24px;
  --shadow-soft: 0 1px 2px rgba(20, 35, 59, 0.04), 0 6px 18px rgba(20, 35, 59, 0.06);
  --shadow-raised: 0 2px 8px rgba(20, 35, 59, 0.06), 0 18px 40px rgba(20, 35, 59, 0.12);
}

* {
  box-sizing: border-box;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Heebo", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ── Shell ──────────────────────────────────────────── */
.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  /* RTL: sidebar (first child) sits on the RIGHT, chat on the left. */
  grid-template-columns: 292px minmax(0, 1fr);
  direction: rtl;
  overflow: hidden;
}

.sidebar,
.chat-shell {
  direction: rtl;
}

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: var(--surface);
  color: var(--ink);
  border-inline-start: 1px solid var(--line);
  min-height: 0;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 14px rgba(14, 79, 74, 0.28);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--primary-strong);
}

.brand-copy span {
  font-size: 12.5px;
  color: var(--muted);
}

/* "שיחה חדשה" — clears the chat back to a clean, empty state. Sits at the top
   of the sidebar (visible on desktop; reachable via the hamburger on mobile). */
.new-chat-btn {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--primary-strong);
  padding: 0 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.new-chat-btn:hover {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 14px rgba(14, 79, 74, 0.22);
}

.new-chat-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: currentColor;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--ink-soft);
  padding: 0 12px;
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-item.active {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 14px rgba(14, 79, 74, 0.22);
}

.nav-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: currentColor;
}

/* "בקרוב" pill pushed to the far (start) edge of a nav item */
.nav-badge {
  margin-inline-start: auto;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
}
.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.22);
  color: var(--on-accent);
}

/* Static "בקרוב" chip inside the compare coming-soon card (replaces the CTA) */
.compare-gate-soon {
  display: inline-block;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
}

/* history in sidebar */
.history-drawer {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.history-drawer h2 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.history {
  display: grid;
  gap: 7px;
  min-width: 0;
  max-height: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
}

.history-item {
  min-width: 0;
  padding: 11px 13px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  cursor: default;
}

.history-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
  font-weight: 600;
  font-size: 13.5px;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.help-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.help-link:hover {
  color: var(--primary-strong);
}

/* Inline support composer that expands under the "עזרה ותמיכה" button. */
.support-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.support-panel[hidden] { display: none; }

.support-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.support-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 76px;
  padding: 9px 11px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
}

.support-textarea:focus {
  outline: none;
  border-color: var(--primary-strong);
}

.support-panel .request-action {
  width: 100%;
}

/* ── Chat shell & header ────────────────────────────── */
.chat-shell {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  flex: 0 0 auto;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 33, 0.5);
  z-index: 9;
}

.sidebar-overlay.active {
  display: block;
}

/* Desktop: no top bar — the centered hero greets the user. The header is
   repurposed as a compact top bar on mobile only (see responsive block). */
.chat-header {
  display: none;
  position: relative;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

/* header-copy holds the JS-updated view title; not displayed in the new
   layout but kept in the DOM for switchView(). */
.header-copy {
  display: none;
}

/* Mobile top bar: just the "רפרנטו" name, absolutely centered regardless of the
   hamburger button on the side. */
.header-brand {
  position: absolute;
  inset-inline: 0;
  margin-inline: auto;
  width: fit-content;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.header-brand-logo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
}

.header-brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--primary-strong);
}

.header-chip {
  display: none !important;
}

/* ── Chat area ──────────────────────────────────────── */
.chat-area {
  flex: 1 1 auto;
  min-height: 0;
  padding: 28px 36px 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.messages {
  width: min(1020px, 100%);
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

/* When only the welcome/empty state is shown it fills the height: the title
   block centered in the upper space, the shortcut pills pinned just above the
   composer (same layout on desktop and mobile). */
.messages:has(#emptyState) {
  display: flex;
  flex-direction: column;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* full width so the shortcut pills line up with the composer's edge */
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: center;
}

.empty-illustration {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-top: auto;
  margin-bottom: 18px;
  border-radius: 18px;
  background: #e3eaf4;
  color: var(--ink-soft);
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.empty-hint {
  margin: 0 auto 8px;
  max-width: 440px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.7;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Example question — inline in the hint line, flat, no bubble */
.suggestion-chip {
  border: none;
  background: none;
  color: var(--primary-strong);
  padding: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}

.suggestion-chip:hover {
  color: var(--primary-strong);
}

/* Marked shortcuts (bubble) — jump straight to a view.
   margin-top:auto pins them to the bottom of the empty state, just above
   the composer; flex-start hugs the RTL leading (right) edge. */
.quick-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  /* same width as .composer so the pills sit flush with the chat box edge */
  width: min(760px, 100%);
  align-self: center;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.quick-link-icon {
  color: var(--ink-mute, var(--ink-soft));
  display: inline-flex;
}

.quick-link:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.quick-link:hover .quick-link-icon {
  color: var(--primary-strong);
}

/* ── Messages ───────────────────────────────────────── */
.message {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.user-message {
  justify-content: flex-start;
}

.assistant-message {
  justify-content: flex-end;
}

.avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-top: 2px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 800;
}

.user-avatar {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid #c9ddfa;
}

.assistant-avatar {
  background: linear-gradient(150deg, #15918a, #0a4f4b);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 107, 102, 0.3);
}

.bubble {
  max-width: 640px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  line-height: 1.65;
}

.user-message .bubble {
  background: var(--blue-soft);
  border-color: #cfe1fb;
}

/* ChatGPT-style emphasis: the user's question is slightly bold, the AI answer
   stays at a regular/light weight (prose inherits 400 from the bubble; the
   structured elements below are toned down to match). */
.user-message .bubble p {
  font-weight: 600;
}

.assistant-message .bubble {
  font-weight: 400;
}

.bubble p {
  margin: 0 0 6px;
}

.bubble time {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.result-card {
  min-width: min(640px, 100%);
  max-width: 760px;
}

.result-title {
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--ink);
}

/* source line */
.source-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Keep the source reference to a single compact line; full text on hover. */
.source-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-logo {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  border: 1px solid #bfdedc;
  color: var(--primary-strong);
  font-size: 10.5px;
  font-weight: 800;
}

.source-prefix {
  margin-inline-end: 3px;
}

.source-company {
  margin-inline-end: 6px;
  color: var(--ink);
  font-weight: 700;
}

/* answer body */
.answer-summary {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: var(--primary-soft);
  border: 1px solid #cde7e5;
  color: var(--primary-strong);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.65;
}

.answer-table {
  margin: 0;
}

.answer-row {
  display: grid;
  grid-template-columns: 30px minmax(170px, 1fr) minmax(180px, 0.95fr);
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.answer-row:last-child {
  border-bottom: 0;
}

.row-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 800;
}

.answer-row dt {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
}

.answer-row dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

.indexed-amount-row {
  margin: 6px 0;
  padding: 10px 12px;
  border: 1px solid #bfdedc;
  border-radius: var(--radius-m);
  background: var(--primary-soft);
}

.indexed-amount-row dd {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary-strong);
}

.indexed-amount-row .row-icon {
  background: #d2ecea;
  color: var(--primary-strong);
}

.answer-extra {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* Page citation the model embeds in the answer, lifted out to a small line. */
.source-page-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Full-length list/prose answers — readable, nothing truncated. */
.answer-longform {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.75;
}

/* loading */
.loading-bubble {
  min-height: 54px;
  display: flex;
  align-items: center;
}

.loading-current-step {
  direction: rtl;
  color: var(--ink-soft);
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-current-step::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--primary);
  animation: loading-spin 0.9s linear infinite;
}

.loading-dots::after {
  content: "";
  animation: loading-dots-anim 1.2s steps(4, end) infinite;
}

@keyframes loading-dots-anim {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.stream-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--ink);
  font-size: 15px;
}

/* not found / request cards */
.not-found-card {
  border-color: #f0c0ba;
  background: #fffbfa;
}

.not-found-card .result-title {
  color: var(--danger);
}

.not-found-card .not-found-subtitle {
  color: #8f1d14;
  font-size: 15px;
  line-height: 1.65;
}

.not-found-card .source-line {
  margin: 14px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid #f0d8d4;
  border-bottom: 0;
  color: #9b7b78;
  font-size: 11.5px;
}

.not-found-card .company-logo {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #fff7f6;
  border-color: #efc7c2;
  color: #8f1d14;
  font-size: 10px;
}

.not-found-card .source-company {
  color: #7f312b;
}

.not-found-actions {
  margin-top: 10px;
}

.appendix-request-card {
  background: #fffdfb;
}

/* post-answer "register / upgrade" nudge card */
.signup-offer-card {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.signup-offer-card .result-title {
  color: var(--primary-strong);
}

/* Guest login wall — a gentle "register to continue" invite, not a hard lock. */
.locked-answer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  text-align: start;
}

.locked-answer-card .result-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}

.locked-answer-text {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 12px;
}

.locked-answer-status {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0 0 12px;
}

.locked-answer-card .request-action {
  border-radius: 999px;
  padding: 9px 22px;
}

.request-details {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid #f0d8d4;
  border-bottom: 1px solid #f0d8d4;
}

.request-details div {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1.2fr);
  gap: 12px;
  align-items: start;
}

.request-details dt {
  color: var(--ink);
  font-weight: 500;
}

.request-details dd {
  margin: 0;
  color: var(--ink-soft);
}

.request-action {
  width: fit-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.request-action:disabled {
  opacity: 0.65;
  cursor: default;
}

/* Confirmation shown in place of the button once the request is sent. */
.request-sent {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.request-sent-title {
  color: var(--success);
  font-weight: 700;
  font-size: 14px;
}

.request-sent-note {
  color: var(--muted);
  font-size: 12.5px;
}

.request-action:hover {
  background: #173a63;
}

/* copy button */
.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.copy-button:hover {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: #b3cef5;
}

.copy-button.copied {
  background: var(--primary-soft);
  color: var(--primary-strong);
  border-color: #bfdedc;
}

/* ── Composer ───────────────────────────────────────── */
.composer {
  flex: 0 0 auto;
  width: min(760px, calc(100% - 48px));
  margin: 0 auto 16px;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  z-index: 2;
}

.composer-fields {
  display: grid;
  grid-template-columns: 1fr 1.45fr 0.7fr;
  gap: 12px;
  margin-bottom: 12px;
}

.meta-grid {
  display: grid;
  grid-template-columns: 0.9fr 1fr 1.1fr 0.9fr;
  gap: 12px;
  margin-bottom: 12px;
}

.meta-field {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
}

.meta-field em {
  color: var(--danger);
  font-style: normal;
}

.meta-field input,
.match-picker select,
.input-row textarea,
.compare-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface-soft);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.meta-field input:focus,
.input-row textarea:focus,
.compare-form textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 107, 102, 0.12);
}

.meta-field input {
  min-height: 42px;
  padding: 0 13px;
  font-size: 14.5px;
  font-weight: 500;
}

/* Keep numeric year validation and keyboard stepping, without spinner arrows. */
#policyYear {
  -moz-appearance: textfield;
  appearance: textfield;
}

#policyYear::-webkit-inner-spin-button,
#policyYear::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.important-field input {
  border-color: #93b8e8;
  background: #f6faff;
  font-weight: 700;
}

.match-picker {
  margin-bottom: 12px;
}

.match-picker label {
  display: grid;
  gap: 7px;
  color: var(--danger);
  font-weight: 700;
  font-size: 13px;
}

.match-picker select {
  min-height: 44px;
  padding: 0 12px;
}

/* Company dropdown in the composer — same look as .meta-field input, with an
   RTL chevron. A native <select> (not free text) prevents company-name typos. */
.company-select {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background-color: var(--surface-soft);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238492a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 13px center;
  padding-left: 34px;
}
.company-select:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(15, 107, 102, 0.12);
}

/* RTL order: textarea (right) · open-pdf · circular send (left). The open-pdf
   button collapses while disabled, so most of the time it's just input + send. */
.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.input-row textarea {
  height: 52px;
  min-height: 52px;
  resize: none;
  overflow: hidden;
  padding: 14px 16px;
  line-height: 1.5;
  font-size: 15.5px;
  border-radius: 999px;
}

.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(14, 79, 74, 0.26);
  transition: background 0.15s, transform 0.1s;
}

.send-button:hover {
  background: var(--accent-hover);
}

.send-button:active {
  transform: translateY(1px);
}

.send-button:disabled {
  opacity: 0.65;
  cursor: wait;
  box-shadow: none;
}

.send-icon {
  display: inline-grid;
  place-items: center;
  transform: scaleX(-1);
}

/* Chat composer: icon-only circular send button. */
.composer .send-button {
  width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 50%;
  flex: 0 0 auto;
}

.composer .send-label {
  display: none;
}

.source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #b3cef5;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s;
}

.source-button:hover:not(:disabled) {
  background: #ddebfd;
}

/* Hidden until a source PDF is available, matching the clean Stitch composer. */
#openPdfButton:disabled {
  display: none;
}

.footer-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.policy-dir {
  margin: 0;
  max-width: 55%;
  direction: ltr;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Compare view (visual / demo) ───────────────────── */
.compare-shell {
  flex: 1 1 auto;
  min-height: 0;
  /* The compare view is a blurred "coming soon" teaser — no scrolling. */
  overflow: hidden;
  padding: 26px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cmp-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.cmp-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* Wrapper clips the tall blurred grid so the "בקרוב" badge stays centered. */
.cmp-soon-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* RTL: control panel (first child) on the right, results on the left. */
.cmp-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  /* Teaser state: lightly blurred and non-interactive behind the overlay —
     soft enough that users can still make out the system. */
  filter: blur(1px);
  pointer-events: none;
  user-select: none;
}

.cmp-soon {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(238, 241, 247, 0.28);
}

.cmp-soon-badge {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 360px;
  padding: 28px 36px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-raised);
}

.cmp-soon-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.cmp-soon-badge strong {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--primary-strong);
}

.cmp-soon-badge span {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.cmp-control {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cmp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.cmp-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
}

/* "What differs / what's similar" highlights card */
.cmp-highlights {
  margin-top: 14px;
}
.cmp-hl-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.cmp-hl-list {
  margin: 0 0 6px;
  padding-inline-start: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cmp-hl-list li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.cmp-hl-similar {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.cmp-hl-similar strong {
  color: var(--ink-soft);
}

/* Loading note — sets the ~3 minute expectation */
.cmp-loading-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Covered / not-covered icons in comparison cells */
.cmp-ic {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  margin-inline-end: 4px;
}
.cmp-ic-yes {
  background: rgba(21, 128, 61, 0.12);
  color: var(--success);
}
.cmp-ic-no {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Per-row "פרטים" expand toggle + detail row */
.cmp-expand {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-inline-start: 6px;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.cmp-expand:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}
.cmp-chevron {
  transition: transform 0.15s ease;
}
.cmp-expand.open .cmp-chevron {
  transform: rotate(180deg);
}
.cmp-detail-row > td,
.cmp-detail-row > th {
  background: var(--surface-soft);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  vertical-align: top;
  padding-top: 8px;
  padding-bottom: 12px;
}
.cmp-detail-label {
  font-weight: 700;
  color: var(--muted);
}

/* Limit-reached popup — gentle style matching the inline register cards. */
#limitPopup.login-overlay {
  background: rgba(20, 35, 59, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.limit-popup-card {
  width: min(380px, 100%);
  padding: 26px 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.limit-popup-card .result-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}
.limit-popup-card .login-text {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.limit-popup-card .limit-upgrade-btn {
  width: auto;
  min-width: 200px;
  margin-top: 0;
  border-radius: 999px;
  padding: 11px 26px;
  font-size: 15px;
}
.limit-popup-close {
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: underline;
}

/* First-visit onboarding tour — spotlight over the real UI. The ring's huge
   box-shadow dims everything except a transparent "hole" over the target. */
#onboardingTour { position: fixed; inset: 0; z-index: 1200; }
.onboard-dim {
  position: fixed;
  background: rgba(20, 35, 59, 0.55);
  transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}
.onboard-ring {
  position: fixed;
  border: 2px solid var(--accent);
  border-radius: 12px;
  transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
  pointer-events: none;
}
.onboard-ring.no-target { border-color: transparent; }
.onboard-tip {
  position: fixed;
  width: min(330px, calc(100vw - 24px));
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-raised);
  padding: 18px 18px 14px;
  text-align: center;
  transition: top 0.3s ease, left 0.3s ease;
}
.onboard-tip-title { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.onboard-tip-text { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 12px; }
.onboard-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 12px; }
.onboard-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.2s, transform 0.2s;
}
.onboard-dots span.active { background: var(--accent); transform: scale(1.25); }
.onboard-tip-actions { display: flex; align-items: center; justify-content: center; gap: 14px; }
.onboard-next {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 28px;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}
.onboard-next:hover { background: var(--accent-hover); }
.onboard-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.onboard-skip[hidden] { display: none; }

.cmp-card-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.cmp-field-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.cmp-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.cmp-textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 95, 88, 0.12);
}

.cmp-hint {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.cmp-pick {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  padding: 12px 13px;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cmp-pick.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.cmp-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.cmp-pick-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
}

.cmp-pick-name small {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.cmp-pick-head input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-strong);
  flex: 0 0 auto;
}

.cmp-pick-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.cmp-pick-fields .meta-field {
  display: grid;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.cmp-pick-fields .meta-field input {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
}

.cmp-analyze {
  width: 100%;
  margin-top: 6px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(14, 79, 74, 0.24);
  transition: background 0.15s;
}

.cmp-analyze:hover {
  background: var(--accent-hover);
}

.cmp-analyze-icon {
  display: inline-grid;
  place-items: center;
}

/* main results column */
.cmp-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.cmp-history-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.cmp-history-btn:hover {
  background: var(--surface-soft);
}

/* recommendation card */
.cmp-reco {
  border-color: #bfdedc;
  background: linear-gradient(180deg, var(--primary-soft), var(--surface) 62%);
}

.cmp-reco-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cmp-reco-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  flex: 0 0 auto;
}

.cmp-reco-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.cmp-reco-text {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.cmp-reco-text strong {
  color: var(--primary-strong);
}

.cmp-reco-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cmp-reco-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid #bfdedc;
  color: var(--primary-strong);
  font-size: 12.5px;
  font-weight: 700;
}

/* comparison table */
.cmp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}

.cmp-table th,
.cmp-table td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.cmp-table thead th {
  font-weight: 800;
  color: var(--ink);
  vertical-align: bottom;
  background: var(--surface);
}

.cmp-table thead small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.cmp-th-param {
  text-align: right;
  color: var(--muted);
  font-weight: 700;
}

.cmp-table tbody th {
  text-align: right;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--surface);
}

.cmp-table tbody td {
  color: var(--ink);
  font-weight: 600;
}

.cmp-section-row td {
  text-align: right;
  padding: 9px 16px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* recommended column highlight */
.cmp-col-reco {
  background: var(--primary-soft) !important;
}

.cmp-table tbody td.cmp-col-reco {
  color: var(--primary-strong);
}

.cmp-table thead .cmp-col-reco {
  box-shadow: inset 0 3px 0 var(--primary-strong);
}

.cmp-reco-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 800;
}

.cmp-bad {
  color: var(--danger) !important;
  font-weight: 700;
}

/* table footer actions */
.cmp-table tfoot td {
  border-bottom: 0;
  padding: 14px 12px;
}

.cmp-quote {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
}

.cmp-quote:hover {
  background: var(--surface-soft);
}

.cmp-quote-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.cmp-quote-primary:hover {
  background: var(--accent-hover);
}

/* ── Legal footer ───────────────────────────────────── */
.legal-footer {
  flex: 0 0 auto;
  padding: 9px 36px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.disclaimer-text {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.disclaimer-text strong {
  color: var(--ink-soft);
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--blue);
  font-size: 11.5px;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links span {
  color: var(--muted);
  font-size: 11.5px;
}

/* ── Dark mode ──────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0c141f;
    --surface: #16202e;
    --surface-soft: #1b2735;
    --ink: #e8eef8;
    --ink-soft: #97a9c4;
    --muted: #65789a;
    --line: #243246;
    --line-strong: #31435c;
    --primary: #19a59c;
    --primary-strong: #5fe0d8;
    --primary-soft: #11302f;
    --blue: #5aa2f7;
    --blue-soft: #142440;
    --navy: #0a1422;
    --danger: #f87171;
    --danger-soft: #2c1614;
    --success: #34d399;
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.3);
    --shadow-raised: 0 2px 6px rgba(0, 0, 0, 0.35), 0 16px 36px rgba(0, 0, 0, 0.45);
  }

  .meta-field input:focus,
  .input-row textarea:focus,
  .compare-form textarea:focus {
    background: #101a27;
  }

  .important-field input {
    border-color: #2e4a73;
    background: #13233a;
  }

  .answer-summary {
    border-color: #1d4a47;
  }

  .indexed-amount-row {
    border-color: #1d4a47;
  }

  .indexed-amount-row .row-icon {
    background: #173f3c;
    color: #5fe0d8;
  }

  .company-logo {
    border-color: #1d4a47;
    color: #5fe0d8;
  }

  .not-found-card {
    border-color: #5c2a24;
    background: #20120f;
  }

  .not-found-card .not-found-subtitle {
    color: #f0b8b1;
  }

  .not-found-card .source-line {
    border-top-color: #3c2a25;
    color: #a58c88;
  }

  .not-found-card .company-logo {
    background: #2a1815;
    border-color: #5c2a24;
    color: #f0b8b1;
  }

  .not-found-card .source-company {
    color: #f0b8b1;
  }

  .appendix-request-card {
    background: #1d1612;
  }

  .request-details {
    border-color: #3c2a25;
  }

  .request-action {
    background: #1d63d8;
  }

  .request-action:hover {
    background: #2f74e8;
  }


  .source-button {
    border-color: #2e4a73;
  }

  .copy-button:hover {
    border-color: #2e4a73;
  }

  .empty-illustration {
    background: var(--surface-soft);
    color: var(--ink-soft);
  }

  .brand-logo,
  .nav-item.active,
  .header-brand-logo,
  .send-button {
    box-shadow: none;
  }
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  /* RTL drawer: anchored to the right edge, slides in from the right. */
  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(308px, 85vw);
    z-index: 10;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  }

  .menu-button {
    display: grid;
    place-items: center;
    row-gap: 1px;
    padding: 4px 0;
  }

  .menu-button-label {
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
  }

  /* Mobile top bar: hamburger + centered "רפרנטו" brand. */
  .chat-header {
    display: flex;
    min-height: 56px;
    padding: 10px 14px;
    gap: 12px;
  }

  .chat-area {
    padding: 18px 12px 8px;
  }

  /* no side padding so the shortcut pills reach the composer's edge */
  .empty-state {
    width: 100%;
    padding: 16px 0;
  }

  /* chat-area side padding is 12px but the composer's margin is 9px —
     let the centered row overhang 3px per side so pills sit flush with it */
  .quick-links {
    width: calc(100% + 6px);
  }

  .empty-illustration {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
  }

  .empty-state h2 {
    font-size: 21px;
  }

  .empty-hint {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .composer {
    width: calc(100% - 18px);
    margin-bottom: max(8px, env(safe-area-inset-bottom));
    padding: 11px 12px 8px;
    border-radius: var(--radius-l);
  }

  .composer-fields {
    grid-template-columns: 1fr 0.72fr;
    grid-template-areas:
      "company year"
      "appendix appendix";
    gap: 8px;
    margin-bottom: 9px;
  }

  .company-field { grid-area: company; }
  .appendix-field { grid-area: appendix; }
  .year-field { grid-area: year; }

  .meta-field {
    gap: 3px;
    font-size: 11.5px;
  }

  /* iOS Safari auto-zooms into inputs with font-size < 16px — keep all
     interactive text fields at exactly 16px on mobile. */
  .meta-field input,
  .match-picker select,
  .company-select,
  .input-row textarea,
  .compare-form textarea {
    font-size: 16px;
  }

  .meta-field input,
  .company-select {
    min-height: 40px;
    padding: 0 12px;
  }

  /* Keep room for the RTL chevron on mobile (overrides the shared padding above). */
  .company-select {
    padding-left: 32px;
    background-position: left 11px center;
  }

  .input-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .composer .send-button {
    width: 46px;
    height: 46px;
    min-height: 46px;
  }

  .input-row textarea {
    height: 46px;
    min-height: 46px;
    padding: 11px 14px;
  }

  .footer-row {
    display: none;
  }

  .bubble,
  .result-card {
    min-width: 0;
    max-width: calc(100vw - 56px);
    padding: 12px 14px;
  }

  .answer-summary {
    font-size: 14.5px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }

  .avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .legal-footer {
    padding: 5px 12px max(6px, env(safe-area-inset-bottom));
  }

  /* Keep the legal disclaimer reachable but compact (max 2 lines). */
  .disclaimer-text {
    font-size: 10px;
    line-height: 1.35;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .answer-row {
    grid-template-columns: 28px 1fr;
    gap: 6px;
  }

  .answer-row dd {
    grid-column: 2;
  }

  .request-details div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .compare-shell {
    padding: 16px 12px 24px;
  }

  .cmp-head h1 {
    font-size: 21px;
  }

  .cmp-grid {
    grid-template-columns: 1fr;
  }

  .cmp-table {
    font-size: 13px;
  }

  .cmp-table th,
  .cmp-table td {
    padding: 11px 12px;
  }
}

/* ── Accessibility ──────────────────────────────────── */
.skip-link {
  position: absolute;
  right: -9999px;
  top: 8px;
  z-index: 1000;
  background: var(--primary-strong);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-s);
  font-size: 15px;
  text-decoration: none;
}

.skip-link:focus {
  right: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Beta: account card (in sidebar), login overlay, quota, upgrade, toast ── */
/* Lives in the sidebar so it's visible on desktop (sidebar is always shown)
   and on mobile inside the hamburger drawer. margin-top:auto pins it to the
   bottom, directly above the footer. */
.account-bar {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-soft);
  font-size: 13px;
}
.account-bar[hidden] { display: none; }
.account-bar:not([hidden]) + .sidebar-footer { margin-top: 0; }
.account-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.account-name {
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-quota {
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  text-align: center;
}
.account-reset {
  color: var(--primary-strong);
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 4px 10px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.account-trial {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 1px solid #bfdedc;
  border-radius: var(--radius-s);
  padding: 7px 9px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.account-trial-ended {
  color: var(--warning);
  background: #fff7ed;
  border-color: #fed7aa;
}
.account-badge {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}
.account-actions {
  display: flex;
  gap: 8px;
}
.account-upgrade {
  flex: 1 1 auto;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  font-weight: 600;
  cursor: pointer;
}
.account-upgrade:hover { background: var(--accent-hover); }
.account-signout {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: var(--radius-s);
  padding: 8px 12px;
  cursor: pointer;
}
.account-signout:hover { background: var(--surface); filter: brightness(0.97); }

/* Login overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: linear-gradient(160deg, #0e4f4a 0%, #14233b 100%);
}
.login-overlay[hidden] { display: none; }
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-raised);
  padding: 32px 28px;
  text-align: center;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}
.login-logo { color: var(--primary-strong); }
.login-brand strong { font-size: 26px; color: var(--ink); }
.login-sub { color: var(--muted); font-size: 13px; }
.login-text { color: var(--ink-soft); margin: 0 0 22px; line-height: 1.6; }
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-m);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.google-btn:hover { background: var(--surface-soft); box-shadow: var(--shadow-soft); }
.google-icon { display: inline-flex; }
.login-legal { color: var(--muted); font-size: 12px; margin: 18px 0 0; line-height: 1.6; }
.login-legal a { color: var(--primary); }

/* Daily-limit banner inside the chat */
.limit-upgrade-btn {
  margin-top: 14px;
  width: 100%;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-m);
  padding: 13px 18px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.limit-upgrade-btn:hover { background: var(--accent-hover); }
.limit-upgrade-btn:active { transform: translateY(1px); }

/* Toast */
.beta-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-raised);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1100;
  max-width: 90vw;
  text-align: center;
}
.beta-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Beta admin dashboard ───────────────────────────────────────────── */
.dashboard-body { background: var(--bg); }
.dash-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.dash-header h1 { font-size: 24px; margin: 0; color: var(--ink); }
.dash-sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.dash-auth { display: flex; align-items: center; }
.dash-userrow { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.dash-auth .google-btn { width: auto; }
.dash-message {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  margin: 0 0 20px;
}
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-num { font-size: 30px; font-weight: 800; color: var(--primary-strong); }
.dash-label { color: var(--ink-soft); font-size: 13px; }
.dash-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.dash-section-head h2 { font-size: 18px; margin: 0; color: var(--ink); }
.dash-pill {
  background: var(--surface-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}
.dash-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}
.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dash-table th, .dash-table td {
  text-align: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dash-table thead th { color: var(--ink-soft); font-weight: 600; background: var(--surface-soft); }
.dash-table tbody tr:last-child td { border-bottom: 0; }
.dash-tag {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  background: var(--surface-soft);
  color: var(--muted);
}
.dash-tag-on { background: var(--primary-soft); color: var(--primary-strong); }
.dash-empty { color: var(--muted); padding: 18px; margin: 0; text-align: center; }

/* ── "Find the right appendix" guiding questions (facet chips) ───────── */
.facet-card { display: block; }
.facet-prompt { margin: 0 0 4px; font-weight: 700; color: var(--ink); font-size: 15px; }
.facet-sub { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.year-fallback-note {
  padding: 9px 11px;
  border: 1px solid #e5c879;
  border-radius: var(--radius-m);
  background: #fff9e8;
  color: #76540a;
  font-weight: 700;
}
.facet-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.facet-files { flex-direction: column; }
.facet-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.facet-chip:hover { background: var(--primary-soft); border-color: var(--primary); }
.facet-chip:active { transform: scale(0.97); }
.facet-chip .facet-count {
  background: var(--surface-soft);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
}
.facet-chip.chosen {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.facet-chip.chosen .facet-count { background: rgba(255, 255, 255, 0.25); color: #fff; }
.facet-chip:disabled { opacity: 0.55; cursor: default; }
.facet-chip.chosen:disabled { opacity: 1; }
/* "open document / ask the AI" choice shown right after a policy is locked:
   full-width stacked actions, the primary "ask" one filled. */
.facet-options:has(.policy-choice) { flex-direction: column; }
.facet-chip.policy-choice {
  width: 100%;
  justify-content: center;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 15px;
}
.facet-chip.policy-choice[data-choice="ask"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.facet-chip.policy-choice[data-choice="ask"]:hover { filter: brightness(1.05); }
/* file pick-list chips: full-width, right-aligned, wrap long names */
.file-chip {
  display: block;
  width: 100%;
  text-align: start;
  border-radius: var(--radius-m);
  white-space: normal;
  line-height: 1.5;
}

/* ── Comparison view (live) ──────────────────────────────────────────────── */
/* Overrides the teaser's no-scroll/hidden: this is now an interactive view. */
.compare-shell {
  overflow-y: auto;
  overflow-x: hidden;
  position: relative; /* anchor for the registration gate overlay */
}

/* The compare view toggles visibility with the [hidden] attribute, but several
   of its elements set an explicit display (flex/grid), which would otherwise
   override the UA's low-specificity [hidden]{display:none}. Force it. */
.compare-shell [hidden] { display: none !important; }

.cmp-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  flex: 1 1 auto;
  min-height: 0;
}

.cmp-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 12px;
}

.cmp-profile-grid .meta-field { margin: 0; }

.cmp-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.cmp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  background: var(--surface-soft);
}

.cmp-toggle input { accent-color: var(--primary); width: 16px; height: 16px; }
.cmp-toggle:has(input:checked) {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: var(--primary-soft);
}

/* ── Policy slots ── */
.cmp-slots { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }

.cmp-slot {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  padding: 10px;
  background: var(--surface-soft);
}
.cmp-slot.is-resolved { border-color: var(--primary); background: var(--primary-soft); }

.cmp-slot-search { display: flex; gap: 6px; align-items: center; }
.cmp-slot-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
.cmp-slot-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.cmp-slot-go {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-s);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.cmp-slot-go:hover { background: var(--accent-hover); }

.cmp-slot-remove {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.cmp-slot-remove:hover { color: var(--danger); border-color: var(--danger); }

.cmp-wizard { margin-top: 10px; }
.cmp-wiz-loading { font-size: 13px; color: var(--muted); padding: 6px 2px; }
.cmp-wiz-prompt { margin: 0 0 2px; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.cmp-wiz-sub { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.cmp-wiz-none { margin: 6px 2px 0; font-size: 13px; color: var(--warning); }

/* Resolved slot card — company + year revealed only here, after picking. */
.cmp-slot-resolved { display: flex; flex-direction: column; gap: 10px; }
.cmp-slot-id { display: flex; align-items: center; gap: 10px; }
.cmp-slot-id .company-logo {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--primary-strong);
  font-weight: 800;
  font-size: 13px;
}
.cmp-slot-meta { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.cmp-slot-title { font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-slot-sub { font-size: 12.5px; color: var(--primary-strong); }
.cmp-slot-replace {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--primary-strong);
  font: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer;
}
.cmp-slot-replace:hover { background: var(--surface); border-color: var(--primary-strong); }

.cmp-premium { display: flex; flex-direction: column; gap: 4px; }
.cmp-premium span { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.cmp-premium-input {
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
.cmp-premium-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.cmp-add-slot {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--primary-strong);
  font: inherit; font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}
.cmp-add-slot:hover { background: var(--primary-soft); border-color: var(--primary); }

.policy-compare-card { margin-bottom: 18px; }
.policy-compare-form { display: grid; gap: 12px; }
.cmp-question-field { display: grid; gap: 6px; }
.cmp-question-field > span { font-size: 13px; font-weight: 700; color: var(--ink); }
.cmp-question-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  line-height: 1.55;
  box-sizing: border-box;
}
.cmp-question-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.cmp-question-example {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.cmp-question-example:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.cmp-inline-error { margin: 0 0 12px; color: var(--danger); font-size: 13px; font-weight: 600; }

/* ── Results side ── */
.cmp-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-soft);
}
.cmp-empty-icon {
  display: grid; place-items: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  margin-bottom: 6px;
}
.cmp-empty h2 { margin: 0; font-size: 19px; color: var(--ink); }
.cmp-empty p { margin: 0; max-width: 420px; font-size: 13.5px; line-height: 1.6; }

.cmp-results { display: flex; flex-direction: column; gap: 16px; }
.cmp-loading { display: grid; place-items: center; padding: 48px 0; }
.cmp-loading-note { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.cmp-ai-answer {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  padding: 18px;
  background: var(--surface);
}
.cmp-ai-answer h3 { margin: 0 0 12px; color: var(--ink); }
.cmp-answer-text { color: var(--ink); line-height: 1.75; }
.cmp-answer-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cmp-source-button {
  border: 1px solid var(--primary);
  border-radius: var(--radius-s);
  padding: 8px 11px;
  background: var(--surface);
  color: var(--primary-strong);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.cmp-source-button:hover { background: var(--primary-soft); }

.cmp-reco-chip {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12.5px;
  font-weight: 600;
  margin: 0 0 6px;
}
.cmp-vfm { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.cmp-vfm strong { color: var(--primary-strong); }

/* Best cell in a row + parameter-relevance dot */
.cmp-table tbody td.cmp-cell-best { font-weight: 800; color: var(--primary-strong); }
.cmp-table tbody td.cmp-muted-cell { color: var(--muted); }
.cmp-weight-dot { color: var(--primary); font-size: 9px; vertical-align: middle; }
.cmp-src {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--blue);
  font-size: 11px;
  cursor: pointer;
}
.cmp-src:hover { background: var(--blue-soft); border-color: var(--blue); }

.cmp-caveats {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.cmp-caveats p { margin: 0 0 6px; font-size: 12px; line-height: 1.6; color: var(--muted); }

@media (max-width: 900px) {
  .cmp-layout { grid-template-columns: 1fr; }
  .compare-shell { padding: 18px 16px 22px; }
}

@media (max-width: 520px) {
  .cmp-profile-grid { grid-template-columns: 1fr; }
  .cmp-toggle { flex: 1 1 auto; justify-content: center; }
  .compare-gate-card { padding: 22px 18px; }
  .cmp-slot-search { flex-wrap: wrap; }
  .cmp-slot-input { flex: 1 1 100%; }
}

/* Compare control inputs: native selects restyled with an RTL chevron. */
.cmp-control select,
.cmp-text-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
.cmp-control select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-inline-start: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238492a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  background-size: 12px;
  cursor: pointer;
}
.cmp-control select:focus,
.cmp-text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.cmp-field-hint { margin: 5px 2px 12px; font-size: 11.5px; color: var(--muted); }

.cmp-family-extra {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cmp-family-extra .cmp-profile-grid { margin: 0; }

.cmp-est-tag {
  display: inline-block;
  margin-inline-start: 5px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warning);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.cmp-doc-tag { background: var(--blue); }

/* Wizard escape-hatch actions (chat + compare): change company / not found. */
.facet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.facet-alt {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  border-radius: var(--radius-m);
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.facet-alt:hover { background: var(--surface-soft); border-color: var(--primary); }
.facet-alt:disabled { opacity: 0.55; cursor: default; }
.facet-notfound { color: var(--danger); }
.facet-notfound:hover { background: var(--surface-soft); border-color: var(--line-strong); }

/* Floating round "back" arrow + "חזור" caption, fully outside the wizard card,
   centered in the avatar column (below the AI avatar), vertically centered on
   the card. The wrapper (not the button) carries the position. */
.facet-card { position: relative; }
.facet-back-wrap {
  position: absolute;
  top: 50%;
  right: -50px; /* 13px gap + centered under the 40px avatar column */
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.facet-back-float {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  padding: 0;
}
.facet-back-float:hover { background: var(--surface-soft); border-color: var(--primary); }
.facet-back-float:disabled { opacity: 0.55; cursor: default; }
.facet-back-float:disabled + .facet-back-caption { opacity: 0.55; }
/* A step the agent has moved past (its buttons disabled) is no longer "back"-able
   from here, so hide the arrow entirely instead of showing a greyed-out dead
   button on every old card in the transcript. Re-appears automatically the
   moment this card is reactivated (its button becomes enabled again). */
.facet-back-wrap:has(.facet-back-float:disabled) { display: none; }
.facet-back-caption {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* ── Bureau market comparison (the live part of the compare tab) ─────────── */
.bureau-card { flex: 0 0 auto; }
.bureau-form { display: flex; gap: 10px; }
.bureau-form .cmp-text-input { flex: 1 1 auto; }
.bureau-ask-btn { width: auto; margin-top: 0; min-height: 42px; padding: 0 26px; }
.bureau-answer { margin-top: 14px; }
.bureau-answer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.bureau-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
}
.bureau-answer-text {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.bureau-result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.bureau-result-title {
  margin: 0;
  padding: 14px 16px 6px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}
.bureau-conclusions {
  margin: 6px 16px 18px;
  padding: 11px 14px;
  border: 1px solid #c6e0dd;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.bureau-bottom-line {
  margin: 0;
  max-width: 1100px;
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.7;
}
.bureau-section-title {
  margin: 0;
  padding: 0 16px 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}
.bureau-group-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  list-style: none;
  cursor: pointer;
}
.bureau-group-details > summary::-webkit-details-marker { display: none; }
.bureau-group-label { display: block; }
.bureau-diff-count {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 650;
}
.bureau-diff-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}
.bureau-diff-action {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.bureau-diff-action::after { content: " +"; }
.bureau-group-details[open] .bureau-diff-action::after { content: " −"; }
.bureau-group-details[open] .bureau-diff-preview { display: none; }
.bureau-diff-action-close { display: none; }
.bureau-group-details[open] .bureau-diff-action-open { display: none; }
.bureau-group-details[open] .bureau-diff-action-close { display: inline; }
.bureau-diff-body {
  padding: 0 12px 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.bureau-diff-body ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2px 22px;
  margin: 0;
  padding: 9px 18px 0 0;
}
.bureau-diff-body li {
  padding: 5px 0;
  break-inside: avoid;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.55;
}
.bureau-diff-item-text { display: block; }
.bureau-diff-item-detail {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
}
@media (hover: hover) and (pointer: fine) {
  .bureau-group-details:not([open]):hover > .bureau-diff-body,
  .bureau-group-details:not([open]):focus-within > .bureau-diff-body {
    display: block;
  }
}
.bureau-table-wrap {
  overflow-x: auto;
  border-block: 1px solid var(--line);
}
.bureau-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
}
.bureau-table th,
.bureau-table td {
  padding: 11px 13px;
  border-inline-start: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}
.bureau-table tr:last-child th,
.bureau-table tr:last-child td { border-bottom: 0; }
.bureau-table th:first-child,
.bureau-table td:first-child { border-inline-start: 0; }
.bureau-table thead th {
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}
.bureau-table tbody th {
  width: 180px;
  background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
  color: var(--ink);
  font-weight: 750;
}
.bureau-winning-value {
  font-weight: 850;
}
.bureau-advantage-cell {
  width: 180px;
}
.bureau-advantage-label {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}
.bureau-advantage-label-winner {
  color: var(--primary-strong);
  font-weight: 850;
}
.bureau-advantage-label-empty { color: var(--muted); }
.bureau-advantage-reason {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
}
.bureau-group-row > .bureau-group-content { padding: 0; }
.bureau-table .bureau-group-row > th {
  font-size: 12.5px;
}
.bureau-table .bureau-table-section-row > th {
  width: auto;
  padding: 13px 16px 9px;
  border-inline-start: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.bureau-source-cell {
  width: 88px;
  white-space: nowrap;
}
.bureau-page-ref {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.bureau-page-ref-empty { background: var(--surface-soft); color: var(--muted); }
.bureau-recommendations {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.bureau-recommendations > h4 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}
.bureau-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px 28px;
}
.bureau-recommendation {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.bureau-recommendation h5 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.bureau-recommendation ul {
  margin: 0;
  padding: 0 20px 0 0;
}
.bureau-recommendation li,
.bureau-recommendation p {
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.6;
}
.bureau-recommendation li + li { margin-top: 3px; }
.bureau-recommendation p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}
.bureau-notes {
  margin: 0;
  padding: 12px 34px 14px 16px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}
.bureau-notes li + li { margin-top: 4px; }
@media (max-width: 520px) {
  .bureau-form { flex-wrap: wrap; }
  .bureau-ask-btn { width: 100%; }
  .bureau-result-title { font-size: 15px; }
  .bureau-bottom-line { font-size: 13px; }
  .bureau-group-details > summary { min-height: 38px; }
  .bureau-table { min-width: 680px; font-size: 12.5px; }
  .bureau-recommendation-grid { grid-template-columns: 1fr; }
}
.bureau-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.bureau-example {
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.bureau-example:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: var(--primary-soft);
}

/* ── Comparison registration gate (registered users only) ────────────────── */
.compare-gate { display: none; }
body.compare-locked .compare-gate {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 24px;
  background: rgba(238, 241, 247, 0.3);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
/* Tease the real tool behind the gate — light blur so it stays visible. */
body.compare-locked .cmp-layout {
  filter: blur(1px);
  pointer-events: none;
  user-select: none;
}
/* Behind the gate show a sample table instead of the empty state; revert on unlock. */
#compareDemo { display: none; }
body.compare-locked #compareDemo { display: flex; flex-direction: column; gap: 16px; }
body.compare-locked #cmpEmpty { display: none !important; }
.compare-gate-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 30px 34px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-raised);
}
.compare-gate-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.compare-gate-card h2 { margin: 4px 0 0; font-size: 21px; color: var(--ink); }
.compare-gate-card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.compare-gate-btn {
  margin-top: 8px;
  padding: 12px 26px;
  border: none;
  border-radius: var(--radius-m);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.compare-gate-btn:hover { background: var(--accent-hover); }


/* ── PWA "הוסף למסך הבית" — באנר התקנה (Android) + בועת הדרכה (iOS) ─────────
   הסגנונות כאן (ולא מוזרקים מ-JS) כי ה-CSP הוא style-src 'self' בלי
   unsafe-inline — <style> מוזרק נחסם. ראו static/pwa-install.js. */
.pwa-banner {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  width: min(440px, calc(100vw - 24px));
  z-index: 2147483000;
  direction: rtl;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}
.pwa-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.pwa-card {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-raised);
  padding: 14px 14px 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pwa-ico {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-m);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pwa-ico svg { width: 26px; height: 26px; }
.pwa-body { flex: 1 1 auto; min-width: 0; }
.pwa-title { font-weight: 700; font-size: .95rem; line-height: 1.3; margin: 0; }
.pwa-sub { font-size: .82rem; color: var(--ink-soft); margin: 2px 0 0; line-height: 1.45; }
.pwa-cta {
  flex: 0 0 auto;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease;
}
.pwa-cta:hover { background: var(--accent-hover); }
.pwa-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-s);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.pwa-close:hover { background: var(--surface-soft); color: var(--ink); }
/* בועת iOS עם חץ למטה (לכיוון כפתור השיתוף) */
.pwa-banner.ios .pwa-card {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-bottom: 16px;
}
.pwa-ios-head { display: flex; align-items: flex-start; gap: 10px; }
.pwa-ios-text { font-size: .9rem; line-height: 1.5; color: var(--ink); margin: 0; flex: 1 1 auto; }
.pwa-ios-text .pwa-share { display: inline-flex; vertical-align: -3px; margin: 0 2px; }
.pwa-banner.ios::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%) rotate(45deg);
  width: 18px;
  height: 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-bottom-right-radius: 3px;
}
@media (max-width: 380px) {
  .pwa-title { font-size: .9rem; }
  .pwa-cta { padding: 9px 12px; }
}

/* ── איתור רופא חכם (Find a Doctor) ───────────────────────────────────────── */
.doctor-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dr-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.dr-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.dr-search {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.dr-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  font: inherit;
  font-size: 16px; /* avoid iOS zoom */
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.dr-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.dr-search-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius-m);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dr-search-btn:hover { background: var(--accent-hover); }
.dr-search-btn.is-loading { opacity: 0.7; cursor: default; }

.dr-results { display: flex; flex-direction: column; gap: 16px; }

.dr-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 12px 2px;
}
.dr-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: dr-spin 0.7s linear infinite;
}
@keyframes dr-spin { to { transform: rotate(360deg); } }

.dr-error {
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
}

.dr-answer {
  border: 1px solid #bfdedc;
  background: linear-gradient(180deg, var(--primary-soft), var(--surface) 70%);
  border-radius: var(--radius-l);
  padding: 16px 18px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.7;
}

/* "האם התכוונתם" chips under a no-result answer */
.dr-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dr-suggest-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px dashed var(--primary);
  color: var(--primary);
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.dr-suggest-btn:hover {
  background: var(--primary-soft);
}

.dr-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.dr-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dr-card-head { display: flex; align-items: center; gap: 12px; }
/* Copy-to-client button: name + location (+ phone when available) as text. */
.dr-copy {
  margin-inline-start: auto;
  align-self: flex-start;
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  border-radius: var(--radius-m);
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.dr-copy:hover { background: var(--surface-soft); border-color: var(--primary); }
.dr-copy.copied { color: var(--primary); border-color: var(--primary); font-weight: 700; }
.dr-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.dr-card-id { min-width: 0; }
.dr-card-id h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}
.dr-card-spec {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.dr-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dr-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
}
.dr-tag-ins { background: var(--primary-soft); color: var(--primary-strong); border: 1px solid #bfdedc; }
.dr-tag-hmo { background: var(--surface-soft); color: var(--ink-soft); border: 1px solid var(--line-strong); }

.dr-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.dr-meta-item { font-size: 12.5px; color: var(--muted); }

/* Numbered page navigation under the results grid. */
.dr-pager-wrap { margin-top: 18px; }
.dr-pager {
  display: flex;
  direction: ltr;               /* keep 1→N ascending left-to-right */
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.dr-page {
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  border-radius: var(--radius-m);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.dr-page:hover { border-color: var(--primary); background: var(--surface-soft); }
.dr-page.current { border-color: var(--primary); color: var(--primary); font-weight: 800; cursor: default; }
.dr-page-nav { background: var(--primary); border-color: var(--primary); color: #fff; }
.dr-page-nav:hover { background: var(--primary); color: #fff; }
.dr-page:disabled { opacity: 0.55; cursor: default; }
.dr-pager-info { text-align: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* Sources / coverage panel */
.dr-freshness {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.dr-freshness:empty { display: none; }
.dr-freshness-icon {
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 14%, transparent);
}
.dr-freshness.is-current { border: 0; background: transparent; box-shadow: none; padding: 3px 0; gap: 8px; align-items: center; }
.dr-freshness.is-current .dr-freshness-icon { background: var(--success); width: 7px; height: 7px; margin-top: 0; box-shadow: none; }
.dr-freshness.is-pending .dr-freshness-icon { background: #d99100; box-shadow: 0 0 0 4px rgba(217,145,0,.14); }
.dr-freshness.is-stale,
.dr-freshness.is-incomplete { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.dr-freshness.is-stale .dr-freshness-icon,
.dr-freshness.is-incomplete .dr-freshness-icon { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }
.dr-freshness-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dr-freshness-copy strong { color: var(--ink); font-size: 13.5px; }
.dr-freshness-copy > span { color: var(--ink-soft); font-size: 12.5px; }
.dr-freshness-copy .dr-freshness-meta { color: var(--muted); font-size: 11.5px; }
.dr-freshness-warning { margin-top: 3px; color: var(--danger); font-size: 11.5px; font-weight: 700; }
.dr-freshness.is-current .dr-freshness-copy { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.dr-freshness.is-current .dr-freshness-copy strong { font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }
.dr-freshness.is-current .dr-freshness-copy > span:not(.dr-freshness-meta) { display: none; }
.dr-freshness.is-current .dr-freshness-meta { font-size: 12px; }
.dr-sources {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dr-sources:empty { display: none; }
.dr-src-title { font-size: 13px; font-weight: 800; color: var(--ink); }
.dr-src-group { display: flex; flex-direction: column; gap: 7px; }
.dr-src-group h3 {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.dr-src-list { display: flex; flex-wrap: wrap; gap: 7px; }
.dr-src {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  background: var(--surface-soft);
}
.dr-src-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.dr-src.is-live .dr-src-dot { background: var(--success); }
.dr-src.is-soon .dr-src-dot { background: var(--muted); }
.dr-src-name { font-weight: 700; color: var(--ink); }
.dr-src.is-live .dr-src-fresh { color: var(--success); font-weight: 600; }
.dr-src.is-soon .dr-src-fresh { color: var(--muted); }
.dr-src.is-soon { opacity: 0.8; }

@media (max-width: 720px) {
  .doctor-shell { padding: 18px 14px 22px; }
  .dr-head h1 { font-size: 21px; }
  .dr-search { flex-direction: column; }
  .dr-search-btn { padding: 12px; justify-content: center; }
  .dr-cards { grid-template-columns: 1fr; }
}

/* ── סרטוני הדרכה view ─────────────────────────────────────────────────── */
.video-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.vid-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
}

.vid-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.vid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  align-items: start;
}

.vid-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.vid-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-m);
  background: #000;
}

.vid-card h3 {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.vid-card p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.vid-grid-android-install {
  display: block;
}

.android-app-banner {
  width: min(100%, 1000px);
  margin: 12px auto 0;
}

.android-app-download {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.android-app-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(14, 79, 74, .16);
}

.android-app-download:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 3px;
}

.android-app-download img {
  display: block;
  width: 100%;
  height: auto;
}

.android-app-download:disabled {
  cursor: default;
  transform: none;
}

.android-install-wait {
  margin-top: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  text-align: center;
}

.android-install-wait p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.android-install-diagnostics {
  margin: 12px 0;
  text-align: start;
}

.android-install-diagnostics summary {
  cursor: pointer;
}

.android-install-diagnostics pre {
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
}

.android-installed-card {
  width: min(100%, 680px);
  margin: 12px auto 0;
  padding: 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.android-installed-card > img {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 21px;
  box-shadow: 0 8px 22px rgba(14, 79, 74, .18);
}

.android-installed-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.android-installed-copy p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.android-app-open {
  min-width: 160px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.android-app-open:hover { background: var(--accent-hover); }

.android-app-retry { margin-top: 12px; }

.android-installing-card {
  grid-template-columns: auto minmax(0, 1fr);
}

.android-install-spinner {
  width: 54px;
  height: 54px;
  border: 6px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: android-install-spin .85s linear infinite;
}

@keyframes android-install-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .android-install-spinner { animation: none; }
}

.user-message .msg-meta-row {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: space-between;
  column-gap: 10px;
  min-width: 110px;
  margin-top: 8px;
  direction: ltr;
}

.user-message .msg-meta-row time,
.user-message .msg-meta-row .msg-edit-btn {
  margin-top: 0;
}

.user-message .msg-meta-row time {
  grid-column: 1;
  justify-self: start;
  direction: ltr;
  text-align: left;
}

.user-message .msg-meta-row .msg-edit-btn {
  grid-column: 2;
  justify-self: end;
  direction: rtl;
  white-space: nowrap;
}

.user-message .msg-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.user-message .msg-edit-btn:hover { color: var(--ink); border-color: var(--ink-soft); }
/* מסכי מגע: אזור לחיצה נדיב יותר לאצבע */
@media (pointer: coarse) {
  .user-message .msg-edit-btn { padding: 7px 14px; font-size: 13px; }
}

/* Keep the action compact enough to share the footer row on narrow phones. */
@media (max-width: 720px) {
  .user-message .msg-meta-row .msg-edit-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
}

.vid-empty {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 46px 20px;
  text-align: center;
  color: var(--ink-soft);
}

.vid-empty-icon { display: inline-block; margin-bottom: 10px; }
.vid-empty h2 { margin: 0 0 6px; font-size: 19px; color: var(--ink); }
.vid-empty p { margin: 0; font-size: 14px; }

@media (max-width: 720px) {
  .video-shell { padding: 18px 14px 22px; }

  .android-app-banner {
    margin-top: 4px;
  }

  .android-installed-card {
    margin-top: 4px;
    padding: 22px 18px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
    text-align: center;
  }

  .android-installed-card > img {
    width: 82px;
    height: 82px;
  }

  .android-app-open {
    width: 100%;
    min-height: 48px;
  }
}

/* ── פליירים ─────────────────────────────────────────────────────────────── */
.flyer-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fly-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ink);
}

.fly-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.fly-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.fly-control {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.fly-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.fly-field select,
.fly-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  padding: 9px 12px;
}

.fly-field select:focus,
.fly-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.fly-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding-inline-end: 2px;
}

.fly-product {
  /* The scrollable flex list must not compress long document titles down to
     the minimum card height, leaving the title/metadata outside its border. */
  flex: 0 0 auto;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-soft);
  color: var(--ink);
  text-align: start;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.fly-product:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.fly-product.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-accent);
}

.fly-product-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.fly-product-pages {
  font-size: 12.5px;
  color: inherit;
  opacity: 0.75;
}

.fly-main {
  min-width: 0;
}

/* Like .compare-shell: explicit display (grid) would override the UA's
   [hidden]{display:none}, leaving the empty card visible behind a selection. */
.flyer-shell [hidden] { display: none !important; }

.fly-empty,
.fly-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.fly-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  color: var(--ink-soft);
}

.fly-empty-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
}

.fly-empty h2 {
  margin: 0;
  font-size: 20px;
  color: var(--ink);
}

.fly-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fly-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fly-card-icon {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.fly-card-title {
  min-width: 0;
}

.fly-card-title p {
  margin: 0 0 4px;
  color: var(--primary-strong);
  font-weight: 800;
  font-size: 13px;
}

.fly-card-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.fly-details {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fly-details div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-soft);
  padding: 11px 12px;
}

.fly-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 4px;
}

.fly-details dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.fly-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fly-action {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.fly-action.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-accent);
}

.fly-action:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.fly-action.primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.fly-action:disabled {
  opacity: 0.65;
  cursor: default;
}

.fly-status {
  min-height: 18px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.fly-loading,
.fly-inline-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 4px;
}

/* Category heading inside the ידע מקצועי file list */
.fly-group-title {
  margin: 10px 2px 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.knowledge-add-button {
  width: 100%;
  margin-top: 2px;
  border-style: dashed;
  color: var(--primary);
}

.knowledge-upload-form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface-soft);
}

.knowledge-upload-form[hidden] { display: none; }

.knowledge-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
}

.knowledge-upload-head button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 23px;
  cursor: pointer;
}

.knowledge-upload-head button:hover { background: var(--surface); color: var(--ink); }

.knowledge-upload-form input,
.knowledge-upload-form select,
.knowledge-upload-form textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
}

.knowledge-upload-form textarea { resize: vertical; }
.knowledge-upload-form .fly-action { width: 100%; }

@media (max-width: 900px) {
  .fly-layout { grid-template-columns: 1fr; }
  .fly-products { max-height: none; }
}

@media (max-width: 720px) {
  .flyer-shell { padding: 18px 14px 22px; }
  .fly-head h1 { font-size: 21px; }
  .fly-details { grid-template-columns: 1fr; }
  .fly-actions { flex-direction: column; }
  .fly-action { width: 100%; }
}

/* ── תוכניות תשלום ─────────────────────────────────────────────────────── */
.pricing-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 36px 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background:
    linear-gradient(176deg, rgba(228, 239, 237, 0.74) 0 31%, transparent 31.2%),
    var(--bg);
}

.pricing-head {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
}

.pricing-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
}

.pricing-head p {
  margin: 0;
  max-width: 760px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.65;
}

.pricing-billing {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.pricing-billing-option {
  min-width: 132px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
}

.pricing-billing-option.active {
  background: var(--blue);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(14, 79, 74, 0.13), 0 8px 18px rgba(37, 99, 201, 0.22);
}

.pricing-billing-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pricing-grid {
  display: grid;
  grid-template-columns: minmax(0, 620px);
  justify-content: center;
  gap: 18px;
  align-items: stretch;
  margin-top: 8px;
  padding-bottom: 34px;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 470px;
  padding: 52px 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 2px rgba(20, 35, 59, 0.04), 0 18px 38px rgba(20, 35, 59, 0.08);
  text-align: center;
  overflow: hidden;
}

.pricing-card-stack {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pricing-card-stack .pricing-card {
  flex: 1 1 auto;
  width: 100%;
}

.pricing-card-featured {
  border: 2px solid #2563eb;
  transform: translateY(-14px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 24px 46px rgba(37, 99, 201, 0.14);
}

.pricing-card-unlimited.pricing-card-featured {
  border-color: #f97316;
  transform: none;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 24px 46px rgba(249, 115, 22, 0.14);
}

.pricing-top-line {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 8px;
  background: var(--success);
}

.pricing-card-featured .pricing-top-line {
  background: var(--blue);
}

.pricing-card-unlimited .pricing-top-line {
  background: #f97316;
}

.pricing-card-enterprise .pricing-top-line {
  background: #94a3b8;
}

.pricing-ribbon {
  position: absolute;
  inset-block-start: 18px;
  inset-inline: 0;
  width: fit-content;
  margin-inline: auto;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.pricing-ribbon-popular {
  background: #fef08a;
  color: #1f2937;
  font-weight: 900;
}

/* Marking of the plan the user is currently subscribed to (see
   markCurrentPlanCard in app.js). */
.pricing-ribbon-current {
  background: var(--accent);
  color: var(--on-accent);
}

.pricing-card-current {
  border: 2px solid var(--accent);
}

.pricing-card-current .pricing-ribbon-popular {
  display: none;
}

.pricing-card-current .pricing-action-cancel {
  border: 2px solid #dc2626;
  background: transparent;
  color: #dc2626;
}

.pricing-card-current .pricing-action-cancel:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.pricing-card-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pricing-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.pricing-card-featured .pricing-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.pricing-card-unlimited .pricing-icon {
  background: #fff1e8;
  color: #f97316;
}

.pricing-card-enterprise .pricing-icon {
  background: #eef2ff;
  color: #334155;
}

.pricing-card h2 {
  margin: 0;
  color: var(--primary-strong);
  font-size: 22px;
  font-weight: 800;
}

.pricing-card-featured h2 { color: var(--blue); }
.pricing-card-unlimited h2 { color: #f97316; }
.pricing-card-enterprise h2 { color: #334155; }

.pricing-kicker {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 7px 18px;
  border: 1px solid #b8e1c9;
  border-radius: 999px;
  color: var(--success);
  font-size: 12.5px;
  font-weight: 800;
}

.pricing-card-featured .pricing-kicker {
  border-color: #facc15;
  background: #fef08a;
  color: #1f2937;
  font-weight: 900;
}

.pricing-card-unlimited .pricing-kicker {
  border-color: #ffd1b3;
  background: transparent;
  color: #f97316;
}

.pricing-card-enterprise .pricing-kicker {
  border-color: #cbd5e1;
  color: #334155;
}

.pricing-coupon-trigger {
  appearance: none;
  background: transparent;
  font-family: inherit;
  line-height: inherit;
  cursor: default;
}

.pricing-price {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 48px;
  font-weight: 500;
  line-height: 1.1;
}

.pricing-price span {
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 600;
}

.pricing-price-before {
  display: block;
  margin-bottom: 4px;
  color: #94a3b8 !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.1;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.pricing-price-current {
  display: inline-block;
  color: var(--ink) !important;
  font-size: 48px !important;
  font-weight: 500 !important;
  line-height: 1.1;
}

.pricing-price-current span {
  color: var(--ink-soft) !important;
  font-size: 17px !important;
  font-weight: 600 !important;
}

.pricing-discount-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 8px auto 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.pricing-price-custom {
  max-width: 260px;
  margin-inline: auto;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.22;
}

.pricing-sub {
  margin: -6px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.pricing-list {
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
  row-gap: 10px;
  list-style: none;
  text-align: start;
}

.pricing-list li {
  position: relative;
  padding-inline-start: 22px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.pricing-list li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  color: var(--success);
  font-weight: 900;
}

.pricing-action {
  width: 100%;
  min-height: 62px;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  transition: background 0.15s, transform 0.15s;
}

.pricing-action:hover { background: var(--accent-hover); }
.pricing-action:active { transform: translateY(1px); }
.pricing-action:disabled { opacity: 0.7; cursor: default; transform: none; }

.pricing-card-featured .pricing-action {
  background: #2563eb;
  color: #fff;
}

.pricing-card-featured .pricing-action:hover {
  background: #1d4ed8;
}

.pricing-card-unlimited .pricing-action {
  border: 2px solid #f97316;
  background: transparent;
  color: #f97316;
}

.pricing-card-unlimited .pricing-action:hover {
  background: #fff7ed;
  color: #ea580c;
}

.pricing-card-enterprise .pricing-action {
  border: 2px solid #94a3b8;
  background: transparent;
  color: #334155;
}

.pricing-card-enterprise .pricing-action:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.pricing-enterprise-action[hidden] {
  display: none;
}

.pricing-coupon-form {
  width: 100%;
  margin-top: 8px;
  padding: 15px;
  display: grid;
  gap: 10px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-m);
  background: rgba(248, 250, 252, 0.9);
  text-align: start;
}

.pricing-coupon-form[hidden] {
  display: none;
}

.pricing-coupon-form label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.pricing-coupon-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.pricing-coupon-row input,
.pricing-coupon-row button {
  min-height: 46px;
  border-radius: 10px;
  font: inherit;
}

.pricing-coupon-row input {
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  direction: ltr;
  text-align: start;
  text-transform: uppercase;
}

.pricing-coupon-row input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}

.pricing-coupon-row button {
  padding: 0 14px;
  border: 0;
  background: #334155;
  color: #fff;
  font-weight: 800;
}

.pricing-coupon-row button:disabled {
  opacity: 0.65;
}

.pricing-coupon-status {
  min-height: 20px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
}

.pricing-coupon-status.is-success {
  color: #15803d;
}

.pricing-coupon-status.is-error {
  color: #b91c1c;
}

.pricing-coupon-applied {
  outline: 3px solid rgba(22, 163, 74, 0.14);
}

.pricing-action-muted {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.pricing-action-muted:hover {
  background: var(--surface-soft);
  color: var(--primary-strong);
}

@media (max-width: 900px) {
  .pricing-shell { padding: 18px 16px 22px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card-featured { transform: none; }
}

@media (max-width: 520px) {
  .pricing-head h1 { font-size: 21px; }
  .pricing-card { padding: 16px; }
  .pricing-list { grid-template-columns: 1fr; }
  .pricing-billing-option { min-width: 116px; font-size: 14px; }
  .pricing-price { font-size: 36px; }
  .pricing-coupon-row { grid-template-columns: 1fr; }
}

/* ── Dark-mode contrast fixes for late-defined components ────────────────────
   These live AFTER the base rules on purpose: the main dark block (~L1905)
   themes via CSS variables, but a direct color override only wins the cascade
   if it comes after the base declaration. The enterprise heading (#334155) and
   the doctor-tag border (#bfdedc) are near-invisible / clashing on dark. */
@media (prefers-color-scheme: dark) {
  .pricing-card-enterprise h2 { color: #cbd5e1; }
  .pricing-card-enterprise .pricing-icon { background: #1b2735; color: #cbd5e1; }
  .dr-tag-ins { border-color: var(--line-strong); }
}
.access-locked { overflow: hidden; }
.access-locked .app-shell { visibility: hidden; pointer-events: none; }
.access-overlay { z-index: 100000; padding: 20px; overflow-y: auto; }
.access-card h1 { font-size: 24px; margin: 22px 0 12px; }
.access-email { overflow-wrap: anywhere; color: #0e4f4a; }
.access-card .google-btn { margin-top: 12px; }
.access-card [hidden] { display: none !important; }
.dr-forbes-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.dr-forbes-filter label { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.dr-forbes-filter select { min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--surface); color: var(--ink); font: inherit; }
.dr-forbes-badge { display: inline-flex; align-items: center; gap: 5px; margin: 4px 0; padding: 3px 9px; border: 1px solid #d2b567; border-radius: 999px; background: #fff4d5; color: #654600; font-size: 12px; font-weight: 700; }
