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

:root {
  /* Surfaces */
  --bg:          oklch(0.997 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;
}

[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: 'Inter', system-ui, -apple-system, sans-serif;
  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 {
  width: 44px; height: 44px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, oklch(0.72 0.16 55) 0 40%, transparent 40%),
    linear-gradient(180deg, oklch(0.55 0.085 215) 0 50%, oklch(0.92 0.04 85) 50% 100%);
  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 {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background:
    radial-gradient(circle at 35% 35%, var(--warm) 0 40%, transparent 40%),
    linear-gradient(180deg, var(--accent) 0 50%, var(--sand) 50% 100%);
  box-shadow: inset 0 0 0 1px var(--line), 0 2px 8px oklch(0.3 0.05 240 / .15);
}
[data-theme="night"] .brand-mark {
  box-shadow: inset 0 0 0 1px var(--line), 0 2px 8px oklch(0 0 0 / .35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-family: 'Instrument Serif', serif; font-size: 28px; }
.brand-sub { font-size: 12px; color: var(--ink-mute); letter-spacing: 0.05em; text-transform: uppercase; }

.topbar-actions { display: flex; gap: 10px; 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-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.season-title { font-family: 'Instrument Serif', 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: flex; gap: 28px; flex-wrap: wrap; }
.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: 'Instrument Serif', 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);
}

/* ============================== 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 { 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: 'Instrument Serif', 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); }

/* 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 { }

/* ============================== Picker modal */
.picker-overlay {
  position: fixed; inset: 0; background: oklch(0.2 0.03 240 / 0.35);
  backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.picker-overlay.open { opacity: 1; pointer-events: auto; }
.picker {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 380px; max-width: 90vw; overflow: hidden;
  transform: translateY(8px); transition: transform .2s;
}
.picker-overlay.open .picker { transform: translateY(0); }
.picker-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.picker-title { font-family: 'Instrument Serif', serif; font-size: 22px; line-height: 1.1; }
.picker-subtitle { font-size: 12px; color: var(--ink-mute); margin-top: 4px; }
.picker-list { max-height: 280px; overflow-y: auto; }
.picker-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  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);
}
.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); }
.picker-input { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; }
.picker-input input {
  flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  font-size: 14px; font-family: inherit; background: var(--bg-elev); color: var(--ink); outline: none;
}
.picker-input input:focus { border-color: var(--accent); }
.picker-input button {
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-family: inherit; cursor: pointer; font-weight: 500;
}
.picker-input button:disabled { opacity: .4; cursor: not-allowed; }

/* ============================== Wizard */
.wizard-overlay {
  position: fixed; inset: 0; background: oklch(0.2 0.03 240 / 0.5);
  backdrop-filter: blur(4px); z-index: 200; display: grid; place-items: center; padding: 20px;
}
.wizard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 560px; max-width: 100%; max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column; position: relative;
}
.wizard-head { padding: 28px 32px 16px; position: relative; }
.wizard-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;
}
.wizard-close:hover { background: var(--bg-elev); color: var(--ink); border-color: var(--line); }
.wizard-step-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); margin-bottom: 6px; }
.wizard-title { font-family: 'Instrument Serif', serif; font-size: 34px; line-height: 1.05; margin: 0; }
.wizard-title em { font-style: italic; color: var(--accent); }
.wizard-desc { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.wizard-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="number"],
.field input[type="date"],
.field input[type="time"],
.field select {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 15px; font-family: inherit; background: var(--bg-elev); color: var(--ink);
  outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus { border-color: var(--accent); background: var(--surface); }

/* ============================== Edit training day modal */
.edit-modal { width: 460px; }
.modal-form { padding: 4px 0 4px; }
.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; }
.wizard-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;
}
.wizard-gender-btn.gender-male   { border-color: oklch(0.60 0.10 240); }
.wizard-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 var(--line); border-radius: 8px; padding: 8px 12px;
  font-size: 14px; font-family: inherit; background: var(--bg-elev); color: var(--ink); outline: none;
}
.player-input-row input:focus { border-color: var(--accent); }
.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; }
.wizard-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;
}
.wizard-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);
}
.wizard-progress { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-mute); }
.wizard-dots { display: flex; gap: 4px; margin-right: 8px; }
.wizard-dot { width: 18px; height: 3px; border-radius: 2px; background: var(--line); }
.wizard-dot.active { background: var(--accent); }
.wizard-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: 'Instrument Serif', 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; }
.wizard-hint {
  font-size: 13px; color: var(--ink-soft); padding: 8px 12px;
  background: var(--bg-elev); border-radius: 8px; border: 1px solid var(--line-soft);
}
.wizard-hint strong { color: var(--accent); }

/* ============================== Season list dropdown */
.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 { width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.season-list-divider { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.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-hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 24px 28px; flex-wrap: wrap; box-shadow: var(--shadow);
}
.billing-hero-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); margin-bottom: 6px; }
.billing-hero-title { font-family: 'Instrument Serif', serif; font-size: 36px; line-height: 1; margin: 0; }
.billing-hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.bh-stat { display: flex; flex-direction: column; }
.bh-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); margin-bottom: 3px; }
.bh-value { font-family: 'Instrument Serif', serif; font-size: 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: 'Instrument Serif', 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(280px, 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: 'Instrument Serif', 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: 'Instrument Serif', 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 delete modal */
.modal-backdrop {
  position: fixed; inset: 0; background: oklch(0.2 0.03 240 / 0.5);
  backdrop-filter: blur(4px); z-index: 300; display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg); width: 400px; max-width: 100%; padding: 28px 28px 24px;
}
.confirm-title { font-family: 'Instrument Serif', serif; font-size: 26px; margin-bottom: 12px; }
.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); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ============================== Tweaks panel */
.tweaks-panel { position: fixed; bottom: 20px; right: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 16px; z-index: 300; width: 240px; display: none; }
.tweaks-panel.open { display: block; }
.tweaks-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); margin-bottom: 10px; }
.tweak-themes { display: flex; flex-direction: column; gap: 6px; }
.tweak-theme-btn { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--ink); text-align: left; }
.tweak-theme-btn:hover { border-color: var(--accent); }
.tweak-theme-btn.active { border-color: var(--accent); background: oklch(from var(--accent) l c h / 0.06); }
.tweak-theme-btn .preview { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); flex-shrink: 0; }
.tweak-theme-btn .tlabel { font-weight: 500; display: block; }
.tweak-theme-btn .tdesc { font-size: 11px; color: var(--ink-mute); display: block; }
.preview-beach  { background: linear-gradient(135deg, oklch(0.97 0.015 85) 0 50%, oklch(0.52 0.14 240) 50% 100%); }
.preview-sunset { background: linear-gradient(135deg, oklch(0.95 0.03 55) 0 50%, oklch(0.58 0.17 30) 50% 100%); }
.preview-night  { background: linear-gradient(135deg, oklch(0.22 0.035 240) 0 50%, oklch(0.78 0.13 85) 50% 100%); }

::-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;
}

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

/* ============================== 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 display (topbar) */
.login-display { display: flex; align-items: center; gap: 8px; }
.login-name { font-size: 13px; color: var(--ink-soft); }

/* ============================== 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); }

.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;
  margin-top: 12px;
}
.share-btn:hover { transform: translateY(-1px); }
.share-btn:active { transform: translateY(0); }

.btn-logout {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: var(--radius-md);
  padding: 8px 10px; cursor: pointer;
  transition: transform .1s, opacity .15s;
}
.btn-logout:hover { transform: translateY(-1px); }
.btn-logout:active { transform: translateY(0); }

/* ============================== Typography utilities */
.h-display { font-family: 'Instrument Serif', 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: 'Instrument Serif', serif; font-size: var(--text-h1); line-height: var(--leading-tight); letter-spacing: var(--track-tight); }
.h-2       { font-family: 'Instrument Serif', serif; font-size: var(--text-h2); line-height: var(--leading-snug); }
.h-3       { font-family: 'Instrument Serif', serif; font-size: var(--text-h3); line-height: var(--leading-snug); }
.body      { font-family: 'Inter', system-ui, sans-serif; font-size: var(--text-body); line-height: var(--leading-normal); color: var(--ink); }
.body-sm   { font-family: 'Inter', system-ui, sans-serif; font-size: var(--text-body-sm); line-height: var(--leading-normal); color: var(--ink-soft); }
.caption   { font-family: 'Inter', system-ui, sans-serif; font-size: var(--text-caption); line-height: var(--leading-normal); color: var(--ink-soft); }
.eyebrow   { font-family: 'Inter', system-ui, sans-serif; font-size: var(--text-eyebrow); text-transform: uppercase; letter-spacing: var(--track-eyebrow); color: var(--ink-mute); }
.mono      { font-family: 'JetBrains Mono', monospace; font-size: var(--text-mono); font-variant-numeric: tabular-nums; }

/* ============================== 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 {
    grid-template-columns: 80px 1fr 65px 28px;
    padding: 10px 12px;
  }

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

  .day-date {
    gap: 6px;
  }
}
