:root {
      --bg: #071018;
      --bg-soft: #0f1c29;
      --card: #132235;
      --text: #e7f0ff;
      --muted: #9cb2ca;
      --line: #24405f;
      --cyan: #37d5ff;
      --emerald: #43d18b;
      --amber: #f0b84c;
      --rose: #ff698f;
    }

    * { box-sizing: border-box; }

    html, body {
      margin: 0;
      padding: 0;
      background:
        radial-gradient(circle at 20% 20%, #123252 0%, transparent 40%),
        radial-gradient(circle at 90% 5%, #203d5f 0%, transparent 30%),
        linear-gradient(180deg, var(--bg) 0%, #050b12 100%);
      color: var(--text);
      font-family: "Segoe UI", "Trebuchet MS", sans-serif;
      scroll-behavior: smooth;
    }

    .page {
      width: min(1200px, 94vw);
      margin: 0 auto;
      padding: 28px 0 40px;
    }

    .hero {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 18px;
      margin-bottom: 18px;
    }

    .hero-main {
      position: relative;
      overflow: hidden;
    }

    .hero-main::after {
      content: "";
      position: absolute;
      right: -80px;
      top: -80px;
      width: 240px;
      height: 240px;
      border-radius: 999px;
      background: radial-gradient(circle, rgba(55, 213, 255, 0.2) 0%, rgba(55, 213, 255, 0) 70%);
      pointer-events: none;
    }

    .hero-visual {
      margin-top: 12px;
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      align-items: stretch;
      position: relative;
      z-index: 1;
    }

    .hero-visual .main-shot {
      width: 100%;
      height: auto;
      max-height: 360px;
      object-fit: contain;
      background: #08131f;
      display: block;
      border-radius: 12px;
      border: 1px solid var(--line);
      box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    }

    .panel {
      background: linear-gradient(160deg, rgba(19, 34, 53, 0.95) 0%, rgba(12, 23, 37, 0.92) 100%);
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 18px;
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    }

    h1, h2, h3 {
      margin: 0 0 10px;
      line-height: 1.2;
      letter-spacing: 0.2px;
    }

    h1 {
      font-size: clamp(1.7rem, 4vw, 2.4rem);
    }

    h2 {
      font-size: clamp(1.15rem, 2.2vw, 1.45rem);
      margin-bottom: 12px;
    }

    p {
      margin: 0 0 10px;
      color: var(--muted);
      line-height: 1.55;
    }

    .hero p strong { color: var(--text); }

    .mini-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

    .stat {
      background: rgba(9, 18, 29, 0.7);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 10px;
    }

    .stat[data-tone="cyan"] .value { color: var(--cyan); }
    .stat[data-tone="emerald"] .value { color: var(--emerald); }
    .stat[data-tone="amber"] .value { color: var(--amber); }
    .stat[data-tone="rose"] .value { color: var(--rose); }

    .stat .label {
      display: block;
      font-size: 0.78rem;
      color: var(--muted);
      margin-bottom: 4px;
    }

    .stat .value {
      font-size: 1.25rem;
      color: var(--cyan);
      font-weight: 700;
    }

    .stat .meta {
      display: block;
      margin-top: 4px;
      font-size: 0.74rem;
      color: #98b1ca;
      line-height: 1.35;
    }

    .toc {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 0 0 16px;
    }

    .toc a {
      color: var(--text);
      text-decoration: none;
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 7px 12px;
      font-size: 0.84rem;
      background: rgba(17, 30, 46, 0.75);
    }

    .toc a:hover { border-color: var(--cyan); color: var(--cyan); }

    .section { margin-top: 14px; }

    .lead-grid {
      display: grid;
      grid-template-columns: 1.1fr 0.9fr;
      gap: 12px;
    }

    .subtle {
      font-size: 0.9rem;
      color: #b7cae0;
    }

    .bars {
      display: grid;
      gap: 8px;
    }

    .bar-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 4px;
      font-size: 0.75rem;
      color: #9fb8d2;
    }

    .bar-note {
      margin-top: 6px;
      font-size: 0.74rem;
      color: #97b2cb;
    }

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

    .viz-box {
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      background: rgba(8, 17, 29, 0.72);
    }

    .donut-row {
      display: grid;
      grid-template-columns: 130px 1fr;
      gap: 12px;
      align-items: center;
    }

    .donut {
      width: 120px;
      height: 120px;
      border-radius: 50%;
      border: 1px solid #2a4969;
      box-shadow: inset 0 0 0 22px rgba(7, 16, 24, 0.9);
      position: relative;
    }

    .donut::after {
      content: attr(data-center);
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      font-size: 0.76rem;
      color: #c6ddf3;
      text-align: center;
      white-space: pre;
      line-height: 1.2;
    }

    .legend {
      display: grid;
      gap: 6px;
      margin: 0;
      padding: 0;
      list-style: none;
      font-size: 0.78rem;
      color: #c3d8ee;
    }

    .legend .dot {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      display: inline-block;
      margin-right: 6px;
      vertical-align: middle;
    }

    .bar-row {
      display: grid;
      grid-template-columns: 140px 1fr 70px;
      gap: 8px;
      align-items: center;
      font-size: 0.84rem;
    }

    .bar-row .name { color: #c5d7ea; }

    .bar-row .value {
      color: #d7eaff;
      font-variant-numeric: tabular-nums;
    }

    .bar-track {
      height: 10px;
      border-radius: 999px;
      background: #0b1624;
      border: 1px solid #25415f;
      overflow: hidden;
    }

    .bar-fill {
      height: 100%;
      background: linear-gradient(90deg, #179ec0, #34d8ff);
      border-radius: 999px;
    }

    .bar-fill.risk { background: linear-gradient(90deg, #cb7a31, #ff698f); }

    .chip-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }

    .chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border-radius: 999px;
      border: 1px solid var(--line);
      padding: 5px 10px;
      background: rgba(13, 25, 39, 0.8);
      font-size: 0.78rem;
      color: #c8dbef;
    }

    .chip b { color: var(--cyan); }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.91rem;
      overflow: hidden;
      border-radius: 12px;
    }

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

    th {
      background: rgba(8, 15, 24, 0.8);
      color: #c9e8ff;
      font-size: 0.8rem;
      letter-spacing: 0.3px;
      text-transform: uppercase;
    }

    .table-wrap {
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
    }

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

    .eq {
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      background: rgba(8, 16, 27, 0.72);
    }

    .eq code {
      display: block;
      color: var(--emerald);
      font-size: 0.96rem;
      margin-bottom: 8px;
      font-family: Consolas, "Courier New", monospace;
    }

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

    .math-card {
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      background: rgba(8, 16, 27, 0.72);
    }

    .math-card h3 {
      margin-bottom: 8px;
      font-size: 1rem;
      color: #d8ecff;
    }

    .eqline {
      display: block;
      font-family: Consolas, "Courier New", monospace;
      color: #74e2ff;
      font-size: 0.88rem;
      line-height: 1.45;
      margin: 6px 0;
      white-space: normal;
    }

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

    .const-item {
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 9px;
      background: rgba(9, 18, 30, 0.76);
      font-size: 0.82rem;
      color: #c8dbef;
      font-family: Consolas, "Courier New", monospace;
    }

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

    .card {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(9, 17, 28, 0.7);
      padding: 12px;
    }

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

    .card ul {
      margin: 0;
      padding-left: 18px;
      color: var(--muted);
      line-height: 1.45;
    }

    .card li { margin-bottom: 7px; }

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

    .pathway {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(8, 17, 29, 0.72);
      padding: 10px;
      overflow-x: auto;
    }

    .risk-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      margin-top: 10px;
    }

    .risk-card {
      border: 1px solid var(--line);
      border-radius: 10px;
      background: rgba(9, 18, 30, 0.76);
      padding: 10px;
    }

    .risk-card h3 {
      margin-bottom: 6px;
      font-size: 0.95rem;
      color: #d8ebff;
    }

    .risk-card p {
      margin: 0;
      font-size: 0.84rem;
    }

    .field {
      display: grid;
      gap: 5px;
      margin-bottom: 10px;
    }

    label {
      font-size: 0.83rem;
      color: #bdd2e8;
    }

    input, select, button {
      width: 100%;
      border-radius: 10px;
      border: 1px solid var(--line);
      padding: 10px;
      font: inherit;
    }

    input, select {
      background: #0c1726;
      color: var(--text);
    }

    button {
      background: linear-gradient(95deg, #0d6b86, #0f8ea3);
      color: #f0fbff;
      border: none;
      cursor: pointer;
      font-weight: 600;
    }

    button:hover { filter: brightness(1.08); }

    .result {
      border: 1px dashed #2f5479;
      border-radius: 12px;
      padding: 14px;
      background: rgba(8, 18, 31, 0.65);
    }

    .result strong {
      color: var(--amber);
      font-size: 1.2rem;
      display: inline-block;
      margin-top: 3px;
    }

    .refs .ref {
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 10px;
      background: rgba(8, 17, 28, 0.7);
      margin-bottom: 8px;
    }

    .refs .ref .meta {
      color: var(--muted);
      font-size: 0.88rem;
    }

    .refs .ref a {
      color: var(--cyan);
      text-decoration: none;
      word-break: break-all;
    }

    .footer {
      margin-top: 22px;
      font-size: 0.84rem;
      color: var(--muted);
      text-align: center;
    }

    @media (max-width: 960px) {
      .hero { grid-template-columns: 1fr; }
      .mini-stats { grid-template-columns: repeat(2, 1fr); }
      .equations, .grid-2, .calc, .lead-grid, .risk-grid, .math-grid, .const-grid { grid-template-columns: 1fr; }
      .viz-wrap { grid-template-columns: 1fr; }
      .bar-row { grid-template-columns: 120px 1fr 55px; }
      .hero-visual { grid-template-columns: 1fr; }
      .hero-visual .main-shot { max-height: 260px; }
    }

    @media (max-width: 680px) {
      .mini-stats { grid-template-columns: 1fr; }
      .bar-row {
        grid-template-columns: 1fr;
        gap: 4px;
      }
      .bar-head {
        flex-direction: column;
        gap: 2px;
      }
      .donut-row {
        grid-template-columns: 1fr;
        justify-items: center;
      }
    }
