/*
 * Minimal Y2K: Tahoma-era grey chrome, one type scale, light depth (no heavy bevels).
 */
:root {
  --font-ui: Tahoma, "Segoe UI", system-ui, sans-serif;
  --bg-app: #949494;
  --text: #1a1a1a;
  --text-muted: #454545;
  --strip-bg: linear-gradient(180deg, #9e9c97 0%, #868480 48%, #76726c 100%);
  --strip-edge: #5c5a56;
  --panel-bg: linear-gradient(180deg, #d4d0c8 0%, #c0bcb4 50%, #b0aca4 100%);
  --surface: #fff;
  --chrome-line: #5a5854;
  --chrome-line-soft: #8c8882;
  --btn-face: linear-gradient(180deg, #eae7e2 0%, #d4d0c8 100%);
  --btn-face-hover: linear-gradient(180deg, #f2f0ec 0%, #dcd8d0 100%);
  --btn-primary: linear-gradient(180deg, #c8c4bc 0%, #a8a4a0 100%);
  --btn-primary-hover: linear-gradient(180deg, #d4d0c8 0%, #b4b0a8 100%);
  --btn-secondary: #cac6c0;
  --btn-secondary-hover: #d4d0ca;
  --shadow-modal: 0 16px 40px rgba(0, 0, 0, 0.2);
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.12);
  --overlay-dim: rgba(32, 32, 36, 0.33);
  --focus-ring: #2f5f9e;
  /* Square UI; tiny radius only where it aids touch targets */
  --r-touch: 2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  font: 15px var(--font-ui);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
}

.site-strip {
  flex: 0 0 auto;
  width: 100%;
  min-height: 44px;
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  background: var(--strip-bg);
  border-style: solid;
  border-color: #b0aca6 var(--strip-edge) var(--strip-edge) #b0aca6;
}

.site-strip--header {
  padding-top: env(safe-area-inset-top, 0px);
  min-height: calc(44px + env(safe-area-inset-top, 0px));
  border-width: 0 0 2px;
}

/* Header: left cluster (Выйти / Заявить); right cluster (имя / Войти). flex-start + margin auto is more reliable than space-between on iOS Safari. */
.site-strip--header--with-login {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px));
}

.header-strip-start:empty {
  display: none;
}

.site-strip--header--with-login .header-strip-end {
  margin-inline-start: auto;
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-end;
}

.header-strip-start {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.header-strip-end {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.login-header-btn {
  margin: 0;
  padding: 5px 11px;
  border: 1px solid var(--chrome-line);
  border-radius: 0;
  background: var(--btn-face);
  font: 600 12px var(--font-ui);
  letter-spacing: 0.02em;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, var(--shadow-soft);
  touch-action: manipulation;
}

.login-header-btn:hover {
  background: var(--btn-face-hover);
}

.login-header-btn:active {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.18);
  filter: brightness(0.97);
}

.login-header-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

a.login-header-btn--logout {
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
}

a.login-header-btn--logout:hover {
  background: var(--btn-face-hover);
}

/* Logged-in: username as dashboard button or static span */
span.login-header-btn--session {
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
  user-select: none;
  cursor: default;
}

button.login-header-btn--session {
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: inherit;
  cursor: pointer;
  text-align: end;
}

.profile-edit-modal {
  max-width: 400px;
}

/* Programmatic focus on open (no input zoom); hide ring unless keyboard :focus-visible */
#profile-edit-dialog:focus:not(:focus-visible) {
  outline: none;
}

/* Username / email: look disabled and are omitted from POST */
.reg-input.reg-input--locked,
.reg-input:disabled.reg-input--locked {
  opacity: 0.88;
  cursor: not-allowed;
  background: #e4e2dc;
  color: var(--text-muted);
  border-color: var(--chrome-line-soft);
}

.profile-modal-footer.reg-modal-footer {
  gap: 10px;
}

.profile-modal-footer .reg-btn--profile-pair {
  flex: 1 1 0;
  min-width: 0;
  min-height: 30px;
  padding: 7px 12px;
  font: 600 11px var(--font-ui);
  letter-spacing: 0.03em;
  border: 1px solid var(--chrome-line);
  border-radius: 0;
  background: var(--btn-primary);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, var(--shadow-soft);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}

.profile-modal-footer .reg-btn--profile-pair:hover {
  background: var(--btn-primary-hover);
}

.profile-modal-footer .reg-btn--profile-pair:active {
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.15);
  filter: brightness(0.96);
}

.profile-modal-footer .reg-btn--profile-pair:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Login / profile modals + credential error (above success-thanks 55) */
.login-modal-overlay,
.profile-modal-overlay,
.login-error-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--overlay-dim);
}

.login-error-overlay {
  z-index: 125;
}

.login-modal-overlay--hidden {
  display: none;
}

/* Tall modals: margin auto centers when short; collapses when content exceeds viewport so overlay scrolls */
.login-modal-overlay > .login-modal,
.profile-modal-overlay > .login-modal,
.login-error-overlay > .login-error-modal {
  flex-shrink: 0;
  margin: auto;
  width: 100%;
  min-width: 0;
}

.login-modal {
  width: 100%;
  max-width: 420px;
  min-width: 0;
}

.login-modal-intro {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 400;
  text-align: center;
  line-height: 1.5;
  color: var(--text-muted);
}

.site-strip--footer {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  min-height: calc(44px + env(safe-area-inset-bottom, 0px));
  border-width: 2px 0 0;
}

.site-strip--footer--social {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-inline: max(10px, env(safe-area-inset-left, 0px)) max(10px, env(safe-area-inset-right, 0px));
}

.site-strip--footer--social .reg-social-links {
  margin: 0;
  padding: 0;
  border-top: none;
  justify-content: flex-end;
}

.site-center {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
}

.vote-wrap {
  width: 100%;
  max-width: 500px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  justify-content: center;
  padding: 12px 10px;
  background: var(--panel-bg);
  border-radius: 0;
  box-shadow: none;
}

/* Voting and results: dvh for dynamic viewport height on mobile */
.vote-wrap--voting,
.vote-wrap--results,
.vote-wrap--post-vote {
  justify-content: flex-start;
  padding-top: clamp(10px, 4dvh, 48px);
  padding-bottom: clamp(10px, 2.5dvh, 24px);
}

.vote-prompt {
  width: 100%;
  flex: 0 0 auto;
  margin: 0 0 clamp(10px, 2.5dvh, 20px);
  padding: 0 6px;
  font-size: clamp(15px, 4.2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-align: center;
  text-transform: none;
  text-wrap: balance;
  color: var(--text);
}

/* Vote buttons directly under the prompt, not vertically centered on screen */
.vote-wrap--voting .vote-screen {
  flex: 0 0 auto;
  align-items: flex-start;
}

.vote-screen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.vote-half {
  display: flex;
  align-items: center;
}

.vote-screen > .vote-half:first-child {
  justify-content: flex-start;
}

.vote-screen > .vote-half:last-child {
  justify-content: flex-end;
}

.vote-tile {
  width: min(36vw, 168px);
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 1px solid var(--chrome-line);
  border-radius: 0;
  background: var(--btn-face);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 2px 8px rgba(0, 0, 0, 0.1);
  font: 700 clamp(13px, 3.8vw, 17px) var(--font-ui);
  letter-spacing: 0.06em;
  color: inherit;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.vote-tile:hover {
  background: var(--btn-face-hover);
  border-color: var(--chrome-line-soft);
}

.vote-tile:focus:not(:focus-visible) {
  outline: none;
}

.vote-tile:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.vote-tile:active {
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.16);
  filter: brightness(0.96);
}

.profile-vote-field {
  margin-top: 6px;
}

.profile-vote-hint {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.profile-vote-hint-extra {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.92;
}

.profile-vote-screen {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 12px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Mini vote tiles: same chrome as main .vote-tile, scaled-down squares (narrower than main, same aspect). */
.profile-edit-modal .vote-tile.profile-vote-tile {
  flex: 0 0 auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(24vw, 68px);
  max-width: min(24vw, 68px);
  aspect-ratio: 1;
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  font: 700 clamp(9px, 2.6vw, 11px) var(--font-ui);
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.profile-vote-tile--selected,
.profile-vote-tile.profile-vote-tile--selected:disabled {
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.16);
  filter: brightness(0.96);
  cursor: default;
}

.profile-vote-tile:disabled:not(.profile-vote-tile--selected) {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Results: height follows content, aligned to top of column */
.vote-wrap--results .vote-screen--results,
.vote-wrap--post-vote .vote-screen--results {
  flex: 0 0 auto;
  align-self: flex-start;
}

.vote-screen--results {
  align-items: flex-start;
  gap: clamp(8px, 2dvw, 14px);
}

.vote-bar-col {
  display: flex;
  flex: 0 1 50%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  max-width: 48%;
}

.vote-bar-pct {
  flex: 0 0 auto;
  margin-bottom: 6px;
  font-size: clamp(15px, 4.2vw, 19px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: center;
}

.vote-bar-track {
  display: flex;
  width: min(72px, 22vw);
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: flex-end;
  height: clamp(72px, 22dvh, min(200px, 38dvh));
  border: 1px solid var(--chrome-line);
  border-radius: 0;
  background: #7a7672;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.28);
}

.vote-bar-fill {
  width: 100%;
  min-height: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.vote-bar-fill--chicken {
  background: linear-gradient(180deg, #d4a574 0%, #a87840 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.vote-bar-fill--egg {
  background: linear-gradient(180deg, #ece8d8 0%, #c8c0a0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.vote-bar-label {
  flex: 0 0 auto;
  margin-top: 8px;
  font-size: clamp(11px, 3.2vw, 14px);
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (min-width: 500px) {
  .vote-wrap:not(.vote-wrap--voting) {
    padding: 16px 14px;
  }

  .vote-wrap--voting,
  .vote-wrap--results,
  .vote-wrap--post-vote {
    padding-top: clamp(20px, 5dvh, 56px);
    padding-bottom: clamp(16px, 3dvh, 28px);
  }

  .vote-wrap--voting {
    padding-inline: 14px;
  }

  .vote-prompt {
    margin-bottom: clamp(16px, 3dvh, 24px);
    font-size: 20px;
  }

  .vote-tile {
    width: 172px;
    font-size: 18px;
  }

  .vote-screen--results {
    gap: clamp(14px, 2.5dvw, 20px);
  }

  .vote-bar-track {
    width: 88px;
    height: clamp(100px, 20dvh, min(240px, 42dvh));
  }
}

/* Short viewport: modals (landscape phone, split view) */
@media (max-height: 520px) {
  .login-modal-intro {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .login-modal.reg-modal {
    padding-top: 10px;
    padding-bottom: 8px;
  }
}

/* Short viewport (small phone portrait, browser chrome) */
@media (max-height: 620px) {
  .vote-wrap--voting,
  .vote-wrap--results,
  .vote-wrap--post-vote {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .vote-prompt {
    margin-bottom: 8px;
    font-size: clamp(13px, 3.8vw, 18px);
  }

  .vote-bar-pct {
    margin-bottom: 4px;
    font-size: clamp(13px, 3.6vw, 17px);
  }

  .vote-bar-label {
    margin-top: 4px;
  }
}

/* Post-vote: same full-height beige column as voting/results; modal is position:fixed on top */
.vote-wrap--post-vote {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.vote-post-vote-results {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

/* Lock page scroll while registration overlay is open (mobile Safari). */
html:has(.reg-overlay:not(.reg-overlay--hidden)) {
  overflow: hidden;
  height: 100%;
}

html:has(.reg-overlay:not(.reg-overlay--hidden)) body {
  overflow: hidden;
}

html:has(.login-modal-overlay:not(.login-modal-overlay--hidden)),
html:has(.login-error-overlay:not(.login-modal-overlay--hidden)),
html:has(.profile-modal-overlay:not(.login-modal-overlay--hidden)),
html:has(.success-thanks-overlay:not(.success-thanks-overlay--hidden)),
html:has(.reg-skip-info-overlay.reg-skip-info-overlay--open) {
  overflow: hidden;
  height: 100%;
}

html:has(.login-modal-overlay:not(.login-modal-overlay--hidden)) body,
html:has(.login-error-overlay:not(.login-modal-overlay--hidden)) body,
html:has(.profile-modal-overlay:not(.login-modal-overlay--hidden)) body,
html:has(.success-thanks-overlay:not(.success-thanks-overlay--hidden)) body,
html:has(.reg-skip-info-overlay.reg-skip-info-overlay--open) body {
  overflow: hidden;
}

.reg-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px))
    max(8px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--overlay-dim);
}

.reg-overlay--hidden {
  display: none;
}

.reg-modal {
  width: 100%;
  max-width: 380px;
  min-width: 0;
  margin-inline: auto;
  padding: 14px 14px 10px;
  border: 1px solid var(--chrome-line);
  border-radius: 0;
  background: #d8d4cc;
  box-shadow: var(--shadow-modal);
}

.reg-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.reg-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  min-width: 0;
}

.reg-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.reg-input {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 5px 7px;
  border: 1px solid var(--chrome-line-soft);
  border-radius: var(--r-touch);
  background: var(--surface);
  font: 12px var(--font-ui);
  line-height: 1.35;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.reg-input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--chrome-line);
}

.reg-select {
  cursor: pointer;
}

.reg-field--country {
  position: relative;
}

.reg-country-list {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: 100%;
  max-height: min(200px, 40dvh);
  margin: 2px 0 0;
  padding: 2px 0;
  overflow: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid var(--chrome-line);
  border-radius: var(--r-touch);
  background: var(--surface);
  box-shadow: var(--shadow-modal);
}

.reg-country-list li {
  padding: 5px 8px;
  cursor: pointer;
  font: 12px var(--font-ui);
}

.reg-country-list li:hover,
.reg-country-list__active {
  background: #4a7ab8;
  color: #fff;
}

.reg-field-error {
  font-size: 11px;
  color: #8b2525;
  font-weight: 400;
}

.reg-field-error:empty {
  display: none;
}

.profile-modal-global-error:empty {
  display: none;
}

.reg-form-error--global {
  margin: 0 0 6px;
  padding: 7px 9px;
  border: 1px solid rgba(139, 37, 37, 0.35);
  border-radius: 0;
  background: #f5e8e8;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: #5a1a1a;
}

.reg-modal-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.reg-social-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.reg-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--chrome-line);
  border-radius: var(--r-touch);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, var(--shadow-soft);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.reg-social-link:hover {
  filter: brightness(1.06);
}

.reg-social-link:active {
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2);
  filter: brightness(0.96);
}

.reg-social-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.reg-social-link--telegram {
  background: #229ed9;
  border-color: #1b7fb0;
}

.reg-social-link--vk {
  background: #0077ff;
  border-color: #0060cc;
}

.reg-social-link__icon {
  display: block;
  width: 22px;
  height: 22px;
}

.reg-btn {
  margin: 0;
  padding: 5px 11px;
  min-height: 28px;
  border: 1px solid var(--chrome-line);
  border-radius: 0;
  background: var(--btn-primary);
  font: 600 11px var(--font-ui);
  letter-spacing: 0.04em;
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, var(--shadow-soft);
}

.reg-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.reg-btn--primary {
  min-width: 108px;
}

.reg-btn--confirm-choice {
  min-width: 0;
  padding: 5px 10px;
  font-size: 11px;
}

.reg-btn--ghost {
  border-color: var(--chrome-line-soft);
  background: var(--btn-secondary);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  font-weight: 400;
}

.reg-btn--later {
  padding: 4px 8px;
  min-height: 26px;
  font-size: 10px;
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .reg-overlay {
    padding: max(6px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px))
      max(6px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  }

  .reg-modal {
    max-width: none;
    padding: 10px 10px 8px;
  }

  .reg-form {
    gap: 6px;
  }

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

  .reg-input {
    padding: 4px 6px;
    font-size: 11px;
  }

  /* Modals: 16px+ inputs avoid iOS zoom-on-focus; stacked footers keep both actions in view with keyboard */
  .login-modal .reg-input,
  .reg-overlay .reg-input,
  .profile-edit-modal .reg-input {
    font-size: 16px;
    padding: 8px 10px;
    line-height: 1.35;
  }

  .reg-overlay .reg-country-search {
    font-size: 16px;
    padding: 8px 10px;
  }

  .reg-overlay .reg-select {
    font-size: 16px;
    padding: 8px 10px;
    min-height: 36px;
  }

  .login-modal-footer.reg-modal-footer,
  .reg-overlay .reg-form > .reg-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .login-modal-footer.reg-modal-footer .reg-btn,
  .reg-overlay .reg-form > .reg-modal-footer .reg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 10px 12px;
    box-sizing: border-box;
    text-align: center;
    font-size: 12px;
  }

  .reg-field-error {
    font-size: 10px;
  }

  .reg-form-error--global {
    margin-bottom: 4px;
    padding: 6px 8px;
    font-size: 10px;
  }

  .reg-modal-footer {
    margin-top: 8px;
    padding-top: 6px;
    gap: 6px;
  }

  .reg-social-links {
    margin-top: 8px;
    padding-top: 8px;
    gap: 10px;
  }

  .reg-social-link {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .reg-social-link__icon {
    width: 20px;
    height: 20px;
  }

  .reg-btn {
    padding: 4px 8px;
    min-height: 26px;
    font-size: 10px;
  }

  .reg-btn--confirm-choice {
    padding: 4px 8px;
    font-size: 10px;
  }

  .reg-btn--later {
    padding: 3px 6px;
    min-height: 24px;
    font-size: 9px;
  }

  .reg-country-list {
    max-height: min(140px, 35dvh);
  }

  .reg-country-list li {
    padding: 4px 7px;
    font-size: 11px;
  }
}

.reg-btn:hover {
  background: var(--btn-primary-hover);
}

.reg-btn--ghost:hover {
  background: var(--btn-secondary-hover);
}

.reg-btn:active {
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.15);
  filter: brightness(0.96);
}

.reg-btn--ghost:active {
  filter: brightness(0.94);
}

.vote-results-under-modal[hidden] {
  display: none !important;
}

/* "Not now" info: visible only with .reg-skip-info-overlay--open */
.reg-skip-info-overlay {
  position: fixed;
  inset: 0;
  z-index: 105;
  display: none;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: var(--overlay-dim);
}

.reg-skip-info-overlay.reg-skip-info-overlay--open {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.reg-skip-info-overlay.reg-skip-info-overlay--open > .reg-skip-info-modal {
  flex-shrink: 0;
  margin: auto;
  width: 100%;
  min-width: 0;
}

.reg-skip-info-modal {
  width: 100%;
  max-width: 320px;
  padding: 18px 18px 14px;
  border: 1px solid var(--chrome-line);
  border-radius: 0;
  background: #d8d4cc;
  box-shadow: var(--shadow-modal);
  text-align: center;
}

.reg-skip-info-text {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  text-align: center;
  color: var(--text-muted);
}

/* Третья строка всегда отдельно (как на узком экране), название кнопки не рвём пополам */
.reg-skip-info-text .reg-skip-info-cta {
  white-space: nowrap;
}

.reg-skip-info-actions {
  display: flex;
  justify-content: center;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* After successful registration: compact thanks modal + fixed login CTA */
.success-thanks-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--overlay-dim);
}

.success-thanks-overlay > .success-thanks-modal {
  flex-shrink: 0;
  margin: auto;
  width: 100%;
  min-width: 0;
}

.success-thanks-overlay--hidden {
  display: none;
}

.success-thanks-modal {
  width: 100%;
  max-width: 300px;
  padding: 18px 18px 12px;
  border: 1px solid var(--chrome-line);
  border-radius: 0;
  background: #d8d4cc;
  box-shadow: var(--shadow-modal);
  text-align: center;
}

.success-thanks-text {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  text-align: center;
  color: var(--text-muted);
}

.success-thanks-actions {
  display: flex;
  justify-content: center;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

