/* Discovera Map Studio — дизайн-токены v2/styles.css + раскладка каталога привязки */

.hidden {
  display: none !important;
}

.studio-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 600px at 15% -10%, rgba(217, 119, 6, 0.14), transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

.studio-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15, 14, 13, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.studio-header .wrap {
  width: min(1380px, calc(100% - 28px));
  max-width: none;
}

.studio-header-inner {
  min-height: 58px;
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.studio-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.studio-header .brand img {
  width: 30px;
  height: 30px;
}

.studio-header .brand .brand-title {
  font-size: 1.05rem;
  white-space: nowrap;
}

.studio-header .brand .brand-sub {
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.studio-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 0.82rem;
  white-space: nowrap;
}

.header-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 2px 6px 2px 2px;
  border-radius: 999px;
  cursor: pointer;
}

.header-profile-trigger:hover {
  background: var(--surface-raised);
}

.header-profile-trigger img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--amber-line);
}

/* While /api/session answers, the account pill keeps its place: the last known name with
   the coins dimmed, or — on a first visit — placeholders that say it is loading. */
.header-user-pill.is-loading .header-profile-trigger,
.header-user-pill.is-loading .coin-chip { pointer-events: none; }
.header-user-pill.is-loading #header-user-coins { opacity: 0.5; }
.header-user-pill.is-loading #header-user-name:empty,
.header-user-pill.is-loading #header-user-coins:empty,
.header-user-pill.no-profile #header-avatar {
  display: inline-block;
  min-width: 74px;
  height: 0.85em;
  border-radius: 6px;
  vertical-align: middle;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: pill-loading 1.2s linear infinite;
}
.header-user-pill.is-loading #header-user-coins:empty { min-width: 24px; opacity: 1; }
.header-user-pill.no-profile #header-avatar { min-width: 0; height: 24px; border-radius: 50%; }
@keyframes pill-loading {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .header-user-pill.is-loading #header-user-name:empty,
  .header-user-pill.is-loading #header-user-coins:empty,
  .header-user-pill.no-profile #header-avatar { animation: none; }
}

.header-scope-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-inset);
}

.coin-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--amber-line);
  background: var(--amber-tint);
  color: var(--amber-glow);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
}

.coin-chip:hover {
  border-color: var(--amber-bright);
}

.coin-plus {
  font-weight: 700;
  color: var(--amber-bright);
}

.studio-main {
  flex: 1 0 auto;
  padding-top: 20px;
  padding-bottom: 48px;
}

.surface-card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  padding: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--amber-bright);
  text-transform: uppercase;
}

.studio-toast {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 45;
  margin-bottom: 14px;
  padding: 11px 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--amber-line);
  background: #231a0e;
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: var(--shadow-float);
}

.studio-toast.is-error {
  border-color: rgba(248, 113, 113, 0.5);
  background: #281313;
  color: #fecaca;
}

.studio-toast.is-success {
  border-color: rgba(52, 211, 153, 0.45);
  background: #10241d;
  color: #d1fae5;
}

/* Inputs & buttons */
.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stone-border);
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}

.input-sm {
  padding: 7px 10px;
  font-size: 0.85rem;
}

.input:focus {
  outline: none;
  border-color: var(--amber-bright);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}

.button-block {
  width: 100%;
  justify-content: center;
}

.button-sm {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 0.84rem;
}

/* The site's .button is 52 px tall; without its own height a small button kept that and
   turned «−», «+», «Весь лист» into fat ovals around tiny text. */
.button-xs {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.78rem;
}

.ico {
  flex-shrink: 0;
}

.ico-amber {
  color: var(--amber-glow);
}

/* Segmented Pill Switches (replaces native <select>) */
.pill-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-control);
  background: var(--surface-inset);
  border: 1px solid var(--line-strong);
}

.pill-switch-sm {
  padding: 3px;
  gap: 2px;
}

.pill-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  padding: 8px 13px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.pill-switch-sm .pill-opt {
  padding: 5px 10px;
  font-size: 0.78rem;
  border-radius: 7px;
}

.pill-opt:hover {
  color: var(--text);
}

.pill-opt.is-active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--amber-line);
}

/* Auth & Onboarding */
.auth-hero {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 960px) {
  .auth-hero {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.auth-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 14px;
}

.auth-copy .lead {
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 18px;
}

.auth-guarantees {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--text-dim);
  line-height: 1.5;
}

.auth-guarantees strong {
  color: var(--text);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-control);
  background: var(--surface-inset);
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--amber-line);
}

/* Official Google Icon Sign-In Button */
.google-signin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius-control);
  border: 1px solid var(--amber-line);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}

.google-signin-btn:hover {
  border-color: var(--amber-bright);
  background: #231e19;
  transform: translateY(-1px);
}

.google-g-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.google-signin-text {
  font-weight: 700;
  font-size: 0.96rem;
}

.google-signin-meta {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--amber-glow);
  font-family: var(--font-mono);
}

/* Discovera Modal (Google Account Picker) */
.studio-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
}

.studio-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 6, 0.76);
  backdrop-filter: blur(6px);
}

.studio-modal-card {
  position: relative;
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  border-color: var(--amber-line);
}

.studio-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.google-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.google-modal-brand h2 {
  margin: 0 0 2px;
  font-size: 1.15rem;
}

.icon-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-close-btn:hover {
  color: var(--text);
  border-color: var(--amber-line);
}

.google-accounts-list {
  display: grid;
  gap: 8px;
}

.google-account-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.google-account-row:hover {
  border-color: var(--amber-bright);
  background: #231e19;
}

.google-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
  background: var(--amber);
  color: var(--on-amber);
  flex-shrink: 0;
}

.google-avatar.is-cyan {
  background: rgba(34, 211, 238, 0.18);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.4);
}

.google-avatar.is-plus {
  background: var(--surface-inset);
  color: var(--text-body);
  border: 1px solid var(--line-strong);
}

.google-account-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.google-account-info strong {
  font-size: 0.92rem;
}

.google-account-info span {
  font-size: 0.78rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-google-box {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line-strong);
}

.stack-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 5px;
  font-size: 0.84rem;
  color: var(--text-dim);
}

.form-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.scope-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-card);
  border: 1px solid var(--amber-line);
  background: rgba(217, 119, 6, 0.06);
}

.scope-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--amber-glow);
}

.scope-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
}

.scope-option:has(input:checked) {
  border-color: var(--amber-bright);
  background: rgba(245, 158, 11, 0.12);
}

.scope-option strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 3px;
}

.scope-option span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.zero-coin-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.onboarding-banner {
  margin-bottom: 14px;
}

.onboarding-banner h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

/* Workspace Tabs */
.workspace-view {
  display: grid;
  gap: 14px;
}

.studio-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}

@media (max-width: 1120px) {
  .studio-tabs {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    border-radius: var(--radius-control);
  }
}

.studio-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  font-size: 0.81rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.studio-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.studio-tab.is-active {
  background: var(--amber);
  color: var(--on-amber);
}

.tab-count {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* Search Tab */
.search-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.search-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1 1 260px;
}

.location-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.location-label {
  font-size: 0.82rem;
  color: var(--amber-glow);
  font-weight: 600;
}

.quick-chips {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  color: var(--text-body);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--amber-bright);
  color: var(--amber-glow);
}

.chip-locate {
  border-color: var(--amber-line);
  background: var(--amber-tint);
  color: var(--amber-glow);
  font-weight: 600;
}

.chip-dist {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.search-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.search-meta-inline {
  font-size: 0.84rem;
  color: var(--text-dim);
}

.anti-bypass-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.search-results-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.map-card {
  display: grid;
  grid-template-rows: 170px 1fr auto;
  overflow: hidden;
  border-radius: var(--radius-panel);
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.map-thumb {
  position: relative;
  background: #141211;
  overflow: hidden;
}

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

.map-thumb-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.map-thumb-badges .badge {
  background: rgba(16, 13, 10, 0.88);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  color: #f6efe4;
  border-color: rgba(255, 255, 255, 0.22);
}

.map-thumb-badges .badge-success {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.45);
}

.map-thumb-badges .badge-warn {
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.45);
}

.map-thumb-badges .badge-danger {
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.45);
}

.map-card-body {
  padding: 14px 16px 10px;
  display: grid;
  gap: 6px;
}

.map-card-body h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
}

.map-meta-line {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--amber-bright);
}

.map-excerpt {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.map-card-foot {
  padding: 10px 16px 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  font-size: 0.73rem;
  font-family: var(--font-mono);
  color: var(--text-body);
}

.badge-amber {
  border-color: var(--amber-line);
  background: var(--amber-tint);
  color: var(--amber-glow);
}

.badge-success {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}

.badge-cyan {
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}

.badge-warn {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.scope-pill,
.mono-pill {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ============================================================
 * CATALOG-STYLE GEOREFERENCER STUDIO
 * ============================================================ */
.empty-box {
  text-align: center;
  padding: 40px 24px;
}

.georef-catalog-head {
  padding: 12px 16px;
  margin-bottom: 12px;
  display: grid;
  gap: 8px;
}

.georef-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.georef-title-input {
  flex: 1 1 240px;
  padding: 7px 11px;
  font-weight: 600;
}

.georef-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.georef-hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.step-hint {
  font-size: 0.84rem;
  color: var(--amber-glow);
  font-weight: 600;
}

.georef-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 980px) {
  .georef-split {
    grid-template-columns: 1fr 1fr;
  }
}

.pane-card {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line-strong);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.pane-card.is-awaiting {
  border-color: var(--amber-bright);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

.pane-coord-readout {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Catalog PlaceSearch box above modern map */
.place-search-wrap {
  position: relative;
  display: flex;
  gap: 6px;
}

.place-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 76px;
  z-index: 60;
  background: var(--surface-raised);
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-float);
  max-height: 220px;
  overflow-y: auto;
}

.place-sug-item {
  width: 100%;
  display: block;
  text-align: left;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-size: 0.83rem;
  cursor: pointer;
}

.place-sug-item:last-child {
  border-bottom: 0;
}

.place-sug-item:hover {
  background: rgba(245, 158, 11, 0.14);
  color: var(--text);
}

.scan-viewport,
.modern-viewport {
  width: 100%;
  flex: 1 1 auto;
  min-height: 430px;
  height: 440px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-strong);
  background: #12100e;
  overflow: hidden;
  position: relative;
}

#scan-canvas,
.maplibre-host,
.fallback-modern-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#scan-canvas,
.fallback-modern-canvas {
  cursor: crosshair;
}

/* Fingers on the scan belong to the scan (pan, pinch, tap for a point), not to the page. */
#scan-canvas {
  touch-action: none;
}

/* Match Catalog's ui/map_assets/map.css inside MapLibre */
#modern-map-host .maplibregl-canvas {
  cursor: crosshair;
}

#labels-control {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  font: 12px/1.3 "Segoe UI", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.labels-bar {
  display: flex;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.labels-bar button {
  border: 0;
  background: #fff;
  color: #2b2723;
  cursor: pointer;
  padding: 5px 8px;
  font-weight: 700;
  font-size: 13px;
}

.labels-bar button:hover {
  background: #f0f0f0;
}

#labels-toggle {
  min-width: 28px;
}

#labels-toggle.off {
  color: #9e9e9e;
  text-decoration: line-through;
}

#labels-more {
  border-left: 1px solid #ddd !important;
  padding: 5px 6px !important;
}

#labels-categories {
  background: #fff;
  color: #2b2723;
  border-radius: 4px;
  padding: 6px 10px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#labels-categories label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 12px;
}

/* Catalog draggable GCP crosshair + number marker in MapLibre */
/* MapLibre positions the marker itself: it sets position:absolute on .maplibregl-marker
   and centres it with translate(-50%, -50%). Overriding position here put every pin
   back into normal flow, so pin N drifted N×12 px down the map. */
.ml-gcp-pin {
  width: 24px;
  height: 24px;
  cursor: grab;
  user-select: none;
}

.ml-gcp-pin:active {
  cursor: grabbing;
}

.ml-gcp-ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #0f0e0d;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: #0f0e0d;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.ml-gcp-pin.is-selected .ml-gcp-ring {
  outline: 2px solid #ffffff;
  transform: scale(1.14);
}

.pane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pane-btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.modern-foot {
  gap: 10px;
}

.opacity-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-dim);
  flex: 1 1 120px;
  min-width: 110px;
}

.opacity-control input[type="range"] {
  flex: 1;
  min-width: 70px;
  accent-color: var(--amber);
}

/* Action Bar + Points Panel */
.georef-action-bar {
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.georef-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.more-menu-wrap {
  position: relative;
}

.more-actions-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 65;
  min-width: 240px;
  padding: 6px;
  border-radius: var(--radius-card);
  border: 1px solid var(--amber-line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-float);
  display: grid;
  gap: 3px;
}

.more-actions-menu button {
  border: 0;
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-size: 0.83rem;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.more-actions-menu button:hover {
  background: rgba(245, 158, 11, 0.14);
  color: var(--text);
}

.more-actions-menu button.is-danger {
  color: #fca5a5;
}

.georef-points-card {
  padding: 12px 16px;
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

.georef-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-body);
}

.georef-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

.georef-status-dot.is-good {
  background: var(--success);
}

.georef-status-dot.is-warn {
  background: #f87171;
}

.georef-points-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

@media (min-width: 720px) {
  .georef-points-layout {
    grid-template-columns: 1fr 150px;
  }
}

.gcp-listbox {
  min-height: 92px;
  max-height: 170px;
  overflow-y: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-strong);
  background: var(--surface-inset);
  padding: 6px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.gcp-listbox:focus {
  outline: none;
  border-color: var(--amber-line);
}

.gcp-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.79rem;
  text-align: left;
  cursor: pointer;
}

.gcp-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.gcp-row.is-selected {
  background: rgba(245, 158, 11, 0.14);
  border-color: var(--amber-line);
  color: var(--text);
}

.gcp-list-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.section-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.math-dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px 12px;
}

.math-dl div {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--line);
}

.math-dl dt {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.math-dl dd {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

/* Dashboard inside Cabinet Tab */
.profile-dashboard {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--amber-line);
  background: var(--surface-inset);
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-name-row h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.profile-meta-row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--text-dim);
}

.wallet-box {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  border: 1px solid var(--line-strong);
}

.wallet-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.wallet-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 1.4rem;
}

.wallet-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.wallet-actions {
  display: flex;
  gap: 8px;
}

.stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.stat-tile {
  padding: 11px 13px;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  display: grid;
  gap: 3px;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--text);
}

.stat-foot {
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* Cabinet, Coins, Harvest */
.section-head-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head-bar h2 {
  margin: 0 0 4px;
}

.muted-text {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0;
}

.cabinet-grid,
.harvest-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  margin-bottom: 18px;
}

.cabinet-card {
  display: grid;
  gap: 10px;
}

.cabinet-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cabinet-card-head img {
  width: 88px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
}

.cabinet-secondary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.mini-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.mini-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}

.coin-packs-grid {
  margin-top: 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.coin-pack-card {
  display: grid;
  gap: 12px;
  position: relative;
}

.coin-pack-card.is-popular {
  border-color: var(--amber-bright);
  box-shadow: 0 0 0 1px var(--amber-line);
}

.coin-pack-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.coin-pack-top img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.coin-pack-price {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--amber-glow);
}

.coin-order-status {
  margin-top: 16px;
}

.studio-footer {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* App account panel: level, achievements and the maps already in the app */
.app-profile-panel { margin-bottom: 18px; display: grid; gap: 10px; }
.app-profile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.app-profile-head h3 { margin: 2px 0 0; }
.app-profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.app-profile-grid h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.app-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.app-chip { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(217, 119, 6, .45); background: rgba(217, 119, 6, .12); font-size: 13px; }
.app-xp-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.app-xp-bar span { display: block; height: 100%; background: #d97706; }


/* Password visibility toggle */
.header-site-link {
  white-space: nowrap;
  text-decoration: none;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field .input {
  width: 100%;
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim, rgba(255, 255, 255, 0.65));
  cursor: pointer;
  z-index: 2;
  transition: color 0.14s ease, background 0.14s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--amber, #e09f3e);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Registration provider chooser (centered & separated cards) */
.reg-method-chooser {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  margin-bottom: 2px;
}

.reg-method-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim, rgba(255, 255, 255, 0.72));
}

.reg-method-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

@media (max-width: 520px) {
  .reg-method-grid {
    grid-template-columns: 1fr;
  }

  .reg-method-or {
    padding: 2px 0;
  }
}

.reg-method-or {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim, rgba(255, 255, 255, 0.55));
}

.reg-method-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 10px;
  min-height: 86px;
  border-radius: var(--radius-control, 12px);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  background: rgba(255, 255, 255, 0.03);
  color: var(--text, #f5f2eb);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.reg-method-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
}

.reg-method-card.is-active {
  border-color: var(--amber, #e09f3e);
  background: rgba(224, 159, 62, 0.12);
  box-shadow: 0 0 0 1px var(--amber, #e09f3e) inset;
}

.reg-method-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.reg-method-icon-mail {
  font-weight: 800;
  font-size: 1rem;
  color: var(--amber-glow, #f7b857);
}

.reg-method-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.reg-method-sub {
  font-size: 0.74rem;
  color: var(--text-dim, rgba(255, 255, 255, 0.62));
  line-height: 1.25;
}

.reg-google-hint {
  padding: 10px 12px;
  border-radius: var(--radius-control, 10px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--line, rgba(255, 255, 255, 0.16));
  font-size: 0.82rem;
  color: var(--text-dim, rgba(255, 255, 255, 0.72));
  line-height: 1.4;
  text-align: center;
}

/* bePaid wordmark: the provider's own drawing, in the colour of the text around it */
.bepaid-badge-bw {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.12em;
  margin: 0 3px;
  line-height: 1;
  color: inherit;
}
.bepaid-badge-bw svg {
  width: 57px;
  height: 15px;
  display: block;
}
.button .bepaid-badge-bw svg {
  width: 49px;
  height: 13px;
}

/* Welcome coins banner */
.welcome-coins-banner {
  padding: 10px 12px;
  border-radius: var(--radius-control, 10px);
  background: rgba(224, 159, 62, 0.1);
  border: 1px solid rgba(224, 159, 62, 0.34);
  font-size: 0.83rem;
  line-height: 1.4;
  color: var(--text, #f5f2eb);
  text-align: center;
}

/* Legal / RB Law 99-Z consent box & modal */
.legal-consent-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-control, 12px);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  background: rgba(255, 255, 255, 0.03);
}

.legal-consent-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.legal-consent-head strong {
  font-size: 0.86rem;
  display: block;
}

.legal-consent-sub {
  margin: 4px 0 0;
  font-size: 0.77rem;
  color: var(--text-dim, rgba(255, 255, 255, 0.65));
  line-height: 1.35;
}

.legal-read-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim, rgba(255, 255, 255, 0.75));
}

.legal-read-badge.is-done {
  border-color: rgba(64, 196, 122, 0.55);
  background: rgba(64, 196, 122, 0.15);
  color: #82e6ae;
}

.legal-check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-dim, rgba(255, 255, 255, 0.82));
  cursor: pointer;
}

.legal-check-row input[type='checkbox'] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--amber, #e09f3e);
  flex-shrink: 0;
}

.legal-modal-card {
  max-width: 680px;
  width: min(94vw, 680px);
  display: grid;
  gap: 14px;
}

.legal-modal-scroll {
  max-height: 52vh;
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: var(--radius-control, 12px);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  background: rgba(0, 0, 0, 0.24);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text, #f5f2eb);
}

.legal-modal-scroll h4 {
  margin: 14px 0 6px;
  font-size: 0.92rem;
  color: var(--amber-glow, #f7b857);
}

.legal-modal-scroll h4:first-child {
  margin-top: 0;
}

.legal-modal-scroll p {
  margin: 0 0 10px;
}

.legal-modal-scroll a {
  color: var(--amber-glow, #f7b857);
}

.legal-modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.legal-scroll-hint {
  font-size: 0.78rem;
  color: var(--amber-glow, #f7b857);
  font-weight: 600;
}

.legal-scroll-hint.is-done {
  color: #82e6ae;
}

.auth-error-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-hint-box {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-control, 10px);
  border: 1px dashed var(--line, rgba(255, 255, 255, 0.16));
  background: rgba(255, 255, 255, 0.03);
}

.demo-hint-box .form-hint {
  margin: 0;
}

/* ============================================================
 * SEARCH CARDS: real previews, paging
 * ============================================================ */
button.map-thumb {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  text-align: left;
}

button.map-thumb:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: -2px;
}

.map-thumb img {
  transition: opacity 0.25s ease, transform 0.35s ease;
}

button.map-thumb:hover img {
  transform: scale(1.03);
}

.map-thumb.is-loading img {
  opacity: 0;
}

.map-thumb.is-loading {
  background: linear-gradient(100deg, #171412 30%, #241f1a 50%, #171412 70%);
  background-size: 220% 100%;
  animation: thumb-shimmer 1.4s linear infinite;
}

.map-thumb-wait {
  position: absolute;
  inset: auto 0 14px 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-faint);
  display: none;
}

.map-thumb.is-loading .map-thumb-wait {
  display: block;
}

@keyframes thumb-shimmer {
  from {
    background-position: 110% 0;
  }
  to {
    background-position: -110% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-thumb.is-loading {
    animation: none;
  }
  .map-thumb img {
    transition: none;
  }
}

.search-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 6px;
}

.button-danger-text {
  color: #fca5a5;
}

.button-danger-text:hover {
  color: #fecaca;
}

.cabinet-thumb {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  flex: 0 0 auto;
  line-height: 0;
  border-radius: var(--radius-sm);
}

.cabinet-thumb img {
  background: #141211;
}

/* ============================================================
 * MAP VIEWER
 * ============================================================ */
.map-viewer {
  padding: 12px;
}

.map-viewer-card {
  position: relative;
  width: min(1280px, 100%);
  height: min(880px, calc(100vh - 24px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  border-color: var(--amber-line);
}

.map-viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.map-viewer-titles {
  min-width: 0;
  flex: 1 1 auto;
}

.map-viewer-titles h2 {
  max-width: none;
  margin: 0 0 4px;
  font-size: 1.15rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.map-viewer-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-strong);
  background: #12100e;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-viewer-stage.is-dragging {
  cursor: grabbing;
}

#viewer-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
}

#viewer-img:not([src]) {
  visibility: hidden;
}

.map-viewer-status,
.scan-status {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(16, 13, 10, 0.9);
  border: 1px solid var(--amber-line);
  color: var(--amber-glow);
  font-size: 0.82rem;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.map-viewer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
}

.map-viewer-badges,
.map-viewer-pager,
.map-viewer-zoom,
.map-viewer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .map-viewer {
    padding: 0;
  }
  .map-viewer-card {
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    padding: 12px;
  }
  .map-viewer-actions {
    width: 100%;
  }
  .map-viewer-actions .button {
    flex: 1 1 0;
  }
}

.map-thumb-badges {
  justify-content: flex-end;
}

.viewer-rights {
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* The holder's credit links to its site, as the holder asked. */
.viewer-credit a {
  color: inherit;
  text-decoration: underline;
}

/* The holder keeps its original from programs: the reader's own way to it, in one line
   under the badges, wrapping on a phone. */
.viewer-original {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.viewer-original > span {
  flex: 1 1 260px;
  min-width: 0;
}

/* ============================================================
 * CABINET: one name, one balance, compact lists
 * ============================================================ */

/* The cabinet shows the profile in full; the header copy steps aside there. */
:root[data-tab='cabinet'] .header-user-pill {
  display: none;
}

/* Card checkout is for Russian-speaking visitors, Google Play for everyone else. */
:root.is-foreign [data-pay='bepaid'],
:root:not(.is-foreign) [data-pay='play'] {
  display: none !important;
}

.profile-dashboard {
  gap: 12px;
}

.profile-identity > div {
  min-width: 0;
}

.profile-identity .app-xp-bar {
  margin-top: 8px;
  max-width: 320px;
}

.profile-meta-row {
  gap: 6px 8px;
}

.button-logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-body);
}

.button-logout:hover {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.45);
}

.stats-grid {
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.stat-tile {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
}

.stat-num {
  font-size: 1.02rem;
}

.stat-foot {
  margin-left: auto;
  text-align: right;
}

.app-profile-panel {
  gap: 12px;
}

/* Saved maps: a thumbnail, what the sheet is waiting for, one main action. */
.cabinet-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}

.cabinet-card {
  position: relative;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px;
}

.cabinet-thumb img {
  width: 108px;
  height: 84px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
}

.cabinet-card-main {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding-right: 26px;
}

.cabinet-title {
  font-size: 0.95rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cabinet-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cabinet-badges:empty {
  display: none;
}

.cabinet-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.cabinet-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

.cabinet-remove:hover,
.cabinet-remove:focus-visible {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
}

/* Coin history: one line per operation, the last five by default. */
.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-head-row h3 {
  margin: 0;
}

.ledger-list {
  display: grid;
}

.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 12px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

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

.ledger-what {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-when {
  color: var(--text-faint);
  font-size: 0.76rem;
  white-space: nowrap;
}

.ledger-delta {
  font-family: var(--font-mono);
  min-width: 44px;
  text-align: right;
}

.ledger-delta.is-plus {
  color: var(--success);
}

.ledger-delta.is-minus {
  color: #fca5a5;
}

#btn-ledger-more {
  margin-top: 6px;
}

.ledger-pay-note {
  margin: 10px 0 0;
}

/* Coins tab */
.coins-intro {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 26px 24px;
}

.coins-intro h2 {
  margin: 0;
  max-width: 28ch;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.2;
}

.coins-intro p.muted-text {
  margin: 0;
  max-width: 68ch;
}

.coin-shared-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
  border-color: var(--amber-line);
}

.coin-shared-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.coin-shared-head h3 {
  margin: 0 0 2px;
}

.coin-shared-head p {
  margin: 0;
}

.coin-shared-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 1.5rem;
}

.coin-ways {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.coin-way {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  border: 1px solid var(--line);
}

.coin-way h4 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.coin-way p {
  margin: 0;
}

.coin-way .button {
  justify-self: start;
  margin-top: 4px;
  text-decoration: none;
}

@media (max-width: 560px) {
  .cabinet-grid {
    grid-template-columns: 1fr;
  }
  .cabinet-card {
    grid-template-columns: 84px minmax(0, 1fr);
  }
  .cabinet-thumb img {
    width: 84px;
    height: 68px;
  }
  .ledger-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .ledger-when {
    grid-column: 1;
    grid-row: 2;
  }
  .ledger-delta {
    grid-row: 1 / span 2;
    align-self: center;
  }
}

.wallet-box {
  flex: 1 1 440px;
  justify-content: space-between;
  max-width: 640px;
}

.section-head-bar h2 {
  max-width: none;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.2;
}

.section-head-bar p {
  margin: 4px 0 0;
  max-width: none;
}

/* Cabinet, second pass: small buttons, aligned app maps, app figures beside the avatar */
.profile-app-stats {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.cabinet-actions .button,
.app-profile-panel .button {
  min-height: 0;
  padding: 5px 11px;
  font-size: 0.8rem;
  line-height: 1.25;
  border-radius: 9px;
  box-shadow: none;
}

.cabinet-card {
  align-items: center;
}

.app-map-list,
#app-maps-list {
  display: grid;
  gap: 0;
}

.app-map-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
}

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

.app-map-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--amber-bright);
}

.app-map-text {
  display: grid;
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.3;
}

.app-map-text strong,
.app-map-text .muted-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-map-text .muted-text {
  font-size: 0.76rem;
}

.icon-quiet-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

.icon-quiet-btn:hover,
.icon-quiet-btn:focus-visible {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
}

.app-profile-grid {
  align-items: start;
}

/* ============================================================
 * BUSY STATES: a pressed button says that work is under way
 * ============================================================ */
.btn-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: btn-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.button.is-busy {
  cursor: progress;
  opacity: 0.92;
}

.button.is-busy .btn-spinner {
  display: inline-block;
}

.button.is-busy .btn-icon {
  display: none;
}

.button:disabled {
  cursor: not-allowed;
}

.button.is-busy:disabled {
  cursor: progress;
}

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

.search-progress {
  margin: -6px 0 14px;
}

.search-progress-track {
  position: relative;
  height: 3px;
  border-radius: 999px;
  background: var(--surface-raised);
  overflow: hidden;
}

.search-progress-track span {
  display: block;
  height: 100%;
  width: 6%;
  border-radius: inherit;
  background: var(--amber-bright);
  transition: width 0.5s ease;
}

.search-progress-track.is-indeterminate span {
  position: absolute;
  width: 30%;
  animation: progress-slide 1.3s ease-in-out infinite;
}

@keyframes progress-slide {
  from {
    left: -30%;
  }
  to {
    left: 100%;
  }
}

.search-results-grid.is-stale {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.map-card-skeleton {
  pointer-events: none;
}

.map-card-skeleton .map-thumb {
  height: 100%;
}

.map-card-skeleton .map-card-body {
  gap: 10px;
}

.sk-line,
.sk-btn {
  display: block;
  border-radius: 6px;
  background: linear-gradient(100deg, #26211c 30%, #3a3129 50%, #26211c 70%);
  background-size: 220% 100%;
  animation: thumb-shimmer 1.4s linear infinite;
}

.sk-line {
  height: 12px;
  width: 92%;
}

.sk-title {
  height: 18px;
  width: 70%;
}

.sk-short {
  width: 48%;
}

.sk-btn {
  display: inline-block;
  height: 32px;
  width: 112px;
  border-radius: 10px;
}

/* A long job (a build, a send) shows its own line under the action. */
.job-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--amber-glow);
}

.job-status .btn-spinner {
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner,
  .sk-line,
  .sk-btn,
  .search-progress-track.is-indeterminate span {
    animation-duration: 3s;
  }
}

/* RU / EN */
.lang-switch {
  min-width: 38px;
  height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  color: var(--text);
  border-color: var(--amber-line);
}

/* In-page yes/no (askConfirm in studio.js) — window.confirm is not shown in every browser. */
.confirm-modal { z-index: 120; }
.confirm-card { max-width: 440px; display: grid; gap: 18px; }
.confirm-text { margin: 0; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.icon-quiet-btn.is-busy { opacity: 0.45; cursor: progress; }
.confirm-actions .button-danger { border: 1px solid transparent; background: #b91c1c; color: #fff; }
.confirm-actions .button-danger:hover, .confirm-actions .button-danger:focus-visible { background: #dc2626; }

/* A card whose picture costs the whole scan: it says how big and loads when pressed. */
.map-thumb.is-on-demand {
  cursor: pointer;
  background:
    repeating-linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0 12px, transparent 12px 24px),
    #171412;
}
.map-card .map-thumb.is-on-demand .map-thumb-wait {
  display: block;
  inset: 50% 16px auto 16px;
  transform: translateY(-50%);
  padding: 10px 14px;
  border: 1px dashed var(--amber-line);
  border-radius: 999px;
  color: var(--amber-glow, #fbbf24);
  font-size: 0.82rem;
  font-weight: 600;
}
.map-thumb.is-on-demand:hover .map-thumb-wait,
.map-thumb.is-on-demand:focus-visible .map-thumb-wait {
  border-style: solid;
  background: rgba(245, 158, 11, 0.1);
}

/* «Как карта будет называться в приложении» — asked before sending (askAppMapDetails). */
.app-details-card { width: min(520px, 100%); max-width: none; }
/* Grid children and inputs shrink to the card: with content-box inputs the fields ran past its edge. */
.app-details-card > *, .app-details-row > * { min-width: 0; }
.app-details-card h2 { max-width: none; margin: 0; font-size: 1.25rem; text-wrap: balance; }
.app-details-card .muted-text { margin: 0; }
.app-details-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.app-details-field { display: grid; gap: 6px; font-size: 0.82rem; color: var(--text-dim); }
.app-details-field input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.app-details-field input:focus-visible { outline: 2px solid var(--amber-line); outline-offset: 1px; border-color: var(--amber-line); }
.app-details-error { margin: 0; color: var(--error); font-size: 0.85rem; }
@media (max-width: 520px) { .app-details-row { grid-template-columns: 1fr; } }

/* «Скачать»: the formats and the app, one choice per row, each said in plain words. */
.download-card { width: min(520px, 100%); max-width: none; }
.download-card h2 { margin: 0; font-size: 1.25rem; }
.download-card .download-map-title { margin: -10px 0 0; }
.download-options { display: grid; gap: 10px; }
.download-option {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text-body);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.download-option strong { color: var(--amber-glow); font-size: 0.98rem; }
.download-option span { color: var(--text-dim); font-size: 0.84rem; line-height: 1.4; }
.download-option:hover, .download-option:focus-visible { border-color: var(--amber-line); background: var(--surface-inset); outline: none; }
.download-option.is-disabled { cursor: default; opacity: 0.55; }
.download-option.is-disabled:hover { border-color: var(--line-strong); background: var(--surface-raised); }

/* ============================================================
 * THREE TOOLS: the first screen lists them; «Привязка» offers a sheet
 * from the search or your own scan; your own scan and «Файлы .sqlitedb»
 * are the site's tool pages in a frame (tools/kit/embed.js).
 * ============================================================ */
.studio-tools {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.studio-tools li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-dim);
  line-height: 1.5;
}

.studio-tools li .ico {
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 10px;
  color: var(--amber-glow);
  background: var(--amber-tint);
  border: 1px solid var(--amber-line);
}

.studio-tools strong {
  color: var(--text);
}

.georef-choice h2 {
  margin: 0 0 18px;
}

.georef-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

@media (min-width: 720px) {
  .georef-choice-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.choice-card {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius-panel);
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.choice-card:hover,
.choice-card:focus-visible {
  border-color: var(--amber-bright);
  background: var(--amber-tint);
}

.choice-card .ico {
  color: var(--amber-glow);
}

.choice-card strong {
  color: var(--text);
  font-size: 1.05rem;
}

.tool-frame-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.84rem;
}

.tool-frame {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  background: transparent;
  color-scheme: dark;
}

/* Phones: the language, «На главную» and the account pill used to run 45 px past a 390 px
   screen (the whole page then scrolled sideways). They wrap instead. */
@media (max-width: 560px) {
  .studio-header-right {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
  }

  .header-site-link {
    padding-inline: 10px;
  }

  /* Three rows of header on a phone took a third of the screen and stayed over the tools. */
  .studio-header {
    position: static;
  }
}

/* Sign-in in progress. Without it the sign-in screen stood still after Google's window
   closed, and a second later the workspace jumped in: no sign that anything was happening. */
.auth-loading {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  background: rgba(15, 14, 13, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.auth-loading.hidden { display: none; }
.auth-loading.is-visible { opacity: 1; }
.auth-loading-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 28px 36px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 18px;
  background: rgba(24, 22, 20, 0.92);
  transform: translateY(6px);
  transition: transform 0.25s ease;
}
.auth-loading.is-visible .auth-loading-card { transform: none; }
.auth-loading .coil-loader { --coil-size: 46px; }
.auth-loading-card p { margin: 0; font-size: 0.95rem; color: var(--text, #f3efe8); }

/* The workspace arrives instead of popping in. */
@keyframes workspace-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
#workspace-view.just-entered { animation: workspace-enter 0.35s ease both; }
@media (prefers-reduced-motion: reduce) {
  .auth-loading, .auth-loading-card { transition: none; }
  #workspace-view.just-entered { animation: none; }
}


/* ---------------------------------------------------------------------------------------
   Phones. The header took three rows (language and «На главную», then the account, then
   six tabs in three lines) - a third of the screen before the first field. Now it is one
   row: the logo (it already leads to the site), the account, the coins, the language in
   the right corner. The sections go to a bar at the bottom, like the app's own menu.
   --------------------------------------------------------------------------------------- */
@media (max-width: 720px) {
  /* A backdrop filter makes the header the frame of every fixed child: the bottom bar
     stuck to the header instead of the screen. The header does not float on a phone. */
  .studio-header {
    position: static;
    backdrop-filter: none;
    background: rgba(15, 14, 13, 0.97);
  }

  .studio-header-inner {
    flex-wrap: nowrap;
    min-height: 52px;
    gap: 8px;
  }

  .studio-header .brand .brand-title {
    display: grid;
    line-height: 1.05;
    font-size: 0.98rem;
  }

  .studio-header .brand .brand-sub {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }

  .studio-header-right {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
  }

  .header-site-link,
  .header-scope-tag,
  #header-user-name {
    display: none !important;
  }

  .header-user-pill {
    gap: 4px;
    padding: 2px 4px;
  }

  .header-profile-trigger {
    padding: 2px;
  }

  .studio-header-right .lang-switch {
    order: 3;
  }

  .studio-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    order: 0;
    width: auto;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 0;
    background: rgba(15, 14, 13, 0.97);
    backdrop-filter: blur(12px);
  }

  .studio-tab {
    position: relative;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 52px;
    padding: 5px 2px;
    border-radius: 10px;
    font-size: 0.64rem;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }

  .studio-tab .ico {
    width: 19px;
    height: 19px;
  }

  .studio-tab > span:not(.tab-count) {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* «Georeference» is wider than a sixth of a phone: it breaks with a hyphen, not mid-letter. */
    max-width: 100%;
    hyphens: auto;
    /* break-word leaves the min-content width at the whole word, so the column still overflowed. */
    overflow-wrap: anywhere;
  }

  .studio-tab .tab-count {
    position: absolute;
    top: 3px;
    right: calc(50% - 22px);
  }

  /* Room for the bottom bar, so it never covers the last button of a page. */
  .studio-body:has(.studio-tabs:not(.hidden)) .studio-main {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  /* Sign-in first: on a phone the form came after the whole description of the Studio. */
  .auth-card {
    order: -1;
  }

  .auth-copy h1 {
    font-size: 1.5rem;
  }

  /* Search: the field on its own line, then the filter and the button. */
  .search-bar .search-input {
    flex: 1 1 100%;
  }

  .search-bar #btn-search {
    flex: 1 1 auto;
  }

  /* «Рядом со мной» is one button; the towns appear when it is pressed. */
  .location-search-bar:not(.is-open) .location-label,
  .location-search-bar:not(.is-open) .quick-chips {
    display: none;
  }

  .location-search-bar.is-open .location-label {
    flex: 1 1 100%;
  }

  .search-subbar .anti-bypass-mini {
    display: block;
    font-size: 0.74rem;
    line-height: 1.45;
  }

  .search-subbar .anti-bypass-mini .ico {
    display: inline-block;
    vertical-align: -2px;
    margin-right: 4px;
  }
}


/* «Подтвердите почту»: above the work, in the Studio's amber, with its two buttons. */
.email-confirm-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 14px 18px;
  border-color: var(--amber-line);
  background: radial-gradient(80% 140% at 100% 0%, rgba(217, 119, 6, 0.14), transparent 70%), var(--surface);
}

.email-confirm-text {
  flex: 1 1 320px;
  min-width: 0;
}

.email-confirm-text strong {
  color: var(--amber-glow);
}

.email-confirm-text p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.email-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .email-confirm-actions,
  .email-confirm-actions .button {
    flex: 1 1 100%;
  }
}

/* Share or keep: the nickname choice and the reviewer's reason under a rejected map. */
.share-nick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
}
.share-terms {
  font-size: 0.78rem;
  margin-top: 8px;
}
.review-note {
  color: var(--danger, #e57373);
}

.badge-danger {
  background: rgba(229, 115, 115, 0.16);
  color: #f2a3a3;
}

/* What an achievement is for: shown on hover or focus (a tap on a phone), above the chip. */
.app-chip[data-hint] {
  position: relative;
  cursor: help;
}
.app-chip[data-hint]:hover::after,
.app-chip[data-hint]:focus::after {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #11100e;
  border: 1px solid rgba(232, 160, 60, 0.45);
  color: var(--text, #f3efe7);
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: normal;
  z-index: 30;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.app-maps-more {
  margin-top: 8px;
}

/* A map already in the cabinet: green, with a tick; a press opens the cabinet. */
.button-saved {
  background: rgba(52, 199, 123, 0.16);
  border: 1px solid rgba(52, 199, 123, 0.55);
  color: #5fe0a0;
}
.button-saved:hover {
  background: rgba(52, 199, 123, 0.26);
}

/* The sheet on the whole screen: the card fills the window (and the screen, where the browser
   lets it), the stage takes everything the head and the foot leave. */
.map-viewer.is-full {
  padding: 0;
}
.map-viewer.is-full .map-viewer-card {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  border-radius: 0;
  border: 0;
}
.map-viewer-card:fullscreen {
  width: 100vw;
  height: 100vh;
  background: var(--bg, #0f0e0d);
}
.viewer-full-btn .ico {
  display: block;
}

/* Right click on an open sheet, for staff: download the original. */
.viewer-menu {
  position: fixed;
  z-index: 200;
  min-width: 240px;
  max-width: 280px;
  padding: 6px;
  border: 1px solid var(--amber-line, rgba(234, 179, 8, 0.35));
  border-radius: 10px;
  background: rgba(24, 22, 20, 0.98);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}
.viewer-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.viewer-menu-item:hover {
  background: rgba(234, 179, 8, 0.14);
}
.viewer-menu-note {
  padding: 2px 10px 6px;
  color: var(--muted, #958f8a);
  font-size: 0.75rem;
  line-height: 1.3;
}

/* Came with a shared map (?map=<archiveId>): why the visitor is asked to sign in first. */
.auth-shared-map-note {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  font-weight: 600;
  line-height: 1.45;
}

/* The person's own recent searches, where «Рядом со мной» used to be. */
.recent-searches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 10px;
}
.recent-searches .quick-chips {
  display: contents;
}
.recent-clear {
  border: 0;
  background: transparent;
  color: var(--muted, #958f8a);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}
#btn-viewer-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Staff: the queue of maps shared for the archive, and the check on the ground. */
.staff-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.staff-card {
  display: grid;
  gap: 6px;
}
.staff-signups {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.signup-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}
.signup-total {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.signup-bars {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 4px;
  height: 56px;
  align-items: end;
}
.signup-bar {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.signup-bar i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--accent, #f59e0b);
  opacity: 0.85;
}
.signup-bar b {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.7;
}
.staff-card-head .badge {
  white-space: nowrap;
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.1;
  font-family: inherit;
  letter-spacing: 0;
}
.staff-card-who {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
}
.staff-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #1a1206;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.staff-edited {
  font-size: 0.8rem;
  color: #fbbf24;
}
.staff-pin.is-movable {
  cursor: grab;
}
.staff-pin.is-movable:active {
  cursor: grabbing;
}
.staff-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.staff-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.staff-note {
  font-size: 0.82rem;
  color: var(--muted, #958f8a);
  border-left: 2px solid var(--amber-line, rgba(234, 179, 8, 0.35));
  padding-left: 8px;
}
.staff-note-error {
  color: #f87171;
  border-left-color: rgba(248, 113, 113, 0.6);
}
.staff-review-stage {
  position: relative;
  min-height: 0;
}
.staff-review-map {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
}
.staff-review-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.staff-review-opacity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.staff-review-opacity input {
  width: 160px;
  accent-color: #f59e0b;
}
.staff-legend {
  font-size: 0.78rem;
}
.staff-review-foot .map-viewer-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.staff-reject-input {
  min-width: 240px;
}
.staff-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  color: #111;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.button-success {
  background: #10b981;
  color: #04120c;
  border: 1px solid #10b981;
}
.button-success:hover {
  background: #34d399;
}
.button-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.55);
}

/* A message must be seen where the person is looking: "Ссылка на карту скопирована" appeared
   behind the open sheet (the toast sat in the page at layer 45, the viewer at 90). It floats
   now, at the top in the middle, above every window but the sign-in veil. */
.studio-toast {
  position: fixed;
  top: calc(var(--header-h, 64px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  margin: 0;
  width: max-content;
  max-width: min(640px, calc(100vw - 32px));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

/* «Т» on the moderators' review map: town and road names on or off. */
.staff-review-labels {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}
.staff-review-labels button:not(.is-on) {
  opacity: 0.55;
  text-decoration: line-through;
}
