/* NEET (PG) Admission Intelligence. Design system on the DnyanSetu logo: royal blue and golden yellow.
   Mobile first. Fonts are downloaded with the app (no CDN). Touch targets are at least 44px.
   Every module opens in a popup (90% by 90%) with a context header and footer. */

/* ---------- Fonts (self-hosted, downloadable woff2) ---------- */
@font-face { font-family: "Hind"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/hind-latin-devanagari-300.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/hind-latin-devanagari.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/hind-latin-devanagari-500.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/hind-latin-devanagari-600.woff2") format("woff2"); }
@font-face { font-family: "Hind"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/hind-latin-devanagari-700.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/baloo2-latin-devanagari.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/baloo2-latin-devanagari-500.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/baloo2-latin-devanagari-600.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/baloo2-latin-devanagari-700.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/baloo2-latin-devanagari-800.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --blue: #004aab;
  --blue-deep: #05326f;
  --blue-ink: #0a2a57;
  --blue-soft: #e9f1fc;
  --blue-line: #b9cbe8;
  --gold: #fed409;
  --gold-hi: #ffe44d;
  --gold-soft: #fff6c4;
  --gold-line: #f2cf3c;
  --bg: #f1f5fb;
  --card: #ffffff;
  --ink: #14213d;
  --ink-2: #3a4863;
  --muted: #5d6b86;
  --line: #dbe3f0;
  --chip: #eef3fb;
  --ok: #13703f;
  --ok-bg: #e5f6ec;
  --warn: #6e4300;
  --warn-bg: #fff3d1;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(10,42,87,.06), 0 4px 14px rgba(10,42,87,.06);
  --shadow-md: 0 18px 44px rgba(10,42,87,.22);
  --font-body: "Hind", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Baloo 2", "Hind", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; margin: 0; }
p { margin: 0 0 10px; }
a { color: var(--blue); }
button { font-family: inherit; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--gold); color: var(--blue-deep); padding: 10px 14px; border-radius: 10px; font-weight: 700;
}
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Always-visible header: logo returns home, Trust is always one tap away ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  background: linear-gradient(100deg, var(--blue-deep) 0%, var(--blue) 70%, #1a63c4 100%);
  color: #fff;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 6px 18px rgba(5,50,111,.28);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: #fff; min-height: 44px; }
.brand:hover .app-title { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.logo {
  height: 36px; width: auto; flex: 0 0 auto;
  background: #fff; border-radius: 8px; padding: 2px;
}
.app-title {
  font-family: var(--font-head); font-weight: 800;
  font-size: 15px; line-height: 1.05; letter-spacing: .03em;
  color: #fff; text-transform: uppercase; overflow-wrap: anywhere;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.trust-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--gold); color: var(--blue-deep);
  font-weight: 700; font-size: 15px; text-decoration: none;
  box-shadow: 0 2px 0 rgba(0,0,0,.14);
}
.trust-btn:hover { background: var(--gold-hi); }
.install-btn {
  min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.5);
  background: transparent; color: #fff; font: 600 14px var(--font-body); cursor: pointer;
}
.install-btn:hover { background: rgba(255,255,255,.12); }

/* ---------- Page ---------- */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px 16px 40px; }
.stage { width: 100%; max-width: 960px; margin: 0 auto; }
.kicker { margin: 0 0 6px; font: 600 12px/1.3 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.lead { color: var(--muted); margin: 0 0 16px; max-width: 64ch; }
.note { color: var(--muted); font-size: 14px; margin: 10px 0; }
.empty { text-align: center; color: var(--muted); padding: 22px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 12px 0; box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 18px; margin-bottom: 4px; }
.notice {
  background: var(--warn-bg); color: var(--warn); border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0;
}
.notice.ok { background: var(--ok-bg); color: var(--ok); border-left-color: var(--ok); }

/* ---------- Home: hero, consent, four views ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 22px 20px 20px; margin: 4px 0 12px;
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 65%, #1d68c9 100%);
  color: #fff; border-radius: 22px; box-shadow: var(--shadow-md);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(254,212,9,.45), rgba(254,212,9,0) 70%); pointer-events: none;
}
.hero .kicker { color: var(--gold); }
.home-title { font: 800 clamp(28px, 7vw, 40px)/1.08 var(--font-head); color: #fff; margin: 0 0 8px; }
.hero .lead { color: #dbe6f7; margin: 0 0 12px; }
.disclaimer-line {
  display: inline-block; margin: 0; padding: 6px 12px; border-radius: 999px;
  background: rgba(254,212,9,.16); border: 1px solid rgba(254,212,9,.55); color: #fff7cc; font-size: 13px;
}
.consent { margin-top: 12px; }
.consent-form { display: grid; gap: 12px; }
.consent-done { display: flex; gap: 10px; align-items: center; }
.consent-done p { margin: 0; }
.tick {
  width: 30px; height: 30px; border-radius: 999px; background: var(--ok-bg); color: var(--ok);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto;
}
.inline-form { margin-top: 8px; }
.check-row {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--chip); cursor: pointer;
  font-size: 15px;
}
.check-row input { width: 24px; height: 24px; margin: 0; accent-color: var(--blue); }
.check-row a { font-weight: 600; }

.actions { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
.action {
  position: relative; display: grid; grid-template-columns: 56px 1fr 28px; align-items: center; gap: 14px;
  min-height: 92px; padding: 16px 16px 16px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.action:hover, .action:focus-visible { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.action .n {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold)); color: var(--blue-deep);
  display: flex; align-items: center; justify-content: center;
  font: 800 26px/1 var(--font-head); box-shadow: inset 0 -3px 0 rgba(0,0,0,.08);
}
.action .at { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.action strong { font: 700 19px/1.2 var(--font-head); }
.action small { color: var(--muted); font-size: 14px; line-height: 1.4; }
.action::after { content: "→"; font: 700 22px var(--font-head); color: var(--blue); text-align: right; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 18px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 15px/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s, transform .08s;
}
.btn:hover { border-color: var(--blue); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 3px 0 var(--blue-deep); }
.btn.primary:hover { background: #0a5bc4; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--blue); font: 600 15px var(--font-body); padding: 10px 0; cursor: pointer; min-height: 44px; }
.reset { margin-top: 12px; }

/* ---------- Popup: 90% by 90%, context header, scrolling body, footer ---------- */
dialog.sheet {
  width: 90vw; height: 90vh; max-width: none; max-height: none; padding: 0;
  border: 0; border-radius: 20px; background: var(--bg); color: var(--ink);
  box-shadow: var(--shadow-md); overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet::backdrop { background: rgba(5,22,50,.6); backdrop-filter: blur(2px); }
.sheet .dlg-body { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.sheet-root { flex: 1 1 0; min-height: 0; height: 100%; display: flex; flex-direction: column; }
.sheet-head {
  flex: 0 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 14px 16px 12px; color: #fff;
  background: linear-gradient(100deg, var(--blue-deep) 0%, var(--blue) 75%, #1d68c9 100%);
  border-bottom: 3px solid var(--gold);
}
.sheet-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sheet-head .kicker { color: var(--gold); margin: 0; font-size: 11px; }
.sheet-head h2 { color: #fff; font-size: 22px; margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.sheet-close {
  flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 0; border-radius: 13px; text-decoration: none;
  background: var(--gold); color: var(--blue-deep); font: 700 15px var(--font-body); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 3px 0 rgba(0,0,0,.14);
}
.sheet-close:hover { background: var(--gold-hi); }
.sheet-body {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 16px 18px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.sheet-foot {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--card);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 20px rgba(10,42,87,.07);
}
.sheet-actions { display: flex; flex: 1 1 auto; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sheet-actions:empty { display: none; }
.sheet-actions .btn { flex: 1 1 140px; }
.sheet-note { margin: 0; font-size: 13px; color: var(--muted); flex: 1 1 100%; }
.consent-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  margin: 16px 0; padding: 14px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
}
.consent-bar p { margin: 0; font-weight: 600; }
.warn-note { color: #8a4b00; font-weight: 600; }
.disclaimer { order: 9; margin: 0; width: 100%; flex: 0 0 100%; text-align: center; font-size: 12px; color: var(--muted); padding-top: 8px; border-top: 1px dashed var(--line); }
.sheet-head + .sheet-body .table-wrap { max-height: 60vh; }
.frame-wrap { position: relative; flex: 1 1 auto; min-height: 0; background: #fdf8f2; }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fdf8f2; }

/* Progress and step dots inside the popup header (Results) */
.progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width .3s ease; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dot {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; font-weight: 700;
}
.dot.on { background: var(--gold); color: var(--blue-deep); border-color: var(--gold); }
.dot:hover { border-color: #fff; }

/* Segmented control in the header (NPG25 rounds) */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.14); margin-top: 10px; max-width: 100%; overflow-x: auto; }
.seg-item { min-height: 40px; display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.seg-item.on { background: var(--gold); color: var(--blue-deep); }

/* ---------- Set my focus: step bar, picks, review ---------- */
.dlg-body > form { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; margin: 0; }
.dlg-body > form > .sheet-root { flex: 1 1 0; }
.focus-form > *, .hub-form > * { min-width: 0; }
.stepper {
  position: sticky; top: -14px; z-index: 4; margin: -14px -16px 14px; padding: 12px 16px 10px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.stepper ol { list-style: none; margin: 0; padding: 2px 0 2px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.stepper li { flex: 0 0 auto; }
.step {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 12px 5px 5px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 14px/1.2 var(--font-body); white-space: nowrap; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.step:hover { border-color: var(--blue); }
.step .sn {
  width: 32px; height: 32px; border-radius: 999px; background: var(--chip); color: var(--blue-deep);
  display: inline-flex; align-items: center; justify-content: center; font: 700 15px/1 var(--font-head);
}
.step .cnt {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--chip); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.step .cnt:empty { display: none; }
.step.on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-deep); }
.step.on .sn { background: var(--gold); color: var(--blue-deep); }
.step.on .cnt { background: #fff; color: var(--blue-deep); }
.step-head { margin: 0 0 12px; }
.step-head .lead { margin: 0; }

.pickset {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px 14px; margin: 12px 0; min-width: 0; box-shadow: var(--shadow-sm);
}
.pickset legend { padding: 0 6px; font: 700 16px var(--font-head); color: var(--blue-deep); }
.pickgrid { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 4px 2px; }
.pickgrid .kicker { grid-column: 1 / -1; margin: 10px 0 0; }
.pickgrid.big { grid-template-columns: 1fr; }
.pick {
  display: flex; align-items: flex-start; gap: 12px; min-height: 56px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .12s, background .12s, transform .08s;
}
.pick:hover { border-color: var(--blue-line); }
.pick:active { transform: scale(.995); }
.pick input { width: 22px; height: 22px; min-height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--blue); }
.pick span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.pick b { font-weight: 600; }
.pick small { color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.4; }
.pick:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.tab {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 14px/1.2 var(--font-body); text-decoration: none; cursor: pointer;
}
.tab:hover { border-color: var(--blue); }
.tab.on { background: var(--blue); border-color: var(--blue); color: #fff; }

.drawer {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 14px 12px; margin: 12px 0; box-shadow: var(--shadow-sm);
}
.drawer summary {
  cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px;
  font: 700 16px var(--font-head); color: var(--blue-deep); list-style: none;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary::before { content: "▸"; color: var(--blue); transition: transform .15s; display: inline-block; }
.drawer[open] summary::before { transform: rotate(90deg); }
.count, .drawer .count {
  min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--gold); color: var(--blue-deep);
  display: inline-flex; align-items: center; justify-content: center; font: 700 13px var(--font-body);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 999px;
  padding: 4px 4px 4px 12px; font-size: 14px;
}
.chip-x {
  width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--blue); font: 700 18px/1 var(--font-body); cursor: pointer; flex: 0 0 auto;
}
.chip-x:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.review { display: grid; gap: 12px; margin-top: 4px; }
.review-card { margin: 0; }
.rc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-head h3 { font-size: 18px; margin: 0; }
.rc-body { margin: 8px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.save-state { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.saved-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--ok); flex: 0 0 auto; }

.hub-form { display: grid; gap: 4px; }
.hub-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.hub-step {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); cursor: pointer; text-align: left; font: 600 16px var(--font-body);
}
.hub-step:hover { border-color: var(--blue); }
.hub-step .sn {
  width: 36px; height: 36px; border-radius: 12px; background: var(--gold); color: var(--blue-deep);
  display: inline-flex; align-items: center; justify-content: center; font: 800 18px/1 var(--font-head); flex: 0 0 auto;
}

/* ---------- Results (NEET PG 26) ---------- */
.big-number { font: 800 clamp(30px, 8vw, 44px)/1 var(--font-head); color: var(--blue-deep); margin: 4px 0 12px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.tile span { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.tile b { font: 700 24px/1.2 var(--font-head); color: var(--blue-deep); }
.bars { list-style: none; margin: 12px 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; margin: 10px 0; }
.bar { height: 12px; background: var(--chip); border-radius: 999px; overflow: hidden; display: block; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #3c8ef0); border-radius: 999px; }
.lbl { font: 600 13px var(--font-body); color: var(--muted); }
.val { font-size: 14px; color: var(--muted); white-space: nowrap; }
.next { padding-left: 18px; }
.next li { margin: 10px 0; }
.next a { color: var(--blue); font-weight: 600; }
.entry { display: grid; gap: 14px; max-width: 480px; }

/* ---------- Fields and filters ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input, select {
  font: 400 16px var(--font-body); color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 46px; width: 100%;
}
input:focus, select:focus { border-color: var(--blue); outline: 3px solid var(--gold); outline-offset: 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; color: var(--ink); }
.check input { width: 22px; height: 22px; min-height: 22px; accent-color: var(--blue); }
.filters { display: grid; gap: 12px; margin-top: 10px; }
.filters fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; background: var(--card); }
.filters legend { padding: 0 6px; color: var(--muted); font-size: 14px; }
.filters .scroll { max-height: 220px; overflow: auto; }
.filters .actions { margin: 0; }
.filters .btn { width: 100%; }

/* ---------- Tables (both-way scroll inside the popup) ---------- */
.table-wrap {
  max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow-sm); margin: 8px 0;
}
table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.plain { min-width: 0; margin: 10px 0; }
table.plain th, table.plain td { padding: 8px 10px; }
th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  background: var(--chip); color: var(--blue-deep); font: 700 13px var(--font-body);
  padding: 10px; border-bottom: 1px solid var(--line);
}
th a { color: var(--blue-deep); text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
th a:hover { text-decoration: underline; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:nth-child(even) td { background: #f8faff; }
a.inst { color: var(--blue); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--blue); }
a.inst:hover { border-bottom-style: solid; }
.tiles + .table-wrap { margin-top: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
.pager span { color: var(--muted); font-size: 14px; }

.facts { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 6px 0 12px; }
.facts div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; }
.facts dd em { color: var(--muted); }
.copybar { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.copybar .btn { flex: 1 1 180px; }

.empty-state { text-align: center; padding: 36px 16px; }
.empty-mark { display: inline-flex; width: 64px; height: 64px; border-radius: 20px; background: var(--gold-soft); color: var(--blue-deep); align-items: center; justify-content: center; font-size: 30px; }
.empty-state p { color: var(--muted); max-width: 46ch; margin: 8px auto 0; }

/* ---------- Mobile first, then larger screens ---------- */
@media (min-width: 520px) {
  .app-title { font-size: 18px; }
  .logo { height: 42px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 720px) {
  .app-title { font-size: 22px; }
  .logo { height: 48px; }
  .wrap { padding: 22px 22px 48px; }
  .hero { padding: 30px 32px 28px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pickgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pickgrid.big { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet-head h2 { font-size: 26px; }
  .sheet-body { padding: 16px 22px 22px; }
  .sheet-foot { padding: 14px 22px; }
  .sheet-actions .btn { flex: 0 0 auto; min-width: 160px; }
  .sheet-note { flex: 0 1 auto; }
  .stepper { margin: -16px -22px 16px; padding: 12px 22px 10px; }
  .check-row { grid-template-columns: 26px 1fr auto; }
}
@media (max-width: 519px) {
  .hide-sm { display: none; }
  .topbar { gap: 8px; }
  .trust-btn { padding: 0 12px; font-size: 14px; }
  .install-btn { padding: 0 10px; font-size: 13px; }
  .sheet-head h2 { font-size: 19px; }
  dialog.sheet { border-radius: 16px; }
  .sheet-close span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
