/* Barlow Semi Condensed + Atkinson Hyperlegible (see fonts.css). */
@import url(/css/fonts.css);

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The hidden attribute always wins. Without this, any class that sets
   display (a flex panel, an inline-flex button) silently keeps a "hidden"
   element on screen. */
[hidden] { display: none !important; }

/* ── Tokens ──
   Navy is the brand (the poster, the TindeByte mark and the phone theme
   colour already used it). The page is a cool chalk grey. On scores, green
   is under par (a birdie) and amber over par (a bogey), as on the brand
   mark. The --blue/--gray/... names are BuldreAppen's, kept so admin.css and
   the pages' scripts stay alike: --blue is the brand's fill colour,
   --blue-dark its text/link colour. */
:root {
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;

  --brand: #0C447C;
  --brand-hover: #0A3966;
  --brand-deep: #0A2238;

  --blue: #0C447C;
  --blue-light: #E3EDF7;
  --blue-dark: #0C447C;
  --green: #1A7A2E;
  --green-light: #E4F2E6;
  --green-border: #A9D3B1;
  --amber: #8A5300;
  --amber-light: #FBF0DC;
  --amber-border: #EBC77F;
  --amber-strong: #D29922;
  --red: #C93B3A;
  --red-light: #FBEAEA;
  --red-border: #EBA5A5;
  --red-strong: #A32D2D;
  --gray: #6B7884;
  --gray-light: #F1F4F6;
  --text: #102336;
  --text-muted: #55677A;
  --border: #D3DBE2;
  --bg: #EDF0F2;
  --surface: #FFFFFF;
  --gold: #A86D12;
  --toggle-off: #C3CCD4;
  --focus: #FFB800;

  --selected: #FFC400;
  --score-birdie: #1A7A2E;
  --score-bogey: #D29922;

  --radius: 14px;
  --radius-sm: 10px;
}

/* Dark theme -- toggled via data-theme on <html> (theme-init.js before
   paint, the footer button after). The same deep navy as the admin menu and
   the display screen, so the app has one dark look instead of three. */
:root[data-theme="dark"] {
  --brand: #8DBDF0;
  --brand-hover: #2F78C6;
  --blue: #2468B0;
  --blue-light: #15304A;
  --blue-dark: #8DBDF0;
  --green: #4CB866;
  --green-light: #12301C;
  --green-border: #2C5C38;
  --amber: #E7B45C;
  --amber-light: #33260F;
  --amber-border: #6B4E1A;
  --red: #F07170;
  --red-light: #3A1719;
  --red-border: #6E3032;
  --red-strong: #F4A6A6;
  --gray: #8394A5;
  --gray-light: #172B3D;
  --text: #E6EDF3;
  --text-muted: #96A8B9;
  --border: #26405A;
  --bg: #0A1622;
  --surface: #10202F;
  --gold: #E5A93A;
  --toggle-off: #33495E;
  --score-birdie: #1F8A36;
  --score-bogey: #E7B45C;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 1rem 1rem 3rem;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; }
a { color: var(--blue-dark); }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.container {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* The container's gap only spaces its direct children; a wrapper holding
   several cards (a list filled by JS, a form, a tab) needs its own. Margins,
   not flex gap, so it survives JS setting display:block on a tab. */
.stack > * + * { margin-top: 1rem; }

/* ── Brand ──
   The mark is a row of a disc golf scorecard: a birdie (circled), a par
   (plain) and a bogey (squared) -- the way scores are marked on a card. */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 34px; flex-shrink: 0; }
.brand-mark i { aspect-ratio: 1; border-radius: 3px; display: block; }
.brand-mark i:nth-child(1) { background: var(--score-birdie); border-radius: 50%; }
.brand-mark i:nth-child(2) { box-shadow: inset 0 0 0 1.5px var(--text-muted); }
.brand-mark i:nth-child(3) { background: var(--score-bogey); border-radius: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .2px; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
/* A card's heading: a real title in the display face, not a small-caps tag. */
.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 12px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head .card-title { margin-bottom: 0; }
.card-aside { font-size: 14px; color: var(--text-muted); white-space: nowrap; }

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 2px;
}
.topbar h1 {
  font-size: 26px;
  flex: 1;
  min-width: 0;
}
.back-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px; height: 44px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: -8px;
  border-radius: var(--radius-sm);
}
.page-sub { font-size: 15px; color: var(--text-muted); margin-top: -8px; }
.page-sub a { font-weight: 700; text-decoration: none; margin-left: 10px; white-space: nowrap; }
.page-sub a:hover { text-decoration: underline; }

/* ── Badges ── shaped like a strip of tape: square-ish, not pills. */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-live   { background: var(--green-light); color: var(--green); }
.badge-closed { background: var(--gray-light);  color: var(--text-muted); }
.badge-info   { background: var(--blue-light);  color: var(--blue-dark); }
.badge-youth  { background: var(--amber-light); color: var(--amber); }
.badge-abc-a  { background: var(--green-light); color: var(--green); }
.badge-abc-b  { background: var(--blue-light);  color: var(--blue-dark); }
.badge-abc-c  { background: var(--amber-light); color: var(--amber); }

/* ── Form fields ── 16px text: below that, iPhones zoom into the field. */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 15px; font-weight: 700; color: var(--text); }
.field .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 14px; color: var(--amber); }
.field .optional { font-size: 14px; font-weight: 400; color: var(--text-muted); }

input[type=text], input[type=email], input[type=tel],
input[type=date], input[type=number], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--surface);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
  padding-right: 36px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--blue-light);
}
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); }

/* ── Buttons ── 48px tall: tapped with chalky fingers. */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary  { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-success  { background: var(--green); color: #fff; }
.btn-outline  { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--text-muted); }
.btn-danger   { background: transparent; border-color: var(--red); color: var(--red); }
.btn-sm       { width: auto; min-height: 36px; padding: 6px 13px; font-size: 14px; display: inline-flex; }
.btn-google   { background: var(--surface); border-color: var(--border); color: var(--text); }
.text-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--blue-dark); font-size: 15px; font-weight: 700; text-decoration: none;
}
.text-link:hover { text-decoration: underline; }
.link-row { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; }

/* ── Alerts ── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  display: none;
}
.alert-error   { background: var(--red-light);   border: 1px solid var(--red-border);   color: var(--red-strong); }
.alert-success { background: var(--green-light); border: 1px solid var(--green-border); color: var(--green); }
.alert-info    { background: var(--amber-light); border: 1px solid var(--amber-border); color: var(--amber); }

/* ── Stat boxes ── */
.stat-row { display: flex; gap: 10px; }
.stat-box {
  flex: 1;
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.stat-num { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 14px; color: var(--text-muted); }

/* ── Leaderboard rows ── */
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.lb-row:last-child { border-bottom: none; }
.lb-rank  {
  width: 30px; flex-shrink: 0; text-align: center;
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.lb-rank.gold { color: var(--gold); }
.lb-name  { font-size: 16px; font-weight: 700; line-height: 1.3; }
.lb-meta  { font-size: 14px; color: var(--text-muted); }
.lb-score { text-align: right; flex-shrink: 0; }
.lb-score .main { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.lb-score .sub  { font-size: 13px; color: var(--text-muted); }
.lb-chev { color: var(--text-muted); font-size: 22px; flex-shrink: 0; }
.group-label {
  font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--text-muted);
  margin: 14px 0 2px;
}
.group-label:first-child { margin-top: 2px; }

/* ── Filter pills ── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  min-height: 38px;
  padding: 6px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  font-size: 15px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}
.pill.active { background: var(--text); border-color: var(--text); color: var(--surface); font-weight: 700; }

/* ── Tabs (leaderboard) ── a segmented control of real buttons. */
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--gray-light); border: 1px solid var(--border); border-radius: 12px;
}
.tab {
  flex: 1; min-height: 42px; padding: 8px 6px; border: none; border-radius: 9px; background: none;
  font-size: 15px; font-weight: 700; color: var(--text-muted); cursor: pointer;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(10, 34, 56, .14); }

/* ── Toggle ── */
.toggle {
  width: 44px; height: 26px; border-radius: 13px;
  background: var(--toggle-off); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.toggle.on { background: var(--blue); }
.toggle::after {
  content: ''; position: absolute; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left .2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.toggle.on::after { left: 21px; }
.toggle.disabled { opacity: .4; cursor: not-allowed; }

/* ── Scores to par ──
   Under par green, over par amber, as on the brand mark: a scorecard marks
   a birdie with a circle and a bogey with a square, so the scorecard cells
   do too -- shape as well as colour. */
.under { color: var(--score-birdie); }
.over { color: var(--amber); }
.even { color: var(--text); }

/* ── Scoring page (athlete.html) ── */
.round-tabs { margin: 0; }
.save-strip { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 15px; color: var(--text-muted); }
.save-strip .status { margin-left: auto; font-size: 14px; font-weight: 700; }
.status-ok { color: var(--green); }
.status-bad { color: var(--red); }
.status-wait { color: var(--text-muted); }
.status-offline { color: var(--amber); }

.play-card { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.hole-nav { display: flex; align-items: center; gap: 8px; }
.hole-head { flex: 1; text-align: center; min-width: 0; }
.hole-title { font-size: 34px; line-height: 1; }
.hole-sub { font-size: 15px; color: var(--text-muted); margin-top: 4px; }
.hole-step {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 30px; line-height: 1; cursor: pointer;
}
.player-rows { display: flex; flex-direction: column; }
.player-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.player-row.me .player-name > span:first-child { font-weight: 700; }
.player-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.player-total { font-size: 14px; color: var(--text-muted); }
.player-total b { font-family: var(--font-display); font-size: 16px; }
/* Big targets for wet or cold fingers. */
.score-stepper { display: flex; align-items: center; gap: 6px; }
.score-stepper .stepper-btn { width: 54px; height: 54px; font-size: 30px; }
.score-val {
  width: 58px; height: 58px; border-radius: 14px; border: 2px solid var(--border);
  background: var(--surface); font-family: var(--font-display); font-size: 32px; font-weight: 700;
  font-variant-numeric: tabular-nums; cursor: pointer; color: var(--text);
}
.score-val.empty { color: var(--text-muted); opacity: .55; border-style: dashed; }
.score-val.under { border-color: var(--score-birdie); color: var(--score-birdie); border-radius: 50%; }
.score-val.over { border-color: var(--score-bogey); color: var(--amber); border-radius: 4px; }
.score-val:disabled, .score-stepper .stepper-btn:disabled { cursor: default; opacity: .45; }
.clear-btn, .clear-btn-space { width: 28px; flex-shrink: 0; }
.clear-btn { height: 28px; border: none; background: none; color: var(--text-muted); font-size: 22px; cursor: pointer; border-radius: 50%; }
.btn-next { min-height: 56px; font-size: 19px; }
.hole-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.hole-chip {
  min-width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted);
  font-family: var(--font-display); font-size: 17px; font-weight: 700; cursor: pointer;
}
.hole-chip.done { background: var(--green-light); border-color: var(--green-border); color: var(--green); }
.hole-chip.current { border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); color: var(--text); }

.done-totals { display: flex; flex-direction: column; margin-top: 10px; }
.done-row { display: grid; grid-template-columns: 1fr auto 48px; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 17px; }
.done-row b, .done-row span:last-child { font-family: var(--font-display); font-size: 20px; text-align: right; }

/* The scorecard: a column per hole, scrolling sideways on a phone. */
.scorecard-wrap { overflow-x: auto; margin: 0 -6px; }
table.scorecard { border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.scorecard th, .scorecard td { text-align: center; padding: 4px 3px; min-width: 30px; border-bottom: 1px solid var(--border); }
.scorecard thead th { font-family: var(--font-display); font-size: 15px; color: var(--text-muted); cursor: pointer; }
.scorecard thead th.current { color: var(--text); text-decoration: underline; }
.scorecard .sc-par td { color: var(--text-muted); font-size: 12px; }
.scorecard .sc-name {
  text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 6px; font-weight: 400;
}
.scorecard tr.me .sc-name { font-weight: 700; }
.scorecard .sc-sum { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.scorecard .sc { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
.scorecard .sc.under { box-shadow: inset 0 0 0 1.5px var(--score-birdie); border-radius: 50%; }
.scorecard .sc.over { box-shadow: inset 0 0 0 1.5px var(--score-bogey); border-radius: 2px; }

/* Stepper (− value +) */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text);
  font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.stepper-btn:hover { border-color: var(--text-muted); }
.stepper-val { font-family: var(--font-display); font-size: 30px; font-weight: 700; min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }

/* ── Toast (public pages) ── */
.pub-toast-box {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 1100;
  bottom: calc(16px + env(safe-area-inset-bottom)); width: min(448px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.pub-toast {
  display: flex; align-items: center; gap: 12px; pointer-events: auto;
  background: var(--brand-deep); color: #fff; border-radius: 12px; padding: 12px 14px 12px 16px;
  font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: opacity .25s;
}
:root[data-theme="dark"] .pub-toast { background: #E6EDF3; color: #0A1622; }
.pub-toast span { flex: 1; }
.pub-toast button {
  background: none; border: none; color: inherit; font: inherit; font-weight: 700;
  text-decoration: underline; cursor: pointer; padding: 4px;
}
.pub-toast.out { opacity: 0; }

/* ── Competition list (front page) ── */
.comp-card .comp-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.15; margin: 8px 0 2px; }
.comp-card .comp-where { font-size: 15px; color: var(--text-muted); margin-bottom: 16px; }
.comp-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.comp-more { margin-top: 12px; text-align: center; }
.comp-more a { font-size: 14px; color: var(--text-muted); font-weight: 700; text-decoration: none; }
.comp-more a:hover { color: var(--text); text-decoration: underline; }

/* Kept for the admin panel's own list labels. */
.comp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.comp-row:last-child { border-bottom: none; }
.comp-meta { font-size: 13px; color: var(--text-muted); }
.comp-group-label {
  font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--text-muted);
  margin: 14px 0 2px;
}
.comp-group-label:first-child { margin-top: 0; }

/* lookup.html: the event a player can still enter scores in */
.lookup-card-live { border-left: 4px solid var(--green); }

/* ── Consent ── */
.consent-row { display: flex; align-items: flex-start; gap: 12px; }
.consent-row input { margin-top: 2px; flex-shrink: 0; }
.consent-row span { font-size: 15px; line-height: 1.45; }

/* ── Results (results.html) ── */
.lb-row.clickable { cursor: pointer; }
.lb-score .main.under { color: var(--score-birdie); }
.lb-score .main.over { color: var(--amber); }
.lb-score .main.muted { color: var(--text-muted); }
.lb-detail { padding: 4px 0 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.lb-detail-head { font-size: 14px; font-weight: 700; color: var(--text-muted); margin-top: 6px; }
.res-note { font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.res-note:empty { display: none; }
.hole-stats { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.hole-stats th { text-align: left; font-size: 13px; color: var(--text-muted); font-weight: 700; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.hole-stats td { padding: 6px; border-bottom: 1px solid var(--border); }
.hole-stats .bar-col { width: 40%; }
.spread { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--gray-light); }
.spread i, .spread-legend i { display: block; height: 100%; }
.spread .u, .spread-legend .u { background: var(--score-birdie); }
.spread .e, .spread-legend .e { background: var(--toggle-off); }
.spread .o, .spread-legend .o { background: var(--score-bogey); }
.spread-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); margin-top: 10px; }
.spread-legend span { display: inline-flex; align-items: center; gap: 6px; }
.spread-legend i { width: 14px; height: 10px; border-radius: 3px; }

/* Spinner */
.spinner { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 15px; }

/* ── Page header (organiser, venue and sponsor logos) ── */
.page-header { padding: 2px 0 0; }
.header-logos { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.header-logo-bi { height: 44px; width: auto; }
.header-logo-venue { height: 40px; width: auto; }
.header-sponsor { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-sponsor-label { font-size: 13px; color: var(--text-muted); }
.header-logo-sponsor { height: 36px; width: auto; }

/* Logo picker (admin) */
.logo-field { display: flex; align-items: center; gap: 10px; }
.logo-preview {
  width: 84px; height: 48px; border: 1px solid var(--border); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; background: #fff; flex-shrink: 0;
  font-size: 12px; color: #6B7884; overflow: hidden; padding: 4px;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-modal { max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.logo-option {
  border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: #102336; font-size: 12px;
}
.logo-option img { height: 44px; max-width: 100%; object-fit: contain; }
.logo-option.selected { box-shadow: inset 0 0 0 3px var(--selected); }

/* ── Footer ── */
footer {
  margin-top: 3rem;
  padding: 1.25rem 0 1rem;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.footer-logo-tindebyte { height: 28px; width: auto; opacity: .75; transition: opacity .15s; display: block; }
.footer-logo-tindebyte:hover { opacity: 1; }
/* The wordmark is navy, unreadable on a dark background: a light copy of the
   SVG swaps in with the theme (an <img> can't be recoloured by CSS). */
.footer-logo-tindebyte.on-dark { display: none; }
:root[data-theme="dark"] .footer-logo-tindebyte.on-light { display: none; }
:root[data-theme="dark"] .footer-logo-tindebyte.on-dark { display: block; }
.footer-tools { display: flex; gap: 8px; }

.icon-btn, .theme-toggle, .feedback-btn {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 50%;
  width: 42px; height: 42px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); flex-shrink: 0; padding: 0;
}
.icon-btn:hover, .theme-toggle:hover, .feedback-btn:hover { border-color: var(--text-muted); }
.icon-btn svg, .theme-toggle svg, .feedback-btn svg { width: 20px; height: 20px; }
.lang-toggle { font-size: 14px; font-weight: 700; letter-spacing: .3px; }

/* Feedback modal */
.feedback-overlay, .tips-overlay {
  position: fixed; inset: 0; background: rgba(10, 22, 34, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; z-index: 1000;
}
.feedback-modal {
  max-width: 420px; width: 100%;
  display: flex; flex-direction: column; gap: 12px;
}
.feedback-modal textarea { resize: vertical; min-height: 100px; }
.modal-intro { font-size: 15px; color: var(--text-muted); }

/* Onboarding tips (athlete.html, first visit only) */
.tips-modal {
  max-width: 380px; width: 100%;
  display: flex; flex-direction: column; gap: 14px;
}
.tips-item { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.tips-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-light); color: var(--blue-dark);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tips-icon svg { width: 18px; height: 18px; }

/* Company billing details */
.billing-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

/* Lookup page */
.lookup-result {
  background: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  display: none;
}

/* GDPR notice */
.gdpr-notice {
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}
.gdpr-notice summary {
  padding: 12px 14px; cursor: pointer; font-weight: 700; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; gap: 10px;
}
.gdpr-notice summary::-webkit-details-marker { display: none; }
.gdpr-notice summary::after { content: '+'; font-size: 20px; line-height: 1; color: var(--text-muted); }
.gdpr-notice[open] summary::after { content: '−'; }
.gdpr-notice .gdpr-body { padding: 0 14px 14px; }
.gdpr-notice a { color: var(--blue-dark); }

/* Athlete number (competitions with company classes) */
.athlete-number {
  display: inline-block; font-variant-numeric: tabular-nums;
  font-size: .85em; font-weight: 700; color: var(--text-muted);
  margin-right: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Front page ── */
.home-head { padding: 14px 0 6px; }
.home-head h1 { font-size: inherit; }
.home-head .brand-mark { width: 46px; gap: 4px; }
.home-head .brand-mark i:nth-child(2) { border-radius: 4px; }
.home-head .brand-name { font-size: 36px; }
.home-tagline { font-size: 17px; color: var(--text-muted); margin-top: 8px; max-width: 34ch; }
.home-lookup .card-title { font-size: 18px; }

/* The athlete's own row (results.html?me=<id>, from their own page). */
.lb-row.me { background: var(--blue-light); margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-radius: 8px; border-bottom-color: transparent; }

/* Disabled buttons go grey rather than fading their colour: a faded green
   "Save" still looked like it could be pressed. */
.btn:disabled, .btn:disabled:hover { opacity: 1; background: var(--gray-light); border-color: var(--border); color: var(--text-muted); }
