/* ClauseSav: mobile-first styles, matched to the mockups in /mockup */

:root {
  --plum: #352344;
  --coral: #E66F61;
  --surface: #FFFFFF;
  --page: #FCF8F7;
  --coral-ink: #A34238;
  --highlight: #F3C4BC;
  --action: #643C76; /* White text on action plum; coral is reserved for signature accents. */
  --action-hover: #513060;
  --blush: #F8EAE7;
  --tint: #FBF3F1;
  --on-dark: #F8EAE7;
  --bg: var(--page);
  --bg-outside: #FCF8F7;
  --ink: var(--plum);
  --muted: #6D5A73;
  --line: #E5D5DD;
  --control-border: #967F9F;
  --focus: var(--action);
  /* Compatibility aliases keep existing component/state hooks unchanged. */
  --deep: var(--plum);
  --deep-hover: #493153;
  --purple: var(--action);
  --purple-strong: var(--action-hover);
  --lavender: var(--blush);
  --lavender-soft: var(--tint);
  --yellow: var(--blush);
  --yellow-ink: var(--plum);
  --high: #B42318;
  --high-bg: #FDECEA;
  --medium: #9A5B00;
  --medium-bg: #FEF6DC;
  --info: #175CD3;
  --info-bg: #EAF2FF;
  --success: #05603A;
  --success-bg: #E7F8EE;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(53, 35, 68, .04), 0 8px 24px rgba(53, 35, 68, .06);
  --shadow-lift: 0 2px 4px rgba(53, 35, 68, .06), 0 12px 32px rgba(53, 35, 68, .12);
  --nav-h: 64px;
  --max-w: 480px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans SC", "Noto Sans Tamil", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--purple); }
button, input, select { font-family: inherit; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- App frame ---------- */

.app {
  max-width: var(--max-w);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 520px) {
  body { background: var(--bg-outside); }
  .app { box-shadow: 0 0 40px rgba(53, 35, 68, 0.08); }
}

/* ---------- Header (inner screens) ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* keeps the title centred whatever is on the right */
  align-items: center;
  gap: 8px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
}
.app-header[hidden] { display: none; }
.app-header #back-btn { justify-self: start; }

/* Yellow "Comic" pill in the header */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.pill-btn svg { width: 18px; height: 18px; }
.pill-btn[hidden] { display: none; }
.pill-comic { background: var(--yellow); color: var(--yellow-ink); }
.pill-comic:hover { background: var(--line); }

.round-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.round-btn:hover { background: var(--lavender-soft); }
.round-btn:disabled { opacity: 0.5; cursor: wait; }
.round-btn[hidden] { display: none; }

.page-title {
  margin: 0;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

/* ---------- Screen ---------- */

.screen {
  flex: 1;
  padding: 16px 16px 8px;
  outline: none;
}
.app-header:not([hidden]) + .screen { padding-top: 4px; }

.screen h2 { font-size: 1.25rem; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.01em; }
.screen h3 { font-size: 1rem; margin: 0 0 4px; }
.screen p { margin: 0 0 12px; }
.muted { color: var(--muted); }

/* Big left-aligned title on top-level screens (Contracts, Deadlines, Experts) */
.page-h1 {
  margin: calc(8px + env(safe-area-inset-top)) 0 4px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.screen .page-sub { color: var(--muted); margin-bottom: 18px; }

/* Section headings like "Explain it as" */
.screen .h2 {
  margin: 22px 0 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- Disclaimer (every screen) ---------- */

.disclaimer {
  margin: 0;
  padding: 8px 24px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}
/* Inner screens have no bottom nav, just room for the floating Ask AI button */
.no-nav .disclaimer { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

/* ---------- Bottom nav (floating) ---------- */

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: calc(100% - 32px);
  max-width: calc(var(--max-w) - 32px);
  height: var(--nav-h);
  padding: 6px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow-lift);
}

.bottom-nav[hidden] { display: none; }

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 16px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
}
.bottom-nav a svg { width: 20px; height: 20px; }
.bottom-nav a:hover { color: var(--ink); }
.bottom-nav a.active { background: var(--lavender); color: var(--purple-strong); font-weight: 700; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 22px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn svg { width: 20px; height: 20px; }

.btn-primary { background: var(--deep); color: var(--surface); }
.btn-primary:hover { background: var(--deep-hover); }

.btn-secondary { background: var(--lavender); color: var(--purple-strong); }
.btn-secondary:hover { background: var(--line); }

.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card-link {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}
.card-link:hover { box-shadow: var(--shadow-lift); }
.card-link .chev { margin-left: auto; color: var(--muted); }

.doc-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--lavender);
  color: var(--purple);
}

.screen .card-title { font-weight: 700; margin: 0; }
.screen .card-meta { font-size: 0.85rem; color: var(--muted); margin: 0; }

.screen .section-label {
  margin: 22px 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Home ---------- */

.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: calc(4px + env(safe-area-inset-top)) 0 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.logo svg { width: 34px; height: 34px; }
.logo b { color: var(--purple); font-weight: 800; }

.lang-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.lang-pill svg { width: 18px; height: 18px; }
/* The real <select> sits invisibly over the pill, so tapping it opens the phone's own picker. */
.lang-pill select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px; /* stops iOS zooming in */
  cursor: pointer;
}
.lang-pill:focus-within { outline: 3px solid var(--purple); outline-offset: 2px; }
.lang-pill .caret { width: 14px; height: 14px; }

.eyebrow {
  margin: 0 0 6px !important;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
}

.display {
  margin: 0 0 20px;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

/* Dark "scan" card */
.scan-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 22px;
  background: var(--deep);
  color: var(--surface);
}
/* Decorative ring, top right */
.scan-card::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -60px;
  width: 170px;
  height: 170px;
  border: 22px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.pick { position: relative; display: block; cursor: pointer; }
.pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pick input:disabled { cursor: not-allowed; }
.pick input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }

.scan-main span, .scan-sub span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  font-weight: 700;
}
.scan-main span {
  position: relative;
  min-height: 56px;
  background: var(--surface);
  color: var(--deep);
  font-size: 1.05rem;
}
.scan-main:hover span { background: var(--lavender-soft); }

.scan-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.scan-sub span {
  min-height: 48px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--surface);
}
.scan-sub:hover span { background: rgba(255, 255, 255, 0.2); }
.scan-sub svg { width: 18px; height: 18px; }
.pick input:disabled + span { opacity: 0.5; }

/* Photo warning under the Scan / Photo buttons */
.screen .photo-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  color: #fde68a;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}
.photo-note svg { width: 16px; height: 16px; margin-top: 1px; }

.scan-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0 !important;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}
.scan-note svg { width: 14px; height: 14px; }

/* Chosen file, inside the dark card */
.scan-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 6px 10px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}
.scan-file .doc-icon { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.15); color: var(--surface); }
.scan-file .thumb { width: 40px; height: 50px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.scan-file .file-info { flex: 1; min-width: 0; }
.screen .scan-file .card-title { color: var(--surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen .scan-file .card-meta { color: rgba(255, 255, 255, 0.7); }
.scan-file .icon-btn { color: rgba(255, 255, 255, 0.8); }
.scan-file .icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--surface); }

/* Choice tiles (radio buttons) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.tile { position: relative; display: block; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 76px;
  padding: 12px 6px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  cursor: pointer;
}
.tile-inner svg { width: 20px; height: 20px; }
.tile-inner:hover { border-color: var(--lavender); }
.tile input:focus-visible + .tile-inner { outline: 3px solid var(--purple); outline-offset: 2px; }

/* "Explain it as": selected tile is yellow with a dark outline */
.tiles-mode .tile input:checked + .tile-inner {
  background: var(--yellow);
  border-color: var(--deep);
  color: var(--yellow-ink);
  font-weight: 700;
}
/* "What kind of contract?": selected tile is lavender with a purple outline */
.tiles-type .tile input:checked + .tile-inner {
  background: var(--lavender);
  border-color: var(--purple);
  color: var(--purple-strong);
  font-weight: 700;
}

.submit { margin-top: 22px; }
#scan-status .notice { margin: 16px 0 0; }

/* ---------- Bottom sheet (NRIC reminder) ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(53, 35, 68, 0.45);
}
.sheet {
  width: 100%;
  max-width: var(--max-w);
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.sheet-handle { width: 44px; height: 5px; margin: 0 auto 16px; border-radius: 999px; background: var(--lavender); }
.sheet-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--medium-bg);
  color: var(--medium);
}
.sheet h2 { font-size: 1.3rem !important; font-weight: 800; letter-spacing: -0.02em; }
.sheet p { color: var(--muted); }
.sheet .btn + .btn { margin-top: 10px; }
.sheet .btn-ghost { background: transparent; color: var(--muted); min-height: 44px; }

/* ---------- Contract tabs (segmented control) ---------- */

.tabs {
  position: sticky;
  top: calc(68px + env(safe-area-inset-top));
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 16px;
  background: var(--line);
}

.tab {
  min-height: 42px;
  white-space: nowrap; /* a tab label never breaks mid-word */
  overflow: hidden;
  padding: 0 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }

/* ---------- Empty states and "coming later" ---------- */

.empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
  padding: 28px 20px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 16px;
}
.empty-icon svg { width: 26px; height: 26px; }
.tone-purple { background: var(--lavender); color: var(--purple-strong); }
.tone-red { background: var(--high-bg); color: var(--high); }
.tone-yellow { background: var(--blush); color: var(--action); }
.empty-card h3 { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; }
.screen .empty-card p { color: var(--muted); font-size: 0.92rem; max-width: 34ch; }
.empty-card .btn { margin-top: 4px; }

.step-pill {
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--purple-strong);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Dark banner (mockup 7 "THIS WEEK", mockup 5 expert card) */
.banner-dark {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 22px;
  background: var(--deep);
  color: var(--surface);
}
.banner-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--yellow);
}
.banner-eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.banner-text { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }

/* Title row with a dark "+ Add"-style pill (mockup 7) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head .page-h1 { margin-bottom: 4px; }
.add-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  margin-top: env(safe-area-inset-top);
  padding: 0 20px;
  border-radius: 999px;
  background: var(--purple-strong);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
}
.add-pill:hover { background: var(--purple); }
.add-pill svg { width: 18px; height: 18px; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--purple-strong);
  font-size: 0.75rem;
  font-weight: 700;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: var(--muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Notices ---------- */

.notice {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.notice p { margin: 6px 0 10px; }
.notice-info { background: var(--lavender); color: var(--deep); }
.notice-success { background: var(--success-bg); color: var(--success); }
.notice-error { background: var(--high-bg); color: var(--high); }
.notice-warn { background: var(--medium-bg); color: #7a2e0e; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--lavender-soft); color: var(--ink); }

.file-info { min-width: 0; flex: 1; }
.thumb { width: 44px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

/* ---------- Contract overview (mockup 2) ---------- */

.meta-chip {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--purple-strong);
  font-size: 0.8rem;
  font-weight: 600;
}

.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.meta-row .meta-chip { margin-bottom: 0; }
.privacy-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--purple-strong);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}
.privacy-link svg { width: 14px; height: 14px; }
.privacy-link:hover { text-decoration: underline; }

/* ---------- Personal details found ---------- */

.pd-card { padding: 18px; }
.pd-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.pd-head h2 { margin: 0 0 2px !important; font-size: 1.05rem !important; font-weight: 800; }
.screen .pd-head p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.pd-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; }
.pd-icon svg { width: 20px; height: 20px; }
.pd-ok { background: var(--success-bg); color: var(--success); }
.pd-warn { background: var(--medium-bg); color: var(--medium); }
.pd-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.pd-label { color: var(--muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.pd-values { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--lavender-soft);
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-word;
}
.pd-chip small { color: var(--muted); font-weight: 600; }
.screen .pd-none { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.screen .pd-note { margin: 10px 0 0; color: var(--muted); font-size: 0.8rem; }
.pd-empty { display: flex; align-items: center; gap: 10px; color: var(--success); font-weight: 700; }
.screen .pd-empty p { margin: 0; }
.screen .pd-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 14px; color: var(--muted); font-size: 0.82rem; text-align: center; }
.pd-foot svg { width: 14px; height: 14px; }

/* "Hide these too" switch */
.pd-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--lavender-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.switch-track { position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--line); transition: background 0.15s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.pd-switch[aria-checked="true"] .switch-track { background: var(--purple-strong); }
.pd-switch[aria-checked="true"] .switch-thumb { transform: translateX(18px); }

.contract-title {
  margin: 0 0 16px;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

/* White card holding a list of tappable rows */
.list-card {
  list-style: none;
  margin: 0 0 4px;
  padding: 4px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.point + .point { border-top: 1px solid var(--line); }

.point-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 14px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.point-row { cursor: pointer; }
button.point-row:hover .point-title { color: var(--purple-strong); }

.point-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--lavender);
  color: var(--purple-strong);
}
.point-icon svg { width: 20px; height: 20px; }

.point-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.point-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.point-title { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.point-sub { color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.point-ref { flex-shrink: 0; color: var(--muted); font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
button.point-row[aria-expanded="true"] .point-ref { color: var(--purple-strong); }

.screen .not-in-contract { margin: 8px 4px 0; color: var(--muted); font-size: 0.8rem; }

.point-muted .point-icon { background: var(--tint); color: var(--muted); }
.point-muted .point-title { color: var(--muted); }

.point-clauses { padding: 0 0 14px 58px; }
.point-clauses .clause-quote + .clause-quote { margin-top: 8px; }

/* "DEC / 1" date block */
.date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  line-height: 1.05;
}
.date-block .mon { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; color: var(--purple-strong); }
.date-block .day { font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.date-block.urgent .mon { color: var(--high); }
.date-block-icon { height: 44px; border-radius: 12px; background: var(--lavender); color: var(--purple-strong); }
.date-block-icon svg { width: 20px; height: 20px; }
.date-block-icon.urgent { background: var(--high-bg); color: var(--high); }

.screen .tab-foot { margin: 16px 8px 0; color: var(--muted); font-size: 0.8rem; text-align: center; }

/* Floating "Ask AI" button */
.fab {
  position: fixed;
  right: max(16px, calc(50% - var(--max-w) / 2 + 16px));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--purple-strong);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(53, 35, 68, 0.35);
}
.fab:hover { background: var(--purple); }
.fab svg { width: 18px; height: 18px; }

/* Red "SCAM CHECK" banner on the Overview (mockup 2) */
.risk-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
  padding: 16px;
  border-radius: var(--radius);
  color: var(--surface);
  text-decoration: none;
}
.banner-red { background: #b91c1c; }
.banner-amber { background: #9a5b00; }
.risk-banner-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
}
.risk-banner-body { flex: 1; min-width: 0; }
.risk-banner-eyebrow { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.risk-banner-text { display: block; font-size: 1.1rem; font-weight: 800; line-height: 1.25; }
.risk-banner .chev { color: var(--surface); }

/* Red dot on the Risks tab */
.tab-dot { display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--high); vertical-align: 2px; }

.all-clauses { margin-top: 20px; }

/* ---------- Risks & scam check (mockup 3) ---------- */

.risk-top { padding: 20px; }
.risk-top-head { display: flex; align-items: center; gap: 16px; }
.gauge { width: 72px; height: 44px; flex-shrink: 0; stroke-width: 8; stroke-linecap: butt; }
.gauge .needle { stroke-width: 3.5; stroke-linecap: round; }
.screen .risk-eyebrow { margin: 0 0 2px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.risk-eyebrow.lvl-high { color: var(--high); }
.risk-eyebrow.lvl-medium { color: var(--medium); }
.risk-eyebrow.lvl-info, .risk-eyebrow.lvl-none { color: var(--purple-strong); }
.screen .risk-title { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.screen .risk-callout { margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; font-size: 0.92rem; }
.callout-red { background: var(--high-bg); color: #7a1a12; }
.callout-red strong { color: var(--high); }
.callout-purple { background: var(--lavender-soft); color: var(--deep); }

.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-note { color: var(--muted); font-size: 0.8rem; }

.kv-card { padding: 4px 16px 16px; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv-label { color: var(--muted); font-size: 0.9rem; flex-shrink: 0; }
.kv-value { font-weight: 700; font-size: 0.92rem; text-align: right; }
.kv-bad { color: var(--high); font-weight: 700; }
.kv-sub { display: block; color: var(--high); font-size: 0.78rem; font-weight: 600; }
.screen .kv-note { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0; color: var(--muted); font-size: 0.82rem; }
.kv-note svg { width: 16px; height: 16px; margin-top: 2px; }

.risk-item { display: flex; gap: 14px; color: inherit; text-decoration: none; }
.risk-item:hover { box-shadow: var(--shadow-lift); }
.risk-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
}
.risk-icon svg { width: 20px; height: 20px; }
.risk-icon.lvl-high { background: var(--high-bg); color: var(--high); }
.risk-icon.lvl-medium { background: var(--medium-bg); color: var(--medium); }
.risk-icon.lvl-info { background: var(--info-bg); color: var(--info); }
.risk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.risk-item-title { font-weight: 800; font-size: 1rem; line-height: 1.3; }
.risk-item-text { color: var(--muted); font-size: 0.88rem; }
.risk-item-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.risk-link { display: inline-flex; align-items: center; gap: 2px; color: var(--purple-strong); font-weight: 700; font-size: 0.88rem; }
.chev-sm { width: 16px; height: 16px; }

.level-pill { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 700; }
.level-pill.lvl-high { background: var(--high-bg); color: var(--high); }
.level-pill.lvl-medium { background: var(--medium-bg); color: var(--medium); }
.level-pill.lvl-info { background: var(--info-bg); color: var(--info); }

.help-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.help-row .btn { padding: 12px 10px; font-size: 0.95rem; }
.btn-outline-red { background: var(--surface); color: var(--high); box-shadow: inset 0 0 0 2px #f5c2bd; }
.btn-outline-red:hover { background: var(--high-bg); }
.btn-yellow { background: var(--yellow); color: var(--yellow-ink); }
.btn-yellow:hover { background: var(--line); }
.help-case { margin-top: 10px; }

/* ---------- Language and read-aloud ---------- */

/* Speaker button: shows a stop square while reading */
.audio-stop-bar { position: fixed; bottom: calc(88px + env(safe-area-inset-bottom) + var(--audio-lift, 0px)); left: max(16px, env(safe-area-inset-left), calc((100vw - var(--max-w)) / 2 + 16px)); right: auto; width: max-content; max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)); z-index: 10000; display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--action); border-radius: 999px; background: var(--surface); color: var(--plum); box-shadow: 0 3px 14px #0003; }
.audio-stop-bar[hidden] { display: none; }
.audio-stop-bar button { min-width: 44px; height: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--action-hover); color: white; font-size: 14px; line-height: 1.2; font-weight: 800; white-space: nowrap; cursor: pointer; }
.audio-status { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; }
.audio-status svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.audio-loading-dot { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--action-hover); border-radius: 50%; animation: audio-loading-spin 0.8s linear infinite; }
@keyframes audio-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .audio-loading-dot { animation: none; } }
/* Match the existing sidebar grid: 16px outer padding + sidebar width + 28px gap.
   Keep phone/frame layouts above bottom chrome even when their navigation is hidden. */
html[data-layout="desktop"] .audio-stop-bar { left: max(calc(44px + clamp(220px, 18vw, 256px)), env(safe-area-inset-left)); bottom: calc(24px + env(safe-area-inset-bottom) + var(--audio-lift, 0px)); }
.audio-stop-bar button:focus-visible, .risk-read:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.risk-read { margin: 8px 16px 16px; }
#speak-btn { width: 44px; min-width: 44px; height: 44px; padding: 8px; }
[data-dt-speak] { width: 44px; min-width: 44px; height: 44px; }
#speak-btn .icon-stop { display: none; }
#speak-btn[aria-pressed="true"] { background: var(--purple-strong); color: var(--surface); }
#speak-btn[aria-pressed="true"] .icon-speak { display: none; }
#speak-btn[aria-pressed="true"] .icon-stop { display: block; }

.lang-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 10px; }
.lang-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 64px;
  padding: 10px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--lavender-soft);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}
.lang-option small { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.lang-option:hover { border-color: var(--lavender); }
.lang-option[aria-pressed="true"] { border-color: var(--purple); background: var(--lavender); color: var(--purple-strong); }

.screen .lang-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--lavender-soft);
  color: var(--purple-strong);
  font-size: 0.82rem;
  font-weight: 600;
}
.lang-note svg { width: 16px; height: 16px; }
.lang-note .spinner { width: 14px; height: 14px; }
.lang-note-error { flex-wrap: wrap; background: var(--high-bg) !important; color: var(--high) !important; }

/* "Listen to this summary" (Explain it as: Audio) */
.listen-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  border: 0;
  border-radius: 16px;
  background: var(--yellow);
  color: var(--yellow-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.listen-bar svg { width: 18px; height: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 60;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: calc(var(--max-w) - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--deep);
  color: var(--surface);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lift);
}

/* Contracts list card with its own delete button */
.contract-row { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 16px; }
.contract-row .card-link { flex: 1; min-width: 0; padding: 4px 0; }
.contract-row:hover { box-shadow: var(--shadow-lift); }
.contract-row .card-link:hover { box-shadow: none; }

.btn-danger-ghost { margin-top: 12px; background: transparent; color: var(--high); box-shadow: inset 0 0 0 1.5px #f5c2bd; }
.btn-danger-ghost:hover { background: var(--high-bg); }

/* ---------- Comic explanation (mockup 4) ---------- */

.screen .tab-lead { color: var(--muted); margin-bottom: 12px; }

.comic-card {
  margin-bottom: 12px;
  border: 2px solid transparent;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 76px;
}
.comic-card.open { border-color: var(--purple); }
.comic-card.risky { background: #fff7f6; box-shadow: var(--shadow), inset 0 0 0 1.5px #f8cdc8; }
.comic-card.risky.open { box-shadow: var(--shadow); }

.comic-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.comic-head > svg { color: var(--muted); }
.comic-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--lavender);
  color: var(--purple-strong);
}
.comic-icon svg { width: 20px; height: 20px; }
.comic-card.open .comic-icon { background: var(--deep); color: var(--surface); }
.comic-card.risky .comic-icon { background: var(--high-bg); color: var(--high); }
.comic-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.comic-title { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; }
.comic-card.risky .comic-title { color: var(--high); }
.comic-sub { color: var(--muted); font-size: 0.82rem; }

.comic-body { padding: 0 12px 14px; }
.comic-loading { padding: 32px 12px; }

.comic-body { container-type: inline-size; }
/* One column for narrow panels, so the speech bubble text stays readable (at least 13px). */
/* Always a 2 x 2 grid of panels, on phone and desktop. */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.panel {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--tint);
}
.panel.key { border: 2.5px solid var(--purple); }
.panel.panel-high { border: 2.5px solid #B42318; }
.panel.panel-medium { border: 2.5px solid #B54708; }
.panel figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 6px;
  min-height: 64px;
  padding: 8px 10px 4px;
  font-family: var(--font);
  font-size: 0.85rem; /* 13-14px */
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
}
.panel-caption { flex: 1 1 120px; min-width: 0; }
/* Warning badges sit in the caption strip, above the picture, so they never cover a face or a bubble. */
.panel-warn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-family: var(--font); font-size: 0.74rem; font-weight: 800; line-height: 1.3; }
.panel-warn svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.panel-warn-high { background: #B42318; color: var(--surface); }
.panel-warn-medium { background: #FEF0C7; color: #7A2E0E; }
.panel-num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--yellow);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: 1px;
}
.panel.key .panel-num { background: var(--purple-strong); color: var(--surface); }
.comic-art { display: block; width: 100%; height: auto; max-height: 200px; margin-top: auto; aspect-ratio: 4 / 3; }
.comic-art .comic-bubble-text { font-weight: 400; font-style: normal; font-synthesis: none; stroke: none; stroke-width: 0; -webkit-text-stroke: 0; text-shadow: none; filter: none; paint-order: normal; letter-spacing: normal; }
html[data-layout="desktop"] .comic-art { max-width: 240px; margin-left: auto; margin-right: auto; }

.screen .ai-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--purple-strong);
  font-size: 0.8rem;
  font-weight: 700;
}
.ai-label svg { width: 14px; height: 14px; }

.assumptions { margin-bottom: 10px; padding: 10px 14px; border-radius: 12px; background: var(--medium-bg); color: #6b3d00; }
.screen .assume-head { margin: 0 0 4px; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.assumptions ul { margin: 0; padding-left: 18px; font-size: 0.9rem; }

.clause-picker { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 0.9rem; font-weight: 700; }
.clause-picker select {
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 16px;
}

/* Bottom action bar (mockup 4 "Ask about this") */
.action-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 15;
  width: 100%;
  max-width: var(--max-w);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(244, 242, 251, 0));
}

/* ---------- Ask: AI chatbot (mockup 5) ---------- */

.chat { display: flex; flex-direction: column; gap: 12px; padding-bottom: 150px; }
.msg { display: flex; flex-direction: column; }
.msg-user { align-items: flex-end; }
.msg-bot { align-items: flex-start; }
.bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 0.98rem;
  line-height: 1.45;
}
.msg-user .bubble {
  border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, var(--purple), var(--purple-strong));
  color: var(--surface);
  font-weight: 600;
}
.msg-bot .bubble { border-bottom-left-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.screen .bubble p { margin: 0; }
.bubble strong { font-weight: 800; }

.msg-quote {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-left: 3px solid var(--purple);
  border-radius: 0 8px 8px 0;
  background: var(--lavender-soft);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.9rem;
  color: var(--plum);
}
.msg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--purple-strong);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.msg-chip svg { width: 14px; height: 14px; }
.msg-chip[aria-expanded="true"] { background: var(--purple-strong); color: var(--surface); }
.msg-clause { margin-top: 10px; }

/* Typing indicator */
.typing { display: flex; gap: 5px; padding: 16px 18px; }
.typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); opacity: 0.35; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* "Want a real person to check?" card */
.expert-card {
  width: 100%;
  margin-top: 10px;
  padding: 16px;
  border-radius: 20px;
  background: var(--deep);
  color: var(--surface);
}
.expert-head { display: flex; align-items: center; gap: 12px; }
.expert-head strong { display: block; font-size: 1rem; }
.expert-head span span { display: block; color: var(--line); font-size: 0.85rem; }
.expert-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--on-dark);
  color: var(--deep);
}
.expert-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.expert-links a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--deep);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

/* Fixed question bar */
.composer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 15;
  width: 100%;
  max-width: var(--max-w);
  padding: 10px 16px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 80%, rgba(244, 242, 251, 0));
}
.ask-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.ask-chips::-webkit-scrollbar { display: none; }
.ask-chip {
  flex-shrink: 0;
  min-height: 38px;
  padding: 6px 14px;
  border: 1.5px solid var(--lavender);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.ask-chip:hover { border-color: var(--purple); }
.ask-chip:disabled { opacity: 0.5; cursor: wait; }
.composer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 18px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.composer-box input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px; /* stops iOS zooming in */
  outline: none;
}
.composer-box:focus-within { box-shadow: var(--shadow-lift), 0 0 0 3px var(--focus); }
.send-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--purple-strong);
  color: var(--surface);
  cursor: pointer;
}
.send-btn:disabled { opacity: 0.5; cursor: wait; }
.screen .composer-foot { margin: 8px 0 0; color: var(--muted); font-size: 0.72rem; text-align: center; }

/* ---------- Your document (mockup 3b) ---------- */

.doc-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -16px -16px 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  background: var(--bg);
}
.doc-bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-bar-title strong { font-size: 1.05rem; }
.doc-bar-title span { color: var(--muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.doc-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--high-bg);
  box-shadow: inset 0 0 0 2px #f5c2bd;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}
.step-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--high);
}
.step-btn svg { width: 18px; height: 18px; }

.doc-paper {
  margin-bottom: 280px; /* room above the bottom sheet */
  padding: 22px 18px;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--plum);
}
.doc-h { margin: 18px 0 8px !important; font-size: 1rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; }
.doc-h:first-child { margin-top: 0 !important; }
.doc-clause { position: relative; }
.screen .doc-clause p { margin: 0 0 10px; white-space: pre-line; }
.doc-clause.flagged { margin: 18px -10px 12px; padding: 14px 10px 4px 14px; border-left: 4px solid var(--high); border-radius: 0 8px 8px 0; background: #fdecea; }
.doc-clause.flagged.lvl-medium { border-color: var(--medium); background: var(--medium-bg); }
.doc-clause.flagged.lvl-info { border-color: var(--info); background: var(--info-bg); }
.doc-tag {
  position: absolute;
  top: -11px;
  left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--high);
  color: var(--surface);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
}
.doc-tag.lvl-medium { background: var(--medium); }
.doc-tag.lvl-info { background: var(--info); }
.doc-paper mark { padding: 0 2px; border-radius: 2px; background: #f9b4ad; color: inherit; text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 3px; }

.doc-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 20;
  width: 100%;
  max-width: var(--max-w);
  padding: 10px 18px calc(14px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 -8px 30px rgba(53, 35, 68, 0.12);
}
.doc-sheet .sheet-handle { margin-bottom: 12px; }
.doc-sheet h2 { margin: 8px 0 4px !important; font-size: 1.2rem !important; font-weight: 800; letter-spacing: -0.02em; }
.screen .doc-sheet p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.doc-sheet .help-row { margin-top: 14px; }
.screen .doc-sheet .sheet-foot { margin-top: 10px; font-size: 0.72rem; text-align: center; }
.all-clauses summary { font-weight: 700; cursor: pointer; color: var(--purple-strong); min-height: 24px; }
.all-clauses[open] summary { margin-bottom: 8px; }
.clause-item { padding: 10px 0; border-top: 1px solid var(--line); }
.screen .clause-num { margin: 0 0 2px; font-size: 0.8rem; font-weight: 700; color: var(--purple); }
.screen .clause-text { margin: 0; font-size: 0.9rem; white-space: pre-line; }

/* ---------- Original clause text ---------- */

.loading-tall { flex-direction: column; text-align: center; padding: 48px 16px; }

.clause-quote {
  padding: 10px 12px;
  border-left: 4px solid var(--purple);
  border-radius: 0 10px 10px 0;
  background: var(--lavender-soft);
}
.screen .quote-head { margin: 0 0 4px; font-size: 0.8rem; font-weight: 700; color: var(--purple); }
.clause-quote blockquote { margin: 0; font-size: 0.9rem; white-space: pre-line; }

/* ---------- Your situation (PRD FR7) ---------- */

/* "Optional" tag beside a section heading */
.h2-tag {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--purple-strong);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: 2px;
}

/* "Tell us about you" box, on the scan screen and the Your situation screen */
.situation-input {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
}
.situation-input::placeholder { color: var(--muted); }
.situation-input:focus { outline: none; box-shadow: var(--shadow-lift), 0 0 0 3px var(--lavender); }
.situation-input:disabled { opacity: 0.6; }
.screen .situation-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 4px 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.situation-note svg { width: 14px; height: 14px; margin-top: 2px; flex-shrink: 0; }
#situation-status:not(:empty) { margin-top: 12px; }
.screen #situation-status + .btn { margin-top: 16px; }
.btn-ghost { background: transparent; color: var(--muted); min-height: 44px; margin-top: 6px; }
.btn-ghost:hover { color: var(--purple-strong); }

/* Two links on the right of the Overview's meta row */
.meta-links { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }

/* "Made for you" banner, under the scam check on the Overview */
.for-you {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--deep);
  color: var(--surface);
}
.for-you-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
}
.for-you-icon svg { width: 20px; height: 20px; }
.for-you-body { flex: 1; min-width: 0; }
/* A clear heading, so the tailoring stands out straight away, with what it means underneath */
.screen .for-you-title { margin: 0 0 2px; color: var(--surface); font-size: 1.12rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.screen .for-you-text { margin: 0; color: var(--line); font-size: 0.86rem; font-weight: 500; line-height: 1.4; }
.for-you-btn {
  flex-shrink: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--deep);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.for-you-btn:hover { background: var(--lavender); }

/* "Your plan before you sign" (styled after mockup 6) */
#plan { scroll-margin-top: 72px; }
.section-link { color: var(--purple-strong); font-size: 0.8rem; font-weight: 700; text-decoration: none; }
.section-link:hover { text-decoration: underline; }
.screen .plan-note { margin: 0 4px 10px; color: var(--muted); font-size: 0.85rem; }
.plan-note a { color: var(--purple-strong); font-weight: 700; }
.plan-list .point-title { font-weight: 600; font-size: 0.95rem; }
.step-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--purple-strong);
  font-size: 0.85rem;
  font-weight: 800;
}
.plan-help { display: flex; align-items: center; gap: 8px; margin: -6px 0 12px 42px; color: var(--muted); font-size: 0.78rem; }
.plan-list .point-clauses { padding-left: 42px; }
.help-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lavender-soft);
  box-shadow: inset 0 0 0 1px var(--lavender);
  color: var(--purple-strong);
  font-weight: 700;
  text-decoration: none;
}
.help-chip svg { width: 13px; height: 13px; }
.help-chip:hover { background: var(--lavender); }
.screen .plan-empty p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* "Why this matters for you" on a warning */
.risk-why {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--lavender-soft);
  color: var(--deep);
  font-size: 0.85rem;
  line-height: 1.4;
}
.risk-why strong { color: var(--purple-strong); }
.screen .doc-sheet .sheet-why { margin-top: 8px; }

/* ---------- You decide (PRD FR8, styled after mockup 6) ---------- */

/* Risks tab: each warning is a card holding its link and the three mark buttons */
.risk-card { padding: 16px 16px 12px; }
.risk-card .risk-item:hover { box-shadow: none; }
.risk-card:has(.risk-item:hover) { box-shadow: var(--shadow-lift); }
.mark-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0 54px; }
.mark-btn {
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--lavender-soft);
  box-shadow: inset 0 0 0 1px var(--lavender);
  color: var(--purple-strong);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.mark-btn:hover { background: var(--lavender); }
.mark-btn[aria-pressed="true"] { background: var(--deep); box-shadow: none; color: var(--surface); }
.mark-btn.mark-ok[aria-pressed="true"] { background: var(--success); }
.mark-btn.mark-wrong[aria-pressed="true"] { background: var(--muted); }
.risk-disagreed .risk-item { opacity: 0.7; }
.disagreed-pill { margin-left: 6px; padding: 3px 10px; border-radius: 6px; background: var(--line); color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.risk-item-foot .disagreed-pill { margin-right: auto; }

/* The way into "You decide", at the end of the Summary and Risks tabs */
.decide-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--lavender);
  color: var(--deep);
  text-decoration: none;
}
.decide-card:hover { background: var(--line); }
.decide-card-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--deep); color: var(--surface); }
.decide-card-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.decide-card-body { flex: 1; min-width: 0; }
.decide-card-title { display: block; font-size: 1.05rem; font-weight: 800; }
.decide-card-text { display: block; color: var(--purple-strong); font-size: 0.85rem; line-height: 1.35; }

/* The screen: dark header card like mockup 6's "Your checklist" */
.decide-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--deep);
  color: var(--surface);
}
.decide-count {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--on-dark);
  font-size: 1.3rem;
  font-weight: 800;
}
.screen .decide-title { margin: 0; color: var(--surface); font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.screen .decide-sub { margin: 2px 0 8px; color: var(--line); font-size: 0.88rem; }
.decide-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fdecea; color: var(--high); font-size: 0.78rem; font-weight: 700; }
.screen .decide-h2 { margin: 20px 4px 10px; font-size: 1.05rem; }
.screen .decide-note { margin: -4px 4px 10px; color: var(--muted); font-size: 0.85rem; }

.ask-list { padding: 4px 16px; }
.ask-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ask-item:last-child { border-bottom: 0; }
.ask-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--purple); }
.ask-dot.lvl-high { background: var(--high); }
.ask-dot.lvl-medium { background: var(--medium); }
.ask-text { flex: 1; font-weight: 600; font-size: 0.95rem; line-height: 1.35; }
.clause-chip { flex-shrink: 0; padding: 3px 8px; border-radius: 6px; background: var(--lavender); color: var(--purple-strong); font-size: 0.78rem; font-weight: 700; text-decoration: none; }
.clause-chip.lvl-high { background: var(--high-bg); color: var(--high); }
.clause-chip.lvl-medium { background: var(--medium-bg); color: var(--medium); }
.screen .decide-empty p { margin: 0 0 12px; color: var(--muted); }

/* The draft message */
.screen .draft-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--purple-strong); font-size: 0.85rem; font-weight: 700; }
.draft-label svg { width: 16px; height: 16px; flex-shrink: 0; }
.draft-text {
  width: 100%;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--lavender);
  border-radius: var(--radius-sm);
  background: var(--lavender-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
}
.draft-text:focus { outline: 2px solid var(--purple); outline-offset: 1px; background: var(--surface); }
.draft-status { min-height: 1.2em; margin: 4px 2px 0; color: var(--success); font-size: 0.8rem; font-weight: 700; }
.draft-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.draft-actions .btn { padding: 12px 10px; font-size: 0.92rem; }
.screen .draft-note { margin: 10px 2px 0; color: var(--muted); font-size: 0.8rem; }
.plain-card { background: var(--lavender-soft); box-shadow: inset 0 0 0 1px var(--lavender); }
.screen .plain-label { margin: 0 0 6px; color: var(--purple-strong); font-size: 0.82rem; font-weight: 800; }
.screen .plain-text { margin: 0 0 8px; font-size: 0.95rem; line-height: 1.55; }
.screen .plain-outdated { margin: 0 0 8px; color: var(--medium); font-size: 0.85rem; font-weight: 600; }

/* Four options: same size and style, none picked or highlighted until the user taps one */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-btn {
  min-height: 56px;
  padding: 12px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--lavender), var(--shadow);
  color: var(--deep);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}
.choice-btn:hover { background: var(--lavender-soft); }
.choice-btn[aria-pressed="true"] { background: var(--deep); box-shadow: none; color: var(--surface); }
.choice-next { margin-top: 12px; }
.screen .choice-next p { margin: 0; font-size: 0.92rem; line-height: 1.5; }
.choice-help { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 0.82rem; }
.screen .decide-foot { margin: 22px 8px 8px; color: var(--muted); font-size: 0.82rem; line-height: 1.5; text-align: center; }
.screen .decide-foot strong { color: var(--ink); }

/* Chatbot: "Should I sign?" points to You decide */
.chat-decide { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 10px 14px; font-size: 0.88rem; }
.chat-decide svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; }

/* ---------- No more typing (PRD FR9) ---------- */

/* Photographed pages: a numbered thumbnail strip inside the scan card */
.pages-head { position: relative; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.9rem; font-weight: 700; }
.link-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.link-btn:disabled { opacity: 0.5; cursor: default; }
.page-strip { position: relative; display: flex; gap: 10px; margin: 0 -20px; padding: 2px 20px 8px; overflow-x: auto; list-style: none; scroll-snap-type: x proximity; }
.page-tile { position: relative; flex: 0 0 96px; scroll-snap-align: start; }
.page-tile img { display: block; width: 96px; height: 128px; border-radius: 10px; object-fit: cover; background: var(--surface); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.page-bad img { box-shadow: 0 0 0 3px #fca5a5; }
.page-num {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--deep);
  color: var(--surface);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}
.page-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 6px; }
.page-tools button { display: grid; place-items: center; height: 30px; padding: 0; border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.12); color: var(--surface); cursor: pointer; }
.page-tools button:hover { background: rgba(255, 255, 255, 0.22); }
.page-tools button:disabled { opacity: 0.35; cursor: default; }
.page-tools svg { width: 15px; height: 15px; }
.screen .pages-nric { position: relative; display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 12px; color: #fde68a; font-size: 0.82rem; }
.pages-nric svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.pages-actions { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pick-off { opacity: 0.5; }
.btn-light { position: relative; min-height: 52px; background: var(--surface); color: var(--deep); font-weight: 800; }
.btn-light:hover { background: var(--lavender-soft); }
.btn-light svg { width: 18px; height: 18px; }
.btn-small { padding: 7px 12px; font-size: 0.82rem; }

/* Reading progress, page order and problems */
.read-progress { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; }
.progress-bar { flex-basis: 100%; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--on-dark); transition: width 0.3s; }
.screen .read-note { position: relative; display: flex; align-items: center; gap: 6px; margin: 10px 0 0; color: #bbf7d0; font-size: 0.88rem; font-weight: 700; }
.read-note svg { width: 16px; height: 16px; }
.page-problems { position: relative; margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--surface); color: var(--ink); }
.screen .problems-title { margin: 0 0 8px; color: var(--high); font-weight: 800; }
.page-problems ul { margin: 0 0 10px; padding: 0; list-style: none; }
.page-problems li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.page-problems li span { flex-basis: 100%; }
.page-problems .btn-light { background: var(--deep); color: var(--surface); }

/* "Detected: Job offer from BrightPath Solutions · Change" */
.detected { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--lavender); color: var(--deep); font-size: 0.92rem; font-weight: 600; }
.detected-off { background: var(--medium-bg); color: var(--medium); }
.detected-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--deep); color: var(--surface); }
.detected-icon svg { width: 16px; height: 16px; }
.detected-body { flex: 1; min-width: 0; }
.detected-main { display: block; font-weight: 800; }
.detected-main .link-btn { color: var(--purple-strong); }
.detected-extra { display: block; margin-top: 2px; color: var(--purple-strong); font-size: 0.82rem; }

/* Mic buttons */
.voice-box { position: relative; }
.voice-box .situation-input { padding-right: 52px; }
.mic-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--purple-strong);
  cursor: pointer;
}
.mic-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.mic-btn:hover { background: var(--line); }
.mic-btn[aria-pressed="true"] { background: var(--high); color: var(--surface); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 8px rgba(180, 35, 24, 0.15); } }
.voice-box .mic-btn { position: absolute; right: 8px; bottom: 12px; }
.composer-box .mic-btn { width: 36px; height: 36px; margin-right: 6px; }

/* ---------- Make it fail: a second AI checks the first (PRD FR10) ---------- */

/* "Demo mode: mistakes added on purpose" */
.demo-label { margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: #fef3c7; box-shadow: inset 0 0 0 1.5px #f59e0b; color: #78350f; font-size: 0.85rem; line-height: 1.4; }
.demo-label strong { display: block; color: #92400e; font-size: 0.92rem; }

/* An explanation the two AIs couldn't agree on: the clause itself instead */
.unclear-note { display: block; color: var(--medium); font-weight: 700; }
.unclear-clause { display: block; margin-top: 4px; padding-left: 10px; border-left: 3px solid var(--lavender); color: var(--ink); font-style: italic; }



/* Waiting for the final, double-checked answer (PRD FR10) */
.wait-card { display: grid; justify-items: center; gap: 10px; padding: 28px 20px; text-align: center; }
.screen .wait-now { margin: 0; font-size: 1.05rem; font-weight: 800; }
.wait-steps { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; text-align: left; }
.wait-steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.88rem; }
.wait-steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.wait-steps li.now { color: var(--purple-strong); font-weight: 700; }
.wait-steps li.now::before { background: var(--purple); }
.wait-steps li.done { color: var(--success); }
.wait-steps li.done::before { display: none; }
.wait-steps svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.6; }

/* "✓ Checked twice": a small tick, no details */
.screen .checked-tick { display: inline-flex; align-items: center; gap: 5px; margin: 8px 0 2px; padding: 3px 10px; border-radius: 999px; background: var(--success-bg); color: var(--success); font-size: 0.78rem; font-weight: 700; }
.checked-tick svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.8; }

/* Judge view only (?judge=1): "Behind the scenes" */
.behind { margin: 22px 0 12px; padding: 16px; border-radius: var(--radius); background: #fffbeb; box-shadow: inset 0 0 0 1.5px #fcd34d; }
.screen .behind .h2 { margin-top: 0; }
.screen .behind-intro { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; }
.behind-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.behind-item { padding: 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.behind-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.behind-where { color: var(--purple-strong); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.planted-pill { padding: 2px 8px; border-radius: 6px; background: #fde68a; color: #78350f; font-size: 0.72rem; font-weight: 800; }
.behind-step { display: grid; gap: 2px; padding: 6px 0 6px 12px; border-left: 3px solid var(--line); font-size: 0.86rem; line-height: 1.45; }
.behind-step + .behind-step { margin-top: 4px; }
.behind-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.behind-step.wrote { border-color: var(--line); color: var(--muted); }
.behind-step.caught { border-color: var(--high); }
.behind-step.caught .behind-label { color: var(--high); }
.behind-step.final { border-color: var(--success); }
.behind-step.final .behind-label { color: var(--success); }

/* ==========================================================================
   Desktop layout (screens 1024px and wider), after mockup/desktop/*.html.
   Only applies when <html data-layout="desktop"> (or "frame" for the phone
   view on a wide screen), so the phone layout is unchanged.
   ========================================================================== */

.dt-side,
.frame-bar { display: none; }

/* ---------- The View switch (desktop top bar and above the phone frame) ---------- */

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-family: var(--font);
}
.view-switch-label { padding: 0 6px 0 10px; color: var(--ink); font-size: 14px; font-weight: 700; }
.view-switch button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.view-switch button:hover { background: var(--tint); color: var(--plum); }
.view-switch button[aria-pressed="true"] { background: var(--action); color: var(--surface); font-weight: 700; }
.view-switch button:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

/* ---------- Phone view on a wide screen: a phone-sized frame on lavender ---------- */

html[data-layout="frame"] { --max-w: 430px; }
html[data-layout="frame"] body { background: var(--blush); }
html[data-layout="frame"] .frame-bar { display: flex; justify-content: center; padding: 16px 16px 14px; }
html[data-layout="frame"] .app {
  min-height: calc(100vh - 100px);
  margin-bottom: 24px;
  border-radius: 30px;
  overflow: clip;
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(53, 35, 68, 0.16);
}

/* ---------- Desktop: colours from the mockups, frame, sidebar ---------- */

html[data-layout="desktop"] {
  --bg: var(--page);
  --ink: var(--plum);
  --deep: var(--plum);
  --deep-hover: var(--plum);
  --purple: var(--action);
  --purple-strong: var(--action);
  --lavender: var(--blush);
  --lavender-soft: var(--tint);
}
html[data-layout="desktop"] body { background: var(--page); }
html[data-layout="desktop"] .app {
  max-width: none;
  min-height: 100vh;
  display: grid;
  grid-template-columns: clamp(220px, 18vw, 256px) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: 28px;
  padding: 16px;
  background: var(--tint);
  box-shadow: none;
}
html[data-layout="desktop"] .app-header,
html[data-layout="desktop"] .bottom-nav,
html[data-layout="desktop"] .fab { display: none !important; }
html[data-layout="desktop"] .screen { grid-column: 2; grid-row: 1; min-width: 0; padding: 6px 12px 12px 0; }
html[data-layout="desktop"] .disclaimer,
html[data-layout="desktop"] .no-nav .disclaimer { grid-column: 2; grid-row: 2; padding: 10px 12px 4px 0; color: var(--muted); font-size: 13px; text-align: left; }
html[data-layout="desktop"] :focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

html[data-layout="desktop"] .dt-side {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: sticky;
  top: 16px;
  align-self: start;
  height: calc(100vh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 26px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(53, 35, 68, 0.06);
}
.dt-logo { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; color: var(--plum); text-decoration: none; }
.dt-logo-mark { width: 38px; height: 38px; flex: none; }
.dt-logo-text { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; color: var(--plum); line-height: 1.2; }
.dt-logo-text > span:first-child { color: var(--action); }
.dt-sg { padding: 0 5px; border-radius: 5px; background: var(--blush); color: var(--plum); font-size: 16px; }
.dt-nav { display: flex; flex-direction: column; gap: 4px; }
.dt-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.dt-nav a svg { width: 19px; height: 19px; }
.dt-nav a:hover { background: var(--tint); color: var(--plum); }
.dt-nav a[aria-current="page"] { background: var(--action); color: var(--surface); font-weight: 700; }
.dt-badge { margin-left: auto; padding: 2px 8px; border-radius: 6px; background: var(--blush); color: var(--plum); font-size: 12px; font-weight: 800; }
.dt-side-box { margin-top: auto; display: flex; flex-direction: column; padding: 18px; border-radius: 16px; }
.dt-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.dt-side-private { gap: 10px; background: var(--tint); }
.dt-side-private .dt-eyebrow { color: var(--action); }
.dt-side-private ul { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; color: var(--ink); font-size: 13px; line-height: 1.45; }
.dt-side-private li { display: flex; gap: 8px; }
.dt-side-private li svg { width: 16px; height: 16px; margin-top: 2px; stroke: var(--action); stroke-width: 2.6; }
.dt-side-scam { gap: 6px; background: var(--plum); }
.dt-side-scam .dt-eyebrow { color: #FFD54A; }
.dt-side-scam p { margin: 0; color: var(--on-dark); font-size: 13px; line-height: 1.5; }
.dt-side-scam a { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--surface); font-size: 22px; font-weight: 800; text-decoration: none; }
.dt-side-scam a:focus-visible { outline-color: #FFD54A; }

/* ---------- Desktop: page, top bar, Back ---------- */

.dt-page { max-width: 1480px; }
.dt-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 22px; max-width: 100%; box-sizing: border-box; }
.dt-top .view-switch { max-width: 100%; flex-wrap: wrap; justify-content: center; box-sizing: border-box; }
.dt-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--plum);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dt-lang svg { width: 18px; height: 18px; }
.dt-lang b { color: var(--action); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.dt-lang select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.dt-lang:focus-within { outline: 3px solid var(--action); outline-offset: 2px; }
.dt-narrow { max-width: 760px; }
.dt-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-bottom: 4px; color: var(--action); font-size: 14px; font-weight: 700; text-decoration: none; }
.dt-back svg { width: 18px; height: 18px; }
.dt-back:hover { color: var(--action-hover); }
.screen .dt-inner-h1 { margin: 0 0 14px; font-size: 34px; font-weight: 800; line-height: 1.1; letter-spacing: -0.035em; }

/* ---------- Desktop Home ---------- */

.dt-home { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.dt-home-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.dt-home-side { flex: 1 1 300px; max-width: 390px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.dt-hero { display: flex; flex-direction: column; }

.dt-welcome {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding: 44px 44px 96px;
  border-radius: 28px;
  background: var(--blush);
}
.dt-welcome-ring { position: absolute; right: -120px; top: -150px; width: 420px; height: 420px; }
.dt-welcome-spark { position: absolute; left: 46%; top: 34px; color: var(--coral); }
.dt-welcome-spark svg { width: 26px; height: 26px; }
.dt-welcome-text { position: relative; flex: 3 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.dt-pill { align-self: flex-start; padding: 6px 14px; border-radius: 999px; background: var(--blush); color: var(--plum); font-size: 13px; font-weight: 800; }
.screen .dt-home-h1 { margin: 0; color: var(--plum); font-size: clamp(44px, 4.3vw, 62px); font-weight: 800; line-height: 1.02; letter-spacing: -0.045em; }
.screen .dt-home-h1:lang(ta) { font-size: clamp(30px, 2.9vw, 42px); line-height: 1.2; letter-spacing: -0.02em; }
.dt-accent { color: var(--coral-ink); }
.dt-mark { padding: 0 4px; box-shadow: inset 0 -16px 0 var(--highlight); }
.screen .dt-intro { max-width: 500px; margin: 0; color: var(--ink); font-size: 17px; line-height: 1.65; }

.dt-art { position: relative; flex: 2 1 260px; display: flex; justify-content: center; }
.dt-art-letter {
  position: relative;
  width: 196px;
  height: 236px;
  margin-right: 76px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 20px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 10px 10px 0 var(--line);
}
.dt-art-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--action-hover); font-family: "Source Serif 4", Georgia, serif; font-size: 10px; font-weight: 700; letter-spacing: 0.2em; }
.dt-art-ref { color: var(--action); font-family: "Source Serif 4", Georgia, serif; font-size: 11px; font-weight: 700; }
.dt-art-ref2 { margin-top: 6px; }
.dt-art-line { display: block; height: 6px; border-radius: 3px; background: var(--line); }
.dt-art-hl { width: 100%; height: 12px; background: var(--blush); }
.dt-art-card {
  position: absolute;
  left: calc(50% + 10px);
  top: 120px;
  width: 176px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: var(--plum);
  color: var(--surface);
  box-shadow: 0 14px 30px rgba(53, 35, 68, 0.25);
}
.dt-art-pill { align-self: flex-start; padding: 2px 7px; border-radius: 5px; background: var(--blush); color: var(--plum); font-size: 11px; font-weight: 800; }
.dt-art-text { font-size: 13px; font-weight: 700; line-height: 1.35; }
.dt-art-foot { color: var(--on-dark); font-size: 11px; }

.dt-start {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: -64px 28px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(53, 35, 68, 0.1);
}
.dt-start-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.screen .dt-start-head h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.dt-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--tint); }
.dt-seg-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dt-seg-btn svg { width: 17px; height: 17px; }
.dt-seg-btn:hover { color: var(--plum); background: var(--blush); }
.dt-seg-btn[aria-selected="true"] { background: var(--action); color: var(--surface); font-weight: 700; }
.dt-seg-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.dt-drop {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 150px;
  padding: 22px;
  border: 1.5px dashed var(--on-dark);
  border-radius: 16px;
  background: var(--tint);
  color: var(--plum);
  cursor: pointer;
}
.dt-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dt-drop:hover,
.dt-drop.dt-drop-over { border-color: var(--action); background: var(--tint); }
.dt-drop:focus-within { outline: 3px solid var(--action); outline-offset: 2px; }
.dt-drop-icon { display: grid; place-items: center; flex: none; width: 58px; height: 58px; border-radius: 16px; background: var(--action); color: var(--surface); }
.dt-drop-icon svg { width: 28px; height: 28px; }
.dt-drop-text { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.dt-drop-title { font-size: 18px; font-weight: 800; }
.dt-drop-sub { color: var(--muted); font-size: 14px; }
.dt-nric { align-self: flex-start; margin-top: 4px; padding: 4px 10px; border-radius: 6px; background: var(--blush); color: var(--action-hover); font-size: 12px; font-weight: 700; }
.screen .dt-photo-note { display: flex; align-items: flex-start; gap: 8px; margin: 10px 2px 0; color: var(--muted); font-size: 13px; }
.dt-photo-note svg { width: 16px; height: 16px; margin-top: 1px; }
.dt-scan-card { margin: 0; }
.dt-speak { display: flex; align-items: flex-start; gap: 16px; padding: 18px; border-radius: 16px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.dt-speak-icon { display: grid; place-items: center; flex: none; width: 58px; height: 58px; border-radius: 16px; background: var(--action); color: var(--surface); }
.dt-speak-icon svg { width: 26px; height: 26px; }
.dt-speak-body { display: flex; flex-direction: column; gap: 4px; }
.dt-speak-title { font-size: 18px; font-weight: 800; }
.dt-speak-sub { color: var(--muted); font-size: 14px; line-height: 1.5; }
.screen .dt-speak-next { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.dt-start .voice-box .mic-btn { width: 44px; height: 44px; }
.dt-start .h2 { margin: 6px 0 10px; }
.dt-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 22px; }
.dt-start .detected { margin-top: 0; }
#scan-status:empty { display: none; }

.dt-cando { display: flex; flex-direction: column; gap: 16px; }
.dt-cando-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.screen .dt-cando-head h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.035em; }
.dt-sdgs { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-sdg { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--plum); font-size: 12px; font-weight: 700; }
.dt-sdg b { color: var(--action); }
.dt-bento { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.dt-tile { display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--plum); }
.dt-tile-big { position: relative; overflow: hidden; grid-row: span 2; gap: 12px; min-height: 260px; padding: 26px; border: 0; background: var(--action); color: var(--surface); }
.dt-tile-deco { position: absolute; right: -60px; bottom: -60px; width: 200px; height: 200px; }
.dt-tile-eyebrow { color: var(--on-dark); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.screen .dt-tile-big-title { position: relative; max-width: 240px; margin: 0; color: var(--surface); font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
.screen .dt-tile-big-text { position: relative; max-width: 240px; margin: 0; color: var(--on-dark); font-size: 14px; line-height: 1.55; }
.dt-tile-top { display: flex; align-items: center; gap: 10px; }
.dt-tile-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--blush); color: var(--action); }
.dt-tile-icon svg { width: 20px; height: 20px; }
.dt-tile-num { color: var(--action); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; }
.screen .dt-tile-title { margin: 0; font-size: 17px; font-weight: 800; }
.screen .dt-tile-text { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.dt-tile-yellow { border-color: var(--blush); background: var(--blush); }
.dt-tile-yellow .dt-tile-icon { background: var(--blush); color: var(--plum); }
.dt-tile-yellow .dt-tile-num { color: var(--action-hover); }
.screen .dt-tile-yellow .dt-tile-text { color: var(--ink); }

.dt-ask { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 12px 32px rgba(53, 35, 68, 0.06); }
.dt-ask-head { display: flex; align-items: center; gap: 12px; padding: 20px; background: var(--plum); color: var(--surface); }
.dt-ask-mark { width: 40px; height: 40px; flex: none; }
.screen .dt-ask-head h2 { margin: 0; color: var(--surface); font-size: 18px; font-weight: 800; }
.dt-ask-sub { color: var(--on-dark); font-size: 12px; }
.dt-ask-body { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.screen .dt-ask-hi { margin: 0; padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: var(--tint); font-size: 14px; line-height: 1.55; }
.screen .dt-ask-about { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; }
.dt-ask-about select { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--plum); font: inherit; font-size: 14px; }
.dt-ask-qs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dt-ask-qs button {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--plum);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.dt-ask-qs button:hover:not(:disabled) { border-color: var(--action); background: var(--tint); }
.dt-ask-qs button:disabled { opacity: 0.55; cursor: not-allowed; }
.dt-ask-box { display: flex; align-items: center; gap: 8px; padding: 5px; border-radius: 14px; background: var(--tint); }
.dt-ask-box:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.dt-ask-box input { flex: 1; min-width: 0; height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--plum); font: inherit; font-size: 14px; }
.dt-ask-box input::placeholder { color: var(--muted); }
.dt-ask-box .mic-btn { width: 44px; height: 44px; border-radius: 10px; background: var(--surface); color: var(--action); }
.dt-send { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--action); color: var(--surface); cursor: pointer; }
.dt-send svg { width: 18px; height: 18px; }
.dt-send:disabled { opacity: 0.5; cursor: not-allowed; }

.dt-recent { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 12px 32px rgba(53, 35, 68, 0.06); }
.dt-recent-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 2px; }
.screen .dt-recent-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.dt-recent-head a { display: inline-flex; align-items: center; min-height: 44px; color: var(--action); font-size: 14px; font-weight: 700; text-decoration: none; }
.dt-recent-head a:hover { color: var(--action-hover); text-decoration: underline; }
.dt-recent-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.dt-recent-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px; border-radius: 14px; color: var(--plum); text-decoration: none; }
.dt-recent-item:hover { background: var(--tint); }
.dt-recent-list li:first-child .dt-recent-item { background: var(--tint); }
.dt-recent-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--blush); color: var(--action); }
.dt-recent-list li:first-child .dt-recent-icon { background: var(--action); color: var(--surface); }
.dt-recent-icon svg { width: 20px; height: 20px; }
.dt-recent-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dt-recent-title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.dt-recent-item .chev-sm { width: 18px; height: 18px; color: var(--muted); }
.dt-status { align-self: flex-start; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.dt-status-red { background: #FDE4E4; color: #8A1C1C; }
.dt-status-yellow { background: var(--blush); color: var(--action-hover); }
.dt-status-calm { background: #E3F6EC; color: #0B5B36; }
.dt-status-wait { background: var(--blush); color: var(--action-hover); }
.screen .dt-recent-none { margin: 0; padding: 6px 2px; color: var(--muted); font-size: 14px; }
.screen .dt-side-note { margin: 0; padding: 0 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dt-side-note a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--action); font-weight: 800; }

/* ---------- Desktop contract screen ---------- */

.dt-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dt-head-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dt-crumb { color: var(--muted); font-size: 14px; }
.dt-crumb a { display: inline-flex; align-items: center; min-height: 44px; color: var(--action); font-weight: 600; text-decoration: none; }
.dt-crumb a:hover { color: var(--action-hover); text-decoration: underline; }
.screen .dt-h1 { margin: 0; font-size: 46px; font-weight: 800; line-height: 1.05; letter-spacing: -0.045em; overflow-wrap: anywhere; }
.dt-h1 .dt-mark { color: var(--action); box-shadow: inset 0 -14px 0 var(--highlight); }
.dt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.dt-meta-chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; }
.dt-meta a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--action); font-size: 14px; font-weight: 600; text-decoration: none; }
.dt-meta a:hover { color: var(--action-hover); text-decoration: underline; }
.dt-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dt-icon-btn { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--plum); cursor: pointer; }
.dt-icon-btn svg { width: 18px; height: 18px; }
.dt-icon-btn:hover { background: var(--tint); }
.dt-icon-btn[aria-pressed="true"] { border-color: var(--action); background: var(--blush); color: var(--action-hover); }
.dt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--plum);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.dt-btn svg { width: 18px; height: 18px; color: var(--action); }
.dt-btn:hover { background: var(--tint); }
.dt-btn-primary { border-color: var(--action); background: var(--action); color: var(--surface); font-weight: 800; }
.dt-btn-primary svg { color: var(--surface); }
.dt-btn-primary:hover { border-color: var(--action-hover); background: var(--action-hover); }

.dt-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 26px;
  margin-bottom: 22px;
  padding: 30px;
  border-radius: 26px;
  background: var(--action);
  color: var(--surface);
}
.dt-banner-deco { position: absolute; right: -110px; top: -130px; width: 360px; height: 360px; }
.dt-banner-main { position: relative; flex: 2 1 340px; min-width: 0; display: flex; align-items: center; gap: 22px; }
.dt-ring { flex: none; width: 104px; height: 104px; }
.dt-banner-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.screen .dt-banner h2 { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--surface); font-size: 31px; font-weight: 800; line-height: 1.12; letter-spacing: -0.035em; }
.dt-banner h2 .spinner { flex: none; border-color: rgba(255, 255, 255, 0.35); border-top-color: var(--surface); }
.screen .dt-banner p { margin: 0; color: var(--on-dark); font-size: 15px; line-height: 1.6; }
.dt-stats { position: relative; flex: 1 1 300px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dt-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 16px; background: var(--surface); color: var(--plum); }
.dt-stat b { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.dt-stat span { color: var(--muted); font-size: 13px; line-height: 1.3; }
.dt-stat-yellow { background: var(--blush); }
.dt-stat-yellow span { color: var(--plum); }

/* Two columns (clauses | explanations, plan below) until there's room for three. */
.dt-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  grid-template-areas: "orig mid" "orig right";
  align-items: start;
  gap: 22px;
}
@media (min-width: 1360px) {
  .dt-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: "orig mid right"; }
}

.dt-orig {
  grid-area: orig;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 10px 10px 0 var(--line);
}
.dt-orig-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.screen .dt-orig-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.dt-orig-count { color: var(--muted); font-size: 13px; }
.dt-orig-title { padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--action-hover); font-family: "Source Serif 4", Georgia, serif; font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.dt-clauses {
  position: relative;
  flex: 1;
  min-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 3px 6px 3px 3px;
  color: var(--plum);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 15px;
  line-height: 1.75;
}
.dt-clauses:focus-visible { outline-offset: -3px; }
.screen .dt-cl { margin: 0; border-radius: 10px; white-space: pre-line; }
.dt-cl-num { color: var(--action); font-family: var(--font); font-size: 13px; font-weight: 800; }
.dt-cl-flagged { padding: 10px 12px; background: var(--tint); box-shadow: 0 0 0 2px var(--line); }
.dt-cl-target { padding: 10px 12px; background: var(--blush); box-shadow: 0 0 0 2px var(--action); }
.dt-cl-target .dt-cl-num { color: var(--action-hover); }
.dt-cl mark { padding: 0 2px; border-radius: 2px; background: var(--blush); color: inherit; }
.dt-cl-viewing { display: block; margin-top: 8px; color: var(--action-hover); font-family: var(--font); font-size: 12px; font-weight: 800; white-space: normal; }

.dt-mid {
  grid-area: mid;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(53, 35, 68, 0.06);
}
.screen .dt-mid-foot { margin: 0; color: var(--muted); font-size: 13px; }
html[data-layout="desktop"] .tabs { position: static; margin: 0; padding: 4px; border-radius: 14px; background: var(--tint); }
html[data-layout="desktop"] .tab { min-height: 44px; border-radius: 11px; color: var(--ink); font-size: 15px; }
html[data-layout="desktop"] .tab:hover { color: var(--plum); background: var(--blush); }
html[data-layout="desktop"] .tab[aria-selected="true"] { background: var(--action); color: var(--surface); box-shadow: none; }
html[data-layout="desktop"] #tab-panel > :first-child { margin-top: 0; }

/* Summary rows as separate cards, with the clause chip on the right (mockup) */
html[data-layout="desktop"] .dt-mid .list-card { display: flex; flex-direction: column; gap: 10px; padding: 0; background: none; box-shadow: none; }
html[data-layout="desktop"] .dt-mid .point + .point { border-top: 0; }
html[data-layout="desktop"] .dt-mid .point-row { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--tint); }
html[data-layout="desktop"] .dt-mid button.point-row:hover { border-color: var(--on-dark); }
html[data-layout="desktop"] .dt-mid .point-row.dt-selected { border-color: var(--coral); background: var(--tint); box-shadow: 0 0 0 1px var(--action); }
html[data-layout="desktop"] .dt-mid .point-ref { padding: 4px 8px; border-radius: 6px; background: var(--blush); color: var(--action); font-size: 13px; font-weight: 700; }
html[data-layout="desktop"] .dt-mid .risk-card.dt-selected { box-shadow: 0 0 0 2px var(--action); }

/* "Made for you" in yellow, "Checked twice" as the dark chip */
html[data-layout="desktop"] .for-you { align-items: flex-start; gap: 14px; margin: 12px 0 0; padding: 16px; border-radius: 16px; background: var(--blush); color: var(--plum); }
html[data-layout="desktop"] .for-you-icon { width: 34px; height: 34px; background: none; color: var(--coral); }
html[data-layout="desktop"] .for-you-icon svg { width: 34px; height: 34px; }
html[data-layout="desktop"] .screen .for-you-title { color: var(--plum); font-size: 15px; }
html[data-layout="desktop"] .screen .for-you-text { color: var(--ink); font-size: 14px; line-height: 1.55; }
html[data-layout="desktop"] .for-you-btn { align-self: center; min-height: 44px; padding: 0 14px; background: var(--surface); color: var(--plum); }
html[data-layout="desktop"] .screen .checked-tick { gap: 6px; margin: 0 0 4px; padding: 6px 12px; background: var(--plum); color: var(--surface); font-size: 13px; }
html[data-layout="desktop"] .checked-tick svg { stroke: var(--blush); }

/* The phone's fixed bars sit inside the middle column on desktop */
html[data-layout="desktop"] .composer,
html[data-layout="desktop"] .action-bar { position: static; left: auto; width: auto; max-width: none; padding: 12px 0 0; transform: none; background: none; }
html[data-layout="desktop"] .chat { padding-bottom: 0; }
html[data-layout="desktop"] .doc-sheet { position: sticky; left: auto; max-width: none; transform: none; }
html[data-layout="desktop"] .sheet-backdrop { align-items: center; }
html[data-layout="desktop"] .sheet { max-width: 520px; border-radius: 24px; }
html[data-layout="desktop"] .toast { bottom: 24px; }

/* Targets of at least 44px for the phone screens shown inside the desktop layout */
html[data-layout="desktop"] .help-chip,
html[data-layout="desktop"] .section-link,
html[data-layout="desktop"] .privacy-link,
html[data-layout="desktop"] .link-btn { display: inline-flex; align-items: center; min-height: 44px; }
html[data-layout="desktop"] .help-chip { padding: 0 12px; }

.dt-right { grid-area: right; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.dt-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 12px 32px rgba(53, 35, 68, 0.06); }
.dt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.screen .dt-card-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.dt-count { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--blush); color: var(--plum); font-size: 12px; font-weight: 800; white-space: nowrap; }
.dt-progress { height: 8px; border-radius: 8px; background: var(--blush); }
.dt-progress span { display: block; height: 8px; border-radius: 8px; background: var(--action); transition: width 0.2s; }
.dt-steps { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dt-step { display: flex; align-items: flex-start; gap: 4px; }
.dt-step-check { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: -9px 0 0 -9px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.dt-step-check > span { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 12px; font-weight: 800; }
.dt-step-check svg { width: 14px; height: 14px; stroke-width: 3; }
.dt-step-check:hover > span { border-color: var(--action); color: var(--action); }
.dt-step.next .dt-step-check > span { border-color: var(--action); color: var(--action); }
.dt-step.done .dt-step-check > span { border-color: var(--action); background: var(--action); color: var(--surface); }
.dt-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dt-step-text { font-size: 14px; line-height: 1.5; }
.dt-step.done .dt-step-text { color: var(--muted); text-decoration: line-through; }
.dt-step-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin-top: -2px; }
.dt-ref,
.dt-help { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; text-decoration: none; cursor: pointer; }
.dt-ref > span { padding: 3px 8px; border-radius: 6px; background: var(--blush); color: var(--action); font-size: 13px; font-weight: 700; }
.dt-ref:hover > span { background: var(--line); }
.dt-ref.dt-selected > span { background: var(--blush); color: var(--ink); }
.dt-help > span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); color: var(--action); font-size: 13px; font-weight: 700; }
.dt-help svg { width: 13px; height: 13px; }
.dt-help:hover > span { background: var(--blush); }
.screen .dt-plan-note,
.screen .dt-plan-wait { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; }
.dt-plan-note a,
.dt-plan-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--action); font-size: 14px; font-weight: 700; }

.dt-call { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 22px; background: var(--plum); color: var(--surface); }
.dt-call-deco { position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; }
.dt-call > :not(.dt-call-deco) { position: relative; }
.dt-call-eyebrow { color: var(--blush); font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.screen .dt-call h2 { margin: 0; color: var(--surface); font-size: 25px; font-weight: 800; letter-spacing: -0.035em; }
.dt-call h2 span { color: var(--on-dark); }
.screen .dt-call p { margin: 0; color: var(--on-dark); font-size: 14px; line-height: 1.55; }
.dt-call-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dt-call-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 6px 8px; border: 0; border-radius: 12px; background: var(--surface); color: var(--plum); font: inherit; font-size: 14px; font-weight: 700; line-height: 1.25; cursor: pointer; }
.dt-call-btn svg { width: 16px; height: 16px; stroke-width: 3; }
.dt-call-btn:hover { background: var(--blush); }
.dt-call-btn[aria-pressed="true"] { background: var(--blush); }
.dt-call-next { padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); }
.screen .dt-call-next p { color: var(--on-dark); }
.dt-call-help { display: flex; flex-wrap: wrap; gap: 0 6px; margin-top: 4px; }
.dt-call .dt-help > span { background: var(--surface); box-shadow: none; color: var(--plum); }
.dt-call :focus-visible,
.dt-banner :focus-visible { outline-color: var(--blush); }

/* ---------- Deadlines: every key date from the saved contracts (phone and desktop) ---------- */
.dl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.dl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.dl-date { display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; width: 66px; min-height: 66px; border-radius: 14px; background: var(--blush); color: var(--action-hover); text-align: center; }
.dl-day { font-size: 22px; font-weight: 800; line-height: 1; }
.dl-mon { margin-top: 4px; font-size: 12px; font-weight: 700; }
.dl-main { display: flex; flex: 1 1 240px; flex-direction: column; gap: 4px; min-width: 0; }
.dl-kind { align-self: flex-start; padding: 2px 9px; border-radius: 6px; background: var(--blush); color: var(--action-hover); font-size: 12px; font-weight: 800; }
.dl-text { color: var(--plum); font-size: 15px; line-height: 1.5; }
.dl-meta { display: flex; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.dl-contract { display: inline-flex; align-items: center; min-height: 44px; color: var(--action); font-weight: 700; text-decoration: none; }
.dl-contract:hover { color: var(--action-hover); text-decoration: underline; }
.dl-side { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; }
.dl-days { color: var(--plum); font-size: 14px; font-weight: 800; }
.dl-soon { color: #8A1C1C; }
.dl-ics { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--on-dark); border-radius: 12px; background: var(--surface); color: var(--action); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.dl-ics svg { width: 18px; height: 18px; flex: none; }
.dl-ics:hover:not(:disabled) { background: var(--tint); }
.dl-ics:disabled { opacity: 0.5; cursor: not-allowed; }
.dl-ics:focus-visible,
.dl-contract:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

/* ---------- Contract type check (scan screen prompt, contract screen note) ---------- */
.type-check { margin: 0 0 12px; padding: 14px 16px; border: 1.5px solid var(--medium); border-radius: 16px; background: var(--medium-bg); color: var(--plum); }
.type-check-text { margin: 0 0 10px; font-size: 15px; font-weight: 700; line-height: 1.45; }
.type-check-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.type-check-actions .btn { min-height: 44px; }
.type-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--tint); color: var(--plum); }
.type-note p { flex: 1 1 240px; margin: 0; font-size: 14px; line-height: 1.5; }
.type-note .btn { min-height: 44px; }

/* ---------- Longer translations and long file names wrap instead of overflowing ---------- */
.app button,
.app a,
.app label,
.app h1,
.app h2,
.app h3,
.app p,
.app li,
.app span { overflow-wrap: anywhere; }
.scan-file,
.dt-drop-title,
.dt-drop-sub,
.dt-recent-title { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Voice input: the grey line of what is being heard, and the Stop button ---------- */
.voice-interim { margin: 6px 2px 0; color: var(--muted); font-size: 14px; font-style: italic; line-height: 1.45; min-height: 1.2em; overflow-wrap: anywhere; }
.mic-btn.mic-btn-stop { width: auto; min-width: 44px; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; justify-content: center; background: #B42318; color: var(--surface); font-size: 14px; font-weight: 800; }
.mic-btn.mic-btn-stop svg { stroke: var(--surface); fill: var(--surface); width: 14px; height: 14px; }

/* ---------- Speaker loading state ---------- */
.is-loading { opacity: 0.6; cursor: progress; }

/* Tamil and Malay labels are longer: a smaller font keeps each tab label on one line. */
html[lang="ta"] .tab, html[lang="ms"] .tab { font-size: 0.78rem; letter-spacing: 0; }

/* Long clause names (sections with names, e.g. "ENDORSEMENT A - CLAIMS ADMINISTRATION"): the reference
   goes on its own line under the text, and the main text always uses the full width. */
.point-head { flex-wrap: wrap; justify-content: flex-start; }
.point-head > .point-title { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; }
.point-ref { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.ask-item { flex-wrap: wrap; }
.ask-item .ask-text { flex: 1 1 calc(100% - 40px); min-width: 0; overflow-wrap: anywhere; }
.ask-item .clause-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.clause-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.draft-note { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--blush); color: var(--action-hover); font-size: 0.9rem; font-weight: 600; }

/* Tabs grow to fit their label (a Tamil or Malay label is longer); on a very narrow screen the row scrolls. */
.tabs { grid-template-columns: repeat(4, minmax(max-content, 1fr)); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { min-width: max-content; padding: 0 8px; }

/* ---------- Privacy policy and terms of use (#/privacy, #/terms) ---------- */

.footer-links { display: inline-flex; align-items: center; gap: 2px; }
.footer-links a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 6px; color: var(--purple-strong); font-weight: 700; }

.legal { max-width: 720px; padding-bottom: 8px; }
.legal-top { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.screen .legal-h1 { margin: 0 0 4px; font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.screen .legal-updated { margin: 0 0 16px; color: var(--muted); font-size: 0.85rem; }
.legal-short { margin: 0 0 22px; padding: 16px 18px; border-radius: var(--radius); background: var(--lavender); color: var(--ink); }
.screen .legal-short h2 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 800; }
.legal-short ul { margin: 0 0 10px; padding-left: 20px; line-height: 1.5; }
.legal-short li + li { margin-top: 6px; }
.screen .legal-applies { margin: 0; color: var(--muted); font-size: 0.85rem; }
.screen .legal-body h2 { margin: 22px 0 8px; font-size: 1.15rem; font-weight: 800; }
.legal-body p, .legal-body li { line-height: 1.6; }
.legal-body ul { margin: 0 0 12px; padding-left: 20px; }
.legal-body li + li { margin-top: 6px; }
.legal-body a { color: var(--purple-strong); font-weight: 700; }
.screen .legal-contact { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
html[data-layout="desktop"] .legal-body a,
html[data-layout="desktop"] .legal-contact a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Consent before an upload (two checkboxes) ---------- */

.consent { position: relative; margin: 0 0 14px; padding: 12px 14px 6px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.1); color: var(--surface); }
.consent legend { float: left; width: 100%; margin: 0 0 4px; padding: 0; font-size: 0.95rem; font-weight: 800; }
.consent-row { clear: both; display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; font-size: 0.92rem; line-height: 1.4; cursor: pointer; }
.consent-row input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--yellow); cursor: pointer; }
.consent-row input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.screen .consent-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin: 0; font-size: 0.85rem; }
.consent-foot #consent-hint { flex-basis: 100%; color: #fde68a; font-weight: 600; }
.consent-foot a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; color: var(--surface); font-weight: 700; }
.consent-foot a:focus-visible { outline-color: var(--yellow); }
/* Desktop: the boxes sit on the white start card */
.dt-start .consent { margin: 0; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); color: var(--plum); }
.dt-start .consent-row input { accent-color: var(--action); }
.dt-start .consent-row input:focus-visible { outline-color: var(--action); }
.dt-start .consent-foot #consent-hint { color: var(--action-hover); }
.dt-start .consent-foot a { color: var(--action); }
.dt-start .consent-foot a:focus-visible { outline-color: var(--action); }
.dt-drop:has(input:disabled) { cursor: not-allowed; opacity: 0.6; }
.dt-drop input:disabled { cursor: not-allowed; }

/* Account and recruited-lawyer directory use the existing card/button palette. */
.guest-banner { padding: 16px 20px; margin: 0 0 20px; border: 1px solid var(--line); background: var(--tint); }
.guest-banner p { line-height: 1.6; overflow-wrap: anywhere; }
.account-page { max-width: 680px; margin-inline: auto; }
.account-page .card { padding: 22px; }
.account-form { display: grid; gap: 14px; margin: 16px 0 24px; }
.account-form label, .directory-filter { display: grid; gap: 8px; font-weight: 600; }
.account-form input, .directory-filter select { width: 100%; min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); color: var(--plum); font: inherit; }
.account-page details { border-top: 1px solid var(--line); padding-block: 12px; }
.account-delete { margin-top: 24px; }
.account-delete summary { color: var(--high); }
.account-delete fieldset { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: 16px; }
.account-form .delete-confirm { display: flex; align-items: flex-start; gap: 12px; }
.account-form .delete-confirm input { flex: 0 0 24px; width: 24px; min-height: 24px; margin: 2px 0 0; accent-color: var(--action); }
.account-page summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.account-actions, .lawyer-contacts { display: flex; flex-wrap: wrap; gap: 10px; }
.account-page p, .lawyer-directory p, .lawyer-card dd { overflow-wrap: anywhere; line-height: 1.65; }
.directory-filter { max-width: 340px; }
.directory-note { margin-block: 20px; color: var(--muted); }
.lawyer-group { margin-block: 28px; }
.lawyer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr)); gap: 16px; }
.lawyer-card, .directory-empty { padding: 22px; margin: 0; }
.lawyer-card h3, .directory-empty h3 { margin-top: 0; }
.directory-empty { border: 1px dashed var(--line); background: var(--tint); }
.directory-empty > span { display: block; color: var(--action); font-size: 2rem; margin-bottom: 8px; }
.lawyer-card dl > div { margin-block: 12px; }
.lawyer-card dt { font-size: .85rem; color: var(--muted); }
.lawyer-card dd { margin: 4px 0 0; }
.bottom-nav a { min-width: 0; overflow-wrap: anywhere; }
.bottom-nav a span { max-width: 100%; line-height: 1.4; }
@media (max-width: 480px) { .account-page .card, .lawyer-card, .directory-empty { padding: 16px; } .bottom-nav a { font-size: .68rem; padding-inline: 3px; } }

/* ClauseSav identity: colour-mapped supplied image assets, one responsive logo per screen. */
.brand-horizontal, .brand-stacked, .brand-symbol { display: block; object-fit: contain; height: auto; }
.logo { width: 166px; max-width: 49%; min-width: 120px; text-decoration: none; }
.logo .brand-horizontal { width: 100%; }
.mobile-brand { display: flex; align-items: center; min-height: 60px; padding: calc(10px + env(safe-area-inset-top)) 16px 6px; background: var(--surface); }
.mobile-brand img { width: 166px; max-width: 60%; height: auto; object-fit: contain; }
body[data-page="home"] .mobile-brand { display: none; }
html[data-layout="desktop"] .mobile-brand { display: none; }
.dt-logo { justify-content: center; padding: 0 8px; }
.dt-logo .brand-stacked { width: 152px; max-width: 100%; height: auto; }
html[data-layout="desktop"] .dt-side { gap: 22px; }
.home-top { gap: 8px; }
.home-top .lang-pill { flex-shrink: 0; }
.dt-ask-mark { padding: 3px; border-radius: 9px; background: var(--surface); object-fit: contain; }
.dt-welcome-ring, .dt-tile-deco, .dt-banner-deco, .dt-call-deco { display: none; }
.btn-primary { background: var(--action); color: var(--surface); }
.btn-primary:hover { background: var(--action-hover); }
.dt-nav a[aria-current="page"]:hover,
.view-switch button[aria-pressed="true"]:hover,
.dt-seg-btn[aria-selected="true"]:hover,
html[data-layout="desktop"] .tab[aria-selected="true"]:hover,
.dt-send:hover:not(:disabled) { background: var(--action-hover); color: var(--surface); }
.btn-primary:disabled:hover { background: var(--action); }
.screen :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="file"]) { border-color: var(--control-border); }
.dt-art-pill { background: var(--high-bg); color: var(--high); }
.dt-status-yellow, .dt-stat-yellow { background: var(--medium-bg); color: var(--medium); }
.dt-stat-yellow span { color: var(--medium); }
.dt-tile-yellow .dt-tile-icon { background: var(--line); }
:is(.scan-card, .banner-dark, .dt-banner, .dt-ask-head, .dt-side-scam) :focus-visible { outline-color: var(--surface); }
@media (max-width: 350px) { .logo { width: 132px; } .home-top .lang-pill { padding-inline: 8px; gap: 5px; } }
