/* ==========================================================================
   Хариулт таних — интерфэйсийн загвар
   Брэнд нь илтгэлтэй ижил: хар ногоон (--brand), шар (--accent), цаасан дэвсгэр, хариултын бөмбөлөг.
   Фонт: Nunito (SIL OFL 1.1, /static/fonts) — монгол үсэг (Ө, Ү) бүрэн.
   ========================================================================== */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("/static/fonts/nunito-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("/static/fonts/nunito-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("/static/fonts/nunito-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f5f3ec; --surface: #ffffff; --surface-2: #f2efe6; --surface-3: #e7e3d6; --hover: #f4f1e8; --raised: #ffffff;
  --border: #e7e2d4; --border-strong: #d4cebc; --border-subtle: #efebe1;
  --text: #13241f; --text-2: #4d5d57; --text-3: #87938d;
  --brand: #17352f; --brand-2: #22493f; --brand-fg: #ffffff; --brand-soft: #e4eee9; --brand-ink: #bcd0c8;
  --accent: #e39b2d; --accent-2: #eeb04f; --accent-soft: #fbeed5; --accent-fg: #1b2c27;
  --primary: #17352f; --primary-fg: #ffffff; --on-status: #ffffff;
  --ring: #d68f22; --ring-soft: rgba(227, 155, 45, .25);
  --success: #1d8a5e; --success-soft: #e1f2e8; --danger: #c8412f; --danger-soft: #fbe7e3;
  --warn: #a96500; --warn-soft: #fcefd5; --diff: #fdf3dc;
  --m-classical: #c27a1e; --m-yolo: #1f8a68; --m-hybrid: #8f3f71; --m-yolo_ft: #2c6fb0; --m-template: #c27a1e;
  --m-true: #87938d;
  --seq-0: #eef5f1; --seq-1: #cfe4d9; --seq-2: #9ccab4; --seq-3: #5aa586; --seq-4: #1f8a68;
  --shadow-sm: 0 1px 2px rgba(23, 53, 47, .06), 0 0 0 1px rgba(23, 53, 47, .045);
  --shadow-md: 0 10px 30px rgba(23, 53, 47, .09), 0 1px 3px rgba(23, 53, 47, .07);
  --shadow-lg: 0 18px 50px rgba(23, 53, 47, .2), 0 2px 6px rgba(23, 53, 47, .08);
  --r: 12px; --r-lg: 20px;
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --topbar: 60px; --maxw: 1360px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1714; --surface: #13221e; --surface-2: #1a2c27; --surface-3: #243a33; --hover: #182a25; --raised: #1b2e29;
    --border: #223630; --border-strong: #324b43; --border-subtle: #1b2b26;
    --text: #ebf3ef; --text-2: #a8bab3; --text-3: #6f837b;
    --brand: #10231e; --brand-2: #1a3a32; --brand-fg: #ffffff; --brand-soft: #18322b; --brand-ink: #9fb8ae;
    --accent: #eba73f; --accent-2: #f3bb60; --accent-soft: rgba(235, 167, 63, .15); --accent-fg: #15211d;
    --primary: #dcebe4; --primary-fg: #0c1714; --on-status: #0c1714;
    --ring: #eba73f; --ring-soft: rgba(235, 167, 63, .28);
    --success: #4cc38a; --success-soft: rgba(76, 195, 138, .14); --danger: #f07b6b; --danger-soft: rgba(240, 123, 107, .14);
    --warn: #f2bb5e; --warn-soft: rgba(242, 187, 94, .14); --diff: rgba(242, 187, 94, .08);
    --m-classical: #e3a356; --m-yolo: #4cc38a; --m-hybrid: #c97ba7; --m-yolo_ft: #6ea6e0; --m-template: #e3a356;
    --m-true: #7f928a;
    --seq-0: #13241f; --seq-1: #1a3d32; --seq-2: #23604c; --seq-3: #33896a; --seq-4: #4cc38a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .035);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .04); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1714; --surface: #13221e; --surface-2: #1a2c27; --surface-3: #243a33; --hover: #182a25; --raised: #1b2e29;
  --border: #223630; --border-strong: #324b43; --border-subtle: #1b2b26;
  --text: #ebf3ef; --text-2: #a8bab3; --text-3: #6f837b;
  --brand: #10231e; --brand-2: #1a3a32; --brand-fg: #ffffff; --brand-soft: #18322b; --brand-ink: #9fb8ae;
  --accent: #eba73f; --accent-2: #f3bb60; --accent-soft: rgba(235, 167, 63, .15); --accent-fg: #15211d;
  --primary: #dcebe4; --primary-fg: #0c1714; --on-status: #0c1714;
  --ring: #eba73f; --ring-soft: rgba(235, 167, 63, .28);
  --success: #4cc38a; --success-soft: rgba(76, 195, 138, .14); --danger: #f07b6b; --danger-soft: rgba(240, 123, 107, .14);
  --warn: #f2bb5e; --warn-soft: rgba(242, 187, 94, .14); --diff: rgba(242, 187, 94, .08);
  --m-classical: #e3a356; --m-yolo: #4cc38a; --m-hybrid: #c97ba7; --m-yolo_ft: #6ea6e0; --m-template: #e3a356;
  --m-true: #7f928a;
  --seq-0: #13241f; --seq-1: #1a3d32; --seq-2: #23604c; --seq-3: #33896a; --seq-4: #4cc38a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .035);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .04); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- суурь */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--text); font: 500 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, h4, h5, p, figure { margin: 0; }
h1 { font-size: 28px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 19px; font-weight: 850; letter-spacing: -.01em; line-height: 1.3; }
h3 { font-size: 16px; font-weight: 800; letter-spacing: -.005em; line-height: 1.35; }
h4 { font-weight: 800; }
b, strong { font-weight: 800; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
code, kbd { font-family: var(--mono); font-size: .92em; }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--text-2); }
.caption { font-size: 13px; color: var(--text-3); }
.danger { color: var(--danger); }
.lead { color: var(--text-2); max-width: 760px; margin-bottom: 8px; }
.link { display: inline-flex; align-items: center; gap: 3px; color: var(--text-2); text-decoration: none; font-size: 13.5px; font-weight: 750; white-space: nowrap; }
.link:hover { color: var(--text); }
.link svg { width: 15px; height: 15px; }
.spacer { flex: 1; }
.num { font-variant-numeric: tabular-nums; }
.l-short { display: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------------------------------------------------------- дээд мөр: брэндийн хар ногоон */
.topbar { position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); background: var(--brand); color: var(--brand-fg); }
.topbar__inner { max-width: var(--maxw); height: var(--topbar); margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 900; font-size: 17.5px; letter-spacing: -.01em; white-space: nowrap; }
.brand__mark { display: grid; width: 26px; height: 26px; color: #fff; }
.brand__mark svg { width: 26px; height: 26px; }
.nav { display: flex; align-self: stretch; gap: 4px; }
.nav__item { position: relative; display: flex; align-items: center; padding: 0 12px; color: rgba(255, 255, 255, .6); text-decoration: none; font-size: 15px; font-weight: 800; transition: color .15s; }
.nav__item:hover, .nav__item.is-active { color: #fff; }
.nav__item.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.topbar__actions { margin-left: auto; display: flex; gap: 2px; }
.topbar .icon-btn { color: rgba(255, 255, 255, .8); }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@media (hover: none) { .topbar .icon-btn:hover { background: transparent; color: rgba(255, 255, 255, .8); } }

/* ---------------------------------------------------------------- хуудас */
.page { max-width: var(--maxw); margin: 0 auto; padding: 28px 32px 56px; }

/* ---------------------------------------------------------------- товч */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 800; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none; transition: background .15s, border-color .15s, color .15s, opacity .15s, box-shadow .15s, transform .1s; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.btn--primary:hover { background: var(--primary); opacity: .88; }
.btn--accent { background: var(--accent); color: var(--accent-fg); border-color: transparent; box-shadow: 0 8px 20px -6px rgba(227, 155, 45, .6); }
.btn--accent:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--hover); color: var(--text); }
.btn--ghost[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; gap: 6px; }
.btn--lg { height: 54px; padding: 0 20px; font-size: 16px; border-radius: 16px; }
.btn--block { width: 100%; }
.btn svg { width: 17px; height: 17px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; background: transparent; }
.icon-btn[aria-pressed="true"], .icon-btn[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.badge-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }

/* ---------------------------------------------------------------- талбар */
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); font-weight: 600; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.textarea { height: auto; min-height: 60px; padding: 10px 12px; font: 13px/1.45 var(--mono); resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2387938d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; text-overflow: ellipsis; cursor: pointer; }
.select--bare { width: auto; max-width: 100%; field-sizing: content; height: 32px; padding-left: 8px; border-color: transparent; background-color: transparent; color: var(--text-2); font-weight: 750; }
.select--bare:hover { background-color: var(--hover); color: var(--text); }
.select--sm { width: auto; height: 34px; font-size: 13px; }
.input--count { width: 66px; height: 36px; padding: 0 6px; text-align: center; font-variant-numeric: tabular-nums; }
.input[type="number"] { -moz-appearance: textfield; }
.input[type="number"]::-webkit-inner-spin-button, .input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label { font-size: 13px; font-weight: 800; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }

/* сегмент */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-2); border-radius: 13px; max-width: 100%; }
.seg > button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 800; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.seg > button:hover { color: var(--text); }
.seg > button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg--sm > button { height: 28px; padding: 0 11px; font-size: 13px; }

/* таб (статистик) */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin-bottom: 28px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > button { flex: none; height: 46px; padding: 0; border: 0; background: none; color: var(--text-3); font-size: 14.5px; font-weight: 800; cursor: pointer; white-space: nowrap; box-shadow: inset 0 -3px 0 transparent; transition: color .15s, box-shadow .15s; }
.tabs > button:hover { color: var(--text); }
.tabs > button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }

/* арга сонгох чип, шошго */
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px 0 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-3); font-size: 13px; font-weight: 750; cursor: pointer; transition: border-color .15s, color .15s; }
.mchip:hover { color: var(--text-2); }
.mchip[aria-pressed="true"] { color: var(--text); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.mchip:disabled { opacity: .4; cursor: not-allowed; }
.mchip .dot { opacity: .3; }
.mchip[aria-pressed="true"] .dot { opacity: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 800; letter-spacing: 0; white-space: nowrap; vertical-align: middle; }
.tag--real, .tag--success { background: var(--success-soft); color: var(--success); }
.tag--danger { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- дээд удирдлага ба тохиргоо */
.toolbar { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 24px; }
.counts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--text-2); }
.counts label { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 28px; padding: 20px; margin: -6px 0 28px; background: var(--surface-2); border-radius: 18px; animation: reveal .16s ease-out; }
.settings .link { margin-top: 2px; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }

/* ---------------------------------------------------------------- зураг оруулах */
.dz { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 260px; padding: 40px 24px; border: 2px dashed var(--border-strong); border-radius: 20px; background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dz:hover { border-color: var(--accent); background: var(--accent-soft); }
.dz__icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent); margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.dz__icon svg { width: 23px; height: 23px; }
.dz__title { font-size: 17px; font-weight: 850; letter-spacing: -.01em; }
.dz__sub { font-size: 13.5px; color: var(--text-3); }
.dz--mid { width: 100%; min-height: 150px; padding: 28px 20px; font: inherit; color: inherit; }

/* жишээ зураг */
.samples { margin-top: 32px; }
.samples__head { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; min-width: 0; }
.samples__head h3 { font-size: 14px; margin-right: 6px; white-space: nowrap; }
.samples__head .select--bare { min-width: 0; flex: 0 1 auto; }
.thumbs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: pointer; transition: transform .18s, box-shadow .18s; }
.thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(16, 16, 22, .07); pointer-events: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.thumb.is-skel { cursor: default; animation: shimmer 1.4s infinite linear; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; }
.thumb.is-skel:hover { transform: none; box-shadow: none; }
.samples__desc { margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* тоо хүлээж буй файл */

/* ---------------------------------------------------------------- үр дүн */
.result { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "media head" "media methods" "media answers"; grid-template-rows: auto auto 1fr; column-gap: 32px; align-items: start; }
.result__head { grid-area: head; margin-bottom: 14px; min-width: 0; }
.result__methods { grid-area: methods; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.result__media { grid-area: media; position: sticky; top: calc(var(--topbar) + 24px); min-width: 0; }
.result__answers { grid-area: answers; margin-top: 16px; padding: 18px 18px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.rh__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: -4px 0 0 -10px; }
.rh__tools { display: flex; gap: 2px; margin-left: auto; }
.rh__titles { order: 3; flex-basis: 100%; min-width: 0; margin-top: 10px; padding-left: 10px; }
.rh__title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 22px; font-weight: 900; letter-spacing: -.015em; overflow-wrap: anywhere; }
.rh__meta { margin-top: 3px; font-size: 13.5px; color: var(--text-3); }
.mrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1px 10px; width: 100%; padding: 12px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; transition: background .15s; }
.mrow:hover { background: var(--hover); }
.mrow.is-selected { background: var(--brand-soft); }
.mrow.is-na { cursor: default; }
.mrow.is-na:hover { background: transparent; }
.mrow.is-na .mrow__name, .mrow.is-na .mrow__big { color: var(--text-3); }
.mrow__name { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow__big { font-size: 21px; font-weight: 900; letter-spacing: -.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.mrow.is-bad .mrow__big { color: var(--danger); }
.mrow__sub { grid-column: 2 / -1; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.frame-wrap { position: relative; }
.frame { position: relative; display: grid; place-items: center; min-height: 320px; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.frame img { max-height: calc(100vh - var(--topbar) - 136px); width: auto; max-width: 100%; cursor: zoom-in; }
.frame.is-compare { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2px; place-items: stretch; background: var(--border); }
.frame.is-compare figure { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.frame.is-compare figcaption { display: flex; align-items: center; gap: 6px; padding: 12px 14px; font-size: 13px; font-weight: 750; }
.frame.is-compare img { margin: auto; max-height: calc(100vh - var(--topbar) - 160px); }
.frame.is-busy img { opacity: .4; filter: grayscale(.4); cursor: default; }
.frame__busy { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 999px; background: var(--brand); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.frame__busy .spinner { color: var(--accent); }
.frame--empty { min-height: 200px; }
.frame__tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; padding: 3px; border-radius: 13px; background: color-mix(in srgb, var(--raised) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-sm); }
.frame__tools .icon-btn { width: 34px; height: 34px; color: var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.legend i { display: inline-block; width: 11px; height: 8px; border-radius: 2px; border: 2px solid; margin-right: 6px; }

/* хариултын хүснэгт */
.ah { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.ah { flex-wrap: wrap; }
.ah > .btn { margin-left: auto; margin-right: -10px; }
.ah__tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ah__tools > .btn--ghost:last-child { margin-right: -10px; }
.ah__sum { margin: 2px 0 10px; }
.ah__note { margin-top: 12px; line-height: 1.5; }
.allgood { display: flex; align-items: center; gap: 8px; padding: 10px 0 2px; color: var(--success); font-weight: 500; font-size: 13.5px; }
.allgood svg { width: 18px; height: 18px; }
.ablocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 28px; }
table { border-collapse: collapse; width: 100%; }
.atable { font-size: 13px; }
.atable th { font-size: 11.5px; font-weight: 800; color: var(--text-3); text-align: center; padding: 6px 4px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.atable th .dot { width: 7px; height: 7px; margin-right: 5px; vertical-align: 1px; }
.atable td { padding: 3px 4px; text-align: center; border-bottom: 1px solid var(--border-subtle); }
.atable td:first-child { color: var(--text-3); text-align: right; padding-right: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; width: 1%; }
.atable tr.is-diff td { background: var(--diff); }
.ans { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 24px; padding: 0 7px; border-radius: 12px; font-weight: 900; font-size: 12.5px; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--text); }
.ans--ok { background: var(--success-soft); color: var(--success); }
.ans--bad { background: var(--danger-soft); color: var(--danger); }
.ans--none { background: transparent; color: var(--text-3); font-weight: 500; }
.st { font-size: 10.5px; color: var(--warn); margin-left: 4px; }

/* ---------------------------------------------------------------- багц */
.runbox { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.runline { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; width: 100%; }
.runline__main { flex: 1 1 320px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.runline__main .select { flex: 1; min-width: 0; }
.nfield { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.runbox .filters { margin: 0; }
.prog { display: flex; align-items: center; gap: 12px; width: 100%; }
.progress { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--text); border-radius: 4px; transition: width .25s; }
.prog__text { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hint-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; max-width: 560px; color: var(--text-2); }
.bhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.bhead p { margin-top: 2px; font-size: 13px; color: var(--text-3); }
.statrow { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); margin-bottom: 28px; }
.stat { padding: 2px 24px; border-left: 1px solid var(--border); min-width: 0; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat__head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 750; white-space: nowrap; overflow: hidden; }
.stat__v { font-size: 34px; font-weight: 900; letter-spacing: -.03em; line-height: 1.15; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat__l { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.statwrap { margin-bottom: 28px; }
.statwrap .statrow { margin-bottom: 0; }
.statcap { font-size: 12.5px; color: var(--text-3); margin-bottom: 12px; }
.mname { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* хэсэг (энгийн ба нээгддэг) */
.sec { border-top: 1px solid var(--border); padding: 24px 0 32px; }
.sec--first { border-top: 0; padding-top: 4px; }
.sec__head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sec__head .spacer { min-width: 8px; }
details.sec { padding: 0; }
details.sec > summary { display: flex; align-items: baseline; gap: 6px 12px; padding: 18px 0; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; letter-spacing: -.006em; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary .caption { font-weight: 400; letter-spacing: 0; }
details.sec > summary svg { margin-left: auto; align-self: center; width: 18px; height: 18px; color: var(--text-3); transition: transform .2s, color .15s; }
details.sec > summary:hover svg { color: var(--text); }
details.sec[open] > summary svg { transform: rotate(180deg); }
.sec__body { padding: 2px 0 32px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 28px 40px; }
.two h4 { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }

/* өгөгдлийн хүснэгт */
.dtable { font-size: 13px; }
.dtable th { text-align: left; font-size: 12px; font-weight: 800; color: var(--text-3); padding: 8px 14px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dtable td { padding: 9px 14px 9px 0; border-bottom: 1px solid var(--border-subtle); font-variant-numeric: tabular-nums; vertical-align: middle; }
.dtable th:last-child, .dtable td:last-child { padding-right: 0; }
.dtable .r { text-align: right; }
.dtable .sub { display: block; margin-top: 1px; font-size: 12px; color: var(--text-3); }
.dtable tr.is-click { cursor: pointer; }
.dtable tr.is-click:hover td { background: var(--hover); }
.dtable td.chev { width: 1%; color: var(--text-3); }
.dtable td.chev svg { width: 16px; height: 16px; }
.dtable .thumb-sm { width: 30px; height: 40px; max-width: none; object-fit: cover; border-radius: 5px; box-shadow: 0 0 0 1px var(--border); }
.dtable .th-m { display: inline-flex; align-items: center; gap: 6px; }
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heat td { text-align: center; }
.heat th.r { text-align: center; }

/* ---------------------------------------------------------------- статистик */
.ovt { font-size: 13.5px; }
.ovt th { padding: 0 0 10px 18px; font-size: 12.5px; font-weight: 500; color: var(--text-2); text-align: right; vertical-align: bottom; }
.ovt th:first-child { padding-left: 0; text-align: left; }
.ovt .th-m { display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.ovt td { padding: 11px 0 11px 18px; border-top: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.ovt td:first-child { padding-left: 0; text-align: left; color: var(--text); white-space: normal; }
.ovt td:first-child .tag { margin-left: 6px; }
.ovt td.best { color: var(--text); font-weight: 600; }
.ovt tr.is-time td { color: var(--text-3); }
.ovt tr.is-time td.best { color: var(--text-2); }
.ovt__dot, .ovt-legend { display: none; }
.callout { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.callout b { font-size: 28px; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.callout p { flex: 1 1 360px; color: var(--text-2); }
.mult { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; }
.mult h5 { margin: 0 0 4px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.loading { display: flex; align-items: center; gap: 10px; color: var(--text-3); padding: 24px 0; }

/* ---------------------------------------------------------------- график */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-2); font-size: 11.5px; font-family: var(--font); }
.chart .axis text { fill: var(--text-3); font-size: 11px; }
.chart .grid line { stroke: var(--border-subtle); }
.chart .base { stroke: var(--border-strong); }
.chart .track { stroke: var(--border); stroke-width: 1; }
.chart .lbl { fill: var(--text); font-size: 12.5px; }
.chart .hit { fill: transparent; }
.chart .ring { stroke: var(--bg); stroke-width: 2; }
.chart-fit { width: 100%; min-width: 0; }
.mlegend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); margin: 0 0 10px; }
.mlegend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
details.tv { margin-top: 10px; }
details.tv > summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 12.5px; color: var(--text-3); list-style: none; }
details.tv > summary:hover { color: var(--text); }
details.tv > summary::-webkit-details-marker { display: none; }
details.tv > summary::before { content: "▸"; font-size: 10px; }
details.tv[open] > summary::before { content: "▾"; }
details.tv table { margin-top: 8px; }
#tip { position: fixed; z-index: 90; pointer-events: none; background: var(--raised); color: var(--text); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow-lg); display: none; max-width: 280px; }
#tip .t { font-weight: 600; margin-bottom: 4px; }
#tip .r { display: flex; align-items: center; gap: 6px; }
#tip .r b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- ачаалж байх үе */
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skel--sm { height: 14px; width: 28%; margin-bottom: 18px; }
.skel--title { height: 24px; width: 62%; }
.skel--line { height: 14px; width: 82%; margin-top: 10px; }
.skel--row { height: 66px; border-radius: 12px; margin: 0 12px 6px; }
.skel--block { height: 120px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 22%, transparent); border-top-color: currentColor; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- мэдэгдэл */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; max-width: 460px; padding: 11px 16px; border-radius: 14px; background: #17352f; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 700; animation: toast-in .2s ease-out; pointer-events: auto; }
:root[data-theme="dark"] .toast { background: #24443b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #24443b; } }
.toast svg { width: 18px; height: 18px; margin-top: 1px; }
.toast--error svg { color: #ffb2a6; }
.toast--success svg { color: #f2c06c; }
.toast--info svg { color: #bcd0c8; }
.toast.is-out { opacity: 0; transform: scale(.96); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: scale(.96); } }

/* ---------------------------------------------------------------- чирж оруулах давхарга */
.drop-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; opacity: 0; transition: opacity .15s; }
.drop-overlay.is-on { opacity: 1; }
.drop-overlay > div { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 56px; border: 1.5px dashed var(--text-3); border-radius: 22px; background: var(--raised); font-weight: 600; box-shadow: var(--shadow-lg); }
.drop-overlay svg { width: 26px; height: 26px; color: var(--text-2); }

/* ---------------------------------------------------------------- томруулах цонх */
.viewer { position: fixed; inset: 0; z-index: 80; background: #0a0a0b; display: none; }
.viewer.is-open { display: block; }
.viewer__bar { position: absolute; top: 0; left: 0; right: 0; z-index: 1; display: flex; align-items: center; gap: 4px; padding: 10px 12px; color: #fff; }
.viewer__title { margin-right: auto; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 6px; }
.viewer__bar .icon-btn { color: #d4d4d8; }
.viewer__bar .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.viewer__stage { position: absolute; inset: 54px 0 0; overflow: hidden; cursor: grab; touch-action: none; }
.viewer__stage img { position: absolute; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }

/* цонх (dialog): утсаар нээх QR, тусламж, нууцлал, зөв хариулт */
dialog.dlg { border: 0; border-radius: 24px; background: var(--raised); color: var(--text); width: min(420px, calc(100vw - 32px)); padding: 24px; box-shadow: var(--shadow-lg); }
dialog.dlg::backdrop { background: rgba(9, 22, 18, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dlg__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dlg__head h3 { margin-right: auto; font-size: 19px; font-weight: 900; }
.qr { display: block; width: 200px; height: 200px; margin: 6px auto 16px; border-radius: 16px; background: #fff; padding: 8px; image-rendering: pixelated; box-shadow: 0 0 0 1px var(--border); }
.urlbox { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 12px; border-radius: 12px; background: var(--surface-2); font: 12.5px/1.4 var(--mono); }
.urlbox span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.steps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--text-2); }
.steps li { counter-increment: s; display: flex; gap: 11px; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-size: 12.5px; font-weight: 900; display: grid; place-items: center; margin-top: -1px; }
.note { font-size: 13px; color: var(--warn); background: var(--warn-soft); border-radius: 12px; padding: 10px 12px; }

/* ---------------------------------------------------------------- дэлгэцийн хэмжээ */
@media (max-width: 1023px) {
  .result { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "methods" "media" "answers"; grid-template-rows: none; }
  .result__media { position: static; margin-top: 16px; }
  .frame img { max-height: 78vh; }
  .thumbs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar__inner { padding: 0 12px 0 16px; gap: 14px; }
  .brand__text { display: none; }
  .nav { gap: 0; }
  .page { padding: 16px 16px 64px; }
  .toolbar { gap: 10px; margin-bottom: 16px; }
  .toolbar > .seg { flex: 1 1 0; min-width: 0; }
  .toolbar > .seg > button { flex: 1; min-width: 0; padding: 0 6px; }
  .toolbar > .spacer { display: none; }
  .counts { order: 3; width: 100%; }
  .l-long, .hide-sm { display: none; }
  .l-short { display: inline; }
  .settings { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; margin-top: -2px; }
  .samples { margin-top: 24px; }
  .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .rh__title { font-size: 18px; }
  .frame { min-height: 220px; }
  .statrow { margin-bottom: 20px; }
  .stat { padding: 0 12px; }
  .stat__v { font-size: 24px; }
  .stat__head { font-size: 12px; gap: 6px; }
  .bhead h2 { font-size: 17px; }
  .two { gap: 24px; }
  .toasts { bottom: 16px; }
  .ovt-legend { display: flex; }
  .ovt thead { display: none; }
  .ovt, .ovt tbody { display: block; }
  .ovt tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding: 12px 0; border-top: 1px solid var(--border); }
  .ovt td { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; }
  .ovt td:first-child { flex-basis: 100%; display: block; margin-bottom: 2px; }
  .ovt__dot { display: inline-flex; }
}

/* ==========================================================================
   Утас (мэдрэгч дэлгэц): доод товч, тохиргооны хуудас, таб маягийн үр дүн
   ========================================================================== */
button, a, label, input, select, textarea { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.steps b { color: var(--text); font-weight: 800; white-space: nowrap; }
.steps li svg { width: 13px; height: 13px; vertical-align: -2px; }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid var(--border); transition: transform .2s; }
.actionbar__inner { display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
.actionbar__side { flex: none; padding: 0 18px; transition: transform .1s, opacity .15s; }
.actionbar__side svg { width: 20px; height: 20px; }
.actionbar__side[aria-disabled="true"] { opacity: .4; }
.actionbar__main[aria-disabled="true"] { opacity: .55; cursor: default; }
.actionbar__main { flex: 1; transition: transform .1s, opacity .15s; }
.actionbar__main svg { width: 20px; height: 20px; }
.page.has-bar { padding-bottom: 32px; }
body.typing .actionbar { transform: translateY(115%); }
.mdetail, .sheet-backdrop, .settings__done { display: none; }
.viewer__bar { padding-top: calc(10px + env(safe-area-inset-top)); }
.viewer__stage { inset: calc(54px + env(safe-area-inset-top)) 0 0; }
.viewer__hint { position: absolute; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #f4f4f5; font-size: 13px; white-space: nowrap; opacity: 0; transition: opacity .3s; pointer-events: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.viewer__hint.is-on { opacity: 1; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }

@media (pointer: coarse) {
  .input, .select, .textarea { font-size: 16px; }          /* iOS: 16px-ээс бага талбарт дарахад хуудас томордог */
  .icon-btn { width: 40px; height: 40px; }
  .frame__tools .icon-btn { width: 38px; height: 38px; }
  .hide-touch { display: none !important; }
}
@media (hover: none) {                                      /* мэдрэгч дэлгэцэд hover «наалддаг» тул буцаана */
  .thumb:hover { transform: none; box-shadow: none; }
  .btn:hover { background: var(--surface); }
  .btn--primary:hover { background: var(--primary); opacity: 1; }
  .btn--accent:hover { background: var(--accent); }
  .btn--ghost:hover { background: transparent; color: var(--text-2); }
  .btn--ghost[aria-expanded="true"]:hover { background: var(--surface-2); color: var(--text); }
  .icon-btn:hover { background: transparent; color: var(--text-2); }
  .icon-btn[aria-pressed="true"]:hover, .icon-btn[aria-expanded="true"]:hover { background: var(--surface-3); color: var(--text); }
  .frame__tools .icon-btn:hover { color: var(--text); }
  .mrow:hover { background: transparent; }
  .mrow.is-selected:hover { background: var(--brand-soft); }
  .dz:hover { background: var(--surface-2); border-color: var(--border-strong); }
  .dtable tr.is-click:hover td { background: transparent; }
  .viewer__bar .icon-btn:hover { background: transparent; color: #d4d4d8; }
  .btn:active, .actionbar__side:active, .thumb:active, .mrow:active { transform: scale(.97); }
  .btn:active, .icon-btn:active, .dtable tr.is-click:active td { opacity: .75; }
}

@media (max-width: 720px) {
  /* жишээ зураг: хэвтээ гүйлгэдэг нэг мөр */
  .samples { margin-top: 8px; }
  .thumbs { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .thumbs::-webkit-scrollbar { display: none; }
  .thumb { flex: 0 0 29%; scroll-snap-align: start; }
  .samples__desc { display: none; }
  /* үр дүн: аргууд таб шиг, зураг ирмэг хүртэл */
  .result__head { margin-bottom: 12px; }
  .rh__bar { flex-wrap: nowrap; gap: 0; margin: -6px -8px 0 -12px; }
  .rh__titles { order: 0; flex: 1 1 auto; margin: 0; padding: 0 4px 0 0; }
  .rh__title { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rh__title .tag { margin-left: 6px; }
  .rh__meta { margin-top: 1px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .result__methods { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 6px; margin: 0; }
  .result__methods .skel--row { height: 60px; margin: 0; }
  .mrow { grid-template-columns: auto minmax(0, 1fr); gap: 0 6px; padding: 9px 10px 8px; border: 1px solid var(--border); }
  .mrow.is-selected { border-color: transparent; }
  .mrow__name { font-size: 12.5px; color: var(--text-2); }
  .mrow.is-selected .mrow__name { color: var(--text); }
  .mrow__big { grid-column: 1 / -1; font-size: 19px; }
  .mrow__sub { display: none; }
  .mdetail { display: block; grid-column: 1 / -1; margin: 4px 2px 0; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
  .result__media { margin: 14px -16px 0; }
  .frame { border-radius: 0; min-height: 260px; }
  .frame img { width: 100%; max-height: none; }                 /* утсанд зураг дэлгэцийн өргөнөөр */
  .frame.is-compare { grid-template-columns: minmax(0, 1fr); }   /* зэрэгцүүлэхэд доош нь дараалуулна */
  .frame.is-compare img { max-height: none; }
  .result__media .legend { padding: 0 16px; }
  .result__answers { margin-top: 24px; }
  /* тохиргоо: доороос гарч ирэх хуудас */
  .settings { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; margin: 0; max-height: 86vh; overflow-y: auto; overscroll-behavior: contain; gap: 18px; padding: 10px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--raised); box-shadow: var(--shadow-lg); animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); }
  .settings::before { content: ""; justify-self: center; width: 36px; height: 5px; border-radius: 3px; background: var(--border-strong); }
  .settings__done { display: flex; margin-top: 2px; }
  .sheet-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(8, 8, 10, .38); animation: fade-in .2s; }
  body.sheet-open { overflow: hidden; }
  /* мэдэгдэл дээд талд — доод товчтой давхцахгүй */
  .toasts { top: calc(var(--topbar) + 10px); bottom: auto; }
  .dz--mid { min-height: 120px; }
}

/* ---------------------------------------------------------------- бодит өгөгдөл: зөвшөөрөл, «Зөв уншсан уу?», засвар */
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
/* олон хуудастай тест: дараагийн хуудас хүлээж буй мэдэгдэл */
.pnote { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--text-2); font-size: 14px; line-height: 1.5; }
.pnote p { flex: 1 1 240px; margin: 0; }
.pnote b { color: var(--text); font-weight: 900; }
.pnote > svg { flex: none; width: 18px; height: 18px; color: var(--success); }
.pnote.is-done { background: var(--success-soft); }
.pnote__act { display: flex; flex-wrap: wrap; gap: 8px; }
.step .pnote { margin: 0 0 12px; }
.many .pnote { margin: 4px 0 0; }
.fb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--surface-2); }
.fb__q { flex: 1; min-width: 110px; font-size: 13.5px; font-weight: 500; }
.fb .btn svg { width: 15px; height: 15px; }
.fb.is-done { gap: 8px; color: var(--success); background: var(--success-soft); font-size: 13.5px; font-weight: 500; }
.fb.is-done svg { width: 18px; height: 18px; }
.fix { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.fix__row { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 8px; }
.fix__row.is-diff { background: var(--diff); }
.fix__row.is-changed { background: var(--ring-soft); }
.fix__q { flex: none; width: 32px; padding-right: 6px; text-align: right; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fix__opt { width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; }
.fix__opt[aria-pressed="true"] { border-color: transparent; background: var(--primary); color: var(--primary-fg); }
.fix__foot { display: flex; gap: 8px; margin-top: 14px; }
.fix__foot .input { flex: 1; min-width: 0; }
@media (max-width: 720px) {
  .fix__opt { width: 42px; height: 38px; font-size: 13.5px; }
  .fix__foot { flex-direction: column; }
  .fix__foot .btn { height: 44px; }
}
#c-answers { scroll-margin-top: calc(var(--topbar) + 12px); }   /* «Засах» дарахад гарчиг дээд мөрөнд хаагдахгүй */

/* ---------------------------------------------------------------- хуудасны төрлийн жишээ зураг (эхлэл дэлгэц) */
.seg__img { display: none; }
.toolbar.is-start { align-items: flex-start; }
.toolbar.is-start > .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 420px); padding: 0; border-radius: 0; background: none; }
.toolbar.is-start > .seg > button { flex-direction: column; gap: 7px; height: auto; padding: 8px 8px 7px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); white-space: normal; }
.toolbar.is-start > .seg > button:hover { border-color: var(--border-strong); }
.toolbar.is-start > .seg > button[aria-checked="true"] { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar.is-start .seg__img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 7px; background: #fff; box-shadow: 0 0 0 1px var(--border); pointer-events: none; }
@media (max-width: 720px) {
  .toolbar.is-start > .seg { flex: 1 1 0; width: auto; gap: 8px; }
  .toolbar.is-start > .seg > button { padding: 6px 6px 5px; border-radius: 12px; font-size: 13px; }
}

/* ---------------------------------------------------------------- брэндийн бөмбөлөг (A–E) ба дугуй хувь */
.bubbles { display: inline-flex; gap: 8px; }
.bubbles i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid currentColor; font-size: 13px; font-style: normal; font-weight: 900; line-height: 1; }
.bubbles i.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.ring { position: relative; flex: none; display: grid; place-items: center; width: 84px; height: 84px; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--surface-3); stroke-width: 7; }
.ring__bar { fill: none; stroke: var(--success); stroke-width: 7; stroke-linecap: round; }
.ring.is-fail .ring__bar { stroke: var(--danger); }
.ring__v { position: relative; font-size: 16px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- зөвшөөрлийн цонх: хариулахгүйгээр цааш ашиглахгүй */
dialog.gate { width: min(400px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
dialog.gate::backdrop { background: rgba(9, 22, 18, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gate__art { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 22px 20px; background: #17352f; color: #bcd0c8; }
.gate__art p { font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #e39b2d; }
.gate__body { padding: 22px 22px 18px; }
.gate h3 { margin-bottom: 8px; font-size: 21px; font-weight: 900; }
.gate p { font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.gate__list { margin: 12px 0 18px; padding-left: 18px; list-style: disc; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.gate__actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.gate .caption { font-size: 12.5px; line-height: 1.5; color: var(--text-3); }

/* ---------------------------------------------------------------- зөв хариулт: товч ба оруулах цонх */
.keybtn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.keybtn:hover { border-color: var(--border-strong); }
.keybtn:not(.is-set) { border: 2px dashed var(--accent); background: var(--accent-soft); }
.keybtn__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.keybtn__icon svg { width: 18px; height: 18px; }
.keybtn.is-set .keybtn__icon { background: var(--success-soft); color: var(--success); box-shadow: none; }
.keybtn__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.keybtn__text b { font-size: 15.5px; font-weight: 900; }
.keybtn__text span { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keybtn:not(.is-set) .keybtn__text span { color: var(--text-2); }
.keybtn__text .keybtn__key { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; color: var(--text-2); }
.keybtn > svg:last-child { width: 18px; height: 18px; color: var(--accent); }
.keybtn__edit { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 800; color: var(--text-2); }
.keyrow { margin-top: 14px; }
.keybtn--inline { margin-top: 14px; }
dialog.keydlg { width: min(540px, calc(100vw - 32px)); }
.keydlg__hint { margin: -4px 0 12px; line-height: 1.55; }
.keydlg__hint code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; }
.keydlg__ta { min-height: 100px; border-radius: 14px; font-size: 14.5px; letter-spacing: .05em; }
.keydlg__status { margin: 10px 0 8px; font-size: 13.5px; font-weight: 800; color: var(--success); }
.keydlg__status.is-error { color: var(--danger); }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 5px; max-height: 190px; overflow-y: auto; }
.kchip { display: flex; align-items: baseline; justify-content: center; gap: 4px; height: 28px; border-radius: 14px; background: var(--surface-2); font-size: 13px; font-weight: 900; line-height: 28px; font-variant-numeric: tabular-nums; }
.kchip i { font-style: normal; font-size: 11px; font-weight: 700; color: var(--text-3); }
.keydlg__foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }

/* ---------------------------------------------------------------- нэг аргын үр дүн: оноо (дугуй хувь), алдаа, хариултын бөмбөлгүүд */
.summary { grid-area: methods; padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.summary__main { display: flex; align-items: center; gap: 16px; }
.summary__score { display: flex; flex-direction: column; min-width: 0; }
.summary__big { font-size: 44px; font-weight: 900; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.summary__label { margin-top: 5px; font-size: 14px; font-weight: 750; color: var(--text-3); }
.summary__stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.sstat { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--text-2); }
.sstat::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); }
.sstat b { font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.sstat--ok::before { background: var(--success); }
.sstat--bad::before { background: var(--danger); }
.sstat--none::before { background: transparent; box-shadow: inset 0 0 0 2px var(--text-3); }
.sstat--multi::before { background: var(--warn); }
.summary__meta { margin-top: 12px; font-size: 13px; color: var(--text-3); }
.fail { grid-area: methods; padding: 20px; border-radius: var(--r-lg); background: var(--danger-soft); }
.fail__icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 50%; background: var(--surface); color: var(--danger); }
.fail__icon svg { width: 21px; height: 21px; }
.fail h3 { font-size: 18px; font-weight: 900; }
.fail__msg { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.fail__tips { margin: 12px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.fail__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.frame img.is-plain { cursor: default; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.ac { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 9px; border-radius: 12px; background: var(--surface-2); font-variant-numeric: tabular-nums; overflow: hidden; }
.ac__q { min-width: 16px; font-size: 12px; font-weight: 800; color: var(--text-3); }
.ac__a { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--surface-3); color: var(--text); font-size: 13.5px; font-weight: 900; line-height: 1; }
.ac--ok { background: var(--success-soft); }
.ac--ok .ac__a { background: var(--success); color: var(--on-status); }
.ac--bad { background: var(--danger-soft); }
.ac--bad .ac__a { background: var(--danger); color: var(--on-status); }
.ac--multi { background: var(--warn-soft); }
.ac--multi .ac__a { background: var(--warn); color: var(--on-status); }
.ac--blank .ac__a, .ac--none .ac__a { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); color: var(--text-3); }
@media (max-width: 720px) {
  .summary { padding: 16px; }
  .summary__big { font-size: 38px; }
  .ring { width: 76px; height: 76px; }
  .fail { padding: 18px 16px; }
  .agrid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
}

/* ---------------------------------------------------------------- хөл ба нууцлал */
.foot { border-top: 1px solid var(--border); }
.foot__inner { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; max-width: var(--maxw); margin: 0 auto; padding: 14px 32px 22px; font-size: 12.5px; color: var(--text-3); }
.foot__sep { opacity: .6; }
.foot__link { display: inline-flex; align-items: center; gap: 5px; margin-right: -8px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.foot__link:hover { background: var(--hover); color: var(--text); }
.foot__link svg { width: 14px; height: 14px; }
body:has(#page-check.has-bar:not([hidden])) .foot { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
dialog.privacy { width: min(480px, calc(100vw - 32px)); max-height: min(86vh, 720px); overflow-y: auto; }
.privacy__body { display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.privacy__body h4 { margin: 0 0 3px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.privacy__body ul { margin: 0; padding-left: 18px; }
.privacy__consent { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.privacy__status { flex: 1; min-width: 160px; font-weight: 500; color: var(--text); }
@media (max-width: 720px) {
  .foot__inner { padding: 14px 16px 18px; }
}
@media (hover: none) {
  .keybtn:hover { border-color: var(--border); }
  .keybtn:not(.is-set):hover { border-color: var(--accent); }
  .glink:hover { box-shadow: var(--shadow-sm); }
  .foot__link:hover { background: none; color: var(--text-2); }
  .keybtn:active { transform: scale(.985); }
}

/* ---------------------------------------------------------------- дүн: багшийн жагсаалт */
.gline { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.gline__no { flex: none; display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 17px; background: var(--accent); color: var(--accent-fg); font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.gline__name { flex: 1; min-width: 0; height: 38px; }
.gline__link { flex: none; }
.keyrow--top { margin: 0 0 16px; }
.ghead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.ghead h2 { font-size: 25px; font-weight: 900; letter-spacing: -.02em; }
.ghead p { margin-top: 2px; font-size: 13.5px; color: var(--text-3); }
.ghead .btn { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.gstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.gstat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.gstat:first-child { background: #17352f; color: #fff; box-shadow: none; }
.gstat:first-child .gstat__k { color: #e39b2d; }
.gstat:first-child .gstat__sub { color: #bcd0c8; }
.gstat__k { font-size: 13px; font-weight: 800; color: var(--text-2); }
.gstat b { font-size: 28px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.gstat__sub { overflow: hidden; font-size: 12.5px; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
#page-grades .sec { margin-top: 16px; padding: 20px; border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
#page-grades .sec--first { margin-top: 0; padding: 6px 18px 4px; }
.gtable td { vertical-align: middle; }
.gtable tbody tr:last-child td { border-bottom: 0; }
.gno { width: 1%; color: var(--text-3); font-weight: 800; font-variant-numeric: tabular-nums; }
.gcell-name { min-width: 160px; }
.gcell-name .tag { height: 19px; margin-left: 6px; font-size: 11px; vertical-align: 0; }
.gname { width: 100%; max-width: 260px; height: 32px; margin-left: -8px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; font-weight: 800; }
.gname:hover { border-color: var(--border-strong); }
.gname:focus { outline: none; border-color: var(--ring); background: var(--surface); box-shadow: 0 0 0 3px var(--ring-soft); }
.gname::placeholder { font-weight: 600; color: var(--text-3); }
.gscore { font-size: 15px; font-weight: 900; }
.gscore.is-pass { color: var(--success); }
.gscore.is-fail { color: var(--danger); }
.gpct { color: var(--text-2); font-weight: 750; }
.gdel.is-armed { background: var(--danger-soft); color: var(--danger); }
.gempty { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 480px; margin: 8px auto 24px; padding: 34px 24px 30px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-sm); text-align: center; }
.gempty__art { margin-bottom: 4px; color: var(--border-strong); }
.gempty__art i { color: var(--text-3); }
.gempty p { color: var(--text-2); }
@media (max-width: 720px) {
  .gstats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gstat { padding: 14px; }
  .gstat b { font-size: 23px; }
  .gerr, .gtable th:nth-child(5) { display: none; }
  .gcell-name { min-width: 120px; }
  .gline { flex-wrap: wrap; }
  #page-grades .sec { padding: 16px; }
  #page-grades .sec--first { padding: 4px 12px 2px; }
  .ghead h2 { font-size: 22px; }
}
@media (pointer: coarse) {
  .gname { font-size: 16px; }
}

/* ---------------------------------------------------------------- скан: камерын шууд горим (оноо дараалан) */
body.scanning { overflow: hidden; }
.scanner { position: fixed; inset: 0; z-index: 95; background: #000; color: #fff; }
.scanner__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner__frame { position: absolute; left: 50%; top: 45%; width: min(80vw, 56vh); aspect-ratio: 210 / 297; transform: translate(-50%, -50%); pointer-events: none; }
.scanner__frame i { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(255, 255, 255, .9); }
.scanner__frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.scanner__frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.scanner__frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.scanner__frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.scanner__top { position: absolute; left: 0; right: 0; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 18px; background: linear-gradient(rgba(0, 0, 0, .6), transparent); }
.scanner__title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; font-size: 12.5px; color: rgba(255, 255, 255, .8); text-align: center; }
.scanner__title b { font-size: 15px; color: #fff; }
.scanner__btn { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.scanner__btn svg { width: 20px; height: 20px; }
.scanner__btn.is-on { background: #fff; color: #111; }
.scanner__btn[hidden] { display: grid !important; visibility: hidden; }
.scanner__bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 12px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .7) 45%); }
.scanner__status { max-width: 92vw; padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: 14px; font-weight: 750; text-align: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.scanner__status.is-busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.scanner__status.is-ok { background: rgba(29, 138, 94, .9); }
.scanner__status.is-warn { background: rgba(154, 91, 0, .88); }
.scanner__status.is-error { background: rgba(200, 30, 30, .88); }
.scanner__card { width: min(92vw, 420px); padding: 16px 18px 14px; border-top: 6px solid #e39b2d; border-radius: 22px; background: #fff; color: #13241f; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.scanner__card.is-pass { border-top-color: #1d8a5e; }
.scanner__card.is-fail { border-top-color: #c8412f; }
.scanner__card.is-pop { animation: pop .28s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes pop { from { transform: scale(.86); opacity: 0; } }
.scanner__score { font-size: 56px; font-weight: 900; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.scanner__card.is-pass .scanner__score { color: #1d8a5e; }
.scanner__card.is-fail .scanner__score { color: #c8412f; }
.scanner__meta { margin-top: 6px; font-size: 14.5px; font-weight: 700; color: #4d5d57; }
.scanner__meta b { color: #13241f; }
.scanner__same { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; color: #4d5d57; }
.scanner__card .btn { border-color: #d4cebc; background: #fff; color: #13241f; }
.scanner__tray { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 560px; }
.scanner__list { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.scanner__list::-webkit-scrollbar { display: none; }
.schip { flex: none; display: inline-flex; align-items: baseline; gap: 5px; height: 30px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 13px; font-weight: 600; line-height: 30px; font-variant-numeric: tabular-nums; }
.schip i { font-size: 12px; font-style: normal; font-weight: 500; opacity: .75; }
.schip.is-pass { background: rgba(76, 195, 138, .32); }
.scanner__grades { flex: none; display: inline-flex; align-items: center; gap: 2px; height: 36px; margin-left: auto; padding: 0 14px; border-radius: 999px; background: #e39b2d; color: #1b2c27; font-size: 14px; font-weight: 900; text-decoration: none; }
.scanner__grades svg { width: 16px; height: 16px; }
.scanner__progress { width: min(60vw, 240px); height: 4px; overflow: hidden; border-radius: 4px; background: rgba(255, 255, 255, .22); opacity: 0; transition: opacity .15s; }
.scanner__progress.is-on { opacity: 1; }
.scanner__progress span { display: block; width: 0; height: 100%; border-radius: 4px; background: #e39b2d; transition: width .12s linear; }
.scanner__shutter { flex: none; display: grid; place-items: center; width: 72px; height: 72px; padding: 0; border: 4px solid rgba(255, 255, 255, .9); border-radius: 50%; background: transparent; cursor: pointer; }
.scanner__shutter span { width: 56px; height: 56px; border-radius: 50%; background: #fff; transition: transform .1s; }
.scanner__shutter:active span { transform: scale(.88); }
.scanner__shutter.is-small { width: 48px; height: 48px; border-width: 3px; }
.scanner__shutter.is-small span { width: 36px; height: 36px; }
body.scanning .toasts { opacity: 0; pointer-events: none; }   /* камер дээр мэдэгдэл давхцахгүй (төлөв доод мөрөнд) */

/* ---------------------------------------------------------------- эхлэл: хар ногоон толгой + A төрөл · B зөв хариулт · C шалгах */
.start { display: flex; flex-direction: column; gap: 16px; max-width: 660px; margin: 0 auto; }
.hero { position: relative; display: flex; flex-direction: column; margin-top: -28px; padding: 30px 0 76px; background: var(--brand); color: var(--brand-fg);
  box-shadow: 0 0 0 100vmax var(--brand); clip-path: inset(0 -100vmax); }        /* дэвсгэр дэлгэцийн өргөнөөр */
.hero__eyebrow { font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.hero__title { margin-top: 8px; max-width: 460px; font-size: 34px; font-weight: 900; letter-spacing: -.025em; line-height: 1.1; color: #fff; }
.hero__sub { margin-top: 10px; max-width: 420px; font-size: 15.5px; line-height: 1.5; color: var(--brand-ink); }
.hero__bubbles { position: absolute; right: 0; top: 40px; color: rgba(188, 208, 200, .55); }
.hero__bubbles i { width: 40px; height: 40px; font-size: 15px; }
.stepcard { position: relative; margin-top: -56px; padding: 4px 24px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-md); }
.step { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 20px 0; }
.step + .step { border-top: 1px solid var(--border-subtle); }
.step__head { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.step__head h2 { flex: 1; min-width: 0; font-size: 17px; font-weight: 900; }
.step__head .btn { margin-right: -10px; }
.step__no { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong); color: var(--text-3); font-size: 13px; font-weight: 900; line-height: 1; transition: background .2s, border-color .2s, color .2s; }
.step__no.is-done { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.step__note { font-size: 13.5px; line-height: 1.5; color: var(--text-3); }
.step__note .link { font-size: 13.5px; color: var(--text); vertical-align: bottom; }
.step__text { font-size: 15px; line-height: 1.55; color: var(--text-2); }
.step__row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.step .settings { margin: 0; }
.step .dz { min-height: 190px; padding: 28px 20px; }
.types > .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 480px); padding: 0; border-radius: 0; background: none; }
.types > .seg > button { position: relative; flex-direction: column; gap: 8px; height: auto; padding: 8px 8px 9px; border: 2px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text-2); white-space: normal; transition: border-color .15s, box-shadow .15s, color .15s; }
.types > .seg > button:hover { border-color: var(--border-strong); }
.types > .seg > button[aria-checked="true"] { border-color: var(--accent); background: var(--surface); color: var(--text); box-shadow: 0 0 0 4px var(--accent-soft); }
.types > .seg > button[aria-checked="true"]::after { content: ""; position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b2c27' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat; }
.types .seg__img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 11px; background: #fff; box-shadow: 0 0 0 1px var(--border); pointer-events: none; }
.glink { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text-2); font-size: 14.5px; text-decoration: none; transition: box-shadow .15s; }
.glink::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.glink b { font-weight: 900; color: var(--text); }
.glink svg { width: 18px; height: 18px; margin-left: auto; color: var(--text-3); }
.glink:hover { box-shadow: var(--shadow-md); }
.start .samples { margin-top: 8px; }
@media (max-width: 720px) {
  .start { gap: 14px; }
  .hero { margin-top: -16px; padding: 18px 0 56px; }
  .hero__eyebrow { display: none; }
  .hero__bubbles { position: static; order: -1; gap: 6px; margin-bottom: 12px; }
  .hero__bubbles i { width: 24px; height: 24px; font-size: 11px; border-width: 1.5px; }
  .hero__title { margin-top: 0; font-size: 24px; line-height: 1.15; }
  .hero__sub { margin-top: 6px; font-size: 14px; line-height: 1.45; }
  .stepcard { margin-top: -40px; padding: 2px 16px; border-radius: 22px; }
  .step { padding: 16px 0; }
  .types > .seg { width: 100%; gap: 10px; }
  .types > .seg > button { padding: 6px 6px 7px; border-radius: 16px; font-size: 13px; }
  .types .seg__img { aspect-ratio: 1; border-radius: 10px; }
}

/* ---------------------------------------------------------------- олон зураг: дараалан уншиж «Дүн»-д нэмэх */
.many { max-width: 660px; margin: 0 auto; padding: 22px 22px 18px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-md); }
.many__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.many__head h2 { font-size: 20px; font-weight: 900; }
.many__head .caption { margin-top: 3px; font-variant-numeric: tabular-nums; }
.many .progress { flex: none; height: 6px; margin-bottom: 8px; }
.many .progress span { background: var(--accent); }
.many__list { display: flex; flex-direction: column; }
.mitem { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 2px; border-bottom: 1px solid var(--border-subtle); }
.mitem:last-child { border-bottom: 0; }
.mitem__no { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); font-size: 12.5px; font-weight: 900; font-variant-numeric: tabular-nums; }
.mitem.is-ok .mitem__no { background: var(--accent); color: var(--accent-fg); }
.mitem__name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; font-weight: 750; }
.mitem__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mitem__name small { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.mitem__score { flex: none; padding: 4px 12px; border-radius: 999px; font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
.mitem.is-pass .mitem__score { background: var(--success-soft); color: var(--success); }
.mitem.is-low .mitem__score { background: var(--danger-soft); color: var(--danger); }
.mitem__st { display: inline-flex; align-items: center; gap: 8px; max-width: 55%; font-size: 13.5px; font-weight: 700; color: var(--text-3); text-align: right; }
.mitem.is-fail .mitem__st, .mitem.is-err .mitem__st { color: var(--danger); }
.mitem.is-wait, .mitem.is-skip { opacity: .55; }
.mitem .btn { flex: none; margin-right: -8px; }
.many__foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.many__foot:empty { display: none; }
@media (max-width: 720px) {
  .many { padding: 18px 16px 14px; border-radius: 22px; }
}

/* ---------------------------------------------------------------- хүснэгтэний тоо (үр дүн, алдааны карт), тусламж, дүнгийн хөл */
.linkbtn { padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.result__head > .linkbtn { margin-top: 6px; font-size: 13px; }
.result__head > .counts { margin-top: 12px; }
.fail__counts { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--surface); }
.fail__counts p { margin-bottom: 10px; font-size: 13px; color: var(--text-2); }
dialog.help { width: min(460px, calc(100vw - 32px)); max-height: min(86vh, 720px); overflow-y: auto; }
.help .steps { margin-top: 2px; }
.help .steps b { white-space: normal; }
.help__h { margin: 20px 0 6px; font-size: 13.5px; font-weight: 600; }
.help__list { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.help__p { font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.help__p b { font-weight: 600; color: var(--text); }
.help__p svg { width: 14px; height: 14px; vertical-align: -2px; }
.link--inline { display: inline; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: normal; }
.gfoot { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--border); }
.gfoot .btn { margin-left: -10px; }

/* ---------------------------------------------------------------- өргөн дэлгэц: бүх өргөнийг ашиглана (утасны загвар хэвээр) */
.hero__art { display: none; }
.kchip--more { color: var(--text-3); }
@media (max-width: 759px) {
  .step__wide { display: none; }
}
@media (min-width: 760px) {
  .start { max-width: none; }
  .stepcard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px; }
  .step { padding: 22px 24px; }
  .step + .step { border-top: 0; }
  .step:nth-child(2) { border-left: 1px solid var(--border-subtle); }
  .step:last-child { grid-column: 1 / -1; border-top: 1px solid var(--border-subtle); }   /* A | B, доор нь C бүтэн өргөнөөр */
  .step .kgrid { max-height: none; }
  .many { max-width: none; }
  .many__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 32px; }
  .mitem:last-child { border-bottom: 1px solid var(--border-subtle); }
}
@media (min-width: 1100px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; column-gap: 48px; padding: 40px 0 104px; }
  .hero > * { grid-column: 1; }
  .hero__art { display: block; grid-column: 2; grid-row: 1 / span 4; align-self: center; width: 420px; margin: -8px 0 -28px; }
  .hero__art svg { display: block; width: 100%; height: auto; }
  .hero__art text { font-family: var(--font); }
  .hero__title { max-width: 700px; font-size: 44px; }
  .hero__sub { max-width: 560px; font-size: 17px; }
  .hero__bubbles { position: static; margin-top: 22px; }
  .stepcard { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); margin-top: -68px; }
  .step:last-child { grid-column: auto; border-top: 0; }
  .step + .step { border-left: 1px solid var(--border-subtle); }
  .step .dz { flex: 1; min-height: 220px; }
  .types > .seg { width: 100%; }
  .gcols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr); gap: 16px; align-items: start; }
  .gside > .sec:first-child { margin-top: 0; }
}
@media (min-width: 1280px) {
  .result { grid-template-columns: minmax(0, 1fr) 420px; column-gap: 40px; }
}

