/* ==========================================================================
   Medee design system
   Tokens first; every component below reads from them. --brand and its
   shades are overridden per site from admin → Тохиргоо → Дизайн.
   ========================================================================== */
:root {
  --brand: #0a5cff;
  --brand-dark: #084bd1;
  --brand-soft: #e7efff;

  --ink: #101218;
  --text: #2e313a;
  --muted: #7b808c;
  --line: #e8e9ee;
  --soft: #f6f7f9;
  --page: #ffffff;
  --footer: #010b24;

  --serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --container: 1320px;
  --gutter: 24px;
  --gap: 40px;
  --shadow: 0 8px 24px rgba(10, 30, 80, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--page); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
button { font: inherit; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.icon { display: block; flex-shrink: 0; }
.empty { color: var(--muted); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; transition: box-shadow .2s; }
.site-header.scrolled { box-shadow: var(--shadow); }
.header-bar { background: var(--brand); color: #fff; }
.header-inner { display: flex; align-items: center; gap: 30px; height: 72px; }
.icon-btn { background: none; border: 0; color: inherit; padding: 4px; cursor: pointer; display: inline-flex; }
.logo { flex-shrink: 0; font-family: var(--serif); font-size: 28px; font-weight: 500; color: #fff; letter-spacing: -.5px; line-height: 1; white-space: nowrap; }
.logo:hover { color: #fff; }
.logo img { height: 48px; width: auto; display: block; }
/* Categories in the bar; ones that do not fit wrap onto a hidden second line (all are in the drawer). */
.main-nav { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; height: 72px; overflow: hidden; column-gap: 22px; }
.main-nav a { display: flex; align-items: center; height: 72px; color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; padding-top: 3px; transition: border-color .15s, opacity .15s; }
.main-nav a:hover { color: #fff; border-bottom-color: rgba(255, 255, 255, .55); }
.main-nav a.active { border-bottom-color: #fff; }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }
.header-actions .icon-btn { width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; transition: background .15s; }
.header-actions .icon-btn:hover, .search-open .search-toggle { background: rgba(255, 255, 255, .16); }
/* Search drops down under the bar */
.header-search { display: none; background: var(--brand-dark); }
.search-open .header-search { display: block; }
.header-search-inner { display: flex; align-items: center; gap: 12px; height: 64px; color: rgba(255, 255, 255, .8); }
.header-search input { flex: 1; min-width: 0; height: 44px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); color: #fff; padding: 0 16px; font: italic 16px var(--serif); outline: none; }
.header-search input:focus { border-color: #fff; }
.header-search input::placeholder { color: rgba(255, 255, 255, .75); }
.header-search input::-webkit-search-cancel-button { filter: invert(1); }
.header-search button { height: 44px; padding: 0 22px; background: #fff; color: var(--brand); border: 0; font-weight: 700; cursor: pointer; }
/* Light strip: date, weather, rates with daily change, breaking ticker */
.info-strip { background: var(--brand-soft); border-bottom: 1px solid var(--line); font-size: 13px; color: #4b5263; }
.info-strip-inner { display: flex; align-items: center; gap: 28px; height: 40px; }
.strip-items { display: flex; align-items: center; gap: 26px; white-space: nowrap; flex-shrink: 0; }
.strip-date { color: var(--brand); font-weight: 700; }
.strip-weather { display: inline-flex; align-items: center; gap: 6px; }
.strip-rate b { color: var(--ink); font-weight: 700; }
.strip-rate i { font-style: normal; font-weight: 600; font-size: 12px; }
.strip-rate i.up { color: #16a34a; }
.strip-rate i.down { color: #dc2626; }
.strip-breaking { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.strip-breaking .ticker-track a { font: 600 13px var(--sans); color: var(--brand-dark); }

.breaking-label { background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 4px 10px; flex-shrink: 0; }
.ticker { overflow: hidden; flex: 1; }
.ticker-track { display: inline-flex; gap: 48px; white-space: nowrap; animation: ticker 45s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track a { font: 500 15px var(--serif); color: var(--ink); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Drawer menu ---------- */
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(360px, 88vw); background: var(--page); z-index: 50; transform: translateX(-100%); transition: transform .25s ease; overflow-y: auto; display: flex; flex-direction: column; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(1, 11, 36, .5); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-overlay { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; background: var(--brand); color: #fff; }
.logo-sm { font-size: 28px; }
.logo-sm img { max-height: 40px; }
.drawer-nav, .drawer-pages { list-style: none; margin: 0; padding: 8px 0; }
.drawer-nav a { display: block; padding: 13px 24px; font-size: 16px; font-weight: 600; color: var(--ink); border-left: 3px solid transparent; }
.drawer-nav a:hover, .drawer-nav a.active { color: var(--brand); background: var(--brand-soft); border-left-color: var(--brand); }
.drawer-rates { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 16px 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.drawer-rates b { color: var(--ink); }
.drawer-pages { border-top: 1px solid var(--line); }
.drawer-pages a { display: block; padding: 9px 24px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.drawer .socials { padding: 16px 24px 28px; margin-top: auto; }
.drawer .socials a { color: var(--brand); border-color: var(--brand); }

/* ---------- Layout ---------- */
.site-main { padding: 48px 0 72px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 64px; align-items: start; }
.section { margin-top: 64px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font: 500 26px/1.2 var(--serif); color: var(--ink); margin: 0 0 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line); position: relative; }
.section-title::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 64px; height: 3px; background: var(--brand); }
.section-title .more { display: inline-flex; align-items: center; gap: 4px; font: 500 14px var(--sans); color: var(--brand); }
.page-title { font: 500 34px/1.2 var(--serif); color: var(--ink); margin: 0 0 32px; }
.grid { display: grid; gap: 40px 32px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.list { display: flex; flex-direction: column; }

/* ---------- Meta line ---------- */
.meta { display: flex; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); line-height: 1.6; }
.meta-cat { color: var(--brand); }
.meta-author { margin-left: 4px; color: var(--text); }
.meta-dot { margin: 0 10px; font-size: 12px; }
.meta > .meta-dot:first-child { display: none; }

/* ---------- Cards ---------- */
.card { display: flex; flex-direction: column; min-width: 0; }
.card-img { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.noimg { display: flex; align-items: center; justify-content: center; height: 100%; font: 500 20px var(--serif); color: #b6bac4; }
.card-body { padding-top: 16px; }
.card-title { font: 400 19px/1.35 var(--serif); color: var(--ink); margin: 0 0 10px; }
.card-title a:hover { color: var(--brand); }
.excerpt { color: var(--muted); font-size: 16px; line-height: 1.8; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.card-feature .card-img { aspect-ratio: 16 / 9; }
.card-label { position: absolute; left: 0; bottom: 0; background: var(--brand); color: #fff; font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; padding: 6px 12px; }
.card-feature .card-body { padding-top: 26px; }
.card-feature .card-title { font-size: 34px; line-height: 1.28; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-feature .excerpt { font-size: 17px; }

.card-row { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.card-row:first-child { padding-top: 0; }
.card-row .card-body { padding-top: 0; }
.card-row .card-title { font-size: 24px; }

/* ---------- Home ---------- */
.home-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 56px; align-items: start; }
.featured-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.featured-pair .card-feature:only-child { grid-column: 1 / -1; }
.home-top .rank-list { max-height: 720px; overflow-y: auto; scrollbar-width: thin; }

/* ---------- Sidebar: Шинэ / Хандалттай ---------- */
.sidebar { display: flex; flex-direction: column; gap: 32px; }
.tab-buttons { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.tab-buttons button { background: var(--page); border: 0; padding: 17px 10px; font-size: 17px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.tab-buttons button.active { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(1, 11, 36, .18); }
.rank-list { list-style: none; margin: 0; padding: 0 4px 0 0; }
.rank-list li { display: flex; gap: 22px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.rank-list li.empty { display: block; }
.rank { font: italic 400 44px/1 var(--serif); color: #b4b8c2; min-width: 46px; padding-top: 2px; }
.rank-title { display: block; font: 400 19px/1.3 var(--serif); color: var(--ink); margin-bottom: 10px; }
.rank-title:hover { color: var(--brand); }
.widget iframe { display: block; }
.widget-title { font: 600 15px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .6px; color: var(--ink); margin: 0 0 16px; padding-bottom: 12px; border-bottom: 2px solid var(--brand); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 14px; font-weight: 500; line-height: 1.3; transition: background .15s, color .15s; }
.tag-chip small { font-size: 11px; color: var(--muted); font-weight: 600; }
.tag-chip:hover, .tag-chip.active { background: var(--brand); color: #fff; text-decoration: none; }
.tag-chip:hover small, .tag-chip.active small { color: rgba(255, 255, 255, .8); }
.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 28px 0 8px; }
.article-tags > span { font-size: 14px; font-weight: 600; color: var(--muted); margin-right: 4px; }

/* ---------- Article ---------- */
.article-title { font: 500 40px/1.25 var(--serif); color: var(--ink); margin: 0 0 18px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-bottom: 22px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.article-meta .views { font-size: 14px; color: var(--muted); }
.article-meta .views a { color: var(--brand); }
.article-cover { margin: 0 0 28px; }
.article-cover img { width: 100%; }
.lead { margin: 0 0 1.2em; }
.article-body, .lead { font-size: 18px; line-height: 1.95; color: var(--text); text-align: justify; hyphens: auto; overflow-wrap: break-word; }
.article-body p { margin: 0 0 1.2em; }
.article-body h2, .article-body h3, .article-body h4 { font: 700 19px/1.6 var(--sans); text-transform: uppercase; letter-spacing: .2px; color: var(--ink); text-align: left; margin: 1.6em 0 .7em; }
.article-body a { color: var(--brand); text-decoration: underline; }
.article-body img { height: auto; margin: 24px auto; }
.article-body iframe { max-width: 100%; aspect-ratio: 16 / 9; height: auto; width: 100%; }
.article-body blockquote { margin: 28px 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--brand); font: italic 20px/1.7 var(--serif); color: var(--ink); text-align: left; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin-bottom: .4em; }
.article-body .ql-align-center { text-align: center; }
.article-body .ql-align-right { text-align: right; }

.share { display: flex; gap: 12px; margin: 36px 0 48px; }
.share-btn { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--brand); color: var(--brand); background: var(--page); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 3px 8px rgba(1, 11, 36, .12); transition: background .2s, color .2s; }
.share-btn:hover, .share-btn.copied { background: var(--brand); color: #fff; }

/* ---------- Comments ---------- */
.comments { margin-top: 8px; }
.comments .count { display: inline-block; background: var(--brand); color: #fff; font: 600 13px var(--sans); padding: 2px 9px; border-radius: 12px; vertical-align: middle; margin-left: 6px; }
.comments .section-title { justify-content: flex-start; }
.comment-form { background: var(--soft); padding: 36px; display: flex; flex-direction: column; gap: 24px; }
.comment-form input, .comment-form textarea { width: 100%; font: 16px var(--sans); color: var(--ink); background: #fff; border: 1px solid #e1e3e8; padding: 14px 22px; outline: none; transition: border-color .2s; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--brand); }
.comment-form textarea { resize: vertical; min-height: 180px; line-height: 1.6; }
.comment-note { display: flex; justify-content: space-between; gap: 20px; margin-top: -8px; }
.comment-note small { color: #a3a7b1; font-size: 13px; line-height: 1.6; }
.comment-note .counter { white-space: nowrap; }
.btn-block { width: 100%; background: var(--brand); color: #fff; border: 0; padding: 15px; font-size: 17px; font-weight: 500; cursor: pointer; transition: background .2s; }
.btn-block:hover { background: var(--brand-dark); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.comment-list { list-style: none; padding: 0; margin: 28px 0 0; }
.comment-list li { display: flex; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.comment-list li.empty { display: block; color: var(--muted); }
.comment-list p { margin: 6px 0 0; line-height: 1.7; overflow-wrap: anywhere; }
.avatar { flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.comment-head b { color: var(--ink); font-weight: 600; margin-right: 8px; }
.comment-head .meta { display: inline; }
.notice { padding: 12px 16px; margin-bottom: 16px; font-size: 15px; }
.notice-success { background: #dcfce7; color: #166534; }
.notice-info { background: var(--brand-soft); color: var(--brand-dark); }
.notice-error { background: #fee2e2; color: #991b1b; }

/* ---------- Misc ---------- */
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 36px; }
.pager a { min-width: 42px; padding: 9px 12px; text-align: center; border: 1px solid var(--line); font-weight: 500; }
.pager a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.notfound { text-align: center; padding: 60px 0; }
.notfound h1 { font: 500 110px/1 var(--serif); color: var(--brand); margin: 0 0 12px; }
.btn { display: inline-block; background: var(--brand); color: #fff; padding: 12px 24px; font-weight: 500; }
.btn:hover { background: var(--brand-dark); color: #fff; }

.to-top { position: fixed; right: 40px; bottom: 40px; width: 52px; height: 52px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 20; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: var(--shadow); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: #fff; background: var(--brand-dark); }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1.2fr .8fr; gap: 64px; padding-top: 88px; padding-bottom: 56px; }
.footer-brand p { font-size: 14px; line-height: 1.95; margin: 26px 0 36px; max-width: 560px; }
.footer-brand .logo img { max-height: 56px; }
.socials { display: flex; gap: 12px; }
.socials a { width: 44px; height: 44px; border-radius: 50%; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: background .2s, color .2s; }
.site-footer .socials a:hover { background: #fff; color: var(--footer); }
.footer-contact h4 { font: 600 18px var(--serif); margin: 0 0 18px; }
.footer-contact p { font-size: 14px; line-height: 1.9; margin: 0 0 4px; }
.footer-contact p + h4 { margin-top: 40px; }
.footer-contact a:hover, .footer-links a:hover, .footer-bottom a:hover { color: #fff; text-decoration: underline; }
.footer-cats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 24px; font-size: 17px; font-weight: 500; text-transform: uppercase; letter-spacing: .2px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 14px; padding-top: 28px; padding-bottom: 40px; border-top: 1px solid rgba(255, 255, 255, .45); }

/* ---------- Polish ---------- */

/* Reading progress (article pages) */
.read-progress { height: 3px; background: transparent; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .1s linear; }

/* Pulsing dot in the breaking label */
.breaking-label { display: inline-flex; align-items: center; gap: 7px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #ff4d4f; box-shadow: 0 0 0 0 rgba(255, 77, 79, .7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(255, 77, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0); } }

/* Images fade in once loaded; placeholder for articles without a picture */
.card-img img { opacity: 0; transition: opacity .35s ease, transform .4s ease; }
.card-img img.loaded, .no-js .card-img img { opacity: 1; }
.noimg { background: linear-gradient(135deg, var(--brand-soft), #fff); }
.noimg span { font: 500 22px var(--serif); color: var(--brand); opacity: .55; }
.card-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(1, 11, 36, .18), transparent 45%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.card:hover .card-img::after { opacity: 1; }
.card-chip { position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .94); color: var(--brand); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 5px 9px; z-index: 1; }

/* Category sections: one lead story + compact list, alternating sides */
.mosaic { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.mosaic-flip .card-lead { order: 2; }
.card-lead .card-img { aspect-ratio: 16 / 10; }
.card-lead .card-title { font-size: 28px; line-height: 1.3; margin-bottom: 14px; }
.mosaic-list { display: flex; flex-direction: column; }
.card-mini { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.card-mini:first-child { padding-top: 0; }
.card-mini:last-child { border-bottom: 0; }
.card-mini .card-img { aspect-ratio: 4 / 3; }
.card-mini .card-body { padding-top: 0; }
.card-mini .card-title { font-size: 18px; line-height: 1.35; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Article extras */
.article-kicker { display: inline-block; color: var(--brand); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 14px; padding-left: 12px; border-left: 3px solid var(--brand); }
.article-cover img { box-shadow: 0 20px 40px -24px rgba(1, 11, 36, .45); }
.article-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin: 40px 0 48px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-foot .share { margin: 0; }
.author-box { display: flex; align-items: center; gap: 14px; }
.author-box small { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.author-box b { display: block; font: 600 18px var(--serif); color: var(--ink); }
.author-box span:not(.avatar) { font-size: 13px; color: var(--muted); }
.avatar-lg { flex: 0 0 56px; height: 56px; font-size: 22px; }

/* Section heading polish */
.section-title a:first-child { position: relative; }
.rank-list li { transition: background .2s; }
.rank-list li:hover .rank { color: var(--brand); }
.rank { transition: color .2s; }
.site-footer { position: relative; }
.site-footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-dark)); z-index: 1; }

/* ---------- Mongolian ornaments (алхан хээ, өлзий, эвэр угалз) ---------- */
:root {
  --orn-alkhan: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M0 1H10M0 9H10M2.5 1V6.2M0.6 6.2H4.4M7.5 9V3.8M5.6 3.8H9.4' fill='none' stroke='%23000' stroke-width='1.15' stroke-linecap='square'/%3E%3C/svg%3E");
  --orn-ulzii: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' transform='rotate(45 24 24)'%3E%3Cpath d='M13 17V13H17M31 13H35V17M35 31V35H31M17 35H13V31M17 13V35M24 13V35M31 13V35M13 17H35M13 24H35M13 31H35M13 17A5.6 5.6 0 1 1 17 13M31 13A5.6 5.6 0 1 1 35 17M35 31A5.6 5.6 0 1 1 31 35M17 35A5.6 5.6 0 1 1 13 31'/%3E%3C/g%3E%3C/svg%3E");
}
.orn { display: block; }
/* Hammer (алхан) band along the bottom of the blue header and the drawer head */
.has-ornaments .header-bar::after, .has-ornaments .drawer-head::after {
  content: ''; display: block; height: 10px; background: rgba(255, 255, 255, .55);
  -webkit-mask: var(--orn-alkhan) repeat-x left center / 10px 10px; mask: var(--orn-alkhan) repeat-x left center / 10px 10px;
}
.has-ornaments .drawer-head { flex-wrap: wrap; padding-bottom: 0; }
.has-ornaments .drawer-head::after { flex-basis: calc(100% + 48px); margin: 18px -24px 0; }
/* Footer: band in the brand colour on navy, faint horn scroll in the corner */
.has-ornaments .site-footer::before {
  height: 14px; background: var(--brand);
  -webkit-mask: var(--orn-alkhan) repeat-x left center / 14px 14px; mask: var(--orn-alkhan) repeat-x left center / 14px 14px;
}
.site-footer { overflow: hidden; }
.footer-ugalz { position: absolute; right: -40px; bottom: -30px; width: 520px; color: #fff; opacity: .05; pointer-events: none; }
.site-footer .container { position: relative; }
/* Өлзий before section headings */
.has-ornaments .section-title > :first-child::before {
  content: ''; display: inline-block; width: 24px; height: 24px; margin-right: 12px; vertical-align: -3px; background: var(--brand);
  -webkit-mask: var(--orn-ulzii) center / contain no-repeat; mask: var(--orn-ulzii) center / contain no-repeat;
}
.title-ulzii { display: inline-block; width: 26px; height: 26px; margin-right: 12px; vertical-align: -3px; color: var(--brand); }
/* Divider at the end of an article */
.orn-divider { display: flex; align-items: center; gap: 18px; margin: 44px 0 0; color: var(--brand); }
.orn-divider::before, .orn-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line) 30%, var(--line) 70%, transparent); }
.orn-divider .orn { width: 34px; height: 34px; }
.orn-divider + .article-foot { margin-top: 20px; border-top: 0; }
/* Horn scroll above static page titles and the 404 */
.page-ugalz { width: 120px; color: var(--brand); opacity: .85; margin: 0 0 10px; }
.notfound .page-ugalz { margin: 0 auto 8px; width: 150px; }
/* Tiny alkhan line under the sidebar tabs */
.has-ornaments .tab-buttons { position: relative; }
.has-ornaments .rank-box::after {
  content: ''; display: block; height: 10px; margin-top: 18px; background: var(--brand); opacity: .35;
  -webkit-mask: var(--orn-alkhan) repeat-x left center / 10px 10px; mask: var(--orn-alkhan) repeat-x left center / 10px 10px;
}

/* ---------- Advertising ---------- */
.ad { position: relative; text-align: center; margin: 0 auto; }
.ad img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.ad a { display: block; }
.ad-label { display: block; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: #a5a9b3; margin-bottom: 6px; text-align: center; }
.ad-wrap-top { margin-bottom: 40px; }
.ad-sidebar img { width: 100%; }
.article-body .ad, .ad-article_end { margin: 32px auto; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-indent: 0; }
.article-body .ad img { margin: 0 auto; }

/* ---------- Reactions ---------- */
.reactions { margin: 40px 0 0; padding: 28px; background: var(--soft); text-align: center; }
.reactions h3 { font: 500 20px var(--serif); color: var(--ink); margin: 0 0 20px; }
.reaction-list { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.reaction { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 86px; padding: 12px 10px 10px; background: var(--page); border: 2px solid var(--line); border-radius: 14px; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.reaction:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 6px 16px rgba(1, 11, 36, .1); }
.reaction .emoji { font-size: 34px; line-height: 1.1; }
.reaction .count { font-weight: 700; font-size: 16px; color: var(--ink); }
.reaction .label { font-size: 12px; color: var(--muted); }
.reaction.active { border-color: var(--brand); background: var(--brand-soft); }
.reaction.active .count { color: var(--brand); }
.reaction.pop .emoji { animation: pop .4s ease; }
@keyframes pop { 40% { transform: scale(1.45) rotate(-8deg); } 100% { transform: scale(1); } }
.reactions.busy { opacity: .8; }

/* ---------- Push notifications ---------- */
.push-btn { position: relative; color: #fff; }
.push-btn .push-dot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: #ff4d4f; box-shadow: 0 0 0 2px var(--brand); }
.push-btn.subscribed .push-dot { background: #4ade80; }
.push-invite { position: fixed; left: 24px; bottom: 24px; z-index: 60; max-width: 360px; display: flex; gap: 14px; background: var(--page); color: var(--text); padding: 18px 20px; box-shadow: 0 18px 50px rgba(1, 11, 36, .25); border-top: 4px solid var(--brand); opacity: 0; transform: translateY(20px); transition: opacity .3s, transform .3s; }
.push-invite.show { opacity: 1; transform: none; }
.push-invite-icon { font-size: 30px; }
.push-invite b { display: block; font: 600 17px var(--serif); color: var(--ink); }
.push-invite p { margin: 4px 0 12px; font-size: 14px; color: var(--muted); }
.push-invite-actions { display: flex; gap: 8px; }
.push-invite-actions button { border: 0; padding: 9px 16px; font-weight: 600; cursor: pointer; }
.push-invite-actions .yes { background: var(--brand); color: #fff; }
.push-invite-actions .no { background: var(--soft); color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 70; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; font-size: 14px; opacity: 0; transition: opacity .3s, transform .3s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-feature .card-title { font-size: 28px; }
}
@media (max-width: 1080px) {
  :root { --gap: 32px; }
  .mosaic { grid-template-columns: 1fr; gap: 28px; }
  .mosaic-flip .card-lead { order: 0; }
  .home-top, .layout { grid-template-columns: 1fr; gap: 48px; }
  .home-top .rank-list { max-height: none; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 48px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .push-invite { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .reactions { padding: 20px 12px; }
  .reaction { min-width: 0; flex: 1 1 calc(33% - 10px); }
  .reaction .emoji { font-size: 28px; }
  .has-ornaments .header-bar::after { height: 8px; -webkit-mask-size: 8px 8px; mask-size: 8px 8px; }
  .footer-ugalz { width: 320px; }
  .card-lead .card-title { font-size: 22px; }
  .card-mini { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
  .card-mini .card-title { font-size: 16px; }
  .article-foot { flex-direction: column; align-items: flex-start; }
  .header-inner { height: 60px; gap: 12px; }
  .main-nav { display: none; }
  .logo img { height: 38px; }
  .header-actions { gap: 4px; }
  .header-search-inner { height: 58px; }
  .header-search-inner > .icon { display: none; }
  .header-search button { padding: 0 14px; }
  .info-strip-inner { height: auto; padding: 8px var(--gutter); flex-wrap: wrap; gap: 6px 16px; }
  .strip-items { gap: 14px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .strip-items::-webkit-scrollbar { display: none; }
  .strip-breaking { flex-basis: 100%; }
  .site-main { padding: 24px 0 48px; }
  .featured-pair { grid-template-columns: 1fr; gap: 36px; }
  .card-feature .card-title { font-size: 22px; margin-bottom: 12px; -webkit-line-clamp: 3; }
  .card-feature .card-body { padding-top: 14px; }
  .card-label { font-size: 13px; }
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .card-title { font-size: 16px; }
  .card-row { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 18px 0; }
  .card-row .card-title { font-size: 17px; }
  .card-row .excerpt { display: none; }
  .card-row .card-img { aspect-ratio: 4 / 3; }
  .article-title { font-size: 28px; }
  .article-body, .lead { font-size: 17px; line-height: 1.85; }
  .comment-form { padding: 20px; }
  .comment-note { flex-direction: column; gap: 4px; }
  .section { margin-top: 44px; }
  .section-title { font-size: 22px; }
  .rank { font-size: 36px; min-width: 36px; }
  .rank-title { font-size: 17px; }
  .footer-grid { grid-template-columns: 1fr; padding-top: 56px; gap: 36px; }
  .footer-links { gap: 16px; font-size: 15px; }
  .to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; }
}
@media (max-width: 420px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
}

/* Search inside the drawer (phones have no room for it in the bar) */
.drawer-search { display: flex; margin: 8px 24px 4px; border: 1px solid var(--line); }
.drawer-search input { flex: 1; min-width: 0; border: 0; padding: 11px 14px; font: 15px var(--sans); outline: none; }
.drawer-search button { border: 0; background: var(--brand); color: #fff; padding: 0 14px; cursor: pointer; display: flex; align-items: center; }
