/* BIOMED REWIRED - base: variables, reset, header, navigation, dialogs */
:root {
  --bg: #040b1a;
  --panel: #0a1c3a;
  --cyan: #19d3f0;
  --line: rgba(40, 200, 255, .55);
  --text: #eaf2ff;
  --muted: #a9bbd6;
  --ink: #0b1b36;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 130px; }
body { margin: 0; min-height: 100vh; font-family: "Inter", system-ui, sans-serif; color: var(--text); line-height: 1.35; -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 500px at 15% 0%, #0b2c58 0%, transparent 70%), radial-gradient(900px 600px at 90% 60%, #082a4d 0%, transparent 70%), var(--bg); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic.sm { width: 14px; height: 14px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: rgba(3, 9, 20, .97); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; gap: 18px; padding: 8px max(22px, calc((100% - 1480px) / 2 + 22px)); }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pulse { width: 62px; height: 32px; fill: none; stroke: var(--cyan); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font-size: 1.55rem; font-weight: 800; line-height: 1.05; letter-spacing: -.005em; }
.brand small { font-size: .9rem; color: #dbe8fb; }
.search { position: relative; margin-left: auto; width: min(420px, 100%); }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; }
.search input { width: 100%; font: inherit; font-size: .9rem; color: var(--text); background: #07142b; border: 1.5px solid rgba(255,255,255,.85); border-radius: 8px; padding: 11px 14px 11px 42px; }
.search input::placeholder { color: #cdd9ec; }
.search input:focus { outline: 2px solid var(--cyan); border-color: transparent; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #0b1b36; border: 1px solid var(--line); border-radius: 10px; max-height: 340px; overflow: auto; box-shadow: 0 16px 40px rgba(0,0,0,.6); z-index: 5; }
.results button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.07); padding: 10px 14px; }
.results button:hover { background: rgba(25,211,240,.12); }
.results b { display: block; font-size: .9rem; }
.results span { font-size: .78rem; color: var(--muted); }
.results p { padding: 12px 14px; color: var(--muted); font-size: .88rem; }
.menu-btn { display: none; background: none; border: 0; padding: 8px; }
.menu-btn span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; }

.mainnav { display: flex; align-items: center; gap: 0; justify-content: space-between; padding: 6px max(14px, calc((100% - 1480px) / 2 + 14px)); background: linear-gradient(180deg, #0a1d3b, #07152b); border-top: 1px solid rgba(40,200,255,.25); overflow-x: auto; }
.mainnav a { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .84rem; font-weight: 500; padding: 8px 9px; border-radius: 6px; color: #e4eefc; }
.mainnav a .ic:not(.sm) { width: 19px; height: 19px; }
.mainnav a:hover { background: rgba(25,211,240,.14); }
.mainnav a.active { background: #129fb4; color: #fff; font-weight: 600; }
/* Global layout */
main, .site-footer { max-width: 1480px; margin-inline: auto; }
@media (min-width: 1481px) { main { border-inline: 1px solid rgba(40,200,255,.18); } }
/* ---------- Dialog ---------- */
dialog { width: min(680px, calc(100% - 28px)); max-height: 86vh; padding: 0; border: 1.5px solid var(--line); border-radius: 14px; background: #0a1c3a; color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 24px rgba(25,211,240,.3); overflow: auto; }
dialog::backdrop { background: rgba(2,6,16,.72); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.12); position: sticky; top: 0; background: #0a1c3a; }
.dlg-head h3 { font-size: 1.2rem; }
.dlg-x { background: none; border: 0; font-size: 1.8rem; line-height: 1; padding: 0 6px; color: var(--muted); }
#dlg-body { padding: 16px 20px 22px; font-size: .95rem; }
#dlg-body ul.pts { list-style: disc; padding-left: 20px; display: grid; gap: 8px; color: #dce8fa; }
#dlg-body .rev { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-weight: 600; }
#dlg-body .rev input { width: 18px; height: 18px; accent-color: var(--cyan); }
#dlg-body dt { font-weight: 700; color: var(--cyan); margin-top: 10px; }
#dlg-body dd { margin: 0; color: #dce8fa; }
#dlg-body .list { display: grid; gap: 8px; }
#dlg-body .list button { text-align: left; background: #0e2548; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 10px 14px; }
#dlg-body .list button:hover { border-color: var(--cyan); }
#dlg-body .list b { display: block; }
#dlg-body .list small { color: var(--muted); }
#dlg-body .quiz-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
#dlg-body .quiz-row input { font: inherit; color: var(--text); background: #07142b; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 140px; }
#dlg-body .quiz-row button { background: var(--cyan); color: #04202a; border: 0; border-radius: 6px; padding: 8px 16px; font-weight: 700; }
#dlg-body .fb { margin-top: 12px; min-height: 1.4em; font-weight: 600; }
.sep { height: 1px; background: rgba(255,255,255,.12); margin: 14px 0; }


/* Shared utilities */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--cyan); color: #04202a; font-weight: 700; padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
#main:focus { outline: none; }
.results a.res { display: block; width: 100%; text-align: left; border-bottom: 1px solid rgba(255,255,255,.07); padding: 10px 14px; }
.results a.res:hover { background: rgba(25,211,240,.12); }
.results .res b { display: block; font-size: .9rem; }
.results .res span { font-size: .78rem; color: var(--muted); }
.les-link { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* iOS Safari zooms the page when a text field under 16px gets focus. Keep fields at 16px on small screens. */
@media (max-width: 900px) {
  .search input, .f-search input, .ll-search input, input[type="search"], input[type="text"], input[type="email"], select, textarea { font-size: 16px; }
}
