/* ================================================================
   Online SATs test (exam-player.js)
   ================================================================ */
#screenTest.is-exam .test-view-tabs,
#screenTest.is-exam .test-body { display: none !important; }
#screenTest:not(.is-exam) #examBody { display: none; }

.exam {
  --ex-ink: #1f1b3d;
  --ex-accent: var(--violet);
  --ex-card: #fff;
  --ex-bg: #f4f3fa;
  max-width: 1400px; margin: 0 auto; padding: 12px 16px 16px;
  height: calc(100vh - 96px); height: calc(100dvh - 96px);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
}
.exam.has-text { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.exam.is-start, .exam.is-results { display: block; overflow: auto; }

/* ---------- start card */
.ex-start { display: flex; justify-content: center; padding: 20px 0 40px; }
.ex-start-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 32px 36px; max-width: 640px; width: 100%; text-align: center; animation: exRise .45s cubic-bezier(.2,.9,.3,1.2); }
.ex-start-icon { font-size: 3rem; line-height: 1; }
.ex-start-kicker { font-weight: 900; letter-spacing: .06em; text-transform: uppercase; font-size: .78rem; color: var(--violet); margin-top: 10px; }
.ex-start-card h2 { font-family: var(--font-display); font-size: 1.7rem; color: var(--ex-ink); margin: 6px 0 18px; }
.ex-facts { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ex-facts div { background: var(--violet-soft); border-radius: 16px; padding: 10px 16px; min-width: 88px; }
.ex-facts strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--violet-deep); line-height: 1.1; }
.ex-facts span { font-size: .78rem; font-weight: 800; color: var(--ink-soft); }
.ex-rules { text-align: left; list-style: none; display: grid; gap: 8px; margin: 0 auto 22px; max-width: 520px; }
.ex-rules li { position: relative; padding-left: 26px; font-weight: 700; color: var(--ink-soft); line-height: 1.45; }
.ex-rules li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--go); font-weight: 900; }
.ex-start-btns { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.ex-last { margin-top: 14px; }

/* ---------- main column */
.ex-main { display: flex; flex-direction: column; min-height: 0; gap: 10px; }
.ex-nav { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; flex-shrink: 0; }
.ex-pill { flex: 0 0 auto; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 12px; border: none; cursor: pointer; font: inherit; font-weight: 900; font-size: .85rem;
  background: #fff; color: var(--ink-soft); box-shadow: inset 0 0 0 2px var(--line); position: relative; transition: transform .15s, background .15s; }
.ex-pill:hover { transform: translateY(-2px); }
.ex-pill.is-done { background: var(--violet-soft); color: var(--violet-deep); box-shadow: inset 0 0 0 2px #c4b5fd; }
.ex-pill.is-current { background: var(--violet); color: #fff; box-shadow: 0 4px 0 var(--violet-deep); }
.ex-pill.is-flag::after { content: ''; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 2px #fff; }

.ex-stage { flex: 1; min-height: 0; overflow: auto; border-radius: var(--r-lg); }
.ex-card { background: var(--ex-card); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 22px 26px 26px; transition: opacity .25s, transform .25s; color: var(--ex-ink); }
.ex-card.is-enter { opacity: 0; transform: translateX(18px); }
.ex-qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.ex-qnum { min-width: 44px; height: 44px; padding: 0 8px; border-radius: 14px; background: var(--violet); color: #fff; font-family: var(--font-display); font-size: 1.25rem; display: flex; align-items: center; justify-content: center; }
.ex-qmeta { font-weight: 800; color: var(--muted); font-size: .85rem; flex: 1; }
.ex-marks { font-weight: 900; font-size: .8rem; background: var(--sun-soft); color: #92400e; padding: 4px 10px; border-radius: 99px; }
.ex-icon { border: none; background: var(--violet-soft); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 1.05rem; transition: transform .15s; filter: grayscale(.4); }
.ex-icon:hover { transform: scale(1.08); filter: none; }
.ex-icon.is-on { background: var(--sun-soft); filter: none; box-shadow: inset 0 0 0 2px var(--sun); }

.ex-stem { font-size: 1.08rem; line-height: 1.55; color: var(--ink-soft); background: #faf9fe; border-left: 4px solid #c4b5fd; padding: 10px 14px; border-radius: 0 12px 12px 0; margin-bottom: 12px; }
.ex-prompt { font-size: 1.2rem; line-height: 1.6; font-weight: 700; }
.ex-prompt.is-sum { font-family: var(--font-display); font-size: 2rem; font-weight: 600; letter-spacing: .01em; padding: 14px 0 6px; }
.ex-prompt .frac { font-size: .95em; vertical-align: middle; }
.ex-sub { margin-top: 6px; font-weight: 800; color: var(--violet-deep); }
.ex-fig { margin: 16px 0 6px; text-align: center; }
.ex-fig img { max-width: 100%; max-height: 52vh; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); background: #fff; }

/* column / bus-stop calculations */
.ex-calc { font-family: var(--font-display); font-size: 2rem; margin: 10px 0 4px 6px; font-variant-numeric: tabular-nums; }
.ex-calc.is-col { display: inline-grid; justify-items: end; letter-spacing: .25em; }
.ex-calc.is-col .op { margin-right: .5em; letter-spacing: 0; }
.ex-calc.is-col .rule { width: 100%; border-top: 3px solid var(--ex-ink); height: 1.2em; margin-top: 4px; border-bottom: 3px solid var(--ex-ink); }
.ex-calc.is-div { display: inline-flex; align-items: flex-end; letter-spacing: .25em; margin-top: 24px; }
.ex-calc.is-div .dv { padding-right: .3em; letter-spacing: 0; }
.ex-calc.is-div .dd { border-left: 3px solid var(--ex-ink); border-top: 3px solid var(--ex-ink); padding: 2px 0 0 .35em; border-top-left-radius: 0 0; }

/* ---------- answer controls */
.ex-answer { margin-top: 18px; }
.ex-box { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 6px 10px; box-shadow: inset 0 0 0 3px #a5b4fc; transition: box-shadow .15s; }
.ex-box:focus-within { box-shadow: inset 0 0 0 3px var(--violet), 0 0 0 5px var(--violet-soft); }
.ex-unit { font-weight: 900; color: var(--ink-soft); font-size: 1.15rem; }
.ex-input { border: none; outline: none; font: inherit; font-size: 1.35rem; font-weight: 800; color: var(--ex-ink); width: 11ch; min-width: 0; padding: 6px 4px; background: transparent; }
.ex-input::placeholder { color: #c7c4dc; font-weight: 700; }
.ex-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.ex-flabel { font-weight: 900; color: var(--violet-deep); }
.ex-hint { margin-top: 8px; font-size: .85rem; font-weight: 800; color: var(--muted); }

.ex-options { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ex-opt { display: flex; align-items: center; gap: 12px; text-align: left; border: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 1.05rem; color: var(--ex-ink);
  background: #fff; padding: 12px 14px; border-radius: 14px; box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow .15s, background .15s, transform .1s; }
.ex-opt:hover { box-shadow: inset 0 0 0 2px #c4b5fd; }
.ex-opt:active { transform: scale(.98); }
.ex-tick { flex: 0 0 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 2px #a5a1c8; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; }
.ex-opt.is-on { background: var(--violet-soft); box-shadow: inset 0 0 0 2px var(--violet); }
.ex-opt.is-on .ex-tick { background: var(--violet); box-shadow: none; }
.ex-opt.is-on .ex-tick::after { content: '✓'; }

.ex-table-wrap { overflow-x: auto; }
.ex-table { border-collapse: separate; border-spacing: 0; min-width: 100%; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 2px var(--line); }
.ex-table th, .ex-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.ex-table thead th { background: var(--violet-soft); color: var(--violet-deep); font-weight: 900; font-size: .9rem; }
.ex-table tbody th { text-align: left; font-weight: 700; }
.ex-table tbody tr:last-child > * { border-bottom: none; }
.ex-cell { width: 34px; height: 34px; border-radius: 9px; border: none; cursor: pointer; background: #fff; box-shadow: inset 0 0 0 2px #a5a1c8; color: #fff; font-weight: 900; font-size: 1.1rem; }
.ex-cell.is-on { background: var(--violet); box-shadow: none; }
.ex-cell.is-on::after { content: '✓'; }

.ex-match { display: grid; gap: 10px; }
.ex-mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; background: #faf9fe; padding: 8px 10px; border-radius: 14px; }
.ex-mleft { font-weight: 800; }
.ex-marrow { color: var(--violet); font-weight: 900; }
.ex-select { font: inherit; font-weight: 800; padding: 9px 10px; border-radius: 12px; border: none; box-shadow: inset 0 0 0 2px #a5b4fc; background: #fff; color: var(--ex-ink); max-width: 100%; }

.ex-order { list-style: none; display: grid; gap: 8px; max-width: 520px; }
.ex-order li { display: flex; align-items: center; gap: 10px; background: #fff; padding: 8px 10px; border-radius: 14px; box-shadow: inset 0 0 0 2px var(--line); animation: exRise .25s; }
.ex-ordn { width: 28px; height: 28px; border-radius: 50%; background: var(--violet-soft); color: var(--violet-deep); font-weight: 900; display: flex; align-items: center; justify-content: center; font-size: .85rem; }
.ex-ordt { flex: 1; font-weight: 800; font-size: 1.1rem; }
.ex-mv { border: none; background: var(--violet-soft); color: var(--violet-deep); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-weight: 900; }
.ex-mv:disabled { opacity: .3; cursor: default; }

.ex-sentence { font-size: 1.2rem; line-height: 2.3; font-weight: 600; }
.ex-word { border: none; background: none; font: inherit; color: inherit; cursor: pointer; padding: 1px 5px; border-radius: 99px; transition: background .15s, box-shadow .15s; }
.ex-word:hover { background: var(--violet-soft); }
.ex-word.is-on { box-shadow: 0 0 0 2.5px var(--violet); background: #f5f3ff; }
.ex-spot { display: inline-block; vertical-align: middle; width: 26px; height: 26px; margin: 0 3px; border: none; border-radius: 7px; cursor: pointer; background: #fff; box-shadow: inset 0 0 0 2px #a5a1c8; color: #fff; font-weight: 900; }
.ex-spot.is-on { background: var(--violet); box-shadow: none; }
.ex-spot.is-on::after { content: '✓'; }
.ex-gaps .ex-gap { width: 9ch; border-bottom: 3px solid #a5b4fc; border-radius: 6px 6px 0 0; background: #f5f3ff; font-size: 1.1rem; text-align: center; margin: 0 4px; }
.ex-gaps .ex-select { margin: 0 4px; }
.ex-long { width: 100%; font: inherit; font-size: 1.1rem; line-height: 1.7; padding: 12px 14px; border-radius: 14px; border: none; box-shadow: inset 0 0 0 3px #a5b4fc; resize: vertical; color: var(--ex-ink);
  background: repeating-linear-gradient(#fff 0 calc(1.7em - 1px), #e8e6f5 calc(1.7em - 1px) 1.7em); background-attachment: local; background-position: 0 12px; }
.ex-long:focus { outline: none; box-shadow: inset 0 0 0 3px var(--violet), 0 0 0 5px var(--violet-soft); }

/* drawing on a diagram */
.ex-drawwrap { display: grid; gap: 8px; }
.ex-drawstage { position: relative; display: inline-block; max-width: 100%; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 2px #a5b4fc; background: #fff; justify-self: start; }
.ex-drawstage img { display: block; max-width: 100%; max-height: 60vh; }
.ex-drawstage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.ex-drawblank { width: min(560px, 80vw); height: 320px; }

/* working space */
.ex-work { margin-top: 22px; border-radius: 16px; background: #fbfbff; box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; }
.ex-work-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px 8px 14px; border-bottom: 2px solid var(--line); background: #fff; }
.ex-work-head strong { color: var(--violet-deep); }
.ex-work-head > span { font-size: .82rem; font-weight: 700; color: var(--muted); flex: 1; }
.ex-work-pad { display: block; width: 100%; height: 280px; touch-action: none; cursor: crosshair;
  background-color: #fff; background-image: linear-gradient(#e3e9f7 1px, transparent 1px), linear-gradient(90deg, #e3e9f7 1px, transparent 1px); background-size: 22px 22px; }
.sk-tools { display: flex; gap: 4px; }
.sk-btn { border: none; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 800; color: var(--ink-soft); background: transparent; padding: 6px 9px; border-radius: 10px; display: inline-flex; gap: 4px; align-items: center; }
.sk-btn:hover { background: var(--violet-soft); }
.sk-btn.is-on { background: var(--violet); color: #fff; }

/* footer */
.ex-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.ex-count { font-weight: 800; color: var(--muted); font-size: .85rem; text-align: center; }
.ex-foot .btn:disabled { opacity: .4; pointer-events: none; }

/* ---------- reading text panel */
.ex-text { display: flex; flex-direction: column; min-height: 0; background: #fffdf7; border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.ex-text-tabs { display: flex; gap: 6px; padding: 10px; background: #fff7e6; border-bottom: 2px solid #fde9c3; overflow-x: auto; flex-shrink: 0; }
.ex-text-tabs button { flex: 0 0 auto; border: none; cursor: pointer; font: inherit; font-weight: 800; font-size: .85rem; padding: 8px 12px; border-radius: 99px; background: #fff; color: #92400e; box-shadow: inset 0 0 0 2px #fde2a8; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-text-tabs button.is-active { background: #f59e0b; color: #fff; box-shadow: none; }
.ex-article { overflow: auto; padding: 22px 30px 40px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.12rem; line-height: 1.75; color: #2b2540; }
.ex-art-kind { font-family: var(--font-body, inherit); font-size: .75rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #b45309; }
.ex-article h2 { font-family: var(--font-display); font-size: 1.7rem; color: #3b2f13; margin: 4px 0 2px; line-height: 1.25; }
.ex-art-by { font-style: italic; color: #7c6f55; margin-bottom: 14px; }
.ex-article h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 20px 0 6px; color: #3b2f13; }
.ex-article p { margin: 0 0 14px; }
.ex-article figure { margin: 16px 0; text-align: center; }
.ex-article figure img { max-width: 100%; border-radius: 12px; }
.ex-mobile-tabs { display: none; }

/* ---------- results */
.rv { max-width: 960px; margin: 0 auto; padding-bottom: 40px; animation: exRise .4s; }
.rv-banner { display: flex; gap: 24px; align-items: center; background: linear-gradient(135deg, #f5f3ff, #fef3c7); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--shadow-md); }
.rv-ring { --p: 0; flex: 0 0 140px; height: 140px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--violet) calc(var(--p) * 1%), #e9e5fb 0); animation: badgeIn .8s cubic-bezier(.3,1.6,.5,1); }
.rv-ring > div { width: 112px; height: 112px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rv-ring strong { font-family: var(--font-display); font-size: 2.6rem; color: var(--violet-deep); line-height: 1; }
.rv-ring span { font-size: .78rem; font-weight: 900; color: var(--ink-soft); }
.rv-sum h2 { font-family: var(--font-display); color: var(--ex-ink); font-size: 1.6rem; }
.rv-meta { font-weight: 800; color: var(--ink-soft); margin: 4px 0 10px; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-chips span { font-weight: 900; font-size: .82rem; padding: 5px 11px; border-radius: 99px; background: #fff; }
.chip-r { color: var(--go-deep); } .chip-w { color: #b91c1c; } .chip-c { color: #92400e; }
.rv-help { margin-top: 10px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.rv-filter { display: flex; gap: 8px; margin: 18px 0 12px; flex-wrap: wrap; }
.rv-filter button { border: none; cursor: pointer; font: inherit; font-weight: 900; padding: 8px 16px; border-radius: 99px; background: #fff; color: var(--ink-soft); box-shadow: inset 0 0 0 2px var(--line); }
.rv-filter button.is-active { background: var(--violet); color: #fff; box-shadow: none; }
.rv-list { list-style: none; display: grid; gap: 10px; }
.rv-row { background: #fff; border-radius: 18px; box-shadow: var(--shadow-sm, 0 2px 8px rgba(40,30,90,.08)); padding: 14px 16px; border-left: 6px solid var(--coral); }
.rv-row.is-right { border-left-color: var(--go); }
.rv-row.is-part { border-left-color: var(--sun); }
.rv-row.is-check { box-shadow: 0 0 0 2px var(--sun-soft), 0 2px 8px rgba(40,30,90,.08); }
.rv-top { display: flex; gap: 12px; align-items: flex-start; }
.rv-n { flex: 0 0 auto; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 11px; background: var(--violet-soft); color: var(--violet-deep); font-weight: 900; display: flex; align-items: center; justify-content: center; }
.rv-q { flex: 1; font-weight: 700; line-height: 1.5; color: var(--ex-ink); }
.rv-score { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--ink-soft); }
.rv-score strong { font-family: var(--font-display); font-size: 1.3rem; color: var(--ex-ink); }
.rv-adj { width: 28px; height: 28px; border-radius: 8px; border: none; cursor: pointer; background: var(--violet-soft); color: var(--violet-deep); font-weight: 900; }
.rv-body { margin: 8px 0 0 48px; display: grid; gap: 6px; }
.rv-line { display: grid; grid-template-columns: 130px 1fr; gap: 10px; font-size: .95rem; }
.rv-lab { font-weight: 900; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.rv-val { font-weight: 800; color: var(--ex-ink); white-space: pre-wrap; }
.rv-val.is-empty { color: var(--muted); font-style: italic; }
.rv-val.is-key { color: var(--go-deep); }
.rv-val.is-ms { font-weight: 600; color: var(--ink-soft); }
.rv-check { font-weight: 800; font-size: .88rem; color: #92400e; background: var(--sun-soft); padding: 6px 10px; border-radius: 10px; }
.rv-workbox summary { cursor: pointer; font-weight: 900; color: var(--violet-deep); font-size: .9rem; }
.rv-work { width: 100%; max-height: 220px; background: #fff; background-image: linear-gradient(#eef1f9 1px, transparent 1px), linear-gradient(90deg, #eef1f9 1px, transparent 1px); background-size: 16px 16px; border-radius: 10px; margin-top: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.rv-drawn { position: relative; display: inline-block; max-width: 100%; margin-top: 6px; }
.rv-drawn img { display: block; max-width: 100%; max-height: 320px; }
.rv-drawn .rv-work { position: absolute; inset: 0; height: 100%; max-height: none; background: none; box-shadow: none; margin: 0; }
.rv-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

@keyframes exRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- small screens */
@media (max-width: 860px) {
  .exam { padding: 8px 10px 10px; height: calc(100dvh - 120px); }
  .exam.has-text { grid-template-columns: 1fr; }
  .exam.has-text .ex-mobile-tabs { display: flex; gap: 6px; }
  .ex-mobile-tabs button { flex: 1; border: none; font: inherit; font-weight: 900; padding: 9px; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; }
  .ex-mobile-tabs button.is-active { background: var(--violet); color: #fff; box-shadow: none; }
  .exam.has-text .ex-text { display: none; }
  .exam.has-text[data-pane="text"] .ex-text { display: flex; grid-row: 1; }
  .exam.has-text[data-pane="text"] .ex-main { grid-row: 2; flex: 0; }
  .exam.has-text[data-pane="text"] .ex-nav, .exam.has-text[data-pane="text"] .ex-stage, .exam.has-text[data-pane="text"] .ex-foot { display: none; }
  .exam.has-text[data-pane="text"] { grid-template-rows: minmax(0, 1fr) auto; }
  .ex-card { padding: 16px; }
  .ex-prompt.is-sum, .ex-calc { font-size: 1.6rem; }
  .ex-article { padding: 16px 18px 30px; }
  .rv-banner { flex-direction: column; text-align: center; }
  .rv-chips { justify-content: center; }
  .rv-body { margin-left: 0; }
  .rv-line { grid-template-columns: 1fr; gap: 0; }
  .ex-work-pad { height: 220px; }
  .sk-btn span { display: none; }
}

/* ---------- reading: link from each question to the text, and the in-window reader */
.ex-textlink { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff7e6; border: 2px solid #fde2a8; border-radius: 14px; padding: 8px 10px 8px 12px; margin-bottom: 14px; }
.ex-tl-icon { font-size: 1.3rem; }
.ex-tl-text { flex: 1; min-width: 180px; font-weight: 700; color: #7c4a03; line-height: 1.35; }
.ex-tl-text em { display: block; font-style: normal; font-size: .8rem; font-weight: 800; color: #b45309; }
.ex-tl-btn { background: #f59e0b; color: #fff; box-shadow: 0 3px 0 #b45309; white-space: nowrap; }
.ex-tl-btn:hover { background: #d97706; }
.ex-text-pop { margin-left: auto; flex: 0 0 auto !important; width: 36px; padding: 0 !important; font-size: 1.05rem !important; }

.ex-article .is-ref { background: #fff3c4; box-shadow: -8px 0 0 #fff3c4, 8px 0 0 #fff3c4; border-left: 4px solid #f59e0b; padding-left: 10px; margin-left: -14px; border-radius: 0 6px 6px 0; }
.ex-article .is-ref-start { position: relative; }
.ex-article .is-ref-start::before { content: '📍 This question is about here'; display: block; font-family: var(--font-body, system-ui); font-size: .72rem; font-weight: 900; letter-spacing: .03em; color: #b45309; margin-bottom: 4px; }
.ex-article mark { background: #fde047; color: inherit; padding: 0 2px; border-radius: 3px; }

.ex-reader { position: fixed; inset: 0; z-index: 60; background: rgba(30, 24, 60, .45); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: stretch; padding: 18px; opacity: 0; transition: opacity .25s; }
.ex-reader.open { opacity: 1; }
.exr-card { --rs: 1; width: min(860px, 100%); background: #fffdf7; border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(20, 10, 60, .35); display: flex; flex-direction: column; overflow: hidden; transform: translateY(16px) scale(.98); transition: transform .3s cubic-bezier(.2,.9,.3,1.2); }
.ex-reader.open .exr-card { transform: none; }
.exr-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; background: #fff; border-bottom: 2px solid #fde9c3; flex-wrap: wrap; }
.exr-title { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.exr-title strong { font-family: var(--font-display); font-size: 1.2rem; color: #3b2f13; }
.exr-title span { font-size: .84rem; font-weight: 700; color: #92400e; }
.exr-size { display: flex; gap: 4px; }
.exr-size button { border: none; cursor: pointer; font: inherit; font-weight: 900; width: 40px; height: 36px; border-radius: 10px; background: #fff7e6; color: #92400e; box-shadow: inset 0 0 0 2px #fde2a8; }
.exr-tabs { display: flex; gap: 6px; padding: 10px 14px; background: #fff7e6; overflow-x: auto; flex-shrink: 0; }
.exr-tabs button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer; font: inherit; font-weight: 800; font-size: .88rem; padding: 7px 14px 7px 7px; border-radius: 99px; background: #fff; color: #92400e; box-shadow: inset 0 0 0 2px #fde2a8; }
.exr-tabs button span { width: 24px; height: 24px; border-radius: 50%; background: #fde9c3; display: grid; place-items: center; font-size: .78rem; }
.exr-tabs button.is-active { background: #f59e0b; color: #fff; box-shadow: none; }
.exr-tabs button.is-active span { background: rgba(255,255,255,.3); }
.exr-article { flex: 1; font-size: calc(1.15rem * var(--rs)); padding: 26px 44px 30px; scroll-behavior: smooth; }
.exr-end { display: flex; justify-content: center; padding: 26px 0 6px; border-top: 2px dashed #fde9c3; margin-top: 20px; font-family: var(--font-body, system-ui); }
@media (max-width: 860px) {
  .ex-reader { padding: 0; }
  .exr-card { border-radius: 0; }
  .exr-article { padding: 18px 20px 24px; }
  .exr-head .exr-close { width: 100%; order: 3; }
  .ex-article .is-ref { margin-left: -10px; padding-left: 8px; }
}

/* data tables written in question text ("a | b | c" lines) */
.ex-data { border-collapse: collapse; margin: 10px 0 12px; font-size: .95em; font-weight: 500; min-width: 50%; max-width: 100%; display: block; overflow-x: auto; }
.ex-data th, .ex-data td { border: 1px solid var(--line); padding: 6px 12px; text-align: center; white-space: nowrap; }
.ex-data th { background: var(--violet-soft); color: var(--violet-deep); font-weight: 650; }
.ex-data tbody tr:nth-child(even) td { background: #f8fafc; }
