:root {
      --bg-image: linear-gradient(135deg, #f5f8ff 0%, #eaf0f6 100%);
      --bg-overlay: linear-gradient(135deg, rgba(17, 24, 39, 0.18), rgba(15, 23, 42, 0.08));
      --black-overlay-opacity: 0.36;
      --panel-offset-y: 42px;
      --panel: rgba(255, 255, 255, 0.76);
      --text: #172033;
      --muted: #657084;
      --line: rgba(23, 32, 51, 0.12);
      --accent: #0f766e;
      --accent-dark: #0b5c55;
      --warm: #f59e0b;
      --shadow: 0 24px 70px rgba(12, 18, 28, 0.22);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--text);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background-image:
        linear-gradient(rgba(0, 0, 0, var(--black-overlay-opacity)), rgba(0, 0, 0, var(--black-overlay-opacity))),
        var(--bg-overlay),
        var(--bg-image);
      background-size: cover;
      background-position: center;
    }

    button {
      font: inherit;
    }

    .page {
      min-height: 90vh;
      display: grid;
      place-items: center;
      padding: clamp(58px, 12vw, 128px) 24px;
    }

    .quiz {
      width: min(460px, 100%);
      background: var(--panel);
      border: 1px solid rgba(255, 255, 255, 0.58);
      border-radius: 8px;
      box-shadow: var(--shadow);
      backdrop-filter: blur(18px);
      overflow: hidden;
      transform: translateY(var(--panel-offset-y));
      opacity: 1;
      transition: opacity 320ms ease, transform 320ms ease;
    }

    .quiz.is-hiding {
      opacity: 0;
      transform: translateY(calc(var(--panel-offset-y) + 12px));
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 8px 12px;
      border-bottom: 1px solid var(--line);
    }


    .bg-video {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      z-index: -1;
      pointer-events: none;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      font-weight: 800;
      letter-spacing: 0;
    }

    .brand-mark {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      color: white;
      background: var(--accent);
      border-radius: 8px;
      font-weight: 900;
    }

    .step-count {
      color: var(--muted);
      font-weight: 700;
      white-space: nowrap;
    }

    .progress {
      height: 4px;
      background: rgba(15, 118, 110, 0.12);
    }

    .progress span {
      display: block;
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, var(--accent), var(--warm));
      transition: width 260ms ease;
    }

    .board {
      padding: 10px 12px;
      opacity: 1;
      transform: translateY(0);
      transition: opacity 220ms ease, transform 220ms ease;
    }

    .board.is-fading {
      opacity: 0;
      transform: translateY(8px);
    }

    .question-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
      color: var(--accent-dark);
      font-size: 12px;
      font-weight: 800;
    }

    .question-kicker::before {
      content: "";
      width: 28px;
      height: 2px;
      background: var(--accent);
    }

    h1 {
      margin: 0;
      font-size: clamp(18px, 3.5vw, 21px);
      line-height: 1.18;
      letter-spacing: 0;
    }

    .lead {
      margin: 8px 0 0;
      color: var(--muted);
      line-height: 1.55;
      font-size: 12px;
    }

    .choices {
      display: grid;
      gap: 8px;
      margin-top: 12px;
    }

    .choice {
      width: 100%;
      display: grid;
      grid-template-columns: 36px 1fr 20px;
      align-items: center;
      gap: 10px;
      min-height: 40px;
      padding: 5px 8px 5px 5px;
      color: var(--text);
      background: white;
      border: 1px solid var(--line);
      border-radius: 8px;
      cursor: pointer;
      text-align: left;
      transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    }

    .choice:hover,
    .choice:focus-visible {
      border-color: rgba(15, 118, 110, 0.58);
      box-shadow: 0 12px 30px rgba(15, 118, 110, 0.16);
      transform: translateY(-2px);
      outline: none;
    }

    .choice-key {
      width: 32px;
      height: 32px;
      display: grid;
      place-items: center;
      color: var(--accent-dark);
      background: rgba(15, 118, 110, 0.1);
      border-radius: 8px;
      font-size: 12px;
      font-weight: 900;
    }

    .choice-label {
      min-width: 0;
      font-weight: 800;
      line-height: 1.45;
      font-size: 13px;
    }

    .choice-arrow {
      color: var(--accent);
      font-weight: 900;
      text-align: right;
      font-size: 13px;
    }

    .start-pop {
      position: fixed;
      inset: 0;
      z-index: 10;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(10, 15, 25, 0.46);
      opacity: 1;
      transition: opacity 320ms ease;
    }

    .start-pop.is-fading-out {
      opacity: 0;
      pointer-events: none;
    }

    .start-box {
      width: min(460px, 100%);
      padding: 30px;
      color: var(--text);
      background: rgba(255, 255, 255, 0.94);
      border-radius: 8px;
      box-shadow: var(--shadow);
      text-align: center;
    }

    .start-box h2 {
      margin: 0;
      font-size: clamp(24px, 7vw, 34px);
      line-height: 1.2;
      letter-spacing: 0;
    }

    .start-box p {
      margin: 12px 0 22px;
      color: var(--muted);
      line-height: 1.7;
    }

    .start-button {
      width: 100%;
      min-height: 54px;
      border: 0;
      border-radius: 8px;
      color: white;
      background: var(--accent);
      cursor: pointer;
      font-weight: 900;
      transition: background 180ms ease, transform 180ms ease;
    }

    .start-button:hover,
    .start-button:focus-visible {
      background: var(--accent-dark);
      transform: translateY(-1px);
      outline: none;
    }

    .is-hidden {
      display: none;
    }

    .loading {
      min-height: 330px;
      display: grid;
      place-items: center;
      text-align: center;
    }

    .loader {
      width: 70px;
      height: 70px;
      margin: 0 auto 18px;
      border: 7px solid rgba(15, 118, 110, 0.14);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 900ms linear infinite;
    }

    .loading h2 {
      margin: 0;
      font-size: clamp(24px, 5vw, 36px);
      letter-spacing: 0;
    }

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

    .loading > div {
      width: min(100%, 520px);
    }

    .result-screen {
      display: grid;
      gap: 16px;
      justify-items: center;
      text-align: center;
      padding: 18px 8px;
    }

    .result-icon {
      width: 64px;
      height: 64px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: white;
      background: linear-gradient(135deg, var(--accent), var(--warm));
      font-size: 30px;
      font-weight: 900;
      box-shadow: 0 16px 36px rgba(15, 118, 110, 0.2);
    }

    .result-screen h2 {
      margin: 0;
      font-size: clamp(22px, 4vw, 28px);
      line-height: 1.2;
    }

    .result-screen p {
      margin: 0;
      color: var(--muted);
      line-height: 1.7;
      max-width: 520px;
    }

    .result-button {
      width: min(100%, 260px);
      min-height: 50px;
      border: 0;
      border-radius: 999px;
      color: white;
      background: linear-gradient(135deg, var(--accent), var(--warm));
      cursor: pointer;
      font-weight: 900;
      transition: transform 180ms ease, box-shadow 180ms ease;
      box-shadow: 0 12px 24px rgba(15, 118, 110, 0.2);
    }

    .result-button:hover,
    .result-button:focus-visible {
      transform: translateY(-1px);
      box-shadow: 0 14px 28px rgba(15, 118, 110, 0.24);
      outline: none;
    }

    .diagnosis-banner {
      display: block;
      width: 100%;
      margin-top: 8px;
      overflow: hidden;
      border: none;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      text-decoration: none;
    }

    .diagnosis-banner img {
      display: block;
      width: 100%;
      height: auto;
      object-fit: cover;
    }

    .banner-placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 60px;
      padding: 8px 0;
      color: var(--accent);
      font-size: 14px;
      font-weight: 800;
      letter-spacing: 0.04em;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    @media (max-width: 560px) {
      :root {
        --panel-offset-y: 82px;
      }

      .page {
        padding: 14px;
      }

      .topbar {
        padding: 8px 12px;
      }

      .brand span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .choice {
        grid-template-columns: 32px 1fr 18px;
        gap: 8px;
        padding-right: 8px;
      }

      .choice-key {
        width: 28px;
        height: 28px;
      }
    }