:root {
  color-scheme: dark;
  font-family: Inter, Arial, sans-serif;
  background: #000;
  color: #f8fbff;
}

@font-face {
  font-family: 'ABCFavoritPro';
  src: url('/fonts/ABCFavoritPro-Medium.otf') format('opentype');
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #07111f 0%, #000 100%);
}

.page {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  height: 100vh;
  padding: 0;
}

.banner-card {
  width: 100%;
  height: 100vh;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  overflow: hidden;
}

.public-page .banner-card {
  position: relative;
}

.banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ff5ea8;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-link {
  color: #71e0ff;
  text-decoration: none;
  font-weight: 600;
}

.carousel {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.media-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 1.2s ease-in-out, transform 1.2s ease-in-out;
  will-change: opacity, transform;
}

.media-frame.is-visible {
  z-index: 2;
  opacity: 1;
  transform: scale(1);
}

.media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.station-qr-card {
  position: fixed;
  z-index: 10;
  right: clamp(22px, 4vw, 58px);
  bottom: clamp(20px, 4vh, 48px);
  display: grid;
  justify-items: center;
  gap: 9px;
  width: clamp(132px, 14vw, 190px);
  padding: 12px 10px 10px;
  border: 2px solid #092c50;
  border-radius: 13px 9px 14px 9px;
  border: 0;
  background: #fff;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .3);
  color: #171717;
}

.station-qr-heading {
  margin: 0;
  font-family: 'ABCFavoritPro', Inter, Arial, sans-serif;
  font-size: clamp(11px, 1.15vw, 15px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.25px;
  text-align: center;
}

.station-qr-image-wrap {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 5px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.station-qr-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.station-qr-number {
  min-width: 78%;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #171717;
  font-family: 'ABCFavoritPro', Inter, Arial, sans-serif;
  font-size: clamp(14px, 1.55vw, 20px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 2px;
  text-align: center;
  white-space: nowrap;
}

.foreign-power-bank-banner {
  position: fixed;
  z-index: 8;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.empty {
  color: #d6e3f3;
  padding: 24px 0;
}

.admin-shell {
  --ink: #202820;
  --muted: #748074;
  --line: #e6ebe3;
  --green: #286b49;
  width: min(1120px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 32px;
  color: var(--ink);
}

body:has(.admin-shell) {
  min-height: 100vh;
  background: #f4f6f1;
  color: var(--ink);
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e6eae3;
}

.brand,
.topbar-actions,
.auth-actions,
.panel-heading,
.screen-footer,
.upload-row,
.file-picker,
.ads-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #276744;
  color: #fff;
  font-size: 25px;
  font-weight: 800;
}

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 17px; letter-spacing: -0.5px; }
.brand-copy small { color: #879186; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.topbar-actions { gap: 20px; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #657166;
  font-size: 12px;
  font-weight: 600;
}

.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: #42a66a; box-shadow: 0 0 0 4px #e2f2e7; }
.preview-link { color: #286b49; font-size: 13px; font-weight: 700; text-decoration: none; }
.preview-link:hover { color: #154b30; }

.welcome-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  gap: 40px;
  align-items: center;
  padding: 36px 0 27px;
}

.eyebrow { margin: 0 0 7px; color: #7c897b; font-size: 10px; font-weight: 800; letter-spacing: 1.25px; }
.welcome-row h1 { margin: 0; font-size: clamp(27px, 4vw, 36px); letter-spacing: -1.5px; }
.welcome-copy { margin: 9px 0 0; color: #758074; font-size: 14px; }

.auth-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 5px 16px rgba(31, 48, 35, .035);
}

.auth-status { margin: 0 0 10px; color: #687668; font-size: 12px; line-height: 1.4; }
.auth-actions { flex-wrap: wrap; gap: 7px; }

.panel {
  margin: 0 0 16px;
  padding: 23px 25px;
  border: 1px solid #e6eae3;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(39, 54, 40, .035);
}

.panel-heading { gap: 13px; margin-bottom: 14px; }
.panel-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.35px; }
.panel-heading .eyebrow { margin-bottom: 4px; }
.panel-tag { margin-left: auto; padding: 7px 10px; border-radius: 999px; background: #f1f5ef; color: #68816b; font-size: 11px; font-weight: 700; }
.section-icon { flex: 0 0 41px; height: 41px; display: grid; place-items: center; border-radius: 13px; background: #eaf4ec; color: #2b734c; font-size: 22px; }
.upload-icon { background: #edf3fb; color: #4d75a7; }
.ads-icon { background: #f4f0fa; color: #8065a4; }

.settings-help { margin: 0; color: #778177; font-size: 13px; line-height: 1.55; }
.screen-settings > .settings-help { max-width: 720px; margin: 0 0 18px 54px; }
.screen-settings-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-left: 54px; }
.field { display: grid; gap: 7px; color: #475347; font-size: 12px; font-weight: 700; }
.field input, .field select, .slide-editor input, .slide-editor select, .slide-editor textarea {
  width: 100%; min-width: 0; min-height: 43px; padding: 10px 12px;
  border: 1px solid #dfe5dc; border-radius: 10px; outline: none;
  background: #fbfcfa; color: #263126; font: inherit; font-size: 13px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field select:focus, .slide-editor input:focus, .slide-editor select:focus, .slide-editor textarea:focus { border-color: #78a98a; background: #fff; box-shadow: 0 0 0 3px rgba(65, 132, 87, .11); }
.field-hint { color: #929b91; font-size: 11px; font-weight: 400; }
.manual-screen { margin: 16px 0 0 54px; border-top: 1px solid #edf0eb; padding-top: 12px; }
.manual-screen summary { width: fit-content; cursor: pointer; color: #657366; font-size: 12px; font-weight: 700; }
.manual-fields { margin: 13px 0 0; }
.screen-footer { justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 18px 0 0 54px; padding-top: 15px; border-top: 1px solid #edf0eb; }
.screen-footer .settings-help { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.settings-help a { color: #286b49; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; text-decoration: none; }
.settings-help a:hover { text-decoration: underline; }
.settings-status { min-height: 18px; margin: 0 auto 0 0; color: #2c7950; font-size: 12px; font-weight: 700; }
.settings-status.is-error { color: #b44343; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0; }

.button {
  min-height: 37px; display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  padding: 9px 13px; border: 1px solid transparent; border-radius: 9px;
  cursor: pointer; color: #fff; font: inherit; font-size: 12px; font-weight: 700;
  text-decoration: none; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary, .button-yandex { background: #286b49; }
.button-primary:hover:not(:disabled), .button-yandex:hover:not(:disabled) { background: #1d583a; box-shadow: 0 4px 11px rgba(40,107,73,.15); }
.button-vk { background: #527da8; }
.button-quiet { min-height: 32px; padding: 7px 10px; border-color: #e2e7df; background: #fff; color: #59665a; }
.button-quiet:hover:not(:disabled) { background: #f6f8f4; }
.button-secondary { background: #edf3ee; color: #286b49; }
.button-outline-danger { border-color: #eedbda; background: #fff; color: #a84c49; }
.button-outline-danger:hover:not(:disabled) { background: #fff6f5; }
.copy-button { min-height: 28px; padding: 5px 8px; font-size: 11px; }

.upload-panel { padding-top: 18px; padding-bottom: 18px; }
.panel-heading-compact { margin-bottom: 12px; }
.panel-heading-compact .section-icon { flex-basis: 36px; height: 36px; border-radius: 11px; font-size: 19px; }
.panel-heading-compact h2 { font-size: 16px; }
.upload-row { gap: 10px; margin-left: 49px; }
.upload-row input[type="file"] { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }
.file-picker { min-height: 48px; flex: 1; gap: 11px; padding: 7px 12px; border: 1px dashed #ccd8cc; border-radius: 11px; cursor: pointer; background: #fbfcfa; }
.file-picker:hover { border-color: #79a688; background: #f6faf6; }
.file-picker > span:last-child { display: grid; gap: 3px; }
.file-picker strong { color: #455346; font-size: 12px; }
.file-picker small { color: #929b91; font-size: 10px; }
.file-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: #eaf3eb; color: #34734c; font-size: 20px; }

.ads-panel { padding-top: 20px; }
.ads-heading { align-items: center; }
.ads-heading > div:nth-child(2) { min-width: 200px; }
.ads-heading .settings-help { margin-top: 5px; }
.ads-actions { gap: 8px; margin-left: auto; }
.editor-list { margin: 0 0 0 49px; }
.slide-editor { display: grid; gap: 13px; margin: 0 0 11px; padding: 16px; border: 1px solid #e8ece6; border-radius: 12px; background: #fbfcfa; }
.slide-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.slide-editor label { display: grid; gap: 6px; color: #596559; font-size: 11px; font-weight: 700; }
.slide-editor input, .slide-editor select { min-height: 38px; }
.slide-actions { display: flex; justify-content: flex-end; }
.slide-actions button.danger { min-height: 32px; padding: 7px 11px; border: 1px solid #eedbda; border-radius: 8px; background: #fff; color: #a84c49; font-size: 11px; }
.editor-list > .empty { margin: 0; padding: 18px; border: 1px dashed #dfe5dc; border-radius: 11px; color: #788278; font-size: 13px; }
.admin-footer { padding: 11px 3px; color: #a0a89e; text-align: center; font-size: 10px; }

button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .5; }

@media (max-width: 760px) {
  .admin-shell { width: min(100% - 28px, 600px); }
  .topbar { min-height: 67px; }
  .live-badge { display: none; }
  .topbar-actions { gap: 0; }
  .welcome-row { grid-template-columns: 1fr; gap: 17px; padding: 26px 0 20px; }
  .auth-card { padding: 13px; }
  .panel { padding: 17px 15px; border-radius: 14px; }
  .panel-tag { display: none; }
  .screen-settings > .settings-help, .screen-settings-grid, .manual-screen, .screen-footer, .upload-row, .editor-list { margin-left: 0; }
  .screen-settings-grid { grid-template-columns: 1fr; }
  .screen-footer { align-items: flex-start; }
  .screen-settings-actions { width: 100%; }
  .screen-settings-actions .button { flex: 1; }
  .upload-row { align-items: stretch; flex-wrap: wrap; }
  .file-picker { flex-basis: 100%; }
  .upload-row .button { margin-left: auto; }
  .ads-heading { align-items: flex-start; flex-wrap: wrap; }
  .ads-actions { width: 100%; margin: 4px 0 0 49px; }
  .ads-actions .button { flex: 1; }
  .slide-row { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .admin-shell { width: calc(100% - 20px); }
  .brand-copy small { font-size: 8px; }
  .preview-link { font-size: 11px; }
  .welcome-row h1 { font-size: 28px; }
  .section-icon { flex-basis: 35px; height: 35px; }
  .panel-heading h2 { font-size: 16px; }
  .auth-actions .button { flex: 1; }
  .screen-footer .settings-help { width: 100%; }
  .ads-actions { margin-left: 0; }
}
