:root {
  --gold: #b8860b;
  --gold-dark: #7a5a00;
  --gold-soft: #fbf3dc;
  --gold-line: #ead9a6;
  --ink: #1f1a10;
  --muted: #6b6250;
  --bg: #faf8f3;
  --card: #ffffff;
  --line: #e7e2d6;
  --ok: #1f7a3f;
  --ok-soft: #e4f4ea;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --bad: #b3261e;
  --bad-soft: #fde7e5;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-dark); }

/* ---------- header ---------- */
.top {
  background: linear-gradient(90deg, #3b2a00, #7a5a00 55%, #b8860b);
  color: #fff; padding: 12px 20px; display: flex; align-items: center; gap: 14px;
}
.top .logo { width: 48px; height: 48px; flex: none; object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(255, 214, 120, .55)) drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.top h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: .2px; }
.top .sub { font-size: 12.5px; opacity: .85; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.top .right button { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35); color: #fff; }
.top .right button:hover { background: rgba(255,255,255,.25); }

main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
h2 { font-size: 21px; margin: 0 0 4px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- controls ---------- */
button {
  border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 8px;
  cursor: pointer; white-space: nowrap;
}
button:hover { border-color: var(--gold); }
button.primary { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; font-weight: 600; }
button.primary:hover { background: #5f4600; }
button.danger { color: var(--bad); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--gold-soft); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.big { padding: 11px 22px; font-size: 16px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
textarea { min-height: 70px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.chk { display: inline-flex; gap: 6px; align-items: center; margin-right: 14px; cursor: pointer; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; font-weight: 600;
  background: #eee; color: #555; }
.badge.open { background: var(--ok-soft); color: var(--ok); }
.badge.closed { background: #ececec; color: #555; }
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.badge.done { background: var(--gold-soft); color: var(--gold-dark); }
.badge.pub { background: #e7eefc; color: #234da0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222; color: #fff;
  padding: 10px 18px; border-radius: 8px; z-index: 100; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--bad); }

.modal-back { position: fixed; inset: 0; background: rgba(20,15,0,.45); display: flex; align-items: center;
  justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 12px; max-width: 640px; width: 100%; max-height: 90vh; overflow: auto;
  padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal.wide { max-width: 900px; }

/* ---------- login ---------- */
.login { max-width: 400px; margin: 50px auto; }
.login .card { padding: 26px; }
.err-text { color: var(--bad); font-size: 14px; min-height: 20px; }

/* ---------- voter home ---------- */
.cat-card { display: flex; flex-direction: column; gap: 8px; }
.cat-card .desc { color: var(--muted); font-size: 14px; flex: 1; }
.result-pill { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
  border: 1px solid var(--gold-line); background: var(--gold-soft); border-radius: 8px; }
.result-pill b { font-size: 22px; color: var(--gold-dark); }

/* ---------- ballot ---------- */
.steps { display: flex; gap: 8px; margin: 14px 0 16px; flex-wrap: wrap; }
.steps span { padding: 5px 12px; border-radius: 99px; background: #eee; font-size: 13px; color: #555; }
.steps span.on { background: var(--gold-dark); color: #fff; }
.ballot { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.tray { position: sticky; top: 12px; }
.tray ol { list-style: none; margin: 0; padding: 0; }
.tray li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tray li .rank { width: 26px; height: 26px; border-radius: 50%; background: var(--gold-dark); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.tray li.empty .rank { background: #ddd; }
.tray li .who { flex: 1; min-width: 0; font-size: 14px; }
.tray li .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray li button { padding: 2px 7px; }
.progress { height: 6px; background: #eee; border-radius: 9px; overflow: hidden; margin: 8px 0 12px; }
.progress div { height: 100%; background: var(--gold); transition: width .2s; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters input { flex: 2; min-width: 200px; }
.filters select { flex: 1; min-width: 160px; width: auto; }
.az { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 10px; }
.az button { padding: 3px 0; width: 28px; font-size: 13px; border-radius: 6px; }
.az button.on { background: var(--gold-dark); color: #fff; border-color: var(--gold-dark); }
.az button:disabled { opacity: .3; }
.nlist { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: 64vh; overflow: auto; }
.nlist .letter { position: sticky; top: 0; background: var(--gold-soft); color: var(--gold-dark); font-weight: 700;
  padding: 3px 14px; font-size: 13px; border-bottom: 1px solid var(--gold-line); }
.nrow { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #f1eee6;
  cursor: pointer; user-select: none; }
.nrow:hover { background: #fdfaf1; }
.nrow.sel { background: var(--gold-soft); }
.nrow .box { width: 22px; height: 22px; border: 2px solid #c9bf9f; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 12px; }
.nrow.sel .box { background: var(--gold-dark); border-color: var(--gold-dark); }
.nrow .who { flex: 1; min-width: 0; }
.nrow .name { font-weight: 600; }
.nrow .meta { font-size: 13px; color: var(--muted); }
.nrow.full:not(.sel) { opacity: .45; cursor: not-allowed; }
.nrow.opted { background: #f4f3f0; cursor: not-allowed; }
.nrow.opted:hover { background: #f4f3f0; }
.nrow.opted .name, .nrow.opted .meta { color: #9a968c; }
.nrow.opted .box { border-color: #d5d1c6; color: #aaa59a; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.nrow .opted-note { font-size: 12px; color: #8a6200; font-style: italic; margin-top: 1px; }
.order-bar { margin: 8px 0 12px; border-color: #e8b43a; background: #fff6df; }
.count-line { font-size: 13px; color: var(--muted); margin: 6px 2px; }

.qcard { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 16px; margin-bottom: 14px; }
.qcard .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qcard .head .rank { width: 30px; height: 30px; border-radius: 50%; background: var(--gold-dark); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.q { margin: 12px 0; }
.q .qt { font-weight: 600; margin-bottom: 6px; font-size: 14.5px; }
.rate { display: flex; gap: 6px; flex-wrap: wrap; }
.rate button { width: 48px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.rate button small { font-size: 10px; color: var(--muted); }
.rate button.on { background: var(--gold-dark); color: #fff; border-color: var(--gold-dark); }
.rate button.on small { color: #f3e3b4; }
.q.missing .qt { color: var(--bad); }
.q.missing .hodscale { outline: 2px solid var(--bad); outline-offset: 4px; border-radius: 6px; }
.hodscale button { width: 42px; padding: 8px 0; font-weight: 600; }
.qcard input.hc { margin-top: 4px; }

/* ---------- category editor ---------- */
.etabs { margin: 6px 0 16px; }
.etabs button { padding: 8px 10px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 14px; }
.chip input:checked + span { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-dark); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--gold); }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.srow.off { background: #faf9f6; }
.srow.off .sw, .srow.off .sset { opacity: .4; }
.srow .chk { align-items: flex-start; }
.qh.hi { display: none; }
.show-hi .qh.hi { display: block; }
.station-bar { background: #1f7a3f; color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 12px; font-weight: 600; }
.station-bar button { margin-left: auto; background: #fff; color: #1f7a3f; border: none; font-weight: 700; }

/* ---------- certificates ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tpl-grid .card + .card { margin-top: 0; }
.tpl-card img { width: 100%; aspect-ratio: 1.41; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f3efe4; }
.modal.modal-xl { max-width: 1280px; width: 96vw; max-height: 96vh; }
.designer { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.canvas { position: relative; user-select: none; touch-action: none; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.canvas img { width: 100%; display: block; pointer-events: none; }
.canvas .el { position: absolute; cursor: move; line-height: 1; outline: 1px dashed rgba(122, 90, 0, .45); outline-offset: 2px; }
.canvas .el.sel { outline: 2px solid #1b6fb8; z-index: 2; }
.canvas .el-line { height: 0; padding: 4px 0 0; }
.canvas .el-qr { background: repeating-conic-gradient(#222 0 25%, #fff 0 50%) 0 0 / 8px 8px; color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; text-shadow: 0 0 2px #000; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 78vh; overflow: auto; }
.phs { display: flex; flex-wrap: wrap; gap: 4px; }
.phs .ph { padding: 2px 6px; font-size: 12px; font-family: Consolas, monospace; }
.el-row { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-row:hover { background: var(--gold-soft); }
.tplpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tplpick label { cursor: pointer; border: 2px solid var(--line); border-radius: 8px; padding: 4px; font-size: 12px; text-align: center; }
.tplpick input { position: absolute; opacity: 0; }
.tplpick label:has(input:checked) { border-color: var(--gold-dark); background: var(--gold-soft); font-weight: 600; }
.tplpick img { width: 100%; aspect-ratio: 1.41; object-fit: cover; border-radius: 4px; display: block; margin-bottom: 4px; }
.simple-ed { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 14px; align-items: start; }
.simple-ed .panel { max-height: 80vh; }
.simple-ed h3 { margin: 14px 0 8px; }
.sbox { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: #fffdf8; }
button.small { padding: 3px 8px; font-size: 12.5px; }
@media (max-width: 900px) { .designer, .simple-ed { grid-template-columns: 1fr; } }

/* ---------- charts ---------- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 16px; }
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.chart-card h3 { margin-bottom: 2px; }
.chart-card .cap { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sbar { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr) 46px; gap: 8px; align-items: center;
  padding: 4px 0; font-size: 13px; cursor: default; }
.sbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar .track { display: flex; gap: 2px; height: 16px; }
.sbar .track span { height: 100%; }
.sbar .track span:first-child { border-radius: 4px 0 0 4px; }
.sbar .track span:last-child { border-radius: 0 4px 4px 0; }
.sbar .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sbar:hover .nm { color: var(--gold-dark); font-weight: 600; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin-bottom: 16px; }
.podium .pl { background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: center; padding: 14px 10px; min-width: 0; }
.podium .pl .medal { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 20px; }
.podium .pl.g { background: linear-gradient(160deg, #fff8e1, #fbeec2); border-color: var(--gold-line); padding: 22px 10px; }
.podium .pl.g .medal { background: radial-gradient(circle at 35% 35%, #fff2b8, #e0b53a 60%, #a37a10); color: #5f4600; width: 58px; height: 58px; }
.podium .pl.s .medal { background: radial-gradient(circle at 35% 35%, #ffffff, #c9ccd1 60%, #8c9097); color: #3d4046; }
.podium .pl.b .medal { background: radial-gradient(circle at 35% 35%, #ffe2c4, #cd8a4f 60%, #8a5426); color: #4a2a0c; }
.podium .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .sc { font-size: 22px; font-weight: 800; color: var(--gold-dark); }
.tip { position: fixed; pointer-events: none; background: #1f1a10; color: #fff; font-size: 12.5px; padding: 8px 10px;
  border-radius: 8px; z-index: 60; max-width: 280px; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.tip b { color: #ffe9a3; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.cols .c { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; height: 100%; }
.cols .c span { width: 100%; max-width: 48px; background: var(--gold); border-radius: 4px 4px 0 0; }
.cols .c em { font-style: normal; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.cols-x { display: flex; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.cols-x span { flex: 1; text-align: center; min-width: 0; }
.ring { display: flex; gap: 12px; align-items: center; }

.done-box { text-align: center; padding: 34px 20px; }
.done-box .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 10px 14px;
  font-weight: 600; color: var(--muted); }
.tabs button.on { color: var(--gold-dark); border-bottom-color: var(--gold-dark); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile b { display: block; font-size: 26px; color: var(--gold-dark); }
.tile span { font-size: 13px; color: var(--muted); }
table.t { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #efebe1; vertical-align: middle; }
table.t th { background: #f6f2e7; font-size: 12.5px; color: var(--muted); font-weight: 700; position: sticky; top: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.top10 td { background: #fffbef; }
table.t tr.winner td { background: var(--gold-soft); font-weight: 600; }
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); max-height: 70vh; }
.bar { height: 8px; background: #eee; border-radius: 9px; overflow: hidden; min-width: 80px; }
.bar div { height: 100%; background: var(--gold); }
.editor-list .item { display: grid; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.editor-list .qitem { grid-template-columns: minmax(0, 1fr) 130px auto auto; }
.editor-list .citem { grid-template-columns: minmax(0, 1fr) 210px 90px minmax(0, 200px) auto; }
.weight-total { font-weight: 700; }
.weight-total.bad { color: var(--warn); }
.winner-card { display: flex; gap: 16px; align-items: center; background: linear-gradient(120deg, #fff8e1, #fbeec2);
  border: 1px solid var(--gold-line); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.winner-card .medal { width: 56px; height: 56px; border-radius: 50%; flex: none; display: flex; align-items: center;
  justify-content: center; font-size: 26px; font-weight: 800; color: #5f4600;
  background: radial-gradient(circle at 35% 35%, #fff2b8, #e0b53a 60%, #a37a10); }
.winner-card .nm { font-size: 20px; font-weight: 700; }
.hint { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 8px; padding: 10px 12px;
  font-size: 13.5px; margin-bottom: 12px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; font-size: 13px; }

@media (max-width: 860px) {
  .ballot { grid-template-columns: minmax(0, 1fr); }
  .filters input, .filters select { min-width: 0; flex: 1 1 100%; }
  .top .right span { display: none; }
  .az button { width: 26px; }
  .hodscale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .hodscale button { width: auto; min-height: 44px; font-size: 16px; }
  .top { gap: 10px; }
  .top .logo { width: 36px; height: 36px; }
  .top h1 { font-size: 13.5px; line-height: 1.25; }
  .top .right { gap: 6px; }
  .top .right button { padding: 6px 10px; font-size: 13px; }
  .tray { position: static; order: -1; }
  .editor-list .qitem, .editor-list .citem { grid-template-columns: 1fr 1fr; }
  .top { padding: 10px 14px; }
  .top h1 { font-size: 15px; }
  .top .sub { display: none; }
  .nlist { max-height: none; }
}

[hidden] { display: none !important; }

/* person form: role in the award */
.rolebox { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 6px 0 10px; background: var(--soft, #fbf7ec); }
.rolebox-h { font-weight: 700; margin-bottom: 6px; }
.rolerow { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line); cursor: pointer; }
.rolerow:first-of-type { border-top: 0; }
.rolerow input { margin-top: 3px; width: auto; }
/* categories: collapsible cards */
.cat-tools { margin-bottom: 12px; }
.catcard .cat-head { cursor: pointer; user-select: none; flex-wrap: nowrap; }
.catcard .cat-arrow { display: inline-block; transition: transform .15s; color: var(--muted); width: 14px; }
.catcard.open .cat-arrow { transform: rotate(90deg); }
.catcard .cat-body { display: none; }
.catcard.open .cat-body { display: block; }
.catcard:not(.open) { padding-top: 12px; padding-bottom: 12px; }
.cat-mini { white-space: nowrap; }
@media (max-width: 600px) { .cat-mini { display: none; } }
/* category card body: progress, facts, actions */
.cprog { display: flex; flex-wrap: wrap; gap: 0; list-style: none; padding: 0; margin: 12px 0 10px; font-size: 12.5px; }
.cprog li { padding: 4px 12px 4px 18px; background: #f1eee6; color: var(--muted); position: relative; margin-right: 2px; }
.cprog li:first-child { border-radius: 99px 0 0 99px; padding-left: 12px; }
.cprog li:last-child { border-radius: 0 99px 99px 0; }
.cprog li.done { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.cprog li.next { background: var(--gold-soft); color: var(--gold-dark); font-weight: 700; outline: 1.5px solid var(--gold); outline-offset: -1.5px; }
.cwarn { background: var(--warn-soft); color: #7a4a00; border-radius: 8px; padding: 6px 10px; font-size: 13px; margin-bottom: 6px; }
.cfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 24px; margin: 4px 0 6px; }
.cf { display: grid; grid-template-columns: 170px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; align-items: baseline; }
.cf-l { color: var(--muted); font-size: 13px; }
.cf-tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: #e7eefc; color: #234da0; margin-left: 4px; }
.cf-parts { display: flex; flex-wrap: wrap; gap: 4px; }
.cf-part { font-size: 12.5px; padding: 2px 8px; border-radius: 6px; background: var(--gold-soft); border: 1px solid var(--gold-line); }
.cact { margin-top: 12px; gap: 8px; }
.cmore { position: relative; }
.cmore > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 8px; font-weight: 600; }
.cmore > summary::-webkit-details-marker { display: none; }
.cmore-m { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 4px; display: flex; flex-direction: column; min-width: 200px; }
.cmore-m button { border: 0; text-align: left; background: none; padding: 8px 12px; }
.cmore-m button:hover { background: var(--gold-soft); }
@media (max-width: 600px) { .cf { grid-template-columns: 1fr; gap: 2px; } .cfacts { grid-template-columns: 1fr; } }
/* who has voted */
.tturn .tdep { cursor: pointer; }
.tturn .tdep:hover td { background: var(--gold-soft); }
.tturn .cat-arrow { display: inline-block; transition: transform .15s; color: var(--muted); }
.tturn .tdep.on .cat-arrow { transform: rotate(90deg); }
.tturn .tpeople > td { background: #fbf9f3; padding: 10px 14px 14px 32px; }
.tturn .tpeople table.t td { background: #fff; }
.tbar { display: inline-flex; width: calc(100% - 50px); height: 10px; border-radius: 99px; background: #f1d6d3; overflow: hidden; vertical-align: middle; }
.tbar i { display: block; height: 100%; }
/* designation picker */
.des-pick summary { cursor: pointer; color: var(--gold-dark, #8a6200); font-weight: 600; margin-top: 6px; }
.des-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.des-list .chk { display: block; margin: 4px 0; }
.chip.des-on > span { background: var(--gold-soft, #fff3d0); border-color: var(--gold, #c9971c); }
.chip.des-on a { text-decoration: none; margin-left: 4px; color: var(--muted); }
/* station sub-tabs */
.st-tabs { margin: 4px 0 10px; }
.st-tabs .badge { margin-left: 4px; }
/* data entry steps + spelling groups */
.steps { display: flex; gap: 8px; padding: 0; list-style: none; margin: 0 0 8px; flex-wrap: wrap; counter-reset: st; }
.steps li { counter-increment: st; font-size: 13px; color: var(--muted); }
.steps li::before { content: counter(st) ". "; font-weight: 700; }
.steps li:not(:last-child)::after { content: "  →"; }
.spell { border-top: 1px solid var(--line); margin-top: 10px; }
.spell-g { padding: 8px 0; border-bottom: 1px dashed var(--line); }

/* "vote in every category" note on the voter's home screen */
.warn-note { background: #fff4e0; border-color: #f0c070; }
.done-note { background: #e9f8f0; border-color: #9bd8b8; }

/* certificate title font, shipped with the app (SIL Open Font Licence) */
@font-face { font-family: "Oswald Bold"; src: url("/static/fonts/Oswald-Bold.ttf") format("truetype"); font-weight: 700; }

/* publish results window */
.pubsec { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.pubsec .pubh { font-weight: 700; margin-bottom: 8px; }
.pubsec .chk { display: block; margin: 4px 0; }

/* certificate templates grouped by set */
.tpl-set > summary { cursor: pointer; list-style: none; flex-wrap: wrap; }
.tpl-set > summary::-webkit-details-marker { display: none; }
.tpl-set > summary::before { content: "▸"; color: var(--muted); margin-right: 6px; transition: transform .15s; display: inline-block; }
.tpl-set[open] > summary::before { transform: rotate(90deg); }
.tpl-set .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tpl-card img { width: 100%; border-radius: 6px; border: 1px solid var(--line); display: block; }
.tplgroup { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; }
.tplgroup summary { cursor: pointer; padding: 4px 0; }
.tplgroup .tplpick { margin: 6px 0 4px; }

/* HODs with nobody on the shortlist: the rule */
.fbbox { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; margin: 6px 0 10px; }
.fbbox .chk { display: block; margin: 3px 0; }

/* coloured sub-tabs (People & logins) - each section has its own colour, the open one is filled */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.subtabs button { border-radius: 999px; padding: 8px 16px; font-weight: 600; border: 2px solid var(--c); color: var(--c);
  background: color-mix(in srgb, var(--c) 8%, white); }
.subtabs button .cnt { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; font-size: 12px;
  background: color-mix(in srgb, var(--c) 18%, white); }
.subtabs button.on { background: var(--c); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 35%, transparent); }
.subtabs button.on .cnt { background: rgba(255, 255, 255, .25); color: #fff; }
.sub-c0 { --c: #8a6200; } .sub-c1 { --c: #6a3fa0; } .sub-c2 { --c: #c0560f; } .sub-c3 { --c: #1f5fa8; } .sub-c4 { --c: #a3203a; } .sub-c5 { --c: #18684a; }
.subtabs button.pulse:not(.on) { background: color-mix(in srgb, var(--c) 12%, #fff); animation: subpulse 1.6s ease-in-out infinite; }
@keyframes subpulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent); } }
/* inner tabs (Exceptions lists, Voting station): pills, the open one filled */
.st-tabs { border: 0; gap: 8px; display: flex; flex-wrap: wrap; }
.st-tabs button { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; background: #fff; }
.st-tabs button.on { background: var(--gold-dark, #7a5a00); border-color: var(--gold-dark, #7a5a00); color: #fff; }
.st-tabs button.on .badge { background: rgba(255, 255, 255, .25); color: #fff; }
.st-tabs button[data-exc="no_vote"].on { background: #4a5568; border-color: #4a5568; }
.st-tabs button[data-exc="opted_out"].on { background: #a3203a; border-color: #a3203a; }
.st-tabs button[data-exc="is_mgmt"].on { background: #18684a; border-color: #18684a; }

/* category editor, Basics: numbered boxes */
.ebox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.ebox-h { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.ebox-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold-dark, #7a5a00);
  color: #fff; font-size: 13px; }
.egrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .egrid { grid-template-columns: 1fr; } }
.egrid .field { margin: 0; }
.erow { display: grid; grid-template-columns: 190px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px dashed var(--line); }
.ebox-h + .erow { border-top: 0; }
@media (max-width: 700px) { .erow { grid-template-columns: 1fr; } }
.elabel { font-weight: 600; padding-top: 6px; }
.ecount { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--gold-soft, #fff3d0); font-size: 13px; }
.ecount:empty { display: none; }
.ebox .rolerow { border-top: 1px dashed var(--line); }
/* segmented choice (People / Teams) */
.seg { justify-self: start; width: max-content; display: inline-flex; border: 1.5px solid var(--gold-dark, #7a5a00); border-radius: 999px; overflow: hidden; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 6px 16px; }
.seg label:has(input:checked) span { background: var(--gold-dark, #7a5a00); color: #fff; font-weight: 600; }

/* fair-voting design: team choice step and leaders */
.teamcard { margin-bottom: 4px; }
.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.tpick { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line, #ddd); border-radius: 10px; background: #fff; cursor: pointer; }
.tpick .tbox { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid #bbb; display: grid; place-items: center; font-weight: 700; }
.tpick.on { border-color: var(--ok, #1b8a4b); background: #eef9f2; }
.tpick.on .tbox { background: var(--ok, #1b8a4b); border-color: var(--ok, #1b8a4b); color: #fff; }
.howto { background: #f7f4ec; border: 1px solid #e6dcc3; border-radius: 10px; padding: 12px 16px; margin: 10px 0 14px; line-height: 1.55; }
.howto ol { margin: 6px 0 6px 18px; padding: 0; }
.howto li { margin: 4px 0; }
.agreed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff6dd; border: 1px solid #ecd28a; border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; font-size: 14px; }
/* user manual */
.manual { max-width: 980px; margin: 0 auto; font-size: 16px; line-height: 1.65; color: #2a2013; }
.manual h3 { font-size: 21px; margin: 34px 0 10px; padding-top: 10px; border-top: 2px solid #eadfc4; color: #6b4b00; scroll-margin-top: 12px; }
.manual p, .manual ul { margin: 8px 0 12px; }
.mtoc { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; background: #faf6ec; border: 1px solid #eadfc4; border-radius: 12px; padding: 12px 16px; margin: 12px 0 8px; }
.mtoc a { color: #6b4b00; text-decoration: none; padding: 2px 0; }
.mtoc a:hover { text-decoration: underline; }
.mtoc-g { display: flex; flex-direction: column; gap: 2px; }
.mtoc-g > b { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.mt { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 15px; background: #fff; }
.mt th { background: #f3ead6; text-align: left; padding: 8px 10px; border: 1px solid #e3d7be; }
.mt td { padding: 8px 10px; border: 1px solid #ece3cf; vertical-align: top; }
.mt tr.hl td { background: #fff3cc; }
.mformula { font-size: 17px; font-weight: 600; background: #fff6dd; border: 1px solid #ecd28a; border-radius: 10px; padding: 12px 16px; margin: 12px 0; }
.mkey { background: #eef6fb; border-left: 4px solid #1f5f8a; border-radius: 6px; padding: 10px 14px; margin: 12px 0; }
.mex { border: 1px solid #e3d7be; border-radius: 12px; padding: 4px 14px 8px; margin: 12px 0 16px; background: #fffdf8; }
.mex-h { font-weight: 700; color: #6b4b00; margin: 8px 0 2px; }
@media print { header.top, nav.tabs, #mPrint, .mtoc, .small.muted:first-child { display: none !important; } .manual { max-width: none; font-size: 12pt; } .manual h3 { break-after: avoid; } .mt, .mex { break-inside: avoid; } }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border: 1px solid #ecd28a; background: #fffaf0; }
.sorth { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; white-space: nowrap; }
.sorth span { color: #b9a678; font-size: 12px; margin-left: 2px; }
.sorth.on span, .sorth:hover span { color: #7a5a00; }
.fbview { margin-top: 12px; border-top: 1px solid #eee3cb; padding-top: 10px; }
.fbview summary { cursor: pointer; }
.certchoice { display: grid; gap: 10px; }
.certchoice button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 12px; }
.certchoice button span { font-size: 13px; color: #6e634f; font-weight: 400; }
/* upload progress window */
.busy-back { position: fixed; inset: 0; background: rgba(30, 24, 10, .35); display: grid; place-items: center; z-index: 9999; }
.busy-box { background: #fff; border-radius: 14px; padding: 20px 24px; width: min(420px, 90vw); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.busy-title { font-weight: 700; margin-bottom: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.busy-bar { height: 10px; border-radius: 6px; background: #f1e9d6; overflow: hidden; position: relative; }
.busy-bar i { display: block; height: 100%; width: 2%; background: #8a6200; border-radius: 6px; transition: width .2s; }
.busy-bar.indet i { width: 35% !important; position: absolute; animation: busyslide 1.2s ease-in-out infinite; }
@keyframes busyslide { from { left: -35%; } to { left: 100%; } }
.busy-text { margin-top: 10px; font-size: 14px; }
.busy-time { margin-top: 4px; font-size: 12px; color: #8a7f68; }

/* committee flags with their reason */
.flagwhy { margin-top: 4px; font-size: 12px; color: #8a5a00; text-align: left; max-width: 260px; white-space: normal; }
.flagwhy > div { margin-top: 2px; }
.flagbox { background: #fff8e6; border: 1px solid #f0d48a; border-radius: 8px; padding: 10px 12px; color: #4a3500; }
.flagbox .t { background: #fff; }
.t.raw td, .t.raw th { white-space: nowrap; font-size: 12.5px; }
.faqcat h4 { margin: 14px 0 6px; color: var(--gold-dark, #7a5a00); }
details.faq { border: 1px solid var(--line, #e5ddc8); border-radius: 8px; margin: 6px 0; background: #fff; }
details.faq > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; }
details.faq > div { padding: 0 12px 10px; line-height: 1.5; }
details.faq[open] > summary { border-bottom: 1px solid var(--line, #e5ddc8); margin-bottom: 8px; }
@media print { details.faq > summary { list-style: none; } }

/* =====================================================================
   ADMIN DESIGN SYSTEM (admin pages only: body.admin) - "deep teal and saffron"
   Teal = the frame and "you are here" (top bar, selected menu item, tabs).
   Saffron = the main action on a page (primary buttons). Gold stays for winners.
   Layout: full-width top bar (logo, award name, event, user) + menu sidebar.
   ===================================================================== */
body.admin {
  --teal-900: #0b3f3b; --teal-800: #0e4f4a; --teal-700: #0f625b; --teal-600: #12776f; --teal-100: #dff2ef; --teal-50: #eff8f6;
  --saffron: #ee7d0e; --saffron-2: #d86c00; --saffron-soft: #fff1e3;
  --bg: #f3f6f5; --card: #ffffff; --line: #e1e7e5; --line-2: #ecf0ef;
  --ink: #17201f; --ink-2: #34403e; --muted: #687673;
  --accent: var(--teal-700); --accent-2: var(--teal-800); --accent-soft: var(--teal-100); --accent-line: #b9e0d9;
  --gold-dark: #8a5a00;
  --gold: var(--teal-600); --gold-soft: var(--teal-50); --gold-line: var(--accent-line);   /* charts and highlights follow the theme; medals keep real gold */
  --radius: 12px; --shadow: 0 1px 2px rgba(14, 40, 37, .06), 0 1px 1px rgba(14, 40, 37, .03);
  --shadow-lg: 0 14px 34px rgba(14, 40, 37, .18);
  --bar-h: 60px;
  font-size: 14.5px; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
body.admin a { color: var(--teal-700); }
body.admin.shell-on header.top { display: none; }
body.admin.shell-on main#app { max-width: none; padding: 0; margin: 0; }

/* ---- top bar: on every page ---- */
.appbar { position: sticky; top: 0; z-index: 45; height: var(--bar-h); display: flex; align-items: center; gap: 16px;
  padding: 0 18px; background: var(--teal-800); color: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.appbar-menu { display: none; background: none; border: 0; color: #fff; padding: 6px; }
.appbar-menu .ico { width: 22px; height: 22px; color: #fff; }
.appbar-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.appbar-brand > div { min-width: 0; }
.appbar-brand img { width: 38px; height: 38px; object-fit: contain; flex: none;
  filter: drop-shadow(0 0 4px rgba(255, 196, 120, .45)); }
.appbar-brand b { display: block; font-size: 16px; font-weight: 650; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-brand span { display: block; font-size: 12px; color: #a9d6cf; }
.appbar-event { display: flex; align-items: center; gap: 7px; min-width: 0; max-width: 380px; margin-left: 10px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; }
.appbar-event .ico { width: 15px; height: 15px; color: #ffb766; }
.appbar-event span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.admin .appbar-event a { color: #fff; text-decoration: none; font-weight: 600; font-size: 12px; background: rgba(255, 255, 255, .14);
  border-radius: 999px; padding: 2px 10px; flex: none; }
body.admin .appbar-event a:hover { background: rgba(255, 255, 255, .24); }
.appbar-user { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.appbar-btn { display: inline-flex; align-items: center; gap: 6px; color: #e4f3f0 !important; background: none !important; border: 0 !important;
  border-radius: 8px; padding: 6px 10px !important; font-size: 13.5px; text-decoration: none; cursor: pointer; }
.appbar-btn:hover { background: rgba(255, 255, 255, .12) !important; }
.appbar-btn .ico { width: 17px; height: 17px; color: #bfe3dd; }
.appbar-me { display: flex; align-items: center; gap: 9px; padding: 0 8px; border-left: 1px solid rgba(255, 255, 255, .15);
  border-right: 1px solid rgba(255, 255, 255, .15); margin: 0 4px; }
.appbar-who b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.appbar-who span { display: block; font-size: 11.5px; color: #a9d6cf; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--saffron); color: #fff; font-weight: 700;
  font-size: 12.5px; display: flex; align-items: center; justify-content: center; flex: none; }

/* ---- body: menu sidebar + page ---- */
.shell-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - var(--bar-h)); }
.side { position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); overflow-y: auto; background: #fff;
  border-right: 1px solid var(--line); padding: 14px 12px; scrollbar-width: thin; scrollbar-color: #d6dfdc transparent; }
.side-nav { display: flex; flex-direction: column; gap: 10px; }
.side-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #8a9a97; padding: 0 10px 3px; }
.side-grp { display: flex; flex-direction: column; gap: 1px; }
.side-grp button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none;
  border-radius: 8px; padding: 7px 10px; color: var(--ink-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.side-grp button:hover { background: var(--teal-50); border: 0; }
.side-grp button.on { background: var(--teal-100); color: var(--teal-800); font-weight: 650; box-shadow: inset 3px 0 0 var(--teal-600); }
.side-grp button.on .ico { color: var(--teal-600); }
.ico { width: 18px; height: 18px; flex: none; color: #84928f; }

.page { min-width: 0; padding: 26px 36px 64px; max-width: 1320px; width: 100%; }
.phead { margin: 0 0 20px; }
.phead h1 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.2px; color: var(--ink); }
.phead p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.scrim { display: none; }
.dup-title { display: none !important; }

/* ---- surfaces ---- */
body.admin .card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); padding: 20px; }
body.admin .card + .card { margin-top: 16px; }
body.admin h2 { font-size: 19px; letter-spacing: -.1px; }
body.admin h3 { font-size: 15.5px; }
body.admin .hint { background: var(--teal-50); border-color: var(--accent-line); border-radius: 10px; color: var(--ink-2); }

/* ---- controls: saffron = the main action ---- */
body.admin button { border-radius: 8px; border-color: #d3dcd9; padding: 7px 14px; font-weight: 500; transition: background .12s, border-color .12s; }
body.admin button:hover { border-color: #b8c6c2; background: #f7faf9; }
body.admin button.primary { background: var(--saffron); border-color: var(--saffron); color: #fff; font-weight: 600; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
body.admin button.primary:hover { background: var(--saffron-2); border-color: var(--saffron-2); }
body.admin button.ghost { background: transparent; border-color: transparent; }
body.admin button.ghost:hover { background: var(--teal-50); }
body.admin button.danger { color: var(--bad); }
body.admin input[type=text], body.admin input[type=password], body.admin input[type=number], body.admin input[type=search],
body.admin input[type=email], body.admin select, body.admin textarea { border-color: #d3dcd9; border-radius: 8px; }
body.admin input:focus, body.admin select:focus, body.admin textarea:focus, body.admin button:focus-visible { outline: 2px solid rgba(18, 119, 111, .35); outline-offset: 1px; border-color: var(--teal-600); }
body.admin input[type=checkbox], body.admin input[type=radio] { accent-color: var(--teal-600); }

/* in-page tabs and section tabs: teal = selected */
body.admin .tabs { border-bottom-color: var(--line); gap: 2px; margin-bottom: 16px; }
body.admin .tabs button { color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom-width: 2px; }
body.admin .tabs button:hover { background: none; color: var(--ink); }
body.admin .tabs button.on { color: var(--teal-800); border-bottom-color: var(--teal-600); }
body.admin .st-tabs button { border-radius: 999px; border: 1px solid #d3dcd9; padding: 6px 14px; color: var(--ink-2); }
body.admin .st-tabs button.on { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
body.admin .subtabs { gap: 6px; margin-bottom: 16px; }
body.admin .subtabs button { --c: var(--teal-700); border: 1px solid #d3dcd9; color: var(--ink-2); background: #fff; font-weight: 600; padding: 7px 14px; box-shadow: none; }
body.admin .subtabs button:hover { border-color: #b8c6c2; background: #f7faf9; }
body.admin .subtabs button .cnt { background: var(--teal-50); color: var(--teal-800); }
body.admin .subtabs button.on { background: var(--teal-700); border-color: var(--teal-700); color: #fff; box-shadow: none; }
body.admin .subtabs button.on .cnt { background: rgba(255, 255, 255, .22); color: #fff; }
body.admin .seg { border-color: var(--teal-700); }
body.admin .seg label:has(input:checked) span { background: var(--teal-700); }
body.admin .chip input:checked + span { background: var(--teal-100); border-color: var(--teal-600); color: var(--teal-800); }
body.admin .progress div, body.admin .bar div { background: var(--teal-600); }

/* ---- KPI tiles: label on top, number below ---- */
body.admin .tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
body.admin .tile { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 16px 18px;
  border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); min-height: 92px; position: relative; overflow: hidden; }
body.admin .tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--teal-600); opacity: .8; }
body.admin .tile b { font-size: 28px; line-height: 1.1; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
body.admin .tile span { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---- tables ---- */
body.admin .tbl-wrap { border-radius: 10px; border-color: var(--line); background: #fff; }
body.admin table.t { font-size: 14px; }
body.admin table.t th { background: #f6f9f8; color: #5f6e6b; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 650;
  border-bottom: 1px solid var(--line); padding: 9px 12px; }
body.admin table.t td { padding: 9px 12px; border-bottom-color: var(--line-2); }
body.admin table.t tbody tr:hover td { background: #f8fbfa; }
body.admin table.t tr.top10 td { background: #fffbf3; }
body.admin table.t tr.winner td { background: #fff3dc; }

body.admin .bulkbar { background: var(--teal-50); border-color: var(--accent-line); }
/* ---- badges, modals, guide ---- */
body.admin .badge { font-weight: 600; font-size: 11.5px; padding: 2px 9px; }
body.admin .badge.done { background: #fff1d6; color: var(--gold-dark); }
body.admin .modal-back { background: rgba(11, 35, 33, .45); backdrop-filter: blur(2px); }
body.admin .modal { border-radius: 14px; box-shadow: var(--shadow-lg); padding: 24px; }
body.admin .mtoc { background: var(--teal-50); border-color: var(--accent-line); }
body.admin .mtoc a { color: var(--teal-800); }
body.admin .manual h3 { color: var(--teal-800); }
body.admin .faqcat h4 { color: var(--teal-700); }

/* ---- small screens: the menu slides in under the top bar ---- */
@media (max-width: 980px) {
  .appbar { gap: 10px; padding: 0 10px; }
  .appbar-menu { display: inline-flex; }
  .appbar-event, .appbar-who, .appbar-btn span { display: none; }
  .appbar-me { border: 0; padding: 0 4px; margin: 0; }
  .appbar-brand { flex: 1; }
  .appbar-brand img { width: 30px; height: 30px; }
  .appbar-brand b { font-size: 14px; }
  .appbar-user { margin-left: 0; gap: 0; }
  .appbar-user > a.appbar-btn, #myVote { display: none !important; }
  .shell-body { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: var(--bar-h); bottom: 0; height: auto; width: 272px; z-index: 60; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: var(--bar-h) 0 0 0; background: rgba(11, 35, 33, .35); z-index: 55; }
  .page { padding: 18px 16px 48px; }
  .phead h1 { font-size: 21px; }
}
@media (max-width: 600px) {
  body.admin .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.admin .tile { padding: 12px 14px; min-height: 0; }
  body.admin .tile b { font-size: 22px; }
}
@media print { .appbar, .side, .phead { display: none !important; } .shell-body { display: block; } .page { padding: 0; } }

/* ---------- voting login: Dr. A.P.J. Abdul Kalam's Rudraksha tree, full screen ----------
   The tree fills the screen; a deep-green shade on the left carries the story (with the planting photo as a
   small print); the login sits in a floating cream card on the right. No header bar here (body.auth-on). */
body.auth-on header.top, body.auth-on #stationBar { display: none; }
body.auth-on main#app { max-width: none; margin: 0; padding: 0; }
.gl { --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; --gold-btn: #d6a446;
  position: relative; min-height: 100vh; overflow: hidden; color: #fff;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); grid-template-rows: auto 1fr;
  gap: 0 56px; padding: 44px 56px 48px; background: #1e3a24; }
.gl-bg, .gl-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.gl-bg img { object-fit: cover; object-position: 50% 60%; }
.gl-shade { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 38, 26, .9) 0%, rgba(10, 38, 26, .72) 34%, rgba(10, 38, 26, .28) 62%, rgba(10, 38, 26, .12) 100%),
              linear-gradient(0deg, rgba(10, 38, 26, .55) 0%, rgba(10, 38, 26, 0) 40%); }
.gl > *:not(.gl-bg):not(.gl-shade) { position: relative; z-index: 1; }
/* top-left: the award */
.gl-brand { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 12px; }
.gl-brand img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); }
.gl-brand b { display: block; font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: .2px; }
.gl-brand span { display: block; font-size: 13px; color: #d5e6dc; }
/* bottom-left: the story */
.gl-story { grid-column: 1; grid-row: 2; align-self: end; max-width: 560px; }
.gl-print { margin: 0 0 14px; width: 150px; padding: 7px 7px 22px; background: #fbfaf5; border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35); transform: rotate(-3deg); }
.gl-print img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.gl-date { margin: 0 0 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #e6c27a; }
.gl-latin { margin: 0 0 6px; font-family: var(--serif); font-style: italic; font-size: 15px; color: #e6c27a; }
.gl-story h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: 1.08; letter-spacing: -.3px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .3); }
.gl-text { margin: 14px 0 0; font-size: 16px; line-height: 1.6; color: #e9f1ec; max-width: 34em; text-wrap: pretty; }   /* no single word left alone on the last line */
.gl-story h1 { text-wrap: balance; }
/* right: the login card */
.gl-card { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #1d2a24; background: #fbf9f3;
  border-radius: 18px; padding: 34px 36px 30px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.gl-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gl-eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #6f7a73; }
.gl-lang { background: #fff !important; border: 1px solid #dcd8cc !important; color: #2f3b35 !important; border-radius: 8px !important;
  padding: 5px 12px !important; font-size: 13.5px; }
.gl-lang:hover { border-color: #b08a3c !important; }
.gl-card h2 { margin: 0 0 6px; font-family: var(--serif); font-weight: 700; font-size: 32px; line-height: 1.15; color: #1f3a2c; }
.gl-tag { margin: 0 0 26px; font-size: 12.5px; color: #6c7770; letter-spacing: .01em; }   /* smaller than the field labels */
.gl-field { display: block; font-size: 13.5px; font-weight: 600; color: #2a3630; margin: 0 0 6px; }
.gl-card input { width: 100%; height: 48px; border: 1px solid #dcd8cc; border-radius: 9px; padding: 0 14px; margin-bottom: 18px;
  background: #fff; font-size: 15px; color: #1d2a24; transition: border-color .12s, box-shadow .12s; }
.gl-card input:hover { border-color: #c5bfae; }
.gl-card input:focus { outline: none; border-color: #b08a3c; box-shadow: 0 0 0 3px rgba(214, 164, 70, .25); }
.gl-pw { position: relative; }
.gl-pw input { padding-right: 48px; }
.gl-eye { position: absolute; right: 7px; top: 8px; width: 32px; height: 32px; padding: 7px !important; border: 0 !important;
  background: none !important; color: #8a8f86; border-radius: 6px !important; }
.gl-eye:hover { color: #1f3a2c; background: #f1ede2 !important; }
.gl-eye svg, .gl-privacy svg { display: block; width: 100%; height: 100%; }
.gl .err-text { min-height: 20px; margin: -6px 0 8px; font-size: 13px; }
.gl-btn { width: 100%; height: 50px; border: 0; border-radius: 9px; background: var(--gold-btn); color: #2a2109; font-size: 15.5px; font-weight: 700;
  letter-spacing: .02em; cursor: pointer; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); transition: background .12s; }
.gl-btn:hover { background: #c8953a; }
.gl-btn:disabled { opacity: .6; }
.gl-privacy { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0 0; padding: 12px 14px; border-radius: 10px;
  background: #eef0e9; font-size: 12.5px; line-height: 1.5; color: #4f5c55; }
.gl-privacy svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: #1f3a2c; }
@media (max-width: 1000px) {
  .gl { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 22px; padding: 22px 18px 28px; }
  .gl-bg img { object-position: 50% 80%; }
  .gl-shade { background: linear-gradient(180deg, rgba(10, 38, 26, .78) 0%, rgba(10, 38, 26, .55) 45%, rgba(10, 38, 26, .82) 100%); }
  .gl-brand b { font-size: 17px; }
  .gl-brand img { width: 38px; height: 38px; }
  .gl-story { grid-row: 2; align-self: start; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 16px; align-items: center; }
  .gl-print { grid-row: 1 / span 2; width: 96px; padding: 5px 5px 14px; margin: 0; }
  .gl-date { margin: 0; font-size: 10.5px; align-self: end; }
  .gl-story .gl-latin { align-self: start; margin-top: 4px; }
  .gl-latin { margin: 0; font-size: 13px; }
  .gl-story h1 { grid-column: 1 / -1; font-size: 30px; margin-top: 10px; }
  .gl-text { grid-column: 1 / -1; font-size: 14.5px; margin-top: 6px; }
  .gl-card { grid-column: 1; grid-row: 3; align-self: start; padding: 24px 20px 22px; }
  .gl-card h2 { font-size: 26px; }
}
/* =====================================================================
   VOTING PAGE THEME (body.voter) - the same deep teal and saffron as the admin area.
   Teal = the frame and what you have chosen; saffron = the main button; gold stays for results.
   ===================================================================== */
body.voter {
  --teal-900: #0b3f3b; --teal-800: #0e4f4a; --teal-700: #0f625b; --teal-600: #12776f; --teal-100: #dff2ef; --teal-50: #eff8f6;
  --saffron: #ee7d0e; --saffron-2: #d86c00;
  --gold: var(--teal-600); --gold-dark: var(--teal-700); --gold-soft: var(--teal-50); --gold-line: #b9e0d9;
  --bg: #f3f6f5; --line: #e1e7e5; --ink: #17201f; --muted: #687673;
  background: var(--bg); color: var(--ink);
}
body.voter a { color: var(--teal-700); }
body.voter .top { background: linear-gradient(90deg, var(--teal-900), var(--teal-800) 60%, var(--teal-700)); }
body.voter .top .sub { color: #a9d6cf; opacity: 1; }
body.voter button.primary { background: var(--saffron); border-color: var(--saffron); }
body.voter button.primary:hover { background: var(--saffron-2); border-color: var(--saffron-2); }
body.voter button:hover { border-color: var(--teal-600); }
body.voter input:focus, body.voter select:focus, body.voter textarea:focus, body.voter button:focus-visible { outline-color: rgba(18, 119, 111, .45); }
body.voter .card { border-color: var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(14, 40, 37, .06); }
body.voter .rate button.on small { color: #d6efe9; }
body.voter .result-pill b { color: #8a5a00; }                 /* your result: gold */
body.voter .result-pill { background: #fff6e2; border-color: #f0d9a2; }
body.voter .login-brand { color: var(--teal-800); }body.voter .tpick.on { border-color: var(--teal-600); background: var(--teal-50); }
body.voter .tpick.on .tbox { background: var(--teal-600); border-color: var(--teal-600); }
/* admin login / set-password screens (before the sidebar loads): same teal and saffron as the rest of the admin area */
body.admin .top { background: linear-gradient(90deg, #0b3f3b, #0e4f4a 60%, #0f625b); }
body.admin .top .sub { color: #a9d6cf; opacity: 1; }
body.admin .login .card { border-radius: 16px; border-color: #e1e7e5; box-shadow: 0 1px 2px rgba(14, 40, 37, .05), 0 16px 40px rgba(14, 40, 37, .10); padding: 30px; }
body.admin .login h2 { color: #0e4f4a; }
/* ---------- annual report (admin): settings on the left, the document on the right; print shows only the document ---------- */
.rp-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.rp-side { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.rp-checks { display: grid; gap: 6px; margin-top: 8px; }
.rp-chk { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 7px 9px; border: 1px solid #e1e7e5; border-radius: 8px; }
.rp-chk input { margin-top: 3px; }
.rp-plist { display: grid; gap: 6px; }
.rp-pitem { display: grid; grid-template-columns: 56px 1fr auto; gap: 6px; align-items: center; }
.rp-pitem img { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; }
.rp { background: #fff; border: 1px solid #e1e7e5; border-radius: 10px; padding: 40px 48px; max-width: 900px; color: #1d2a28;
  font-size: 14px; line-height: 1.5; box-shadow: 0 1px 2px rgba(14, 40, 37, .05); }
.rp section { margin-bottom: 30px; }
.rp-h { font-family: var(--serif, "Palatino Linotype", serif); color: #0e4f4a; font-size: 21px; border-bottom: 2px solid #ee7d0e;
  padding-bottom: 6px; margin: 0 0 14px; display: flex; gap: 10px; align-items: baseline; }
.rp-h span { color: #ee7d0e; font-size: 16px; }
.rp h3 { font-size: 15px; color: #0e4f4a; margin: 18px 0 8px; }
.rp-note { font-size: 12.5px; color: #55635f; margin: 8px 0; }
.rp-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: #f1f3f2; color: #55635f; vertical-align: middle; }
.rp-tag.ok { background: #dff2ef; color: #0f625b; }
.rp-src { color: #8a9693; font-size: 12px; }
table.rt { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 8px; }
table.rt th { text-align: left; background: #eff8f6; color: #0e4f4a; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #cfe3df; }
table.rt td { padding: 5px 8px; border-bottom: 1px solid #edf0ef; }
table.rt td.n, table.rt th.n { text-align: right; }
table.rt tr.win td { font-weight: 600; background: #fff8ec; }
table.rt-small { font-size: 12px; }
.rp-cover { position: relative; border-radius: 10px; overflow: hidden; color: #fff; min-height: 520px; display: flex; margin: -16px -24px 34px; }
.rp-tree { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rp-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(8, 44, 40, .94), rgba(8, 44, 40, .78) 55%, rgba(8, 44, 40, .35)); }
.rp-cover-in { position: relative; z-index: 2; padding: 44px; max-width: 560px; }
.rp-logo { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 50%; padding: 4px; }
.rp-eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: #f3c46b; margin: 18px 0 4px; }
.rp-cover h1 { font-family: var(--serif, "Palatino Linotype", serif); font-size: 36px; margin: 0 0 6px; line-height: 1.15; }
.rp-sub { color: #cfe7e2; margin: 0 0 20px; }
table.rp-facts td { padding: 4px 14px 4px 0; vertical-align: top; color: #fff; }
table.rp-facts td:first-child { color: #a9d6cf; white-space: nowrap; }
.rp-motto { margin-top: 26px; font-style: italic; color: #cfe7e2; font-size: 13px; }
.rp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rp-kpis > div { border: 1px solid #e1e7e5; border-radius: 8px; padding: 12px 14px; }
.rp-kpis b { display: block; font-size: 24px; color: #0e4f4a; }
.rp-kpis span { font-size: 12.5px; color: #55635f; }
.rp-days { display: flex; gap: 6px; align-items: flex-end; overflow-x: auto; padding: 6px 0; }
.rp-days > div { display: flex; flex-direction: column; align-items: center; min-width: 44px; font-size: 11px; color: #55635f; }
.rp-days i { display: block; width: 22px; background: #12776f; border-radius: 3px 3px 0 0; }
.rp-days b { color: #1d2a28; margin-top: 2px; }
.rp-award { break-inside: avoid; }
.rp-list { margin: 6px 0 0; padding-left: 20px; font-size: 13px; }
.rp-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rp-photos figure { margin: 0; break-inside: avoid; }
.rp-photos img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; display: block; }
.rp-photos figcaption { font-size: 12px; color: #55635f; margin-top: 4px; }
.rp-notes { white-space: normal; }
.rp-prov { background: #fff4e3; border: 1px solid #f0c98a; color: #8a4b00; border-radius: 8px; padding: 8px 12px; margin-bottom: 18px; font-size: 13px; font-weight: 600; }
.rp-foot { border-top: 1px solid #e1e7e5; padding-top: 10px; font-size: 11.5px; color: #8a9693; }
@media (max-width: 1000px) { .rp-wrap { grid-template-columns: 1fr; } .rp-side { position: static; max-height: none; } .rp { padding: 24px 18px; } .rp-cover { margin: -8px -6px 26px; } .rp-kpis { grid-template-columns: repeat(2, 1fr); } }
@media print {
  @page { size: A4; margin: 14mm; }
  body.admin .rp-side { display: none !important; }
  .rp-wrap { display: block; }
  .rp { border: 0; box-shadow: none; padding: 0; max-width: none; font-size: 10.5pt; }
  .rp-cover { margin: 0 0 0; min-height: 250mm; break-after: page; border-radius: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp section:not(.rp-cover) { break-before: auto; }
  .rp-h { break-after: avoid; }
  .rp h3 { break-after: avoid; }
  table.rt tr { break-inside: avoid; }
  table.rt th, table.rt tr.win td, .rp-days i, .rp-tag, .rp-prov { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.rp-fresh { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: #eff8f6; border-radius: 8px; padding: 6px 10px; margin: 6px 0 4px; }
.rp-fresh button { margin-left: auto; padding: 3px 9px; }
/* Committee: read-only bar above the report; Settings: what the Committee can see */
.rp-ro { gap: 8px; max-width: 900px; }
@media print { .rp-ro { display: none !important; } }
.cpg { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.cpg input:disabled + span { opacity: .8; }
/* sealed ballot / sealed marks, and the automatic log-out after the last vote */
.card.sealed { border-left: 4px solid var(--teal-600, #12776f); background: #f4faf9; }
.card.sealed h3 { margin: 0 0 6px; color: var(--teal-800, #0e4f4a); }
.auto-out { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #d8e3e0; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 14px; color: #55635f; }
/* credit line at the bottom of every page */
footer.credit { text-align: center; font-size: 12px; color: #7d8a87; padding: 18px 16px 22px; letter-spacing: .01em; }
@media print { footer.credit { display: none !important; } }body.auth-on footer.credit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 10px 16px; color: rgba(255, 255, 255, .78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none; }@media (max-width: 1000px) {     /* phones / tablets: the login page scrolls, so the credit sits at the end of it */
  body.auth-on footer.credit { position: static; background: #0d2a1d; color: rgba(255, 255, 255, .72); text-shadow: none; padding: 14px 16px 18px; }
}footer.credit { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }
footer.credit > span + span::before { content: "·"; margin-right: 18px; opacity: .6; }
@media (max-width: 600px) { footer.credit { flex-direction: column; align-items: center; } footer.credit > span + span::before { content: none; } }
/* footer alignment */
footer.credit { gap: 4px 12px; }
footer.credit > span + span::before { margin-right: 12px; }
/* admin: inside the page column, lined up with the content; the one below the whole layout is hidden */
body.shell-on > footer.credit { display: none; }
footer.credit.in-page { justify-content: flex-start; text-align: left; margin-top: 44px; padding: 14px 0 0; border-top: 1px solid var(--line, #e1e7e5); }
/* voting login on a computer: copyright lined up under the story (left), credit lined up with the login card (right) */
@media (min-width: 1001px) {
  body.auth-on footer.credit { justify-content: space-between; padding: 0 56px 16px; }
  body.auth-on footer.credit > span + span::before { content: none; }
}
@media (max-width: 600px) { footer.credit.in-page { align-items: flex-start; } }