@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&family=Manrope:wght@400;600;700;800&family=Sora:wght@500;600;700;800&display=swap");

:root {
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --bg: #eaf2f9;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: #f7fbff;
  --text: #0f2436;
  --muted: #4f697f;
  --line: rgba(30, 68, 96, 0.2);
  --accent: #1e7f98;
  --accent-strong: #15596d;
  --accent-soft: rgba(30, 127, 152, 0.14);
  --good: #1f7a66;
  --warn: #946915;
  --bad: #9b3c44;
  --shadow: 0 14px 30px rgba(16, 48, 72, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(71, 172, 197, 0.12), transparent 34%),
    linear-gradient(220deg, rgba(38, 146, 121, 0.1), transparent 38%),
    linear-gradient(180deg, #f6fbff 0%, var(--bg) 100%);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-5) 20px 48px;
}

@keyframes labFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: var(--space-4);
  align-items: end;
  margin-bottom: var(--space-3);
  animation: labFadeUp 340ms ease-out both;
}

.hero.hero-compact {
  grid-template-columns: minmax(0, 1fr);
}

.eyebrow,
.hero-label,
.metric-label,
.badge,
.slot-position,
.table-header,
.mini-label {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow {
  margin: 0 0 10px;
  color: #1a6f83;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Sora", sans-serif;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1;
  margin-bottom: 16px;
}

.hero-copy {
  max-width: 720px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-actions {
  margin-top: var(--space-3);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 172px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #10637a, #1a8398);
  border: 1px solid rgba(16, 99, 122, 0.5);
  box-shadow: 0 10px 22px rgba(16, 99, 122, 0.28);
  transition: transform 140ms ease, filter 140ms ease;
}

.hero-cta:hover {
  transform: translateY(-1px);
  filter: saturate(1.06);
}

.hero-card,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-card {
  padding: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(239, 247, 255, 0.92));
}

.hero-card ul {
  padding-left: 18px;
  margin: 14px 0 0;
  color: var(--muted);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.trust-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(16, 48, 72, 0.14);
}

.trust-card strong {
  display: block;
  margin-top: 4px;
  font-family: "Sora", sans-serif;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.session-header {
  margin-bottom: var(--space-3);
}

.session-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(120deg, rgba(171, 220, 244, 0.5), rgba(238, 247, 255, 0.94) 45%),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 24px rgba(16, 48, 72, 0.16);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.session-main h3 {
  font-size: 1.1rem;
  margin-top: 4px;
}

.session-audit {
  margin-top: 6px;
  color: #4f697f;
  font-size: 0.86rem;
}

.session-side {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.session-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-action {
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.quality-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(244, 251, 255, 0.92);
  color: var(--text);
  white-space: nowrap;
}

.quality-chip.small {
  font-size: 0.72rem;
  padding: 4px 9px;
}

.quality-a {
  color: #1d725f;
  border-color: rgba(29, 114, 95, 0.28);
  background: rgba(113, 226, 190, 0.28);
}

.quality-b {
  color: #1f6d80;
  border-color: rgba(31, 109, 128, 0.26);
  background: rgba(140, 217, 236, 0.3);
}

.quality-c {
  color: #8b6115;
  border-color: rgba(139, 97, 21, 0.26);
  background: rgba(248, 210, 144, 0.42);
}

.quality-d {
  color: #8f3c44;
  border-color: rgba(143, 60, 68, 0.28);
  background: rgba(245, 176, 183, 0.42);
}

.command-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  margin-bottom: var(--space-3);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 22px rgba(8, 18, 34, 0.34);
}

.command-bar label {
  gap: 5px;
}

.command-optimize {
  align-self: end;
  min-width: 150px;
}

.workspace-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  margin-bottom: var(--space-3);
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(197, 220, 241, 0.26);
}

.workspace-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.workspace-tab.active {
  background: linear-gradient(135deg, #4f89b3, #6ca8cf);
  color: #fff;
  border-color: #4a80a8;
}

.dashboard {
  display: grid;
  grid-template-columns: 330px minmax(360px, 440px) minmax(0, 1fr);
  grid-template-areas:
    "controls lineup intel";
  gap: 20px;
  align-items: start;
}

.controls-panel {
  grid-area: controls;
  position: sticky;
  top: 20px;
  align-self: start;
  min-width: 0;
}

.lineup-panel {
  grid-area: lineup;
  position: sticky;
  top: 20px;
  align-self: start;
}

.intel-panel {
  grid-area: intel;
  min-width: 0;
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.intel-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 10px;
}

.intel-tab {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(247, 252, 255, 0.88);
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.intel-tab.active {
  color: #ffffff;
  border-color: #5f9bc7;
  background: linear-gradient(135deg, #4f89b3, #6ca8cf);
}

.intel-pane {
  display: none;
  min-height: 0;
}

.intel-pane.active {
  display: block;
}

#intelPaneRankings {
  max-height: calc(100vh - 210px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

#intelPaneRankings .player-table {
  overflow: auto;
}

#intelPaneInsights.active,
#intelPaneCalibration.active {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  padding-right: 4px;
}

.calibration-status-row {
  margin-top: 4px;
}

.hint-chip {
  display: inline-flex;
  margin-top: 2px;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(85, 180, 204, 0.45);
  background: rgba(76, 161, 183, 0.26);
  color: #1a6f83;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
}

.rules-view {
  padding: 22px;
}

.rules-layout {
  display: block;
}

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

.rule-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(246, 251, 255, 0.84);
}

.rule-card h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.rule-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.glossary-card {
  margin-bottom: 14px;
  border-color: rgba(37, 109, 90, 0.24);
  background: rgba(18, 41, 35, 0.6);
}

.panel {
  padding: var(--space-3);
  overflow: hidden;
  animation: labFadeUp 380ms ease-out both;
}

.controls-panel {
  animation-delay: 30ms;
}

.lineup-panel {
  animation-delay: 70ms;
}

.rankings-panel {
  animation-delay: 110ms;
}

.insights-panel {
  animation-delay: 150ms;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading p {
  color: var(--muted);
  max-width: 420px;
  font-size: 0.95rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  min-width: 0;
  color: var(--muted);
}

label select,
label input {
  color: var(--text);
}

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

select,
input {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

select:focus,
input:focus {
  outline: none;
  border-color: rgba(21, 113, 135, 0.45);
  box-shadow: 0 0 0 3px rgba(21, 113, 135, 0.14);
  background: rgba(255, 255, 255, 0.98);
}

select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slider-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.slider-group input {
  grid-column: 1 / -1;
  padding: 0;
}

.weights-grid {
  display: grid;
  gap: 10px;
  margin-bottom: var(--space-3);
}

.top-control-block {
  display: grid;
  gap: 14px;
  margin-bottom: var(--space-3);
  padding: var(--space-2);
  border-radius: 18px;
  background: rgba(247, 252, 255, 0.8);
  border: 1px solid var(--line);
  min-width: 0;
}

.advanced-controls {
  margin-bottom: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 252, 255, 0.8);
  overflow: hidden;
}

.advanced-controls summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.76rem;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.advanced-controls[open] summary {
  border-bottom-color: var(--line);
}

.advanced-controls summary::-webkit-details-marker {
  display: none;
}

.advanced-grid {
  padding: 12px;
  margin-bottom: 0;
}

.contest-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.contest-chip {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(245, 251, 255, 0.82);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.contest-chip.active {
  background: linear-gradient(135deg, #4f89b3, #6ca8cf);
  color: white;
  border-color: #5f9bc7;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}

.actions-row .primary-action,
.actions-row .secondary-action {
  flex: 1 1 155px;
  min-width: 155px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.status-stack {
  display: grid;
  gap: 4px;
}

.calibration-upload {
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(245, 251, 255, 0.82);
}

.calibration-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.calibration-actions {
  margin-top: 12px;
  margin-bottom: 0;
}

.calibration-snapshot {
  margin-top: 6px;
  font-size: 0.86rem;
}

.player-table {
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.rankings-toolbar {
  margin-bottom: 12px;
}

.search-label {
  display: grid;
  gap: 8px;
}

.player-card {
  display: grid;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(250, 253, 255, 0.84);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  min-width: 0;
  text-align: left;
  content-visibility: auto;
  contain-intrinsic-size: 160px;
}

.player-card:hover,
.player-card.active {
  transform: translateY(-1px);
  border-color: rgba(21, 113, 135, 0.3);
  background: rgba(255, 255, 255, 0.98);
}

.player-card-top,
.player-card-stats {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.player-card-top {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
}

.player-card-stats {
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  padding-top: 8px;
  border-top: 1px solid rgba(16, 32, 47, 0.12);
}

.player-rank {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 12px;
  background: rgba(170, 194, 219, 0.16);
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.player-card-value {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.player-stat {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.player-stat strong {
  font-size: 1.02rem;
}

.player-name,
.slot-name {
  font-weight: 700;
}

.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-meta,
.slot-empty,
.empty-state {
  color: var(--muted);
}

.slot-projection {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.player-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1a6f83;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(166, 191, 216, 0.18);
  color: var(--muted);
}

.status-tag.out,
.status-tag.inactive,
.status-tag.doubtful {
  background: rgba(139, 48, 48, 0.12);
  color: var(--bad);
}

.status-tag.questionable {
  background: rgba(157, 102, 31, 0.12);
  color: var(--warn);
}

.status-tag.probable {
  background: rgba(37, 109, 90, 0.12);
  color: var(--good);
}

.source-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(157, 102, 31, 0.12);
  color: var(--warn);
}

.lock-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(37, 109, 90, 0.12);
  color: var(--good);
}

.news-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.news-tag.positive {
  background: rgba(37, 109, 90, 0.12);
  color: var(--good);
}

.news-tag.negative {
  background: rgba(139, 48, 48, 0.12);
  color: var(--bad);
}

.script-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.script-tag.positive {
  background: rgba(37, 109, 90, 0.12);
  color: var(--good);
}

.script-tag.negative {
  background: rgba(139, 48, 48, 0.12);
  color: var(--bad);
}

.ownership-tag,
.leverage-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.ownership-tag.high {
  background: rgba(157, 102, 31, 0.12);
  color: var(--warn);
}

.ownership-tag.mid {
  background: rgba(166, 191, 216, 0.18);
  color: var(--muted);
}

.ownership-tag.low {
  background: rgba(37, 109, 90, 0.12);
  color: var(--good);
}

.leverage-tag.strong {
  background: rgba(37, 109, 90, 0.12);
  color: var(--good);
}

.leverage-tag.neutral {
  background: rgba(166, 191, 216, 0.18);
  color: var(--muted);
}

.leverage-tag.weak {
  background: rgba(139, 48, 48, 0.12);
  color: var(--bad);
}

.why-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(200, 75, 49, 0.24);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: #1a6f83;
  cursor: help;
}

.ban-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(166, 191, 216, 0.22);
  color: var(--text);
}

.lineup-slots,
.player-insight {
  display: grid;
  gap: 10px;
}

.lineup-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(247, 252, 255, 0.88);
  border: 1px solid var(--line);
}

.toolbar-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.lineup-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-focus-toggle {
  border: 1px solid var(--line);
  background: rgba(245, 251, 255, 0.94);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.toolbar-focus-toggle[aria-pressed="true"] {
  border-color: rgba(16, 99, 122, 0.4);
  background: rgba(217, 241, 248, 0.95);
}

.toolbar-focus-toggle:hover {
  transform: translateY(-1px);
}

.lineup-slot {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(170, 194, 219, 0.3);
  border-radius: 12px;
  background: rgba(248, 252, 255, 0.82);
}

.lineup-slot-content {
  min-width: 0;
}

.lineup-slot .slot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineup-player-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.lineup-slot .status-tag,
.lineup-slot .source-tag,
.lineup-slot .lock-tag,
.lineup-slot .news-tag,
.lineup-slot .script-tag,
.lineup-slot .ownership-tag,
.lineup-slot .leverage-tag,
.lineup-slot .why-tag,
.lineup-slot .ban-tag {
  margin-left: 0;
}

.slot-position {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 12px;
  background: rgba(30, 88, 124, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
}

.slot-action {
  border: 0;
  border-radius: 12px;
  padding: 9px 11px;
  background: linear-gradient(135deg, #4b82ab, #679fcb);
  color: white;
  cursor: pointer;
  white-space: nowrap;
  min-width: 86px;
  justify-self: end;
}

.slot-action:disabled {
  opacity: 0.7;
  cursor: wait;
}

.primary-action {
  border: 0;
  border-radius: 16px;
  padding: 13px 15px;
  background: linear-gradient(135deg, #2d89a2, #52aecd);
  color: white;
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.primary-action:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.secondary-action {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-action:hover,
.secondary-action:hover,
.slot-action:hover {
  transform: translateY(-1px);
}

.primary-action:hover {
  box-shadow: 0 10px 22px rgba(16, 99, 122, 0.28);
  filter: saturate(1.06);
}

.secondary-action:hover {
  background: rgba(255, 255, 255, 0.99);
  border-color: rgba(168, 194, 220, 0.34);
}

.secondary-action:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.status-copy {
  margin-top: 12px;
  color: var(--muted);
  min-height: 20px;
  font-size: 0.92rem;
}

.error-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(159, 57, 65, 0.28);
  background: rgba(159, 57, 65, 0.1);
  color: var(--bad);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: pre-wrap;
}

.slate-meta {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(247, 252, 255, 0.84);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.lineup-summary,
.metrics,
.detail-grid {
  display: grid;
  gap: 12px;
}

.lineup-summary {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
}

.generated-lineups-shell {
  margin-top: 14px;
}

.compact-heading {
  margin: 0 0 10px;
}

.compact-heading h3 {
  font-size: 1.05rem;
}

.compact-heading p {
  font-size: 0.88rem;
  max-width: none;
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

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

.lineup-summary div,
.metric-card,
.detail-card,
.ai-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(247, 252, 255, 0.88);
  border: 1px solid var(--line);
}

.generated-lineups {
  display: grid;
  gap: 10px;
}

.generated-lineup-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(247, 252, 255, 0.88);
  border: 1px solid var(--line);
}

.generated-lineup-card.active {
  border-color: rgba(21, 113, 135, 0.34);
  background: rgba(255, 255, 255, 0.98);
}

.generated-lineup-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.generated-lineup-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.generated-lineup-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.generated-lineup-meta span {
  white-space: nowrap;
}

.generated-lineup-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

.generated-lineup-action {
  width: 100%;
  flex: 0 0 auto;
  min-width: 122px;
  white-space: nowrap;
}

.generated-lineup-players {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.checklist-state {
  text-align: left;
  max-width: 420px;
}

.checklist-state strong {
  display: block;
  margin-bottom: 6px;
}

.checklist-steps {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.action-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  border: 1px solid rgba(16, 32, 47, 0.16);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(18, 42, 63, 0.14);
  padding: 11px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.action-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.generated-lineups-empty {
  min-height: 120px;
}

.lineup-summary span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.lineup-summary strong {
  font-size: 1.15rem;
}

.empty-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed rgba(170, 194, 219, 0.32);
  border-radius: 14px;
  padding: 24px;
}

.insight-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.insight-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.insight-actions .secondary-action {
  width: auto;
}

.metric-card strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 6px;
}

.detail-card ul,
.ai-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.ai-card .slot-action {
  margin-top: 12px;
}

.mini-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  color: var(--muted);
}

.score-good {
  color: var(--good);
}

.score-warn {
  color: var(--warn);
}

.score-bad {
  color: var(--bad);
}

.prompt-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(30, 88, 124, 0.08);
  color: var(--text);
  white-space: pre-wrap;
  font-size: 0.92rem;
}

body.focus-mode .dashboard {
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  grid-template-areas: "controls lineup";
}

body.focus-mode .intel-panel {
  display: none;
}

@media (max-width: 1100px) {
  .command-bar {
    grid-template-columns: 1fr 1fr;
  }

  .command-optimize {
    grid-column: 1 / -1;
    width: 100%;
  }

  .dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "controls"
      "lineup"
      "intel";
  }

  .controls-panel,
  .lineup-panel,
  .intel-panel {
    position: static;
    max-height: none;
  }

  #intelPaneRankings,
  #intelPaneInsights.active,
  #intelPaneCalibration.active {
    max-height: none;
  }

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

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

@media (max-width: 840px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .session-card {
    grid-template-columns: 1fr;
  }

  .session-side {
    justify-items: start;
  }

  .session-presets {
    justify-content: flex-start;
  }

  .actions-row .primary-action,
  .actions-row .secondary-action {
    flex-basis: 100%;
    min-width: 0;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .player-card-stats,
  .metrics,
  .detail-grid,
  .lineup-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 18px 14px 28px;
  }

  .workspace-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  h1 {
    font-size: 2.8rem;
  }

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .command-bar {
    grid-template-columns: 1fr;
  }

  .player-card-top,
  .player-card-stats,
  .metrics,
  .detail-grid,
  .lineup-summary,
  .lineup-slot {
    grid-template-columns: 1fr;
  }

  .player-card-value {
    justify-items: start;
  }

  .insight-top {
    flex-direction: column;
  }

  .generated-lineup-top {
    grid-template-columns: 1fr;
  }

  .generated-lineup-actions {
    justify-content: flex-start;
  }

  .generated-lineup-action {
    width: auto;
  }

  .action-toast {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}


