/* BioSamjho — light, mobile-first */
:root {
  --g: #0f9d6b; --g-d: #0b7a53; --g-l: #e7f6ef; --g-ll: #f4fbf7;
  --ink: #0f172a; --txt: #334155; --mut: #64748b; --line: #e5eaf0; --bg: #ffffff; --soft: #f6f8fa;
  --ok: #0f9d6b; --ok-l: #e7f6ef; --no: #d9365e; --no-l: #fdecf0; --amber: #b7791f; --amber-l: #fff7e6;
  --r: 16px; --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #eef2f5; color: var(--txt); font: 16px/1.6 "Segoe UI", Roboto, "Noto Sans", system-ui, -apple-system, sans-serif; }
h1, h2, p, ul, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
b { color: var(--ink); font-weight: 650; }
.app { max-width: 640px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--bg); box-shadow: 0 0 40px rgba(15, 23, 42, .06); padding-bottom: 40px; }
.wrap { padding: 16px 18px 0; animation: in .32s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid rgba(15, 157, 107, .45); outline-offset: 2px; border-radius: 8px; }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; padding: 26px 20px 30px; background: linear-gradient(160deg, #eafaf2 0%, #f7fcf4 55%, #fff 100%); border-bottom: 1px solid var(--line); }
.hero-in { position: relative; z-index: 1; max-width: 62%; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; color: var(--g-d); font-size: 18px; letter-spacing: -.01em; }
.brand img { border-radius: 9px; }
.hero h1 { margin-top: 22px; font-size: clamp(26px, 7.4vw, 38px); line-height: 1.12; letter-spacing: -.03em; color: var(--ink); font-weight: 800; }
.hero p { margin-top: 10px; color: var(--mut); font-size: 14.5px; }
.hero-art { position: absolute; right: -54px; top: 18px; width: 230px; pointer-events: none; animation: float 7s ease-in-out infinite; filter: drop-shadow(0 14px 24px rgba(232, 149, 90, .25)); }
@keyframes float { 50% { transform: translateY(-9px) rotate(4deg); } }

.cont { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; margin-top: 4px; border-radius: var(--r); background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.cont .cont-t { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cont small { color: #7fe0b8; font-size: 12.5px; font-weight: 600; }
.cont b { color: #fff; font-size: 17px; }
.cont em { font-style: normal; color: #94a3b8; font-size: 13px; }
.cont .ic { color: #94a3b8; }
.ring { width: 52px; height: 52px; flex: none; }
.ring-bg { fill: none; stroke: rgba(148, 163, 184, .3); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--g); stroke-width: 5; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s; }
.ring text { font-size: 12px; font-weight: 700; fill: currentColor; }
.cont .ring-fg { stroke: #34d399; }

.tabs { display: flex; gap: 6px; padding: 4px; margin: 22px 0 12px; background: var(--soft); border-radius: 12px; }
.tabs button, .seg button { flex: 1; padding: 9px; border-radius: 9px; font-weight: 650; color: var(--mut); transition: .2s; }
.tabs .on, .seg .on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.chapters { list-style: none; padding: 0; display: grid; gap: 8px; }
.ch { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.ch-no { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--soft); font-weight: 700; color: var(--mut); font-size: 14px; }
.ch-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.ch-t b { font-size: 15.5px; }
.ch-t small { color: var(--mut); font-size: 13px; }
.ch-on { border-color: #bfe8d5; background: var(--g-ll); }
.ch-on .ch-no { background: var(--g); color: #fff; }
.ch-off b { color: var(--mut); font-weight: 550; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--mut); font-size: 12px; font-weight: 650; white-space: nowrap; }
.pill .ic { width: 12px; height: 12px; }
.pill-g { background: var(--g); color: #fff; }
.foot { margin-top: 18px; text-align: center; font-size: 13px; color: var(--mut); }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 10px 14px 10px 8px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.back { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); }
.back:hover { background: var(--soft); }
.bar-t { min-width: 0; line-height: 1.25; }
.bar h1 { font-size: 17px; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar span { font-size: 12.5px; color: var(--mut); }

/* ---------- chapter ---------- */
.prog { padding: 14px 16px; border-radius: var(--r); background: var(--g-ll); border: 1px solid #d5f0e3; }
.prog-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 13.5px; color: var(--mut); }
.prog-top b { color: var(--g-d); font-size: 15px; }
.prog-bar { height: 8px; border-radius: 99px; background: #d9eee4; overflow: hidden; }
.prog-bar i { display: block; height: 100%; border-radius: 99px; background: var(--g); transition: width .5s; }
.prog-bar.slim { height: 5px; background: var(--soft); margin-bottom: 18px; }
.sec { margin: 24px 2px 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); font-weight: 700; }
.rows { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; transition: background .15s; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: var(--soft); }
.row > .ic { color: #cbd5e1; }
.row-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--soft); color: var(--mut); }
.row-ic i { font-style: normal; font-weight: 700; font-size: 14px; }
.row-ic.done { background: var(--g); color: #fff; }
.row-ic.p1 { background: #f1ecfd; color: #6b4bc4; }
.row-ic.p2 { background: #e8f2fd; color: #2f7fc8; }
.row-ic.p3 { background: var(--amber-l); color: var(--amber); }
.row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.row-t b { font-size: 15.5px; }
.row-t small { color: var(--mut); font-size: 13px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; display: flex; flex-direction: column; padding: 12px 12px 14px; border-radius: var(--r); border: 1px solid var(--line); line-height: 1.35; transition: transform .2s, box-shadow .2s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile b { font-size: 15px; margin-top: 10px; }
.tile small { color: var(--mut); font-size: 12.5px; }
.tile-art { height: 104px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; pointer-events: none; }
.t1 .tile-art { background: #fff4ea; }
.t1 .tile-art svg { height: 94px; width: auto; }
.t2 .tile-art { background: linear-gradient(135deg, #eaf3ff, #f1ecfd); color: #6b4bc4; }
.tile-art.play .ic { width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); fill: currentColor; }
.tick { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--g); color: #fff; }
.tick .ic { width: 14px; height: 14px; }

/* ---------- lesson ---------- */
.lesson { font-size: 16.5px; }
.lesson > * + * { margin-top: 14px; }
.lesson h2 { margin-top: 28px; font-size: 19px; color: var(--ink); letter-spacing: -.01em; line-height: 1.3; }
.ul { padding-left: 20px; display: grid; gap: 7px; }
.ul li::marker { color: var(--g); }
.key { padding: 14px 16px; border-radius: 14px; background: var(--g-ll); border: 1px solid #cdeedd; }
.key > b { display: block; color: var(--g-d); margin-bottom: 6px; }
.key ul { padding-left: 20px; display: grid; gap: 5px; }
.tip { padding: 12px 16px; border-radius: 14px; background: var(--amber-l); border-left: 4px solid #f2a93b; }
.tip b { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--amber); }
.tip p { font-size: 15.5px; }
.fig { padding: 12px 8px 10px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); text-align: center; }
.fig figcaption { margin-top: 4px; font-size: 13px; color: var(--mut); }
.fig-svg, .safar-svg, .cell-svg { display: block; width: 100%; height: auto; }
.lab { font: 600 12.5px "Segoe UI", Roboto, sans-serif; fill: #334155; }
.lab.b { font-size: 13px; fill: #0f172a; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; }
th { background: var(--soft); color: var(--ink); font-weight: 650; font-size: 13px; white-space: nowrap; }
tr + tr td { border-top: 1px solid var(--line); }
td:first-child { color: var(--ink); font-weight: 600; }

.actions { margin-top: 22px; display: grid; gap: 10px; }
.actions.two { grid-template-columns: 1fr 1fr; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 18px; border-radius: 14px; font-weight: 700; color: var(--ink); background: var(--soft); border: 1px solid var(--line); transition: .15s; }
.btn:hover { background: #eef1f4; }
.btn:active { transform: scale(.98); }
.btn-g { background: var(--g); color: #fff; border-color: var(--g); box-shadow: 0 6px 16px rgba(15, 157, 107, .28); }
.btn-g:hover { background: var(--g-d); }
.btn-g .ic[viewBox] path { }
.hint { text-align: center; font-size: 13.5px; color: var(--mut); }

/* ---------- diagram ---------- */
.seg { display: flex; gap: 6px; padding: 4px; background: var(--soft); border-radius: 12px; }
.stage { margin-top: 12px; padding: 10px; border-radius: 20px; background: radial-gradient(circle at 50% 40%, #fff, #f3f7fa); border: 1px solid var(--line); }
.stage .cell-svg { max-height: 52vh; margin: 0 auto; }
.cell-svg .org { cursor: pointer; transition: opacity .25s, filter .25s; outline: none; }
.cell-svg .org:hover { filter: brightness(1.05) drop-shadow(0 0 4px rgba(15, 23, 42, .25)); }
.cell-svg.has-sel .org:not(.sel) { opacity: .28; }
.cell-svg .org.sel { filter: drop-shadow(0 0 7px rgba(15, 157, 107, .9)); animation: pop .35s ease; }
.cell-svg .org:focus-visible { filter: drop-shadow(0 0 6px rgba(15, 157, 107, .9)); }
@keyframes pop { 40% { filter: drop-shadow(0 0 14px rgba(15, 157, 107, 1)); } }
.info { margin-top: 12px; min-height: 84px; }
.info-empty { padding: 26px 16px; text-align: center; color: var(--mut); font-size: 14.5px; border: 1.5px dashed var(--line); border-radius: var(--r); }
.info-card { padding: 16px 18px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); animation: in .25s ease both; }
.info-card small { color: var(--g-d); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.info-card h2 { font-size: 20px; color: var(--ink); letter-spacing: -.01em; margin-bottom: 4px; }
.neet { margin-top: 12px; padding: 10px 12px; border-radius: 11px; background: var(--amber-l); font-size: 14.5px; }
.neet b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--amber); }
.chips { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.chips button { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; background: #fff; transition: .15s; }
.chips button.on { background: var(--g); border-color: var(--g); color: #fff; }

/* label practice */
.label-stage .cell-svg { max-height: 40vh; }
.cell-svg.label-mode .org { pointer-events: none; opacity: .3; }
.cell-svg.label-mode .org.target { opacity: 1; animation: glow 1.1s ease-in-out infinite; }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 3px rgba(226, 61, 109, .7)); } 50% { filter: drop-shadow(0 0 13px rgba(226, 61, 109, 1)) brightness(1.08); } }

/* safar */
.safar-stage { padding: 8px; }
.pk { transition: transform 1.5s cubic-bezier(.55, 0, .2, 1); }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.dots button { width: 26px; height: 8px; border-radius: 99px; background: var(--line); transition: .25s; }
.dots .past { background: #9fdcc2; }
.dots .on { background: var(--g); width: 40px; }
.v-safar .key { margin-top: 20px; }

/* ---------- quiz ---------- */
.q { font-size: 19px; line-height: 1.4; color: var(--ink); letter-spacing: -.01em; }
.q small { font-size: 14px; color: var(--mut); font-weight: 500; }
.opts { margin-top: 16px; display: grid; gap: 9px; }
.opts button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-weight: 550; color: var(--ink); line-height: 1.35; transition: .15s; }
.opts button:not(:disabled):hover { border-color: #9fdcc2; background: var(--g-ll); }
.opts span { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--soft); font-size: 13px; font-weight: 700; color: var(--mut); }
.opts .ok { border-color: var(--ok); background: var(--ok-l); }
.opts .ok span { background: var(--ok); color: #fff; }
.opts .no { border-color: var(--no); background: var(--no-l); }
.opts .no span { background: var(--no); color: #fff; }
.opts button:disabled { cursor: default; }
.opts button:disabled:not(.ok):not(.no) { opacity: .55; }
.fb { margin-top: 14px; padding: 12px 16px; border-radius: 14px; animation: in .25s ease both; font-size: 15px; }
.fb.ok { background: var(--ok-l); } .fb.ok b { color: var(--g-d); }
.fb.no { background: var(--no-l); } .fb.no b { color: #b3264a; }
.result { text-align: center; padding: 28px 8px 8px; }
.result .ring { width: 120px; height: 120px; color: var(--ink); }
.result h2 { font-size: 34px; color: var(--ink); letter-spacing: -.02em; margin-top: 8px; }
.result p { color: var(--mut); max-width: 320px; margin: 4px auto 0; }
.rev { padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 9px; font-size: 14.5px; }
.rev b { display: block; }
.rev span { display: inline-block; margin: 5px 0; padding: 2px 10px; border-radius: 99px; background: var(--ok-l); color: var(--g-d); font-weight: 650; font-size: 13.5px; }
.rev p { color: var(--mut); }

/* ---------- board ---------- */
.bq { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.bq summary { display: flex; align-items: flex-start; gap: 10px; padding: 14px; cursor: pointer; list-style: none; }
.bq summary::-webkit-details-marker { display: none; }
.bq-n { flex: none; font-weight: 750; color: var(--g-d); font-size: 14px; padding-top: 1px; }
.bq-q { flex: 1; font-weight: 600; color: var(--ink); line-height: 1.4; }
.bq[open] summary { background: var(--g-ll); border-bottom: 1px solid var(--line); }
.bq .ul { padding: 14px 16px 16px 34px; font-size: 15px; }

@media (max-width: 360px) {
  .hero-in { max-width: 70%; } .hero-art { width: 190px; right: -70px; }
  .actions.two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
