:root {
  --green: #0b7a3b;
  --green-dark: #075a2b;
  --green-light: #e6f4ec;
  --red: #d0212a;
  --blue: #1b4ea3;
  --link-blue: var(--blue);
  --gold: #f2a900;
  --ink: #1c2430;
  --muted: #5f6b7a;
  --line: #dde3ea;
  --bg: #f4f6f8;
  --card: #ffffff;
  --input-bg: #ffffff;
  --input-border: #c9d1da;
  --disabled-bg: #f0f2f4;
  --disabled-text: #8a94a0;
  --alert-error-bg: #fdecec; --alert-error-text: #8f1a20; --alert-error-border: #f5c2c5;
  --alert-info-bg: #e9f0fb; --alert-info-text: #163a7a; --alert-info-border: #c3d4f2;
  --badge-red-bg: #fdecec; --badge-red-text: #8f1a20;
  --badge-blue-bg: #e9f0fb; --badge-blue-text: #163a7a;
  --badge-gold-bg: #fff4d6; --badge-gold-text: #7a5300;
  --badge-grey-bg: #eef1f4;
  --code-bg: #f0f3f6;
  --table-head-bg: #f7f9fb;
  --table-hover-bg: #fafbfc;
  --ph-bg: #e8ecef;
  --alert-success-border: #b7dfc6;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green-dark: #34c778;
    --link-blue: #6ea8ff;
    --green-light: rgba(11, 122, 59, .22);
    --ink: #e9eef0;
    --muted: #9aa7b0;
    --line: #2b3540;
    --bg: #10151a;
    --card: #1a2129;
    --input-bg: #1f2730;
    --input-border: #37424e;
    --disabled-bg: #232b33;
    --disabled-text: #6b7580;
    --alert-error-bg: rgba(208, 33, 42, .16); --alert-error-text: #ff9a9f; --alert-error-border: rgba(208, 33, 42, .4);
    --alert-info-bg: rgba(27, 78, 163, .2); --alert-info-text: #9dc0f5; --alert-info-border: rgba(27, 78, 163, .45);
    --badge-red-bg: rgba(208, 33, 42, .18); --badge-red-text: #ff9a9f;
    --badge-blue-bg: rgba(27, 78, 163, .2); --badge-blue-text: #9dc0f5;
    --badge-gold-bg: rgba(242, 169, 0, .18); --badge-gold-text: #ffcf5c;
    --badge-grey-bg: #232b33;
    --code-bg: #232b33;
    --table-head-bg: #1f2730;
    --table-hover-bg: #1d242c;
    --ph-bg: #1f2730;
    --alert-success-border: rgba(11, 122, 59, .5);
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --green-dark: #34c778;
  --link-blue: #6ea8ff;
  --green-light: rgba(11, 122, 59, .22);
  --ink: #e9eef0;
  --muted: #9aa7b0;
  --line: #2b3540;
  --bg: #10151a;
  --card: #1a2129;
  --input-bg: #1f2730;
  --input-border: #37424e;
  --disabled-bg: #232b33;
  --disabled-text: #6b7580;
  --alert-error-bg: rgba(208, 33, 42, .16); --alert-error-text: #ff9a9f; --alert-error-border: rgba(208, 33, 42, .4);
  --alert-info-bg: rgba(27, 78, 163, .2); --alert-info-text: #9dc0f5; --alert-info-border: rgba(27, 78, 163, .45);
  --badge-red-bg: rgba(208, 33, 42, .18); --badge-red-text: #ff9a9f;
  --badge-blue-bg: rgba(27, 78, 163, .2); --badge-blue-text: #9dc0f5;
  --badge-gold-bg: rgba(242, 169, 0, .18); --badge-gold-text: #ffcf5c;
  --badge-grey-bg: #232b33;
  --code-bg: #232b33;
  --table-head-bg: #1f2730;
  --table-hover-bg: #1d242c;
  --ph-bg: #1f2730;
  --alert-success-border: rgba(11, 122, 59, .5);
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 15px; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* Top bar with party stripe */
.stripe { height: 6px; background: linear-gradient(90deg, var(--green) 0 33%, #fff 33% 66%, var(--red) 66%); }
header.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
header.topbar .inner { max-width: 1200px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 700; }
.brand img { height: 52px; width: auto; max-width: 120px; object-fit: contain; border-radius: 6px; }
.brand .fallback { height: 46px; width: 46px; border-radius: 50%; background: conic-gradient(var(--green) 0 50%, var(--red) 50% 75%, var(--blue) 75%); color: #fff; display: grid; place-items: center; font-size: .8rem; letter-spacing: .5px; }
.brand .t1 { font-size: 1rem; line-height: 1.1; } .brand .t2 { font-size: .72rem; color: var(--muted); font-weight: 500; letter-spacing: .3px; }
nav.main { margin-left: auto; display: flex; gap: .3rem; flex-wrap: wrap; }
nav.main a { padding: .45rem .8rem; border-radius: 8px; color: var(--ink); font-weight: 500; }
nav.main a:hover, nav.main a.active { background: var(--green-light); color: var(--green-dark); text-decoration: none; }
.theme-toggle { background: none; border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 38px; font-size: 1rem; line-height: 1; cursor: pointer; color: var(--ink); display: inline-grid; place-items: center; }
.theme-toggle:hover { background: var(--bg); }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; }
.narrow { max-width: 760px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem; border-radius: 9px; border: 1px solid transparent; font-weight: 600; cursor: pointer; font-size: .95rem; transition: .15s; background: var(--green); color: #fff; }
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); } .btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--red); } .btn.danger:hover { background: #a3161d; }
.btn.blue { background: var(--blue); }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* Cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid.cols-8-4 { grid-template-columns: 2fr 1fr; }
.grid.leaders-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.stat .n { font-size: 1.9rem; font-weight: 700; color: var(--green-dark); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat.red .n { color: var(--red); } .stat.blue .n { color: var(--blue); } .stat.gold .n { color: #b57d00; }

/* Forms */
.form-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field.full { grid-column: 1 / -1; }
label { font-weight: 600; font-size: .88rem; }
label .req { color: var(--red); }
input, select, textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--input-border); border-radius: 8px; font: inherit; background: var(--input-bg); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(11,122,59,.35); border-color: var(--green); }
select:disabled, input:disabled { background: var(--disabled-bg); color: var(--disabled-text); }
textarea { min-height: 110px; resize: vertical; }
.help { font-size: .8rem; color: var(--muted); }
.alert { padding: .75rem 1rem; border-radius: 9px; margin: .75rem 0; font-size: .92rem; }
.alert.error { background: var(--alert-error-bg); color: var(--alert-error-text); border: 1px solid var(--alert-error-border); }
.alert.success { background: var(--green-light); color: var(--green-dark); border: 1px solid var(--alert-success-border); }
.alert.info { background: var(--alert-info-bg); color: var(--alert-info-text); border: 1px solid var(--alert-info-border); }

/* Stepper */
.steps { display: flex; gap: .4rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.steps .s { flex: 1; min-width: 140px; padding: .55rem .7rem; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.steps .s b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: .8rem; }
.steps .s.active { border-color: var(--green); color: var(--green-dark); background: var(--green-light); }
.steps .s.active b { background: var(--green); color: #fff; }
.steps .s.done b { background: var(--green-dark); color: #fff; }

/* Map */
.map { height: 340px; border-radius: 10px; border: 1px solid var(--line); background: var(--ph-bg); z-index: 0; }
.map.tall { height: 520px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--table-head-bg); font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
tr:hover td { background: var(--table-hover-bg); }
td.num, th.num { text-align: right; }
.bar { height: 8px; background: var(--green-light); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); }

/* Badges & chips */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--green-light); color: var(--green-dark); }
.badge.red { background: var(--badge-red-bg); color: var(--badge-red-text); } .badge.blue { background: var(--badge-blue-bg); color: var(--badge-blue-text); } .badge.gold { background: var(--badge-gold-bg); color: var(--badge-gold-text); } .badge.grey { background: var(--badge-grey-bg); color: var(--muted); }
.code { font-family: Consolas, "Courier New", monospace; background: var(--code-bg); padding: .15rem .45rem; border-radius: 6px; font-size: .9em; }
.refbox { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.refbox input { flex: 1; min-width: 200px; font-family: Consolas, monospace; }

/* Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: .6rem .9rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--green-dark); border-bottom-color: var(--green); }

/* Hero (landing) */
.hero { background: linear-gradient(135deg, var(--green-dark), var(--green) 60%, #0e9a4d); color: #fff; padding: 3rem 1rem; }
.hero .inner { max-width: 1200px; margin: 0 auto; display: grid; gap: 2rem; grid-template-columns: 1.3fr 1fr; align-items: center; }
.hero h1 { font-size: 2.3rem; margin-bottom: .6rem; }
.hero .motto { display: inline-block; background: var(--red); color: #fff; padding: .35rem .9rem; border-radius: 6px; font-weight: 700; letter-spacing: .3px; margin-bottom: 1rem; }
.hero p { font-size: 1.05rem; opacity: .95; max-width: 560px; }
.hero .btn.secondary { background: #fff; color: var(--green-dark); border-color: #fff; }
.hero .logo-big { width: 100%; max-width: 360px; justify-self: center; filter: drop-shadow(0 6px 20px rgba(0,0,0,.3)); border-radius: 16px; }
.feature { display: flex; gap: .9rem; }
.feature .ic { width: 44px; height: 44px; border-radius: 10px; background: var(--green-light); color: var(--green-dark); display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.leader { text-align: center; }
.leader img, .leader .ph { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; object-position: top; margin: 0 auto .7rem; display: block; border: 4px solid var(--green-light); background: var(--ph-bg); }
.leader.lg img, .leader.lg .ph { width: 190px; height: 190px; }
.leader .ph { display: grid; place-items: center; color: var(--muted); font-size: 2.4rem; font-weight: 700; }
.leader b { display: block; font-size: 1.05rem; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; line-height: 1.6; }
footer.site-footer b { display: inline-block; font-size: 1.1rem; letter-spacing: .2em; color: var(--green-dark); border: 2px solid var(--green-dark); border-radius: 50%; width: 44px; height: 44px; line-height: 40px; margin-bottom: .3rem; }

.avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--green-light); background: var(--ph-bg); }
.profile-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; font-size: .92rem; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin-top: .75rem; }
.filters { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid #ccc; border-top-color: var(--green); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
.chart-bars { display: grid; grid-template-columns: max-content 1fr max-content; gap: .35rem .7rem; align-items: center; font-size: .88rem; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 90px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.spark div { flex: 1; background: var(--green); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.spark div:hover::after { content: attr(data-t); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #1c2430; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: .72rem; white-space: nowrap; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }

.event-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.event-cover { aspect-ratio: 16/9; background: var(--green-light); display: grid; place-items: center; overflow: hidden; }
.event-cover img { width: 100%; height: 100%; object-fit: cover; }
.event-cover-ph { font-size: 2.2rem; }
.event-body { padding: 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.event-tag { align-self: flex-start; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gold); background: #fff6e0; padding: .15rem .5rem; border-radius: 5px; }
.event-body h3 { margin: 0; }
.event-meta { color: var(--muted); font-size: .85rem; }
.event-links { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--line); display: flex; gap: .9rem; flex-wrap: wrap; }
.event-link { font-weight: 600; font-size: .88rem; color: var(--link-blue); }
.event-link.gold { color: var(--green); }

@media (max-width: 800px) {
  .grid.cols-8-4 { grid-template-columns: 1fr; }
  .hero .inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  header.topbar .inner { flex-wrap: wrap; }
  nav.main { margin-left: 0; width: 100%; }
}
@media (max-width: 480px) {
  .grid.leaders-2 { grid-template-columns: 1fr; }
  .container { padding: 1rem .75rem; }
  h1 { font-size: 1.55rem; } h2 { font-size: 1.2rem; }
  .brand img { height: 40px; }
  .brand .t1 { font-size: .9rem; } .brand .t2 { font-size: .65rem; }
  nav.main { gap: .15rem; }
  nav.main a { padding: .4rem .55rem; font-size: .88rem; }
  .hero { padding: 2rem .75rem; }
  .hero h1 { font-size: 1.45rem; }
  .btn { padding: .55rem .9rem; font-size: .9rem; }
  .card { padding: 1rem; }
}
@media print { header.topbar, nav.main, .no-print { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }

.slideshow { position: relative; max-width: 820px; margin: 1rem auto 0; border-radius: var(--radius); overflow: hidden; background: #111; aspect-ratio: 16/10; }
.slideshow .slide { display: none; width: 100%; height: 100%; }
.slideshow .slide.active { display: block; }
.slideshow .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.4); color: #fff; border: none; font-size: 1.2rem; line-height: 1; padding: .6rem .9rem; cursor: pointer; border-radius: 8px; }
.slide-nav:hover { background: rgba(0,0,0,.65); }
.slide-nav.prev { left: 12px; }
.slide-nav.next { right: 12px; }
.slide-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 7px; }
.slide-dots .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; border: none; padding: 0; }
.slide-dots .dot.active { background: #fff; }
.slide-caption { position: absolute; top: 12px; left: 12px; right: 12px; background: rgba(11,122,59,.85); color: #fff; font-weight: 600; font-size: .85rem; padding: .5rem .8rem; border-radius: 8px; }
@media (max-width: 800px) { .slideshow { aspect-ratio: 4/5; } }
.gallery-tabs { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: .75rem 0 1rem; }
.gallery-tab { background: var(--card); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .85rem; padding: .5rem 1rem; border-radius: 999px; cursor: pointer; }
.gallery-tab:hover { background: var(--green-light); }
.gallery-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
