/* Capitole on wide screens, chapter pop-up, Subiect page, Khan-style sidebar, practice main area */
/* chapters index: on wide screens it fills the screen like the practice page */
.ch .tp{display:none}
@media (min-width:1100px){
  .app.hm{max-width:none;padding-left:32px;padding-right:32px;zoom:var(--z)}
  .hmg{display:grid;grid-template-columns:340px minmax(0,1fr);gap:40px;align-items:start}
  .hm-l{position:sticky;top:calc(var(--toph-v,var(--toph)) / var(--z) + 16px);background:var(--card);border:1px solid var(--line);border-radius:14px;padding:22px 22px 18px}
  .hm-l .cont{flex-direction:column;align-items:stretch;margin-bottom:16px}
  .hm-l .cont .btn{width:100%}
  .hm-l .stats{grid-template-columns:1fr;margin-bottom:18px}
  .hm-l .stat{display:flex;align-items:baseline;gap:12px}
  .hm-l .stat b{min-width:60px}
  .hm-r .group{margin-bottom:28px}
  .hm-r .gh h2{font-size:20px;line-height:26px}
  .hm-r>.group .chapters{grid-template-columns:repeat(3,minmax(0,1fr))}
  .hm-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px}
  .hm-r .ch{padding:16px 18px;gap:10px}
  .hm-r .ch .nm{font-size:16px}
  .hm-r .ch .tp{display:block;font-size:13px;line-height:19px;color:var(--muted)}
  .hm-r .ch .r2{margin-top:auto}
  .hm-r .ch .r2>span:first-child{white-space:nowrap}
  .hm-pair .chapters{grid-template-columns:1fr}
}
@media (min-width:1100px) and (max-width:1399px){.hm-r>.group .chapters{grid-template-columns:repeat(2,minmax(0,1fr))}}
.gh-l{background:none;border:none;padding:0;font:inherit;color:inherit;cursor:pointer;display:inline-flex;align-items:center}
.gh-a{margin-left:8px;color:var(--muted);font-size:.85em;transition:transform .15s}
.gh-l:hover{color:var(--acc)}.gh-l:hover .gh-a{color:var(--acc);transform:translateX(3px)}
/* chapter pop-up */
.dlg{border:none;padding:0;border-radius:18px;width:min(980px,calc(calc(100vw / var(--rz)) - 32px));max-height:calc(calc(100vh / var(--rz)) - 48px);background:var(--bg);color:var(--ink);box-shadow:0 24px 60px rgba(20,20,40,.28)}
.dlg::backdrop{background:rgba(20,22,40,.45)}
.dlg-in{padding:24px 26px 20px;display:flex;flex-direction:column;gap:16px}
.dlg-h{display:flex;align-items:center;gap:14px}
.dlg-h>div{flex:1;min-width:0}
.dlg-h h2{font-size:26px;line-height:32px;font-weight:900}
.dlg-x{width:40px;height:40px;border-radius:10px;border:none;background:var(--panel);font-size:26px;line-height:1;color:var(--muted);cursor:pointer;flex:none}
.dlg-x:hover{color:var(--ink)}
.dlg-s{display:flex;flex-wrap:wrap;align-items:center;gap:8px 22px;font-size:14px;color:var(--muted);background:var(--panel);border-radius:12px;padding:12px 16px}
.dlg-s b{color:var(--ink);font-size:17px;margin-right:2px}
.dlg-s .ok b{color:var(--good)}
.dlg-m{margin-left:auto;display:flex;align-items:center;gap:10px}
.dtab{width:100%;border-collapse:collapse;font-size:14.5px}
.dtab th{text-align:left;font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;padding:4px 10px 8px;white-space:nowrap}
.dtab td{padding:11px 10px;border-top:1px solid var(--line);vertical-align:middle}
.dtab tbody tr{cursor:pointer}
.dtab tbody tr:hover td{background:var(--panel)}
.dtab .r{text-align:right;font-variant-numeric:tabular-nums}
.dst{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;color:var(--muted)}
.dst.d{color:var(--good);font-weight:700}
.dst .m{width:18px;height:18px;border-radius:6px}
.dgo{padding:7px 14px;font-size:13.5px;white-space:nowrap}
.dlg-f{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
@media (max-width:700px){.dlg-in{padding:18px 16px}.dtab th:nth-child(1),.dtab td:nth-child(1),.dtab th:nth-child(4),.dtab td:nth-child(4),.dtab th:nth-child(5),.dtab td:nth-child(5),.dtab th:nth-child(6),.dtab td:nth-child(6),.dtab th:nth-child(8),.dtab td:nth-child(8){display:none}.dlg-m{margin-left:0}.dlg-f .btn{flex:1}}
/* subject page table + clickable subject header in the sidebar */
button.sd-top{width:100%;background:none;border:none;border-bottom:1px solid var(--line);font:inherit;color:inherit;text-align:left;cursor:pointer}
button.sd-top:hover{background:var(--panel)}
button.sd-top>div{flex:1;min-width:0}
.sd-go{width:18px;height:18px;color:var(--muted);flex:none}
button.sd-top:hover .sd-go{color:var(--acc)}
table.sj{width:100%;border-collapse:collapse;font-size:15px}
.sj th{text-align:left;font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;padding:6px 12px 10px}
.sj td{background:var(--bg);padding:12px;border-top:6px solid var(--panel);vertical-align:middle}
.sj td:first-child{border-radius:10px 0 0 10px}.sj td:last-child{border-radius:0 10px 10px 0}
.sj tr[data-ch]{cursor:pointer}
.sj tr[data-ch]:hover td{background:var(--card)}
.sj .r{text-align:right;font-variant-numeric:tabular-nums}
.sj td.ok{color:var(--good);font-weight:800}
.sj .ps{font-weight:800;color:var(--sc,var(--acc));white-space:nowrap}
.sj-c{display:flex;align-items:center;gap:10px}
.sj-p{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted);min-width:120px}
.sj-go{padding:8px 16px;font-size:14px;white-space:nowrap}
.app.chp .pl>section{min-width:0}
@media (max-width:700px){.sj th:nth-child(3),.sj td:nth-child(3),.sj th:nth-child(5),.sj td:nth-child(5),.sj th:nth-child(6),.sj td:nth-child(6){display:none}.sj-c .cic{display:none}.sj td{padding:10px 8px}.sj th{padding:6px 8px 8px}}
/* chapter page: same sidebar as practice, overview centred on the right */
.app.chp .chm{width:100%;max-width:940px;margin:0 auto;padding-bottom:40px}
.app.chp h1{font-size:34px;line-height:40px}
.app.chp .chhead{margin-bottom:24px}
.ch2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px}
.ch2 .box{margin-bottom:0}
.app.chp .box{padding:20px 22px}
.app.chp .box h2{font-size:19px}
.app.chp .topics{font-size:16px;line-height:28px}
.app.chp .where span{font-size:14px;padding:4px 12px}
.app.chp .ex{padding:13px 16px;font-size:15.5px}
.ex .es{font-size:13px;color:var(--muted);flex:none}
.ex .es.ok{color:var(--good)}
.chgo{display:flex;justify-content:center;margin-top:8px}
.app.chp #start{font-size:18px;padding:14px 44px}
.sd-none{padding:14px 16px;font-size:13.5px;color:var(--muted)}
@media (max-width:640px){.ch2{grid-template-columns:1fr}.app.chp h1{font-size:28px;line-height:34px}}
/* practice: bigger, centered answer area */
.app.prac,.app.chp{max-width:none;padding-left:32px;padding-right:32px;padding-bottom:0}
.app.prac .pl,.app.chp .pl{grid-template-columns:300px minmax(0,1fr);gap:40px}
.app.prac .foot{position:sticky;bottom:0;z-index:5;margin-top:0;padding:14px 0 16px;background:var(--bg);border-top:1px solid var(--line)}
.app.prac h1{font-size:34px;line-height:40px}
.app.prac .card{padding:34px 40px}
.app.prac .card .st{font-size:21px;line-height:34px}
.app.prac .src{font-size:14px}
/* Khan-style sidebar: subject, chapter crumb with prev/next, big exercise rows */
.app.prac .side,.app.chp .side{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:0;gap:0;top:calc(var(--toph-v,var(--toph)) / var(--z) + 16px);height:calc(calc(100vh / var(--rz)) / var(--z) - 160px);min-height:420px;max-height:none;overflow:hidden}
@media (max-width:860px){.app.prac .side,.app.chp .side{position:static;height:auto;min-height:0;max-height:none}.app.prac .side ol,.app.chp .side ol{max-height:320px}.app.prac .pl>section,.app.chp .pl>section{order:-1}}
.sd-top{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line)}
.sd-top b{display:block;font-size:17px;line-height:22px;font-weight:800}
.sd-top span{font-size:13px;color:var(--muted)}
.sd-crumb{display:grid;grid-template-columns:30px minmax(0,1fr) 30px;align-items:center;gap:4px;padding:10px 8px;border-bottom:1px solid var(--line);text-align:center}
.sd-path{font-size:12px;line-height:16px;font-weight:800;letter-spacing:.06em;color:var(--acc);text-transform:uppercase}
.sd-title{font-size:15px;line-height:20px;font-weight:800;margin-top:3px;text-wrap:balance}
.sd-arr{width:34px;height:34px;display:grid;place-items:center;border:none;background:none;border-radius:8px;color:var(--muted);cursor:pointer}
.sd-arr svg{width:20px;height:20px}
.sd-arr:hover{background:var(--panel);color:var(--ink)}
.app.prac .side .sp,.app.chp .side .sp{padding:8px 16px;border-bottom:1px solid var(--line)}
.app.prac .side ol,.app.chp .side ol{flex:1;gap:0;padding:0;overflow-y:auto}
.app.prac .side li button,.app.chp .side li button{border:none;border-bottom:1px solid var(--line);border-radius:0;padding:10px 16px;gap:12px;font-size:13.5px;line-height:18px}
.app.prac .side li button:hover,.app.chp .side li button:hover{background:var(--panel)}
.app.prac .side li button[aria-current="true"],.app.chp .side li button[aria-current="true"]{background:var(--acc-w);box-shadow:inset 4px 0 0 var(--acc);border-color:var(--line)}
.app.prac .side li button[aria-current="true"] .rt,.app.chp .side li button[aria-current="true"] .rt{color:var(--acc)}
.app.prac .side .m,.app.chp .side .m{width:20px;height:20px;border-radius:6px}
.side .rt{display:block;font-weight:700}
.side .stt{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.side .stt.ok{color:var(--good)}
.sd-all{margin-top:auto;border:none;border-top:1px solid var(--line);background:var(--panel);padding:10px 16px;font:700 14px var(--font);color:var(--muted);cursor:pointer;text-align:left}
.sd-all:hover{color:var(--ink)}
/* main area: the exercise centred in a tall panel, like Khan */
@media (min-width:1200px){
  .app.prac{height:calc((calc(100vh / var(--rz)) - var(--toph)) / var(--z));padding-top:14px;padding-bottom:0;overflow:hidden}
  .app.prac #view,.app.prac .pl{height:100%}
  .app.prac .pl{align-items:stretch}
  .app.prac .side{height:auto;min-height:0;margin-bottom:14px;position:static}
  .app.prac .pl>section{display:flex;flex-direction:column;min-height:0;height:100%}
  .app.prac .qhead{flex:none;margin-bottom:10px}
  .app.prac .card{flex:1 1 auto;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:26px 36px;margin-bottom:0}
  .app.prac .foot{position:static;flex:none;flex-wrap:nowrap}
  /* long statements that don't fit: statement left, answer right */
  .app.prac .note{display:none}
  .app.prac .card>*{width:100%;max-width:900px}
  .app.prac .qleft{align-items:center;text-align:center}
  .app.prac .qleft>.src{align-self:center}
  .app.prac .qleft .chbar{justify-content:center}
  .app.prac .qleft .hints{width:100%;text-align:left}
  .app.prac .yours{margin-top:16px;padding:18px 26px 20px}
  .app.prac .yours h3{font-size:20px}
  .app.prac .ans.big .f{font-size:22px;flex-wrap:wrap;justify-content:center}
  .app.prac .ans.big .f input{width:260px;height:56px;font-size:22px}
  .app.prac .ans.big .f input.wide{width:440px;max-width:100%}
  .app.prac .btn-check{font-size:18px;padding:14px 44px}
  .app.prac .hints{margin-top:22px}
  .app.prac .hint{font-size:17px;line-height:28px;padding:12px 16px}
  .app.prac .sol .step,.app.prac #selfbox .step,.app.prac #aibox .step,.app.prac #out .step{font-size:18px;line-height:30px}
  .app.prac #selfbox .help,.app.prac #aibox .help{font-size:15px;line-height:24px}
}
.qleft{display:flex;flex-direction:column;min-width:0}
.qleft>.src{align-self:flex-start}
.yours{text-align:center;padding:26px 24px 22px}
.yours h3{font-size:18px;margin-bottom:8px}
.yours .help{margin:0 0 14px}
.ans.big{flex-direction:column;align-items:center;gap:16px;margin-top:10px}
.ans.big .fields{display:flex;gap:20px 28px;flex-wrap:wrap;justify-content:center;align-items:center}
.ans.big .f{font-size:20px;gap:10px;color:var(--ink)}
.ans.big .f input{width:200px;height:56px;font-size:20px;border-radius:12px;padding:0 14px}
.ans.big .f input.wide{width:380px;text-align:left}
.btn-check{font-size:18px;padding:15px 56px;border-radius:12px;min-width:220px}
.ans.big .hint-btn{padding:4px}
.ans.big .btn-ghost{font-size:14px}
@media (max-width:860px){.app.prac .pl,.app.chp .pl{grid-template-columns:1fr}.app.chp{padding-left:16px;padding-right:16px}}
/* below 1000px the links no longer fit beside a centred logo: logo moves next to "Capitole" */
@media (max-width:1500px){.top-in{gap:14px}}
@media (max-width:1100px){.top-in{min-height:88px}}
@media (max-width:1100px){#streak{display:none!important}}
@media (max-width:720px){.brand .bname{display:none}}
@media (max-width:600px){#streak{display:none!important}.top-in{gap:8px;min-height:64px;padding-top:8px;padding-bottom:8px}.brand .bname{display:none}.explore{font-size:15px}.top-r{gap:0}.top .linkbtn{font-size:13px;padding:7px 5px}}
@media (max-width:520px){.app.prac .card{padding:18px}.ans.big .f{flex-wrap:wrap;justify-content:center}.ans.big .f input,.ans.big .f input.wide{width:100%}.btn-check{width:100%}}
.f input.wide{width:280px;max-width:100%;text-align:left;padding:0 12px}
@media (max-width:520px){.f{flex-wrap:wrap}.f input.wide{width:100%}}
.hint{display:flex;gap:12px;align-items:baseline;background:var(--bg);border:1px dashed #b3c4f2;border-radius:10px;padding:10px 12px}
.hint .hn{flex:none;font-size:12px;line-height:18px;font-weight:700;color:var(--acc);background:var(--acc-w);border-radius:999px;padding:1px 8px}
.hint .tx{flex:1;min-width:0}
.hint .pp{flex:none;font-size:12px;line-height:18px;font-weight:700;color:var(--muted);background:var(--panel);border-radius:999px;padding:2px 8px;font-variant-numeric:tabular-nums}

