/* OpenBracket Admin — hard Apple (SF system, materials, fluid response) */
:root {
  --bg: #F2F2F7;
  --bg-deep: #E5E5EA;
  --shell: #F2F2F7;
  --card: #FFFFFF;
  --card-solid: #FFFFFF;
  --ink: #1C1C1E;
  --label-2: #3A3A3C;
  --muted: #8E8E93;
  --line: rgba(60, 60, 67, 0.12);
  --separator: rgba(60, 60, 67, 0.29);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.16);
  --fill-3: rgba(120, 120, 128, 0.2);
  --primary: #1C1C1E;
  --primary-soft: rgba(120, 120, 128, 0.12);
  --accent: #007AFF;
  --accent-ink: #FFFFFF;
  --clay: #FF9F0A;
  --good: #34C759;
  --live: #FF3B30;
  --blue: #007AFF;
  --purple: #AF52DE;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 8px 28px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --material: rgba(255, 255, 255, 0.72);
  --material-heavy: rgba(242, 242, 247, 0.86);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --header-h: 3.75rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast: 100ms;
  --duration-bump: 220ms;
  --press: scale(0.97);
}

* { box-sizing: border-box; }
/* The UA rule for [hidden] loses to any class that sets `display`, which silently
   breaks every `el.hidden = true` in the app. Enforce it once, globally. */
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html, body { margin: 0; min-height: 100%; }
body {
  font: 100%/1.47 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button,
.btn,
.app-header-nav-link,
.court-chip,
.share-chip {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(60, 60, 67, 0.28); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(60, 60, 67, 0.42); }

@media (prefers-reduced-transparency: reduce) {
  :root {
    --material: #FFFFFF;
    --material-heavy: #F2F2F7;
  }
}

/* —— Auth —— */
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse 90% 55% at 50% -20%, rgba(0, 122, 255, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--material);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow-soft);
}
.auth-card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.auth-card h1::before {
  content: 'O';
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  background: #000;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.auth-card label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 510;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.auth-card input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}
.auth-card input:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.16);
}
.auth-card button,
.btn {
  border: 0;
  border-radius: 980px;
  padding: 10px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 590;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    transform var(--duration-fast) ease-out,
    opacity var(--duration-fast) ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.auth-card button:hover,
.btn:hover { background: #0066D6; }
.auth-card button:active,
.btn:active { transform: var(--press); }
.btn-accent { background: var(--blue); color: #fff; }
.btn-accent:hover { background: #0066D6; }
.btn-ghost {
  background: var(--fill);
  border: 0;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--fill-2); }
.btn-ghost:active { transform: var(--press); background: var(--fill-3); }
.ok { color: var(--good); }
.err { color: var(--live); }
.auth-card .muted a { color: var(--blue); font-weight: 510; text-decoration: underline; text-underline-offset: 2px; }

/* —— Admin shell —— */
.admin-app {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.app-shell {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow-x: clip;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
  min-width: 0;
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "brand actions"
    "nav nav";
  align-items: center;
  gap: 0.65rem 0.75rem;
  padding: 0.65rem 1rem;
  padding-top: max(0.65rem, env(safe-area-inset-top));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  border-bottom: 0.5px solid var(--separator);
  background: var(--material);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}
.app-header-left { grid-area: brand; }
.app-header-nav { grid-area: nav; }
.app-header-actions { grid-area: actions; }
.app-header:not(:has(.app-header-nav)) {
  grid-template-areas: "brand actions";
}
@media (min-width: 768px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "brand nav actions";
    gap: 0.75rem 1rem;
    padding: 0.7rem 1.75rem;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .app-header {
    background: #FFFFFF;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.app-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.04em;
  white-space: nowrap;
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease-out;
}
.app-header-brand:active { opacity: 0.55; transform: var(--press); }
.app-header-logo {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: #000;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}
.app-header-clinic { font-size: 1.15rem; font-weight: 680; }

.app-header-code {
  font-size: 0.8125rem;
  font-weight: 590;
  color: var(--ink);
  background: var(--fill);
  padding: 0.4rem 0.8rem;
  border-radius: 980px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  max-width: min(11.5rem, 34vw);
  transition: background var(--duration-fast) ease, transform var(--duration-fast) ease-out;
}
.app-header-switch-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.015em;
}
.app-header-code:hover { background: var(--fill-2); }
.app-header-code:active { transform: var(--press); }
.app-header-switch { position: relative; }
.app-header-code--switch {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.app-header-code--switch::-webkit-details-marker { display: none; }
.app-header-switch[open] > .app-header-code--switch {
  background: var(--fill-3);
}
.app-header-switch-chevron {
  font-size: 0.55rem;
  opacity: 0.55;
  flex: none;
}
.app-header-switch-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  left: auto;
  z-index: 50;
  min-width: 15rem;
  max-width: min(22rem, 80vw);
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(40px) saturate(190%);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  border: 0.5px solid var(--separator);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18), 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  display: grid;
  gap: 0.1rem;
  transform-origin: top right;
  animation: apple-menu-in 220ms var(--ease-spring);
}
@keyframes apple-menu-in {
  from { opacity: 0; transform: scale(0.92) translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .app-header-switch-menu { animation: none; }
}
.app-header-switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 510;
  letter-spacing: -0.01em;
  transition: background var(--duration-fast) ease;
}
.app-header-switch-item:hover { background: var(--fill); }
.app-header-switch-item:active { background: var(--fill-2); }
.app-header-switch-item--active {
  background: rgba(0, 122, 255, 0.12);
  color: var(--blue);
  font-weight: 600;
}
.app-header-switch-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-header-switch-code {
  flex: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.app-header-switch-item--active .app-header-switch-code { color: var(--blue); }
.app-header-switch-item--new {
  border-top: 0.5px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
  color: var(--blue);
}

.app-header-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.15rem;
  background: var(--fill);
  border-radius: 980px;
}
.app-header-nav::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
  .app-header-nav {
    width: auto;
    overflow-x: visible;
    padding: 0.2rem;
    justify-content: center;
  }
}
.app-header-nav-link {
  padding: 0.5rem 0.85rem;
  border-radius: 980px;
  font-size: 0.875rem;
  font-weight: 510;
  letter-spacing: -0.015em;
  color: var(--label-2);
  white-space: nowrap;
  flex: none;
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  transition:
    color var(--duration-fast) ease,
    background var(--duration-fast) ease,
    transform var(--duration-fast) ease-out,
    box-shadow 180ms var(--ease-out);
}
.app-header-nav-link:hover { color: var(--ink); }
.app-header-nav-link:active { transform: var(--press); }
.app-header-nav-link--active {
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.app-header-nav-link--active:hover { color: var(--ink); background: #FFFFFF; }

.app-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 768px) {
  .app-header-actions { gap: 0.75rem; }
}
.app-header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--fill);
  padding: 0.28rem 0.55rem 0.28rem 0.32rem;
  border-radius: 980px;
  border: 0;
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 768px) {
  .app-header-user {
    gap: 0.6rem;
    padding: 0.3rem 0.7rem 0.3rem 0.4rem;
  }
}
.app-header-user .app-header-code {
  background: rgba(255, 255, 255, 0.85);
}
.app-header-user .app-header-switch-menu {
  right: 0;
  left: auto;
}
@media (max-width: 420px) {
  .app-header-code { max-width: min(9rem, 42vw); }
  .app-header-avatar { display: none; }
}
.app-header-avatar {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--fill-3);
  color: var(--label-2);
  display: grid;
  place-items: center;
  font-weight: 680;
  font-size: 0.68rem;
  letter-spacing: -0.02em;
  flex: none;
}
.app-header-logout {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--label-2);
  background: var(--fill);
  font-size: 0.72rem;
  line-height: 1;
  text-decoration: none;
  transition: opacity var(--duration-fast) ease, color var(--duration-fast) ease, background var(--duration-fast) ease;
}
.app-header-logout:hover {
  opacity: 1;
  color: var(--ink);
  background: var(--fill-3);
}
.app-header-logout:active { opacity: 0.55; }

/* Language switcher */
.lang-switch {
  position: relative;
  display: inline-flex;
  flex: none;
}
.lang-switch__btn {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.16);
  transition: transform 100ms ease-out, box-shadow 150ms ease, filter 150ms ease;
}
.lang-switch__btn::-webkit-details-marker { display: none; }
.lang-switch__btn::marker { content: ""; }
.lang-switch__btn:hover { filter: brightness(1.03); }
.lang-switch__btn:active { transform: scale(0.94); }
.lang-switch[open] > .lang-switch__btn { box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.35); }
.lang-switch__flag {
  width: 1.55rem;
  height: 1.15rem;
  display: block;
  object-fit: cover;
  pointer-events: none;
  border-radius: 3px;
}
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 0.3rem;
  padding: 0.4rem;
  min-width: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  transform-origin: top right;
  animation: lang-menu-in 280ms var(--ease-spring, cubic-bezier(0.32, 0.72, 0, 1));
}
.lang-switch__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  line-height: 0;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.16);
  transition: transform 100ms ease-out, box-shadow 120ms ease, filter 120ms ease;
  animation: lang-opt-in 300ms var(--ease-spring, cubic-bezier(0.32, 0.72, 0, 1)) both;
}
.lang-switch__opt:nth-child(1) { animation-delay: 30ms; }
.lang-switch__opt:nth-child(2) { animation-delay: 70ms; }
.lang-switch__opt:nth-child(3) { animation-delay: 110ms; }
.lang-switch__opt:hover { filter: brightness(1.03); box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.28); }
.lang-switch__opt:active { transform: scale(0.94); }
@keyframes lang-menu-in {
  from { opacity: 0; transform: translateY(-8px) scaleY(0.9); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}
@keyframes lang-opt-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .lang-switch__menu,
  .lang-switch__opt { animation: none; }
  .lang-switch__btn:active,
  .lang-switch__opt:active { transform: none; }
}
.lang-switch--header { margin-right: 0.2rem; }
.lang-switch--auth {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
}
.auth-card { position: relative; }
.lang-switch--dark .lang-switch__btn,
.lang-switch--dark .lang-switch__opt {
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.28);
}
.lang-switch--dark .lang-switch__menu {
  background: rgba(28, 28, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
}
.lang-switch--dark[open] > .lang-switch__btn,
.lang-switch--dark .lang-switch__opt:hover {
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.45);
}
.app-header-apps {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--muted);
  border-radius: 0.5rem;
  transition: color .15s ease, background .15s ease;
}
.app-header-apps:hover {
  color: var(--ink);
  background: var(--fill);
}

@media (max-width: 767px) {
  .app-header-clinic { display: none; }
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow-x: clip;
  overflow-y: auto;
}
.ta-page { flex: 1; min-width: 0; }
.ta-page-inner {
  max-width: none;
  margin: 0;
  padding: 1.15rem 1rem 2rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
  width: 100%;
}
.ta-page-inner--wide { max-width: none; }
@media (min-width: 768px) {
  .ta-page-inner { padding: 1.75rem 2rem 2.5rem; gap: 1.5rem; }
}

.ta-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0;
}
.ta-page-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
@media (min-width: 768px) {
  .ta-page-title { font-size: 2.1rem; letter-spacing: -0.04em; }
}
.ta-page-sub {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}
.ta-flash {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: rgba(52, 199, 89, 0.12);
  color: #248A3D;
  font-size: 0.9rem;
  border: 0;
}
.ta-flash--warn {
  background: rgba(255, 159, 10, 0.14);
  color: #9A6700;
}

/* —— Dashboard —— */
.dash-day-chrome { margin: 0; }
.agenda-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.1rem;
}
@media (min-width: 768px) {
  .agenda-head {
    flex-direction: row;
    align-items: flex-end;
  }
}
.agenda-greet-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.94rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.agenda-greet {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.75rem, 4.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: var(--ink);
}
.agenda-sub {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em;
}
.agenda-now-time {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.agenda-now-sep { color: rgba(60, 60, 67, 0.28); }

.agenda-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--fill);
  padding: 0.2rem;
  border-radius: 980px;
  border: 0;
  align-self: stretch;
  max-width: 100%;
}
@media (min-width: 768px) {
  .agenda-head-actions {
    align-self: flex-end;
    max-width: none;
  }
}
.agenda-head-actions .btn,
.agenda-head-actions .btn-ghost {
  border: 0;
  background: transparent;
  color: var(--label-2);
  box-shadow: none;
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 510;
  letter-spacing: -0.01em;
  min-height: 2.35rem;
  flex: 1 1 auto;
  text-align: center;
}
@media (min-width: 768px) {
  .agenda-head-actions .btn,
  .agenda-head-actions .btn-ghost {
    padding: 0.45rem 1.05rem;
    font-size: 0.875rem;
    flex: none;
  }
}
.agenda-head-actions .btn-ghost:hover {
  color: var(--ink);
  background: transparent;
}
.agenda-head-actions .btn:not(.btn-ghost) {
  background: #FFFFFF;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}
.agenda-head-actions .btn:active,
.agenda-head-actions .btn-ghost:active {
  transform: var(--press);
}

.agenda-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
}
@media (min-width: 1024px) {
  .agenda-hero { grid-template-columns: 2fr 1fr; gap: 1.15rem; }
}

.agenda-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.2rem 1.2rem 1.2rem 1.35rem;
  border-radius: var(--radius-xl);
  background: #FFFFFF;
  border: 0;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: transform 180ms var(--ease-spring), box-shadow 180ms ease;
}
@media (min-width: 768px) {
  .agenda-next {
    gap: 1.25rem 1.75rem;
    padding: 1.4rem 1.55rem;
  }
}
.agenda-next::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--blue);
  opacity: 1;
  border-radius: 3px 0 0 3px;
}
.agenda-next:hover { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07); }
.agenda-next--live::before { display: none; }
.agenda-next--idle::before { background: var(--good); }
.agenda-next--live {
  background: #1C1C1E;
  color: #F5F5F7;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}
.agenda-next-timeblock {
  flex: none;
  min-width: 4.5rem;
  padding-left: 0.55rem;
  text-align: left;
}
.agenda-next-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.agenda-next--live .agenda-next-kicker { color: rgba(235, 235, 245, 0.55); }
.agenda-next-time {
  margin: 0;
  font-family: var(--display);
  font-size: 2.55rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}
.agenda-next--live .agenda-next-time { color: #fff; }
.agenda-next-rel {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.agenda-next--live .agenda-next-rel { color: rgba(235, 235, 245, 0.55); }
.agenda-next-divider {
  width: 0.5px;
  align-self: stretch;
  min-height: 3.5rem;
  background: var(--separator);
}
.agenda-next--live .agenda-next-divider { background: rgba(84, 84, 88, 0.65); }
@media (max-width: 560px) {
  .agenda-next-divider { display: none; }
}
.agenda-next-body { flex: 1 1 12rem; min-width: 0; }
.agenda-next-name {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.agenda-next-meta {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.agenda-next--live .agenda-next-meta { color: rgba(235, 235, 245, 0.55); }
.agenda-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-left: auto;
  width: 100%;
}
@media (min-width: 640px) {
  .agenda-next-actions { width: auto; }
}
@media (max-width: 639px) {
  .agenda-next-actions .btn { width: 100%; }
}
.agenda-next--live .btn:not(.btn-ghost) {
  background: #FFFFFF;
  color: #1C1C1E;
}
.agenda-next--live .btn:not(.btn-ghost):hover { background: #F2F2F7; }
.agenda-next--live .btn-ghost {
  background: rgba(120, 120, 128, 0.28);
  border: 0;
  color: #F5F5F7;
}
.agenda-next--live .btn-ghost:hover {
  background: rgba(120, 120, 128, 0.4);
  color: #fff;
}

.agenda-today-card {
  background: #FFFFFF;
  border: 0;
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.45rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-soft);
}
.agenda-today-label {
  margin: 0 0 1rem;
  font-size: 0.68rem;
  font-weight: 680;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.agenda-today-stats {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.05rem 1rem;
}
.agenda-today-stats dt {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.agenda-today-stats dd {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.court-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 0.75rem;
  margin: 0;
}
@media (min-width: 768px) {
  .court-strip { gap: 0.85rem; }
}
.court-chip {
  display: grid;
  gap: 0.35rem;
  padding: 1.1rem 1.15rem;
  background: #FFFFFF;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--duration-fast) ease-out,
    box-shadow 180ms ease,
    background 150ms ease;
  cursor: pointer;
}
.court-chip:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07); }
.court-chip:active { transform: var(--press); }
.court-chip.is-live {
  border: 0;
  background: #1C1C1E;
  color: #F5F5F7;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.court-chip-name {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.court-chip-meta {
  font-size: 0.78rem;
  letter-spacing: -0.01em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.court-chip-meta::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(60, 60, 67, 0.28);
  flex: none;
}
.court-chip.is-live .court-chip-meta { color: rgba(235, 235, 245, 0.55); }
.court-chip.is-live .court-chip-meta::before {
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.22);
}

.ta-card {
  background: #FFFFFF;
  border: 0;
  border-radius: var(--radius-xl);
  padding: 1.05rem 1.1rem;
  box-shadow: var(--shadow-soft);
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 768px) {
  .ta-card { padding: 1.25rem 1.4rem; }
}
.ta-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 0.5px solid var(--line);
}
.ta-card-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 680;
  letter-spacing: -0.025em;
}
.ta-card-head .muted,
.ta-card-head a.muted {
  font-size: 0.9rem;
  font-weight: 510;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ta-card-head a.muted:hover { opacity: 0.7; }

.agenda-list-card { margin: 0; }
.agenda-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.65rem;
  margin: -0.35rem 0 1rem;
}
.agenda-search {
  position: relative;
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 18rem;
}
.agenda-search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1em;
  font-size: 0.8rem;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
.agenda-search input[type="search"],
.agenda-search input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.65rem;
  min-height: 2.35rem;
  font-size: 0.875rem;
  background: var(--fill);
  border: 0;
  border-radius: 12px;
}
.agenda-search input[type="search"]::-webkit-search-decoration,
.agenda-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.agenda-search input:focus {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.16);
}
.agenda-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.2rem;
  background: var(--fill);
  border-radius: 980px;
}
.agenda-pill {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--label-2);
  font: 600 0.72rem/1 inherit;
  letter-spacing: 0.01em;
  padding: 0.45rem 0.75rem;
  border-radius: 980px;
  cursor: pointer;
  min-height: 2rem;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, transform var(--duration-fast) ease-out;
}
.agenda-pill:hover { color: var(--ink); }
.agenda-pill:active { transform: var(--press); }
.agenda-pill.is-on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}
.agenda-pill[data-status="live"].is-on { color: var(--live); }
.agenda-pill[data-status="completed"].is-on { color: #248A3D; }
#matchesTbody > tr[hidden] { display: none !important; }
.agenda-select {
  flex: 0 1 auto;
  min-width: 8.5rem;
  max-width: 12rem;
  min-height: 2.35rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  background: var(--fill);
  border: 0;
  border-radius: 12px;
}
@media (max-width: 720px) {
  .agenda-search { max-width: none; flex-basis: 100%; }
  .agenda-select { flex: 1 1 calc(50% - 0.35rem); max-width: none; }
  .agenda-pills { width: 100%; justify-content: stretch; }
  .agenda-pill { flex: 1; text-align: center; }
}
.agenda-day-list { list-style: none; margin: 0; padding: 0; }
.agenda-day-row[hidden] { display: none !important; }
.agenda-day-list:has(.agenda-day-empty:not([hidden])) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7rem;
}
.agenda-day-empty {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.9rem;
  width: 100%;
  border: 0 !important;
}
.agenda-day-row {
  display: grid;
  grid-template-columns: 3.5rem 0.55rem minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem 0.65rem;
  padding: 0.85rem 0.15rem;
  border-bottom: 0.5px solid var(--line);
  border-radius: 10px;
  transition: background var(--duration-fast) ease;
}
.agenda-day-row:last-child { border-bottom: 0; }
.agenda-day-row:hover { background: var(--fill); }
@media (max-width: 720px) {
  .agenda-day-row {
    grid-template-columns: 3.2rem 0.55rem 1fr auto;
    grid-template-areas:
      "time dot name actions"
      "time dot detail actions"
      "time dot status actions";
  }
  .agenda-day-time { grid-area: time; }
  .agenda-day-dot { grid-area: dot; }
  .agenda-day-name { grid-area: name; }
  .agenda-day-detail { grid-area: detail; }
  .agenda-day-status { grid-area: status; }
  .agenda-day-actions { grid-area: actions; }
}
.agenda-day-time {
  font-size: 0.72rem;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.agenda-day-row--live .agenda-day-time { color: var(--live); }
.agenda-day-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(60, 60, 67, 0.28);
  justify-self: center;
}
.agenda-day-row--live .agenda-day-dot {
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.16);
}
.agenda-day-row--scheduled .agenda-day-dot { background: var(--blue); }
.agenda-day-name {
  font-weight: 590;
  font-size: 0.94rem;
  letter-spacing: -0.015em;
  min-width: 0;
}
.agenda-day-detail { font-size: 0.84rem; color: var(--muted); min-width: 0; letter-spacing: -0.01em; }
.agenda-day-status {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.agenda-day-row--live .agenda-day-status { color: var(--live); }
.agenda-day-actions { display: flex; gap: 6px; justify-content: flex-end; }

.btn-xs {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 980px;
}
.btn.is-disabled,
span.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}
@media (pointer: coarse) {
  .btn,
  .btn-ghost {
    min-height: 2.75rem;
  }
  .btn-xs {
    min-height: 2.5rem;
    padding: 0.5rem 0.9rem;
  }
  .agenda-day-actions .btn-xs,
  .table-scroll .btn-xs {
    min-height: 2.35rem;
  }
}

.share-title {
  margin: 0 0 1.15rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 680;
  letter-spacing: -0.025em;
}
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}
.share-courts {
  margin: 1.1rem 0 0;
  padding-top: 0.95rem;
  border-top: 0.5px solid var(--line);
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.25rem;
}
.share-courts a { color: var(--blue); }
.share-courts a:hover { opacity: 0.7; }
.share-chip {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 14px;
  background: var(--fill);
  min-width: 0;
  flex: 1 1 10rem;
  text-align: left;
  transition: background var(--duration-fast) ease, transform var(--duration-fast) ease-out;
}
.share-chip:hover { background: var(--fill-2); }
.share-chip:active { transform: var(--press); background: var(--fill-3); }
.share-chip span {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.share-chip code {
  font-size: 0.9rem;
  font-weight: 590;
  letter-spacing: -0.015em;
  font-family: var(--font);
  color: var(--ink);
}

.field {
  display: grid;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 510;
  letter-spacing: -0.01em;
}
.field input,
.field select,
.field textarea,
.field-inline,
select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="file"],
input[type="password"],
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.16);
}
.field textarea { resize: vertical; min-height: 4rem; }
.field-inline { min-width: 0; width: 100%; max-width: 100%; }
@media (min-width: 480px) {
  .field-inline { min-width: 10rem; width: auto; }
}
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 400;
}

/* —— Settings —— */
.settings-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 960px) {
  .settings-layout {
    grid-template-columns: minmax(16rem, 0.9fr) minmax(0, 1.35fr);
    gap: 1.5rem;
  }
  .settings-layout > .settings-card:nth-child(3) {
    grid-column: 1 / -1;
  }
}
.settings-card { margin: 0; }
.settings-card-flash { margin: 0 0 1.15rem; }
.settings-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.settings-status::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}
.settings-status--open {
  color: #248A3D;
  background: rgba(52, 199, 89, 0.14);
}
.settings-status--closed {
  color: #9A6700;
  background: rgba(255, 159, 10, 0.14);
}
.settings-identity {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--fill);
  border: 0;
}
.settings-identity-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}
.settings-identity-code {
  margin: 0.45rem 0 0;
}
.settings-identity-code code {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 0.45rem;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #374151;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.settings-block {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid #f3f4f6;
}
.settings-block-label {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-tour-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.settings-tour-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.settings-tour-chip:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}
.settings-tour-chip.is-current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.settings-closed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.settings-closed-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  flex-wrap: wrap;
}
.settings-closed-meta {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.settings-closed-meta a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
}
.settings-closed-meta a:hover { text-decoration: underline; }
.settings-closed-meta code {
  font-size: 0.72rem;
  color: var(--muted);
}
.settings-rules {
  display: grid;
  gap: 1.15rem;
}
.settings-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
.settings-fieldset legend {
  padding: 0;
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-fields {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 640px) {
  .settings-fields {
    grid-template-columns: 1fr 1fr;
  }
  .settings-check { grid-column: 1 / -1; }
}
.settings-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.settings-check:hover { border-color: #d1d5db; }
.settings-check.is-on {
  border-color: #a7f3d0;
  background: #f0fdf4;
}
.settings-check input {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  accent-color: #059669;
  flex: none;
}
.settings-check span {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.settings-check strong {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}
.settings-check em {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--muted);
}
.settings-rules-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
  border-top: 1px solid #f3f4f6;
}

.signup-status-card { margin-bottom: 1rem; }
.signup-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
}
.signup-status-row .ta-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

.signup-queue { margin-bottom: 1rem; }
.signup-queue-list {
  display: grid;
  gap: 0.75rem;
}
.signup-queue-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--fill-2, rgba(0, 0, 0, 0.03));
}
.signup-queue-main { min-width: min(100%, 16rem); flex: 1 1 14rem; }
.signup-queue-meta { margin-top: 0.25rem; font-size: 0.8rem; }
.signup-queue-note {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: var(--ink);
}
.signup-queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.player-import {
  display: grid;
  gap: 1rem;
}
.player-import-example span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.player-import-pre {
  margin: 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--fill-2, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre;
  color: var(--ink);
}

.player-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.player-form .field--full { grid-column: 1 / -1; }
.player-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  background: #eff6ff;
  display: inline-block;
}
.player-thumb--empty { border: 1px dashed var(--line); }
.player-photo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--shell);
}
.player-photo-row .player-thumb {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
}
.player-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--ink);
}
.player-status--paid { background: #ecfdf5; color: #047857; }
.player-status--cancelled { background: #fef2f2; color: #b91c1c; }
.player-checkin-box {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--shell);
}
.player-checkin-box code {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.player-checkin-box a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.player-qr {
  width: 120px;
  height: 120px;
  flex: 0 0 120px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.player-qr canvas,
.player-qr table {
  display: none !important;
}
.player-qr img {
  display: block;
  width: 120px !important;
  height: 120px !important;
}
.court-qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  padding: 4px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  overflow: hidden;
  vertical-align: middle;
}
/* qrcode.js draws canvas then swaps to <img>; never force canvas/table visible */
.court-qr canvas,
.court-qr table {
  display: none !important;
}
.court-qr img {
  display: block !important;
  width: 64px !important;
  height: 64px !important;
  max-width: 100%;
  margin: 0 auto !important;
}
.court-connect-btn {
  min-height: 2.75rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  width: 100%;
  justify-content: center;
}
.court-list {
  display: grid;
  gap: 0.75rem;
}
.court-list-empty {
  margin: 0;
  padding: 1.25rem 0.25rem;
}
.court-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: var(--material, #fff);
  border: 1px solid var(--line);
}
.court-row.is-live {
  border-color: color-mix(in srgb, #ff3b30 35%, var(--line));
}
.court-row.is-editing {
  box-shadow: inset 3px 0 0 var(--blue, #007AFF);
}
.court-row-main {
  min-width: 0;
}
.court-row-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.court-row-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.court-row-meta {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.court-row .court-connect-btn {
  width: auto;
  min-width: 11.5rem;
}
.court-row-more {
  position: relative;
}
.court-row-more > summary {
  list-style: none;
  cursor: pointer;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  user-select: none;
}
.court-row-more > summary::-webkit-details-marker { display: none; }
.court-row-more > summary:hover,
.court-row-more[open] > summary {
  background: var(--fill);
  color: var(--ink);
}
.court-row-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  min-width: 9.5rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: var(--material, #fff);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  display: grid;
}
.court-row-menu a,
.court-row-menu button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.court-row-menu a:hover,
.court-row-menu button:hover {
  background: var(--fill);
}
.court-row-menu form { margin: 0; }
.court-row-menu button { width: 100%; color: #c0392b; }
.court-add {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.35rem 0.15rem 0.15rem;
}
.court-add .field-inline {
  flex: 1;
  min-width: 0;
}
.court-edit-card {
  margin-bottom: 0.25rem;
  border-left: 3px solid var(--blue, #007AFF);
}
@media (max-width: 640px) {
  .court-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main more"
      "connect connect";
  }
  .court-row-main { grid-area: main; }
  .court-row-more { grid-area: more; justify-self: end; }
  .court-row .court-connect-btn {
    grid-area: connect;
    width: 100%;
  }
}
.court-qr--lg {
  width: 256px;
  height: 256px;
  padding: 12px;
  border-radius: 12px;
}
.court-qr--lg img {
  width: 232px !important;
  height: 232px !important;
}
.qr-connect-dialog {
  width: min(420px, calc(100vw - 24px));
}
.qr-connect-dialog.is-split {
  width: min(720px, calc(100vw - 24px));
}
.qr-connect-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}
.qr-connect-single {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}
.qr-connect-single[hidden],
.qr-connect-split[hidden] {
  display: none !important;
}
.qr-split-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--fill, rgba(120, 120, 128, 0.12));
  font-size: 0.9rem;
  font-weight: 650;
}
.qr-split-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.qr-split-toggle__ui {
  width: 2.4rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.28);
  position: relative;
  flex: none;
  transition: background 160ms ease;
}
.qr-split-toggle__ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease;
}
.qr-split-toggle input:checked + .qr-split-toggle__ui {
  background: var(--blue, #007AFF);
}
.qr-split-toggle input:checked + .qr-split-toggle__ui::after {
  transform: translateX(1.05rem);
}
.qr-split-toggle:focus-within {
  outline: 2px solid color-mix(in srgb, var(--blue, #007AFF) 45%, transparent);
  outline-offset: 2px;
}
.qr-zoom-body,
.qr-dual-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}
.qr-zoom-hint {
  margin: 0;
  font-size: 0.85rem;
}
.qr-zoom-link-wrap {
  margin: 0;
  max-width: 100%;
  word-break: break-all;
  font-size: 0.75rem;
}
.qr-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: min(100%, 22rem);
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: var(--fill, rgba(120, 120, 128, 0.12));
  text-align: left;
}
.qr-link-card__meta {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.qr-link-card__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.qr-link-card__path {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qr-link-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: none;
}
.qr-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}
@media (max-width: 560px) {
  .qr-dual-grid { grid-template-columns: 1fr; }
}
.qr-dual-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg, #f7f7f8) 70%, #fff);
}
.qr-dual-label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.qr-dual-open {
  font-size: 0.85rem;
  font-weight: 600;
}
.qr-dual-card .court-qr--lg {
  width: 220px;
  height: 220px;
  padding: 10px;
}
.qr-dual-card .court-qr--lg img {
  width: 200px !important;
  height: 200px !important;
}
.player-dialog {
  width: min(640px, calc(100vw - 24px));
  max-height: min(calc(100vh - 48px), calc(100dvh - 48px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--material);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28), 0 1px 0 rgba(255,255,255,0.55) inset;
  margin: auto;
  overflow: hidden;
}
.player-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: player-dialog-in 280ms var(--ease-spring);
}
.player-dialog::backdrop {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.player-dialog[open]::backdrop { animation: player-dialog-fade var(--duration-bump) ease; }
@keyframes player-dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes player-dialog-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .player-dialog[open],
  .player-dialog[open]::backdrop { animation: none; }
}

/* Header / body / footer: only the body scrolls, actions stay reachable. */
.player-dialog-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
}
.player-dialog-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 1.05rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.player-dialog-kicker {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.player-dialog-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.player-dialog-close {
  flex: none;
  width: 2rem;
  height: 2rem;
  margin: -0.15rem -0.25rem 0 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.player-dialog-close:hover {
  background: var(--primary-soft);
  color: var(--ink);
}
.player-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.15rem 1.25rem 1.35rem;
  /* Transparent so the dialog's material shows through; the head/foot hairlines
     already mark where the scroll region starts and ends. */
  background: transparent;
}
.player-dialog-foot {
  flex: none;
  margin: 0;
  padding: 0.9rem 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: transparent;
}

/* Form controls inside the dialog */
.player-dialog input[type="file"] {
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}
.player-dialog input[type="file"]::file-selector-button {
  margin-right: 0.7rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
}
.player-dialog input[type="file"]::file-selector-button:hover { background: var(--bg-deep); }

@media (max-width: 700px) {
  .player-form { grid-template-columns: 1fr; }
  .player-dialog {
    width: 100%;
    max-width: 100%;
    max-height: min(94vh, 94dvh);
    margin: auto auto 0;
    border-radius: 1.25rem 1.25rem 0 0;
    border-bottom: 0;
  }
  .player-dialog-head,
  .player-dialog-body,
  .player-dialog-foot { padding-left: 1rem; padding-right: 1rem; }
  .player-dialog-foot { padding-bottom: calc(0.9rem + env(safe-area-inset-bottom)); }
  .player-dialog-foot .btn { flex: 1 1 0; }
}

.muted { color: var(--muted); }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.tag.live { color: var(--live); }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}
.ta-card:has(> .table-scroll) {
  overflow: hidden;
}
.table-scroll > table.data {
  min-width: 36rem;
}
@media (max-width: 700px) {
  .table-scroll > table.data--matches {
    min-width: 28rem;
  }
  .table-scroll > table.data--courts {
    min-width: 32rem;
  }
}
table.data th,
table.data td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 0.5px solid var(--line);
}
table.data th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.data tr:hover td { background: var(--fill); }
table.data tr.is-editing { background: rgba(0, 122, 255, 0.08); }

/* —— OpenBracket bracket (Žreb) — light theme —— */
.mp-bracket-wrap {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: auto;
  padding: 1.15rem 1rem 1.5rem;
}
.mp-recent {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid var(--line);
}
.mp-recent-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.mp-recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.mp-recent-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 0.75rem;
  background: #f9fafb;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease;
}
.mp-recent-item:hover { border-color: #d1d5db; }
.mp-recent-winner {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.mp-recent-vs {
  font-size: 0.75rem;
  color: var(--muted);
}
.mp-recent-score {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.mp-recent-round {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-top: 4px;
}
.mp-bracket {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: min-content;
  min-height: 420px;
}
.mp-bracket-round {
  display: flex;
  flex-direction: column;
  min-width: 230px;
  padding: 0 18px;
  position: relative;
}
.mp-bracket-round + .mp-bracket-round {
  border-left: 1px solid var(--line);
}
.mp-bracket-round-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-left: 2px;
}
.mp-bracket-slots {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 14px;
}
.mp-bracket-slot {
  position: relative;
  display: flex;
  align-items: center;
  scroll-margin-top: 90px;
}
.mp-bracket-slot--flash .mp-card {
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
}
.mp-bracket-round:not(:last-child) .mp-bracket-slot::after {
  content: '';
  position: absolute;
  right: -18px;
  top: 50%;
  width: 18px;
  height: 1px;
  background: #d1d5db;
}
.mp-card {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 10px 12px 8px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mp-card:hover { border-color: #d1d5db; }
.mp-card--live {
  border-color: #111;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.08);
}
.mp-card--done {
  border-color: #e5e7eb;
  background: #fafafa;
}
.mp-card--partial { border-color: #dbeafe; }
.mp-card--wait { opacity: 0.92; }
.mp-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 1.35em;
}
.mp-card-row + .mp-card-row { margin-top: 4px; }
.mp-card-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-card-row.is-winner .mp-card-name { color: #000; font-weight: 600; }
.mp-card--done .mp-card-row:not(.is-winner) .mp-card-name {
  color: #9ca3af;
}
.mp-card-scores {
  display: flex;
  gap: 6px;
  flex: none;
}
.mp-card-score {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  flex: none;
  min-width: 0.9em;
  text-align: right;
}
.mp-card-row.is-winner .mp-card-score { color: #000; }
.mp-card-foot {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #f3f4f6;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
}
.mp-card-foot--live { color: var(--live); }
.mp-card-foot--wait { color: var(--clay); }
.mp-card-wrap {
  position: relative;
  width: 100%;
}
.mp-card-edit {
  appearance: none;
  cursor: pointer;
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mp-card-edit:hover {
  color: #fff;
  background: #000;
  border-color: #000;
}
.mp-edit-dialog {
  width: min(520px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}
.mp-edit-dialog::backdrop { background: rgba(17, 24, 39, 0.4); }
.mp-edit-form { padding: 1.15rem 1.25rem 1.25rem; }
.mp-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.mp-edit-kicker {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.mp-edit-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.mp-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mp-edit-grid .field { margin: 0; }
.mp-edit-grid .field select,
.mp-edit-grid .field input {
  width: 100%;
  margin-top: 4px;
}
.mp-edit-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--ink);
}
.mp-edit-foot {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 560px) {
  .mp-edit-grid { grid-template-columns: 1fr; }
}

.scoreboard { width: 100%; }
.scoreboard .names { font-weight: 600; }
.scoreboard .pts {
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}
.serve { color: var(--clay); margin-right: 6px; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  display: inline-block;
  animation: pulse 1.4s linear infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes mp-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .idea-live-dot {
    animation: none;
  }
  .idea-ov-serve::after,
  .idea-board-serve::after,
  .idea-point-serve::after,
  .idea-board-row,
  .idea-point {
    transition: none;
  }
  .idea-point-pts.is-bump {
    animation: none;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .idea-tablet-top,
  .idea-stream-bar {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* —— Tablet PIN unlock —— */
.idea-tablet-unlock-page {
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(23, 96, 59, .18), transparent 55%),
    #f4f2ed;
}
.idea-unlock {
  width: min(380px, 100%);
  text-align: center;
}
.idea-unlock-kicker {
  margin: 0 0 8px;
  font: 600 12px/1 'Barlow Condensed', sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6b6f68;
}
.idea-unlock-title {
  margin: 0;
  font: 700 clamp(2rem, 6vw, 2.6rem)/1 'Barlow Condensed', sans-serif;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #191c18;
}
.idea-unlock-sub {
  margin: 6px 0 28px;
  font: 500 15px/1.3 'Barlow', sans-serif;
  color: #6b6f68;
}
.idea-unlock-err { margin: 0 0 12px; }
.idea-unlock-form {
  display: grid;
  gap: 14px;
  text-align: left;
}
.idea-unlock-form .field input {
  font-size: 1.4rem;
  letter-spacing: .35em;
  text-align: center;
  font-weight: 600;
}
.idea-unlock-form .idea-btn { width: 100%; justify-content: center; }
.idea-unlock-hint {
  margin: 22px 0 0;
  font: 400 13px/1.4 'Barlow', sans-serif;
  color: #8a8e86;
}

/* —— Idea: Tablica ob igrišču —— */
.idea-tablet-page {
  margin: 0;
  min-height: 100vh;
  background: #0a0c0a;
  color: #f1f4ec;
  font-family: 'Barlow', var(--font);
  padding: 18px 16px 40px;
}
.idea-tablet-page--fill {
  padding: 0;
  background: #f4f2ed;
  color: #191c18;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
}
html:has(.idea-tablet-page--fill) {
  height: 100%;
}
html:has(.idea-tablet-page--fill) body {
  height: 100%;
  margin: 0;
}
.idea-screen-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px;
  max-width: 1200px; margin: 0 auto 14px; padding: 0 4px;
}
.idea-screen-kicker {
  font: 600 11px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .16em; text-transform: uppercase; color: rgba(241,244,236,.35);
}
.idea-screen-title {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 16px;
  letter-spacing: .04em; text-transform: uppercase; color: #d7ff3e;
}
.idea-screen-note {
  font: 400 12px/1.3 'Barlow', sans-serif; color: rgba(241,244,236,.42);
}

.idea-tablet {
  position: relative;
  width: 1200px; max-width: 100%;
  margin: 0 auto;
  background: #f4f2ed;
  border: 10px solid #c6c2b9;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 54px rgba(0,0,0,.4);
  color: #191c18;
  min-height: min(820px, calc(100vh - 80px));
}
.idea-tablet-page--fill .idea-tablet {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  min-height: 100%;
  height: 100%;
  margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.idea-tablet-page--fill .idea-tablet-grid {
  flex: 1;
  min-height: 0;
}
.idea-tablet-page--fill .idea-cam-stage {
  flex: 1;
  aspect-ratio: auto;
  min-height: 220px;
}
.idea-tablet-top {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(226, 222, 214, 0.85);
  flex: none;
  z-index: 2;
}
.idea-tablet-brand {
  display: flex; align-items: baseline; gap: 10px;
  min-width: 0;
}
.idea-tablet-court {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 19px;
  letter-spacing: .02em; text-transform: uppercase;
  line-height: 1;
}
.idea-tablet-mode {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: #191c18;
  color: #f4f7f2;
  font: 700 10px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  align-self: center;
}
.idea-tablet-round {
  font: 500 13px/1.2 'Barlow', sans-serif; color: #6b6f68;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idea-tablet-sync {
  display: flex; align-items: center; gap: 7px; margin-left: auto;
  font: 500 13px/1 'Barlow', sans-serif; color: #6b6f68;
}
.idea-sync-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #17603b;
  box-shadow: 0 0 0 3px color-mix(in srgb, #17603b 16%, transparent);
}
.idea-tablet-clock {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 16px;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  color: #191c18;
}

.idea-tablet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  min-height: 740px;
}
.idea-tablet-page--mode-video .idea-score-col,
.idea-tablet-page--mode-score .idea-cam-col {
  display: none !important;
}
.idea-tablet-page--mode-video .idea-tablet-grid,
.idea-tablet-page--mode-score .idea-tablet-grid {
  grid-template-columns: 1fr;
}
.idea-tablet-page--mode-score .idea-tablet-grid {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.idea-tablet-page--fill.idea-tablet-page--mode-score .idea-score-col {
  padding: 14px 16px 16px;
}
@media (max-width: 980px) {
  .idea-tablet-grid { grid-template-columns: 1fr; }
  .idea-tablet { border-width: 6px; border-radius: 14px; }
  .idea-tablet-page--fill .idea-tablet { border: 0; border-radius: 0; }
  .idea-tablet-page--fill .idea-tablet-grid {
    grid-template-rows: minmax(280px, 45vh) minmax(0, 1fr);
    overflow: auto;
  }
  .idea-tablet-page--fill.idea-tablet-page--mode-video .idea-tablet-grid,
  .idea-tablet-page--fill.idea-tablet-page--mode-score .idea-tablet-grid {
    grid-template-rows: minmax(0, 1fr);
  }
}

.idea-cam-col {
  min-width: 0; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0;
}
.idea-tablet-page--fill .idea-cam-col {
  flex: 1;
  min-height: 0;
}
.idea-cam-stage {
  position: relative; aspect-ratio: 16/9;
  border-radius: 10px; overflow: hidden;
  background: #e3e0d8; border: 1px solid #dad6cd;
}
.idea-cam-stage iframe,
.idea-cam-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0; display: block;
  background: #111; object-fit: cover;
}
.idea-cam-idle {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  z-index: 1;
  background: #e3e0d8;
  pointer-events: none;
}
.idea-cam-idle[hidden] { display: none !important; }
.idea-cam-stage.is-live .idea-cam-idle { display: none !important; }
.idea-cam-idle-kicker {
  font: 600 11px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .18em; text-transform: uppercase; color: #9a9c94;
}
.idea-cam-idle-sub { font: 500 14px/1.3 'Barlow', sans-serif; color: #6b6f68; }
.idea-cam-idle-sub b { color: #c63a2e; font-weight: 700; }
.idea-cam-err {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4;
  padding: 10px 12px; border-radius: 6px;
  background: rgba(198, 58, 46, .92); color: #fff;
  font: 500 13px/1.35 'Barlow', sans-serif;
}

.idea-live-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 3px; background: #c63a2e; color: #fff;
  font: 700 11px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .16em; text-transform: uppercase;
}
.idea-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #fff;
  animation: pulse 1.4s linear infinite;
}
.idea-viewers {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  padding: 5px 10px; border-radius: 3px; background: rgba(25,28,24,.6); color: #fff;
  font: 600 11px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .1em; text-transform: uppercase;
}
.idea-watch-link {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4;
  display: block; text-align: center; text-decoration: none;
  padding: 10px 12px; border-radius: 6px;
  background: rgba(215,255,62,.92); color: #191c18;
  font: 700 12px/1.2 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .08em; text-transform: uppercase;
}
.idea-watch-link[hidden] { display: none !important; }

.idea-ov { position: absolute; z-index: 3; pointer-events: none; }
.idea-ov--lower {
  left: 14px; bottom: 14px;
  border-radius: 3px; overflow: hidden;
  background: #16382f;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.idea-ov-inner { display: flex; flex-direction: column; }
.idea-ov--corner {
  right: 14px; bottom: 14px; left: auto;
  border-radius: 3px; overflow: hidden;
  background: #16382f;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.idea-ov-row {
  display: flex; align-items: stretch;
  height: 26px; color: #f4f7f2;
}
.idea-ov-serve {
  display: flex; align-items: center; justify-content: center;
  width: 1.4em; flex: none; padding-left: 8px;
  color: transparent; line-height: 1;
}
.idea-ov-serve::after {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #d7ff3e;
  box-shadow: 0 0 0 2px color-mix(in srgb, #d7ff3e 18%, transparent);
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 320ms cubic-bezier(0.23, 1, 0.32, 1), transform 320ms cubic-bezier(0.23, 1, 0.32, 1);
}
.idea-ov-row.is-serving .idea-ov-serve::after {
  opacity: 1;
  transform: scale(1);
}
.idea-ov-name {
  display: flex; align-items: center;
  width: 118px; padding: 0 8px 0 4px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 15px; letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idea-ov--corner .idea-ov-name { width: 64px; font-size: 14px; }
.idea-ov .idea-set {
  display: flex; align-items: center; justify-content: center;
  width: 22px; flex: none;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 15px;
  color: #6a8a7a; font-variant-numeric: tabular-nums;
}
.idea-ov .idea-set.is-won { color: #f4f7f2; }
.idea-ov .idea-set[hidden] { display: none !important; }
.idea-ov--corner .idea-set { display: none !important; }
.idea-ov-games {
  display: flex; align-items: center; justify-content: center;
  width: 28px; flex: none;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 15px;
  background: #6d9a7c; color: #f4f7f2; font-variant-numeric: tabular-nums;
}
.idea-ov-pts {
  display: flex; align-items: center; justify-content: center;
  min-width: 38px; flex: none; padding: 0 6px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 15px;
  background: #fff; color: #142820; font-variant-numeric: tabular-nums;
}
.idea-ov-pts[hidden] { display: none !important; }
.idea-ov-row.is-winner .idea-ov-name { color: #fff; }
.idea-ov-row.is-loser .idea-ov-name { color: #6a8a7a; }
.idea-ov-row.is-loser .idea-ov-games { color: rgba(244, 247, 242, .7); }
.idea-ov-winner {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: min(78%, 320px);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 22px 18px; border-radius: 3px;
  background: #16382f; color: #f4f7f2;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
  text-align: center;
  pointer-events: none;
}
.idea-ov-winner[hidden] { display: none !important; }
.idea-ov-winner-trophy {
  width: 2.4rem; height: 2.4rem; color: #d7ff3e;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
.idea-ov-winner-kicker {
  font: 700 11px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .16em; text-transform: uppercase; color: #d7ff3e;
}
.idea-ov-winner strong {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 24px; letter-spacing: .03em; text-transform: uppercase;
  color: #fff; line-height: 1.05;
}
.idea-ov-winner-sets {
  margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 3.5rem; padding: 3px 10px;
  font: 700 16px/1 'Barlow Condensed', sans-serif;
  background: #6d9a7c; color: #f4f7f2;
  font-variant-numeric: tabular-nums;
}
.idea-ov-next {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  max-width: min(46%, 220px);
  display: flex; flex-direction: column; gap: 2px;
  padding: 7px 10px 8px; border-radius: 3px;
  background: #16382f; color: #f4f7f2;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.idea-ov-next[hidden] { display: none !important; }
.idea-ov-next-kicker {
  font: 700 9px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .14em; text-transform: uppercase; color: #d7ff3e;
}
.idea-ov-next strong {
  font: 700 12px/1.25 'Barlow Condensed', sans-serif;
  letter-spacing: .03em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.idea-stream-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(226, 222, 214, 0.9);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  flex: none;
}
.idea-stream-meta {
  flex: 1; min-width: 0;
  font: 500 12px/1.2 'Barlow', sans-serif; color: #8a8e86;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idea-stream-actions {
  display: flex; align-items: center; gap: 6px; flex: none;
}
.idea-stream-panel {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; background: #fff;
  border: 1px solid #e2ded6; border-radius: 10px;
}
.idea-stream-panel[hidden],
.idea-detail-row[hidden],
.idea-stats[hidden],
.idea-ov[hidden],
.idea-live-badge[hidden],
.idea-viewers[hidden] { display: none !important; }
.idea-stream-head { display: flex; flex-direction: column; gap: 2px; }
.idea-stream-head > span:last-child { font: 500 14px/1.3 'Barlow', sans-serif; }
.idea-label {
  font: 600 11px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .16em; text-transform: uppercase; color: #9a9c94;
}
.idea-stream-form .field { color: #6b6f68; }
.idea-stream-form input, .idea-stream-form select {
  background: #faf9f5; border-color: #ddd9d1; color: #191c18;
}

.idea-chip, .idea-btn {
  appearance: none; cursor: pointer;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid #ddd9d1; background: #fff; color: #6b6f68;
  font: 600 11px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .08em; text-transform: uppercase;
  min-height: 40px;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease,
              transform 100ms ease-out;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.idea-stream-actions .idea-chip { padding: 8px 10px; min-height: 36px; }
.idea-chip:hover, .idea-btn:hover { border-color: #17603b; color: #17603b; }
.idea-chip:active, .idea-btn:active { transform: scale(0.97); }
.idea-chip.is-on { background: #17603b; border-color: #17603b; color: #fff; }
.idea-chip--live {
  border: none; background: #c63a2e; color: #fff;
  letter-spacing: .08em; font-weight: 700; min-width: 5.5rem;
}
.idea-chip--live:hover { background: #a83228; color: #fff; border: none; }
.idea-chip--live.is-on-air { background: #191c18; }
.idea-chip--live.is-on-air:hover { background: #2a2e28; }
.idea-btn--danger { border: none; background: #c63a2e; color: #fff; font-weight: 700; }

.idea-score-col {
  padding: 14px 16px 16px 0;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0;
}
@media (max-width: 980px) {
  .idea-score-col { padding: 0 14px 14px; }
}
.idea-board {
  background: #fff; border: 1px solid #e2ded6; border-radius: 14px; overflow: hidden;
  flex: none;
  box-shadow: 0 1px 0 rgba(25, 28, 24, .03);
}
.idea-board-row {
  display: flex; align-items: center; gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid #efede7;
  transition: background-color 220ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
.idea-board-row.is-serving {
  background: color-mix(in srgb, #d7ff3e 8%, #fff);
}
.idea-board-serve {
  width: 1.25rem; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.idea-board-serve::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #b6d92a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #d7ff3e 35%, transparent);
  opacity: 0;
  transform: scale(0.55);
  transition:
    opacity 320ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    transform 320ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
.idea-board-row.is-serving .idea-board-serve::after {
  opacity: 1;
  transform: scale(1);
}
.idea-board-name {
  flex: 1; min-width: 0;
  font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 600;
  font-size: 18px; letter-spacing: -0.01em; color: #191c18;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idea-board .idea-set {
  width: 26px; text-align: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 18px; color: #9a9c94;
  font-variant-numeric: tabular-nums;
}
.idea-board .idea-set.is-won { color: #17603b; }
.idea-board-games {
  width: 34px; text-align: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.idea-board-pts {
  width: 44px; text-align: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 22px; color: #17603b;
  font-variant-numeric: tabular-nums;
}
.idea-board-foot {
  display: flex; align-items: center; padding: 8px 16px; background: #faf9f5;
  font: 500 12px/1 'Barlow', sans-serif; color: #6b6f68;
}
.idea-board-foot span:last-child { margin-left: auto; color: #9a9c94; }
.idea-board-row.is-winner .idea-board-name { color: #17603b; }
.idea-board-row.is-loser { opacity: .55; }
.idea-match-end {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; border-radius: 12px;
  background: #191c18; color: #f1f4ec;
}
.idea-match-end[hidden] { display: none !important; }
.idea-match-end-kicker {
  margin: 0;
  font: 600 11px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .18em; text-transform: uppercase; color: #d7ff3e;
}
.idea-match-end-winner {
  margin: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 28px; letter-spacing: .02em;
  text-transform: uppercase;
}
.idea-match-end-score {
  margin: 0 0 4px;
  font: 600 18px/1.2 'Barlow Condensed', sans-serif;
  color: rgba(241,244,236,.72);
}
.idea-match-end-box {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; border-radius: 8px;
  background: rgba(255,255,255,.06);
}
.idea-match-end-box .idea-label { color: rgba(241,244,236,.45); }
.idea-match-end-box strong {
  font: 600 16px/1.3 'Barlow', sans-serif;
}
.idea-match-end-box .muted { color: rgba(241,244,236,.4); font-size: 13px; }
.idea-match-end .idea-btn { width: 100%; justify-content: center; }
.idea-match-end .idea-chip {
  width: 100%; justify-content: center;
  background: transparent; border-color: rgba(241,244,236,.2); color: rgba(241,244,236,.7);
}

.idea-score-controls {
  display: flex; flex-direction: column; gap: 10px;
  flex: 1; min-height: 0;
}
.idea-score-hint {
  margin: 0;
  font: 600 11px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .14em; text-transform: uppercase; color: #9a9c94;
}

.idea-undo {
  appearance: none; cursor: pointer;
  flex: 1.2; min-height: 48px;
  padding: 12px 14px; border-radius: 10px; border: 1px solid #d4cfc5;
  background: #fff; color: #5a5e58;
  font: 700 12px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .1em; text-transform: uppercase;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease,
              transform 100ms ease-out;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.idea-undo:hover { background: #efede7; border-color: #a9a49a; color: #191c18; }
.idea-undo:active { transform: scale(0.97); }

.idea-point {
  appearance: none; cursor: pointer; text-align: left; width: 100%;
  border: 1.5px solid #d4cfc5; background: #fff; border-radius: 16px;
  padding: 18px 18px 18px 14px; min-height: 92px;
  display: flex; align-items: center; gap: 12px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 1px 2px rgba(25, 28, 24, .04);
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 180ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    transform 100ms ease-out;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.idea-point:hover { border-color: #17603b; background: #f4f8f5; }
.idea-point:active {
  transform: scale(0.97);
  border-color: #17603b;
  background: #e8f3ec;
}
.idea-point.is-serving {
  border-color: color-mix(in srgb, #17603b 45%, #d4cfc5);
  background:
    linear-gradient(90deg, color-mix(in srgb, #d7ff3e 18%, transparent), transparent 42%),
    #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 0 0 1px color-mix(in srgb, #d7ff3e 28%, transparent);
}
.idea-point-serve {
  flex: none;
  width: 1.5rem; height: 1.5rem;
  display: grid; place-items: center;
}
.idea-point-serve::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #b6d92a;
  box-shadow: 0 0 0 4px color-mix(in srgb, #d7ff3e 32%, transparent);
  opacity: 0;
  transform: scale(0.55);
  transition:
    opacity 320ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    transform 320ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}
.idea-point.is-serving .idea-point-serve::after {
  opacity: 1;
  transform: scale(1);
}
.idea-point-side {
  flex: none;
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
  color: #17603b;
  background: color-mix(in srgb, #d7ff3e 55%, #fff);
  border: 1px solid color-mix(in srgb, #b6d92a 50%, transparent);
}
.idea-point-side[hidden] { display: none !important; }
.idea-point-side.is-ad {
  color: #fff;
  background: #17603b;
  border-color: #17603b;
}
.idea-board-side {
  flex: none;
  min-width: 1.6rem;
  margin-right: 2px;
  padding: 0.12rem 0.35rem;
  border-radius: 5px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-align: center;
  color: #17603b;
  background: color-mix(in srgb, #d7ff3e 55%, #fff);
}
.idea-board-side.is-ad {
  color: #fff;
  background: #17603b;
}
.idea-point-name {
  flex: 1; min-width: 0;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem); letter-spacing: .01em;
  line-height: 1.05;
  text-transform: uppercase; color: #191c18;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idea-point-pts {
  flex: none;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.1rem); line-height: 1; color: #17603b;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  min-width: 2.4ch; text-align: right;
}
.idea-point-pts.is-bump {
  animation: mp-bump var(--duration-bump) var(--ease-in-out);
}

.idea-detail-row { display: flex; gap: 6px; flex-wrap: wrap; }
.idea-detail-row button {
  appearance: none; cursor: pointer; padding: 10px 12px; border-radius: 8px;
  border: 1px solid #ddd9d1; background: #fff; color: #6b6f68;
  font: 600 12px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .1em; text-transform: uppercase;
  min-height: 40px;
}
.idea-detail-row button:hover { border-color: #17603b; color: #17603b; }

.idea-stats {
  background: transparent;
  border: 0;
  padding: 0;
  display: block;
}
.idea-stats-panel {
  background: #fff;
  border: 1px solid #e2ded6;
  border-radius: 10px;
  padding: 12px 14px;
}
.idea-stats-title {
  margin: 0 0 8px;
  font: 600 12px/1 'Barlow Semi Condensed', sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #9a9c94;
}
.idea-stats-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 14px;
  font: 400 14px/1.3 'Barlow', sans-serif;
  color: #4a4e48;
}
.idea-stats-head {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: #9a9c94;
  text-align: right;
}
.idea-stats-grid span:nth-child(3n+2),
.idea-stats-grid span:nth-child(3n+3) {
  text-align: right;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #191c18;
}

.idea-score-foot {
  display: flex; gap: 8px; margin-top: auto;
  align-items: stretch;
  flex-wrap: wrap;
}
.idea-score-foot .idea-chip,
.idea-score-foot .idea-undo {
  flex: 1 1 calc(33% - 8px);
  min-width: 5.5rem;
  min-height: 48px;
  padding: 12px 10px;
  letter-spacing: .1em;
}

/* print bracket / order of play */
.print-page { background: #f2f2f7; min-height: 100vh; color: #1c1c1e; }
.print-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; background: #fff; border-bottom: 1px solid rgba(60,60,67,.12);
  position: sticky; top: 0; z-index: 2;
}
.print-sheet { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.print-title { margin: 0 0 .25rem; font-size: 1.75rem; }
.print-sub { margin: 0 0 1.5rem; color: #8e8e93; }
.print-section { margin-bottom: 2rem; }
.print-section h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.print-bracket { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.print-round { flex: 1 1 180px; min-width: 160px; }
.print-round h3 { margin: 0 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: #8e8e93; }
.print-match {
  background: #fff; border: 1px solid rgba(60,60,67,.12); border-radius: 8px;
  padding: .55rem .7rem; margin-bottom: .45rem;
}
.print-side { font-weight: 600; font-size: .95rem; }
.print-side.is-win { color: #1f8a4c; }
.print-sets { margin-top: .25rem; font-size: .8rem; color: #8e8e93; }
.print-table { width: 100%; border-collapse: collapse; background: #fff; }
.print-table th, .print-table td {
  border: 1px solid rgba(60,60,67,.12); padding: .45rem .55rem; text-align: left; font-size: .9rem;
}
.print-table th { background: #fafafa; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #8e8e93; }
@media print {
  .no-print { display: none !important; }
  .print-page { background: #fff; }
  .print-sheet { max-width: none; padding: 0; }
  .print-break { break-before: page; }
  .print-match, .print-table { break-inside: avoid; }
}

/* legacy helpers still used elsewhere */
.tablet-page { max-width: 1100px; margin: 0 auto; padding: 20px; background: var(--bg); }
.tablet-shell {
  background: #f4f2ed; border: 10px solid #c6c2b9; border-radius: 24px;
  overflow: hidden; box-shadow: var(--shadow); color: #191c18;
}
.point-btn {
  flex: 1; min-height: 120px; border: 0; border-radius: 16px;
  background: var(--ink); color: #fff; cursor: pointer;
  font-family: var(--display); font-size: 2rem; font-weight: 700;
}
.point-btn:nth-child(2) { background: var(--clay); }

/* TV — see assets/tv.css */

/* Phone live */
.phone-frame {
  max-width: 420px; margin: 20px auto; background: #111; border-radius: 28px;
  padding: 12px; box-shadow: var(--shadow);
}
.phone-inner {
  background: #fff; border-radius: 22px; min-height: 720px; padding: 16px; color: var(--ink);
}

code.linkish { background: var(--shell); padding: 4px 8px; border-radius: 8px; font-size: 0.85rem; }

/* Legacy card helpers still used outside admin */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  border: 1px solid var(--line);
}
.card h2 { margin: 0; font-size: 1rem; }
.card .sub { margin: 4px 0 14px; color: var(--muted); font-size: 0.82rem; }
.list-quiet { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list-quiet li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: var(--shell);
  font-size: 0.9rem;
}
