:root {
  color-scheme: light;
  --ground: #f5f3ed;
  --paper: #fff;
  --ink: #171715;
  --muted: #5d5b51;
  --line: #e4e1d7;
  --gold: #f7c90d;
  --selected: #fff1af;
  --dark: #242420;
  --green: #28603c;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 500 14px/1.55 Montserrat, system-ui, sans-serif; }
a { color: inherit; }
p, h1, h2, h3, dl, dd, form { margin: 0; }
h1, h2, h3, p, strong, code { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.12; letter-spacing: -.025em; }
h2 { font-size: 1.24rem; line-height: 1.3; }
h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #496ec1;
  outline-offset: 3px;
}
.top { min-height: 86px; padding: 20px max(24px, calc((100vw - 1392px) / 2)); background: var(--ink);
  color: white; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 700; }
.brand { display: inline-flex; padding: 2px; border-radius: 5px; background: white; }
.brand img { display: block; object-fit: contain; }
.shell { display: grid; grid-template-columns: 256px minmax(0,1fr); align-items: start; gap: 24px;
  width: min(100%, 1440px); margin-inline: auto; padding: 24px; }
main { display: grid; gap: 16px; min-width: 0; align-content: start; }
.auth-shell { width: min(100%, 575px); margin: clamp(28px, 7vw, 100px) auto; padding: 0 18px; }
.navigation { background: var(--ink); color: white; border-radius: 16px; display: grid; justify-items: start; gap: 10px; padding: 20px; }
.navigation > strong { text-transform: uppercase; font-size: 11px; }
.navigation a, .navigation button { background: var(--dark); border: 1px solid transparent; color: white; font-weight: 700; }
.navigation a { text-decoration: none; border-radius: 10px; padding: 11px 14px; min-height: 44px; display: inline-flex; align-items: center; }
.navigation a:hover, .navigation button:hover { background: #363631; }
.navigation a[aria-current] { background: var(--selected); color: var(--ink); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; padding: 16px; min-width: 0;
  display: grid; align-content: start; gap: 11px; }
.auth { padding: clamp(18px, 4vw, 32px); gap: 22px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 15px;
  border-radius: 10px; border: 1px solid var(--line); min-height: 44px; max-width: 100%;
  color: var(--ink); background: var(--paper); text-align: center; text-decoration: none;
  font-weight: 700; font-size: 13px; cursor: pointer; }
.button, button, .panel > a { justify-self: start; }
.button:hover, button:hover { background: #f3f1ea; }
.primary { background: var(--gold); border-color: var(--gold); }
.primary:hover { background: #f0bd07; border-color: #f0bd07; }
.danger { color: #872c22; background: #fff1ed; border-color: #f3c8bf; }
button:disabled { cursor: default; opacity: .55; }
.muted, .subtitle, small { color: var(--muted); }
.subtitle { margin-top: -6px; }
.back { align-self: start; justify-self: start; font-weight: 700; text-underline-offset: 3px; }
.stack, .showcase, .project-layout { display: grid; align-items: start; gap: 16px; min-width: 0; }
.showcase, .project-layout { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.older { grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); }
.cover { display: block; width: 100%; height: 121px; border-radius: 5px; object-fit: cover; }
.featured .cover { height: clamp(165px,22vw,272px); }
.featured h2 { font-size: clamp(1.28rem,3vw,1.86rem); }
.cover-empty { padding: 18px; display: grid; align-content: end; color: #fff; background: #283354; font-weight: 700; }
.featured .cover-empty { background: #1f2947; }
.tag { width: fit-content; border-radius: 8px; background: var(--gold); padding: 5px 9px; font-size: 11px; font-weight: 700; }
.preview { display: block; width: 100%; max-height: 490px; object-fit: contain; background: #eeefe9; border-radius: 5px; }
.panel > a:has(.preview) { width: 100%; }
.preserve { white-space: pre-wrap; }
.file-row, .entry, .attempt, .recipient { border-top: 1px solid var(--line); padding: 10px 0; }
.file-row { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.entry { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.pupil { align-items: start; }
.lesson-code, .access-code, .mail { font-size: clamp(1rem, 4vw, 1.7rem); font-weight: 700; }
.recipient { display: flex; align-items: center; gap: 11px; min-height: 44px; }
.recipient input { accent-color: var(--gold); width: 22px; height: 22px; }
.form-grid { display: grid; gap: 14px; }
.form-grid label { font-weight: 700; display: grid; gap: 7px; align-content: start; min-width: 0; }
.form-grid input:not([type=file]), .form-grid select, .form-grid textarea { width: 100%; color: var(--ink); background: #fafaf7;
  border: 1px solid var(--line); padding: 10px 12px; border-radius: 9px; min-height: 44px; }
.form-grid textarea { resize: vertical; }
.form-grid button { justify-self: start; }
.drop { padding: 16px; border: 1px dashed #a39c81; border-radius: 10px; background: #faf8ed; cursor: pointer; }
.drop input { width: 100%; min-width: 0; max-width: 100%; font-size: 12px; }
.drop.over { outline: 3px solid var(--gold); outline-offset: 1px; }
.notice { border-radius: 10px; padding: 12px 16px; background: #e8e8e1; }
.success { background: #ddefe0; }
.error { color: #872c22; background: #fce7e1; }
summary { font-weight: 700; cursor: pointer; }
details[open] summary { margin-bottom: 14px; }
details form + form { margin-top: 18px; }
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.metric { grid-template-rows: auto 1fr auto; gap: 4px; }
.metric dt, .metric dd:last-child { color: var(--muted); font-size: .8rem; }
.metric dd:nth-child(2) { font-size: 1.85rem; font-weight: 800; }
.chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; min-height: 125px; }
.bar { display: grid; justify-items: center; gap: 6px; min-width: 0; font-size: .72rem; text-align: center; }
.bar meter { appearance: none; display: block; width: clamp(22px, 9vw, 70px); height: 90px; writing-mode: vertical-lr; direction: rtl; }
.bar meter::-webkit-meter-bar { background: transparent; border: 0; border-radius: 4px; }
.bar meter::-webkit-meter-optimum-value { background: var(--gold); border-radius: 4px; }
.bar meter::-moz-meter-bar { background: var(--gold); border-radius: 4px; }
.attempt { display: grid; grid-template-columns: minmax(120px, 2fr) 1fr 1fr 1fr; align-items: center; gap: 8px; font-size: 13px; }
.success-text { color: var(--green); font-weight: 700; }
@media (max-width: 820px) {
  .top { padding: 16px 18px 12px; min-height: 72px; }
  .brand img { width: 78px; height: 42px; }
  .shell { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .navigation { border-radius: 0; padding: 0 18px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
  .navigation > strong { display: none; }
  .navigation a, .navigation button { padding-inline: 10px; font-size: 12px; }
  .shell main { padding: 17px 18px 30px; }
  .project-layout, .showcase { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .attempt { grid-template-columns: 1fr auto auto; }
  .attempt > div { grid-column: 1 / -1; }
}
