/* Hallmark v2 | Graphite duty journal | architectural workbench | custom school floor plans */
/* Structural rhythm comes from the ruled navigation, plan canvas and list of duty posts. */
:root {
  color-scheme: dark;
  --page: #14171b;
  --head: #191c20;
  --layer: #20242a;
  --hover: #292f36;
  --field: #171a1f;
  --line: #363e47;
  --rule: #2c3239;
  --type: #f3f4f3;
  --copy: #d6dbe1;
  --muted: #a5afb9;
  --blue: #a1c9ff;
  --blue-dark: #253c58;
  --brand-ink: #1b2a3a;
  --gold: #e6c984;
  --silver: #c3cbd6;
  --danger: #ffb8ac;
  --danger-bg: #422c2d;
  --paper: #eff3f2;
  --shade: rgb(8 12 17 / .74);
  --shadow: rgb(0 0 0 / .28);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --max: 1360px;
  --inset: clamp(16px, 4vw, 64px);
  --curve: 9px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; min-height: 100svh; background: var(--page); color: var(--type); font: 400 16px/1.48 var(--font); -webkit-font-smoothing: antialiased; }
:where(h1,h2,h3,p) { margin: 0; }
:where(h1,h2,h3) { font-weight: 580; line-height: 1.13; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
h1 { font-size: clamp(2.2rem, 4.6vw, 4rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.37rem, 2.2vw, 1.85rem); letter-spacing: -.032em; }
h3 { font-size: 1.05rem; letter-spacing: -.013em; }
p { text-wrap: pretty; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, dialog { color: inherit; }
button { appearance: none; background: var(--layer); color: var(--type); border: 1px solid var(--line); border-radius: 7px; padding: 8px 16px; cursor: pointer; font-weight: 520; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
button:hover { background: var(--hover); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: not-allowed; background: var(--field); color: var(--muted); border-color: var(--rule); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; }
.shell { max-width: var(--max); padding-inline: var(--inset); margin-inline: auto; }
.masthead { background: var(--head); border-bottom: 1px solid var(--line); }
.topline { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.identity { display: flex; align-items: center; gap: 12px; font-size: clamp(17px, 2vw, 21px); font-weight: 650; letter-spacing: -.035em; }
.logomark { width: 36px; height: 36px; color: var(--blue); }
#account { font-size: .875rem; padding: 8px 16px; min-height: 38px; border-radius: 7px; }
.navline { display: flex; align-items: stretch; gap: clamp(16px, 3vw, 40px); }
.navline button { position: relative; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 0; padding: 8px 0 16px; background: transparent; color: var(--muted); font-size: .94rem; }
.navline svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.navline button:hover, .navline button:is(.active,[aria-current=page]) { color: var(--type); }
.navline button:is(.active,[aria-current=page])::after { content: ""; position: absolute; inset: auto 0 -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--blue); }
#content { padding-block: clamp(28px, 4.6vw, 64px) 64px; }
.pagehead { margin-bottom: clamp(20px, 3vw, 32px); }
.pagehead p, .muted, small, .hint { color: var(--muted); }
.pagehead p { margin-top: 8px; max-width: 68ch; font-size: clamp(15px, 1.4vw, 17px); }
.toolbar, .tabs, .actions, .floorbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar { margin-block: 16px; }
.toolbar input { flex: 1 1 200px; }
.tabs { margin-block: 16px; }
button:is(.active,[aria-pressed=true]), .tabs .active, .floorbar .active { color: var(--blue); background: var(--blue-dark); border-color: var(--blue); }
.primary { background: var(--blue); color: var(--brand-ink); border-color: var(--blue); font-weight: 640; }
.primary:hover { background: var(--type); color: var(--brand-ink); border-color: var(--type); }
.danger, .error { color: var(--danger); }
button.danger { background: var(--danger-bg); }
.gridmap { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(250px, 1fr); align-items: start; gap: clamp(16px, 2.6vw, 32px); }
.mapcard { color: var(--type); overflow: clip; border-radius: var(--curve); border: 1px solid var(--line); background: var(--layer); }
.floorbar { padding: 16px 16px; min-height: 62px; border-bottom: 1px solid var(--line); }
.floorbar button { padding: 8px 12px; font-size: .875rem; }
.floorbar strong, .floorbar h2 { margin-right: auto; }
.mapview { background: var(--paper); overflow: auto; }
.mapview svg { display: block; width: 100%; min-width: 400px; }
.mapcard > p, .mapcard > footer, .legend { margin: 0; padding: 12px 16px; font-size: .875rem; color: var(--muted); }
.gridmap aside > h2, .gridmap aside > h3, .postlist > h2 { padding-block: 8px 16px; border-bottom: 1px solid var(--line); }
.postlist, .stack { display: grid; gap: 8px; }
.postlist { gap: 0; }
.row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 12px; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; text-align: left; background: transparent; font-size: .98rem; }
.row > * { min-width: 0; }
.row > span:first-child, .row > div:first-child { overflow-wrap: anywhere; }
.row small, .row .muted { font-size: .84rem; }
.row small { display: block; margin-top: 4px; }
.row:hover { background: var(--layer); }
.row:last-child { border-bottom-color: var(--line); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; line-height: 1.3; padding: 4px 8px; color: var(--blue); background: var(--blue-dark); border-radius: 5px; }
.crown { color: var(--gold); }
.silver { color: var(--silver); }
.stack > p, .case p { color: var(--copy); }
.case, .card { color: var(--type); background: var(--layer); border: 1px solid var(--line); border-radius: var(--curve); padding: clamp(16px, 2.3vw, 24px); overflow-wrap: anywhere; }
.case > * + *, .card > * + * { margin-top: 8px; }
.evidence { display: block; width: auto; max-width: 100%; max-height: 390px; object-fit: contain; border-radius: 6px; }
label { display: grid; gap: 8px; font-size: .94rem; font-weight: 540; }
label:has(input[type=checkbox]), label:has(input[type=radio]) { display: flex; align-items: center; gap: 8px; }
.field { display: grid; gap: 8px; }
input:not([type=checkbox],[type=radio]), select, textarea { display: block; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--type); padding: 8px 12px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--blue); }
textarea { resize: vertical; min-height: 92px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=file] { font-size: .87rem; }
input::file-selector-button { font: inherit; border: 0; border-radius: 4px; padding: 4px 8px; margin-right: 8px; background: var(--layer); color: var(--type); cursor: pointer; }
form.stack { gap: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--rule); }
th { color: var(--muted); font-size: .84rem; font-weight: 540; }
dialog { padding: clamp(16px, 3vw, 32px); width: min(580px, calc(100% - 24px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 14px; background: var(--head); box-shadow: 0 18px 80px var(--shadow); overscroll-behavior: contain; }
dialog[open] { animation: enter .17s ease-out both; }
dialog::backdrop { background: var(--shade); }
.dismiss { display: flex; justify-content: end; height: 0; position: sticky; top: 0; z-index: 1; }
#panelclose { width: 34px; height: 34px; padding: 0; display: grid; place-content: center; border-radius: 50%; font-size: 24px; line-height: 1; font-weight: 400; }
#panelbody > :is(h1,h2,h3):first-child, #panelbody > :first-child :is(h1,h2,h3):first-child { padding-right: 40px; min-height: 32px; }
#panelbody > * + * { margin-top: 16px; }
#notice:not(:empty) { position: fixed; z-index: 3; bottom: max(20px,env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--type); background: var(--layer); box-shadow: 0 6px 28px var(--shadow); }
.skip { position: fixed; inset: 6px auto auto 6px; translate: 0 -150%; z-index: 5; border-radius: 4px; background: var(--layer); padding: 8px 12px; }
.skip:focus { translate: none; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (max-width: 800px) {
  .gridmap { grid-template-columns: minmax(0, 1fr); }
  .row { padding-inline: 8px; }
  .mapview svg { min-width: 0; }
}
@media (max-width: 500px) {
  .topline { min-height: 64px; }
  .logomark { width: 30px; height: 30px; }
  .identity { gap: 8px; }
  .navline { gap: clamp(8px, 3.5vw, 20px); }
  .navline button { gap: 4px; font-size: .84rem; min-height: 42px; }
  .navline svg { width: 15px; }
  .floorbar { padding: 8px; min-height: 48px; }
  .floorbar button { padding: 8px 8px; }
  .toolbar > select { width: 100%; }
  .row { align-items: flex-start; }
  th, td { padding: 8px 4px; font-size: .87rem; }
  dialog { border-radius: 11px; }
}
@media (max-width: 355px) { .navline svg { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url('./inter-cyrillic-wght-normal.woff2') format('woff2'); unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url('./inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+2000-206F,U+2190-21FF; }
.formerror:not(:empty) {color:var(--danger)}
.formerror:empty {display:none}
.crown:not(.silver) {text-shadow:0 0 8px var(--gold)}
dialog[open] {animation:open-panel .16s ease-out}
@keyframes open-panel {from {opacity:.7;transform:translateY(3px)} to {opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){dialog[open]{animation:none}}
h1 {letter-spacing:-.037em}
.map-legend {display:flex;align-items:center;gap:12px 18px;flex-wrap:wrap}
.map-legend span {display:inline-flex;align-items:center;gap:7px}
.map-legend i {display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;border:2px solid var(--blue);font:600 10px/1 var(--font)}
.map-legend span:nth-child(2) i {background:var(--blue);color:var(--brand-ink)}
.map-legend button {margin-inline-start:auto;font-size:.875rem}
.mapview.enlarged svg {width:150%;min-width:760px}
.gridmap aside h2 small {display:block;margin-top:6px;font-size:.87rem;font-weight:450;color:var(--muted);letter-spacing:0}
form[data-form=studentlogin] input {font-size:1.65rem;letter-spacing:.28em;font-variant-numeric:tabular-nums;max-width:10rem}
code {font-variant-numeric:tabular-nums;letter-spacing:.12em;color:var(--blue);font-size:1rem}
.photo-note {color:var(--muted);font-size:.9rem}
.rulebook {max-width:850px;border-top:1px solid var(--line)}
.rulebook section {display:grid;grid-template-columns:minmax(145px,1fr) 2.7fr;gap:20px;padding:24px 0;border-bottom:1px solid var(--line)}
.rulebook h2,.rule-update h2 {font-size:1.3rem}
.rulebook p,.comparison p {white-space:pre-line;overflow-wrap:anywhere}
.rule-update {margin-top:20px;padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--layer)}
.update-title {display:flex;align-items:center;justify-content:space-between;gap:16px}
.rule-update section {margin-top:16px}
.comparison {display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:8px}
.comparison p {color:var(--copy)}
.comparison strong {display:block;color:var(--blue);margin-bottom:4px;font-size:.85rem}
.comparison p:first-child strong {color:var(--muted)}
::selection {background:var(--blue);color:var(--brand-ink)}
@media(max-width:600px){
  .rulebook section,.comparison {grid-template-columns:1fr;gap:8px}
  .map-legend {gap:8px 12px}
  .map-legend button {margin:0;min-height:42px}
  .rule-update {padding:16px}
  .floorbar button {min-height:42px;min-width:52px}
}
#connection:not([hidden]) {margin-top:1rem;color:var(--muted);font-size:.9rem}
#connection button {margin-inline-start:.5rem}
