:root {
  --ink: #071638;
  --ink-strong: #020b22;
  --muted: #5b6a86;
  --muted-strong: #3d4b68;
  --line: #c9d3e5;
  --soft-line: #e6ecf6;
  --panel: #ffffff;
  --panel-soft: #f7faff;
  --page: #061632;
  --primary: #0d63ff;
  --primary-dark: #054ed3;
  --accent: #7a2cff;
  --accent-soft: #eef3ff;
  --success: #059669;
  --danger: #dc2626;
  --warning: #b7791f;
  --gold: #ffb300;
  --shadow: 0 24px 70px rgba(0, 13, 46, .22);
  --button-shadow: 0 14px 28px rgba(13, 99, 255, .24);
  --cute-font: "HGP創英角ポップ体", "HG丸ゴシックM-PRO", "UD Digi Kyokasho N-R", "M PLUS Rounded 1c", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
}

body {
  position: relative;
  z-index: 0;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, #041126 0%, #06245b 48%, #041126 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(86, 151, 255, .34) 1px, transparent 0),
    linear-gradient(90deg, rgba(14, 96, 255, .18), transparent 32%, rgba(118, 44, 255, .12));
  background-size: 24px 24px, 100% 100%;
  opacity: .52;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(255, 179, 0, .28);
  outline-offset: 3px;
}

.site-header {
  width: 100%;
  min-height: 104px;
  padding: 0 max(20px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(122, 161, 230, .24);
  background:
    linear-gradient(90deg, rgba(3, 16, 44, .98), rgba(5, 33, 80, .96));
  box-shadow: 0 12px 38px rgba(0, 0, 0, .14);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: #fff;
  font-size: clamp(28px, 5vw, 42px);
  font-family: var(--cute-font);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  text-shadow: 0 0 26px rgba(255, 255, 255, .18);
}

.yonavote-wordmark {
  max-width: 100%;
  font-family: "Arial Rounded MT Bold", "Segoe UI Rounded", "M PLUS Rounded 1c", "Zen Maru Gothic", "HGP創英角ポップ体", "Trebuchet MS", system-ui, sans-serif;
  font-weight: 900;
  line-height: .94;
  letter-spacing: 0;
  white-space: nowrap;
}

.yonavote-wordmark.puffy {
  display: inline-flex;
  align-items: baseline;
  gap: .01em;
  filter: drop-shadow(0 14px 26px rgba(13, 99, 255, .30));
}

.yonavote-wordmark.puffy .logo-ch {
  display: inline-block;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 48%, #b8ccff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: .055em rgba(255, 255, 255, .88);
  text-shadow:
    0 .045em 0 rgba(3, 16, 38, .20),
    0 .10em .18em rgba(13, 99, 255, .26),
    0 0 .32em rgba(255, 255, 255, .18);
}

.yonavote-wordmark.puffy.on-light {
  filter: drop-shadow(0 12px 20px rgba(13, 99, 255, .18));
}

.yonavote-wordmark.puffy.on-light .logo-ch {
  -webkit-text-stroke: .06em rgba(4, 18, 56, .58);
  text-shadow:
    0 .04em 0 rgba(255, 255, 255, .82),
    0 .10em .16em rgba(13, 99, 255, .22),
    0 0 .24em rgba(122, 44, 255, .14);
}

.yonavote-wordmark.puffy .logo-ch:nth-child(1) { transform: rotate(-2deg) translateY(.01em); }
.yonavote-wordmark.puffy .logo-ch:nth-child(2) { transform: rotate(1deg) translateY(-.015em); }
.yonavote-wordmark.puffy .logo-ch:nth-child(3) { transform: rotate(-1deg); }
.yonavote-wordmark.puffy .logo-ch:nth-child(4) { transform: rotate(1.2deg) translateY(.01em); }
.yonavote-wordmark.puffy .logo-ch:nth-child(5) { margin-left: .08em; transform: rotate(-1deg); }
.yonavote-wordmark.puffy .logo-ch:nth-child(6) { transform: rotate(1deg) translateY(-.01em); }
.yonavote-wordmark.puffy .logo-ch:nth-child(7) { transform: rotate(-1.2deg) translateY(.01em); }
.yonavote-wordmark.puffy .logo-ch:nth-child(8) { transform: rotate(.8deg); }

.brand-mark {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  display: block;
  border-radius: 20px;
  filter: drop-shadow(0 14px 34px rgba(41, 97, 255, .36));
}

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

.brand-mark.title-mark {
  width: .96em;
  height: .96em;
  margin-right: .16em;
  transform: translateY(.08em);
  filter: drop-shadow(0 8px 16px rgba(13, 99, 255, .22));
}

.vote-badge {
  min-width: 106px;
  min-height: 54px;
  margin-right: auto;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(122, 161, 230, .24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.vote-badge i {
  position: relative;
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(214, 228, 255, .56);
}

.vote-badge i::before {
  content: "";
  position: absolute;
  left: 0;
  top: -3px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 179, 0, .78);
  border-radius: 50%;
  background: rgba(255, 179, 0, .18);
}

.vote-badge i:nth-child(2) { width: 82%; }
.vote-badge i:nth-child(3) { width: 64%; }

.connection {
  min-width: 116px;
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 179, 0, .44);
  border-radius: 8px;
  color: #ffc24b;
  background: rgba(255, 179, 0, .13);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.connection i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(255, 179, 0, .75);
}

.connection.online i { background: var(--gold); }
.connection.offline {
  color: #fecaca;
  border-color: rgba(248, 113, 113, .44);
  background: rgba(220, 38, 38, .14);
}
.connection.offline i {
  background: #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, .6);
}

.app-shell {
  width: min(calc(100% - 32px), 760px);
  margin: clamp(30px, 6vh, 70px) auto 58px;
}

.admin-shell {
  width: min(calc(100% - 32px), 1160px);
  margin: clamp(26px, 5vh, 58px) auto 58px;
}

.login-card {
  width: min(calc(100% - 32px), 860px);
  margin: clamp(42px, 8vh, 88px) auto 58px;
}

.card {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(250, 252, 255, .96));
  box-shadow: var(--shadow);
}

.home-card,
.vote-card,
.auth-card,
.admin-card,
.message-card {
  position: relative;
  overflow: hidden;
}

.home-card::before,
.vote-card::before,
.auth-card::before,
.admin-card::before,
.message-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(13, 99, 255, .08), transparent 26%),
    linear-gradient(315deg, rgba(122, 44, 255, .08), transparent 30%);
}

.loading-card, .empty, .success { text-align: center; }

.loading-card {
  max-width: 520px;
  margin: 0 auto;
}

.link-error {
  max-width: 680px;
  margin: 4vh auto 0;
  border-color: #fecaca;
  background: linear-gradient(180deg, #fffafa, #fff);
  box-shadow: 0 24px 70px rgba(153, 27, 27, .16);
}

.link-error::before {
  content: "!";
  position: relative;
  inset: auto;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  font-size: 34px;
  font-weight: 900;
}

.link-error h1 { color: #991b1b; }

.link-error p {
  max-width: 540px;
  margin: 12px auto 0;
  color: #475569;
  font-size: 16px;
}

.message-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.message-actions .link-button {
  min-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border: 3px solid #d9e3f2;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.top-row, .admin-head, .results-head, .timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .04em;
}

.question, .card h1 {
  position: relative;
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--cute-font);
  font-weight: 900;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.35;
  letter-spacing: 0;
}

.admin-card h1 {
  font-size: clamp(24px, 3.4vw, 34px);
}

.lead, .empty p, .login-card p, .muted {
  position: relative;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.auth-card > .lead,
.home-card > .lead {
  margin: 0 0 22px;
}

.subtle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  color: #047857;
  background: #ecfdf5;
  font-size: 13px;
  font-weight: 800;
}

.pill.closed { color: #475569; background: #f1f5f9; }
.pill.preparing { color: #b45309; background: #fffbeb; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.timer {
  position: relative;
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f7faff;
}

.timer-row {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.timer-row strong {
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.timer-track, .result-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe5f4;
}

.timer-track span, .result-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .25s ease;
}

.poll-image {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 16px auto 18px;
}

.poll-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(78vw, 380px);
  max-height: min(42vh, 420px);
  object-fit: contain;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(7, 22, 56, .10);
}

.choices {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.choice {
  position: relative;
  min-height: 68px;
  padding: 13px;
  display: grid;
  grid-template-columns: 38px 1fr 24px;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.choice:hover {
  border-color: #9db6e5;
  transform: translateY(-1px);
}

.choice:has(input:checked) {
  border-color: var(--primary);
  box-shadow:
    inset 0 0 0 1px var(--primary),
    0 12px 28px rgba(13, 99, 255, .12);
}

.choice input { position: absolute; opacity: 0; }

.choice-letter {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #334766;
  background: #edf3fb;
  font-size: 13px;
  font-weight: 900;
}

.choice:has(input:checked) .choice-letter {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.choice strong {
  color: var(--ink);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.radio {
  width: 22px;
  height: 22px;
  border: 1.5px solid #8ca0bd;
  border-radius: 50%;
  background: #fff;
}

.choice:has(input:checked) .radio {
  border: 6px solid var(--primary);
}

.primary, .secondary, .danger, .mini-tabs button, .poll-list button, .link-button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.primary {
  width: 100%;
  min-height: 58px;
  margin-top: 20px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #2352ff 46%, var(--accent) 100%);
  box-shadow: var(--button-shadow);
}

.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1745e6 46%, #6621e6 100%);
}

.primary:disabled {
  color: #8da0be;
  background: #dbe5f4;
  box-shadow: none;
  cursor: not-allowed;
}

.primary.compact {
  width: auto;
  min-height: 46px;
  margin: 0;
}

.secondary, .link-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, .92);
}

.secondary:hover, .link-button:hover {
  border-color: #9eb4d8;
  background: #f8fbff;
}

.danger {
  border: 1px solid #fecaca;
  color: var(--danger);
  background: #fff;
}

.danger:hover { background: #fff5f5; }
.full { width: 100%; }

.note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.success-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--success), #13b981);
  box-shadow: 0 14px 30px rgba(5, 150, 105, .22);
  font-size: 31px;
  font-weight: 900;
}

.my-vote {
  margin: 22px 0;
  padding: 17px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f7faff;
}

.my-vote span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.my-vote strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
}

.results {
  position: relative;
  margin-top: 22px;
  text-align: left;
}

.results.muted {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7faff;
}

.results-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.results-head strong {
  color: var(--ink);
  font-size: 26px;
}

.result { margin-top: 15px; }
.result.is-winner .result-track span { background: linear-gradient(90deg, var(--success), #28c58f); }

.result > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.result strong {
  color: var(--ink);
  white-space: nowrap;
}

.form-grid {
  position: relative;
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  text-align: left;
}

.field span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.field input, .field select {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, .98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .68);
}

.field select {
  color: var(--ink);
  cursor: pointer;
}

.field input::placeholder { color: #7b89a4; }

.field input:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 99, 255, .12);
}

.field.has-error input {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
}

.form-error {
  margin: 0 0 2px;
  padding: 13px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  background: #fef2f2;
  font-size: 14px;
  line-height: 1.6;
}

.form-error:focus {
  outline: 2px solid rgba(220, 38, 38, .35);
  outline-offset: 2px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.options-editor {
  display: grid;
  gap: 10px;
}

.option-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
}

.remove-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--danger);
  background: #fff;
  font-weight: 900;
}

.home-actions {
  position: relative;
  margin-top: 16px;
  display: flex;
}

.home-actions .link-button {
  display: inline-flex;
  align-items: center;
}

.auth-card {
  padding: clamp(28px, 5vw, 56px);
}

.auth-card-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 18px;
  align-items: start;
  margin-bottom: 26px;
}

.auth-card-head h1 {
  max-width: 760px;
  font-family: var(--cute-font);
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 900;
  line-height: 1.12;
  color: transparent;
  background: linear-gradient(92deg, #03143a 0%, #0d3678 46%, #7a2cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 7px 28px rgba(13, 99, 255, .12);
}

.auth-card-head h1.auth-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2em;
  color: var(--ink-strong);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  text-shadow: none;
}

.auth-title-brand {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.auth-title-tail {
  color: var(--ink-strong);
  text-shadow: 0 5px 18px rgba(13, 99, 255, .10);
}

.auth-card-head .lead {
  margin: 16px 0 0;
  color: #3c4d70;
  font-size: clamp(16px, 2.8vw, 20px);
}

.auth-side {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.auth-mark {
  width: 74px;
  height: 74px;
  filter: drop-shadow(0 12px 28px rgba(13, 99, 255, .20));
}

.vote-motif {
  width: 104px;
  padding: 10px;
  display: grid;
  gap: 7px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.vote-motif i {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #dbe7ff, #eef3ff);
}

.vote-motif i::before {
  content: "";
  position: absolute;
  left: 0;
  top: -3px;
  width: 14px;
  height: 14px;
  border: 2px solid #7b8aa8;
  border-radius: 50%;
  background: #fff;
}

.vote-motif i:nth-child(1)::before {
  border-color: var(--primary);
  background: radial-gradient(circle, var(--primary) 0 35%, #fff 38%);
}

.vote-motif i:nth-child(2) { width: 86%; }
.vote-motif i:nth-child(3) { width: 70%; }

.mini-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  margin: 16px 0 24px;
}

.mini-tabs button {
  min-height: 56px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.mini-tabs button:last-child { border-right: 0; }

.mini-tabs button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--button-shadow);
}

.secure-note {
  margin: 20px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.secure-note::before {
  content: "";
  width: 13px;
  height: 11px;
  margin-right: 8px;
  display: inline-block;
  border: 2px solid var(--muted-strong);
  border-radius: 3px;
  vertical-align: -1px;
  box-shadow: inset 0 4px 0 rgba(91, 106, 134, .12);
}

.admin-card {
  padding: clamp(22px, 3vw, 34px);
}

.admin-head {
  position: relative;
  align-items: flex-start;
  margin-bottom: 22px;
}

.admin-head h1 {
  margin: 9px 0 5px;
  color: var(--ink-strong);
}

.admin-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.admin-layout {
  position: relative;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
}

.poll-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.poll-list button {
  min-height: 62px;
  display: grid;
  gap: 5px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
}

.poll-list button.is-active {
  border-color: var(--primary);
  background: #f7faff;
  box-shadow:
    inset 4px 0 0 var(--primary),
    0 12px 24px rgba(13, 99, 255, .10);
}

.poll-list strong, .poll-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poll-list span {
  color: var(--muted);
  font-size: 12px;
}

.admin-detail {
  min-width: 0;
}

.url-box {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #f7faff;
  font-size: 12px;
}

.url-box code {
  color: var(--muted-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poll-image-settings {
  margin-top: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}

.inherited-image-settings {
  margin-top: 0;
}

.poll-image-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.poll-image-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.poll-image-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.poll-image-admin-preview {
  width: 100%;
  min-height: 116px;
  padding: 12px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7faff;
  color: var(--muted);
  font-size: 13px;
}

.poll-image-admin-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 230px;
  object-fit: contain;
  border-radius: 8px;
}

.poll-image-admin-preview.is-empty {
  padding: 14px;
}

.image-upload-form {
  display: grid;
  gap: 11px;
}

.image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.image-status {
  margin: 0;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.image-status.loading {
  color: #475569;
  background: #f1f5f9;
}

.image-status.ready {
  color: #1e3a8a;
  background: #eff6ff;
}

.image-status.success {
  color: #065f46;
  background: #ecfdf5;
}

.image-status.error {
  color: #991b1b;
  background: #fef2f2;
}

.cropper-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 11, 34, .62);
}

.cropper-dialog {
  width: min(100%, 680px);
  max-height: min(92vh, 820px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(183, 199, 226, .72);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(2, 11, 34, .35);
}

.cropper-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.cropper-head h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 24px;
}

.ghost-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  color: var(--ink);
  background: #f7faff;
  font-size: 24px;
  line-height: 1;
}

.cropper-shapes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.cropper-shapes button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  color: var(--muted-strong);
  background: #f7faff;
  font-size: 13px;
  font-weight: 800;
}

.cropper-shapes button.is-active {
  border-color: rgba(42, 108, 255, .72);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 18px rgba(42, 108, 255, .20);
}

.cropper-frame {
  position: relative;
  width: min(100%, var(--crop-frame-width, 420px));
  aspect-ratio: var(--crop-aspect, 4 / 3);
  margin: 0 auto 16px;
  overflow: hidden;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, .18), rgba(255, 255, 255, .18)),
    #071638;
  box-shadow: 0 16px 36px rgba(7, 22, 56, .18);
}

.cropper-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 33%, rgba(255, 255, 255, .7) 33%, rgba(255, 255, 255, .7) calc(33% + 1px), transparent calc(33% + 1px), transparent 66%, rgba(255, 255, 255, .7) 66%, rgba(255, 255, 255, .7) calc(66% + 1px), transparent calc(66% + 1px)),
    linear-gradient(0deg, transparent 33%, rgba(255, 255, 255, .7) 33%, rgba(255, 255, 255, .7) calc(33% + 1px), transparent calc(33% + 1px), transparent 66%, rgba(255, 255, 255, .7) 66%, rgba(255, 255, 255, .7) calc(66% + 1px), transparent calc(66% + 1px));
}

.cropper-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-color: #fff;
}

.cropper-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.cropper-controls .field {
  margin: 0;
}

.cropper-controls input[type="range"] {
  width: 100%;
  min-height: 34px;
  padding: 0;
}

.cropper-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.metric {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 26px;
  overflow-wrap: anywhere;
}

.metric .metric-name { font-size: 18px; }
.metric small { color: var(--muted); font-size: 12px; }

.admin-results {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--soft-line);
}

.admin-tabs {
  display: flex;
  gap: 9px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--soft-line);
}

.admin-tabs button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.admin-extra { margin-top: 14px; }

.list-table {
  display: grid;
  gap: 9px;
}

.list-table > div {
  padding: 13px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}

.list-table strong { color: var(--ink); font-size: 14px; }
.list-table span, .list-table small { color: var(--muted); }

.loading-line {
  padding: 13px;
  color: var(--muted);
  font-size: 13px;
}

.error {
  position: relative;
  margin: 12px 0;
  padding: 12px 13px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  background: #fef2f2;
  font-size: 14px;
  line-height: 1.55;
}

footer {
  width: 100%;
  min-height: 76px;
  padding: 0 max(20px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid rgba(122, 161, 230, .22);
  color: rgba(226, 236, 255, .74);
  background: rgba(3, 16, 44, .62);
  font-size: 15px;
}

.footer-right {
  margin-left: auto;
  display: grid;
  justify-items: end;
  gap: 3px;
  text-align: right;
}

.footer-right span:last-child {
  color: #fff;
  font-family: var(--cute-font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: min(92vw, 540px);
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  color: #fff;
  background: rgba(2, 11, 34, .94);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .24);
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: .2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .poll-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .poll-image-settings { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 92px;
    padding-inline: 20px;
  }

  .brand {
    gap: 12px;
    font-size: 31px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  .connection {
    min-width: auto;
    min-height: 40px;
    padding-inline: 12px;
    font-size: 12px;
  }

  .app-shell,
  .admin-shell,
  .login-card {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    margin-top: 28px;
  }

  .card {
    padding: 22px;
  }

  .auth-card {
    padding: 26px 22px;
  }

  .auth-card-head {
    grid-template-columns: minmax(0, 1fr) 52px;
    gap: 12px;
    margin-bottom: 22px;
  }

  .auth-card-head h1 {
    font-size: 34px;
  }

  .auth-card-head .lead {
    font-size: 16px;
  }

  .auth-mark {
    width: 50px;
    height: 50px;
  }

  .vote-badge,
  .vote-motif {
    display: none;
  }

  .question, .card h1 {
    font-size: 26px;
  }

  .admin-card h1 {
    font-size: 24px;
  }

  .link-error {
    margin-top: 2vh;
  }

  .link-error p {
    font-size: 15px;
  }

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

  .message-actions .link-button {
    width: 100%;
  }

  .top-row, .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .metrics,
  .settings-grid,
  .poll-list {
    grid-template-columns: 1fr;
  }

  .url-box {
    grid-template-columns: 1fr;
  }

  .url-box .secondary {
    width: 100%;
  }

  .poll-image-admin-preview {
    width: 100%;
  }

  .poll-image img {
    max-width: min(86vw, 330px);
    max-height: min(38vh, 360px);
  }

  .cropper-overlay {
    align-items: start;
    padding: 12px;
  }

  .cropper-dialog {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .cropper-head h2 {
    font-size: 20px;
  }

  .cropper-controls {
    grid-template-columns: 1fr;
  }

  .cropper-shapes {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .mini-tabs {
    grid-template-columns: 1fr;
  }

  .mini-tabs button {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mini-tabs button:last-child {
    border-bottom: 0;
  }

  .field input,
  .field select,
  .primary {
    min-height: 54px;
    height: 54px;
  }

  .choice {
    min-height: 64px;
    grid-template-columns: 36px 1fr 22px;
  }

  footer {
    min-height: 70px;
    padding-inline: 20px;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .site-header {
    gap: 10px;
    padding-inline: 12px;
  }

  .brand {
    gap: 9px;
    font-size: 24px;
  }

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

  .connection {
    min-height: 36px;
    padding-inline: 8px;
    font-size: 10px;
  }

  .connection {
    padding-inline: 10px;
    font-size: 11px;
  }

  .auth-card-head {
    grid-template-columns: 1fr;
  }

  .auth-mark {
    display: none;
  }

  .auth-card-head h1 {
    font-size: 31px;
  }

  .brand-block {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
