:root {
  --paper: #f3f6f6;
  --card: #fff;
  --ink: #192e35;
  --quiet: #536870;
  --deep: #163d46;
  --line: #cad6d6;
  --accent: #126559;
  --light: #e7f3ee;
  --gold: #d7ab6c;
  --error: #92392a;
  font-family: "Source Sans 3","Segoe UI",Arial,sans-serif;
  color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.48; }
.shell { max-width: 1270px; margin: 0 auto; padding-inline: clamp(16px,3.7vw,56px); }
.site-header { background: var(--deep); color: white; }
.header-row,.brand,.account,.actions,.panel-head,.page-intro,.tabs,.selector { display: flex; align-items: center; }
.header-row { min-height: 72px; justify-content: space-between; gap: 12px; }
.brand { color: white; text-decoration: none; gap: 14px; font-size: 1rem; font-weight: 650; line-height: 1.2; }
.brand-mark { position: relative; width: 44px; height: 26px; flex: none; }
.brand-mark::before,.brand-mark::after { content: ""; position: absolute; width: 19px; height: 19px; border: 2px solid #d0e4dd; border-radius: 50%; top: 2px; left: 6px; }
.brand-mark::after { left: 21px; border-color: var(--gold); }
.brand-mark i { position: absolute; top: 13px; left: 0; width: 8px; border-top: 2px solid #d0e4dd; }
.account { gap: 12px; font-size: .9rem; color: #d9e8e7; }
.skip { position: absolute; top: -100px; left: 15px; z-index:10; padding: 12px; background:white; color:var(--deep); }
.skip:focus { top: 8px; }
a { color: var(--accent); }
button,.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; cursor: pointer; border: 1px solid #9db2b1; border-radius: 7px; padding: 9px 16px; background: #fff; color: var(--deep); font: inherit; font-size: .94rem; line-height: 1.25; text-decoration: none; font-weight: 650; }
button:hover,.button:hover { background: #eaf3f1; }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: #0a5248; }
.quiet { min-height: 35px; color: #f2f7f5; background: transparent; border-color: #628287; padding: 6px 12px; }
.quiet:hover { background: #29545e; }
:focus-visible { outline: 3px solid #bf7721; outline-offset: 3px; }
h1,h2,h3,p,figure { margin: 0; }
h1,h2,h3 { letter-spacing: -.035em; line-height: 1.13; }
h1 { font-size: clamp(2.05rem,4.4vw,3.75rem); font-weight: 650; }
h2 { font-size: clamp(1.45rem,2.4vw,2rem); font-weight: 650; }
h3 { font-size: 1.2rem; }
.eyebrow { font-size: .86rem; font-weight: 680; letter-spacing: .035em; color: var(--accent); margin: 0 0 9px; }
.eyebrow span { margin: 0 3px; }
.help,.intro-copy { color: var(--quiet); }
.help { font-size: .96rem; margin: 8px 0 14px; }
strong,b { font-weight: 650; }
label { display: block; font-size: .92rem; margin-bottom: 5px; font-weight: 650; }
input:not([type=hidden]),select,textarea { border: 1px solid #aebdbc; background: #fff; color: var(--ink); border-radius: 6px; padding: 9px 11px; font: inherit; max-width: 100%; }
input[type=file] { width:100%; padding: 9px 4px; margin-bottom: 15px; border: none; border-bottom: 1px solid var(--line); border-radius: 0; font-size: .88rem; }
input[type=file]::file-selector-button { margin-right: 8px; color: var(--deep); background: var(--paper); border: 1px solid var(--line); padding: 6px; border-radius: 4px; }
select,textarea { width: 100%; }
textarea { resize: vertical; margin-bottom: 9px; font-variant-numeric: tabular-nums; }
.footer { display:flex; justify-content:space-between; color: var(--quiet); font-size:.85rem; margin-block: 36px 24px; gap: 12px; }
.notice { border: 1px solid #c6b184; border-left: 4px solid #a27236; border-radius: 5px; padding: 10px 14px; margin-top: 18px; background: #fff9eb; }
.login-layout { display: grid; grid-template-columns: 1fr minmax(265px,.85fr); max-width: 985px; margin: clamp(32px,7.5vh,85px) auto; min-height: 540px; overflow: hidden; border-radius: 15px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 40px #1336410b; }
.login-form { align-self:center; padding: clamp(30px,5vw,64px); }
.login-form h1 { font-size: clamp(2.5rem,4.7vw,4.15rem); line-height: 1.02; }
.switch { display: flex; width: fit-content; margin: 30px 0 25px; background: #ecf1f0; border-radius: 7px; padding: 4px; }
.switch a { padding: 7px 13px; color: var(--quiet); border-radius: 5px; text-decoration: none; font-weight: 600; font-size: .95rem; }
.switch a[aria-current] { color: var(--deep); background: white; box-shadow: 0 1px 4px #132d3b20; }
.login-form label { font-size: 1.03rem; }
.login-form .help { margin: 0 0 15px; }
.credential,.login-go { width: 100%; min-height: 47px; }
.login-go { margin-top: 12px; }
.drawing { display: grid; grid-template-rows: 1fr auto; place-items:center; padding: 25px 25px 17px; border-left: 1px solid var(--line); background-color:#e4eeeb; background-image:linear-gradient(#9eb9b04a 1px,transparent 1px),linear-gradient(90deg,#9eb9b04a 1px,transparent 1px); background-size:24px 24px; }
.drawing img { height: 400px; width: 85%; object-fit: contain; mix-blend-mode: multiply; }
.drawing figcaption { width: 100%; display: flex; gap: 5px 12px; justify-content: space-between; align-items: baseline; flex-wrap: wrap; border-top: 1px solid #9ab4ad; padding-top: 10px; color: var(--deep); font-size: .87rem; }
.page-intro { justify-content: space-between; gap: 16px; margin: 40px 0 25px; align-items: end; }
.page-intro.tight { margin-top: 18px; }
.page-intro .intro-copy { margin-top: 8px; font-size: 1.08rem; }
.code-label { font-size: .88rem; color: var(--quiet); text-align: right; }
.code-label strong { display: block; font-family: Consolas,monospace; font-size: 1.18rem; letter-spacing:.06em; color:var(--ink); }
.metrics { display: grid; grid-template-columns: repeat(4,1fr); margin-bottom: 26px; border-radius: 12px; background: var(--deep); color: #fff; overflow: hidden; }
.metrics>div { padding: 17px 20px 19px; }
.metrics>div+div { border-left: 1px solid #477078; }
.metrics span { display: block; color: #dbe9e7; font-size: .92rem; }
.metrics strong { font-size: 1.95rem; font-weight: 650; line-height:1.25; font-variant-numeric: tabular-nums; }
.metrics small { font-size: 1rem; font-weight: 450; color: #c8ded9; }
.tabs { gap: 3px; border-bottom: 1px solid #b4c5c3; margin-bottom: 18px; flex-wrap:wrap; }
.tabs a { text-decoration:none; padding: 9px 17px 12px; color: var(--quiet); border-bottom: 3px solid transparent; font-weight: 650; }
.tabs a:hover { color: var(--accent); }
.tabs a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a span { margin-left:5px; }
.work-layout,.teacher-layout { display:grid; grid-template-columns:minmax(0,2.35fr) minmax(235px,.98fr); align-items:start; gap:20px; }
.panel { margin-bottom: 17px; padding: clamp(16px,2.4vw,30px); background: var(--card); border: 1px solid var(--line); border-radius: 11px; min-width:0; }
.panel-head { gap:14px; justify-content:space-between; align-items: center; }
.panel .eyebrow { margin-bottom:5px; }
.compact-title { font-size:1.3rem; margin-bottom:12px; }
.pill { display:inline-block; background:#edf1f1; color:#405859; padding:4px 8px; border-radius:5px; font-size:.81rem; white-space:nowrap; font-weight:600; }
.pill.ok,.pass { color:#13614d; }
.pill.ok { background:#def2e7; }
.point { margin: 22px 0; }
.point h3 { border-left: 4px solid #418679; background:#edf3f1; padding:9px 13px; }
table { border-collapse: collapse; width:100%; text-align:left; }
th,td { padding: 8px 7px; }
th { font-weight:600; }
thead { font-size:.86rem; color:var(--quiet); }
tbody th,tbody td { border-top:1px solid #dce5e4; }
.calc-table { table-layout:fixed; }
.calc-table th:first-child { width:48%; }
.calc-table tbody th { font-size:.93rem; }
.calc-table .numeric { width:100%; font-size:1rem; font-variant-numeric:tabular-nums; padding:8px; }
.numeric[readonly] { background:#f4f7f6; }
.numeric.good { border-color: #5b9986; }
.numeric.bad { border-color:#b76148; background:#fff9f6; }
.field-result { display:block; font-size:.79rem; margin-top:2px; }
.fail { color:var(--error); }
.actions { gap:10px; flex-wrap:wrap; justify-content:flex-start; border-top:1px solid var(--line); padding-top:18px; }
.side-table { font-variant-numeric:tabular-nums; }
.source-links { display:grid; gap:7px; margin-top:15px; font-size:.94rem; text-underline-offset:3px; }
.side-table th,.side-table td { padding:6px; }
.scheme { border-top:1px solid var(--line); margin-top:14px; padding-top:13px; }
details summary { cursor:pointer; font-weight:600; color:var(--deep); }
.scheme img { display:block; max-height:480px; margin:14px auto 0; max-width:100%; }
.journal { list-style:none; margin:0; padding:0; }
.journal li { display:flex; justify-content:space-between; gap:8px; padding:11px 0; font-size:.92rem; border-bottom:1px solid var(--line); }
.journal li:last-child { border:0; }
.journal strong { font-size:1.12rem; color:var(--accent); white-space:nowrap; }
.journal small,.roster small,.attempt summary small { display:block; color:var(--quiet); font-size:.82rem; font-weight:400; }
.selector { align-items:end; gap:10px; padding-bottom:24px; margin-bottom:22px; border-bottom:1px solid var(--line); }
.selector>div { flex: 1; }
.scroll-table { overflow:auto; max-width:100%; }
.roster { font-size:.93rem; }
.roster td,.roster th { padding:11px 6px; }
.roster thead { font-size:.81rem; }
.roster small { margin-top:3px; }
.student-link { font-weight:650; text-underline-offset:3px; }
.mono { font-family:Consolas,monospace; }
.num { font-variant-numeric:tabular-nums; white-space:nowrap; }
.back { display:inline-block; margin-top:25px; text-underline-offset:3px; }
.attempt { margin-top:18px; border-top:1px solid var(--line); }
.attempt summary { padding:15px 5px; }
.attempt summary>span:first-child { display:inline-block; vertical-align:middle; }
.attempt summary .pill { float:right; }
.attempt-table { font-size:.92rem; }
@media(max-width:920px){.teacher-layout { grid-template-columns:1fr; }.teacher-layout aside { display:grid; grid-template-columns:1fr 1fr; gap:16px; }.work-layout{grid-template-columns:minmax(0,1fr) 235px;gap:12px;}.panel {padding:18px;}}
@media(max-width:720px){
 .shell{padding-inline:16px;}.header-row{min-height:61px;}.brand{gap:8px;font-size:.92rem;}.account>span{display:none;}
 .login-layout{grid-template-columns:1fr;min-height:auto;margin:28px auto;max-width:480px;}
 .drawing{grid-template-columns:1fr auto;grid-template-rows:1fr;gap:16px;padding:15px 23px;border-left:0;border-top:1px solid var(--line);}
 .drawing img{max-height:155px;width:auto;}.drawing figcaption{display:grid;border:0;gap:4px;font-size:.85rem;}
 .login-form{padding:30px 23px;}.login-form h1 br{display:none;}.login-form h1{font-size:2.35rem;}.switch{margin:20px 0;}
 .metrics{grid-template-columns:repeat(2,1fr);}.metrics>div{padding:12px 14px;}.metrics>div:nth-child(3){border-left:0;}.metrics>div:nth-child(n+3){border-top:1px solid #477078;}
 .metrics strong{font-size:1.55rem;}.metrics span{font-size:.85rem;}
 .work-layout,.teacher-layout,.teacher-layout aside{display:block;}.work-layout aside{display:grid;gap:12px;grid-template-columns:1fr 1fr;}
 .tabs a{padding:9px 11px;font-size:.95rem;}.page-intro{margin:25px 0 18px;}.roster{min-width:650px;}.attempt-table{min-width:600px;}
}
@media(max-width:470px){
 .brand-name span{display:block;}.work-layout aside{display:block;}.page-intro{flex-wrap:wrap;}.code-label{text-align:left;}
 .code-label strong{display:inline;margin-left:5px;font-size:1rem;}.panel{padding:13px;}.panel-head{gap:5px;}.compact-title{font-size:1.22rem;}
 .calc-table th,.calc-table td{padding:6px 3px;}.calc-table th:first-child{width:43%;}.calc-table tbody th{font-size:.86rem;}.field-result{font-size:.73rem;}
 .footer{font-size:.76rem;}.teacher-layout .selector{flex-wrap:wrap;}.account .quiet{padding:4px 8px;}
}
.setting-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.setting-field{display:flex;flex-direction:column;gap:7px}
.setting-control{display:flex;align-items:center;gap:6px}
.setting-control input{max-width:170px}
.setting-field small{line-height:1.3}
.review-form{display:grid;gap:8px;padding:16px}
