/* EZSteno — exam-hall paper, fountain-pen blue, examiner's red pen. No build step. */
:root {
  --ink: #102a43; --muted: #52606d; --paper: #f5f7fa; --surface: #fff; --line: #d9e2ec;
  --pen: #2340a0; --pen-dark: #182f7a; --full: #b42318; --half: #b54708; --pass: #1f7a4d;
  --radius: 8px; --font: "Hind", "Nirmala UI", "Mangal", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--pen); }
a:hover { color: var(--pen-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; border-radius: 4px; }
.tabular { font-variant-numeric: tabular-nums; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 46rem; }
.section { padding: 2.5rem 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.spacer { flex: 1; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header nav { display: flex; align-items: center; gap: 1.25rem; padding: .75rem 0; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.site-header nav a:not(.brand):not(.btn) { color: var(--muted); text-decoration: none; }
.site-header nav a:not(.brand):not(.btn):hover { color: var(--ink); }
.badge-dot { display: inline-block; min-width: 1.2rem; padding: 0 .3rem; border-radius: 99px; background: var(--full); color: #fff; font-size: .75rem; text-align: center; }
.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .875rem; }
.notice { background: #fff8e6; border-bottom: 1px solid #f3d27a; padding: .6rem 0; font-size: .95rem; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem 1.2rem; border-radius: var(--radius);
  border: 1px solid rgba(16,42,67,.2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--pen); color: var(--ink); }
.btn-primary { background: var(--pen); border-color: var(--pen); color: #fff; }
.btn-primary:hover { background: var(--pen-dark); color: #fff; }
.btn-danger { border-color: var(--full); color: var(--full); }
.btn-sm { padding: .3rem .7rem; font-size: .875rem; font-weight: 500; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.1rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--pen); cursor: pointer; text-decoration: underline; }
label { display: block; font-weight: 500; }
input[type=text], input[type=email], input[type=number], input[type=password], input[type=tel], input[type=search], input[type=datetime-local], input[type=file], select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
textarea { line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--pen); outline: none; box-shadow: 0 0 0 3px rgba(35,64,160,.15); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.check input { width: 1.1rem; height: 1.1rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: .85rem; color: var(--muted); font-weight: 400; }

/* Cards, stats, tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--pen); }
.stat dt { font-size: .85rem; color: var(--muted); }
.stat dd { margin: 0; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.callout { border-left: 4px solid var(--pen); background: var(--surface); padding: 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper); font-weight: 500; font-size: .875rem; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: .05rem .55rem; border-radius: 99px; font-size: .8rem; background: var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { background: rgba(31,122,77,.12); color: var(--pass); }
.pill.warn { background: rgba(181,71,8,.12); color: var(--half); }
.pill.bad { background: rgba(180,35,24,.1); color: var(--full); }
.text-pass { color: var(--pass); } .text-full { color: var(--full); } .text-half { color: var(--half); }
.flash { padding: .7rem 1rem; border-radius: var(--radius); margin: 1rem 0; }
.flash.ok { background: rgba(31,122,77,.1); border: 1px solid rgba(31,122,77,.3); }
.flash.error { background: rgba(180,35,24,.08); border: 1px solid rgba(180,35,24,.3); }
.prose h2, .prose h3 { margin-top: 1.5rem; }
.prose ul { padding-left: 1.2rem; }
details summary { cursor: pointer; font-weight: 600; }
.bar { height: .5rem; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--pen); }

/* Hero */
.hero { display: grid; gap: 3rem; grid-template-columns: 1.1fr 1fr; align-items: center; padding: 3.5rem 0 3rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.05; letter-spacing: -.02em; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 34rem; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; padding-top: 2rem; } }

/* Examiner marks on transcripts */
.marked { font-size: 1.1rem; line-height: 2.4; }
.mark-full { color: var(--full); text-decoration: line-through; text-decoration-thickness: 2px; }
.mark-half { text-decoration: underline wavy var(--half); text-underline-offset: 4px; }
.mark-add { color: var(--full); border: 1.5px solid var(--full); border-radius: 99px; padding: 0 .3em; }
.mark-omit { color: var(--full); font-weight: 600; }
.mark-correction { color: var(--full); font-size: .78em; vertical-align: super; margin-left: .15em; }
.mark-ignored { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .875rem; color: var(--muted); list-style: none; padding: 0; margin: 0; }

/* Exam runner */
.runner { min-height: 100vh; display: flex; flex-direction: column; }
.runner-center { max-width: 48rem; margin: 0 auto; padding: 3rem 1.25rem; width: 100%; }
.countdown { font-size: clamp(5rem, 14vw, 9rem); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; }
.clock { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock.low { color: var(--full); }
.tr-bar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.tr-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding-top: .6rem; padding-bottom: .6rem; }
#transcript { width: 100%; height: calc(100vh - 10rem); resize: none; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); line-height: 1.7; }
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(16,42,67,.65); }
.overlay .card { max-width: 28rem; }
.no-select { user-select: none; -webkit-user-select: none; }
.desktop-only-note { display: none; }
@media (max-width: 760px) { .desktop-only-note { display: block; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: .3rem 1rem; padding: .75rem 0 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; font-size: .95rem; }
.admin-nav a { color: var(--muted); text-decoration: none; }
.admin-nav a.on, .admin-nav a:hover { color: var(--ink); font-weight: 600; }
.chart { width: 100%; height: 9rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875em; }
pre { background: var(--paper); padding: .75rem; border-radius: 6px; overflow-x: auto; }

/* Invoice print */
@media print { .site-header, .site-footer, .no-print { display: none !important; } body { background: #fff; } .card { border: 0; } }
