/* Sổ tay sinh tồn — giao diện "bản đồ địa hình": giấy xanh xám, mực xanh rêu, vàng cột mốc, đỏ chỉ dành cho cảnh báo. */
:root {
  --paper: #e8eeeb; --surface: #f8faf9; --surface2: #eef3f1; --ink: #11292c; --muted: #52686b; --line: #c8d4d1;
  --teal: #0f5257; --teal-d: #0a3a3e; --teal-t: #d7e9e7; --beacon: #f0b429; --beacon-t: #fbefc9; --alarm: #c8372d; --alarm-t: #f9dcd8; --ok: #2f7d55; --ok-t: #d8eee1; --warn-t: #fcefc6;
  --c-check: #1b8a8f; --c-inv: #3b73c9; --c-learn: #d99a0b; --c-prac: #a5499c;
  --r: 14px; --shadow: 0 1px 0 rgba(17,41,44,.06), 0 6px 18px -10px rgba(17,41,44,.28);
  --serif: ui-serif, "New York", "Iowan Old Style", Charter, Georgia, "Noto Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper:#0c1a1c; --surface:#132325; --surface2:#182d30; --ink:#e6efec; --muted:#93a9a7; --line:#27423f; --teal:#58c2bb; --teal-d:#8fdcd6; --teal-t:#173a3b; --beacon-t:#3a3115; --alarm:#ff7366; --alarm-t:#3b1d1b; --ok:#5fc08a; --ok-t:#17331f; --warn-t:#3a3115; --c-check:#3fc1c6; --c-inv:#6c9cf0; --c-learn:#f0b429; --c-prac:#d27bc8; --shadow:0 1px 0 rgba(0,0,0,.4), 0 8px 22px -12px rgba(0,0,0,.7); } }
:root[data-theme="dark"] { --paper:#0c1a1c; --surface:#132325; --surface2:#182d30; --ink:#e6efec; --muted:#93a9a7; --line:#27423f; --teal:#58c2bb; --teal-d:#8fdcd6; --teal-t:#173a3b; --beacon-t:#3a3115; --alarm:#ff7366; --alarm-t:#3b1d1b; --ok:#5fc08a; --ok-t:#17331f; --warn-t:#3a3115; --c-check:#3fc1c6; --c-inv:#6c9cf0; --c-learn:#f0b429; --c-prac:#d27bc8; --shadow:0 1px 0 rgba(0,0,0,.4), 0 8px 22px -12px rgba(0,0,0,.7); color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: .4em 0; } a { color: var(--teal); } img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--beacon); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sub { color: var(--muted); font-size: .92rem; } .hint { color: var(--muted); font-size: .88rem; }

/* ---- khung ---- */
#app { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.side { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; gap: .6rem; align-items: center; padding: calc(.6rem + var(--sat)) calc(1rem + var(--sar)) .6rem calc(1rem + var(--sal)); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.search { flex: 1; min-width: 0; position: relative; }
.search input[type=search] { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 .9rem 0 2.4rem; }
.search::before { content: ""; position: absolute; left: .85rem; top: 50%; width: 14px; height: 14px; margin-top: -9px; border: 2px solid var(--muted); border-radius: 50%; }
.search::after { content: ""; position: absolute; left: 1.55rem; top: 50%; width: 7px; height: 2px; margin-top: 6px; background: var(--muted); transform: rotate(45deg); }
.sos { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 .9rem; border-radius: 12px; background: var(--alarm); color: #fff; font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.netpill { display: none; font-size: .8rem; padding: .2rem .55rem; border-radius: 99px; background: var(--beacon-t); border: 1px solid var(--beacon); white-space: nowrap; }
body.offline .netpill { display: inline-block; }
.updatebar { display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .6rem 1rem; background: var(--teal); color: #fff; font-size: .95rem; }
.updatebar .btn { background: #fff; color: var(--teal-d); border-color: #fff; }
#view { padding: 1.1rem calc(1rem + var(--sar)) calc(6.2rem + var(--sab)) calc(1rem + var(--sal)); width: 100%; max-width: 980px; margin: 0 auto; outline: none; }
.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: .35rem calc(.5rem + var(--sar)) calc(.35rem + var(--sab)) calc(.5rem + var(--sal)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 50px; justify-content: center; text-decoration: none; color: var(--muted); font-size: .72rem; border-radius: 10px; }
.tabs a .ic, .side a .ic { font-size: 1.3rem; line-height: 1; }
.tabs a[aria-current="page"] { color: var(--teal); font-weight: 700; }
@media (min-width: 820px) {
  #app { grid-template-columns: 232px 1fr; }
  .side { display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 0; height: 100vh; height: 100dvh; padding: calc(1rem + var(--sat)) .8rem 1rem calc(.8rem + var(--sal)); border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
  .side .brand { padding: .3rem .6rem 1rem; font-size: 1.15rem; }
  .side a.nav { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; text-decoration: none; color: var(--ink); min-height: 42px; }
  .side a.nav:hover { background: var(--surface2); }
  .side a.nav[aria-current="page"] { background: var(--teal-t); color: var(--teal-d); font-weight: 700; }
  .side .sep { height: 1px; background: var(--line); margin: .5rem .4rem; }
  .tabs, .top .brand { display: none; }
  #view { padding-bottom: 3rem; }
}

/* ---- thành phần chung ---- */
.phead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.phead p { margin: .3rem 0 0; } .phead-act { display: flex; gap: .5rem; }
.back { display: inline-block; margin: 0 0 .6rem; text-decoration: none; font-weight: 600; min-height: 32px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .5rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); cursor: pointer; font-weight: 600; text-align: center; }
.btn:hover { border-color: var(--teal); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; } :root[data-theme="dark"] .btn.primary { color: #06201f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #06201f; } }
.btn.danger { background: var(--alarm); border-color: var(--alarm); color: #fff; } .btn.danger-o { color: var(--alarm); border-color: color-mix(in srgb, var(--alarm) 45%, var(--line)); }
.btn.sm { min-height: 36px; padding: .25rem .7rem; font-size: .9rem; } .btn.block { display: flex; width: 100%; } .btn.big { min-height: 54px; font-size: 1.05rem; }
.btn[aria-pressed="true"] { background: var(--beacon-t); border-color: var(--beacon); } .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; margin: .8rem 0; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; align-items: center; }
.pill { display: inline-block; font-size: .76rem; line-height: 1; padding: .28rem .55rem; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.p4 { background: var(--alarm-t); border-color: transparent; color: var(--alarm); font-weight: 700; } .pill.p3 { background: var(--beacon-t); border-color: transparent; color: #8a5d00; font-weight: 600; }
:root[data-theme="dark"] .pill.p3 { color: var(--beacon); } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.p3 { color: var(--beacon); } }
.pill.core { background: var(--teal-t); color: var(--teal-d); border-color: transparent; font-weight: 700; } .pill.gear { background: var(--surface2); }
.pill.warn, .pill.r4, .pill.r3 { background: var(--alarm-t); color: var(--alarm); border-color: transparent; }
.gdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; align-self: center; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; min-width: 60px; flex: 1; } .bar i { display: block; height: 100%; background: var(--c-check); border-radius: 99px; transition: width .25s; } .bar.tall { height: 12px; margin: .6rem 0 1rem; }
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: .1rem 0 .6rem; margin: 0 -.25rem; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: .3rem .85rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.chip.on { background: var(--teal); color: #fff; border-color: var(--teal); } :root[data-theme="dark"] .chip.on { color: #06201f; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { color: #06201f; } }
.filters { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; } .check { display: inline-flex; gap: .4rem; align-items: center; min-height: 38px; } .check input { width: 20px; height: 20px; }
.count { color: var(--muted); font-size: .9rem; margin: .2rem 0 .6rem; }
.lsec { margin: 1.4rem 0; } .lsec > h2 { margin-bottom: .6rem; } .sech { margin: 1.4rem 0 .6rem; }
.empty { text-align: center; padding: 2rem 1rem; border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface); } .empty p { color: var(--muted); }
.callout { padding: .8rem 1rem; border-radius: 12px; background: var(--surface2); border-left: 4px solid var(--teal); margin: .6rem 0; }
.callout.danger { background: var(--alarm-t); border-color: var(--alarm); } .callout.warn { background: var(--warn-t); border-color: var(--beacon); }
.callout.good { background: var(--ok-t); border-color: var(--ok); } .callout.ok { background: var(--warn-t); border-color: var(--beacon); } .callout.bad { background: var(--alarm-t); border-color: var(--alarm); }
.disc { font-size: .82rem; color: var(--muted); margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: .8rem; }

/* ---- danh sách / thẻ ---- */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.lrow { display: flex; gap: .8rem; align-items: center; padding: .75rem .9rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); border-left: 4px solid var(--gc, transparent); min-height: 56px; }
.lrow:last-child { border-bottom: 0; } .lrow:hover { background: var(--surface2); } .lrow.static:hover { background: none; }
.lrow-tick { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .85rem; color: #fff; } .lrow-tick.big { border: 0; font-size: 1.4rem; width: 32px; color: inherit; }
.lrow.done .lrow-tick { background: var(--ok); border-color: var(--ok); } .lrow-main { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.lrow-title { font-weight: 600; overflow-wrap: anywhere; } .lrow-meta { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; } .lrow-sub { font-size: .8rem; color: var(--muted); }
.ggrid, .hubgrid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hubgrid.sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gcard, .hub { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.gcard { border-top: 5px solid var(--gc); } .gcard:hover, .hub:hover { border-color: var(--teal); }
.gcard p, .hub p { color: var(--muted); font-size: .88rem; margin: 0; } .gicon, .hub-i { font-size: 1.7rem; line-height: 1; }
.gfoot { display: flex; gap: .6rem; align-items: center; margin-top: auto; padding-top: .5rem; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.hub.due { border-color: var(--beacon); background: var(--beacon-t); } .hub.alarm { background: var(--alarm); color: #fff; border-color: var(--alarm); } .hub.alarm p { color: #ffe6e3; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: var(--r); background: var(--teal-t); border: 1px solid var(--line); text-decoration: none; color: var(--ink); margin-bottom: 1rem; }
.banner.core { background: var(--teal); color: #fff; border-color: var(--teal); } .banner.core p { color: #d5ecea; margin: .2rem 0 0; } .banner.due { background: var(--beacon-t); border-color: var(--beacon); }
:root[data-theme="dark"] .banner.core { color: #06201f; } :root[data-theme="dark"] .banner.core p { color: #0b3b3a; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .banner.core { color: #06201f; } :root:not([data-theme="light"]) .banner.core p { color: #0b3b3a; } }
.banner-n { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; margin: 1rem 0; }
.stat { display: flex; flex-direction: column; padding: .8rem 1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); } .stat b { font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; } .stat span { color: var(--muted); font-size: .82rem; }
.stat.alert { border-color: var(--alarm); background: var(--alarm-t); }
.decks { display: flex; flex-direction: column; gap: .6rem; } .deck { display: grid; grid-template-columns: 1fr 90px auto; gap: .8rem; align-items: center; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--gc); border-radius: 12px; }
.deck-main { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: center; } .deck-main .sub { flex-basis: 100%; }
@media (max-width: 560px) { .deck { grid-template-columns: 1fr; } .deck .btn { width: 100%; } }

/* ---- tổng quan ---- */
.hero { display: grid; gap: 1.2rem; grid-template-columns: 1fr; align-items: center; padding: 1.2rem; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 1rem; background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260' fill='none' stroke='%230f5257' stroke-opacity='.11' stroke-width='1.4'%3E%3Cpath d='M-10 200C60 150 90 230 170 190S300 90 430 130'/%3E%3Cpath d='M-10 170C60 120 95 200 170 162S300 62 430 100'/%3E%3Cpath d='M-10 140C60 92 100 170 172 134S300 36 430 70'/%3E%3Cpath d='M-10 230C70 185 100 255 175 220S305 125 430 165'/%3E%3Cpath d='M-10 110C62 66 104 140 176 106S302 12 430 42'/%3E%3Cpath d='M-10 260C75 215 108 280 180 250S310 160 430 200'/%3E%3C/svg%3E"); background-size: cover; }
@media (min-width: 640px) { .hero { grid-template-columns: 240px 1fr; } }
.hero-gauge { max-width: 240px; margin: 0 auto; width: 100%; } .gauge { width: 100%; height: auto; display: block; } .gauge-n { font: 700 40px var(--serif); fill: var(--ink); } .gauge-s { font: 13px var(--sans); fill: var(--muted); }
.legend { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .35rem; } .legend li { display: flex; align-items: center; gap: .6rem; font-size: .92rem; } .legend i { width: 12px; height: 12px; border-radius: 4px; flex: none; } .legend span { flex: 1; } 
.week { display: flex; align-items: flex-end; gap: .5rem; height: 86px; padding: .5rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); } .week .wd { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; } .week i { display: block; width: 100%; max-width: 28px; background: var(--line); border-radius: 5px; } .week i.on { background: var(--teal); } .week span { font-size: .7rem; color: var(--muted); }
.numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .6rem 0 1rem; } .num { display: flex; flex-direction: column; align-items: center; padding: .6rem; border-radius: 12px; background: var(--alarm-t); border: 1px solid color-mix(in srgb, var(--alarm) 40%, transparent); text-decoration: none; color: var(--ink); } .num b { font: 800 1.5rem var(--serif); color: var(--alarm); } .num span { font-size: .78rem; }

/* ---- bài học ---- */
.lesson { --gc: var(--teal); } .lhead { padding: 1rem 0 .4rem; border-top: 5px solid var(--gc); } .lmeta { display: flex; align-items: baseline; gap: .5rem; color: var(--muted); font-size: .88rem; margin-top: .6rem; flex-wrap: wrap; } .lhead h1 { margin: .4rem 0 .6rem; overflow-wrap: anywhere; }
.lbadges, .lact { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0; }
.lsec h2 { font-size: 1.15rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.lesson p { max-width: 70ch; }
.steps { padding: 0; margin: .5rem 0; list-style: none; counter-reset: s; display: grid; gap: .5rem; } .steps li { counter-increment: s; display: flex; gap: .8rem; padding: .7rem .9rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; align-items: flex-start; } .steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; } .steps li.on { background: var(--ok-t); border-color: var(--ok); } .steps li.on span { opacity: .75; }
:root[data-theme="dark"] .steps li::before { color: #06201f; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .steps li::before { color: #06201f; } }
.lnav { display: flex; justify-content: space-between; gap: .6rem; margin: 1.4rem 0; } .sources { margin-top: 1.4rem; color: var(--muted); font-size: .88rem; } .sources summary { cursor: pointer; min-height: 36px; }

/* ---- thẻ ôn / trắc nghiệm / tình huống ---- */
.cmeta { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; color: var(--muted); font-size: .88rem; } .tag { padding: .15rem .55rem; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); white-space: nowrap; }
.flash { min-height: 260px; padding: 1.3rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--gc); box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: .8rem; }
.cgroup { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .85rem; } .cbody.front { font: 700 clamp(1.25rem, 1rem + 1.2vw, 1.7rem)/1.3 var(--serif); } .cbody.back p { font-size: 1.05rem; margin: .3rem 0; } .flash hr { border: 0; border-top: 1px dashed var(--line); width: 100%; } .clink { margin-top: auto; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .9rem; } .grade { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: .5rem .2rem; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; } .grade small { color: var(--muted); } .grade kbd { display: none; }
.grade.again { border-color: var(--alarm); } .grade.hard { border-color: var(--beacon); } .grade.good { border-color: var(--ok); } .grade.easy { border-color: var(--c-inv); }
@media (min-width: 820px) { .grade kbd { display: block; position: absolute; top: 4px; right: 6px; font-size: .7rem; color: var(--muted); } }
.result { padding: 1.2rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); } .big-score { font: 700 2.4rem var(--serif); margin: .2rem 0; }
.qsetup { display: grid; gap: .8rem; max-width: 520px; } .qsetup label, .form label { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; }
select, input[type=text], input[type=number], input[type=date], input[type=search], textarea { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: .45rem .7rem; width: 100%; }
.bigsearch { height: 50px; margin-bottom: 1rem; font-size: 1.05rem; }
.qtext { margin: .4rem 0 1rem; font-size: 1.3rem; } .opts { display: grid; gap: .6rem; } .opt { display: flex; gap: .8rem; align-items: flex-start; text-align: left; padding: .8rem 1rem; min-height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; } .opt .ol { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.opt.right { border-color: var(--ok); background: var(--ok-t); } .opt.wrong { border-color: var(--alarm); background: var(--alarm-t); } .opt:disabled { cursor: default; color: inherit; }
.qfb { margin-top: 1rem; padding: .8rem 1rem; border-radius: 12px; } .qfb:not(:empty) { background: var(--surface2); }
.log { padding-left: 1.2rem; } .log .good::marker { color: var(--ok); } .log .bad::marker { color: var(--alarm); } .log li { margin: .3rem 0; }

/* ---- checklist / kho / thẻ khẩn cấp ---- */
.cl { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; } .cl li { padding: .6rem .9rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); } .cl li.on { background: var(--ok-t); border-color: var(--ok); } .cl li.on .cl-t { text-decoration: line-through; opacity: .7; }
.cl label { display: flex; gap: .8rem; align-items: flex-start; min-height: 40px; cursor: pointer; } .cl input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--teal); } .cl-t { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.cl-inv { display: flex; gap: .6rem; align-items: center; justify-content: space-between; margin: .2rem 0 .1rem 2.3rem; font-size: .85rem; } .cl-inv .ok { color: var(--ok); } .cl-inv .part { color: #8a5d00; } .cl-inv .no { color: var(--alarm); }
.inv { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; } .inv > li { display: grid; grid-template-columns: 1fr auto; gap: .5rem .8rem; align-items: center; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.invrow.expired { border-color: var(--alarm); background: var(--alarm-t); } .invrow.soon { border-color: var(--beacon); } .inv-main { display: flex; flex-direction: column; gap: .2rem; min-width: 0; align-items: flex-start; } .inv-main .bar { width: 100%; flex: none; }
.qty { display: flex; align-items: center; gap: .5rem; font-weight: 600; } .ibtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); font-size: 1.2rem; cursor: pointer; } .row-act { grid-column: 1 / -1; display: flex; gap: .5rem; justify-content: flex-end; }
.guide header { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; } .guide-i { font-size: 2.6rem; }
.callbtn { display: flex; justify-content: center; align-items: center; min-height: 58px; border-radius: 14px; background: var(--alarm); color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; margin-bottom: 1rem; }
.gsteps { list-style: none; counter-reset: g; padding: 0; display: grid; gap: .7rem; } .gsteps li { counter-increment: g; display: flex; gap: .9rem; padding: 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 1.12rem; line-height: 1.5; } .gsteps li::before { content: counter(g); flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 800; }
:root[data-theme="dark"] .gsteps li::before { color: #06201f; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gsteps li::before { color: #06201f; } }
.never { margin: 1.2rem 0; padding: 1rem; border-radius: 14px; background: var(--alarm-t); border: 1px solid color-mix(in srgb, var(--alarm) 40%, transparent); } .never h2 { color: var(--alarm); } .never ul { margin: .4rem 0 0; padding-left: 1.2rem; }

/* ---- sổ tay / cài đặt / hộp thoại ---- */
.noteedit { display: grid; gap: .8rem; } .note-title { font: 700 1.4rem var(--serif); } .note-body { min-height: 46vh; resize: vertical; line-height: 1.6; } .saved { color: var(--muted); font-size: .85rem; }
.form { display: grid; gap: .8rem; max-width: 520px; } .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.kv { list-style: none; padding: 0; margin: 0 0 .6rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); } .kv li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .9rem; border-bottom: 1px solid var(--line); font-size: .92rem; } .kv li:last-child { border: 0; } .kv span { color: var(--muted); } .kv b { text-align: right; }
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(5, 20, 22, .55); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.dlg { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 1.2rem 1.2rem calc(1.2rem + var(--sab)); box-shadow: 0 -20px 50px -20px rgba(0,0,0,.5); } .dlg-body { margin: .8rem 0; } .dlg-act { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
@media (min-width: 640px) { .overlay { align-items: center; padding: 1rem; } .dlg { border-radius: 20px; } }
.toast { position: fixed; z-index: 120; left: 50%; bottom: calc(5.4rem + var(--sab)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--paper); padding: .7rem 1rem; border-radius: 12px; max-width: min(92vw, 520px); font-size: .92rem; transition: opacity .2s, transform .2s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; } .toast-act { margin-left: .8rem; background: none; border: 0; color: var(--beacon); font-weight: 700; cursor: pointer; }
@media (min-width: 820px) { .toast { bottom: 1.5rem; } }
.boot { display: grid; place-items: center; min-height: 60vh; text-align: center; color: var(--muted); padding: 2rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .side, .top, .tabs, .toast { display: none !important; } body { background: #fff; } }
