:root {
  --bg: #f5f2ec; --surface: #ffffff; --ink: #18212d; --muted: #5d6877; --line: #e2ddd2;
  --brand: #1c3557; --brand-ink: #ffffff; --accent: #d9661b; --accent-soft: #fbe9dc;
  --ok: #1d7a4c; --ok-soft: #e3f3ea; --warn: #9a5a06; --warn-soft: #fdf1d8; --danger: #b3261e;
  --gold: #f6e7b4; --silver: #e9ecef; --bronze: #f1dcc8;
  --radius: 12px; --shadow: 0 1px 2px rgba(24,33,45,.06), 0 4px 14px rgba(24,33,45,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161d; --surface: #1a212b; --ink: #e9edf2; --muted: #9aa5b3; --line: #2c3644;
    --brand: #0f1c2e; --accent: #f08a3e; --accent-soft: #3a2616;
    --ok: #5fcf95; --ok-soft: #153123; --warn: #f0b955; --warn-soft: #3a2c10; --danger: #f2756c;
    --gold: #4a3f17; --silver: #2f3742; --bronze: #40301f;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); line-height: 1.2; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
p { margin: 0 0 .75rem; }
small { font-weight: 400; color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 1.25rem; padding-bottom: 3rem; min-height: 70vh; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.top { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 52px; }
.brand { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; color: #fff; }
.brand:hover { color: #fff; }
.mark { width: 14px; height: 14px; background: var(--accent); transform: rotate(45deg); border-radius: 2px; display: inline-block; }
.top-nav { display: flex; align-items: center; gap: 1rem; font-size: .92rem; }
.top-nav a { color: #dbe4ef; text-decoration: none; }
.top-nav a:hover { color: #fff; }
.top-nav form { margin: 0; }
.who { color: #dbe4ef; }
.linkish { background: none; border: 0; color: #dbe4ef; font: inherit; cursor: pointer; padding: 0; }
.linkish:hover { color: #fff; }
.foot { color: var(--muted); font-size: .85rem; padding-top: 1rem; padding-bottom: 2rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.crumb { font-size: .9rem; color: var(--muted); margin: 0 0 .25rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; color: var(--accent); font-weight: 700; margin: 0 0 .2rem; }
.lead { font-size: 1.05rem; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 0 0 1rem; box-shadow: var(--shadow); display: block; }
.card.narrow { max-width: 460px; margin: 8vh auto 1rem; }
.card.note { border-left: 4px solid var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cards .card { margin: 0; }
.hk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.hk h2 a { text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .5rem 0 1rem; }
.stats dt { font-size: .75rem; color: var(--muted); }
.stats dd { margin: 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--line); color: var(--ink); vertical-align: middle; white-space: nowrap; }
.badge-open { background: var(--ok-soft); color: var(--ok); }
.badge-draft { background: var(--warn-soft); color: var(--warn); }
.badge-closed { background: var(--line); color: var(--muted); }

.flash { padding: .7rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); margin: 0 0 1rem; }
.flash-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.flash-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

label { display: block; font-size: .9rem; font-weight: 600; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; width: 100%; margin-top: .25rem; }
label input, label select, label textarea { font-weight: 400; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; accent-color: var(--accent); }
input[readonly] { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.stack > * + * { margin-top: .8rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin: 0; }
.row.end { align-items: flex-end; }
.grow { flex: 1 1 260px; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .3rem; }
.w-num { width: 5.5rem; }
.hint { font-size: .88rem; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; padding: .55rem 1rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 42px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(.94); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: .25rem .65rem; min-height: 32px; font-size: .85rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.subnav { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.subnav a { text-decoration: none; font-size: .9rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.subnav a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.tbl-wrap { overflow-x: auto; margin: 0 -0.2rem .75rem; }
.tbl { border-collapse: collapse; width: 100%; font-size: .93rem; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .45rem .5rem; border-bottom: 2px solid var(--line); vertical-align: bottom; }
.tbl th.num { text-align: right; }
.tbl th small { display: block; text-transform: none; letter-spacing: 0; }
.tbl td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl.edit td { padding: .25rem .3rem; vertical-align: top; }
.tbl.edit input, .tbl.edit textarea { margin: 0; padding: .4rem .5rem; min-width: 4rem; }
.tbl.edit td.center { vertical-align: middle; }
.tbl .w-num { width: 5.2rem; }
.tbl .w-del { width: 4.5rem; text-align: center; }
.tbl tr.new td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.link-cell { display: flex; gap: .35rem; align-items: center; min-width: 16rem; }
.link-cell input { font-size: .8rem; }
.rank .pos { font-weight: 700; font-size: 1.05rem; }
.rank .total { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.rank tr.top1 td { background: var(--gold); }
.rank tr.top2 td { background: var(--silver); }
.rank tr.top3 td { background: var(--bronze); }
.matrix td:first-child { white-space: nowrap; }
progress { width: 6rem; height: .55rem; vertical-align: middle; accent-color: var(--accent); }

details.more > summary { cursor: pointer; font-weight: 600; color: var(--muted); font-size: .9rem; }
details.more[open] > summary { margin-bottom: .6rem; }
details.card.more > summary { color: var(--ink); font-size: 1rem; }
.hints { margin: .25rem 0 .5rem; padding-left: 1.1rem; color: var(--muted); font-size: .9rem; }
.hints li + li { margin-top: .15rem; }
.w { font-size: .75rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .1rem .5rem; vertical-align: middle; margin-left: .25rem; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: transparent; box-shadow: none; }

/* Κριτής */
.tally { text-align: right; line-height: 1.1; }
.tally strong { font-size: 2.2rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.tally span { color: var(--muted); display: block; font-size: .85rem; }
.teams { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .45rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.team a { display: flex; align-items: center; gap: .75rem; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; min-height: 58px; }
.team a:hover { border-color: var(--accent); color: inherit; }
.team.done a { border-left: 4px solid var(--ok); }
.team.part a { border-left: 4px solid var(--accent); }
.ord { flex: 0 0 2rem; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tn { flex: 1 1 auto; min-width: 0; }
.tn strong { display: block; overflow-wrap: anywhere; }
.tn small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { flex: 0 0 auto; font-size: .82rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: var(--bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.part { background: var(--accent-soft); color: var(--accent); }

.score-form .crit { padding-top: .6rem; }
.crit legend { font-weight: 700; font-size: 1.05rem; padding: 0 .35rem; }
.scale { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 .75rem; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label { flex: 1 1 3rem; min-width: 3rem; max-width: 6rem; text-align: center; font-size: 1.25rem; font-weight: 700; padding: .7rem 0; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-variant-numeric: tabular-nums; user-select: none; }
.scale label:hover { border-color: var(--accent); }
.scale input:checked + label { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; }
.scale input:disabled + label { cursor: default; opacity: .7; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 1rem 0 .75rem; }

@media (max-width: 640px) {
  .top-nav { gap: .7rem; font-size: .85rem; }
  .who { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card { padding: .9rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .actions .btn { flex: 1 1 auto; }
  .teams { grid-template-columns: 1fr; }
}
