/* ============================================================
   ailawyer.sg — "Lawson"
   Bespoke design system: PRECISION FINTECH
   Cold indigo + near-black + restrained mint accent.
   All sans-serif (Inter). Tabular numerals. Fine-line grid.
   Mid radius (8-10px). Restrained glassmorphism.
   ============================================================ */

:root {
  /* --- Surface scale (page / card / sunken) --- */
  --surface-0: #0b0e1a;
  --surface-1: #10152a;
  --surface-2: #161d38;
  --surface-3: #1d2647;
  --surface-sunken: #080a14;
  --surface-light: #f7f8fc;
  --surface-light-2: #eef0f8;

  /* --- Brand: cold indigo + mint accent --- */
  --indigo: #2f4be0;
  --indigo-bright: #4c67ff;
  --indigo-deep: #1e2a78;
  --indigo-ink: #141b52;
  --mint: #3de0b0;
  --mint-dim: #2bb891;

  /* --- Text (three tiers, dark theme) --- */
  --text: #eaecf7;
  --text-muted: #9aa2c4;
  --text-faint: #6b74a0;
  --ink: #10152a;
  --ink-muted: #47507a;
  --ink-faint: #7a83a8;

  /* --- Hairlines (three tiers) --- */
  --line: rgba(255,255,255,0.07);
  --line-2: rgba(255,255,255,0.12);
  --line-strong: rgba(255,255,255,0.20);
  --line-light: #dfe3f2;

  /* --- Grid texture --- */
  --grid: rgba(124,140,220,0.055);
  --grid-strong: rgba(124,140,220,0.10);

  /* --- Radius (mid) --- */
  --r-xs: 6px;
  --r: 9px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* --- Shadow (4 steps, cool) --- */
  --sh-1: 0 1px 0 rgba(255,255,255,0.03), 0 1px 2px rgba(4,6,16,0.5);
  --sh-2: 0 2px 8px rgba(4,6,16,0.55), 0 0 0 1px rgba(255,255,255,0.03);
  --sh-3: 0 12px 40px rgba(4,6,16,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  --sh-glow: 0 0 0 1px rgba(47,75,224,0.5), 0 8px 30px rgba(47,75,224,0.25);

  /* --- Type --- */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC',
          'Microsoft YaHei', 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;

  /* --- Motion --- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --max: 1180px;
  --narrow: 720px;

  /* legacy aliases so inline styles in old shells (404, how-it-works) still resolve */
  --teal: var(--indigo);
  --teal-dark: var(--indigo-deep);
  --teal-light: var(--indigo-bright);
  --copper: var(--mint);
  --copper-light: var(--mint-dim);
  --bg: var(--surface-0);
  --bg-card: var(--surface-2);
  --bg-dark: var(--surface-0);
  --border: var(--line);
  --radius: var(--r-lg);
  --radius-sm: var(--r);
  --radius-lg: var(--r-lg);
  --font-sans: var(--sans);
  --font-serif: var(--sans);
  --shadow: var(--sh-2);
  --shadow-lg: var(--sh-3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--surface-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-feature-settings: "cv02","cv03","cv04","ss01";
}

.num, .stat-value, .step-num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 650; line-height: 1.18; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.15rem; }
p { margin-bottom: 1rem; }
a { color: var(--indigo-bright); text-decoration: none; transition: color 0.18s var(--ease); }
a:hover { color: var(--mint); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 24px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  background: rgba(11,14,26,0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.08rem; font-weight: 700; color: var(--text); letter-spacing: -0.03em;
}
.brand:hover { color: var(--text); }
.brand .mark {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--r);
  background: linear-gradient(140deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: #fff; font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 0 0 1px rgba(76,103,255,0.35), 0 4px 12px rgba(47,75,224,0.3);
}
.brand .dim { color: var(--text-faint); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; }
.nav-links > a {
  color: var(--text-muted); padding: 7px 12px; border-radius: var(--r);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-links > a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.lang {
  display: flex; gap: 2px; margin-left: 8px; padding: 3px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: rgba(255,255,255,0.02);
}
.lang a { font-size: 0.76rem; padding: 4px 11px; border-radius: var(--r-pill); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lang a:hover { color: var(--text); }
.lang a.on { background: var(--indigo); color: #fff; }
.lang a.on:hover { background: var(--indigo-bright); color: #fff; }

/* ============================================================
   HERO — precision grid / coordinate texture
   ============================================================ */
.hero {
  position: relative; padding: 84px 0 72px; text-align: center; overflow: hidden;
  background:
    radial-gradient(900px 480px at 50% -8%, rgba(47,75,224,0.28), transparent 62%),
    radial-gradient(700px 400px at 82% 8%, rgba(61,224,176,0.10), transparent 60%),
    var(--surface-0);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(680px 420px at 50% 30%, #000 45%, transparent 80%);
  mask-image: radial-gradient(680px 420px at 50% 30%, #000 45%, transparent 80%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, transparent 49.85%, var(--grid-strong) 49.85%, var(--grid-strong) 50.15%, transparent 50.15%);
  -webkit-mask-image: radial-gradient(500px 320px at 50% 34%, #000 30%, transparent 75%);
  mask-image: radial-gradient(500px 320px at 50% 34%, #000 30%, transparent 75%);
}
.hero .wrap { position: relative; z-index: 2; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--mint); font-weight: 500;
  background: rgba(61,224,176,0.07); border: 1px solid rgba(61,224,176,0.22);
  padding: 6px 14px; border-radius: var(--r-pill); margin-bottom: 26px;
}
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.1rem); font-weight: 700; color: var(--text);
  letter-spacing: -0.035em; line-height: 1.08; max-width: 760px; margin: 0 auto 18px;
}
.hero h1 em { font-style: normal; color: var(--indigo-bright); }
.hero .lede {
  font-size: 1.06rem; color: var(--text-muted); max-width: 640px; margin: 0 auto 30px; line-height: 1.6;
}

/* ============================================================
   INLINE CHAT (homepage tool) — the hero
   ============================================================ */
#assistant-inline {
  position: relative; z-index: 3; max-width: 660px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(22,29,56,0.92), rgba(16,21,42,0.92));
  border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow: hidden;
}
#assistant-inline::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(76,103,255,0.10), transparent 30%);
}
.inline-chat { display: flex; flex-direction: column; max-height: 540px; position: relative; }
.inline-msgs { flex: 1; overflow-y: auto; padding: 22px 20px 8px; min-height: 56px; display: flex; flex-direction: column; gap: 12px; }
.inline-welcome { text-align: left; padding: 4px 2px 12px; color: var(--text-muted); font-size: 0.94rem; line-height: 1.55; }
.inline-welcome span { font-weight: 650; color: var(--mint); }

.msg {
  max-width: 88%; padding: 11px 15px; border-radius: var(--r);
  font-size: 0.92rem; line-height: 1.55; animation: msgIn 0.28s var(--ease-out);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.msg.user {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; box-shadow: 0 2px 10px rgba(47,75,224,0.3);
}
.msg.bot {
  background: var(--surface-3); color: var(--text); align-self: flex-start;
  border: 1px solid var(--line); border-bottom-left-radius: 3px;
}
.msg.bot a { color: var(--mint); text-decoration: underline; text-underline-offset: 2px; }
.msg.bot strong { color: #fff; font-weight: 650; }
.msg.bot em { color: var(--text); }
.msg.bot code {
  font-family: var(--mono); font-size: 0.84em; background: var(--surface-sunken);
  border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px;
}
.msg.bot ul, .msg.bot ol { margin: 6px 0 6px 18px; }
.msg.bot li { margin-bottom: 3px; }
.msg.bot p { margin-bottom: 8px; }
.msg.bot p:last-child { margin-bottom: 0; }
.msg.bot h4 { font-size: 0.95rem; margin: 8px 0 4px; color: #fff; }
.msg .disclaimer-tag {
  display: block; margin-top: 8px; font-size: 0.7rem; color: var(--text-faint);
  border-top: 1px solid var(--line-2); padding-top: 6px; line-height: 1.4;
}
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 3px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: blink 1.3s infinite both; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.inline-input-row {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px;
  border-top: 1px solid var(--line-2); background: rgba(8,10,20,0.5);
}
.inline-input-row textarea {
  flex: 1; border: 1px solid var(--line-2); border-radius: var(--r); padding: 11px 14px;
  font-family: var(--sans); font-size: 0.92rem; resize: none; min-height: 44px; max-height: 160px;
  line-height: 1.5; outline: none; background: var(--surface-sunken); color: var(--text);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.inline-input-row textarea::placeholder { color: var(--text-faint); }
.inline-input-row textarea:focus { border-color: rgba(76,103,255,0.6); box-shadow: 0 0 0 3px rgba(47,75,224,0.15); }
.inline-input-row button {
  width: 46px; height: 46px; border: none; border-radius: var(--r);
  background: linear-gradient(135deg, var(--indigo), var(--indigo-deep)); color: #fff;
  cursor: pointer; font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s var(--ease), box-shadow 0.18s var(--ease), background 0.18s;
  flex-shrink: 0; box-shadow: 0 2px 10px rgba(47,75,224,0.35);
}
.inline-input-row button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(47,75,224,0.5); }
.inline-input-row button:disabled { background: var(--surface-3); color: var(--text-faint); cursor: not-allowed; box-shadow: none; }

/* ---------- Chips ---------- */
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 680px; margin: 18px auto 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.83rem; color: var(--text-muted);
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-2); padding: 7px 14px;
  border-radius: var(--r-pill); cursor: pointer; transition: all 0.18s var(--ease);
}
.pill:hover { border-color: rgba(76,103,255,0.5); color: var(--text); background: rgba(47,75,224,0.12); }
.pill i { font-size: 0.9rem; color: var(--indigo-bright); }

/* ============================================================
   SECTIONS
   ============================================================ */
section { padding: 66px 0; position: relative; }
section[style*="background:#fff"], section[style*="background: #fff"] {
  background: var(--surface-1) !important; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.sec-head h2 { font-size: 1.45rem; color: var(--text); }
.sec-head > a { font-size: 0.85rem; color: var(--mint); font-weight: 550; font-family: var(--mono); letter-spacing: 0.02em; }
.sec-head > a:hover { color: var(--indigo-bright); }
.sec-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; display: block; }

/* ---------- Metric row (precision data feel) ---------- */
.metric-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-1);
}
.metric { padding: 26px 22px; border-right: 1px solid var(--line); position: relative; }
.metric:last-child { border-right: none; }
.metric .stat-value { font-size: 2rem; font-weight: 700; color: var(--text); letter-spacing: -0.03em; line-height: 1; display: block; margin-bottom: 6px; }
.metric .stat-value em { font-style: normal; color: var(--mint); font-size: 0.68em; }
.metric .stat-label { font-size: 0.82rem; color: var(--text-muted); }

/* ---------- Guides grid ---------- */
.guides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.guide-card {
  position: relative; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.guide-card::after {
  content: ""; position: absolute; left: 0; top: 16px; width: 2px; height: 0;
  background: linear-gradient(var(--indigo-bright), var(--mint)); border-radius: 2px; transition: height 0.25s var(--ease);
}
.guide-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--sh-3); }
.guide-card:hover::after { height: calc(100% - 32px); }
.guide-card h3 { font-size: 0.98rem; line-height: 1.35; margin-bottom: 6px; font-weight: 600; }
.guide-card h3 a { color: var(--text); }
.guide-card h3 a:hover { color: var(--indigo-bright); }
.guide-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.guide-card .topic-tag {
  display: inline-block; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mint); background: rgba(61,224,176,0.08); border: 1px solid rgba(61,224,176,0.2);
  padding: 2px 9px; border-radius: var(--r-pill); margin-bottom: 12px;
}

/* ---------- Feature row ---------- */
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.feature {
  display: flex; gap: 14px; padding: 22px; background: var(--surface-2); border-radius: var(--r-lg);
  border: 1px solid var(--line); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.feature:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature .feat-icon {
  width: 42px; height: 42px; border-radius: var(--r); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1.2rem;
}
.feature .feat-icon.teal { background: rgba(47,75,224,0.15); color: var(--indigo-bright); border: 1px solid rgba(76,103,255,0.25); }
.feature .feat-icon.copper { background: rgba(61,224,176,0.12); color: var(--mint); border: 1px solid rgba(61,224,176,0.25); }
.feature h4 { font-size: 0.95rem; margin-bottom: 4px; color: var(--text); font-weight: 600; }
.feature p { font-size: 0.85rem; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* ---------- How steps ---------- */
.how-steps { margin: 30px 0; display: grid; gap: 12px; }
.how-step {
  display: flex; gap: 16px; align-items: flex-start; padding: 22px;
  background: var(--surface-2); border-radius: var(--r-lg); border: 1px solid var(--line);
  position: relative; transition: border-color 0.2s var(--ease);
}
.how-step:hover { border-color: var(--line-strong); }
.how-step .step-num {
  width: 38px; height: 38px; border-radius: var(--r); background: rgba(47,75,224,0.14);
  border: 1px solid rgba(76,103,255,0.3); color: var(--indigo-bright);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.05rem;
  flex-shrink: 0; font-variant-numeric: tabular-nums; font-family: var(--mono);
}
.how-step h3 { font-size: 1.02rem; margin-bottom: 4px; color: var(--text); }
.how-step p { font-size: 0.9rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* ---------- Disclaimer bar ---------- */
.disc-bar {
  background: var(--indigo-ink); border-top: 1px solid rgba(76,103,255,0.25); border-bottom: 1px solid rgba(76,103,255,0.25);
  color: var(--text-muted); font-size: 0.8rem; padding: 11px 0; text-align: center;
}
.disc-bar i { margin-right: 6px; vertical-align: -1px; color: var(--mint); }

/* ---------- Trust strip ---------- */
.trust-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 30px 0; background: var(--surface-1); }
.trust-strip .wrap { display: flex; align-items: center; justify-content: center; gap: 44px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.86rem; }
.trust-item i { font-size: 1.15rem; color: var(--mint); }

/* ============================================================
   ARTICLE (guide pages) — light editorial-data zone
   ============================================================ */
.article-main { padding: 0; background: var(--surface-light); }
.article-main .wrap-narrow, .article-main .wrap { padding-top: 44px; padding-bottom: 64px; }
.guide-article { font-size: 1rem; color: var(--ink); }
.breadcrumb { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em; color: var(--ink-faint); margin-bottom: 18px; }
.breadcrumb a { color: var(--ink-muted); }
.breadcrumb a:hover { color: var(--indigo); }
.guide-article h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.15rem); font-weight: 700; color: var(--ink);
  letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 10px;
}
.guide-article .lede { color: var(--ink-muted); }
.byline {
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.03em; color: var(--ink-faint);
  margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line-light);
}
.guide-article h2 {
  font-size: 1.32rem; margin-top: 38px; margin-bottom: 12px; color: var(--ink); font-weight: 650;
  letter-spacing: -0.02em; padding-left: 14px; border-left: 3px solid var(--indigo);
}
.guide-article h3 { font-size: 1.06rem; margin-top: 24px; margin-bottom: 8px; color: var(--indigo-deep); font-weight: 650; }
.guide-article p { color: var(--ink); line-height: 1.75; margin-bottom: 14px; }
.guide-article ul, .guide-article ol { margin: 0 0 16px 22px; line-height: 1.7; color: var(--ink); }
.guide-article li { margin-bottom: 7px; }
.guide-article li::marker { color: var(--indigo); }
.guide-article strong { color: var(--indigo-deep); font-weight: 650; }
.guide-article em { color: var(--ink-muted); }
.guide-article a { color: var(--indigo); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.guide-article a:hover { color: var(--indigo-bright); }
.guide-article section { padding: 0; background: transparent !important; border: none !important; }

/* CTA boxes inside articles */
.cta-note, .cta-bot {
  margin-top: 34px; padding: 18px 22px;
  background: linear-gradient(135deg, rgba(47,75,224,0.06), rgba(61,224,176,0.05));
  border: 1px solid var(--line-light); border-left: 3px solid var(--mint);
  border-radius: var(--r); color: var(--ink); font-weight: 500;
}
.cta-note a, .cta-bot a { font-weight: 650; color: var(--indigo); cursor: pointer; text-decoration: none; }
.cta-note a:hover, .cta-bot a:hover { color: var(--indigo-bright); }

/* ============================================================
   FLOATING CHAT BUBBLE (inner pages)
   ============================================================ */
#chat-bubble-widget { position: fixed; bottom: 22px; right: 22px; z-index: 999; }
.bubble-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(140deg, var(--indigo) 0%, var(--indigo-deep) 100%); color: #fff;
  border: none; cursor: pointer; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(47,75,224,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); position: relative;
}
.bubble-btn:hover { transform: scale(1.06); box-shadow: 0 8px 30px rgba(47,75,224,0.6); }
.bubble-btn .online-dot {
  position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--mint); border: 2px solid var(--surface-light); box-shadow: 0 0 0 1px rgba(61,224,176,0.4);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.55; } }

.bubble-panel {
  position: absolute; bottom: 70px; right: 0; width: 384px; max-height: min(560px, 76vh);
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  overflow: hidden; flex-direction: column; display: flex; transform-origin: bottom right;
  animation: panelIn 0.24s var(--ease-out);
}
.bubble-panel[hidden] { display: none; }
.bubble-panel.open { display: flex; }
.bubble-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 44px 14px 16px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.02);
}
.bubble-header .bh-mark {
  width: 30px; height: 30px; border-radius: var(--r);
  background: linear-gradient(140deg, var(--indigo), var(--indigo-deep));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.9rem;
}
.bubble-header .bh-name { font-weight: 650; font-size: 0.9rem; color: var(--text); line-height: 1.1; }
.bubble-header .bh-status { font-size: 0.7rem; color: var(--mint); display: flex; align-items: center; gap: 5px; }
.bubble-header .bh-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); animation: pulse-dot 2s infinite; }
.bubble-panel .bubble-msgs { flex: 1; overflow-y: auto; padding: 16px; min-height: 60px; display: flex; flex-direction: column; gap: 10px; }
.bubble-panel .inline-input-row { padding: 10px 12px; }
.bubble-panel .inline-input-row textarea { max-height: 120px; min-height: 42px; }
.bubble-close {
  position: absolute; top: 11px; right: 11px; width: 28px; height: 28px; border-radius: var(--r-xs);
  border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: var(--text-muted);
  z-index: 2; transition: background 0.18s, color 0.18s;
}
.bubble-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--surface-sunken); color: var(--text-muted); padding: 52px 0 26px;
  font-size: 0.88rem; border-top: 1px solid var(--line);
}
.footer-grid { display: grid; grid-template-columns: 2.2fr 1fr 1fr; gap: 40px; margin-bottom: 34px; }
.footer-grid h3 { color: var(--text); font-size: 1.02rem; margin-bottom: 10px; letter-spacing: -0.02em; }
.footer-grid > div > p { color: var(--text-faint); font-size: 0.85rem; line-height: 1.6; max-width: 44ch; }
.footer-grid h4 { color: var(--text-faint); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 14px; font-family: var(--mono); }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid a { color: var(--text-muted); font-size: 0.85rem; }
.footer-grid a:hover { color: var(--mint); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 18px; font-size: 0.76rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* ---------- Jurisdiction grid (compat) ---------- */
.juris-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.juris-item { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface-2); border-radius: var(--r-lg); border: 1px solid var(--line); font-size: 0.9rem; color: var(--text); }
.juris-item i { color: var(--mint); font-size: 1.1rem; }

/* ---------- 404 helper ---------- */
.err-code { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: clamp(4rem, 12vw, 7rem); font-weight: 700; letter-spacing: -0.04em; color: var(--indigo-bright); line-height: 1; margin-bottom: 12px; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
[data-reveal].in { opacity: 1; transform: none; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: none; }
  .metric:nth-child(1), .metric:nth-child(2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 768px) {
  h1 { font-size: 1.9rem; }
  .hero { padding: 56px 0 44px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .guides-grid { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
  .trust-strip .wrap { gap: 20px 30px; }
  .bubble-panel { width: calc(100vw - 28px); right: -6px; max-height: 72vh; }
  section { padding: 48px 0; }
  .hide-sm { display: none !important; }
}
@media (max-width: 560px) {
  .metric-row { grid-template-columns: 1fr; }
  .metric { border-right: none; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .bubble-btn .online-dot, .bubble-header .bh-status::before { animation: none; }
}

/* ============================================================
   LIGHT LISTING ZONE (guides index) — contrast fixes
   .article-main is a light surface; headings/intro that are NOT
   inside .guide-article must use dark ink, and guide-cards need a
   light-surface variant so they read on the light background.
   ============================================================ */
.article-main > .wrap > h1,
.article-main > .wrap > .breadcrumb,
.article-main > .wrap > .lede,
.article-main > .wrap > p { color: var(--ink); }
.article-main > .wrap > h1 { color: var(--ink); letter-spacing: -0.03em; margin-bottom: 8px; }
.article-main > .wrap > .breadcrumb { color: var(--ink-faint); }
.article-main > .wrap > .breadcrumb a { color: var(--ink-muted); }
.article-main > .wrap > .breadcrumb a:hover { color: var(--indigo); }
.article-main > .wrap > .lede { color: var(--ink-muted) !important; }

/* guide-cards on the light listing surface */
.article-main .guides-grid .guide-card {
  background: #fff;
  border: 1px solid var(--line-light);
  box-shadow: 0 1px 2px rgba(16,21,42,0.04);
}
.article-main .guides-grid .guide-card h3 a { color: var(--ink); }
.article-main .guides-grid .guide-card h3 a:hover { color: var(--indigo); }
.article-main .guides-grid .guide-card p { color: var(--ink-muted); }
.article-main .guides-grid .guide-card:hover {
  border-color: var(--indigo);
  box-shadow: 0 10px 30px rgba(16,21,42,0.10);
}
.article-main .guides-grid .guide-card .topic-tag {
  color: var(--indigo); background: rgba(47,75,224,0.07); border-color: rgba(47,75,224,0.2);
}
