/* =============================================================
   Náhradníci – Beach tracker
   3 theme variants via [data-theme]
   ============================================================= */

:root {
  /* Surfaces */
  --bg:          oklch(0.97 0.008 195);
  --bg-elev:     oklch(0.999 0.005 195);
  --surface:     oklch(1 0 0);

  /* Ink */
  --ink:         oklch(0.22 0.03 240);
  --ink-soft:    oklch(0.45 0.04 240);
  --ink-mute:    oklch(0.62 0.03 240);

  /* Lines */
  --line:        oklch(0.90 0.015 195);
  --line-soft:   oklch(0.94 0.01 195);

  /* Accent — desaturated blue-green */
  --accent:      oklch(0.55 0.085 215);
  --accent-soft: oklch(0.93 0.04 215);
  --accent-ink:  oklch(0.98 0.01 215);

  /* Warm secondary */
  --warm:        oklch(0.72 0.16 55);
  --warm-ink:    oklch(0.25 0.05 55);
  --warm-soft:   oklch(0.94 0.05 55);

  /* Neutrals */
  --sand:        oklch(0.92 0.04 85);
  --good:        oklch(0.62 0.14 155);
  --danger:      oklch(0.55 0.20 25);
  --danger-soft: oklch(0.55 0.20 25 / 0.08);

  /* Shadows */
  --shadow:      0 1px 0 oklch(0.88 0.02 85 / .7), 0 8px 24px -12px oklch(0.3 0.05 240 / .15);
  --shadow-lg:   0 1px 0 oklch(0.88 0.02 85 / .7), 0 24px 60px -20px oklch(0.3 0.05 240 / .25);

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   10px;
  --radius:      14px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-full: 999px;

  /* Gender */
  --gender-male-bg:    oklch(0.86 0.06 235);
  --gender-male-ink:   oklch(0.32 0.10 240);
  --gender-female-bg:  oklch(0.88 0.05 15);
  --gender-female-ink: oklch(0.40 0.12 15);

  /* Spacing */
  --space-1:  4px;
  --space-2:  6px;
  --space-3:  8px;
  --space-4:  12px;
  --space-5:  16px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  48px;

  /* Type scale */
  --text-display:  52px;
  --text-h1:       38px;
  --text-h2:       26px;
  --text-h3:       22px;
  --text-body:     15px;
  --text-body-sm:  13.5px;
  --text-caption:  12px;
  --text-eyebrow:  11px;
  --text-mono:     13px;

  --leading-tight:   1.1;
  --leading-snug:    1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.65;

  --track-tight:   -0.02em;
  --track-eyebrow:  0.08em;
  --track-caps:     0.1em;

  /* Font families */
  --font-sans:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
}

[data-theme="sunset"] {
  --bg:          oklch(0.95 0.03 55);
  --bg-elev:     oklch(0.97 0.025 55);
  --surface:     oklch(0.99 0.015 55);
  --ink:         oklch(0.25 0.08 30);
  --ink-soft:    oklch(0.45 0.07 30);
  --ink-mute:    oklch(0.60 0.05 30);
  --line:        oklch(0.86 0.04 55);
  --line-soft:   oklch(0.92 0.03 55);
  --accent:      oklch(0.58 0.17 30);
  --accent-ink:  oklch(0.99 0.01 30);
  --warm:        oklch(0.70 0.17 75);
  --warm-ink:    oklch(0.25 0.06 75);
  --sand:        oklch(0.90 0.05 55);
  --good:        oklch(0.62 0.14 155);
}

[data-theme="night"] {
  --bg:          oklch(0.18 0.03 240);
  --bg-elev:     oklch(0.22 0.035 240);
  --surface:     oklch(0.26 0.04 240);
  --ink:         oklch(0.96 0.01 85);
  --ink-soft:    oklch(0.78 0.02 85);
  --ink-mute:    oklch(0.60 0.02 240);
  --line:        oklch(0.34 0.04 240);
  --line-soft:   oklch(0.30 0.035 240);
  --accent:      oklch(0.78 0.13 85);
  --accent-ink:  oklch(0.20 0.03 240);
  --warm:        oklch(0.72 0.16 55);
  --warm-ink:    oklch(0.20 0.04 55);
  --sand:        oklch(0.30 0.04 240);
  --good:        oklch(0.72 0.14 155);
  --shadow:      0 1px 0 oklch(0.3 0.03 240), 0 8px 24px -12px oklch(0 0 0 / .4);
  --shadow-lg:   0 1px 0 oklch(0.3 0.03 240), 0 24px 60px -20px oklch(0 0 0 / .5);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-feature-settings: "ss01", "cv11";
}

body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1200px 500px at 85% -10%, oklch(0.82 0.06 215 / .18), transparent 60%),
    radial-gradient(900px 400px at 0% 105%, oklch(0.85 0.09 55 / .15), transparent 60%);
}
[data-theme="sunset"] body::before {
  background-image:
    radial-gradient(1200px 500px at 85% -10%, oklch(0.78 0.14 30 / .22), transparent 60%),
    radial-gradient(900px 400px at 0% 105%, oklch(0.80 0.13 75 / .22), transparent 60%);
}
[data-theme="night"] body::before {
  background-image:
    radial-gradient(1200px 600px at 80% -20%, oklch(0.40 0.10 240 / .5), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, oklch(0.35 0.07 280 / .4), transparent 60%);
}

/* ============================== Loading */
.app-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: fixed; inset: 0; gap: 16px; color: var(--ink-mute);
}
.app-loading .brand-mark {
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ============================== App shell */
.app {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto;
  padding: 36px 32px 120px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; margin-bottom: 28px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  height: 53px; aspect-ratio: 878.74 / 283.465; flex-shrink: 0;
  background: url('/brand-mark.svg') center / contain no-repeat;
}
.topbar .brand-mark { margin-left: 32px; }
.brand-link { display: inline-flex; text-decoration: none; cursor: pointer; }
.topbar .brand-link { margin-left: 32px; }
.topbar .brand-link .brand-mark { margin-left: 0; }

.topbar-actions { display: flex; gap: 24px; align-items: center; position: relative; }

.season-pick {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; font-size: 13px; color: var(--ink); cursor: pointer; font-family: inherit;
}
.season-pick:hover { border-color: var(--accent); }
.season-pick .chev { color: var(--ink-mute); }

/* ============================== Season hero */
.season-hero {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px 32px; margin-bottom: 22px;
  box-shadow: var(--shadow); overflow: hidden;
}
.season-hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, var(--warm) 0%, transparent 70%);
  opacity: .12; pointer-events: none;
}
.season-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.season-title { font-family: var(--font-serif); font-size: 52px; line-height: 1; letter-spacing: -0.02em; margin: 0 0 6px; }
.season-title em { font-style: italic; color: var(--accent); }
.season-meta { display: flex; align-items: center; gap: 10px; color: var(--ink-mute); font-size: 13px; }
.season-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-mute); }

.stats { display: grid; grid-template-columns: auto auto; column-gap: 34px; row-gap: 14px; }
.stat { display: flex; flex-direction: column; }
.stat-label { font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
.stat-value { font-family: var(--font-serif); font-size: 26px; line-height: 1.1; }
.stat-total { font-size: 16px; color: var(--ink-mute); }

/* ============================== Players bar */
.players-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 14px;
}
.players-bar-label { font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; margin-right: 4px; }
.player-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; font-size: 13px;
}
.player-chip .avatar {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 600; background: var(--sand); color: var(--ink);
  cursor: pointer; outline: 1px solid transparent; outline-offset: 4px;
  transition: width 0.15s, height 0.15s, font-size 0.15s, margin 0.15s, outline-color 0.15s, outline-offset 0.15s;
}
.player-chip .avatar:hover {
  width: 26px; height: 26px; font-size: 12px; margin: -2px;
  outline-color: var(--line); outline-offset: 2px;
}
.shared-view .player-chip .avatar { cursor: default; }
.shared-view .player-chip .avatar:hover {
  width: 22px; height: 22px; font-size: 10px; margin: 0;
  outline-color: transparent; outline-offset: 4px;
}
.gender-male   { background: var(--gender-male-bg)   !important; color: var(--gender-male-ink)   !important; }
.gender-female { background: var(--gender-female-bg) !important; color: var(--gender-female-ink) !important; }
.player-rename-input {
  border: none; outline: none; background: none; font: inherit;
  width: 80px; padding: 0; color: var(--ink);
}
.player-chip .player-name {
  cursor: pointer; padding: 1px 3px; border-radius: 4px;
  transition: background .12s;
}
.player-chip .player-name:hover { background: var(--bg-elev); }

/* ============================== Days table */
.days-section {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow); overflow: hidden;
}
.days-head {
  display: grid; grid-template-columns: 180px 1fr 120px 40px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-mute); background: var(--bg-elev);
}
.day-row {
  display: grid; grid-template-columns: 180px 1fr 120px 40px;
  align-items: center; padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer; transition: background .15s; position: relative;
}
.day-row:hover { background: var(--bg-elev); }
.day-row.past > .day-date,
.day-row.past > .day-subs,
.day-row.past > .day-status { opacity: 0.68; }
.day-row.today::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 3px; background: var(--warm); border-radius: 0 3px 3px 0;
}
.day-date { display: flex; align-items: baseline; gap: 10px; }
.day-num { font-family: var(--font-serif); font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.day-month { font-size: 12px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; }
.day-weekday { font-size: 12px; color: var(--ink-soft); }
.day-subs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sub-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  background: oklch(from var(--warm) l c h / 0.12); color: var(--warm-ink);
  border: 1px solid oklch(from var(--warm) l c h / 0.25);
  border-radius: 999px; font-size: 12.5px; font-weight: 500;
}
[data-theme="night"] .sub-chip {
  background: oklch(from var(--warm) l c h / 0.2); color: oklch(0.95 0.05 55);
  border-color: oklch(from var(--warm) l c h / 0.35);
}
.sub-chip .for { color: var(--ink-mute); font-weight: 400; }
.no-subs { font-size: 13px; color: var(--ink-mute); font-style: italic; }
.day-status { font-size: 12px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.day-status .today-label { color: var(--warm-ink); font-weight: 600; }
.day-chev { color: var(--ink-mute); transition: transform .25s; justify-self: end; }
.day-row.open .day-chev { transform: rotate(90deg); color: var(--accent); }
.day-menu-wrap { position: relative; display: flex; align-items: center; justify-self: end; }
.day-menu-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.day-menu-btn:hover {
  background: var(--bg-elev);
  color: var(--ink);
  border-color: var(--ink-mute);
}
.day-menu {
  position: fixed;
  top: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 6px;
  z-index: 200;
}
.day-menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.day-menu-item:hover { background: var(--bg-elev); }
.day-menu-item.danger { color: var(--danger); }
.day-menu-item.danger:hover { background: oklch(from var(--danger) l c h / 0.08); }
.day-menu-divider { margin: 4px 0; border: none; border-top: 1px solid var(--line-soft); }

/* Expand */
.day-expand { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.day-row.open + .day-expand { max-height: 600px; }
.day-expand-inner {
  padding: 22px 22px 26px; background: var(--bg-elev); border-top: 1px dashed var(--line);
}
.expand-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); margin-bottom: 14px; }
.training-day-note {
  font-size: 12px; color: var(--ink-mute); font-style: italic;
  margin-bottom: 10px; padding: 6px 10px;
  background: var(--bg); border-radius: 6px; border: 1px solid var(--line-soft);
}
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.slot {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; position: relative;
}
.slot.has-sub { border-color: oklch(from var(--warm) l c h / 0.5); }
.slot-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; background: var(--sand); color: var(--ink);
  flex-shrink: 0; position: relative;
}
.slot.has-sub .slot-avatar { background: var(--sand); color: var(--ink); }
.slot.has-sub .slot-avatar::after {
  content: "↔"; position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--warm); color: var(--warm-ink);
  font-size: 10px; display: grid; place-items: center; border: 2px solid var(--surface);
}
.slot-body { flex: 1; min-width: 0; }
.slot-main { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.slot-sub { font-size: 12px; color: var(--ink-mute); }
.slot-sub s { color: var(--ink-mute); text-decoration-thickness: 1px; }
.slot-btn {
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.slot-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.slot.has-sub .slot-btn { color: var(--ink-mute); }
.days-scroll { }

/* ============================== Substitute picker modal */
.picker-input-row { display: flex; gap: 8px; }
.picker-input-row input { flex: 1; }
.picker-list { max-height: 280px; overflow-y: auto; margin: 0 -32px; }
.picker-list-clear { border-top: 1px solid var(--line-soft); margin-top: 12px; }
.picker-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 32px;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  color: var(--ink); font-family: inherit; font-size: 14px;
}
.picker-item:hover { background: var(--bg-elev); }
.picker-item .avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; background: var(--sand); color: var(--ink);
  flex-shrink: 0;
}
.picker-item .name { flex: 1; }
.picker-item .hint { font-size: 11px; color: var(--ink-mute); }
.picker-item.clear { color: var(--ink-mute); }
.picker-item.clear .avatar { background: transparent; border: 1px dashed var(--line); }

/* ============================== Modal */
.modal-overlay {
  position: fixed; inset: 0; background: oklch(0.2 0.03 240 / 0.5);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 560px; max-width: 100%; min-width: 0; max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column; position: relative;
}
.modal-head { padding: 28px 32px 16px; position: relative; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--ink-mute);
  font-size: 22px; line-height: 1; cursor: pointer; font-family: inherit; z-index: 10;
  display: grid; place-items: center; transition: background .15s, color .15s, border-color .15s;
}
.modal-close:hover { background: var(--bg-elev); color: var(--ink); border-color: var(--line); }
.step-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); margin-bottom: 6px; }
.modal-title { font-family: var(--font-serif); font-size: 34px; line-height: 1.05; margin: 0; }
.modal-title em { font-style: italic; color: var(--accent); }
.modal-desc { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.modal-body { padding: 14px 32px 8px; overflow-y: auto; flex: 1; }
.field { display: flex; flex-direction: column; margin-bottom: 16px; }
.field > label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); margin-bottom: 6px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field input[type="time"],
.field select {
  border: 1px solid transparent; border-radius: 14px; padding: 13px 18px;
  font-size: 14px; font-family: inherit; background: var(--surface); color: var(--ink);
  outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.15);
}

/* ============================== Edit event modal */
.edit-warning {
  font-size: 13px; color: var(--warm-ink);
  background: oklch(from var(--warm) l c h / 0.1);
  border: 1px solid oklch(from var(--warm) l c h / 0.3);
  border-radius: 8px; padding: 8px 12px; margin-top: 4px;
}
[data-theme="night"] .edit-warning { color: oklch(0.88 0.12 55); }
.edit-error {
  font-size: 13px; color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid oklch(from var(--danger) l c h / 0.3);
  border-radius: 8px; padding: 8px 12px; margin-top: 4px;
}
.field-hint { font-size: 12px; color: var(--ink-mute); margin-top: 4px; }
.field-optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-mute); font-style: italic; }
.weather-icon { font-size: 15px; line-height: 1; margin-left: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.players-input { display: flex; flex-direction: column; gap: 6px; }
.player-input-row { display: flex; align-items: center; gap: 8px; }
.gender-btn {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; border: 1px solid var(--line); background: var(--sand); color: var(--ink);
  flex-shrink: 0; cursor: pointer; padding: 0;
}
.gender-btn.gender-male   { border-color: oklch(0.60 0.10 240); }
.gender-btn.gender-female { border-color: oklch(0.62 0.10 15); }
.player-input-row .num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; background: var(--sand); color: var(--ink-soft); flex-shrink: 0;
}
.player-input-row input {
  flex: 1; border: 1px solid transparent; border-radius: 10px; padding: 9px 14px;
  font-size: 14px; font-family: inherit; background: var(--surface); color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.player-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.15);
}
.player-input-row button {
  background: none; border: none; cursor: pointer; color: var(--ink-mute); font-size: 16px; width: 26px; height: 26px;
}
.player-input-row button:hover { color: var(--danger); }
.add-player-btn {
  align-self: flex-start; background: none; border: 1px dashed var(--line); border-radius: 8px;
  padding: 7px 12px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; font-family: inherit; margin-top: 4px;
}
.add-player-btn:hover { border-color: var(--accent); color: var(--accent); border-style: solid; }
.modal-error {
  margin: 0 32px 12px; font-size: 13px; color: var(--danger);
  background: var(--danger-soft); border: 1px solid oklch(from var(--danger) l c h / 0.3);
  border-radius: 8px; padding: 8px 12px;
}
.modal-foot {
  padding: 18px 32px 22px; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--bg-elev);
}
.modal-foot-actions { justify-content: flex-end; }
.step-progress { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-mute); }
.step-dots { display: flex; gap: 4px; margin-right: 8px; }
.step-dot { width: 18px; height: 3px; border-radius: 2px; background: var(--line); }
.step-dot.active { background: var(--accent); }
.step-dot.done { background: oklch(from var(--accent) l c h / 0.4); }
.btn-row { display: flex; gap: 8px; }
.btn {
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: transform .1s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent; color: var(--ink-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 18px; font-size: 14px; font-family: inherit; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-danger {
  background: var(--danger); color: white; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer;
}
.btn-danger:hover { background: oklch(0.48 0.20 25); }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; padding: 4px 0 12px; }
.summary-item .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); margin-bottom: 3px; }
.summary-item .value { font-size: 15px; }
.summary-full { grid-column: 1 / -1; }
.summary-highlight {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-top: 12px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.summary-highlight .big { font-family: var(--font-serif); font-size: 38px; line-height: 1; color: var(--accent); }
.summary-highlight .desc { font-size: 12.5px; color: var(--ink-soft); text-align: right; }
.price-toggle {
  display: flex; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; padding: 3px;
}
.price-toggle-btn {
  flex: 1; background: transparent; border: none; padding: 9px 12px; font-family: inherit;
  font-size: 13px; color: var(--ink-soft); cursor: pointer; border-radius: 7px; transition: background .15s, color .15s;
}
.price-toggle-btn:hover { color: var(--ink); }
.price-toggle-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px oklch(0 0 0 / 0.06); font-weight: 500; }
.modal-hint {
  font-size: 13px; color: var(--ink-soft); padding: 8px 12px;
  background: var(--bg-elev); border-radius: 8px; border: 1px solid var(--line-soft);
}
.modal-hint strong { color: var(--accent); }
.field-error { font-size: 12px; color: var(--danger); margin-top: -8px; margin-bottom: 10px; }
.field-currency-row { display: flex; gap: 6px; }
.field-currency-row input { flex: 1; min-width: 0; }
.field-currency-row select { width: 60px; flex-shrink: 0; }

/* ============================== Season list dropdown */
.season-picker-wrap { position: relative; display: inline-flex; align-items: center; }
.season-list {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
  min-width: 240px; z-index: 50; display: none;
}
.season-list.open { display: block; }
.season-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; gap: 10px;
}
.season-list-item:hover { background: var(--bg-elev); }
.season-list-item .active-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--good); margin-left: 6px; vertical-align: middle; }
.season-list-divider { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.season-list-divider.dashed { height: 0; background: none; border-top: 1px dashed var(--line-soft); }
.season-list-item.new { color: var(--accent); }

.season-list-item-name { flex: 1; }
.season-list-item-actions { display: flex; align-items: center; gap: 6px; }

.season-delete-btn {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  border: none; background: transparent;
  color: var(--ink-mute); cursor: pointer;
  opacity: 0; transition: opacity .15s, background .15s, color .15s;
  flex-shrink: 0;
}
.season-list-item:hover .season-delete-btn { opacity: 1; }
.season-delete-btn:hover {
  background: oklch(from var(--danger) l c h / 0.1);
  color: var(--danger);
}

/* ============================== View toggle */
.view-toggle {
  display: inline-flex; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; margin-right: 8px;
}
.view-toggle-btn { background: transparent; border: none; padding: 6px 14px; border-radius: 999px; font-family: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.view-toggle-btn:hover { color: var(--ink); }
.view-toggle-btn.active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px oklch(0 0 0 / 0.08); }

/* ============================== Billing */
.billing { display: flex; flex-direction: column; gap: 22px; }
.billing-section { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px 24px; box-shadow: var(--shadow); }
.billing-section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; gap: 16px; }
.billing-section-title { font-family: var(--font-serif); font-size: 24px; margin: 0; font-weight: 400; }
.billing-section-hint { font-size: 12px; color: var(--ink-mute); }
.billing-empty { font-size: 13px; color: var(--ink-mute); font-style: italic; padding: 20px; text-align: center; }
.balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.balance-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.balance-card-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 10px; }
.balance-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--sand); color: var(--ink); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.balance-name { font-size: 15px; font-weight: 500; }
.balance-sub-label { font-size: 12px; color: var(--ink-mute); }
.balance-amount-wrap { text-align: right; }
.balance-amount-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); }
.balance-amount { font-family: var(--font-serif); font-size: 22px; line-height: 1.1; }
.balance-amount.has { color: var(--warm-ink); }
.balance-amount.zero { color: var(--ink-mute); }
[data-theme="night"] .balance-amount.has { color: oklch(0.88 0.12 55); }
.balance-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.balance-bar-fill { height: 100%; background: linear-gradient(90deg, var(--warm), var(--accent)); border-radius: 2px; }
.balance-math { font-size: 11.5px; color: var(--ink-mute); }
.balance-subs { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; }
.balance-sub-row { display: grid; grid-template-columns: 50px 1fr auto; gap: 10px; font-size: 12.5px; align-items: center; }
.balance-sub-date { color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.balance-sub-name { color: var(--ink); }
.balance-sub-amt { font-variant-numeric: tabular-nums; color: var(--warm-ink); font-weight: 500; }
[data-theme="night"] .balance-sub-amt { color: oklch(0.88 0.12 55); }
.tx-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tx-head, .tx-row, .tx-foot { display: grid; grid-template-columns: 120px 1fr 1fr 120px; gap: 12px; padding: 10px 16px; align-items: center; }
.tx-head { background: var(--bg-elev); border-bottom: 1px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); }
.tx-row { border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.tx-row:last-of-type { border-bottom: none; }
.tx-date { display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.tx-day { font-size: 15px; font-family: var(--font-serif); }
.tx-mon { font-size: 11px; color: var(--ink-mute); text-transform: uppercase; }
.tx-dow { font-size: 11px; color: var(--ink-mute); margin-left: 4px; }
.tx-sub { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.tx-avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 600; background: oklch(from var(--warm) l c h / 0.2); color: var(--warm-ink); }
[data-theme="night"] .tx-avatar { background: oklch(from var(--warm) l c h / 0.3); color: oklch(0.92 0.05 55); }
.tx-player { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-soft); }
.tx-arrow { color: var(--ink-mute); }
.tx-amount { font-variant-numeric: tabular-nums; font-weight: 500; }
.r { text-align: right; }
.tx-foot { background: var(--bg-elev); border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.sub-summary { display: flex; flex-direction: column; gap: 4px; }
.sub-summary-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 14px; }
.sub-summary-row:hover { background: var(--bg-elev); }
.sub-summary-name { font-weight: 500; }
.sub-summary-count { font-size: 12.5px; color: var(--ink-mute); }
.sub-summary-total { font-variant-numeric: tabular-nums; font-weight: 500; }

/* ============================== Confirm body */
.confirm-body { font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.confirm-sub { margin-top: 8px; font-size: 13px; color: var(--ink-mute); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--surface); }
::-webkit-scrollbar-track { background: transparent; }

#blazor-error-ui {
  background: oklch(0.55 0.20 25); bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
  display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem;
  position: fixed; width: 100%; z-index: 1000; color: white; font-size: 14px;
}
#blazor-error-ui .reload { color: #fff; font-weight: 600; text-decoration: underline; margin-left: 8px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ============================== Past section toggle */
.days-past-header {
  display: grid; grid-template-columns: 180px 1fr 120px 40px;
  align-items: center; padding: 14px 22px;
  cursor: pointer; background: var(--bg-elev);
  border-top: 2px solid var(--line);
  font-size: 13px; color: var(--ink-mute);
  transition: background .15s;
}
.days-past-header:hover { background: var(--sand); }
.days-past-header .day-chev { justify-self: end; transition: transform .25s; }
.days-past-header.open .day-chev { transform: rotate(90deg); color: var(--accent); }
.days-past-count { font-size: 12px; }

.days-past-body {
  display: grid; grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows .35s ease;
}
.days-past-header.open + .days-past-body { grid-template-rows: 1fr; }
.days-past-body > div { overflow: hidden; min-height: 0; }

/* ============================== Inline rename */
.chip-rename-trigger {
  cursor: pointer;
}
.chip-rename-trigger:hover {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 2px;
}
.chip-rename-input {
  border: none;
  border-bottom: 1.5px solid var(--accent);
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  padding: 0;
  width: 90px;
}
.sub-rename-input {
  font-size: 14px;
  font-weight: 500;
  width: 120px;
}

/* ============================== Layout shell */
.layout-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.layout-content {
  flex: 1;
}

/* ============================== Footer */
.app-footer {
  margin-top: 48px;
  padding: 14px 32px 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--ink-mute);
  text-align: center;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 1;
}

/* ============================== Login screen */
.login-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 16px; padding: 32px;
}
.login-tagline { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* ============================== Login (centered single column — register, etc.) */
.login-centered {
  --form-width: 380px;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 48px 24px;
  position: relative; z-index: 1;
}
.auth-tagline {
  font-size: 14px; line-height: 1.55; color: var(--ink-soft);
  margin: 0 0 20px;
}

/* ============================== Login (split layout) */
.login-split {
  --form-width: 380px;
  --center-gap: 96px;
  --brand-side: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  position: relative; z-index: 1;
}
.login-split-form {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 32px var(--center-gap) 32px 32px;
}
.login-form-inner {
  width: 100%; max-width: var(--form-width);
  display: flex; flex-direction: column;
}
.login-logo {
  height: 67px;
  align-self: flex-start;
  margin-bottom: 36px;
}
.login-heading {
  font-family: var(--font-serif);
  font-size: 34px; font-weight: 700; line-height: 1.15;
  margin: 0 0 24px;
  color: var(--ink);
  letter-spacing: -0.025em;
}
h1[tabindex="-1"]:focus { outline: none; }
.auth-form {
  display: flex; flex-direction: column; gap: 16px;
  margin: 0;
}
.form-row {
  display: flex; flex-direction: column; gap: 7px;
}
.form-row label {
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
}
.input-with-icon { position: relative; }
.input-icon {
  position: absolute;
  left: 16px; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  color: var(--ink-mute);
  pointer-events: none;
}
.login-input {
  width: 100%;
  padding: 13px 18px 13px 46px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.15);
}
.input-with-icon:focus-within .input-icon { color: var(--accent); }
.btn-login-wide {
  width: 100%;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 14.5px;
  margin-top: 4px;
}
.auth-error {
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  padding: 10px 14px;
  border-radius: 10px;
}
.login-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px;
  margin-top: 18px;
}
.login-meta-soft { color: var(--ink-mute); }
.login-meta-strong {
  color: var(--ink); font-weight: 400; text-decoration: none;
}
button.login-meta-strong {
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: inherit; cursor: pointer;
}
.login-meta-strong:hover { color: var(--accent); }
.login-forgot {
  display: inline-block; align-self: flex-start;
  margin-top: 6px;
  font-size: 13.5px;
}
.login-google {
  margin-top: 28px;
  display: flex; justify-content: flex-start;
}
.google-icon-wrap {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.google-icon-wrap:hover { border-color: var(--accent); transform: translateY(-1px); }
.google-icon-art {
  width: 24px; height: 24px;
  pointer-events: none;
}
.google-icon-host {
  position: absolute; inset: 0;
  opacity: 0;
  display: flex; align-items: center; justify-content: center;
}
.google-icon-host > div { width: 100%; height: 100%; }

.login-split-brand {
  display: flex; align-items: center; justify-content: flex-start;
  padding: 0 var(--brand-side) 0 0;
}
.login-split-brand-inner {
  width: calc(var(--form-width) + 2 * var(--center-gap));
  height: 80vh;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 30px;
  padding: 56px var(--center-gap);
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--shadow-lg);
}
.login-brand-heading {
  font-family: var(--font-serif);
  font-size: 34px; font-weight: 700; line-height: 1.15;
  margin: 0;
  color: var(--accent-ink);
  letter-spacing: -0.025em;
}
.login-brand-tagline {
  color: oklch(from var(--accent-ink) l c h / 0.78);
  font-size: 13px; line-height: 1.6;
  margin: 20px 0 0; max-width: 420px;
}

@media (max-width: 1200px) {
  .login-split { grid-template-columns: 1fr; min-height: auto; }
  .login-split-form { padding: 48px 24px; justify-content: center; }
  .login-split-brand { padding: 0 16px 24px; }
  .login-split-brand-inner {
    width: 100%; height: auto;
    padding: 40px 32px;
  }
  .login-brand-heading { font-size: 25px; }
  .login-heading { font-size: 25px; }
  .login-brand-tagline { font-size: 13px; max-width: none; }
}

/* ============================== Shared season error */
.shared-error-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  position: relative; z-index: 1;
}
.shared-error-card {
  width: 100%; max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: var(--shadow);
  text-align: center;
}
.shared-error-card .brand-link {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.shared-error-title {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--ink);
}
.shared-error-msg {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 auto 28px;
  max-width: 360px;
}
.shared-error-actions {
  display: flex; gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================== Login display (topbar) */
.shared-badge { font-size: 13px; color: var(--ink-soft); }

/* User menu — pill (variant C) + dropdown */
.user-menu { position: relative; display: inline-flex; align-items: center; }

.user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; font-size: 13px; color: var(--ink); cursor: pointer; font-family: inherit;
  transition: border-color .15s;
}
.user-pill:hover { border-color: var(--accent); }
.user-pill.open { border-color: var(--accent); }

.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; background: var(--sand); color: var(--ink);
  flex-shrink: 0;
}
.user-avatar.lg { width: 38px; height: 38px; font-size: 14px; }

.user-pill-name {
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-chevron { color: var(--ink-mute); transition: transform .15s; flex-shrink: 0; }
.user-pill.open .user-chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
  min-width: 240px; z-index: 50;
}

.user-dropdown-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
}
.user-dropdown-id { display: flex; flex-direction: column; min-width: 0; }
.user-dropdown-name { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown-email { font-size: 12px; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-dropdown-divider { height: 1px; background: var(--line-soft); margin: 6px 4px; }

.user-dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; background: transparent; border-radius: 8px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); text-align: left;
  cursor: pointer; transition: background .12s;
}
.user-dropdown-item svg { color: var(--ink-soft); flex-shrink: 0; }
.user-dropdown-item:hover { background: var(--bg-elev); }
.user-dropdown-item:disabled { opacity: 0.45; cursor: default; }
.user-dropdown-item:disabled:hover { background: transparent; }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger svg { color: var(--danger); }
.user-dropdown-item.danger:hover { background: oklch(from var(--danger) l c h / 0.1); }

/* ============================== Notifications */
.user-avatar { position: relative; }
.notif-dot {
  position: absolute; top: -2px; right: -2px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
}
.notif-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; line-height: 1;
  background: var(--danger); color: white; border-radius: 9px;
}

.notif-grid { display: grid; grid-template-columns: 200px 1fr; }
.notif-row {
  align-items: center; padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.notif-row:last-child { border-bottom: none; }
.notif-date { font-size: 13px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.notif-text { font-size: 14px; color: var(--ink); }
.notif-row.text-muted .notif-text { color: var(--ink-mute); }

@media (max-width: 560px) {
  .notif-grid { grid-template-columns: 130px 1fr; }
  .notif-row { padding: 14px 16px; }
}

/* ============================== Action buttons */
.btn-login {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: var(--radius-md);
  padding: 10px 22px; font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: transform .1s, opacity .15s;
}
.btn-login:hover { transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

.hero-actions {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  margin-top: 12px;
}
.hero-actions .view-toggle { margin-right: 0; }

.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: var(--radius-md);
  padding: 8px 14px; font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: transform .1s, opacity .15s;
}
.share-btn:hover { transform: translateY(-1px); }
.share-btn:active { transform: translateY(0); }

/* ============================== Typography utilities */
.h-display { font-family: var(--font-serif); font-size: var(--text-display); line-height: var(--leading-tight); letter-spacing: var(--track-tight); }
.h-display em { font-style: italic; color: var(--accent); }
.h-1       { font-family: var(--font-serif); font-size: var(--text-h1); line-height: var(--leading-tight); letter-spacing: var(--track-tight); }
.h-2       { font-family: var(--font-serif); font-size: var(--text-h2); line-height: var(--leading-snug); }
.h-3       { font-family: var(--font-serif); font-size: var(--text-h3); line-height: var(--leading-snug); }
.body      { font-family: var(--font-sans); font-size: var(--text-body); line-height: var(--leading-normal); color: var(--ink); }
.body-sm   { font-family: var(--font-sans); font-size: var(--text-body-sm); line-height: var(--leading-normal); color: var(--ink-soft); }
.caption   { font-family: var(--font-sans); font-size: var(--text-caption); line-height: var(--leading-normal); color: var(--ink-soft); }
.eyebrow   { font-family: var(--font-sans); font-size: var(--text-eyebrow); text-transform: uppercase; letter-spacing: var(--track-eyebrow); color: var(--ink-mute); }

/* ============================== Cancelled days */
.day-row.cancelled { cursor: default; }
.day-row.cancelled:hover { background: transparent; }
.day-row.cancelled > .day-date,
.day-row.cancelled > .day-subs,
.day-row.cancelled > .day-status { opacity: 0.62; }
.badge-cancelled {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid oklch(from var(--danger) l c h / 0.25);
  border-radius: 999px; font-size: 12px; font-weight: 500;
}
.cancelled-label { color: var(--danger); font-weight: 500; font-size: 12px; }
.cancelled-info { font-size: 13px; color: var(--ink-mute); font-style: italic; }

/* ============================== Cancelled section toggle */
.days-cancelled-header {
  display: grid; grid-template-columns: 180px 1fr 120px 40px;
  align-items: center; padding: 14px 22px;
  cursor: pointer; background: var(--bg-elev);
  border-top: 2px solid var(--line);
  font-size: 13px; color: var(--ink-mute);
  transition: background .15s;
}
.days-cancelled-header:hover { background: var(--sand); }
.days-cancelled-header .day-chev { justify-self: end; transition: transform .25s; }
.days-cancelled-header.open .day-chev { transform: rotate(90deg); color: var(--accent); }
.days-cancelled-count { font-size: 12px; }

.days-cancelled-body {
  display: grid; grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows .35s ease;
}
.days-cancelled-header.open + .days-cancelled-body { grid-template-rows: 1fr; }
.days-cancelled-body > div { overflow: hidden; min-height: 0; }

/* ============================== CancelOrRescheduleModal choices */
.cancel-choice-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 4px; }
.cancel-choice-btn {
  width: 100%; text-align: left;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
  cursor: pointer; font-family: inherit; color: var(--ink);
  transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 4px;
}
.cancel-choice-btn:hover { border-color: var(--accent); background: var(--surface); }
.cancel-choice-btn strong { font-size: 14.5px; font-weight: 500; }
.cancel-choice-btn span { font-size: 12.5px; color: var(--ink-mute); }
.cancel-choice-btn.danger:hover { border-color: var(--danger); }

/* ============================== Season list page */
.season-list-title {
  font-family: var(--font-serif);
  font-size: 34px; font-weight: 700; line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 24px 32px;
}
.notif-hint { margin: -12px 0 24px 32px; }
.season-list-empty {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 60px 20px; color: var(--ink-mute);
}
.season-list-empty .btn { text-decoration: none; display: inline-block; }

/* Grid shared by head, row and past-header: name, running info, action, chev */
.days-head.season-grid,
.day-row.season-grid,
.days-past-header.season-grid {
  grid-template-columns: minmax(126px, 1.12fr) 1fr 110px 40px;
  column-gap: 24px;
}
.season-name {
  font-family: var(--font-serif); font-size: 20px; line-height: 1.2;
  min-width: 0; overflow-wrap: anywhere;
}
.season-cell {
  font-size: 13px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.season-cell-action { justify-self: end; }
/* Season + invitation rows have no chevron — let the actions span to the right edge */
.season-row-actions,
.invitation-actions { grid-column: 3 / -1; }

.season-players-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 22px;
}
.season-detail-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 32px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

/* Season detail can be taller than a day expand */
.day-row.season-grid.open + .day-expand { max-height: 900px; }

@media (max-width: 760px) {
  .days-head.season-grid,
  .day-row.season-grid,
  .days-past-header.season-grid {
    grid-template-columns: 1fr 90px 28px;
  }
  /* Hide running-info (2); keep name + action + chev */
  .days-head.season-grid > div:nth-child(2),
  .day-row.season-grid > div:nth-child(2) { display: none; }
  /* Running-info hidden, no chevron — actions fill from col 2 to the edge */
  .season-row-actions,
  .invitation-actions { grid-column: 2 / -1; }
  /* Past header: hide spacer (2), keep name + count + chev */
  .days-past-header.season-grid > div:nth-child(2) { display: none; }
  .season-name { font-size: 17px; }
  .season-list-title { font-size: 25px; }
}

/* ============================== Mobile */
@media (max-width: 600px) {
  .app {
    padding: 14px 14px 72px;
  }

  /* Topbar wraps: brand on row 1, actions full-width on row 2 */
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  /* View toggle stretches to fill left side */
  .view-toggle {
    flex: 1;
    margin-right: 0;
  }

  .view-toggle-btn {
    flex: 1;
    text-align: center;
    padding: 7px 8px;
  }

  /* Season pick: cap width and truncate long names */
  .season-pick {
    max-width: 145px;
    flex-shrink: 0;
  }

  .season-pick > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  /* Days table: narrower date column */
  .days-head,
  .day-row,
  .days-past-header,
  .days-cancelled-header {
    grid-template-columns: 80px 1fr 65px 28px;
    padding: 10px 12px;
  }

  .day-num {
    font-size: 24px;
  }

  .day-date {
    gap: 6px;
  }

  /* Season dropdown: anchor left and cap to viewport so it can't overflow off-screen */
  .season-list {
    left: 0;
    right: auto;
    min-width: 0;
    max-width: calc(100vw - 28px);
  }

  /* Reset desktop indents that waste width on mobile */
  .topbar .brand-link { margin-left: 0; }
  .season-list-title { margin-left: 0; }
  .notif-hint { margin-left: 0; }

  /* User pill: hide the name to save width, keep avatar + chevron */
  .user-pill-name { display: none; }
  .user-pill { padding: 5px; }

  /* User dropdown: anchor right but cap to viewport so it can't overflow off-screen */
  .user-dropdown {
    min-width: 0;
    max-width: calc(100vw - 28px);
  }

  /* Transactions table: reflow each row to two lines instead of a 4-col grid that overflows */
  .tx-head { display: none; }
  .tx-row {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
    padding: 12px 14px;
  }
  .tx-row .tx-date   { grid-area: 1 / 1; }
  .tx-row .tx-amount { grid-area: 1 / 2; }
  .tx-row .tx-sub    { grid-area: 2 / 1; }
  .tx-row .tx-player { grid-area: 2 / 2; justify-self: end; }
  .tx-foot { grid-template-columns: 1fr auto; }
  .tx-foot > div:nth-child(2),
  .tx-foot > div:nth-child(3) { display: none; }

  /* Modals: shrink horizontal paddings so form fields aren't choked.
     (min-width: 0 lives on .modal in the base rule.) */
  .modal-head { padding: 22px 18px 14px; }
  .modal-body { padding: 12px 18px 8px; }
  .modal-foot { padding: 14px 18px 18px; flex-wrap: wrap; row-gap: 10px; }
  .modal-foot .btn-row { width: 100%; justify-content: flex-end; }
  .modal-error { margin: 0 18px 12px; }

  /* Keep picker list flush with the modal edges after padding change */
  .picker-list { margin: 0 -18px; }
  .picker-item { padding: 10px 18px; }

  /* Stack two-column form grids on mobile */
  .field-row,
  .summary-grid { grid-template-columns: 1fr; }
}

/* Role icons (owner / manager) */
.role-icon {
  width: 14px; height: 14px;
  flex-shrink: 0;
  vertical-align: -2px;
  margin-right: 6px;
}
.role-icon-owner { color: var(--accent); }
.role-icon-manager { color: var(--accent); }
.role-icon--hoverable { cursor: pointer; transition: opacity .15s, color .15s; }
.role-icon--hoverable:hover { opacity: 0.7; }
/* Placed after the owner/manager color rules so it wins by source order (equal specificity). */
.role-icon--favorite { color: #F5B800; }
.season-list-item-name .role-icon { margin-right: 4px; }
.season-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.season-title .role-icon { width: 28px; height: 28px; margin-right: 0; flex-shrink: 0; }

/* Manager chips - pending invitation visual */
.player-chip.pending {
  opacity: 0.65;
}
.player-chip.pending .avatar {
  background: var(--bg-elev);
  color: var(--ink-mute);
  border: 1px dashed var(--line);
}
.player-chip .chip-remove-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; margin-left: 4px;
  border: none; background: transparent;
  color: var(--ink-mute); cursor: pointer; border-radius: 4px;
  font-size: 14px; line-height: 1;
}
.player-chip .chip-remove-btn:hover {
  background: oklch(from var(--danger) l c h / 0.12);
  color: var(--danger);
}

.players-bar.managers-bar { margin-top: 8px; }
.btn-add-manager {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-size: 13px;
  border: 1px dashed var(--line); background: transparent;
  color: var(--ink-soft); cursor: pointer;
}
.btn-add-manager:hover { border-color: var(--accent); color: var(--accent); }

/* Pending invitation rows — share season-grid layout with season list rows */
.invitation-row { cursor: default; }
.invitation-actions,
.season-row-actions {
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-decline {
  padding: 5px 10px; border-radius: 6px; font-size: 12px;
  border: 1px solid var(--line); background: transparent;
  color: var(--ink); cursor: pointer; font-family: inherit;
}
.btn-decline:hover {
  background: oklch(from var(--danger) l c h / 0.1);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-decline:disabled { opacity: 0.5; cursor: default; }

