:root{
  --bg:#f7f3ea;
  --paper:#fffdf8;
  --ink:#22313a;
  --muted:#66747d;
  --line:#dcd4c8;
  --year:#a55434;
  --person:#315f78;
  --place:#4d765e;
  --cause:#9a742e;
  --effect:#6b5688;
  --soft-year:#f7e9df;
  --soft-person:#e3eef3;
  --soft-place:#e5eee7;
  --soft-cause:#f4eddc;
  --soft-effect:#ede8f3;
  --shadow:0 14px 38px rgba(38,49,58,.09);
  --radius:22px;
  --font:Arial,"Helvetica Neue",sans-serif;
}
*{box-sizing:border-box}
html{font-size:18px;scroll-behavior:smooth}
body{
  margin:0;
  background:
    radial-gradient(circle at 8% 0,rgba(165,84,52,.07),transparent 28%),
    radial-gradient(circle at 92% 3%,rgba(49,95,120,.08),transparent 30%),
    linear-gradient(180deg,#fbf8f1,var(--bg));
  color:var(--ink);
  font-family:var(--font);
  line-height:1.6;
  padding-bottom:100px;
  min-height:100vh;
}
body.easy-read{
  letter-spacing:.035em;
  word-spacing:.07em;
  line-height:1.78;
}
button,input{font:inherit}
button{cursor:pointer}
button:focus-visible,a:focus-visible,[tabindex]:focus-visible{
  outline:4px solid rgba(49,95,120,.24);
  outline-offset:3px;
}
.topbar{
  position:sticky;top:0;z-index:50;
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  padding:12px clamp(14px,4vw,40px);
  background:rgba(255,253,248,.94);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.brand{
  display:flex;align-items:center;gap:11px;
  border:0;background:transparent;text-align:left;color:var(--ink);padding:0;
}
.brand-symbol{
  width:46px;height:46px;border-radius:14px;
  display:grid;place-items:center;
  background:var(--person);color:white;font-weight:900;font-size:1.35rem;
}
.brand strong{display:block}
.brand small{display:block;color:var(--muted);font-size:.7rem}
.top-actions{display:flex;gap:8px}
.tool-btn{
  min-width:44px;height:44px;border-radius:13px;
  border:1px solid var(--line);background:white;color:var(--ink);
}
.app{width:min(1180px,calc(100% - 24px));margin:22px auto 60px}
.panel,.card{
  background:rgba(255,253,248,.97);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.panel{padding:clamp(20px,4vw,38px)}
.card{padding:18px}
h1,h2,h3{line-height:1.15;margin:.45em 0}
h1{font-size:clamp(2.1rem,6vw,4rem);letter-spacing:-.035em}
h2{font-size:clamp(1.45rem,4vw,2.35rem);letter-spacing:-.02em}
h3{font-size:1.08rem}
p{max-width:72ch}
.lead{font-size:clamp(1rem,2.2vw,1.2rem);color:#394b56}
.muted{color:var(--muted)}
.small{font-size:.82rem}
.eyebrow{
  display:inline-flex;align-items:center;gap:7px;
  padding:6px 10px;border-radius:999px;
  background:#eef2ef;color:#465a4d;font-size:.76rem;font-weight:800;
}
.kicker{
  color:var(--muted);font-weight:900;font-size:.72rem;
  text-transform:uppercase;letter-spacing:.12em;
}
.grid{display:grid;gap:16px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.section-head{display:flex;justify-content:space-between;align-items:end;gap:14px;margin:28px 2px 14px}
.button-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.primary,.secondary,.ghost{
  border-radius:14px;padding:12px 16px;font-weight:800;
}
.primary{border:1px solid var(--person);background:var(--person);color:white}
.secondary{border:1px solid #c5d7cb;background:var(--soft-place);color:#31553e}
.ghost{border:1px solid var(--line);background:white;color:var(--ink)}
.source-link{
  display:inline-flex;align-items:center;text-decoration:none;
  border:1px solid var(--line);border-radius:12px;padding:9px 11px;
  background:white;color:var(--person);font-weight:800;font-size:.8rem;
}

/* Начало */
.hero{
  display:grid;grid-template-columns:1.1fr .9fr;overflow:hidden;
}
.hero-copy{padding:clamp(24px,5vw,52px)}
.hero-visual{
  min-height:430px;padding:26px;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(150deg,#e4eef1,#f5e8d9);
}
.memory-chain{
  width:min(430px,100%);
  display:grid;gap:8px;
}
.memory-node{
  padding:15px;border-radius:17px;background:rgba(255,255,255,.9);
  border:1px solid rgba(220,212,200,.9);
  box-shadow:0 8px 22px rgba(36,48,56,.08);
}
.memory-node strong{display:block;font-size:1.2rem}
.memory-arrow{text-align:center;font-size:1.35rem;color:var(--muted)}
.home-card{
  width:100%;min-height:180px;text-align:left;color:var(--ink);
  border:1px solid var(--line);border-radius:20px;background:white;padding:19px;
  box-shadow:var(--shadow);
}
.home-card:hover{border-color:#a9b9b1;transform:translateY(-2px)}
.home-card .icon{
  width:50px;height:50px;border-radius:15px;display:grid;place-items:center;
  margin-bottom:14px;font-size:1.35rem;background:#f2efe8;
}
.home-card strong{display:block;font-size:1.08rem}
.home-card small{display:block;color:var(--muted);margin-top:5px}

/* визуални котви */
.anchor-frame{
  position:relative;overflow:hidden;
  border:1px solid var(--line);border-radius:20px;
  background:#edf1ee;aspect-ratio:4/3;
}
.anchor-frame img{
  width:100%;height:100%;display:block;object-fit:cover;
}
.anchor-fallback{
  position:absolute;inset:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:20px;text-align:center;
  background:linear-gradient(145deg,#e3eef3,#f4e7d9);
}
.anchor-fallback .big{font-size:2.2rem;font-weight:900;color:var(--year)}
.anchor-fallback .word{font-size:1.15rem;font-weight:900;margin-top:8px}
.visual-type{
  position:absolute;left:10px;bottom:10px;max-width:calc(100% - 20px);
  padding:6px 9px;border-radius:10px;
  background:rgba(255,253,248,.94);border:1px solid rgba(220,212,200,.92);
  font-size:.7rem;font-weight:900;
}
.image-source{
  font-size:.72rem;color:var(--muted);margin-top:7px;
}

/* категории */
.chip{
  display:inline-flex;align-items:center;gap:6px;
  border-radius:999px;padding:6px 10px;font-size:.76rem;font-weight:900;
  border:1px solid transparent;
}
.chip-year{color:var(--year);background:var(--soft-year);border-color:#ecd3c3}
.chip-person{color:var(--person);background:var(--soft-person);border-color:#cadae2}
.chip-place{color:var(--place);background:var(--soft-place);border-color:#cedfcf}
.chip-cause{color:var(--cause);background:var(--soft-cause);border-color:#e3d6b5}
.chip-effect{color:var(--effect);background:var(--soft-effect);border-color:#dad0e6}
.chips{display:flex;gap:7px;flex-wrap:wrap}

/* timeline */
.timeline{position:relative;padding-left:42px}
.timeline::before{
  content:"";position:absolute;left:16px;top:10px;bottom:10px;
  width:4px;border-radius:4px;background:#ccd7d1;
}
.timeline-item{
  position:relative;display:grid;grid-template-columns:190px 1fr;
  gap:18px;margin-bottom:18px;overflow:hidden;
}
.timeline-dot{
  position:absolute;left:-34px;top:28px;
  width:19px;height:19px;border-radius:50%;
  background:var(--year);border:4px solid var(--bg);
}
.timeline-copy{padding:20px 20px 20px 0}
.year-big{
  display:inline-block;padding:5px 10px;border-radius:12px;
  background:var(--soft-year);color:var(--year);
  font-size:1.5rem;font-weight:900;
}
.status-text{font-size:.76rem;font-weight:900;color:#587061}

/* event */
.event-layout{display:grid;grid-template-columns:.86fr 1.14fr;gap:18px}
.event-aside{position:sticky;top:82px;align-self:start}
.remember{
  margin-top:14px;border-left:5px solid var(--year);
  background:var(--soft-year);border-radius:13px;padding:15px 17px;
}
.fact-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin:18px 0}
.fact-box{border:1px solid var(--line);border-radius:16px;padding:14px;background:white}
.fact-box .label{display:block;font-size:.72rem;font-weight:900;color:var(--muted);margin-bottom:4px}
.causal{
  display:grid;grid-template-columns:1fr auto 1fr auto 1fr;
  gap:10px;align-items:stretch;margin:18px 0;
}
.causal .box{border-radius:17px;padding:15px;border:1px solid var(--line);background:white}
.causal .arrow{align-self:center;font-size:1.45rem;color:var(--muted);font-weight:900}
.before-after{
  display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin:16px 0;
}
.before-after>div{border:1px solid var(--line);border-radius:16px;padding:14px;background:white}
.before-after .now{background:var(--soft-year);border-color:#e6cdbd}
.source-box{
  border:1px solid var(--line);background:#faf7f0;border-radius:16px;padding:14px;margin-top:18px;
}

/* people */
.person-card{overflow:hidden;padding:0}
.person-card .anchor-frame{border:0;border-radius:0;aspect-ratio:5/3}
.person-copy{padding:17px}
.one-thing{
  border-left:4px solid var(--person);background:var(--soft-person);
  border-radius:12px;padding:12px 14px;margin-top:12px;
}

/* events */
.event-card{
  display:grid;grid-template-columns:150px 1fr;gap:15px;
  overflow:hidden;padding:0;
}
.event-card .anchor-frame{border:0;border-radius:0;aspect-ratio:auto;min-height:165px}
.event-card-copy{padding:16px 16px 16px 0}

/* map */
.map-layout{display:grid;grid-template-columns:1.3fr .7fr;gap:16px}
.map-wrap{
  position:relative;min-height:570px;
  border:1px solid var(--line);border-radius:22px;overflow:hidden;
  background:linear-gradient(180deg,#e5f1f5,#f6f0e6);
}
.map-svg{width:100%;height:100%;display:block}
.bg-shape{fill:#dbe6c5;stroke:#789069;stroke-width:4}
.danube{fill:none;stroke:#69a5c0;stroke-width:8;stroke-linecap:round;opacity:.9}
.map-pin{cursor:pointer}
.map-pin circle{fill:var(--place);stroke:white;stroke-width:4}
.map-pin text{font-size:16px;font-weight:900;fill:#233740;paint-order:stroke;stroke:white;stroke-width:5px}
.place-panel .anchor-frame{aspect-ratio:16/9}
.outside-box{
  margin-top:16px;border:1px solid var(--line);border-radius:18px;padding:16px;background:#faf7f0;
}

/* causes */
.cause-card{padding:20px}
.cause-line{
  display:grid;grid-template-columns:1fr auto 1fr auto 1fr;gap:10px;align-items:stretch;
}
.cause-cell{border-radius:16px;border:1px solid var(--line);padding:14px;background:white}
.cause-arrow{align-self:center;color:var(--muted);font-size:1.3rem}

/* review/test */
.quiz{max-width:800px;margin:0 auto}
.quiz-visual{width:min(430px,100%);margin:0 auto 18px}
.quiz-question{font-size:clamp(1.25rem,3vw,1.65rem);font-weight:900;margin:16px 0}
.answers{display:grid;gap:10px}
.answer{
  text-align:left;width:100%;padding:14px;border-radius:14px;
  border:2px solid var(--line);background:white;color:var(--ink);
}
.answer:hover{border-color:#8da6b0}
.feedback{margin-top:14px;padding:14px;border-radius:14px;background:var(--soft-place)}
.hint{margin-top:14px;padding:14px;border-radius:14px;background:#f2efe8}

/* knowledge */
.knowledge-stream{max-width:780px;margin:0 auto}
.knowledge-node{
  display:grid;grid-template-columns:110px 1fr;gap:16px;
  border:1px solid var(--line);border-radius:18px;background:white;padding:14px;
}
.knowledge-year{
  display:grid;place-items:center;border-radius:14px;background:var(--soft-year);
  color:var(--year);font-size:1.45rem;font-weight:900;
}
.knowledge-arrow{text-align:center;color:var(--muted);font-size:1.4rem;padding:6px}

/* parent */
.stat{padding:17px;border-radius:17px;background:#eef3ef}
.stat strong{display:block;font-size:1.7rem}
.list-clean{list-style:none;padding:0;margin:0}
.list-clean li{padding:9px 0;border-bottom:1px solid #ece6dc}

.bottom-nav{
  position:fixed;z-index:60;left:50%;bottom:10px;transform:translateX(-50%);
  width:min(820px,calc(100% - 18px));
  display:grid;grid-template-columns:repeat(6,1fr);
  background:rgba(255,253,248,.95);
  border:1px solid var(--line);border-radius:20px;padding:7px;
  box-shadow:0 16px 45px rgba(35,47,56,.16);
  backdrop-filter:blur(12px);
}
.bottom-nav button{
  border:0;background:transparent;border-radius:13px;padding:7px 4px;
  color:var(--muted);font-size:.62rem;font-weight:900;
}
.bottom-nav button span{display:block;font-size:1.15rem}
.bottom-nav button.active{background:var(--soft-person);color:var(--person)}

hr{border:0;border-top:1px solid var(--line);margin:24px 0}
@media(max-width:900px){
  .hero,.event-layout,.map-layout{grid-template-columns:1fr}
  .event-aside{position:static}
  .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:680px){
  html{font-size:17px}
  .app{width:min(100% - 16px,1180px);margin-top:12px}
  .panel{padding:18px}
  .grid-2,.grid-3{grid-template-columns:1fr}
  .timeline{padding-left:32px}
  .timeline-item,.event-card{grid-template-columns:1fr}
  .timeline-copy,.event-card-copy{padding:16px}
  .causal,.cause-line,.before-after{grid-template-columns:1fr}
  .causal .arrow,.cause-arrow{transform:rotate(90deg);justify-self:center}
  .fact-grid{grid-template-columns:1fr}
  .knowledge-node{grid-template-columns:82px 1fr}
  .bottom-nav{bottom:6px}
  .bottom-nav button{font-size:.55rem}
}

/* =========================================================
   ЧЕТИМОСТ И КОГНИТИВНА ПОДРЕДБА
   ========================================================= */
:root{
  --font:Verdana,Tahoma,Arial,sans-serif;
}
html{font-size:19px}
body{
  line-height:1.68;
  text-align:left;
}
body.large-text{font-size:1.1em}
body.easy-read{
  letter-spacing:.025em;
  word-spacing:.07em;
  line-height:1.82;
}
p{
  max-width:62ch;
  margin-top:.65em;
  margin-bottom:1.05em;
}
strong{font-weight:700}
small,.small{font-size:.84rem;line-height:1.55}
button,a{line-height:1.35}
.primary,.secondary,.ghost,.answer,.tool-btn,.bottom-nav button{
  min-height:48px;
}
h1,h2,h3{
  font-weight:700;
  max-width:28ch;
}
h1{font-size:clamp(2rem,5vw,3.6rem)}
h2{font-size:clamp(1.4rem,3.5vw,2.15rem)}
.lead{max-width:58ch;line-height:1.65}
.panel{overflow-wrap:anywhere}
.timeline-copy p,.event-card-copy p,.fact-box,.cause-cell,.memory-node{
  max-width:62ch;
}

/* Бързи филтри на времевата линия */
.timeline-controls{
  position:sticky;
  top:71px;
  z-index:35;
  margin:0 0 18px;
  padding:14px;
  background:rgba(255,253,248,.97);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 10px 28px rgba(38,49,58,.10);
  backdrop-filter:blur(10px);
}
.filter-row{
  display:grid;
  grid-template-columns:92px 1fr;
  gap:10px;
  align-items:start;
  padding:5px 0;
}
.filter-label{
  padding-top:7px;
  color:var(--muted);
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.07em;
}
.filter-scroll{
  display:flex;
  gap:7px;
  overflow-x:auto;
  padding:1px 1px 7px;
  scrollbar-width:thin;
}
.filter-btn{
  flex:0 0 auto;
  min-height:42px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:white;
  color:var(--ink);
  font-size:.8rem;
  font-weight:700;
}
.filter-btn.active{
  background:var(--soft-person);
  border-color:#aec8d4;
  color:var(--person);
}
.filter-btn.core.active{
  background:var(--soft-year);
  border-color:#dfbdab;
  color:var(--year);
}

/* Обобщение на век */
.century-summary{
  margin:0 0 20px;
  border:1px solid #cbd9d0;
  border-radius:20px;
  background:#f3f7f3;
  padding:18px;
}
.century-summary-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.century-mini{
  border:1px solid var(--line);
  border-radius:15px;
  background:white;
  padding:13px;
}
.century-mini .y{
  color:var(--year);
  font-size:1.25rem;
  font-weight:700;
}
.century-sentence{
  margin-top:14px;
  padding:13px 15px;
  border-left:4px solid var(--person);
  background:var(--soft-person);
  border-radius:12px;
}

/* Статус на паметта */
.memory-state{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:34px;
  padding:6px 10px;
  border-radius:999px;
  font-size:.74rem;
  font-weight:700;
}
.memory-known{background:#e5f0e7;color:#3d684b}
.memory-unsure{background:#f5eedc;color:#7b6227}
.memory-forgot{background:#f5e3df;color:#8c493c}
.memory-new{background:#edf0f2;color:#60707a}

/* "Днес повтори" */
.today-review{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.today-item{
  width:100%;
  text-align:left;
  border:1px solid var(--line);
  background:white;
  border-radius:16px;
  padding:14px;
  color:var(--ink);
}
.today-item strong{display:block;margin-bottom:5px}

/* Сравнение на близки години */
.compare-years{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.compare-item{
  border:1px solid var(--line);
  background:white;
  border-radius:16px;
  padding:14px;
}
.compare-item .compare-year{
  display:block;
  color:var(--year);
  font-size:1.45rem;
  font-weight:700;
  margin-bottom:5px;
}
.compare-item strong{display:block}

/* Компактен хронологичен контекст */
.context-strip{
  display:grid;
  grid-template-columns:1fr auto 1fr auto 1fr;
  gap:8px;
  align-items:center;
  margin:14px 0 2px;
}
.context-node{
  min-height:76px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:white;
  text-align:center;
  font-size:.82rem;
}
.context-node.current{
  background:var(--soft-year);
  border-color:#dfbdab;
}
.context-arrow{color:var(--muted);font-weight:700}

/* Удобство на четене */
.answer{
  font-size:1rem;
  padding:15px 16px;
}
.quiz-question{
  max-width:46ch;
  line-height:1.5;
}
.image-source{
  font-size:.75rem;
  line-height:1.5;
}
.visual-type{
  font-size:.72rem;
  line-height:1.35;
}
.bottom-nav button{
  font-size:.66rem;
}
@media(max-width:900px){
  .century-summary-grid,.today-review,.compare-years{grid-template-columns:1fr}
  .timeline-controls{top:70px}
}
@media(max-width:680px){
  html{font-size:18px}
  body.large-text{font-size:1.08em}
  .filter-row{grid-template-columns:1fr;gap:3px}
  .filter-label{padding-top:2px}
  .context-strip{grid-template-columns:1fr}
  .context-arrow{transform:rotate(90deg);justify-self:center}
  .timeline-controls{top:68px;padding:10px}
}


/* Тестове по отделни години */
.year-test-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.year-test-card{
  width:100%;
  text-align:left;
  border:1px solid var(--line);
  border-radius:18px;
  background:white;
  padding:14px;
  color:var(--ink);
}
.year-test-card:hover{border-color:#9fb2bb}
.year-test-card .year{
  display:block;
  color:var(--year);
  font-size:1.55rem;
  font-weight:700;
  margin-bottom:5px;
}
.test-progress{
  height:10px;
  background:#ece6db;
  border-radius:999px;
  overflow:hidden;
  margin:10px 0 18px;
}
.test-progress span{
  display:block;
  height:100%;
  background:var(--person);
}
.test-type{
  display:inline-flex;
  padding:6px 9px;
  border-radius:999px;
  background:#f1eee7;
  color:#55646d;
  font-size:.74rem;
  font-weight:700;
  margin-bottom:8px;
}
.test-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.test-summary .fact-box{min-height:90px}
@media(max-width:800px){
  .year-test-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .year-test-grid,.test-summary{grid-template-columns:1fr}
}


/* =========================================================
   КАРТА КАТО ИНСТРУМЕНТ ЗА ПАМЕТ
   ========================================================= */
.map-controls{
  position:sticky;
  top:71px;
  z-index:34;
  margin-bottom:16px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,253,248,.97);
  box-shadow:0 10px 28px rgba(38,49,58,.09);
  backdrop-filter:blur(10px);
}
.map-control-row{
  display:grid;
  grid-template-columns:100px 1fr;
  gap:10px;
  align-items:start;
  padding:5px 0;
}
.map-control-label{
  padding-top:7px;
  color:var(--muted);
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.06em;
}
.map-control-scroll{
  display:flex;
  gap:7px;
  overflow-x:auto;
  padding:1px 1px 7px;
}
.map-mode-btn,.map-filter-btn{
  flex:0 0 auto;
  min-height:42px;
  border:1px solid var(--line);
  border-radius:12px;
  background:white;
  color:var(--ink);
  padding:8px 12px;
  font-size:.8rem;
  font-weight:700;
}
.map-mode-btn.active,.map-filter-btn.active{
  background:var(--soft-place);
  border-color:#b9d0bf;
  color:var(--place);
}
.map-mode-note{
  margin-top:8px;
  padding:10px 12px;
  border-radius:12px;
  background:#f4f1ea;
  color:#52616a;
  font-size:.82rem;
}
.map-wrap{
  min-height:600px;
  background:
    radial-gradient(circle at 74% 45%,rgba(105,165,192,.13),transparent 26%),
    linear-gradient(180deg,#e6f1f5,#f7f1e7);
}
.map-svg .country-shadow{
  fill:rgba(40,60,45,.10);
  transform:translate(5px,7px);
}
.bg-shape{
  fill:#d8e4c3;
  stroke:#718a65;
  stroke-width:4;
}
.bg-inner{
  fill:none;
  stroke:#aab99a;
  stroke-width:1.5;
  opacity:.55;
}
.balkan-line{
  fill:none;
  stroke:#8b9b7d;
  stroke-width:10;
  stroke-linecap:round;
  opacity:.48;
}
.map-orientation-label{
  font-size:15px;
  font-weight:700;
  fill:#6f7d75;
}
.map-pin circle{
  transition:r .15s ease, fill .15s ease, stroke-width .15s ease;
}
.map-pin:hover circle{r:16}
.map-pin.focused circle{
  fill:var(--year);
  stroke-width:6;
}
.map-pin.dimmed{opacity:.25}
.map-pin.correct circle{fill:#3f7957}
.map-pin.wrong circle{fill:#a55434}
.map-pin-label.hidden{display:none}
.map-instruction{
  margin-bottom:12px;
  padding:14px 16px;
  border-left:4px solid var(--place);
  border-radius:12px;
  background:var(--soft-place);
}
.map-self-prompt{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.map-self-prompt strong{font-size:1.18rem}
.map-feedback{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  background:#f2efe8;
}
.map-memory-link{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:10px;
  align-items:start;
  margin:9px 0;
  padding:10px;
  border:1px solid var(--line);
  border-radius:13px;
  background:white;
}
.map-memory-link .mini-year{
  color:var(--year);
  background:var(--soft-year);
  border-radius:9px;
  padding:4px 7px;
  font-weight:700;
}
.map-show-list{
  display:grid;
  gap:7px;
  max-height:310px;
  overflow:auto;
  padding-right:3px;
}
.map-show-item{
  width:100%;
  text-align:left;
  border:1px solid var(--line);
  background:white;
  border-radius:12px;
  padding:10px;
  color:var(--ink);
}
.map-show-item.active{
  border-color:#9bb8a4;
  background:var(--soft-place);
}
.map-test-shell{
  display:grid;
  grid-template-columns:1.25fr .75fr;
  gap:14px;
  margin-top:14px;
}
.map-test-map{
  min-height:460px;
  border:1px solid var(--line);
  border-radius:20px;
  overflow:hidden;
  background:linear-gradient(180deg,#e5f1f5,#f7f1e8);
}
.map-test-side{
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  background:white;
}
.map-year-link{
  display:inline-flex;
  margin-top:8px;
  min-height:44px;
  align-items:center;
}
@media(max-width:850px){
  .map-test-shell{grid-template-columns:1fr}
  .map-control-row{grid-template-columns:1fr;gap:3px}
  .map-control-label{padding-top:2px}
  .map-controls{top:68px}
}


/* =========================================================
   V5 — ЯСЕН ДИЗАЙН ЗА 10-ГОДИШНО ДЕТЕ
   ========================================================= */
:root{
  --bg:#f7f3e9;
  --paper:#fffdf8;
  --ink:#20313b;
  --muted:#60717a;
  --line:#d5ccbd;
  --year:#b45735;
  --person:#28637f;
  --place:#47775c;
  --cause:#947024;
  --effect:#70578d;
  --soft-year:#fae9de;
  --soft-person:#dfedf4;
  --soft-place:#e2f0e7;
  --soft-cause:#f7eed7;
  --soft-effect:#eee8f5;
  --button-shadow:0 4px 0 rgba(38,56,66,.12);
  --button-shadow-hover:0 6px 0 rgba(38,56,66,.14);
}
html{font-size:19px}
body{font-family:Verdana,Tahoma,Arial,sans-serif;font-size:19px;line-height:1.68;color:var(--ink)}
body.large-text{font-size:21px}
body.easy-read{letter-spacing:.025em;word-spacing:.065em;line-height:1.82}
h1{font-size:clamp(32px,4.5vw,48px)!important;line-height:1.12;letter-spacing:-.025em;font-weight:700}
h2{font-size:clamp(25px,3vw,36px)!important;line-height:1.18;font-weight:700}
h3{font-size:clamp(20px,2vw,24px)!important;line-height:1.25;font-weight:700}
body.large-text h1{font-size:48px!important}
body.large-text h2{font-size:36px!important}
body.large-text h3{font-size:25px!important}
.lead{font-size:20px;line-height:1.62}
body.large-text .lead{font-size:22px}
.kicker,.filter-label,.map-control-label,.fact-box .label{font-size:14px!important;letter-spacing:.055em}
.small,small{font-size:16px;line-height:1.5}
p{max-width:62ch}

/* По-ясни бутони */
button,.primary,.secondary,.ghost,.filter-btn,.map-mode-btn,.map-filter-btn,.answer,.home-card,.year-test-card,.today-item,.compare-item,.century-mini,.map-show-item,.map-memory-link{transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease,background .12s ease}
.primary,.secondary,.ghost{min-height:52px;border-width:2px;border-radius:14px;padding:12px 18px;box-shadow:var(--button-shadow);font-weight:700}
.primary{background:#28637f;border-color:#1f526b;color:#fff}
.secondary{background:#e2f0e7;border-color:#8bb09a;color:#294f38}
.ghost{background:#fffdfa;border-color:#aeb8b9;color:#263b46}
.primary:hover,.secondary:hover,.ghost:hover,.filter-btn:hover,.map-mode-btn:hover,.map-filter-btn:hover,.answer:hover,.home-card:hover,.year-test-card:hover,.today-item:hover,.compare-item:hover,.century-mini:hover,.map-show-item:hover,.map-memory-link:hover{transform:translateY(-2px);box-shadow:var(--button-shadow-hover)}
.primary:active,.secondary:active,.ghost:active,.filter-btn:active,.map-mode-btn:active,.map-filter-btn:active,.answer:active,.home-card:active,.year-test-card:active,.today-item:active{transform:translateY(1px);box-shadow:0 2px 0 rgba(38,56,66,.12)}
.tool-btn{min-width:50px;min-height:50px;border:2px solid #aeb8b9;background:#fff;box-shadow:0 3px 0 rgba(38,56,66,.10);font-weight:700}
.tool-btn:hover{background:var(--soft-person);border-color:#88aebe}

/* Начални избори */
.home-card{min-height:190px;border:2px solid #cfc6b8;box-shadow:0 6px 0 rgba(49,62,69,.09),0 14px 28px rgba(36,48,58,.07);padding:20px}
.home-card .icon{width:56px;height:56px;border:2px solid rgba(0,0,0,.06);background:linear-gradient(145deg,#f8eadf,#e2edf2);font-size:26px}
.home-card strong{font-size:20px}.home-card small{font-size:16px;line-height:1.5}

/* Ясни избрани филтри */
.filter-btn,.map-mode-btn,.map-filter-btn{min-height:46px;border:2px solid #b9c1bf;padding:9px 13px;background:#fff;color:#2a3f49;box-shadow:0 3px 0 rgba(38,56,66,.08);font-weight:700}
.filter-btn.active,.map-mode-btn.active,.map-filter-btn.active{border-color:#28637f;background:#dfeef5;color:#174d68;box-shadow:inset 0 0 0 1px rgba(40,99,127,.18)}
.filter-btn.core.active{border-color:#b45735;background:#fae9de;color:#8d3f25}

/* Тестови отговори */
.answer{min-height:58px;border:2px solid #b9c1bf;padding:15px 17px;font-size:19px;line-height:1.45;box-shadow:0 3px 0 rgba(38,56,66,.08)}
.answers{gap:12px}.quiz-question{font-size:clamp(22px,2.5vw,28px)!important;line-height:1.42;max-width:48ch}.test-type{font-size:15px;border:1px solid #d2c9bb}.feedback,.hint{font-size:18px;line-height:1.55}

/* Карти и групи */
.panel{border:2px solid #ddd4c6;box-shadow:0 12px 30px rgba(36,48,58,.08)}.card{border:2px solid #ddd4c6}.fact-box,.cause-cell,.memory-node,.context-node,.century-mini,.compare-item{border-width:2px}.year-big{font-size:30px!important;border:2px solid #e3c4b2}.chip{min-height:34px;font-size:15px;border-width:1.5px}.memory-state{min-height:38px;font-size:15px;border:1px solid rgba(0,0,0,.07)}.remember{font-size:19px;line-height:1.55}.remember strong{font-size:20px}
.timeline-item{border-width:2px}.timeline-dot{width:22px;height:22px;border-width:4px}.timeline-copy{padding-top:22px}.century-summary{border-width:2px}.century-mini .y{font-size:25px}
.map-instruction{font-size:18px;line-height:1.55}.map-mode-note{font-size:16px;line-height:1.5}.map-pin text{font-size:17px}.map-pin circle{stroke-width:5}.map-show-item,.map-memory-link{min-height:50px;border-width:2px}
.bottom-nav{border:2px solid #c9c0b2;padding:8px}.bottom-nav button{min-height:58px;border:1px solid transparent;font-size:13px;line-height:1.25;color:#53636b}.bottom-nav button span{font-size:22px;margin-bottom:2px}.bottom-nav button.active{background:#dfeef5;border-color:#aac7d4;color:#174d68}
.today-item{min-height:120px;border:2px solid #cfc6b8;box-shadow:0 4px 0 rgba(38,56,66,.07)}.today-item strong{font-size:18px}.year-test-card{min-height:150px;border:2px solid #cfc6b8;box-shadow:0 5px 0 rgba(38,56,66,.08)}.year-test-card .year{font-size:30px}.test-progress{height:12px}
.event-layout h1,.quiz h1,.section-head h1{font-size:clamp(32px,4.5vw,48px)!important}
@media(max-width:680px){html{font-size:18px}body{font-size:18px}h1{font-size:clamp(30px,9vw,42px)!important}h2{font-size:clamp(24px,7vw,32px)!important}h3{font-size:21px!important}.lead{font-size:19px}.small,small{font-size:15px}.bottom-nav button{font-size:12px}}


/* =========================================================
   V6 — компактни второстепенни блокове
   ========================================================= */
.compact-section-head{
  margin-top:20px;
  margin-bottom:9px;
}
.compact-section-head h2{
  font-size:24px!important;
  line-height:1.25;
  margin:.15em 0;
}
.causal-compact{gap:8px}
.causal-compact .box{padding:12px}
.causal-compact .compact-text{
  font-size:16px!important;
  line-height:1.5;
  font-weight:400;
  margin:8px 0 0;
}
.causal-compact .event-center{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
  background:var(--soft-year);
}
.compact-year{
  font-size:23px;
  line-height:1.1;
  font-weight:700;
  color:var(--year);
}
.compact-event{
  margin-top:6px;
  font-size:16px;
  line-height:1.4;
  font-weight:700;
}
.chronology-compact>div{
  min-height:96px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:6px;
}
.chrono-year{
  font-size:22px;
  line-height:1.1;
  font-weight:700;
  color:var(--year);
}
.chrono-title{
  font-size:16px;
  line-height:1.4;
  font-weight:600;
}
.chronology-compact .now .chrono-title{font-weight:700}
.compare-clear{
  min-height:126px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:6px;
  text-align:left;
}
.compare-clear .compare-year{
  font-size:25px;
  line-height:1.1;
  margin:0;
}
.compare-title{
  display:block;
  font-size:17px;
  line-height:1.35;
  font-weight:700;
}
.compare-word{
  display:inline-flex;
  margin-top:2px;
  padding:5px 8px;
  border-radius:9px;
  background:#f2eee6;
  color:#5e6a70;
  font-size:14px;
  line-height:1.25;
}
@media(max-width:680px){
  .compact-section-head h2{font-size:22px!important}
  .compact-year,.chrono-year{font-size:21px}
  .compact-event,.chrono-title,.compare-title{font-size:16px}
}


/* =========================================================
   V7 — ясна начална страница и постоянни визуални подсказки
   ========================================================= */
.home-intro{
  display:grid;
  grid-template-columns:.9fr 1.1fr;
  gap:24px;
  align-items:center;
}
.main-choice-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.main-choice{
  min-height:116px;
  display:grid;
  grid-template-columns:56px 1fr auto;
  gap:12px;
  align-items:center;
  text-align:left;
  border:2px solid #c9c1b4;
  border-radius:18px;
  background:white;
  padding:16px;
  color:var(--ink);
  box-shadow:0 5px 0 rgba(38,56,66,.08);
}
.main-choice:hover{transform:translateY(-2px);box-shadow:0 7px 0 rgba(38,56,66,.11)}
.main-choice-icon{
  width:54px;height:54px;
  display:grid;place-items:center;
  border-radius:15px;
  font-size:28px;
}
.choice-time .main-choice-icon{background:var(--soft-year)}
.choice-map .main-choice-icon{background:var(--soft-place)}
.choice-people .main-choice-icon{background:var(--soft-person)}
.choice-test .main-choice-icon{background:#e7f1e9}
.main-choice strong{display:block;font-size:20px;line-height:1.25}
.main-choice small{display:block;margin-top:4px;color:var(--muted);font-size:15px;line-height:1.4}
.choice-arrow{font-size:24px;color:#61727b;font-weight:700}

.home-section-head{margin-top:28px;margin-bottom:11px}
.home-section-head h2{font-size:28px!important}

.learning-legend{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:9px;
}
.legend-item{
  min-height:84px;
  display:grid;
  grid-template-columns:42px 1fr;
  gap:9px;
  align-items:center;
  padding:12px;
  border:2px solid var(--line);
  border-radius:15px;
  background:white;
}
.legend-icon{
  width:40px;height:40px;
  display:grid;place-items:center;
  border-radius:12px;
  font-size:22px;
}
.year-icon{background:var(--soft-year)}
.person-icon{background:var(--soft-person)}
.place-icon{background:var(--soft-place)}
.cause-icon{background:var(--soft-cause)}
.effect-icon{background:var(--soft-effect)}
.legend-item strong{display:block;font-size:16px;line-height:1.25}
.legend-item small{display:block;margin-top:2px;font-size:14px;color:var(--muted)}

.home-map-card{
  border:2px solid var(--line);
  border-radius:20px;
  background:white;
  padding:16px;
  box-shadow:0 8px 24px rgba(36,48,58,.07);
}
.home-map-head{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
}
.home-map-head h2{font-size:28px!important;margin:.25em 0}
.home-map-help{margin:.2em 0 10px;font-size:16px}
.home-map-wrap{
  min-height:350px;
  border-radius:17px;
  overflow:hidden;
  background:linear-gradient(180deg,#e8f2f5,#f7f2e9);
  border:1px solid #d8d0c4;
}
.home-map-svg{width:100%;height:100%;min-height:350px;display:block}
.home-map-pin{cursor:pointer}
.home-map-pin circle{fill:var(--place);stroke:white;stroke-width:5}
.home-map-pin text{
  font-size:17px;font-weight:700;fill:#243840;
  paint-order:stroke;stroke:white;stroke-width:5px;
}
.home-map-pin:hover circle{fill:var(--year)}

.today-year{color:var(--year);font-size:26px;line-height:1.1;font-weight:700;margin-bottom:6px}

.secondary-tools{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;
}
.secondary-tool{
  min-height:104px;
  display:grid;grid-template-columns:48px 1fr;gap:11px;align-items:center;
  text-align:left;border:2px solid #d2cabc;border-radius:17px;background:white;
  padding:14px;color:var(--ink);box-shadow:0 4px 0 rgba(38,56,66,.07);
}
.secondary-tool-icon{
  width:46px;height:46px;display:grid;place-items:center;border-radius:13px;
  background:#f2eee6;font-size:24px;
}
.secondary-tool strong{display:block;font-size:17px}
.secondary-tool small{display:block;margin-top:3px;color:var(--muted);font-size:14px;line-height:1.4}

.mixed-review-card{
  margin-top:18px;
  display:flex;justify-content:space-between;gap:18px;align-items:center;
  border:2px solid #d6cec1;border-radius:18px;background:#faf7f1;padding:17px;
}
.mixed-review-card h2{font-size:24px!important;margin:.3em 0}
.mixed-review-card p{margin:.25em 0}

@media(max-width:930px){
  .home-intro{grid-template-columns:1fr}
  .learning-legend{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:680px){
  .main-choice-grid{grid-template-columns:1fr}
  .learning-legend{grid-template-columns:repeat(2,minmax(0,1fr))}
  .secondary-tools{grid-template-columns:1fr}
  .home-map-head,.mixed-review-card{align-items:flex-start;flex-direction:column}
  .home-map-wrap,.home-map-svg{min-height:290px}
}


/* V8 — по-надеждни филтри и по-лесни точки на картата */
.filter-reset-row{
  display:flex;
  justify-content:flex-end;
  padding-top:8px;
  border-top:1px solid #e6dfd4;
  margin-top:7px;
}
.filter-reset-btn{
  min-height:44px;
  font-size:15px;
  box-shadow:none;
}
.map-hit{
  fill:transparent!important;
  stroke:none!important;
  pointer-events:all;
}
.map-pin:hover .map-hit,
.home-map-pin:hover .map-hit{
  r:26!important;
  fill:transparent!important;
  stroke:none!important;
}
.home-map-pin .map-hit{fill:transparent!important;stroke:none!important}
.home-map-pin:hover .home-map-dot{fill:var(--year)}
.map-pin:hover .map-dot{r:16}
.timeline-item[role="button"]{cursor:pointer}
.timeline-item[role="button"]:focus-visible{
  outline:4px solid rgba(40,99,127,.25);
  outline-offset:3px;
}


/* V9 — единичните години се изписват с думата „година“ */
.year-big,.year-test-card .year,.today-year,.compare-clear .compare-year,
.compact-year,.chrono-year,.knowledge-year,.century-mini .y{white-space:normal}
.year-big{font-size:27px!important}
.today-year{font-size:23px}
.compare-clear .compare-year{font-size:22px}
.compact-year,.chrono-year{font-size:20px}
.knowledge-year{font-size:20px}
.first-memory{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 16px}
.first-memory span{
  display:inline-flex;align-items:center;min-height:38px;padding:7px 10px;
  border:1.5px solid var(--line);border-radius:11px;background:#fff;
  font-size:15px;font-weight:700;line-height:1.3;
}
.first-memory span:nth-child(1){background:var(--soft-year)}
.first-memory span:nth-child(2){background:var(--soft-person)}
.first-memory span:nth-child(3){background:#f4f1ea}


/* =========================================================
   V10 — по-лесна начална страница, векове без скрол,
   карта вътре в събитието
   ========================================================= */
.child-home-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.choice-events .main-choice-icon{background:#f2eadf}
.choice-test{
  grid-column:1 / -1;
}
.choice-test .main-choice-icon{background:#e7f1e9}

/* Вековете: 9 бутона = 3 ясни реда по 3 */
.century-filter-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  overflow:visible!important;
  width:100%;
  padding-bottom:2px;
}
.century-filter-grid .filter-btn{
  width:100%;
  white-space:normal;
  min-height:52px;
  line-height:1.3;
}

/* Личност + карта */
.person-first-block{
  display:grid;
  gap:10px;
  margin:18px 0 12px;
}
.person-box{
  min-height:84px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.person-box strong{
  font-size:20px;
}
.event-person-map{
  border:2px solid #cbd8cf;
  border-radius:17px;
  background:#f4f8f4;
  padding:12px;
}
.event-person-map-title{
  display:flex;
  flex-wrap:wrap;
  gap:7px 12px;
  align-items:center;
  margin-bottom:9px;
}
.event-person-map-title span{
  color:var(--place);
  font-size:14px;
  font-weight:700;
}
.event-person-map-title strong{
  font-size:16px;
  line-height:1.4;
}
.event-person-map-wrap{
  min-height:245px;
  border:1px solid #d4ddd6;
  border-radius:13px;
  overflow:hidden;
  background:linear-gradient(180deg,#e8f2f5,#f7f2e9);
}
.event-person-map-svg{
  width:100%;
  min-height:245px;
  display:block;
}
.event-map-pin{cursor:pointer}
.event-map-pin circle{
  fill:var(--year);
  stroke:white;
  stroke-width:5;
}
.event-map-pin text{
  font-size:17px;
  font-weight:700;
  fill:#243840;
  paint-order:stroke;
  stroke:white;
  stroke-width:5px;
}
.event-map-pin:hover circle{fill:var(--place)}
.event-facts-grid{margin-top:12px}

@media(max-width:760px){
  .century-filter-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .child-home-grid{grid-template-columns:1fr}
  .choice-test{grid-column:auto}
  .event-person-map-wrap,.event-person-map-svg{min-height:215px}
}


/* =========================================================
   V11 — ясна обратна връзка в теста + важни факти
   ========================================================= */
.answer.answer-wrong,
.answer.answer-wrong:hover{
  background:#f9dedd!important;
  border-color:#b84e49!important;
  color:#6f2421!important;
  box-shadow:0 3px 0 rgba(139,53,49,.14)!important;
  transform:none!important;
}
.answer.answer-correct,
.answer.answer-correct:hover{
  background:#dff1e4!important;
  border-color:#45805a!important;
  color:#245936!important;
  box-shadow:0 3px 0 rgba(44,105,67,.14)!important;
  transform:none!important;
}
.answer:disabled{
  opacity:1;
  cursor:default;
}
.feedback-wrong{
  border-left:4px solid #b84e49;
  background:#fff3f2;
}
.important-facts{
  margin-top:12px;
  border:2px solid #d8cda9;
  border-radius:16px;
  background:#fffaf0;
  padding:13px 14px;
}
.important-facts-title{
  color:#6f5925;
  font-size:14px;
  font-weight:700;
  letter-spacing:.04em;
}
.important-facts ul{
  margin:10px 0 0;
  padding-left:21px;
}
.important-facts li{
  margin:8px 0;
  font-size:15px;
  line-height:1.48;
}
.event-aside .event-person-map{
  margin-top:2px;
}


/* =========================================================
   V12 — лого с карта на България + горна навигация
   ========================================================= */
.topbar{
  display:block;
  padding:12px clamp(14px,4vw,40px) 10px;
}
.topbar-main{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
}
.brand{
  min-width:0;
}
.brand-logo{
  width:54px;
  height:54px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:#e3eef3;
  color:var(--person);
}
.brand-logo svg{
  width:46px;
  height:32px;
  display:block;
}
.top-nav{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding-top:10px;
}
.top-nav button{
  appearance:none;
  border:1.5px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.86);
  color:var(--ink);
  min-height:42px;
  padding:8px 14px;
  font-size:15px;
  font-weight:700;
  line-height:1.2;
}
.top-nav button:hover{
  border-color:#aac7d4;
  background:#f5fbff;
}
.top-nav button.active{
  background:#dfeef5;
  border-color:#aac7d4;
  color:#174d68;
}
@media(max-width:720px){
  .topbar-main{
    align-items:flex-start;
  }
  .top-nav{
    overflow-x:auto;
    flex-wrap:nowrap;
    padding-bottom:2px;
  }
  .top-nav button{
    white-space:nowrap;
    flex:0 0 auto;
  }
}


/* =========================================================
   V14 — V12 интерфейс + по-компактна карта
   Само route "map" използва тези размери.
   ========================================================= */
.route-map .section-head{
  margin:16px 0 9px;
}
.route-map .section-head h1{
  font-size:34px!important;
  margin:.18em 0;
}
.route-map .section-head .lead{
  font-size:16px;
  line-height:1.5;
  max-width:68ch;
  margin:.35em 0;
}
.route-map .map-controls{
  top:112px;
  margin-bottom:10px;
  padding:10px 11px;
  border-radius:15px;
  box-shadow:0 6px 18px rgba(38,49,58,.07);
}
.route-map .map-control-row{
  grid-template-columns:72px 1fr;
  gap:7px;
  padding:3px 0;
}
.route-map .map-control-label{
  padding-top:6px;
  font-size:11px!important;
}
.route-map .map-control-scroll{
  gap:6px;
  padding:0 1px 4px;
}
.route-map .map-mode-btn,
.route-map .map-filter-btn{
  min-height:36px;
  padding:6px 10px;
  border-width:1.5px;
  border-radius:10px;
  font-size:14px;
  box-shadow:none;
}
.route-map .filter-reset-row{
  margin-top:5px;
}
.route-map .filter-reset-btn,
.route-map .map-year-link{
  min-height:36px;
  padding:6px 10px;
  font-size:14px;
  box-shadow:none;
}
.route-map .map-mode-note{
  margin-top:6px;
  padding:8px 10px;
  font-size:14px;
  line-height:1.4;
}
.route-map .map-instruction{
  margin-bottom:9px;
  padding:10px 12px;
  border-left-width:3px;
  font-size:15px;
  line-height:1.45;
}
.route-map .map-self-prompt strong{
  font-size:17px;
}
.route-map .map-layout{
  grid-template-columns:minmax(0,1.45fr) minmax(260px,.55fr);
  gap:12px;
}
.route-map .map-wrap{
  min-height:520px;
  border-radius:16px;
}
.route-map .map-pin text{
  font-size:15px;
  font-weight:700;
}
.route-map .place-panel{
  padding:14px;
}
.route-map .place-panel h2{
  font-size:24px!important;
  margin:.35em 0;
}
.route-map .place-panel h3{
  font-size:17px!important;
  margin:.8em 0 .45em;
}
.route-map .place-panel p{
  font-size:15px;
  line-height:1.5;
}
.route-map .place-panel .anchor-frame{
  max-height:210px;
  overflow:hidden;
}
.route-map .place-panel .anchor-frame img{
  max-height:210px;
  object-fit:cover;
}
.route-map .map-memory-link{
  min-height:44px;
  margin:7px 0;
  padding:8px;
  gap:8px;
  border-width:1.5px;
}
.route-map .map-memory-link .mini-year{
  font-size:14px;
  padding:4px 6px;
}
.route-map .map-memory-link strong{
  font-size:15px;
}
.route-map .map-memory-link .small{
  font-size:13px;
}
.route-map .map-show-list{
  gap:5px;
  max-height:250px;
}
.route-map .map-show-item{
  min-height:40px;
  padding:8px 9px;
  font-size:14px;
}
@media(max-width:980px){
  .route-map .map-layout{
    grid-template-columns:1fr;
  }
  .route-map .map-wrap{
    min-height:470px;
  }
}
@media(max-width:720px){
  .route-map .map-controls{
    top:106px;
  }
  .route-map .map-control-row{
    grid-template-columns:1fr;
    gap:2px;
  }
  .route-map .map-wrap{
    min-height:390px;
  }
  .route-map .section-head h1{
    font-size:30px!important;
  }
}


/* =========================================================
   V16 — запазени V14 филтри, но по-компактни
   ========================================================= */

/* Времева линия — същите филтри, по-малки */
.timeline-controls{
  padding:10px!important;
  gap:7px!important;
  border-radius:15px!important;
}
.timeline-controls .filter-row{
  grid-template-columns:74px 1fr!important;
  gap:7px!important;
}
.timeline-controls .filter-label{
  font-size:11px!important;
  line-height:1.2!important;
  padding-top:8px!important;
}
.timeline-controls .filter-scroll{
  gap:5px!important;
  padding-bottom:2px!important;
}
.timeline-controls .filter-btn{
  min-height:34px!important;
  padding:6px 9px!important;
  border-width:1.5px!important;
  border-radius:9px!important;
  font-size:12px!important;
  line-height:1.2!important;
  box-shadow:none!important;
}
.timeline-controls .century-filter-grid{
  gap:5px!important;
}
.timeline-controls .century-filter-grid .filter-btn{
  min-height:38px!important;
  font-size:11px!important;
  padding:5px 7px!important;
}
.timeline-controls .filter-reset-row{
  margin-top:3px!important;
}
.timeline-controls .filter-reset-btn{
  min-height:34px!important;
  padding:5px 8px!important;
  font-size:12px!important;
  box-shadow:none!important;
}

/* Карта — запазени V14 филтри, още по-компактни */
.route-map .map-controls{
  padding:8px 9px!important;
  margin-bottom:8px!important;
}
.route-map .map-control-row{
  grid-template-columns:64px 1fr!important;
  gap:5px!important;
  padding:2px 0!important;
}
.route-map .map-control-label{
  font-size:10px!important;
  padding-top:7px!important;
}
.route-map .map-control-scroll{
  gap:4px!important;
  padding-bottom:2px!important;
}
.route-map .map-mode-btn,
.route-map .map-filter-btn{
  min-height:32px!important;
  padding:5px 8px!important;
  font-size:11px!important;
  line-height:1.2!important;
  border-radius:8px!important;
}
.route-map .filter-reset-btn,
.route-map .map-year-link{
  min-height:32px!important;
  padding:5px 8px!important;
  font-size:11px!important;
}
.route-map .map-mode-note{
  font-size:12px!important;
  padding:7px 8px!important;
}
.route-map .map-instruction{
  font-size:13px!important;
  padding:8px 10px!important;
  margin-bottom:7px!important;
}
.route-map .map-show-item{
  min-height:34px!important;
  padding:6px 8px!important;
  font-size:12px!important;
}

/* По-голяма невидима зона за натискане върху град */
.map-pin .map-hit{
  fill:transparent!important;
  stroke:none!important;
  pointer-events:all!important;
}
.map-pin{
  cursor:pointer!important;
  outline:none;
}
.map-pin:focus .map-dot{
  stroke:#174d68!important;
  stroke-width:7!important;
}
.map-pin-label{
  pointer-events:none;
}

@media(max-width:720px){
  .timeline-controls .filter-row,
  .route-map .map-control-row{
    grid-template-columns:1fr!important;
  }
  .timeline-controls .filter-label,
  .route-map .map-control-label{
    padding-top:0!important;
  }
}


/* =========================================================
   V17 — Senior UX/UI redesign: calm, predictable, dyslexia-friendly
   ========================================================= */
:root{
  --bg:#f5f1e8;
  --paper:#fffdf8;
  --ink:#23333c;
  --muted:#60717a;
  --line:#d8d2c7;
  --shadow:0 5px 18px rgba(35,51,60,.065);
  --radius:16px;
  --font:Verdana,Tahoma,Arial,sans-serif;
}
html{font-size:17px}
body{
  background:var(--bg)!important;
  font-size:17px;
  line-height:1.58;
  padding-bottom:30px;
}
body.easy-read{letter-spacing:.025em;word-spacing:.055em;line-height:1.72}
body.large-text{font-size:19px}
.app{width:min(1120px,calc(100% - 28px));margin:18px auto 48px}
p{max-width:66ch}
h1,h2,h3{letter-spacing:0!important}
h1{font-size:clamp(30px,4vw,40px)!important;line-height:1.18;margin:.35em 0}
h2{font-size:clamp(21px,2.5vw,27px)!important;line-height:1.25;margin:.4em 0}
h3{font-size:19px!important;line-height:1.3}
.lead{font-size:17px!important;line-height:1.58;color:#3d5059}
.small,small{font-size:14px}
.kicker{font-size:12px;letter-spacing:.06em}
.eyebrow{font-size:13px;padding:5px 9px}
.panel,.card{border-radius:var(--radius);box-shadow:var(--shadow);border:1px solid var(--line)}
.panel{padding:clamp(18px,3vw,28px)}
.card{padding:14px}
.section-head{margin:22px 0 11px;align-items:end}
.button-row{gap:8px;margin-top:14px}
.primary,.secondary,.ghost,.answer,.tool-btn,.filter-btn,.map-mode-btn,.map-filter-btn,.source-link{
  min-height:44px;
}
.primary,.secondary,.ghost{padding:9px 13px;border-radius:11px;font-size:15px}
button:focus-visible,a:focus-visible,[tabindex]:focus-visible,summary:focus-visible{
  outline:3px solid rgba(49,95,120,.28);outline-offset:2px;
}

/* Header: one navigation system per device */
.topbar{padding:8px clamp(14px,3vw,28px);background:rgba(255,253,248,.97)}
.topbar-main{gap:10px}
.brand{gap:9px}
.brand-logo{width:44px;height:44px;border-radius:12px}
.brand-logo svg{width:38px;height:28px}
.brand strong{font-size:15px;line-height:1.25}
.brand small{font-size:12px;line-height:1.25}
.top-actions{gap:5px}
.tool-btn{min-width:44px;height:44px;border-radius:10px;padding:0 10px}
.top-nav{gap:5px;padding-top:7px}
.top-nav button{min-height:40px;padding:7px 10px;font-size:13px;border-radius:10px}
.bottom-nav{display:none!important}

/* Home */
.home-hero-v17{display:grid;grid-template-columns:minmax(260px,.7fr) minmax(0,1.3fr);gap:22px;align-items:center}
.home-intro-copy{padding:0}
.home-learn-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.main-choice{min-height:92px;padding:12px 13px;border-radius:14px;box-shadow:none;border:1.5px solid #d3cdc2}
.main-choice:hover{transform:none;border-color:#9ab5c1;background:#fbfeff}
.main-choice-icon{width:44px;height:44px;font-size:22px;border-radius:11px}
.main-choice strong{font-size:16px}
.main-choice small{font-size:13px;line-height:1.35}
.choice-arrow{font-size:18px}
.home-test-cta{grid-column:1/-1;width:100%;margin-top:10px;display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:11px;text-align:left;min-height:66px;padding:10px 13px;border:1.5px solid #9fc4aa;border-radius:14px;background:#edf6ef;color:var(--ink)}
.home-test-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:11px;background:#dceee1;color:#315d3f;font-size:20px;font-weight:900}
.home-test-cta strong{display:block;font-size:16px}.home-test-cta small{display:block;color:var(--muted);font-size:13px;margin-top:2px}
.home-legend-bar{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0 4px;padding:9px 11px;border:1px solid var(--line);border-radius:13px;background:rgba(255,253,248,.75)}
.home-legend-bar span{font-size:13px;color:#4e6069}.home-legend-bar b{font-size:16px;margin-right:3px}
.home-map-card{padding:13px;border-radius:16px;box-shadow:var(--shadow)}
.home-map-head h2{font-size:22px!important}.home-map-help{font-size:14px}
.home-map-wrap,.home-map-svg{min-height:315px}

/* Timeline filters and cards */
.timeline-controls{padding:9px!important;border-radius:14px!important;box-shadow:none!important;background:#fbf8f1}
.timeline-controls .filter-row{grid-template-columns:68px 1fr!important;gap:6px!important}
.timeline-controls .filter-label{font-size:10px!important;padding-top:7px!important;letter-spacing:.05em}
.timeline-controls .filter-scroll{gap:5px!important}
.timeline-controls .filter-btn{min-height:38px!important;padding:6px 8px!important;font-size:12px!important;border-radius:9px!important;box-shadow:none!important}
.timeline-controls .century-filter-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important}
.timeline-controls .century-filter-grid .filter-btn{font-size:11px!important;min-height:40px!important}
.timeline-controls .filter-reset-btn{min-height:38px!important;font-size:12px!important}
.timeline{padding-left:30px}
.timeline-item.card{grid-template-columns:150px 1fr;gap:14px;padding:13px;margin-bottom:11px;border-radius:15px}
.timeline-item .anchor-frame{border-radius:12px}
.timeline-item .visual-type,.timeline-item .image-source{display:none}
.timeline-item .year-big{font-size:23px!important}
.timeline-item h2{font-size:21px!important;margin:.25em 0}
.timeline-item .lead{font-size:15px!important;margin:.35em 0}
.timeline-item .chip{font-size:12px;padding:5px 8px}
.century-summary{padding:15px;border-radius:14px}
.century-summary-grid{gap:8px}.century-mini{padding:10px;border-radius:11px;min-height:86px}

/* Events and people */
.events-grid-v17{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.event-card-v17{display:grid;grid-template-columns:130px 1fr;gap:12px;align-items:start;text-align:left;min-height:0}
.event-card-v17 .anchor-frame{border-radius:12px;aspect-ratio:4/3}.event-card-v17 .visual-type,.event-card-v17 .image-source{display:none}
.event-card-v17 h2{font-size:19px!important;margin:.35em 0}.event-card-v17 p{font-size:14px;line-height:1.45;margin:.35em 0}.event-person-line{color:#40545e}
.people-grid-v17{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
.person-card-v17{text-align:left;padding:12px}.person-card-v17 .anchor-frame{border-radius:12px;aspect-ratio:16/10}.person-card-v17 .visual-type,.person-card-v17 .image-source{display:none}
.person-card-v17 h2{font-size:18px!important}.person-card-v17 .chip{font-size:12px}.memory-link-v17{font-size:14px;line-height:1.45;margin:.55em 0 0;color:#4d6069}

/* Event page: prioritize the memory anchor, progressively reveal detail */
.event-layout-v17{grid-template-columns:300px minmax(0,1fr);gap:14px;align-items:start}
.event-aside-v17{position:sticky;top:118px;display:grid;gap:8px}
.event-aside-v17 .anchor-frame{border-radius:14px}.event-aside-v17 .image-source{font-size:12px}
.event-remember{margin:0;padding:11px;border-radius:12px;font-size:14px;line-height:1.5}
.event-main-v17 h1{margin-top:.28em}
.event-anchor-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:13px 0}
.event-anchor-row>div{border:1px solid var(--line);border-radius:12px;padding:10px 11px;background:#fbf8f1}
.event-anchor-row span{display:block;font-size:12px;color:var(--muted);font-weight:700;margin-bottom:3px}.event-anchor-row strong{font-size:15px;line-height:1.35}
.event-story-v17{display:grid;gap:8px;margin:13px 0}
.story-step{display:grid;grid-template-columns:38px 1fr;gap:10px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:#fffdf8}
.story-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:#f0ede6;font-size:18px}
.story-step h2{font-size:17px!important;margin:0 0 3px}.story-step p{font-size:15px;line-height:1.55;margin:0;max-width:62ch}
.event-actions-v17{margin:14px 0 4px}
.event-details-v17{margin-top:9px;border:1px solid var(--line);border-radius:12px;background:#fbf8f1;overflow:hidden}
.event-details-v17 summary{min-height:44px;display:flex;align-items:center;padding:9px 12px;cursor:pointer;font-size:14px;font-weight:700;color:#334a55;list-style:none}
.event-details-v17 summary::-webkit-details-marker{display:none}.event-details-v17 summary::after{content:"＋";margin-left:auto;font-size:17px}.event-details-v17[open] summary::after{content:"−"}
.event-details-v17[open] summary{border-bottom:1px solid var(--line)}
.event-details-v17 .causal,.event-details-v17 .before-after,.event-details-v17 .source-box{margin:10px;padding:0;background:transparent;box-shadow:none;border:0}
.important-facts{padding:11px 12px;border-radius:12px}.important-facts-title{font-size:12px}.important-facts li{font-size:14px;line-height:1.45;margin:6px 0}
.event-person-map{padding:10px;border-radius:12px}.event-person-map-title strong{font-size:14px}.event-person-map-wrap,.event-person-map-svg{min-height:190px}

/* Tests */
.year-test-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.year-test-card{min-height:118px;padding:11px;border-radius:12px}.year-test-card .year{font-size:19px}.year-test-card strong{font-size:14px;line-height:1.35}
.quiz.panel{max-width:820px;margin-inline:auto}.quiz-question{font-size:21px;line-height:1.4;margin:16px 0}.answers{gap:8px}.answer{min-height:50px;padding:10px 12px;font-size:15px;border-radius:11px}
.answer.answer-wrong::after{content:"  ✕";font-weight:900}.answer.answer-correct::after{content:"  ✓";font-weight:900}

/* Map: preserve V16 behavior, make it calmer */
.route-map .section-head h1{font-size:34px!important}.route-map .map-controls{box-shadow:none!important;background:#fbf8f1}.route-map .map-layout{gap:11px}.route-map .place-panel{border-radius:14px}.route-map .map-wrap{border-radius:14px}

/* Tablet */
@media(max-width:1024px){
  .app{width:min(100% - 24px,960px)}
  .home-hero-v17{grid-template-columns:1fr}.home-learn-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .people-grid-v17{grid-template-columns:repeat(2,minmax(0,1fr))}
  .events-grid-v17{grid-template-columns:1fr}
  .event-layout-v17{grid-template-columns:270px minmax(0,1fr)}
  .timeline-controls .century-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .year-test-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* Mobile: bottom nav only; no horizontal page scroll */
@media(max-width:680px){
  html{font-size:16px}
  body{font-size:16px;padding-bottom:78px;overflow-x:hidden}
  .app{width:calc(100% - 20px);margin:12px auto 28px}
  h1{font-size:30px!important}h2{font-size:21px!important}.lead{font-size:16px!important}
  .topbar{padding:7px 10px}.top-nav{display:none!important}.brand small{display:none}.brand-logo{width:40px;height:40px}.top-actions{gap:3px}.tool-btn{min-width:40px;height:40px;padding:0 8px;font-size:14px}
  .bottom-nav{display:grid!important;grid-template-columns:repeat(6,1fr);position:fixed;left:6px;right:6px;bottom:6px;z-index:60;padding:5px;border-radius:14px;background:rgba(255,253,248,.98);border:1px solid var(--line);box-shadow:0 5px 20px rgba(35,51,60,.13)}
  .bottom-nav button{min-width:0;min-height:56px;padding:5px 2px;border:0;background:transparent;border-radius:9px;font-size:10px;line-height:1.15;color:#52646d}.bottom-nav button span{display:block;font-size:18px;margin-bottom:2px}.bottom-nav button.active{background:#e6f0f4;color:#174d68}
  .panel{padding:15px}.card{padding:11px}.section-head{margin:17px 0 9px}
  .home-learn-grid{grid-template-columns:1fr}.main-choice{min-height:76px}.home-test-cta{min-height:62px}.home-legend-bar{gap:5px;padding:8px}.home-legend-bar span{font-size:12px}
  .home-map-wrap,.home-map-svg{min-height:260px}.home-map-head{align-items:flex-start}.home-map-head .secondary{min-height:42px;font-size:13px}
  .timeline-controls .filter-row{grid-template-columns:1fr!important}.timeline-controls .filter-label{padding-top:0!important}.timeline-controls .century-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.timeline-controls .filter-btn{min-height:44px!important;font-size:12px!important}
  .timeline{padding-left:0}.timeline:before,.timeline-dot{display:none}.timeline-item.card{grid-template-columns:96px 1fr;gap:10px;padding:10px}.timeline-item .year-big{font-size:20px!important}.timeline-item h2{font-size:17px!important}.timeline-item .chip-place{display:none}.timeline-item .lead{display:none}
  .events-grid-v17,.people-grid-v17{grid-template-columns:1fr}.event-card-v17{grid-template-columns:96px 1fr}.person-card-v17{display:grid;grid-template-columns:105px 1fr;gap:10px;align-items:start}.person-card-v17 .anchor-frame{aspect-ratio:1}.person-card-v17 h2{margin-top:0}
  .event-layout-v17{grid-template-columns:1fr}.event-aside-v17{position:static}.event-aside-v17>.anchor-frame{max-height:250px}.event-anchor-row{grid-template-columns:1fr}.event-person-map-wrap,.event-person-map-svg{min-height:170px}
  .causal{grid-template-columns:1fr!important}.causal .arrow{transform:rotate(90deg)}.before-after{grid-template-columns:1fr!important}
  .year-test-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.year-test-card{min-height:108px}.year-test-card strong{font-size:13px}
  .quiz-question{font-size:19px}.answer{min-height:52px}
  .route-map .map-layout{grid-template-columns:1fr}.route-map .map-wrap{min-height:360px}.route-map .map-control-row{grid-template-columns:1fr!important}.route-map .map-mode-btn,.route-map .map-filter-btn{min-height:44px!important;font-size:12px!important}
}
@media(max-width:390px){
  .year-test-grid{grid-template-columns:1fr}
  .timeline-item.card{grid-template-columns:82px 1fr}
  .event-card-v17{grid-template-columns:84px 1fr}
  .person-card-v17{grid-template-columns:92px 1fr}
}


/* V17 final responsive/touch corrections */
.timeline-controls .filter-btn{min-height:44px!important}
.route-map .map-mode-btn,
.route-map .map-filter-btn,
.route-map .filter-reset-btn,
.route-map .map-year-link{min-height:44px!important}
@media(max-width:680px){
  .bottom-nav{
    left:6px!important;
    right:6px!important;
    width:auto!important;
    transform:none!important;
  }
  .route-map .map-control-scroll{
    display:flex!important;
    flex-wrap:wrap!important;
    overflow:visible!important;
    white-space:normal!important;
  }
  .route-map .map-mode-btn,
  .route-map .map-filter-btn{
    flex:0 0 auto;
  }
}


/* =========================================================
   V18 — събития, навигация, статуси
   ========================================================= */
.story-step{
  grid-template-columns:30px minmax(0,1fr)!important;
  gap:8px!important;
  padding:9px 10px!important;
}
.story-icon{
  width:29px!important;
  height:29px!important;
  border-radius:8px!important;
  font-size:14px!important;
}
.story-step h2{
  font-size:14px!important;
  line-height:1.3!important;
  margin:0 0 3px!important;
  font-weight:800!important;
}
.story-step p{
  font-size:14px!important;
  line-height:1.5!important;
}
.events-grid-v17{
  grid-template-columns:repeat(auto-fit,minmax(390px,1fr))!important;
  gap:12px!important;
}
.event-card-v17{
  grid-template-columns:112px minmax(0,1fr)!important;
  gap:12px!important;
  align-items:center!important;
  min-height:118px!important;
  padding:11px!important;
  overflow:hidden!important;
}
.event-card-v17>div:first-child{
  min-width:0!important;
  width:100%!important;
}
.event-card-v17 .anchor-frame{
  width:100%!important;
  height:92px!important;
  min-height:92px!important;
  aspect-ratio:auto!important;
  border-radius:10px!important;
  overflow:hidden!important;
}
.event-card-v17 .anchor-frame img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}
.event-card-v17 .anchor-fallback{
  width:100%!important;
  height:92px!important;
  min-height:92px!important;
  padding:6px!important;
}
.event-card-v17 .anchor-fallback .big{font-size:17px!important}
.event-card-v17 .anchor-fallback .word{
  font-size:11px!important;
  line-height:1.2!important;
  text-align:center!important;
}
.event-card-v17 .event-card-copy{
  min-width:0!important;
  overflow-wrap:anywhere!important;
}
.event-card-v17 h2{
  font-size:17px!important;
  line-height:1.3!important;
  margin:.3em 0!important;
}
.event-card-v17 p{
  font-size:13px!important;
  line-height:1.4!important;
  margin:.25em 0!important;
}
.event-card-v17 .chip{
  font-size:11px!important;
  padding:4px 7px!important;
}
.top-nav button.active,
.bottom-nav button.active{
  border-color:#2d6f8b!important;
  background:#dcecf4!important;
  color:#174d68!important;
  font-weight:800!important;
}
@media(max-width:700px){
  .events-grid-v17{grid-template-columns:1fr!important}
  .event-card-v17{
    grid-template-columns:88px minmax(0,1fr)!important;
    min-height:104px!important;
    padding:9px!important;
    gap:10px!important;
  }
  .event-card-v17 .anchor-frame,
  .event-card-v17 .anchor-fallback{
    height:78px!important;
    min-height:78px!important;
  }
  .event-card-v17 h2{font-size:16px!important}
}


/* =========================================================
   V19 FINAL QA — centered header navigation
   ========================================================= */
.topbar-main{
  position:relative!important;
  display:flex!important;
  justify-content:space-between!important;
  align-items:center!important;
  width:100%;
  min-height:54px;
}
.brand{flex:0 1 auto!important;z-index:2}
.top-nav{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  transform:translate(-50%,-50%)!important;
  display:flex!important;
  justify-content:center!important;
  flex-wrap:nowrap!important;
  padding-top:0!important;
  margin:0!important;
  z-index:1;
}
.top-actions{flex:0 0 auto!important;z-index:2}
@media(max-width:1100px) and (min-width:761px){
  .brand small{display:none!important}
  .brand strong{font-size:14px!important}
  .brand-logo{width:44px!important;height:44px!important}
  .brand-logo svg{width:37px!important;height:27px!important}
  .top-nav{gap:2px!important}
  .top-nav button{padding:6px 6px!important;font-size:11px!important;min-height:38px!important}
  .top-actions{gap:4px!important}
  .tool-btn{min-width:36px!important;min-height:36px!important;padding:0 8px!important}
}
@media(max-width:760px){
  .topbar-main{display:flex!important;justify-content:space-between!important}
  .top-nav{display:none!important}
}


/* Final child-UX fix for event detail */
.event-back-top{
  margin:0 0 10px!important;
}
@media(max-width:760px){
  .event-layout-v17{
    display:flex!important;
    flex-direction:column!important;
  }
  .event-main-v17{order:1!important}
  .event-aside-v17{order:2!important}
  .event-aside-v17 .anchor-frame{
    max-height:220px!important;
  }
  .event-aside-v17 .anchor-frame img{
    max-height:220px!important;
    object-fit:cover!important;
  }
}


/* =========================================================
   V20 — clearer links, person map, Bulgaria contour, timeline
   ========================================================= */

/* The 3 event labels are intentionally small */
.story-step h2{display:none!important}
.story-label{
  font-size:12px!important;
  line-height:1.2!important;
  font-weight:800!important;
  letter-spacing:.04em!important;
  text-transform:uppercase!important;
  color:#52636c!important;
  margin:1px 0 4px!important;
}
.story-step p{
  margin:0!important;
  font-size:14px!important;
  line-height:1.5!important;
}

/* Wikimedia Bulgaria provinces map as a visual base */
.bulgaria-base-map{
  pointer-events:none;
  opacity:.92;
}
.map-fallback-shape{
  fill:#f7f0df!important;
}
.map-source-note{
  margin-top:5px;
  font-size:10px;
  color:#748087;
  text-align:right;
}

/* Related events clearly look clickable */
.related-events-title{
  margin-bottom:3px!important;
}
.related-events-help{
  margin:0 0 8px!important;
  font-size:13px!important;
  color:var(--muted);
}
.related-events-list{
  display:grid;
  gap:8px;
}
.related-event-link{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  width:100%;
  min-height:50px;
  padding:9px 11px;
  border:2px solid #b7cdd7;
  border-radius:12px;
  background:#f3f9fb;
  color:var(--ink);
  text-align:left;
  cursor:pointer;
  font:inherit;
  box-shadow:0 2px 5px rgba(37,74,89,.06);
}
.related-event-link:hover,
.related-event-link:focus{
  border-color:#2d6f8b;
  background:#e7f3f8;
  outline:none;
}
.related-event-year{
  padding:4px 7px;
  border-radius:8px;
  background:#fff;
  color:#174d68;
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
}
.related-event-name{
  font-size:14px;
  font-weight:800;
  line-height:1.3;
}
.related-event-action{
  font-size:12px;
  font-weight:800;
  color:#2d6f8b;
  white-space:nowrap;
}

/* Person detail map */
.person-detail-map{
  margin-top:14px;
  padding:10px;
  border:1.5px solid #cbd8cf;
  border-radius:14px;
  background:#f7faf7;
}
.person-map-head{
  display:grid;
  gap:3px;
  margin-bottom:8px;
}
.person-map-head span{
  font-size:11px;
  font-weight:800;
  color:#527060;
  letter-spacing:.04em;
}
.person-map-head strong{
  font-size:13px;
  line-height:1.4;
}
.person-map-wrap{
  border:1px solid #d4ddd6;
  border-radius:11px;
  overflow:hidden;
  background:#f2ead6;
}
.person-map-svg{
  width:100%;
  display:block;
  aspect-ratio:900/570;
}
.person-map-pin{cursor:pointer}
.person-map-pin .map-hit{fill:transparent;pointer-events:all}
.person-map-dot{
  fill:#a55434;
  stroke:#fff;
  stroke-width:5;
}
.person-map-pin text{
  font-size:15px;
  font-weight:800;
  fill:#243840;
  paint-order:stroke;
  stroke:#fff;
  stroke-width:5px;
  pointer-events:none;
}
.person-map-outside{
  padding:10px;
  border-radius:10px;
  background:#fff8ed;
  font-size:13px;
  line-height:1.45;
}

/* Obvious vertical timeline */
.vertical-timeline-v20{
  position:relative;
  display:grid;
  gap:0;
  margin:18px 0 28px;
}
.vt-row{
  display:grid;
  grid-template-columns:120px 34px minmax(0,1fr);
  gap:12px;
  align-items:stretch;
  min-height:118px;
}
.vt-year{
  padding-top:12px;
  text-align:right;
  font-size:18px;
  font-weight:900;
  color:#8b4c2f;
}
.vt-axis{
  position:relative;
  display:flex;
  justify-content:center;
}
.vt-dot{
  position:relative;
  z-index:2;
  width:16px;
  height:16px;
  margin-top:16px;
  border-radius:50%;
  background:#2d6f8b;
  border:4px solid #e6f0f4;
  box-shadow:0 0 0 2px #2d6f8b;
}
.vt-line{
  position:absolute;
  top:31px;
  bottom:-1px;
  width:3px;
  background:#aac7d4;
}
.vt-card{
  margin-bottom:12px;
  padding:11px 13px;
  border:1.5px solid #d3d9d7;
  border-radius:13px;
  background:#fffdf9;
}
.vt-card h2{
  margin:0 0 5px!important;
  font-size:17px!important;
  line-height:1.3!important;
}
.vt-card p{
  margin:6px 0 8px!important;
  font-size:13px!important;
  line-height:1.45!important;
}
.vt-meta{
  display:flex;
  flex-wrap:wrap;
  gap:5px 12px;
  color:#5b6970;
  font-size:12px;
}
.vt-more{
  min-height:40px;
  padding:7px 11px;
  border:0;
  border-radius:9px;
  background:#2d6f8b;
  color:white;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
}
.vt-more:hover,.vt-more:focus{
  background:#174d68;
  outline:3px solid rgba(45,111,139,.15);
}

/* Top nav can fit the longer timeline label */
.top-nav button[data-route="timeline"]{
  white-space:nowrap;
}

@media(max-width:760px){
  .related-event-link{
    grid-template-columns:1fr auto;
  }
  .related-event-year{
    grid-column:1;
  }
  .related-event-name{
    grid-column:1;
  }
  .related-event-action{
    grid-column:2;
    grid-row:1 / span 2;
    align-self:center;
  }

  .vt-row{
    grid-template-columns:24px minmax(0,1fr);
    gap:9px;
    min-height:120px;
  }
  .vt-year{
    grid-column:2;
    grid-row:1;
    text-align:left;
    padding:5px 0 0;
    font-size:16px;
  }
  .vt-axis{
    grid-column:1;
    grid-row:1 / span 2;
  }
  .vt-dot{
    margin-top:10px;
    width:14px;
    height:14px;
  }
  .vt-line{
    top:25px;
    bottom:-1px;
  }
  .vt-card{
    grid-column:2;
    grid-row:2;
    margin-bottom:10px;
  }
  .bottom-nav button[data-route="timeline"]{
    font-size:8.5px!important;
  }
}


/* =========================================================
   V21 — all verified map locations + timeline images
   ========================================================= */
.home-map-card-v21 .home-map-wrap{
  background:#f7f1e6!important;
}
.home-map-svg-v21{
  width:100%;
  min-height:430px;
}
.home-map-svg-v21 .bulgaria-base-map{
  opacity:.96;
}
.home-map-svg-v21 .home-map-pin text{
  font-size:12.5px!important;
  font-weight:800!important;
  fill:#243840!important;
  paint-order:stroke;
  stroke:#fff;
  stroke-width:4px;
  stroke-linejoin:round;
  pointer-events:none;
}
.home-map-svg-v21 .home-map-dot{
  fill:#a55434!important;
  stroke:white!important;
  stroke-width:4px!important;
}
.home-map-location-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:9px;
}
.home-map-location-list button{
  min-height:36px;
  padding:5px 8px;
  border:1px solid #cbd7d2;
  border-radius:9px;
  background:white;
  color:#36484f;
  font:inherit;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}
.home-map-location-list button:hover,
.home-map-location-list button:focus{
  border-color:#2d6f8b;
  background:#eef7fa;
  outline:none;
}
.map-pin-label{
  font-size:12.5px!important;
  paint-order:stroke;
  stroke:#fff;
  stroke-width:4px!important;
  stroke-linejoin:round;
}

/* Timeline: each event now has a visual anchor */
.vt-card-with-image{
  display:grid!important;
  grid-template-columns:112px minmax(0,1fr)!important;
  gap:12px!important;
  align-items:start!important;
}
.vt-thumb{
  width:112px;
  height:86px;
  overflow:hidden;
  border-radius:10px;
  background:#edf2ef;
  border:1px solid #d6ded9;
}
.vt-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.vt-card-body{
  min-width:0;
}
@media(max-width:760px){
  .home-map-svg-v21{
    min-height:300px;
  }
  .home-map-svg-v21 .home-map-pin text{
    font-size:10px!important;
    stroke-width:3px!important;
  }
  .home-map-location-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .home-map-location-list button{
    width:100%;
    text-align:left;
    min-height:40px;
    font-size:10.5px;
  }
  .vt-card-with-image{
    grid-template-columns:82px minmax(0,1fr)!important;
    gap:9px!important;
  }
  .vt-thumb{
    width:82px;
    height:68px;
  }
}


/* =========================================================
   V22 — always-visible fixed bottom navigation
   ========================================================= */
body{
  padding-bottom:94px!important;
}
.bottom-nav{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  bottom:8px!important;
  transform:translateX(-50%)!important;
  width:min(calc(100% - 16px),820px)!important;
  z-index:120!important;
  padding:6px!important;
  border:1px solid #c9d3cf!important;
  border-radius:16px!important;
  background:rgba(255,253,248,.97)!important;
  box-shadow:0 8px 28px rgba(35,51,60,.16)!important;
  backdrop-filter:blur(10px);
}
.bottom-nav button{
  min-width:0!important;
  min-height:56px!important;
  padding:5px 4px!important;
  border:0!important;
  border-radius:10px!important;
  background:transparent!important;
  color:#52646d!important;
  font-size:11px!important;
  line-height:1.15!important;
}
.bottom-nav button span{
  display:block!important;
  font-size:19px!important;
  margin-bottom:2px!important;
}
.bottom-nav button.active{
  background:#e3f0f5!important;
  color:#174d68!important;
  font-weight:800!important;
}
@media(max-width:760px){
  body{padding-bottom:88px!important}
  .bottom-nav{
    bottom:5px!important;
    width:calc(100% - 10px)!important;
    padding:4px!important;
    border-radius:14px!important;
  }
  .bottom-nav button{
    min-height:54px!important;
    padding:4px 1px!important;
    font-size:9.5px!important;
  }
  .bottom-nav button span{
    font-size:18px!important;
  }
  .bottom-nav button[data-route="timeline"]{
    font-size:8.2px!important;
  }
}


/* =========================================================
   V22 — era separators, linked years, linked people
   ========================================================= */

/* Era separators */
.timeline-era-divider{
  display:grid;
  grid-template-columns:minmax(20px,1fr) auto minmax(20px,1fr);
  gap:12px;
  align-items:center;
  margin:18px 0 12px;
  padding:0 4px;
}
.timeline-era-divider .era-line{
  height:2px;
  background:#c9d5d1;
}
.timeline-era-divider>div{
  display:grid;
  gap:2px;
  text-align:center;
  min-width:210px;
}
.timeline-era-divider strong{
  font-size:15px;
  line-height:1.2;
  letter-spacing:.03em;
}
.timeline-era-divider small{
  font-size:11px;
  line-height:1.35;
  color:#68767d;
}
.timeline-era-divider.medieval strong{color:#7a5733}
.timeline-era-divider.revival strong{color:#8a4d38}
.timeline-era-divider.modern strong{color:#2c667f}

/* All linked years highlighted at the same time */
.place-linked-years{
  margin:7px 0 11px;
  padding:9px 10px;
  border:1.5px solid #c3d7df;
  border-radius:12px;
  background:#eef7fa;
}
.place-years-label{
  display:block;
  margin-bottom:6px;
  color:#45606b;
  font-size:11px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.place-years-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.place-years-list button{
  min-height:38px;
  padding:6px 9px;
  border:2px solid #2d6f8b;
  border-radius:9px;
  background:white;
  color:#174d68;
  font:inherit;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}
.place-years-list button:hover,
.place-years-list button:focus{
  background:#dcecf4;
  outline:none;
}

/* Related personality card inside an event */
.event-related-people{
  margin:12px 0;
  padding:10px;
  border:1px solid #d6d0c5;
  border-radius:14px;
  background:#fbf8f1;
}
.event-related-people-label{
  margin-bottom:7px;
  color:#66594d;
  font-size:11px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.event-related-people-grid{
  display:grid;
  gap:8px;
}
.event-person-card{
  display:grid;
  grid-template-columns:72px minmax(0,1fr);
  gap:10px;
  align-items:center;
  padding:8px;
  border:1px solid #ddd6ca;
  border-radius:11px;
  background:white;
}
.event-person-card img{
  width:72px;
  height:72px;
  object-fit:cover;
  border-radius:9px;
  background:#edf2ef;
}
.event-person-card-body{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:3px 8px;
  align-items:center;
  min-width:0;
}
.event-person-card-body strong{
  grid-column:1;
  font-size:14px;
  line-height:1.25;
}
.event-person-card-body span{
  grid-column:1;
  font-size:12px;
  line-height:1.4;
  color:#657179;
}
.event-person-card-body button{
  grid-column:2;
  grid-row:1 / span 2;
  min-height:40px;
  padding:6px 9px;
  border:1.5px solid #2d6f8b;
  border-radius:9px;
  background:#eef7fa;
  color:#174d68;
  font:inherit;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.event-person-card-body button:hover,
.event-person-card-body button:focus{
  background:#dcecf4;
  outline:none;
}

@media(max-width:760px){
  .timeline-era-divider{
    grid-template-columns:20px minmax(0,1fr);
    gap:8px;
    margin:15px 0 9px;
  }
  .timeline-era-divider .era-line:first-child{
    display:none;
  }
  .timeline-era-divider .era-line:last-child{
    grid-column:1;
    width:3px;
    height:100%;
    justify-self:center;
    background:#c9d5d1;
  }
  .timeline-era-divider>div{
    grid-column:2;
    grid-row:1;
    min-width:0;
    text-align:left;
  }
  .timeline-era-divider strong{font-size:14px}
  .timeline-era-divider small{font-size:10.5px}

  .event-person-card{
    grid-template-columns:58px minmax(0,1fr);
  }
  .event-person-card img{
    width:58px;
    height:58px;
  }
  .event-person-card-body{
    grid-template-columns:1fr;
  }
  .event-person-card-body strong,
  .event-person-card-body span,
  .event-person-card-body button{
    grid-column:1;
    grid-row:auto;
  }
  .event-person-card-body button{
    justify-self:start;
    min-height:38px;
    margin-top:3px;
  }
}


/* =========================================================
   V23 — map centuries: exactly 2 rows, no scroll
   ========================================================= */
.route-map .map-century-grid{
  display:grid!important;
  grid-template-columns:repeat(var(--map-century-cols),minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(42px,auto))!important;
  grid-auto-flow:row!important;
  gap:5px!important;
  overflow:visible!important;
  white-space:normal!important;
  padding:0!important;
  width:100%!important;
}
.route-map .map-century-grid .map-filter-btn{
  width:100%!important;
  min-width:0!important;
  min-height:42px!important;
  padding:4px 3px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:1px!important;
  text-align:center!important;
}
.map-century-name{
  display:block;
  font-size:10.5px!important;
  font-weight:800!important;
  line-height:1.1!important;
}
.map-century-range{
  display:block;
  font-size:8.5px!important;
  font-weight:600!important;
  line-height:1.1!important;
  opacity:.78;
}
.map-open-event-cta{
  min-height:44px;
  padding:9px 14px;
  border:2px solid #3f7650;
  border-radius:10px;
  background:#e2f1e5;
  color:#245735;
  font:inherit;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 2px 7px rgba(53,101,68,.10);
}
.map-open-event-cta:hover,
.map-open-event-cta:focus{
  background:#cfe7d4;
  border-color:#2f6440;
  color:#183f27;
  outline:3px solid rgba(63,118,80,.18);
  outline-offset:2px;
}
@media(max-width:760px){
  .route-map .map-century-row{
    grid-template-columns:1fr!important;
  }
  .route-map .map-century-grid{
    gap:3px!important;
  }
  .route-map .map-century-grid .map-filter-btn{
    min-height:46px!important;
    padding:3px 1px!important;
    border-radius:7px!important;
  }
  .map-century-name{font-size:9px!important}
  .map-century-range{font-size:7.5px!important}
}


/* =========================================================
   V24 — explicit CTAs, large maps, readable centuries, image reliability
   ========================================================= */
.home-map-svg-v21 .home-map-dot{
  fill:#3f7b50!important;
  stroke:#fff!important;
  stroke-width:4px!important;
  transition:fill .15s ease,transform .15s ease;
  transform-box:fill-box;
  transform-origin:center;
}
.home-map-svg-v21 .home-map-pin:hover .home-map-dot,
.home-map-svg-v21 .home-map-pin:focus .home-map-dot{
  fill:#b13f32!important;
  transform:scale(1.25);
}
.home-map-svg-v21 .home-map-pin{
  cursor:pointer!important;
  outline:none;
}
.green-learn-btn{
  min-height:42px;
  padding:8px 12px;
  border:2px solid #3f7650;
  border-radius:9px;
  background:#e1f1e5;
  color:#215634;
  font:inherit;
  font-size:12px;
  line-height:1.2;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 2px 6px rgba(44,92,57,.10);
}
.green-learn-btn:hover,
.green-learn-btn:focus{
  background:#cce6d2;
  border-color:#2f6540;
  color:#173f27;
  outline:3px solid rgba(63,118,80,.16);
  outline-offset:2px;
}
.list-learn-btn{
  margin-top:8px;
  justify-self:start;
}
.event-card-v17,
.person-card-v17{
  cursor:default!important;
}
.event-card-v17:hover,
.person-card-v17:hover{
  transform:none!important;
}
.map-related-events{
  display:grid;
  gap:9px;
}
.map-memory-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:10px;
  border:1.5px solid #cfd8d3;
  border-radius:11px;
  background:#fff;
}
.map-memory-copy{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:0;
}
.map-memory-copy .mini-year{
  flex:0 0 auto;
  padding:5px 7px;
  border-radius:8px;
  background:#eef7fa;
  color:#174d68;
  font-size:12px;
  font-weight:900;
}
.map-century-name{
  font-size:13px!important;
  line-height:1.15!important;
}
.map-century-range{
  font-size:10.5px!important;
  line-height:1.15!important;
}
.route-map .map-century-grid .map-filter-btn{
  min-height:52px!important;
  padding:5px 4px!important;
}
.event-large-map{
  margin:14px 0;
}
.event-large-map .event-person-map{
  padding:12px!important;
  border:1.5px solid #cbd8cf;
  border-radius:14px;
  background:#f7faf7;
}
.event-large-map .event-person-map-wrap{
  min-height:330px!important;
}
.event-large-map .event-person-map-svg{
  width:100%!important;
  min-height:330px!important;
  max-height:440px!important;
  display:block!important;
}
.event-large-map .event-person-map-title{
  margin-bottom:9px!important;
}
.event-large-map .event-person-map-title strong{
  font-size:14px!important;
  line-height:1.4!important;
}
.event-map-outside .outside-location-note{
  margin-top:9px;
  padding:10px;
  border-radius:10px;
  background:#fff6e8;
  color:#66543f;
  font-size:13px;
  line-height:1.45;
}
.person-detail-map{
  margin-top:16px!important;
  padding:12px!important;
}
.person-map-wrap{
  min-height:300px!important;
}
.person-map-svg{
  min-height:300px!important;
  max-height:430px!important;
}
.person-map-pin text{
  font-size:14px!important;
}
.anchor-frame img,
.vt-thumb img,
.event-person-card img{
  object-position:center center;
}
@media(max-width:760px){
  .map-century-name{font-size:11px!important}
  .map-century-range{font-size:8.8px!important}
  .route-map .map-century-grid .map-filter-btn{min-height:50px!important}
  .map-memory-card{grid-template-columns:1fr}
  .map-memory-card .green-learn-btn{justify-self:start}
  .event-large-map .event-person-map-wrap,
  .event-large-map .event-person-map-svg{min-height:230px!important}
  .person-map-wrap,
  .person-map-svg{min-height:230px!important}
}


/* =========================================================
   V25 — whole learning cards are clickable
   ========================================================= */
.clickable-learning-card{
  cursor:pointer!important;
  transition:border-color .15s ease,background .15s ease,box-shadow .15s ease,transform .15s ease!important;
}
.clickable-learning-card:hover,
.clickable-learning-card:focus{
  border-color:#5f9270!important;
  background:#fbfefb!important;
  box-shadow:0 5px 16px rgba(45,96,62,.12)!important;
  outline:3px solid rgba(63,118,80,.14)!important;
  outline-offset:2px!important;
}
.clickable-learning-card:hover .green-learn-cue,
.clickable-learning-card:focus .green-learn-cue{
  background:#cce6d2!important;
  border-color:#2f6540!important;
  color:#173f27!important;
}

.green-learn-cue{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:6px 10px;
  border:2px solid #3f7650;
  border-radius:9px;
  background:#e1f1e5;
  color:#215634;
  font-size:11.5px;
  line-height:1.15;
  font-weight:900;
  white-space:nowrap;
}
.list-learn-cue{
  margin-top:8px;
  justify-self:start;
}

/* Map related event card: text first, cue clearly below/right */
.map-memory-card{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:10px!important;
  align-items:center!important;
}
.map-memory-copy{
  min-width:0!important;
}
.map-memory-text{
  display:grid;
  gap:2px;
  min-width:0;
}
.map-memory-text strong{
  font-size:13px;
  line-height:1.3;
}
.map-memory-text .small{
  display:block;
  line-height:1.35;
}
.map-memory-card .green-learn-cue{
  align-self:center;
}

/* Restore clear clickable behavior to event/person cards */
.event-card-v17.clickable-learning-card,
.person-card-v17.clickable-learning-card{
  cursor:pointer!important;
}
.event-card-v17.clickable-learning-card:hover,
.person-card-v17.clickable-learning-card:hover{
  transform:translateY(-1px)!important;
}

@media(max-width:760px){
  .map-memory-card{
    grid-template-columns:1fr!important;
  }
  .map-memory-card .green-learn-cue{
    justify-self:start!important;
    margin-top:2px;
  }
}


/* =========================================================
   V26 — related events live below the map
   ========================================================= */
.map-related-wide{
  margin-top:14px;
  padding:14px;
  border:1.5px solid #cbd8d1;
  border-radius:15px;
  background:#f8fbf8;
}
.map-related-wide-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:10px;
}
.map-related-wide-head h2{
  margin:2px 0 0!important;
  font-size:18px!important;
  line-height:1.25!important;
}
.map-related-place-name{
  flex:0 0 auto;
  color:#3f6d4d;
  font-size:13px;
}
.map-related-wide-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.map-related-wide-card{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:11px;
  align-items:center;
  min-height:78px;
  padding:11px 12px;
  border:1.5px solid #cfd8d3;
  border-radius:12px;
  background:white;
}
.map-related-year{
  padding:6px 8px;
  border-radius:9px;
  background:#eef7fa;
  color:#174d68;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
}
.map-related-main{
  display:grid;
  gap:3px;
  min-width:0;
}
.map-related-main strong{
  font-size:14px;
  line-height:1.25;
  color:#25373f;
}
.map-related-main span{
  font-size:12.5px;
  line-height:1.35;
  color:#637078;
}
.map-related-wide-card .green-learn-cue{
  align-self:center;
}
@media(max-width:900px){
  .map-related-wide-list{
    grid-template-columns:1fr;
  }
}
@media(max-width:600px){
  .map-related-wide{
    padding:11px;
  }
  .map-related-wide-head{
    display:grid;
    gap:4px;
    align-items:start;
  }
  .map-related-place-name{
    font-size:12px;
  }
  .map-related-wide-card{
    grid-template-columns:auto minmax(0,1fr);
    gap:8px 10px;
  }
  .map-related-wide-card .green-learn-cue{
    grid-column:1 / -1;
    justify-self:start;
    margin-left:0;
  }
}


/* =========================================================
   V28 — map focus, collapsible filters, Bulgarian TTS UX
   ========================================================= */
.map-filter-stack{
  display:grid;
  gap:6px;
  min-width:0;
}
.filter-expand-toggle{
  justify-self:start;
  min-height:38px;
  padding:6px 10px;
  border:1.5px solid #8fa99a;
  border-radius:9px;
  background:#f1f7f2;
  color:#315e40;
  font:inherit;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.filter-expand-toggle:hover,
.filter-expand-toggle:focus{
  background:#dfeee2;
  border-color:#4f7f5e;
  outline:none;
}
.map-collapsible-grid{
  transition:max-height .18s ease;
}
.map-collapsible-grid.collapsed{
  max-height:58px!important;
  overflow:hidden!important;
}
.map-collapsible-grid.expanded{
  max-height:none!important;
  overflow:visible!important;
}
.map-collapsible-list.collapsed{
  max-height:54px!important;
  overflow:hidden!important;
}
.map-collapsible-list.expanded{
  max-height:340px!important;
  overflow:auto!important;
}
.map-single-place-note{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  align-items:center;
  margin-top:9px;
  padding:9px 11px;
  border:1.5px solid #b9d0bf;
  border-radius:11px;
  background:#f0f8f2;
  color:#355a40;
  font-size:13px;
}

/* Always keep city names readable on mobile and desktop */
.route-map .map-pin-label,
.route-map .map-pin text,
.home-map-svg-v21 .home-map-pin text{
  fill:#17262d!important;
}
@media(max-width:760px){
  .route-map .map-pin-label,
  .route-map .map-pin text,
  .home-map-svg-v21 .home-map-pin text{
    fill:#111!important;
    stroke:#fff!important;
    stroke-width:3px!important;
    font-weight:900!important;
  }
  .route-map .map-century-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:none!important;
  }
  .map-collapsible-grid.collapsed{
    max-height:54px!important;
  }
}

/* Events / People filters reuse timeline visual language */
.collection-filter-panel{
  margin-bottom:14px;
}
.collection-filter-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:6px!important;
  overflow:visible!important;
}
.collection-filter-grid.years{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
}
.collection-filter-grid .filter-btn{
  width:100%;
  min-width:0;
  white-space:normal;
  text-align:center;
}
@media(max-width:1024px){
  .collection-filter-grid,
  .collection-filter-grid.years{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
@media(max-width:680px){
  .collection-filter-grid,
  .collection-filter-grid.years{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}


/* =========================================================
   V30 — filter affordance + mobile style lock
   ========================================================= */
.filter-stack-v30{
  display:grid;
  gap:6px;
  min-width:0;
}
.filter-collapsible-grid.collapsed{
  max-height:54px!important;
  overflow:hidden!important;
}
.filter-collapsible-grid.expanded{
  max-height:none!important;
  overflow:visible!important;
}

/* "Покажи всички" must be visually different from green location CTA */
.filter-expand-toggle.show-all-filter{
  background:#fbe5e2!important;
  border-color:#b84a3d!important;
  color:#8e2f25!important;
  -webkit-text-fill-color:#8e2f25!important;
}
.filter-expand-toggle.show-all-filter:hover,
.filter-expand-toggle.show-all-filter:focus{
  background:#f4cbc5!important;
  border-color:#96372d!important;
  color:#70241d!important;
  -webkit-text-fill-color:#70241d!important;
}
.filter-expand-toggle.hide-filter{
  background:#f2f4f3!important;
  border-color:#9aa9a1!important;
  color:#45544c!important;
  -webkit-text-fill-color:#45544c!important;
}
.filter-expand-toggle.hide-filter:hover,
.filter-expand-toggle.hide-filter:focus{
  background:#e4e8e6!important;
  border-color:#7e8f86!important;
  color:#2f4037!important;
  -webkit-text-fill-color:#2f4037!important;
}
.map-single-place-note .green-learn-btn{
  background:#e1f1e5!important;
  border-color:#3f7650!important;
  color:#215634!important;
  -webkit-text-fill-color:#215634!important;
}

/* Timeline / Events / People filter grids */
.timeline-filter-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:6px!important;
  overflow:visible!important;
}
.century-filter-grid.filter-collapsible-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:6px!important;
}
.collection-filter-grid.filter-collapsible-grid{
  overflow:hidden!important;
}
.collection-filter-grid.filter-collapsible-grid.expanded{
  overflow:visible!important;
}

/* Force key UI colors to survive iOS / Android browser defaults */
.filter-btn,
.filter-expand-toggle,
.green-learn-btn,
.green-learn-cue,
.map-filter-btn,
.vt-more,
.bottom-nav button{
  -webkit-appearance:none;
  appearance:none;
}
.filter-btn{
  color:#34484f!important;
  -webkit-text-fill-color:#34484f!important;
  background:#fff!important;
}
.filter-btn.active{
  color:#174d68!important;
  -webkit-text-fill-color:#174d68!important;
  background:#e3f0f5!important;
  border-color:#6e9caf!important;
}
.map-filter-btn{
  color:#34484f!important;
  -webkit-text-fill-color:#34484f!important;
}
.map-filter-btn.active{
  color:#174d68!important;
  -webkit-text-fill-color:#174d68!important;
}
.green-learn-btn,
.green-learn-cue{
  color:#215634!important;
  -webkit-text-fill-color:#215634!important;
}
.vt-more{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  background:#2d6f8b!important;
}

/* Labels on all maps remain black on mobile */
.route-map .map-pin-label,
.route-map .map-pin text,
.home-map-svg-v21 .home-map-pin text,
.person-map-pin text,
.event-person-map-svg text{
  fill:#111!important;
}

@media(max-width:760px){
  .timeline-filter-grid,
  .century-filter-grid.filter-collapsible-grid,
  .collection-filter-grid,
  .collection-filter-grid.years{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .filter-collapsible-grid.collapsed{
    max-height:52px!important;
  }
  .filter-btn,
  .map-filter-btn{
    color:#25373f!important;
    -webkit-text-fill-color:#25373f!important;
    background:#fff!important;
  }
  .filter-btn.active,
  .map-filter-btn.active{
    color:#174d68!important;
    -webkit-text-fill-color:#174d68!important;
    background:#e3f0f5!important;
  }
  .filter-expand-toggle.show-all-filter{
    color:#8e2f25!important;
    -webkit-text-fill-color:#8e2f25!important;
    background:#fbe5e2!important;
  }
  .filter-expand-toggle.hide-filter{
    color:#45544c!important;
    -webkit-text-fill-color:#45544c!important;
    background:#f2f4f3!important;
  }
  .map-single-place-note .green-learn-btn,
  .green-learn-btn,
  .green-learn-cue{
    color:#215634!important;
    -webkit-text-fill-color:#215634!important;
    background:#e1f1e5!important;
  }
}


/* =========================================================
   V31 — listening in events/persons + fixed visual anchors
   ========================================================= */
.listen-btn{
  min-height:44px;
  padding:9px 13px;
  border:2px solid #527f9a;
  border-radius:10px;
  background:#e7f2f8;
  color:#204f69;
  -webkit-text-fill-color:#204f69;
  font:inherit;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 2px 7px rgba(45,91,116,.09);
  -webkit-appearance:none;
  appearance:none;
}
.listen-btn:hover,
.listen-btn:focus{
  background:#d3e8f2;
  border-color:#376a86;
  color:#173e55;
  -webkit-text-fill-color:#173e55;
  outline:3px solid rgba(82,127,154,.16);
  outline-offset:2px;
}
body.is-speaking .listen-btn{
  border-color:#a95749;
  background:#fae8e5;
  color:#87372d;
  -webkit-text-fill-color:#87372d;
}
.person-listen-row{
  margin:10px 0 4px;
}
@media(max-width:760px){
  .listen-btn{
    width:100%;
    min-height:46px;
    color:#204f69!important;
    -webkit-text-fill-color:#204f69!important;
    background:#e7f2f8!important;
  }
  body.is-speaking .listen-btn{
    color:#87372d!important;
    -webkit-text-fill-color:#87372d!important;
    background:#fae8e5!important;
  }
}


/* =========================================================
   V32 — search, century review, map listening
   ========================================================= */
.sr-only{
  position:absolute!important;
  width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;
  overflow:hidden!important;clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;border:0!important;
}
.home-search-panel{
  margin:16px 0;
  padding:16px;
  border:1.5px solid #cbd8d1;
  border-radius:16px;
  background:#f8fbf8;
}
.home-search-head h2{
  margin:3px 0 5px!important;
  font-size:20px!important;
}
.home-search-head p{
  margin:0 0 12px;
  color:#617077;
}
.home-search-box{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:8px;
  align-items:center;
  min-height:50px;
  padding:0 13px;
  border:2px solid #98b6a3;
  border-radius:12px;
  background:#fff;
}
.home-search-box:focus-within{
  border-color:#49785a;
  outline:3px solid rgba(73,120,90,.13);
}
.home-search-icon{font-size:18px}
.home-search-box input{
  width:100%;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  color:#1e3036!important;
  -webkit-text-fill-color:#1e3036!important;
  font:inherit;
  font-size:16px;
  min-height:46px;
}
.home-search-box input::placeholder{
  color:#829097!important;
  -webkit-text-fill-color:#829097!important;
}
.home-search-results{
  margin-top:10px;
}
.home-search-hint,
.home-search-empty{
  padding:10px 2px 2px;
  color:#65747b;
  font-size:13px;
}
.home-search-results-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.home-search-result{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:10px;
  border:1.5px solid #d3ddd7;
  border-radius:11px;
  background:#fff;
}
.home-search-result-icon{font-size:22px}
.home-search-result-copy{
  display:grid;
  gap:2px;
  min-width:0;
}
.home-search-result-copy small{
  font-size:9.5px;
  font-weight:900;
  letter-spacing:.08em;
  color:#75847b;
}
.home-search-result-copy strong{
  color:#24363d;
  font-size:13px;
  line-height:1.3;
}
.home-search-result-copy span{
  color:#65727a;
  font-size:11.5px;
  line-height:1.35;
}

/* Century review appears only when a century is selected. */
.century-review-panel{
  margin:12px 0 18px;
  padding:14px;
  border:1.5px solid #c7d9e2;
  border-radius:15px;
  background:#f4f9fb;
}
.century-review-head{
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:14px;
  margin-bottom:10px;
}
.century-review-head h2{
  margin:3px 0!important;
  font-size:19px!important;
}
.century-review-head p{
  margin:0;
  color:#66757d;
}
.century-review-links{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.century-review-link{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:9px;
  min-height:64px;
  padding:9px 10px;
  border:1.5px solid #cad8de;
  border-radius:11px;
  background:#fff;
  color:#26393f;
  -webkit-text-fill-color:#26393f;
  font:inherit;
  text-align:left;
  cursor:pointer;
  -webkit-appearance:none;
  appearance:none;
}
.century-review-link:hover,
.century-review-link:focus{
  border-color:#5f8ca2;
  background:#eef7fa;
  outline:2px solid rgba(95,140,162,.14);
}
.century-review-year{
  padding:5px 7px;
  border-radius:8px;
  background:#e4f0f5;
  color:#174d68;
  -webkit-text-fill-color:#174d68;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}
.century-review-copy{
  display:grid;
  gap:1px;
}
.century-review-copy strong{font-size:12.5px}
.century-review-copy small{
  color:#66747c;
  font-size:11px;
}
.map-listen-btn{
  width:100%;
  margin-top:10px;
}

@media(max-width:760px){
  .home-search-panel{
    padding:12px;
  }
  .home-search-results-list,
  .century-review-links{
    grid-template-columns:1fr;
  }
  .home-search-result{
    grid-template-columns:auto minmax(0,1fr);
  }
  .home-search-result .green-learn-cue{
    grid-column:1 / -1;
    justify-self:start;
  }
  .century-review-head{
    display:grid;
    align-items:start;
  }
  .century-listen-btn{
    width:100%;
  }
  .home-search-box input{
    font-size:16px!important; /* prevents iOS input zoom and keeps style */
    color:#1e3036!important;
    -webkit-text-fill-color:#1e3036!important;
  }
  .century-review-link,
  .home-search-result{
    color:#26393f!important;
    -webkit-text-fill-color:#26393f!important;
    background:#fff!important;
  }
}


/* =========================================================
   V33 — richer learning, simple UX, responsive/mobile first
   ========================================================= */

/* Century has a distinct soft-purple identity; years remain blue. */
.map-century-grid .map-filter-btn,
.century-filter-grid .filter-btn,
.collection-filter-grid:not(.years) .filter-btn{
  background:#f4eef8!important;
  border-color:#b7a0c7!important;
  color:#684f79!important;
  -webkit-text-fill-color:#684f79!important;
}
.map-century-grid .map-filter-btn.active,
.century-filter-grid .filter-btn.active,
.collection-filter-grid:not(.years) .filter-btn.active{
  background:#e7dcef!important;
  border-color:#8f70a4!important;
  color:#543966!important;
  -webkit-text-fill-color:#543966!important;
}
.collection-filter-grid.years .filter-btn,
.year-test-card .year,
.chip-year,
.related-event-year,
.map-related-year,
.century-review-year{
  background:#e4f0f5!important;
  color:#174d68!important;
  -webkit-text-fill-color:#174d68!important;
}
.chip-century{
  background:#f4eef8!important;
  color:#684f79!important;
  border-color:#b7a0c7!important;
}

/* School-memory block */
.school-remember{
  margin:14px 0;
  padding:14px;
  border:1.5px solid #ddc98b;
  border-radius:14px;
  background:#fffaf0;
}
.school-remember h2{margin:4px 0 7px!important;font-size:18px!important}
.school-remember p{margin:0;line-height:1.55}

/* Mini chronology always compact; horizontal scrolling only inside the strip. */
.mini-time-strip{
  margin:10px 0 14px;
  padding:10px;
  border-radius:12px;
  background:#f6f8f9;
  border:1px solid #d8e0e3;
}
.mini-time-label{
  display:block;
  margin-bottom:7px;
  font-size:9.5px;
  font-weight:900;
  letter-spacing:.08em;
  color:#69777e;
}
.mini-time-items{
  display:grid;
  grid-template-columns:repeat(5,minmax(110px,1fr));
  gap:6px;
}
.mini-time-items button{
  min-width:0;
  padding:7px;
  border:1.5px solid #d0d9dd;
  border-radius:9px;
  background:#fff;
  color:#34464e;
  -webkit-text-fill-color:#34464e;
  font:inherit;
  cursor:pointer;
  text-align:left;
}
.mini-time-items button span{display:block;font-size:11px;font-weight:900;color:#174d68}
.mini-time-items button small{display:block;font-size:9.5px;line-height:1.25;margin-top:2px}
.mini-time-items button.active{border-color:#5e91a8;background:#e7f2f6}

/* Person learning metadata */
.person-meta-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:10px 0;
}
.person-meta-grid>div{
  padding:10px;
  border:1px solid #d8e0dc;
  border-radius:10px;
  background:#f9fbf9;
}
.person-meta-grid span{display:block;font-size:10px;font-weight:800;color:#718078;margin-bottom:3px}
.person-meta-grid strong{font-size:12.5px;line-height:1.35}
.recognize-card{
  margin:10px 0;
  padding:11px;
  border-radius:12px;
  background:#f5f0f8;
  border:1px solid #d5c5df;
}
.recognize-anchors{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.recognize-anchors span{
  padding:6px 8px;
  border-radius:999px;
  background:#fff;
  border:1px solid #cbb8d6;
  color:#624b72;
  font-size:11px;
  font-weight:800;
}
.learning-details{
  margin:10px 0;
  border:1px solid #d8e0dc;
  border-radius:11px;
  background:#fff;
}
.learning-details>summary{
  cursor:pointer;
  padding:10px 12px;
  font-weight:900;
  color:#35484f;
}
.learning-details>p,
.learning-details>.glossary-grid,
.learning-details>.compare-grid,
.learning-details>.dont-confuse-grid{margin:0;padding:0 12px 12px}
.compare-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}
.compare-grid>div{padding:10px;border-radius:10px;background:#f8faf9}
.compare-grid span{display:block;font-size:11px;color:#65747b;margin:3px 0}
.compare-grid p{font-size:12px;line-height:1.45}
.glossary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.glossary-item{border:1px solid #e1e5e3;border-radius:9px;background:#fafcfb}
.glossary-item summary{cursor:pointer;padding:8px 9px;font-weight:800}
.glossary-item p{padding:0 9px 9px;margin:0;font-size:12px;line-height:1.45}
.dont-confuse-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.dont-confuse-grid>div{padding:9px;border-radius:10px;background:#fff7f4;border:1px solid #ecd2ca}
.dc-year{display:inline-block;margin-bottom:4px;padding:3px 6px;border-radius:7px;background:#e4f0f5;color:#174d68;font-weight:900}
.dont-confuse-grid strong{display:block;font-size:12px}
.dont-confuse-grid p{font-size:11px;line-height:1.4;margin:4px 0 0}

/* Battle block */
.battle-card{
  margin:14px 0;
  padding:14px;
  border:1.5px solid #d7c7b0;
  border-radius:15px;
  background:#fffaf4;
}
.battle-head{display:flex;justify-content:space-between;align-items:end;gap:12px;margin-bottom:10px}
.battle-head h2{margin:3px 0!important;font-size:19px!important}
.battle-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.battle-facts>div{padding:9px;border-radius:10px;background:#fff;border:1px solid #e4d8c7}
.battle-facts span{display:block;font-size:10px;color:#796b5b;font-weight:800;margin-bottom:3px}
.battle-facts strong{font-size:12px;line-height:1.4}
.battle-before-after{
  display:grid;
  grid-template-columns:1fr auto 1fr auto 1fr;
  gap:8px;
  align-items:center;
  margin:10px 0;
}
.battle-before-after>div{padding:9px;border-radius:10px;background:#fff}
.battle-before-after span{font-size:9px;font-weight:900;color:#77685a}
.battle-before-after p{font-size:11px;line-height:1.4;margin:3px 0 0}
.battle-now{border:2px solid #b88656}
.battle-memory{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.battle-memory strong{margin-right:3px}
.battle-memory span{padding:5px 7px;border-radius:999px;background:#f3e4d3;color:#65482f;font-size:11px;font-weight:800}

/* Mistakes */
.mistakes-panel{
  margin:0 0 16px;
  padding:14px;
  border:1.5px solid #e3c4bd;
  border-radius:15px;
  background:#fff8f6;
}
.mistakes-head{display:flex;justify-content:space-between;gap:14px;align-items:end}
.mistakes-head h2{margin:3px 0!important;font-size:19px!important}
.mistakes-head p{margin:0;color:#726763}
.mistakes-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:10px}
.mistakes-list button{
  padding:9px;
  border:1px solid #e4ccc6;
  border-radius:10px;
  background:#fff;
  color:#3e4548;
  text-align:left;
  font:inherit;
  cursor:pointer;
}
.mistakes-list span{display:block;color:#9a463a;font-size:10px;font-weight:900}
.mistakes-list strong{font-size:11.5px}
.mistakes-empty strong{display:block;margin-top:4px;font-size:13px}

/* Tablet */
@media(max-width:980px){
  .person-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mini-time-items{grid-template-columns:repeat(5,minmax(105px,1fr));overflow-x:auto}
  .dont-confuse-grid{grid-template-columns:1fr}
  .mistakes-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Mobile */
@media(max-width:680px){
  .person-meta-grid,
  .battle-facts,
  .compare-grid,
  .glossary-grid,
  .mistakes-list{
    grid-template-columns:1fr;
  }
  .mini-time-items{
    display:flex;
    overflow-x:auto;
    scroll-snap-type:x proximity;
    padding-bottom:3px;
  }
  .mini-time-items button{
    flex:0 0 145px;
    scroll-snap-align:start;
  }
  .battle-head,
  .mistakes-head{
    display:grid;
    align-items:start;
  }
  .battle-listen,
  .mistakes-head .primary{
    width:100%;
  }
  .battle-before-after{
    grid-template-columns:1fr;
  }
  .battle-before-after>strong{
    transform:rotate(90deg);
    justify-self:center;
  }
  .school-remember,
  .battle-card,
  .mistakes-panel{
    padding:11px;
  }
  .learning-details>summary{
    min-height:44px;
    display:flex;
    align-items:center;
  }
  .map-century-grid .map-filter-btn,
  .century-filter-grid .filter-btn,
  .collection-filter-grid:not(.years) .filter-btn{
    background:#f4eef8!important;
    color:#684f79!important;
    -webkit-text-fill-color:#684f79!important;
  }
  .collection-filter-grid.years .filter-btn,
  .chip-year,
  .related-event-year,
  .map-related-year{
    background:#e4f0f5!important;
    color:#174d68!important;
    -webkit-text-fill-color:#174d68!important;
  }
}


/* =========================================================
   V34 — cleaner person layout + Roman numeral accent only
   ========================================================= */

/* Century buttons use the same neutral/active system as other filters. */
.map-century-grid .map-filter-btn,
.century-filter-grid .filter-btn,
.collection-filter-grid:not(.years) .filter-btn{
  background:#fff!important;
  border-color:#cbd5d9!important;
  color:#34484f!important;
  -webkit-text-fill-color:#34484f!important;
}
.map-century-grid .map-filter-btn.active,
.century-filter-grid .filter-btn.active,
.collection-filter-grid:not(.years) .filter-btn.active{
  background:#e3f0f5!important;
  border-color:#6e9caf!important;
  color:#174d68!important;
  -webkit-text-fill-color:#174d68!important;
}

/* Only the Roman numeral is visually different. */
.century-roman{
  color:#7b4f94!important;
  -webkit-text-fill-color:#7b4f94!important;
  font-weight:950!important;
}

/* Person: image and identity are one clean left-side visual unit. */
.person-detail-grid-v34{
  align-items:start!important;
}
.person-visual-column{
  display:grid;
  gap:10px;
  min-width:0;
}
.person-under-image{
  display:grid;
  gap:9px;
}
.person-under-image .person-meta-grid{
  grid-template-columns:1fr!important;
  margin:0!important;
}
.person-under-image .person-meta-grid>div{
  padding:9px 10px;
}
.person-under-image .recognize-card{
  margin:0!important;
}
.person-content-column{
  min-width:0;
}

/* Removed "Не ги бъркай": no dead visual spacing. */
.dont-confuse,
.dont-confuse-grid{
  display:none!important;
}

@media(max-width:980px){
  .person-detail-grid-v34{
    grid-template-columns:minmax(220px,.75fr) minmax(0,1.25fr)!important;
    gap:16px!important;
  }
}
@media(max-width:720px){
  .person-detail-grid-v34{
    grid-template-columns:1fr!important;
  }
  .person-visual-column{
    width:100%;
  }
  .person-under-image .person-meta-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .person-under-image .person-meta-grid>div:last-child:nth-child(3){
    grid-column:1 / -1;
  }
  .century-roman{
    color:#7b4f94!important;
    -webkit-text-fill-color:#7b4f94!important;
  }
}
@media(max-width:480px){
  .person-under-image .person-meta-grid{
    grid-template-columns:1fr!important;
  }
  .person-under-image .person-meta-grid>div:last-child:nth-child(3){
    grid-column:auto;
  }
}


/* =========================================================
   V35 — final clarity: selected year only + top listening
   ========================================================= */
.collection-filter-grid.years .filter-btn{
  background:#fff!important;
  border-color:#cbd5d9!important;
  color:#34484f!important;
  -webkit-text-fill-color:#34484f!important;
}
.collection-filter-grid.years .filter-btn:hover,
.collection-filter-grid.years .filter-btn:focus{
  background:#f5f8f9!important;
  border-color:#91a7b0!important;
  color:#263a42!important;
  -webkit-text-fill-color:#263a42!important;
}
.collection-filter-grid.years .filter-btn.active{
  background:#dceef6!important;
  border-color:#5f92aa!important;
  color:#164f69!important;
  -webkit-text-fill-color:#164f69!important;
  box-shadow:inset 0 0 0 1px rgba(23,77,104,.08);
}
.top-listen-row{
  display:flex;
  align-items:center;
  margin:7px 0 10px;
}
.top-listen-btn{
  min-height:42px;
  padding:8px 12px;
}
.person-content-column>h1,
.event-main-v17>h1{
  margin-bottom:2px!important;
}
@media(max-width:760px){
  .top-listen-row{width:100%;margin:6px 0 9px}
  .top-listen-btn{width:100%}
  .collection-filter-grid.years .filter-btn{
    background:#fff!important;
    color:#34484f!important;
    -webkit-text-fill-color:#34484f!important;
  }
  .collection-filter-grid.years .filter-btn.active{
    background:#dceef6!important;
    color:#164f69!important;
    -webkit-text-fill-color:#164f69!important;
  }
}


/* =========================================================
   V36 — final tablet overflow fix
   ========================================================= */

/* On desktop/tablet the 5-point local timeline must fit inside
   the content column instead of forcing the whole page wider. */
.mini-time-items{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  min-width:0!important;
}
.mini-time-items button{
  min-width:0!important;
  overflow-wrap:anywhere;
}

/* Preserve the intentional swipe version only on small phones. */
@media(max-width:680px){
  .mini-time-items{
    display:flex!important;
    overflow-x:auto!important;
    scroll-snap-type:x proximity;
  }
  .mini-time-items button{
    flex:0 0 145px!important;
    overflow-wrap:normal;
  }
}


/* =========================================================
   V37 — final mobile event containment
   ========================================================= */
@media(max-width:760px){
  .event-layout-v17,
  .event-main-v17,
  .event-aside-v17{
    min-width:0!important;
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .event-main-v17>*,
  .event-aside-v17>*{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .event-anchor-row,
  .event-related-people,
  .event-story-v17,
  .school-remember,
  .battle-card,
  .event-large-map,
  .event-actions-v17,
  .event-details-v17,
  .mini-time-strip{
    min-width:0!important;
    max-width:100%!important;
  }
  .mini-time-strip{
    overflow:hidden!important;
  }
  .mini-time-items{
    max-width:100%!important;
  }
}


/* =========================================================
   V38 — person title/audio above the whole content
   ========================================================= */
.person-page-head-v38{
  margin-bottom:12px;
}
.person-page-head-v38 h1{
  margin:.22em 0 .05em!important;
}
.person-page-head-v38 .top-listen-row{
  margin:6px 0 0!important;
}
@media(max-width:760px){
  .person-page-head-v38{
    margin-bottom:10px;
  }
  .person-page-head-v38 .top-listen-btn{
    width:100%;
  }
}


/* =========================================================
   V40 — FINAL RESPONSIVE / CONTROL SYSTEM
   ========================================================= */
html,body{max-width:100%;overflow-x:clip}
#app,#app *,.bottom-nav,.bottom-nav *{box-sizing:border-box}
#app button,.bottom-nav button,.top-nav button,.tool-btn{font-family:inherit;-webkit-tap-highlight-color:transparent}
#app button:focus-visible,.bottom-nav button:focus-visible,.top-nav button:focus-visible,.tool-btn:focus-visible,#app a:focus-visible,#app summary:focus-visible{outline:3px solid rgba(45,111,139,.24)!important;outline-offset:2px}

/* Filters: one row when collapsed; wrapped rows when expanded. */
.filter-scroll,.map-control-scroll.map-collapsible-grid{scrollbar-width:none!important}
.filter-scroll::-webkit-scrollbar,.map-control-scroll.map-collapsible-grid::-webkit-scrollbar{display:none!important}
.filter-collapsible-grid,.map-collapsible-grid{width:100%!important;min-width:0!important;overflow:hidden!important;transition:max-height .18s ease!important}
.timeline-filter-grid,.century-filter-grid.filter-collapsible-grid,.collection-filter-grid,.collection-filter-grid.years{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important}
.collection-filter-grid.years{grid-template-columns:repeat(5,minmax(0,1fr))!important}
.route-map .map-century-grid{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;grid-template-rows:none!important;gap:6px!important}
.filter-collapsible-grid.collapsed,.map-collapsible-grid.collapsed{max-height:58px!important;overflow:hidden!important}
.filter-collapsible-grid.expanded,.map-collapsible-grid.expanded{max-height:1400px!important;overflow:visible!important}
.map-collapsible-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;width:100%!important;min-width:0!important;transition:max-height .18s ease!important}
.map-collapsible-list.collapsed{max-height:52px!important;overflow:hidden!important}
.map-collapsible-list.expanded{max-height:1600px!important;overflow:visible!important}
.map-show-item{min-width:0!important;max-width:100%!important}
.filter-expand-toggle{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:auto!important;max-width:100%!important;min-height:40px!important;white-space:nowrap!important;margin-top:2px!important}
@media(max-width:1024px){
 .timeline-filter-grid,.century-filter-grid.filter-collapsible-grid,.collection-filter-grid,.collection-filter-grid.years{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 .route-map .map-century-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 .map-collapsible-list{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:680px){
 .timeline-controls .filter-row,.route-map .map-control-row{grid-template-columns:1fr!important;gap:5px!important}
 .timeline-controls .filter-label,.route-map .map-control-label{padding-top:0!important;margin-bottom:1px!important}
 .timeline-filter-grid,.century-filter-grid.filter-collapsible-grid,.collection-filter-grid,.collection-filter-grid.years,.route-map .map-century-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
 .filter-collapsible-grid.collapsed,.map-collapsible-grid.collapsed{max-height:58px!important}
 .map-collapsible-list{grid-template-columns:1fr!important}
 .map-collapsible-list.collapsed{max-height:48px!important}
 .filter-btn,.map-filter-btn{width:100%!important;min-width:0!important;max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere}
}

/* Bottom navigation */
.bottom-nav{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;grid-auto-rows:minmax(54px,auto)!important;gap:3px!important;width:min(calc(100% - 16px),820px)!important;padding:5px!important;overflow:hidden!important}
.bottom-nav button{width:100%!important;min-width:0!important;max-width:100%!important;min-height:54px!important;padding:5px 3px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1px!important;white-space:normal!important;overflow-wrap:anywhere!important;text-align:center!important;line-height:1.08!important;border-radius:9px!important;font-size:10.5px!important}
.bottom-nav button span{flex:0 0 auto!important;line-height:1!important}
@media(max-width:560px){
 body{padding-bottom:128px!important}
 .bottom-nav{grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(2,49px)!important;grid-auto-rows:49px!important;gap:3px!important;width:calc(100% - 10px)!important;bottom:5px!important;padding:4px!important;border-radius:13px!important}
 .bottom-nav button{min-height:49px!important;height:49px!important;padding:3px!important;font-size:10.5px!important}
 .bottom-nav button span{font-size:16px!important;margin:0!important}
 .bottom-nav button[data-route="timeline"]{font-size:10px!important}
}
@media(min-width:561px) and (max-width:900px){body{padding-bottom:88px!important}}

/* Standardize controls that previously could fall back to browser defaults. */
.home-map-location-list button,.event-person-card button,.place-years-list button,.mistakes-list button{-webkit-appearance:none!important;appearance:none!important;border:1.5px solid #cbd8d1!important;border-radius:9px!important;background:#fff!important;color:#2e444d!important;-webkit-text-fill-color:#2e444d!important;font:inherit!important;font-weight:800!important;cursor:pointer!important;box-shadow:none!important}
.home-map-location-list button:hover,.event-person-card button:hover,.place-years-list button:hover,.mistakes-list button:hover,.home-map-location-list button:focus,.event-person-card button:focus,.place-years-list button:focus,.mistakes-list button:focus{background:#eef7f1!important;border-color:#6d9878!important;color:#215634!important;-webkit-text-fill-color:#215634!important}
.event-person-card button{min-height:38px!important;padding:7px 9px!important;margin-top:7px!important}
.place-years-list{display:flex!important;flex-wrap:wrap!important;gap:5px!important}
.place-years-list button{min-height:34px!important;padding:5px 8px!important;color:#174d68!important;-webkit-text-fill-color:#174d68!important;background:#e8f3f7!important;border-color:#a9c6d2!important}
.home-map-location-list button{min-height:42px!important;padding:7px 9px!important}

@media(max-width:680px){
 #app button,#app .primary,#app .secondary,#app .ghost,#app .listen-btn,#app .green-learn-btn,#app .source-link{max-width:100%!important}
 .button-row{display:flex!important;flex-wrap:wrap!important;gap:7px!important}
 .button-row>.primary,.button-row>.secondary,.button-row>.ghost,.button-row>.listen-btn,.button-row>.green-learn-btn,.button-row>.source-link{flex:1 1 210px!important;min-width:0!important}
 .map-single-place-note{display:grid!important;grid-template-columns:1fr!important;align-items:start!important}
 .map-single-place-note .green-learn-btn{width:100%!important}
}
#app p,#app li,#app strong,#app span,#app small,#app h1,#app h2,#app h3,#app button,#app a{overflow-wrap:anywhere}
.learning-details>summary{list-style-position:inside}
@media(max-width:560px){.learning-details>summary{min-height:44px!important;display:flex!important;align-items:center!important}}


/* =========================================================
   V41 — iOS Safari / real-device compatibility
   ========================================================= */

/* iOS Safari can hit-test max-height/overflow transitions differently.
   V41 disables that mechanism on responsive widths and uses two
   genuinely different layouts instead. */
@media(max-width:900px){
  html,body{
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important; /* Safari-safe fallback; do not use clip */
  }

  .filter-collapsible-grid,
  .map-collapsible-grid,
  .map-collapsible-list{
    transition:none!important;
    max-height:none!important;
    min-height:0!important;
  }

  /* COLLAPSED:
     exactly two rows, with horizontal swipe inside the component. */
  .filter-collapsible-grid.collapsed,
  .map-collapsible-grid.collapsed{
    display:grid!important;
    grid-template-columns:none!important;
    grid-template-rows:repeat(2,minmax(44px,auto))!important;
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(138px,42vw)!important;
    gap:6px!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
    padding:1px 1px 5px!important;
  }
  .filter-collapsible-grid.collapsed>*,
  .map-collapsible-grid.collapsed>*{
    scroll-snap-align:start;
    min-width:0!important;
    max-width:none!important;
  }

  /* EXPANDED:
     all options wrap normally. No horizontal page/list scrolling. */
  .filter-collapsible-grid.expanded,
  .map-collapsible-grid.expanded{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:none!important;
    grid-auto-flow:row!important;
    grid-auto-columns:auto!important;
    gap:6px!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
    padding:1px!important;
  }

  /* The map "show years/events" list uses the same principle. */
  .map-collapsible-list.collapsed{
    display:grid!important;
    grid-template-columns:none!important;
    grid-template-rows:repeat(2,minmax(44px,auto))!important;
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(210px,78vw)!important;
    gap:6px!important;
    max-height:none!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
    padding:1px 1px 5px!important;
  }
  .map-collapsible-list.collapsed>*{
    scroll-snap-align:start;
  }
  .map-collapsible-list.expanded{
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:none!important;
    grid-auto-flow:row!important;
    gap:6px!important;
    max-height:none!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
    padding:1px!important;
  }

  /* Show/Hide is deliberately outside the scrolling layer and
     above it in hit-testing order. */
  .filter-stack-v30,
  .map-filter-stack,
  .map-instruction{
    position:relative!important;
    isolation:isolate;
    overflow:visible!important;
  }
  .filter-expand-toggle{
    position:relative!important;
    z-index:6!important;
    pointer-events:auto!important;
    touch-action:manipulation!important;
    -webkit-appearance:none!important;
    appearance:none!important;
    user-select:none!important;
    -webkit-user-select:none!important;
  }

  .filter-btn,
  .map-filter-btn,
  .map-show-item,
  .map-mode-btn,
  .primary,.secondary,.ghost,.answer,.listen-btn,.green-learn-btn,
  .year-test-card,.main-choice,.home-test-cta{
    touch-action:manipulation!important;
    pointer-events:auto!important;
    -webkit-appearance:none!important;
    appearance:none!important;
  }
}

/* Narrow phones: keep the collapsed filter readable and swipeable. */
@media(max-width:560px){
  .filter-collapsible-grid.collapsed,
  .map-collapsible-grid.collapsed{
    grid-auto-columns:minmax(142px,45vw)!important;
  }

  /* iPhone safe-area bottom navigation.
     It is 3 x 2 and never depends on width:min/max functions. */
  body{
    padding-bottom:calc(112px + env(safe-area-inset-bottom))!important;
  }
  .bottom-nav{
    display:grid!important;
    position:fixed!important;
    left:6px!important;
    right:6px!important;
    bottom:0!important;
    width:auto!important;
    max-width:none!important;
    height:auto!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,48px)!important;
    grid-auto-rows:48px!important;
    gap:3px!important;
    padding:4px 4px calc(4px + env(safe-area-inset-bottom))!important;
    margin:0!important;
    border-radius:13px 13px 0 0!important;
    overflow:visible!important;
    z-index:2147483000!important;
    transform:translateZ(0)!important;
    -webkit-transform:translateZ(0)!important;
    backface-visibility:hidden;
    -webkit-backface-visibility:hidden;
  }
  .bottom-nav button{
    position:relative!important;
    z-index:1!important;
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:48px!important;
    min-height:48px!important;
    padding:3px 2px!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
    touch-action:manipulation!important;
    pointer-events:auto!important;
    -webkit-appearance:none!important;
    appearance:none!important;
  }
}

/* Tablet: one bottom row, safe-area aware and never overlaps content. */
@media(min-width:561px) and (max-width:900px){
  body{
    padding-bottom:calc(76px + env(safe-area-inset-bottom))!important;
  }
  .bottom-nav{
    left:8px!important;
    right:8px!important;
    bottom:0!important;
    width:auto!important;
    max-width:none!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:56px!important;
    padding:5px 5px calc(5px + env(safe-area-inset-bottom))!important;
    z-index:2147483000!important;
    transform:translateZ(0)!important;
    -webkit-transform:translateZ(0)!important;
  }
}

/* Prevent invisible/oversized layers from blocking taps on responsive pages. */
@media(max-width:900px){
  #app,
  .app,
  .panel,
  .card,
  .timeline-controls,
  .collection-filter-panel,
  .route-map .map-layout,
  .event-layout-v17,
  .person-detail-grid-v34{
    min-width:0!important;
    max-width:100%!important;
  }

  .filter-collapsible-grid,
  .map-collapsible-grid,
  .map-collapsible-list{
    position:relative!important;
    z-index:1!important;
  }

  /* Keep action rows above decorative/map layers. */
  .button-row,
  .top-listen-row,
  .filter-expand-toggle,
  .bottom-nav{
    pointer-events:auto!important;
  }
}

/* Touch browsers sometimes inject blue/grey button styling. */
@supports (-webkit-touch-callout:none){
  button,
  input,
  select,
  textarea{
    font-family:inherit!important;
  }
  button{
    -webkit-appearance:none!important;
    appearance:none!important;
    border-radius:inherit;
  }
  .filter-btn,
  .map-filter-btn,
  .filter-expand-toggle,
  .bottom-nav button{
    -webkit-text-fill-color:currentColor;
  }
}

