:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --accent:#2563eb;
  --accent-bg:rgba(37,99,235,.08);
  --accent-border:rgba(37,99,235,.16);
  --warn:#f59e0b;
  --warn-bg:rgba(245,158,11,.10);
  --success:#16a34a;
  --danger:#dc2626;
  --radius:10px;
  --radius-sm:8px;
  --shadow:0 1px 3px rgba(15,23,42,.05),0 10px 28px rgba(15,23,42,.04);
  --shadow-hover:0 14px 30px rgba(15,23,42,.10);
  --font:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --transition:.18s ease;
}

*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;scroll-padding-top:88px}
body{
  font-family:var(--font);
  color:var(--text);
  background:var(--bg);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

a{color:inherit;text-decoration:none}
::selection{background:var(--accent);color:#fff}

.wrap{
  max-width:1240px;width:95%;
  width:min(100% - 40px,1240px);
  margin:0 auto;
  padding:16px 0 40px;
}

.hidden{display:none !important}

/* Shared */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
a.card,
.card-link{
  display:flex;
  flex-direction:column;
  text-decoration:none;
  color:inherit;
  transition:transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
a.card:hover,
.card-link:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow-hover);
  border-color:#d5deea;
}

.cards,
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:18px;
}

.card.card-link,
a.card{
  padding:22px 22px;
}

.card h3{
  font-size:17px;
  line-height:1.3;
  font-weight:500;
  color:var(--text);
  margin-bottom:6px;
}

.card > p{
  font-size:14px;
  color:#4b5563;
  line-height:1.68;
  display:-webkit-box;
  -webkit-line-clamp:4;
  -webkit-box-orient:vertical;
  overflow:hidden;
  flex:1;
}

.card > a{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:12px;
  color:var(--accent);
  font-size:14px;
  font-weight:600;
  transition:gap var(--transition);
}
.card > a::after{content:"\2192"}
.card > a:hover{gap:8px}

.card-action{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:auto;
  padding-top:12px;
  color:var(--accent);
  font-size:14px;
  font-weight:600;
}

.card .eyebrow{
  display:inline-block;
  margin-bottom:6px;
  font-size:12px;
  font-weight:600;
  letter-spacing:.4px;
  text-transform:uppercase;
  color:var(--accent);
}

.card-flat{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:14px 16px;
  box-shadow:var(--shadow);
}

.myths-card{
  border-left:4px solid var(--warn);
  background:linear-gradient(135deg,var(--warn-bg),#fff 46%);
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:20px;
  background:#eef2f7;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}
.pill .dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--accent);
}

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:14px 20px;
  margin-bottom:18px;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:var(--shadow);
  position:sticky;
  top:10px;
  z-index:100;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:-webkit-max-content;min-width:max-content;
  font-size:15px;
  font-weight:600;
  line-height:1.25;
}

.brand-mark{
  display:block;
  width:28px;
  height:28px;
  border-radius:6px;
  object-fit:contain;
  flex-shrink:0;
}

.brand .logo{
  width:30px;
  height:30px;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--accent-bg);
  font-size:16px;
  flex-shrink:0;
}

.brand .bname{
  font-weight:600;
  font-size:15px;
  line-height:1.2;
}

.brand .btag{
  font-size:10.5px;
  color:var(--muted);
  line-height:1.2;
}

.nav{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex:1;
  min-width:0;
  overflow-x:auto;
  scrollbar-width:none;
}
.nav::-webkit-scrollbar{display:none}

.nav a{
  padding:8px 14px;
  border-radius:20px;
  color:#8b95a5;
  font-size:14px;
  font-weight:500;
  white-space:nowrap;
  transition:all var(--transition);
}
.nav a:hover{
  color:var(--text);
  background:rgba(15,23,42,.04);
}
.nav a.active{
  background:var(--accent);
  color:#fff;
  font-weight:600;
  box-shadow:0 2px 6px rgba(37,99,235,.18);
}

.lang-switch{
  display:flex;
  gap:2px;
  padding:3px;
  border-radius:20px;
  background:rgba(15,23,42,.04);
  flex-shrink:0;
}
.lang-switch a{
  padding:5px 10px;
  border-radius:20px;
  color:#8b95a5;
  font-size:13px;
  font-weight:600;
  transition:all var(--transition);
  letter-spacing:.01em;
}
.lang-switch a:hover{color:var(--text)}
.lang-switch a.active{
  color:#fff;
  background:var(--accent);
  box-shadow:0 2px 6px rgba(37,99,235,.18);
}

/* Compact topbar on scroll – all viewports */
.topbar{
  transition:padding .25s ease, gap .25s ease;
}
.topbar.topbar-compact{
  padding:8px 16px;
  gap:14px;
}
.topbar-compact .nav a{
  padding:6px 11px;
  font-size:13px;
}
.topbar-compact .lang-switch a:not(.active){
  display:none;
}
.topbar-compact .lang-switch.lang-open a:not(.active){
  display:inline-flex;
}

/* Alternative nav systems */
.seg{
  display:flex;
  gap:2px;
  padding:2px;
  border-radius:20px;
  background:rgba(0,0,0,.04);
}
.seg button{
  min-width:34px;
  height:28px;
  padding:0 8px;
  border-radius:20px;
  border:none;
  background:none;
  color:var(--muted);
  font-size:11.5px;
  font-weight:600;
  cursor:pointer;
  transition:all var(--transition);
}
.seg button:hover{color:var(--text)}
.seg button.active{
  color:#fff;
  background:var(--text);
  box-shadow:0 1px 3px rgba(0,0,0,.15);
}





/* Hero */
.hero{
  background:linear-gradient(180deg,#f4f8ff 0%,#eef3fb 100%);
  border:1px solid #e3eaf6;
  border-radius:12px;
  padding:34px 34px;
  margin-bottom:18px;
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden;
}
/* hero-sun removed -- too subtle on light background */
.hero.card{border:1px solid #e3eaf6;box-shadow:var(--shadow)}

/* All .hero blocks: flat/compact on desktop, card on mobile */
@media (min-width:768px){
  .hero:not(.item-hero){
    background:none;
    border:none;
    box-shadow:none;
    padding:16px 4px;
    border-radius:0;
    margin-bottom:8px;
  }
  .hero:not(.item-hero) h1{
    font-size:24px;
    margin-bottom:4px;
  }
  .hero:not(.item-hero) .lead{
    font-size:15px;
    max-width:70ch;
  }
  .hero:not(.item-hero) .search-form{
    max-width:none;
  }
}

.item-hero{
  grid-area:hero;
  width:100%;
  max-width:none;
  min-height:auto;
}

.hero h1{
  font-size:26px;
  font-weight:500;
  letter-spacing:-.3px;
  margin-bottom:8px;
  line-height:1.2;
}

.item-hero h1{
  font-size:26px;
  font-weight:600;
  letter-spacing:-.3px;
  margin-bottom:8px;
  line-height:1.22;
}

.hero p{
  font-size:15px;
  color:#4b5563;
  line-height:1.6;
}

.item-hero p{
  font-size:15px;
  color:#5a6678;
  line-height:1.62;
}

.hero .lead,
.item-hero .lead{
  margin-bottom:0;
  color:#4b5563;
}

.hero .lead{max-width:62ch}
.item-hero .lead{max-width:none}

.hero-actions{
  margin-top:16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.hero-actions .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:10px 18px;
  border-radius:10px;
  border:1px solid #d9e2ef;
  background:#fff;
  color:var(--accent);
  font-size:14px;
  font-weight:700;
  transition:all var(--transition);
}

.hero-actions .btn:hover{
  background:var(--accent);
  color:#fff;
  border-color:var(--accent);
}

.hero-actions .btn-secondary{
  background:rgba(255,255,255,.72);
}
.hero-actions .btn-primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.hero-actions .btn-primary:hover{opacity:.9;transform:translateY(-1px);background:var(--accent);color:#fff}
.hero-actions .btn-outline{background:transparent;color:var(--accent);border-color:var(--accent)}
.hero-actions .btn-outline:hover{background:var(--accent);color:#fff}

.hero .links{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.hero .links a{
  padding:7px 13px;
  border-radius:20px;
  background:rgba(255,255,255,.84);
  color:var(--accent);
  font-size:13px;
  font-weight:700;
  transition:all var(--transition);
}

.hero .links a:hover{
  background:var(--accent);
  color:#fff;
}

.section-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:12px;
  margin:2px 2px 12px;
}
.section-head h2{
  font-size:18px;
  line-height:1.2;
  font-weight:500;
  color:var(--text);
}

/* Filter / sections */
.filter-bar{
  display:flex;
  gap:6px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  padding:4px 0;
  margin-bottom:12px;
  position:sticky;
  top:72px;
  z-index:90;
  background:var(--bg);
}
.filter-bar::-webkit-scrollbar{display:none}
.filter-bar button{
  flex-shrink:0;
  padding:8px 14px;
  border:1.5px solid var(--line);
  border-radius:20px;
  background:var(--card);
  color:var(--muted);
  font-size:13px;
  font-weight:500;
  white-space:nowrap;
  cursor:pointer;
  transition:all var(--transition);
  font-family:inherit;
}
.filter-bar button:hover{
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-bg);
}
.filter-bar button.active{
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-bg);
  font-weight:600;
}

.sec-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:6px;
  margin:14px 0 8px;
}
.sec-head h2{
  font-size:15px;
  font-weight:600;
  color:var(--muted);
}
.sec-head .count{
  font-size:11.5px;
  color:var(--muted);
  font-weight:600;
}
.sec-block{margin-bottom:16px}

/* Search / forms */
.search-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) 118px;
  gap:12px;
  margin-bottom:16px;
}
.search-form input,
.g-filter input{
  width:100%;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  font-size:15px;
  color:var(--text);
  transition:all var(--transition);
}
.search-form input:focus,
.g-filter input:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-bg);
}
.search-form button{
  width:100%;
  border:none;
  border-radius:12px;
  background:var(--accent);
  color:#fff;
  font-size:15px;
  font-weight:700;
  cursor:pointer;
  transition:all var(--transition);
}
.search-form button:hover{background:#1d4ed8}

/* Prose / markdown */
.card.prose,
.prose-block{
  padding:22px 24px;
  box-shadow:var(--shadow);
}
.prose-block + .prose-block{
  margin-top:8px;
}

.prose-block{
  padding:16px 18px;
}

.card.prose h2{
  font-size:20px;
  font-weight:600;
  margin-bottom:12px;
  color:var(--text);
}
.card.prose h3{
  font-size:17px;
  font-weight:600;
  margin-bottom:8px;
}
.card.prose p{
  font-size:16px;
  color:var(--text);
  line-height:1.8;
  display:block;
  -webkit-line-clamp:unset;
  margin-bottom:14px;
}
.card.prose ul,
.card.prose ol{
  margin:8px 0 14px 22px;
  font-size:16px;
  line-height:1.7;
}
.card.prose li{margin:4px 0}
.card.prose li::marker{color:var(--accent)}
.card.prose table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
  margin:12px 0;
}
.card.prose th{
  text-align:left;
  padding:9px 12px;
  font-weight:600;
  border-bottom:2px solid var(--line);
  font-size:13px;
  color:var(--muted);
}
.card.prose td{
  padding:9px 12px;
  border-bottom:1px solid var(--line);
}
.card.prose tr:hover{background:rgba(0,0,0,.015)}

.prose{min-width:0}

.md,
.prose{
  font-size:16px;
  line-height:1.76;
  color:#222;
}
.md p,
.prose p{margin:0 0 12px}
.md ul,.md ol,
.prose ul,.prose ol{margin:8px 0 14px 22px}
.md li,
.prose li{margin:4px 0;line-height:1.66}
.md li::marker,
.prose li::marker{color:#555}
.md a,
.prose a{
  color:var(--accent);
  text-decoration:underline;
  text-underline-offset:2px;
}
.md strong,
.prose strong{font-weight:600;color:#111}
.md blockquote,
.prose blockquote{
  margin:14px 0;
  padding:12px 14px;
  border-left:3px solid var(--accent);
  background:#f7faff;
  border-radius:0 8px 8px 0;
  color:#444;
}
.md h2,
.prose h2{
  font-size:19px;
  line-height:1.35;
  font-weight:600;
  color:#1b1f24;
  margin:30px 0 10px;
}
.md h3,
.prose h3{
  font-size:16px;
  line-height:1.45;
  font-weight:600;
  color:#30343a;
  margin:22px 0 8px;
}
.md table,
.prose table{
  width:100%;
  border-collapse:collapse;
  margin:14px 0 20px;
  background:#fff;
  border:1px solid #e8ebf0;
}
.md th,.md td,
.prose th,.prose td{
  border:1px solid #e8ebf0;
  padding:9px 11px;
  text-align:left;
  vertical-align:middle;
}
.md th,
.prose th{
  background:#f8fafc;
  font-size:13px;
  font-weight:600;
  color:#4b5563;
}
.md td,
.prose td{
  font-size:14px;
  color:#2f3742;
}
.md tr:hover,
.prose tr:hover{background:#fafbfd}

.section{padding-top:4px}

/* Status / empty */
.status{
  font-size:13px;
  color:var(--muted);
  min-height:16px;
}
.status.error{color:var(--danger)}

.empty{
  text-align:center;
  padding:32px 18px;
  color:var(--muted);
}
.empty .icon{
  font-size:38px;
  margin-bottom:8px;
}
.empty p{
  font-size:14px;
  line-height:1.65;
}
.empty .suggestions{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  justify-content:center;
}

.empty .suggestions button,
.popular .tags button{
  padding:8px 14px;
  border:none;
  border-radius:20px;
  background:#eef2f7;
  color:#5b6472;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  transition:all var(--transition);
}
.empty .suggestions button:hover,
.popular .tags button:hover{
  background:var(--accent-bg);
  color:var(--accent);
}

.result-count,
.g-count{
  font-size:13px;
  color:var(--muted);
}

.result-group{margin-bottom:14px}
.result-group-title{
  font-size:11.5px;
  color:var(--muted);
  font-weight:600;
  margin-bottom:5px;
}

.popular{margin-top:16px}
.popular h3{
  font-size:18px;
  font-weight:600;
  margin-bottom:10px;
}
.popular .tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

mark{
  background:rgba(37,99,235,.12);
  color:var(--accent);
  font-weight:700;
  border-radius:2px;
  padding:0 1px;
}

/* Item page */
.item-page{
  margin-top:4px;
}

.item-shell{
  background:transparent;
  border:none;
  box-shadow:none;
}

.item-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  grid-template-areas:
    "hero aside"
    "main aside";
  gap:12px;
  align-items:start;
  margin-top:8px;
  background:transparent;
  border:none;
  box-shadow:none;
  padding:0;
}

.item-hero{
  grid-area:hero;
  width:100%;
  min-width:0;
  padding:28px 32px 20px;
  border-radius:24px;
  background:linear-gradient(135deg,#e8f0fe 0%,#f0f4fb 40%,#faf8f5 100%);
  border:1px solid #dce4f0;
  border-left:4px solid var(--accent);
  box-shadow:0 2px 12px rgba(0,0,0,.06),0 0 0 1px rgba(0,0,0,.02);
}

.item-hero .eyebrow{
  margin-bottom:12px;
  font-size:13px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--accent);
}

.item-hero h1{
  font-size:28px;
  line-height:1.2;
  font-weight:600;
  letter-spacing:-0.3px;
  margin-bottom:10px;
  color:var(--text);
}

.item-hero .lead{
  font-size:17px;
  line-height:1.7;
  color:#4b5563;
  max-width:none;
}

.item-main,
.item-content{
  grid-area:main;
  min-width:0;
}

.item-main{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.item-aside,
.item-side{
  grid-area:aside;
  width:100%;
  min-width:0;
  position:sticky;
  top:96px;
  align-self:start;
  margin-top:0;
}

.sidebar-sticky{
  position:static;
}

.side-card{
  padding:18px 20px;
  border-radius:12px;
}

.item-aside .side-card + .side-card,
.item-side .side-card + .side-card{
  margin-top:14px;
}

.toc-title,
.side-share-title{
  font-size:13px;
  font-weight:600;
  letter-spacing:.24px;
  color:#7b8795;
  margin-bottom:10px;
  text-transform:uppercase;
}

.toc-links{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.toc a,
.toc-links a{
  display:block;
  color:#556070;
  font-size:13.5px;
  line-height:1.45;
  padding:4px 0;
  font-weight:500;
  transition:color var(--transition);
}

.toc a:hover,
.toc a.active,
.toc-links a:hover,
.toc-links a.active{
  color:var(--accent);
}

.toc-empty{
  font-size:13px;
  color:var(--muted);
  line-height:1.5;
}

.item-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:2px;
  margin-bottom:0;
}

.item-actions button{
  width:100%;
  min-height:42px;
  justify-content:center;
  padding:10px 14px;
  border:1px solid #d8dde6;
  border-radius:10px;
  background:#fff;
  color:#5d6775;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  transition:all var(--transition);
}

.item-actions button:hover{
  color:var(--accent);
  border-color:var(--accent);
  background:var(--accent-bg);
}

.prose-block{
  padding:28px 30px;
  border-radius:22px;
}

.prose-block h2{
  font-size:22px;
  line-height:1.26;
  font-weight:600;
  letter-spacing:-0.15px;
  margin:0 0 16px;
}

.prose-block .prose{
  font-size:16px;
  line-height:1.78;
  color:#1f2937;
}

.prose-block .prose p{
  margin:0 0 14px;
}

.prose-block .prose p:last-child{
  margin-bottom:0;
}

.prose-block .prose ul,
.prose-block .prose ol{
  margin:8px 0 16px 22px;
}

.prose-block .prose li{
  margin:5px 0;
  line-height:1.7;
}

.prose-block .prose h2{
  font-size:20px;
  font-weight:600;
  margin:28px 0 12px;
}

.prose-block .prose h2:first-child{
  margin-top:0;
}

.prose-block .prose h3{
  font-size:17px;
  font-weight:600;
  margin:22px 0 8px;
}

.prose-block .prose table{
  width:100%;
  border-collapse:collapse;
  margin:16px 0 18px;
  display:table;
}

.prose-block .prose th,
.prose-block .prose td{
  padding:10px 14px;
  vertical-align:top;
}

.share-bar{
  display:none;
}

@media (max-width:980px){
  .item-layout{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:
      "hero"
      "aside"
      "main"
      "footer";
    gap:14px;
  }

  .item-aside,
  .item-side{
    position:static;
    top:auto;
  }

  .item-aside{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
  }

  .item-aside .side-card,
  .item-side .side-card{
    margin-top:0 !important;
  }

  .item-hero h1{
    max-width:none;
  }
}

@media (max-width:767px){
  .item-page{
    margin-top:0;
  }

  .item-layout{
    display:block;
  }

  .item-hero{
    padding:20px 16px 18px;
    margin-bottom:12px;
    border-radius:12px;
    border-left-width:3px;
  }

  .item-hero .eyebrow{
    font-size:11px;
    margin-bottom:8px;
  }

  .item-hero h1{
    max-width:none;
    font-size:20px;
    line-height:1.22;
    letter-spacing:-0.2px;
    margin-bottom:8px;
  }

  .item-hero .lead{
    font-size:14px;
    line-height:1.62;
  }

  .item-aside,
  .item-side{
    display:block;
    position:static;
    margin:0 0 12px;
  }

  .side-card{
    padding:14px 14px;
    border-radius:12px;
  }

  .item-aside .side-card + .side-card,
  .item-side .side-card + .side-card{
    margin-top:10px !important;
  }

  .toc-title,
  .side-share-title{
    font-size:12px;
    margin-bottom:8px;
  }

  .toc a,
  .toc-links a{
    font-size:13px;
    line-height:1.42;
    padding:2px 0;
  }

  .item-actions{
    gap:8px;
  }

  .item-actions button{
    min-height:40px;
    font-size:12.5px;
    border-radius:20px;
    padding:9px 12px;
  }

  .item-main{
    gap:12px;
  }

  .prose-block{
    padding:20px 16px;
    border-radius:12px;
  }

  .prose-block h2{
    font-size:17px;
    line-height:1.3;
    margin-bottom:10px;
  }

  .prose-block .prose{
    font-size:15px;
    line-height:1.72;
  }

  .prose-block .prose p{
    margin:0 0 12px;
  }

  .prose-block .prose ul,
  .prose-block .prose ol{
    margin:8px 0 12px 20px;
  }

  .prose-block .prose table{
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    white-space:nowrap;
    margin:12px -2px 4px;
  }

  .prose-block .prose th,
  .prose-block .prose td{
    padding:9px 10px;
    font-size:13px;
  }
}


/* Glossary */
#glossaryGrid{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.g-card{
  padding:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  box-shadow:var(--shadow);
  background:var(--card);
  cursor:pointer;
  transition:all var(--transition);
}
.g-card:hover{
  border-color:var(--accent);
  box-shadow:var(--shadow-hover);
}
.g-card.open{
  border-color:var(--accent);
  box-shadow:var(--shadow-hover);
}

.g-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:12px 16px;
  -webkit-appearance:none;
  appearance:none;
  background:none;
  border:none;
  font-family:inherit;
  font-size:inherit;
  color:inherit;
  text-align:left;
  cursor:pointer;
  width:100%;
}
.g-head > span:first-child{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
  flex:1;
}
.g-head .g-title{
  font-size:14px;
  font-weight:600;
  color:var(--text);
}
.g-head .g-preview{
  font-size:13px;
  color:var(--muted);
  font-weight:500;
  line-height:1.45;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.g-card.open .g-preview{
  -webkit-line-clamp:unset;
  display:block;
}
.g-toggle{
  width:22px;
  height:22px;
  border-radius:50%;
  background:var(--accent-bg);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  transition:transform .2s ease;
}
.g-toggle svg{
  width:13px;
  height:13px;
  color:var(--accent);
  transition:transform .2s ease;
}
.g-card.open .g-toggle svg{transform:rotate(180deg)}

.g-body{
  max-height:0;
  overflow:hidden;
  transition:max-height .3s ease;
}
.g-card.open .g-body{
  max-height:700px;
}
.g-body-inner{
  padding:0 16px 14px;
  border-top:1px solid var(--line);
  margin-top:0;
  padding-top:14px;
}
.g-body .g-def{
  font-size:14.5px;
  color:#334155;
  line-height:1.72;
  margin-bottom:10px;
}
.g-body .g-section{margin-bottom:8px}
.g-body .g-section-title{
  font-size:12px;
  color:var(--muted);
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.4px;
  margin-bottom:4px;
}
.g-body .g-example{
  padding:10px 14px;
  border-left:3px solid var(--accent);
  border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  background:var(--accent-bg);
  font-size:13.5px;
  color:#475569;
  line-height:1.6;
}
.g-body .g-ref{
  font-size:13px;
  margin-top:3px;
}
.g-body .g-ref a{
  color:var(--accent);
  text-decoration:underline;
}
.g-body .g-related{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:6px;
}
.g-body .g-related a{
  padding:4px 9px;
  border-radius:20px;
  background:rgba(0,0,0,.04);
  font-size:13px;
  font-weight:600;
  transition:all var(--transition);
}
.g-body .g-related a:hover{
  background:var(--accent-bg);
  color:var(--accent);
}
.g-filter{margin-bottom:12px}

/* Glossary toolbar */
.glossary-toolbar{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
  flex-wrap:wrap;
}
.glossary-search-wrap{
  position:relative;
  flex:1;
  min-width:200px;
}
.glossary-search-icon{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  color:var(--muted);
  pointer-events:none;
}
.glossary-search-input{
  width:100%;
  padding:10px 14px 10px 38px;
  border:1.5px solid var(--line);
  border-radius:var(--radius);
  font-size:15px;
  background:var(--bg);
  color:var(--text);
  transition:border-color .2s;
  outline:none;
  font-family:inherit;
}
.glossary-search-input:focus{
  border-color:var(--accent);
}
.glossary-search-input::placeholder{
  color:var(--muted);
}
.glossary-count{
  font-size:13px;
  color:var(--muted);
  font-weight:600;
  white-space:nowrap;
}

/* Alphabet nav */
.alpha-nav{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-bottom:14px;
}
.alpha-btn{
  min-width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1.5px solid var(--line);
  border-radius:20px;
  background:var(--card);
  color:var(--muted);
  font-size:13px;
  font-weight:500;
  cursor:pointer;
  transition:all var(--transition);
  font-family:inherit;
  padding:0 8px;
}
.alpha-btn:hover{
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-bg);
}
.alpha-btn.active{
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-bg);
  font-weight:600;
}

/* Timeline */
.progress-bar{
  display:grid;
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:6px;
  margin:10px 0 20px;
}
.progress-bar .step{
  height:8px;
  border-radius:20px;
  background:var(--line);
}
.progress-bar .step.done{background:var(--accent)}
.progress-bar .step.current{
  background:linear-gradient(90deg,var(--warn),#fbbf24);
}

.legend{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin:6px 0 6px;
  color:var(--muted);
  font-size:13px;
  font-weight:600;
}
.legend span{
  display:flex;
  align-items:center;
  gap:6px;
}
.legend .dot-leg{
  width:9px;
  height:9px;
  border-radius:50%;
  display:inline-block;
}

.tl-item{
  position:relative;
  padding-left:42px;
  padding-bottom:22px;
  border-left:2px solid var(--line);
  margin-left:16px;
  cursor:pointer;
  transition:all var(--transition);
}
.tl-item:last-child{
  border-left-color:transparent;
  padding-bottom:0;
}
.tl-item .tl-num{
  position:absolute;
  left:-16px;
  top:0;
  width:30px;
  height:30px;
  border-radius:50%;
  background:var(--accent);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  font-weight:700;
  box-shadow:0 3px 10px rgba(37,99,235,.18);
}
.tl-item:hover .tl-num{transform:scale(1.05)}
.tl-item .tl-title{
  font-size:18px;
  line-height:1.3;
  font-weight:600;
  margin-bottom:4px;
}
.tl-item .tl-desc{
  font-size:15px;
  color:var(--muted);
  line-height:1.65;
}
.tl-item .tl-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:6px;
}
.tl-item .tl-badge{
  padding:4px 10px;
  border-radius:20px;
  background:rgba(0,0,0,.04);
  color:var(--muted);
  font-size:11.5px;
  font-weight:700;
}
.tl-item .tl-badge.time{
  background:rgba(22,163,74,.08);
  color:var(--success);
}
.tl-item .tl-extra{
  max-height:0;
  overflow:hidden;
  opacity:0;
  transition:max-height .3s ease, opacity .3s ease;
}
.tl-item.open .tl-extra{
  max-height:420px;
  opacity:1;
  margin-top:10px;
}
.tl-extra-inner{
  padding:12px 14px;
  border-radius:12px;
  background:rgba(15,23,42,.03);
  font-size:14px;
  color:#475569;
  line-height:1.65;
  border:1px solid #edf1f6;
}
.tl-extra-inner ul{margin:6px 0 0 16px}
.tl-extra-inner li{margin:3px 0}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-height:38px;
  padding:0 14px;
  border:none;
  border-radius:12px;
  background:rgba(0,0,0,.05);
  color:var(--text);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:all var(--transition);
}
.btn:hover{background:rgba(0,0,0,.09)}
.btn.primary{
  background:var(--accent);
  color:#fff;
}
.btn.primary:hover{background:#1d4ed8}
.btn-primary{background:var(--accent);color:#fff;border-color:var(--accent);border:1.5px solid var(--accent)}
.btn-primary:hover{opacity:.9;transform:translateY(-1px)}
.btn-outline{background:transparent;color:var(--accent);border:1.5px solid var(--accent)}
.btn-outline:hover{background:var(--accent);color:#fff}

/* Footer */
.foot{
  width:100%;
  margin-top:32px;
  padding:20px 0 24px;
}

.foot-inner{
  width:min(100% - 40px,1240px);
  margin:0 auto;
  padding:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:12px;
}

.foot-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  width:100%;
}

.foot-nav{
  display:flex;
  flex-wrap:wrap;
  gap:4px 12px;
  width:100%;
}
.foot-nav a{
  padding:0;
  border-radius:0;
  background:none;
  color:#8b97a8;
  font-size:12.5px;
  font-weight:600;
  transition:color var(--transition);
}
.foot-nav a:hover{
  color:var(--accent);
  background:none;
}

.foot-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:4px 8px;
  font-size:12.5px;
  color:#8b97a8;
  line-height:1.6;
}

.foot-meta a{
  color:#8b97a8;
  transition:color var(--transition);
}
.foot-meta a:hover{color:var(--accent)}

.foot-links{
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
}

.foot-note{
  color:#8b97a8;
}

.foot-copy{
  color:#8b97a8;
}

.foot-sep{
  color:#c5cdd8;
}
.foot-social{
  display:flex;
  gap:6px;
  flex-shrink:0;
}
.foot-social a{
  display:flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:10px;
  background:#eef2f6;
  color:#8a909a;
  transition:all var(--transition);
}
.foot-social a:hover{
  color:var(--accent);
  background:var(--accent-bg);
}

.foot-bot{
  margin-top:2px;
  padding-top:12px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:#9aa1ad;
  font-size:11.5px;
  line-height:1.6;
  width:100%;
}

/* Cookie */
.cookie-banner{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:200;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
  padding:12px 16px;
  background:var(--card);
  border-top:1px solid var(--line);
  box-shadow:0 -4px 20px rgba(0,0,0,.08);
}

.cookie-banner p{
  max-width:520px;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.cookie-banner a{
  color:var(--accent);
  text-decoration:underline;
}

.cookie-banner button{
  flex-shrink:0;
  padding:8px 16px;
  border:none;
  border-radius:20px;
  background:var(--accent);
  color:#fff;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
.cookie-banner button:hover{background:#1d4ed8}
.cookie-banner.dismissed{display:none}

/* Back to top */
.btt,
.back-to-top{
  position:fixed;
  right:24px;
  bottom:24px;
  width:38px;
  height:38px;
  border:none;
  border-radius:50%;
  background:#f1f5f9;
  color:#7b8694;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:none;
  opacity:0;
  transform:translateY(8px);
  transition:all .22s ease;
  z-index:100;
}
.btt.show,
.back-to-top.visible{
  opacity:1;
  transform:translateY(0);
}
.btt:hover,
.back-to-top:hover{
  background:var(--accent-bg);
  color:var(--accent);
}

/* Tablet */
@media (max-width:900px){
  .wrap{
    width:min(100% - 24px,980px);
    padding-top:16px;
  }

  .cards,
  .grid{
    grid-template-columns:1fr 1fr;
    gap:12px;
  }

  .topbar{
    flex-wrap:wrap;
    gap:6px 10px;
    padding:8px 12px;
  }
  .brand{
    font-size:13px;
  }
  .brand .bname{
    font-size:13px;
  }
  .brand-mark{
    width:24px;
    height:24px;
  }
  .brand .logo{
    width:24px;
    height:24px;
  }

  .nav{
    order:3;
    flex:none;
    width:100%;
    justify-content:flex-start;
    gap:3px;
  }

  .nav a{
    padding:6px 9px;
    font-size:12.5px;
  }

  .hero h1,
  .item-hero h1{font-size:26px}

  .hero p,
  .item-hero p,
  .hero .lead,
  .item-hero .lead{font-size:15px}
}

/* Chip buttons */
.chip{
  display:inline-flex;
  align-items:center;
  padding:6px 14px;
  border-radius:20px;
  border:1.5px solid var(--line);
  background:var(--card);
  color:var(--muted);
  font-size:13px;
  font-weight:500;
  font-family:inherit;
  cursor:pointer;
  transition:all var(--transition);
  line-height:1.4;
  white-space:nowrap;
}
.chip:hover,
.chip:focus-visible{
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-bg);
  font-weight:600;
}

/* Keyboard focus outlines */
:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}

/* Buttons & inputs inherit font */
button,
input,
select,
textarea{
  font-family:inherit;
}


/* Safe-area for notched phones */
@supports(padding:env(safe-area-inset-bottom)){
  .foot{padding-bottom:calc(24px + env(safe-area-inset-bottom))}
  .topbar{padding-left:calc(14px + env(safe-area-inset-left));padding-right:calc(14px + env(safe-area-inset-right))}
}

/* Mobile */
@media (max-width:767px){
  .wrap{
    width:min(100% - 20px,767px);
    padding-top:12px;
  }

  .topbar{
    flex-wrap:wrap;
    gap:6px;
    padding:10px 12px 8px;
  }

  .brand{
    font-size:14px;
    gap:8px;
  }

  .nav{
    order:3;
    flex:none;
    width:100%;
    justify-content:flex-start;
    gap:2px;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    margin-top:2px;
  }
  .nav::-webkit-scrollbar{display:none}

  .nav a{
    font-size:13px;
    padding:6px 10px;
    white-space:nowrap;
    min-height:36px;
    display:inline-flex;
    align-items:center;
  }

  .lang-switch{
    gap:1px;
    padding:2px;
  }
  .lang-switch a{
    font-size:12px;
    padding:4px 8px;
    min-height:28px;
    display:inline-flex;
    align-items:center;
  }

  .hero,
  .item-hero{
    padding:18px 16px;
    border-radius:var(--radius-sm);
  }

  .hero h1{
    font-size:24px;
  }

  .item-hero h1{
    font-size:20px;
  }

  .hero p,
  .hero .lead{
    font-size:14px;
  }

  .hero-actions .btn{
    font-size:13px;
    padding:10px 16px;
    min-height:44px;
  }

  .cards,
  .grid{
    grid-template-columns:1fr;
    gap:10px;
  }

  .card{
    border-radius:var(--radius-sm);
  }

  .card.card-link,
  a.card{
    padding:16px;
  }

  .hero-search{
    flex-direction:column;
    max-width:100%;
  }
  .hero-search input{
    min-height:44px;
  }
  .hero-search button{
    min-height:44px;
    width:100%;
  }

  .search-form{
    grid-template-columns:minmax(0,1fr);
  }
  .search-form input{
    min-height:44px;
  }
  .search-form button{
    width:100%;
    min-height:44px;
  }

  .stat-strip{
    grid-template-columns:repeat(2,1fr);
  }
  .stat-strip .stat-num{
    font-size:20px;
  }

  .stat-grid{
    grid-template-columns:repeat(2,1fr);
  }

  /* section-nav stays horizontal scroll on mobile -- no grid override */

  .filter-bar{
    flex-wrap:wrap;
  }

  .item-layout{
    display:flex;
    flex-direction:column;
    gap:14px;
  }

  .item-aside{
    order:99;
  }

  .basics-grid{
    grid-template-columns:1fr;
  }
  .basics-side{
    position:static;
  }

  .related-grid{
    grid-template-columns:1fr;
  }

  /* Footer mobile – ultra-compact */
  .foot{
    margin-top:24px;
    padding:12px 0 14px;
  }
  .foot-inner{
    width:min(100% - 20px,767px);
    gap:8px;
  }
  .foot-top{
    flex-direction:row;
    align-items:center;
    gap:8px;
  }
  .foot-nav{
    gap:2px 10px;
    flex-wrap:wrap;
  }
  .foot-nav a{
    font-size:12px;
  }
  .foot-social a{
    width:28px;
    height:28px;
    border-radius:8px;
  }
  .foot-social a svg{
    width:15px;
    height:15px;
  }
  .foot-meta{
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    gap:2px 6px;
  }
  .foot-sep{
    display:inline;
  }
  .foot-note{
    font-size:10.5px;
    line-height:1.4;
  }
  .foot-copy{
    font-size:10.5px;
  }

  /* Timeline mobile */
  .tl-line{left:18px}
  .tl-event{padding-left:44px}
  .tl-dot{left:12px;width:12px;height:12px}

  /* Compact topbar on scroll – mobile overrides */
  .topbar.topbar-compact{
    flex-wrap:nowrap;
    gap:4px;
    padding:5px 8px;
  }
  .topbar-compact .brand{
    gap:4px;
    min-width:auto;
  }
  .topbar-compact .brand-mark{
    width:22px;
    height:22px;
  }
  .topbar-compact .brand .logo{
    width:22px;
    height:22px;
    font-size:13px;
  }
  .topbar-compact #brandText{
    display:none;
  }
  .topbar-compact .nav{
    order:0;
    width:auto;
    flex:1;
    min-width:0;
    margin-top:0;
    gap:2px;
    overflow-x:auto;
  }
  .topbar-compact .nav a{
    font-size:11px;
    padding:4px 6px;
    min-height:26px;
  }
  .topbar-compact .lang-switch a{
    font-size:10px;
    padding:2px 5px;
    min-height:22px;
  }
}

/* Small phones */
@media (max-width:380px){
  .topbar{padding:8px 10px 6px}
  .brand{
    font-size:13px;
    gap:6px;
  }
  .brand-mark{
    width:24px;
    height:24px;
  }
  .brand .bname{
    font-size:13px;
  }
  .nav a{
    font-size:13px;
    padding:5px 8px;
    min-height:32px;
  }
  .lang-switch{
    gap:0;
    padding:2px;
  }
  .lang-switch a{
    font-size:10.5px;
    padding:3px 6px;
    min-height:24px;
  }

  .hero,
  .item-hero{
    padding:16px 14px;
  }

  .hero h1{
    font-size:22px;
  }

  .item-hero h1{
    font-size:18px;
  }

  .hero-actions .btn{
    font-size:13px;
    padding:8px 12px;
  }

  .card h3{font-size:15px}
  .card > p{font-size:13.5px}
}

/* ── Hamburger menu button ── */
.hamburger{
  display:none;
  width:36px;
  height:36px;
  border:none;
  background:none;
  cursor:pointer;
  padding:6px;
  border-radius:8px;
  color:var(--text);
  transition:background var(--transition);
  flex-shrink:0;
}
.hamburger:hover{background:rgba(15,23,42,.06)}
.hamburger svg{display:block;width:24px;height:24px}

@media(max-width:600px){
  .hamburger{display:flex;align-items:center;justify-content:center}
  .topbar{flex-wrap:nowrap}
  .nav{
    display:none;
    position:absolute;
    top:100%;
    left:0;
    right:0;
    flex-direction:column;
    background:rgba(255,255,255,.97);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    border:1px solid var(--line);
    border-radius:0 0 12px 12px;
    box-shadow:0 8px 24px rgba(0,0,0,.1);
    padding:8px;
    margin:0;
    width:auto;
    order:0;
    z-index:99;
    gap:2px;
  }
  .nav.nav-open{
    display:flex;
  }
  .nav a{
    width:100%;
    padding:10px 14px;
    border-radius:10px;
    font-size:14px;
    text-align:left;
  }
  .topbar{position:relative}
}

/* Skip-to-content link (accessibility) */
.skip-link{position:absolute;top:-40px;left:0;background:var(--accent);color:#fff;padding:8px 16px;z-index:9999;font-size:14px;font-weight:600;border-radius:0 0 8px 0;transition:top .2s;text-decoration:none}
.skip-link:focus{top:0}
/* ═══════════════════════════════════════════════════════════ */
/* COMPAT: flex-gap fallback (Chrome <84, Safari iOS <14.1)   */
/* JS adds .no-fg to <html> when flex gap is not supported    */
/* ═══════════════════════════════════════════════════════════ */

/* --- row containers --- */
.no-fg .topbar>*+*{margin-left:24px}
.no-fg .brand>*+*{margin-left:10px}
.no-fg .nav>*+*{margin-left:8px}
.no-fg .lang-switch>*+*{margin-left:2px}
.no-fg .seg>*+*{margin-left:2px}
.no-fg .foot-top>*+*{margin-left:16px}
.no-fg .foot-social>*+*{margin-left:6px}
.no-fg .foot-bot>*+*{margin-left:12px}
.no-fg .section-head>*+*{margin-left:12px}
.no-fg .filter-bar>*+*{margin-left:6px}
.no-fg .sec-head>*+*{margin-left:6px}
.no-fg .g-head>*+*{margin-left:10px}
.no-fg .legend span>*+*{margin-left:6px}

/* --- column containers --- */
.no-fg .foot-inner>*+*{margin-top:12px}
.no-fg #glossaryGrid>*+*{margin-top:8px}
.no-fg .item-main>*+*{margin-top:18px}
.no-fg .item-layout>*+*{margin-top:14px}
.no-fg .item-actions>*+*{margin-top:10px}
.no-fg .toc-links>*+*{margin-top:4px}
.no-fg .g-head>span:first-child>*+*{margin-top:3px}

/* --- wrap containers (use both margin-left and margin-top for wrapping) --- */
.no-fg .hero-actions>*{margin:0 10px 10px 0}
.no-fg .hero .links>*{margin:0 8px 8px 0}
.no-fg .foot-nav>*{margin:4px 12px 0 0}
.no-fg .foot-meta>*{margin:4px 8px 0 0}
.no-fg .alpha-nav>*{margin:0 4px 4px 0}
.no-fg .popular .tags>*{margin:0 8px 8px 0}
.no-fg .glossary-toolbar>*{margin:0 12px 12px 0}
.no-fg .legend>*{margin:0 14px 14px 0}
.no-fg .tl-item .tl-meta>*{margin:0 8px 8px 0}
.no-fg .empty .suggestions>*{margin:0 6px 6px 0}
.no-fg .g-body .g-related>*{margin:0 6px 6px 0}
.no-fg .cookie-banner>*{margin:0 12px 12px 0}

/* ═══════════════════════════════════════════════════════
   Section color accents – subtle tints per content category
   ═══════════════════════════════════════════════════════ */

/* Category left border accents on cards – uses box-shadow to avoid border shorthand conflict */
.card[data-section="rights"]      { box-shadow: inset 3px 0 0 rgba(37,99,235,.55), var(--shadow) }
.card[data-section="power"]       { box-shadow: inset 3px 0 0 rgba(124,58,237,.5), var(--shadow) }
.card[data-section="about"]       { box-shadow: inset 3px 0 0 rgba(14,165,133,.5), var(--shadow) }
.card[data-section="history"]     { box-shadow: inset 3px 0 0 rgba(161,98,7,.5), var(--shadow) }
.card[data-section="referendum"],
.card[data-section="post_referendum"] { box-shadow: inset 3px 0 0 rgba(220,38,38,.4), var(--shadow) }
.card[data-section="myths"]       { box-shadow: inset 3px 0 0 rgba(236,72,153,.45), var(--shadow) }
.card[data-section="participation"]{ box-shadow: inset 3px 0 0 rgba(5,150,105,.5), var(--shadow) }
.card[data-section="practical"]   { box-shadow: inset 3px 0 0 rgba(100,116,139,.45), var(--shadow) }
.card[data-section="local"]       { box-shadow: inset 3px 0 0 rgba(217,119,6,.5), var(--shadow) }
.card[data-section="constitutional_laws"] { box-shadow: inset 3px 0 0 rgba(79,70,229,.45), var(--shadow) }

/* Eyebrow color per section */
.card[data-section="rights"] .eyebrow      { color: #2563eb }
.card[data-section="power"] .eyebrow       { color: #7c3aed }
.card[data-section="about"] .eyebrow       { color: #0ea585 }
.card[data-section="history"] .eyebrow     { color: #a16207 }
.card[data-section="referendum"] .eyebrow,
.card[data-section="post_referendum"] .eyebrow { color: #dc2626 }
.card[data-section="myths"] .eyebrow       { color: #db2777 }
.card[data-section="participation"] .eyebrow{ color: #059669 }
.card[data-section="practical"] .eyebrow   { color: #64748b }
.card[data-section="local"] .eyebrow       { color: #d97706 }
.card[data-section="constitutional_laws"] .eyebrow { color: #4f46e5 }

/* ═══════════════════════════════════════════════════════
   Compare page – alternating section backgrounds
   ═══════════════════════════════════════════════════════ */
.compare-section:nth-child(even) {
  background: rgba(37,99,235,.03);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  margin-left: -16px;
  margin-right: -16px;
}

/* ═══════════════════════════════════════════════════════
   Glossary – alphabet group headers
   ═══════════════════════════════════════════════════════ */
.g-letter-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.g-letter-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ═══════════════════════════════════════════════════════
   Featured → All cards divider on homepage
   ═══════════════════════════════════════════════════════ */
.section-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 18px;
}
.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.section-divider h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   Disclaimer footer – subtle accent background
   ═══════════════════════════════════════════════════════ */
.disclaimer-bar {
  background: rgba(37,99,235,.04);
  border-top: 1px solid rgba(37,99,235,.08);
  padding: 14px 0;
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* Preserve inset accent on hover */
a.card[data-section]:hover,
.card-link[data-section]:hover {
  box-shadow: inset 3px 0 0 currentColor, var(--shadow-hover);
}
.card[data-section="rights"]:hover      { box-shadow: inset 3px 0 0 rgba(37,99,235,.6), var(--shadow-hover) }
.card[data-section="power"]:hover       { box-shadow: inset 3px 0 0 rgba(124,58,237,.5), var(--shadow-hover) }
.card[data-section="about"]:hover       { box-shadow: inset 3px 0 0 rgba(14,165,133,.5), var(--shadow-hover) }
.card[data-section="history"]:hover     { box-shadow: inset 3px 0 0 rgba(161,98,7,.5), var(--shadow-hover) }
.card[data-section="referendum"]:hover,
.card[data-section="post_referendum"]:hover { box-shadow: inset 3px 0 0 rgba(220,38,38,.4), var(--shadow-hover) }
.card[data-section="myths"]:hover       { box-shadow: inset 3px 0 0 rgba(236,72,153,.5), var(--shadow-hover) }
.card[data-section="participation"]:hover{ box-shadow: inset 3px 0 0 rgba(5,150,105,.5), var(--shadow-hover) }
.card[data-section="practical"]:hover   { box-shadow: inset 3px 0 0 rgba(100,116,139,.5), var(--shadow-hover) }
.card[data-section="local"]:hover       { box-shadow: inset 3px 0 0 rgba(217,119,6,.5), var(--shadow-hover) }
.card[data-section="constitutional_laws"]:hover { box-shadow: inset 3px 0 0 rgba(79,70,229,.5), var(--shadow-hover) }

/* Single-line footer */
.foot-meta--single {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
}
.foot-meta--single .foot-copy {
  font-weight: 600;
}
.foot-meta--single .foot-sep {
  opacity: .4;
}
.foot-meta--single .foot-note {
  opacity: .8;
}

/* ═══════════════════════════════════════════════════════
   Unification fixes — mobile overflow, tap targets, spacing
   ═══════════════════════════════════════════════════════ */

/* Fix mobile overflow on /p/* pages */
.item-main,
.prose-block,
.card.prose {
  max-width: 100%;
  overflow-x: auto;
  overflow-wrap: break-word;
  word-break: break-word;
}

.card.prose table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent any child from pushing beyond viewport */
@media (max-width: 767px) {
  .item-main {
    max-width: 100vw;
    overflow-x: hidden;
  }
  .prose-block {
    padding: 16px 14px;
  }
  .card.prose pre,
  .card.prose code {
    white-space: pre-wrap;
    word-break: break-all;
  }
}

/* Chat widget — prevent overlap with content */
.wrap {
  padding-bottom: 72px;
}

/* TOC tap targets — minimum 44px per Apple HIG */
.toc-links a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 6px 0;
}

/* Footer · separator — ensure it renders */
.foot-sep {
  display: inline;
  margin: 0 4px;
  opacity: .4;
  font-weight: 400;
}

/* Mobile footer — allow wrapping */
@media (max-width: 600px) {
  .foot-meta--single {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
  .foot-sep {
    display: none;
  }
}

/* Skeleton loader */
.skeleton-card{padding:20px;border-radius:var(--radius-sm,10px);background:var(--card);border:1px solid var(--line)}
.skeleton-line{height:14px;background:linear-gradient(90deg,var(--line) 25%,var(--bg) 50%,var(--line) 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:6px;margin-bottom:10px}
.skeleton-line.short{width:60%}
.skeleton-line.medium{width:80%}
.skeleton-line.title{height:18px;width:70%;margin-bottom:14px}
@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}

/* Article-level TOC in sidebar */
.toc-articles{display:flex;flex-wrap:wrap;gap:2px 4px;padding:2px 0 6px 8px}
.toc-article-link{font-size:10px;padding:2px 6px;color:var(--muted);border-radius:4px;text-decoration:none;white-space:nowrap;transition:all var(--transition)}
.toc-article-link:hover{background:var(--accent-bg);color:var(--accent)}
.toc-article-link.active{color:var(--accent);font-weight:700;background:var(--accent-bg)}

/* ═══════════════════════════════════════════════════════════
   WCAG 2.1 AA — added 2026-03-31
   ═══════════════════════════════════════════════════════════ */

/* Focus indicators (WCAG 2.4.7) */
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
a:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* Ensure minimum tap target (WCAG 2.5.8 - 44x44 minimum) */
.nav a,.lang-switch a,.filter-bar button{min-height:44px;display:inline-flex;align-items:center}

/* Reduced motion (WCAG 2.3.3) */
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* Feedback block */
.feedback-block{text-align:center;padding:20px;margin:24px 0}
.feedback-question{font-size:14px;font-weight:600;color:var(--text);margin-bottom:12px}
.feedback-buttons{display:flex;gap:12px;justify-content:center}
.feedback-btn{width:44px;height:44px;border-radius:50%;border:1.5px solid var(--line);background:var(--card);color:var(--muted);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--transition)}
.feedback-yes:hover{border-color:#22c55e;color:#22c55e;background:#f0fdf4}
.feedback-no:hover{border-color:#ef4444;color:#ef4444;background:#fef2f2}
.feedback-thanks{font-size:13px;color:var(--muted);font-style:italic}

/* Print button */
.print-btn{background:none;border:1px solid var(--line);border-radius:6px;padding:4px 10px;font-size:12px;cursor:pointer;color:var(--muted)}

/* Print styles */
@media print{
  .topbar,.foot,.item-aside,.janus-fab,.janus-panel,.feedback-block,.item-nav,.skip-link{display:none!important}
  .item-layout{display:block!important}
  .item-main{max-width:100%!important;padding:0!important}
  body{font-size:11pt;line-height:1.5;color:#000}
  .card{border:none!important;box-shadow:none!important;background:none!important}
  a{color:#000!important;text-decoration:underline}
  a[href]::after{content:" (" attr(href) ")";font-size:9pt;color:#666}
  a[href^="#"]::after,a[href^="javascript"]::after{content:none}
  .hero,.item-hero{background:none!important;border:none!important}
}

/* Breadcrumb navigation */
.breadcrumb{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin-bottom:8px;flex-wrap:wrap}
.breadcrumb a{color:var(--muted);text-decoration:none}
.breadcrumb a:hover{color:var(--accent)}
.bc-sep{color:var(--line)}

/* Press Kit */
.press-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:16px;margin:24px 0}
.press-stat{text-align:center;padding:24px 16px;background:var(--card);border-radius:var(--radius-sm,10px);border:1px solid var(--line)}
.press-stat-value{font-size:36px;font-weight:800;color:var(--accent);line-height:1}
.press-stat-label{font-size:13px;color:var(--muted);margin-top:6px}

/* Visual Timeline */
.timeline{position:relative;padding:20px 0 20px 40px;margin:24px 0}
.timeline::before{content:'';position:absolute;left:16px;top:0;bottom:0;width:2px;background:var(--accent)}
.tl-item{position:relative;margin-bottom:32px;padding-left:24px}
.tl-item::before{content:'';position:absolute;left:-32px;top:6px;width:12px;height:12px;border-radius:50%;background:var(--accent);border:2px solid var(--card);z-index:1}
.tl-item.tl-future::before{background:var(--line);border-color:var(--muted)}
.tl-year{font-size:14px;font-weight:800;color:var(--accent);margin-bottom:4px}
.tl-title{font-size:16px;font-weight:600;margin-bottom:4px}
.tl-desc{font-size:14px;color:var(--muted);line-height:1.5}
.tl-highlight{background:var(--accent-bg);border-left:3px solid var(--accent);padding:12px 16px;border-radius:0 var(--radius-sm,10px) var(--radius-sm,10px) 0}

