:root {
  --navy-950: #03182f;
  --navy-900: #082f5c;
  --navy-800: #123f70;
  --navy-700: #1b4f83;
  --orange-600: #f06400;
  --orange-500: #ff7900;
  --orange-100: #fff0e4;
  --ink: #0b1f35;
  --muted: #66788c;
  --line: #dce5ee;
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --danger: #c43737;
  --danger-soft: #fff1f1;
  --shadow-lg: 0 30px 80px rgba(3, 24, 47, 0.15);
  --shadow-md: 0 18px 45px rgba(8, 47, 92, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--surface-soft);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 121, 0, 0.35);
  outline-offset: 3px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--orange-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--orange-500);
  box-shadow: 0 0 0 5px rgba(255, 121, 0, 0.12);
}

/* Voter */

.vote-body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: #eef3f7;
}

.vote-shell {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 540px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(circle at 0 58%, rgba(255, 121, 0, 0.09), transparent 26%),
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 0 60px rgba(8, 47, 92, 0.1);
}

.corner {
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 34px;
  transform: rotate(45deg);
}

.corner::after {
  content: "";
  position: absolute;
  inset: 11px 0 auto;
  height: 3px;
  background: var(--orange-500);
}

.corner--top {
  top: 16px;
  right: -74px;
  background: var(--navy-900);
}

.corner--bottom {
  bottom: 10px;
  left: -80px;
  background: var(--orange-500);
}

.corner--bottom::after {
  background: var(--navy-900);
}

.vote-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 74px;
  margin-bottom: 34px;
}

.vote-brand img {
  width: 178px;
  height: 74px;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: multiply;
}

.year-chip {
  display: grid;
  place-items: center;
  height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(8, 47, 92, 0.13);
  border-radius: 999px;
  color: var(--navy-900);
  background: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 800;
}

.vote-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 38px;
}

.vote-card h1 {
  max-width: 390px;
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(31px, 9vw, 43px);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.vote-subtitle {
  max-width: 420px;
  margin: 16px 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.vote-option {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(112px, 33vw, 152px);
  overflow: hidden;
  border: 2px solid #d7e1ea;
  border-radius: 23px;
  color: var(--navy-900);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 25px rgba(8, 47, 92, 0.06);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.vote-option::before {
  content: "";
  position: absolute;
  inset: auto -32px -48px auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255, 121, 0, 0.07);
}

.vote-option span {
  position: relative;
  font-size: clamp(52px, 18vw, 76px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.06em;
}

.vote-option:not(:disabled):active {
  transform: scale(0.96);
}

@media (hover: hover) and (pointer: fine) {
  .vote-option:not(:disabled):hover {
    border-color: var(--orange-500);
    box-shadow: 0 14px 28px rgba(255, 121, 0, 0.14);
    transform: translateY(-2px);
  }
}

.vote-option.selected {
  border-color: var(--navy-900);
  color: #fff;
  background: var(--navy-900);
  box-shadow: 0 18px 35px rgba(8, 47, 92, 0.24);
}

.vote-option.selected::after {
  content: "✓";
  position: absolute;
  top: 11px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--navy-900);
  background: var(--orange-500);
  font-size: 15px;
  font-weight: 900;
}

.vote-option.muted {
  opacity: 0.38;
}

.vote-option.is-loading span {
  opacity: 0.28;
}

.vote-option.is-loading::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(8, 47, 92, 0.18);
  border-top-color: var(--orange-500);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.voter-results {
  margin-top: 22px;
}

.voter-confirmation {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 121, 0, 0.22);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff8f1, #fff);
  box-shadow: 0 12px 28px rgba(255, 121, 0, 0.08);
}

.voter-confirmation__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #fff;
  background: var(--orange-500);
  box-shadow: 0 8px 18px rgba(255, 121, 0, 0.22);
  font-size: 20px;
  font-weight: 900;
}

.voter-confirmation > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.voter-confirmation > div:nth-child(2) > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.voter-confirmation > div:nth-child(2) > strong {
  color: var(--navy-950);
  font-size: 16px;
}

.voter-confirmation b {
  color: var(--orange-600);
}

.voter-live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--navy-700);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.voter-live i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--orange-500);
  box-shadow: 0 0 0 4px rgba(255, 121, 0, 0.12);
  animation: live-pulse 1.8s ease-in-out infinite;
}

.voter-results__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 2px 11px;
}

.voter-results__heading > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voter-results__heading > div:first-child strong {
  color: var(--navy-950);
  font-size: 16px;
}

.voter-results__heading > div:first-child span {
  color: var(--muted);
  font-size: 11px;
}

.voter-total {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--muted);
}

.voter-total strong {
  color: var(--orange-600);
  font-size: 24px;
  line-height: 1;
}

.voter-total span {
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.voter-results__list {
  display: grid;
  gap: 8px;
}

.voter-result-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(8, 47, 92, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 7px 18px rgba(8, 47, 92, 0.04);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.voter-result-row.is-selected {
  border-color: rgba(255, 121, 0, 0.42);
  background: linear-gradient(100deg, rgba(255, 240, 228, 0.94), #fff 70%);
  box-shadow: 0 9px 22px rgba(255, 121, 0, 0.09);
}

.voter-result-option {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: var(--navy-900);
  font-size: 21px;
  font-weight: 850;
}

.voter-result-row.is-selected .voter-result-option {
  color: var(--navy-950);
  background: var(--orange-500);
}

.voter-result-data {
  min-width: 0;
}

.voter-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.voter-result-meta > span {
  min-width: 0;
  overflow: hidden;
  color: var(--navy-900);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voter-result-meta small {
  margin-left: 5px;
  color: var(--orange-600);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.voter-result-percent {
  flex: 0 0 auto;
  color: var(--navy-950);
  font-size: 15px;
}

.voter-result-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef4;
}

.voter-result-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy-800), var(--navy-700));
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.voter-result-row.is-selected .voter-result-track span {
  background: linear-gradient(90deg, var(--orange-500), #ffac5f);
}

.voter-result-count {
  display: block;
  margin-top: 5px;
  color: #8998a8;
  font-size: 9px;
  font-weight: 700;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.vote-closed {
  margin-top: 28px;
  padding: 34px 24px;
  border: 1px solid rgba(8, 47, 92, 0.1);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(8, 47, 92, 0.08);
  text-align: center;
}

.closed-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: var(--surface-soft);
}

.closed-mark span {
  width: 25px;
  height: 4px;
  border-radius: 999px;
  background: var(--orange-500);
}

.vote-closed strong {
  display: block;
  color: var(--navy-900);
  font-size: 19px;
}

.vote-closed p {
  max-width: 310px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.connection-message {
  margin: 16px 0 0;
  padding: 13px 15px;
  border-radius: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 13px;
  line-height: 1.45;
}

.vote-footer {
  padding-top: 15px;
  color: #93a1b0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
}

.vote-footer span {
  padding: 0 7px;
  color: var(--orange-500);
}

/* Admin login */

.admin-body {
  min-width: 320px;
  min-height: 100vh;
  background: #f2f6fa;
}

.admin-body.dashboard-open {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(400px, 1.06fr) minmax(480px, 0.94fr);
  min-height: 100vh;
  background: #fff;
}

.login-visual {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background: var(--navy-900);
}

.login-visual::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 24, 47, 0.04), rgba(3, 24, 47, 0.86));
}

.login-visual::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: -90px;
  bottom: 84px;
  width: 420px;
  height: 64px;
  background: var(--orange-500);
  transform: rotate(-46deg);
  box-shadow: 0 19px 0 rgba(255, 255, 255, 0.88), 0 25px 0 var(--navy-900);
}

.login-visual > img {
  width: 100%;
  height: 100%;
  min-height: 640px;
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(0.95);
}

.login-visual-overlay {
  position: absolute;
  z-index: 2;
  left: clamp(32px, 6vw, 86px);
  bottom: clamp(42px, 7vw, 84px);
  display: flex;
  flex-direction: column;
  max-width: 490px;
  color: #fff;
}

.login-visual-overlay span {
  margin-bottom: 12px;
  color: #ffb878;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.login-visual-overlay strong {
  font-size: clamp(34px, 4.5vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 46px;
}

.login-card {
  width: min(100%, 430px);
}

.login-logo {
  width: 188px;
  height: 112px;
  margin: 0 0 38px;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: multiply;
}

.login-card h1 {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.login-card > p {
  margin: 13px 0 31px;
  color: var(--muted);
  font-size: 15px;
}

.pin-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.pin-inputs input {
  width: 100%;
  min-width: 0;
  height: 78px;
  border: 2px solid var(--line);
  border-radius: 17px;
  color: var(--navy-950);
  background: #f8fafc;
  font-size: 37px;
  font-weight: 900;
  text-align: center;
  caret-color: var(--orange-500);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.pin-inputs input:focus {
  border-color: var(--orange-500);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 121, 0, 0.1);
}

.pin-error {
  min-height: 20px;
  margin: 12px 0 2px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
}

.login-button {
  width: 100%;
  margin-top: 9px;
}

/* Buttons */

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 19px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 780;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease, background 150ms ease;
}

.primary-button {
  color: #fff;
  background: var(--navy-900);
  box-shadow: 0 12px 24px rgba(8, 47, 92, 0.2);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: var(--navy-800);
  box-shadow: 0 14px 26px rgba(8, 47, 92, 0.26);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--navy-900);
  background: #fff;
  box-shadow: 0 7px 18px rgba(8, 47, 92, 0.05);
}

.danger-button {
  border: 1px solid #f2cece;
  color: var(--danger);
  background: var(--danger-soft);
}

.icon-button {
  width: 48px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--navy-900);
  background: #fff;
  font-size: 18px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-icon {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.qr-symbol {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  background: linear-gradient(90deg, currentColor 2px, transparent 2px) 5px 5px / 5px 5px;
}

.qr-symbol::before,
.qr-symbol::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border: 1.5px solid currentColor;
  background: #fff;
}

.qr-symbol::before {
  top: 2px;
  left: 2px;
}

.qr-symbol::after {
  right: 2px;
  bottom: 2px;
}

.is-loading .refresh-symbol {
  animation: spin 700ms linear infinite;
}

/* Dashboard */

.dashboard {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(8, 47, 92, 0.035) 25%, transparent 25%) 0 0 / 46px 46px,
    #f3f6f9;
}

.dashboard-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-controls button {
  min-height: clamp(40px, 5.2vh, 46px);
}

.utility-menu {
  position: fixed;
  z-index: 35;
  top: 14px;
  right: 14px;
}

.utility-menu__toggle {
  display: grid;
  width: 43px;
  height: 43px;
  padding: 11px;
  place-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  color: var(--navy-900);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 24px rgba(8, 47, 92, 0.08);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.utility-menu__toggle:hover,
.utility-menu__toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(8, 47, 92, 0.14);
}

.utility-menu__toggle span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.utility-menu__panel {
  position: absolute;
  top: 50px;
  right: 0;
  width: 218px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 20px 50px rgba(3, 24, 47, 0.18);
  backdrop-filter: blur(20px);
  animation: menu-in 160ms ease-out both;
}

.utility-menu__item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border-radius: 12px;
  color: var(--navy-900);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.utility-menu__item:hover {
  background: rgba(8, 47, 92, 0.06);
}

.utility-menu__item--danger {
  color: var(--danger);
}

.utility-menu__icon {
  flex: 0 0 auto;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: rgba(8, 47, 92, 0.07);
  font-size: 16px;
}

.utility-menu__item--danger .utility-menu__icon {
  background: rgba(196, 55, 55, 0.08);
}

.utility-menu__item > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.utility-menu__item strong {
  font-size: 13px;
}

.utility-menu__item small {
  color: var(--muted);
  font-size: 10px;
}

.utility-menu__item .qr-symbol {
  border-width: 1.5px;
  background: linear-gradient(90deg, currentColor 2px, transparent 2px) 5px 5px / 5px 5px;
}

.dashboard-content {
  width: min(100%, 1280px);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: clamp(16px, 2.6vh, 30px) clamp(22px, 5vw, 64px);
}

#active-dashboard:not([hidden]) {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(10px, 1.5vh, 17px);
}

.dashboard-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
}

.dashboard-topline h1 {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(30px, 4.4vh, 48px);
  line-height: 1.05;
  letter-spacing: -0.048em;
}

.dashboard-topline .eyebrow {
  margin-bottom: clamp(5px, 0.8vh, 9px);
}

.dashboard-topline p {
  margin: clamp(5px, 0.8vh, 9px) 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-topline p strong {
  color: var(--navy-900);
}

.auto-update {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #28724b;
  background: #e9f7ef;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.auto-update i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ba768;
  box-shadow: 0 0 0 3px rgba(59, 167, 104, 0.12);
}

.summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 9px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(8, 47, 92, 0.08);
  border-radius: 27px;
  background: #e8eef4;
  box-shadow: 0 18px 42px rgba(8, 47, 92, 0.11);
}

.summary-main {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
  min-height: clamp(100px, 14vh, 128px);
  padding: clamp(17px, 2.3vh, 23px) 26px;
  overflow: hidden;
  border-radius: 19px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy-900), #164d82);
}

.summary-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: clamp(54px, 7vh, 64px);
  height: clamp(54px, 7vh, 64px);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.summary-icon span {
  width: 7px;
  border-radius: 4px 4px 1px 1px;
  background: var(--orange-500);
}

.summary-icon span:nth-child(1) { height: 15px; }
.summary-icon span:nth-child(2) { height: 27px; }
.summary-icon span:nth-child(3) { height: 21px; }

.summary-copy {
  min-width: 0;
}

.summary-label {
  display: block;
  margin-bottom: 5px;
  color: #c8d8e8;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.summary-metric {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.summary-metric strong {
  flex: 0 0 auto;
  font-size: clamp(46px, 6.4vh, 58px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.summary-metric small {
  max-width: 180px;
  padding-bottom: 5px;
  color: #c8d8e8;
  font-size: 12px;
  line-height: 1.35;
}

.round-chip {
  display: flex;
  min-width: 0;
  min-height: clamp(100px, 14vh, 128px);
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(15px, 2vh, 19px);
  border-radius: 19px;
  background: var(--orange-500);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.round-chip > span {
  color: var(--navy-950);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.round-chip strong {
  display: grid;
  min-width: clamp(54px, 7vh, 66px);
  height: clamp(54px, 7vh, 66px);
  padding: 0 15px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: var(--navy-950);
  font-size: clamp(34px, 5vh, 42px);
  line-height: 1;
  letter-spacing: -0.05em;
  box-shadow: 0 12px 26px rgba(3, 24, 47, 0.2);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 0;
  gap: clamp(9px, 1.4vh, 15px);
}

.result-card {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: clamp(14px, 2vh, 21px) clamp(17px, 2vw, 25px);
  overflow: hidden;
  border: 1px solid rgba(8, 47, 92, 0.09);
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(8, 47, 92, 0.065);
}

.result-card::after {
  content: attr(data-result);
  position: absolute;
  right: 16px;
  bottom: -26px;
  color: rgba(8, 47, 92, 0.035);
  font-size: clamp(100px, 17vh, 142px);
  font-weight: 900;
  line-height: 1;
}

.result-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.answer-number {
  display: grid;
  place-items: center;
  width: clamp(34px, 4.8vh, 40px);
  height: clamp(34px, 4.8vh, 40px);
  margin-right: 11px;
  border-radius: 12px;
  color: #fff;
  background: var(--navy-900);
  font-size: 20px;
  font-weight: 850;
}

.answer-label {
  color: var(--navy-900);
  font-size: 14px;
  font-weight: 770;
}

.answer-percent {
  margin-left: auto;
  color: var(--orange-600);
  font-size: clamp(19px, 2.8vh, 24px);
  letter-spacing: -0.04em;
}

.result-count {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: clamp(10px, 1.7vh, 17px) 0 auto;
}

.result-count strong {
  color: var(--navy-950);
  font-size: clamp(34px, 5.2vh, 47px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.result-count span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.result-track {
  position: relative;
  z-index: 1;
  height: clamp(7px, 1vh, 9px);
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f6;
}

.result-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange-500), #ff9b42);
  transition: width 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.finished-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  padding: 60px 24px;
  border: 1px solid rgba(8, 47, 92, 0.09);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 4%, rgba(255, 121, 0, 0.09), transparent 25%),
    #fff;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.finished-icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin-bottom: 25px;
  border: 1px solid rgba(8, 47, 92, 0.1);
  border-radius: 27px;
  background: var(--surface-soft);
}

.finished-icon span {
  width: 31px;
  height: 8px;
  border-radius: 999px;
  background: var(--orange-500);
}

.finished-panel h1 {
  margin: 8px 0 13px;
  color: var(--navy-950);
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.finished-panel > p {
  max-width: 560px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.finished-panel > p strong {
  color: var(--navy-900);
}

.start-new-button {
  min-height: 55px;
  padding: 0 25px;
}

/* Modals */

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 24, 47, 0.68);
  backdrop-filter: blur(9px);
}

.modal {
  position: relative;
  width: min(100%, 480px);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 35px;
  border-radius: 25px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modal-in 180ms ease-out both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 24px;
  cursor: pointer;
}

.modal-eyebrow {
  color: var(--orange-600);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.modal h2 {
  margin: 9px 0 9px;
  color: var(--navy-950);
  font-size: 30px;
  letter-spacing: -0.04em;
}

.modal > p {
  margin: 0 auto 22px;
  max-width: 370px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.qr-frame {
  display: grid;
  place-items: center;
  width: min(100%, 360px);
  aspect-ratio: 1;
  margin: 0 auto 17px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 13px 35px rgba(8, 47, 92, 0.09);
}

.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-loader {
  color: var(--muted);
  font-size: 14px;
}

.qr-link {
  color: var(--navy-900);
  font-size: 14px;
  font-weight: 780;
  text-decoration-color: rgba(8, 47, 92, 0.25);
  text-underline-offset: 4px;
}

.warning-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 18px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 29px;
  font-weight: 900;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 27px;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: min(390px, calc(100vw - 48px));
  padding: 15px 18px;
  border-radius: 13px;
  color: #fff;
  background: var(--navy-900);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  font-weight: 700;
  animation: toast-in 180ms ease-out both;
}

.toast[data-tone="error"] {
  background: var(--danger);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.97); }
}

.shake {
  animation: shake 300ms ease-in-out;
}

@media (max-width: 980px) {
  .login-screen {
    grid-template-columns: minmax(280px, 0.78fr) minmax(420px, 1fr);
  }

  .login-visual > img {
    object-position: 47% center;
  }

  .login-visual-overlay strong {
    font-size: 42px;
  }

  .dashboard-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 760px) {
  .login-screen {
    display: block;
    min-height: 100vh;
    padding: 0;
    background:
      linear-gradient(165deg, var(--navy-900) 0 29%, transparent 29.2%),
      #fff;
  }

  .login-visual {
    min-height: 210px;
    height: 30vh;
    max-height: 280px;
  }

  .login-visual > img {
    min-height: 0;
    height: 100%;
  }

  .login-visual-overlay {
    left: 24px;
    bottom: 24px;
  }

  .login-visual-overlay span {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .login-visual-overlay strong {
    font-size: 30px;
  }

  .login-panel {
    display: block;
    padding: 31px 23px 48px;
  }

  .login-card {
    margin: 0 auto;
  }

  .login-logo {
    width: 150px;
    height: 78px;
    margin-bottom: 22px;
  }

  .pin-inputs input {
    height: 66px;
    border-radius: 15px;
  }

  .dashboard-content {
    padding: 12px;
  }

  .dashboard-topline {
    gap: 8px;
    margin: 0;
  }

  .dashboard-topline > div:first-child {
    padding-right: 45px;
  }

  .dashboard-topline h1 {
    font-size: clamp(25px, 4.2vh, 31px);
  }

  .dashboard-topline .eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .dashboard-topline p {
    margin-top: 4px;
    font-size: 11px;
  }

  .auto-update {
    padding: 3px 6px;
    font-size: 8px;
  }

  .dashboard-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .dashboard-controls button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding-right: 7px;
    padding-left: 7px;
    gap: 5px;
    border-radius: 11px;
    font-size: 11px;
  }

  .dashboard-controls .button-icon {
    min-width: 14px;
    font-size: 16px;
  }

  .summary-card {
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 6px;
    padding: 6px;
    border-radius: 19px;
  }

  .summary-main {
    min-height: 100px;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
  }

  .summary-icon {
    width: 48px;
    height: 48px;
    padding: 10px;
    border-radius: 14px;
  }

  .summary-metric {
    gap: 8px;
  }

  .summary-metric strong {
    font-size: 42px;
  }

  .summary-metric small {
    display: none;
  }

  .summary-label {
    margin-bottom: 4px;
    font-size: 9px;
  }

  .round-chip {
    min-height: 100px;
    padding: 12px;
    border-radius: 14px;
  }

  .round-chip > span {
    font-size: 8px;
  }

  .round-chip strong {
    min-width: 46px;
    height: 46px;
    padding: 0 10px;
    border-radius: 13px;
    font-size: 29px;
    box-shadow: 0 7px 16px rgba(3, 24, 47, 0.18);
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .result-card {
    min-height: 0;
    padding: 11px 12px;
    border-radius: 15px;
  }

  .result-card::after {
    right: 8px;
    bottom: -17px;
    font-size: 82px;
  }

  .answer-number {
    width: 32px;
    height: 32px;
    margin-right: 7px;
    border-radius: 9px;
    font-size: 16px;
  }

  .answer-label {
    display: none;
  }

  .answer-percent {
    font-size: 18px;
  }

  .result-count {
    gap: 5px;
    margin: 7px 0 auto;
  }

  .result-count strong {
    font-size: clamp(28px, 5.2vh, 38px);
  }

  .result-count span {
    font-size: 10px;
  }

  .result-track {
    height: 7px;
  }

  .modal {
    padding: 32px 21px 24px;
    border-radius: 22px;
  }

  .finished-panel {
    height: 100%;
    min-height: 0;
    padding: 30px 20px;
  }

  .finished-panel h1 {
    font-size: 40px;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .summary-main {
    gap: 14px;
    padding-right: 17px;
    padding-left: 17px;
  }

  .summary-metric small {
    display: none;
  }

  .vote-shell {
    padding-right: 17px;
    padding-left: 17px;
  }

  .vote-brand {
    margin-bottom: 22px;
  }

  .vote-brand img {
    width: 150px;
  }

  .vote-grid {
    gap: 11px;
  }

  .vote-option {
    min-height: 104px;
    border-radius: 19px;
  }

  .pin-inputs {
    gap: 9px;
  }

  .pin-inputs input {
    height: 60px;
  }

  .dashboard-brand span {
    display: none;
  }
}

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