/* Admin / poll customizer */

.admin-page .site-shell {
  min-height: 100vh;
  min-height: 100svh;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.46);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.admin-badge svg {
  width: 13px;
  height: 13px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.035em;
  text-decoration: none;
  transition: color 160ms ease;
}

.back-link:hover {
  color: var(--coral-deep);
}

.back-link svg {
  width: 15px;
  height: 15px;
}

.admin-stage {
  flex: 1;
  padding: 48px 0 70px;
}

.admin-heading {
  max-width: 780px;
}

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

.admin-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 66px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.06em;
}

.admin-intro {
  max-width: 610px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.85;
  letter-spacing: 0.015em;
}

.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 310px;
  margin-top: 36px;
  border: 1px solid var(--line);
  border-radius: 28px;
  color: var(--muted);
  background: rgba(255, 250, 241, 0.55);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.admin-blocked {
  max-width: 520px;
  margin: 44px 0 0;
  padding: 40px 34px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.blocked-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 17px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201, 78, 50, 0.28);
  border-radius: 50%;
  color: var(--coral-deep);
  background: rgba(233, 101, 69, 0.08);
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
}

.admin-blocked h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.admin-blocked p {
  margin: 10px auto 21px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.back-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border-radius: 999px;
  color: var(--card-bright);
  background: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.admin-login {
  display: grid;
  gap: 9px;
  max-width: 280px;
  margin: 0 auto 20px;
  text-align: left;
}

.admin-login[hidden] {
  display: none;
}

.admin-login label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-login input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--card-bright);
  font: inherit;
  font-size: 13px;
}

.admin-login input:focus {
  outline: 2px solid rgba(201, 78, 50, 0.3);
  outline-offset: 1px;
}

.admin-login button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  color: var(--card-bright);
  background: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.admin-login button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.admin-blocked .admin-login-error {
  margin: 0;
  color: var(--coral-deep);
  font-size: 11px;
  line-height: 1.5;
}

.admin-blocked .admin-login-error[hidden] {
  display: none;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: start;
  gap: clamp(34px, 4.5vw, 58px);
  margin-top: 38px;
}

/* Form */

.admin-form {
  padding: 29px 30px 26px;
  border: 1px solid rgba(72, 57, 36, 0.16);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.97), rgba(255, 249, 239, 0.91)),
    var(--card);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    var(--shadow-card);
}

.form-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 23px;
  padding: 12px 14px;
  border: 1px solid rgba(79, 124, 101, 0.18);
  border-radius: 13px;
  color: #3f6749;
  background: #eaf1e5;
  animation: results-in 320ms ease both;
}

.form-success-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--card-bright);
  background: #5c8463;
}

.form-success-icon svg {
  width: 15px;
  height: 15px;
}

.form-success strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.form-success a {
  display: inline-block;
  margin-top: 3px;
  color: #3f6749;
  font-size: 10.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-section + .admin-section {
  margin-top: 27px;
  padding-top: 26px;
  border-top: 1px dashed var(--line-strong);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.section-index {
  flex: 0 0 auto;
  padding-top: 2px;
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.section-heading-options {
  align-items: flex-start;
}

.option-counter {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 18px;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.035em;
}

.field-label em {
  color: var(--coral-deep);
  font-size: 8px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.field-label small {
  margin-left: auto;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.poll-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 1px;
}

.poll-type-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.poll-type-option:hover {
  border-color: rgba(31, 44, 35, 0.3);
  background: rgba(255, 255, 255, 0.68);
}

.poll-type-option:has(input:focus-visible) {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.poll-type-option:has(input:checked) {
  border-color: rgba(31, 44, 35, 0.62);
  background: var(--card-bright);
  box-shadow: 0 0 0 3px rgba(31, 44, 35, 0.045);
}

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

.poll-type-mark {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.poll-type-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--card-bright);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.poll-type-option:has(input:checked) .poll-type-mark {
  border-color: var(--ink);
  background: var(--ink);
}

.poll-type-option:has(input:checked) .poll-type-mark::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.poll-type-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.poll-type-copy strong {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.poll-type-copy small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.poll-type-hint {
  margin: 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
}

.admin-form.is-text .option-edit-row {
  grid-template-columns: 24px 78px minmax(0, 1.12fr) minmax(0, 0.88fr) 30px;
  grid-template-areas: "num icon title subtitle remove";
}

.admin-form.is-text .edit-photo,
.admin-form.is-text .option-photo-hint {
  display: none;
}

.field input,
.field textarea,
.edit-field input,
.edit-field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.edit-field input::placeholder {
  color: #a4a197;
}

.field input:hover,
.field textarea:hover,
.edit-field input:hover,
.edit-field select:hover {
  border-color: rgba(31, 44, 35, 0.27);
}

.field input:focus,
.field textarea:focus,
.edit-field input:focus,
.edit-field select:focus {
  border-color: rgba(233, 101, 69, 0.64);
  outline: none;
  background: var(--card-bright);
  box-shadow: 0 0 0 3px rgba(233, 101, 69, 0.09);
}

.field input:user-invalid,
.edit-field input:user-invalid {
  border-color: rgba(201, 78, 50, 0.6);
}

.option-editor {
  display: grid;
  gap: 10px;
  margin-top: 17px;
}

.option-edit-row {
  display: grid;
  grid-template-columns: 24px 46px 78px minmax(0, 1.12fr) minmax(0, 0.88fr) 30px;
  grid-template-areas: "num photo icon title subtitle remove";
  align-items: end;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.4);
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.option-edit-row:focus-within {
  border-color: rgba(31, 44, 35, 0.35);
  background: rgba(255, 255, 255, 0.7);
}

.option-number {
  grid-area: num;
  align-self: center;
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.edit-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.edit-field > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.edit-field input,
.edit-field select {
  padding: 9px 10px;
  font-size: 11.5px;
  border-radius: 9px;
}

.edit-icon {
  grid-area: icon;
}

.edit-title {
  grid-area: title;
}

.edit-subtitle {
  grid-area: subtitle;
}

.edit-field select {
  cursor: pointer;
}

.edit-photo {
  grid-area: photo;
  position: relative;
  align-self: end;
}

.option-photo-button {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 0;
  border: 1px dashed rgba(31, 44, 35, 0.3);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.option-photo-button:hover {
  border-color: rgba(31, 44, 35, 0.55);
  background: var(--card-bright);
}

.option-photo-button > span {
  color: var(--coral-deep);
  font-size: 15px;
  line-height: 1;
}

.option-photo-button > small {
  font-size: 6.5px;
  letter-spacing: 0.05em;
}

.option-photo-button.has-image {
  border-style: solid;
  border-color: rgba(31, 44, 35, 0.14);
}

.option-photo-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.option-photo-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(31, 44, 35, 0.2);
  border-radius: 50%;
  color: var(--ink);
  background: var(--card-bright);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.option-photo-remove:hover {
  border-color: rgba(201, 78, 50, 0.45);
  color: var(--coral-deep);
}

.option-photo-remove[hidden] {
  display: none;
}

.remove-option {
  grid-area: remove;
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.remove-option:hover:not(:disabled) {
  border-color: rgba(201, 78, 50, 0.2);
  color: var(--coral-deep);
  background: rgba(233, 101, 69, 0.06);
}

.remove-option:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.add-option {
  width: 100%;
  min-height: 43px;
  margin-top: 10px;
  border: 1px dashed rgba(31, 44, 35, 0.25);
  border-radius: 12px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.add-option span {
  margin-right: 3px;
  color: var(--coral);
  font-size: 14px;
}

.add-option:hover:not(:disabled) {
  border-color: rgba(233, 101, 69, 0.5);
  color: var(--ink);
  background: rgba(233, 101, 69, 0.035);
}

.add-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.option-photo-hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
}

.form-error-banner {
  margin: 18px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(201, 78, 50, 0.2);
  border-radius: 10px;
  color: #943c29;
  background: rgba(233, 101, 69, 0.08);
  font-size: 11px;
  line-height: 1.55;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.danger-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.danger-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: #a47a31;
}

.danger-note strong {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.save-button {
  width: 100%;
  min-height: 56px;
  padding: 8px 9px 8px 20px;
  border: 0;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--card-bright);
  background: var(--ink);
  box-shadow: 0 12px 24px -14px rgba(31, 44, 35, 0.62);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.save-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #29382d;
  box-shadow: 0 15px 28px -14px rgba(31, 44, 35, 0.68);
}

.save-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.save-label {
  flex: 1;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.save-arrow {
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
}

.save-arrow svg {
  width: 20px;
  height: 20px;
}

.save-button.is-loading .save-arrow svg {
  display: none;
}

.save-button.is-loading .save-arrow::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(31, 44, 35, 0.25);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 650ms linear infinite;
}

/* Preview */

.admin-aside {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 14px;
}

.preview-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: 27px;
  color: #fff9ed;
  background: var(--ink);
  box-shadow: 0 24px 50px -28px rgba(31, 44, 35, 0.7);
}

.preview-card::before {
  content: "";
  position: absolute;
  width: 250px;
  height: 250px;
  top: -125px;
  right: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 201, 93, 0.3), rgba(244, 201, 93, 0) 68%);
}

.preview-card::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 66px;
  top: 0;
  left: 0;
  border-radius: 0 0 4px 0;
  background: linear-gradient(var(--coral), var(--yellow));
}

.preview-card > * {
  position: relative;
  z-index: 1;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 3px;
  color: rgba(255, 249, 237, 0.5);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.preview-top i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a9c4a6;
  box-shadow: 0 0 0 3px rgba(169, 196, 166, 0.12);
  animation: live-pulse 2.4s ease-in-out infinite;
}

.preview-eyebrow {
  margin: 34px 0 0;
  color: rgba(255, 249, 237, 0.48);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.preview-title {
  margin: 15px 0 0;
  font-family: var(--font-display);
  font-size: 43px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.preview-title span {
  display: block;
}

.preview-title em {
  display: block;
  color: #ff9476;
  font-style: normal;
}

.preview-divider {
  height: 1px;
  margin: 22px 0 18px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 249, 237, 0.22) 0 4px,
    transparent 4px 8px
  );
}

.preview-label {
  margin: 0;
  color: rgba(255, 249, 237, 0.5);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.preview-card h3 {
  margin: 7px 0 0;
  color: #fff9ed;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.36;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.preview-card > p:not(.preview-title):not(.preview-label):not(.preview-eyebrow) {
  margin: 9px 0 0;
  color: rgba(255, 249, 237, 0.58);
  font-size: 10.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 249, 237, 0.12);
  color: rgba(255, 249, 237, 0.45);
  font-size: 8px;
  letter-spacing: 0.045em;
}

.admin-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.5);
}

.admin-note-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(31, 44, 35, 0.06);
}

.admin-note-icon svg {
  width: 15px;
  height: 15px;
}

.admin-note strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

/* Confirmation dialog */

.confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid rgba(72, 57, 36, 0.15);
  border-radius: 24px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 30px 70px -25px rgba(31, 44, 35, 0.55);
}

.confirm-dialog[open] {
  animation: dialog-in 220ms ease both;
}

.confirm-dialog::backdrop {
  background: rgba(31, 44, 35, 0.46);
  backdrop-filter: blur(3px);
}

.dialog-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--card-bright);
  background: var(--coral);
  font-family: var(--font-display);
  font-size: 21px;
  font-style: italic;
}

.confirm-dialog h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.confirm-dialog p {
  margin: 11px 0 22px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.8;
  text-wrap: pretty;
}

.confirm-dialog p strong {
  color: var(--coral-deep);
  font-variant-numeric: tabular-nums;
}

.confirm-dialog code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(31, 44, 35, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

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

.dialog-cancel,
.dialog-confirm {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.035em;
  cursor: pointer;
}

.dialog-cancel {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: transparent;
}

.dialog-cancel:hover {
  background: rgba(255, 255, 255, 0.7);
}

.dialog-confirm {
  border: 1px solid var(--ink);
  color: var(--card-bright);
  background: var(--ink);
}

.dialog-confirm:hover {
  background: #29382d;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive */

@media (max-width: 1080px) {
  .admin-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 34px;
  }

  .preview-title {
    font-size: 37px;
  }

  .preview-card {
    padding: 21px;
  }
}

@media (max-width: 900px) {
  .admin-stage {
    padding: 37px 0 58px;
  }

  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    margin-top: 30px;
  }

  .admin-aside {
    position: static;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.7fr);
    align-items: start;
  }

  .preview-card {
    max-width: 520px;
  }
}

@media (max-width: 700px) {
  .site-header.admin-header {
    gap: 14px;
  }

  .admin-badge {
    display: none;
  }

  .admin-heading h1 {
    font-size: clamp(38px, 9vw, 50px);
  }

  .admin-intro {
    font-size: 12.5px;
  }

  .admin-form {
    padding: 21px 18px 20px;
    border-radius: 23px;
  }

  .section-heading h2 {
    font-size: 19px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .option-edit-row {
    grid-template-columns: 23px 46px minmax(0, 1fr) 30px;
    grid-template-areas:
      "num photo icon remove"
      ". title title title"
      ". subtitle subtitle subtitle";
    row-gap: 8px;
    padding: 11px;
  }

  .poll-type-options {
    grid-template-columns: 1fr;
  }

  .admin-form.is-text .option-edit-row {
    grid-template-columns: 23px minmax(0, 1fr) 30px;
    grid-template-areas:
      "num icon remove"
      ". title title"
      ". subtitle subtitle";
  }

  .option-number {
    align-self: center;
  }

  .remove-option {
    height: 32px;
  }

  .admin-actions {
    margin-top: 23px;
    padding-top: 19px;
  }

  .save-label {
    font-size: 11.5px;
  }

  .admin-aside {
    grid-template-columns: 1fr;
  }

  .preview-card {
    max-width: none;
  }

  .preview-title {
    font-size: 42px;
  }

  .confirm-dialog {
    padding: 23px;
  }
}

@media (max-width: 430px) {
  .admin-header .header-meta {
    gap: 0;
  }

  .back-link {
    font-size: 9.5px;
  }

  .admin-stage {
    padding-top: 29px;
  }

  .admin-heading .eyebrow {
    margin-bottom: 15px;
  }

  .admin-heading h1 {
    font-size: 36px;
  }

  .admin-intro {
    margin-top: 13px;
    font-size: 11.5px;
  }

  .admin-form {
    padding-left: 14px;
    padding-right: 14px;
  }

  .section-heading {
    gap: 9px;
  }

  .section-heading p {
    font-size: 9.5px;
  }

  .field-label {
    font-size: 10px;
  }

  .option-edit-row {
    grid-template-columns: 20px 40px minmax(0, 1fr) 28px;
    gap: 7px;
    padding: 9px;
  }

  .admin-form.is-text .option-edit-row {
    grid-template-columns: 20px minmax(0, 1fr) 28px;
  }

  .edit-field input,
  .edit-field select {
    padding: 8px 9px;
    font-size: 11px;
  }

  .save-button {
    padding-left: 16px;
  }

  .save-label {
    font-size: 10.5px;
    letter-spacing: 0.05em;
  }

  .danger-note {
    font-size: 9px;
  }

  .preview-title {
    font-size: 39px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-cancel,
  .dialog-confirm {
    width: 100%;
  }
}

/* Image uploads */

.image-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 14px;
  margin-top: 18px;
}

.image-uploader {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.35);
}

.image-uploader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.image-uploader-head div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.image-uploader-head strong {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.image-uploader-head span {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.image-uploader-head em {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.image-dropzone {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px dashed rgba(31, 44, 35, 0.24);
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(244, 201, 93, 0.07), rgba(233, 101, 69, 0.035)),
    rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.image-dropzone:hover,
.image-dropzone.is-dragover {
  border-color: rgba(233, 101, 69, 0.55);
  background-color: rgba(255, 255, 255, 0.7);
}

.image-dropzone.has-image {
  border-style: solid;
  border-color: rgba(31, 44, 35, 0.14);
  background: rgba(255, 255, 255, 0.5);
}

.image-dropzone-cover {
  aspect-ratio: 1 / 1;
}

.image-dropzone > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  text-align: center;
}

.image-placeholder svg {
  width: 26px;
  height: 26px;
  margin-bottom: 3px;
  color: rgba(31, 44, 35, 0.38);
}

.image-placeholder p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 500;
}

.image-placeholder small {
  font-size: 7.5px;
  letter-spacing: 0.02em;
}

.image-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 253, 248, 0.3);
  border-radius: 50%;
  color: var(--card-bright);
  background: rgba(31, 44, 35, 0.7);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.image-remove:hover {
  background: var(--coral-deep);
}

.image-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink-soft);
  background: rgba(255, 250, 241, 0.84);
  font-size: 9.5px;
  backdrop-filter: blur(3px);
}

.image-upload-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}

.image-select {
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.image-select:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.image-uploader.is-uploading .image-select {
  opacity: 0.4;
  pointer-events: none;
}

#cover-status,
#background-status {
  max-width: 60%;
  overflow: hidden;
  color: var(--muted);
  font-size: 7.5px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#cover-status.is-error,
#background-status.is-error {
  color: var(--coral-deep);
}

.image-readability-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.image-readability-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  opacity: 0.75;
}

/* Visitor candidate photos */

.candidate-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.candidate-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.candidate-card-image {
  display: block;
  aspect-ratio: 1 / 1;
  background: #f4eee2;
}

.candidate-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.candidate-card:hover .candidate-card-image img {
  transform: scale(1.03);
}

.candidate-card-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 7px;
  padding: 9px 10px 10px;
}

.candidate-card-body strong {
  width: 100%;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.candidate-card.is-text {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(251, 243, 229, 0.82));
}

.candidate-card-text-mark {
  display: block;
  padding: 12px 12px 0;
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 0.7;
}

.candidate-card-author {
  color: var(--ink-soft);
  font-size: 8px;
}

.candidate-card-time {
  color: var(--muted);
  font-size: 8px;
}

.candidate-card-votes {
  margin-left: auto;
  color: var(--coral);
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.candidate-card-delete {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 4px 8px;
  border: 1px solid rgba(31, 44, 35, 0.15);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.92);
  font-family: var(--font-ui);
  font-size: 8px;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.candidate-card:hover .candidate-card-delete,
.candidate-card:focus-within .candidate-card-delete {
  opacity: 1;
}

.candidate-card-delete:hover {
  border-color: rgba(201, 78, 50, 0.35);
  color: var(--coral-deep);
}

@media (hover: none) {
  .candidate-card-delete {
    opacity: 1;
  }
}

.candidate-gallery-empty {
  margin: 14px 0 0;
  padding: 22px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.candidate-gallery-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.candidate-gallery-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  opacity: 0.75;
}

.preview-cover {
  width: 100%;
  max-width: 220px;
  margin: 16px auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 237, 0.14);
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.05);
}

.preview-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 700px) {
  .image-upload-grid {
    grid-template-columns: 1fr;
  }

  .image-placeholder p {
    font-size: 10px;
  }
}

/* Image cropper */

.crop-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  padding: 24px;
  overflow-y: auto;
  border: 1px solid rgba(72, 57, 36, 0.15);
  border-radius: 26px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 30px 80px -28px rgba(31, 44, 35, 0.65);
}

.crop-dialog[open] {
  animation: dialog-in 220ms ease both;
}

.crop-dialog--square {
  width: min(560px, calc(100vw - 32px));
}

.crop-dialog--square .crop-stage {
  aspect-ratio: 1 / 1;
}

.crop-dialog::backdrop {
  background: rgba(31, 44, 35, 0.58);
  backdrop-filter: blur(5px);
}

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

.crop-kicker {
  margin: 0 0 7px;
  color: var(--coral-deep);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.crop-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.crop-head p:not(.crop-kicker) {
  max-width: 540px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.crop-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.crop-close:hover {
  color: var(--ink);
  background: rgba(31, 44, 35, 0.05);
}

.crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 17px;
  overflow: hidden;
  border-radius: 14px;
  outline: none;
  background: #1e2921;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.crop-stage.is-dragging {
  cursor: grabbing;
}

.crop-stage:focus-visible {
  box-shadow: 0 0 0 3px var(--coral);
}

.crop-stage > img {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.crop-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 253, 248, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 253, 248, 0.3) 1px, transparent 1px);
  background-size: 33.3333% 33.3333%;
  box-shadow: inset 0 0 0 1px rgba(255, 253, 248, 0.25);
}

.crop-ratio {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 4px 7px;
  border: 1px solid rgba(255, 253, 248, 0.22);
  border-radius: 999px;
  color: var(--card-bright);
  background: rgba(31, 44, 35, 0.58);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.crop-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-soft);
  background: rgba(255, 250, 241, 0.92);
  font-size: 10.5px;
}

.crop-loading .spinner {
  border-color: rgba(31, 44, 35, 0.2);
  border-top-color: var(--coral);
}

.crop-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.crop-controls label {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.crop-controls input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 18px;
  margin: 0;
  accent-color: var(--coral);
  cursor: pointer;
}

.crop-zoom-value,
#crop-zoom-value {
  width: 40px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.crop-size {
  flex: 0 0 auto;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.crop-error {
  margin: 12px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(201, 78, 50, 0.2);
  border-radius: 8px;
  color: #943c29;
  background: rgba(233, 101, 69, 0.08);
  font-size: 10px;
  line-height: 1.5;
}

.crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.crop-cancel,
.crop-apply {
  min-height: 40px;
  padding: 0 17px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.035em;
  cursor: pointer;
}

.crop-cancel {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: transparent;
}

.crop-cancel:hover {
  background: rgba(255, 255, 255, 0.7);
}

.crop-apply {
  min-width: 116px;
  border: 1px solid var(--ink);
  color: var(--card-bright);
  background: var(--ink);
}

.crop-apply:hover:not(:disabled) {
  background: #29382d;
}

.crop-apply:disabled {
  opacity: 0.45;
  cursor: wait;
}

.image-dropzone.has-image:hover {
  border-color: rgba(233, 101, 69, 0.45);
}

@media (max-width: 700px) {
  .crop-dialog {
    padding: 18px;
    border-radius: 21px;
  }

  .crop-head h2 {
    font-size: 23px;
  }

  .crop-head p:not(.crop-kicker) {
    font-size: 9.5px;
  }

  .crop-controls {
    flex-wrap: wrap;
    gap: 7px 9px;
  }

  .crop-controls input[type="range"] {
    flex-basis: calc(100% - 110px);
  }

  .crop-size {
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 430px) {
  .crop-dialog {
    width: calc(100vw - 20px);
    padding: 15px;
  }

  .crop-head {
    gap: 12px;
  }

  .crop-head h2 {
    font-size: 21px;
  }

  .crop-actions {
    flex-direction: column-reverse;
  }

  .crop-cancel,
  .crop-apply {
    width: 100%;
  }
}
