:root {
  /* Brand palette (exact hexes) — used for the flag bar and decorative fills. */
  --brand-hibiscus: #FF1F4D;
  --brand-cyan: #00DFFF;
  --brand-sunshine: #FFE45C;
  /* Deepened, WCAG-AA-safe shades of the brand hues, for links/buttons/text —
     the raw hibiscus/cyan are too light for body-text contrast on white. */
  --accent: #007690;        /* cyan-derived: links, buttons, active states */
  --accent-alert: #D1133B;  /* hibiscus-derived: term-limited badges, errors */
  --ink: #1a1a1a;
  --muted: #606060;
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #e2e4e8;
  --paper: #fbf7ea;
  --paper-line: #e7dcc0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
}
a { color: var(--accent); }
.wrap { max-width: 40rem; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }

.flag-bar {
  height: 6px;
  background: linear-gradient(to right,
    var(--brand-hibiscus) 0 33.33%, var(--brand-cyan) 33.33% 66.66%, var(--brand-sunshine) 66.66% 100%);
}

/* Header / hero */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; padding-top: 0.9rem; }
.logo-link { display: inline-flex; align-items: center; }
.logo-img { height: 42px; width: auto; display: block; }
.toolnote {
  font-size: 0.78rem; color: var(--muted); margin-top: 0.65rem; padding: 0.4rem 0.6rem;
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px;
}
.hero { padding-top: 0.75rem; }
.sections { font-size: 0.82rem; color: var(--muted); margin: 0.65rem 0 0; }
.sections a { font-weight: 600; }
.hero-sub { margin: 0; color: var(--brand-hibiscus); font-weight: 700; font-size: 1.15rem; }
.hero-title { margin: 0.2rem 0 0.35rem; font-size: 2.2rem; line-height: 1.05; letter-spacing: -0.02em; font-weight: 900; color: var(--brand-cyan); }
.hero-lead { margin: 0; color: var(--ink); font-size: 1.1rem; }
.authbar { margin-left: auto; font-size: 0.85rem; text-align: right; white-space: nowrap; }
.authbar a { text-decoration: none; font-weight: 600; }
.authbar .who { color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 0.25rem; margin-top: 1rem; }
.tab { font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer; background: none;
  border: none; padding: 0.5rem 0.75rem; color: var(--muted); border-bottom: 3px solid transparent; }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab .n { font-weight: 400; opacity: 0.7; }

main.wrap { padding-top: 1rem; padding-bottom: 2rem; }
.loading, .empty { color: var(--muted); }
.empty { font-size: 0.9rem; padding: 0.5rem 0; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.15rem 0 0.9rem; }

/* Sort toolbar */
.toolbar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar .lbl { color: var(--muted); font-size: 0.85rem; }
.sortbtn { font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.85rem; color: var(--ink); }
.sortbtn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.count { margin-left: auto; color: var(--muted); font-size: 0.85rem; }

/* Feed cards */
.feed { display: flex; flex-direction: column; gap: 0.75rem; }
.pcard { display: flex; gap: 0.9rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.9rem; }
.pcard .photo, .pcard .photo-ph {
  width: 92px; height: 112px; border-radius: 10px; flex: 0 0 auto;
  object-fit: contain; object-position: center; background: #eceef1;
}
.pcard .photo-ph { display: flex; align-items: center; justify-content: center; color: #9aa0a6; font-weight: 700; font-size: 1.5rem; }
.pcard .info { flex: 1; min-width: 0; }
.pcard h2 { font-size: 1.15rem; margin: 0 0 0.25rem; line-height: 1.15; }
.pcard .positions { margin: 0.3rem 0; padding-left: 1.05rem; font-size: 0.82rem; color: var(--ink); }
.pcard .positions li { margin: 0.08rem 0; }
.pcard .bio { font-size: 0.84rem; color: var(--muted); margin: 0.25rem 0; }
.pcard .cardfoot { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.55rem; flex-wrap: wrap; }
.votes { font-size: 0.8rem; color: var(--muted); }
.votes strong { color: var(--accent); }

/* Badges — blue by default, red for term-limited, no checkmarks */
.badge { display: inline-block; font-weight: 700; font-size: 0.7rem; padding: 0.2rem 0.55rem;
  border-radius: 999px; background: #e0f4f7; color: var(--accent); margin-bottom: 0.2rem; }
.badge.red { background: #ffe6ec; color: var(--accent-alert); }
.note { font-size: 0.78rem; color: var(--muted); font-style: italic; margin: 0.15rem 0; }

/* Buttons */
.btn { font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; padding: 0.35rem 0.75rem; border-radius: 8px; }
.btn.ghost { background: var(--card); color: var(--accent); }
.btn.on { background: #e0f4f7; color: var(--accent); border-color: #aadce4; }
.btn.mini { padding: 0.2rem 0.45rem; font-size: 0.9rem; line-height: 1; border-radius: 6px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* Admin stats */
.statsrow { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.statbox { flex: 1; min-width: 6.5rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.6rem 0.5rem; text-align: center; }
.statn { font-size: 1.5rem; font-weight: 900; color: var(--accent); }
.statl { font-size: 0.72rem; color: var(--muted); }

/* Admin review form */
.admincard { flex-direction: row; }
.admincard .info { display: flex; flex-direction: column; gap: 0.4rem; }
.fld { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.8rem; }
.fld-l { color: var(--muted); font-weight: 600; }
.fld input, .fld textarea { font: inherit; font-size: 0.85rem; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.fldrow { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.chk { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; }
.admincard .cardfoot input { flex: 1; min-width: 8rem; font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; }

/* Add-your-bet card */
.addcard .photo-ph { border: 2px dashed #c3c8cf; background: #f7f8fa; }
.addcard .headicon { width: 44px; height: 44px; }
.addform { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.addform input { font: inherit; flex: 1; min-width: 12rem; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; }
.msg { font-size: 0.8rem; margin-top: 0.4rem; }
.msg.err { color: var(--accent-alert); }
.msg.ok { color: #137333; }

/* ===== Ballot (My Shortlist) ===== */
.section-title { font-size: 1.05rem; margin: 1.4rem 0 0.4rem; }
.ballot-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.ballot-titlerow .section-title { margin: 1.4rem 0 0.4rem; }
.share-btn { white-space: nowrap; }
.privateline { font-size: 0.8rem; color: var(--muted); margin: 0 0 0.6rem; }
.privateline::before { content: "\1F512 "; }

.ballot {
  position: relative; background: var(--paper); border: 1px solid var(--paper-line);
  border-radius: 4px; padding: 0.9rem 1.6rem 1.1rem; margin-bottom: 0.5rem;
  box-shadow: 0 1px 5px rgba(0,0,0,0.09);
  background-image: repeating-linear-gradient(transparent, transparent 33px, rgba(0,0,0,0.04) 34px);
}
/* timing marks + barcode on the side edges */
.ballot::before {
  content: ""; position: absolute; top: 8px; bottom: 8px; left: 5px; width: 8px;
  background-image: repeating-linear-gradient(to bottom, #1a1a1a 0 5px, transparent 5px 12px);
}
.ballot::after {
  content: ""; position: absolute; top: 10px; bottom: 10px; right: 5px; width: 9px;
  background-image: repeating-linear-gradient(to bottom,
    #1a1a1a 0 2px, transparent 2px 4px, #1a1a1a 4px 7px, transparent 7px 9px, #1a1a1a 9px 10px, transparent 10px 13px);
}
.ballot-head { text-align: center; border-bottom: 2px solid #1a1a1a; padding-bottom: 0.35rem; margin-bottom: 0.5rem; }
.ballot-head .k { font-family: "Courier New", monospace; font-size: 0.7rem; letter-spacing: 0.15em; color: #555; }
.ballot-head .t { font-weight: 900; font-size: 1.05rem; letter-spacing: 0.02em; }

.brow { display: flex; align-items: center; gap: 0.55rem; padding: 0.28rem 0; border-bottom: 1px dotted var(--paper-line); }
.brow:last-child { border-bottom: none; }
.brow .grip { cursor: grab; touch-action: none; color: #b3a97f; font-size: 1rem; padding: 0 0.15rem; user-select: none; }
.bubble { width: 24px; height: 15px; border: 2px solid #1a1a1a; border-radius: 999px; flex: 0 0 auto; }
.bubble.filled { background: #1a1a1a; }
.brow .rk { font-weight: 800; width: 1.4rem; text-align: right; font-family: "Courier New", monospace; }
.brow .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow .acts { display: flex; gap: 0.2rem; flex: 0 0 auto; }
.brow.dragging { background: #fffdf5; box-shadow: 0 4px 12px rgba(0,0,0,0.18); border-radius: 6px; position: relative; z-index: 5; }
.emptyballot { text-align: center; color: #8a8266; font-family: "Courier New", monospace; padding: 0.8rem 0; }

.consider .brow { border-bottom-color: var(--line); }
.consider-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.8rem; }

/* ===== Everyone / aggregate ranking ===== */
.tearline { position: relative; height: 22px; margin: 1.1rem 0 0.9rem;
  background: var(--bg);
  filter: drop-shadow(0 2px 1px rgba(0,0,0,0.08));
}
.tearline::before, .tearline::after {
  content: ""; position: absolute; left: 0; right: 0; height: 11px;
  background:
    linear-gradient(135deg, var(--card) 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(-135deg, var(--card) 25%, transparent 25%) 0 0 / 12px 12px;
}
.tearline::before { top: 0; }
.tearline::after { bottom: 0; transform: scaleY(-1); }
.tearlabel { position: relative; z-index: 2; text-align: center; font-weight: 800; font-size: 0.78rem;
  color: var(--accent-alert); letter-spacing: 0.05em; background: var(--bg); display: inline-block;
  padding: 0 0.6rem; left: 50%; transform: translateX(-50%); top: 3px; }
.rankwrap { display: flex; flex-direction: column; gap: 0.75rem; }
.rankwrap .pcard { position: relative; }
.rankno { position: absolute; top: 0.6rem; right: 0.8rem; font-weight: 900; font-size: 1.1rem; color: var(--accent); opacity: 0.5; }

/* Promo pages (up-for-reelection, term-limited, 2025 runners-up, low attendance) */
.promo-nav { font-size: 0.85rem; margin-top: 0.6rem; }
.promo-nav a { font-weight: 600; }
.promo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.6rem; }
.promo-head h1 { font-size: 1.6rem; margin: 0; line-height: 1.15; }
.promo-intro { color: var(--muted); font-size: 0.92rem; margin-top: 0.5rem; }
.promolist { display: flex; flex-direction: column; gap: 0.6rem; }
.promorow { display: flex; align-items: center; gap: 0.8rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.65rem 0.85rem; }
.promo-thumb, .promo-thumb-ph { width: 52px; height: 52px; border-radius: 8px; flex: 0 0 auto; object-fit: cover; background: #eceef1; }
.promo-thumb-ph { display: flex; align-items: center; justify-content: center; color: #9aa0a6; font-weight: 700; font-size: 1.05rem; }
.promorow-body { flex: 1; min-width: 0; }
.promorow-name { font-weight: 700; font-size: 0.95rem; }
.promorow-note { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }
.promorow-meta { flex: 0 0 auto; font-weight: 700; color: var(--accent); font-size: 0.9rem; white-space: nowrap; }
a.listlink { text-decoration: none; color: inherit; }
a.listlink:hover { border-color: var(--accent); }
a.listlink .promorow-name { color: var(--accent); }

/* How they voted */
.votecard { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.1rem; margin-bottom: 1.1rem; }
.votedate { font-size: 0.76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.votetitle { font-size: 1.35rem; margin: 0.15rem 0 0.5rem; }
.votemotion { font-size: 0.9rem; margin: 0 0 0.5rem; }
.votemeaning { font-size: 0.88rem; background: #f2fbfd; border-left: 3px solid var(--accent);
  padding: 0.5rem 0.7rem; border-radius: 0 6px 6px 0; margin: 0 0 0.6rem; }
.voteoutcome { display: inline-block; font-weight: 800; font-size: 0.8rem; letter-spacing: 0.04em;
  background: var(--ink); color: #fff; padding: 0.25rem 0.6rem; border-radius: 999px; margin-bottom: 0.8rem; }
.votegroups { display: flex; gap: 1rem; flex-wrap: wrap; }
.votegroup { flex: 1; min-width: 13rem; }
.votegrouphead { font-size: 0.8rem; margin: 0 0 0.4rem; padding-bottom: 0.25rem; border-bottom: 2px solid var(--line); }
.votegrouphead.yes { color: #137333; border-bottom-color: #137333; }
.votegrouphead.no { color: var(--accent-alert); border-bottom-color: var(--accent-alert); }
.votegrouphead.abstain { color: var(--muted); }
.voterow { display: flex; align-items: center; gap: 0.5rem; padding: 0.22rem 0; }
.votethumb { width: 34px; height: 34px; border-radius: 6px; }
.votename { font-size: 0.86rem; font-weight: 600; }
.votecontext { font-size: 0.84rem; color: var(--muted); margin: 0.9rem 0 0.3rem; }
.votesource { font-size: 0.76rem; color: #8a8f96; margin: 0 0 0.8rem; }
.trackerbadge { display: inline-block; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.06em;
  background: #fff4e5; color: #b45309; border: 1px solid #fed7aa; padding: 0.2rem 0.6rem; border-radius: 999px; margin-bottom: 0.5rem; }
.votecard .votegrouphead { margin-top: 1rem; }
.upcomingvote { background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.75rem; margin-bottom: 0.5rem; }
.upcomingwhen { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.upcomingmotion { font-size: 0.9rem; font-weight: 600; margin: 0.15rem 0; }
.upcomingnote { font-size: 0.8rem; color: var(--muted); }

/* /lists swipeable card sections (konteksto-style) */
.listsection { margin: 1.6rem 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.section-head h2 { font-size: 1.2rem; margin: 0; }
.sec-emoji { font-size: 1.1rem; }
.carousel { position: relative; }
.carousel-track {
  display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; padding: 0.2rem 0.1rem 0.7rem; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ccard {
  scroll-snap-align: start; flex: 0 0 80%; max-width: 19rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.9rem 1rem; display: flex; flex-direction: column; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ccard-top { display: flex; align-items: center; justify-content: space-between; }
.ccard-emoji { font-size: 1.6rem; }
.ccard .cstat { font-weight: 800; color: var(--accent); font-size: 0.95rem; }
.ccard-badge { font-weight: 800; font-size: 0.66rem; letter-spacing: 0.05em; background: #fff4e5;
  color: #b45309; border: 1px solid #fed7aa; padding: 0.15rem 0.5rem; border-radius: 999px; }
.ccard h3 { font-size: 1.05rem; margin: 0.4rem 0 0.25rem; line-height: 1.2; }
.ccard .cteaser { font-size: 0.85rem; color: var(--muted); flex: 1; margin: 0 0 0.7rem; }
.ccard-foot { display: flex; gap: 0.4rem; align-items: center; }
.section-nav { display: none; gap: 0.3rem; }
.chev {
  width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 1.2rem; line-height: 1;
  cursor: pointer; padding: 0;
}
.chev:hover { border-color: var(--muted); }
@media (min-width: 40rem) {
  .ccard { flex-basis: 15rem; }
  .section-nav { display: flex; }
}

/* Footer */
.site-footer { padding-top: 1.25rem; padding-bottom: 2.5rem; }
.privacy { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1.1rem; }
.privacy h2 { margin: 0 0 0.35rem; font-size: 1rem; }
.privacy p { margin: 0; font-size: 0.86rem; color: var(--muted); }
.fineprint { font-size: 0.76rem; color: var(--muted); margin-top: 0.9rem; }

@media (max-width: 30rem) {
  .hero-title { font-size: 1.8rem; }
  .pcard .photo, .pcard .photo-ph { width: 74px; height: 92px; }
}
