/* Hackathon360 - "the answer script".
   Ink blue on ruled paper; examiner red is reserved for marks and results.
   Fonts are bundled (offline-safe): Bitter for headings and numbers, Source Sans 3 for everything else. */

@font-face { font-family: "Bitter"; src: url("../fonts/bitter.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/sourcesans3.woff") format("woff"); font-weight: 200 900; font-display: swap; }

:root {
  --ink: #1C2B5A;          /* navigation, headings */
  --ink-2: #2B3D73;        /* hover on ink */
  --blue: #2B4ACB;         /* actions, links */
  --blue-dark: #1F37A3;
  --rule: #DCE3F3;         /* ruled lines, borders */
  --rule-strong: #C3CDE6;
  --paper: #F5F7FC;        /* page */
  --sheet: #FFFFFF;        /* surfaces */
  --text: #1A2238;
  --muted: #5C6785;
  --red: #C62F2F;          /* examiner red: marks and results only */
  --red-soft: #FBEAEA;
  --moss: #23784A;  --moss-soft: #E6F3EB;
  --amber: #A86A00; --amber-soft: #FDF3DF;
  --blue-soft: #E9EEFC;
  --serif: "Bitter", Georgia, "Cambria", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", "DejaVu Sans Mono", "Courier New", monospace;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.5 var(--sans); background: var(--paper); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); margin: 0 0 .5rem; line-height: 1.2; font-weight: 650; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }
pre code, .statement pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
code { font-family: var(--mono); font-size: .88em; background: var(--blue-soft); color: var(--ink); padding: .05em .35em; border-radius: 3px; }
:focus-visible { outline: 3px solid #8FA6F0; outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.right { margin-left: auto; }
.num { font-family: var(--serif); font-variant-numeric: tabular-nums lining-nums; }

/* ------------------------------------------------------------------ app shell: sidebar (admin, HOD) */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) 236px, transparent 236px); }
.sidebar { background: var(--ink); color: #D6DDF2; display: flex; flex-direction: column; position: sticky; top: 0;
           height: 100vh; padding: 1.3rem 0 1rem; box-shadow: inset -7px 0 0 -5px rgba(198,47,47,.85), inset -11px 0 0 -9px rgba(198,47,47,.55); }
.brand { display: flex; align-items: baseline; gap: .1rem; padding: 0 1.4rem 1.4rem; font-family: var(--serif);
         font-size: 1.35rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: -.01em; }
.brand .n360 { color: #9DB1F5; }
.brand:hover { color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 .7rem; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 5px; color: #D6DDF2;
         text-decoration: none; font-size: .97rem; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: #fff; color: var(--ink); font-weight: 600; }
.nav svg { width: 19px; height: 19px; flex: none; }
.side-user { margin-top: auto; padding: 1rem 1.4rem 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .9rem; }
.side-user strong { display: block; color: #fff; font-weight: 600; }
.side-user form { margin: .7rem 0 0; }
.main { min-width: 0; }
.page { max-width: 1180px; padding: 2rem 2.4rem 3rem; }

/* ------------------------------------------------------------------ top bar (students) */
.topbar { background: var(--ink); color: #D6DDF2; border-bottom: 3px double rgba(198,47,47,.7); }
.topbar-inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 1.2rem; padding: .7rem 1.4rem; }
.topbar .brand { padding: 0; font-size: 1.25rem; }
.topbar .who { margin-left: auto; text-align: right; font-size: .9rem; line-height: 1.3; }
.topbar .who strong { color: #fff; font-weight: 600; }
.topbar form { margin: 0; }
.page-narrow { max-width: 1040px; margin: 0 auto; padding: 2rem 1.4rem 3rem; }

/* ------------------------------------------------------------------ page head */
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .35rem; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.page-head .lede { color: var(--muted); margin: .15rem 0 0; max-width: 62ch; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ panels */
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.2rem; }
.panel-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
.panel-head h2 { margin: 0; }
.panel-head .hint { color: var(--muted); font-size: .9rem; }
.panel-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.cols { display: grid; gap: 1.2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cols > .panel { margin-bottom: 0; }
.cols + .panel, .cols + .cols { margin-top: 1.2rem; }

/* one strip of figures, divided like columns of a marks register */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--rule);
         border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 1.2rem; overflow: hidden; }
.stat { padding: 1rem 1.2rem; background: var(--sheet); }
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-4 .stat { padding: .8rem .9rem; }
.stats-4 .stat .n { font-size: 1.5rem; }
.stat .n { font-family: var(--serif); font-size: 1.85rem; font-weight: 650; color: var(--ink); line-height: 1.1;
           font-variant-numeric: tabular-nums lining-nums; }
.stat .l { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.stat.warn .n { color: var(--amber); }
.stat.bad .n { color: var(--red); }

/* ------------------------------------------------------------------ tables: ruled like a register */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.data th { text-align: left; font-weight: 600; color: var(--ink); padding: .55rem .7rem; border-bottom: 2px solid var(--ink);
                background: var(--sheet); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.data td { padding: .6rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data tbody tr:hover td { background: #F8FAFF; }
table.data .nw, table.data td.n, table.data th.n { white-space: nowrap; }
table.data td a:has(.marks-text) { text-decoration: none; color: var(--muted); }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 1.4rem .7rem !important; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--rule-strong); background: var(--sheet);
       color: var(--ink); padding: .5rem 1rem; border-radius: 5px; font: 600 .94rem/1.25 var(--sans); cursor: pointer;
       text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-success { background: var(--moss); border-color: var(--moss); color: #fff; }
.btn-success:hover { background: #1B603B; color: #fff; }
.btn-danger { background: var(--sheet); border-color: #E3A3A3; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-dark { background: transparent; border-color: rgba(255,255,255,.25); color: #E2E7F5; }
.btn-dark:hover { border-color: #fff; color: #fff; }
.btn-sm { padding: .28rem .6rem; font-size: .85rem; }
.btn-link { background: none; border: 0; color: var(--blue); padding: 0; font-weight: 600; cursor: pointer; font: inherit; }

/* ------------------------------------------------------------------ forms */
form.stack label, .field label { display: block; font-weight: 600; font-size: .92rem; margin: .9rem 0 .3rem; color: var(--ink); }
form.stack label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; color: var(--text); }
input[type=text], input[type=password], input[type=datetime-local], select {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--rule-strong); border-radius: 5px; font: inherit; color: var(--text);
  background: #fff; }
input[type=text]:focus, input[type=password]:focus, input[type=datetime-local]:focus, select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,74,203,.18); }
input[type=file] { font: inherit; font-size: .92rem; color: var(--muted); }
input[type=file]::file-selector-button { font: 600 .88rem var(--sans); color: var(--ink); background: var(--blue-soft); border: 1px solid var(--rule-strong);
  border-radius: 5px; padding: .4rem .8rem; margin-right: .7rem; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--ink); }
.fields { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choices label { display: inline-flex !important; align-items: center; gap: .45rem; margin: 0 !important; font-weight: 400 !important;
                 border: 1px solid var(--rule-strong); border-radius: 5px; padding: .4rem .75rem; background: #fff; cursor: pointer; }
.choices label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.form-actions { margin-top: 1.2rem; display: flex; gap: .6rem; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------------ messages and tags */
.alert { padding: .75rem 1rem; border-radius: 5px; margin-bottom: 1rem; border-left: 4px solid; background: var(--sheet); }
.alert-success { border-color: var(--moss); background: var(--moss-soft); color: #164A2E; }
.alert-warning { border-color: var(--amber); background: var(--amber-soft); color: #6A4300; }
.alert-danger { border-color: var(--red); background: var(--red-soft); color: #7D1D1D; }
.alert-info { border-color: var(--blue); background: var(--blue-soft); color: #1F2F70; }
.tag { font-family: var(--sans); vertical-align: middle; display: inline-block; padding: .08rem .5rem; border-radius: 4px; font-size: .82rem; font-weight: 600; background: #EEF1F8; color: var(--muted);
       white-space: nowrap; }
.tag-ok { background: var(--moss-soft); color: var(--moss); }
.tag-warn { background: var(--amber-soft); color: var(--amber); }
.tag-bad { background: var(--red-soft); color: var(--red); }
.tag-info { background: var(--blue-soft); color: var(--blue-dark); }
/* old class names still used in a few places */
.badge { display: inline-block; padding: .08rem .5rem; border-radius: 4px; font-size: .82rem; font-weight: 600; background: #EEF1F8; color: var(--muted); }
.badge-ok { background: var(--moss-soft); color: var(--moss); } .badge-warn { background: var(--amber-soft); color: var(--amber); }
.badge-bad { background: var(--red-soft); color: var(--red); } .badge-info { background: var(--blue-soft); color: var(--blue-dark); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; vertical-align: .05em; }
.dot-ok { background: var(--moss); } .dot-bad { background: var(--red); }

/* ------------------------------------------------------------------ the examiner's mark (results only) */
.mark { display: inline-flex; align-items: center; justify-content: center; min-width: 4.6rem; height: 4.2rem; padding: 0 .9rem;
        border: 2.5px solid var(--red); border-radius: 52% 48% 46% 54% / 55% 46% 54% 45%; transform: rotate(-4deg);
        color: var(--red); font-family: var(--serif); font-weight: 700; font-size: 1.7rem; font-variant-numeric: lining-nums; }
.mark small { font-size: .55em; font-weight: 600; margin-left: .15rem; opacity: .85; }
.mark-sm { min-width: 3.4rem; height: 2.2rem; font-size: 1.05rem; border-width: 2px; padding: 0 .45rem; }
.marks-text { color: var(--red); font-weight: 700; font-family: var(--serif); font-variant-numeric: tabular-nums lining-nums; }
.tick { color: var(--moss); font-weight: 700; } .cross { color: var(--red); font-weight: 700; }

/* ------------------------------------------------------------------ hall ticket (student event card) */
.ticket { background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius); margin-bottom: 1.4rem;
          display: grid; grid-template-columns: 1fr auto; overflow: hidden; }
.ticket-main { padding: 1.5rem 1.7rem; }
.ticket-main h1 { margin-bottom: .2rem; }
.ticket-fields { display: flex; flex-wrap: wrap; gap: .9rem 2.6rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.ticket-fields div strong { white-space: nowrap; }
.ticket-fields div span { display: block; color: var(--muted); font-size: .85rem; }
.ticket-fields div strong { font-weight: 600; color: var(--ink); }
.ticket-side { border-left: 2px dashed var(--rule-strong); padding: 1.4rem 1.6rem; display: flex; flex-direction: column;
               justify-content: center; align-items: center; min-width: 230px; text-align: center; background: #FAFBFE; }
.ticket-side .label { color: var(--muted); font-size: .9rem; }
.countdown { font-family: var(--serif); font-size: 2.1rem; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }

.project-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.project { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.3rem; display: flex; flex-direction: column; }
.project h3 { font-size: 1.15rem; }
.project.selected { border-color: var(--blue); box-shadow: inset 4px 0 0 var(--blue); }
.project form { margin-top: auto; padding-top: .8rem; }
.result-head { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art { background: var(--ink); color: #D6DDF2; padding: 3.4rem 3.6rem; display: flex; flex-direction: column; position: relative; overflow: hidden;
             background-image: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(157,177,245,.13) 39px 40px); }
.login-art::before { content: ""; position: absolute; top: 0; bottom: 0; left: 2.4rem; border-left: 2px solid rgba(198,47,47,.65); }
.login-art::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(2.4rem + 5px); border-left: 1px solid rgba(198,47,47,.45); }
.login-art .brand { padding: 0 0 0 1.4rem; font-size: 1.5rem; }
.login-art h1 { color: #fff; font-size: 2.6rem; line-height: 1.12; margin: auto 0 1rem; padding-left: 1.4rem; max-width: 15ch; font-weight: 700; }
.login-art p { padding-left: 1.4rem; max-width: 46ch; font-size: 1.07rem; color: #C3CCE8; }
.login-art ul { padding-left: 2.6rem; margin: .4rem 0 2.4rem; color: #C3CCE8; }
.login-art li { margin: .3rem 0; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 1.6rem; margin-bottom: .3rem; }

/* ------------------------------------------------------------------ workspace */
body.ws { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.ws-top { background: var(--ink); color: #D6DDF2; display: flex; align-items: center; gap: 1.2rem; padding: .5rem 1rem;
          border-bottom: 3px double rgba(198,47,47,.7); }
.ws-top .brand { padding: 0; font-size: 1.15rem; }
.ws-top .ev { font-size: .88rem; line-height: 1.25; }
.ws-top .ev strong { color: #fff; display: block; font-size: .98rem; }
.ws-top .who { text-align: right; font-size: .85rem; line-height: 1.25; }
.ws-top .who strong { color: #fff; }
.ws-top form { margin: 0; }
.timer-box { margin-left: auto; display: flex; align-items: center; gap: .55rem; }
.timer { font-family: var(--serif); font-weight: 650; font-size: 1.2rem; padding: .15rem .7rem; border-radius: 5px; background: rgba(255,255,255,.1);
         color: #fff; font-variant-numeric: tabular-nums lining-nums; }
.timer.warn { background: var(--amber); }
.ws-main { flex: 1; display: flex; min-height: 0; }
.ws-left { width: 36%; min-width: 300px; overflow: auto; background: var(--sheet); border-right: 1px solid var(--rule); padding: 1.3rem 1.5rem; font-size: .95rem; }
.ws-left h1 { font-size: 1.4rem; } .ws-left h2 { font-size: 1.1rem; margin-top: 1.3rem; } .ws-left h3 { margin-top: 1rem; }
.ws-left table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; font-size: .88rem; }
.ws-left th { text-align: left; border-bottom: 2px solid var(--ink); padding: .35rem .45rem; }
.ws-left td { border-bottom: 1px solid var(--rule); padding: .35rem .45rem; vertical-align: top; }
.ws-left pre { background: #F3F6FD; border: 1px solid var(--rule); padding: .7rem; border-radius: 5px; overflow: auto; font-size: .85rem; }
.ws-left hr { border: 0; border-top: 1px solid var(--rule); margin: 1.6rem 0; }
.ws-right { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #1E2230; }
.ws-toolbar { display: flex; gap: .45rem; align-items: center; padding: .5rem .7rem; background: #262B3B; color: #CFD6E6; flex-wrap: wrap; }
.ws-toolbar .btn { padding: .36rem .8rem; font-size: .9rem; }
.ws-toolbar .btn-dark { background: #323950; border-color: #3E4763; }
.ws-toolbar .btn-dark:hover { background: #3A4260; }
.ws-editor { flex: 1 1 60%; min-height: 120px; position: relative; overflow: hidden; }
.ws-editor .CodeMirror { height: 100%; font-family: var(--mono); font-size: 15px; }
.ws-editor textarea.fallback { width: 100%; height: 100%; border: 0; resize: none; padding: .8rem; background: #1E2230; color: #E6E9F2;
                               font: 15px/1.5 var(--mono); tab-size: 4; outline: none; }
.ws-terminal { flex: 1 1 40%; min-height: 120px; display: flex; flex-direction: column; background: #0E1219; border-top: 1px solid #2E3548; }
.term-head { display: flex; align-items: center; gap: .6rem; padding: .35rem .7rem; color: #9AA4B8; font-size: .84rem; background: #161B26; }
.term-head strong { color: #E2E7F5; font-family: var(--serif); font-weight: 600; }
.term-head code { background: none; color: inherit; }
.ws-terminal pre { flex: 1; margin: 0; padding: .7rem .9rem; overflow: auto; color: #E6EDF3; font: 14px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; }
.ws-terminal .err { color: #FF9A9A; } .ws-terminal .sys { color: #92B2FF; } .ws-terminal .typed { color: #84E39B; }
.term-input { display: flex; border-top: 1px solid #222A38; }
.term-input span { padding: .5rem .7rem; color: #84E39B; font-family: var(--mono); }
.term-input input { flex: 1; background: #0E1219; color: #84E39B; border: 0; outline: none; font: 14px var(--mono); padding: .5rem 0; }
.term-input input:focus-visible { outline: none; }
.term-input:focus-within { box-shadow: inset 3px 0 0 #84E39B; }
.term-input input:disabled { color: #4A5266; }
.save-status { font-size: .84rem; padding: .18rem .6rem; border-radius: 4px; background: #323950; color: #CFD6E6; }
.save-status.saved { background: #163F2A; color: #84E39B; }
.save-status.saving { background: #43391A; color: #F2CC60; }
.save-status.failed { background: #4D1F1F; color: #FFA3A3; }
.ws-banner { padding: .55rem 1rem; font-weight: 600; text-align: center; }
.ws-banner.ended { background: var(--red-soft); color: var(--red); }
.ws-banner.submitted { background: var(--moss-soft); color: var(--moss); }
body.fullscreen .ws-left { display: none; }
body.light .ws-right { background: #fff; }
body.light .ws-toolbar { background: #EEF1F8; color: var(--text); }
body.light .ws-toolbar .btn-dark { background: #fff; border-color: var(--rule-strong); color: var(--ink); }
body.light .ws-terminal, body.light .term-input input { background: #FBFCFE; }
body.light .ws-terminal pre { color: var(--text); }
body.light .term-head { background: #EEF1F8; color: var(--muted); }
body.light .term-head strong { color: var(--ink); }
body.light .ws-editor textarea.fallback { background: #fff; color: var(--text); }

/* ------------------------------------------------------------------ dialog */
.modal-back { position: fixed; inset: 0; background: rgba(18,26,52,.55); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-back.show { display: flex; }
.modal { background: #fff; border-radius: 8px; padding: 1.5rem 1.6rem; max-width: 480px; width: 92%; border-top: 4px solid var(--blue); }
.modal .row { justify-content: flex-end; margin-top: 1.2rem; }

/* ------------------------------------------------------------------ statement (rendered markdown) */
.statement table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; font-size: .9rem; }
.statement th { text-align: left; border-bottom: 2px solid var(--ink); padding: .4rem .5rem; }
.statement td { border-bottom: 1px solid var(--rule); padding: .4rem .5rem; vertical-align: top; }
.statement pre { background: #F3F6FD; border: 1px solid var(--rule); padding: .7rem; border-radius: 5px; overflow: auto; }


/* ------------------------------------------------------------------ live status */
.live { display: inline-flex; align-items: center; gap: .4rem; padding: .08rem .55rem .08rem .45rem; border-radius: 4px;
        background: var(--moss-soft); color: var(--moss); font: 600 .82rem/1.5 var(--sans); white-space: nowrap; vertical-align: middle; }
.pulse { width: .55rem; height: .55rem; border-radius: 50%; background: #1FA35B; position: relative; flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #1FA35B; animation: pulse 1.6s ease-out infinite; }
.live .pulse { animation: blink 1.6s ease-in-out infinite; }
@keyframes pulse { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.refresh-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: -.6rem 0 1rem; }
.refresh-bar label { display: inline-flex; gap: .35rem; align-items: center; color: var(--muted); }
.refresh-bar .live { font-size: .92rem; padding: .2rem .7rem .2rem .55rem; }

/* ------------------------------------------------------------------ charts */
.analysis .cols { margin-bottom: 1.2rem; }
svg.chart { display: block; width: 100%; max-width: 640px; height: auto; overflow: visible; font-family: var(--sans); }
svg.chart text { font-size: 13.5px; fill: var(--text); }
svg.chart text.v { font-weight: 600; font-variant-numeric: tabular-nums; }
svg.chart text.on { font-size: 13px; font-weight: 700; }
svg.chart g:hover path, svg.chart g:hover rect[fill]:not([fill="transparent"]), svg.chart g:hover circle { opacity: .82; }
svg.pie { max-width: 190px; flex: none; }
.pie-row { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.legend { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.3rem; font-size: .92rem; }
.pie-row .legend { flex-direction: column; margin: 0; }
.sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .45rem; vertical-align: -.05em; }
.menu-grid { display: grid; gap: 1.2rem 2rem; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.menu-grid h3 { font-size: 1rem; margin-bottom: .5rem; }
details.as-table { margin-top: .7rem; }
details.as-table summary { cursor: pointer; color: var(--blue); font-size: .88rem; font-weight: 600; }
details.as-table table { margin-top: .4rem; max-width: 420px; }


/* ------------------------------------------------------------------ LIVE badge (event running) */
.live-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .5rem .1rem .42rem; border-radius: 4px;
              background: #D62828; color: #fff; font: 700 .74rem/1.45 var(--sans); letter-spacing: .06em; vertical-align: middle;
              animation: live-blink 1.2s ease-in-out infinite; white-space: nowrap; }
.live-badge .dot { width: .45rem; height: .45rem; border-radius: 50%; background: #fff; }
h1 .live-badge { font-size: .8rem; margin-left: .35rem; vertical-align: .3em; }
.ws-top .live-badge { margin-left: .3rem; font-size: .68rem; }
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .7rem; box-shadow: none;
             border-bottom: 3px double rgba(198,47,47,.7); }
  .brand { padding: 0 .7rem; }
  .nav { flex-direction: row; flex-wrap: wrap; padding: 0; }
  .side-user { margin: 0 0 0 auto; border: 0; padding: 0 .7rem; display: flex; gap: .6rem; align-items: center; }
  .side-user form { margin: 0; }
  .page { padding: 1.4rem 1rem 2rem; }
  .cols { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 2rem 1.6rem; } .login-art p, .login-art ul { display: none; } .login-art h1 { font-size: 1.9rem; margin-top: 1.4rem; }
  .ticket { grid-template-columns: 1fr; } .ticket-side { border-left: 0; border-top: 2px dashed var(--rule-strong); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .pulse::after { display: none; } }

/* ------------------------------------------------------------------ exam protection: form */
.protect-options { display: grid; gap: .55rem; }
.protect-options label.check { align-items: flex-start !important; margin: 0 !important; padding: .6rem .75rem; border: 1px solid var(--rule);
                                border-radius: 5px; background: #fff; font-size: .92rem; }
.protect-options input { margin-top: .25rem; }
.protect-options label.check:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }

/* ------------------------------------------------------------------ exam protection: workspace */
.protect-note { background: var(--amber-soft); border-left: 4px solid var(--amber); color: #5B3B00; padding: .6rem .8rem;
                border-radius: 4px; font-size: .88rem; margin-bottom: 1.1rem; }
body.no-copy #statement { -webkit-user-select: none; user-select: none; }
.toast { position: fixed; left: 50%; bottom: 1.6rem; transform: translate(-50%, 1rem); background: var(--ink); color: #fff;
         padding: .7rem 1.1rem; border-radius: 6px; font-weight: 600; font-size: .95rem; box-shadow: 0 6px 24px rgba(18,26,52,.35);
         opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; border-left: 4px solid var(--red); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.watermark { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 40; background-repeat: repeat; }
.shield { display: none; position: fixed; inset: 0; z-index: 70; background: rgba(18,26,52,.96); color: #E2E7F5;
          align-items: center; justify-content: center; text-align: center; padding: 2rem; cursor: pointer; }
.shield h2 { color: #fff; font-size: 1.6rem; }
.shield p { max-width: 46ch; margin: .5rem auto 1.2rem; }
body.shielded #shield { display: flex; }
body.shielded .ws-main { filter: blur(18px); }
#fs-gate { cursor: default; }
#fs-gate.show { display: flex; }
@media print {
  body.protected * { display: none !important; }
  body.protected::before { content: "Printing is turned off during the hackathon."; display: block; padding: 2rem; font: 16px sans-serif; }
}

/* ------------------------------------------------------------------ breaks and pauses */
.state-badge { display: inline-flex; align-items: center; padding: .1rem .5rem; border-radius: 4px; font: 700 .74rem/1.45 var(--sans);
               letter-spacing: .06em; vertical-align: middle; white-space: nowrap; }
.state-badge.break { background: var(--amber-soft); color: var(--amber); border: 1px solid #E8C77A; }
.state-badge.paused { background: #7D1D1D; color: #fff; }
h1 .state-badge { font-size: .8rem; margin-left: .35rem; vertical-align: .3em; }
.ws-top .state-badge { margin-left: .3rem; font-size: .68rem; }
.time-panel.is-paused { border-color: #E3A3A3; box-shadow: inset 4px 0 0 var(--red); }
.extra-form { display: inline-flex; gap: .25rem; align-items: center; margin: 0; }
.extra-form select { width: auto; padding: .2rem .3rem; font-size: .82rem; }
.break-rows { display: grid; gap: .45rem; }
.break-rows .row { flex-wrap: nowrap; }
.break-rows input[type=time] { width: 8.5rem; padding: .45rem .5rem; border: 1px solid var(--rule-strong); border-radius: 5px; font: inherit; }
.hold-overlay { display: none; position: fixed; inset: 0; z-index: 75; background: rgba(18,26,52,.95); color: #E2E7F5;
                align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.hold-overlay.show { display: flex; }
.hold-overlay h2 { color: #fff; font-size: 1.7rem; margin-bottom: .4rem; }
.hold-overlay p { max-width: 48ch; margin: .4rem auto; }
.hold-overlay .countdown { color: #fff; font-size: 2.6rem; margin: .8rem 0; }
.hold-overlay.paused { background: rgba(70,16,16,.95); }

/* Copy-case decisions */
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin-bottom: .6rem; }
.case-panel { margin-bottom: 0; }
.case-now { margin: .2rem 0 .8rem; line-height: 1.6; }
.case-form fieldset { border: 0; padding: 0; margin: 0 0 .6rem; display: grid; gap: .35rem; }
.case-choice { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem .6rem; border: 1px solid var(--rule-strong);
  border-radius: var(--radius); cursor: pointer; }
.case-choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.case-choice input { margin-top: .25rem; }
.case-form textarea { width: 100%; margin: .25rem 0 .6rem; font-family: var(--sans); font-size: .95rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Register only some students */
.subrow td { padding-top: 0; border-top: 0; }
.reg-some summary { cursor: pointer; color: var(--blue); font-size: .9rem; padding: .2rem 0; }
.reg-some-form { margin-top: .6rem; }
.reg-some-form fieldset { border: 0; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; }
.reg-some-form legend { font-weight: 600; font-size: .85rem; margin-bottom: .25rem; padding: 0; }
