﻿#quiz-container * {
    box-sizing: border-box;
  }

  #quiz-container {
    margin: 10px auto 30px;
    max-width: 980px;
  }

  #qz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
  }

  .qz-meta,
  .qz-score-badge,
  #qz-legend,
  .qz-q-number,
  .qz-q-text,
  .qz-option,
  .qz-explanation,
  .qz-page-btn,
  .qz-nav-btn,
  #qz-results,
  #qz-retry-btn {
    font-family: roboto, Arial, sans-serif;
  }

  .qz-meta {
    font-size: 10.5pt;
    color: rgb(120, 120, 120);
  }

  .qz-score-badge {
    font-size: 10.5pt;
    background: #eef0fa;
    color: rgb(0, 0, 128);
    border: 1px solid #c5cae9;
    border-radius: 20px;
    padding: 3px 14px;
  }

  #qz-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 9.5pt;
    color: rgb(130, 130, 130);
  }

  .qz-leg {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .qz-leg-dot {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    flex-shrink: 0;
  }

  #qz-progress-wrap {
    height: 5px;
    background: #e9ecef;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
  }

  #qz-progress-fill {
    height: 100%;
    width: 0%;
    background: rgb(0, 0, 128);
    border-radius: 3px;
    transition: width 0.4s ease;
  }

  .qz-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-left: 4px solid #dee2e6;
    border-radius: 6px;
    padding: 20px 22px;
    margin-bottom: 14px;
  }

  .qz-card.correct {
    border-left-color: #28a745;
  }

  .qz-card.wrong {
    border-left-color: #dc3545;
  }

  .qz-card.answered {
    border-left-color: #9fa8da;
  }

  .qz-q-number {
    font-size: 9pt;
    font-weight: 500;
    color: rgb(0, 0, 128);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
  }

  .qz-q-text {
    font-size: 12pt;
    color: #222;
    line-height: 1.6;
    margin-bottom: 14px;
    text-align: justify;
  }

  .qz-q-text a {
    color: rgb(0, 0, 128);
    font-size: 12pt;
  }

  .qz-options {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .qz-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 13px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11pt;
    color: #333;
    background: #fafafa;
    transition: background 0.12s, border-color 0.12s;
    user-select: none;
    line-height: 1.5;
  }

  .qz-option:hover:not(.locked) {
    background: #eef0fa;
    border-color: #9fa8da;
  }

  .qz-option input[type="radio"] {
    display: none;
  }

  .qz-option.selected {
    background: #eef0fa;
    border-color: rgb(0, 0, 128);
    color: rgb(0, 0, 128);
  }

  .qz-option.opt-correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
  }

  .qz-option.opt-wrong {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
  }

  .qz-option.locked {
    cursor: default;
  }

  .qz-option-dot {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    border: 2px solid #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    margin-top: 1px;
    flex-shrink: 0;
    transition: background 0.12s, border-color 0.12s;
  }

  .qz-option.selected .qz-option-dot {
    border-color: rgb(0, 0, 128);
    background: rgb(0, 0, 128);
    color: #fff;
  }

  .qz-option.opt-correct .qz-option-dot {
    border-color: #28a745;
    background: #28a745;
    color: #fff;
  }

  .qz-option.opt-wrong .qz-option-dot {
    border-color: #dc3545;
    background: #dc3545;
    color: #fff;
  }

  .qz-explanation {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-left: 3px solid #9fa8da;
    border-radius: 0 4px 4px 0;
    font-size: 11pt;
    color: #444;
    line-height: 1.65;
    text-align: justify;
  }

  .qz-explanation.show {
    display: block;
  }

  .qz-explanation.correct-exp {
    border-left-color: #28a745;
  }

  .qz-explanation.wrong-exp {
    border-left-color: #dc3545;
  }

  #qz-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 20px 0 8px;
  }

  .qz-page-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgb(0, 0, 128);
    border-radius: 4px;
    background: #fff;
    color: rgb(0, 0, 128);
    font-size: 10pt;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
  }

  .qz-page-btn:hover {
    background: #eef0fa;
  }

  .qz-page-btn.active-page {
    background: rgb(0, 0, 128);
    color: #fff;
    font-weight: 500;
  }

  .qz-page-btn.pg-done {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
  }

  .qz-page-btn.pg-partial {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
  }

  .qz-page-btn.pg-done.active-page,
  .qz-page-btn.pg-partial.active-page {
    background: rgb(0, 0, 128);
    color: #fff;
    border-color: rgb(0, 0, 128);
  }

  .qz-nav-btn {
    padding: 0 14px;
    height: 36px;
    border: 1px solid rgb(0, 0, 128);
    border-radius: 4px;
    background: #fff;
    color: rgb(0, 0, 128);
    font-size: 10.5pt;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.12s;
  }

  .qz-nav-btn:hover:not(:disabled) {
    background: #eef0fa;
  }

  .qz-nav-btn:disabled,
  .qz-page-btn:disabled {
    opacity: 0.38;
    cursor: default;
  }

  #qz-submit-row {
    text-align: right;
    margin: 10px 0 4px;
  }

  #qz-submit-btn {
    background: rgb(0, 0, 128);
    color: #fff;
    border-color: rgb(0, 0, 128);
    padding: 0 24px;
    height: 38px;
  }

  #qz-results {
    display: none;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 28px;
    margin-top: 14px;
    text-align: center;
  }

  #qz-results h3 {
    font-size: 15pt;
    font-weight: 500;
    color: rgb(0, 0, 128);
    padding: 0;
    margin: 0 0 4px;
  }

  .qz-big-score {
    font-size: 38pt;
    font-weight: 300;
    color: rgb(0, 0, 128);
    line-height: 1.1;
    margin: 10px 0 4px;
  }

  .qz-score-sub {
    font-size: 11pt;
    color: rgb(120, 120, 120);
    margin-bottom: 22px;
  }

  .qz-results-grid {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }

  .qz-res-box {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 12px 22px;
    min-width: 90px;
  }

  .qz-res-box .rn {
    font-size: 22pt;
    font-weight: 400;
  }

  .qz-res-box .rl {
    font-size: 10pt;
    color: rgb(120, 120, 120);
    margin-top: 2px;
  }

  .qz-res-box.rc .rn {
    color: #28a745;
  }

  .qz-res-box.rw .rn {
    color: #dc3545;
  }

  .qz-res-box.rs .rn {
    color: rgb(150, 150, 150);
  }

  #qz-retry-btn {
    margin-top: 4px;
    padding: 8px 30px;
    background: rgb(0, 0, 128);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 11pt;
    cursor: pointer;
  }

  #qz-retry-btn:hover,
  #qz-submit-btn:hover {
    opacity: 0.88;
  }

  @media (max-width: 640px) {
    .qz-card {
      padding: 16px 14px;
    }

    .qz-q-text {
      font-size: 11pt;
      text-align: left;
    }

    .qz-option {
      font-size: 10.5pt;
    }

    #qz-submit-row {
      text-align: center;
    }
  }
