/* LETSCUBE Vision Control theme: chamfered panels, blue→magenta edges, dark and light modes.
   Loaded last; owns colours and the application shell layout. */
/* Brand fonts (brand book, p. 9): Radiotechnika Regular for headings, Pragmatica Light for text. */
@font-face {
  font-family: "Radiotechnika";
  src: url("/assets/Radiotechnika.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Pragmatica";
  src: url("/assets/Pragmatica-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

/* ---------- Tokens ---------- */
html[data-theme="dark"] body,
html:not([data-theme]) body {
  color-scheme: dark;
  --bg: #080b12;
  --grid-line: rgba(118, 142, 196, .055);
  --sidebar: #0c0f17;
  --rail: #0a0d14;
  --surface: #111622;
  --surface-2: #161c2a;
  --surface-3: #111622;
  --surface-hover: #1a2133;
  --surface-sunken: #0b0f17;
  --field: #0c111b;
  --line: #20283a;
  --line-strong: #323e58;
  --text: #f1f4fa;
  --muted: #949eb3;
  --label: #c0c8d8;
  --blue: #5191f2;
  --cyan: #6fa8f5;
  --pink: #ea3482;
  --green: #5fd3a0;
  --amber: #e9b75e;
  --danger: #ff8a8a;
  --accent: #5191f2;
  --accent-soft: rgba(81, 145, 242, .14);
  --danger-soft: rgba(255, 120, 120, .14);
  --ok-bg: rgba(64, 190, 140, .08);
  --ok-border: #24543f;
  --warn-bg: rgba(233, 183, 94, .09);
  --warn-border: #614f2c;
  --bad-bg: rgba(255, 110, 110, .09);
  --bad-border: #643439;
  --canvas: #06080d;
  --ink: var(--bg);
  --card-fill: linear-gradient(120deg, #18264a 0%, #121a2c 48%, #2b1532 100%);
  --card-fill-quiet: linear-gradient(135deg, #131a2b 0%, #0f1420 62%, #1a1424 100%);
  --tile-fill: linear-gradient(135deg, #142038 0%, #101624 60%, #21152b 100%);
  --edge: linear-gradient(120deg, #4479de 0%, #2a3655 46%, #d02a74 100%);
  --edge-quiet: linear-gradient(135deg, #2b3a5c 0%, #1f2638 50%, #3b2342 100%);
  --edge-active: linear-gradient(90deg, #5594ff 0%, #8a59c9 50%, #f0388a 100%);
  --fill-active: linear-gradient(90deg, #22427c 0%, #1b2849 50%, #4c1c47 100%);
  --accent-strong: linear-gradient(90deg, #2f5fc4 0%, #6a3a9e 55%, #c42a72 100%);
  --accent-strong-hover: linear-gradient(90deg, #3a6dd6 0%, #7744ad 55%, #d43480 100%);
  --mark-fill: linear-gradient(135deg, #1b2c55, #3a1840);
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --logo-dark-display: block;
  --logo-light-display: none;
}

html[data-theme="light"] body {
  color-scheme: light;
  --bg: #edf0f6;
  --grid-line: rgba(40, 64, 120, .055);
  --sidebar: #ffffff;
  --rail: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --surface-3: #ffffff;
  --surface-hover: #edf1f8;
  --surface-sunken: #f3f5fa;
  --field: #ffffff;
  --line: #dde3ed;
  --line-strong: #c3ccdc;
  --text: #121726;
  --muted: #5b6579;
  --label: #353e52;
  --blue: #2563d4;
  --cyan: #2563d4;
  --pink: #d01f6c;
  --green: #12885a;
  --amber: #9a6407;
  --danger: #c4303b;
  --accent: #2563d4;
  --accent-soft: rgba(37, 99, 212, .1);
  --danger-soft: rgba(196, 48, 59, .1);
  --ok-bg: rgba(18, 136, 90, .07);
  --ok-border: #a7d8c2;
  --warn-bg: rgba(200, 140, 20, .08);
  --warn-border: #e2c88f;
  --bad-bg: rgba(196, 48, 59, .07);
  --bad-border: #eab3b8;
  --canvas: #e4e8f0;
  --ink: var(--bg);
  --card-fill: linear-gradient(120deg, #eef3ff 0%, #ffffff 50%, #fdeef5 100%);
  --card-fill-quiet: linear-gradient(135deg, #ffffff 0%, #fafbfe 60%, #fdf7fa 100%);
  --tile-fill: linear-gradient(135deg, #f3f7ff 0%, #ffffff 60%, #fdf3f8 100%);
  --edge: linear-gradient(120deg, #6d9bf2 0%, #d3dbea 46%, #e9659f 100%);
  --edge-quiet: linear-gradient(135deg, #cbd5e7 0%, #dfe4ee 50%, #ead2df 100%);
  --edge-active: linear-gradient(90deg, #2f6fe0 0%, #8a4fc7 50%, #e0307f 100%);
  --fill-active: linear-gradient(90deg, #e3ecff 0%, #f2f0fb 50%, #fde5f0 100%);
  --accent-strong: linear-gradient(90deg, #2a62d6 0%, #6a3bb0 55%, #d0236f 100%);
  --accent-strong-hover: linear-gradient(90deg, #346ee6 0%, #7746be 55%, #dd2f7c 100%);
  --mark-fill: linear-gradient(135deg, #e5edff, #fbe5ef);
  --shadow: 0 20px 50px rgba(30, 45, 80, .16);
  --logo-dark-display: none;
  --logo-light-display: block;
}

html body :is(strong, b) { font-weight: 700; }
html body {
  font-weight: 300;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
  color: var(--text);
}

/* ---------- Chamfered surfaces ----------
   The element is clipped; ::before paints the gradient edge and ::after the fill 1px inside. */
html body :is(.club-hero, .connection-status > span, .club-card, .club-tabs button[data-club-tab], .subnav-item,
  .app button.secondary, .calls-summary > div, .training-zone-form, .camera-card, .history-card, .calls-card,
  .theme-toggle, .club-switch, .sidebar-product, .help-button) {
  --chamfer: polygon(0 0, calc(100% - var(--cut, 10px)) 0, 100% var(--cut, 10px), 100% 100%, var(--cut, 10px) 100%, 0 calc(100% - var(--cut, 10px)));
  position: relative;
  isolation: isolate;
  clip-path: var(--chamfer);
  border-color: transparent;
  border-radius: 0;
  background: transparent;
}
html body :is(.club-hero, .connection-status > span, .club-card, .club-tabs button[data-club-tab], .subnav-item,
  .app button.secondary, .calls-summary > div, .training-zone-form, .camera-card, .history-card, .calls-card,
  .theme-toggle, .club-switch, .sidebar-product, .help-button)::before,
html body :is(.club-hero, .connection-status > span, .club-card, .club-tabs button[data-club-tab], .subnav-item,
  .app button.secondary, .calls-summary > div, .training-zone-form, .camera-card, .history-card, .calls-card,
  .theme-toggle, .club-switch, .sidebar-product, .help-button)::after {
  content: "";
  position: absolute;
  z-index: -1;
  display: block;
  margin: 0;
  pointer-events: none;
  clip-path: var(--chamfer);
  transition: opacity 160ms ease;
}
html body :is(.club-hero, .connection-status > span, .club-card, .club-tabs button[data-club-tab], .subnav-item,
  .app button.secondary, .calls-summary > div, .training-zone-form, .camera-card, .history-card, .calls-card,
  .theme-toggle, .club-switch, .sidebar-product, .help-button)::before {
  inset: 0;
  width: auto;
  height: auto;
  background: var(--cut-edge, var(--edge-quiet));
}
html body :is(.club-hero, .connection-status > span, .club-card, .club-tabs button[data-club-tab], .subnav-item,
  .app button.secondary, .calls-summary > div, .training-zone-form, .camera-card, .history-card, .calls-card,
  .theme-toggle, .club-switch, .sidebar-product, .help-button)::after {
  inset: 1px;
  background: var(--cut-fill, var(--card-fill-quiet));
}

/* Defaults with zero specificity: chamfer variables must not inherit from a chamfered parent. */
html :where(.club-hero, .connection-status > span, .club-card, .club-tabs button[data-club-tab], .subnav-item,
  .app button.secondary, .calls-summary > div, .training-zone-form, .camera-card, .history-card, .calls-card,
  .theme-toggle, .club-switch, .sidebar-product, .help-button) {
  --cut: 10px;
  --cut-edge: var(--edge-quiet);
  --cut-fill: var(--card-fill-quiet);
}

/* ---------- Typography ---------- */
.display,
html body #pageTitle,
html body .subnav-head h2,
html body #configurationTitle,
html body .auth-title,
html body .auth-panel h2 {
  font-family: "Radiotechnika", "Pragmatica", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: .01em;
  text-transform: uppercase;
}

/* ---------- Controls ---------- */
html body .app button,
html body dialog button {
  border-radius: 0;
  --chamfer: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  clip-path: var(--chamfer);
}
html body .app button:focus-visible,
html body dialog button:focus-visible { outline-offset: -3px; outline-color: #fff; }
html[data-theme="light"] body .app button:focus-visible { outline-color: var(--blue); }
html body .app button.secondary { --cut: 9px; color: var(--text); }
html body .app button.secondary:hover { --cut-edge: var(--edge); background: transparent; }
html body .app button.secondary:hover::after { background: var(--surface-hover); }
html body .app button.link { clip-path: none; color: var(--blue); }
html body .app button.link::before,
html body .app button.link::after { content: none; }

html body .app :is(input, select, textarea),
html body dialog :is(input, select, textarea) {
  background-color: var(--field);
  border-color: var(--line-strong);
  border-radius: 4px;
  color: var(--text);
}
html body .app :is(input, select, textarea):hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line-strong)); }
html body .app :is(input, select, textarea):focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }
html body .app input::placeholder,
html body .app textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
html body .app label { color: var(--label); }

/* ---------- Shell layout ---------- */
html body .app {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
}
html body .app aside.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  overflow: hidden;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 18px;
}
html body .app .sidebar-top .compact { padding: 0; }
html body .app .sidebar-top .compact img { width: 172px; }
.logo-on-dark { display: var(--logo-dark-display) !important; }
.logo-on-light { display: var(--logo-light-display) !important; }
html body .app .theme-toggle {
  --cut: 8px;
  --cut-fill: var(--surface-2);
  width: 42px;
  min-height: 42px;
  height: 42px;
  padding: 0;
  color: var(--blue);
  background: transparent;
}
html body .app .theme-toggle:hover { --cut-edge: var(--edge); background: transparent; color: var(--text); }
.sidebar-product {
  --cut: 10px;
  --cut-fill: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 22px 18px;
  padding: 11px 14px;
}
.sidebar-product-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--muted); }
.sidebar-product small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.sidebar-product strong { display: block; font-size: 15px; line-height: 1.35; }

.sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
html body .app nav.rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 16px 8px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.rail-spacer { flex: 1 1 auto; min-height: 12px; }
html body .app nav.rail button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 70px;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  box-shadow: none;
  --chamfer: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
html body .app nav.rail button .ui-icon { width: 22px; height: 22px; color: inherit; }
html body .app nav.rail button:hover { background: var(--surface-hover); color: var(--text); }
html body .app nav.rail button.active {
  background: var(--fill-active);
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 55%, transparent);
}
html body .app nav.rail button.active .ui-icon { color: var(--text); }
html body .app nav.rail button[data-empty]:not(.active) { opacity: .7; }

.subnav { min-width: 0; padding: 22px 16px; overflow-y: auto; }
.subnav-head h2 { margin: 6px 0 6px; font-size: 22px; line-height: 1.15; }
.subnav-head p { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.subnav-list { display: grid; gap: 8px; }
.subnav-empty { margin: 0; color: var(--muted); font-size: 14px; }
html body .app .subnav-item {
  --cut: 12px;
  --cut-edge: transparent;
  --cut-fill: transparent;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: start;
  justify-content: stretch;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 13px 12px;
  color: var(--text);
  font-weight: 400;
  text-align: left;
}
html body .app .subnav-item:hover { --cut-fill: var(--surface-hover); background: transparent; }
html body .app .subnav-item[aria-current="page"] { --cut-edge: var(--edge); --cut-fill: var(--fill-active); }
.subnav-icon { color: var(--muted); padding-top: 1px; }
.subnav-item[aria-current="page"] .subnav-icon { color: var(--text); }
.subnav-text { min-width: 0; }
.subnav-text strong { display: block; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.subnav-text small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.subnav-arrow { color: var(--muted); opacity: 0; align-self: center; }
.subnav-arrow .ui-icon { width: 16px; height: 16px; }
.subnav-item[aria-current="page"] .subnav-arrow,
.subnav-item:hover .subnav-arrow { opacity: 1; }

html body .app .aside-footer {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--sidebar);
}
.sidebar-club { display: flex; align-items: flex-start; gap: 12px; }
.sidebar-club > .ui-icon { margin-top: 2px; color: var(--muted); }
.sidebar-club div { min-width: 0; }
.sidebar-club strong { display: block; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.sidebar-club small { display: block; color: var(--muted); font-size: 13px; }
.sidebar-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
html body .app .sidebar-actions button { min-height: 34px; padding: 6px 4px; background: transparent; color: var(--label); font-weight: 400; font-size: 14px; }
html body .app .sidebar-actions button:hover { color: var(--text); background: transparent; }
html body .app .sidebar-actions .ui-icon { width: 17px; height: 17px; }
html body .app .aside-footer .release-button {
  display: flex;
  justify-content: space-between;
  min-height: 30px;
  padding: 4px 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  clip-path: none;
}
html body .app .aside-footer .release-button span:first-child { color: var(--muted); }
html body .app .aside-footer .release-button span + span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--pink); }
html body .app .aside-footer .release-button:hover { color: var(--text); background: transparent; }

/* ---------- Workspace ---------- */
html body .app .workspace { max-width: none; padding: 0 clamp(20px, 2.6vw, 40px) 64px; }
html body .app .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  margin: 0 calc(-1 * clamp(20px, 2.6vw, 40px));
  padding: 16px clamp(20px, 2.6vw, 40px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--sidebar) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.club-switch {
  --cut: 10px;
  --cut-fill: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: min(460px, 100%);
  padding: 4px 4px 4px 6px;
}
.club-switch-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 6px; background: var(--mark-fill); color: var(--text); }
html body .app .club-switch select {
  min-width: 0;
  width: auto;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 34px 8px 10px;
  border: 0;
  background-color: transparent;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
}
html body .app .club-switch select:focus-visible { outline-offset: -2px; }
html body .app .club-switch select option { background: var(--surface); color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 18px; min-width: 0; }
html body .app .help-button {
  --cut: 10px;
  --cut-edge: var(--edge);
  --cut-fill: var(--surface-2);
  width: auto;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
  border-radius: 0;
  font-size: 14px;
  align-self: center;
}
html body .app .help-button .ui-icon { width: 18px; height: 18px; }
html body .app #profile { display: flex; align-items: center; gap: 10px; color: var(--muted); }
html body .app .profile-avatar { width: 38px; height: 38px; border-radius: 6px; background: var(--mark-fill); color: var(--text); font-weight: 700; }
html body .app .profile-text strong { font-size: 14px; }

.page-head { display: flex; flex-direction: column; gap: 4px; padding: 34px 0 6px; }
html body #pageTitle { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.1; }
#pageSubtitle { margin: 4px 0 0; font-size: 15px; }
html body .app .view { margin-top: 26px; }
html body .app .section-head { border-bottom: 0; padding-bottom: 18px; }
html body .app .section-head p { color: var(--muted); }

/* Club hero */
.club-hero {
  --cut: 28px;
  --cut-edge: var(--edge);
  --cut-fill: var(--card-fill);
  padding: 30px 32px 28px;
  margin-bottom: 26px;
  overflow: hidden;
}
.club-hero::after {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--card-fill) !important;
}
.club-hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-right: 140px; }
.club-hero-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--label); font-size: 14px; }
.club-hero-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); }
html body #configurationTitle { margin: 0; font-size: clamp(30px, 3.6vw, 52px); line-height: 1.05; overflow-wrap: anywhere; }
.club-hero-meta { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
html body .app .club-hero .back-button {
  --cut: 9px;
  --cut-fill: color-mix(in srgb, var(--surface) 70%, transparent);
  margin: 0;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  color: var(--label);
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
html body .app .club-hero .back-button:hover { color: var(--text); }
.club-hero-mark { position: absolute; top: 26px; right: 30px; width: 112px; height: 112px; opacity: .9; pointer-events: none; z-index: 0; }
html body .app #configurationStatus {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
  position: relative;
  z-index: 1;
}
html body .app #configurationStatus > span {
  --cut: 12px;
  --cut-fill: color-mix(in srgb, var(--surface) 78%, transparent);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
}
html body .app #configurationStatus > span[data-state="on"] { --cut-edge: var(--edge); }
html body .app #configurationStatus small { font-size: 13px; color: var(--muted); }
html body .app #configurationStatus strong { color: var(--text); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
html body .app #configurationStatus > span::before { background: var(--cut-edge, var(--edge-quiet)); }
html body .app #configurationStatus > span[data-state="off"] strong { color: var(--muted); }

/* Club tabs: big chamfered segments, only the active section's tabs are shown */
html body .app .club-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  border: 0;
  overflow: visible;
}
html body .app .club-tabs.single-tab { display: none; }
html body .app .club-tabs button[data-club-tab] {
  --cut: 14px;
  --cut-fill: var(--card-fill-quiet);
  justify-content: center;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  color: var(--label);
  font-size: 16px;
  font-weight: 700;
  white-space: normal;
  text-align: center;
}
html body .app .club-tabs button[data-club-tab] .ui-icon { display: inline-block; width: 20px; height: 20px; }
html body .app .club-tabs button[data-club-tab]:hover { color: var(--text); --cut-edge: var(--edge); background: transparent; }
html body .app .club-tabs button[data-club-tab][aria-selected="true"] { color: var(--text); border: 0; --cut-edge: var(--edge-active); --cut-fill: var(--fill-active); }
html body .app .club-tabs button.tab-outside-group { display: none; }
html body .app .config-form { margin-top: 30px; }

/* Panels */
html body .app .camera-card { --cut: 16px; padding: 18px 20px; }
html body .app .training-zone-form { --cut: 16px; padding: 22px; }
html body .app .history-card { --cut: 18px; padding: 24px 26px; }
html body .app .calls-card { --cut: 16px; padding: 20px 22px; }
html body .app :is(.camera-card, .training-zone-form, .history-card, .calls-card):hover { --cut-edge: var(--edge); }
html body .app .camera-card-actions button,
html body .app .polygon-tools button,
html body .app .sample-list-controls > button,
html body .app .local-vision-dialog [data-close] { --chamfer: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px)); }
html body .app .camera-card-actions button.secondary::before,
html body .app .camera-card-actions button.secondary::after { content: none; }
html body .app .camera-card-actions button:hover { background: var(--accent-soft); }
html body .app .training-canvas-wrap { background: var(--canvas); border-radius: 0; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px)); }
html body .app .training-progress { background: var(--surface-2); border-radius: 0; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
html body .app .camera-quality { border-radius: 0; }
html body .app .calls-summary { gap: 12px; border: 0; border-radius: 0; }
html body .app .calls-summary > div { --cut: 12px; --cut-fill: var(--tile-fill); padding: 16px 18px; border: 0; }
html body .app .calls-summary > div:first-child { --cut-edge: var(--edge); }
html body .app .calls-summary dd { font-size: 28px; }
html body .app .calls-sections button[aria-pressed] { --cut: 9px; }
html body .app .calls-sections button[aria-pressed="true"] { --cut-edge: var(--edge-active); --cut-fill: var(--fill-active); color: var(--text); background: transparent; }
html body .app .calls-attempt { background: var(--surface-sunken); }
html body .app .section-save { border-top: 1px solid var(--line); }
html body .app .sample-pagination button[aria-current="page"] { background: var(--accent-strong); color: #fff; }

/* Clubs list */
html body .app .club-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  border: 0;
}
html body .app .club-card {
  --cut: 20px;
  --cut-fill: var(--card-fill-quiet);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-areas: "mark info" "state state" "open open";
  align-items: center;
  gap: 14px 16px;
  padding: 24px;
  border: 0;
  border-bottom: 0;
}
html body .app .club-card:hover { --cut-edge: var(--edge); --cut-fill: var(--card-fill); }
html body .app .club-card .club-mark { grid-area: mark; width: 52px; height: 52px; border: 0; border-radius: 8px; background: var(--mark-fill); color: var(--text); }
html body .app .club-card:nth-child(even) .club-mark { color: var(--text); }
html body .app .club-info { grid-area: info; }
html body .app .club-info h3 { margin: 0; font-size: 19px; line-height: 1.25; }
html body .app .club-card .club-state { grid-area: state; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
html body .app .club-card .club-state:empty { display: none; }
html body .app .club-card .club-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
html body .app .club-card button {
  grid-area: open;
  justify-self: stretch;
  min-height: 44px;
  margin: 4px 0 0;
  background: var(--accent-strong);
  color: #fff;
}
html body .app .club-card button:hover { background: var(--accent-strong-hover); }
html body .app #clubs .section-head strong { color: var(--text); }

/* Lists and notices */
html body .app .stack article { border-bottom-color: var(--line); }
html body .app .notice { color: var(--muted); }

/* Dialogs and popovers */
html body .snapshot-dialog,
html body .release-popover,
html body .guide-coach {
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  background-image: linear-gradient(90deg, var(--blue), var(--pink));
  background-size: 100% 3px;
  background-repeat: no-repeat;
}
html body .snapshot-dialog::backdrop { background: rgba(4, 6, 12, .7); backdrop-filter: blur(5px); }
html[data-theme="light"] body .snapshot-dialog::backdrop { background: rgba(25, 35, 60, .35); }
html body .guide-arrow { background: var(--surface); }
html body .release-popover b { color: var(--text); }

/* ---------- Authorization ----------
   No photos: gradients, inline-sized SVG cube and one font keep the first load light. */
html body .auth-layout {
  --auth-pad: clamp(20px, 6vw, 116px);
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 6vw, 120px);
  padding: 26px var(--auth-pad) 48px;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(70% 60% at 32% 0%, rgba(122, 28, 64, .42), transparent 70%),
    radial-gradient(55% 55% at 95% 100%, rgba(40, 62, 130, .28), transparent 70%),
    linear-gradient(180deg, #120d17 0%, #0b0e17 55%, #090c14 100%);
}
html[data-theme="light"] body .auth-layout {
  background:
    radial-gradient(70% 60% at 32% 0%, rgba(232, 80, 140, .16), transparent 70%),
    radial-gradient(55% 55% at 95% 100%, rgba(70, 120, 230, .14), transparent 70%),
    linear-gradient(180deg, #f6f2f7 0%, #f1f3f9 60%, #eef1f7 100%);
}
html body .auth-top { grid-column: 1 / -1; display: flex; flex-direction: row; align-items: center; gap: 16px; min-height: 48px; padding: 0; border: 0; }
.auth-logo img { display: block; width: clamp(170px, 18vw, 250px); height: auto; }
.auth-product { padding-left: 16px; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
html body .auth-top .theme-toggle {
  --cut: 8px;
  --cut-fill: color-mix(in srgb, var(--surface-2) 85%, transparent);
  margin-left: auto;
  width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--blue);
}
html body .auth-top .theme-toggle:hover { --cut-edge: var(--edge); color: var(--text); }
html body .auth-top .theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: -4px; }

/* 3D cube: six stacked copies of the 0.8 KB logo SVG, only `transform` animates. */
.auth-scene {
  position: absolute;
  z-index: -1;
  left: clamp(200px, 30vw, 520px);
  top: 50%;
  width: clamp(300px, 34vw, 520px);
  aspect-ratio: 1;
  transform: translate(-30%, -52%);
  perspective: 1400px;
  pointer-events: none;
}
.auth-cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(10deg) rotateY(-24deg) rotateZ(-6deg);
  animation: auth-cube-drift 16s ease-in-out infinite alternate;
  will-change: transform;
}
.auth-cube img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translateZ(calc(var(--layer) * -7px));
  filter: saturate(.5) brightness(var(--shade));
}
.auth-cube img:nth-child(1) { --layer: 0; --shade: .5; }
.auth-cube img:nth-child(2) { --layer: 1; --shade: .36; }
.auth-cube img:nth-child(3) { --layer: 2; --shade: .31; }
.auth-cube img:nth-child(4) { --layer: 3; --shade: .27; }
.auth-cube img:nth-child(5) { --layer: 4; --shade: .23; }
.auth-cube img:nth-child(6) { --layer: 5; --shade: .2; }
html[data-theme="light"] .auth-cube img { filter: saturate(.45) brightness(1.2) opacity(.07); }
html[data-theme="light"] .auth-cube img:nth-child(1) { filter: saturate(.5) brightness(1.15) opacity(.3); }
@keyframes auth-cube-drift {
  0% { transform: rotateX(10deg) rotateY(-24deg) rotateZ(-6deg) translate3d(0, 0, 0); }
  50% { transform: rotateX(4deg) rotateY(-8deg) rotateZ(-3deg) translate3d(0, -10px, 0); }
  100% { transform: rotateX(14deg) rotateY(-32deg) rotateZ(-8deg) translate3d(0, 6px, 0); }
}
@media (prefers-reduced-motion: reduce) { .auth-cube { animation: none; } }
.auth-layout.hidden .auth-cube { animation: none; }

.auth-intro { grid-column: 1; align-self: center; max-width: 680px; padding: 40px 0; }
html body .auth-title { margin: 0; font-size: clamp(28px, 3.1vw, 48px); font-weight: 400; line-height: 1.04; letter-spacing: .02em; }
.auth-title span { display: block; }
.auth-title span + span { color: #e3b8d3; }
html[data-theme="light"] .auth-title span + span { color: #b0336f; }
.auth-lead { max-width: 340px; margin: 26px 0 0; color: var(--label); font-size: 19px; line-height: 1.5; }
.auth-features { display: grid; gap: 14px; margin: 44px 0 0; padding: 0; list-style: none; }
.auth-features li { display: grid; gap: 6px; padding: 10px 0 10px 24px; border-left: 2px solid var(--line-strong); }
.auth-features li:first-child { border-left-color: var(--pink); }
.auth-features strong { font-size: 20px; line-height: 1.3; }
.auth-features span { color: var(--muted); font-size: 15px; line-height: 1.45; }
.auth-kicker { margin: 40px 0 0 26px; color: #8db5ff; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
html[data-theme="light"] .auth-kicker { color: var(--blue); }
.auth-note { margin: 10px 0 0 26px; color: var(--label); font-size: 15px; }

.auth-access { grid-column: 2; align-self: center; position: relative; width: 100%; }
html body .auth-panel {
  position: relative;
  width: 100%;
  padding: 40px 40px 34px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}
html body .auth-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 38px;
  right: 38px;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--pink));
}
html body .auth-panel h2 { margin: 0; font-size: clamp(26px, 2.4vw, 34px); font-weight: 400; line-height: 1.15; }
html body .auth-panel > .muted { margin: 16px 0 26px; color: var(--muted); font-size: 16px; line-height: 1.5; }
html body .auth-panel label { margin: 0 0 20px; gap: 10px; color: var(--text); font-size: 15px; font-weight: 700; }
html body .auth-layout input {
  min-height: 60px;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}
html body .auth-layout input:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }
html body .password-field-text > input { padding-inline-end: 112px; }
html body .password-field > .password-toggle-text {
  inset-inline-end: 8px;
  top: 8px;
  bottom: 8px;
  width: auto;
  min-width: 88px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--label);
  font-size: 14px;
  font-weight: 700;
}
html body .password-field > .password-toggle-text:hover,
html body .password-field > .password-toggle-text[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); }
html body .auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  margin-top: 6px;
  padding: 0 22px;
  border-radius: 10px;
  background: #3f84e8;
  color: #fff;
  font-size: 17px;
  clip-path: none;
}
html body .auth-submit:hover { background: #4b8ff2; }
html body .auth-submit:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
html body .auth-submit .ui-icon { width: 22px; height: 22px; }
html body .auth-layout output { margin-top: 14px; color: var(--danger); font-size: 14px; }
html body .auth-layout output:empty { display: none; }
html body .auth-switch { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; text-align: center; }
html body .auth-switch .link { min-height: 0; padding: 0; background: none; color: var(--blue); font-weight: 700; }
html body .auth-switch .link:hover { color: var(--text); }

@media (max-width: 980px) {
  html body .auth-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; row-gap: 28px; padding-bottom: 40px; }
  .auth-access { grid-column: 1; grid-row: 2; max-width: 520px; width: 100%; justify-self: center; }
  .auth-intro { grid-column: 1; grid-row: 3; max-width: none; padding: 8px 0 0; }
  .auth-scene { left: auto; right: -10%; top: 6%; width: 320px; transform: none; opacity: .5; }
}
@media (max-width: 560px) {
  html body .auth-layout { padding: 18px 16px 32px; }
  .auth-product { display: none; }
  .auth-logo img { width: 170px; }
  html body .auth-panel { padding: 30px 22px 26px; border-radius: 14px; }
  html body .auth-panel::before { left: 22px; right: 22px; }
  .auth-features strong { font-size: 18px; }
  .auth-lead { font-size: 17px; }
  .auth-scene { width: 240px; right: -30%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  html body .app { grid-template-columns: 300px minmax(0, 1fr); }
  .sidebar-body { grid-template-columns: 80px minmax(0, 1fr); }
  html body .app #configurationStatus { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html body .app .club-tabs .ui-icon { display: inline-block; }
}
@media (max-width: 960px) {
  html body .app { grid-template-columns: 96px minmax(0, 1fr); }
  .sidebar-top { flex-direction: column; padding: 18px 10px 14px; }
  html body .app .sidebar-top .compact { width: 40px; height: 40px; background: url("/assets/favicon.svg") center / contain no-repeat; }
  html body .app .sidebar-top .compact img { display: none !important; }
  .sidebar-product, .subnav, .sidebar-club, .sidebar-actions #sidebarAddClub, .aside-footer .release-button span + span { display: none !important; }
  .sidebar-body { grid-template-columns: 1fr; }
  html body .app nav.rail { border-right: 0; }
  html body .app .aside-footer { padding: 12px 8px; justify-items: center; }
  html body .app .sidebar-actions .logout span { display: none; }
  .club-hero-head { padding-right: 0; }
  .club-hero-mark { display: none; }
}
@media (max-width: 760px) {
  html body .app { display: block; }
  html body .app aside.sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .sidebar-top { grid-column: 1; grid-row: 1; flex-direction: row; padding: 14px 10px 10px 16px; }
  html body .app .sidebar-top .compact { width: auto; height: auto; background: none; }
  html body .app .sidebar-top .compact img { width: 150px; height: auto; }
  html body .app .sidebar-top .compact img.logo-on-dark { display: var(--logo-dark-display) !important; }
  html body .app .sidebar-top .compact img.logo-on-light { display: var(--logo-light-display) !important; }
  .sidebar-body { grid-column: 1 / -1; display: block; border-top: 0; }
  html body .app nav.rail { flex-direction: row; padding: 0 12px 10px; overflow-x: auto; background: transparent; }
  .rail-spacer { display: none; }
  html body .app nav.rail button { flex: 1 0 74px; min-height: 58px; font-size: 12px; }
  .subnav { display: block !important; padding: 4px 16px 14px; }
  .subnav-head { display: none; }
  .subnav-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  html body .app .subnav-item { flex: 0 0 auto; width: auto; max-width: 240px; grid-template-columns: 18px minmax(0, auto); padding: 10px 14px; }
  .subnav-text small, .subnav-arrow { display: none; }
  html body .app .aside-footer { grid-column: 2; grid-row: 1; display: flex; align-items: center; padding: 14px 16px 10px 0; border: 0; background: transparent; }
  .sidebar-club, #sidebarAddClub, html body .app .aside-footer .release-button { display: none !important; }
  html body .app .sidebar-actions .logout { width: 42px; min-height: 42px; justify-content: center; border: 1px solid var(--line-strong); }
  html body .app .workspace { padding: 0 16px 48px; }
  html body .app .topbar { position: static; margin: 0 -16px; padding: 12px 16px; min-height: 0; flex-wrap: wrap; }
  .club-switch { flex: 1 1 100%; max-width: none; }
  html body .app .club-switch select { flex: 1 1 auto; }
  .topbar-actions { flex: 1 1 100%; justify-content: space-between; }
  html body .app .profile-text { display: none; }
  .page-head { padding-top: 24px; }
  .club-hero { --cut: 18px; padding: 22px 18px; }
  .club-hero-head { flex-direction: column; gap: 16px; }
  html body .app #configurationStatus { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  html body .app #configurationStatus > span { padding: 12px; }
  html body .app .club-tabs { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
  html body .app .club-tabs button[data-club-tab] { min-height: 52px; font-size: 14px; padding: 10px; }
  html body .app .club-tabs .ui-icon { display: none !important; }
  html body .app .club-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html body *::before, html body *::after { transition: none !important; }
}
