/* ==========================================================================
   ubKids layout: топ цэс, нүүр хуудас, каталог, хяналтын самбар
   ========================================================================== */

/* ---------- Top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 500;
  height: var(--nav-h);
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); box-shadow: 0 1px 12px rgba(16,24,40,.04); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: 22px; }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.logo:hover { color: var(--ink); }
.logo__mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--brand-500), var(--violet));
  display: grid; place-content: center; color: #fff;
  box-shadow: 0 5px 14px rgba(47,107,255,.3);
  transition: transform var(--t) var(--ease);
}
.logo:hover .logo__mark { transform: rotate(-8deg) scale(1.05); }
.logo__mark svg { width: 19px; height: 19px; }
.logo__text { font-size: 19px; font-weight: 780; letter-spacing: -.04em; }
.logo__text span { color: var(--brand-500); }
.logo__tag { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; display: block; margin-top: -4px; }

.nav__links { display: flex; align-items: center; gap: 3px; }
.nav__link {
  padding: 8px 14px; border-radius: var(--r-full);
  font-size: 14.5px; font-weight: 550; color: var(--ink-2);
  transition: all var(--t-fast) var(--ease);
}
.nav__link:hover { background: var(--surface-3); color: var(--ink); }
.nav__link.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 620; }

.nav__actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.nav__burger { display: none; }

.bell { position: relative; }
.bell__dot {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--coral); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  border: 2px solid var(--surface); box-sizing: content-box;
}
.bell.has-new svg { animation: ring 1.6s var(--ease) 1; }

.usermenu { position: relative; }
.usermenu__btn {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px; border-radius: var(--r-full);
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; transition: all var(--t-fast) var(--ease);
}
.usermenu__btn:hover { border-color: #d5dbe7; background: var(--surface-2); }
.usermenu__name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.usermenu__role { font-size: 11.5px; color: var(--muted); line-height: 1.2; }

.dropdown {
  position: absolute; top: calc(100% + 9px); right: 0; z-index: 600;
  min-width: 250px; padding: 7px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-lg);
  animation: popIn .2s var(--ease-out) both;
}
.dropdown--wide { min-width: 370px; padding: 0; }
.dropdown__item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border: 0; background: transparent; border-radius: var(--r-xs);
  font-size: 14px; color: var(--ink-2); cursor: pointer; text-align: left;
  transition: background var(--t-fast) var(--ease);
}
.dropdown__item:hover { background: var(--surface-2); color: var(--ink); }
.dropdown__item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.dropdown__sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dropdown__head {
  padding: 14px 16px 11px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.dropdown__list { max-height: 400px; overflow-y: auto; }
.dropdown__foot { padding: 10px 14px; border-top: 1px solid var(--line); }

.notif {
  display: flex; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid var(--line-2); cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.notif:hover { background: var(--surface-2); }
.notif:last-child { border-bottom: 0; }
.notif.is-unread { background: var(--brand-50); }
.notif.is-unread:hover { background: var(--brand-100); }
.notif__icon {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-content: center;
}
.notif__icon svg { width: 16px; height: 16px; }
.notif__title { font-size: 13.5px; font-weight: 620; line-height: 1.4; }
.notif__body { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.notif__time { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 90px; padding: 56px 0 34px;
  background: var(--surface); border-top: 1px solid var(--line);
}
.footer__grid {
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px;
}
.footer__title { font-size: 13px; font-weight: 680; margin-bottom: 14px; letter-spacing: -.01em; }
.footer__list a { display: block; padding: 5px 0; font-size: 13.5px; color: var(--muted); }
.footer__list a:hover { color: var(--brand-600); }
.footer__bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 68px 0 52px; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(760px 420px at 12% -8%, rgba(47,107,255,.10), transparent 62%),
    radial-gradient(620px 380px at 92% 4%, rgba(139,92,246,.10), transparent 60%),
    radial-gradient(540px 340px at 62% 92%, rgba(255,122,89,.07), transparent 60%);
}
.hero__grid {
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 54px; align-items: center;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 7px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 550; color: var(--ink-2);
  box-shadow: var(--sh-xs); margin-bottom: 22px;
}
.hero__eyebrow b {
  background: var(--brand-500); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-full);
}
.hero h1 { margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--brand-500); position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 9px;
  background: var(--amber); opacity: .28; border-radius: 4px; z-index: -1;
}
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero__trust { display: flex; gap: 30px; margin-top: 38px; flex-wrap: wrap; }
.hero__trust b { display: block; font-size: 25px; font-weight: 760; letter-spacing: -.035em; }
.hero__trust span { font-size: 13px; color: var(--muted); }

.searchbar {
  display: flex; gap: 8px; padding: 8px; margin-top: 28px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-full); box-shadow: var(--sh-md);
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.searchbar:focus-within { border-color: var(--brand-300); box-shadow: var(--sh-lg); }
.searchbar .input {
  border: 0; box-shadow: none !important; background: transparent;
  padding-left: 16px;
}
.searchbar .select { border: 0; box-shadow: none !important; background-color: transparent; max-width: 165px; }

/* Hero collage */
.collage { position: relative; height: 430px; }
.collage__card {
  position: absolute; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-md); padding: 15px;
  animation: floaty 7s var(--ease) infinite;
}
.collage__card:nth-child(2) { animation-delay: -2.4s; }
.collage__card:nth-child(3) { animation-delay: -4.6s; }
.collage__card:nth-child(4) { animation-delay: -1.2s; }
.c1 { top: 0; left: 4%; width: 250px; }
.c2 { top: 130px; right: 0; width: 264px; }
.c3 { bottom: 12px; left: 0; width: 238px; }
.c4 { top: 44px; right: 26px; width: 152px; padding: 12px 14px; }

.mini-course { display: flex; gap: 11px; align-items: center; }
.mini-course__ico {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-content: center; font-size: 20px;
}
.mini-course__t { font-size: 13.5px; font-weight: 650; line-height: 1.34; }
.mini-course__s { font-size: 12px; color: var(--muted); }

/* ---------- Section ---------- */
.section { padding: 62px 0; }
.section--tight { padding: 40px 0; }
.section__head { margin-bottom: 30px; max-width: 660px; }
.section__head--row {
  max-width: none; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
.section__eyebrow {
  font-size: 12.5px; font-weight: 680; color: var(--brand-600);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 9px;
}
.section__desc { color: var(--muted); margin-top: 10px; font-size: 15.5px; }

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 13px;
}
.cat-card {
  display: flex; flex-direction: column; gap: 11px;
  padding: 18px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; text-align: left;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: #dde3ee; }
.cat-card__ico {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-content: center; font-size: 21px;
  transition: transform var(--t) var(--ease);
}
.cat-card:hover .cat-card__ico { transform: scale(1.08) rotate(-5deg); }
.cat-card__name { font-size: 14.5px; font-weight: 650; color: var(--ink); letter-spacing: -.015em; }
.cat-card__n { font-size: 12.5px; color: var(--muted); }

/* ---------- Course card ---------- */
.course-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 18px;
}
.course-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: #dde3ee; }
.course-card__cover {
  height: 124px; position: relative; overflow: hidden;
  display: grid; place-content: center;
}
.course-card__cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.4), transparent 70%);
}
.course-card__emoji {
  font-size: 46px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.12));
  transition: transform var(--t-slow) var(--ease-out);
}
.course-card:hover .course-card__emoji { transform: scale(1.12) rotate(5deg); }
.course-card__flag {
  position: absolute; top: 11px; left: 11px; z-index: 2;
  background: rgba(255,255,255,.93); backdrop-filter: blur(6px);
}
.course-card__fav {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  width: 31px; height: 31px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.93); backdrop-filter: blur(6px);
  display: grid; place-content: center; cursor: pointer; color: var(--muted);
  transition: all var(--t-fast) var(--ease);
}
.course-card__fav:hover { transform: scale(1.12); color: var(--rose); }
.course-card__fav.is-on { color: var(--rose); }
.course-card__fav svg { width: 15px; height: 15px; }
.course-card__body { padding: 15px 16px 16px; display: flex; flex-direction: column; flex: 1; gap: 9px; }
.course-card__center { font-size: 12px; color: var(--muted); font-weight: 560; }
.course-card__title {
  font-size: 15.5px; font-weight: 670; line-height: 1.36; letter-spacing: -.018em;
  min-height: 42px;
}
.course-card__meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.course-card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.course-card__meta svg { width: 13px; height: 13px; }
.course-card__foot {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.course-card__price { font-size: 15px; font-weight: 720; letter-spacing: -.025em; }
.course-card__price small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.rate { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 640; }
.rate svg { width: 14px; height: 14px; color: var(--amber); }
.rate span { color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- Catalog ---------- */
.catalog { display: grid; grid-template-columns: 268px 1fr; gap: 28px; align-items: start; }
.filters {
  position: sticky; top: calc(var(--nav-h) + 18px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 19px;
  max-height: calc(100vh - var(--nav-h) - 36px); overflow-y: auto;
}
.filters__group + .filters__group { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.filters__label {
  font-size: 12.5px; font-weight: 680; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin-bottom: 11px;
}
.filters__opts { display: flex; flex-direction: column; gap: 2px; }

/* ---------- Course detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 348px; gap: 34px; align-items: start; }
.detail__hero {
  border-radius: var(--r-xl); padding: 34px; position: relative; overflow: hidden;
  margin-bottom: 26px;
}
.detail__hero::after {
  content: ""; position: absolute; right: -40px; bottom: -50px;
  font-size: 210px; line-height: 1; opacity: .13;
}
.detail__emoji { font-size: 56px; margin-bottom: 14px; display: block; }
.booking {
  position: sticky; top: calc(var(--nav-h) + 18px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-sm);
}
.booking__price { font-size: 30px; font-weight: 780; letter-spacing: -.04em; line-height: 1.1; }
.booking__per { font-size: 13.5px; color: var(--muted); }

.feature-list { display: flex; flex-direction: column; gap: 11px; }
.feature-list li { display: flex; gap: 11px; font-size: 14.5px; color: var(--ink-2); align-items: flex-start; }
.feature-list svg { width: 18px; height: 18px; flex: none; color: var(--mint); margin-top: 2px; }

/* ---------- Timetable ---------- */
.timetable { display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); gap: 9px; }
.tt-day__name {
  font-size: 12px; font-weight: 680; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 0 3px 9px; text-align: center;
}
.tt-day__name.is-today { color: var(--brand-600); }
.tt-col {
  background: var(--surface-2); border-radius: var(--r-sm); padding: 8px;
  min-height: 120px; display: flex; flex-direction: column; gap: 7px;
}
.tt-col.is-today { background: var(--brand-50); }
.tt-item {
  background: var(--surface); border-radius: var(--r-xs); padding: 9px 10px;
  border-left: 3px solid var(--brand-500); box-shadow: var(--sh-xs);
  cursor: pointer; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.tt-item:hover { transform: translateX(2px); box-shadow: var(--sh-sm); }
.tt-item__time { font-size: 11px; font-weight: 700; color: var(--brand-600); font-variant-numeric: tabular-nums; }
.tt-item__t { font-size: 12.5px; font-weight: 600; line-height: 1.35; margin-top: 2px; }
.tt-item__c { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- App shell (dashboards) ---------- */
.app-shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: calc(100vh - var(--nav-h)); }
.side {
  border-right: 1px solid var(--line); background: var(--surface);
  padding: 20px 14px; position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h)); overflow-y: auto;
}
.side__group + .side__group { margin-top: 22px; }
.side__label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted-2); padding: 0 12px; margin-bottom: 7px;
}
.side__link {
  display: flex; align-items: center; gap: 11px;
  padding: 9.5px 12px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 550; color: var(--ink-2);
  transition: all var(--t-fast) var(--ease);
}
.side__link:hover { background: var(--surface-2); color: var(--ink); }
.side__link.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 640; }
.side__link svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.side__link.is-active svg { color: var(--brand-600); }
.side__link .badge { margin-left: auto; }

.work { padding: 26px 30px 70px; min-width: 0; background: var(--canvas); }
.work__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.work__title { font-size: 25px; font-weight: 740; letter-spacing: -.032em; }
.work__sub { color: var(--muted); font-size: 14px; margin-top: 3px; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; align-items: start; }

/* ---------- Charts ---------- */
.chart { width: 100%; overflow: visible; }
.chart text { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--line-2); stroke-width: 1; }
.chart .axis-line { stroke: var(--line); stroke-width: 1; }
.chart-bar { transition: opacity var(--t-fast) var(--ease); cursor: pointer; }
.chart-bar:hover { opacity: .78; }
.chart-anim-bar { animation: growBar .8s var(--ease-out) both; transform-origin: bottom; }
@keyframes growBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-line-path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: drawLine 1.5s var(--ease-out) forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

.hbar-row { display: grid; grid-template-columns: 148px 1fr 64px; gap: 12px; align-items: center; font-size: 13.5px; }
.hbar-row + .hbar-row { margin-top: 11px; }
.hbar-row__name { color: var(--ink-2); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row__val { text-align: right; font-weight: 640; font-variant-numeric: tabular-nums; }

/* ---------- GPS / map ---------- */
.map-box {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: #f2efe9;
  height: 260px;
}
.map-tiles {
  position: absolute; left: 50%; top: 50%;
  pointer-events: none; user-select: none;
}
.map-tiles img {
  position: absolute; width: 256px; height: 256px; max-width: none;
  opacity: 0; animation: tileIn .55s var(--ease) .05s forwards;
  -webkit-user-drag: none;
}
@keyframes tileIn { to { opacity: 1; } }

.map-zone {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(22, 185, 129, .13);
  border: 2px solid rgba(22, 185, 129, .75);
  box-shadow: 0 0 0 4px rgba(22, 185, 129, .08);
}

.mk { position: absolute; z-index: 2; pointer-events: none; }
.mk--center { transform: translate(-50%, -100%); }
.mk--kid { transform: translate(-50%, -50%); z-index: 3; }
.mk__pin {
  display: block; width: 30px; height: 40px;
  filter: drop-shadow(0 4px 5px rgba(16, 24, 40, .32));
  animation: pinDrop .6s var(--ease-out) both;
}
@keyframes pinDrop {
  0% { transform: translateY(-14px); opacity: 0; }
  60% { transform: translateY(2px); opacity: 1; }
  100% { transform: none; }
}
.mk__kid {
  position: relative; display: grid; place-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--coral); color: #fff;
  font-size: 13px; font-weight: 720;
  border: 3px solid #fff; box-shadow: 0 3px 9px rgba(16, 24, 40, .3);
}
.mk__kid::before {
  content: ""; position: absolute; inset: -10px; z-index: -1;
  border-radius: 50%; background: rgba(255, 122, 89, .35);
  animation: kidPulse 2.2s var(--ease) infinite;
}
@keyframes kidPulse {
  0% { transform: scale(.55); opacity: .9; }
  100% { transform: scale(1.6); opacity: 0; }
}
.mk__label {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 5px; white-space: nowrap;
  font-size: 11px; font-weight: 650; color: var(--ink);
  background: #fff; padding: 2px 8px; border-radius: 99px;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .18);
}
.mk--kid .mk__label { margin-top: 7px; }

.map-attr {
  position: absolute; right: 0; bottom: 0; z-index: 4;
  font-size: 9.5px; line-height: 1.5; color: #4b5565;
  background: rgba(255, 255, 255, .85);
  padding: 1px 6px; border-top-left-radius: 6px;
}
.map-attr a { color: inherit; }
.map-attr a:hover { color: var(--brand-600); }

.gps-status {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: var(--r-md); border: 1px solid var(--line);
}
.gps-status--in { background: var(--mint-s); border-color: rgba(22,185,129,.3); }
.gps-status--out { background: var(--amber-s); border-color: rgba(245,165,36,.3); }
.gps-status__ico { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-content: center; background: #fff; }

/* ---------- Certificate ---------- */
.cert-preview {
  border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--sh-sm); background: #fff;
}
.cert-preview canvas { width: 100%; height: auto; display: block; }

/* ---------- Auth ---------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  background: var(--canvas);
}
.auth__side {
  position: relative; overflow: clip;
  background: linear-gradient(155deg, var(--brand-600), var(--violet) 135%);
  color: #fff;
  padding: 56px clamp(28px, 4.5vw, 64px);
  display: flex; flex-direction: column; justify-content: center;
}
.auth__side::before {
  content: ""; position: absolute; width: 440px; height: 440px; border-radius: 50%;
  background: rgba(255,255,255,.07); top: -170px; right: -150px;
}
.auth__side::after {
  content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,.06); bottom: -120px; left: -100px;
}
.auth__side-inner { position: relative; z-index: 1; max-width: 430px; }
.auth--register .auth__side { justify-content: flex-start; }
.auth--register .auth__side-inner { position: sticky; top: calc(var(--nav-h) + 40px); }
.auth__side .logo { color: #fff; margin-bottom: 34px; }
.auth__side .logo__mark { background: rgba(255,255,255,.18); box-shadow: none; }
.auth__side .logo__text span { color: #ffd27a; }
.auth__side h2 { color: #fff; font-size: clamp(25px, 2.5vw, 31px); margin-bottom: 10px; }
.auth__side p { color: rgba(255,255,255,.84); margin: 0 0 26px; font-size: 15px; }
.auth__roles { display: grid; gap: 10px; }
.auth__roles li {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--r-md);
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
}
.auth__roles b { display: block; font-size: 14.5px; font-weight: 650; }
.auth__role-d { display: block; font-size: 13px; color: rgba(255,255,255,.78); line-height: 1.45; margin-top: 1px; }
.auth__role-ico {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-content: center; background: rgba(255,255,255,.16);
}
.auth__role-ico svg { width: 17px; height: 17px; }
.auth__stats {
  display: flex; gap: 30px; margin-top: 26px; padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.16);
}
.auth__stats b { display: block; font-size: 23px; font-weight: 760; letter-spacing: -.03em; line-height: 1.2; }
.auth__stats span { font-size: 12.5px; color: rgba(255,255,255,.75); }

.auth__main {
  display: flex; justify-content: center; align-items: center;
  padding: 48px clamp(18px, 4vw, 56px) 56px;
}
.auth--register .auth__main { align-items: flex-start; }
.auth__box { width: min(520px, 100%); animation: fadeUp .4s var(--ease-out) both; }
.auth__box .note-box { margin-bottom: 18px; }
.auth__title { font-size: 27px; font-weight: 760; letter-spacing: -.032em; margin: 26px 0 6px; }
.auth__lead { color: var(--muted); font-size: 14.5px; margin: 0 0 22px; }
.auth__switch { text-align: center; font-size: 14px; color: var(--muted); margin: 18px 0 0; }
.auth__switch a { font-weight: 620; }
.auth__box .field { margin: 0 0 14px; }
.auth__box .field + .field { margin-top: 0; }

.seg--block { display: flex; width: 100%; }
.seg--block button { flex: 1; padding: 10px 14px; font-size: 14.5px; }

.auth__step { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 680; margin: 0 0 12px; }
.auth__step-n {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-content: center;
  background: var(--brand-500); color: #fff; font-size: 12.5px; font-weight: 700;
}

.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  padding: 15px 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.type-opt:hover { border-color: var(--brand-300); transform: translateY(-1px); }
.type-opt.is-on { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.type-opt__ico {
  width: 34px; height: 34px; border-radius: 11px; margin-bottom: 7px;
  display: grid; place-content: center; background: var(--surface-3); color: var(--ink-2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.type-opt__ico svg { width: 17px; height: 17px; }
.type-opt.is-on .type-opt__ico { background: var(--brand-500); color: #fff; }
.type-opt__t { font-size: 14.5px; font-weight: 660; color: var(--ink); }
.type-opt__d { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.subhead { font-size: 13.5px; font-weight: 650; color: var(--ink-2); margin: 2px 0 10px; }
.role-fields { animation: fadeUp .32s var(--ease-out) both; }
[hidden] { display: none !important; }

.footer--flush { margin-top: 0; }

.role-pick { display: grid; gap: 10px; }
.role-opt {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  cursor: pointer; background: var(--surface);
  transition: all var(--t-fast) var(--ease);
}
.role-opt:hover { border-color: var(--brand-300); background: var(--brand-50); }
.role-opt.is-on { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.role-opt__ico { width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-content: center; font-size: 19px; }
.role-opt__t { font-size: 14.5px; font-weight: 650; }
.role-opt__d { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; padding: 12px; border-radius: var(--r-full);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.oauth-btn:hover { background: var(--surface-2); border-color: #d5dbe7; transform: translateY(-1px); }
.oauth-btn svg { width: 19px; height: 19px; }

.or-sep { display: flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: 12.5px; margin: 20px 0; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.step { position: relative; }
.step__n {
  width: 38px; height: 38px; border-radius: 13px; margin-bottom: 14px;
  display: grid; place-content: center; font-weight: 740; font-size: 15px;
  background: var(--brand-50); color: var(--brand-600);
}
.step h4 { margin-bottom: 6px; }

/* ---------- Reveal on scroll utilities ---------- */
.reveal-1 { transition-delay: .06s; }
.reveal-2 { transition-delay: .12s; }
.reveal-3 { transition-delay: .18s; }
.reveal-4 { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero__grid { grid-template-columns: 1fr; gap: 34px; }
  .collage { height: 340px; max-width: 520px; }
  .detail { grid-template-columns: 1fr; }
  .booking { position: static; }
  .grid-2-1 { grid-template-columns: 1fr; }
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
}

@media (max-width: 900px) {
  :root { --side-w: 0px; }
  .app-shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; top: var(--nav-h); left: 0; z-index: 480;
    width: 272px; transform: translateX(-100%);
    transition: transform var(--t) var(--ease); box-shadow: var(--sh-lg);
  }
  .side.is-open { transform: none; }
  .work { padding: 20px 18px 60px; }
  .auth { grid-template-columns: 1fr; }
  .auth__side { display: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .timetable { grid-template-columns: repeat(7, 132px); overflow-x: auto; padding-bottom: 8px; }
}

@media (max-width: 760px) {
  .shell { padding-inline: 18px; }
  .nav__links { display: none; }
  .nav__burger {
    display: grid; place-content: center; width: 38px; height: 38px;
    border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  }
  .nav__burger svg { width: 18px; height: 18px; }
  .usermenu__name, .usermenu__role { display: none; }
  .usermenu__btn { padding: 5px; }
  .hero { padding: 40px 0 34px; }
  .section { padding: 42px 0; }
  .searchbar { flex-direction: column; border-radius: var(--r-lg); }
  .searchbar .select { max-width: none; border-top: 1px solid var(--line-2); border-radius: 0; }
  .searchbar .btn { width: 100%; }
  .hero__trust { gap: 20px; }
  .footer__grid { grid-template-columns: 1fr; }
  .collage { display: none; }
  .modal__head, .modal__body, .modal__foot { padding-inline: 18px; }
  .course-grid { grid-template-columns: 1fr; }
  .work__title { font-size: 21px; }
  .hbar-row { grid-template-columns: 110px 1fr 54px; font-size: 12.5px; }
}

/* Mobile drawer scrim */
.scrim {
  position: fixed; inset: var(--nav-h) 0 0; z-index: 470;
  background: rgba(14,21,38,.35); animation: fadeIn .2s var(--ease) both;
}
@media (min-width: 901px) { .scrim { display: none; } }

@media print {
  .nav, .side, .footer, .toasts, .btn { display: none !important; }
  .work { padding: 0; }
  body { background: #fff; }
}

/* Нарийн дэлгэц дээр дээд цэсний хоёрдогч товчийг нуух */
@media (max-width: 860px) {
  .logo__tag { display: none; }
}
@media (max-width: 760px) {
  .nav__cta-2 { display: none; }
  .nav__inner { gap: 12px; }
  .logo__mark { width: 30px; height: 30px; border-radius: 10px; }
  .logo__text { font-size: 17px; }
}

/* Сүлжээний нүд агуулгаасаа болж өргөсөхөөс сэргийлнэ */
.grid-2 > *, .grid-3 > *, .grid-2-1 > *, .grid-stats > *,
.app-shell > *, .catalog > *, .detail > * { min-width: 0; }

/* Нарийн дэлгэц дээр мөрүүд доошоо эвхэгдэнэ */
@media (max-width: 760px) {
  .row { flex-wrap: wrap; }
  .list-row { flex-wrap: wrap; }
  .list-row > .grow { flex-basis: 100%; order: -1; }
  .card__head { flex-wrap: wrap; }
  .work__head { align-items: flex-start; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { text-align: left; margin-bottom: 8px; }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}

@media (max-width: 560px) {
  .form-grid, .type-pick { grid-template-columns: 1fr; }
  .auth__main { padding: 28px 16px 40px; }
  .auth__title { font-size: 23px; margin-top: 20px; }
}

/* Төвийн нэр зүүгээс дээр, хүүхдийн нэр тэмдгээс доор гарна */
.mk--center .mk__label { top: auto; bottom: 100%; margin: 0 0 4px; }
