/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; color: #222; background: #f5f5f5; }
a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }
kbd { display: inline-block; padding: 1px 5px; font-size: 11px; background: #e8e8e8; border: 1px solid #bbb; border-radius: 3px; font-family: monospace; }

/* ---- Top navigation ---- */
.topnav { display: flex; align-items: center; gap: 16px; padding: 8px 20px; background: #fff; border-bottom: 1px solid #ddd; flex-shrink: 0; }
.nav-link { padding: 4px 12px; border-radius: 4px; font-weight: 500; }
.nav-link.active { background: #1a73e8; color: #fff; }
.nav-status { margin-left: auto; color: #666; font-size: 13px; }

main { padding: 0; height: calc(100vh - 41px); overflow: hidden; }

/* ---- Split layout (iframe left, form right) ---- */
.split-layout { display: flex; height: 100%; }

.split-left { flex: 1; display: flex; flex-direction: column; border-right: 1px solid #ddd; min-width: 0; }
.iframe-header { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #fff; border-bottom: 1px solid #ddd; flex-shrink: 0; flex-wrap: wrap; }
.progress-badge { background: #1a73e8; color: #fff; padding: 3px 10px; border-radius: 12px; font-weight: 600; font-size: 13px; }
.site-badge { background: #e8e8e8; padding: 3px 10px; border-radius: 12px; font-size: 13px; }
.open-tab { font-size: 11px; color: #666; }
.timer { margin-left: auto; font-family: monospace; font-size: 16px; color: #666; }

.iframe-wrap { flex: 1; position: relative; }
.iframe-wrap iframe { width: 100%; height: 100%; border: none; }
.iframe-fallback { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: #888; }

.split-right { width: 420px; flex-shrink: 0; overflow-y: auto; padding: 16px 20px; background: #fff; }

/* ---- Question box ---- */
.question-box { margin-bottom: 16px; padding: 12px 16px; background: #f0f7ff; border: 1px solid #b3d4fc; border-radius: 6px; }
.question-box h2 { font-size: 16px; margin-bottom: 8px; line-height: 1.3; }
.question-box details { font-size: 13px; color: #444; }
.question-box summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; color: #1a73e8; }
.question-box ul { margin: 4px 0 8px 20px; }
.question-box li { margin-bottom: 2px; }
.question-box p { margin: 6px 0 2px; }

/* ---- Decision form ---- */
.decision-row { margin-bottom: 14px; }
.radio-group { display: flex; gap: 8px; }
.radio-btn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2px solid #ddd; border-radius: 6px; cursor: pointer; transition: border-color 0.15s; flex: 1; justify-content: center; }
.radio-btn:hover { border-color: #999; }
.radio-btn input[type="radio"] { margin: 0; }
.radio-btn input[type="radio"]:checked ~ span { font-weight: 600; }
.radio-yes input[type="radio"]:checked ~ span { color: #155724; }
.radio-yes:has(input:checked) { border-color: #28a745; background: #d4edda; }
.radio-no input[type="radio"]:checked ~ span { color: #721c24; }
.radio-no:has(input:checked) { border-color: #dc3545; background: #f8d7da; }
.radio-uncertain input[type="radio"]:checked ~ span { color: #856404; }
.radio-uncertain:has(input:checked) { border-color: #ffc107; background: #fff3cd; }

/* Extraction fields */
.extraction-fields { background: #f9f9f9; border: 1px solid #ddd; border-radius: 4px; padding: 10px 14px; margin-bottom: 10px; }
.field-row { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.field-row label { flex: 1; min-width: 150px; font-size: 12px; font-weight: 500; }
.field-row label small { font-weight: 400; color: #888; }
.field-row input, .field-row select { display: block; width: 100%; padding: 5px 8px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; margin-top: 2px; }

/* Rejection fields */
.rejection-fields { margin-bottom: 10px; }
.rejection-fields label { font-size: 12px; font-weight: 500; }
.rejection-fields select { padding: 5px 8px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; margin-top: 2px; }

/* Note */
.note-row { margin-bottom: 12px; }
.note-row label { font-size: 12px; font-weight: 500; display: block; }
.note-row input { display: block; width: 100%; padding: 5px 8px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; margin-top: 2px; }

/* Submit */
.submit-row { margin-bottom: 20px; }
.submit-row button { width: 100%; padding: 10px 28px; background: #1a73e8; color: #fff; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; font-weight: 600; }
.submit-row button:hover { background: #155ab6; }

/* ---- Done banner ---- */
.done-banner { text-align: center; padding: 60px 20px; }
.done-banner h1 { margin-bottom: 10px; }

/* ---- Dashboard ---- */
.dashboard { max-width: 900px; margin: 20px auto; padding: 0 20px; }
.dashboard h1 { margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 16px; text-align: center; }
.stat-card.positive { border-left: 4px solid #28a745; }
.stat-card.negative { border-left: 4px solid #dc3545; }
.stat-card.uncertain-card { border-left: 4px solid #ffc107; }
.stat-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: #666; text-transform: uppercase; }

.progress-bar { height: 6px; background: #e8e8e8; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: #1a73e8; border-radius: 3px; transition: width 0.3s; }

.dashboard-actions { text-align: center; }
.btn { display: inline-block; padding: 10px 24px; background: #1a73e8; color: #fff; border-radius: 4px; font-weight: 600; }
.btn:hover { background: #155ab6; text-decoration: none; }
