/* ==========================================================================
   Ovana — upgrade page
   ========================================================================== */

:root {
  --green-50: #ecf8f0;
  --green-100: #d3efdd;
  --green-500: #1fa34a;
  --green-600: #138a3e;
  --green-700: #0f7a3c;
  --green-800: #0b5d2e;
  --green-900: #083f21;
  --navy: #17264d;

  --bg: #f6faf7;
  --bg-hero-a: #f3faf5;
  --bg-hero-b: #d9eef0;
  --surface: #ffffff;
  --surface-2: #f3f7f4;
  --tint: #eef6f1;
  --ink: #1d2420;
  --ink-2: #4a5550;
  --muted: #6f7a74;
  --line: #e1e8e3;
  --line-2: #d2ddd6;
  --accent: var(--green-600);
  --amber: #b26a00;
  --amber-bg: #fff4e0;
  --logo-ink: var(--navy);
  --shadow-sm: 0 1px 2px rgba(16, 40, 28, .06);
  --shadow: 0 1px 2px rgba(16, 40, 28, .05), 0 8px 24px rgba(16, 40, 28, .07);
  --shadow-lg: 0 24px 60px rgba(10, 40, 24, .18);
  --grad: linear-gradient(135deg, #1fa34a 0%, #0f7a3c 55%, #0b5d2e 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1511;
    --bg-hero-a: #0c1a14;
    --bg-hero-b: #0d2026;
    --surface: #121e19;
    --surface-2: #17251f;
    --tint: #0f1b16;
    --ink: #e7efe9;
    --ink-2: #b7c4bc;
    --muted: #8a9a91;
    --line: #22332b;
    --line-2: #2c4036;
    --accent: #3ccf6e;
    --amber: #f2b45a;
    --amber-bg: #2d2412;
    --logo-ink: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1511;
  --bg-hero-a: #0c1a14;
  --bg-hero-b: #0d2026;
  --surface: #121e19;
  --surface-2: #17251f;
  --tint: #0f1b16;
  --ink: #e7efe9;
  --ink-2: #b7c4bc;
  --muted: #8a9a91;
  --line: #22332b;
  --line-2: #2c4036;
  --accent: #3ccf6e;
  --amber: #f2b45a;
  --amber-bg: #2d2412;
  --logo-ink: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
svg { display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 820px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

/* inline icons */
.btn svg, .meta svg, .menu-btn svg, .theme-btn svg, .drawer-close svg, .icon-btn svg,
.ai-send svg, .ai-launcher svg, .drawer-acc summary svg, .portal-ico svg, .f-ico svg,
.restored-ico svg, .phase-dot svg, .msg .avatar svg, .think-chev svg {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- logo ---------- */
.logo { height: 34px; width: auto; aspect-ratio: 182 / 64; }
.logo-light { --logo-ink: #ffffff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(15, 122, 60, .28), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(15, 122, 60, .34), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn-ghost:hover { background: var(--tint); }
.btn-light { background: #fff; color: var(--green-800); }
.btn-light:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.btn-ghost-light { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .16); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

/* ---------- ribbon ---------- */
.ribbon {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 16px; font-size: 13.5px; font-weight: 500; text-align: center;
  background: var(--green-900); color: #dff5e7;
}
.is-restored .ribbon { background: var(--green-700); color: #fff; }
.pulse {
  flex: none; width: 8px; height: 8px; border-radius: 50%; background: #f5b53d;
  box-shadow: 0 0 0 0 rgba(245, 181, 61, .6); animation: pulse 1.8s infinite;
}
.is-restored .pulse, .badge.is-ok .pulse { background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(245, 181, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 181, 61, 0); } }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 12px; height: 68px; }
.menu-btn, .theme-btn {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  cursor: pointer; box-shadow: var(--shadow-sm); color: var(--ink);
}
.menu-btn svg, .theme-btn svg { width: 20px; height: 20px; }
.menu-btn:hover, .theme-btn:hover { border-color: var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-sep { width: 1px; height: 22px; background: var(--line-2); }
.pill-nclex {
  font-size: 11.5px; font-weight: 800; letter-spacing: .14em; color: #fff;
  background: #133b2b; padding: 3px 10px; border-radius: 6px;
}
.topnav { display: none; gap: 4px; margin-left: 20px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14.5px; padding: 8px 12px; border-radius: 8px; }
.topnav a:hover { color: var(--accent); background: var(--tint); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
@media (max-width: 420px) {
  .hide-xs { display: none; }
  .brand-sep, .pill-nclex { display: none; }
  .logo { height: 30px; }
}
@media (min-width: 960px) { .topnav { display: flex; } }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(8, 30, 20, .45); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.drawer {
  position: fixed; inset: 0 auto 0 0; z-index: 61; width: min(320px, 86vw);
  display: flex; flex-direction: column; background: var(--surface);
  box-shadow: var(--shadow-lg); transform: translateX(-102%); transition: transform .25s ease;
}
.drawer-open .scrim { opacity: 1; }
.drawer-open .drawer { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: linear-gradient(135deg, #0a3a22, #0f6b37 60%, #0a4a29);
}
.drawer-head .logo { height: 36px; }
.drawer-close {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
}
.drawer-close svg { width: 20px; height: 20px; }
.drawer-scroll { flex: 1; overflow-y: auto; padding: 14px 14px 18px; }
.drawer-label { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 6px; }
.drawer-nav { display: grid; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.drawer-nav a { padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 16px; }
.drawer-nav a:hover { background: var(--tint); color: var(--accent); }
.drawer-acc { margin-top: 10px; }
.drawer-acc summary {
  display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer;
  padding: 10px 12px; border-radius: 8px; font-weight: 700; color: var(--accent);
  background: var(--tint); border-left: 3px solid var(--green-500);
}
.drawer-acc summary::-webkit-details-marker { display: none; }
.drawer-acc summary svg { width: 18px; height: 18px; transition: transform .2s; transform: rotate(180deg); }
.drawer-acc[open] summary svg { transform: none; }
.portal-card {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  margin: 10px 0 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm);
}
.portal-card strong { display: block; font-size: 16px; }
.portal-card small { display: block; color: var(--ink-2); font-size: 13px; line-height: 1.5; margin-top: 2px; }
.portal-card .tag { grid-column: 2; justify-self: start; }
.portal-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--grad); color: #fff; }
.portal-ico svg { width: 20px; height: 20px; }
.drawer-note { margin-top: 12px; padding: 12px 10px 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; }
.drawer-foot { padding: 14px; border-top: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 10px; }
.drawer-foot .drawer-label { padding: 0; }
.drawer-small { font-size: 13.5px; color: var(--ink-2); margin-top: -4px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 500px at 85% -10%, var(--bg-hero-b), transparent 70%),
              linear-gradient(180deg, var(--bg-hero-a), var(--bg));
  padding: 40px 0 56px;
}
.dots {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 35%, transparent) 1px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 60%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 60%, transparent);
}
.hero-grid { position: relative; display: grid; gap: 36px; align-items: start; }
@media (min-width: 960px) {
  .hero { padding: 72px 0 88px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 56px; }
}
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.hero h1 { margin-top: 14px; font-size: clamp(36px, 7vw, 60px); font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
.accent { color: var(--accent); }
.lead { margin-top: 18px; font-size: clamp(16px, 2.2vw, 18.5px); color: var(--ink-2); max-width: 58ch; }
.lead strong { color: var(--ink); }
.meta { list-style: none; display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 0; margin: 24px 0 0; font-weight: 600; font-size: 15px; }
.meta li { display: flex; align-items: center; gap: 8px; }
.meta svg { width: 18px; height: 18px; color: var(--accent); }
.meta b { font-weight: 700; color: var(--accent); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
@media (max-width: 520px) { .cta-row .btn { flex: 1 1 100%; } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.status-card { padding: 22px; }
@media (min-width: 640px) { .status-card { padding: 28px; } }
.status-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.status-head h2 { font-size: 22px; margin-top: 4px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--amber-bg); color: var(--amber);
}
.badge.is-ok { background: var(--green-50); color: var(--green-700); }
.progress { margin: 20px 0 6px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress-bar {
  display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad);
  background-size: 200% 100%; transition: width .8s cubic-bezier(.2, .7, .2, 1);
  position: relative; overflow: hidden;
}
.progress-bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-100%); animation: shimmer 2.2s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.phases { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 2px; }
.phase { display: grid; grid-template-columns: 32px 1fr; gap: 12px; position: relative; padding-bottom: 14px; }
.phase:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.phase.is-done:not(:last-child)::before { background: var(--green-500); }
.phase-dot {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 2px solid var(--line-2);
}
.phase-dot svg { width: 16px; height: 16px; stroke-width: 3; }
.is-done .phase-dot { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.is-active .phase-dot { border-color: var(--green-500); color: var(--accent); background: var(--surface); animation: ring 2s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(31, 163, 74, .45); } 70%, 100% { box-shadow: 0 0 0 9px rgba(31, 163, 74, 0); } }
.phase-name { font-weight: 650; font-size: 15.5px; padding-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.phase-tag { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.is-done .phase-tag { background: var(--green-50); color: var(--green-700); }
.is-active .phase-tag { background: var(--amber-bg); color: var(--amber); }
:root[data-theme="dark"] .is-done .phase-tag, :root[data-theme="dark"] .badge.is-ok { background: rgba(60, 207, 110, .12); color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .is-done .phase-tag, :root:not([data-theme="light"]) .badge.is-ok { background: rgba(60, 207, 110, .12); color: var(--accent); }
}
.phase-detail { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.is-pending .phase-name { color: var(--ink-2); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 8px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.facts div { background: var(--surface-2); padding: 12px 14px; }
.facts dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 650; font-size: 15px; font-variant-numeric: tabular-nums; }
#fact-eta { color: var(--accent); }
.eta-note { font-size: 13.5px; color: var(--ink-2); margin-top: 12px; }
.eta-note:empty { display: none; }
.status-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
#refresh svg { width: 16px; height: 16px; }
#refresh.is-spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- restored ---------- */
.restored { background: var(--grad); color: #fff; padding: 28px 0; }
.restored-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.restored-inner > div { flex: 1 1 260px; }
.restored h2 { font-size: 26px; }
.restored p { opacity: .9; }
.restored-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.restored-ico svg { width: 26px; height: 26px; stroke-width: 3; }

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section-tint { background: var(--tint); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 28px; max-width: 640px; }
.section-head h2 { margin-top: 10px; font-size: clamp(26px, 4.4vw, 38px); font-weight: 800; }
.section-head .sub { margin-top: 10px; color: var(--ink-2); font-size: 17px; }

.services { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.service {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.svc-name { font-weight: 600; font-size: 15px; }
.tag { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650; }
.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag-amber { background: var(--amber-bg); color: var(--amber); }
.tag-green { background: var(--green-50); color: var(--green-700); }
:root[data-theme="dark"] .tag-green { background: rgba(60, 207, 110, .12); color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag-green { background: rgba(60, 207, 110, .12); color: var(--accent); } }

.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.feature { padding: 24px; transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.f-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--grad); color: #fff; box-shadow: 0 6px 14px rgba(15, 122, 60, .25); }
.f-ico svg { width: 22px; height: 22px; }
.feature h3 { font-size: 18px; margin-top: 16px; }
.feature p { color: var(--ink-2); font-size: 15px; margin-top: 6px; }

.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 16px; }
.tabs button { border: 0; background: transparent; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.tabpanel { padding: 8px 22px; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding: 16px 0 16px 34px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 19px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--green-500) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.checks b { color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--line-2); }
.timeline li { position: relative; padding: 0 0 28px 18px; }
.timeline li::before { content: ""; position: absolute; left: -30px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--green-500); }
.timeline li:first-child::before { background: var(--green-500); box-shadow: 0 0 0 5px color-mix(in srgb, var(--green-500) 22%, transparent); }
.timeline time { font-size: 13.5px; font-weight: 600; color: var(--accent); }
.timeline h3 { font-size: 18px; margin-top: 4px; }
.timeline p { color: var(--ink-2); margin-top: 4px; }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 52px 18px 20px; font-weight: 650; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 20px 18px; color: var(--ink-2); }

.cta-band { background: linear-gradient(135deg, #0a3a22, #0f6b37 55%, #0b4d2a); color: #fff; padding: 56px 0; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; right: -120px; top: -140px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(43, 180, 90, .45), transparent 70%); }
.cta-inner { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-inner h2 { font-size: clamp(24px, 4vw, 34px); }
.cta-inner p { margin-top: 8px; opacity: .85; max-width: 52ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.footer { padding: 32px 0 96px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.footer .logo { height: 32px; margin-bottom: 8px; }

/* ==========================================================================
   Ovana AI chat
   ========================================================================== */
.ai-launcher {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 50;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  background: var(--grad); box-shadow: 0 12px 28px rgba(15, 122, 60, .4);
  display: grid; place-items: center; transition: transform .2s;
}
.ai-launcher:hover { transform: scale(1.06); }
.ai-launcher svg { width: 26px; height: 26px; grid-area: 1 / 1; transition: opacity .2s, transform .2s; }
.ai-launcher .i-close { opacity: 0; transform: rotate(-45deg); }
.ai-open .ai-launcher .i-open { opacity: 0; transform: rotate(45deg); }
.ai-open .ai-launcher .i-close { opacity: 1; transform: none; }
.ai-launcher-dot { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: #4ade80; border: 3px solid var(--bg); }
.ai-open .ai-launcher-dot { display: none; }

.ai-panel {
  position: fixed; z-index: 70; display: flex; flex-direction: column;
  inset: 0; background: var(--surface);
  animation: pop .22s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 640px) {
  .ai-panel {
    inset: auto 18px 92px auto; width: 410px; height: min(660px, calc(100vh - 120px));
    border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden;
  }
}
@media (max-width: 639px) { .ai-open .ai-launcher { display: none; } .ai-open { overflow: hidden; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.ai-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
  background: linear-gradient(135deg, #0a3a22, #0f6b37 60%, #0a4a29); color: #fff;
}
.ai-avatar { flex: none; width: 42px; height: 42px; border-radius: 12px; background: #fff; display: grid; place-items: center; --logo-ink: var(--navy); }
.ai-avatar svg { width: 34px; height: 34px; }
.ai-id { flex: 1; min-width: 0; }
.ai-id h2 { font-size: 17px; letter-spacing: -0.01em; }
.ai-id p { font-size: 12.5px; opacity: .85; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex: none; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.light { width: 40px; height: 40px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.icon-btn.light:hover { background: rgba(255, 255, 255, .2); color: #fff; border-color: rgba(255, 255, 255, .5); }

.ai-log { flex: 1; overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 16px; background: var(--bg); overscroll-behavior: contain; }
.ai-welcome { text-align: center; padding: 18px 8px 4px; }
.ai-welcome-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ai-welcome-mark svg { width: 50px; height: 50px; }
.ai-welcome h3 { margin-top: 14px; font-size: 20px; }
.ai-welcome p { color: var(--ink-2); font-size: 14.5px; margin: 6px auto 0; max-width: 32ch; }
.welcome-chips, .follow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.follow { justify-content: flex-start; margin: -4px 0 0 42px; }
.chip {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer;
  padding: 8px 13px; border-radius: 99px; font-size: 13.5px; font-weight: 500; text-align: left;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--tint); }

.msg { display: flex; gap: 10px; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg-user { justify-content: flex-end; }
.msg-user .bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 18px 18px 4px 18px;
  background: var(--grad); color: #fff; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg .avatar { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; }
.msg .avatar svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.msg-body { flex: 1; min-width: 0; }

/* reasoning block */
.think { margin-bottom: 10px; }
.think-head {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.think-head:hover { border-color: var(--line-2); color: var(--ink); }
.think-label { font-weight: 600; }
.think-meta { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.think-meta:empty { display: none; }
.think-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.think.is-live .think-dot { background: var(--green-500); animation: blink 1s infinite; }
.think.is-live .think-label {
  background: linear-gradient(90deg, var(--ink-2) 0%, var(--accent) 50%, var(--ink-2) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 1.6s linear infinite;
}
@keyframes sheen { to { background-position: -200% 0; } }
@keyframes blink { 50% { opacity: .3; } }
.think-chev svg { width: 15px; height: 15px; transition: transform .2s; }
.think-head[aria-expanded="true"] .think-chev svg { transform: rotate(180deg); }
.think-body {
  margin-top: 8px; padding: 2px 0 2px 14px; border-left: 2px solid var(--line-2);
  color: var(--muted); font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere;
}
.think.is-live .think-body::after { content: "▍"; color: var(--accent); animation: blink .9s infinite; margin-left: 1px; }

/* answer */
.md { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.md p { margin: 0 0 10px; }
.md p:last-child, .md ul:last-child, .md ol:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md li { margin: 3px 0; }
.md li::marker { color: var(--accent); }
.md strong { font-weight: 650; }
.md code { font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.answer.is-streaming > :last-child::after, .answer.is-streaming:empty::after {
  content: ""; display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -2px;
  background: var(--accent); border-radius: 2px; animation: blink .8s infinite;
}
.answer.is-streaming ul:last-child > li:last-child::after { content: ""; display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -2px; background: var(--accent); border-radius: 2px; animation: blink .8s infinite; }
.answer.is-streaming ul:last-child::after { content: none; }
.msg-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.msg-stats { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.ai-form {
  display: flex; align-items: flex-end; gap: 8px; margin: 10px 12px 0; padding: 6px 6px 6px 14px;
  border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm);
}
.ai-form:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-500) 18%, transparent); }
.ai-form textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.45; padding: 8px 0; max-height: 140px;
}
.ai-send {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--grad); color: #fff;
}
.ai-send svg { width: 19px; height: 19px; }
.ai-stop { background: var(--ink); color: var(--surface); }
.ai-stop svg { fill: currentColor; stroke: none; }
.ai-disclaimer { font-size: 11.5px; color: var(--muted); text-align: center; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
