:root {
  color-scheme: light;
  --page-bg: #f7f4ed;
  --surface: #fff;
  --text: #1d1d1b;
  --muted: #66665d;
  --muted-soft: #77766d;
  --border: #ded9cc;
  --control-border: #bcb7aa;
  --header-bg: rgba(247,244,237,.96);
  --notice-bg: #fff2a8;
  --notice-text: #4d441c;
  --fill: #dbe7ff;
  --badge-bg: #e9f0ff;
  --badge-text: #19499a;
  --active-bg: #1d1d1b;
  --active-text: #fff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page-bg);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #15181e;
  --surface: #20252d;
  --text: #edf1f6;
  --muted: #c0c7d0;
  --muted-soft: #a4adb9;
  --border: #343c47;
  --control-border: #596372;
  --header-bg: rgba(21,24,30,.96);
  --notice-bg: #3e381d;
  --notice-text: #f4e8b3;
  --fill: #2a4268;
  --badge-bg: #29364a;
  --badge-text: #c5d8fa;
  --active-bg: #e0e7f0;
  --active-text: #171b22;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  min-height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 10px max(16px, calc((100% - 720px) / 2));
  background: var(--header-bg); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.brand { color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-dot {
  display: inline-block;
  color: #16a34a;
  transform-origin: center;
  animation: heartbeat 2.4s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 45%, 100% { opacity: 1; transform: scale(1); }
  12% { opacity: .65; transform: scale(1.35); }
  24% { opacity: 1; transform: scale(1); }
  34% { opacity: .75; transform: scale(1.2); }
}
.topbar-controls { display: flex; align-items: center; gap: 8px; }
.language-toggle { display: flex; gap: 4px; }
.language-toggle button, .appearance-toggle button {
  min-height: 44px; border: 0; background: transparent; color: var(--muted);
  border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
.language-toggle button.active, .appearance-toggle button.active { background: var(--active-bg); color: var(--active-text); }
.appearance-control { display: flex; align-items: center; gap: 4px; }
.control-label { color: var(--muted-soft); font-size: 12px; }
.appearance-toggle { display: flex; gap: 2px; }
.notice {
  display: grid; gap: 4px;
  padding: 10px max(16px, calc((100% - 720px) / 2));
  background: var(--notice-bg); color: var(--notice-text); font-size: 13px; line-height: 1.4;
}
.notice p { margin: 0; }
.auth-notice { font-weight: 750; }
.feed { max-width: 720px; margin: 0 auto; padding: 16px; }
.poll-card {
  scroll-margin-top: 130px; margin: 0 0 16px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 4px 18px rgba(45,42,31,.05);
}
.poll-card.highlighted { outline: 3px solid #2361d2; }
.badge {
  display: inline-block; margin-bottom: 10px; padding: 5px 9px;
  border-radius: 999px; background: var(--badge-bg); color: var(--badge-text); font-size: 12px; font-weight: 800;
}
.poll-card h1, .poll-card h2 { margin: 0 0 10px; font-size: clamp(21px, 5vw, 30px); line-height: 1.25; }
.description { color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.close-date { color: var(--muted-soft); font-size: 13px; }
.options { display: grid; gap: 10px; margin-top: 16px; }
.vote-button {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 52px; width: 100%; padding: 10px 14px;
  border: 1px solid var(--control-border); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 16px; font-weight: 750; cursor: pointer;
}
.vote-button::before {
  position: absolute; z-index: -1; inset: 0 auto 0 0;
  width: var(--vote-progress, 0%); background: var(--fill);
  content: ""; transition: width 300ms ease;
}
.vote-label { text-align: left; }
.vote-result { flex: 0 0 auto; font-size: 14px; white-space: nowrap; }
.vote-button:hover, .vote-button:focus-visible { border-color: #2361d2; outline: 3px solid var(--fill); }
.vote-button:disabled { cursor: not-allowed; opacity: 1; }
.status { min-height: 24px; margin: 12px 0 0; color: var(--badge-text); font-weight: 700; }
.vote-total { margin: 12px 0; font-size: 14px; font-weight: 750; }
.state-select { margin-top: 14px; }
.state-select label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.state-select select { width: 100%; min-height: 48px; border: 1px solid var(--control-border); border-radius: 10px; background: var(--surface); color: var(--text); }
.state-notice { color: var(--muted-soft); font-size: 12px; line-height: 1.45; }
.closed-heading { max-width: 720px; margin: 16px auto 0; padding: 0 16px; font-size: 19px; font-weight: 800; }
.sentinel { height: 1px; }
footer { display: flex; justify-content: center; gap: 20px; padding: 24px 16px 40px; }
footer a { color: var(--muted); }
.privacy-page { max-width: 720px; margin: 24px auto; padding: 0 16px; line-height: 1.65; }
#turnstile-container { position: fixed; left: -9999px; }
html[lang="hi"] body { font-family: "Noto Sans Devanagari", "Noto Sans", system-ui, sans-serif; }
@media (prefers-reduced-motion: reduce) {
  .brand-dot { animation: none; }
}
@media (max-width: 420px) {
  .poll-card { padding: 16px; border-radius: 14px; }
  .topbar { min-height: 58px; }
  .notice { font-size: 12px; }
  .vote-button { padding: 10px; font-size: 15px; }
  .vote-result { font-size: 12px; }
  .topbar-controls { gap: 2px; }
  .control-label { display: none; }
  .language-toggle button, .appearance-toggle button { padding: 8px 6px; font-size: 12px; }
}
