:root { --bg:#0a0118; --surface:#16072b; --text:#fff; --muted:#9b96b0; --line:#3d2f55; --accent:#713dff; --accent-light:#bba9ff; --danger:#ff8fbc; }

* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { scroll-behavior:smooth; -webkit-tap-highlight-color:transparent; }
body { margin:0; color:var(--text); background:var(--bg); font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:16px; line-height:1.55; }
button,input { font:inherit; }
button { cursor:pointer; }
a { color:inherit; }
:focus { outline:0; }

.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.skip-link { position:fixed; z-index:20; top:-70px; left:16px; padding:9px 14px; color:#0a0118; background:#fff; text-decoration:none; }
.skip-link:focus { top:16px; }
.shell { min-height:100vh; overflow:clip; background:radial-gradient(circle at 48% 11%,rgb(113 61 255 / 17%),transparent 31%),var(--bg); }

.topbar { position:sticky; z-index:4; top:0; display:flex; align-items:center; justify-content:space-between; width:100%; height:78px; padding:0 max(28px,calc((100% - 1144px) / 2)); background:#fff; }
.brand { display:flex; align-items:center; text-decoration:none; }
.brand-lockup { display:block; width:200px; max-height:68px; height:auto; object-fit:contain; }
nav { display:flex; align-items:center; gap:29px; }
nav a { color:#4a405c; text-decoration:none; font-size:14px; }
nav a:hover,nav a[aria-current="page"] { color:#5520c6; }
nav a[aria-current="page"] { font-weight:700; }
.nav-icon { display:none; }
.saved-count { display:inline-grid; min-width:19px; height:19px; margin-left:4px; padding:0 5px; place-items:center; border-radius:99px; color:#fff; background:var(--accent); font-size:11px; }
.saved-screen-count { display:none; margin-left:8px; vertical-align:middle; }
.status-strip { position:sticky; z-index:3; top:78px; width:100%; padding:8px 28px; color:#fff; background:#422273; text-align:center; font-size:13px; }
.status-action { min-height:36px; margin-left:12px; border:1px solid #d9d0ff; padding:4px 10px; color:#fff; background:transparent; font-size:13px; font-weight:700; }
.status-action:hover { background:#5a358e; }

main { max-width:1200px; margin:auto; padding:0 28px; }
.hero { max-width:910px; margin:auto; padding:24px 0; text-align:center; }
h1,h2,h3 { margin:0; font-family:Arial,Helvetica,sans-serif; letter-spacing:-.055em; }
h1 { font-size:clamp(42px,7vw,72px); font-weight:800; line-height:1.04; }
h1 em { color:var(--accent-light); font-style:normal; }
.eyebrow { margin:0 0 15px; color:var(--accent-light); font-size:12px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.hero-copy { max-width:620px; margin:27px auto 31px; color:#d2d0dd; font-size:20px; letter-spacing:-.012em; }

.search-wrap { display:flex; align-items:center; max-width:710px; height:58px; margin:auto; border:1px solid #5d467e; background:#120423; box-shadow:0 0 0 7px rgb(113 61 255 / 7%); }
.search-icon { position:relative; width:17px; height:17px; margin:0 15px 0 20px; border:2px solid var(--muted); border-radius:50%; }
.search-icon::after { position:absolute; right:-6px; bottom:-3px; width:7px; height:2px; content:""; background:var(--muted); transform:rotate(45deg); }
input[type="search"] { flex:1; min-width:0; border:0; outline:0; color:#fff; background:transparent; font-size:15px; }
input::placeholder { color:#8f849e; }
.search-button { align-self:stretch; border:0; padding:0 22px; color:#fff; background:var(--accent); font-size:14px; font-weight:700; }
.search-button:hover { background:#8358ff; }
.privacy-note { margin:17px 0 0; color:var(--muted); font-size:13px; }
.privacy-note span { color:var(--accent-light); font-size:17px; vertical-align:-1px; }
.safety-note { max-width:620px; margin:11px auto 0; color:#d2d0dd; font-size:13px; }
.quick-links,.topic-grid { display:flex; flex-wrap:wrap; gap:8px; }
.quick-links { justify-content:center; margin-top:26px; }
.quick-links button,.topic-card { border:1px solid #624985; border-radius:99px; color:#d2d0dd; background:transparent; font-size:14px; font-weight:600; line-height:1.2; }
.quick-links button { padding:7px 13px; font-size:13px; font-weight:400; }
.quick-links button:hover,.topic-card:hover { border-color:var(--accent-light); color:#fff; }

.results-section,.saved-section,.help-section { min-height:calc(100vh - 165px); padding:72px 0; border-top:0; scroll-margin-top:10px; }
.section-head { display:flex; align-items:end; justify-content:space-between; gap:20px; }
.section-head h2,.help-section h2 { font-size:36px; line-height:1.1; }
.section-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:16px; }
.text-action { border:0; padding:4px 0; color:var(--accent-light); background:none; text-decoration:underline; text-underline-offset:4px; font-size:14px; }
.text-action.danger { color:var(--danger); }
.topic-grid { margin:20px 0 0; }
.topic-card { display:inline-flex; min-height:44px; align-items:center; justify-content:center; padding:8px 14px; }
.topic-card[aria-pressed="true"] { border-color:var(--accent-light); color:#fff; background:#32205c; }
.result-meta { margin:22px 0 8px; color:#fff; font-weight:700; }
.coverage-note { margin:0 0 12px; color:#d2d0dd; font-size:13px; }
.coverage-note a { color:var(--accent-light); }
.results-list { display:grid; gap:12px; margin-top:18px; }
.entry-card { position:relative; display:grid; grid-template-columns:minmax(0,1fr) 44px; gap:16px; padding:20px; border:1px solid var(--line); background:var(--surface); }
.entry-card:hover { border-color:#73539d; }
.entry-content { min-width:0; }
.entry-actions { position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; }
.entry-card h3 { font-size:22px; line-height:1.1; }
.entry-open { padding:0; border:0; color:inherit; background:transparent; font:inherit; letter-spacing:inherit; text-align:left; }
.entry-open::after { position:absolute; inset:0; content:""; cursor:pointer; }
.entry-open:hover { text-decoration:underline; }
.entry-summary { max-width:700px; margin:11px 0 0; color:#d2d0dd; font-size:15px; }
.entry-arrow { color:var(--accent-light); font-size:25px; line-height:1; }
.bookmark-button { position:relative; z-index:1; flex:0 0 auto; width:44px; height:44px; border:1px solid #624985; color:var(--accent-light); background:transparent; font-size:16px; pointer-events:auto; }
.bookmark-button[aria-pressed="true"] { border-color:var(--accent); color:#fff; background:var(--accent); }
.empty-state { padding:35px; border:1px dashed #5c4778; background:rgb(255 255 255 / 2%); }
.empty-state h3 { font-size:24px; }
.empty-state p { margin:8px 0 0; color:var(--muted); }
.saved-list { margin-top:24px; }
.saved-message { padding:27px; border-left:2px solid var(--accent); color:#d2d0dd; background:rgb(113 61 255 / 9%); }
.saved-message strong { color:#fff; }
.back-link { display:inline-flex; align-items:center; justify-content:center; min-height:58px; margin:32px 0 42px; border:0; padding:0 22px; color:#fff; background:var(--accent); font-size:14px; font-weight:700; }
.back-link:hover { background:#8358ff; }

.help-section { display:grid; grid-template-columns:.9fr 1.1fr; align-content:start; gap:80px; }
.help-section h2 { font-size:42px; }
.help-copy { color:#d2d0dd; font-size:17px; }
.help-copy p:first-child { margin-top:0; }
.help-copy h3 { margin:30px 0 8px; color:#fff; font-size:21px; }
.help-copy h3 + p { margin-top:0; }
.help-back { grid-column:1 / -1; }

footer { max-width:1200px; margin:auto; padding:25px 28px 36px; border-top:1px solid var(--line); color:var(--muted); text-align:center; font-size:12px; }
.footer-meta { display:flex; flex-direction:column; align-items:center; gap:4px; }
.footer-links { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:7px; margin-top:5px; }
.footer-links a,.footer-sources { display:inline; padding:0; border:0; color:var(--muted); background:transparent; text-align:center; text-decoration:underline; text-underline-offset:3px; font:inherit; }
.footer-links a:hover,.footer-sources:hover { color:#fff; }

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

.legal-page .shell { min-height:100vh; min-height:100dvh; }
.legal-content { width:min(760px,100%); margin:0 auto; padding:72px 28px 80px; }
.legal-tabs { flex-wrap:wrap; gap:8px; margin-bottom:30px; }
.legal-tabs a { display:inline-flex; min-height:44px; align-items:center; padding:8px 16px; border:1px solid #624985; border-radius:99px; color:var(--accent-light); font-size:14px; text-decoration:none; }
.legal-tabs a:hover,.legal-tabs a[aria-current="page"] { border-color:var(--accent-light); color:#fff; background:#32205c; }
.legal-content .eyebrow { margin:0 0 12px; }
.legal-content h1 { margin:0; font-size:clamp(42px,6vw,70px); letter-spacing:-.05em; line-height:.98; }
.legal-content h2 { margin:42px 0 11px; font-size:25px; letter-spacing:-.03em; }
.legal-content p,.legal-content li { color:#d2d0dd; font-size:16px; line-height:1.65; }
.legal-content ul { padding-left:22px; }
.legal-content li + li { margin-top:8px; }
.legal-content a { color:var(--accent-light); }
.legal-content .updated { margin-top:12px; color:var(--muted); font-size:14px; }

dialog { width:min(700px,calc(100% - 32px)); max-height:calc(100vh - 32px); padding:0; border:1px solid #73539d; color:#fff; background:#140626; box-shadow:0 22px 70px rgb(0 0 0 / 65%); }
dialog::backdrop { background:rgb(0 0 0 / 68%); backdrop-filter:blur(2px); }
.dialog-top { display:flex; align-items:center; justify-content:space-between; padding:18px 21px; border-bottom:1px solid var(--line); }
.dialog-top .eyebrow { margin:0; }
.icon-button { width:44px; height:44px; border:1px solid var(--line); color:#fff; background:transparent; font-size:25px; line-height:1; }
.dialog-body { padding:29px 30px 33px; }
.dialog-body h2 { font-size:39px; line-height:1.02; }
.clinical-name { margin:8px 0 25px; color:var(--accent-light); font-size:14px; }
.dialog-body p { color:#d2d0dd; font-size:16px; }
.dialog-body h3 { margin-top:29px; font-size:21px; }
.question-list { margin:13px 0 0; padding-left:19px; color:#d2d0dd; }
.question-list li { margin:8px 0; }
.source-block { margin-top:29px; padding-top:20px; border-top:1px solid var(--line); color:var(--muted); font-size:13px; }
.source-block a { color:var(--accent-light); }
.offline-tag { display:inline-block; margin-right:7px; padding:2px 7px; border:1px solid #66547b; border-radius:99px; color:#d2d0dd; font-size:11px; }
.save-feedback { position:fixed; z-index:6; bottom:20px; left:50%; width:max-content; max-width:calc(100% - 32px); padding:10px 16px; border:1px solid #bba9ff; color:#fff; background:#422273; font-size:14px; transform:translateX(-50%); }
.save-feedback:empty { display:none; }

body.home-screen .shell { display:flex; flex-direction:column; min-height:100vh; min-height:100dvh; }
body.home-screen main { width:100%; margin:auto auto 0; }
body.home-screen footer { width:100%; margin:0 auto auto; border-top:0; padding-top:0; }

@media (min-width:651px) {
  a:focus-visible,.entry-open:focus-visible { color:#fff; text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:4px; }
  button:focus-visible { color:#fff; text-shadow:0 0 12px rgb(187 169 255 / 70%); }
}

@media (max-width:650px) {
  .shell { padding-bottom:calc(68px + env(safe-area-inset-bottom)); }
  .topbar { justify-content:center; padding:0 18px; }
  .brand-lockup { width:180px; }
  .topbar nav { position:fixed; z-index:5; right:0; bottom:0; left:0; display:flex; justify-content:space-around; gap:0; padding:4px 8px calc(4px + env(safe-area-inset-bottom)); border-top:1px solid #9c7aff; background:var(--accent); }
  .topbar nav a { display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center; min-height:52px; gap:1px; color:#fff; font-size:11px; line-height:1.15; }
  .topbar nav a:hover,.topbar nav a[aria-current="page"] { color:#fff; text-decoration:underline; text-underline-offset:3px; }
  .nav-icon { display:block; height:18px; font-family:Arial,sans-serif; font-size:17px; font-weight:400; line-height:18px; }
  .topbar nav .saved-nav-count { display:none; }
  .saved-screen-count { display:inline-grid; color:#fff; background:var(--accent); }
  main { padding:0 18px; }
  .hero { padding:67px 0 83px; }
  .hero-copy { font-size:17px; }
  .search-wrap { height:auto; flex-wrap:wrap; padding:13px 0 0; }
  .search-icon { margin-left:17px; }
  input[type="search"] { height:31px; font-size:14px; }
  .search-button { width:100%; height:42px; margin-top:13px; }
  .results-section,.saved-section { padding:55px 0; }
  .section-head { align-items:start; }
  .section-head h2 { font-size:30px; }
  .section-actions { max-width:155px; gap:8px 14px; }
  .topic-card { min-height:40px; padding:7px 12px; font-size:13px; }
  .back-link { display:none; }
  .entry-card { gap:12px; padding:18px; }
  .entry-card h3 { font-size:20px; }
  .help-section { grid-template-columns:1fr; gap:24px; padding:57px 0; }
  .help-section h2 { font-size:35px; }
  footer { padding:21px 18px 29px; }
  .legal-content { padding:52px 18px 62px; }
  .dialog-body { padding:25px 21px 27px; }
  .dialog-body h2 { font-size:33px; }
  .save-feedback { bottom:calc(76px + env(safe-area-inset-bottom)); }
  .status-strip { padding:8px 18px; }
  .status-action { display:block; margin:8px auto 0; }
}
