/* InternFactory Learn · brand kit v1.1 (Plus Jakarta Sans; Ground, Factory Blue, Violet; Node Cyan on dark only).
   Lesson classes (card, callout, dg, check, kicker, notice) match Python Lab so content can move between them. */
:root {
  --ground: #0A1124; --ground2: #141F3D; --gline: #26335C; --onground: #A7B3CC; --cyan: #5CE1F2;
  --blue: #2D5BFF; --violet: #8B3DFF; --grad: linear-gradient(135deg, #2D5BFF, #8B3DFF);
  --bg: #F3F5FA; --panel: #FFFFFF; --ink: #141B2E; --muted: #5A6478; --line: #DCE2EE;
  --brand: #2D5BFF; --brand-soft: #E8EEFF; --brand-text: #2D5BFF;
  --ok: #0E8A5F; --ok-soft: #E3F6EE; --warn: #A35F00; --warn-soft: #FFF3DF; --bad: #C2362B; --bad-soft: #FDE8E6;
  --code-bg: #0A1124; --radius: 14px;
  --font: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0A1124; --panel: #141F3D; --ink: #F3F5FA; --muted: #A7B3CC; --line: #26335C;
  --brand: #6F8CFF; --brand-soft: #1D2B55; --brand-text: #5CE1F2;
  --ok: #5CE1A8; --ok-soft: #12302A; --warn: #F0B04A; --warn-soft: #33270F; --bad: #FF8A80; --bad-soft: #3A1717; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0A1124; --panel: #141F3D; --ink: #F3F5FA; --muted: #A7B3CC; --line: #26335C;
  --brand: #6F8CFF; --brand-soft: #1D2B55; --brand-text: #5CE1F2;
  --ok: #5CE1A8; --ok-soft: #12302A; --warn: #F0B04A; --warn-soft: #33270F; --bad: #FF8A80; --bad-soft: #3A1717; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font: 16px/1.65 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-text); }
code { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; background: var(--brand-soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.1em; }
table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* top bar */
.bar { background: var(--ground); color: #fff; }
.bar-in { max-width: 1040px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bar img { height: 30px; display: block; }
.bar .crumb { color: var(--onground); font-size: 13px; font-weight: 600; }
.bar .crumb b { color: #fff; }
.main { max-width: 1040px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left)) 48px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; font: 700 14.5px var(--font); text-decoration: none; cursor: pointer; border: 1.5px solid var(--line); background: var(--panel); color: var(--ink); }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.onground { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; min-width: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 6px; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--brand-soft); margin-bottom: 16px; font-size: 15px; }
.notice.ok { background: var(--ok-soft); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); white-space: nowrap; }
.pill.grey { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

/* course hero */
.hero { background: var(--ground); color: #fff; border-radius: 20px; padding: 28px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero .kicker { color: var(--cyan); }
.hero p { color: var(--onground); max-width: 62ch; }
.facts { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; color: var(--onground); }
.facts b { display: block; font-size: 22px; color: #fff; letter-spacing: -.02em; }
.mods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mod h3 { margin: 0 0 8px; }
.mod ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.mod li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 15px; }
.mod li a { font-weight: 700; }

/* lesson */
.objectives li { margin: 4px 0; }
.plan td:first-child { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.callout { border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.callout > b:first-child { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 4px; }
.callout p { margin: 4px 0; }
.callout.analogy { border-color: var(--ok); background: var(--ok-soft); } .callout.analogy > b:first-child { color: var(--ok); }
.callout.remember { border-color: var(--warn); background: var(--warn-soft); } .callout.remember > b:first-child { color: var(--warn); }
.callout.predict { border-color: var(--bad); background: var(--bad-soft); } .callout.predict > b:first-child { color: var(--bad); }
details.check { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
details.check summary { cursor: pointer; font-weight: 700; }
details.check summary::before { content: "Check yourself: "; color: var(--brand-text); }
.dg { margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow-x: auto; }
.dg svg { display: block; width: 100%; min-width: 560px; max-width: 760px; height: auto; margin: 0 auto; }
.dg figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
@media (max-width: 600px) { .dg figcaption::after { content: " (swipe sideways to see all)"; } }
.dg text { fill: var(--ink); font: 14px var(--font); }
.dg .tb { font-weight: 700; } .dg .tm { fill: var(--muted); font-size: 12.5px; }
.dg .big { font-size: 30px; font-weight: 800; fill: var(--brand-text); }
.dg .mono { font-family: "JetBrains Mono", monospace; font-size: 14px; } .dg .tok { fill: var(--ok); font-weight: 700; }
.dg .bxb { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 2; }
.dg .bxo { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 2; }
.dg .bxw { fill: var(--warn-soft); stroke: var(--warn); stroke-width: 2; }
.dg .ln { stroke: var(--muted); stroke-width: 2.5; fill: none; } .dg .lnb { stroke: var(--brand); stroke-width: 2.5; fill: none; }
.dg .ah { fill: var(--muted); } .dg .ahb { fill: var(--brand); }
.dg .wat { fill: #5CA8FF; opacity: .55; }
.dg .pipe { stroke: #5CA8FF; stroke-width: 18; fill: none; opacity: .7; } .dg .pipe.thin { stroke-width: 7; }

/* Try it widgets */
.tw { border: 1.5px solid var(--brand); border-radius: var(--radius); padding: 16px; margin: 16px 0 4px; background: var(--panel); min-width: 0; }
.tw-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tw-head b { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; background: var(--grad); color: #fff; padding: 3px 10px; border-radius: 999px; }
.tw-head span { font-weight: 800; }
.tw-hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.tw-ctl { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.tw-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); min-width: 0; }
.tw-f select, .tw-in input { font: 600 15px var(--font); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 44px; }
.tw-in { display: flex; align-items: center; gap: 6px; } .tw-in input { width: 110px; } .tw-in em { font-style: normal; color: var(--ink); }
.tw-chk { flex-direction: row; align-items: center; gap: 8px; align-self: flex-end; min-height: 44px; color: var(--ink); font-size: 14px; }
.tw-chk input { width: 20px; height: 20px; }
.tw-view { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tw-view.tw-one { grid-template-columns: 1fr; }
.tw-sch { background: var(--bg); border-radius: 12px; padding: 8px; overflow: hidden; }
.tw-side { display: grid; gap: 10px; min-width: 0; }
.tw-out { border-radius: 12px; padding: 12px 14px; background: var(--brand-soft); display: grid; gap: 4px; font-size: 14.5px; }
.tw-out > div { display: flex; justify-content: space-between; gap: 10px; }
.tw-out > div span { color: var(--muted); }
.tw-out > div b { font-variant-numeric: tabular-nums; }
.tw-out p { margin: 4px 0 0; }
.tw-out.ok { background: var(--ok-soft); } .tw-out.warn { background: var(--warn-soft); } .tw-out.bad { background: var(--bad-soft); }
.tw-calc { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; display: block !important; }
.tw-obs { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; overflow-x: auto; }
.tw-obs-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tw-tm { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
svg.cw { width: 100%; height: auto; display: block; }
.cw-w { stroke: var(--ink); stroke-width: 2.5; fill: none; stroke-linecap: round; }
.cw-r { fill: #E8D3A8; stroke: #8A6D3B; stroke-width: 2; }
.cw-m { fill: var(--panel); stroke: var(--ink); stroke-width: 2; }
.cw-led { stroke: var(--ink); stroke-width: 2; }
.cw-t { fill: var(--ink); font: 700 14px var(--font); } .cw-tm { fill: var(--muted); font: 12px var(--font); }
.cw-dot { fill: var(--blue); }
svg.cw-g { width: 100%; height: auto; display: block; background: var(--bg); border-radius: 12px; }
.cw-ax { stroke: var(--muted); stroke-width: 1.5; } .cw-line { stroke: var(--violet); stroke-width: 3; } .cw-pt { fill: var(--blue); stroke: #fff; stroke-width: 2; }

/* lab + quiz */
.lab dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; }
.lab dt { font-weight: 700; color: var(--muted); font-size: 14px; }
.lab dd { margin: 0; }
.quiz-q { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.quiz-q h4 { margin: 0 0 10px; font-size: 16px; }
.quiz-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quiz-opts button { text-align: left; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 10px 12px; font: 600 15px var(--font); cursor: pointer; min-height: 46px; }
.quiz-opts button:hover:not([disabled]) { border-color: var(--brand); }
.quiz-opts button.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.quiz-opts button.wrong { border-color: var(--bad); color: var(--bad); }
.quiz-why { margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }
.branch { display: grid; gap: 10px; }
.branch details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.branch summary { cursor: pointer; }
.branch summary b { color: var(--brand-text); }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 36px; }
.foot b { display: block; color: var(--ink); font-size: 15px; }
.lockrow { opacity: .75; }
/* charts, meter (Sessions 2 to 6) */
.cw-grid { stroke: var(--line); stroke-width: 1; } .cw-mark { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; }
.cw-line2 { stroke: var(--blue); stroke-width: 2.2; } .dash { stroke-dasharray: 6 5; }
.cw-pr { stroke: #E5484D; stroke-width: 3; } .cw-prf { fill: #E5484D; } .cw-pb { stroke: var(--ink); stroke-width: 3; } .cw-pbf { fill: var(--ink); }
.cw-meter { fill: #F2C230; stroke: #8A6D1B; stroke-width: 2; } .cw-lcd { fill: #C9D6B8; stroke: #5E6B4E; }
.cw-lcdt { font: 700 22px "JetBrains Mono", monospace; fill: #1D2414; }
/* logic (Sessions 7, 8) */
.lg-row { margin-top: 10px; }
.lg-sw { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 700 14px var(--font); cursor: pointer; }
.lg-sw b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--line); }
.lg-sw.on b { background: var(--blue); color: #fff; }
.lg-lamp { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.lg-lamp i { width: 18px; height: 18px; border-radius: 50%; background: var(--line); border: 2px solid var(--muted); }
.lg-lamp.on i { background: #FF4D4D; border-color: #FF4D4D; box-shadow: 0 0 12px #FF4D4D; }
.lg-g { fill: var(--brand-soft); stroke: var(--ink); stroke-width: 2.5; } .lg-wire { stroke: var(--muted); stroke-width: 3; } .lg-wire.hot { stroke: var(--blue); }
.lg-out { fill: var(--line); stroke: var(--ink); stroke-width: 2; } .lg-out.on { fill: #FF4D4D; }
.lg-tt { width: auto; min-width: 180px; } .lg-tt td, .lg-tt th { text-align: center; font-variant-numeric: tabular-nums; } .lg-tt tr.hi td { background: var(--brand-soft); font-weight: 800; }
.lg-bits { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.lg-bit { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; min-height: 52px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 700 18px "JetBrains Mono", monospace; cursor: pointer; padding: 4px 0; }
.lg-bit span { font: 600 11px var(--font); color: var(--muted); } .lg-bit.on { background: var(--blue); border-color: var(--blue); color: #fff; } .lg-bit.on span { color: #DDE5FF; }
.lg-word { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; } .lg-word > span { width: 70px; font-weight: 700; } .lg-word em { font-style: normal; font-weight: 700; margin-left: 6px; }
.lg-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.lg-fa { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 2px; font-size: 13px; text-align: center; } .lg-fa b { color: var(--brand-text); }
.lg-mux { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; } .lg-col { display: grid; gap: 6px; }
.lg-mi.sel .lg-sw { border-color: var(--blue); box-shadow: 0 0 0 3px var(--brand-soft); }
.lg-box { border: 2.5px solid var(--ink); border-radius: 12px; padding: 18px 22px; font-weight: 800; text-align: center; background: var(--brand-soft); }
.lg-wave { stroke: var(--violet); stroke-width: 2.5; }
.lg-cnt { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; } .lg-7 { width: 90px; height: 150px; }
.lg-7bg { fill: #0A1124; } .sg { fill: #26335C; } .sg.on { fill: #FF4D4D; }
/* code runners (Sessions 9 to 16) */
pre.code { background: var(--code-bg); color: #E8ECF6; border-radius: 12px; padding: 12px 14px; overflow-x: auto; font: 13.5px/1.55 "JetBrains Mono", ui-monospace, monospace; }
pre.code code { background: none; padding: 0; color: inherit; font-size: inherit; }
.cd-ed, .cd-in { width: 100%; display: block; margin-top: 12px; font: 13.5px/1.55 "JetBrains Mono", ui-monospace, monospace; color: #E8ECF6; background: var(--code-bg); border: 1.5px solid var(--gline); border-radius: 12px; padding: 12px 14px; resize: vertical; tab-size: 4; white-space: pre; overflow-x: auto; }
.cd-in { white-space: pre-wrap; }
.cd-lab { margin-top: 10px; }
.cd-bar { margin: 10px 0; } .cd-st { font-size: 13px; }
.cd-out { margin: 0; min-height: 52px; max-height: 340px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font: 13.5px/1.5 "JetBrains Mono", ui-monospace, monospace; white-space: pre-wrap; }
.cd-out.err, .cd-mon pre.err { color: var(--bad); }
.cd-plots svg { margin-top: 10px; }
.cd-mon { border-radius: 12px; background: var(--code-bg); color: #E8ECF6; padding: 10px 12px; }
.cd-mon b { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.cd-mon pre { margin: 6px 0 0; height: 180px; overflow: auto; font: 13px/1.45 "JetBrains Mono", monospace; white-space: pre-wrap; }
.cd-pcb { fill: #1E2A4A; stroke: #0A1124; stroke-width: 2; } .cd-can { fill: #B9C1CF; stroke: #7C8596; } .cd-usb { fill: #9AA3B2; }
.cd-chip { fill: #0A1124; font: 800 14px var(--font); } .cd-pin { fill: #C8D0E0; font: 600 10px var(--font); } .cd-pin.used { fill: #5CE1F2; font-weight: 800; }
.cd-btn { fill: #555E70; stroke: var(--ink); stroke-width: 2; } .cd-btn.down { fill: #2D5BFF; }
.cd-pot { fill: #3C4660; stroke: var(--ink); stroke-width: 2; }
.cd-head { stroke: #E5484D; stroke-width: 2; }
.cd-tim svg { min-width: 520px; }
@media (max-width: 760px) { .lg-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cd-ed { font-size: 13px; } }
@media print { .bar, .btn, .tw-ctl, .notice { display: none !important; } body { background: #fff; } .card { break-inside: avoid; border-color: #ccc; } }
@media (max-width: 760px) {
  .tw-view, .mods { grid-template-columns: 1fr; }
  .lab dl { grid-template-columns: 1fr; gap: 2px; } .lab dd { margin-bottom: 8px; }
  .quiz-opts { grid-template-columns: 1fr; }
  .card { padding: 16px; } .hero { padding: 22px; }
  .tw-in input { width: 90px; }
  table { display: block; overflow-x: auto; font-size: 14px; } th, td { padding: 7px 8px; }
}

/* ================= portal (sign-in, dashboards, faculty, admin) — layout from Python Lab ================= */
.hidden { display: none !important; }
.prewrap { white-space: pre-wrap; }
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ground); color: #fff; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: grid; gap: 10px; margin: 2px 6px 14px; }
.side-logo { height: 26px; width: auto; display: block; }
.brand-t { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.brand-t small { display: block; font-weight: 600; color: var(--onground); font-size: 12px; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: #E6EBF5; font-weight: 600; font-size: 14px; text-decoration: none; }
.nav a:hover { background: var(--ground2); }
.nav a.active { background: var(--grad); color: #fff; }
.nav .grp { margin: 16px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.nav .lock { margin-left: auto; font-size: 12px; opacity: .6; }
.nav .tick { margin-left: auto; color: #5CE1A8; font-size: 12px; }
.nav a.active .tick { color: inherit; }
.userbox { margin-top: 20px; padding: 14px 6px 0; border-top: 1px solid var(--gline); font-size: 13px; }
.userbox .dim { color: var(--onground); }
.userbox a { color: var(--cyan); }
.pmain { padding: 26px 34px 60px; max-width: 1120px; width: 100%; min-width: 0; }
.topbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 22% 0 0; z-index: 30; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ground); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
  .pmain { padding: 18px 16px 50px; }
}
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: 1fr 1fr; } .g2 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .g3, .g4 { grid-template-columns: 1fr; } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 13px; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.cur { border-color: var(--brand); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pbar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pbar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
:where(.auth, #content) label:not(.tw *):not(.opt) { display: block; font-weight: 700; font-size: 13px; margin: 10px 0 4px; }
:where(.auth, #content) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea):not(.tw *) {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: 500 15px var(--font); }
:where(.auth, #content) :is(input, select, textarea):not(.tw *):focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
input[type=checkbox]:not(.tw *) { width: 20px; height: 20px; }
.tablewrap { overflow-x: auto; max-width: 100%; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-bottom: 2.5px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none; }
.tabs a.active { color: var(--brand-text); border-color: var(--brand); }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ground); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 99; box-shadow: 0 8px 30px rgba(0,0,0,.25); max-width: 90vw; font-weight: 600; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.daycard { display: block; color: inherit; text-decoration: none; margin: 0; }
.daycard:hover { border-color: var(--brand); }
.daycard.locked { opacity: .6; }
.branch details.mine { border-color: var(--brand); background: var(--brand-soft); }
/* quiz (server-checked) */
.q { padding: 14px 0; border-bottom: 1px solid var(--line); }
.q:last-of-type { border-bottom: 0; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; margin: 6px 0; cursor: pointer; font-size: 15px; }
.opt input { width: auto; margin-top: 4px; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.explain { margin-top: 6px; font-size: 14px; }
/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ground); }
.auth .card { width: 100%; max-width: 440px; }
.auth.stack { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.auth-top { display: flex; align-items: center; gap: 14px; color: #fff; width: 100%; max-width: 440px; flex-wrap: wrap; }
.auth-top img { height: 28px; }
.auth-top b { display: block; font-size: 17px; } .auth-top small { color: var(--onground); font-size: 12.5px; }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.roles button { min-height: 44px; border: 1.5px solid var(--line); background: var(--panel); border-radius: 10px; cursor: pointer; font: 700 14px var(--font); color: var(--ink); }
.roles button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.auth .powered-sm, .auth .powered-sm a { color: var(--onground); }
/* record print */
.record-page { background: #fff; color: #111; padding: 28px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }
.record-page pre { background: #f4f4f4; color: #111; padding: 10px; border-radius: 4px; white-space: pre-wrap; font-size: 12px; }
.record-page th { color: #555; }
.record-page h3 { margin-top: .8em; }
@media print {
  .side, .topbar, .noprint, #toast, .bar { display: none !important; }
  .shell { display: block; }
  .pmain { padding: 0; max-width: none; }
  body, :root { background: #fff; }
  .record-page { border: 0; page-break-after: always; padding: 0; }
}
/* footer */
.if-logo { height: 18px; width: auto; display: block; }
.powered-sm { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; justify-content: center; }
.powered-sm .if-logo { height: 16px; }
.if-foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.if-foot a { color: var(--muted); }
@media (max-width: 520px) { .if-foot { gap: 6px; } .if-foot span { flex-basis: 100%; } }
/* class pulse */
.pulse { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pulse .pbtn.on[data-st="done"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.pulse .pbtn.on[data-st="help"] { background: var(--bad); border-color: var(--bad); color: #fff; }
.pulse .pmsg { font-size: 13px; }
.pulse-row .sbar { display: flex; height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 8px; }
.pulse-row .sbar i { display: block; height: 100%; }
.pulse-row .sbar i.d { background: var(--ok); } .pulse-row .sbar i.h { background: var(--bad); }
.pnums { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.pnums b { color: var(--ink); font-size: 16px; } .pnums .hl b { color: var(--bad); }
.phelp { margin-top: 8px; color: var(--bad); font-size: 14px; }
.pnone { margin-top: 6px; font-size: 13px; color: var(--muted); } .pnone summary { cursor: pointer; }
#main, #content { min-width: 0; }
#content select { max-width: 100%; min-width: 0; }
#content .row:has(> select) { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.nowrap { white-space: nowrap; }
details.rnot { margin: 4px 0 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bad-soft); }
details.rnot summary { cursor: pointer; }
pre.out { background: var(--bg); border: 1px dashed var(--line); padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; font: 13px/1.5 "JetBrains Mono", monospace; margin: 4px 0 10px; }
.trycta { border: 1.5px solid var(--brand); }
.trylist li { margin: 4px 0; }
/* ---------- certificate (A4 landscape, InternFactory brand) ---------- */
.ifcert-wrap { position: relative; width: 100%; max-width: 297mm; aspect-ratio: 297 / 210; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ifcert { position: absolute; left: 0; top: 0; width: 297mm; height: 210mm; overflow: hidden; transform: scale(var(--s, 1)); transform-origin: 0 0;
  background: #fff; color: #141B2E; font-family: "Plus Jakarta Sans", Arial, sans-serif; line-height: 1.3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ifcert * { box-sizing: border-box; }
.ifcert .c-pat { position: absolute; inset: 0; background: url(/assets/brand/cert-pattern.svg) 0 0 / 100% 100% no-repeat; }
.ifcert .c-f1 { position: absolute; inset: 7mm; border: .5mm solid #0A1124; border-radius: 1mm; }
.ifcert .c-f2 { position: absolute; inset: 9mm; border: .25mm solid #2D5BFF; opacity: .6; }
.ifcert .c-tag { position: absolute; right: 20mm; top: 16mm; text-align: right; font-size: 7.5pt; color: #5A6478; line-height: 1.6; }
.ifcert .c-tag b { color: #2D5BFF; letter-spacing: .2em; font-weight: 700; }
.ifcert .c-hdr { position: absolute; top: 17mm; left: 0; right: 0; display: flex; justify-content: center; }
.ifcert .c-hdr img { height: 10mm; width: auto; }
.ifcert .c-mid { position: absolute; left: 24mm; right: 24mm; top: 37mm; text-align: center; }
.ifcert .c-k { font-size: 14pt; color: #0A1124; letter-spacing: .34em; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6mm; }
.ifcert .c-k:before, .ifcert .c-k:after { content: ""; width: 34mm; height: .35mm; background: linear-gradient(90deg, transparent, #2D5BFF); }
.ifcert .c-k:after { background: linear-gradient(90deg, #8B3DFF, transparent); }
.ifcert .c-h1 { font-weight: 800; font-size: 46pt; letter-spacing: -.035em; line-height: 1.05; margin-top: 2mm; color: #0A1124; }
.ifcert .c-sub { font-size: 9pt; color: #2D5BFF; letter-spacing: .3em; text-transform: uppercase; font-weight: 700; margin-top: 1.5mm; }
.ifcert .c-pre { font-size: 10.5pt; color: #5A6478; margin-top: 7mm; }
.ifcert .c-rbw { position: relative; width: 170mm; height: 19mm; margin: 2.5mm auto 0; }
.ifcert .c-rb { position: absolute; inset: 0; width: 100%; height: 100%; }
.ifcert .c-nm { position: absolute; inset: 0 14mm; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 28pt; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; }
.ifcert .c-meta { font-size: 10pt; color: #5A6478; margin-top: 4mm; }
.ifcert .c-txt { font-size: 12.5pt; line-height: 1.6; margin: 4mm auto 0; max-width: 200mm; }
.ifcert .c-txt b { font-weight: 800; color: #0A1124; }
.ifcert .c-foot { position: absolute; left: 24mm; right: 44mm; bottom: 28mm; display: flex; align-items: flex-end; justify-content: space-between; }
.ifcert .c-seal { position: relative; width: 38mm; height: 52mm; }
.ifcert .c-s { position: absolute; left: 0; top: 0; width: 38mm; height: 38mm; }
.ifcert .c-s svg { width: 100%; height: 100%; display: block; }
.ifcert .c-s img { position: absolute; left: 50%; top: 50%; width: 15mm; height: 15mm; transform: translate(-50%, -50%); }
.ifcert .c-tails { position: absolute; left: 7mm; top: 30mm; width: 24mm; height: 21mm; }
.ifcert .c-sgs { display: flex; gap: 16mm; margin-bottom: 1mm; }
.ifcert .c-sg { width: 62mm; text-align: center; color: #141B2E; }
.ifcert .c-sgimg { height: 15mm; display: flex; align-items: flex-end; justify-content: center; }
.ifcert .c-sgimg img { max-height: 15mm; max-width: 56mm; width: auto; mix-blend-mode: multiply; }
.ifcert .c-sl { border-top: 1px solid #141B2E; opacity: .45; margin: 0 4mm; }
.ifcert .c-sn { font-weight: 700; font-size: 10.5pt; margin-top: 2mm; min-height: 4.5mm; }
.ifcert .c-sr { font-size: 8pt; color: #5A6478; margin-top: .6mm; }
.ifcert .c-l2 { position: absolute; left: 0; right: 0; bottom: 17.5mm; text-align: center; font-size: 7pt; color: #5A6478; font-weight: 700; letter-spacing: .2em; }
.ifcert .c-l2 b { color: #0A1124; font-weight: 800; font-size: 8pt; letter-spacing: 0; }
.ifcert .c-l3 { position: absolute; left: 0; right: 0; bottom: 12.5mm; text-align: center; font-size: 7pt; color: #5A6478; display: flex; justify-content: center; gap: 4mm; }
.ifcert .c-l3 b { color: #141B2E; font-weight: 700; }
.certform .sigprev { height: 48px; max-width: 220px; border: 1px dashed var(--line); border-radius: 6px; background: #fff; padding: 2px; display: block; margin-top: 6px; }
@media print {
  .ifcert-wrap { width: 297mm; height: 210mm; max-width: none; aspect-ratio: auto; border: 0; border-radius: 0; break-inside: avoid; }
  .ifcert { transform: none !important; }
  #content:has(.ifcert-wrap) { padding: 0; margin: 0; }
}

