:root {
  --bg: #e1efff;
  --bg-fade: #f7fbff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --line: rgba(26, 72, 132, 0.12);
  --ink: #153352;
  --muted: #58718a;
  --teal: #2a78d3;
  --teal-deep: #123f78;
  --sand: #d94a57;
  --sand-deep: #a72333;
  --sky: #e8f2ff;
  --mint: #e3f5ec;
  --warn: #edf5ff;
  --warn-ink: #1f4f86;
  --danger: #b92634;
  --danger-soft: #ffe2e6;
  --shadow: 0 22px 48px rgba(15, 54, 102, 0.12);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(129, 188, 255, 0.36), transparent 34%),
    radial-gradient(circle at top right, rgba(205, 231, 255, 0.62), transparent 30%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg-fade) 18%, var(--bg) 58%, #d4e6fb 100%);
}

body {
  padding: 24px 24px 120px;
}

body.app-loading {
  overflow: hidden;
}

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

.shell {
  max-width: 1560px;
  margin: 0 auto;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top center, rgba(110, 190, 255, 0.32), transparent 32%),
    linear-gradient(180deg, rgba(7, 33, 66, 0.96), rgba(17, 66, 124, 0.95) 58%, rgba(36, 122, 211, 0.92));
  overflow: hidden;
}

.loading-screen[hidden] {
  display: none !important;
}

.loading-screen.is-hiding {
  animation: loading-screen-fade 0.28s ease forwards;
}

.loading-screen-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.12), transparent 18%),
    radial-gradient(circle at 82% 24%, rgba(159, 215, 255, 0.2), transparent 24%),
    radial-gradient(circle at 50% 82%, rgba(255, 255, 255, 0.08), transparent 22%);
  pointer-events: none;
}

.loading-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 34px 30px 28px;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(10, 44, 86, 0.56), rgba(7, 28, 57, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 28px 60px rgba(5, 20, 42, 0.34);
  backdrop-filter: blur(16px);
}

.loading-logo-shell {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(7, 32, 64, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 32px rgba(4, 18, 38, 0.28);
}

.loading-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.18));
}

.loading-copy {
  display: grid;
  gap: 8px;
  text-align: center;
  justify-items: center;
}

.loading-kicker {
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(237, 245, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  font-weight: 900;
}

.loading-title {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-shadow: 0 16px 28px rgba(0, 0, 0, 0.14);
}

.loading-signoff {
  margin: 0;
  color: rgba(226, 240, 255, 0.88);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.loading-progress {
  width: min(320px, 100%);
  height: 10px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.loading-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(140, 211, 255, 0.92), rgba(255, 255, 255, 0.98) 52%, rgba(85, 180, 255, 0.94));
  box-shadow: 0 0 24px rgba(131, 206, 255, 0.34);
  animation: loading-progress-fill 1.35s ease forwards;
}

@keyframes loading-progress-fill {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes loading-screen-fade {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

.hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 30px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(8, 47, 102, 0.98), rgba(20, 90, 171, 0.96) 56%, rgba(63, 145, 224, 0.94)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 56px rgba(16, 52, 96, 0.18);
  color: #f5f9ff;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 340px;
  height: 340px;
  right: -120px;
  top: -150px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 72%);
}

.hero::after {
  width: 220px;
  height: 220px;
  left: 32%;
  bottom: -140px;
  background: radial-gradient(circle, rgba(133, 199, 255, 0.18) 0%, rgba(133, 199, 255, 0) 74%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.84;
}

.hero h1,
.panel h2,
.panel h3 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.02;
}

.hero-title-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-logo-shell {
  width: 82px;
  height: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
    rgba(7, 35, 74, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 18px 32px rgba(7, 37, 78, 0.2);
  overflow: hidden;
}

.hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-brand-stack {
  display: grid;
  gap: 10px;
}

.hero-signoff {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(115, 191, 255, 0.2), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 16px 30px rgba(7, 37, 78, 0.18);
  color: #f3f8ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.hero-signoff::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #9fd7ff, #ffffff);
  box-shadow: 0 0 0 4px rgba(159, 215, 255, 0.12);
  flex: 0 0 auto;
}

.hero-signoff::after {
  content: "";
  position: absolute;
  inset: 1px auto 1px -28px;
  width: 42px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  transform: skewX(-20deg);
}

.hero-copy {
  max-width: 760px;
  margin: 14px 0 0;
  line-height: 1.56;
  color: rgba(247, 244, 234, 0.9);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-meta-inline {
  margin-top: 0;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 22px;
}

.workspace-shell.is-side-collapsed {
  grid-template-columns: 92px minmax(0, 1fr);
}

.workspace-main {
  min-width: 0;
}

.workspace-main .tabbar {
  margin-top: 0;
}

.side-menu {
  position: sticky;
  top: 14px;
  z-index: 45;
  padding: 18px 14px 14px;
  border-radius: 30px;
  border: 1px solid rgba(30, 89, 156, 0.1);
  background: linear-gradient(180deg, rgba(249, 252, 255, 0.96), rgba(236, 245, 255, 0.9));
  box-shadow: 0 18px 34px rgba(18, 55, 94, 0.12);
  backdrop-filter: blur(14px);
  transition: padding 0.16s ease, border-radius 0.16s ease, box-shadow 0.16s ease;
}

.side-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.side-menu-title {
  display: block;
  font-size: 17px;
  line-height: 1.1;
  color: var(--teal-deep);
}

.side-menu-toggle {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(23, 105, 194, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--teal-deep);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.side-menu-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 18px rgba(18, 55, 94, 0.1);
}

.side-menu-nav {
  display: grid;
  gap: 10px;
}

.side-nav-btn {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 88px;
  border: 1px solid rgba(25, 91, 168, 0.1);
  border-radius: 24px;
  padding: 16px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 245, 255, 0.96));
  color: var(--teal-deep);
  text-align: left;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(18, 55, 94, 0.08);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.debug-only-nav[hidden],
.debug-only-nav.is-hidden {
  display: none !important;
}

.side-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(18, 55, 94, 0.12);
}

.side-nav-btn.is-active {
  color: #fff7eb;
  border-color: rgba(23, 105, 194, 0.26);
  background: linear-gradient(180deg, var(--teal), var(--teal-deep));
  box-shadow: 0 18px 34px rgba(23, 105, 194, 0.24);
}

.side-nav-btn-danger {
  border-color: rgba(173, 46, 46, 0.18);
  background: linear-gradient(180deg, rgba(255, 246, 246, 0.98), rgba(255, 232, 232, 0.96));
  color: #8f2525;
  box-shadow: 0 14px 28px rgba(143, 37, 37, 0.12);
}

.side-nav-btn-danger:hover {
  box-shadow: 0 18px 30px rgba(143, 37, 37, 0.18);
}

.side-nav-btn-danger .side-nav-icon {
  border-color: rgba(173, 46, 46, 0.2);
  background: rgba(173, 46, 46, 0.08);
  color: #8f2525;
}

.side-nav-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(14, 90, 96, 0.14);
  background: rgba(14, 90, 96, 0.08);
  font-size: 14px;
  font-weight: 900;
}

.side-nav-btn.is-active .side-nav-icon {
  color: #fff7eb;
  border-color: rgba(255, 247, 235, 0.24);
  background: rgba(255, 247, 235, 0.16);
}

.side-nav-copy {
  min-width: 0;
}

.side-nav-copy strong,
.side-nav-copy small {
  display: block;
}

.side-nav-copy strong {
  font-size: 17px;
  line-height: 1.08;
}

.side-nav-copy small {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.side-menu.is-collapsed {
  padding-left: 10px;
  padding-right: 10px;
}

.side-menu.is-collapsed .side-menu-head {
  justify-content: center;
}

.side-menu.is-collapsed .side-menu-head > div,
.side-menu.is-collapsed .side-nav-copy {
  display: none;
}

.side-menu.is-collapsed .side-menu-toggle {
  width: 100%;
}

.side-menu.is-collapsed .side-nav-btn {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 72px;
  padding: 14px 10px;
  gap: 0;
}

.meta-chip,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.meta-chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f2f8ff;
}

.meta-chip-debug {
  background: rgba(94, 165, 237, 0.2);
  border-color: rgba(132, 197, 255, 0.3);
  color: #eff7ff;
}

.meta-chip-version {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(173, 212, 255, 0.28);
  color: #f7fbff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.message {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font-weight: 700;
}

#message-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 120;
  width: min(980px, calc(100vw - 48px));
  margin-top: 0;
  padding: 16px 20px;
  border-width: 1px;
  box-shadow: 0 18px 38px rgba(15, 54, 102, 0.18);
  backdrop-filter: blur(14px);
}

#message-bar[hidden] {
  display: none !important;
}

.message-info {
  color: var(--teal-deep);
  background: rgba(229, 241, 255, 0.94);
}

.message-success {
  color: #1f5635;
  background: rgba(224, 245, 230, 0.94);
}

.message-warn {
  color: var(--warn-ink);
  background: rgba(255, 240, 194, 0.94);
}

.tabbar {
  --flow-progress-width: 0px;
  --tab-count: 5;
  position: sticky;
  top: 14px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(var(--tab-count), minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid rgba(30, 89, 156, 0.1);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.92), rgba(233, 243, 255, 0.88));
  box-shadow: 0 18px 34px rgba(18, 55, 94, 0.12);
  backdrop-filter: blur(14px);
}

.tabbar::before,
.tabbar::after {
  content: "";
  position: absolute;
  top: 54px;
  left: 48px;
  height: 6px;
  border-radius: 999px;
  z-index: 0;
}

.tabbar::before {
  right: 48px;
  background: linear-gradient(90deg, rgba(161, 198, 239, 0.2), rgba(23, 105, 194, 0.16), rgba(161, 198, 239, 0.2));
}

.tabbar::after {
  width: var(--flow-progress-width);
  background: linear-gradient(90deg, rgba(26, 98, 183, 0.94), rgba(98, 166, 239, 0.96));
  box-shadow: 0 0 18px rgba(65, 138, 217, 0.22);
  transition: width 240ms ease;
}

.tab-btn {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  border: 1px solid rgba(30, 89, 156, 0.1);
  border-radius: 24px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 245, 255, 0.96));
  color: var(--teal-deep);
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(18, 55, 94, 0.08);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  text-align: left;
}

.tab-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 28%, rgba(255, 255, 255, 0.32) 48%, transparent 68%);
  transform: translateX(-135%);
  opacity: 0;
  pointer-events: none;
}

.tab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(18, 55, 94, 0.12);
}

.tab-btn.is-done {
  border-color: rgba(26, 98, 183, 0.12);
  background: linear-gradient(180deg, rgba(240, 248, 255, 0.98), rgba(223, 237, 255, 0.96));
  color: #164a81;
}

.tab-btn.active {
  color: #fff7eb;
  border-color: rgba(28, 101, 186, 0.34);
  background: linear-gradient(135deg, rgba(20, 78, 146, 0.98), rgba(26, 103, 187, 0.96));
  box-shadow: 0 20px 36px rgba(20, 78, 146, 0.24);
}

.tab-btn.active::after {
  opacity: 1;
  animation: flowSweep 2.8s ease-in-out infinite;
}

.tab-step-no {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(14, 90, 96, 0.14);
  background: rgba(14, 90, 96, 0.08);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.tab-btn.is-done .tab-step-no {
  background: rgba(14, 90, 96, 0.14);
  border-color: rgba(14, 90, 96, 0.18);
}

.tab-btn.active .tab-step-no {
  background: rgba(255, 247, 235, 0.16);
  border-color: rgba(255, 247, 235, 0.24);
  color: #fff7eb;
}

.tab-step-copy {
  min-width: 0;
}

.tab-step-copy strong,
.tab-step-copy small,
.tab-step-copy em {
  display: block;
}

.tab-step-copy strong {
  font-size: 16px;
  line-height: 1.05;
}

.tab-step-copy small {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.tab-step-meta {
  margin-top: 8px;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  border: 1px solid transparent;
}

.tab-step-meta-muted {
  color: var(--muted);
  background: rgba(88, 113, 138, 0.08);
  border-color: rgba(88, 113, 138, 0.14);
}

.tab-step-meta-success {
  color: #1f6a4e;
  background: rgba(73, 181, 126, 0.14);
  border-color: rgba(73, 181, 126, 0.22);
}

.tab-step-meta-warn {
  color: #8a5b14;
  background: rgba(250, 198, 92, 0.18);
  border-color: rgba(214, 161, 52, 0.26);
}

.tab-step-meta-danger {
  color: #9b2638;
  background: rgba(217, 74, 87, 0.14);
  border-color: rgba(217, 74, 87, 0.22);
}

.tab-step-state {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(14, 90, 96, 0.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  justify-self: end;
}

.tab-btn.is-done .tab-step-state {
  background: rgba(14, 90, 96, 0.12);
  color: #0b4e53;
}

.tab-btn.active .tab-step-state {
  background: rgba(255, 247, 235, 0.16);
  color: #fff7eb;
}

.tab-btn.active .tab-step-meta-muted,
.tab-btn.active .tab-step-meta-success,
.tab-btn.active .tab-step-meta-warn,
.tab-btn.active .tab-step-meta-danger {
  color: #fff7eb;
  border-color: rgba(255, 247, 235, 0.2);
  background: rgba(255, 247, 235, 0.14);
}

.pages {
  margin-top: 18px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: 1 / -1;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(30, 89, 156, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(10px);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

textarea,
input[type="text"],
input[type="date"],
input[type="number"],
select {
  width: 100%;
  border: 1px solid rgba(28, 94, 171, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}

textarea:focus,
input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: rgba(14, 90, 96, 0.58);
  box-shadow: 0 0 0 4px rgba(14, 90, 96, 0.12);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.participant-picker {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(245, 250, 255, 0.9);
}

.participant-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) minmax(220px, 1fr);
  gap: 16px;
  align-items: end;
}

.participant-picker-search {
  margin: 0;
}

.participant-picker-search input {
  max-width: 100%;
}

.participant-picker-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.participant-picker-results {
  margin-top: 14px;
}

.participant-picker-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.participant-picker-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(23, 105, 194, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(239, 247, 255, 0.9));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.participant-picker-card:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 105, 194, 0.3);
  box-shadow: 0 12px 24px rgba(18, 55, 94, 0.1);
}

.participant-picker-card strong {
  font-size: 16px;
}

.participant-picker-card span:not(.chip) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.group-plan-preview {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(23, 105, 194, 0.14);
  background: linear-gradient(180deg, rgba(243, 249, 255, 0.88), rgba(233, 244, 255, 0.88));
}

.group-plan-preview.is-warn {
  border-color: rgba(181, 74, 61, 0.22);
  background: linear-gradient(180deg, rgba(255, 244, 240, 0.92), rgba(255, 236, 229, 0.92));
}

.group-plan-preview-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.group-plan-preview-head strong {
  color: var(--teal-deep);
  font-size: 16px;
}

.group-plan-preview.is-warn .group-plan-preview-head strong {
  color: var(--danger);
}

.group-plan-preview-chips {
  margin-bottom: 8px;
}

.group-plan-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.group-plan-preview-card {
  padding: 10px;
  border: 1px solid rgba(23, 105, 194, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.group-plan-preview-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--teal-deep);
}

.group-plan-preview-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.group-assignment-editor {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(23, 105, 194, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.96), rgba(232, 243, 255, 0.92));
}

.group-assignment-editor.is-compact {
  padding: 14px;
}

.group-assignment-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.group-assignment-head h3 {
  margin: 0;
  font-size: 20px;
  color: var(--teal-deep);
}

.group-assignment-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.group-add-double-panel,
.group-move-double-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(21, 81, 146, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.group-add-double-copy,
.group-move-double-copy {
  display: grid;
  gap: 3px;
}

.group-add-double-copy strong,
.group-move-double-copy strong {
  color: var(--teal-deep);
}

.group-add-double-copy span,
.group-move-double-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.group-add-double-form,
.group-move-double-form {
  display: grid;
  gap: 10px;
  align-items: end;
}

.group-add-double-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.group-move-double-form {
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) auto;
}

.group-add-double-form .field,
.group-move-double-form .field {
  min-width: 0;
}

.group-add-double-form .btn,
.group-move-double-form .btn {
  min-height: 48px;
}

.group-assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.group-assignment-editor.is-compact .group-assignment-grid {
  grid-template-columns: 1fr;
}

.group-assignment-editor.is-compact .group-add-double-form,
.group-assignment-editor.is-compact .group-move-double-form {
  grid-template-columns: 1fr;
}

.group-drop-zone {
  min-height: 164px;
  padding: 12px;
  border: 1px solid rgba(21, 81, 146, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.group-drop-zone.is-drag-over {
  border-color: rgba(35, 132, 77, 0.5);
  background: rgba(231, 248, 237, 0.88);
  box-shadow: inset 0 0 0 2px rgba(35, 132, 77, 0.12);
}

.group-assignment-group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.group-assignment-group-head h4 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.group-team-stack {
  display: grid;
  gap: 10px;
}

.group-team-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(21, 81, 146, 0.14);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 255, 0.96));
  box-shadow: 0 10px 18px rgba(18, 55, 94, 0.08);
}

.group-team-card[draggable="true"] {
  cursor: grab;
}

.group-team-card.is-dragging {
  cursor: grabbing;
  opacity: 0.48;
}

.group-team-card-main {
  min-width: 0;
}

.group-team-card strong,
.group-team-card small {
  display: block;
}

.group-team-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.group-team-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  cursor: default;
}

.group-drop-empty {
  display: grid;
  place-items: center;
  min-height: 82px;
  border: 1px dashed rgba(21, 81, 146, 0.24);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 800;
}

.duplicate-check-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(23, 105, 194, 0.14);
  background: linear-gradient(180deg, rgba(243, 249, 255, 0.88), rgba(233, 244, 255, 0.88));
}

.duplicate-check-box strong {
  display: block;
  color: var(--teal-deep);
  margin-bottom: 6px;
}

.duplicate-check-box.is-ok {
  border-color: rgba(35, 132, 77, 0.18);
  background: linear-gradient(180deg, rgba(241, 255, 246, 0.92), rgba(231, 248, 237, 0.92));
}

.duplicate-check-box.is-warn {
  border-color: rgba(181, 74, 61, 0.22);
  background: linear-gradient(180deg, rgba(255, 244, 240, 0.94), rgba(255, 236, 229, 0.94));
}

.duplicate-check-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.duplicate-check-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(181, 74, 61, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.duplicate-check-entered {
  margin-bottom: 8px;
  color: var(--danger);
  font-weight: 800;
}

.duplicate-check-entered span {
  color: var(--ink);
}

.duplicate-check-choice-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.duplicate-choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
}

.duplicate-choice input[type="checkbox"] {
  margin: 0;
}

.duplicate-choice-select:disabled {
  opacity: 0.56;
}

.duplicate-check-candidates {
  display: grid;
  gap: 8px;
}

.duplicate-check-candidate {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(183, 48, 68, 0.08);
  border-left: 4px solid rgba(183, 48, 68, 0.82);
}

.duplicate-check-candidate strong {
  display: block;
  margin: 0 0 4px;
  color: var(--ink);
}

.duplicate-check-candidate span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled,
.mini-btn:disabled,
.inline-danger:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #f7fbff;
  background: linear-gradient(180deg, #3182de, #18518f);
  box-shadow: 0 12px 22px rgba(23, 105, 194, 0.22);
}

.btn-accent {
  color: #f7fbff;
  background: linear-gradient(180deg, #4c9cff, #2360ad);
  box-shadow: 0 12px 22px rgba(35, 96, 173, 0.2);
}

.btn-soft {
  color: var(--teal-deep);
  background: rgba(36, 118, 213, 0.1);
  border: 1px solid rgba(36, 118, 213, 0.16);
}

.btn-ghost {
  color: var(--teal-deep);
  background: rgba(36, 118, 213, 0.08);
  border: 1px solid rgba(36, 118, 213, 0.12);
}

.hero .btn-ghost {
  color: #f2f8ff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-danger {
  color: #fff4f1;
  background: linear-gradient(180deg, #b54a3d, var(--danger));
}

.btn-big {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 260px;
  min-width: 240px;
  padding: 14px 22px;
  font-size: 16px;
  box-shadow: 0 16px 30px rgba(18, 55, 94, 0.14);
}

.small-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty-state,
.note-box,
.waiting-box,
.context-banner {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(249, 252, 255, 0.9);
}

.note-box {
  background: linear-gradient(180deg, rgba(241, 248, 255, 0.92), rgba(230, 241, 255, 0.9));
  color: var(--warn-ink);
}

.waiting-box {
  background: linear-gradient(180deg, rgba(233, 247, 255, 0.94), rgba(220, 240, 255, 0.92));
  color: #15497f;
  font-weight: 700;
}

.context-banner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  background:
    linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(235, 245, 255, 0.94));
}

.context-banner-compact {
  padding: 12px 14px;
  border-radius: 16px;
}

.context-banner-compact h3 {
  font-size: 18px;
  line-height: 1.1;
}

.context-banner-compact p {
  margin-top: 6px;
}

.context-banner p {
  margin: 8px 0 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chip {
  background: rgba(36, 118, 213, 0.08);
  color: var(--teal-deep);
  border: 1px solid rgba(36, 118, 213, 0.12);
}

.chip.gold {
  background: rgba(29, 98, 183, 0.12);
  color: #184c87;
  border-color: rgba(29, 98, 183, 0.18);
}

.hero-context-banner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex: 1 1 420px;
  min-width: 320px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-context-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.hero-context-kicker {
  display: block;
  color: rgba(247, 251, 255, 0.8);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-context-copy strong {
  color: #f8fbff;
  font-size: 14px;
  line-height: 1.15;
}

.hero-context-copy small {
  color: rgba(238, 245, 255, 0.86);
  font-size: 11px;
  line-height: 1.35;
}

.hero-context-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.chip.warn {
  background: rgba(255, 227, 231, 0.92);
  color: #9b2430;
  border-color: rgba(185, 38, 52, 0.18);
}

.chip.active {
  background: rgba(14, 90, 96, 0.18);
  color: #08393e;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(28, 94, 171, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 245, 255, 0.94));
}

.stat-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.stat-value {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-weight: 800;
}

.tournament-list {
  display: grid;
  gap: 12px;
}

.tournament-card {
  border-radius: 20px;
  border: 1px solid rgba(28, 94, 171, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.94));
  padding: 18px;
}

.tournament-card.selected {
  border-color: rgba(14, 90, 96, 0.34);
  box-shadow: 0 0 0 3px rgba(14, 90, 96, 0.1);
}

.card-top,
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.card-top {
  align-items: flex-start;
}

.tournament-card-chips {
  justify-content: flex-end;
}

.card-title {
  font-size: 22px;
  font-weight: 800;
}

.card-copy {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.48;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.summary-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(81, 60, 15, 0.08);
}

.summary-card strong,
.summary-card span {
  display: block;
}

.summary-card span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.summary-card strong {
  margin-top: 6px;
  font-size: 18px;
}

.podium-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.podium-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(81, 60, 15, 0.08);
}

.podium-rank {
  font-size: 22px;
  font-weight: 900;
  color: var(--sand-deep);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(76, 61, 25, 0.12);
  vertical-align: top;
  text-align: left;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

th.sortable-th {
  position: relative;
  padding-right: 28px;
  cursor: pointer;
  user-select: none;
}

th.sortable-th::after {
  content: "↕";
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  font-size: 12px;
  color: rgba(32, 77, 122, 0.42);
}

th.sortable-th[data-sort-dir="asc"]::after {
  content: "↑";
  color: var(--ocean-deep);
}

th.sortable-th[data-sort-dir="desc"]::after {
  content: "↓";
  color: var(--ocean-deep);
}

th.sortable-th:focus-visible {
  outline: 2px solid rgba(27, 96, 170, 0.34);
  outline-offset: -2px;
}

.table-title {
  margin-bottom: 12px;
}

.player-name,
.team-name {
  font-size: 17px;
  font-weight: 800;
}

.pool-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pool-radios label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #d8cfb8;
  background: #fffdf7;
  font-size: 12px;
  font-weight: 800;
  color: #34413a;
}

.pool-radios input {
  accent-color: var(--teal);
}

.private-pool-cell {
  min-width: 128px;
}

.private-pool-radios {
  flex-wrap: nowrap;
}

.private-pool-radios label {
  border-color: rgba(208, 162, 77, 0.34);
  background: rgba(255, 247, 229, 0.9);
}

table[data-sort-key="players-participants"] th,
table[data-sort-key="players-participants"] td {
  padding: 4px 6px;
  vertical-align: middle;
}

table[data-sort-key="players-participants"] th {
  font-size: 10px;
  line-height: 1.15;
}

table[data-sort-key="players-participants"] .player-name {
  font-size: 14px;
  line-height: 1.12;
}

table[data-sort-key="players-participants"] .pool-radios {
  gap: 3px;
}

table[data-sort-key="players-participants"] .pool-radios label {
  gap: 3px;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 1.1;
}

table[data-sort-key="players-participants"] .pool-radios input {
  width: 11px;
  height: 11px;
}

table[data-sort-key="players-participants"] .toggle-pill {
  gap: 5px;
  font-size: 12px;
}

table[data-sort-key="players-participants"] .toggle-pill input {
  width: 14px;
  height: 14px;
}

table[data-sort-key="players-participants"] .private-note {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.15;
}

table[data-sort-key="players-participants"] .mini-btn {
  min-width: 28px;
  padding: 5px 6px;
  border-radius: 8px;
}

table[data-sort-key="players-participants"] .inline-danger {
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.private-row td {
  background: linear-gradient(180deg, rgba(255, 247, 229, 0.92), rgba(255, 239, 205, 0.92));
}

.private-row-start td {
  border-top: 2px solid rgba(208, 162, 77, 0.58);
}

.private-row-end td {
  border-bottom: 2px solid rgba(208, 162, 77, 0.58);
}

.private-row-solo td {
  border-top: 2px dashed rgba(208, 162, 77, 0.7);
  border-bottom: 2px dashed rgba(208, 162, 77, 0.7);
}

.private-note {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #865a0d;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.toggle-pill input {
  width: 18px;
  height: 18px;
  accent-color: var(--sand-deep);
}

.mini-btn {
  min-width: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 10px;
  background: rgba(14, 90, 96, 0.1);
  color: var(--teal-deep);
  font-weight: 900;
  cursor: pointer;
}

.inline-danger {
  border: 0;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
  padding: 8px 10px;
  cursor: pointer;
}

.inline-note {
  font-size: 12px;
  color: var(--muted);
}

.groups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.group-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(76, 61, 25, 0.12);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(246, 238, 219, 0.96));
}

.group-card p,
.group-card strong {
  margin: 0 0 10px;
}

.group-card ol {
  margin: 0 0 12px;
  padding-left: 18px;
}

.group-card li {
  margin-bottom: 6px;
  line-height: 1.45;
}

.group-card-rich {
  display: grid;
  gap: 16px;
}

.groups-grid .group-card-rich {
  border-color: rgba(88, 155, 232, 0.22);
  background: linear-gradient(180deg, rgba(18, 62, 112, 0.99), rgba(9, 31, 59, 0.98));
  box-shadow: 0 18px 34px rgba(8, 20, 39, 0.14);
  color: #f5f9ff;
}

.groups-grid .group-card-rich .section-kicker,
.groups-grid .group-card-rich .small-note,
.groups-grid .group-card-rich .group-card-head h3,
.groups-grid .group-card-rich .summary-card span,
.groups-grid .group-card-rich th,
.groups-grid .group-card-rich td,
.groups-grid .group-card-rich li {
  color: inherit;
}

.groups-grid .group-card-rich .small-note {
  color: rgba(233, 241, 255, 0.78);
}

.groups-grid .group-card-rich .group-card-head h3 {
  color: #ffffff;
}

.groups-grid .group-card-rich .summary-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.12);
}

.groups-grid .group-card-rich .summary-card span {
  color: rgba(233, 241, 255, 0.74);
}

.groups-grid .group-card-rich .summary-card strong {
  color: #ffffff;
}

.groups-grid .group-card-rich .table-wrap {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.groups-grid .group-card-rich .group-standings-table th,
.groups-grid .group-card-rich .group-standings-table td {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.groups-grid .group-card-rich .group-standings-table th {
  color: rgba(237, 244, 255, 0.8);
}

.groups-grid .group-card-rich .group-standings-table td {
  color: #eef5ff;
}

.groups-grid .group-card-rich .group-standings-table td:first-child,
.groups-grid .group-card-rich .group-standings-table td:nth-child(2) {
  color: #ffffff;
}

.groups-grid .group-card-rich .group-standings-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.group-card-head,
.group-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.group-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.group-print-btn {
  min-width: 138px;
}

.group-clear-btn {
  white-space: nowrap;
  min-width: 148px;
  padding-inline: 18px;
  color: #7a550d;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(245, 231, 199, 0.96));
  border: 1px solid rgba(208, 162, 77, 0.28);
  box-shadow: 0 12px 22px rgba(168, 116, 23, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.group-clear-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 254, 250, 0.99), rgba(248, 236, 207, 0.98));
  box-shadow: 0 16px 28px rgba(168, 116, 23, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.group-clear-btn:disabled {
  color: rgba(122, 85, 13, 0.5);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.86), rgba(240, 232, 216, 0.86));
  border-color: rgba(208, 162, 77, 0.12);
  box-shadow: none;
}

.group-summary-grid {
  margin-top: 0;
}

.group-filter-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(76, 61, 25, 0.12);
  background: rgba(255, 252, 246, 0.72);
}

.side-group-filter-panel {
  margin-top: 14px;
}

.main-participant-roster-panel {
  margin: 16px 0 18px;
}

.main-participant-roster-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(23, 105, 194, 0.12);
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.98), rgba(236, 245, 255, 0.94));
  box-shadow: 0 14px 26px rgba(18, 55, 94, 0.08);
}

.main-participant-roster-card .panel-head {
  margin-bottom: 0;
}

.main-participant-roster-card .context-banner {
  margin-bottom: 0;
}

.main-roster-stack {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(360px, 1.18fr);
  gap: 16px;
  align-items: start;
}

.main-roster-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.main-roster-grid .field {
  min-width: 0;
}

.main-roster-grid textarea {
  min-height: 120px;
}

.main-action-stack {
  display: flex;
  width: 100%;
  gap: 8px;
}

.main-action-stack .btn {
  flex: 1 1 150px;
}

.main-roster-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}

.side-group-filter-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(23, 105, 194, 0.12);
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.98), rgba(236, 245, 255, 0.94));
  box-shadow: 0 14px 26px rgba(18, 55, 94, 0.08);
}

.side-group-filter-card .group-filter-row {
  flex-direction: column;
  align-items: flex-start;
}

.side-group-filter-card .group-filter-actions {
  width: 100%;
  justify-content: flex-start;
}

.side-group-filter-card .group-filter-actions .group-print-btn {
  width: 100%;
}

.group-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}

.group-filter-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.group-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.side-menu.is-collapsed .side-group-filter-panel {
  display: none !important;
}

.player-swap-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(18, 92, 156, 0.16);
  background: linear-gradient(180deg, rgba(239, 248, 255, 0.96), rgba(223, 239, 255, 0.88));
  box-shadow: 0 14px 24px rgba(28, 83, 147, 0.08);
}

.player-swap-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.player-swap-panel-head strong {
  display: block;
  font-size: 1.02rem;
  color: var(--ink);
}

.player-swap-panel .form-grid {
  align-items: end;
}

.chip-button {
  appearance: none;
  cursor: pointer;
  font: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.chip-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(13, 90, 96, 0.08);
}

.group-block {
  display: grid;
  gap: 10px;
}

.group-print-overlay {
  position: fixed;
  inset: 18px;
  z-index: 110;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
  background: rgba(8, 25, 42, 0.46);
  backdrop-filter: blur(6px);
  overflow: auto;
}

.group-print-screen-toolbar {
  width: min(100%, 190mm);
  margin: 0 auto;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(23, 105, 194, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 34px rgba(18, 55, 94, 0.16);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.group-print-sheet {
  width: min(100%, 190mm);
  min-height: 277mm;
  margin: 0 auto;
  padding: 9mm 9mm 10mm;
  border-radius: 18px;
  background: #ffffff;
  color: #111111;
  box-shadow: 0 24px 48px rgba(7, 19, 34, 0.22);
}

.group-print-sheet + .group-print-sheet {
  margin-top: 14px;
}

.group-print-sheet .section-kicker,
.group-print-sheet .small-note {
  color: #505b66;
}

.group-print-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.group-print-sheet-head h3 {
  font-size: 30px;
  color: #111111;
}

.group-print-chip-row {
  justify-content: flex-end;
}

.group-print-players-block {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.group-print-players-block strong {
  font-size: 15px;
  color: #111111;
}

.group-print-players-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin: 0;
  padding-left: 20px;
}

.group-print-players-list li {
  color: #111111;
  font-size: 13px;
  line-height: 1.35;
  display: grid;
  grid-template-columns: 22px minmax(52px, auto) 1fr;
  gap: 6px;
  align-items: baseline;
}

.group-print-player-short {
  display: inline-block;
  min-width: 22px;
  font-weight: 800;
}

.group-print-player-code {
  display: inline-block;
  min-width: 52px;
  font-weight: 800;
}

.group-print-player-full {
  color: #39444f;
}

.group-print-rules-block {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 12px;
  margin-bottom: 14px;
}

.group-print-rules-copy,
.group-print-rounds-block {
  border: 1px solid #1c2e42;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f6fbff 0%, #edf5ff 100%);
}

.group-print-rules-copy strong,
.group-print-rounds-block strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #12263b;
}

.group-print-rules-list,
.group-print-rounds-list {
  margin: 0;
  padding-left: 18px;
  color: #1b2e40;
  font-size: 12px;
  line-height: 1.45;
}

.group-print-rounds-list li + li {
  margin-top: 4px;
}

.group-print-round-label {
  font-weight: 800;
}

.group-print-round-bye {
  display: inline-block;
  margin-left: 8px;
  font-weight: 700;
  color: #1b5f7e;
}

.group-print-round-writer {
  display: inline-block;
  margin-left: 8px;
  font-weight: 800;
  color: #6c4b10;
}

.group-print-table-wrap {
  overflow: visible;
}

.group-print-matrix-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  line-height: 1.12;
}

.group-print-matrix-table th,
.group-print-matrix-table td {
  box-sizing: border-box;
  height: 13.5mm;
  padding: 0 3px;
  border: 1px solid #1a1a1a;
  text-align: center;
  vertical-align: middle;
  color: #111111;
  background: #ffffff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.group-print-matrix-table thead th {
  height: 13.5mm;
  padding: 0 2px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.08;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.group-print-matrix-table th:first-child {
  width: 24mm;
}

.group-print-matrix-table thead th:first-child {
  text-align: center;
}

.group-print-matrix-table tbody th:first-child {
  text-align: left;
  font-size: 11px;
  line-height: 1.14;
}

.group-print-score {
  font-weight: 800;
  font-size: 14px;
}

.group-print-matrix-table td.group-print-diag,
.group-print-diag {
  background: #0f0f10 !important;
  color: #0f0f10 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ko-print-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.ko-print-sheet-head {
  margin-bottom: 0;
}

.ko-print-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ko-print-summary-card {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #1c2e42;
  border-radius: 10px;
  background: #f6fbff;
  color: #111111;
  min-width: 0;
}

.ko-print-summary-card span {
  color: #505b66;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ko-print-summary-card strong {
  color: #111111;
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ko-print-status {
  padding: 7px 10px;
  border: 1px solid #1c2e42;
  border-radius: 10px;
  background: #fffaf0;
  color: #1b2e40;
  font-size: 11px;
  font-weight: 800;
}

.ko-print-bracket {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--ko-print-rounds, 3), minmax(0, 1fr));
  gap: 7px;
  align-items: stretch;
}

.ko-print-round {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
}

.ko-print-round-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #1c2e42;
  border-radius: 9px;
  background: #eaf4ff;
  color: #111111;
}

.ko-print-round-head strong,
.ko-print-round-head span {
  font-size: 10px;
  line-height: 1.2;
}

.ko-print-round-head strong {
  overflow-wrap: anywhere;
}

.ko-print-round-head span {
  font-weight: 900;
  white-space: nowrap;
}

.ko-print-match-list {
  display: grid;
  gap: 5px;
  align-content: start;
  min-height: 0;
}

.ko-print-match {
  display: grid;
  gap: 4px;
  padding: 5px;
  border: 1px solid #1a1a1a;
  border-radius: 9px;
  background: #ffffff;
  color: #111111;
  break-inside: avoid;
  page-break-inside: avoid;
}

.ko-print-match-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  color: #111111;
}

.ko-print-match-head span {
  color: #505b66;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ko-print-match-head strong {
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.ko-print-team {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid #c6d2df;
  border-radius: 7px;
  background: #f8fbff;
  color: #111111;
}

.ko-print-team.is-ready {
  border-color: #688dac;
  background: #f4fbff;
}

.ko-print-team.is-winner {
  border-color: #5a8f68;
  background: #e4f3e8;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ko-print-team.is-loser {
  border-color: #b77a75;
  background: #f7e2e0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ko-print-seed {
  color: #505b66;
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ko-print-team strong {
  color: #111111;
  font-size: 10px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.ko-print-team span:not(.ko-print-seed) {
  color: #39444f;
  font-size: 8px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ko-print-vs {
  color: #505b66;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.ko-print-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid #1c2e42;
  border-radius: 12px;
  background: #f6fbff;
  color: #111111;
}

.group-standings-table td:first-child,
.group-standings-table td:nth-child(2),
.rr-table th:first-child {
  font-weight: 800;
}

.rr-table {
  min-width: 720px;
}

.rr-table th,
.rr-table td {
  text-align: center;
  vertical-align: middle;
}

.rr-table thead th {
  min-width: 74px;
}

.rr-table th:first-child {
  text-align: left;
  min-width: 250px;
}

.rr-diag {
  background: rgba(13, 90, 96, 0.06);
}

.rr-diag {
  color: var(--muted);
}

.rr-edit {
  background: rgba(255, 255, 255, 0.55);
}

.rr-edit-cell {
  padding: 6px 4px;
}

.rr-team-header {
  vertical-align: top !important;
}

.rr-team-header-main {
  margin-bottom: 8px;
}

.rr-team-swap-inline {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(23, 105, 194, 0.14);
  background: rgba(236, 246, 255, 0.92);
}

.rr-team-swap-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.rr-team-swap-row {
  display: grid;
  grid-template-columns: minmax(52px, auto) minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
}

.rr-team-swap-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--teal-deep);
}

.rr-team-swap-select {
  min-width: 0;
  width: 100%;
  height: 30px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(23, 105, 194, 0.18);
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  font-size: 12px;
}

.rr-team-swap-btn {
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(220, 236, 255, 0.96));
  border: 1px solid rgba(23, 105, 194, 0.18);
}

.score-cell-editor {
  display: grid;
  grid-template-columns: minmax(44px, 56px) 20px;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto;
}

.score-cell-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-cell-stepper {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.score-stepper {
  display: grid;
  grid-template-columns: 26px minmax(84px, 104px) 26px;
  gap: 6px;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border: 1px solid rgba(55, 67, 45, 0.18);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(243, 248, 255, 0.94));
}

.score-stepper:focus-within {
  border-color: rgba(14, 90, 96, 0.58);
  box-shadow: 0 0 0 4px rgba(14, 90, 96, 0.12);
}

.score-stepper.is-disabled {
  opacity: 0.66;
}

.score-stepper-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.score-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  justify-content: center;
}

.score-input-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  min-width: 220px;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(122, 76, 8, 0.16);
  background: rgba(255, 244, 216, 0.98);
  box-shadow: 0 14px 28px rgba(48, 34, 8, 0.16);
  color: var(--warn-ink);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 12;
}

.score-input-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 12px;
  height: 12px;
  background: rgba(255, 244, 216, 0.98);
  border-right: 1px solid rgba(122, 76, 8, 0.16);
  border-bottom: 1px solid rgba(122, 76, 8, 0.16);
  transform: translateX(-50%) rotate(45deg);
}

.score-input-wrap:hover .score-input-tooltip,
.score-input-wrap:focus-within .score-input-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.score-step-btn {
  width: 100%;
  height: 18px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(14, 90, 96, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(228, 240, 236, 0.9));
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.score-step-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(13, 90, 96, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(234, 244, 241, 0.96));
}

.score-step-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.score-step-btn-compact {
  width: 20px;
  height: 18px;
  border-radius: 8px;
  font-size: 12px;
}

.rr-score-input,
.rr-cell-score-input,
.match-editor-input {
  min-width: 0;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: none;
  background: transparent;
  padding: 0 2px;
  box-shadow: none;
}

.rr-score-input {
  width: 100%;
  margin: 0;
}

.rr-cell-score-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 4px;
  border-radius: 12px;
  border: 1px solid rgba(55, 67, 45, 0.18);
  background: rgba(255, 252, 246, 0.98);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1;
}

.rr-cell-score-input:focus {
  border-color: rgba(14, 90, 96, 0.48);
  box-shadow: 0 0 0 3px rgba(14, 90, 96, 0.1);
}

.score-stepper .rr-score-input:focus,
.score-stepper .match-editor-input:focus,
.score-stepper .ko-score-input:focus {
  border-color: transparent;
  box-shadow: none;
}

.match-editor-list {
  display: grid;
  gap: 10px;
}

.match-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(76, 61, 25, 0.12);
  background: rgba(255, 255, 255, 0.52);
}

.match-editor-row.is-complete {
  border-color: rgba(14, 90, 96, 0.24);
  background: rgba(221, 241, 238, 0.7);
}

.match-editor-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  line-height: 1.4;
}

.match-editor-teams span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-editor-team {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.match-editor-team.is-winner {
  color: #1f6a4e;
  border-color: rgba(43, 127, 84, 0.24);
  background: rgba(224, 245, 230, 0.82);
}

.ko-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.ko-rounds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.ko-round-column {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(46, 108, 188, 0.16);
  background:
    radial-gradient(circle at top left, rgba(66, 154, 255, 0.18), transparent 42%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(180deg, rgba(248, 252, 255, 0.99), rgba(231, 242, 255, 0.96));
  box-shadow: 0 18px 32px rgba(25, 69, 132, 0.12);
}

.ko-round-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.ko-round-match-list {
  display: grid;
  gap: 14px;
}

.ko-match-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(76, 61, 25, 0.12);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(246, 238, 219, 0.96));
}

.ko-match-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.ko-match-head > .chip.gold {
  padding: 10px 16px;
  font-size: 1rem;
  line-height: 1;
  background: rgba(34, 111, 196, 0.14);
  color: #1f5da8;
  border-color: rgba(34, 111, 196, 0.24);
}

.ko-side {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(76, 61, 25, 0.1);
  background: rgba(255, 255, 255, 0.56);
}

.ko-side.is-ready {
  border-color: rgba(14, 90, 96, 0.2);
  background: rgba(221, 241, 238, 0.72);
}

.ko-side.is-winner {
  color: #1f6a4e;
  border-color: rgba(43, 127, 84, 0.5);
  background: linear-gradient(180deg, rgba(226, 246, 234, 0.98), rgba(199, 231, 214, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.ko-side.is-loser {
  color: #9f3b3b;
  border-color: rgba(176, 78, 78, 0.46);
  background: linear-gradient(180deg, rgba(253, 235, 233, 0.98), rgba(243, 211, 208, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.ko-seed {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.ko-vs {
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sand-deep);
}

.ko-score-row {
  display: grid;
  gap: 8px;
}

.ko-score-input {
  width: 100%;
  max-width: none;
  text-align: center;
  font-weight: 800;
}

.scoring-table td:first-child,
.leaderboard-table td:nth-child(2) {
  font-weight: 800;
}

.manual-input {
  min-width: 88px;
}

.registry-text-input {
  min-width: 180px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.94rem;
  line-height: 1.2;
}

.registry-add-form {
  margin: 16px 0 18px;
  align-items: end;
}

.registry-add-btn {
  width: 100%;
}

.registry-bulk-form {
  margin: 0 0 18px;
  align-items: start;
}

.registry-bulk-input {
  min-height: 116px;
  resize: vertical;
}

.registry-bulk-actions {
  justify-content: flex-start;
}

.registry-bulk-note {
  margin-top: 10px;
}

.registry-points-input {
  width: 112px;
  min-width: 96px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.94rem;
  line-height: 1.2;
}

.registry-points-grid {
  display: grid;
  gap: 18px;
}

.registry-points-card .card-title {
  font-size: 20px;
}

.registry-points-card.is-collapsed {
  padding-bottom: 18px;
}

.registry-collapse-chip {
  cursor: pointer;
  border: 0;
}

.registry-points-table-wrap[hidden] {
  display: none;
}

.debug-settings-grid {
  align-items: end;
}

.debug-toggle-field {
  display: grid;
  gap: 10px;
}

.debug-toggle-pill {
  justify-self: start;
  min-width: 116px;
}

.debug-logo-upload {
  display: grid;
  gap: 12px;
}

.debug-logo-preview {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  border: 1px dashed rgba(21, 81, 146, 0.22);
  background: linear-gradient(180deg, rgba(239, 247, 255, 0.9), rgba(226, 239, 255, 0.9));
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 18px;
}

.debug-logo-preview img {
  max-width: 100%;
  max-height: 116px;
  object-fit: contain;
  display: block;
}

.debug-logo-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.debug-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.debug-option-card {
  display: grid;
  align-content: space-between;
  gap: 16px;
  min-height: 168px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(28, 94, 171, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.94));
}

.debug-option-card strong {
  display: block;
  font-size: 16px;
}

.debug-option-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.debug-option-card .action-row {
  margin-top: 0;
}

.debug-splash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.debug-danger-zone {
  border-color: rgba(185, 38, 52, 0.22);
  background: linear-gradient(180deg, rgba(255, 248, 249, 0.98), rgba(255, 231, 235, 0.9));
}

.database-summary-grid {
  margin-top: 16px;
}

.database-note-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(35, 92, 157, 0.14);
  background: linear-gradient(180deg, rgba(241, 247, 255, 0.95), rgba(228, 239, 255, 0.92));
  color: var(--ocean-deep);
}

.database-note-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.database-note-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.database-active-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(35, 92, 157, 0.16);
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(228, 240, 255, 0.94));
}

.database-active-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.database-active-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.database-table-select-field {
  min-width: 240px;
}

.database-edit-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

.database-edit-table {
  min-width: 860px;
}

.database-cell-input {
  width: 100%;
  min-width: 120px;
  padding: 7px 9px;
  border-radius: 10px;
}

.database-primary-value {
  display: inline-block;
  min-width: 64px;
  font-weight: 900;
}

.database-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.database-insert-row {
  background: rgba(224, 241, 255, 0.42);
}

.mini-btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.database-query-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.database-query-textarea {
  min-height: 160px;
  resize: vertical;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.database-query-actions {
  display: grid;
  gap: 12px;
  align-content: start;
}

.database-query-actions small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.database-result-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(35, 92, 157, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 255, 0.96));
}

.database-table-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.database-table-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(35, 92, 157, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 248, 255, 0.95));
  box-shadow: 0 16px 30px rgba(24, 63, 115, 0.08);
}

.database-columns-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.database-null,
.database-empty {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.database-null {
  color: #7a879c;
}

.database-empty {
  color: #9c7a35;
}

.database-json-preview {
  min-height: 420px;
  resize: vertical;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 960px) {
  .database-active-card {
    display: grid;
  }

  .database-active-actions {
    justify-content: flex-start;
  }

  .database-query-grid {
    grid-template-columns: 1fr;
  }
}

#page-player-registry th,
#page-player-registry td {
  padding-top: 5px;
  padding-bottom: 5px;
  vertical-align: middle;
}

#page-player-registry .registry-text-input {
  min-width: 160px;
}

#page-player-registry table {
  font-size: 0.95rem;
}

.ko-category-note {
  min-width: 220px;
  line-height: 1.45;
}

.breakdown-cell {
  min-width: 320px;
  line-height: 1.45;
}

.result-select {
  min-width: 170px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 90, 96, 0.08);
  color: var(--teal-deep);
  font-weight: 800;
  font-size: 12px;
}

@keyframes flowSweep {
  0% {
    transform: translateX(-135%);
  }
  60% {
    transform: translateX(135%);
  }
  100% {
    transform: translateX(135%);
  }
}

@media (max-width: 1200px) {
  .workspace-shell,
  .workspace-shell.is-side-collapsed {
    grid-template-columns: 1fr;
  }

  .side-menu,
  .side-menu.is-collapsed {
    position: static;
    padding: 16px;
  }

  .side-menu-head,
  .side-menu.is-collapsed .side-menu-head {
    justify-content: space-between;
  }

  .side-menu-head > div,
  .side-menu.is-collapsed .side-menu-head > div,
  .side-nav-copy,
  .side-menu.is-collapsed .side-nav-copy {
    display: block;
  }

  .side-menu-toggle,
  .side-menu.is-collapsed .side-menu-toggle {
    width: 42px;
  }

  .side-menu-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-nav-btn,
  .side-menu.is-collapsed .side-nav-btn {
    grid-template-columns: 42px minmax(0, 1fr);
    justify-items: stretch;
    min-height: 80px;
    gap: 12px;
    padding: 16px 14px;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1 / -1;
  }

  .tabbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabbar::before,
  .tabbar::after {
    display: none;
  }

  .participant-picker-toolbar {
    grid-template-columns: 1fr;
  }

  .participant-picker-summary {
    justify-content: flex-start;
  }

  .main-roster-stack {
    grid-template-columns: 1fr;
  }

  .main-roster-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  body {
    padding: 14px;
  }

  .hero {
    flex-direction: column;
    padding: 20px;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .side-menu-nav {
    grid-template-columns: 1fr;
  }

  .tabbar {
    top: 10px;
    grid-template-columns: 1fr;
  }

  .context-banner {
    flex-direction: column;
  }

  .chip-row {
    justify-content: flex-start;
  }

  .group-card-head,
  .group-block-head {
    flex-direction: column;
  }

  .group-card-actions,
  .group-print-screen-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .group-print-players-list {
    grid-template-columns: 1fr;
  }

  .group-print-rules-block {
    grid-template-columns: 1fr;
  }

  .group-filter-row {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .match-editor-row {
    grid-template-columns: 1fr;
  }

  .group-clear-btn,
  .match-editor-input {
    width: 100%;
  }

  .main-participant-roster-card {
    padding: 18px;
  }

  .main-action-stack {
    display: grid;
  }

  .main-action-stack .btn {
    width: 100%;
  }

  .ko-match-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  html,
  body {
    width: auto;
    min-height: auto;
    padding: 0;
    margin: 0;
    background: #ffffff !important;
  }

  body.has-group-print-preview .hero,
  body.has-group-print-preview #message-bar,
  body.has-group-print-preview .side-menu,
  body.has-group-print-preview .tabbar,
  body.has-group-print-preview .panel > :not(.group-print-overlay) {
    display: none !important;
  }

  body.has-group-print-preview .shell,
  body.has-group-print-preview .workspace-shell,
  body.has-group-print-preview .workspace-main,
  body.has-group-print-preview .pages,
  body.has-group-print-preview .page,
  body.has-group-print-preview .page-grid,
  body.has-group-print-preview .panel {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .group-print-overlay {
    position: static;
    inset: 0;
    display: block;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    overflow: visible;
  }

  .group-print-screen-toolbar {
    display: none !important;
  }

  .group-print-sheet {
    box-sizing: border-box;
    width: calc(100% - 2mm);
    max-width: 188mm;
    min-height: 0;
    height: 276mm;
    max-height: 276mm;
    margin: 0 auto;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: page;
    page-break-after: always;
  }

  .group-print-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .group-print-sheet + .group-print-sheet {
    margin-top: 0;
  }

  .group-print-table-wrap {
    box-sizing: border-box;
    padding: 0 0.4mm;
  }

  .ko-print-sheet {
    gap: 5px;
  }

  .ko-print-summary {
    gap: 5px;
  }

  .ko-print-summary-card,
  .ko-print-status {
    padding: 5px 7px;
  }

  .ko-print-bracket {
    gap: 5px;
  }

  .ko-print-match-list {
    gap: 4px;
  }

  .ko-print-match {
    padding: 4px;
  }
}
