/* Learn tab */
.lw { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; max-width: 1140px; margin: 0 auto; padding: 28px 20px 90px; }
.lside { position: sticky; top: 20px; align-self: start; display: flex; flex-direction: column; gap: 14px; }
.lprog .bar { height: 6px; background: #1a222d; border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.lprog .bar i { display: block; height: 100%; background: var(--accent); }
.lnav { display: flex; flex-direction: column; gap: 2px; }
.lnav a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: #b4c0d0; text-decoration: none; font-size: 13.5px; }
.lnav a:hover { background: #151b24; color: #fff; }
.lnav a.on { background: #1b2740; color: #fff; }
.lnav .num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #1a222d; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--dim); }
.lnav .num.done { background: rgba(38,166,154,.2); color: var(--up); }
.btn.wide { text-align: center; text-decoration: none; display: block; }
a.btn { text-decoration: none; color: inherit; display: inline-block; }
a.btn.primary { color: #fff; }
.btn.big { padding: 10px 18px; font-size: 14.5px; }

.lmain { font-size: 15px; line-height: 1.65; min-width: 0; max-width: 780px; }
.lmain h1 { font-size: 30px; line-height: 1.2; margin: 4px 0 6px; color: #f0f4fa; }
.lmain h2 { font-size: 20px; margin: 34px 0 10px; color: #e6edf7; }
.lmain h3 { font-size: 17px; margin: 28px 0 6px; color: #e6edf7; }
.lmain p, .lmain li { color: #c3cdda; }
.lmain ul, .lmain ol { padding-left: 22px; } .lmain li { margin: 4px 0; }
.lmain b { color: #eef3fa; }
.crumbs { font-size: 12.5px; color: var(--dim); } .crumbs a { color: var(--accent); text-decoration: none; }
.meta { font-size: 13px; margin-bottom: 14px; }

.hero { padding: 6px 0 22px; }
.hero h1 { font-size: 38px; }
.hero p { font-size: 17px; max-width: 620px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 10px 0 22px; }
.lcard { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; line-height: 1.4; }
.lcard:hover { border-color: var(--accent); background: #131a24; }
.lcard.done { border-color: rgba(38,166,154,.45); }
.lc-n { font-size: 12px; font-weight: 800; color: var(--accent); } .lcard.done .lc-n { color: var(--up); }
.lc-t { font-weight: 700; font-size: 15px; color: #eef3fa; } .lc-s { font-size: 13px; color: var(--dim); } .lc-m { font-size: 12px; color: #6c7889; margin-top: 4px; }

.callout { border: 1px solid var(--line); border-left: 4px solid var(--blue); background: #0f151d; border-radius: 8px; padding: 12px 14px; margin: 18px 0; font-size: 14.5px; color: #c3cdda; }
.callout.warn { border-left-color: var(--orange); } .callout.tip { border-left-color: var(--up); }

.fig { margin: 16px 0; background: #0d1219; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.fig .figsvg { width: 100%; max-width: 640px; display: block; margin: 0 auto; height: auto; }
.fig figcaption { font-size: 13px; color: var(--dim); text-align: center; margin-top: 6px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }
.pcard { background: #0d1219; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.pcard .ptitle { font-weight: 700; margin-bottom: 4px; color: #eef3fa; }
.pcard p { font-size: 13px; line-height: 1.45; margin: 6px 0 0; }
.pcard .figsvg { width: 100%; height: auto; }

.widget { margin: 18px 0; background: #0f151d; border: 1px solid #2a3544; border-radius: 10px; padding: 14px; }
.wtitle { font-weight: 700; color: var(--accent); margin-bottom: 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; }
.cb { display: grid; grid-template-columns: 1fr 200px; gap: 16px; align-items: center; }
.cbsliders { display: flex; flex-direction: column; gap: 8px; }
.sl { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 10px; font-size: 13.5px; }
.sl b { text-align: right; font-variant-numeric: tabular-nums; }
.cbview .figsvg { width: 100%; height: auto; background: #0b0e13; border-radius: 8px; }
.cbtext { margin-top: 10px; font-size: 14.5px; line-height: 1.5; }
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.calc label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--dim); }
.calc input { background: #0b0e13; border: 1px solid #2a3544; border-radius: 6px; padding: 7px 8px; font-size: 14px; color: var(--text); }
.calcout { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed #202a37; font-size: 14px; } .kv span { color: var(--dim); }
.calcout p, .warnline, .okline { grid-column: 1 / -1; margin: 6px 0 0; font-size: 13.5px; } .warnline { color: var(--orange); } .okline { color: var(--up); }

table.mini { border-collapse: collapse; margin: 10px 0; font: 13px var(--mono); }
table.mini th, table.mini td { padding: 3px 14px; text-align: right; border-bottom: 1px solid #1c2531; } table.mini th { color: var(--dim); font-weight: 500; }
table.mini td:last-child { text-align: left; color: var(--dim); }
table.mini tr.dn td:first-child, table.mini tr.dn td:nth-child(2) { color: var(--down); } table.mini tr.up td:first-child, table.mini tr.up td:nth-child(2) { color: var(--up); }
.lmain dl.gloss { grid-template-columns: 150px 1fr; gap: 8px 16px; } .lmain dl.gloss dt { color: #eef3fa; } .lmain dl.gloss dd { color: #c3cdda; }
.gsearch { width: 100%; padding: 10px 12px; background: #0d1219; border: 1px solid #2a3544; border-radius: 8px; font-size: 15px; margin: 10px 0 16px; color: var(--text); }
dl.gloss.big { grid-template-columns: 200px 1fr; }

.try { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin: 30px 0 6px; border: 1px solid rgba(79,140,255,.45); background: rgba(79,140,255,.08); border-radius: 10px; }
.try p { margin: 4px 0 0; font-size: 14px; } .try .btn { flex: none; }
.quiz { margin-top: 28px; } .quiz h2 { margin-top: 10px; }
.q { margin: 16px 0; } .q p { margin: 0 0 6px; color: #e6edf7; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opts button { text-align: left; padding: 9px 12px; background: #11161d; border: 1px solid #2a3544; border-radius: 8px; cursor: pointer; font-size: 14.5px; line-height: 1.4; }
.opts button:hover:not(:disabled) { border-color: var(--accent); background: #151d2a; }
.opts button.ok { border-color: var(--up); background: rgba(38,166,154,.14); color: #dff6f3; }
.opts button.bad { border-color: var(--down); background: rgba(239,83,80,.14); }
.opts button.dim { opacity: .5; } .opts button:disabled { cursor: default; }
.why { font-size: 13.5px; color: var(--dim); margin-top: 6px; padding-left: 4px; }
.qres { margin-top: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 36px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .lw { grid-template-columns: 1fr; gap: 18px; padding-top: 16px; }
  .lside { position: static; }
  .hero h1 { font-size: 30px; } .cb { grid-template-columns: 1fr; } .try { flex-direction: column; align-items: flex-start; }
  .sl { grid-template-columns: 80px 1fr 40px; } .lmain dl.gloss, dl.gloss.big { grid-template-columns: 1fr; }
}

/* Units, activities, tests, pattern gallery */
.unithead { margin: 12px 8px 3px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #6c7889; }
.lnav a.test { color: var(--orange); } .lnav a.test .num { background: rgba(255,167,38,.14); color: var(--orange); } .lnav a.test .num.done { background: rgba(38,166,154,.2); color: var(--up); }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 6px 0 24px; }
.how div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.4; color: var(--dim); } .how b { color: #eef3fa; font-size: 14px; }
.unit { margin: 26px 0 10px; } .unit h2 { margin: 0 0 2px; font-size: 21px; } .unit > p { margin: 0 0 10px; }
.lcard.test { border-color: rgba(255,167,38,.4); background: rgba(255,167,38,.05); } .lcard.test .lc-n { color: var(--orange); } .lcard.test.done { border-color: rgba(38,166,154,.5); } .lcard.test.done .lc-n { color: var(--up); }

.pgrid.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pcard .tip { font-size: 12.5px; color: #9fb0c4; margin-top: 4px; }
.kind { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-bottom: 4px; }
.k-bull { background: rgba(38,166,154,.16); color: var(--up); } .k-bear { background: rgba(239,83,80,.16); color: var(--down); } .k-ind { background: rgba(255,167,38,.16); color: var(--orange); } .k-cont { background: rgba(66,165,245,.16); color: var(--blue); }
table.cheat { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 12px 0; }
table.cheat th, table.cheat td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); color: #c3cdda; } table.cheat th { color: var(--dim); font-weight: 600; }
.cf .figsvg { width: 100%; max-width: 600px; display: block; margin: 0 auto; height: auto; }

.act { margin: 30px 0; padding: 18px; background: #0f151d; border: 1px solid #2a3544; border-radius: 12px; }
.act.test { border-color: rgba(255,167,38,.45); }
.runidle { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; } .runidle h2 { margin: 0 0 4px; font-size: 19px; } .runidle p { margin: 4px 0; }
.runhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; color: var(--dim); font-size: 13px; } .runhead b { color: #eef3fa; font-size: 15px; }
.act .bar { height: 6px; background: #1a222d; border-radius: 99px; overflow: hidden; } .act .bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.runq { margin-top: 16px; } .prompt { font-size: 16px; color: #e6edf7; margin: 0 0 10px; line-height: 1.5; }
.runq .fig { margin: 8px 0 12px; } .runq .opts button.sel { border-color: var(--accent); background: rgba(79,140,255,.14); }
.numrow { display: flex; align-items: center; gap: 10px; margin: 8px 0; } .numrow input { width: 200px; padding: 9px 11px; background: #0b0e13; border: 1px solid #2a3544; border-radius: 8px; font-size: 16px; color: var(--text); } .numrow .unit { color: var(--dim); }
.runfb { margin: 12px 0 4px; padding: 10px 12px; border-radius: 8px; font-size: 14.5px; line-height: 1.5; } .runfb.ok { background: rgba(38,166,154,.12); border: 1px solid rgba(38,166,154,.5); } .runfb.bad { background: rgba(239,83,80,.1); border: 1px solid rgba(239,83,80,.5); }
.runbtns { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.results { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 6px 0 12px; } .bigscore { font-size: 54px; font-weight: 800; line-height: 1; } .bigscore small { font-size: 22px; color: var(--dim); font-weight: 600; }
.miss { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; } .miss p { margin: 4px 0; } .miss .why { color: var(--dim); font-size: 14px; }
.plancard { margin: 14px 0; padding: 14px 16px; border: 1px solid rgba(38,166,154,.5); background: rgba(38,166,154,.07); border-radius: 10px; } .plancard h3 { margin: 0 0 6px; }
table.cand { margin: 6px 0 10px; } table.cand td:last-child { color: var(--text); text-align: left; }
.fig.small .figsvg { max-width: 220px; }

.lmenu { display: none; }
.lmain table.cheat { display: block; overflow-x: auto; }
@media (max-width: 860px) {
  .lw { padding: 12px 12px 70px; gap: 12px; }
  .lside { gap: 10px; }
  .lmenu { display: block; width: 100%; text-align: left; font-weight: 600; }
  .lside .lnav, .lside .btn.wide { display: none; }
  .lside.open .lnav { display: flex; } .lside.open .btn.wide { display: block; }
  .lmain { font-size: 16px; } .lmain h1 { font-size: 26px; }
  .lmain .fig { padding: 6px; } .fig .figsvg { max-width: 100%; }
  .act { padding: 12px; } .runidle .btn { width: 100%; }
  .opts button { padding: 12px; font-size: 15px; }
  .numrow input { width: 100%; font-size: 16px; } .numrow { flex-wrap: wrap; }
  .results { gap: 12px; } .bigscore { font-size: 44px; }
  .pager .btn { flex: 1 1 100%; text-align: center; }
  .try .btn { width: 100%; text-align: center; }
  .cta .btn { flex: 1 1 100%; text-align: center; }
  .calc { grid-template-columns: 1fr 1fr; } .calc input { font-size: 16px; }
  .gsearch { font-size: 16px; }
}
