/* ==========================================================
   ЭЕШ онлайн сорил (оны жинхэнэ даалгавар) — нэгдсэн загвар
   Хуудас: soril-eesh{он}{a|b|c|d}.html
   ========================================================== */
:root {
  --gun: #0f2b46;
  --gun2: #152238;
  --bekh: #14233a;
  --sul: #5d6f86;
  --zaas: #e3e9f1;
  --tsaas: #ffffff;
  --sharga: #f5b942;
  --zov: #15803d;  --zov-bg: #dcfce7;
  --buruu: #dc2626; --buruu-bg: #fee2e2;
  --songo: #2563eb; --songo-bg: #dbeafe;
  --t1: #0ea5a4;   /* 1 оноо */
  --t2: #3b82f6;   /* 2 оноо */
  --t3: #8b5cf6;   /* 3 оноо */
  --t7: #ec4899;   /* нөхөх */
  --huv: #f59e0b;  /* хувилбарын өнгө — JS солино */
  --huv2: #fbbf24;
  --muhlag: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 20px; scroll-padding-bottom: 80px; overflow-x: clip; }
body {
  margin: 0;
  font-family: "Golos Text", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--gun2);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(59,130,246,.22), transparent 38%),
    radial-gradient(circle at 92% 22%, rgba(236,72,153,.16), transparent 36%),
    radial-gradient(circle at 50% 100%, rgba(14,165,164,.14), transparent 45%);
  background-attachment: fixed;
  color: var(--bekh);
  line-height: 1.6;
  overflow-x: clip;
}
a { color: inherit; }
.es-hyazgaar { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- толгой ---------- */
.es-butsah {
  display: inline-block; margin: 22px 0 6px; color: #b8c7d9;
  text-decoration: none; font-size: 14.5px;
}
.es-butsah:hover { color: var(--sharga); }

.es-hero {
  position: relative; overflow: hidden;
  border-radius: 24px; padding: 26px 24px 22px; margin: 8px 0 18px;
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 55%, #831843 100%);
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
}
.es-hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, var(--huv2), transparent 68%); opacity: .35;
}
.es-hero-mur { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.es-useg {
  flex: none; width: 74px; height: 74px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 800; color: var(--gun);
  background: linear-gradient(145deg, var(--huv2), var(--huv));
  box-shadow: 0 8px 22px rgba(0,0,0,.25), inset 0 -4px 0 rgba(0,0,0,.12);
}
.es-hero h1 { margin: 0; font-size: clamp(22px, 5vw, 30px); line-height: 1.2; letter-spacing: -.3px; }
.es-hero .es-ded { margin: 4px 0 0; color: #dbe4ff; font-size: 14.5px; }
.es-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; position: relative; z-index: 1; }
.es-chip {
  font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18);
}
.es-huvs { display: flex; gap: 8px; margin-top: 16px; position: relative; z-index: 1; align-items: center; flex-wrap: wrap; }
.es-huvs span.es-l { font-size: 13px; color: #dbe4ff; margin-right: 2px; }
.es-huvs a {
  width: 38px; height: 38px; border-radius: 11px; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; text-decoration: none;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.22);
  transition: transform .12s, background .12s;
}
.es-huvs a:hover { transform: translateY(-2px); background: rgba(255,255,255,.24); }
.es-huvs a.es-odoo { background: #fff; color: var(--gun); }

.es-sanamj {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: #d5e0ee; border-radius: 16px; padding: 14px 18px; font-size: 14.5px;
}
.es-sanamj b { color: #fff; }

/* ---------- наалттай мөр ---------- */
.es-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(15,26,46,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.1);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 24px rgba(0,0,0,.25);
}
.es-bar-in { display: flex; align-items: center; gap: 12px; padding: 10px 16px; max-width: 760px; margin: 0 auto; }
.es-ahits { flex: 1; min-width: 0; }
.es-ahits-t { display: flex; justify-content: space-between; font-size: 12.5px; color: #b8c7d9; margin-bottom: 5px; }
.es-ahits-t b { color: #fff; }
.es-zam { height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.es-zam i {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #22d3ee, #3b82f6, #a855f7, #ec4899);
  transition: width .35s ease;
}
.es-tsag {
  flex: none; font-variant-numeric: tabular-nums; font-weight: 700; color: #fff;
  background: rgba(255,255,255,.1); padding: 7px 11px; border-radius: 10px; font-size: 14px;
}
.es-tsag.es-ayul { background: #b91c1c; }
.es-btn-s {
  flex: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 13.5px;
  padding: 8px 12px; border-radius: 10px; background: var(--sharga); color: var(--gun);
}
.es-btn-s.es-saaral { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- бодлогын навигаци ---------- */
.es-nav {
  background: var(--tsaas); border-radius: var(--muhlag); padding: 16px; margin: 18px 0;
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
}
.es-nav h3 { margin: 0 0 10px; font-size: 14px; color: var(--sul); font-weight: 700; letter-spacing: .02em; }
.es-nav-tor { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.es-nav a {
  height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 700; text-decoration: none;
  background: #f1f5f9; color: #64748b; border: 2px solid transparent;
}
.es-nav a.es-hn { background: var(--songo-bg); color: var(--songo); }
.es-nav a.es-zv { background: var(--zov-bg); color: var(--zov); }
.es-nav a.es-br { background: var(--buruu-bg); color: var(--buruu); }
.es-nav a.es-nh { grid-column: span 2; }
.es-tailbar { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--sul); }
.es-tailbar i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- хэсгийн гарчиг ---------- */
.es-heseg {
  display: flex; align-items: center; gap: 12px; color: #fff;
  margin: 34px 0 12px; font-size: 19px; font-weight: 800;
}
.es-heseg span.es-dug {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--sharga); color: var(--gun); font-size: 17px;
}
.es-heseg small { display: block; font-size: 13px; font-weight: 500; color: #b8c7d9; }

/* ---------- бодлогын карт ---------- */
.es-kart {
  position: relative; background: var(--tsaas); border-radius: var(--muhlag);
  padding: 18px 20px 16px; margin: 14px 0;
  box-shadow: 0 8px 22px rgba(0,0,0,.16);
  border-left: 6px solid var(--t-ongo, var(--t2));
  transition: box-shadow .2s;
}
.es-kart.es-t1 { --t-ongo: var(--t1); }
.es-kart.es-t2 { --t-ongo: var(--t2); }
.es-kart.es-t3 { --t-ongo: var(--t3); }
.es-kart.es-t7 { --t-ongo: var(--t7); }
.es-kart.es-zv-k { border-left-color: var(--zov); }
.es-kart.es-br-k { border-left-color: var(--buruu); }
.es-kart-t { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.es-dugaar {
  min-width: 38px; height: 32px; padding: 0 10px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px; background: var(--t-ongo, var(--t2));
}
.es-onoo {
  font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px;
  color: var(--t-ongo, var(--t2)); background: color-mix(in srgb, var(--t-ongo, #3b82f6) 13%, white);
}
.es-eh {
  font-size: 12px; font-weight: 600; color: #64748b; background: #f1f5f9;
  border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.es-tem { margin-left: auto; font-size: 18px; }
.es-asuult { font-size: 16.5px; line-height: 1.75; overflow-wrap: anywhere; }
.es-asuult table { border-collapse: collapse; margin: 10px auto; max-width: 100%; display: block; overflow-x: auto; width: max-content; }
.es-asuult td, .es-asuult th { font-size: 14.5px; padding: 6px 10px; }
.zurag { margin: 14px auto 4px; text-align: center; }
.zurag svg { max-width: 100%; width: 400px; height: auto; }

/* сонголтууд */
.es-songoltuud { display: grid; gap: 8px; margin-top: 14px; }
.es-songolt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: #f8fafc; color: var(--bekh); border: 2px solid #e2e8f0; border-radius: 14px;
  padding: 10px 14px; font: inherit; font-size: 16px; cursor: pointer;
  transition: border-color .12s, background .12s, transform .08s;
  overflow-x: auto;
}
.es-songolt:hover { border-color: #93c5fd; background: #f1f7ff; }
.es-songolt:active { transform: scale(.995); }
.es-songolt .es-u {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14.5px; background: #e2e8f0; color: #475569;
}
.es-songolt.es-sg { border-color: var(--songo); background: var(--songo-bg); }
.es-songolt.es-sg .es-u { background: var(--songo); color: #fff; }
.es-songolt.es-zv { border-color: var(--zov); background: var(--zov-bg); }
.es-songolt.es-zv .es-u { background: var(--zov); color: #fff; }
.es-songolt.es-br { border-color: var(--buruu); background: var(--buruu-bg); }
.es-songolt.es-br .es-u { background: var(--buruu); color: #fff; }
.es-songolt[disabled] { cursor: default; }

/* нөхөх */
.es-mur {
  margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: #fdf4fa;
  font-size: 16px; line-height: 2.3; overflow-x: auto;
}
.es-mur .es-mo { font-size: 12px; font-weight: 700; color: var(--t7); white-space: nowrap; }
.es-mur.es-zv { background: var(--zov-bg); }
.es-mur.es-br { background: var(--buruu-bg); }
.nud {
  width: 36px; height: 42px; text-align: center; vertical-align: middle;
  font: inherit; font-size: 19px; font-weight: 800; color: var(--gun);
  border: 2px dashed #f0abfc; border-radius: 9px; background: #fff; margin: 0 2px; padding: 0;
  transition: border-color .12s, box-shadow .12s;
}
.nud:focus { outline: none; border-style: solid; border-color: var(--t7); box-shadow: 0 0 0 4px rgba(236,72,153,.18); }
.nud.es-bgl { border-style: solid; border-color: #c084fc; background: #faf5ff; }
.nud.zov { border: 2px solid var(--zov); background: #fff; color: var(--zov); }
.nud.buruu { border: 2px solid var(--buruu); background: #fff; color: var(--buruu); }
.es-zovn { display: inline-block; font-size: 12px; font-weight: 800; color: var(--zov); margin-left: -2px; margin-right: 4px; vertical-align: super; }
.butarhai { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 4px; line-height: 1.9; }
.butarhai .deed { display: block; border-bottom: 2px solid var(--gun); padding: 0 4px 4px; }
.butarhai .dood { display: block; padding-top: 4px; }
.yazgu { display: inline-flex; align-items: stretch; vertical-align: middle; }
.yazgu svg { width: 14px; height: auto; flex: none; }
.yazgu .agv { border-top: 2px solid var(--gun); padding: 4px 2px 0; }

/* бодолт */
.es-bodolt {
  margin-top: 14px; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a;
  font-size: 15px; line-height: 1.75; overflow-x: auto;
}
.es-bodolt summary { cursor: pointer; padding: 11px 14px; font-weight: 700; color: #92400e; list-style: none; }
.es-bodolt summary::-webkit-details-marker { display: none; }
.es-bodolt summary::before { content: "💡 "; }
.es-bodolt > div { padding: 0 14px 14px; }
.es-zv-tuluv { font-size: 13.5px; font-weight: 700; margin-top: 10px; }
.es-zv-tuluv.es-ok { color: var(--zov); }
.es-zv-tuluv.es-no { color: var(--buruu); }

/* илгээх */
.es-ilgeeh {
  display: block; width: 100%; max-width: 360px; margin: 30px auto 10px;
  border: 0; border-radius: 16px; padding: 17px; cursor: pointer;
  font: inherit; font-size: 18px; font-weight: 800; color: var(--gun);
  background: linear-gradient(135deg, #fde047, #f59e0b);
  box-shadow: 0 10px 26px rgba(245,158,11,.35), inset 0 -4px 0 rgba(0,0,0,.1);
  transition: transform .1s;
}
.es-ilgeeh:hover { transform: translateY(-2px); }
.es-ilgeeh[disabled] { opacity: .6; cursor: default; transform: none; }
.es-dood-t { text-align: center; color: #b8c7d9; font-size: 13.5px; }

/* дүн */
.es-dun {
  background: var(--tsaas); border-radius: 24px; padding: 26px 22px; margin: 24px 0;
  box-shadow: 0 18px 40px rgba(0,0,0,.25); text-align: center;
}
.es-dun h2 { margin: 0 0 6px; font-size: 22px; }
.es-dun-mur { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 26px; margin-top: 10px; }
.es-tsagrag { position: relative; width: 168px; height: 168px; }
.es-tsagrag svg { transform: rotate(-90deg); }
.es-tsagrag .es-too { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.es-tsagrag .es-too b { font-size: 40px; line-height: 1; color: var(--gun); }
.es-tsagrag .es-too span { font-size: 13px; color: var(--sul); margin-top: 4px; }
.es-tsagrag .es-too .es-pct { margin-top: 2px; font-weight: 800; color: var(--gun); font-size: 14px; }
.es-statuud { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px; text-align: left; }
.es-stat { border-radius: 14px; padding: 10px 14px; background: #f1f5f9; }
.es-stat b { display: block; font-size: 20px; }
.es-stat span { font-size: 12.5px; color: var(--sul); }
.es-stat.es-s1 { background: #ecfeff; } .es-stat.es-s1 b { color: #0e7490; }
.es-stat.es-s2 { background: #fdf2f8; } .es-stat.es-s2 b { color: #be185d; }
.es-stat.es-s3 { background: var(--zov-bg); } .es-stat.es-s3 b { color: var(--zov); }
.es-stat.es-s4 { background: #f5f3ff; } .es-stat.es-s4 b { color: #6d28d9; }
.es-dun-med { margin-top: 16px; font-size: 14px; color: var(--sul); line-height: 1.6; }
.es-dun-tovch { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.es-dun-tovch a, .es-dun-tovch button {
  border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 14.5px; text-decoration: none;
  padding: 10px 16px; border-radius: 12px; background: #eef2ff; color: #3730a3;
}
.es-dun-tovch .es-gol { background: var(--gun); color: #fff; }

/* томьёоны цонх */
.es-tomyo-bg { position: fixed; inset: 0; z-index: 60; background: rgba(5,12,24,.6); display: none; }
.es-tomyo-bg.es-neelt { display: block; }
.es-tomyo {
  position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 22px 22px 18px; display: none;
  box-shadow: 0 30px 60px rgba(0,0,0,.4); font-size: 15.5px;
}
.es-tomyo.es-neelt { display: block; }
.es-tomyo-haah {
  position: sticky; top: 0; float: right; border: 0; background: #f1f5f9; border-radius: 10px;
  width: 36px; height: 36px; font-size: 18px; cursor: pointer;
}
.es-tomyo table { max-width: 100%; display: block; overflow-x: auto; width: max-content; }

footer.es-hol { text-align: center; color: #8ba0b8; font-size: 13px; padding: 30px 16px 110px; }
footer.es-hol a { color: #b8c7d9; margin: 0 8px; }

@media (max-width: 520px) {
  .es-hero { padding: 20px 16px 18px; border-radius: 20px; }
  .es-useg { width: 58px; height: 58px; font-size: 31px; border-radius: 16px; }
  .es-kart { padding: 15px 14px 13px; }
  .es-asuult { font-size: 15.5px; }
  .es-songolt { font-size: 15px; padding: 9px 11px; }
  .es-mur { padding: 10px; font-size: 15px; }
  .nud { width: 32px; height: 38px; font-size: 17px; }
  .es-bar-in { gap: 8px; padding: 9px 12px; }
  .es-btn-s { padding: 7px 9px; font-size: 12.5px; }
  .es-tsag { padding: 6px 8px; font-size: 13px; }
}

/* ---------- нэг нэгээр горим ---------- */
.es-nav-t { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.es-nav-t h3 { margin: 0; }
.es-gorim { display: inline-flex; background: #f1f5f9; border-radius: 11px; padding: 3px; }
.es-gorim button {
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: #64748b;
  padding: 6px 11px; border-radius: 8px; cursor: pointer;
}
.es-gorim button.es-idev { background: #fff; color: var(--gun); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.es-nav a.es-odoo { border-color: var(--gun); box-shadow: 0 0 0 2px rgba(15,43,70,.15); }

.es-neg .es-kart, .es-neg .es-heseg { display: none; }
.es-neg .es-kart.es-idev { display: block; animation: es-orj .22s ease; }
.es-neg .es-heseg.es-idev { display: flex; }
@keyframes es-orj { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.es-pager { display: none; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 0; }
.es-neg .es-pager { display: flex; }
.es-pager span { color: #b8c7d9; font-weight: 700; font-size: 14px; }
.es-pg {
  border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 15px;
  padding: 12px 18px; border-radius: 14px; background: rgba(255,255,255,.12); color: #fff;
}
.es-pg.es-pg-d { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.es-pg[disabled] { opacity: .35; cursor: default; }
.es-sum { display: none; width: 36px; font-size: 20px; line-height: 1; padding: 6px 0; }
.es-neg .es-sum { display: inline-block; }
.es-sum[disabled] { opacity: .35; }
.es-neg .es-ilgeeh { margin-top: 22px; }

/* ---------- хуучин оны өгөгдөлд хэрэглэгддэг ангиуд (2006–2019) ---------- */
.taslahgui { display: inline-block; white-space: nowrap; vertical-align: middle; }
.huvi-guilgeh { overflow-x: auto; }
.nud.jijig { width: 28px; height: 32px; font-size: 16px; }
.zurag.jijig svg, .zurag.dund svg { max-width: 330px; }
.yaz { font-size: 34px; line-height: 46px; vertical-align: middle; }
.yazdoor { border-top: 1.8px solid #0f2b46; padding: 2px 3px 0; vertical-align: middle; }
.yazguur { display: inline-flex; align-items: flex-start; vertical-align: middle; margin: 0 2px; }
.yazguur > svg { display: block; flex: none; width: 15px; height: auto; margin-right: -1px; }
.yazguur .yazdoor { display: inline-block; border-top: 2.4px solid #0f2b46; padding: 4px 5px 0 1px; margin-left: -1px; }
.yazguur > .door { border-top: 2.2px solid #0f2b46; margin-top: 4px; padding: 5px 9px 0 3px; white-space: nowrap; }
.medee-huvsnegt { border-collapse: collapse; margin: 6px auto; }
.medee-huvsnegt td { border: 1.5px solid #8fa3b8; padding: 4px 8px; text-align: center; font-size: 15px; }
.medee-huvsnegt td.gar { font-weight: bold; text-align: left; white-space: nowrap; }
.khuslet { border-collapse: collapse; margin: 14px auto; font-size: 15px; }
.khuslet td, .khuslet th { border: 1.5px solid #0f2b46; padding: 7px 14px; text-align: center; }
.khuslet th { background: #eef3f8; }
.ishnavch { display: inline-block; text-align: left; font-size: 17px; line-height: 2; margin: 6px 0; }
.ishnavch .ishmur { white-space: nowrap; }
.ishnavch .ish { display: inline-block; width: 40px; text-align: right; padding-right: 14px; border-right: 2.5px solid #0f2b46; }
.ishnavch .navch { display: inline-block; padding-left: 16px; letter-spacing: 9px; }
.ishnavch .toolgoi { border-bottom: 2.5px solid #0f2b46; font-weight: bold; padding-bottom: 4px; margin-bottom: 4px; }

/* Шууд шалгах товч — сэдэвчилсэн сорил (S.shuud) */
.es-shalgah {
  display: block; margin: 12px 0 0 auto; padding: 9px 20px; border: 0; border-radius: 10px;
  background: var(--huv, #f59e0b); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
}
.es-shalgah:disabled { background: #e2e8f0; color: #94a3b8; cursor: default; }

/* «Шинээр эхлэх» — толгой хэсгийн chip-тэй ижил хэлбэр, товч */
.es-chip.es-shine { cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: inherit; margin-left: auto; }
.es-chip.es-shine:hover { background: rgba(255,255,255,.28); }
