:root {
  --bg: #05060f;
  --bg-top: #0b1021;
  --bg-mid: #05060f;
  --panel: rgba(18, 23, 38, 0.86);
  --panel-border: rgba(120, 144, 176, 0.18);
  --muted: #a5b4cf;
  --text: #f5f7fb;
  --text-soft: rgba(230, 234, 246, 0.7);
  --accent: #f4b860;
  --accent-strong: #ffdc8f;
  --accent-glow: rgba(244, 184, 96, 0.45);
  --danger: #f87171;
  --warn: #facc15;
  --ok: #4ade80;
  --card: #11182a;
  --border: #1f2a44;
  --chip: #162036;
  --shadow: 0 26px 60px rgba(6, 7, 13, 0.65);
  --shadow-soft: 0 16px 38px rgba(10, 12, 20, 0.45);
  --radius: 20px;
  --ink: #090c18;
  --gradient-royal: linear-gradient(
    135deg,
    #1c2744 0%,
    #10182c 55%,
    rgba(11, 15, 26, 0.92) 100%
  );
  --gradient-gold: linear-gradient(
    120deg,
    #f4b860 0%,
    #fcd79d 45%,
    #f6c169 100%
  );
  --gradient-emerald: linear-gradient(
    135deg,
    #1b3a4b 0%,
    #174541 55%,
    #0f2f2b 100%
  );
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  background: var(--bg);
}
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", Roboto, Inter, system-ui,
    sans-serif;
  background: radial-gradient(
      circle at 22% -10%,
      rgba(244, 184, 96, 0.16),
      transparent 42%
    ),
    radial-gradient(
      circle at 85% 12%,
      rgba(73, 110, 255, 0.18),
      transparent 55%
    ),
    linear-gradient(160deg, var(--bg-top) 0%, var(--bg-mid) 55%, #03040c 100%);
  color: var(--text);
  letter-spacing: 0.01em;
  overflow: auto;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      circle at 15% 18%,
      rgba(244, 184, 96, 0.1),
      transparent 54%
    ),
    radial-gradient(
      circle at 88% 4%,
      rgba(107, 143, 255, 0.12),
      transparent 52%
    );
  mix-blend-mode: screen;
  opacity: 0.65;
}
body.app-page,
body.display-mode {
  background: linear-gradient(
    160deg,
    var(--bg-top) 0%,
    var(--bg-mid) 55%,
    #03040c 100%
  );
  overflow: hidden;
}
body.display-mode::before {
  opacity: 0;
}
.app-page .container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px 28px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  position: relative;
}
.app-page .container::after {
  content: "";
  position: absolute;
  inset: 32px;
  border-radius: calc(var(--radius) * 1.2);
  border: 1px solid rgba(244, 184, 96, 0.08);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.35;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: rgba(12, 16, 28, 0.55);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(
    135deg,
    rgba(244, 184, 96, 0.65),
    rgba(169, 132, 255, 0.45)
  );
  border-radius: 999px;
  border: 2px solid rgba(8, 10, 18, 0.6);
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    135deg,
    rgba(244, 184, 96, 0.85),
    rgba(169, 132, 255, 0.55)
  );
}
.row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(24px);
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    150deg,
    rgba(244, 184, 96, 0.12) 0%,
    rgba(104, 169, 255, 0.08) 45%,
    transparent 100%
  );
  opacity: 0.85;
}
.panel > * {
  position: relative;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
  gap: 16px;
  flex-wrap: wrap;
}
.panel-heading-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
  min-width: 0;
}
.panel-heading-tools {
  display: flex;
  flex-direction: row;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  min-width: 260px;
  flex-wrap: wrap;
}
/* Keep Teams panel header controls on one line (wide view) */
.teams-panel .panel-header .panel-heading-tools {
  flex-wrap: nowrap;
  align-items: center;
}
.teams-panel .panel-header .filter-group {
  flex: 1 1 auto;
  align-items: center;
}
.teams-panel .panel-header .bulk-action-group {
  flex: 0 1 auto;
  align-items: center;
}
/* Keep Teams panel controls on a single row */
.teams-panel .panel-header .panel-heading-tools {
  flex-wrap: nowrap;
  align-items: center;
}
.panel-heading-tools .filter-group {
  margin-right: auto;
  justify-content: flex-start;
}
.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.bulk-action-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.panel-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.28px;
  color: var(--text);
  text-transform: uppercase;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.panel-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.5;
  max-width: 560px;
}
.panel-body {
  padding: 18px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.overview-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 32px;
  background: radial-gradient(
      circle at 12% 16%,
      rgba(244, 184, 96, 0.18),
      transparent 32%
    ),
    var(--panel);
}
.overview-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.overview-primary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.primary-actions .btn {
  height: 44px;
  font-size: 13px;
  padding: 0 18px;
}
.overview-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  flex: 1;
}
/* Adjust metric widths on wide screens: widen Last Allocation by ~33%, shrink Score Mode by ~33% */
@media (min-width: 980px) {
  .metrics-grid {
    grid-template-columns: 1fr 1.33fr 0.67fr;
  }
}

.metric {
  position: relative;
  background: linear-gradient(
    160deg,
    rgba(11, 18, 33, 0.92) 0%,
    rgba(17, 26, 44, 0.82) 100%
  );
  border: 1px solid rgba(244, 184, 96, 0.18);
  border-radius: 18px;
  height: 44px; /* match search input height */
  padding: 0 14px; /* remove vertical padding to keep 44px total */
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  box-shadow: var(--shadow-soft);
}
.metric::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(
    145deg,
    rgba(244, 184, 96, 0.18),
    rgba(80, 115, 235, 0.12),
    transparent 68%
  );
  opacity: 0.6;
  pointer-events: none;
}
.metric-label {
  font-size: 11px;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: var(--text-soft);
}
.metric-value {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
.metric-caption {
  font-size: 11px;
  color: rgba(229, 233, 246, 0.7);
}
.metric-content {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
  text-align: left;
}
.metric-content .metric-value {
  font-weight: 700;
  text-align: left;
}
.metric-content .metric-caption {
  text-align: left;
}
.search-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
}
.search-input-wrap {
  position: relative;
}
.search-input-wrap input {
  width: 100%;
  padding-left: 42px;
  height: 44px;
  border-radius: 14px;
  background: rgba(16, 24, 38, 0.78);
  box-shadow: inset 0 0 0 1px rgba(122, 148, 186, 0.22);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.search-input-wrap input:hover {
  box-shadow: inset 0 0 0 1px rgba(244, 184, 96, 0.32);
}
.search-input-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(244, 184, 96, 0.18),
    inset 0 0 0 1px rgba(244, 184, 96, 0.45);
  background: rgba(18, 26, 42, 0.94);
}
.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
}
.icon-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gradient-gold);
  mask: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.742 10.344h-.646l-.228-.22a4.471 4.471 0 001.086-2.94A4.5 4.5 0 107.5 11.5c1.117 0 2.142-.41 2.94-1.086l.22.228v.646l3.5 3.492 1.052-1.052-3.472-3.384zm-4.242 0C6.012 10.344 4.5 8.832 4.5 7s1.512-3.344 3.344-3.344S11.188 5.168 11.188 7 9.676 10.344 7.5 10.344z' fill='%23fff'/%3E%3C/svg%3E")
    center/contain no-repeat;
  opacity: 0.78;
}
.field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.48px;
  text-transform: uppercase;
  color: rgba(236, 240, 255, 0.62);
  font-weight: 600;
}
.field-label input,
.field-label textarea,
.field-label select {
  margin-top: 4px;
}
.field-help {
  margin: 0;
  font-size: 12px;
  color: rgba(222, 229, 247, 0.5);
  line-height: 1.45;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(244, 184, 96, 0.35),
    transparent
  );
  margin: 6px 0 2px;
}
.section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.32px;
  color: rgba(244, 184, 96, 0.82);
  text-transform: uppercase;
}
.input-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.input-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.template-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.template-row .button-row {
  justify-content: flex-start;
}
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.control-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding-bottom: 6px;
}
.control-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  padding-bottom: 4px;
  transition: grid-template-columns 0.24s ease, gap 0.24s ease;
}
.control-layout.expanded {
  grid-template-columns: minmax(0, 1fr) 80px;
}
.control-layout.expanded .setup-panel .panel-body {
  display: none;
}
.control-layout.expanded .setup-panel {
  overflow: hidden;
}
.panel-heading-tools .bulk-action-group {
  margin-left: auto;
  justify-content: flex-end;
  gap: 8px;
}
.teams-panel .panel-body {
  padding-top: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
}
.teams-panel .panel-header {
  padding-bottom: 6px;
}
.setup-panel .panel-body {
  flex: 1;
  overflow: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
/* ------------------------
   Teams panel compact controls
   ------------------------ */
.teams-panel .filter-group {
  gap: 6px;
}
.teams-panel .filter-group .chip-btn {
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.teams-panel .bulk-action-group {
  gap: 6px;
  align-items: center;
}
/* Ensure action chips match filter chip height without altering filter chips */
.teams-panel .bulk-action-group .chip-btn {
  padding: 7px 16px;
  font-size: 13px;
  white-space: nowrap;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.teams-panel .panel-header .panel-heading-tools {
  gap: 10px;
  flex-wrap: nowrap;
}
.teams-panel .panel-header .filter-group,
.teams-panel .panel-header .bulk-action-group {
  flex: 0 1 auto;
}

/* Thin rail label visible when expanded */
.control-layout.expanded .setup-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  height: 100%;
}
.control-layout.expanded .setup-panel .panel-header .panel-subtitle {
  display: none;
}

/* Setup & Import spacing adjustments */
.setup-panel .panel-body {
  gap: 10px;
}
.setup-panel .form-group {
  margin-bottom: 8px;
}
.setup-panel .form-divider {
  margin: 4px 0 0;
}

/* Accordion bodies */
.acc-body[hidden] {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}
.acc-body {
  transition: max-height 0.24s ease, opacity 0.2s ease;
}
.acc-body.open {
  max-height: 1200px;
  opacity: 1;
}
.acc-toggle {
  cursor: pointer;
}

/* Toggle row for display options */
.toggle-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Allow wrapping on smaller windows */
@media (max-width: 1024px) {
  .teams-panel .panel-header .panel-heading-tools {
    flex-wrap: wrap;
  }
}
.setup-panel .form-group {
  margin-bottom: 12px;
  background: rgba(14, 20, 34, 0.65);
  border: 1px solid rgba(109, 130, 170, 0.22);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 14px 26px rgba(6, 9, 16, 0.32);
}
.setup-panel .form-group .field-label {
  color: rgba(236, 240, 255, 0.7);
}
.setup-panel .form-divider {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(244, 184, 96, 0.25),
    transparent
  );
}
.table-wrap {
  margin-top: 4px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(109, 130, 170, 0.24);
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    rgba(13, 19, 32, 0.9),
    rgba(8, 10, 18, 0.92)
  );
  box-shadow: inset 0 1px 0 rgba(244, 184, 96, 0.12),
    0 20px 32px rgba(6, 8, 15, 0.55);
}
input,
button,
select,
textarea {
  background: rgba(15, 22, 36, 0.78);
  border: 1px solid rgba(126, 152, 188, 0.28);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background 0.18s ease;
}
input::placeholder,
textarea::placeholder {
  color: rgba(215, 224, 245, 0.45);
  letter-spacing: 0.02em;
}
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(244, 184, 96, 0.45);
  box-shadow: 0 0 0 3px rgba(244, 184, 96, 0.18);
  background: rgba(18, 26, 42, 0.92);
}
button {
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid rgba(244, 184, 96, 0.28);
  background: linear-gradient(
    135deg,
    rgba(28, 39, 68, 0.98),
    rgba(16, 24, 40, 0.92)
  );
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
  border-radius: 14px;
  text-transform: uppercase;
  font-size: 12px;
  text-decoration: none;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(9, 12, 22, 0.48);
  border-color: rgba(244, 184, 96, 0.45);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn.primary {
  background: var(--gradient-royal);
  border-color: rgba(109, 142, 255, 0.38);
  color: #f6f8ff;
}
.btn.accent {
  background: var(--gradient-gold);
  border-color: rgba(244, 184, 96, 0.6);
  color: #1b1204;
  box-shadow: 0 16px 30px rgba(244, 184, 96, 0.35);
}
.btn.danger {
  background: linear-gradient(135deg, #3b0f13, #1f080a);
  border-color: rgba(248, 113, 113, 0.42);
  color: #fee2e2;
}
.btn.ghost {
  background: rgba(13, 20, 32, 0.4);
  border-color: rgba(109, 127, 165, 0.3);
}
.btn.subtle {
  padding: 8px 14px;
  height: auto;
  font-size: 12px;
  text-transform: none;
  border-radius: 12px;
}
.btn.ghost.subtle {
  border-color: rgba(132, 152, 189, 0.25);
  background: rgba(16, 23, 36, 0.55);
}
.btn.ghost.subtle:hover {
  border-color: rgba(208, 220, 248, 0.35);
  box-shadow: 0 14px 24px rgba(7, 10, 18, 0.32);
}
.chip-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  background: rgba(20, 29, 47, 0.7);
  color: rgba(235, 239, 252, 0.78);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.16s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chip-btn:hover {
  background: rgba(28, 40, 64, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(9, 12, 22, 0.32);
}
.chip-btn.active {
  background: var(--gradient-gold);
  color: #1b1204;
  box-shadow: 0 16px 28px rgba(244, 184, 96, 0.4);
}
.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(12, 16, 28, 0.7);
  font-size: 12px;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.74);
}
.chip-btn.active .chip-count {
  background: rgba(17, 11, 4, 0.18);
  color: #1b1204;
  font-weight: 700;
}
.pill {
  background: rgba(16, 25, 40, 0.75);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(235, 238, 251, 0.75);
  box-shadow: inset 0 0 0 1px rgba(109, 130, 170, 0.25);
}
.muted {
  color: var(--muted);
}
.grid {
  display: grid;
  gap: 12px;
}
.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1200;
  backdrop-filter: blur(12px);
  background: rgba(5, 7, 14, 0.82);
  border-bottom: 1px solid rgba(244, 184, 96, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 0 28px;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.brand-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 14px;
}

.brand-sub {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(235, 240, 255, 0.65);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(235, 240, 255, 0.75);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-cta .btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
}

.nav-cta .btn.primary {
  min-width: 132px;
}

.nav-cta .btn.ghost {
  border: 1px solid rgba(244, 184, 96, 0.35);
}

.nav-sticky {
  position: sticky;
}

.site-footer {
  padding: 18px 24px 24px;
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  opacity: 0.9;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Announcement overlay */
.announce {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;
  pointer-events: none;
}
.announce.hidden {
  display: none;
}
.announce.announce-active {
  display: grid !important;
}
.announce.hidden.announce-active {
  display: grid !important;
}
.announce-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}
.announce-card {
  position: relative;
  pointer-events: auto;
  min-width: min(92vw, 980px);
  max-width: 96vw;
  padding: 24px 40px;
  border-radius: 20px;
  background: linear-gradient(180deg, #2b1e01, #1e1504);
  border: 1px solid rgba(244, 184, 96, 0.5);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(244, 184, 96, 0.25);
  color: #fff7e5;
  text-align: center;
  transform: translateY(0) scale(1);
  opacity: 1;
}
/* Eye-catching, readable font */
.announce-text {
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-family: Impact, "Arial Black", "Bebas Neue", Oswald, Anton, Inter,
    system-ui, sans-serif;
  font-size: clamp(32px, 6vw, 72px);
}
@media (prefers-reduced-motion: reduce) {
  .announce-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Active gold treatment with shimmer and glow */
.announce.announce-active .announce-card {
  --gold1: #a56f0a;
  --gold2: #f9d36a;
  --gold3: #f2b61a;
  --glow: rgba(255, 198, 60, 0.45);
  background: linear-gradient(
    135deg,
    var(--gold1),
    var(--gold2) 40%,
    var(--gold3) 80%
  );
  border-color: #e1b545;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 24px 6px var(--glow);
  opacity: 1;
  animation: ann-pop-in 0.3s ease-out both,
    ann-glow 2.2s ease-in-out infinite 0.3s;
}
.announce.announce-active .announce-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    115deg,
    transparent 25%,
    rgba(255, 255, 255, 0.15) 35%,
    rgba(255, 255, 255, 0.35) 45%,
    rgba(255, 255, 255, 0.15) 55%,
    transparent 65%
  );
  background-size: 300% 300%;
  mix-blend-mode: screen;
  animation: ann-shimmer 2.4s linear infinite;
}
.announce.announce-active .announce-text {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
@keyframes ann-pop-in {
  0% {
    transform: translateY(12px) scale(0.96);
    opacity: 0;
  }
  60% {
    transform: translateY(0) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
@keyframes ann-glow {
  0%,
  100% {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 0 0 var(--glow);
  }
  50% {
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.6), 0 0 24px 10px var(--glow);
  }
}
@keyframes ann-shimmer {
  0% {
    background-position: 120% 0%;
  }
  100% {
    background-position: -20% 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .announce.announce-active .announce-card {
    animation: none;
  }
  .announce.announce-active .announce-card::after {
    animation: none;
  }
}

#displayView {
  min-height: 100svh;
  height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  row-gap: clamp(12px, 2vh, 18px);
  padding: 0 clamp(12px, 2vw, 28px) clamp(10px, 1.2vh, 18px);
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}
.display-wrap {
  position: relative;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--g, 20px);
  box-sizing: border-box;
  padding: 24px clamp(18px, 3vw, 40px);
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  --g: 20px;
  --lh: 110px;
  --rank: 58px;
  --badge: 84px;
  --fsName: 28px;
  --fsScore: 34px;
  align-items: start;
  align-content: start;
}

.display-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.display-header .seg-toggle.small {
  height: 36px;
  border-radius: 10px;
}
.display-header .seg-toggle.small .seg-btn {
  padding: 0 10px;
  font-size: 12px;
}
.display-title {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: 0.4px;
  margin: 0;
  background: linear-gradient(
    90deg,
    #f8fafc 0%,
    #ffd199 35%,
    #ff8a00 65%,
    #f8fafc 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
}
.subtitle {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--muted);
  margin: 0;
  font-weight: 600;
}

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.top5 {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(5, var(--lh));
  gap: var(--g);
  align-items: stretch;
  padding: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 3;
  min-height: 0;
  height: 100%;
}

/* Grid view */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 4), 1fr);
  gap: 14px;
  min-height: 0;
  height: 100%;
  align-content: stretch;
  justify-items: stretch;
  grid-auto-rows: var(--grid-tile-size, 120px);
  --grid-last-row-shift: 0px;
}
.grid-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(180deg, #0c121a, #0a0f16);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.grid-item.sold {
  filter: grayscale(1) brightness(0.65);
  opacity: 0.6;
}
.grid-badge {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}
/* In the grid, shrink crest placeholders so they match badge footprint
     without altering their shape or styling elsewhere */
.teams-grid .crest {
  width: 80%;
  height: 80%;
  max-width: 80%;
  max-height: 80%;
}
.lane {
  --spin: 0deg;
  position: relative;
  display: grid;
  grid-template-columns: var(--rank) var(--badge) 1fr auto;
  align-items: center;
  gap: var(--g);
  padding: calc(var(--g) * 0.7) calc(var(--g) * 0.9);
  border-radius: 18px;
  background: linear-gradient(180deg, #0c121a, #0a0f16);
  border: 1px solid var(--border);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
  min-height: 0;
  overflow: hidden;
}
.lane::before,
.lane::after {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 0.22;
  transition: transform 920ms cubic-bezier(0.22, 1, 0.36, 1), opacity 920ms ease;
  background-blend-mode: screen;
}
.lane::before {
  background: radial-gradient(
      135% 160% at 20% 24%,
      hsla(var(--h), 88%, 62%, 0.26),
      transparent 68%
    ),
    radial-gradient(
      120% 130% at 78% 18%,
      hsla(calc(var(--h)+36), 86%, 68%, 0.18),
      transparent 72%
    );
}
.lane::after {
  background: radial-gradient(
      140% 150% at 64% 78%,
      hsla(calc(var(--h)+180), 78%, 58%, 0.22),
      transparent 76%
    ),
    radial-gradient(
      120% 140% at 28% 76%,
      rgba(13, 18, 28, 0.65),
      transparent 78%
    );
  opacity: 0.18;
}
.lane.lane-moving::before {
  transform: translate3d(12%, -8%, 0) scale(1.12);
  opacity: 0.36;
}
.lane.lane-moving::after {
  transform: translate3d(-14%, 12%, 0) scale(1.18);
  opacity: 0.3;
}
.lane.lane-just-added::before {
  transform: translate3d(18%, -14%, 0) scale(1.26);
  opacity: 0.46;
}
.lane.lane-just-added::after {
  transform: translate3d(-20%, 16%, 0) scale(1.24);
  opacity: 0.36;
}
.lane > :not(.lane-sweep) {
  position: relative;
  z-index: 1;
}
.lane .lane-sweep {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0) 0%,
    hsla(var(--h), 90%, 72%, 0) 18%,
    hsla(var(--h), 92%, 72%, 0.4) 36%,
    rgba(255, 255, 255, 0.85) 50%,
    hsla(var(--h), 92%, 72%, 0.42) 64%,
    rgba(255, 255, 255, 0) 82%
  );
  transform: translateX(-140%) skewX(-16deg);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 3;
}
.lane .lane-sweep.lane-sweep-active {
  animation: laneSweep 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.lane.lane-just-added .lane-sweep.lane-sweep-active {
  animation-duration: 1150ms;
}
.lane-enter {
  animation: laneEnter 420ms cubic-bezier(0.22, 1, 0.36, 1) both,
    laneGlow 1600ms ease-out;
}
.lane-shift-up {
  animation: laneShiftUp 360ms cubic-bezier(0.3, 1.4, 0.36, 1) both,
    laneGlow 1400ms ease-out;
}
.lane-shift-down {
  animation: laneShiftDown 360ms cubic-bezier(0.3, 1.1, 0.36, 1) both,
    laneGlow 1400ms ease-out;
}
.lane .logo-wrap {
  position: relative;
  width: var(--badge);
  height: var(--badge);
  display: grid;
  place-items: center;
}
.crest {
  width: var(--badge);
  height: var(--badge);
  display: grid;
  place-items: center;
  font-weight: 1000;
  font-size: calc(var(--lh) * 0.22);
  letter-spacing: 0.5px;
  color: #0a0f18;
  background: radial-gradient(circle at 30% 30%, #f3f4f6 0%, #e2e8f0 70%);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04),
    0 12px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid #293241;
}
.badge {
  width: var(--badge);
  height: var(--badge);
  object-fit: contain;
  background: #0b0f14;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04),
    0 12px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid #293241;
}
.lane .lane-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
}
.lane .lane-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.autos-chip {
  font-weight: 900;
  font-size: clamp(14px, calc(var(--lh) * 0.3), 22px);
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 180, 0, 0.25),
    rgba(255, 138, 0, 0.2)
  );
  border: 1px solid rgba(255, 138, 0, 0.6);
  color: #fff7ed;
  letter-spacing: 0.4px;
  box-shadow: 0 8px 20px rgba(255, 138, 0, 0.15);
  white-space: nowrap;
}
.tagline-chip {
  position: relative;
  overflow: visible;
  font-weight: 900;
  font-size: clamp(14px, calc(var(--lh) * 0.3), 22px);
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(132, 145, 255, 0.22),
    rgba(92, 127, 255, 0.18)
  );
  border: 1px solid rgba(92, 127, 255, 0.55);
  color: #eef3ff;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(92, 127, 255, 0.15);
  white-space: nowrap;
}
/* Star marker for tagline chip (slight inset, above border) */
.tagline-chip::before {
  content: "★";
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-40%, -40%);
  font-size: clamp(21px, calc(var(--lh) * 0.54), 27px);
  line-height: 1;
  color: #f4b860;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  pointer-events: none;
  z-index: 2;
}
.case-chip {
  font-weight: 900;
  font-size: clamp(14px, calc(var(--lh) * 0.3), 22px);
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(76, 175, 80, 0.24),
    rgba(56, 142, 60, 0.18)
  );
  border: 1px solid rgba(56, 142, 60, 0.55);
  color: #e8f5e9;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(56, 142, 60, 0.15);
  white-space: nowrap;
}
.rookie-chip {
  position: relative;
  overflow: visible;
  font-weight: 900;
  font-size: clamp(14px, calc(var(--lh) * 0.3), 22px);
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(132, 145, 255, 0.22),
    rgba(92, 127, 255, 0.18)
  );
  border: 1px solid rgba(92, 127, 255, 0.55);
  color: #eef3ff;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(92, 127, 255, 0.15);
  white-space: nowrap;
}
/* RC marker (white RC inside blue circle), slight inset, above border */
.rookie-chip::before {
  content: "RC";
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-40%, -40%);
  width: clamp(21px, calc(var(--lh) * 0.54), 27px);
  height: clamp(21px, calc(var(--lh) * 0.54), 27px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    rgba(132, 145, 255, 0.85),
    rgba(92, 127, 255, 0.85)
  );
  border: 1px solid rgba(92, 127, 255, 0.9);
  color: #fff;
  font-weight: 1000;
  font-size: clamp(12px, calc(var(--lh) * 0.3), 16px);
  letter-spacing: 0.6px;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
.lane .lane-name {
  font-weight: 900;
  font-size: clamp(14px, calc(var(--lh) * 0.28), 36px);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.lane .lane-score {
  font: 900 clamp(16px, calc(var(--lh) * 0.34), 40px) / 1.1 ui-monospace,
    SFMono-Regular, Menlo, Monaco, Consolas;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #fff7ed, #ffb74d 55%, #ff8a00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
}
.lane .lane-meter {
  grid-column: 1/-1;
  position: static;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(8, 12, 22, 0.92),
    rgba(16, 24, 42, 0.82)
  );
  border: 1px solid rgba(255, 180, 0, 0.28);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(255, 180, 0, 0.12);
  overflow: hidden;
  margin-top: 10px;
}
.lane .lane-meter > div {
  height: 100%;
  background: linear-gradient(90deg, #ffe7b3, #ffb74d 45%, #ff8a00 100%);
  box-shadow: 0 0 12px rgba(255, 184, 96, 0.45);
  width: 0%;
}
@keyframes laneEnter {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes laneShiftUp {
  0% {
    transform: translateY(12px);
  }
  55% {
    transform: translateY(-6px);
  }
  100% {
    transform: none;
  }
}
@keyframes laneShiftDown {
  0% {
    transform: translateY(-12px);
  }
  55% {
    transform: translateY(6px);
  }
  100% {
    transform: none;
  }
}
@keyframes laneGlow {
  0% {
    box-shadow: 0 24px 48px rgba(255, 185, 96, 0.38),
      0 0 0 0 rgba(255, 185, 96, 0.45);
    border-color: rgba(255, 205, 140, 0.68);
  }
  60% {
    box-shadow: 0 18px 36px rgba(120, 165, 255, 0.32),
      0 0 0 4px rgba(120, 165, 255, 0.18);
    border-color: rgba(255, 205, 140, 0.28);
  }
  100% {
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
    border-color: var(--border);
  }
}
@keyframes laneSweep {
  0% {
    opacity: 0;
    transform: translateX(-140%) skewX(-16deg);
  }
  20% {
    opacity: 0.65;
  }
  45% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(130%) skewX(-16deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .lane,
  .lane::before,
  .lane::after {
    transition: none !important;
  }
  .lane-enter,
  .lane-shift-up,
  .lane-shift-down,
  .lane-moving,
  .lane-just-added {
    animation: none !important;
  }
  .lane .lane-sweep,
  .lane .lane-sweep.lane-sweep-active {
    animation: none !important;
    transition: none !important;
  }
}
.lane-rank {
  width: var(--rank);
  height: var(--rank);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 1000;
  font-size: calc(var(--lh) * 0.2);
  color: #0a0f18;
  background: radial-gradient(circle at 35% 35%, #fff, #f3f4f6 65%),
    conic-gradient(
      from var(--spin),
      rgba(255, 138, 0, 0.65),
      rgba(0, 210, 255, 0.3),
      rgba(255, 138, 0, 0.65)
    );
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
  border: 2px solid rgba(255, 138, 0, 0.35);
}

.team-desc {
  position: absolute;
  left: 50%;
  bottom: calc(clamp(96px, 12vh, 180px) + var(--g, 20px));
  transform: translate(-50%, 24px);
  width: min(780px, calc(100% - 64px));
  background: linear-gradient(
    180deg,
    rgba(10, 14, 24, 0.94),
    rgba(8, 12, 22, 0.97)
  );
  border: 1px solid hsla(var(--desc-h, 200) 68% 68% /0.32);
  box-shadow: 0 36px 68px rgba(0, 0, 0, 0.55);
  border-radius: 24px;
  padding: 0 0 26px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 62vh;
  overflow: auto;
  backdrop-filter: blur(16px);
  transition: opacity 0.24s ease, transform 0.28s ease;
  opacity: 0;
  pointer-events: none;
}
.team-desc::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    hsla(var(--desc-h, 200) 82% 62% /0.18),
    transparent 58%
  );
  mix-blend-mode: screen;
}
.team-desc.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.team-desc .desc-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 0;
  gap: 18px;
}
.team-desc .desc-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 18px;
  background: linear-gradient(
    120deg,
    hsla(var(--desc-h, 200) 78% 56% /0.18),
    hsla(var(--desc-h, 200) 62% 42% /0.08)
  );
  box-shadow: inset 0 0 0 1px hsla(var(--desc-h, 200) 78% 62% /0.25);
}
.team-desc .desc-banner::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(
    circle at 12% 32%,
    hsla(var(--desc-h, 200) 85% 72% /0.3),
    transparent 60%
  );
  opacity: 0.65;
  mix-blend-mode: screen;
  pointer-events: none;
}
.team-desc .desc-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.team-desc h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0.4px;
}
.team-desc .desc-sub {
  margin: 0;
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.team-desc .desc-crest {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  background: rgba(6, 10, 18, 0.78);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 76px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}
.team-desc .desc-crest img.badge {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.team-desc .desc-crest .crest {
  width: 100%;
  height: 100%;
  border-radius: 18px;
}
.team-desc .close-desc {
  margin-top: 8px;
  align-self: flex-start;
  background: rgba(12, 16, 28, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.team-desc .close-desc:hover {
  background: rgba(18, 24, 40, 0.95);
  color: var(--text);
}
.team-desc .desc-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 0 28px;
}
.team-desc .meta-item {
  background: rgba(12, 18, 30, 0.64);
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.team-desc .meta-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.6);
}
.team-desc .meta-value {
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  color: var(--text);
}
.team-desc p {
  margin: 0;
  padding: 0 28px 4px;
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1.55;
  color: var(--text-soft);
  white-space: pre-wrap;
}
@media (max-width: 720px) {
  .team-desc {
    width: calc(100% - 32px);
    bottom: calc(clamp(96px, 18vh, 220px) + 18px);
    padding-bottom: 22px;
  }
  .team-desc .desc-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .team-desc .close-desc {
    align-self: flex-end;
  }
  .team-desc .desc-banner {
    padding: 16px 18px;
  }
  .team-desc .desc-crest {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }
}

@media (max-width: 1280px) {
  .display-title {
    font-size: 56px;
  }
}
@media (max-width: 1080px) {
  .panel-heading-tools {
    align-items: flex-start;
  }
  .filter-group,
  .bulk-action-group {
    justify-content: flex-start;
  }
}
@media (max-width: 980px) {
  .control-layout.expanded {
    grid-template-columns: 1fr;
  }
  .lane .lane-name {
    font-size: 22px;
  }
  .lane .lane-score {
    font-size: 28px;
  }
  .lane-rank {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}

.title-input {
  font-size: 20px;
  font-weight: 800;
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  background: linear-gradient(
    140deg,
    rgba(25, 34, 56, 0.95),
    rgba(17, 25, 41, 0.88)
  );
  border: 1px solid rgba(244, 184, 96, 0.28);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 44px;
}
.team-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  min-width: 100%;
}
.team-table thead {
  background: linear-gradient(
    135deg,
    rgba(23, 32, 53, 0.92),
    rgba(17, 24, 38, 0.88)
  );
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 24px rgba(6, 9, 17, 0.45);
}
.team-table th,
.team-table td {
  padding: 9px 14px; /* compact: reduce vertical padding by ~25% */
  border-bottom: 1px solid rgba(38, 52, 82, 0.45);
  font-size: 14px;
  line-height: 1.4;
  vertical-align: middle;
}
.team-table th {
  position: sticky;
  top: 0;
  background: linear-gradient(
    135deg,
    rgba(24, 33, 54, 0.95),
    rgba(17, 24, 38, 0.92)
  );
  backdrop-filter: blur(12px);
  z-index: 2;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.6);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(224, 230, 246, 0.7);
  border-bottom: 1px solid rgba(244, 184, 96, 0.28);
}
.team-table td {
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  color: rgba(230, 236, 250, 0.86);
}
/* Prevent wrapping for team name and row buttons without changing table layout */
.team-table td.name-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
}
.team-table tbody button {
  white-space: nowrap;
}
.team-table th.select-col,
.team-table td.select-col {
  width: 42px;
  text-align: center;
}
.team-table th.badge-col,
.team-table td.badge-col {
  width: 120px;
}
.team-table th.score-col,
.team-table td.score-col {
  width: 78px;
}
.team-table th.autos-col,
.team-table td.autos-col {
  width: 78px;
}
.team-table th.case-col,
.team-table td.case-col {
  width: 92px;
  white-space: nowrap;
}
.team-table th.desc-col,
.team-table td.desc-col {
  width: 128px;
}
.team-table th.sold-col,
.team-table td.sold-col {
  width: 68px;
  text-align: center;
}
.team-table td.name-cell {
  font-weight: 600;
  max-width: 280px;
}
.team-table td.badge-col {
  text-align: right;
}
.team-table td.desc-col {
  text-align: left;
}
.team-table input[type="number"] {
  width: 60px;
  padding: 6px 8px;
  font-size: 14px;
}
/* Center header text for table columns */
.team-table thead th {
  text-align: center;
}
.team-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.team-table .badge-cell {
  white-space: normal;
  text-align: right;
  font-size: 12px;
}
.team-table .desc-cell {
  white-space: normal;
  text-align: left;
  font-size: 12px;
}
.badge-cell .badge-status {
  display: inline-block;
  width: 18px;
  text-align: center;
  margin-right: 6px;
  color: rgba(244, 184, 96, 0.65);
}
.cell-actions button {
  background: rgba(20, 28, 46, 0.8);
  color: var(--text);
  border: 1px solid rgba(114, 137, 178, 0.35);
  border-radius: 9px;
  padding: 2px 6px; /* compact */
  font-size: 11px;
  margin-left: 4px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease,
    transform 0.16s ease;
}
.cell-actions button:hover {
  background: rgba(28, 38, 60, 0.95);
  border-color: rgba(244, 184, 96, 0.38);
  transform: translateY(-1px);
}
.cell-actions button:disabled {
  opacity: 0.4;
  cursor: default;
}
.cell-actions .desc-preview {
  font-size: 11px;
  font-style: italic;
  color: var(--muted);
  margin-left: 8px;
  margin-top: 0;
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
.row-sold {
  opacity: 0.45;
}
.team-table tbody tr {
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.team-table tbody tr:hover {
  background: rgba(27, 38, 60, 0.78);
  box-shadow: 0 14px 26px rgba(7, 10, 18, 0.38);
}
.team-table tbody tr.row-selected {
  background: rgba(32, 46, 72, 0.92);
  box-shadow: inset 0 0 0 1px rgba(244, 184, 96, 0.38),
    0 16px 30px rgba(5, 9, 16, 0.4);
}
.team-table tbody tr.row-selected.row-sold {
  opacity: 0.65;
}
.right {
  text-align: right;
}
.grow {
  flex: 1;
}
.kbd {
  font: 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas;
  background: rgba(15, 22, 36, 0.9);
  border: 1px solid rgba(120, 146, 187, 0.35);
  padding: 2px 6px;
  border-radius: 6px;
  color: rgba(235, 240, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(244, 184, 96, 0.12);
}
body.overlay {
  background: transparent;
}
body.display-mode {
  overflow: hidden;
}
.display-mode .site-header {
  display: none;
}
.overlay .display-wrap {
  padding: 16px;
}

@media (max-width: 1280px) {
  .container {
    height: auto;
    overflow: visible;
  }
  body {
    overflow: auto;
  }
  .control-wrap {
    height: auto;
  }
  .control-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .primary-actions {
    justify-content: flex-start;
  }
  .overview-grid {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
}
@media (max-width: 820px) {
  .container {
    padding: 20px 18px;
    height: auto;
  }
  .title-input {
    font-size: 20px;
  }
  .metric {
    height: 44px;
    padding: 0 14px;
  }
  .panel-header,
  .panel-body {
    padding-left: 20px;
    padding-right: 20px;
  }
  .overview-panel {
    padding: 24px;
  }
  .nav-inner {
    flex-direction: column;
    height: auto;
    gap: 16px;
    padding: 12px 20px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  .nav-cta {
    flex-wrap: wrap;
    justify-content: center;
  }
}
@media (max-width: 600px) {
  .primary-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .primary-actions .btn {
    width: 100%;
  }
  .input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .button-row {
    width: 100%;
  }
  .button-row .btn {
    flex: 1;
  }
}

/* Auth overlay */
.auth-status {
  position: fixed !important;
  top: 15px !important;
  left: 15px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
  width: 120px !important;
  font-size: 13px;
  color: inherit;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: none;
  pointer-events: none;
  z-index: 9999;
}
.auth-status.hidden {
  display: none !important;
}
.auth-status .auth-user {
  display: none;
}
.auth-status .auth-logout {
  width: 100% !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  text-align: left !important;
  pointer-events: auto !important;
  border: 1px solid rgba(244, 184, 96, 0.24) !important;
  box-shadow: var(--shadow-soft);
  background: linear-gradient(
    135deg,
    rgba(28, 39, 68, 0.95),
    rgba(16, 24, 40, 0.9)
  ) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, box-shadow 0.18s ease,
    border-color 0.18s ease, background 0.18s ease !important;
}
.auth-status .auth-logout:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 184, 96, 0.4) !important;
  box-shadow: 0 12px 24px rgba(9, 12, 22, 0.4);
}

.auth-gate {
  position: fixed !important;
  inset: 0 !important;
  min-height: 100vh;
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 15, 0.82);
  backdrop-filter: blur(8px);
  z-index: 10000;
}
.auth-gate.hidden {
  display: none !important;
}
.auth-gate-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  min-width: 320px;
  max-width: 400px;
  text-align: center;
  color: var(--text);
}
.auth-gate-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}
.auth-gate-card p {
  margin: 0 0 16px;
  color: var(--text-soft);
}
.auth-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-gate-actions .btn {
  width: 100%;
}

/* Blur/dim content when auth is required */
body.requires-auth #controlView,
body.requires-auth #displayView {
  filter: blur(4px);
  opacity: 0.3;
  pointer-events: none;
  user-select: none;
}
body.requires-auth .auth-status {
  display: none !important;
}

/* Ensure auth modal sits above the gate */
#authModal {
  z-index: 11001 !important;
}
#controlView {
  overflow: hidden;
  height: 100%;
  margin-top: 0 !important;
  padding-top: 0 !important;
  display: flex;
  flex-direction: column;
}

/* Ensure lanes sit above backgrounds */
.top5 {
  position: relative;
  z-index: 2;
}
.ticker,
.fx-layer,
.display-title,
.subtitle {
  position: relative;
  z-index: 2;
}
/* Segmented toggle for score mode */
.seg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  border: 1px solid rgba(244, 184, 96, 0.6);
  background: rgba(16, 24, 38, 0.78);
  box-shadow: inset 0 0 0 1px rgba(122, 148, 186, 0.18);
}
.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  height: 100%;
  letter-spacing: 0.3px;
  cursor: pointer;
}
.seg-btn:hover {
  background: rgba(244, 184, 96, 0.12);
}
.seg-btn.active {
  background: var(--gradient-gold);
  border-left: 1px solid rgba(244, 184, 96, 0.6);
  border-right: 1px solid rgba(244, 184, 96, 0.6);
  color: #1b1204;
  box-shadow: 0 16px 30px rgba(244, 184, 96, 0.35);
}
.seg-btn:first-child.active {
  border-left: 0;
}
.seg-btn:last-child.active {
  border-right: 0;
}
/* Constrain the score toggle metric to align with 44px search input */
#scoreModeMetric .metric-content {
  height: 44px;
}
#scoreModeMetric {
  padding: 0;
}
#scoreModeMetric .metric-content {
  gap: 0;
  padding: 0;
}
#scoreModeToggle {
  width: 100%;
}
#scoreModeMetric .seg-toggle {
  width: 100%;
}
#scoreModeMetric .seg-btn {
  flex: 1;
}

/* Score input read-only visuals */
.score-input[readonly] {
  pointer-events: none;
  opacity: 0.7;
  cursor: default;
  background: rgba(16, 24, 38, 0.4);
}
