:root{
  --ink:#0b1f3a; --ink2:#41526b; --muted:#6b7a90; --line:#dbe6f5; --bg:#f6f9fd; --card:#fff;
  --blue:#1662c4; --blue2:#0f4c99; --blueSoft:#e7f1fb; --green:#1f8a4c; --greenSoft:#e5f4e4;
  --red:#c0392b; --redSoft:#fbebeb; --amber:#a86400; --amberSoft:#f9eeda; --radius:14px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:'Prompt',system-ui,sans-serif;font-weight:300;color:var(--ink);background:var(--bg);line-height:1.6;font-size:16px}
a{color:var(--blue);text-decoration:none} a:hover{text-decoration:underline}
h1,h2,h3{font-weight:500;line-height:1.3;margin:0 0 .5em} h1{font-size:1.6rem} h2{font-size:1.25rem} h3{font-size:1.05rem}
b,strong{font-weight:500}
.wrap{max-width:1080px;margin:0 auto;padding:0 18px}
main.wrap{padding-top:22px;padding-bottom:48px;min-height:70vh;outline:none}
.muted{color:var(--muted)} .center{text-align:center} .pad{padding:40px 0} .small{font-size:.875rem} .nowrap{white-space:nowrap}
.topbar{position:sticky;top:0;z-index:20;background:rgba(248,251,255,.9);backdrop-filter:saturate(180%) blur(16px);border-bottom:1px solid var(--line)}
.topbar-in{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 18px;min-height:54px}
.brand{display:inline-flex;align-items:center;gap:8px;color:var(--ink);font-weight:500}
.brand img{width:30px;height:30px}
#nav{display:flex;flex-wrap:wrap;gap:2px 4px;align-items:center}
#nav a,#nav button{font:inherit;font-size:.92rem;color:var(--ink2);padding:6px 10px;border-radius:9px;background:none;border:0;cursor:pointer}
#nav a.on{background:var(--blueSoft);color:var(--blue2);font-weight:400}
#nav a:hover,#nav button:hover{background:#eef3fa;text-decoration:none}
.foot{border-top:1px solid var(--line);padding:18px 0;color:var(--muted);font-size:.85rem;background:#fff}
.foot .wrap{display:flex;align-items:center;gap:10px} .foot img{width:24px;height:24px;opacity:.8}

.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px 20px;margin-bottom:16px}
.card.tight{padding:12px 16px}
.grid{display:grid;gap:16px} .g2{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))} .g3{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center} .row.between{justify-content:space-between}
.stack>*+*{margin-top:10px}
.hero{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:18px}
.hero p{margin:0}

.btn{font:inherit;font-weight:400;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 16px;border-radius:10px;border:1px solid var(--blue);background:var(--blue);color:#fff;cursor:pointer;min-height:42px;text-decoration:none}
.btn:hover{background:var(--blue2);text-decoration:none}
.btn.ghost{background:#fff;color:var(--blue)} .btn.ghost:hover{background:var(--blueSoft)}
.btn.quiet{background:transparent;border-color:transparent;color:var(--ink2)} .btn.quiet:hover{background:#eef3fa}
.btn.danger{background:#fff;color:var(--red);border-color:#e6b8b2}
.btn.sm{padding:4px 10px;min-height:32px;font-size:.88rem}
.btn[disabled]{opacity:.55;cursor:default}
label{display:block;font-size:.92rem;color:var(--ink2);margin-bottom:4px}
input,select,textarea{font:inherit;font-weight:300;color:var(--ink);width:100%;padding:9px 12px;border:1px solid #c9d6e8;border-radius:10px;background:#fff;min-height:42px}
textarea{min-height:110px;resize:vertical}
input:focus,select:focus,textarea:focus,.btn:focus-visible,a:focus-visible{outline:3px solid #9cc3f2;outline-offset:1px}
.field{margin-bottom:12px}
.inline-input{width:84px;min-height:36px;padding:5px 8px;text-align:center}

.badge{display:inline-block;font-size:.78rem;padding:2px 9px;border-radius:999px;background:#eef3fa;color:var(--ink2);white-space:nowrap;font-weight:400}
.badge.blue{background:var(--blueSoft);color:var(--blue2)} .badge.green{background:var(--greenSoft);color:var(--green)}
.badge.red{background:var(--redSoft);color:var(--red)} .badge.amber{background:var(--amberSoft);color:var(--amber)}
.note{background:var(--blueSoft);border-radius:12px;padding:12px 14px;font-size:.93rem}
.note.warn{background:var(--amberSoft)} .note.err{background:var(--redSoft);color:#7d1f15}

.ann{border-left:4px solid var(--blue);padding:10px 14px;background:#fff;border-radius:10px;margin-bottom:10px}
.ann.pin{border-left-color:var(--amber)} .ann h3{margin:0 0 2px} .ann p{margin:0;white-space:pre-wrap}

.score15{font-size:2.1rem;font-weight:500;line-height:1} .score15 small{font-size:1rem;color:var(--muted);font-weight:300}
.bar{height:8px;background:#e8eef7;border-radius:99px;overflow:hidden;margin-top:10px} .bar>i{display:block;height:100%;background:var(--blue);border-radius:99px}

.list{list-style:none;margin:0;padding:0} .list li{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding:11px 0;border-bottom:1px solid #edf2f9}
.list li:last-child{border-bottom:0}

.unit-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px}
.unit-tabs button{font:inherit;padding:7px 14px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--ink2);cursor:pointer}
.unit-tabs button.on{background:var(--ink);border-color:var(--ink);color:#fff}
.lesson{display:grid;grid-template-columns:44px 1fr;gap:12px;align-items:start}
.lesson .num{width:44px;height:44px;border-radius:12px;background:var(--blueSoft);color:var(--blue2);display:grid;place-items:center;font-weight:500}
.links{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}

.q{border:1px solid var(--line);border-radius:var(--radius);background:#fff;padding:16px 18px;margin-bottom:14px}
.q .qhead{display:flex;justify-content:space-between;gap:10px;margin-bottom:6px;color:var(--muted);font-size:.86rem}
.q .prompt{white-space:pre-wrap;margin-bottom:10px}
.choice{display:flex;gap:10px;align-items:flex-start;padding:9px 12px;border:1px solid #e1e9f4;border-radius:10px;margin-bottom:7px;cursor:pointer}
.choice input{width:auto;min-height:0;margin-top:5px}
.choice:has(input:checked){border-color:var(--blue);background:var(--blueSoft)}
.tf{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;padding:8px 0;border-bottom:1px dashed #e1e9f4}
.tf:last-child{border-bottom:0}
.seg{display:inline-flex;border:1px solid #c9d6e8;border-radius:10px;overflow:hidden}
.seg button{font:inherit;padding:6px 14px;border:0;background:#fff;cursor:pointer;color:var(--ink2);min-height:38px}
.seg button+button{border-left:1px solid #c9d6e8}
.seg button.on{background:var(--blue);color:#fff}
.num-row{display:flex;gap:8px;align-items:center;max-width:320px}
.res{margin-top:10px;padding:10px 12px;border-radius:10px;font-size:.93rem;white-space:pre-wrap}
.res.ok{background:var(--greenSoft)} .res.no{background:var(--redSoft)} .res.wait{background:var(--amberSoft)}
.sticky-submit{position:sticky;bottom:0;background:linear-gradient(transparent,var(--bg) 30%);padding:18px 0 10px}

.tbl-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px;background:#fff;max-height:72vh}
table.tbl{border-collapse:separate;border-spacing:0;width:100%;font-size:.9rem}
.tbl th,.tbl td{padding:7px 10px;border-bottom:1px solid #edf2f9;text-align:left;white-space:nowrap}
.tbl thead th{position:sticky;top:0;background:#f3f7fc;font-weight:500;z-index:2;vertical-align:bottom}
.tbl th.rot{max-width:120px;white-space:normal;font-size:.8rem;line-height:1.25}
.tbl td.num,.tbl th.num{text-align:center}
.tbl tbody tr:hover td{background:#fafcff}
.tbl .stick{position:sticky;left:0;background:#fff;z-index:1} .tbl thead .stick{z-index:3;background:#f3f7fc}
.tbl td.miss{color:#b8c3d3}

.modal-back{position:fixed;inset:0;background:rgba(11,31,58,.35);display:grid;place-items:center;z-index:50;padding:16px}
.modal{background:#fff;border-radius:16px;max-width:560px;width:100%;max-height:90vh;overflow:auto;padding:20px 22px}
.login-box{max-width:400px;margin:5vh auto 0}
.login-box .logo{display:block;width:84px;height:84px;margin:0 auto 10px}
#toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 18px;border-radius:12px;opacity:0;transition:opacity .2s;pointer-events:none;z-index:60;max-width:90vw}
#toast.show{opacity:1}
.cards-print{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pcard{border:1px dashed #8aa;border-radius:8px;padding:10px 12px;font-size:.85rem;break-inside:avoid}
.pcard b{font-size:1.05rem;letter-spacing:.5px}
.chk{width:auto;min-height:0}
@media (max-width:640px){h1{font-size:1.35rem} .card{padding:14px 15px} .cards-print{grid-template-columns:repeat(2,1fr)}}
@media print{
  .topbar,.foot,.no-print,#toast{display:none!important}
  body{background:#fff} main.wrap{padding:0;max-width:none}
  .cards-print{grid-template-columns:repeat(3,1fr)} .pcard{font-size:10pt}
}
