:root {
    --primary-color: #0066ff;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --border-color: #e9ecef;
    --progress-height: 6px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    height: var(--progress-height);
    position: fixed;
    top: 0;
    z-index: 100;
}
.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* Header */
header {
    padding: 20px 20px 10px;
    background: white;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-top: var(--progress-height);
}
h1 {
    font-size: 1.1rem;
    margin: 0;
    color: #111;
}
.step-indicator {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

/* Main Content Area */
.quiz-container {
    flex: 1;
    padding: 20px;
    padding-bottom: 120px; /* Added to prevent overlap with fixed nav */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.question-wrapper {
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.3s ease-in-out;
}

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

.question-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    word-break: keep-all;
}

.question-sub {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    display: block;
    word-break: keep-all;
}

.ref-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

/* Options */
.option-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.option-label {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.option-label.selected {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
    font-weight: bold;
}

.option-label input {
    margin-right: 12px;
    margin-top: 4px;
    transform: scale(1.3);
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.input-text {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 10px;
    box-sizing: border-box;
}

/* Matrix Style */
.matrix-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}
.matrix-title {
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
    font-size: 0.95rem;
}
.matrix-options {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}
.matrix-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    text-align: center;
    width: 25%;
    cursor: pointer;
}
.matrix-opt input {
    margin-bottom: 5px;
    transform: scale(1.2);
}

/* Notice Screen */
.notice-screen {
    text-align: center;
    padding: 40px 20px;
}
.notice-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

/* Navigation Buttons */
.nav-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;

    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}

.btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

.btn-prev {
    background-color: #e9ecef;
    color: #555;
    flex: 0.4;
}

.btn-next {
    background-color: var(--primary-color);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}