/* نادي طويق — the summit. Sadu indigo, red and gold; gold is kept for the top of the climb. */
/* Fonts are served from the site itself (SIL Open Font License, see /fonts). */
@font-face { font-family: 'Alexandria'; src: url('/fonts/alexandria.woff') format('woff'); font-weight: 500 800; font-display: swap; }
@font-face { font-family: 'Plex Arabic'; src: url('/fonts/plex-arabic-regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Arabic'; src: url('/fonts/plex-arabic-medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Plex Arabic'; src: url('/fonts/plex-arabic-semibold.woff') format('woff'); font-weight: 600 700; font-display: swap; }

:root {
  /* Club identity (from the نادي طويق logo): petrol navy, red, gold, teal */
  --indigo: #023047;
  --indigo-2: #0B3F59;
  --indigo-3: #165A78;
  --indigo-4: #2A7896;
  --ink: #08283A;
  --muted: #5B6F7A;
  --paper: #F1F5F6;
  --card: #FFFFFF;
  --line: #DCE5E9;
  --line-2: #C3D1D8;
  --sadu: #AE2012;
  --gold: #F7A100;
  --gold-soft: #FFF2D2;
  --teal: #0A999C;
  --silver: #B4C0C8;
  --bronze: #C7773F;
  --up: #08868A;
  --up-soft: #DDF3F3;
  --down: #AE2012;
  --down-soft: #FBE6E3;
  --good: #08797C; --good-bg: #DDF3F3;
  --mid: #8F5E00;  --mid-bg: #FFF0C7;
  --low: #4E6B85;  --low-bg: #E6EEF4;
  --bad: #A61E11;  --bad-bg: #FBE4E1;
  --on-dark: #A9C3CF;
  --on-dark-2: #D3E3EA;
  --font-display: 'Alexandria', 'Plex Arabic', 'Segoe UI', Tahoma, sans-serif;
  --font-body: 'Plex Arabic', 'Segoe UI', Tahoma, sans-serif;
  --r-xl: 28px; --r-lg: 18px; --r-md: 12px; --r-sm: 8px;
  --nav-h: 64px;
  --wrap: 980px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.75 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
body.is-login { padding-bottom: 0; background: var(--indigo); }
h1, h2, h3, .display { font-family: var(--font-display); line-height: 1.25; margin: 0; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
a { color: var(--indigo-3); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--indigo); color: #fff;
}
.topbar-in {
  max-width: var(--wrap); margin: 0 auto; height: 58px;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { height: 36px; width: auto; display: block; }
.topnav { display: none; gap: 2px; margin-inline-start: 18px; flex: 1; overflow-x: auto; }
.topnav a {
  color: var(--on-dark-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; white-space: nowrap; font-size: 15px;
}
.topnav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.who { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--on-dark-2); }
.who button { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.sadu {
  height: 7px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='7'%3E%3Cpath d='M0 7 7 0 14 7Z' fill='%23AE2012'/%3E%3Cpath d='M14 7 21 0 28 7Z' fill='%23F1F5F6'/%3E%3Cpath d='M12 7 14 5 16 7Z' fill='%23F7A100'/%3E%3C/svg%3E") repeat-x;
  background-color: var(--indigo);
}

/* ---------- bottom nav (phones) ---------- */
.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a, .bottomnav button {
  height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 12px; background: none; border: 0; cursor: pointer;
}
.bottomnav svg { width: 24px; height: 24px; }
.bottomnav [aria-current="page"] { color: var(--indigo); font-weight: 600; }
.bottomnav [aria-current="page"] svg { color: var(--sadu); }

@media (min-width: 900px) {
  body { padding-bottom: 40px; }
  .topnav { display: flex; }
  .bottomnav { display: none; }
}

/* ---------- layout ---------- */
main { max-width: var(--wrap); margin: 0 auto; padding: 18px 16px 24px; }
main.flush { padding-top: 0; }
.stack > * + * { margin-top: 18px; }
.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { font-size: 14px; text-decoration: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.page-head p { color: var(--muted); font-size: 15px; }
.grid-2 { display: grid; gap: 18px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid transparent;
  background: var(--indigo); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 15px;
}
.btn:hover { background: var(--indigo-2); }
.btn.secondary { background: var(--card); color: var(--indigo); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--paper); }
.btn.danger { background: var(--card); color: var(--bad); border-color: #EFC4BE; }
.btn.small { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
label.field { display: block; }
label.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: #fff; font-size: 16px;
}
textarea.input { min-height: 140px; resize: vertical; line-height: 1.7; }
.input:focus { outline: none; border-color: var(--indigo-3); box-shadow: 0 0 0 3px rgba(22,90,120,.18); }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--indigo); }
.form > * + * { margin-top: 14px; }
.error-text { color: var(--bad); font-size: 14px; min-height: 1.5em; }

.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--indigo); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips button {
  flex: none; border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px;
}
.chips button[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: #fff; }

/* ---------- the summit ---------- */
.summit { background: var(--indigo); color: #fff; margin: 0 -16px; padding: 18px 16px 0; overflow: hidden; }
.summit-in { max-width: 560px; margin: 0 auto; }
@media (min-width: 900px) { .summit { margin: 0; border-radius: 0 0 var(--r-xl) var(--r-xl); } }
.summit-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.summit-head h1 { font-size: 34px; font-weight: 800; }
.summit-head p { color: var(--on-dark); font-size: 14px; }
.week-meter { min-width: 120px; text-align: end; }
.week-meter .bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.15); margin-top: 6px; overflow: hidden; }
.week-meter .bar i { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.stage { position: relative; aspect-ratio: 400 / 260; margin-top: 4px; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.climber {
  position: absolute; transform: translateX(-50%); width: 34%;
  display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: #fff;
}
.climber .cname { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.2; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.climber .cpts { font-family: var(--font-display); font-size: 13px; color: var(--on-dark-2); margin-top: 1px; }
.climber .avatar { margin-top: 6px; }
.climber.r1 .cname { font-size: 17px; }
.climber.r1 .cpts { color: var(--gold); font-weight: 600; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; position: relative;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--indigo);
  background: #fff; box-shadow: 0 0 0 3px var(--ring, var(--silver));
}
.climber.r1 .avatar { width: 58px; height: 58px; font-size: 21px; --ring: var(--gold); box-shadow: 0 0 0 4px var(--gold), 0 0 22px rgba(247,161,0,.5); }
.climber.r2 .avatar { --ring: var(--silver); }
.climber.r3 .avatar { --ring: var(--bronze); }
.avatar .medal {
  position: absolute; bottom: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--indigo);
  background: var(--ring, var(--silver)); border: 2px solid var(--indigo);
}
.climber.r1 .avatar .medal { background: var(--gold); }
.empty-summit { text-align: center; color: var(--on-dark); padding: 30px 0 40px; }

@media (prefers-reduced-motion: no-preference) {
  .summit.animate .climber { animation: climb .7s cubic-bezier(.2,.8,.2,1) both; }
  .summit.animate .climber.r3 { animation-delay: .05s; }
  .summit.animate .climber.r2 { animation-delay: .22s; }
  .summit.animate .climber.r1 { animation-delay: .42s; }
  .summit.animate .flag { animation: wave 1.2s ease-in-out .9s 2; transform-origin: 0 100%; transform-box: fill-box; }
}
@keyframes climb { from { opacity: 0; transform: translate(-50%, 26px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes wave { 0%,100% { transform: skewY(0); } 50% { transform: skewY(-9deg); } }

/* own position card, sitting on the foot of the mountain */
.mypos {
  position: relative; margin-top: -26px; z-index: 2;
  background: var(--card); border-radius: var(--r-xl); padding: 18px 20px; border: 1px solid var(--line);
  box-shadow: 0 10px 30px -18px rgba(2,48,71,.5);
}
.mypos-top { display: flex; align-items: center; gap: 16px; }
.mypos .bigrank { font-family: var(--font-display); font-size: 56px; font-weight: 800; line-height: .9; color: var(--indigo); }
.mypos .bigrank small { font-size: 16px; font-weight: 500; color: var(--muted); margin-inline-start: 4px; }
.mypos .label { font-size: 14px; color: var(--muted); }
.mypos .total { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.mypos .gap { margin-top: 12px; font-size: 15px; }
.mypos .gap .bar { height: 8px; background: var(--paper); border-radius: 8px; margin-top: 8px; overflow: hidden; }
.mypos .gap .bar i { display: block; height: 100%; background: var(--indigo-3); border-radius: inherit; }
.mypos.first { background: var(--gold-soft); border-color: #F5D58A; }
.mypos.first .bigrank { color: #8F5E00; }

/* movement */
.move { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-display); font-size: 14px; font-weight: 600; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.move.up { color: var(--up); background: var(--up-soft); }
.move.down { color: var(--down); background: var(--down-soft); }
.move.same { color: var(--muted); background: var(--paper); }
.gain { color: var(--up); font-family: var(--font-display); font-weight: 600; }
.gain, .timeline .sum, .signed { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- ranking list ---------- */
.ranklist { list-style: none; margin: 0; padding: 0; }
.ranklist li { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.ranklist li:last-child { border-bottom: 0; }
.ranklist .rk { font-family: var(--font-display); font-size: 22px; font-weight: 700; text-align: center; color: var(--indigo-3); }
.ranklist .nm { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranklist .nm small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.ranklist .pt { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.ranklist a.row { display: contents; color: inherit; text-decoration: none; }
.ranklist li.p1 .rk { color: #9A6400; }
.ranklist li.p1 { background: linear-gradient(to left, var(--gold-soft), transparent 70%); border-radius: 12px; }
.ranklist li.p2 .rk { color: #6B7C88; }
.ranklist li.p3 .rk { color: var(--bronze); }
.ranklist li.self { background: #E2F0F4; border-radius: 12px; outline: 2px solid var(--indigo-4); outline-offset: -2px; }
.ranklist li.gapline { display: block; text-align: center; color: var(--muted); padding: 2px; border: 0; letter-spacing: 4px; }

/* ---------- posts ---------- */
.post { padding: 16px 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.post + .post { margin-top: 12px; }
.post.announcement { border-inline-start: 6px solid var(--sadu); }
.post .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.post .tag { font-weight: 600; color: var(--sadu); }
.post .tag.news { color: var(--indigo-3); }
.post h3 { margin-bottom: 4px; }
.post .body { white-space: pre-line; color: #2E4655; }
.post .actions { margin-top: 10px; }
.post.restricted { background: #F6F9FA; }

/* ---------- card page ---------- */
.idcard { background: var(--indigo); color: #fff; border-radius: var(--r-xl); padding: 20px; position: relative; overflow: hidden; }
.idcard::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='7'%3E%3Cpath d='M0 7 7 0 14 7Z' fill='%23AE2012'/%3E%3Cpath d='M14 7 21 0 28 7Z' fill='%23F7A100'/%3E%3C/svg%3E") repeat-x;
}
.idcard h1 { font-size: 26px; }
.idcard .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 16px; }
.idcard .rank { font-family: var(--font-display); font-size: 64px; font-weight: 800; line-height: .85; }
.idcard .rank small { font-size: 16px; color: var(--on-dark); font-weight: 500; }
.idcard .tot { text-align: end; }
.idcard .tot b { font-family: var(--font-display); font-size: 30px; display: block; line-height: 1.1; }
.idcard .tot span { color: var(--on-dark); font-size: 14px; }
.idcard .grp { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 2px 10px 2px 12px; border-radius: 999px; background: rgba(255,255,255,.12); font-size: 14px; }
.idcard .grp i { width: 10px; height: 10px; border-radius: 50%; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.badge { text-align: center; padding: 12px 6px; border-radius: var(--r-md); background: var(--paper); }
.badge .ic { font-size: 28px; line-height: 1; }
.badge b { display: block; font-size: 13px; margin-top: 6px; line-height: 1.35; }
.badge.locked { opacity: .38; filter: grayscale(1); }
.badge.earned { background: var(--gold-soft); }

.prog-rows { list-style: none; margin: 0; padding: 0; }
.prog-rows li { display: grid; grid-template-columns: 30px 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prog-rows li:last-child { border-bottom: 0; }
.prog-rows .ic { font-size: 20px; grid-row: span 2; }
.prog-rows .pts { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.prog-rows .meter { grid-column: 2 / -1; height: 7px; background: var(--paper); border-radius: 7px; overflow: hidden; }
.prog-rows .meter i { display: block; height: 100%; background: var(--indigo-3); border-radius: inherit; }
.prog-rows li.top .meter i { background: var(--gold); }
.prog-rows .off { font-size: 12px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 999px; padding: 0 8px; margin-inline-start: 6px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-family: var(--font-display); font-weight: 700; color: var(--indigo-3); line-height: 1.2; }
.timeline .when small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 12px; color: var(--muted); }
.timeline .vals { display: flex; flex-wrap: wrap; gap: 6px; }
.timeline .sum { font-family: var(--font-display); font-weight: 600; }

.v { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--paper); white-space: nowrap; }
.v.good { background: var(--good-bg); color: var(--good); }
.v.mid { background: var(--mid-bg); color: var(--mid); }
.v.low { background: var(--low-bg); color: var(--low); }
.v.bad { background: var(--bad-bg); color: var(--bad); }

.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font-display); }

/* ---------- tables (supervisors) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
table.data th { font-weight: 600; color: var(--muted); background: #F6F9FA; position: sticky; top: 0; font-size: 13px; }
table.data td.n, table.data th.n { text-align: center; font-family: var(--font-display); }
table.data tbody tr:hover td { background: #F6F9FA; }
table.data .sticky { position: sticky; inset-inline-start: 0; background: var(--card); z-index: 1; }
table.data th.sticky { background: #F6F9FA; z-index: 2; }
table.data tr.click { cursor: pointer; }
table.data td.cell { text-align: center; padding: 6px; }
table.data td.cell .v { font-size: 12px; padding: 1px 7px; }
.warn { color: var(--bad); font-weight: 600; }

.heat td.h { text-align: center; font-family: var(--font-display); font-size: 13px; padding: 7px 4px; min-width: 38px; }
.heat td.h.z { color: #B9C8CF; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.kpis > div { background: var(--card); padding: 14px 16px; }
.kpis b { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.kpis span { color: var(--muted); font-size: 13px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { color: inherit; text-decoration: none; }

/* groups */
.groups { display: grid; gap: 12px; }
@media (min-width: 760px) { .groups { grid-template-columns: repeat(2, 1fr); } }
.group { border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); padding: 16px; border-top: 6px solid var(--gc, var(--indigo)); }
.group-head { display: flex; align-items: center; gap: 10px; }
.group-head .em { font-size: 26px; }
.group-head .gr { margin-inline-start: auto; font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--gc, var(--indigo)); }
.group .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.group .stats b { display: block; color: var(--ink); font-family: var(--font-display); font-size: 22px; }
.group .actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { width: 34px; height: 34px; border-radius: 50%; background: var(--c); cursor: pointer; display: grid; place-items: center; }
.swatches input { position: absolute; opacity: 0; }
.swatches input:checked + span { width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.member-pick { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 12px; }
.member-pick .check small { color: var(--muted); margin-inline-start: auto; }

/* programs page */
.programs { display: grid; gap: 12px; }
@media (min-width: 760px) { .programs { grid-template-columns: repeat(2, 1fr); } }
.program { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.program h3 { display: flex; align-items: center; gap: 8px; }
.program .rules { list-style: none; margin: 10px 0 0; padding: 0; }
.program .rules li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.program .rules li:last-child { border-bottom: 0; }
.program .rules b { font-family: var(--font-display); color: var(--indigo-3); }
.program p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* honors */
.honor { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.honor + .honor { margin-top: 18px; }
.honor-head { background: var(--indigo); color: #fff; padding: 16px 18px; }
.honor-head p { color: var(--on-dark); font-size: 14px; }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 8px; padding: 18px 14px 0; background: var(--indigo); }
.podium .step { text-align: center; color: #fff; }
.podium .step .block { margin-top: 8px; border-radius: 12px 12px 0 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--indigo); }
.podium .s1 .block { height: 96px; background: var(--gold); }
.podium .s2 .block { height: 70px; background: var(--silver); }
.podium .s3 .block { height: 52px; background: var(--bronze); }
.podium .step b { display: block; font-family: var(--font-display); font-size: 15px; line-height: 1.25; }
.podium .step span { font-size: 13px; color: var(--on-dark-2); }
.honor .body { padding: 14px 18px 18px; }

/* modal, toast */
dialog.modal { border: 0; border-radius: var(--r-xl); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); color: var(--ink); }
dialog.modal::backdrop { background: rgba(2, 30, 44, .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head button { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px 20px; overflow-y: auto; max-height: calc(100vh - 170px); }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-start; }
.sheet-links { display: grid; gap: 4px; }
.sheet-links a, .sheet-links button {
  display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; text-decoration: none; color: var(--ink);
  background: none; border: 0; text-align: start; cursor: pointer; font-size: 16px;
}
.sheet-links a:hover, .sheet-links button:hover { background: var(--paper); }
.sheet-links svg { width: 22px; height: 22px; color: var(--indigo-3); }
.toast {
  position: fixed; inset-inline: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 60;
  max-width: 420px; margin: 0 auto; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-md);
  font-size: 15px; text-align: center;
}
@media (min-width: 900px) { .toast { bottom: 24px; } }

.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--font-display); font-size: 18px; margin-bottom: 4px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.notice { background: var(--gold-soft); border: 1px solid #F5D58A; border-radius: var(--r-md); padding: 10px 14px; font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 15px; margin-bottom: 10px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.login-sky { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px 0; }
.login-sky img { height: 64px; width: auto; }
.login-sky p { color: var(--on-dark); margin-top: 14px; }
.umbrella { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; color: var(--muted); font-size: 13px; }
.umbrella img { height: 44px; width: auto; }
.login-ridge { width: 100%; display: block; }
.login-card { background: var(--paper); color: var(--ink); padding: 26px 20px calc(30px + env(safe-area-inset-bottom)); }
.login-card .in { max-width: 420px; margin: 0 auto; }
.code-input { text-align: center; font-family: var(--font-display); font-size: 26px; letter-spacing: 3px; height: 60px; direction: ltr; }
.login-card .btn { width: 100%; height: 52px; font-size: 17px; margin-top: 12px; }
.linkish { background: none; border: 0; color: var(--indigo-3); text-decoration: underline; cursor: pointer; padding: 4px 0; font-size: 14px; }

/* ---------- print (login codes) ---------- */
.print-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.print-codes .slip { border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; }
.print-codes .slip b { display: block; font-size: 14px; }
.print-codes .slip code { font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; direction: ltr; display: block; text-align: center; }
.print-codes .slip small { color: var(--muted); font-size: 12px; }
@media print {
  body { background: #fff; padding: 0; }
  body.printing > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; padding: 0; }
  .print-codes .slip { break-inside: avoid; }
}
.print-root { display: none; }
