/* ===== CSS CUSTOM PROPERTIES — LIGHT THEME ===== */
    :root {
      --bg:           #f9f9f8;
      --surface:      #ffffff;
      --surface-2:    #f2f2f0;
      --border:       #e2e2de;
      --text-primary: #1a1a18;
      --text-secondary: #5a5a55;
      --text-muted:   #8a8a84;
      --accent:       #2d6a4f;
      --accent-light: #d8ede3;
      --accent-hover: #235c43;
      --btn-secondary-bg: #f2f2f0;
      --btn-secondary-hover: #e5e5e0;
      --progress-bg:  #e2e2de;
      --progress-fill: #2d6a4f;
      --radio-border: #c0c0ba;
      --radio-checked: #2d6a4f;
      --shadow:       0 2px 16px rgba(0,0,0,0.07);
      --shadow-card:  0 4px 24px rgba(0,0,0,0.09);
      --radius:       12px;
      --radius-sm:    8px;
      --radius-lg:    20px;
      --font: 'Georgia', 'Times New Roman', serif;
      --font-ui: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    }

    /* ===== CSS CUSTOM PROPERTIES — DARK THEME ===== */
    [data-theme="dark"] {
      --bg:           #111110;
      --surface:      #1c1c1a;
      --surface-2:    #252523;
      --border:       #2e2e2b;
      --text-primary: #f0f0ec;
      --text-secondary: #a8a8a0;
      --text-muted:   #6a6a64;
      --accent:       #52b788;
      --accent-light: #1a3328;
      --accent-hover: #63c99a;
      --btn-secondary-bg: #252523;
      --btn-secondary-hover: #2e2e2b;
      --progress-bg:  #2e2e2b;
      --progress-fill: #52b788;
      --radio-border: #4a4a46;
      --radio-checked: #52b788;
      --shadow:       0 2px 16px rgba(0,0,0,0.3);
      --shadow-card:  0 4px 24px rgba(0,0,0,0.4);
    }

    /* ===== RESET & BASE ===== */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    html { font-size: 16px; scroll-behavior: smooth; }

    body {
      font-family: var(--font-ui);
      background: var(--bg);
      color: var(--text-primary);
      min-height: 100vh;
      line-height: 1.6;
      transition: background 0.25s, color 0.25s;
    }

    /* ===== LAYOUT WRAPPER ===== */
    .page-wrapper {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* ===== HEADER ===== */
    .site-header {
      position: sticky;
      top: 0;
      z-index: 50;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      box-shadow: var(--shadow);
    }

    .header-inner {
      max-width: 760px;
      margin: 0 auto;
      padding: 14px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .site-title {
      font-family: var(--font);
      font-size: 1.05rem;
      font-weight: 600;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }

    .site-subtitle {
      font-size: 0.78rem;
      color: var(--text-muted);
      margin-top: 1px;
    }

    /* ===== THEME TOGGLE BUTTON ===== */
    .btn-theme {
      background: var(--btn-secondary-bg);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      border-radius: var(--radius-sm);
      padding: 7px 13px;
      font-size: 0.82rem;
      cursor: pointer;
      transition: background 0.18s, color 0.18s;
      white-space: nowrap;
      font-family: var(--font-ui);
    }
    .btn-theme:hover { background: var(--btn-secondary-hover); color: var(--text-primary); }
    .btn-theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

    /* ===== MAIN CONTENT ===== */
    .main-content {
      flex: 1;
      max-width: 760px;
      margin: 0 auto;
      width: 100%;
      padding: 32px 20px 60px;
    }

    /* ===== INTRO SECTION ===== */
    .intro-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 36px 32px;
      margin-bottom: 32px;
      box-shadow: var(--shadow-card);
    }

    .intro-card h1 {
      font-family: var(--font);
      font-size: 1.65rem;
      font-weight: 700;
      line-height: 1.3;
      color: var(--text-primary);
      margin-bottom: 14px;
    }

    .intro-card p {
      color: var(--text-secondary);
      font-size: 0.97rem;
      margin-bottom: 10px;
      line-height: 1.7;
    }

    .intro-card .start-btn-wrap {
      margin-top: 24px;
    }

    /* ===== SCALE LEGEND ===== */
    .scale-legend {
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 14px 18px;
      margin: 20px 0;
      font-size: 0.87rem;
      color: var(--text-secondary);
    }

    .scale-legend strong {
      display: block;
      margin-bottom: 8px;
      color: var(--text-primary);
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .scale-legend ol {
      list-style: none;
      display: flex;
      flex-wrap: wrap;
      gap: 6px 18px;
    }

    .scale-legend ol li {
      font-size: 0.84rem;
    }

    /* ===== PROGRESS BAR ===== */
    .progress-wrap {
      margin-bottom: 28px;
    }

    .progress-label {
      display: flex;
      justify-content: space-between;
      font-size: 0.82rem;
      color: var(--text-muted);
      margin-bottom: 8px;
    }

    .progress-track {
      height: 5px;
      background: var(--progress-bg);
      border-radius: 99px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      background: var(--progress-fill);
      border-radius: 99px;
      transition: width 0.35s ease;
    }

    /* ===== QUESTION CARD ===== */
    .question-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 32px 28px 28px;
      box-shadow: var(--shadow-card);
      animation: fadeSlideIn 0.28s ease;
    }

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

    .question-number {
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--accent);
      font-weight: 600;
      margin-bottom: 12px;
    }

    .question-text {
      font-family: var(--font);
      font-size: 1.18rem;
      line-height: 1.55;
      color: var(--text-primary);
      margin-bottom: 26px;
    }

    /* ===== LIKERT RADIO GROUP ===== */
    .likert-group {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 28px;
    }

    .likert-option {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 13px 16px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: border-color 0.18s, background 0.18s;
      background: var(--surface);
    }

    .likert-option:hover {
      border-color: var(--accent);
      background: var(--accent-light);
    }

    .likert-option.selected {
      border-color: var(--accent);
      background: var(--accent-light);
    }

    .likert-option input[type="radio"] {
      /* Visually hidden but accessible */
      position: absolute;
      opacity: 0;
      width: 0;
      height: 0;
    }

    /* Custom radio visual */
    .radio-visual {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: 2px solid var(--radio-border);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: border-color 0.18s;
      background: var(--surface);
    }

    .likert-option.selected .radio-visual {
      border-color: var(--radio-checked);
      background: var(--radio-checked);
    }

    .likert-option.selected .radio-visual::after {
      content: '';
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--surface);
    }

    .likert-option:focus-within .radio-visual {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .likert-label-text {
      font-size: 0.93rem;
      color: var(--text-secondary);
      line-height: 1.4;
    }

    .likert-option.selected .likert-label-text {
      color: var(--text-primary);
      font-weight: 500;
    }

    .likert-value {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-left: auto;
      flex-shrink: 0;
    }

    .likert-option.selected .likert-value {
      color: var(--accent);
      font-weight: 600;
    }

    /* ===== VALIDATION MESSAGE ===== */
    .validation-msg {
      font-size: 0.84rem;
      color: #c0392b;
      margin-top: -18px;
      margin-bottom: 14px;
      display: none;
    }

    .validation-msg.visible { display: block; }

    /* ===== SUBMITTING STATE MESSAGE ===== */
    /* Shown while POST is in flight, replaces nav buttons */
    .submitting-msg {
      font-size: 0.93rem;
      color: var(--text-muted);
      padding: 10px 0;
      display: none;
    }
    .submitting-msg.visible { display: block; }

    /* ===== NAVIGATION BUTTONS ===== */
    .nav-buttons {
      display: flex;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
    }

    /* ===== BUTTON STYLES ===== */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      border-radius: var(--radius-sm);
      font-size: 0.93rem;
      font-weight: 500;
      padding: 11px 22px;
      cursor: pointer;
      border: none;
      transition: background 0.18s, color 0.18s, opacity 0.18s, transform 0.12s;
      font-family: var(--font-ui);
      text-decoration: none;
      letter-spacing: 0.01em;
    }

    .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .btn:active { transform: scale(0.98); }

    .btn-primary {
      background: var(--accent);
      color: #fff;
    }
    .btn-primary:hover { background: var(--accent-hover); }

    .btn-secondary {
      background: var(--btn-secondary-bg);
      color: var(--text-secondary);
      border: 1px solid var(--border);
    }
    .btn-secondary:hover { background: var(--btn-secondary-hover); color: var(--text-primary); }

    .btn-outline {
      background: transparent;
      color: var(--accent);
      border: 1.5px solid var(--accent);
    }
    .btn-outline:hover { background: var(--accent-light); }

    .btn-reset {
      background: transparent;
      color: var(--text-muted);
      border: none;
      font-size: 0.82rem;
      padding: 8px 10px;
      text-decoration: underline;
      cursor: pointer;
      font-family: var(--font-ui);
    }
    .btn-reset:hover { color: var(--text-secondary); }
    .btn-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

    /* ===== HIDDEN UTILITY ===== */
    .hidden { display: none !important; }

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

    /* ===== RESPONSIVE ADJUSTMENTS ===== */
    @media (max-width: 520px) {
      .intro-card { padding: 24px 18px; }
      .intro-card h1 { font-size: 1.35rem; }
      .question-card { padding: 22px 16px 20px; }
      .question-text { font-size: 1.05rem; }
      .header-inner { padding: 12px 16px; }
      .main-content { padding: 20px 14px 50px; }
      .nav-buttons { flex-direction: column; align-items: stretch; }
      .nav-buttons .btn { text-align: center; }
    }

    @media (min-width: 600px) {
      .likert-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
      }
      /* Last item spans full width if odd count */
      .likert-group .likert-option:last-child:nth-child(odd) {
        grid-column: 1 / -1;
      }
    }

    @media (min-width: 760px) {
      .likert-group {
        display: flex;
        flex-direction: row;
        gap: 8px;
      }
      .likert-group .likert-option {
        flex: 1;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
        padding: 14px 8px;
      }
      .likert-value { margin-left: 0; }
      /* Last item normal on desktop */
      .likert-group .likert-option:last-child:nth-child(odd) {
        grid-column: auto;
      }
    }