@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&family=Raleway:wght@600;700;800&display=swap");

:root {
  --ink: #34383a;
  --ink-soft: #5a5a57;
  --forest: #0071bd;
  --forest-2: #005b98;
  --cream: #f3f6f8;
  --paper: #ffffff;
  --white: #ffffff;
  --line: #dbe3e8;
  --line-strong: #c5d1d8;
  --coral: #0071bd;
  --coral-dark: #005b98;
  --coral-soft: #e8f3fa;
  --gold: #00a2ea;
  --gold-soft: #e4f7ff;
  --mint: #9dd5ee;
  --green: #27805d;
  --green-soft: #e6f5ee;
  --blue: #0071bd;
  --blue-soft: #e8f3fa;
  --danger: #b73936;
  --shadow-sm: 0 1px 2px rgb(52 56 58 / 0.06), 0 4px 12px rgb(52 56 58 / 0.05);
  --shadow-md: 0 16px 48px rgb(28 62 82 / 0.15);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --font-body: "Open Sans", "Segoe UI", sans-serif;
  --font-display: "Raleway", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(0 113 189 / 0.28);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  justify-items: center;
  color: var(--ink-soft);
}

.boot-screen p {
  margin: 16px 0;
}

.municipal-logo--boot {
  width: 230px;
  height: auto;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--coral);
  color: var(--white);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.18);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
}

.brand-mark--large {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  animation: soft-pulse 1.5s ease-in-out infinite;
}

.brand-mark--large svg {
  width: 42px;
  height: 42px;
}

@keyframes soft-pulse {
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 9px rgb(0 113 189 / 0.08);
  }
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.access-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 1.1fr);
}

.access-page--simple {
  display: block;
  background: var(--forest);
}

.access-page--simple .access-panel {
  min-height: 100svh;
  background:
    radial-gradient(circle at 18% 15%, rgb(255 255 255 / 0.08), transparent 26%),
    radial-gradient(circle at 82% 84%, rgb(0 162 234 / 0.24), transparent 30%),
    var(--forest);
}

.access-card--simple {
  width: min(100%, 420px);
  padding: 42px;
  border: 0;
  text-align: center;
  box-shadow: 0 24px 70px rgb(0 47 79 / 0.28);
}

.municipal-logo {
  display: block;
  max-width: 100%;
  object-fit: contain;
}

.municipal-logo--access {
  width: 265px;
  height: auto;
  margin: 0 auto 36px;
}

.municipal-logo--header {
  width: 126px;
  height: 49px;
}

.access-card--simple .form-error {
  text-align: left;
}

.access-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: 52px clamp(36px, 6vw, 88px);
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 74% 20%, rgb(238 188 69 / 0.18) 0 3px, transparent 4px),
    radial-gradient(circle at 20% 70%, rgb(0 162 234 / 0.22) 0 5px, transparent 6px),
    var(--forest);
  color: var(--paper);
}

.access-story::before,
.access-story::after {
  position: absolute;
  content: "";
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 50%;
}

.access-story::before {
  top: -80px;
  right: -130px;
  width: 390px;
  height: 390px;
  box-shadow:
    0 0 0 46px rgb(255 255 255 / 0.025),
    0 0 0 92px rgb(255 255 255 / 0.018);
}

.access-story::after {
  bottom: -180px;
  left: -210px;
  width: 470px;
  height: 470px;
}

.access-brand,
.top-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}

.access-brand__text strong,
.top-brand__text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.15;
}

.access-brand__text span,
.top-brand__text span {
  display: block;
  margin-top: 3px;
  color: rgb(255 255 255 / 0.58);
  font-size: 0.75rem;
}

.access-story__content {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin: 80px 0;
}

.access-story__content .eyebrow {
  color: var(--gold);
}

.access-story h1 {
  max-width: 650px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.access-story h1 em {
  color: var(--gold);
  font-style: normal;
}

.access-story__content > p:last-of-type {
  max-width: 530px;
  margin: 28px 0 0;
  color: rgb(255 255 255 / 0.68);
  font-size: 1.03rem;
  line-height: 1.7;
}

.weight-list {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 540px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.weight-item {
  display: flex;
  padding: 15px 16px;
  align-items: center;
  gap: 13px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.045);
}

.weight-item strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.weight-item span {
  display: block;
  color: rgb(255 255 255 / 0.62);
  font-size: 0.77rem;
}

.access-panel {
  display: grid;
  min-height: 100vh;
  padding: 40px;
  place-content: center;
  background:
    linear-gradient(110deg, rgb(255 255 255 / 0.35), transparent 55%),
    var(--cream);
}

.access-card {
  width: min(100%, 470px);
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.access-card__mobile-brand {
  display: none;
  margin-bottom: 32px;
}

.access-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.access-card__intro {
  margin: 12px 0 30px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.83rem;
  font-weight: 700;
}

.text-input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.text-input:hover {
  border-color: #aaa398;
}

.text-input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgb(0 113 189 / 0.11);
  outline: none;
}

.access-code {
  height: 58px;
  padding: 0 18px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: var(--coral);
  color: var(--white);
  box-shadow: 0 5px 16px rgb(0 91 152 / 0.18);
}

.btn--primary:hover {
  background: var(--coral-dark);
  box-shadow: 0 8px 20px rgb(0 91 152 / 0.24);
}

.btn--dark {
  background: var(--forest);
  color: var(--white);
}

.btn--ghost {
  border-color: var(--line);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--line-strong);
  background: var(--white);
}

.btn--text {
  min-height: 36px;
  padding: 0 8px;
  background: transparent;
  color: var(--ink-soft);
}

.btn--danger {
  color: var(--danger);
}

.btn--full {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
}

.button-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgb(255 255 255 / 0.38);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.form-error {
  min-height: 20px;
  margin: 11px 0 0;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}

.privacy-note {
  display: flex;
  margin-top: 25px;
  padding-top: 21px;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.privacy-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--green);
}

.app-shell {
  min-height: 100vh;
  background: var(--cream);
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 72px;
  padding: 0 24px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
  background: var(--forest);
  color: var(--white);
  box-shadow: 0 5px 18px rgb(23 35 31 / 0.08);
}

.top-brand__text span {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.role-pill {
  display: inline-flex;
  min-height: 31px;
  padding: 0 11px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 99px;
  background: rgb(255 255 255 / 0.08);
  color: rgb(255 255 255 / 0.78);
  font-size: 0.73rem;
  font-weight: 700;
}

.role-pill::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  content: "";
}

.icon-button {
  display: grid;
  width: 39px;
  height: 39px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 10px;
  place-items: center;
  background: transparent;
  color: rgb(255 255 255 / 0.72);
  cursor: pointer;
}

.icon-button:hover {
  background: rgb(255 255 255 / 0.08);
  color: var(--white);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.ballot-layout {
  display: grid;
  min-height: calc(100vh - 72px);
  grid-template-columns: 300px minmax(0, 1fr);
}

.float-sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  padding: 24px 18px 26px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.progress-block {
  padding: 3px 6px 19px;
  border-bottom: 1px solid var(--line);
}

.progress-block__line {
  display: flex;
  margin-bottom: 9px;
  align-items: baseline;
  justify-content: space-between;
}

.progress-block__line strong {
  font-family: var(--font-display);
  font-size: 0.85rem;
}

.progress-block__line span {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #ebe7de;
}

.progress-track__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 0.35s ease;
}

.float-list {
  height: calc(100% - 84px);
  margin-top: 13px;
  padding-right: 4px;
  overflow: auto;
  scrollbar-color: #c9c4ba transparent;
  scrollbar-width: thin;
}

.float-list__label {
  margin: 6px 8px 10px;
  color: #7c837f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.float-nav-item {
  display: grid;
  width: 100%;
  min-height: 55px;
  margin-bottom: 4px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  grid-template-columns: 34px 1fr 19px;
  align-items: center;
  gap: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.float-nav-item:hover {
  background: #f7f4ed;
}

.float-nav-item.is-active {
  border-color: #b9d8ec;
  background: var(--coral-soft);
}

.float-nav-item__number {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  place-items: center;
  background: #eeeae2;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
}

.float-nav-item.is-active .float-nav-item__number {
  background: var(--coral);
  color: var(--white);
}

.float-nav-item__name {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  display: grid;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  place-items: center;
  background: var(--white);
}

.status-dot svg {
  display: none;
  width: 11px;
  height: 11px;
}

.status-dot.is-complete {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}

.status-dot.is-complete svg {
  display: block;
}

.status-dot.is-partial {
  border: 4px solid var(--gold);
}

.ballot-main {
  min-width: 0;
  padding: 40px clamp(24px, 5vw, 76px) 120px;
}

.ballot-content {
  max-width: 890px;
  margin: 0 auto;
}

.mobile-float-picker {
  display: none;
}

.ballot-heading {
  display: flex;
  margin-bottom: 30px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.ballot-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.ballot-heading__number {
  display: block;
  margin-bottom: 8px;
  color: var(--coral);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.save-state {
  display: flex;
  min-width: 106px;
  padding: 9px 11px;
  align-items: center;
  gap: 8px;
  border-radius: 99px;
  background: var(--white);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  font-size: 0.74rem;
  font-weight: 700;
}

.save-state::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a3aaa6;
  content: "";
}

.save-state.is-saving::before {
  border: 2px solid #ddd7cc;
  border-top-color: var(--coral);
  background: transparent;
  animation: spin 0.7s linear infinite;
}

.save-state.is-saved {
  color: var(--green);
}

.save-state.is-saved::before {
  background: var(--green);
}

.criteria-list {
  display: grid;
  gap: 14px;
}

.criterion-card {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.criterion-card:focus-within {
  border-color: #9ccbe8;
  box-shadow: 0 8px 26px rgb(23 35 31 / 0.07);
}

.criterion-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.criterion-title {
  display: flex;
  align-items: center;
  gap: 11px;
}

.criterion-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  place-items: center;
  background: var(--gold-soft);
  color: #9f7411;
}

.criterion-icon svg {
  width: 19px;
  height: 19px;
}

.criterion-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.03rem;
  letter-spacing: -0.02em;
}

.criterion-title p {
  max-width: 580px;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.weight-badge {
  display: inline-flex;
  min-height: 27px;
  padding: 0 9px;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 99px;
  background: #f1eee7;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.score-row {
  display: grid;
  margin-top: 20px;
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  gap: 9px;
}

.score-button {
  position: relative;
  min-height: 54px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  transition: border-color 0.14s, background 0.14s, color 0.14s, transform 0.14s;
}

.score-button:hover {
  border-color: var(--coral);
  color: var(--coral-dark);
  transform: translateY(-1px);
}

.score-button.is-selected {
  border-color: var(--coral);
  background: var(--coral);
  color: var(--white);
  box-shadow: 0 5px 14px rgb(0 91 152 / 0.2);
}

.score-row-legend {
  display: flex;
  margin-top: 8px;
  justify-content: space-between;
  color: #89908c;
  font-size: 0.66rem;
}

.ballot-footer {
  display: flex;
  margin-top: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ballot-footer .btn {
  min-width: 118px;
}

.completion-card {
  padding: 52px 36px;
  border: 1px solid #bcdacb;
  border-radius: var(--radius-lg);
  background: var(--green-soft);
  text-align: center;
}

.completion-card__icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  border-radius: 50%;
  place-items: center;
  background: var(--green);
  color: var(--white);
}

.completion-card__icon svg {
  width: 29px;
  height: 29px;
}

.completion-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.completion-card p {
  max-width: 520px;
  margin: 10px auto 23px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.completion-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.admin-main {
  min-height: calc(100vh - 72px);
  padding: 34px clamp(20px, 4vw, 64px) 80px;
}

.admin-container {
  max-width: 1320px;
  margin: 0 auto;
}

.admin-hero {
  display: flex;
  margin-bottom: 25px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.admin-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.15rem);
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.admin-hero__actions {
  display: flex;
  gap: 9px;
}

.live-status {
  display: flex;
  margin-bottom: 25px;
  padding: 12px 15px;
  align-items: center;
  gap: 10px;
  border: 1px solid #bdd7ca;
  border-radius: 12px;
  background: var(--green-soft);
  color: #226849;
  font-size: 0.77rem;
  font-weight: 700;
}

.live-status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgb(39 128 93 / 0.12);
  content: "";
}

.admin-tabs {
  display: flex;
  margin-bottom: 24px;
  gap: 4px;
  border-bottom: 1px solid var(--line-strong);
}

.admin-tab {
  position: relative;
  min-height: 47px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-tab.is-active {
  color: var(--ink);
}

.admin-tab.is-active::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--coral);
  content: "";
}

.stat-grid {
  display: grid;
  margin-bottom: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.stat-card {
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.stat-card__label {
  display: flex;
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.stat-card__icon {
  display: grid;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  place-items: center;
  background: var(--coral-soft);
  color: var(--coral);
}

.stat-card__icon svg {
  width: 15px;
  height: 15px;
}

.stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.stat-card small {
  display: block;
  margin-top: 3px;
  color: #818984;
  font-size: 0.69rem;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.panel__header {
  display: flex;
  min-height: 68px;
  padding: 15px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel__header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
}

.panel__header p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.status-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
}

.status-key::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  content: "";
}

.ranking-list {
  max-height: 720px;
  padding: 5px 14px 14px;
  overflow: auto;
}

.ranking-row {
  display: grid;
  min-height: 72px;
  padding: 10px 6px;
  grid-template-columns: 42px minmax(130px, 1fr) minmax(110px, 0.8fr) 82px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.ranking-row:last-child {
  border-bottom: 0;
}

.rank-number {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  place-items: center;
  background: #f0ede6;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.79rem;
  font-weight: 800;
}

.ranking-row:nth-child(1) .rank-number {
  background: var(--gold);
  color: #553c00;
}

.ranking-row:nth-child(2) .rank-number {
  background: #d8dcda;
  color: #43514b;
}

.ranking-row:nth-child(3) .rank-number {
  background: #dca477;
  color: #58331d;
}

.ranking-name {
  min-width: 0;
}

.ranking-name strong {
  display: block;
  overflow: hidden;
  font-size: 0.81rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-name span {
  display: block;
  margin-top: 4px;
  color: #828a85;
  font-size: 0.68rem;
}

.ranking-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #ede9e1;
}

.ranking-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
}

.ranking-score {
  text-align: right;
}

.ranking-score strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.ranking-score span {
  display: block;
  margin-top: 3px;
  color: #89908c;
  font-size: 0.62rem;
}

.ranking-score .final-label {
  color: var(--green);
}

.committee-panel {
  overflow: hidden;
}

.committee-card {
  padding: 21px;
  border-bottom: 1px solid var(--line);
}

.committee-card:last-child {
  border-bottom: 0;
}

.committee-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.committee-card__top span:first-child {
  font-size: 0.77rem;
  font-weight: 700;
}

.committee-weight {
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-size: 0.68rem;
  font-weight: 800;
}

.committee-card strong {
  display: block;
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.committee-card p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.formula-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #e7d9ad;
  border-radius: var(--radius);
  background: var(--gold-soft);
}

.formula-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 0.83rem;
}

.formula-card p {
  margin: 0;
  color: #6e5b25;
  font-size: 0.72rem;
  line-height: 1.6;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(420px, 1.3fr);
  gap: 18px;
  align-items: start;
}

.settings-side {
  display: grid;
  gap: 18px;
}

.settings-form {
  padding: 22px;
}

.settings-form .field + .field {
  margin-top: 16px;
}

.settings-form__actions {
  display: flex;
  margin-top: 23px;
  justify-content: flex-end;
}

.access-setting-input {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.settings-note {
  display: flex;
  margin: 18px 0 0;
  padding: 13px;
  align-items: flex-start;
  gap: 9px;
  border-radius: 10px;
  background: var(--green-soft);
  color: #35624f;
  font-size: 0.72rem;
  line-height: 1.45;
}

.settings-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.danger-zone {
  border-color: #edc8c5;
  background: #fffafa;
}

.danger-zone__text {
  margin: 0 0 17px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.danger-zone .btn--danger {
  border-color: #e5b5b2;
  background: var(--white);
}

.danger-zone .btn--danger:hover {
  border-color: var(--danger);
  background: #fff0ef;
}

.floats-editor {
  overflow: hidden;
}

.floats-editor__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.floats-editor__actions label {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.float-count-input {
  width: 68px;
  min-height: 42px;
  padding: 0 8px;
  text-align: center;
}

.float-edit-list {
  max-height: 620px;
  overflow: auto;
}

.float-edit-row {
  display: grid;
  min-height: 64px;
  padding: 9px 14px;
  grid-template-columns: 31px 32px minmax(120px, 1fr) 36px 36px 36px;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--line);
}

.float-edit-row:last-child {
  border-bottom: 0;
}

.drag-dots {
  color: #9ea39f;
  font-size: 1rem;
  letter-spacing: -3px;
  text-align: center;
}

.float-edit-number {
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
}

.float-edit-row .text-input {
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.81rem;
}

.mini-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  place-items: center;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
}

.mini-button:hover {
  border-color: var(--line-strong);
  background: #f7f4ed;
}

.mini-button:disabled {
  opacity: 0.35;
}

.mini-button--danger:hover {
  border-color: #efc4c2;
  background: #fff2f1;
  color: var(--danger);
}

.mini-button svg {
  width: 15px;
  height: 15px;
}

.empty-state {
  padding: 60px 20px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
}

.empty-state p {
  max-width: 380px;
  margin: 8px auto 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.toast-root {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 9px;
}

.toast {
  display: flex;
  padding: 14px 15px;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 12px;
  background: var(--forest);
  color: var(--white);
  box-shadow: var(--shadow-md);
  animation: toast-in 0.25s ease-out;
  font-size: 0.8rem;
  line-height: 1.45;
}

.toast::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--mint);
  content: "";
}

.toast.is-error::before {
  background: #ff8d78;
}

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

@media (max-width: 1000px) {
  .access-page {
    grid-template-columns: minmax(310px, 0.8fr) minmax(410px, 1fr);
  }

  .access-story {
    padding: 40px;
  }

  .weight-list {
    grid-template-columns: 1fr;
  }

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

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .results-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .formula-card {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .access-page {
    display: block;
  }

  .access-story {
    display: none;
  }

  .access-panel {
    min-height: 100svh;
    padding: 22px;
  }

  .access-card {
    padding: 28px 24px;
  }

  .access-card__mobile-brand {
    display: flex;
  }

  .access-card__mobile-brand .top-brand__text span {
    color: var(--ink-soft);
  }

  .app-header {
    height: 64px;
    padding: 0 14px;
  }

  .top-brand__text strong {
    font-size: 0.83rem;
  }

  .top-brand__text span {
    max-width: 165px;
    font-size: 0.66rem;
  }

  .role-pill {
    display: none;
  }

  .ballot-layout {
    display: block;
    min-height: calc(100vh - 64px);
  }

  .float-sidebar {
    display: none;
  }

  .ballot-main {
    padding: 20px 15px 108px;
  }

  .mobile-float-picker {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
    gap: 8px;
  }

  .mobile-float-picker__select {
    position: relative;
    min-width: 0;
    flex: 1;
  }

  .mobile-float-picker select {
    width: 100%;
    min-height: 45px;
    padding: 0 38px 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    appearance: none;
    background: var(--paper);
    color: var(--ink);
    font-weight: 700;
  }

  .mobile-float-picker__select svg {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 17px;
    height: 17px;
    pointer-events: none;
  }

  .mobile-progress {
    display: grid;
    width: 46px;
    height: 45px;
    border-radius: 10px;
    place-items: center;
    background: var(--forest);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 800;
  }

  .ballot-heading {
    margin-bottom: 21px;
    align-items: flex-start;
  }

  .ballot-heading h1 {
    font-size: 2rem;
  }

  .save-state {
    min-width: auto;
    padding: 8px;
  }

  .save-state span {
    display: none;
  }

  .criterion-card {
    padding: 18px 15px;
  }

  .criterion-title {
    gap: 9px;
  }

  .criterion-icon {
    width: 35px;
    height: 35px;
  }

  .criterion-title h2 {
    font-size: 0.91rem;
  }

  .criterion-title p {
    font-size: 0.71rem;
  }

  .score-row {
    gap: 6px;
  }

  .score-button {
    min-height: 49px;
  }

  .ballot-footer {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 76px;
    margin: 0;
    padding: 12px 15px;
    border-top: 1px solid var(--line);
    background: rgb(255 253 248 / 0.94);
    box-shadow: 0 -8px 26px rgb(23 35 31 / 0.07);
    backdrop-filter: blur(12px);
  }

  .ballot-footer .btn {
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
    min-height: 48px;
    flex: 1;
  }

  .ballot-finish-button {
    font-size: 0.75rem;
  }

  .admin-main {
    padding: 24px 14px 60px;
  }

  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-hero__actions {
    width: 100%;
  }

  .admin-hero__actions .btn {
    flex: 1;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 15px;
  }

  .ranking-row {
    grid-template-columns: 36px minmax(100px, 1fr) 60px;
    gap: 8px;
  }

  .ranking-bar {
    display: none;
  }

  .results-aside {
    display: block;
  }

  .formula-card {
    margin-top: 14px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .floats-editor .panel__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .floats-editor__actions {
    width: 100%;
  }

  .floats-editor__actions .btn {
    margin-left: auto;
  }

  .float-edit-row {
    grid-template-columns: 24px 25px minmax(100px, 1fr) 32px 32px 32px;
    padding: 8px;
    gap: 4px;
  }
}

@media (max-width: 430px) {
  .access-panel {
    padding: 14px;
  }

  .access-card {
    padding: 25px 20px;
  }

  .top-brand__text span {
    display: none;
  }

  .app-header .brand-mark {
    width: 37px;
    height: 37px;
  }

  .criterion-card__top {
    gap: 8px;
  }

  .criterion-title p {
    display: none;
  }

  .score-button {
    min-height: 45px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

@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;
  }
}
