/* Wakeel · light premium theme: warm ivory, ink, deep emerald and bronze. */

:root {
  --canvas: #f5f2ec;
  --canvas-2: #ede8df;
  --paper: #ffffff;
  --paper-2: #fbfaf7;
  --line: #e6e0d4;
  --line-2: #efebe3;
  --ink: #15140f;
  --ink-2: #3b3831;
  --muted: #69645a;
  --faint: #938d81;
  --emerald: #0f3d33;
  --emerald-2: #185442;
  --emerald-soft: #e6efea;
  --bronze: #8f6a2a;
  --gold: #c9a55c;
  --gold-soft: #f5ecd8;
  --ok: #1f6b4a;
  --ok-soft: #e4f1ea;
  --bad: #a93a2e;
  --bad-soft: #f9e9e6;

  /* Dark focal surfaces */
  --night: #0d2620;
  --night-2: #0a1d18;
  --night-ink: #f4f0e6;
  --night-muted: #a9b5ae;
  --night-gold: #e2c88e;
  --night-sage: #9fd3b8;
  --night-coral: #f2a497;
  --night-line: rgba(244, 240, 230, 0.12);

  --serif: "Instrument Serif", "Amiri", Georgia, "Times New Roman", serif;
  --sans: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans-ar: "IBM Plex Sans Arabic", "Inter", system-ui, "Segoe UI", sans-serif;
  --serif-ar: "Amiri", "Instrument Serif", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(21, 20, 15, 0.05);
  --shadow: 0 1px 2px rgba(21, 20, 15, 0.04), 0 18px 40px -22px rgba(21, 20, 15, 0.18);
  --shadow-lg: 0 2px 4px rgba(21, 20, 15, 0.04), 0 40px 80px -36px rgba(21, 20, 15, 0.35);

  --radius: 24px;
  --radius-sm: 16px;
  --topbar-h: 68px;
  --banner-h: 32px;
  --footer-h: 64px;
  /* The three panes fill exactly what is left of the viewport once the hero is hidden. */
  --stage-h: calc(100vh - var(--topbar-h) - var(--banner-h) - var(--footer-h) - 28px);
}

@supports (height: 100dvh) {
  :root {
    --stage-h: calc(100dvh - var(--topbar-h) - var(--banner-h) - var(--footer-h) - 28px);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

[dir="rtl"] body {
  font-family: var(--sans-ar);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 560px at 85% -12%, rgba(201, 165, 92, 0.16), transparent 62%),
    radial-gradient(900px 600px at -12% 40%, rgba(15, 61, 51, 0.07), transparent 60%),
    var(--canvas);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.ico {
  width: 18px;
  height: 18px;
  flex: none;
}

.smallcaps {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

[dir="rtl"] .smallcaps {
  letter-spacing: 0;
  font-size: 13px;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  padding: 5px;
  border-radius: 10px;
  background: var(--emerald);
}

.brand-name {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
}

.brand-ar {
  font-family: var(--serif-ar);
  font-size: 22px;
  font-weight: 700;
  color: var(--bronze);
  margin-inline-start: 8px;
}

.brand-tag {
  padding-inline-start: 20px;
  border-inline-start: 1px solid var(--line);
  color: var(--muted);
}

.topbar-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.model-pill[data-mode="live"] .pulse-dot {
  background: #2f9e6c;
  box-shadow: 0 0 0 3px rgba(47, 158, 108, 0.18);
}

.model-pill[data-mode="mock"] .pulse-dot {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 165, 92, 0.22);
}

.model-pill[data-mode="no_key"] .pulse-dot {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(169, 58, 46, 0.16);
}

.lang-toggle {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 15px;
  font-family: var(--sans-ar);
  font-size: 14px;
  font-weight: 500;
}

[dir="rtl"] .lang-toggle {
  font-family: var(--sans);
}

.lang-toggle:hover {
  border-color: #d3cbbb;
}

.sim-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  height: var(--banner-h);
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  color: var(--bronze);
  background: var(--gold-soft);
  border-bottom: 1px solid #eadfc6;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

[dir="rtl"] .sim-banner {
  letter-spacing: 0;
  font-size: 12.5px;
}

.sim-icon {
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 9px 18px;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.btn:hover:not(:disabled) {
  border-color: #d3cbbb;
  box-shadow: 0 6px 16px -10px rgba(21, 20, 15, 0.35);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-lg {
  padding: 15px 28px;
  font-size: 15.5px;
}

.btn-small {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-primary,
.btn-light {
  color: #ffffff;
  background: var(--emerald);
  border-color: var(--emerald);
  box-shadow: 0 10px 24px -14px rgba(15, 61, 51, 0.8);
}

.btn-primary:hover:not(:disabled),
.btn-light:hover:not(:disabled) {
  background: var(--emerald-2);
  border-color: var(--emerald-2);
  box-shadow: 0 14px 28px -14px rgba(15, 61, 51, 0.85);
}

.btn-primary .ico {
  width: 14px;
  height: 14px;
}

.btn-light {
  padding: 8px 17px;
  font-size: 13.5px;
}

.btn-outline {
  color: var(--bronze);
  border-color: #e3d4b3;
  background: var(--paper);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.btn-danger-ghost {
  color: var(--bad);
  border-color: #efcdc7;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--line-2);
  color: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 80px 48px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 72px;
  align-items: center;
}

.hero.collapsed {
  display: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 26px;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--emerald);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e6c;
  box-shadow: 0 0 0 3px rgba(47, 158, 108, 0.18);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 6.6vw, 100px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
}

[dir="rtl"] .hero h1 {
  font-family: var(--serif-ar);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  font-size: clamp(44px, 5.2vw, 76px);
}

.hero h1 em {
  font-style: italic;
  color: var(--emerald-2);
}

[dir="rtl"] .hero h1 em {
  font-style: normal;
  color: var(--bronze);
}

.lede {
  margin: 26px 0 38px;
  max-width: 56ch;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 4px 0;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--emerald-2);
  border-bottom: 1px solid transparent;
}

.link-btn:hover:not(:disabled) {
  border-bottom-color: currentColor;
}

.link-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.link-btn .ico {
  width: 17px;
  height: 17px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 26px;
  margin-top: 18px;
}

.hero-links .link-btn {
  margin-top: 0;
}

.mic-btn.listening {
  color: #fff;
  background: var(--bad);
  animation: mic-pulse 1.4s ease-in-out infinite;
}

.mic-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@keyframes mic-pulse {
  50% {
    box-shadow: 0 0 0 6px var(--bad-soft);
  }
}

.impact-sub {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

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

.impact-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.impact-tile b {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
}

.impact-tile span {
  font-size: 12px;
  color: var(--ink-2);
}

.impact-tile small {
  font-size: 11px;
  color: var(--muted);
}

.proj {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--canvas);
  border: 1px solid var(--line);
}

.proj label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--ink);
}

.proj label small {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--muted);
}

.proj input[type="number"] {
  width: 110px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font: inherit;
  color: var(--ink);
  text-align: end;
}

.proj input[type="range"] {
  grid-column: 1 / -1;
  accent-color: var(--emerald);
}

.proj output {
  font-weight: 600;
  color: var(--emerald);
}

.msg-scheduled {
  align-self: stretch;
  max-width: 100%;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--emerald-soft);
  border: 1px solid #cfe0d7;
  border-radius: 16px;
}

.msg-scheduled .event-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--emerald);
  margin-bottom: 4px;
}

.msg-scheduled .event-tag .ico {
  width: 14px;
  height: 14px;
}

.how-title {
  margin-top: 60px;
  color: var(--muted);
}

.how {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  max-width: 780px;
}

.how li {
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.how li:first-child {
  border-top-color: var(--emerald);
}

.how-num {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  line-height: 1;
  color: var(--bronze);
  margin-bottom: 10px;
}

.how strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.how-body {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* Example outcome card */

.preview {
  position: relative;
  justify-self: center;
  width: min(450px, 100%);
}

.preview-label {
  margin-bottom: 14px;
  color: var(--muted);
  text-align: center;
}

.preview-card {
  position: relative;
  padding: 30px 30px 24px;
  border-radius: 28px;
  color: var(--night-ink);
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(226, 200, 142, 0.16), transparent 70%),
    linear-gradient(165deg, var(--night), var(--night-2));
  box-shadow: 0 50px 100px -40px rgba(10, 29, 24, 0.75);
}

.pc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--night-line);
}

.pc-kicker {
  font-size: 13.5px;
  color: var(--night-muted);
}

.pc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--night-sage);
  background: rgba(159, 211, 184, 0.12);
}

.pc-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pc-label {
  margin-top: 24px;
  color: var(--night-muted);
}

.pc-amount {
  font-family: var(--serif);
  font-size: 62px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--night-gold);
  margin-top: 4px;
}

[dir="rtl"] .pc-amount {
  font-size: 52px;
}

.pc-note {
  font-size: 13.5px;
  color: var(--night-muted);
}

.pc-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.pc-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 14px;
  color: var(--night-ink);
  border-top: 1px solid var(--night-line);
}

.pc-list .ico {
  width: 16px;
  height: 16px;
  color: var(--night-gold);
}

.pc-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--night-line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--night-muted);
}

.preview-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px -20px rgba(21, 20, 15, 0.35);
  white-space: nowrap;
  animation: float 7s ease-in-out infinite;
}

.preview-chip .ico {
  width: 15px;
  height: 15px;
  color: var(--ok);
}

.chip-2 {
  animation-delay: -3.5s;
}

.chip-2 .ico {
  color: var(--bronze);
}

/* ---------- Stage ---------- */

.stage {
  max-width: 1680px;
  margin: 16px auto 0;
  padding: 0 24px 12px;
  display: grid;
  grid-template-columns: 392px minmax(0, 1fr) 384px;
  gap: 20px;
  align-items: start;
}

.pane-resident {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pane-caption {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  height: 20px;
  color: var(--ink-2);
}

.pane-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  color: var(--bronze);
}

.card-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--stage-h);
  min-height: 600px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition:
    border-color 0.45s ease,
    box-shadow 0.45s ease;
}

.pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
}

.pane-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.pane-title .pane-num {
  font-size: 26px;
}

.pane-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.pane-sub {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.state-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.state-pill[data-state="thinking"] {
  color: var(--emerald);
  background: var(--emerald-soft);
  border-color: #cfe0d7;
}

.state-pill[data-state="thinking"]::before {
  background: var(--emerald-2);
  animation: blink 1.2s infinite;
}

.state-pill[data-state="approval"] {
  color: var(--bronze);
  background: var(--gold-soft);
  border-color: #e8d9b6;
}

.state-pill[data-state="approval"]::before {
  background: var(--gold);
}

.state-pill[data-state="error"] {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: #efcdc7;
}

.state-pill[data-state="error"]::before {
  background: var(--bad);
}

/* ---------- Phone ---------- */

.phone {
  width: 380px;
  height: calc(var(--stage-h) - 30px);
  min-height: 570px;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper-2);
  border: 10px solid #23231f;
  border-radius: 54px;
  box-shadow:
    0 0 0 1px #4a4a43,
    0 0 0 2px #1b1b18,
    0 50px 100px -40px rgba(21, 20, 15, 0.6);
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.45s ease;
}

.phone-status {
  position: relative;
  height: 42px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  font-size: 14px;
  font-weight: 600;
  background: var(--paper);
  direction: ltr;
}

.phone-island {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 96px;
  height: 26px;
  transform: translateX(-50%);
  background: #15140f;
  border-radius: 999px;
}

.phone-icons {
  display: flex;
  gap: 5px;
}

.phone-icons svg {
  width: 16px;
  height: 16px;
}

.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 16px 13px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--night-gold);
  background: var(--emerald);
}

.chat-avatar svg {
  width: 24px;
  height: 24px;
}

.chat-head-text {
  min-width: 0;
}

.chat-title {
  font-weight: 600;
  font-size: 15px;
}

.chat-sub {
  font-size: 12.5px;
  color: var(--ok);
}

.chat-sub.busy {
  color: var(--bronze);
}

.secure-chip {
  margin-inline-start: auto;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ok);
  background: var(--ok-soft);
  white-space: nowrap;
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  background: #f4f1eb;
}

/* Flex children of the scrolling chat must keep their natural height. */
.chat > * {
  flex-shrink: 0;
}

.chat::-webkit-scrollbar {
  width: 5px;
}

.chat::-webkit-scrollbar-thumb {
  background: #d8d1c3;
  border-radius: 5px;
}

.msg {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 20px;
  font-size: 14.5px;
  line-height: 1.55;
  animation: rise 0.35s ease both;
  overflow-wrap: anywhere;
}

.msg p {
  margin: 0 0 7px;
}

.msg p:last-child {
  margin-bottom: 0;
}

.msg ul,
.msg ol {
  margin: 4px 0 8px;
  padding-inline-start: 20px;
}

.msg li {
  margin: 4px 0;
}

.msg strong {
  font-weight: 650;
}

.msg-agent {
  align-self: flex-start;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-end-start-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.msg-agent strong {
  color: var(--emerald);
}

.msg-user {
  align-self: flex-end;
  color: #ffffff;
  background: var(--emerald);
  border-end-end-radius: 6px;
}

.msg-event {
  align-self: center;
  max-width: 94%;
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--gold-soft);
  border: 1px solid #e8d9b6;
  border-radius: 16px;
}

.msg-event .event-tag {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--bronze);
  margin-bottom: 4px;
}

.event-gloss {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.msg-error {
  align-self: stretch;
  max-width: 100%;
  font-size: 13.5px;
  color: var(--bad);
  background: var(--bad-soft);
  border: 1px solid #efcdc7;
}

.msg-attachments {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.msg-attachments img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  object-position: top;
  border-radius: 12px;
  background: #fff;
}

.welcome-hint {
  color: var(--muted);
  font-size: 13px;
}

.typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 13px 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  border-end-start-radius: 6px;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-2);
  animation: bounce 1.2s infinite ease-in-out;
}

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

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

/* Approval card inside the chat */

.approval {
  align-self: stretch;
  background: var(--paper);
  border: 1px solid #e3d2ac;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 0 0 4px rgba(201, 165, 92, 0.16),
    0 18px 36px -22px rgba(143, 106, 42, 0.6);
  animation:
    rise 0.4s ease both,
    attention 2.6s ease-in-out 0.5s infinite;
}

.approval:has(.approval-result) {
  animation: rise 0.4s ease both;
  box-shadow: var(--shadow-sm);
}

.approval-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bronze);
  background: var(--gold-soft);
  border-bottom: 1px solid #ecdfc2;
}

[dir="rtl"] .approval-head {
  letter-spacing: 0;
  font-size: 13px;
}

.approval-head .ico {
  width: 16px;
  height: 16px;
}

.approval-body {
  padding: 14px 16px 16px;
}

.approval-title {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  margin-bottom: 10px;
}

[dir="rtl"] .approval-title {
  font-family: var(--serif-ar);
  font-weight: 700;
  font-size: 21px;
}

.approval ul {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--ink-2);
}

.approval li {
  padding: 7px 0;
  border-top: 1px solid var(--line-2);
}

.approval-effect {
  margin: 8px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.approval-fee {
  display: inline-flex;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--canvas);
  margin-bottom: 14px;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 8px;
}

.approval-actions .btn {
  padding: 12px 14px;
  box-shadow: none;
}

.approval-actions .ico {
  width: 15px;
  height: 15px;
}

.approval-result {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
}

.approval-result .ico {
  width: 16px;
  height: 16px;
}

.approval-result.ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.approval-result.no {
  color: var(--muted);
  background: var(--line-2);
}

/* Composer */

.composer {
  flex: none;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 10px 12px 16px;
}

.suggestions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.suggestions:empty {
  display: none;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cfe0d7;
  background: var(--emerald-soft);
  color: var(--emerald);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  animation: rise 0.35s ease both;
}

.chip .ico {
  width: 15px;
  height: 15px;
}

.chip:hover:not(:disabled) {
  border-color: var(--emerald-2);
}

.chip-gold {
  color: var(--bronze);
  border-color: #e8d9b6;
  background: var(--gold-soft);
}

.chip-gold:hover:not(:disabled) {
  border-color: var(--gold);
}

.attach-tray {
  display: flex;
  gap: 8px;
  padding-bottom: 8px;
}

.attach-tray:empty {
  display: none;
}

.attach-thumb {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.attach-thumb .pdf {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 11px;
  font-weight: 700;
  color: var(--bad);
}

.attach-thumb button {
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(21, 20, 15, 0.75);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  padding: 0;
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 4px;
}

.composer-row:focus-within {
  border-color: var(--emerald-2);
  box-shadow: 0 0 0 3px rgba(15, 61, 51, 0.1);
}

.composer-row textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  padding: 9px 4px;
  max-height: 120px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink);
}

.send-btn {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--emerald);
}

.send-btn .ico {
  width: 16px;
  height: 16px;
}

.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- Work pane ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-2);
}

.stat {
  padding: 12px 16px;
}

.stat + .stat {
  border-inline-start: 1px solid var(--line);
}

.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

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

/* Journey: a segmented progress line with labels */

.journey {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 18px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.journey-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--faint);
}

.journey-bar {
  position: relative;
  height: 4px;
  border-radius: 4px;
  background: var(--line-2);
  overflow: hidden;
}

.journey-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: left;
  transform: scaleX(0);
  background: var(--emerald-2);
  transition: transform 0.6s ease;
}

[dir="rtl"] .journey-bar::after {
  transform-origin: right;
}

.journey-step.done {
  color: var(--ink-2);
}

.journey-step.done .journey-bar::after {
  transform: scaleX(1);
}

.journey-step.active {
  color: var(--bronze);
  font-weight: 600;
}

.journey-step.active .journey-bar::after {
  background: var(--gold);
  transform: scaleX(0.55);
  animation: shimmer 1.6s ease-in-out infinite;
}

.timeline-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 22px 22px 28px;
  position: relative;
  background: linear-gradient(var(--paper), var(--paper-2));
}

.timeline-wrap::-webkit-scrollbar,
.tab-panels::-webkit-scrollbar {
  width: 6px;
}

.timeline-wrap::-webkit-scrollbar-thumb,
.tab-panels::-webkit-scrollbar-thumb {
  background: #ddd6c8;
  border-radius: 6px;
}

.timeline-empty {
  text-align: center;
  max-width: 400px;
  margin: 48px auto 0;
  color: var(--muted);
}

.timeline-empty h3 {
  margin: 22px 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  color: var(--ink);
}

[dir="rtl"] .timeline-empty h3 {
  font-family: var(--serif-ar);
  font-weight: 700;
  font-size: 26px;
}

.timeline-empty p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
}

.empty-orb {
  width: 68px;
  height: 68px;
  margin: 0 auto;
  border-radius: 22px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23e2c88e' stroke-width='1.4'%3E%3Crect x='11' y='11' width='18' height='18' rx='3'/%3E%3Crect x='11' y='11' width='18' height='18' rx='3' transform='rotate(45 20 20)'/%3E%3C/g%3E%3Ccircle cx='20' cy='20' r='2.6' fill='%23e2c88e'/%3E%3C/svg%3E")
      center / 42px no-repeat,
    linear-gradient(160deg, var(--emerald-2), var(--night-2));
  box-shadow: 0 20px 40px -20px rgba(15, 61, 51, 0.7);
  animation: float 6s ease-in-out infinite;
}

.timeline-empty.hidden {
  display: none;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-inline-start: 44px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 15px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--line-2);
}

.tl-item {
  position: relative;
  padding-bottom: 22px;
  animation: rise 0.45s ease both;
}

.tl-icon {
  position: absolute;
  inset-inline-start: -44px;
  top: 1px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  z-index: 1;
}

.tl-icon .ico {
  width: 15px;
  height: 15px;
}

.tl-item[data-status="running"] .tl-icon {
  color: var(--emerald);
  border: 2px solid transparent;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    conic-gradient(from 0deg, var(--emerald-2), transparent 65%) border-box;
  animation: spin 1.1s linear infinite;
}

.tl-item[data-status="running"] .tl-icon .ico {
  animation: spin 1.1s linear infinite reverse;
}

.tl-item[data-status="done"] .tl-icon {
  color: #ffffff;
  background: var(--emerald);
  border-color: var(--emerald);
}

.tl-item[data-status="approval"] .tl-icon {
  color: var(--bronze);
  border-color: var(--gold);
  background: var(--gold-soft);
  animation: glow 1.8s ease-in-out infinite;
}

.tl-item[data-status="error"] .tl-icon {
  color: var(--bad);
  border-color: #efcdc7;
  background: var(--bad-soft);
}

.tl-item[data-status="declined"] .tl-icon {
  color: var(--muted);
  background: var(--line-2);
}

.tl-item[data-kind="note"] .tl-icon {
  width: 26px;
  height: 26px;
  inset-inline-start: -41px;
  top: 3px;
  background: var(--canvas);
  color: var(--muted);
}

.tl-item[data-kind="note"] .tl-icon .ico {
  width: 13px;
  height: 13px;
}

.tl-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 32px;
  padding-top: 5px;
}

.tl-title {
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
}

.tl-item[data-kind="note"] .tl-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
}

.tl-meta {
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.tl-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  font-size: 14px;
  color: var(--muted);
}

.tl-sub .ico {
  width: 15px;
  height: 15px;
  color: var(--bronze);
}

.tl-card {
  margin-top: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  animation: rise 0.45s ease both;
}

.tl-error {
  margin-top: 6px;
  font-size: 14px;
  color: var(--bad);
}

details.reasoning {
  margin-top: 6px;
}

details.reasoning summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--emerald-2);
}

details.reasoning summary:hover {
  color: var(--emerald);
}

details.reasoning summary::-webkit-details-marker {
  display: none;
}

details.reasoning summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-inline-end: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

details.reasoning[open] summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

details.reasoning .reasoning-text {
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--gold);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
}

/* Key-value grids */

.kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px 22px;
}

.kv div {
  min-width: 0;
}

.kv span {
  display: block;
  margin-bottom: 3px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

[dir="rtl"] .kv span {
  letter-spacing: 0;
  font-size: 12.5px;
}

.kv b {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.kv b.neg {
  color: var(--bad);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--canvas);
}

.tag-sim {
  color: var(--bronze);
  background: var(--gold-soft);
}

.tag-ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.tag-bad {
  color: var(--bad);
  background: var(--bad-soft);
}

.tag-brand {
  color: var(--emerald);
  background: var(--emerald-soft);
}

.index-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.index-big {
  text-align: end;
}

.index-big .label,
.assess-main .label,
.lawful-box .label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

[dir="rtl"] .index-big .label,
[dir="rtl"] .assess-main .label,
[dir="rtl"] .lawful-box .label {
  letter-spacing: 0;
  font-size: 12.5px;
}

.index-big .label {
  color: var(--muted);
}

.index-big .value {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stars {
  color: var(--gold);
  letter-spacing: 1px;
}

.stars .off {
  color: #ddd5c4;
}

/* Assessment: the dark focal card */

.tl-card.assess {
  padding: 24px 24px 18px;
  color: var(--night-ink);
  border: none;
  background:
    radial-gradient(520px 240px at 100% 0%, rgba(226, 200, 142, 0.16), transparent 70%),
    linear-gradient(165deg, var(--night), var(--night-2));
  box-shadow: 0 30px 60px -34px rgba(10, 29, 24, 0.8);
}

.assess-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.assess-main .label {
  color: var(--night-muted);
}

.assess-main .big {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 58px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--night-gold);
  font-variant-numeric: tabular-nums;
}

.assess-main .sub {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: var(--night-muted);
}

.lawful-box {
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(159, 211, 184, 0.1);
  border: 1px solid rgba(159, 211, 184, 0.25);
  min-width: 200px;
}

.lawful-box .label {
  color: var(--night-sage);
}

.lawful-box .value {
  display: block;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.1;
  color: var(--night-ink);
  font-variant-numeric: tabular-nums;
}

.bands {
  margin-top: 26px;
}

.band-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.band {
  padding-top: 10px;
  border-top: 3px solid var(--night-line);
  font-size: 15px;
  font-weight: 600;
  color: var(--night-muted);
  transition:
    border-color 0.6s ease,
    color 0.6s ease;
}

.band small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--night-muted);
  opacity: 0.85;
}

.band.active {
  border-top-color: var(--night-gold);
  color: var(--night-gold);
}

.band.active small {
  color: var(--night-ink);
  opacity: 1;
}

.gap-caption {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--night-muted);
}

.checks {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.checks li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  font-size: 14.5px;
  color: var(--night-ink);
  border-top: 1px solid var(--night-line);
}

.check-badge {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.check-badge .ico {
  width: 13px;
  height: 13px;
  stroke-width: 2.2;
}

.checks .ok .check-badge {
  color: var(--night-2);
  background: var(--night-sage);
}

.checks .bad .check-badge {
  color: var(--night-2);
  background: var(--night-coral);
}

.checks .neutral .check-badge {
  color: var(--night-muted);
  border: 1px solid var(--night-line);
}

.cites {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--night-line);
  font-size: 12.5px;
  color: var(--night-muted);
}

.cites b {
  color: var(--night-ink);
  font-weight: 500;
}

/* Documents and receipts */

.doc-card {
  display: grid;
  gap: 10px;
}

.doc-title {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.15;
  color: var(--ink);
}

[dir="rtl"] .doc-title {
  font-family: var(--serif-ar);
  font-weight: 700;
  font-size: 21px;
}

.doc-card .chips {
  margin-top: 0;
}

.doc-preview {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--canvas);
}

.doc-actions {
  display: flex;
  gap: 8px;
}

.doc-actions .ico {
  width: 15px;
  height: 15px;
}

.receipt {
  position: relative;
  overflow: hidden;
}

.receipt .kv {
  padding-inline-end: 130px;
}

.stamp {
  position: absolute;
  inset-inline-end: 18px;
  top: 18px;
  padding: 7px 12px;
  border: 1.5px solid currentColor;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  animation: stamp 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

[dir="rtl"] .stamp {
  letter-spacing: 0;
  font-size: 13px;
  transform: rotate(6deg);
}

.stamp-ok,
.stamp-brand {
  color: var(--ok);
}

.stamp-gold {
  color: var(--bronze);
}

/* ---------- Oversight pane ---------- */

.tabs {
  display: flex;
  gap: 16px;
  margin: 0 22px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  position: relative;
  flex: none;
  border: none;
  background: transparent;
  padding: 10px 0 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--ink);
  font-weight: 600;
}

.tab.active::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--emerald);
}

.tab-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 19px;
  text-align: center;
  color: var(--emerald);
  background: var(--emerald-soft);
  font-variant-numeric: tabular-nums;
}

.tab-count:empty {
  display: none;
}

.tab-panels {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.verify-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.verify-actions {
  display: flex;
  gap: 6px;
}

.chain-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}

.chain-status .ico {
  width: 16px;
  height: 16px;
}

.chain-status[data-state="ok"] {
  color: var(--ok);
  font-weight: 600;
}

.chain-status[data-state="broken"] {
  color: var(--bad);
  font-weight: 600;
}

.chain-status[data-state="verifying"] {
  color: var(--bronze);
}

.audit-list,
.approval-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.audit-entry {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
  animation: flash 1.6s ease;
}

.audit-seq {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.1;
  color: var(--bronze);
}

.audit-action {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.audit-summary {
  font-size: 13.5px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.audit-meta code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.actor {
  font-weight: 600;
  font-size: 12px;
}

.actor-agent {
  color: var(--emerald-2);
}

.actor-resident {
  color: var(--bronze);
}

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

.panel-empty {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  padding: 30px 12px;
}

.approval-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}

.approval-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
}

.approval-item p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.officer-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.officer-card h4 {
  margin: 0 0 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.officer-card h4 .ico {
  width: 16px;
  height: 16px;
  color: var(--bronze);
}

.officer-card p {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: pre-wrap;
}

.quality-score {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.score-ring {
  width: 66px;
  height: 66px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 21px;
  color: var(--ink);
  background:
    radial-gradient(closest-side, var(--paper-2) 86%, transparent 88% 100%),
    conic-gradient(var(--emerald-2) calc(var(--p) * 1%), var(--line) 0);
}

.quality-score h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.quality-score p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.golden-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.golden-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
}

.section-title {
  margin: 18px 0 8px;
  color: var(--muted);
}

.demo-controls {
  margin: 0 16px 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--canvas);
  border: 1px solid var(--line);
  transition:
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.demo-controls.attention {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 0 0 4px rgba(201, 165, 92, 0.16);
}

.demo-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.demo-head small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--bronze);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

[dir="rtl"] .demo-head small {
  letter-spacing: 0;
  font-size: 12.5px;
}

.demo-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.footer {
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  padding: 0 20px;
}

/* ---------- Completion ---------- */

.celebrate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(245, 242, 236, 0.78);
  backdrop-filter: blur(8px);
  animation: fade-in 0.5s ease both;
}

.celebrate[hidden] {
  display: none;
}

.celebrate-card {
  text-align: center;
  padding: 40px 48px 32px;
  border-radius: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: pop 0.7s cubic-bezier(0.2, 1.2, 0.4, 1) both;
  max-width: 460px;
}

.celebrate-check {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
}

.celebrate-check circle {
  fill: var(--emerald-soft);
  stroke: var(--emerald-2);
  stroke-width: 1.5;
}

.celebrate-check path {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 0.7s 0.35s ease forwards;
}

.celebrate-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.05;
  color: var(--ink);
}

[dir="rtl"] .celebrate-card h3 {
  font-family: var(--serif-ar);
  font-weight: 700;
  font-size: 34px;
}

.celebrate-card p {
  margin: 10px 0 0;
  font-size: 15.5px;
  color: var(--ink-2);
}

.celebrate-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 26px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-2);
}

.celebrate-stats div {
  padding: 14px 6px;
}

.celebrate-stats div + div {
  border-inline-start: 1px solid var(--line);
}

.celebrate-stats b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  color: var(--emerald);
  font-variant-numeric: tabular-nums;
}

.celebrate-stats span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Dialog ---------- */

.doc-dialog {
  border: none;
  padding: 0;
  border-radius: 24px;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.doc-dialog::backdrop {
  background: rgba(21, 20, 15, 0.45);
  backdrop-filter: blur(4px);
}

.doc-dialog .eyebrow {
  margin: 0 0 8px;
  padding: 0;
  border: none;
  box-shadow: none;
  background: none;
  color: var(--bronze);
}

.doc-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
}

.doc-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--line-2);
}

.doc-dialog-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.12;
}

[dir="rtl"] .doc-dialog-head h3 {
  font-family: var(--serif-ar);
  font-weight: 700;
  font-size: 26px;
}

.doc-dialog-body {
  padding: 22px 28px;
  overflow-y: auto;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.doc-dialog-body p {
  margin: 0 0 14px;
  white-space: pre-wrap;
}

.doc-dialog-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

.doc-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 28px 22px;
  border-top: 1px solid var(--line-2);
}

/* ---------- Guidance: focus ring and next-step coach ---------- */

.focus-resident .pane-resident .phone {
  box-shadow:
    0 0 0 1px #4a4a43,
    0 0 0 2px #1b1b18,
    0 0 0 7px rgba(201, 165, 92, 0.55),
    0 50px 100px -40px rgba(21, 20, 15, 0.6);
}

.focus-work .pane-work,
.focus-oversight .pane-oversight {
  border-color: var(--gold);
  box-shadow:
    0 0 0 4px rgba(201, 165, 92, 0.18),
    var(--shadow);
}

.coach {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 40;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(780px, calc(100vw - 24px));
  padding: 8px 22px 8px 8px;
  border-radius: 999px;
  color: var(--night-ink);
  background: var(--night);
  box-shadow: 0 24px 48px -18px rgba(10, 29, 24, 0.7);
  animation: coach-in 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}

[dir="rtl"] .coach {
  padding: 8px 8px 8px 22px;
}

.coach[hidden] {
  display: none;
}

.coach.bump {
  animation: coach-bump 0.6s ease;
}

.coach-badge {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--night-2);
  background: var(--night-gold);
  white-space: nowrap;
}

[dir="rtl"] .coach-badge {
  letter-spacing: 0;
  font-size: 13px;
}

.coach[data-tone="working"] .coach-badge {
  color: var(--night-ink);
  background: rgba(244, 240, 230, 0.14);
}

.coach[data-tone="done"] .coach-badge {
  color: var(--night-2);
  background: var(--night-sage);
}

.coach-text {
  font-size: 14.5px;
  line-height: 1.4;
}

.coach-text b {
  font-weight: 600;
  color: var(--night-gold);
}

.coach.has-action {
  padding-inline-end: 8px;
}

.coach-action {
  flex: none;
  margin-inline-start: 4px;
  padding: 9px 18px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--night-2);
  background: var(--night-ink);
  white-space: nowrap;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.coach-action:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-1px);
}

.coach-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.coach-action[hidden] {
  display: none;
}

body.has-coach .footer span {
  visibility: hidden;
}

/* Arrow from the guide pill to the element to use, plus a ring on that element */

.coach-link {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 39;
  pointer-events: none;
  overflow: visible;
}

.coach-link .link {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 6px rgba(143, 106, 42, 0.35));
}

.coach-link .link.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: link-draw 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.coach-link marker path,
.coach-link .link-start {
  fill: var(--gold);
}

.spotlight {
  outline: 2.5px solid var(--gold);
  outline-offset: 4px;
  animation: spotlight 1.8s ease-in-out infinite;
}

.spotlight:not(button) {
  border-radius: 14px;
}

@keyframes link-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes spotlight {
  50% {
    outline-offset: 7px;
    outline-color: rgba(201, 165, 92, 0.4);
  }
}

/* ---------- Motion ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

@keyframes glow {
  50% {
    box-shadow: 0 0 0 5px rgba(201, 165, 92, 0.2);
  }
}

@keyframes attention {
  50% {
    box-shadow:
      0 0 0 7px rgba(201, 165, 92, 0.22),
      0 18px 36px -22px rgba(143, 106, 42, 0.6);
  }
}

@keyframes flash {
  from {
    background: var(--gold-soft);
  }
}

@keyframes float {
  50% {
    transform: translateY(-7px);
  }
}

@keyframes shimmer {
  50% {
    transform: scaleX(0.85);
  }
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: rotate(-6deg) scale(1.6);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes coach-in {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

@keyframes coach-bump {
  30% {
    transform: translate(-50%, -5px);
  }
}

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

/* ---------- Responsive ---------- */

@media (max-width: 1380px) {
  .stage {
    grid-template-columns: 392px minmax(0, 1fr);
  }
  .pane-oversight {
    grid-column: 1 / -1;
    height: auto;
    min-height: 0;
  }
  .pane-oversight .tab-panels {
    max-height: 520px;
  }
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
    padding: 64px 32px 56px;
  }
  .how {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .stage {
    grid-template-columns: 1fr;
  }
  .phone {
    width: min(100%, 420px);
    height: 78vh;
  }
  .card-pane {
    height: auto;
    min-height: 0;
  }
  .timeline-wrap {
    max-height: 70vh;
  }
  .brand-tag {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 0 16px;
    gap: 10px;
  }
  .model-pill {
    display: none;
  }
  .hero {
    padding: 48px 20px 40px;
  }
  .how {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .journey {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 14px;
  }
  .stage {
    padding: 0 12px 12px;
  }
  .sim-banner {
    font-size: 10px;
  }
}

/* ---------- Page for government entities ---------- */

a.btn {
  text-decoration: none;
}

.nav-link {
  padding: 7px 4px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-2);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--emerald);
}

.footer a {
  color: inherit;
  margin-inline-start: 6px;
}

.gov {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  padding: 80px 48px 56px;
}

.gov-hero {
  max-width: 880px;
  margin-bottom: 88px;
}

.gov-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 5.6vw, 80px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.gov-hero h1 em {
  font-style: italic;
  color: var(--emerald-2);
}

[dir="rtl"] .gov-hero h1 {
  font-family: var(--serif-ar);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  font-size: clamp(38px, 4.6vw, 64px);
}

[dir="rtl"] .gov-hero h1 em {
  font-style: normal;
  color: var(--bronze);
}

.gov-section {
  margin-bottom: 80px;
}

.gov-section h2,
.gov-close h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.1;
  color: var(--ink);
}

[dir="rtl"] .gov-section h2,
[dir="rtl"] .gov-close h2 {
  font-family: var(--serif-ar);
  font-weight: 700;
  line-height: 1.4;
  font-size: clamp(26px, 3vw, 36px);
}

.gov-sub {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.gov-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.gov-cards.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .gov-cards.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gov-card,
.gov-week {
  padding: 24px;
  border-radius: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.gov-num {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  color: var(--bronze);
}

.gov-card h3,
.gov-week h3 {
  margin: 10px 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.gov-card p,
.gov-week p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.gov-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 28px;
  padding: 10px;
  border-radius: 26px;
  color: var(--night-ink);
  background:
    radial-gradient(520px 240px at 100% 0%, rgba(226, 200, 142, 0.16), transparent 70%),
    linear-gradient(165deg, var(--night), var(--night-2));
  box-shadow: 0 40px 80px -40px rgba(10, 29, 24, 0.75);
}

.gov-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 22px 24px;
}

.gov-stat b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 46px;
  line-height: 1;
  color: var(--night-gold);
  font-variant-numeric: tabular-nums;
}

[dir="rtl"] .gov-stat b {
  font-family: var(--serif-ar);
  font-size: 38px;
}

.gov-stat span {
  font-size: 14px;
  line-height: 1.45;
  color: var(--night-ink);
}

.gov-stat small {
  font-size: 12px;
  color: var(--night-muted);
}

.gov-weeks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.gov-week .smallcaps {
  color: var(--emerald);
}

.gov-out {
  max-width: 72ch;
  margin: 18px 0 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.gov-needs {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
  margin: 26px 0 0;
  padding: 0;
}

.gov-needs li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.gov-needs .ico {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  padding: 4px;
  border-radius: 50%;
  color: #fff;
  background: var(--emerald);
}

.gov-close {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 38px 42px;
  border-radius: 28px;
  background: linear-gradient(160deg, var(--emerald-2), var(--night-2));
  box-shadow: 0 30px 60px -30px rgba(15, 61, 51, 0.7);
}

.gov-close h2 {
  color: var(--night-ink);
}

.gov-close p {
  max-width: 60ch;
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--night-muted);
}

.gov-close-btn {
  color: var(--night-2);
  background: var(--night-gold);
  border-color: var(--night-gold);
}

.gov-close-btn:hover:not(:disabled) {
  background: #ead6a6;
  border-color: #ead6a6;
}

.gov-page .footer {
  height: auto;
  padding: 24px 20px 32px;
}

@media (max-width: 720px) {
  .nav-link {
    display: none;
  }
  .gov {
    padding: 48px 16px 32px;
  }
  .gov-hero,
  .gov-section {
    margin-bottom: 56px;
  }
  .gov-weeks,
  .gov-needs,
  .gov-cards.three {
    grid-template-columns: 1fr;
  }
  .gov-close {
    padding: 28px 22px;
  }
  .gov-stat b {
    font-size: 40px;
  }
}

.topbar .btn-light {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .gov-page .topbar .btn-light {
    display: none;
  }
}
