/* ==========================================================================
   SuccessBeacon Overseas — dMAT AI mock test page
   Loads after style.css and reuses its colour, radius and shadow tokens.
   ========================================================================== */

/* ---------- App shell ---------- */
#dmat-app { min-width: 0; color: var(--body); }
#dmat-app .dm-screen { max-width: 1040px; margin-inline: auto; }
#dmat-app h2, #dmat-app h3, #dmat-app h4 { color: var(--ink); }
#dmat-app [data-focus-h]:focus { outline: none; }
.dm-visually-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dm-muted { color: var(--body); opacity: .85; }
.dm-small { font-size: .84rem; }
.dm-note { padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--surface-sand); border: 1px solid #ecdfc0; }
.dm-disclaimer { margin-top: 1.25rem; text-align: center; max-width: 52rem; margin-inline: auto; }
.dm-link { background: none; border: 0; padding: .25rem .1rem; font: inherit; font-size: .9rem; font-weight: 600; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.dm-link:hover { color: var(--brand-dark); }
.dm-sep { color: var(--muted); margin-inline: .35rem; }
.dm-i { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.16em; flex: none; }
.dm-banner { padding: .7rem 1rem; border-radius: var(--radius-sm); background: var(--brand-tint); color: var(--brand-darker); font-weight: 600; font-size: .92rem; margin-bottom: 1rem; border: 1px solid #cfe6eb; }
.dm-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: clamp(1.1rem, 2.6vw, 1.75rem); min-width: 0; }
.dm-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.dm-step { font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: .35rem; }
.dm-lead { font-size: 1.05rem; color: var(--body); margin-top: .4rem; }
.dm-actions { display: flex; gap: .85rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }
.dm-actions--wrap { margin-block: 1.75rem; }
.dm-enq { background: var(--accent); color: var(--brand-darker); }
.dm-enq:hover { background: #5fcad9; color: var(--brand-darker); }
.dm-copied { font-size: .88rem; color: var(--brand-dark); font-weight: 600; }
.dm-copied.visually-hidden { position: static; width: auto; height: auto; clip: auto; margin: 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- Menu ---------- */
.dm-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.dm-mode { display: flex; flex-direction: column; gap: .6rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.15rem, 2.6vw, 1.6rem); box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s, border-color .25s; }
.dm-mode:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-light); }
.dm-mode h3 { font-size: 1.25rem; }
.dm-mode p { font-size: .95rem; flex: 1; }
.dm-mode .btn { align-self: flex-start; margin-top: .4rem; }
.dm-mode--primary { background: linear-gradient(150deg, var(--brand-darker), var(--brand-dark) 55%, var(--brand)); border-color: transparent; color: #d3e6eb; }
.dm-mode--primary h3, #dmat-app .dm-mode--primary h3 { color: #fff; }
.dm-mode--primary p { color: #d3e6eb; }
.dm-mode--primary .dm-meta li { background: rgba(255, 255, 255, .12); color: #fff; }
.dm-mode--primary .dm-chip { background: var(--accent); color: var(--brand-darker); }
.dm-mode--primary .btn--primary { background: var(--white); color: var(--brand-darker); }
.dm-mode--primary .btn--primary:hover { background: var(--brand-tint); }
.dm-chip { align-self: flex-start; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: var(--brand-tint); color: var(--brand-dark); padding: .25rem .65rem; border-radius: var(--radius-pill); }
.dm-meta { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; }
.dm-meta li { font-size: .78rem; font-weight: 600; background: var(--surface-alt); border: 0; padding: .25rem .65rem; border-radius: var(--radius-pill); color: var(--brand-dark); }

.dm-drill { margin-top: 1.25rem; }
.dm-drill__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.5rem; margin: 1.1rem 0 1.4rem; }
.dm-drill__grid [hidden] { display: none; }
.dm-lab { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin-bottom: .45rem; }
.dm-pills { border: 0; display: flex; flex-wrap: wrap; gap: .45rem; min-width: 0; }
.dm-pill { position: relative; cursor: pointer; }
.dm-pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.dm-pill span { display: inline-block; padding: .5rem .95rem; border: 1.5px solid var(--line); border-radius: var(--radius-pill); font-size: .9rem; font-weight: 600; color: var(--body); background: var(--white); transition: all .18s; }
.dm-pill:hover span { border-color: var(--brand-light); }
.dm-pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.dm-pill input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.dm-drill select { width: 100%; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--white); color: var(--ink); }

.dm-hist { margin-top: 1.25rem; }
.dm-hist__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.dm-spark { width: 100%; max-width: 320px; height: 72px; margin: .5rem 0 .75rem; overflow: visible; }
.dm-spark path { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.dm-spark circle { fill: #fff; stroke: var(--brand); stroke-width: 2; }
.dm-tablewrap { overflow-x: auto; }
.dm-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.dm-table th { text-align: left; background: var(--brand-tint); color: var(--brand-darker); font-weight: 700; padding: .55rem .8rem; }
.dm-table td { padding: .5rem .8rem; border-top: 1px solid var(--line); }
.dm-table--sm { font-size: .86rem; }

/* ---------- Registration gate ---------- */
.dm-access { text-align: center; max-width: 52rem; margin: 0 auto 1.25rem; padding: .75rem 1rem; background: var(--brand-tint); border: 1px solid #cfe6eb; border-radius: var(--radius); font-size: .93rem; color: var(--brand-darker); }
.dm-lock { align-self: flex-start; display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; color: #7a5300; background: #fff6dc; border: 1px solid #f1d58a; padding: .2rem .6rem; border-radius: var(--radius-pill); }
.dm-mode { position: relative; }
.dm-mode > .dm-chip { margin-right: .4rem; }
.dm-mode--primary .dm-lock { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); }
.dm-mode .btn .dm-i { margin-right: .15rem; }
.dm-reg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(1.25rem, 4vw, 2.5rem); align-items: start; }
.dm-reg__side h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.dm-ff { margin-bottom: .9rem; }
.dm-ff label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); margin-bottom: .3rem; }
.dm-ff input, .dm-ff select { width: 100%; padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--white); color: var(--ink); }
.dm-ff input:focus, .dm-ff select:focus { outline: 3px solid rgba(69, 188, 205, .35); border-color: var(--brand); }
.dm-opt-note { font-weight: 400; color: var(--muted); }
.dm-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; color: var(--body); margin: .4rem 0 .5rem; }
.dm-check input { margin-top: .2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--brand); flex: none; }
.dm-check a { color: var(--brand); text-decoration: underline; }
.dm-freenote { font-size: .86rem; font-weight: 600; color: var(--brand-dark); margin-bottom: .35rem; }
.dm-regmsg { min-height: 1.2em; font-size: .88rem; color: #c0392b; font-weight: 600; }
.dm-regform .dm-actions { margin-top: .75rem; }
.dm-regform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Intro and break ---------- */
.dm-intro h2, .dm-break h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.dm-facts { list-style: none; display: grid; gap: .5rem; margin: 1.25rem 0; padding: 1rem 1.25rem; background: var(--brand-tint); border-radius: var(--radius); }
.dm-facts li { padding-left: 1.4rem; position: relative; }
.dm-facts li::before { content: ""; position: absolute; left: 0; top: .6em; width: .6rem; height: .6rem; border-radius: 50%; background: var(--brand); }
.dm-facts strong { color: var(--ink); }
.dm-rules { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; }
.dm-rules h3 { font-size: 1rem; margin: 0 0 .5rem; }
.dm-rules h3 + h3, .dm-rules ul + h3 { margin-top: 1.1rem; }
.dm-rules ul { padding-left: 1.2rem; display: grid; gap: .4rem; }
.dm-bigtime { font-size: clamp(3rem, 12vw, 5.5rem); font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; margin: 1.25rem 0; letter-spacing: -.02em; }

/* ---------- Runner ---------- */
.dm-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .85rem 1.1rem; background: var(--brand-darker); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.dm-bar__l, .dm-bar__r { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.dm-bar__sec { font-weight: 700; }
.dm-bar__count { font-size: .86rem; color: #bcd8de; }
.dm-level { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--accent); color: var(--brand-darker); padding: .2rem .6rem; border-radius: var(--radius-pill); }
.dm-pace { font-size: .78rem; font-weight: 600; color: #bcd8de; }
.dm-pace.is-behind { color: #ffd58a; }
.dm-timer { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .12); padding: .3rem .8rem; border-radius: var(--radius-pill); }
.dm-timer b { font-weight: 800; }
.dm-timer.is-warn { background: var(--accent); color: var(--brand-darker); }
.dm-timer.is-danger { background: #c0392b; color: #fff; animation: dm-pulse 1s ease-in-out infinite; }
@keyframes dm-pulse { 50% { opacity: .75; } }
.dm-meter { height: 5px; background: var(--brand-tint); }
.dm-meter i { display: block; height: 100%; width: 0; background: var(--brand-light); transition: width .5s linear; }
.dm-stage { background: var(--white); border: 1px solid var(--line); border-top: 0; padding: clamp(1rem, 2.6vw, 1.75rem); border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.dm-run .dm-banner { margin: .85rem 0 0; }
.dm-nav { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.dm-nav .btn { padding: .7rem 1.25rem; }
.dm-flagbtn { display: inline-flex; align-items: center; gap: .4rem; background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-pill); padding: .55rem 1.1rem; font: inherit; font-weight: 600; font-size: .9rem; color: var(--body); cursor: pointer; }
.dm-flagbtn:hover { border-color: var(--accent); }
.dm-flagbtn.is-on { background: #fff6dc; border-color: var(--accent); color: #7a5300; }
.dm-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.dm-chipnav { width: 2.3rem; height: 2.3rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--white); font: inherit; font-size: .85rem; font-weight: 700; color: var(--body); cursor: pointer; position: relative; }
.dm-chipnav:hover:not([disabled]) { border-color: var(--brand-light); }
.dm-chipnav[disabled] { opacity: .4; cursor: default; }
.dm-chipnav.is-part { background: #f3f6f6; border-color: var(--brand-light); }
.dm-chipnav.is-done { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-dark); }
.dm-chipnav.is-cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.dm-chipnav.is-flag::after { content: ""; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.dm-foot { margin-top: 1rem; font-size: .88rem; }
.dm-confirm { position: fixed; inset: auto 0 0 0; z-index: 80; background: var(--white); padding: 1.1rem var(--gutter); box-shadow: 0 -12px 40px rgba(11, 43, 55, .22); border-top: 3px solid var(--brand); text-align: center; }
.dm-confirm .dm-actions { justify-content: center; margin-top: .75rem; }

/* ---------- Question types ---------- */
.dm-instr { font-weight: 600; color: var(--ink); margin-bottom: 1rem; }
.dm-seq { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-bottom: 1.5rem; }
.dm-cell { margin: 0; text-align: center; }
.dm-cell figcaption, .dm-opt--fig span { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-top: .25rem; }
.dm-mx { display: block; border-radius: 6px; max-width: 100%; height: auto; }
.dm-cell .dm-mx { box-shadow: 0 0 0 1px var(--line); }
.dm-qbox { width: 104px; height: 104px; display: grid; place-items: center; border: 2.5px dashed var(--brand-light); border-radius: 6px; background: var(--brand-tint); font-size: 2.6rem; font-weight: 800; color: var(--brand); max-width: 100%; }
.dm-ans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.dm-ans__col { background: var(--surface-alt); border-radius: var(--radius); padding: .9rem 1rem 1.1rem; }
.dm-ans__col h4 { font-size: .9rem; margin-bottom: .6rem; text-align: center; }
.dm-opts { display: grid; gap: .6rem; min-width: 0; }
.dm-opts--fig { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dm-opts--num { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 30rem; margin-top: 1.25rem; }
.dm-opts--txt { grid-template-columns: minmax(0, 1fr); }
.dm-opt { font: inherit; cursor: pointer; background: var(--white); border: 2px solid var(--line); border-radius: var(--radius); color: var(--ink); transition: border-color .15s, background .15s, transform .15s; min-width: 0; }
.dm-opt:hover:not([disabled]) { border-color: var(--brand-light); transform: translateY(-1px); }
.dm-opt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dm-opt.is-sel { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 2px rgba(26, 82, 102, .25); }
.dm-opt.is-correct { border-color: #1e8449; background: #e8f6ee; box-shadow: 0 0 0 2px rgba(30, 132, 73, .2); }
.dm-opt.is-wrong { border-color: #c0392b; background: #fdecea; }
.dm-opt[disabled] { cursor: default; opacity: 1; }
.dm-opt--fig { padding: .35rem; }
.dm-opt--fig .dm-mx { width: 100%; height: auto; }
.dm-opt--num { padding: .8rem .2rem; font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dm-opt--txt { padding: .7rem .95rem; text-align: left; display: flex; gap: .65rem; align-items: baseline; font-size: .96rem; line-height: 1.5; }
.dm-opt--txt b { color: var(--brand); flex: none; }
.dm-eqs { list-style: none; display: grid; gap: .55rem; margin: 0 0 .5rem; max-width: 30rem; }
.dm-eqs li { font-size: 1.3rem; font-weight: 700; color: var(--ink); background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem 1rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.dm-var { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding-inline: .3rem; border-radius: 8px; background: var(--brand); color: #fff; }
.dm-latin { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 3.1rem)); gap: 4px; background: var(--brand-dark); padding: 4px; border-radius: var(--radius-sm); width: max-content; max-width: 100%; margin: 0 auto 1.25rem; }
.dm-lc { aspect-ratio: 1; display: grid; place-items: center; background: var(--white); font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.dm-lc--q { background: var(--accent); color: var(--brand-darker); }
.dm-q--latin .dm-opts--num, .dm-q--eq .dm-opts--num { margin-inline: 0; }
.dm-q--latin .dm-opts--num { margin-inline: auto; }

/* Academic */
.dm-pass { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.dm-text { position: sticky; top: calc(var(--nav-h) + 1rem); background: var(--surface-sand); border: 1px solid #ecdfc0; border-radius: var(--radius); padding: 1.1rem 1.3rem; font-size: .97rem; max-height: calc(100vh - var(--nav-h) - 2rem); overflow-y: auto; }
.dm-text > * + * { margin-top: .8rem; }
.dm-text p { color: var(--ink); }
.dm-text em { font-style: italic; }
.dm-tag { font-size: .72rem !important; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand) !important; }
.dm-text table, .dm-text .dm-table { width: 100%; font-size: .88rem; background: var(--white); border-radius: 8px; overflow: hidden; }
.dm-text .dm-table td, .dm-text .dm-table th { border: 1px solid #eadfc4; padding: .4rem .6rem; }
.dm-fig { margin: 0; text-align: center; }
.dm-fig svg { max-width: 100%; height: auto; background: var(--white); border-radius: 8px; border: 1px solid #eadfc4; }
.dm-qs { display: grid; gap: 1.1rem; }
.dm-question { border: 0; min-width: 0; }
.dm-question legend { font-weight: 600; color: var(--ink); margin-bottom: .55rem; padding: 0; line-height: 1.5; float: left; width: 100%; }
.dm-question .dm-opts { clear: both; }
.dm-qn { display: inline-block; font-size: .75rem; font-weight: 800; background: var(--brand); color: #fff; padding: .1rem .5rem; border-radius: 6px; margin-right: .3rem; }
.dm-why, .dm-fb { margin-top: .75rem; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--brand-tint); border-left: 4px solid var(--brand); font-size: .92rem; color: var(--ink); }
.dm-fb { margin-top: 1.25rem; }
.dm-fb h4 { font-size: .86rem; text-transform: uppercase; letter-spacing: .08em; margin: .5rem 0 .3rem; color: var(--brand-dark); }
.dm-fb ol { list-style: decimal; padding-left: 1.4rem; display: block; }
.dm-fb ol li { display: list-item; margin-top: .3rem; }
.dm-ok { color: #1e8449; } .dm-no { color: #c0392b; }
.dm-ok .dm-i, .dm-no .dm-i { margin-right: .2rem; }

/* ---------- Results ---------- */
.dm-hero { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; background: linear-gradient(135deg, var(--brand-tint), var(--white)); border: 1px solid #cfe6eb; border-radius: var(--radius-lg); padding: clamp(1.25rem, 3vw, 2rem); margin-bottom: 1.25rem; }
.dm-hero h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
.dm-ring { position: relative; width: 150px; height: 150px; flex: none; }
.dm-ring svg { width: 100%; height: 100%; }
.dm-ring__bg { fill: none; stroke: #d6e5e8; stroke-width: 9; }
.dm-ring__fg { fill: none; stroke: var(--brand); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s ease-out; }
.dm-ring__v { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.dm-ring__v b { font-size: 2.4rem; color: var(--ink); font-weight: 800; }
.dm-ring__v span { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: .2rem; }
.dm-scs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.dm-sc { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }
.dm-sc h4 { font-size: .95rem; }
.dm-sc__big { font-size: 1.1rem; margin-top: .35rem; }
.dm-sc__big b { font-size: 2rem; color: var(--brand); font-weight: 800; }
.dm-sc__big span { font-size: .85rem; color: var(--muted); }
.dm-sc__verdict { font-weight: 700; color: var(--brand-dark); font-size: .92rem; }
.dm-sc__facts { list-style: none; font-size: .84rem; margin: .5rem 0 .8rem; display: grid; gap: .15rem; color: var(--body); }
.dm-bar2 { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 2.8rem; align-items: center; gap: .6rem; font-size: .82rem; margin-top: .35rem; }
.dm-card .dm-bar2 { grid-template-columns: 10rem minmax(0, 1fr) 2.8rem; }
.dm-bar2 i { display: block; height: 9px; background: var(--brand-tint); border-radius: 9px; overflow: hidden; }
.dm-bar2 u { display: block; height: 100%; background: var(--brand-light); border-radius: 9px; text-decoration: none; }
.dm-bar2 b { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.dm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.dm-coach { margin-bottom: 1.25rem; background: var(--surface-sand); border-color: #ecdfc0; }
.dm-recs { list-style: none; display: grid; gap: 1rem; margin-top: 1rem; }
.dm-rec { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 1rem; background: var(--white); border-radius: var(--radius); padding: 1rem 1.1rem; border: 1px solid var(--line); }
.dm-rec__n { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.dm-rec h4 { font-size: 1.02rem; margin-bottom: .2rem; }
.dm-rec p { font-size: .93rem; }
.dm-rec__tip { margin: .45rem 0 .7rem; color: var(--ink); }
.dm-rec .btn { padding: .55rem 1.1rem; font-size: .88rem; }
.dm-review__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.dm-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.dm-fil { font: inherit; font-size: .84rem; font-weight: 600; background: var(--white); border: 1.5px solid var(--line); padding: .35rem .85rem; border-radius: var(--radius-pill); cursor: pointer; color: var(--body); }
.dm-fil.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.dm-rv { border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--radius-sm); margin-top: .6rem; background: var(--white); }
.dm-rv.is-ok { border-left-color: #1e8449; } .dm-rv.is-bad { border-left-color: #c0392b; } .dm-rv.is-blank { border-left-color: var(--muted); }
.dm-rv summary { cursor: pointer; padding: .75rem 1rem; display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; color: var(--ink); font-size: .93rem; list-style-position: inside; }
.dm-rv__s { color: var(--muted); font-weight: 600; white-space: nowrap; font-size: .84rem; }
.dm-rv__b { padding: .5rem 1rem 1.25rem; }
.dm-rv .dm-opts--fig { grid-template-columns: repeat(3, minmax(0, 88px)); }

/* ---------- Page sections ---------- */
.dm-grid { display: grid; gap: 1.25rem; }
.dm-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dm-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dm-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.15rem, 2.6vw, 1.6rem); box-shadow: var(--shadow-sm); min-width: 0; }
.dm-box h3 { font-size: 1.15rem; margin-bottom: .45rem; }
.dm-box .dm-time { display: inline-block; font-size: .78rem; font-weight: 700; background: var(--brand-tint); color: var(--brand-dark); padding: .2rem .65rem; border-radius: var(--radius-pill); margin-bottom: .65rem; }
.dm-box ul { padding-left: 1.15rem; display: grid; gap: .4rem; margin-top: .6rem; font-size: .95rem; }
.dm-callout { margin-top: 1.5rem; padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--surface-sand); border: 1px solid #ecdfc0; font-size: .95rem; color: var(--ink); }
.dm-callout strong { color: var(--brand-darker); }
.dm-steps { counter-reset: s; list-style: none; display: grid; gap: 1rem; }
.dm-steps li { counter-increment: s; position: relative; padding-left: 3rem; }
.dm-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; }
.dm-steps strong { color: var(--ink); display: block; }
.dm-guide { scroll-margin-top: calc(var(--nav-h) + 1rem); }
.dm-guide h3 { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.dm-example { margin-top: .9rem; padding: .85rem 1rem; background: var(--surface-alt); border-radius: var(--radius-sm); font-size: .93rem; }
.dm-example strong { color: var(--ink); }
.dm-hero-cta { display: flex; gap: .85rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .dm-pass { grid-template-columns: minmax(0, 1fr); }
  .dm-text { max-height: none; position: static; }
  .dm-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .dm-reg, .dm-modes, .dm-drill__grid, .dm-two, .dm-grid--2, .dm-grid--3, .dm-ans { grid-template-columns: minmax(0, 1fr); }
  .dm-hero { flex-direction: column-reverse; align-items: flex-start; }
  .dm-card .dm-bar2 { grid-template-columns: 7.5rem minmax(0, 1fr) 2.6rem; }
  .dm-qbox { width: 76px; height: 76px; font-size: 1.9rem; }
  .dm-seq .dm-mx { width: 76px; height: 76px; }
  .dm-nav { gap: .5rem; }
  .dm-flagbtn { order: 3; width: 100%; justify-content: center; }
  .dm-nav .btn { flex: 1; justify-content: center; }
  .dm-rv summary { flex-direction: column; gap: .15rem; }
}
@media (max-width: 720px) { .dm-running .float-wa, .dm-running .to-top { display: none; } }
@media (max-width: 420px) {
  .dm-opts--num { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
  .dm-opt--num { font-size: 1.05rem; }
  .dm-opts--fig { gap: .4rem; }
  .dm-latin { grid-template-columns: repeat(var(--n, 5), minmax(0, 2.6rem)); }
}
@media (prefers-reduced-motion: reduce) {
  .dm-timer.is-danger { animation: none; }
  .dm-meter i, .dm-ring__fg, .dm-opt, .dm-mode { transition: none; }
}

/* ---------- Print: save the result as a PDF ---------- */
@media print {
  body.dm-print .page-hero, body.dm-print main > section:not(#practice),
  body.dm-print .dm-actions, body.dm-print .dm-filters, body.dm-print .dm-rec .btn { display: none !important; }
  .dm-rv { break-inside: avoid; }
  .dm-rv[open] .dm-rv__b { display: block; }
  .dm-text { max-height: none; overflow: visible; }
  .dm-confirm { display: none; }
}
