:root {
  color-scheme: light;
  --yellow: #f5ff00;
  --ink: #050505;
  --muted: #646458;
  --paper: #ffffff;
  --soft: rgba(255, 255, 255, 0.82);
  --line: rgba(5, 5, 5, 0.1);
  --green: #0d6b45;
  --red: #a82f35;
  --amber: #94610e;
  --home-ink: #2c2418;
  --home-muted: #735f4a;
  --home-paper: rgba(255, 252, 243, 0.9);
  --home-mint: #dfeee4;
  --home-rose: #ffd8c8;
  --home-blue: #dbeff4;
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.9, 0.22, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--yellow);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--yellow);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--yellow);
  pointer-events: none;
  animation: splashExit 180ms var(--ease) 60ms forwards;
}

.splash-screen strong {
  font-size: clamp(1.55rem, 9vw, 2.3rem);
  font-weight: 1000;
  letter-spacing: -0.04em;
  animation: logoPop 160ms var(--ease) both;
}

.shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--yellow);
}

.shell::before {
  content: "";
  position: absolute;
  inset: -16% -35% auto;
  height: 42%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.36), transparent 58%);
  transform: translateY(calc(var(--motion-y, 0) * 1px));
  opacity: 0.5;
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.brand-lockup,
.session-pill {
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: auto;
}

.ghost-button,
.primary-button,
.secondary-button,
.vote-button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  transition:
    transform 180ms var(--ease),
    border-radius 260ms var(--ease),
    background 180ms ease,
    color 180ms ease;
}

.nav-button,
.top-actions .ghost-button {
  min-width: 72px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.08);
  color: rgba(5, 5, 5, 0.7);
  font-size: 0.78rem;
  backdrop-filter: blur(14px);
}

.nav-button:hover,
.top-actions .ghost-button:hover {
  background: var(--ink);
  color: #fff;
}

.view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding: 78px 28px 44px;
  transition:
    opacity 320ms var(--ease),
    transform 420ms var(--ease),
    filter 420ms var(--ease);
}

.view[hidden] {
  display: none !important;
}

.panel,
.identity-panel {
  width: 100%;
}

.identity-panel {
  display: none;
}

.verify-panel,
.voting-panel,
.admin-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.verify-panel {
  transform-origin: 50% 55%;
  animation: screenIn 520ms var(--ease) both;
}

.panel-heading {
  margin-bottom: 18px;
}

.verify-heading {
  display: grid;
  gap: 8px;
}

.app-logo {
  margin-bottom: clamp(48px, 14vh, 112px);
  font-size: 1.65rem;
  font-weight: 1000;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.eyebrow {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0;
}

.verify-heading .eyebrow {
  display: none;
}

h2 {
  font-size: clamp(1.55rem, 7vw, 2.05rem);
  line-height: 0.98;
  font-weight: 1000;
  letter-spacing: -0.04em;
}

.verify-heading p:last-child {
  max-width: 21rem;
  color: rgba(5, 5, 5, 0.66);
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.25;
}

.stack {
  display: grid;
  gap: 14px;
}

.verify-step {
  display: grid;
  gap: 12px;
  transform-origin: 50% 38%;
  animation: cardMorphIn 440ms var(--ease) both;
}

.step-track {
  display: none;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

input,
textarea {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
  font-weight: 800;
  transition: box-shadow 180ms ease, transform 180ms var(--ease), background 180ms ease;
}

textarea {
  min-height: 128px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(5, 5, 5, 0.18);
}

input:focus,
textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(5, 5, 5, 0.08);
  transform: translateY(-1px);
}

.name-status {
  min-height: 18px;
  color: rgba(5, 5, 5, 0.58);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.25;
}

.name-status[data-status="checking"],
.name-status[data-status="multiple"] {
  color: rgba(5, 5, 5, 0.68);
}

.name-status[data-status="found"] {
  color: #1d7a3a;
}

.name-status[data-status="missing"] {
  color: #b42318;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: fit-content;
  min-width: 56px;
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.vote-button:hover {
  transform: translateY(-2px) scale(1.015);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.vote-button:active {
  transform: translateY(0) scale(0.98);
  border-radius: 18px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.notice {
  display: none;
}

.choice-grid {
  display: grid;
  gap: 12px;
}

.choice-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  width: 100%;
  min-height: 90px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  padding: 18px;
  text-align: left;
  transition:
    transform 220ms var(--ease),
    border-radius 320ms var(--ease),
    background 220ms ease,
    box-shadow 220ms ease;
}

.choice-button:hover {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 30px rgba(5, 5, 5, 0.1);
  transform: translateY(-3px);
}

.choice-button .method-icon {
  display: none;
}

.choice-button strong {
  font-size: 1rem;
  line-height: 1.05;
}

.choice-button span {
  color: rgba(5, 5, 5, 0.7);
  font-size: 0.74rem;
  font-weight: 760;
  line-height: 1.18;
}

.loading-card,
.success-card {
  display: grid;
  justify-items: start;
  gap: 12px;
  min-height: 180px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.loading-card strong,
.success-card strong {
  font-size: clamp(1.45rem, 7vw, 2rem);
  line-height: 1;
  font-weight: 1000;
  letter-spacing: -0.04em;
}

.loading-card span,
.success-card span {
  color: rgba(5, 5, 5, 0.58);
  font-weight: 800;
}

.loader {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(5, 5, 5, 0.12);
  border-top-color: var(--ink);
  border-radius: 999px;
  animation: spin 740ms linear infinite;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--yellow);
  font-size: 1.8rem;
  font-weight: 1000;
}

.success-progress {
  width: min(230px, 70vw);
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.12);
}

.success-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform: scaleX(0.06);
  transform-origin: left;
  animation: fakeWelcomeLoad 280ms var(--ease) forwards;
}

.camera-box {
  position: relative;
  aspect-ratio: 0.78;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.camera-box video,
.camera-placeholder,
.face-target,
.camera-badge,
.turn-arrow,
.camera-instruction {
  position: absolute;
}

.camera-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 1;
  transition: opacity 520ms var(--ease);
}

.camera-box canvas {
  display: none;
}

.camera-placeholder {
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
  padding: 24px;
  z-index: 2;
  opacity: 1;
  transition: opacity 420ms var(--ease), visibility 420ms var(--ease);
}

.camera-box.active .camera-placeholder {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.camera-box:not(.active) .camera-instruction {
  display: none;
}

.face-target {
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 3;
}

.face-ring {
  position: relative;
  width: min(64%, 190px);
  aspect-ratio: 0.78;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 48% 48% 44% 44%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.36);
  transition:
    left 180ms var(--ease),
    top 180ms var(--ease),
    width 180ms var(--ease),
    opacity 180ms ease,
    transform 180ms var(--ease);
}

.camera-box.tracking-face.face-found .face-target {
  display: block;
}

.camera-box.tracking-face.face-found .face-ring {
  position: absolute;
  left: var(--face-x, 50%);
  top: var(--face-y, 50%);
  width: var(--face-w, min(64%, 190px));
  transform: translate(-50%, -50%);
}

.scan-line {
  position: absolute;
  left: 20%;
  right: 20%;
  top: 27%;
  height: 3px;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 0 20px rgba(245, 255, 0, 0.88);
  opacity: 0;
}

.camera-box.tracking-face .face-ring {
  animation: ringPulse 900ms ease-in-out infinite;
}

.camera-box.scanning .face-ring {
  animation: ringPulse 900ms ease-in-out infinite;
}

.camera-box.scanning .scan-line {
  animation: scanSweep 1500ms ease-in-out infinite;
  opacity: 1;
}

.camera-box.tracking-face.scanning .scan-line {
  left: var(--face-scan-left, 20%);
  right: auto;
  top: var(--face-scan-start, 27%);
  width: var(--face-w, 54%);
  animation: faceScanSweep 1250ms ease-in-out infinite;
}

.camera-box.turning-right .turn-arrow,
.camera-box.turning-left .turn-arrow {
  display: grid;
}

.camera-box.complete .face-ring {
  border-color: #74e09b;
}

.turn-arrow {
  display: none;
  place-items: center;
  top: 16px;
  right: 16px;
  z-index: 6;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--yellow);
  color: #050505;
  font-size: 2.2rem;
  font-weight: 1000;
  line-height: 1;
  animation: arrowNudgeRight 760ms ease-in-out infinite;
}

.camera-box.turning-left .turn-arrow {
  left: 16px;
  right: auto;
  animation-name: arrowNudgeLeft;
}

.camera-badge {
  display: none;
}

.camera-instruction {
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.86);
  color: #fff;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.12;
  text-align: center;
}

.challenge-card {
  display: grid;
  gap: 4px;
  border: 0;
  border-radius: var(--radius);
  background: #000;
  color: #fff;
  padding: 14px;
}

.challenge-card span {
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.challenge-card strong {
  font-size: 0.98rem;
}

.debug-panel {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
}

.debug-panel div {
  border: 2px solid var(--ink);
  border-radius: calc(var(--radius) - 4px);
  background: var(--paper);
  padding: 8px;
  text-align: center;
}

.debug-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.debug-panel strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

#turnDebugPrint {
  grid-column: 1 / -1;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: calc(var(--radius) - 4px);
  background: #050505;
  color: #f7ff45;
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  text-align: center;
}

.home-view,
.admin-view {
  align-items: start;
  padding-top: 86px;
  overflow-y: auto;
}

.voting-panel,
.admin-panel {
  padding-bottom: 38px;
}

.panel-heading.row {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading.row .ghost-button,
.admin-panel .ghost-button {
  width: fit-content;
  min-height: 36px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
}

.home-summary {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 10px;
  margin-bottom: 14px;
}

.home-summary div,
.proposal,
.pin-output,
.verification-log,
.verification-row,
.tool-section,
.admin-block {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.home-summary div {
  padding: 14px;
}

.home-summary div + div {
  background: var(--ink);
  color: #fff;
}

.home-summary span,
.result span,
.tool-heading span {
  display: block;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.home-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 1.1rem;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.proposal-list {
  display: grid;
  gap: 12px;
}

.proposal {
  padding: 18px;
  animation: cardMorphIn 420ms var(--ease) both;
}

.proposal h3 {
  font-size: 1.03rem;
  line-height: 1.08;
  font-weight: 1000;
}

.proposal p {
  margin: 10px 0 14px;
  color: rgba(5, 5, 5, 0.64);
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.28;
}

.vote-grid,
.results {
  display: grid;
  gap: 8px;
}

.vote-grid {
  margin-bottom: 12px;
}

.vote-button {
  min-height: 44px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.vote-button.yes {
  background: #e8f5df;
  color: var(--green);
}

.vote-button.no {
  background: #f8e1e2;
  color: var(--red);
}

.vote-button.abstain {
  background: #fff1d2;
  color: var(--amber);
}

.result {
  position: relative;
  min-height: 62px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(5, 5, 5, 0.04);
  padding: 10px;
}

.result::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--green);
}

.result:nth-child(2)::after {
  background: var(--red);
}

.result:nth-child(3)::after {
  background: var(--amber);
}

.result span {
  color: rgba(5, 5, 5, 0.56);
}

.result strong {
  display: block;
  margin-top: 3px;
  font-size: 1.5rem;
  line-height: 1;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(5, 5, 5, 0.55);
  font-weight: 900;
  text-align: center;
  padding: 24px;
}

.admin-panel .panel-heading {
  margin-bottom: 20px;
}

.admin-suite-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.admin-suite-heading h2 {
  font-size: clamp(1.75rem, 7vw, 2.35rem);
}

.admin-suite {
  display: grid;
  gap: 14px;
}

.admin-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-metric,
.admin-section,
.admin-row,
.admin-empty,
.admin-snapshot {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.admin-metric {
  display: grid;
  gap: 4px;
  min-height: 102px;
  padding: 14px;
}

.admin-metric span,
.admin-metric small,
.admin-row small,
.admin-row-actions span {
  color: rgba(5, 5, 5, 0.55);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
}

.admin-metric span,
.admin-row-actions span {
  text-transform: uppercase;
}

.admin-metric strong {
  font-size: 1.85rem;
  font-weight: 1000;
  line-height: 0.95;
}

.admin-grid {
  display: grid;
  gap: 12px;
}

.admin-block,
.tool-section {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.tool-section {
  margin-top: 12px;
}

.admin-grid .tool-section,
.admin-grid .admin-block {
  margin: 0;
}

.admin-section,
.tool-section {
  padding: 14px;
}

.tool-heading {
  display: grid;
  gap: 3px;
}

.tool-heading strong {
  font-size: 1.05rem;
  line-height: 1.1;
}

.pin-output,
.verification-log {
  min-height: 42px;
  padding: 12px;
  color: rgba(5, 5, 5, 0.56);
  font-weight: 900;
}

.pin-output {
  display: grid;
  place-items: center;
  text-align: center;
}

.verification-log {
  display: grid;
  gap: 8px;
}

.admin-board {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-row {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.admin-row strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.12;
}

.compact-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.compact-row > small,
.compact-row > .ghost-button {
  justify-self: end;
}

.ballot-row {
  grid-template-columns: minmax(0, 1fr);
}

.admin-result-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.admin-result-strip span {
  display: grid;
  gap: 2px;
  min-height: 48px;
  border-radius: 8px;
  background: rgba(5, 5, 5, 0.055);
  padding: 8px;
  color: rgba(5, 5, 5, 0.58);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-result-strip b {
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-chip {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.08);
  color: rgba(5, 5, 5, 0.68);
  padding: 0 9px;
  font-size: 0.66rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.status-chip.open,
.status-chip.active {
  background: #e8f5df;
  color: var(--green);
}

.status-chip.closed,
.status-chip.revoked {
  background: #f8e1e2;
  color: var(--red);
}

.status-chip.used {
  background: #e8eef9;
  color: #24436f;
}

.status-chip.pending {
  background: #fff1d2;
  color: var(--amber);
}

.status-chip.expired,
.status-chip.quiet {
  background: rgba(5, 5, 5, 0.08);
  color: rgba(5, 5, 5, 0.55);
}

.admin-empty {
  min-height: 64px;
  padding: 18px;
  color: rgba(5, 5, 5, 0.55);
  font-weight: 900;
}

.admin-snapshot {
  max-height: 220px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 12px;
  color: rgba(5, 5, 5, 0.68);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  white-space: pre-wrap;
}

.verification-row {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.verification-row span {
  color: rgba(5, 5, 5, 0.58);
  font-size: 0.84rem;
  line-height: 1.28;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translateX(-50%) translateY(18px) scale(0.96);
  width: min(290px, calc(100% - 42px));
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  padding: 13px 16px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity 180ms ease, transform 240ms var(--ease), border-radius 260ms var(--ease);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

body[data-verify-step="choice"] .app-logo,
body[data-verify-step="face"] .app-logo,
body[data-verify-step="pin"] .app-logo,
body[data-verify-step="done"] .app-logo {
  margin-bottom: 38px;
}

body[data-verify-step="choice"] .verify-heading h2,
body[data-verify-step="face"] .verify-heading h2,
body[data-verify-step="face"] .verify-heading .eyebrow {
  display: none;
}

body[data-verify-step="choice"] .verify-heading {
  margin-bottom: 14px;
}

body[data-verify-step="choice"] .verify-heading .eyebrow {
  font-size: 0.9rem;
}

body[data-verify-step="loading"] .verify-heading {
  display: none;
}

#nameContinueButton {
  width: 56px;
  min-width: 56px;
  padding: 0;
  justify-content: center;
}

#nameContinueButton span:first-child {
  display: none;
}

body[data-verify-step="choice"] .verify-heading .eyebrow,
body[data-verify-step="face"] .verify-heading .eyebrow,
body[data-verify-step="pin"] .verify-heading .eyebrow {
  display: block;
}

body[data-view="home"] .topbar,
body[data-view="admin"] .topbar {
  position: sticky;
  top: 0;
  margin: 0;
  padding: 18px;
  background: linear-gradient(180deg, var(--yellow) 72%, rgba(245, 255, 0, 0));
}

body[data-view="home"] .session-pill {
  display: inline-flex;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.08);
  color: rgba(5, 5, 5, 0.74);
  padding: 0 12px;
  font-size: 0.76rem;
  font-weight: 900;
}

body[data-verify-step="face"] .verify-heading h2,
body[data-verify-step="face"] .verify-heading .eyebrow {
  display: none;
}

body[data-verify-step="face"] .verify-step[data-verify-step="face"] {
  gap: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
}

body[data-verify-step="face"] .verify-step[data-verify-step="face"]::before {
  content: "Verificació Facial";
  font-size: 1rem;
  font-weight: 1000;
  line-height: 1.05;
}

body[data-verify-step="face"] .camera-box {
  aspect-ratio: 0.9;
  max-height: 430px;
}

body[data-verify-step="face"] .challenge-card {
  display: grid;
}

.method-card {
  display: grid;
  gap: 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 16px;
  animation: cardMorphIn 420ms var(--ease) both;
}

.method-card strong {
  font-size: 1rem;
  line-height: 1.05;
}

.method-card span {
  color: rgba(5, 5, 5, 0.7);
  font-size: 0.74rem;
  font-weight: 760;
  line-height: 1.18;
}

.disabled-card {
  opacity: 0.42;
  filter: saturate(0.35);
}

.active-card input {
  min-height: 40px;
  background: rgba(5, 5, 5, 0.1);
}

.active-card .primary-button {
  width: 100%;
  justify-content: center;
  color: #fff;
}

.active-card .primary-button span {
  display: inline;
  color: #fff;
}

body[data-verify-step="done"] .view {
  align-items: center;
}

body[data-verify-step="done"] .verify-heading {
  display: none;
}

body[data-verify-step="done"] .success-card {
  min-height: calc(100vh - 160px);
  justify-items: center;
  align-content: center;
  text-align: center;
  position: relative;
}

body[data-verify-step="done"] .success-mark {
  display: none;
}

body[data-verify-step="done"] .success-card::after {
  content: "mySDEP";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;
  font-size: 0.8rem;
  font-weight: 1000;
  letter-spacing: -0.04em;
}

body[data-verify-step="done"] .success-card strong {
  font-size: 1.7rem;
  font-style: italic;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-verify-step="done"] .success-status {
  display: block;
  color: rgba(5, 5, 5, 0.52);
}

body[data-verify-step="done"] .success-progress {
  display: block;
}

.home-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: clamp(86px, 18vh, 150px) 0 38px;
  text-align: center;
}

.home-hero .app-logo {
  margin: 0;
}

.home-hero h2 {
  font-size: 1rem;
  font-style: italic;
  font-weight: 950;
}

.dashboard-list {
  display: grid;
  gap: 18px;
}

.dashboard-section {
  display: grid;
  gap: 8px;
}

.dashboard-section > span,
.dashboard-title span {
  font-size: 0.74rem;
  font-weight: 950;
}

.dashboard-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-title .ghost-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.08);
  color: rgba(5, 5, 5, 0.72);
  font-size: 0.68rem;
}

.dashboard-placeholder {
  min-height: 58px;
  border-radius: 0;
  background: rgba(215, 215, 215, 0.88);
  color: rgba(5, 5, 5, 0.52);
  padding: 13px;
  font-size: 0.82rem;
  font-weight: 850;
}

.student-proposal-form,
.my-proposal {
  background: rgba(215, 215, 215, 0.88);
  padding: 13px;
}

.student-proposal-form {
  display: grid;
  gap: 12px;
}

.student-proposal-form input,
.student-proposal-form textarea {
  border-radius: 0;
}

.student-proposal-form textarea {
  min-height: 104px;
}

.student-proposal-form .secondary-button {
  min-height: 34px;
  border-radius: 8px;
  font-size: 0.76rem;
}

.my-proposal-list {
  display: grid;
  gap: 8px;
}

.my-proposal {
  display: grid;
  gap: 5px;
}

.my-proposal strong {
  font-size: 0.84rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.my-proposal span {
  color: rgba(5, 5, 5, 0.52);
  font-size: 0.72rem;
  font-weight: 950;
}

body[data-view="home"] .voting-panel {
  min-height: calc(100vh - 120px);
}

body[data-view="home"] .voting-panel.detail-mode .home-hero,
body[data-view="home"] .voting-panel.detail-mode .home-summary {
  display: none;
}

body[data-view="home"] .voting-panel.detail-mode {
  padding-top: 12px;
}

body[data-view="home"] .proposal {
  border-radius: 0;
  background: rgba(215, 215, 215, 0.88);
  box-shadow: none;
  padding: 13px;
}

body[data-view="home"] .proposal h3 {
  font-size: 0.86rem;
}

body[data-view="home"] .proposal p,
body[data-view="home"] .results {
  display: none;
}

body[data-view="home"] .vote-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 0;
}

body[data-view="home"] .vote-button {
  min-height: 32px;
  border-radius: 8px;
  font-size: 0.72rem;
}

.proposal-summary {
  display: grid;
  gap: 10px;
  cursor: default;
}

body[data-view="home"] .proposal-summary p {
  display: block;
  margin: 0;
  color: rgba(5, 5, 5, 0.62);
  font-size: 0.82rem;
  line-height: 1.22;
}

.open-proposal-button,
.back-link {
  width: fit-content;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.1);
  color: var(--ink);
  padding: 0 12px;
  font-size: 0.74rem;
  font-weight: 950;
  cursor: pointer;
}

.open-proposal-button {
  background: var(--ink);
  color: #fff;
}

.proposal-detail {
  display: grid;
  gap: 14px;
}

body[data-view="home"] .proposal-detail {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 18px;
}

body[data-view="home"] .proposal-detail p,
body[data-view="home"] .proposal-detail .results {
  display: grid;
}

.proposal-detail .proposal-status {
  margin: 0;
  color: rgba(5, 5, 5, 0.55);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.proposal-detail h3 {
  font-size: clamp(1.28rem, 5vw, 1.8rem);
  line-height: 0.98;
}

.proposal-detail > p:not(.proposal-status) {
  color: rgba(5, 5, 5, 0.72);
  font-size: 0.96rem;
  line-height: 1.35;
}

body[data-view="home"] .proposal-detail .detail-results {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-view="home"] .proposal-detail .detail-vote-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
}

body[data-view="home"] .proposal-detail .vote-button {
  min-height: 46px;
  font-size: 0.88rem;
}

body[data-view="home"] {
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 216, 200, 0.72), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(219, 239, 244, 0.7), transparent 32%),
    #211d19;
}

body[data-view="home"] .shell {
  color: var(--home-ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 216, 200, 0.92), transparent 28%),
    radial-gradient(circle at 96% 8%, rgba(223, 238, 228, 0.92), transparent 30%),
    linear-gradient(160deg, #fff3a8 0%, #fff9ea 48%, #eaf5ed 100%);
}

body[data-view="home"] .shell::before {
  inset: 8% auto auto -60px;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  filter: blur(2px);
}

body[data-view="home"] .topbar {
  background: linear-gradient(180deg, rgba(255, 246, 190, 0.96) 70%, rgba(255, 246, 190, 0));
}

body[data-view="home"] .session-pill,
body[data-view="home"] .nav-button,
body[data-view="home"] .top-actions .ghost-button {
  background: rgba(255, 252, 243, 0.76);
  color: var(--home-ink);
  box-shadow: inset 0 0 0 1px rgba(44, 36, 24, 0.08);
}

body[data-view="home"] .nav-button:hover,
body[data-view="home"] .top-actions .ghost-button:hover {
  background: var(--home-ink);
  color: #fffaf0;
}

body[data-view="home"] .voting-panel {
  min-height: calc(100vh - 120px);
}

body[data-view="home"] .home-hero {
  position: relative;
  justify-items: start;
  gap: 22px;
  margin: 28px 0 18px;
  text-align: left;
}

body[data-view="home"] .home-hero::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 216, 200, 0.42)),
    var(--home-rose);
  box-shadow: 0 16px 34px rgba(115, 95, 74, 0.14);
}

body[data-view="home"] .home-hero .app-logo {
  margin: 0;
  color: var(--home-ink);
  font-size: 2.05rem;
}

.home-hero-copy {
  display: grid;
  gap: 8px;
  max-width: 29rem;
}

.home-kicker {
  color: #6f4f22;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-view="home"] .home-hero h2 {
  color: var(--home-ink);
  font-size: clamp(1.85rem, 10vw, 2.85rem);
  font-style: normal;
  line-height: 0.96;
}

.home-hero-copy p:last-child {
  max-width: 24rem;
  color: var(--home-muted);
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.36;
}

body[data-view="home"] .home-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 22px;
}

body[data-view="home"] .home-summary div {
  min-height: 78px;
  border-radius: 16px;
  background: rgba(255, 252, 243, 0.72);
  color: var(--home-ink);
  padding: 13px;
  box-shadow:
    inset 0 0 0 1px rgba(44, 36, 24, 0.07),
    0 14px 30px rgba(99, 77, 54, 0.09);
}

body[data-view="home"] .home-summary div:nth-child(2) {
  background: rgba(223, 238, 228, 0.82);
}

body[data-view="home"] .home-summary div:nth-child(3) {
  background: rgba(219, 239, 244, 0.82);
}

body[data-view="home"] .home-summary span {
  color: rgba(44, 36, 24, 0.58);
  font-size: 0.66rem;
}

body[data-view="home"] .home-summary strong {
  color: var(--home-ink);
  font-size: clamp(0.84rem, 3vw, 1.08rem);
  line-height: 1.03;
  text-transform: lowercase;
}

body[data-view="home"] .dashboard-list {
  gap: 16px;
}

body[data-view="home"] .home-dashboard {
  display: grid;
  gap: 16px;
}

body[data-view="home"] .dashboard-main,
body[data-view="home"] .dashboard-rail,
body[data-view="home"] .live-results-panel,
body[data-view="home"] .tab-panel-shell {
  display: grid;
  gap: 12px;
}

body[data-view="home"] .dashboard-rail {
  align-content: start;
}

body[data-view="home"] .dashboard-section {
  gap: 10px;
}

body[data-view="home"] .dashboard-section > span,
body[data-view="home"] .dashboard-title span {
  color: rgba(44, 36, 24, 0.74);
  font-size: 0.76rem;
  text-transform: uppercase;
}

body[data-view="home"] .dashboard-title .ghost-button,
body[data-view="home"] .open-proposal-button,
body[data-view="home"] .back-link,
body[data-view="home"] .tab-button.active {
  background: linear-gradient(180deg, #4b3824, #2f251b);
  color: #fffaf0;
  box-shadow: 0 14px 28px rgba(64, 43, 24, 0.18);
}

body[data-view="home"] .dashboard-title .ghost-button:hover,
body[data-view="home"] .open-proposal-button:hover,
body[data-view="home"] .back-link:hover {
  background: #111;
}

body[data-view="home"] .dashboard-placeholder,
body[data-view="home"] .proposal,
body[data-view="home"] .student-proposal-form,
body[data-view="home"] .my-proposal,
body[data-view="home"] .live-result-card,
body[data-view="home"] .proposal-detail-page-card,
body[data-view="home"] .current-vote-card {
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 253, 247, 0.9), rgba(255, 248, 231, 0.76)),
    rgba(255, 252, 243, 0.82);
  color: var(--home-muted);
  box-shadow:
    inset 0 0 0 1px rgba(83, 59, 32, 0.09),
    0 18px 42px rgba(95, 66, 34, 0.1);
}

body[data-view="home"] .dashboard-placeholder {
  display: grid;
  align-content: center;
  min-height: 76px;
  padding: 16px;
  font-size: 0.84rem;
  line-height: 1.28;
  text-align: left;
}

body[data-view="home"] .proposal-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

body[data-view="home"] .proposal-summary.is-urgent {
  box-shadow:
    inset 0 0 0 1px rgba(173, 58, 34, 0.2),
    0 18px 42px rgba(173, 58, 34, 0.12);
}

body[data-view="home"] .proposal-summary.is-urgent .proposal-status {
  color: #9f341f;
}

body[data-view="home"] .proposal-summary.is-voted .proposal-status {
  color: #237047;
}

body[data-view="home"] .proposal-summary-copy {
  display: grid;
  gap: 8px;
}

body[data-view="home"] .proposal-summary h3 {
  color: var(--home-ink);
  font-size: 1.02rem;
  line-height: 1.12;
}

body[data-view="home"] .proposal-summary p {
  color: var(--home-muted);
  font-size: 0.86rem;
  line-height: 1.33;
}

body[data-view="home"] .proposal-summary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body[data-view="home"] .proposal-summary-meta strong,
body[data-view="home"] .proposal-summary-meta span {
  color: var(--home-muted);
  font-size: 0.76rem;
  font-weight: 950;
}

body[data-view="home"] .proposal-summary-meta .open-proposal-button {
  margin-left: auto;
}

body[data-view="home"] .dashboard-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.56);
  padding: 5px;
  box-shadow: inset 0 0 0 1px rgba(44, 36, 24, 0.07);
}

body[data-view="home"] .tab-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--home-muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-view="home"] .tab-panel {
  display: grid;
  gap: 10px;
}

body[data-view="home"] .notification-stack {
  display: grid;
  gap: 10px;
}

body[data-view="home"] .notification-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(44, 36, 24, 0.08);
}

body[data-view="home"] .notification-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body[data-view="home"] .notification-card span {
  color: rgba(44, 36, 24, 0.58);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-view="home"] .notification-card strong {
  color: var(--home-ink);
  font-size: 0.92rem;
  line-height: 1.12;
}

body[data-view="home"] .notification-card small {
  color: var(--home-muted);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.26;
}

body[data-view="home"] .notification-card.urgent {
  background: linear-gradient(145deg, rgba(255, 241, 212, 0.92), rgba(255, 228, 214, 0.76));
  box-shadow:
    inset 0 0 0 1px rgba(173, 58, 34, 0.16),
    0 14px 26px rgba(173, 58, 34, 0.1);
}

body[data-view="home"] .notification-card.urgent span {
  color: #9f341f;
}

body[data-view="home"] .notification-card.push-card {
  background: linear-gradient(145deg, rgba(219, 239, 244, 0.86), rgba(255, 253, 247, 0.78));
}

body[data-view="home"] .notification-card.push-card span {
  color: #25636f;
}

body[data-view="home"] .notification-card.push-card.enabled {
  background: linear-gradient(145deg, rgba(223, 238, 228, 0.92), rgba(255, 253, 247, 0.76));
}

body[data-view="home"] .notification-card.push-card.enabled span {
  color: #237047;
}

body[data-view="home"] .live-results-list {
  display: grid;
  gap: 10px;
}

body[data-view="home"] .live-result-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

body[data-view="home"] .live-result-card > div:first-child {
  display: grid;
  gap: 4px;
}

body[data-view="home"] .live-result-card span,
body[data-view="home"] .detail-results-panel > span {
  color: rgba(44, 36, 24, 0.58);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-view="home"] .live-result-card strong {
  color: var(--home-ink);
  font-size: 0.92rem;
  line-height: 1.14;
}

body[data-view="home"] .result-bars {
  display: grid;
  gap: 8px;
}

body[data-view="home"] .result-bar {
  display: grid;
  gap: 5px;
}

body[data-view="home"] .result-bar div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--home-muted);
  font-size: 0.72rem;
  font-weight: 950;
}

body[data-view="home"] .result-bar strong {
  font-size: 0.78rem;
}

body[data-view="home"] .result-bar i {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(44, 36, 24, 0.08);
}

body[data-view="home"] .result-bar i::after {
  content: "";
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

body[data-view="home"] .result-bar.no i::after {
  background: var(--red);
}

body[data-view="home"] .result-bar.abstain i::after {
  background: var(--amber);
}

body[data-view="home"] .student-proposal-form {
  gap: 12px;
  padding: 16px;
}

body[data-view="home"] .student-proposal-form label {
  color: var(--home-ink);
}

body[data-view="home"] .student-proposal-form input,
body[data-view="home"] .student-proposal-form textarea {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--home-ink);
  box-shadow: inset 0 0 0 1px rgba(44, 36, 24, 0.06);
}

body[data-view="home"] .student-proposal-form .secondary-button {
  min-height: 38px;
  border-radius: 999px;
  background: var(--home-ink);
  color: #fffaf0;
}

body[data-view="home"] .my-proposal {
  padding: 14px;
}

body[data-view="home"] .my-proposal strong {
  color: var(--home-ink);
}

body[data-view="home"] .my-proposal span {
  color: var(--home-muted);
}

body[data-view="home"] .proposal-detail-page {
  padding-top: 0;
}

body[data-view="home"] .proposal-detail-content {
  display: grid;
}

body[data-view="home"] .proposal-detail-page-card {
  display: grid;
  gap: 18px;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(83, 59, 32, 0.13), transparent 18px),
    linear-gradient(145deg, rgba(255, 253, 247, 0.96), rgba(255, 249, 236, 0.9));
  padding: 18px;
  position: relative;
}

body[data-view="home"] .proposal-detail-page-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(83, 59, 32, 0.1);
  border-radius: 18px;
  pointer-events: none;
}

body[data-view="home"] .proposal-detail-page-card::after {
  content: "mySDEP";
  position: absolute;
  right: 28px;
  bottom: 20px;
  color: rgba(83, 59, 32, 0.07);
  font-size: clamp(2.6rem, 10vw, 6.4rem);
  font-weight: 1000;
  letter-spacing: -0.05em;
  pointer-events: none;
}

body[data-view="home"] .detail-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

body[data-view="home"] .ballot-seal {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-left: auto;
  border-radius: 999px;
  background: #fff4cc;
  box-shadow:
    inset 0 0 0 1px rgba(83, 59, 32, 0.1),
    0 14px 28px rgba(95, 66, 34, 0.12);
  font-size: 1.55rem;
}

body[data-view="home"] .legal-status-stack {
  display: grid;
  justify-items: end;
  gap: 3px;
}

body[data-view="home"] .legal-status-stack small {
  color: rgba(83, 59, 32, 0.55);
  font-size: 0.72rem;
  font-weight: 900;
}

body[data-view="home"] .detail-page-grid,
body[data-view="home"] .detail-main-panel,
body[data-view="home"] .detail-results-panel {
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 1;
}

body[data-view="home"] .detail-main-panel h3 {
  color: var(--home-ink);
  font-size: clamp(1.75rem, 7vw, 2.78rem);
  line-height: 1;
}

body[data-view="home"] .detail-main-panel > p:not(.home-kicker) {
  max-width: 54rem;
  color: var(--home-muted);
  font-size: 0.96rem;
  font-weight: 760;
  line-height: 1.34;
}

body[data-view="home"] .ballot-notice {
  display: grid;
  gap: 5px;
  max-width: 52rem;
  border-radius: 14px;
  background: rgba(255, 244, 204, 0.68);
  padding: 12px 14px;
  box-shadow: inset 0 0 0 1px rgba(83, 59, 32, 0.08);
}

body[data-view="home"] .ballot-notice strong {
  color: var(--home-ink);
  font-size: 0.92rem;
}

body[data-view="home"] .ballot-notice span,
body[data-view="home"] .ballot-footnote {
  color: rgba(83, 59, 32, 0.7);
  font-size: 0.84rem;
  font-weight: 760;
  line-height: 1.32;
}

body[data-view="home"] .current-vote-card {
  display: grid;
  gap: 4px;
  background: rgba(255, 255, 255, 0.72);
  padding: 13px 14px;
}

body[data-view="home"] .current-vote-card span {
  color: rgba(44, 36, 24, 0.58);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-view="home"] .current-vote-card strong {
  color: var(--home-ink);
  font-size: 1.25rem;
}

body[data-view="home"] .current-vote-card small {
  color: #9f341f;
  font-size: 0.78rem;
  font-weight: 900;
}

body[data-view="home"] .ballot-process,
body[data-view="home"] .ballot-choice-screen,
body[data-view="home"] .locked-vote-panel,
body[data-view="home"] .cast-processing {
  display: grid;
  gap: 12px;
}

body[data-view="home"] .ballot-process-track,
body[data-view="home"] .processing-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

body[data-view="home"] .processing-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-view="home"] .ballot-process-track span,
body[data-view="home"] .processing-steps span {
  display: grid;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  background: rgba(44, 36, 24, 0.08);
  color: rgba(44, 36, 24, 0.62);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-view="home"] .ballot-process-track span.active,
body[data-view="home"] .processing-steps span.active {
  background: #2f251b;
  color: #fffaf0;
}

body[data-view="home"] .ballot-process-card,
body[data-view="home"] .locked-vote-panel,
body[data-view="home"] .cast-processing {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(83, 59, 32, 0.08);
}

body[data-view="home"] .ballot-process-card {
  display: grid;
  gap: 10px;
}

body[data-view="home"] .ballot-process-card > span {
  color: rgba(44, 36, 24, 0.58);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-view="home"] .ballot-process-card strong,
body[data-view="home"] .locked-vote-panel strong,
body[data-view="home"] .cast-processing strong {
  color: var(--home-ink);
  font-size: 1.08rem;
}

body[data-view="home"] .ballot-process-card p,
body[data-view="home"] .locked-vote-panel span {
  color: var(--home-muted);
  font-size: 0.88rem;
  font-weight: 760;
  line-height: 1.34;
}

body[data-view="home"] .ballot-process-card .primary-button {
  min-height: 42px;
  border-radius: 999px;
  background: #2f251b;
  color: #fffaf0;
}

body[data-view="home"] .locked-vote-panel .ghost-button {
  justify-self: start;
}

body[data-view="home"] .locked-vote-panel .ghost-button:disabled {
  opacity: 0.62;
  cursor: default;
}

body[data-view="home"] .cast-processing {
  justify-items: center;
  text-align: center;
}

body[data-view="home"] .detail-results-panel {
  align-content: start;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 245, 221, 0.66));
  padding: 16px;
  box-shadow:
    inset 0 0 0 1px rgba(83, 59, 32, 0.09),
    0 16px 30px rgba(95, 66, 34, 0.08);
}

body[data-view="home"] .detail-results-panel > strong {
  color: var(--home-ink);
  font-size: 1.15rem;
}

body[data-view="home"] .proposal-detail {
  border-radius: 20px;
  background: rgba(255, 252, 243, 0.84);
  box-shadow:
    inset 0 0 0 1px rgba(44, 36, 24, 0.08),
    0 18px 42px rgba(99, 77, 54, 0.1);
}

body[data-view="home"] .proposal-detail .proposal-status {
  color: #6f4f22;
}

body[data-view="home"] .proposal-detail h3 {
  color: var(--home-ink);
}

body[data-view="home"] .proposal-detail > p:not(.proposal-status) {
  color: var(--home-muted);
}

body[data-view="home"] .result {
  background: rgba(255, 255, 255, 0.7);
}

body[data-view="home"] .vote-button {
  border-radius: 11px;
  font-weight: 950;
  box-shadow:
    inset 0 0 0 1px rgba(44, 36, 24, 0.08),
    0 10px 18px rgba(95, 66, 34, 0.08);
}

body[data-view="home"] .vote-button.active {
  outline: 3px solid rgba(83, 59, 32, 0.28);
  outline-offset: 2px;
}

body[data-view="home"] .vote-button.yes {
  background: linear-gradient(180deg, #eff9e9, #d9edce);
}

body[data-view="home"] .vote-button.no {
  background: linear-gradient(180deg, #ffe9e5, #ffd4cf);
}

body[data-view="home"] .vote-button.abstain {
  background: linear-gradient(180deg, #fff6d8, #ffe8ad);
}

@media (min-width: 900px) {
  body {
    display: grid;
    place-items: center;
    padding: 24px;
  }

  .shell {
    width: min(430px, calc(100vw - 48px));
    min-height: min(900px, calc(100vh - 48px));
    border-radius: 30px;
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.34);
  }

  body[data-view="home"] .shell,
  body[data-view="admin"] .shell {
    width: min(1180px, calc(100vw - 112px));
    min-height: min(820px, calc(100vh - 118px));
  }

  body[data-view="home"] .view,
  body[data-view="admin"] .view {
    padding: 88px 56px 56px;
  }

  body[data-view="home"] .topbar,
  body[data-view="admin"] .topbar {
    padding: 22px 56px;
  }

  body[data-view="home"] .home-view {
    padding: 42px 64px 64px;
  }

  .home-hero {
    justify-items: start;
    margin: 26px 0 30px;
    text-align: left;
  }

  .home-hero .app-logo {
    font-size: 2rem;
  }

  .home-hero h2 {
    font-size: 1.15rem;
  }

  .dashboard-list {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    align-items: start;
    gap: 22px;
  }

  .dashboard-section:first-child {
    grid-row: span 2;
  }

  .proposal-list {
    gap: 14px;
  }

  body[data-view="home"] .proposal-summary {
    min-height: 128px;
    padding: 18px;
  }

  body[data-view="home"] .proposal-summary h3 {
    font-size: 1.18rem;
  }

  body[data-view="home"] .proposal-summary p {
    max-width: 56rem;
  }

  body[data-view="home"] .proposal-detail {
    min-height: 420px;
    align-content: start;
    padding: 24px;
  }

  .proposal-detail h3 {
    max-width: 800px;
    font-size: 2.15rem;
  }

  .proposal-detail > p:not(.proposal-status) {
    max-width: 760px;
    font-size: 1.05rem;
  }

  body[data-view="home"] .proposal-detail .detail-vote-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-placeholder {
    min-height: 110px;
  }

  body[data-view="home"] .home-hero {
    margin: 0 0 16px;
  }

  body[data-view="home"] .home-hero .app-logo {
    font-size: 1.9rem;
  }

  body[data-view="home"] .home-hero h2 {
    max-width: 560px;
    font-size: clamp(2.2rem, 4.2vw, 3.35rem);
  }

  body[data-view="home"] .home-summary {
    max-width: 760px;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  body[data-view="home"] .home-summary div {
    min-height: 64px;
    padding: 11px 13px;
  }

  body[data-view="home"] .dashboard-list {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  }

  body[data-view="home"] .home-dashboard {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
    align-items: start;
    gap: 22px;
  }

  body[data-view="home"] .live-results-list {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
  }

  body[data-view="home"] .proposal-summary {
    grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
    align-items: center;
  }

  body[data-view="home"] .proposal-summary-meta {
    justify-content: flex-end;
    text-align: right;
  }

  body[data-view="home"] .proposal-summary-meta .open-proposal-button {
    margin-left: 0;
  }

  body[data-view="home"] .detail-page-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
    align-items: start;
  }

  body[data-view="home"] .proposal-detail-page-card {
    min-height: 470px;
    padding: 22px 24px;
  }

  body[data-view="home"] .detail-vote-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-view="home"] .dashboard-placeholder {
    min-height: 124px;
  }
}

body[data-verify-step="face"] #startScanButton {
  width: 100%;
  justify-content: center;
}

@media (min-width: 680px) and (max-width: 899px) {
  body {
    display: grid;
    place-items: center;
    padding: 24px;
  }

  .shell {
    min-height: min(900px, calc(100vh - 48px));
    border-radius: 30px;
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.34);
  }

  .splash-screen {
    left: 50%;
    width: min(100%, 430px);
    transform: translateX(-50%);
  }
}

@media (min-width: 390px) {
  .vote-grid,
  .results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  body[data-view="home"] .proposal-detail-page .detail-vote-grid {
    grid-template-columns: 1fr;
  }

  body[data-view="home"] .notification-card {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-view="home"] .notification-card .open-proposal-button {
    width: 100%;
  }

  body[data-view="home"] .ballot-process-track,
  body[data-view="home"] .processing-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

body[data-scan-mode] {
  overflow: hidden;
  background: #000;
}

body[data-scan-mode] .shell {
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

body[data-scan-mode] .shell::before,
body[data-scan-mode] .topbar,
body[data-scan-mode] .step-track,
body[data-scan-mode] .notice,
body[data-scan-mode] .verify-heading .eyebrow,
body[data-scan-mode] .verify-heading h2,
body[data-scan-mode] .verify-heading p:last-child,
body[data-scan-mode] #startScanButton {
  display: none;
}

body[data-scan-mode] .login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: block;
  padding: 0;
}

body[data-scan-mode] .verify-panel,
body[data-scan-mode] .verify-step[data-verify-step="face"] {
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  animation: none;
}

body[data-scan-mode] .verify-step[data-verify-step="face"] {
  display: block;
}

body[data-scan-mode] .verify-step[data-verify-step="face"]::before {
  display: none;
}

body[data-scan-mode] .verify-heading {
  position: fixed;
  top: max(48px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  justify-items: center;
  margin: 0;
  pointer-events: none;
}

body[data-scan-mode] .app-logo {
  margin: 0;
  color: #fff;
  font-size: 1.82rem;
  text-align: center;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
}

body[data-scan-mode] .camera-box {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
  box-shadow: none;
  animation: scanTakeover 560ms var(--ease) both;
}

body[data-scan-mode="connecting"] .camera-box video {
  opacity: 0;
}

body[data-scan-mode="camera"] .camera-box video,
body[data-scan-mode="complete"] .camera-box video {
  opacity: 1;
}

body[data-scan-mode] .camera-placeholder {
  z-index: 24;
  font-size: 1.02rem;
}

body[data-scan-mode="connecting"] .challenge-card,
body[data-scan-mode="connecting"] .face-target {
  display: none;
}

body[data-scan-mode] .challenge-card {
  position: fixed;
  top: max(126px, calc(env(safe-area-inset-top) + 94px));
  left: 50%;
  z-index: 42;
  width: min(calc(100vw - 44px), 360px);
  min-height: 52px;
  align-content: center;
  justify-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #050505;
  padding: 11px 18px;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
}

body[data-scan-mode] .challenge-card span {
  display: none;
}

body[data-scan-mode] .challenge-card strong {
  color: #050505;
  font-size: 1rem;
  line-height: 1.08;
}

body[data-scan-mode] .face-target {
  z-index: 22;
}

body[data-scan-mode] .face-ring {
  width: min(54vw, 250px);
  min-width: 178px;
  border-width: 3px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.34);
}

body[data-scan-mode] .scan-line {
  left: 25%;
  right: 25%;
  top: calc(50% - 42px);
}

body[data-scan-mode] .camera-box.turning-right .scan-line,
body[data-scan-mode] .camera-box.turning-left .scan-line,
body[data-scan-mode] .camera-box.complete .scan-line {
  animation: none;
  opacity: 0;
}

body[data-scan-mode] .turn-arrow {
  top: 50%;
  right: max(28px, calc(50vw - 184px));
  z-index: 32;
  width: 68px;
  height: 68px;
  background: var(--yellow);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  animation-name: scanArrowRight;
}

body[data-scan-mode] .camera-box.turning-left .turn-arrow {
  left: max(28px, calc(50vw - 184px));
  right: auto;
  animation-name: scanArrowLeft;
}

body[data-scan-mode] .camera-box.complete .turn-arrow {
  left: 50%;
  right: auto;
  display: grid;
  background: #74e09b;
  color: #050505;
  animation: checkPop 620ms var(--ease) both;
}

body[data-scan-mode] .camera-instruction {
  display: none;
}

body[data-scan-mode] .debug-panel {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 42;
  width: min(calc(100vw - 34px), 380px);
  transform: translateX(-50%);
}

body[data-scan-mode] .login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding: 78px 28px 44px;
}

body[data-scan-mode] .verify-panel {
  width: 100%;
  height: auto;
  padding: 0;
  animation: screenIn 520ms var(--ease) both;
}

body[data-scan-mode] .verify-heading {
  position: static;
  display: grid;
  justify-items: stretch;
  margin-bottom: 18px;
  pointer-events: auto;
}

body[data-scan-mode] .app-logo {
  margin-bottom: 38px;
  color: var(--ink);
  font-size: 1.65rem;
  text-align: left;
  text-shadow: none;
}

body[data-scan-mode] .verify-step[data-verify-step="face"] {
  display: grid;
  gap: 12px;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
}

body[data-scan-mode] .verify-step[data-verify-step="face"]::before {
  display: block;
  content: "Verificació Facial";
}

body[data-scan-mode] .camera-box {
  position: relative;
  inset: auto;
  z-index: auto;
  width: 100%;
  height: auto;
  max-height: 430px;
  aspect-ratio: 0.9;
  border-radius: 14px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: none;
}

body[data-scan-mode] .challenge-card {
  display: none !important;
}

body[data-scan-mode] .face-ring {
  width: min(64%, 190px);
  min-width: 0;
}

body[data-scan-mode] .scan-line {
  left: 20%;
  right: 20%;
  top: 27%;
}

body[data-scan-mode] .turn-arrow {
  top: 16px;
  right: 16px;
  z-index: 6;
  width: 58px;
  height: 58px;
  box-shadow: none;
  animation-name: arrowNudgeRight;
}

body[data-scan-mode] .camera-box.turning-left .turn-arrow {
  left: 16px;
  right: auto;
  animation-name: arrowNudgeLeft;
}

body[data-scan-mode] .camera-box.complete .turn-arrow {
  left: 50%;
  right: auto;
}

body[data-scan-mode] .camera-instruction {
  display: grid;
}

body[data-scan-mode] .debug-panel {
  display: none;
}

body[data-scan-mode] {
  overflow: auto !important;
  background: #1f1f1f !important;
}

body[data-scan-mode] .shell {
  position: relative !important;
  inset: auto !important;
  width: min(100%, 430px) !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  border-radius: 0 !important;
  background: var(--yellow) !important;
  box-shadow: none !important;
}

@media (min-width: 680px) {
  body[data-scan-mode] {
    display: grid !important;
    place-items: center !important;
    padding: 24px !important;
  }

  body[data-scan-mode] .shell {
    width: min(430px, calc(100vw - 48px)) !important;
    min-height: min(900px, calc(100vh - 48px)) !important;
    border-radius: 30px !important;
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.34) !important;
  }
}

@media (min-width: 900px) {
  body:not([data-scan-mode]) {
    display: block;
    padding: 0;
    background: var(--yellow);
  }

  body:not([data-scan-mode]) .shell,
  body:not([data-scan-mode])[data-view="home"] .shell,
  body:not([data-scan-mode])[data-view="admin"] .shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body:not([data-scan-mode]) .view {
    min-height: 100vh;
    min-height: 100dvh;
  }

  body:not([data-scan-mode]) .login-view {
    padding: clamp(64px, 8vh, 96px) clamp(32px, 7vw, 96px) 128px;
  }

  body:not([data-scan-mode]) .login-view .verify-panel {
    width: min(430px, 100%);
    margin: 0 auto;
  }

  body:not([data-scan-mode])[data-view="home"] .voting-panel,
  body:not([data-scan-mode])[data-view="admin"] .admin-panel {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
  }
}

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

@keyframes scanTakeover {
  0% {
    opacity: 0.82;
    transform: scale(0.92);
    border-radius: 22px;
  }

  100% {
    opacity: 1;
    transform: scale(1);
    border-radius: 0;
  }
}

@keyframes checkPop {
  0% {
    transform: translate(-50%, -50%) scale(0.68);
    opacity: 0;
  }

  62% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes scanArrowRight {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }

  50% {
    transform: translateY(-50%) translateX(12px);
  }
}

@keyframes scanArrowLeft {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }

  50% {
    transform: translateY(-50%) translateX(-12px);
  }
}

@keyframes splashExit {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes logoPop {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(14px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes screenIn {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardMorphIn {
  0% {
    opacity: 0;
    border-radius: 28px;
    transform: translateY(26px) scale(0.94);
    filter: blur(8px);
  }

  100% {
    opacity: 1;
    border-radius: var(--radius);
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

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

@keyframes fakeWelcomeLoad {
  0% {
    transform: scaleX(0.06);
  }

  38% {
    transform: scaleX(0.58);
  }

  68% {
    transform: scaleX(0.78);
  }

  86% {
    transform: scaleX(0.92);
  }

  100% {
    transform: scaleX(1);
  }
}

@keyframes ringPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.035);
  }
}

@keyframes scanSweep {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(132px);
  }
}

@keyframes faceScanSweep {
  0%,
  100% {
    top: var(--face-scan-start, 27%);
  }

  50% {
    top: var(--face-scan-end, 70%);
  }
}

@keyframes arrowNudgeRight {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(10px);
  }
}

@keyframes arrowNudgeLeft {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-10px);
  }
}

body[data-scan-mode] {
  display: block !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: #000 !important;
}

body[data-scan-mode] .shell {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  box-shadow: none !important;
}

body[data-scan-mode] .shell::before,
body[data-scan-mode] .topbar,
body[data-scan-mode] .step-track,
body[data-scan-mode] .notice,
body[data-scan-mode] .verify-heading .eyebrow,
body[data-scan-mode] .verify-heading h2,
body[data-scan-mode] .verify-heading p:last-child,
body[data-scan-mode] #startScanButton,
body[data-scan-mode] .verify-step[data-verify-step="face"]::before {
  display: none !important;
}

body[data-scan-mode] .login-view,
body[data-scan-mode] .verify-panel,
body[data-scan-mode] .verify-step[data-verify-step="face"] {
  display: block !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
  animation: none !important;
}

body[data-scan-mode] .verify-heading {
  position: fixed !important;
  top: max(46px, env(safe-area-inset-top)) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 40 !important;
  display: grid !important;
  justify-items: center !important;
  margin: 0 !important;
  pointer-events: none !important;
}

body[data-scan-mode] .app-logo {
  margin: 0 !important;
  color: #fff !important;
  font-size: 1.82rem !important;
  text-align: center !important;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.36) !important;
}

body[data-scan-mode] .camera-box {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  background: #000 !important;
  box-shadow: none !important;
  animation: scanTakeover 420ms var(--ease) both !important;
}

body[data-scan-mode] .camera-box video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body[data-scan-mode="connecting"] .camera-box video {
  opacity: 0 !important;
}

body[data-scan-mode="camera"] .camera-box video,
body[data-scan-mode="complete"] .camera-box video {
  opacity: 1 !important;
}

body[data-scan-mode] .challenge-card {
  position: fixed !important;
  top: max(126px, calc(env(safe-area-inset-top) + 94px)) !important;
  left: 50% !important;
  z-index: 42 !important;
  display: grid !important;
  width: min(calc(100vw - 44px), 360px) !important;
  min-height: 52px !important;
  align-content: center !important;
  justify-items: center !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #050505 !important;
  padding: 11px 18px !important;
  text-align: center !important;
  transform: translateX(-50%) !important;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24) !important;
}

body[data-scan-mode] .challenge-card span {
  display: none !important;
}

body[data-scan-mode] .challenge-card strong {
  color: #050505 !important;
  font-size: 1rem !important;
  line-height: 1.08 !important;
}

body[data-scan-mode] .camera-instruction {
  display: none !important;
}

body[data-scan-mode] .face-target {
  z-index: 22 !important;
}

body[data-scan-mode] .face-ring {
  position: relative !important;
  width: min(54vw, 250px) !important;
  min-width: 178px !important;
  border-width: 3px !important;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.34) !important;
}

body[data-scan-mode] .camera-box.tracking-face.face-found .face-target {
  display: block !important;
}

body[data-scan-mode] .camera-box.tracking-face.face-found .face-ring {
  position: absolute !important;
  left: var(--face-x, 50%) !important;
  top: var(--face-y, 50%) !important;
  width: var(--face-w, min(54vw, 250px)) !important;
  min-width: 138px !important;
  transform: translate(-50%, -50%) !important;
}

body[data-scan-mode] .camera-box.tracking-face.scanning .scan-line {
  left: var(--face-scan-left, 25%) !important;
  right: auto !important;
  top: var(--face-scan-start, calc(50% - 42px)) !important;
  width: var(--face-w, 54%) !important;
  animation: faceScanSweep 1250ms ease-in-out infinite !important;
  opacity: 1 !important;
}

body[data-scan-mode] .scan-line {
  left: 25% !important;
  right: 25% !important;
  top: calc(50% - 42px) !important;
}

body[data-scan-mode] .camera-box.turning-right .scan-line,
body[data-scan-mode] .camera-box.turning-left .scan-line,
body[data-scan-mode] .camera-box.complete .scan-line {
  animation: none !important;
  opacity: 0 !important;
}

body[data-scan-mode] .turn-arrow {
  top: 50% !important;
  right: max(28px, calc(50vw - 184px)) !important;
  z-index: 32 !important;
  width: 68px !important;
  height: 68px !important;
  background: var(--yellow) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28) !important;
  animation-name: scanArrowRight !important;
}

body[data-scan-mode] .camera-box.turning-left .turn-arrow {
  left: max(28px, calc(50vw - 184px)) !important;
  right: auto !important;
  animation-name: scanArrowLeft !important;
}

body[data-scan-mode] .camera-box.complete .turn-arrow {
  left: 50% !important;
  right: auto !important;
  display: grid !important;
  background: #74e09b !important;
  color: #050505 !important;
  animation: checkPop 620ms var(--ease) both !important;
}

body[data-scan-mode] .debug-panel {
  display: none !important;
}

@media (min-width: 900px) {
  body[data-view="admin"] .admin-panel {
    max-width: 1040px;
    margin: 0 auto;
  }

  .admin-overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .ballot-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.8fr) minmax(190px, 0.55fr);
    align-items: center;
  }

  .roster-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .roster-board .compact-row {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    min-height: 116px;
  }
}

body[data-view="admin"] {
  background: #0b1020;
}

body[data-view="admin"] .shell {
  color: #e5e7eb;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 280px),
    #0f172a;
}

body[data-view="admin"] .shell::before {
  display: none;
}

body[data-view="admin"] .topbar {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 72%, rgba(15, 23, 42, 0));
}

body[data-view="admin"] .nav-button,
body[data-view="admin"] .top-actions .ghost-button,
body[data-view="admin"] .admin-panel .ghost-button {
  background: #1e293b;
  color: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

body[data-view="admin"] .nav-button:hover,
body[data-view="admin"] .top-actions .ghost-button:hover,
body[data-view="admin"] .admin-panel .ghost-button:hover {
  background: #2563eb;
  color: #eff6ff;
}

body[data-view="admin"] .admin-suite-heading {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

body[data-view="admin"] .eyebrow,
body[data-view="admin"] .tool-heading span {
  color: #93c5fd;
}

body[data-view="admin"] h2,
body[data-view="admin"] .tool-heading strong,
body[data-view="admin"] .admin-row strong,
body[data-view="admin"] .admin-metric strong {
  color: #f8fafc;
}

body[data-view="admin"] .admin-metric,
body[data-view="admin"] .admin-section,
body[data-view="admin"] .tool-section,
body[data-view="admin"] .admin-row,
body[data-view="admin"] .admin-empty,
body[data-view="admin"] .admin-snapshot,
body[data-view="admin"] .pin-output,
body[data-view="admin"] .admin-block {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #151f32;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.2);
}

body[data-view="admin"] .admin-metric {
  min-height: 118px;
  align-content: space-between;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: #111827;
  color: #94a3b8;
  padding: 0 14px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
}

.admin-tabs button.active {
  border-color: rgba(96, 165, 250, 0.48);
  background: #2563eb;
  color: #eff6ff;
}

.admin-tab-panel {
  animation: adminPanelIn 180ms ease both;
}

body[data-view="admin"] .admin-metric span,
body[data-view="admin"] .admin-metric small,
body[data-view="admin"] .admin-row small,
body[data-view="admin"] .admin-row-actions span,
body[data-view="admin"] .pin-output,
body[data-view="admin"] .admin-empty,
body[data-view="admin"] .admin-snapshot {
  color: #94a3b8;
}

body[data-view="admin"] input,
body[data-view="admin"] textarea {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #0f172a;
  color: #f8fafc;
}

body[data-view="admin"] label {
  color: #cbd5e1;
}

body[data-view="admin"] input::placeholder,
body[data-view="admin"] textarea::placeholder {
  color: #64748b;
}

body[data-view="admin"] input:focus,
body[data-view="admin"] textarea:focus {
  background: #111c31;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}

body[data-view="admin"] .secondary-button,
body[data-view="admin"] .primary-button {
  background: #2563eb;
  color: #eff6ff;
}

body[data-view="admin"] .admin-result-strip span {
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: #0f172a;
  color: #94a3b8;
}

body[data-view="admin"] .admin-result-strip b {
  color: #f8fafc;
}

.ballot-primary {
  display: grid;
  gap: 9px;
}

.row-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.turnout-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.turnout-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
}

.participation-split {
  display: grid;
  gap: 10px;
}

.name-group {
  display: grid;
  gap: 7px;
}

.name-group strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.name-group strong small {
  color: #94a3b8;
}

.name-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.name-chip {
  display: inline-grid;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

body[data-view="admin"] .name-chip.voted {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

body[data-view="admin"] .name-chip.request {
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
}

body[data-view="admin"] .name-chip.missing {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

body[data-view="admin"] .name-chip.quiet {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.roster-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.student-progress {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.student-progress strong {
  font-size: 1.05rem;
}

.ballot-dots {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ballot-dots span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #64748b;
}

.ballot-dots span.voted {
  background: #22c55e;
}

.ballot-dots span.request {
  background: #fbbf24;
}

.ballot-dots span.missing {
  background: #ef4444;
}

.vote-reset-group > div {
  display: grid;
  gap: 8px;
}

.vote-reset-request {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.08);
  padding: 10px;
}

.vote-reset-request > div:first-child {
  display: grid;
  gap: 2px;
}

.vote-reset-request b {
  color: #f8fafc;
  font-size: 0.8rem;
}

.vote-reset-request span {
  color: #fcd34d;
  font-size: 0.7rem;
  font-weight: 900;
}

.vote-reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vote-reset-actions .ghost-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 0.7rem;
}

.josep-card {
  display: grid;
  gap: 22px;
  justify-items: center;
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.18), transparent 42%),
    #151f32;
  text-align: center;
}

.josep-gauge {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, #22c55e 0 var(--fill), #ef4444 var(--fill) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 28px 70px rgba(0, 0, 0, 0.36);
}

.josep-gauge::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 42%),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.16) 0 1px, transparent 1px 18px);
  pointer-events: none;
}

.josep-gauge-progress {
  position: absolute;
  inset: 10px 10px 0;
  border-radius: inherit;
  box-shadow: inset 0 18px 44px rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.josep-gauge-center {
  position: absolute;
  left: 50%;
  bottom: -1px;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  width: min(58%, 300px);
  aspect-ratio: 2 / 1;
  border-radius: 999px 999px 0 0;
  background: #0f172a;
  transform: translateX(-50%);
  box-shadow: 0 -18px 42px rgba(0, 0, 0, 0.26);
}

.josep-gauge-center strong {
  color: #f8fafc;
  font-size: clamp(2.3rem, 13vw, 5.4rem);
  font-weight: 1000;
  line-height: 0.9;
}

.josep-gauge-center span {
  max-width: 12rem;
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.josep-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 36rem;
}

.josep-copy h3 {
  color: #f8fafc;
  font-size: clamp(1.45rem, 5vw, 2.3rem);
  line-height: 0.98;
}

.josep-copy p {
  color: #94a3b8;
  font-weight: 760;
  line-height: 1.42;
}

.josep-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.josep-stats span {
  display: grid;
  gap: 3px;
  min-height: 66px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  background: #0f172a;
  color: #94a3b8;
  padding: 11px;
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.josep-stats b {
  color: #f8fafc;
  font-size: 1.45rem;
  line-height: 1;
}

body[data-view="admin"] .status-chip.open,
body[data-view="admin"] .status-chip.active {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

body[data-view="admin"] .status-chip.closed,
body[data-view="admin"] .status-chip.revoked {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

body[data-view="admin"] .status-chip.used {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

body[data-view="admin"] .status-chip.expired,
body[data-view="admin"] .status-chip.quiet {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

@media (min-width: 900px) {
  body[data-view="admin"] .admin-panel {
    max-width: 1180px;
  }

  body[data-view="admin"] .ballot-row {
    grid-template-columns: minmax(260px, 1.05fr) minmax(210px, 0.55fr) minmax(320px, 1fr) minmax(150px, 0.42fr);
    align-items: start;
  }

  body[data-view="admin"] .roster-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view="admin"] .roster-board .roster-row {
    min-height: 132px;
  }

  .josep-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@keyframes adminPanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* A short receipt in the quieter visual language of SDEP Portal. */
body[data-view="home"] .vote-receipt {
  width: min(100%, 430px);
  margin-inline: auto;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(28px, 6vw, 44px) 24px;
  border: 1px solid #e9e9e7;
  border-radius: 6px;
  background: #fff;
  color: #37352f;
  text-align: center;
  box-shadow: 0 3px 6px #0f0f0f08, 0 9px 24px #0f0f0f0a;
  animation: receipt-enter 160ms cubic-bezier(.23, 1, .32, 1) both;
}
.receipt-brand {
  color: #787774;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .035em;
}
.receipt-brand > span { padding-inline: 6px; color: #b8b6b1; }
.receipt-seal {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-top: 12px;
  border: 1px solid #e9e9e7;
  border-radius: 50%;
  background: #f7f6f3;
}
.receipt-seal svg { width: 40px; height: 40px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.receipt-seal .seal-shackle { transform-origin: 32px 22px; animation: seal-lock 340ms cubic-bezier(.23, 1, .32, 1) both; }
.seal-check { opacity: 0; }
.receipt-data { height: 14px; width: 160px; overflow: hidden; color: #94918a; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 2px; }
.receipt-data > span { display: block; animation: seal-data 560ms linear infinite; }
.vote-receipt h3 { margin-top: 8px; font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -.035em; }
.vote-receipt p { max-width: 275px; color: #787774; font-size: 13px; line-height: 1.6; }
.vote-receipt small { color: #94918a; font-size: 11px; }
.receipt-track { width: 100%; height: 3px; margin-top: 12px; overflow: hidden; background: #eeedeb; border-radius: 3px; }
.receipt-track > span { display: block; height: 100%; background: #37352f; transform-origin: left; animation: receipt-wait 900ms cubic-bezier(.77, 0, .175, 1) infinite; }
.is-complete .receipt-seal { color: #219653; background: #f0f8f2; border-color: #d7ebde; }
.is-complete .seal-key { opacity: 0; }
.is-complete .seal-check { opacity: 1; }
.is-complete .receipt-data { visibility: hidden; }
.is-complete .receipt-track > span { background: #219653; animation: none; transform: scaleX(1); }
.queue-notice {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(380px, calc(100% - 32px));
  padding: 18px 20px;
  border: 1px solid #e9e9e7;
  border-radius: 8px;
  background: #fff;
  color: #37352f;
  box-shadow: 0 8px 32px #00000016;
}
.queue-notice strong { font-size: 14px; font-weight: 650; }
.queue-notice p { margin-top: 4px; color: #787774; font-size: 12px; line-height: 1.5; }
.queue-pulse { flex: 0 0 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #219653; animation: queue-pulse 900ms ease-in-out infinite; }
.invitation-tools { grid-column: 1 / -1; display: grid; gap: 8px; }
.invitation-tools button { justify-self: start; }
.invitation-output { width: 100%; min-width: 0; font: 12px ui-monospace, monospace; }
body[data-verify-step="done"] .success-card strong { font-size: 1.35rem; font-style: normal; font-weight: 650; letter-spacing: -.025em; }
@keyframes receipt-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes seal-lock { from { transform: translateY(-5px) rotate(-12deg); } to { transform: translateY(0) rotate(0); } }
@keyframes seal-data { 0%, 100% { opacity: .4; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes receipt-wait { 0% { transform: translateX(-70%) scaleX(.3); } 100% { transform: translateX(100%) scaleX(.3); } }
@keyframes queue-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .splash-screen, .splash-screen strong, .vote-receipt, .receipt-seal .seal-shackle, .receipt-data > span, .receipt-track > span, .queue-pulse { animation: none !important; }
  .splash-screen { display: none; }
  .receipt-track > span { transform: scaleX(.65); }
  .is-complete .receipt-track > span { transform: scaleX(1); }
}
.receipt-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fafaf9;
  overflow-y: auto;
}
