:root {
  --ink: #14241c;
  --muted: #5c6e64;
  --line: #e1e6df;
  --paper: #f3f5f1;
  --card: #fff;
  --green: #0f3d32;
  --green-2: #1c5c49;
  --ball: #dff25a;
  --ball-ink: #1b2808;
  --clay: #c45c2a;
  --sky: #1f6f8a;
  --busy: #f6d4d0;
  --busy-line: #e3b0aa;
  --mine: #0e9a45;
  --danger: #9d2c2c;
  --ok: #1d7a46;
  --shadow: 0 10px 28px rgba(20, 36, 28, 0.08);
  --radius: 18px;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --cond: "Barlow Condensed", "Avenir Next Condensed", sans-serif;
  --nav-h: calc(62px + env(safe-area-inset-bottom));
  --accent: var(--green);
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 380px at 100% -8%, rgba(223, 242, 90, 0.45), transparent 55%),
    linear-gradient(180deg, #e6f0ea, var(--paper) 320px);
  -webkit-font-smoothing: antialiased;
}

body[data-area="frei"] {
  background:
    radial-gradient(880px 360px at 100% -8%, rgba(31, 111, 138, 0.22), transparent 52%),
    linear-gradient(180deg, #e4f2f5, var(--paper) 320px);
}

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

.app {
  height: 100%;
  min-height: 0;
}

.stage {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 14px 0;
}

.screen {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: calc(var(--nav-h) + 12px);
}

.screen.is-plan {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--nav-h);
}

.has-sel .screen.is-plan {
  padding-bottom: calc(var(--nav-h) + 84px);
}

.side { display: none; }

.top, .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top { justify-content: space-between; padding: 10px 0 8px; }

.mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 30% 28%, rgba(223, 242, 90, 0.45), transparent 46%),
    linear-gradient(145deg, var(--green-2), var(--green));
  position: relative;
  box-shadow: inset 0 0 0 1.5px rgba(223, 242, 90, 0.45);
}

.mark::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 2px solid var(--ball);
  border-radius: 50%;
}

body[data-area="frei"] .mark {
  background:
    radial-gradient(circle at 30% 28%, rgba(223, 242, 90, 0.3), transparent 46%),
    linear-gradient(145deg, var(--sky), var(--green));
}

.club, .product { margin: 0; line-height: 1.1; }
.club { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.product { font-size: 1.05rem; font-weight: 800; }

.top-actions, .side-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-top { justify-content: space-between; }

.avatar, .gear {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.avatar {
  border: 0;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.gear {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: white;
  color: var(--green);
  padding: 0;
}

.gear svg { width: 22px; height: 22px; display: block; }

.gear.is-on {
  background: var(--green);
  color: white;
  border-color: transparent;
}

.tabbar {
  position: fixed;
  z-index: 30;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.tab-brand {
  flex: 0 1 148px;
  min-width: 0;
  gap: 8px;
  margin-right: 4px;
}

.tab-brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.tab-brand .mark::after { inset: 8px; border-width: 1.5px; }

.tab-name {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.tabbar button, .sidenav button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  min-height: 44px;
  font-weight: 700;
  color: var(--muted);
}

.tabbar button { flex: 1; padding: 0 4px; }

.tabbar button[data-nav="account"] {
  flex: 0 0 68px;
  margin-left: 10px;
  padding: 0 6px;
  font-size: 0.86rem;
}

.tabbar button.is-on, .sidenav button.is-on {
  background: var(--green);
  color: white;
}

.plan {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.switch button {
  border: 0;
  background: transparent;
  border-radius: 11px;
  min-height: 40px;
  font-weight: 700;
}

.switch button small {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.75;
}

.switch button[aria-selected="true"] {
  background: var(--accent);
  color: white;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.season {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.next {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 16px;
  padding: 10px 12px;
  background: white;
  box-shadow: var(--shadow);
}

.next span, .next small { color: var(--muted); font-size: 0.78rem; }
.next strong { font-size: 0.95rem; }

.live {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
  border: 1px solid #cfe8c4;
}

.live-head { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.live span { color: var(--green); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.live strong { font-size: 1.02rem; }

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mine);
  box-shadow: 0 0 0 0 rgba(14, 154, 69, 0.45);
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(14, 154, 69, 0.45); opacity: 1; }
  70% { box-shadow: 0 0 0 8px rgba(14, 154, 69, 0); opacity: 0.55; }
  100% { box-shadow: 0 0 0 0 rgba(14, 154, 69, 0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}
.live .btn { width: 100%; }
.live .fine { margin: 0; }

.dayhead {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dayhead h2, .page-title {
  margin: 0;
  font-size: 1.15rem;
  flex: 1;
}

.iconbtn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  font-size: 1.3rem;
  line-height: 1;
}

.iconbtn:disabled { opacity: 0.35; }

.daystrip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.daystrip::-webkit-scrollbar { display: none; }

.daychip {
  flex: 0 0 auto;
  width: 52px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 6px 0 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.daychip span { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.daychip strong {
  font-family: var(--cond);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
.daychip.is-on { background: var(--accent); color: white; border-color: transparent; }
.daychip.is-on span { color: rgba(255, 255, 255, 0.8); }
.daychip.is-we:not(.is-on) { background: #f7f3ea; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-right: 4px;
  vertical-align: -1px;
  border: 1px solid var(--line);
}

.lg.free { background: white; }
.lg.mine { background: var(--mine); border-color: var(--mine); }
.lg.busy { background: var(--busy); border-color: var(--busy-line); }
.lg.pick { background: var(--ball); border-color: #c8dc45; }

.hint, .policy, .price-wait, .fine {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.board {
  flex: 1;
  min-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.board-grid, .week-grid {
  display: grid;
  min-width: 100%;
}

.board-grid { grid-template-columns: 48px repeat(var(--n), minmax(68px, 1fr)); }
.week-grid { grid-template-columns: 48px repeat(7, minmax(42px, 1fr)); }

.corner, .gh, .dh, .tm {
  position: sticky;
  background: #f6f7f4;
  z-index: 2;
}

.corner, .gh, .dh { top: 0; z-index: 3; }
.corner, .tm { left: 0; }
.corner { z-index: 4; }

.gh, .dh, .tm, .corner {
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.gh, .corner { min-height: 36px; }
.dh {
  flex-direction: column;
  gap: 0;
  min-height: 48px;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 4px 0;
}
.dh strong { font-family: var(--cond); font-size: 1.05rem; line-height: 1; }
.dh span, .dh small { font-size: 0.62rem; color: var(--muted); font-weight: 700; }
.dh.is-today { background: #eef6df; }
.tm {
  font-family: var(--cond);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: white;
  border-top: 1px solid var(--line);
  min-height: 48px;
  flex-direction: column;
  gap: 0;
}

.tm.is-now {
  color: var(--green);
  background: #eef6df;
  font-weight: 800;
}

.tm.is-now small {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cell {
  border: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  min-height: 48px;
  background: white;
  font-family: var(--cond);
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.cell.is-free { background: white; box-shadow: inset 0 0 0 1px rgba(15, 61, 50, 0.04); }
.cell.is-count {
  color: var(--green);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0;
  line-height: 1.05;
  padding: 0 2px;
}
.cell.is-pick { background: var(--ball); color: var(--ball-ink); }
.cell.is-mine, .cell.is-past-mine { background: var(--mine); color: white; font-weight: 700; }
.cell.is-busy { background: var(--busy); box-shadow: inset 0 0 0 1px var(--busy-line); }
.cell.is-past, .cell.is-closed { opacity: 0.55; }
.cell:disabled { cursor: default; }
.tm.is-compact, .cell.is-compact { min-height: 28px; font-size: 0.85rem; }

.fold {
  grid-column: 1 / -1;
  border: 0;
  border-top: 1px solid var(--line);
  background: #f7f8f6;
  color: var(--muted);
  text-align: left;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chips button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.86rem;
}

.chips button[aria-pressed="true"] {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

.selbar {
  position: fixed;
  z-index: 35;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-h) + 8px);
}

.selbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  background: var(--green);
  color: white;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 61, 50, 0.28);
}

.selbar-inner p { margin: 0; }
.selbar .btn { width: auto; min-width: 96px; padding-inline: 16px; }
.selbar-inner strong { display: block; }
.selbar-inner span { display: block; font-size: 0.78rem; color: rgba(255, 255, 255, 0.82); }
.selbar-grow { flex: 1; min-width: 0; }
.sel-x {
  border: 0;
  background: transparent;
  color: white;
  font-size: 1.2rem;
  width: 32px;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}

.page-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.back {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 700;
  color: var(--accent);
  align-self: flex-start;
}

.book { display: flex; flex-direction: column; gap: 12px; }

.card, .receipt, .bk, .paypal {
  background: white;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.when { margin: 4px 0 0; color: var(--muted); }

.prices { margin: 0; }
.prices div, .payrow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.prices div:first-child { border-top: 0; }
.prices dt { color: var(--muted); }
.prices dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 650; }
.prices .total { border-top-width: 2px; font-size: 1.12rem; }
.prices .total dt, .prices .total dd { color: var(--ink); font-weight: 800; }
.prices .total dd { font-family: var(--cond); font-size: 1.55rem; letter-spacing: 0.02em; }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 650; font-size: 0.92rem; }
.field input, .field textarea, .search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: white;
  font-weight: 500;
}
.field textarea { resize: vertical; min-height: 76px; }

.subhead {
  margin: 8px 0 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.picks, .topups, .preset { display: flex; flex-wrap: wrap; gap: 8px; }

.picks button, .member, .topups button, .preset button, .btn, .btn-ghost, .btn-line {
  border-radius: 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: white;
  padding: 8px 12px;
  font-weight: 700;
}

.picks button[aria-pressed="true"], .member[aria-pressed="true"] {
  border-color: var(--accent);
  background: #eef6f2;
}

body[data-area="frei"] .picks button[aria-pressed="true"],
body[data-area="frei"] .member[aria-pressed="true"] {
  background: #e7f4f8;
}

.member {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag.is-guest { color: var(--clay); }
.chosen { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.check, .radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  font-weight: 650;
}
.check small, .radio small { display: block; font-weight: 500; color: var(--muted); }
.check input, .radio input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); }
.is-dim { opacity: 0.45; }

.balance {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
}
.balance strong { font-family: var(--cond); font-size: 1.8rem; }

.btn {
  width: 100%;
  border: 0;
  background: var(--ball);
  color: var(--ball-ink);
  font-weight: 800;
}
.btn:disabled { background: #e5e8e2; color: #8b978f; }
.btn-ghost { background: transparent; }
.btn-line { background: white; }
.btn-danger { color: var(--danger); border-color: #f0d0d0; }

.book { padding-bottom: 120px; }

.confirm-bar {
  position: fixed;
  z-index: 25;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-h) + 8px);
  padding: 8px 0 0;
  background: linear-gradient(transparent, var(--paper) 24%);
}

details {
  background: white;
  border-radius: 14px;
  padding: 10px 12px;
}
summary { font-weight: 750; cursor: pointer; }
details ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
details li + li { margin-top: 4px; }

.tabs-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.bk h3, .card h2, .card h3, .paypal h3 { margin: 0; }
.bk header, .split { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #eef3ef;
  border-radius: 999px;
  padding: 4px 8px;
}
.pill.is-lock { background: #f8ecec; color: var(--danger); }
.bk p { margin: 6px 0 0; }
.sum { font-family: var(--cond); font-size: 1.45rem; letter-spacing: 0.02em; }

.groups { display: flex; flex-direction: column; gap: 14px; }
.groups h3 { margin: 0 0 8px; font-size: 0.95rem; }
.grid-2 { display: grid; gap: 10px; }
.readonly {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: #f6f7f4;
  border-radius: 12px;
}
.readonly span { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 700; }

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(var(--nav-h) + 78px);
  transform: translateX(-50%);
  max-width: min(440px, calc(100% - 24px));
  background: var(--ink);
  color: white;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 650;
}

.done-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ball);
  color: var(--ball-ink);
  font-weight: 800;
  font-size: 1.4rem;
}

@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .app {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    position: relative;
    width: min(1120px, 100%);
    height: 100%;
    margin-inline: auto;
    background: rgba(255, 255, 255, 0.42);
    box-shadow: 0 0 0 1px var(--line);
  }
  .side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px;
    background: rgba(255, 255, 255, 0.72);
    border-right: 1px solid var(--line);
  }
  .sidenav { display: flex; flex-direction: column; gap: 6px; }
  .sidenav button { text-align: left; padding: 0 14px; }
  .side-meta { margin-top: auto; font-size: 0.88rem; color: var(--muted); }
  .side-meta strong { color: var(--ink); }
  .side-foot { margin: 0; font-size: 0.78rem; color: var(--muted); }
  .tabbar { display: none; }
  .stage { padding: 22px 28px 0; }
  .screen { padding-bottom: 28px; }
  .top { display: none; }
  .screen.is-plan, .has-sel .screen.is-plan { padding-bottom: 20px; }
  .plan-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }
  .plan-controls .switch { width: 260px; }
  .book {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .book-head, .book-foot { grid-column: 1 / -1; }
  .book { padding-bottom: 0; }
  .confirm-bar,
  .selbar {
    position: absolute;
    left: 268px;
    right: 28px;
    width: auto;
    bottom: 22px;
  }
  .toast { bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
