.lmt-quiz-container { width: 100%; max-width: 760px; margin: 30px auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; box-sizing: border-box; }
.lmt-card { background: #fff; border: 1px solid #dce1e7; border-radius: 8px; padding: 30px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); max-width: 760px; margin: 0 auto; box-sizing: border-box; }
.lmt-card h2 { margin-top: 0; color: #1a365d; }
.lmt-subtitle { color: #555; margin-bottom: 20px; }
.lmt-field { margin-bottom: 16px; }
.lmt-field label { display: block; font-weight: 600; margin-bottom: 6px; color: #222; }
.lmt-field input, .lmt-field textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccd2d9; border-radius: 5px; font-size: 15px; box-sizing: border-box; font-family: inherit; }
.lmt-field textarea#lmt-access-code { font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 1.45; resize: vertical; word-break: break-all; }
.lmt-btn-start, .lmt-btn-next { background: #1a365d; color: #fff; border: none; padding: 12px 24px; font-size: 16px; font-weight: 600; border-radius: 5px; cursor: pointer; width: 100%; margin-top: 6px; box-sizing: border-box; }
.lmt-btn-next:disabled { background: #9aa7b8; cursor: not-allowed; }
.lmt-error { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 5px; margin-bottom: 12px; }
.lmt-no-copy { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }

/* Fullscreen Exam Mode (100vw x 100vh locked viewport) */
body.lmt-exam-locked { overflow: hidden !important; }
#lmt-step-question.lmt-card-wide {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border: none;
    border-radius: 0;
    padding: 18px 32px 20px 32px;
    z-index: 99999;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    overflow-y: auto;
}

.lmt-exam-inner {
    width: 100%;
    max-width: 1520px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #dce1e7;
    border-radius: 8px;
    padding: 18px 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    box-sizing: border-box;
}

.lmt-exam-top { flex: 0 0 auto; }
.lmt-q-header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 16px; color: #1a365d; margin-bottom: 8px; }
.lmt-timer { background: #eef2ff; color: #1a365d; padding: 5px 14px; border-radius: 20px; font-variant-numeric: tabular-nums; }
.lmt-timer.is-danger { background: #fee2e2; color: #dc2626; animation: lmtPulse 1s infinite; }
@keyframes lmtPulse { 50% { opacity: 0.6; } }
.lmt-progress-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
#lmt-progress-fill { height: 100%; background: #c5a059; width: 0%; transition: width 0.3s ease; }

/* Two-column question body: 1/4 (25%) image on left, 3/4 (75%) text on right */
.lmt-q-body-grid {
    flex: 1 1 auto;
    display: flex;
    gap: 24px;
    align-items: stretch;
    min-height: 0;
    margin-bottom: 14px;
}
.lmt-q-image-col {
    flex: 0 0 25%;
    max-width: 25%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    box-sizing: border-box;
    cursor: zoom-in;
    overflow: hidden;
}
.lmt-q-image-col img {
    max-width: 100%;
    max-height: var(--lmt-img-max-h, 240px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}
.lmt-img-zoom-hint { display: block; font-size: 11px; color: #64748b; margin-top: 4px; flex: 0 0 auto; }
.lmt-q-text-col {
    flex: 1 1 75%;
    display: flex;
    align-items: center;
    overflow-y: auto;
    padding-right: 6px;
}
.lmt-q-text { font-size: 18px; font-weight: 600; color: #111; line-height: 1.5; }

/* Reserved bottom zone: 3 options + Next button */
.lmt-exam-bottom { flex: 0 0 auto; width: 100%; }
.lmt-options-list { width: 100%; }
.lmt-option-item {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 9px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 15.5px;
    line-height: 1.35;
}
.lmt-option-item:hover { border-color: #1a365d; background: #f8fafc; }
.lmt-option-item.selected { border-color: #1a365d; background: #eff6ff; font-weight: 600; }
.lmt-option-item input { margin-right: 12px; transform: scale(1.2); flex: 0 0 auto; }
.lmt-finish-box { text-align: center; padding: 50px 30px; }
.lmt-check-icon { width: 64px; height: 64px; line-height: 64px; background: #dcfce7; color: #16a34a; font-size: 32px; border-radius: 50%; margin: 0 auto 20px auto; }

/* Lightbox for diagram enlargement */
.lmt-lightbox { position: fixed; z-index: 999999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.lmt-lightbox img { max-width: 94%; max-height: 92%; border-radius: 6px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); background: #fff; }
.lmt-lightbox-close { position: absolute; top: 18px; right: 28px; color: #fff; font-size: 36px; font-weight: bold; cursor: pointer; line-height: 1; }

/* Responsive stack on mobile/tablet */
@media (max-width: 768px) {
    #lmt-step-question.lmt-card-wide { padding: 10px; }
    .lmt-exam-inner { padding: 14px; }
    .lmt-q-body-grid { flex-direction: column; gap: 12px; }
    .lmt-q-image-col { flex: none; max-width: 100%; width: 100%; }
    .lmt-q-text { font-size: 16px; }
}

/* Operator Generator Styles */
.lmt-operator-box { max-width: 760px; background: #fff; border: 1px solid #ccd0d4; padding: 24px; border-radius: 6px; margin-top: 15px; box-sizing: border-box; }
.lmt-op-row { margin-bottom: 16px; }
.lmt-op-row label { display: block; font-weight: 600; margin-bottom: 6px; }
.lmt-op-row select, .lmt-op-row input { width: 100%; max-width: 340px; padding: 8px; }
.lmt-op-hint { display: block; margin-top: 5px; color: #2271b1; font-size: 13px; }
.lmt-btn-primary { background: #1a365d; color: #fff; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.lmt-btn-primary-sm { background: #1a365d; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.lmt-btn-secondary { background: #f0f0f1; border: 1px solid #8c8f94; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.lmt-op-result { margin-top: 20px; padding: 16px; background: #f6f7f7; border-left: 4px solid #1a365d; }
.lmt-code-textarea { width: 100%; font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 1.45; background: #fff; padding: 8px 10px; border: 1px solid #ccd0d4; border-radius: 4px; box-sizing: border-box; word-break: break-all; resize: vertical; color: #111; }
.lmt-code-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.lmt-direct-link-box { width: 100%; font-family: Consolas, Monaco, monospace; font-size: 12px; background: #fff; border: 1px solid #ccd0d4; padding: 6px 8px; border-radius: 4px; margin-top: 4px; box-sizing: border-box; color: #333; }
.lmt-balance-bar { margin: 12px 0; }
.lvl-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; margin-right: 4px; background: #e2e8f0; }
