/* Clackleby class tools: the staff dashboard. Town colors and Lexend, like the game. No italics anywhere. */
@font-face { font-family: 'Lexend'; src: url('fonts/Lexend-Regular.ttf') format('truetype'); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('fonts/Lexend-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('fonts/Lexend-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --paper: #f6f1e7;        /* page */
  --card: #fffdf8;         /* cards and tables */
  --card-2: #f1ebe0;       /* tiles */
  --line: #ddd2bf;
  --ink: #1f1b16;
  --muted: #554c43;        /* 7:1 on the card color */
  --green: #0f4c3a;        /* Mars Theory green */
  --green-2: #e3efe9;
  --dusk: #1d1834;         /* the town at night */
  --dusk-ink: #fdf8ee;
  --gold: #c9a24a;
  --glow: #f4c46a;
  --amber-bg: #fbefd0;
  --amber-ink: #4a3410;
  --red-bg: #fbe9e4;
  --red-ink: #7d2615;
  --body: "Lexend", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.55; letter-spacing: .01em; font-style: normal; }
em, i, cite, var, dfn, address { font-style: normal; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--card); color: var(--green); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 10px; }

/* ---------- header ---------- */
.top { background: var(--dusk); color: var(--dusk-ink); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; color: var(--dusk-ink); text-decoration: none; }
.brand svg { width: 30px; height: 36px; flex: none; }
.brand .sub { font-weight: 400; font-size: .95rem; color: #e6dcc6; letter-spacing: .03em; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { color: var(--dusk-ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 14px; border-radius: 999px; border: 2px solid transparent; }
.nav a:hover { border-color: rgba(253, 248, 238, .45); }
.nav a[aria-current="page"] { background: var(--dusk-ink); color: var(--dusk); }
.top :focus-visible { outline-color: var(--glow); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .9rem; color: #e6dcc6; }
.who strong { color: var(--dusk-ink); font-weight: 600; }
.who select { font: 600 .9rem var(--body); color: var(--ink); background: var(--dusk-ink); border-radius: 8px; border: 0; padding: 6px 8px; max-width: 260px; }
.btn-top { font: 600 .9rem var(--body); color: var(--dusk-ink); background: transparent; border: 2px solid rgba(253, 248, 238, .6); border-radius: 999px; padding: 6px 14px; min-height: 38px; cursor: pointer; }
.btn-top:hover { background: rgba(253, 248, 238, .12); }

/* ---------- banners ---------- */
.banners { max-width: 1240px; margin: 14px auto 0; padding: 0 20px; display: grid; gap: 10px; }
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 10px 16px; font-size: .92rem; line-height: 1.45; }
.banner svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.banner p { margin: 0; }
.banner strong { font-weight: 700; }
.beta { background: var(--amber-bg); color: var(--amber-ink); border: 2px solid var(--gold); }
.demo { background: #ebe7f6; color: #261f48; border: 2px solid #8f84c4; flex-wrap: wrap; align-items: center; }
.demo p { flex: 1 1 320px; }
.demo .democtl { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.demo label { font-weight: 600; font-size: .88rem; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.demo select { font: 600 .9rem var(--body); border: 2px solid #8f84c4; border-radius: 8px; padding: 4px 8px; background: #fff; color: #261f48; }
.demo button { font: 600 .9rem var(--body); color: #261f48; background: #fff; border: 2px solid #8f84c4; border-radius: 999px; padding: 4px 12px; min-height: 34px; cursor: pointer; }

/* ---------- layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 48px; display: grid; gap: 22px; align-content: start; grid-template-columns: minmax(0, 1fr); }
main > * { min-width: 0; }
main:focus, [tabindex="-1"]:focus:not(:focus-visible), h1[tabindex="-1"]:focus { outline: none; }
h1, h2, h3 { line-height: 1.25; color: var(--green); margin: 0; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 600; color: var(--ink); }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.stack { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.stack > * { min-width: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: 0 1px 0 rgba(60, 40, 20, .04); }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.crumb { font-weight: 600; font-size: .95rem; }
.pagehead { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.crumb + .pagehead { margin-top: -8px; }
.pagehead .stack { gap: 4px; }

/* ---------- buttons and fields ---------- */
.btn { font: 600 .95rem var(--body); letter-spacing: .01em; color: var(--card); background: var(--green); border: 2px solid var(--green); border-radius: 999px; padding: 8px 18px; min-height: 42px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { background: #0b3a2c; }
.btn.secondary { color: var(--green); background: var(--card); }
.btn.secondary:hover { background: var(--green-2); }
.btn.danger { background: var(--red-ink); border-color: var(--red-ink); color: #fff; }
.btn.danger.secondary { background: var(--card); color: var(--red-ink); }
.btn.small { font-size: .85rem; padding: 4px 12px; min-height: 34px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.linkbtn { font: 600 .95rem var(--body); color: var(--green); background: none; border: 0; padding: 6px 4px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 36px; }
label.field { display: grid; gap: 6px; font-weight: 600; }
.hint { font-weight: 400; font-size: .9rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  font: 400 1rem var(--body); color: var(--ink); background: #fff; border: 2px solid #8c7f6c; border-radius: 10px; padding: 8px 12px; min-height: 44px; width: 100%; max-width: 100%; }
textarea { min-height: 170px; line-height: 1.6; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--green); outline-offset: 1px; border-color: var(--green); }
select.narrow { width: auto; min-width: 10rem; max-width: 16rem; }
.code-input { font-size: 1.4rem !important; letter-spacing: .3em; font-weight: 600 !important; max-width: 16ch !important; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.choice { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.choice input { width: 20px; height: 20px; accent-color: var(--green); }

/* ---------- messages ---------- */
.msg { border-radius: 12px; padding: 10px 14px; font-size: .95rem; }
.msg.error { background: var(--red-bg); color: var(--red-ink); border: 1px solid #e4b7aa; }
.msg.good { background: var(--green-2); color: #0b3a2c; border: 1px solid #b7d4c7; }
.msg.warn { background: var(--amber-bg); color: var(--amber-ink); border: 1px solid #e3cf9c; }
/* A gentle note (never a problem): a nickname that might hold a birth year, an age, or a birthday (R6). */
.msg.note { background: var(--card-2); color: var(--ink); border: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--dusk); color: var(--dusk-ink); padding: 10px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(20, 10, 40, .3); z-index: 60; max-width: calc(100vw - 32px); }

/* ---------- sign-in ---------- */
.signin { max-width: 560px; margin: 26px auto 0; display: grid; gap: 16px; }
.signin .card { padding: 26px 28px; display: grid; gap: 16px; }
.signin form { display: grid; gap: 14px; }
.lantern-row { display: flex; gap: 14px; align-items: center; }
.lantern-row svg { width: 46px; height: 56px; flex: none; }

/* ---------- plan, tiles, pills ---------- */
.plan { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; background: var(--card-2); border-radius: 12px; padding: 14px 18px; font-size: .92rem; }
.plan strong { color: var(--green); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; display: grid; gap: 4px; }
.tile .label { font-size: .85rem; color: var(--muted); }
.tile .value { font-size: 1.25rem; font-weight: 700; }
.tile .note { font-size: .8rem; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.on { background: var(--green-2); color: #0b3a2c; }
.pill.off { background: #ece7de; color: #4a423a; }
.pill.locked { background: var(--red-bg); color: var(--red-ink); }
.pill.role { background: #ebe7f6; color: #261f48; }
.pill.role::before, .pill.plain::before { display: none; }

/* ---------- class cards ---------- */
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.classcard { display: grid; gap: 12px; align-content: start; }
.classcard h2 a { color: var(--green); text-decoration: none; }
.classcard h2 a:hover { text-decoration: underline; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: .92rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.newclass { display: grid; gap: 8px; }
.newclass .row input { flex: 1 1 280px; width: auto; }

/* ---------- class page ---------- */
.codebox { display: inline-flex; align-items: center; gap: 10px; background: var(--card); border: 2px dashed var(--gold); border-radius: 12px; padding: 6px 14px; }
.codebox .code { font-size: 1.35rem; font-weight: 700; letter-spacing: .12em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 10px; margin: 4px 0 0; }
.tabs [role="tab"] { font: 600 .95rem var(--body); color: var(--green); background: var(--card); border: 2px solid #c9bba4; border-radius: 999px; padding: 6px 16px; min-height: 40px; cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { background: var(--green); border-color: var(--green); color: var(--card); }
.goalbox { display: flex; gap: 12px 18px; align-items: center; flex-wrap: wrap; background: var(--green-2); border-radius: 12px; padding: 14px 18px; }
.goalbox p { flex: 1 1 320px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* ---------- table ---------- */
/* (more room in every box, tile, and table cell, and between them: Parker, November 12, 2026, "make sure there's enough padding in the dashboards") */
.tablewrap { position: relative; max-width: 100%; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.tablewrap:focus-visible { outline: 3px solid var(--green); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data caption { text-align: left; padding: 16px 18px 6px; font-weight: 600; color: var(--ink); }
table.data th, table.data td { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid #ebe3d5; }
table.data thead th { font-size: .8rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.data tbody th { font-weight: 600; }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; }
table.data td.course { min-width: 13em; }
table.data td.acts > div { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
table.data .keys { white-space: nowrap; }
table.data .sub { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; }
kbd { font: 600 .82rem var(--body); background: #fff; border: 1.5px solid #b9ab95; border-bottom-width: 3px; border-radius: 6px; padding: 0 6px; margin-right: 3px; display: inline-block; min-width: 1.6em; text-align: center; }
.yes { color: #0b5c43; font-weight: 700; white-space: nowrap; }
.no { color: var(--muted); }
td .no { white-space: normal; }
.goalcell { white-space: nowrap; }

/* ---------- PIN panel ---------- */
.pins { border: 2px solid var(--gold); background: #fffaf0; }
.pins table.data td.pin { font-size: 1.1rem; font-weight: 700; letter-spacing: .15em; }

/* ---------- dialogs ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; max-width: min(560px, calc(100vw - 32px)); width: 100%; background: var(--card); color: var(--ink); box-shadow: 0 18px 48px rgba(20, 10, 40, .35); }
dialog::backdrop { background: rgba(29, 24, 52, .55); }
.dlg { padding: 22px 24px; display: grid; gap: 14px; }
.dlg .btnrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.dlg input[type="number"] { max-width: 8rem; }
.dlg .row { row-gap: 6px; }
.dlg hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }

/* ---------- help ---------- */
.help { display: grid; gap: 14px; max-width: 860px; }
.help ul { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 4px; }
ul.plainlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.plainlist li { border-top: 1px solid #ebe3d5; padding-top: 10px; }
ul.plainlist li:first-child { border-top: 0; padding-top: 0; }
.help .card { display: grid; gap: 8px; }

footer { max-width: 1240px; margin: 0 auto; padding: 0 20px 30px; font-size: .85rem; color: var(--muted); }

/* ---------- print: sign-in cards and certificates (only #printArea prints) ---------- */
#printArea { display: none; }
@media print {
  /* The paper size and margins come from print-cards.css or print-certs.css (the page picks one before printing). */
  html, body { background: #fff !important; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; color: #1f1b16; }
}
.cardsheet { display: grid; grid-template-columns: 1fr 1fr; gap: 0; break-after: page; }
.cardsheet:last-child { break-after: auto; }
.signcard { border: 1.5px dashed #8c7f6c; padding: 14px 16px; height: 63mm; display: grid; align-content: start; gap: 6px; break-inside: avoid; }
.signcard .cardtop { color: var(--green); font-size: 9pt; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.signcard .cls { font-size: 10pt; color: #554c43; }
.signcard dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 2px 0; align-items: baseline; }
.signcard dt { font-size: 9pt; color: #554c43; }
.signcard dd { margin: 0; font-size: 15pt; font-weight: 700; letter-spacing: .06em; overflow-wrap: anywhere; }
.signcard .how { font-size: 8.5pt; line-height: 1.35; color: #3a332c; }
.certpage { width: 279mm; height: 214mm; padding: 12mm; break-after: page; display: grid; overflow: hidden; }
.certpage:last-child { break-after: auto; }
.cert { border: 10px double var(--green); outline: 2px solid var(--gold); outline-offset: -24px; background: #fffaf0; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4mm; padding: 10mm 22mm; color: #2b2118; }
.cert .seal { width: 22mm; height: 22mm; }
.cert .certtop { letter-spacing: .3em; font-weight: 700; color: #7a5c0c; font-size: 11pt; }
.cert h1 { font-size: 30pt; color: var(--green); }
.cert p { font-size: 13pt; }
.cert .certname { font-size: 26pt; font-weight: 700; border-bottom: 2px solid var(--gold); padding: 0 1em 1mm; min-width: 50%; overflow-wrap: anywhere; }
.cert .certorg { font-size: 11pt; color: #554c43; }
.cert .certfine { font-size: 9pt; color: #5d5142; max-width: 46em; margin-top: 3mm; }

/* ---------- smaller screens ---------- */
@media (max-width: 760px) {
  .top-in { padding: 10px 16px; }
  .who { margin-left: 0; }
  main, .banners, footer { padding-left: 16px; padding-right: 16px; }
  .signin .card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
