/* Pontozó – styles follow the new tancsics.hu design tokens (@tancsics/ui). */
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/inter-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4 Variable'; font-style: normal; font-display: swap; font-weight: 200 900; src: url(../fonts/source-serif-4-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4 Variable'; font-style: normal; font-display: swap; font-weight: 200 900; src: url(../fonts/source-serif-4-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --tm-color-primary: #0e2c4a;
  --tm-color-primary-600: #1a4775;
  --tm-color-primary-400: #3d6ea3;
  --tm-color-accent: #88c8ee;
  --tm-color-highlight: #b8892b;
  --tm-color-bg: #f7f6f2;
  --tm-color-surface: #ffffff;
  --tm-color-surface-2: #eef1f5;
  --tm-color-border: #d9dee6;
  --tm-color-text: #1c2430;
  --tm-color-text-muted: #556274;
  --tm-color-on-primary: #ffffff;
  --tm-color-link: #1a4775;
  --tm-color-focus: #f2b134;
  --tm-color-heading: #0e2c4a;
  --tm-color-highlight-text: #8a5f0b;
  /* event accents from the two logos */
  --sf-cyan: #00b8f0;
  --sf-blue: #0050e6;
  --sf-orange: #fbab00;
  --otio-purple: #7a3e76;
  --otio-pink: #e01380;
  --ok: #1e7a4c;
  --ok-bg: #e3f4ea;
  --warn: #8a5f0b;
  --warn-bg: #fbf1dc;
  --danger: #b3261e;
  --danger-bg: #fbe7e5;

  --tm-font-sans: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tm-font-serif: 'Source Serif 4 Variable', 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --tm-font-size-sm: 0.875rem;
  --tm-font-size-base: 1rem;
  --tm-radius-sm: 6px;
  --tm-radius: 12px;
  --tm-radius-lg: 20px;
  --tm-shadow-sm: 0 1px 2px rgb(14 44 74 / 0.06), 0 1px 3px rgb(14 44 74 / 0.08);
  --tm-shadow: 0 4px 12px rgb(14 44 74 / 0.08), 0 2px 4px rgb(14 44 74 / 0.06);
  --tm-shadow-lg: 0 18px 40px rgb(14 44 74 / 0.16);
  --tm-transition: 160ms cubic-bezier(0.2, 0.6, 0.2, 1);
  --container: 80rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --tm-color-bg: #0d141d;
    --tm-color-surface: #141e2b;
    --tm-color-surface-2: #1b2838;
    --tm-color-border: #2a3a4f;
    --tm-color-text: #e6ebf2;
    --tm-color-text-muted: #9fb0c4;
    --tm-color-link: #9fd3f3;
    --tm-color-primary-400: #88c8ee;
    --tm-color-heading: #f2f5f9;
    --tm-color-highlight-text: #e3bd6a;
    --ok: #7fd6a6; --ok-bg: #12301f; --warn: #e3bd6a; --warn-bg: #33270e; --danger: #f2a39c; --danger-bg: #3a1714;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --tm-color-bg: #0d141d;
  --tm-color-surface: #141e2b;
  --tm-color-surface-2: #1b2838;
  --tm-color-border: #2a3a4f;
  --tm-color-text: #e6ebf2;
  --tm-color-text-muted: #9fb0c4;
  --tm-color-link: #9fd3f3;
  --tm-color-primary-400: #88c8ee;
  --tm-color-heading: #f2f5f9;
  --tm-color-highlight-text: #e3bd6a;
  --ok: #7fd6a6; --ok-bg: #12301f; --warn: #e3bd6a; --warn-bg: #33270e; --danger: #f2a39c; --danger-bg: #3a1714;
  color-scheme: dark;
}


/* dark mode: navy buttons would vanish on the dark background; logos keep a white plate */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn-primary { background: var(--tm-color-accent); color: #0e2c4a; }
  :root:not([data-theme='light']) .btn-primary:hover { background: #a9d8f3; }
  :root:not([data-theme='light']) .code-badge { background: #2b5a8a; }
  :root:not([data-theme='light']) .scale button[aria-pressed='true'] { background: var(--tm-color-accent); color: #0e2c4a; border-color: var(--tm-color-accent); }
  :root:not([data-theme='light']) .login-logos { background: #fff; border-radius: var(--tm-radius); padding: 0.75rem; }
  :root:not([data-theme='light']) .site-header { background: #0a2038; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--tm-color-bg); color: var(--tm-color-text);
  font-family: var(--tm-font-sans); font-size: var(--tm-font-size-base); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--tm-color-link); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--tm-color-focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--tm-font-serif); line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; color: var(--tm-color-heading); text-wrap: balance; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.8em; }
[hidden] { display: none !important; }
.muted { color: var(--tm-color-text-muted); }
.small { font-size: var(--tm-font-size-sm); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 clamp(1rem, 0.5rem + 2vw, 2rem); }

/* ---------- header (navy band like tancsics.hu) */
.site-header { background: var(--tm-color-primary); color: var(--tm-color-on-primary); position: sticky; top: 0; z-index: 20; box-shadow: var(--tm-shadow); }
.site-header::after { content: ''; display: block; height: 4px; background: linear-gradient(90deg, var(--sf-cyan), var(--sf-blue) 45%, var(--otio-purple) 70%, var(--otio-pink) 85%, var(--sf-orange)); }
.site-header .container { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; color: inherit; text-decoration: none; min-width: 0; }
.brand-logos { display: flex; gap: 0.4rem; flex: none; }
.brand-logos img { height: 2.6rem; width: 2.6rem; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-family: var(--tm-font-serif); font-size: 1.1rem; font-weight: 650; }
.brand-text span { font-size: 0.78rem; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.header-actions .who { font-size: 0.9rem; opacity: 0.9; }

/* admin nav */
.admin-nav { background: var(--tm-color-surface); border-bottom: 1px solid var(--tm-color-border); position: sticky; top: calc(4rem + 4px); z-index: 15; }
.admin-nav .container { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: thin; }
.admin-nav button { appearance: none; border: 0; background: none; font: inherit; font-size: 0.93rem; font-weight: 550; color: var(--tm-color-text-muted); padding: 0.8rem 0.9rem; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.admin-nav button:hover { color: var(--tm-color-heading); }
.admin-nav button[aria-current='page'] { color: var(--tm-color-heading); border-bottom-color: var(--tm-color-highlight); }

/* ---------- buttons & inputs */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; font: inherit; font-weight: 600; font-size: 0.93rem; line-height: 1.2;
  padding: 0.6rem 1rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background var(--tm-transition), border-color var(--tm-transition), transform var(--tm-transition); white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--tm-color-primary); color: #fff; }
.btn-primary:hover { background: var(--tm-color-primary-600); }
.btn-secondary { background: var(--tm-color-surface); color: var(--tm-color-heading); border-color: var(--tm-color-border); }
.btn-secondary:hover { border-color: var(--tm-color-primary-400); }
.btn-ghost { background: transparent; color: inherit; border-color: transparent; }
.btn-ghost:hover { background: rgb(127 127 127 / 0.12); }
.btn-gold { background: var(--tm-color-highlight); color: #fff; }
.btn-danger { background: var(--tm-color-surface); color: var(--danger); border-color: currentColor; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.83rem; }
.btn-lg { padding: 0.85rem 1.4rem; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.site-header .btn-ghost { color: #fff; }
.site-header .btn-secondary { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.4); }

input[type='text'], input[type='password'], input[type='email'], input[type='number'], input[type='search'], input[type='datetime-local'], select, textarea {
  font: inherit; color: inherit; background: var(--tm-color-surface); border: 1px solid var(--tm-color-border); border-radius: var(--tm-radius-sm);
  padding: 0.55rem 0.7rem; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 5rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tm-color-accent); outline-offset: 0; border-color: var(--tm-color-primary-400); }
label { font-weight: 550; font-size: 0.9rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field .hint { font-size: 0.8rem; color: var(--tm-color-text-muted); font-weight: 400; }
.form-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); align-items: end; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 450; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--tm-color-primary); }
.chips-input { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }

/* ---------- layout pieces */
.page { padding-top: 1.75rem; padding-bottom: 4rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.5rem; margin-bottom: 1.25rem; }
.page-head h1, .page-head h2 { margin: 0; }
.page-head .lead { color: var(--tm-color-text-muted); margin: 0.3rem 0 0; max-width: 60ch; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tm-color-highlight-text); margin-bottom: 0.3rem; }

.card { background: var(--tm-color-surface); border: 1px solid var(--tm-color-border); border-radius: var(--tm-radius); box-shadow: var(--tm-shadow-sm); padding: 1.25rem; }
.card + .card, .grid-2 + .card, .card + .grid-2, .stats + .card, .toolbar.card + .card { margin-top: 1rem; }
.upload-zone { display: flex; flex-direction: column; height: 100%; }
.upload-zone .btn { align-self: flex-start; margin-top: auto; }
.upload-zone.drop-target { outline: 3px dashed var(--tm-color-accent); }
.grid-2 { margin-bottom: 1rem; }
.card h2, .card h3 { margin-bottom: 0.6rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 0.9rem; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); margin-bottom: 1.25rem; }
.stat { background: var(--tm-color-surface); border: 1px solid var(--tm-color-border); border-radius: var(--tm-radius); padding: 1rem 1.1rem; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tm-color-accent); }
.stat.warn::before { background: var(--tm-color-highlight); }
.stat.ok::before { background: var(--ok); }
.stat .v { font-family: var(--tm-font-serif); font-size: 2rem; font-weight: 650; color: var(--tm-color-heading); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 0.85rem; color: var(--tm-color-text-muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.toolbar input[type='search'] { max-width: 20rem; }
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--tm-color-border); border-radius: var(--tm-radius); background: var(--tm-color-surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--tm-color-border); }
th { background: var(--tm-color-surface-2); font-weight: 600; font-size: 0.8rem; color: var(--tm-color-text-muted); position: sticky; top: 0; z-index: 1; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--tm-color-accent) 9%, transparent); }
.sub { display: block; color: var(--tm-color-text-muted); font-size: 0.8rem; font-weight: 400; }
tr.is-withdrawn td { opacity: 0.5; text-decoration: line-through; }
tr.place-1 td:first-child { box-shadow: inset 4px 0 0 #d4a72c; }
tr.place-2 td:first-child { box-shadow: inset 4px 0 0 #a7b1bd; }
tr.place-3 td:first-child { box-shadow: inset 4px 0 0 #b9764a; }
.matrix td, .matrix th { text-align: center; padding: 0.35rem 0.4rem; }
.matrix td:first-child, .matrix th:first-child { text-align: left; position: sticky; left: 0; background: var(--tm-color-surface); z-index: 2; }
.matrix th:first-child { background: var(--tm-color-surface-2); z-index: 3; }
.matrix .cell-a { background: color-mix(in srgb, var(--tm-color-accent) 22%, transparent); }
.matrix .cell-done { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.matrix .cell-partial { background: var(--warn-bg); color: var(--warn); }
.th-sort { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit; }
.th-sort:hover, .th-sort.is-active { color: var(--tm-color-heading); }
.th-sort.is-active { text-decoration: underline; text-decoration-color: var(--tm-color-highlight); text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
.th-sort.vert .sort-ind { display: inline-block; }
.vert { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 10rem; overflow: hidden; text-overflow: ellipsis; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--tm-color-surface-2); color: var(--tm-color-text-muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: color-mix(in srgb, var(--tm-color-accent) 25%, transparent); color: var(--tm-color-heading); }
.code-badge { display: inline-grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding: 0 0.4rem; border-radius: 10px; background: var(--tm-color-primary); color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.place-medal { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; font-weight: 700; font-size: 0.85rem; color: #1c2430; }
.place-medal.p1 { background: #f3d36b; } .place-medal.p2 { background: #d5dbe2; } .place-medal.p3 { background: #e0a57c; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.06em; font-weight: 600; }

/* alerts */
.alert { border-radius: var(--tm-radius-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert.info { background: color-mix(in srgb, var(--tm-color-accent) 18%, var(--tm-color-surface)); border-color: color-mix(in srgb, var(--tm-color-accent) 50%, transparent); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { padding: 0.65rem 0; border-bottom: 1px solid var(--tm-color-border); }
.list-plain > li:last-child { border-bottom: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.row .grow { flex: 1; min-width: 12rem; }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 0.6rem; }

/* toast */
.toast-host { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; pointer-events: none; }
.toast { background: var(--tm-color-primary); color: #fff; padding: 0.65rem 1.1rem; border-radius: 999px; box-shadow: var(--tm-shadow-lg); font-size: 0.92rem; animation: pop 200ms ease-out; pointer-events: auto; max-width: 90vw; }
.toast.error { background: var(--danger); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* dialog */
dialog { border: 0; border-radius: var(--tm-radius-lg); padding: 0; box-shadow: var(--tm-shadow-lg); width: min(44rem, calc(100vw - 2rem)); background: var(--tm-color-surface); color: var(--tm-color-text); }
dialog::backdrop { background: rgb(14 44 74 / 0.45); }
dialog .dlg-head { padding: 1.1rem 1.4rem 0; display: flex; align-items: flex-start; gap: 1rem; }
dialog .dlg-head h2 { margin: 0; font-size: 1.3rem; }
dialog .dlg-body { padding: 1rem 1.4rem; max-height: 70vh; overflow: auto; }
dialog .dlg-foot { padding: 0 1.4rem 1.2rem; display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- login screens */
.login-wrap { flex: 1; display: grid; place-items: center; padding: 2rem 1rem; background:
  radial-gradient(60rem 30rem at 110% -10%, color-mix(in srgb, var(--sf-cyan) 18%, transparent), transparent 60%),
  radial-gradient(50rem 30rem at -10% 110%, color-mix(in srgb, var(--otio-purple) 14%, transparent), transparent 60%); }
.login-card { width: min(28rem, 100%); background: var(--tm-color-surface); border-radius: var(--tm-radius-lg); box-shadow: var(--tm-shadow-lg); padding: 2rem; text-align: center; border: 1px solid var(--tm-color-border); }
.login-logos { display: flex; justify-content: center; align-items: center; gap: 1.25rem; margin-bottom: 1.25rem; }
.login-logos img { height: 6rem; width: auto; }
.login-logos img.otio { height: 4.4rem; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.login-card form { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1.4rem; text-align: left; }
.code-input { font-size: 1.8rem !important; text-align: center; letter-spacing: 0.25em; text-transform: uppercase; font-weight: 700; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace !important; padding: 0.7rem !important; }

/* ---------- juror scoring */
.juror-layout { display: grid; grid-template-columns: minmax(18rem, 26rem) 1fr; gap: 1.25rem; align-items: start; }
.juror-list { position: sticky; top: calc(4rem + 4px + 1rem); max-height: calc(100vh - 6rem); display: flex; flex-direction: column; background: var(--tm-color-surface); border: 1px solid var(--tm-color-border); border-radius: var(--tm-radius); overflow: hidden; }
.juror-list .tabs { display: flex; border-bottom: 1px solid var(--tm-color-border); }
.juror-list .tabs button { flex: 1; appearance: none; border: 0; background: none; font: inherit; font-weight: 600; font-size: 0.9rem; padding: 0.75rem 0.5rem; color: var(--tm-color-text-muted); border-bottom: 3px solid transparent; cursor: pointer; }
.juror-list .tabs button[aria-selected='true'] { color: var(--tm-color-heading); border-bottom-color: var(--tm-color-highlight); }
.juror-list .filters { padding: 0.75rem; display: flex; gap: 0.5rem; flex-direction: column; border-bottom: 1px solid var(--tm-color-border); }
.juror-list .items { overflow-y: auto; flex: 1; }
.group-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tm-color-highlight-text); padding: 0.75rem 0.9rem 0.3rem; background: var(--tm-color-surface); position: sticky; top: 0; z-index: 1; }
.p-item { display: flex; gap: 0.7rem; align-items: center; width: 100%; text-align: left; appearance: none; background: none; border: 0; border-bottom: 1px solid var(--tm-color-border); padding: 0.65rem 0.9rem; font: inherit; color: inherit; cursor: pointer; }
.p-item:hover { background: var(--tm-color-surface-2); }
.p-item[aria-current='true'] { background: color-mix(in srgb, var(--tm-color-accent) 22%, var(--tm-color-surface)); }
.p-item .code-badge { min-width: 2.1rem; height: 2.1rem; font-size: 0.9rem; }
.p-item .t { flex: 1; min-width: 0; }
.p-item .t strong { display: block; font-weight: 600; font-size: 0.92rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-item .t span { font-size: 0.78rem; color: var(--tm-color-text-muted); }
.p-item .st { flex: none; }
.p-item.done .code-badge { background: #1e7a4c; }
.p-item.partial .code-badge { background: var(--tm-color-highlight); }

.progress { height: 8px; background: var(--tm-color-surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--sf-cyan), var(--sf-blue)); border-radius: inherit; transition: width 300ms; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--tm-color-text-muted); margin-top: 0.3rem; }

.score-panel { background: var(--tm-color-surface); border: 1px solid var(--tm-color-border); border-radius: var(--tm-radius); box-shadow: var(--tm-shadow-sm); }
.score-panel .head { padding: 1.4rem 1.5rem 1rem; border-bottom: 1px solid var(--tm-color-border); display: flex; gap: 1rem; align-items: flex-start; }
.score-panel .head .code-badge { min-width: 3.2rem; height: 3.2rem; font-size: 1.25rem; border-radius: 14px; }
.score-panel .head h2 { margin: 0 0 0.35rem; font-size: 1.45rem; }
.score-panel .meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.88rem; color: var(--tm-color-text-muted); }
.score-panel .body { padding: 1.25rem 1.5rem; }
.criterion { padding: 0.9rem 0; border-bottom: 1px dashed var(--tm-color-border); }
.criterion:first-child { padding-top: 0; }
.criterion .c-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: 0.5rem; }
.criterion .c-head strong { font-weight: 600; }
.criterion .c-head .muted { font-size: 0.8rem; white-space: nowrap; }
.scale { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.scale button { appearance: none; font: inherit; font-weight: 700; font-size: 1.05rem; min-width: 2.9rem; height: 2.9rem; border-radius: 10px; border: 1px solid var(--tm-color-border); background: var(--tm-color-surface); color: var(--tm-color-heading); cursor: pointer; font-variant-numeric: tabular-nums; transition: background var(--tm-transition), transform var(--tm-transition); }
.scale button:hover { border-color: var(--tm-color-primary-400); background: var(--tm-color-surface-2); }
.scale button.in-range { background: color-mix(in srgb, var(--tm-color-accent) 22%, var(--tm-color-surface)); border-color: color-mix(in srgb, var(--tm-color-accent) 60%, transparent); }
.scale button[aria-pressed='true'] { background: var(--tm-color-primary); color: #fff; border-color: var(--tm-color-primary); transform: scale(1.06); }
.scale.wide button { min-width: 2.6rem; }
.score-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding: 1rem 1.5rem 1.25rem; border-top: 1px solid var(--tm-color-border); background: var(--tm-color-surface-2); border-radius: 0 0 var(--tm-radius) var(--tm-radius); }
.total { font-family: var(--tm-font-serif); font-size: 1.9rem; font-weight: 650; color: var(--tm-color-heading); font-variant-numeric: tabular-nums; line-height: 1; }
.total small { font-size: 1rem; color: var(--tm-color-text-muted); font-weight: 500; }
.save-state { font-size: 0.85rem; color: var(--tm-color-text-muted); }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--danger); }
.score-foot .nav { margin-left: auto; display: flex; gap: 0.5rem; }
.empty-state { text-align: center; padding: 4rem 1.5rem; color: var(--tm-color-text-muted); }
.empty-state img { width: 7rem; opacity: 0.9; margin-bottom: 1rem; }

/* results */
.rank-cell { display: flex; align-items: center; gap: 0.35rem; }
.rank-cell .btn { padding: 0.15rem 0.4rem; min-width: 1.8rem; }
.delta { font-size: 0.75rem; font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
tr.dragging td { opacity: 0.4; }
tr.drop-target td { box-shadow: inset 0 3px 0 var(--tm-color-highlight); }
.drag-handle { cursor: grab; color: var(--tm-color-text-muted); user-select: none; padding: 0 0.2rem; }
.award-tag { display: inline-flex; font-size: 0.75rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: color-mix(in srgb, var(--otio-pink) 14%, transparent); color: var(--otio-purple); font-weight: 600; margin: 0.1rem 0.2rem 0 0; }
:root[data-theme='dark'] .award-tag { color: #f0a6d3; }

#app { flex: 1; display: flex; flex-direction: column; }
.powered-by { padding: 1rem; display: flex; justify-content: center; border-top: 1px solid var(--tm-color-border); background: var(--tm-color-bg); }
.powered-by a { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--tm-color-text-muted); text-decoration: none; font-size: 0.75rem; letter-spacing: 0.04em; transition: color var(--tm-transition); }
.powered-by a:hover, .powered-by a:focus-visible { color: var(--tm-color-heading); }
/* the wordmark is drawn as a mask, so it follows the text colour in light and dark mode */
.powered-by .pb-logo { display: inline-block; height: 0.95rem; aspect-ratio: 1488 / 224.8; background-color: currentColor;
  -webkit-mask: url(../img/uncover-wordmark.svg) center / contain no-repeat; mask: url(../img/uncover-wordmark.svg) center / contain no-repeat; }
.site-footer { padding: 1.5rem 0; color: var(--tm-color-text-muted); font-size: 0.8rem; border-top: 1px solid var(--tm-color-border); }

@media (max-width: 860px) {
  .juror-layout { grid-template-columns: 1fr; }
  .juror-list { position: static; max-height: none; }
  .juror-list .items { max-height: 45vh; }
  .brand-text span { display: none; }
  .form-grid .span-2 { grid-column: auto; }
  .score-panel .head, .score-panel .body, .score-foot { padding-left: 1rem; padding-right: 1rem; }
  .scale button { min-width: 2.6rem; height: 2.6rem; }
}

@media print {
  .site-header, .admin-nav, .toolbar, .btn, .no-print, .powered-by { display: none !important; }
  body { background: #fff; }
  .card, .table-wrap { box-shadow: none; border: 0; }
  th { position: static; }
}
