/* Српска хералдика — систем стилова v5 (без Tailwind CDN-а, ~7 KB gzip) */
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(/assets/fonts/source-serif-4-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(/assets/fonts/source-serif-4-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(/assets/fonts/source-serif-4-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-display: swap; font-weight: 200 900;
  src: url(/assets/fonts/source-serif-4-cyrillic-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0400-045F, U+0490-0491; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(/assets/fonts/source-sans-3-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(/assets/fonts/source-sans-3-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(/assets/fonts/source-sans-3-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --sable: #17171a;        /* текст, црно поље */
  --gules: #9b1c22;        /* црвена са штита у логотипу */
  --gules-deep: #6f1318;
  --gules-tint: #f4e4e4;
  --or: #a37a26;           /* само ознака верификације и фини акценти */
  --vert: #2b6646;
  --argent: #ffffff;       /* поље на коме стоје грбови */
  --stone: #f3f2ee;        /* позадина панела */
  --stone-2: #e7e5df;
  --line: #dedbd3;
  --muted: #5f5e59;
  --faint: #8c8a83;
  --serif: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --sans: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --w: 1240px;
  --g: clamp(16px, 3vw, 32px);
  --r: 3px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--argent); color: var(--sable); font: 400 1.0625rem/1.55 var(--sans); font-feature-settings: 'locl'; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--gules); }
:focus-visible { outline: 2px solid var(--gules); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; font-optical-sizing: auto; letter-spacing: -.01em; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 var(--g); }
.skip { position: absolute; left: -999px; top: 0; background: var(--sable); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Заглавље */
.site-head { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 72px; }
.logo img { height: 46px; width: auto; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav > a, .nav summary { font-weight: 600; font-size: .95rem; padding: 8px 12px; text-decoration: none; border-radius: var(--r); cursor: pointer; list-style: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav > a[aria-current], .nav details[data-active] summary { color: var(--gules); }
.nav > a:hover, .nav summary:hover { background: var(--stone); color: var(--sable); }
.nav details { position: relative; }
.nav details summary::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-3px) rotate(45deg); }
.nav .dd { position: absolute; top: calc(100% + 10px); left: -8px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(23,23,26,.10); padding: 8px; min-width: 300px; border-radius: var(--r); }
.nav .dd a { display: grid; grid-template-columns: 40px 1fr; gap: 2px 12px; padding: 10px; text-decoration: none; border-radius: var(--r); }
.nav .dd a:hover { background: var(--stone); color: var(--sable); }
.nav .dd img { grid-row: span 2; width: 40px; height: 44px; object-fit: contain; }
.nav .dd b { font-weight: 600; }
.nav .dd small { color: var(--muted); font-size: .85rem; line-height: 1.3; }
.head-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; min-width: 210px; color: var(--muted); text-decoration: none; font-size: .95rem; background: #fff; }
.head-search svg { width: 16px; height: 16px; flex: none; }
.head-search:hover { border-color: var(--sable); color: var(--sable); }
.pismo { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: .85rem; font-weight: 600; }
.pismo a { padding: 5px 10px; text-decoration: none; color: var(--muted); }
.pismo a[aria-current] { background: var(--sable); color: #fff; }
.menu-btn { display: none; }
@media (max-width: 980px) {
  .head-search { display: none; }
}
@media (max-width: 820px) {
  .site-head .wrap { height: 64px; }
  .logo img { height: 38px; }
  .menu-btn { display: block; margin-left: auto; }
  .menu-btn summary { list-style: none; cursor: pointer; padding: 10px; font-weight: 600; border: 1px solid var(--line); border-radius: var(--r); }
  .menu-btn summary::-webkit-details-marker { display: none; }
  .nav { display: none; }
  .menu-btn[open] + .nav { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 64px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px var(--g) 16px; box-shadow: 0 16px 30px rgba(0,0,0,.08); }
  .nav details .dd { position: static; box-shadow: none; border: 0; padding: 0 0 0 8px; min-width: 0; }
}

/* Путања (breadcrumbs) */
.crumbs { font-size: .9rem; color: var(--muted); padding: 18px 0 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li:not(:last-child)::after { content: '/'; margin: 0 4px 0 8px; color: var(--line); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* Почетна: херој са грбовником */
.hero { padding: clamp(32px, 6vw, 80px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 5rem); font-weight: 650; line-height: 1; margin-bottom: 20px; }
.hero .lead { font-family: var(--serif); font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.45; color: #34332f; max-width: 30em; }
.search { position: relative; margin: 28px 0 22px; max-width: 520px; }
.search input { width: 100%; font: 500 1.1rem var(--sans); padding: 16px 18px 16px 50px; border: 1.5px solid var(--sable); border-radius: var(--r); background: #fff; color: var(--sable); }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; box-shadow: 0 0 0 4px var(--gules-tint); border-color: var(--gules); }
.search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 18px 40px rgba(23,23,26,.12); list-style: none; margin: 0; padding: 6px; max-height: 420px; overflow: auto; }
.search-results[hidden] { display: none; }
.search-results a { display: grid; grid-template-columns: 36px 1fr; gap: 0 12px; align-items: center; padding: 8px; text-decoration: none; border-radius: var(--r); }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--stone); color: var(--sable); }
.search-results img, .search-results .ph { width: 36px; height: 40px; object-fit: contain; grid-row: span 2; }
.search-results small { color: var(--muted); }
.search-results .empty { padding: 12px; color: var(--muted); }
.stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; font-size: .95rem; color: var(--muted); }
.stats b { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--sable); margin-right: 6px; }

.armorial { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--sable); border-left: 1px solid var(--line); }
.armorial a { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 12px 12px; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 10px; background: #fff; transition: background .2s; }
.armorial a:hover { background: var(--stone); color: var(--sable); }
.armorial img { height: clamp(92px, 11vw, 150px); width: 100%; object-fit: contain; }
.armorial span { font-family: var(--serif); font-size: .95rem; text-align: center; line-height: 1.2; }
.armorial-cap { font-size: .85rem; color: var(--muted); margin-top: 10px; text-align: right; }

/* Гране */
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); max-width: 40em; }
.link { font-weight: 600; text-decoration: underline; text-decoration-color: var(--gules); text-decoration-thickness: 2px; }
.branches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); }
.branch { padding: 28px 24px 26px; text-decoration: none; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.branch:last-child { border-right: 0; }
.branch:hover { background: var(--stone); color: var(--sable); }
.branch .fan { height: 128px; position: relative; margin-bottom: 22px; }
.branch .fan img { position: absolute; bottom: 0; height: 112px; width: 92px; object-fit: contain; }
.branch .fan img:nth-child(1) { left: 0; height: 96px; opacity: .9; }
.branch .fan img:nth-child(2) { left: 30%; height: 124px; z-index: 2; }
.branch .fan img:nth-child(3) { left: 60%; height: 96px; opacity: .9; }
.branch h3 { margin-bottom: 6px; }
.branch p { color: var(--muted); font-size: .98rem; margin-bottom: 18px; }
.branch .count { margin-top: auto; font-size: .92rem; color: var(--muted); }
.branch .count b { color: var(--gules); font-weight: 700; }
@media (max-width: 1000px) { .branches { grid-template-columns: repeat(2, 1fr); } .branch:nth-child(2) { border-right: 0; } .branch:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .branches { grid-template-columns: 1fr; } .branch { border-right: 0; border-bottom: 1px solid var(--line); } }

/* Мапа — тизер на почетној и хабови */
.map-teaser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.map-teaser ul { list-style: none; padding: 0; margin: 24px 0; border-top: 1px solid var(--line); }
.map-teaser li a { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.map-teaser li small { color: var(--muted); font-weight: 400; }
svg.srb { width: 100%; height: auto; max-height: 640px; display: block; }
svg.srb path { stroke: #fff; stroke-width: .8; vector-effect: non-scaling-stroke; fill: var(--stone-2); transition: fill .2s; }
svg.srb a:hover path, svg.srb a:focus path { fill: var(--gules); }
svg.srb .has path, svg.srb path.has { fill: #d9a9ab; }
svg.srb text { font: 600 22px var(--sans); fill: var(--sable); pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; }

/* Каталог: картице грбова */
.page-head { padding: 28px 0 36px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 10px 0 12px; }
.page-head .lead { font-family: var(--serif); font-size: 1.2rem; color: #34332f; max-width: 40em; margin: 0; }
.grid-coa { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.coa { display: flex; flex-direction: column; text-decoration: none; padding: 20px 16px 16px; background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.coa:hover { background: var(--stone); color: var(--sable); }
.coa .img { height: 180px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.coa .img img { max-height: 100%; width: auto; object-fit: contain; }
.coa h3 { font-size: 1.12rem; margin: 0 0 4px; }
.coa small { color: var(--muted); font-size: .9rem; line-height: 1.35; }
.coa .yr { color: var(--gules); font-weight: 600; }
.group { margin: 48px 0 0; }
.group > h2 { font-size: 1.5rem; display: flex; align-items: baseline; gap: 12px; }
.group > h2 small { font: 400 1rem var(--sans); color: var(--muted); }

/* Територијална: хијерархија */
.terr { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding-top: 32px; }
.terr-nav { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; font-size: .95rem; padding-bottom: 24px; }
.terr-nav h2 { font: 600 .9rem var(--sans); color: var(--muted); margin: 0 0 8px; letter-spacing: 0; }
.terr-nav ul { list-style: none; padding: 0; margin: 0 0 18px; }
.terr-nav > ul > li > a { font-weight: 600; display: block; padding: 6px 0; text-decoration: none; }
.terr-nav ul ul { margin: 0 0 8px; padding-left: 12px; border-left: 1px solid var(--line); }
.terr-nav ul ul a { display: flex; justify-content: space-between; padding: 3px 0 3px 8px; text-decoration: none; color: var(--muted); }
.terr-nav ul ul a:hover { color: var(--gules); }
.terr-nav .n { font-variant-numeric: tabular-nums; color: var(--gules); font-weight: 600; }
.region-block { margin-bottom: 56px; }
.region-block > header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 2px solid var(--sable); padding-bottom: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.region-block > header h2 { margin: 0; }
.region-block > header a { font-size: .95rem; }
.okrug { padding: 24px 0 8px; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.okrug-head { display: flex; justify-content: flex-start; align-items: baseline; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.okrug-head h3 { margin: 0; font-size: 1.25rem; }
.okrug-head h3 a { text-decoration: none; }
.okrug-head small { color: var(--muted); }
.okrug-head .progress { margin-left: auto; }
.progress { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.progress i { display: inline-block; width: 90px; height: 4px; background: var(--stone-2); position: relative; border-radius: 2px; overflow: hidden; }
.progress i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--gules); }
.grid-coa.compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-bottom: 14px; }
.grid-coa.compact .img { height: 130px; }
/* Необрађени ентитети — списак имена, не празни оквири */
.pending { display: flex; flex-wrap: wrap; gap: 6px 4px; margin: 0 0 18px; padding: 0; list-style: none; font-size: .95rem; color: var(--muted); align-items: baseline; }
.pending .lbl { font-weight: 600; color: var(--faint); margin-right: 6px; font-size: .88rem; }
.pending li:not(.lbl):not(:last-child)::after { content: ','; }
.pending .sub { color: var(--faint); font-size: .88rem; }
@media (max-width: 900px) { .terr { grid-template-columns: 1fr; gap: 0; } .terr-nav { position: static; max-height: none; border-bottom: 1px solid var(--line); margin-bottom: 8px; } .terr-nav ul ul { display: none; } .terr-nav > ul { display: flex; flex-wrap: wrap; gap: 4px 16px; } }

/* Хаб окрug/регион */
.hub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: 48px; padding: 32px 0 64px; align-items: start; }
.hub aside { position: sticky; top: 96px; background: var(--stone); padding: 20px; border-radius: var(--r); }
.hub aside h2 { font-size: 1.1rem; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: .97rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
@media (max-width: 900px) { .hub { grid-template-columns: 1fr; } .hub aside { position: static; } }

/* Досије знамења */
.entity { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); padding: 24px 0 56px; align-items: start; }
.plate { position: sticky; top: 92px; }
.plate-main { background: #fff; border: 1px solid var(--line); aspect-ratio: 1 / 1.08; display: flex; align-items: center; justify-content: center; padding: clamp(16px, 4vw, 40px); cursor: zoom-in; position: relative; }
.plate-main img { max-height: 100%; width: auto; object-fit: contain; }
.plate-main figcaption { position: absolute; left: 12px; bottom: 10px; font-size: .85rem; color: var(--muted); }
.variants { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.variants button { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 6px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; font: 500 .78rem var(--sans); color: var(--muted); }
.variants button img { height: 56px; width: auto; object-fit: contain; }
.variants button[aria-pressed="true"] { border-color: var(--sable); color: var(--sable); box-shadow: inset 0 -2px 0 var(--gules); }
.entity h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); margin: 8px 0 10px; }
.kind { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .95rem; margin-bottom: 20px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--stone); color: var(--sable); text-decoration: none; }
.badge.ok { background: #e6f0ea; color: var(--vert); }
.badge.no { background: #f6ecdc; color: #7a5413; }
.badge svg { width: 14px; height: 14px; }
.dossier { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 0; margin: 0 0 32px; border-top: 1px solid var(--sable); }
.dossier dt, .dossier dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.dossier dt { color: var(--muted); font-size: .95rem; padding-right: 20px; }
.dossier dd { font-weight: 600; }
.prose { font-family: var(--serif); font-size: 1.12rem; line-height: 1.68; max-width: 38em; }
.prose p { margin-bottom: 1em; }
.prose strong { font-weight: 650; }
.blazon { margin: 0 0 40px; }
.blazon dl { margin: 0; }
.blazon dt { font: 600 .92rem var(--sans); color: var(--gules); margin-top: 18px; }
.blazon dd { margin: 4px 0 0; font-family: var(--serif); font-size: 1.1rem; line-height: 1.65; max-width: 38em; }
.entity-sec { margin: 0 0 44px; }
.entity-sec > h2 { font-size: 1.45rem; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--stone-2); }
.timeline li { position: relative; padding: 0 0 26px 24px; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--gules); }
.timeline .when { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.timeline .st { font-size: .88rem; color: var(--muted); margin-left: 8px; }
.timeline p { margin: 4px 0 8px; max-width: 38em; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs button { background: #fff; border: 1px solid var(--line); padding: 4px; cursor: zoom-in; border-radius: var(--r); }
.thumbs img { height: 72px; width: auto; }
.former { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.former button { background: #fff; border: 1px solid var(--line); padding: 8px; cursor: zoom-in; }
.former h3 { font-size: 1.1rem; margin-bottom: 4px; }
.former small { color: var(--gules); font-weight: 600; }
.related { border-top: 1px solid var(--line); padding: 40px 0 72px; }
@media (max-width: 900px) { .entity { grid-template-columns: 1fr; } .plate { position: static; } .plate-main { aspect-ratio: auto; height: 62vw; max-height: 460px; } }

/* Лајтбокс */
dialog.lb { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
dialog.lb::backdrop { background: rgba(15,15,17,.92); }
dialog.lb .in { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 72px; }
dialog.lb img { max-height: 100%; max-width: 100%; object-fit: contain; background: #fff; padding: 16px; }
dialog.lb button { position: absolute; background: none; border: 0; color: #fff; font: 600 1rem var(--sans); cursor: pointer; padding: 14px; }
dialog.lb .x { top: 8px; right: 12px; }
dialog.lb .pv { left: 8px; top: 50%; transform: translateY(-50%); font-size: 2rem; }
dialog.lb .nx { right: 8px; top: 50%; transform: translateY(-50%); font-size: 2rem; }

/* Интерактивна мапа */
.mapapp { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 0; border: 1px solid var(--line); margin: 20px 0 64px; min-height: 640px; background: #fff; }
.mapapp .stage { position: relative; background: var(--stone); overflow: hidden; }
.mapapp .stage { min-height: 640px; }
.mapapp .stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mapapp .tools { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; z-index: 2; flex-wrap: wrap; }
.mapapp .tools button { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 7px 12px; font: 600 .9rem var(--sans); cursor: pointer; }
.mapapp .tools button:hover { border-color: var(--sable); }
.mapapp .tools button[hidden] { display: none; }
.mapapp .legend { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 14px; font-size: .85rem; color: var(--muted); background: rgba(255,255,255,.9); padding: 6px 10px; border-radius: var(--r); }
.mapapp .legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 2px; }
.m-l path { fill: #e3e0d8; stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .2s, opacity .3s; }
.m-l path.has { fill: #d6a3a6; }
.m-l path:hover, .m-l path.hover { fill: #c9c5bb; }
.m-l path.has:hover { fill: #c07f83; }
.m-l path.sel { fill: var(--gules) !important; }
.m-l path.dim { opacity: .28; pointer-events: none; }
.m-l[data-hide] { display: none; }
.m-lines path { fill: none; stroke: var(--sable); stroke-width: 1.4; vector-effect: non-scaling-stroke; pointer-events: none; }
.m-marks image { pointer-events: none; }
.m-labels text { font: 600 12px var(--sans); fill: var(--sable); paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 3px; pointer-events: none; text-anchor: middle; }
.panel { padding: 22px 24px 28px; border-left: 1px solid var(--line); overflow: auto; max-height: 82vh; }
.panel .crumbs { padding: 0 0 12px; }
.panel h2 { font-size: 1.6rem; margin: 0 0 6px; }
.panel .sub { color: var(--muted); margin-bottom: 18px; }
.panel .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.panel .pair figure { margin: 0; background: #fff; border: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.panel .pair img { height: 150px; width: auto; object-fit: contain; }
.panel .pair figcaption { font-size: .85rem; color: var(--muted); }
.panel .pair .none { height: 150px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--faint); font-size: .9rem; }
.panel ul.kids { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.panel ul.kids li { border-bottom: 1px solid var(--line); }
.panel ul.kids button, .panel ul.kids a { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 9px 4px; font: 500 1rem var(--sans); cursor: pointer; color: var(--sable); text-decoration: none; }
.panel ul.kids button:hover, .panel ul.kids a:hover { background: var(--stone); }
.panel ul.kids img { width: 34px; height: 38px; object-fit: contain; }
.panel ul.kids .dot { width: 34px; height: 38px; display: flex; align-items: center; justify-content: center; }
.panel ul.kids .dot::before { content: ''; width: 18px; height: 21px; border: 1.5px solid var(--line); border-radius: 0 0 9px 9px; }
.panel ul.kids small { color: var(--muted); font-size: .85rem; }
.panel .cta { display: inline-block; margin-top: 4px; background: var(--sable); color: #fff; padding: 10px 16px; border-radius: var(--r); text-decoration: none; font-weight: 600; }
.panel .cta:hover { background: var(--gules); color: #fff; }
.panel .note { font-size: .9rem; color: var(--muted); background: var(--stone); padding: 12px 14px; border-radius: var(--r); margin-top: 16px; }
@media (max-width: 900px) { .mapapp { grid-template-columns: 1fr; } .mapapp .stage { min-height: 0; height: 72vh; } .panel { border-left: 0; border-top: 1px solid var(--line); max-height: none; } }

/* Подножје */
.site-foot { background: var(--sable); color: #d8d6d0; margin-top: auto; padding: 56px 0 28px; font-size: .95rem; }
.site-foot a { color: #fff; }
.site-foot a:hover { color: #f0c9cb; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.foot-grid h2 { font: 600 .95rem var(--sans); color: #fff; margin: 0 0 12px; letter-spacing: 0; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot-grid ul a { text-decoration: none; color: #d8d6d0; }
.foot-grid ul a:hover { color: #fff; text-decoration: underline; }
.partners { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; margin-top: 18px; }
.partners img { height: 34px; width: auto; opacity: .85; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border-top: 1px solid #34343a; margin-top: 44px; padding-top: 20px; color: #a5a39c; font-size: .9rem; }
.credit { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #a5a39c !important; }
.credit img { height: 22px; width: auto; opacity: .8; transition: opacity .2s; }
.credit:hover img { opacity: 1; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

.btn { display: inline-block; background: var(--sable); color: #fff; padding: 12px 20px; border-radius: var(--r); text-decoration: none; font-weight: 600; }
.btn:hover { background: var(--gules); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0 20px; }
.filters button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: 600 .92rem var(--sans); cursor: pointer; color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--sable); color: #fff; border-color: var(--sable); }
.az { columns: 3 260px; column-gap: 40px; margin-top: 8px; }
.az section { break-inside: avoid; margin-bottom: 18px; }
.az h2 { font-size: 1.3rem; color: var(--gules); margin: 0 0 4px; }
.az ul { list-style: none; padding: 0; margin: 0; }
.az li a { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; text-decoration: none; border-bottom: 1px dotted var(--line); }
.az li small { color: var(--faint); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-head, .site-foot, .variants, .crumbs { display: none; } .entity { display: block; } }
.panel .crumbs button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); }
.panel .crumbs button:hover { color: var(--gules); }
.note { font-size: .95rem; color: var(--muted); background: var(--stone); padding: 12px 14px; border-radius: var(--r); }
.search-results .empty a { display: inline; padding: 0; text-decoration: underline; }
@media (max-width: 860px) {
  .hero .wrap, .map-teaser { grid-template-columns: minmax(0, 1fr); }
  .armorial img { height: 84px; }
  .armorial a { padding: 12px 6px 10px; }
  .armorial span { font-size: .82rem; }
  .armorial-cap { text-align: left; }
  .section-head { align-items: start; }
}
@media (max-width: 520px) {
  .grid-coa { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-coa.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coa .img { height: 130px; }
  .dossier { grid-template-columns: minmax(0, 1fr); }
  .dossier dt { border-bottom: 0; padding-bottom: 0; }
  .former { grid-template-columns: 88px 1fr; }
  .panel .pair img { height: 110px; }
}
