/* SHSAT Practice Engine — neutral test-engine skin (not the Modernist system). */

.eng * { box-sizing: border-box; }
.eng { min-height: 100vh; display: flex; flex-direction: column; background: #e8e9ea; font-family: Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.eng mark { background: #ffe9a3; color: inherit; padding: 0 1px; }
.eng button { font-family: inherit; }
.eng [hidden] { display: none !important; }

.eng-word { font-family: "Archivo", sans-serif; font-weight: 800; letter-spacing: -0.02em; color: #fff; }

/* ── Section start screen ─────────────────────────────────────────── */
.eng-start { flex: 1; display: flex; flex-direction: column; background: #e8e9ea; }
.eng-start-bar { background: #3f4a54; border-bottom: 1px solid #2b333b; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.eng-start-body { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 56px 20px 60px; }
.eng-start-card-outer { width: 100%; max-width: 520px; background: #eef0f1; border: 1px solid #c0c4c7; border-radius: 4px; padding: 14px; }
.eng-start-card { background: #fff; border: 1px solid #c6cacd; border-radius: 4px; }
.eng-start-title { margin: 0; text-align: center; font-family: "Archivo", sans-serif; font-weight: 800; font-size: 30px; color: #201e1d; padding: 22px 20px 14px; word-wrap: break-word; }
.eng-start-count-wrap { padding: 0 20px 22px; border-bottom: 2px dashed #ccc; }
.eng-start-count { width: 60%; margin: 0 auto; background: #e4f0f7; border: 1px solid #b7d5e6; border-radius: 4px; padding: 12px 14px; text-align: center; }
.eng-start-count p { margin: 0; font-size: 18px; color: #20434f; }
.eng-start-actions { background: #efefef; padding: 22px 20px 28px; text-align: center; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.eng-btn { border: 1px solid #17527f; padding: 12px 34px; font-size: 16px; font-weight: 700; cursor: pointer; background: #1a5fa0; color: #fff; }
.eng-btn:hover { background: #154d84; }
.eng-btn-sm { padding: 8px 16px; font-size: 13px; }
.eng-btn-ghost { background: #f2f3f4; color: #2c3136; border: 1px solid #9aa1a7; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
.eng-btn-ghost:hover { background: #e2e4e6; }
.eng-btn-icon { background: #4a555f; color: #e6eaed; border: 1px solid #6b7580; padding: 6px 11px; font-size: 12px; cursor: pointer; }

/* ── Test chrome (toolbar + breadcrumb) ──────────────────────────── */
.eng-test { flex: 1; display: flex; flex-direction: column; }
.eng-toolbar { background: #3f4a54; border-bottom: 1px solid #2b333b; padding: 8px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eng-nav-pair { display: flex; gap: 1px; }
.eng-nav-pair button { color: #fff; padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid #17527f; }
.eng-nav-back { background: #1a5fa0; }
.eng-nav-back.is-disabled { background: #5a6a78; }
.eng-nav-next { background: #1a5fa0; }
.eng-nav-next:hover { background: #154d84; }
.eng-tool-group { display: flex; gap: 1px; margin-left: 6px; }
.eng-tool-btn { border: 1px solid #9aa1a7; padding: 8px 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: #f2f3f4; color: #2c3136; }
.eng-tool-btn.is-on { background: #3a6ea5; color: #fff; }
.eng-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.eng-timer { display: flex; align-items: center; gap: 8px; }
.eng-timer-text { font-size: 15px; font-weight: 700; color: #e6eaed; font-variant-numeric: tabular-nums; min-width: 76px; text-align: right; }
.eng-timer-text.is-warn { color: #ffb4a3; }
.eng-user-name { font-size: 13px; color: #d6dade; }

.eng-crumb { background: #f2f3f4; border-bottom: 1px solid #c6cacd; padding: 7px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eng-crumb span.sep { color: #a9aeb2; }
.eng-crumb-item { font-size: 12px; color: #4a5055; }
.eng-crumb-current { font-size: 12px; color: #201e1d; font-weight: 700; }
.eng-progress-wrap { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.eng-progress-track { width: 120px; height: 8px; background: #d9dcdf; border: 1px solid #c0c4c7; }
.eng-progress-fill { height: 100%; background: #1a5fa0; }
.eng-progress-text { font-size: 11px; color: #4a5055; font-variant-numeric: tabular-nums; }

/* ── Content pane ─────────────────────────────────────────────────── */
.eng-content { flex: 1; padding: 16px; background: var(--eng-bg, #e8e9ea); position: relative; }
.eng-pen-layer { position: absolute; inset: 16px; z-index: 20; }
.eng-pen-layer canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }

.eng-pane { display: flex; justify-content: center; }
.eng-pane-inner { width: 100%; max-width: 760px; }
.eng-intro-card { background: #fff; border: 1px solid #c6cacd; box-shadow: 0 1px 2px rgba(32, 30, 29, .12); }
.eng-intro-head { padding: 30px 26px; background: #eceae2; }
.eng-intro-head p { margin: 0 0 4px; text-align: center; font-size: 19px; color: #201e1d; }
.eng-intro-head .strong-sub { font-size: 21px; font-weight: 700; }
.eng-intro-head .grade { font-size: 21px; margin-bottom: 22px; }
.eng-intro-block { background: #fff; border-radius: 10px; padding: 20px 24px 22px; margin-bottom: 22px; }
.eng-intro-block h3 { margin: 0 0 10px; font-family: "Archivo", sans-serif; font-weight: 800; font-size: 20px; color: #201e1d; }
.eng-intro-block p { margin: 0 0 18px; font-size: 15px; line-height: 1.6; color: #2c3136; }
.eng-intro-block p.strong { margin: 0 0 2px; font-weight: 700; color: #201e1d; }
.eng-intro-block p.indent { padding-left: 22px; }
.eng-intro-block ul { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.6; color: #2c3136; }
.eng-intro-block ul li { margin-bottom: 14px; }
.eng-intro-foot { padding: 18px 24px 22px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.eng-intro-foot .hint { font-size: 13px; color: #6b7075; }
.eng-intro-note { margin: 18px 0 0; font-size: 12px; line-height: 1.6; color: #5f666c; }

.eng-directions { max-width: 900px; margin: 0 auto; background: var(--eng-pane, #fff); border: 1px solid #c6cacd; box-shadow: 0 1px 2px rgba(32, 30, 29, .1); padding: 28px 34px 34px; color: var(--eng-ink, #201e1d); font-size: var(--eng-font, 15px); }
.eng-directions .head { margin: 0 0 4px; text-align: center; font-size: 1.1em; font-weight: 700; letter-spacing: 0.04em; }
.eng-directions .note { margin: 0 0 20px; font-size: 1em; line-height: 1.65; text-wrap: pretty; }
.eng-directions .dir-label { margin: 26px 0 10px; text-align: center; font-size: 1em; font-weight: 700; }
.eng-directions .dir-body { margin: 0; font-size: 1em; line-height: 1.65; text-wrap: pretty; }

.eng-item-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; max-width: 1400px; margin: 0 auto; font-size: var(--eng-font, 15px); }
.eng-col { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; background: var(--eng-pane, #fff); border: 1px solid #c6cacd; box-shadow: 0 1px 2px rgba(32, 30, 29, .1); }
.eng-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #dcdfe2; }
.eng-col-kicker { font-size: 0.78em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--eng-muted, #6b7075); }
.eng-col-body { padding: 18px 20px 24px; overflow: auto; color: var(--eng-ink, #201e1d); }
.eng-expand-btn { background: transparent; border: 1px solid #b3b8bc; color: var(--eng-ink, #201e1d); padding: 3px 9px; font-size: 0.75em; cursor: pointer; }
.eng-passage-title { margin: 0 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 1.18em; font-weight: 700; }
.eng-passage-para { margin: 0 0 13px; font-family: Georgia, "Times New Roman", serif; font-size: 1em; line-height: 1.72; text-wrap: pretty; }
.eng-col-head-right { display: flex; align-items: center; gap: 8px; }
.eng-tool-hint { font-size: 0.75em; color: var(--eng-muted, #6b7075); }
.eng-stem { margin: 0 0 18px; font-size: 1.02em; line-height: 1.6; font-weight: 600; text-wrap: pretty; }

.eng-grid-answer { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.eng-grid-answer label { font-size: 0.82em; color: var(--eng-muted, #6b7075); }
.eng-grid-answer input { padding: 12px 14px; font-size: 1.3em; font-variant-numeric: tabular-nums; letter-spacing: 0.14em; border: 1px solid #9aa1a7; background: #fff; color: #201e1d; width: 100%; }
.eng-grid-answer .hint { font-size: 0.78em; color: var(--eng-muted, #6b7075); }

.eng-choices { display: flex; flex-direction: column; gap: 9px; }
.eng-choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid; cursor: pointer; }
.eng-choice-letter { flex: none; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.86em; border-radius: 50%; border: 1px solid; }
.eng-choice-text { font-size: 1em; line-height: 1.55; }

/* ── Floating pencil tools ────────────────────────────────────────── */
.eng-pencil-tools { position: fixed; right: 10px; top: 160px; z-index: 40; display: flex; flex-direction: column; gap: 1px; }
.eng-pencil-tools button { border: 1px solid #16191c; padding: 10px 12px; font-size: 14px; cursor: pointer; }
.eng-pencil-tools .active { background: #2c3136; color: #fff; }
.eng-pencil-tools .pass { background: #3f4a54; color: #e6eaed; }
.eng-pencil-tools .pass.is-disabled { color: #79838c; }

/* ── Notepad ──────────────────────────────────────────────────────── */
.eng-notepad { position: fixed; z-index: 60; width: 320px; background: #fff; border: 1px solid #8f959a; box-shadow: 0 12px 32px rgba(32, 30, 29, .28); }
.eng-notepad-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: #3f4a54; color: #fff; cursor: move; }
.eng-notepad-head span { font-size: 13px; font-weight: 700; }
.eng-notepad-close { background: transparent; border: 0; color: #fff; font-size: 15px; cursor: pointer; line-height: 1; }
.eng-notepad textarea { width: 100%; height: 190px; border: 0; background: #fff; caret-color: #1a5fa0; padding: 12px; font-size: 13px; line-height: 1.6; resize: none; outline: none; color: #201e1d; box-sizing: border-box; }

/* ── Line reader mask ─────────────────────────────────────────────── */
.eng-lr { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.eng-lr-shade { position: absolute; left: 0; right: 0; background: rgba(32, 30, 29, .62); }
.eng-lr-band { position: absolute; left: 0; right: 0; height: 74px; border-top: 2px solid #ffd34d; border-bottom: 2px solid #ffd34d; cursor: grab; pointer-events: auto; }

/* ── Modals ───────────────────────────────────────────────────────── */
.eng-modal-backdrop { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(32, 30, 29, .5); }
.eng-modal { width: min(440px, 100%); background: #fff; border: 1px solid #8f959a; box-shadow: 0 18px 44px rgba(32, 30, 29, .34); }
.eng-modal.wide { width: min(620px, 100%); max-height: 82vh; overflow: auto; }
.eng-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: #3f4a54; color: #fff; }
.eng-modal-head.sticky { position: sticky; top: 0; }
.eng-modal-head.warn { background: #8a5a00; }
.eng-modal-head span { font-size: 15px; font-weight: 700; }
.eng-modal-body { padding: 20px 18px; }
.eng-modal-body p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: #2c3136; }
.eng-modal-body p:last-child { margin-bottom: 0; }
.eng-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid #dcdfe2; }
.eng-modal-actions.sticky { position: sticky; bottom: 0; background: #fff; }
.eng-modal-close { background: transparent; border: 1px solid #6b7580; color: #fff; padding: 5px 11px; font-size: 12px; cursor: pointer; }

.eng-review-rows { padding: 6px 0 10px; }
.eng-review-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #e7e9eb; cursor: pointer; }
.eng-review-row .n { flex: none; width: 30px; font-weight: 700; font-size: 13px; color: #201e1d; font-variant-numeric: tabular-nums; }
.eng-review-row .label { flex: 1; min-width: 0; font-size: 13px; color: #2c3136; }
.eng-review-row .flag { flex: none; font-size: 12px; color: #6b7075; }
.eng-review-row .status { flex: none; font-size: 12px; font-weight: 700; }

/* ── User menu / contrast dialog ──────────────────────────────────── */
.eng-user-menu-backdrop { position: fixed; inset: 0; z-index: 100; }
.eng-user-menu { position: absolute; right: 12px; top: 50px; width: 280px; background: #fff; border: 1px solid #8f959a; box-shadow: 0 12px 32px rgba(32, 30, 29, .3); }
.eng-user-menu button { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #e7e9eb; padding: 11px 14px; font-size: 13px; color: #1a5fa0; cursor: pointer; }
.eng-user-menu button:last-child { border-bottom: 0; }
.eng-user-menu button:hover { background: #f2f6fa; }

.eng-contrast-options { padding: 10px 0; }
.eng-contrast-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; cursor: pointer; }
.eng-contrast-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1px solid #6b7075; }
.eng-contrast-sample { flex: none; padding: 4px 10px; border: 1px solid #201e1d; font-size: 13px; }
.eng-contrast-label { font-size: 13px; color: #2c3136; }

/* ── Score report ─────────────────────────────────────────────────── */
.eng-report { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 44px 20px 64px; background: #e8e9ea; }
.eng-report-inner { width: 100%; max-width: 820px; }
.eng-report-brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.eng-report-brand .word { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: #201e1d; }
.eng-report-brand .sub { font-size: 12px; color: #6b7075; letter-spacing: 0.04em; text-transform: uppercase; }
.eng-report-card { background: #fff; border: 1px solid #c6cacd; box-shadow: 0 1px 2px rgba(32, 30, 29, .12); }
.eng-report-summary { padding: 28px 26px 24px; border-bottom: 1px solid #dcdfe2; display: flex; gap: 32px; align-items: flex-end; flex-wrap: wrap; }
.eng-report-summary .stat-label { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: #6b7075; margin-bottom: 6px; }
.eng-report-composite { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 64px; line-height: 1; color: #201e1d; font-variant-numeric: tabular-nums; }
.eng-report-summary .stat-sub { font-size: 12px; color: #6b7075; margin-top: 6px; }
.eng-report-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.eng-report-stat-value { font-size: 26px; font-weight: 700; color: #201e1d; font-variant-numeric: tabular-nums; }
.eng-result-rows { padding: 8px 0 6px; }
.eng-result-row { display: flex; align-items: center; gap: 14px; padding: 11px 26px; border-bottom: 1px solid #eef0f1; }
.eng-result-row .n { flex: none; width: 28px; font-weight: 700; font-size: 13px; color: #201e1d; font-variant-numeric: tabular-nums; }
.eng-result-row .label { flex: 1; min-width: 0; font-size: 13px; color: #2c3136; }
.eng-result-row .given, .eng-result-row .answer { flex: none; font-size: 13px; color: #6b7075; font-variant-numeric: tabular-nums; }
.eng-result-row .mark { flex: none; width: 80px; text-align: right; font-size: 12px; font-weight: 700; }
.eng-report-actions { display: flex; gap: 12px; padding: 18px 26px 22px; flex-wrap: wrap; }
.eng-report-note { margin: 18px 0 0; font-size: 12px; line-height: 1.6; color: #5f666c; }
