    :root {
      color-scheme: dark;
      --ink: #eef4f8;
      --muted: #b8c7d6;
      --line: #253343;
      --panel: #121b25;
      --panel-soft: #172231;
      --band: #0a1017;
      --accent: #20b893;
      --accent-dark: #179575;
      --warn: #ffbf5f;
      --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: var(--ink);
      background:
        radial-gradient(circle at 20% -10%, rgba(32, 184, 147, 0.18), transparent 34%),
        linear-gradient(180deg, #0d1620 0%, var(--band) 240px);
      min-height: 100vh;
    }

    header {
      padding: 24px clamp(18px, 4vw, 48px);
      background: rgba(10, 16, 23, 0.82);
      color: white;
      border-bottom: 1px solid var(--line);
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
      text-align: center;
    }

    h1 {
      margin: 0;
      font-size: clamp(24px, 4vw, 38px);
      letter-spacing: 0;
    }

    header p {
      margin: 8px 0 0;
      max-width: 760px;
      margin-left: auto;
      margin-right: auto;
      color: #d4dde6;
      line-height: 1.5;
    }

    main {
      width: min(1180px, calc(100% - 32px));
      margin: 24px auto 48px;
      display: grid;
      gap: 18px;
    }

    .tabs {
      width: min(1180px, calc(100% - 32px));
      margin: 18px auto 0;
      display: flex;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .tab-button {
      min-height: 38px;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 14px;
      background: #101925;
      color: var(--muted);
      box-shadow: none;
    }

    .tab-button:hover,
    .tab-button.active {
      border-color: var(--accent);
      background: var(--panel-soft);
      color: var(--ink);
    }

    .page {
      display: grid;
      gap: 18px;
    }

    section {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 18px;
      box-shadow: var(--shadow);
    }

    h2 {
      margin: 0 0 22px;
      font-size: 18px;
      text-align: center;
    }

    label {
      display: grid;
      gap: 6px;
      font-size: 13px;
      color: var(--muted);
      font-weight: 650;
    }

    input,
    select,
    button {
      font: inherit;
    }

    input[type="file"],
    select,
    input[type="search"] {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 9px 10px;
      background: #0d151e;
      color: var(--ink);
      outline: none;
    }

    input[type="file"]::file-selector-button {
      margin-right: 10px;
      border: 0;
      border-radius: 5px;
      padding: 7px 10px;
      background: #233246;
      color: var(--ink);
      cursor: pointer;
    }

    input[type="file"]::file-selector-button:hover {
      background: #2d4058;
    }

    input[type="file"]:focus,
    select:focus,
    input[type="search"]:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(32, 184, 147, 0.18);
    }

    button {
      min-height: 42px;
      border: 0;
      border-radius: 6px;
      padding: 9px 14px;
      background: var(--accent);
      color: #03110d;
      font-weight: 750;
      cursor: pointer;
      box-shadow: 0 10px 24px rgba(32, 184, 147, 0.2);
    }

    button:hover {
      background: var(--accent-dark);
    }

    button.secondary {
      background: #223146;
      color: var(--ink);
    }

    .grid {
      display: grid;
      grid-template-columns: minmax(280px, 460px);
      gap: 14px;
      align-items: end;
    }

    #csvUploadFields {
      margin-top: 18px;
    }

    #csvUploadFields label {
      gap: 10px;
    }

    #setupPage section:first-child .grid {
      justify-content: center;
    }

    #setupPage section:first-child label,
    #setupPage section:first-child .note {
      text-align: center;
    }

    .controls {
      display: grid;
      grid-template-columns: 1fr 1fr auto;
      gap: 14px;
      align-items: end;
    }

    .overlap-player-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      margin-top: 16px;
    }

    .overlap-action {
      display: grid;
      grid-template-columns: minmax(0, calc((100% - 28px) / 3));
      margin-top: 14px;
    }

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

    .dashboard-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
      margin-top: 24px;
    }

    .dashboard-grid h2 {
      margin-top: 0;
    }

    .dashboard-table {
      max-height: 360px;
    }

    .dashboard-wide {
      margin-top: 24px;
    }

    .dashboard-wide h2 {
      margin-bottom: 12px;
      margin-top: 0;
    }

    .heading-with-tooltip {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .tooltip {
      position: relative;
      display: inline-grid;
      place-items: center;
      width: 18px;
      height: 18px;
      border: 1px solid var(--line);
      border-radius: 50%;
      color: var(--muted);
      background: #0d151e;
      font-size: 12px;
      font-weight: 800;
      cursor: help;
    }

    .tooltip-content {
      position: absolute;
      bottom: calc(100% + 10px);
      left: 50%;
      z-index: 10;
      width: min(310px, 72vw);
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #0d151e;
      color: var(--ink);
      box-shadow: var(--shadow);
      font-size: 12px;
      font-weight: 600;
      line-height: 1.45;
      text-align: left;
      transform: translateX(-50%);
      visibility: hidden;
      opacity: 0;
      pointer-events: none;
      transition: opacity 140ms ease;
    }

    .tooltip:hover .tooltip-content,
    .tooltip:focus-visible .tooltip-content {
      visibility: visible;
      opacity: 1;
    }

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

    .team-chart-panel {
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #0d151e;
    }

    .team-chart-group h2 {
      margin: 0 0 12px;
      color: var(--muted);
      font-size: 14px;
      font-weight: 650;
      text-align: center;
    }

    .team-bar-row {
      display: grid;
      gap: 10px;
    }

    .team-bar-item {
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr) 64px;
      align-items: center;
      gap: 10px;
      min-width: 0;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }

    .team-bar-value {
      justify-self: end;
      color: var(--ink);
    }

    .team-bar-track {
      width: 100%;
      height: 14px;
      overflow: hidden;
      border-radius: 999px;
    }

    .team-bar {
      height: 100%;
      min-width: 4px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.16);
    }

    .team-bar-label {
      color: var(--ink);
    }

    .section-heading {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      margin-bottom: 22px;
      position: relative;
    }

    .section-heading h2 {
      margin: 0;
    }

    .section-heading button {
      position: absolute;
      right: 0;
      width: 32px;
      min-height: 32px;
      padding: 0;
      border-radius: 5px;
      font-size: 18px;
      line-height: 1;
    }

    .value-controls {
      display: grid;
      grid-template-columns: minmax(280px, 460px);
      gap: 14px;
      justify-content: center;
      align-items: stretch;
    }

    .value-controls button {
      width: 100%;
    }

    .stat {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
      background: var(--panel-soft);
    }

    .stat strong {
      display: block;
      font-size: 28px;
      line-height: 1.1;
    }

    .stat span {
      color: var(--muted);
      font-size: 13px;
    }

    .value-positive {
      color: #8be6c9;
    }

    .value-negative {
      color: #ff9c9c;
    }

    .hidden {
      display: none !important;
    }

    .note {
      color: var(--muted);
      font-size: 14px;
      line-height: 1.5;
    }

    .note span {
      display: block;
    }

    .warning {
      color: var(--warn);
      font-weight: 700;
    }

    .mobile-label {
      display: none;
    }

    tr:hover td {
      background: rgba(255, 255, 255, 0.025);
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 14px;
    }

    th,
    td {
      padding: 10px 8px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      vertical-align: top;
    }

    th {
      color: var(--muted);
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      background: #0f1822;
      position: sticky;
      top: 0;
      z-index: 1;
    }

    .table-wrap {
      max-height: 520px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #0d151e;
    }

    #exposurePage th,
    #exposurePage td {
      text-align: center;
      padding-left: 6px;
      padding-right: 6px;
    }

    #exposurePage th:first-child,
    #exposurePage td:first-child {
      text-align: left;
      width: 28%;
      padding-left: 10px;
    }

    #exposurePage th:nth-child(2),
    #exposurePage td:nth-child(2),
    #exposurePage th:nth-child(3),
    #exposurePage td:nth-child(3) {
      width: 8%;
      white-space: nowrap;
    }

    #exposurePage th:nth-child(4),
    #exposurePage td:nth-child(4),
    #exposurePage th:nth-child(5),
    #exposurePage td:nth-child(5),
    #exposurePage th:nth-child(6),
    #exposurePage td:nth-child(6) {
      width: 18%;
      white-space: nowrap;
    }

    #exposurePage .controls {
      grid-template-columns: minmax(180px, 1fr) 88px minmax(110px, 140px) minmax(150px, 180px);
      margin-bottom: 18px;
    }

    #exposurePage .exposure-gradient-cell {
      color: #07111c;
      font-weight: 850;
    }

    #playoffPage th,
    #playoffPage td {
      text-align: center;
    }

    #playoffPage th:nth-child(2),
    #playoffPage td:nth-child(2) {
      width: 35%;
    }

    #playoffPage .controls {
      margin-bottom: 18px;
    }

    #playoffPage th:nth-child(3),
    #playoffPage td:nth-child(3) {
      width: 35%;
    }

    .playoff-summary-grid {
      display: grid;
      gap: 18px;
    }

    .playoff-week-chart {
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #0d151e;
    }

    .playoff-week-chart h3 {
      margin: 0 0 12px;
      color: var(--ink);
      text-align: center;
    }

    .playoff-matchup-bars {
      display: grid;
      gap: 8px;
    }

    .playoff-matchup-bar {
      display: grid;
      grid-template-columns: 96px minmax(0, 1fr) 84px;
      align-items: center;
      gap: 10px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }

    .playoff-matchup-label,
    .playoff-matchup-value {
      color: var(--ink);
    }

    .playoff-matchup-value {
      justify-self: end;
    }

    .playoff-matchup-track {
      height: 14px;
      overflow: hidden;
      border-radius: 999px;
    }

    .playoff-matchup-fill {
      height: 100%;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.16);
    }

    .player-list {
      color: var(--muted);
      line-height: 1.45;
    }

    #resultsSection .player-list,
    #qbStackTeamsSection .player-list,
    #valueTeamsSection .player-list {
      text-align: center;
    }

    .position-line {
      margin: 0 0 5px;
    }

    .position-line:last-child {
      margin-bottom: 0;
    }

    .roster-construction {
      margin-bottom: 10px;
      color: var(--ink);
      font-weight: 800;
    }

    .position-label {
      display: inline-block;
      min-width: 40px;
      color: var(--ink);
      font-weight: 800;
    }

    #valueTeamsSection .position-label {
      min-width: 40px;
    }

    .tournament-title {
      margin: 0 0 8px;
      color: var(--ink);
      font-weight: 800;
    }

    .value-team-heading {
      margin: 0;
      color: var(--ink);
      font-weight: 800;
      text-align: center;
    }

    .value-team-title {
      margin-bottom: 14px;
    }

    .draft-date {
      margin-bottom: 14px;
      color: var(--muted);
      font-weight: 400;
      text-align: center;
    }

    .highlight-player {
      color: var(--ink);
      font-weight: 800;
    }

    .link-button {
      appearance: none;
      border: 0;
      padding: 0;
      background: none;
      color: var(--ink);
      font: inherit;
      font-weight: 800;
      cursor: pointer;
      text-align: left;
    }

    .link-button:hover,
    .link-button:focus-visible {
      text-decoration: underline;
    }

    @media (max-width: 820px) {
      .grid,
      .controls,
      .overlap-player-grid,
      .value-controls,
      .dashboard-grid,
      .team-chart,
      .stats {
        grid-template-columns: 1fr;
      }

      .team-chart-group + .team-chart-group {
        padding-top: 16px;
      }

      .section-heading .heading-with-tooltip {
        max-width: calc(100% - 42px);
        flex-wrap: wrap;
      }

      .tooltip-content {
        position: fixed;
        top: 88px;
        bottom: auto;
        left: 50%;
        width: min(300px, calc(100vw - 40px));
        max-width: calc(100vw - 40px);
        transform: translateX(-50%);
      }

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

      #exposurePage .table-wrap {
        overflow-x: hidden;
      }

      #exposurePage table {
        table-layout: fixed;
        min-width: 0;
        width: 100%;
        font-size: 11px;
      }

      #exposurePage th,
      #exposurePage td {
        padding: 8px 2px;
      }

      #exposurePage th:first-child,
      #exposurePage td:first-child {
        width: 40%;
        padding-left: 6px;
      }

      #exposurePage th:nth-child(2),
      #exposurePage td:nth-child(2) {
        width: 12%;
      }

      #exposurePage th:nth-child(3),
      #exposurePage td:nth-child(3) {
        width: 10%;
      }

      #exposurePage th:nth-child(4),
      #exposurePage td:nth-child(4) {
        width: 18%;
      }

      #exposurePage th:nth-child(5),
      #exposurePage td:nth-child(5) {
        display: none;
      }

      #exposurePage th:nth-child(6),
      #exposurePage td:nth-child(6) {
        width: 20%;
      }

      #exposurePage .desktop-label {
        display: none;
      }

      #exposurePage .mobile-label {
        display: inline;
      }
    }
