/* QCube: a flat, high-contrast tool UI. The gadget is always a dark device surface; everything else follows light / dark. */
:root {
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bg: #f4f4f4; --panel: #ffffff; --panel-2: #f0f0f2; --line: #d8d8dc; --text: #161616; --dim: #4d4d55; --hover: #e6e6ea;
  --accent: #0f62fe; --on-accent: #ffffff; --ok: #198038; --okbg: #d9f2e0; --bad: #da1e28; --glow: #f1c21b;
  --sheet: #ffffff; --ink: #161616; --wire: #8d8d95; --bar: #0f62fe;
}
:root[data-mode="dark"] {
  --bg: #121214; --panel: #1e1e22; --panel-2: #29292e; --line: #3a3a41; --text: #f4f4f6; --dim: #bcbcc6; --hover: #34343a;
  --accent: #78a9ff; --on-accent: #0b0b0c; --ok: #6fdc8c; --okbg: #1d4a2b; --bad: #ff8389; --bar: #78a9ff;
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h2, h3, p { margin: 0; }
h3 { font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
code { font-family: var(--mono); }
a { color: var(--accent); }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar-l { display: flex; align-items: baseline; gap: 8px; } .bar-r { justify-self: end; }
.back { color: var(--dim); text-decoration: none; font-size: 14px; } .back:hover { color: var(--text); text-decoration: underline; }
.sep { color: var(--line); } .brand { font: 600 17px var(--sans); letter-spacing: -.01em; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 6px 22px; border-radius: 6px; font-weight: 600; color: var(--dim); }
.seg button.on, .seg button.on:hover:not(:disabled) { background: var(--text); color: var(--bg); }

button { font: 500 13px var(--sans); cursor: pointer; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; transition: background .12s, border-color .12s; }
button:hover:not(:disabled) { background: var(--hover); } button:disabled { opacity: .4; cursor: default; }
button.ghost { background: none; } button.mini { padding: 2px 10px; font-size: 12px; }
button.solid { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; } button.solid:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
input, select, textarea { font: 13px var(--mono); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.bad { color: var(--bad); font-size: 12px; } .hint { color: var(--dim); font-size: 13px; margin: 4px 0 10px; }

/* layout */
.app { display: grid; grid-template-columns: minmax(300px, 350px) minmax(0, 1fr) minmax(310px, 350px); gap: 16px; max-width: 1560px; margin: 0 auto; padding: 16px 20px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.phead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
#toast { font: 12px var(--mono); color: var(--dim); }
footer.foot { max-width: 1560px; margin: 0 auto; padding: 4px 20px 30px; color: var(--dim); font-size: 13px; }
@media (max-width: 1180px) { .app { grid-template-columns: minmax(0, 1fr) 340px; } .left { grid-column: 1 / -1; } }
@media (max-width: 800px) { .app { grid-template-columns: 1fr; padding: 12px; } .bar { grid-template-columns: 1fr auto; } .bar-r { display: block; } }

/* lessons */
.lhead { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.menu { display: flex; align-items: center; gap: 10px; flex: 1; text-align: left; padding: 8px 12px; background: var(--panel); }
.menu span { font: 500 12px var(--mono); color: var(--dim); } .menu b { flex: 1; font-weight: 600; font-size: 14px; } .menu i { font-style: normal; color: var(--dim); }
.prog { width: 54px; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); } .prog i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .4s; }
.lmenu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); padding: 6px; }
.lmenu[hidden] { display: none; }
.lg { font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding: 8px 8px 2px; }
.lmenu button { display: flex; justify-content: space-between; width: 100%; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 5px; }
.lmenu button.on { background: var(--panel-2); font-weight: 600; } .lmenu button i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line); align-self: center; }
.lmenu button.done i { background: var(--ok); border-color: var(--ok); }
.ltabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.ltabs button, .utabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 12px; color: var(--dim); font-weight: 600; }
.ltabs button.on, .utabs button.on, .ltabs button.on:hover:not(:disabled), .utabs button.on:hover:not(:disabled) { color: var(--text); border-bottom-color: var(--accent); }
.stepcard { transition: border-color .3s; }
.stepcard h2 { font: 600 20px/1.25 var(--sans); letter-spacing: -.01em; }
.goal { margin-top: 4px; font-size: 15px; }
.why { margin-top: 10px; color: var(--dim); font-size: 14px; } .use { margin-top: 6px; font-size: 13px; color: var(--text); border-left: 3px solid var(--accent); padding-left: 10px; } .use[hidden] { display: none; }
.track { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; }
.track li { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); background: var(--panel-2); color: var(--dim); transition: all .25s; }
.track li code { font-size: 11px; opacity: .75; }
.track li.cur { background: var(--panel); color: var(--text); border: 2px solid var(--text); font-weight: 600; padding: 3px 10px; }
.track li.done { background: var(--okbg); color: var(--ok); border-color: var(--ok); font-weight: 500; }
.track li.bad { background: var(--bad); color: #fff; border-color: var(--bad); animation: wrongshake .5s; }
.stepcard.done { box-shadow: 0 0 0 0; } .stepcard.shake { animation: wrongshake .45s; }
.stepnav { display: flex; gap: 8px; margin-top: 14px; } .stepnav .solid.go { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok); border-color: var(--ok); color: #fff; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok) 12%, transparent); } }
@keyframes wrongshake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.watch { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.whead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; } .whead .mini { margin-left: auto; }
.speed { font: 600 11px var(--mono); color: var(--accent); }
.cap { min-height: 22px; margin: 8px 0 4px; font-size: 13px; color: var(--text); text-align: center; }
.chips2 { display: flex; justify-content: center; gap: 4px; } .chips2 .chip { font: 500 11px var(--mono); padding: 2px 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); }

/* control map (pop-up): black and white */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; } .modal[hidden] { display: none; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(1040px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.shead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .shead h2 { font: 600 20px var(--sans); }
.mapgrid { display: grid; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; } @media (max-width: 800px) { .mapgrid { grid-template-columns: 1fr; } }
.mm { width: 100%; height: auto; }
.mm .shell { fill: var(--panel-2); stroke: var(--wire); stroke-width: 2; } .mm .cut { fill: none; stroke: var(--wire); stroke-width: 1.5; }
.mm .rg { fill: var(--text); fill-opacity: .07; stroke: none; transition: fill-opacity .15s; }
.mm .rg-r { fill-opacity: .14; } .mm .rg-w { fill-opacity: .22; } .mm .rg-m { fill-opacity: .85; }
.mm .lead path { fill: none; stroke: var(--wire); stroke-width: 1.5; stroke-dasharray: 3 3; }
.mm text { fill: var(--dim); font: 400 12px var(--sans); } .mm .lab .t1 { fill: var(--text); font-weight: 600; font-size: 14px; }
.mm[data-hot="l"] .rg-l, .mm[data-hot="r"] .rg-r { fill-opacity: .5; } .mm[data-hot="w"] .rg-w { fill-opacity: .6; } .mm[data-hot="m"] .rg-m { fill-opacity: 1; stroke: var(--text); stroke-width: 2; }
.mt { width: 100%; border-collapse: collapse; font-size: 13px; }
.mt tr { border-top: 1px solid var(--line); } .mt tr:hover { background: var(--panel-2); }
.mt th { text-align: left; font: 600 12px var(--mono); padding: 6px 8px 6px 4px; white-space: nowrap; width: 1%; } .mt td { padding: 6px 4px; } .mt td.sh { width: 1%; text-align: right; }
.in { display: inline-block; font: 600 10px var(--sans); letter-spacing: .03em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; margin-right: 8px; border: 1px solid var(--text); color: var(--text); }
.in.c-l { background: var(--text); color: var(--bg); } .in.c-r { background: none; } .in.c-w { border-style: dashed; } .in.c-m { background: var(--panel-2); border-width: 2px; }
.recipes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .rec { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 8px 10px; font-weight: 500; } .rec i { font-style: normal; color: var(--accent); font-weight: 700; }

/* composer */
.palette { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }
.palette .grp { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.palette .gl { font: 600 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin-right: 3px; }
.palette button { font: 600 12px var(--mono); padding: 3px 8px; } .palette button.on, .palette button.on:hover:not(:disabled) { background: var(--text); color: var(--bg); border-color: var(--text); }
.palette input { width: 54px; padding: 3px 6px; }
#comp { overflow-x: auto; padding: 6px 4px; background: var(--sheet); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }
table.c { border-collapse: collapse; font: 11px var(--mono); width: 100%; }
table.c td, table.c th { border: 0; min-width: 44px; height: 46px; text-align: center; padding: 0; color: #6f6f78; position: relative; }
table.c th { font-weight: 600; color: var(--ink); text-align: right; padding: 0 10px 0 8px; background: none; }
table.c th.sel { color: var(--accent); }
table.c td::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid var(--wire); z-index: 0; }
table.c tr.cl td::before { border-top: 3px double var(--wire); } table.c tr.cl th { color: #6f6f78; font-weight: 400; } table.c tr.cl td, table.c tr.cl th { height: 28px; }
table.c td.slot { cursor: pointer; } table.c td.slot:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
td .g { position: relative; z-index: 2; display: block; width: 36px; height: 32px; line-height: 30px; margin: 7px auto; border: 1px solid #161616; border-radius: 4px; color: #161616; font-weight: 600; font-size: 12px; cursor: pointer; }
td .v { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid #8a3ffc; z-index: 1; margin-left: -1px; }
td .dot { position: relative; z-index: 2; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #8a3ffc; margin-top: 17px; cursor: pointer; }
td.pend { outline: 2px dashed var(--accent); outline-offset: -4px; }
.g.ghost, .dot.ghost, .v.ghost { pointer-events: none; }
td .g.ghost { background: transparent !important; border: 1.5px dashed #a0a0a8; color: #8a8a93; cursor: default; }
td .dot.ghost { background: transparent; border: 1.5px dashed #a0a0a8; } td .v.ghost { border-left: 2px dashed #b4b4bb; }
td .g.ghost.ok, td .g.ok { background: #6fdc8c !important; border: 1px solid #0e6027; color: #04290f; animation: fillin .45s ease-out; }
td .dot.ok, td .dot.ghost.ok { background: #24a148; border: 0; animation: fillin .45s ease-out; } td .v.ok, td .v.ghost.ok { border-left: 2px solid #24a148; }
@keyframes fillin { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
td .g.caret { background: transparent !important; border: 1.5px dashed var(--accent); pointer-events: none; animation: caret 1.1s steps(2) infinite; }
@keyframes caret { 50% { opacity: .15; } }
td .g.bad { background: #da1e28 !important; color: #fff; border-color: #750e13; animation: wrongshake .5s; pointer-events: none; }

/* probabilities and code, under the composer */
.under { margin-top: 12px; border-top: 1px solid var(--line); }
.utabs { display: flex; gap: 2px; }
#hist { display: flex; gap: 8px; align-items: flex-end; height: 128px; padding: 6px 4px 0; }
.hc { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.hb { width: 100%; flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--text); } .hb i { display: block; width: 100%; background: var(--bar); border-radius: 3px 3px 0 0; min-height: 1px; transition: height .4s; }
.hv { font: 11px var(--mono); color: var(--text); min-height: 15px; } .hl { font: 11px var(--mono); color: var(--dim); margin-top: 3px; }
#qasm { width: 100%; height: 128px; resize: vertical; }

/* the gadget: a dark device surface */
.gd { --g-bg: #1b1b1f; --g-2: #26262c; --g-line: #3a3a42; --g-text: #f4f4f6; --g-dim: #b4b4be; background: var(--g-bg); color: var(--g-text); border: 1px solid #0a0a0b; border-radius: 22px; padding: 12px; display: grid; gap: 10px; }
.gd button { background: var(--g-2); color: var(--g-text); border-color: var(--g-line); }
.gd button:hover:not(:disabled) { background: #34343c; }
.gd-dongle { display: grid; grid-template-columns: 32px 1fr 32px; gap: 6px; align-items: stretch; }
.gd .fl { padding: 0; font-size: 11px; } .reg { display: flex; gap: 4px; }
.gd .rq { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 3px 2px; line-height: 1.2; }
.gd .rq b { font: 600 12px var(--mono); } .gd .rq em { font: 400 10px var(--mono); font-style: normal; color: var(--g-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd .rq.sel { background: #f4f4f6; color: #161616; border-color: #f4f4f6; } .gd .rq.sel em { color: #4d4d55; } .gd .rq.fog { opacity: .7; }
.gd-stage { display: flex; align-items: center; justify-content: space-around; gap: 6px; background: var(--g-2); border-radius: 16px; padding: 6px; }
.side { text-align: center; } .bl { width: 96px; height: 96px; display: block; }
.sst { font: 12px var(--mono); color: var(--g-dim); display: grid; } .sst b { color: var(--g-text); }
.gd.fog .face { opacity: .34; }
.gd-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gd .key { position: relative; padding: 9px 0; font: 600 14px var(--mono); border-radius: 10px; }
.gd .key i { position: absolute; right: 5px; top: 2px; font: 500 9px var(--mono); font-style: normal; color: var(--g-dim); }
.gd .key.k-m { font-size: 11px; }
.gd-opts { display: grid; gap: 6px; }
.orow { display: flex; align-items: center; gap: 8px; } .ol { font: 500 11px var(--sans); color: var(--g-dim); width: 64px; flex: none; }
.segs { display: flex; flex: 1; border: 1px solid var(--g-line); border-radius: 8px; overflow: hidden; } .segs button { flex: 1; border: 0; border-radius: 0; padding: 5px 4px; font: 600 12px var(--mono); background: transparent; }
.segs button + button { border-left: 1px solid var(--g-line); } .gd .segs button.on { background: #f4f4f6; color: #161616; }
.gd-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .gd-foot button { padding: 8px; font-weight: 600; }
.gd .clear:hover:not(:disabled) { background: #5b1a1e; border-color: #da1e28; }
.gd.compact .gd-foot { display: none; } .gd.compact { padding: 10px; gap: 8px; border-radius: 18px; } .gd.compact .bl { width: 78px; height: 78px; } .gd.compact .key { padding: 6px 0; }
.gd.ro { pointer-events: none; }
.gd.shake { animation: devshake .6s; } @keyframes devshake { 10%, 50%, 90% { transform: translate(-5px, 2px) rotate(-1.5deg); } 30%, 70% { transform: translate(5px, -2px) rotate(1.5deg); } }
.gd .call { animation: callbtn 1s ease-in-out infinite; } .gd .hit.call { animation: callface 1s ease-in-out infinite; }
.gd .call.rc::after { content: "right-click"; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%); z-index: 6; background: var(--glow); color: #161616; font: 600 9px var(--sans); padding: 1px 5px; border-radius: 3px; white-space: nowrap; pointer-events: none; }
.gd .press { background: #f4f4f6 !important; color: #161616 !important; box-shadow: 0 0 0 4px rgba(241, 194, 27, .7); transform: scale(.94); transition: all .15s; }
.gd .hit.press { background: rgba(241, 194, 27, .6) !important; box-shadow: none; transform: none; }
@keyframes callbtn { 50% { box-shadow: 0 0 0 4px rgba(241, 194, 27, .9); } }
@keyframes callface { 50% { background: rgba(241, 194, 27, .55); } }
.gd.slow .die-body { transition: transform 1.7s cubic-bezier(.3, 1.2, .5, 1), opacity .4s; }
.gd .key.call, .gd .fl.call, .gd .rq.call, .gd .segs button.call, .gd .pt.call { position: relative; }

/* the die */
.die { --s: 84px; width: calc(var(--s) * 1.55); height: calc(var(--s) * 1.5); perspective: 700px; display: grid; place-items: center; }
.die-view { position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; transform: rotateX(-24deg) rotateY(-32deg); }
.die-body { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.35, .5, 1), opacity .4s; }
.face { position: absolute; inset: 0; display: grid; place-items: center; font: 600 calc(var(--s) * .28)/1 var(--mono); color: #fff; border: 2px solid #050506; border-radius: calc(var(--s) * .12); backface-visibility: hidden; pointer-events: none; transition: opacity .4s; }
.f-xp { background: #e5483d; } .f-xn { background: #8f2a24; } .f-yp { background: #2fae74; } .f-yn { background: #1c6e4a; } .f-zp { background: #3f7df0; } .f-zn { background: #254b94; }
.hit { position: absolute; inset: 0; border-radius: calc(var(--s) * .12); cursor: pointer; backface-visibility: hidden; }
.hit:hover { background: rgba(255, 255, 255, .24); }

/* device */
.dev { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; } .dev summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.devstatus { font: 500 11px var(--mono); color: var(--dim); margin-left: 6px; } .devstatus.live { color: var(--ok); }
.evlog { list-style: none; margin: 8px 0 0; padding: 0; min-height: 106px; }
.evlog li { display: grid; grid-template-columns: 66px 1fr auto; gap: 8px; align-items: baseline; padding: 3px 8px; border-radius: 6px; font-size: 12px; }
.evlog li:first-child { background: var(--panel-2); } .evlog code { font-weight: 600; font-size: 12px; } .evlog i { font: 500 10px var(--mono); font-style: normal; color: var(--dim); }
.evlog li.device code { color: var(--ok); } .evlog li.bad { opacity: .7; } .evlog li.bad code { color: var(--bad); text-decoration: line-through; }

/* one screen: panels share the viewport height and scroll inside themselves, never the page */
@media (min-width: 801px) {
  body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
  .app { flex: 1; min-height: 0; width: 100%; align-items: stretch; padding-top: 12px; padding-bottom: 12px; grid-template-rows: minmax(0, 1fr); }
  .panel { overflow: auto; padding: 14px; }
  footer.foot { display: none; }
  .watch { margin-top: 10px; padding-top: 8px; } .stepcard h2 { font-size: 18px; } .why { margin-top: 6px; font-size: 13px; } .track { margin-top: 8px; } .stepnav { margin-top: 10px; }
  .left .gd.compact { padding: 8px; gap: 6px; } .left .gd.compact .die { --s: 66px !important; } .left .gd.compact .bl { width: 62px; height: 62px; }
  .left .gd.compact .gd-stage { padding: 2px 6px; } .left .gd.compact .key { padding: 4px 0; font-size: 12px; } .left .gd.compact .gd-opts { gap: 3px; } .left .gd.compact .segs button { padding: 3px; font-size: 11px; }
  .left .cap { min-height: 0; margin: 4px 0 2px; } .left .chips2 { display: none; }
  .gd { gap: 8px; padding: 10px; } .gd .key { padding: 7px 0; } .gd-stage .die { --s: 92px !important; }
  .dev { margin-top: 8px; padding-top: 8px; } .evlog { min-height: 0; }
  #hist { height: 104px; } #qasm { height: 104px; }
}
@media (min-width: 801px) and (max-height: 820px) {
  .why { display: none; } .gd-stage .die { --s: 76px !important; } .gd .bl { width: 80px; height: 80px; } .left .gd.compact .die { --s: 56px !important; } .left .gd.compact .bl { width: 52px; height: 52px; }
  .phead { margin-bottom: 4px; } #comp td, #comp th { height: 40px; }
}

/* course */
.lhead .menu + button { padding: 6px 9px; } .lhead #cPrev, .lhead #cNext { flex: none; }
.article { font-size: 14px; line-height: 1.55; }
.article .lvl { font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); } .article .lvl.ok { color: var(--ok); }
.article h2 { font: 600 21px/1.25 var(--sans); letter-spacing: -.01em; margin: 2px 0 8px; }
.prose p { margin: 0 0 9px; } .prose ul { margin: 0 0 10px; padding-left: 18px; } .prose li { margin-bottom: 5px; } .prose code { background: var(--panel-2); padding: 0 4px; border-radius: 3px; font-size: 12px; }
.show { border: 0; background: none; color: var(--accent); padding: 0 2px; font: 600 12px var(--sans); text-decoration: underline; text-underline-offset: 2px; } .show:hover:not(:disabled) { background: none; filter: brightness(1.2); }
.try, .quiz { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 12px; background: var(--panel-2); }
.try h4, .quiz h4 { margin: 0 0 6px; font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.try ul { list-style: none; margin: 0; padding: 0; } .task { display: flex; gap: 9px; align-items: flex-start; padding: 3px 0; }
.task i { flex: none; width: 15px; height: 15px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--wire); transition: all .25s; }
.task.done i { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--panel-2); } .task.done span { color: var(--ok); }
.quiz p { margin: 0 0 6px; } .quiz button { display: block; width: 100%; text-align: left; margin-bottom: 5px; background: var(--panel); }
.quiz button.good { background: var(--okbg); border-color: var(--ok); color: var(--ok); } .quiz button.bad { border-color: var(--bad); color: var(--bad); } .qwhy { font-size: 13px; color: var(--dim); margin: 6px 0 0 !important; }
@media (min-width: 1181px) { body[data-lab="course"] .app { grid-template-columns: minmax(400px, 470px) minmax(0, 1fr) minmax(310px, 350px); } }
.gd button.show { color: inherit; }

/* quiz */
.qscore { display: flex; gap: 14px; font: 500 12px var(--mono); color: var(--dim); margin-bottom: 10px; } .qscore b { color: var(--text); }
.qcard { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--panel-2); transition: border-color .3s; } .qcard.solved { border-color: var(--ok); background: var(--okbg); }
.qcard .lvl { font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.qcard h2 { font: 600 19px/1.3 var(--sans); margin: 4px 0 8px; } .qwhy2 { margin: 8px 0 0; font-size: 14px; } .qhint { margin: 8px 0 0; font-size: 13px; color: var(--dim); }
.qsteps { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; } .qsteps span { font: 500 12px var(--mono); padding: 2px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.qbtns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; } .qbtns [hidden] { display: none; }
@media (max-width: 800px) { .seg button { padding: 6px 9px; font-size: 13px; } .bar { padding: 8px 10px; gap: 6px; } .bar-l .back, .bar-l .sep { display: none; } .bar-r { display: flex; } .bar-r .ghost { padding: 5px 7px; font-size: 12px; } #mode { display: none; } }
.prose h3 { font: 600 14px var(--sans); margin: 16px 0 5px; letter-spacing: -.005em; } .prose h3:first-child { margin-top: 4px; } .prose ol { margin: 0 0 10px; padding-left: 20px; }
.prose p code { font-size: 11.5px; word-break: break-word; }
.prose h3 { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 15px; }
