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

:root {
  --bg: #fafafb;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f4f4f6;
  --border: #ececf0;
  --border-strong: #dcdce3;
  --border-focus: #6366f1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-bg: rgba(99, 102, 241, 0.06);
  --accent-glow: rgba(99, 102, 241, 0.14);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.06);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.06);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.05);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --thumb-size: 92px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 2px 12px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-accent: 0 2px 12px rgba(99, 102, 241, 0.14);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100vh;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ===== Auth Screen ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(16, 185, 129, 0.06), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 44px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}

.auth-title {
  margin: 0 0 4px 0;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.auth-subtitle {
  margin: 0 0 32px 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.auth-input {
  padding: 13px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-elevated);
}

.auth-btn {
  padding: 13px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.auth-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.auth-btn:active:not(:disabled) {
  transform: translateY(0);
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 10px 0;
  line-height: 1.5;
}

.auth-switch {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.auth-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  padding: 0;
  font-weight: 500;
  transition: color var(--transition);
}

.auth-link:hover {
  color: var(--accent-hover);
}

.auth-2fa-setup {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.auth-qr-wrap {
  flex-shrink: 0;
}

.auth-qr {
  display: block;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
}

.auth-qr-hint {
  margin: 8px 0 0 0;
  font-size: 0.8125rem;
}

.auth-secret-wrap {
  flex: 1;
  min-width: 200px;
}

.auth-secret-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.auth-secret {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  word-break: break-all;
  user-select: all;
  color: var(--accent);
}

.auth-copy-btn {
  flex-shrink: 0;
  font-size: 0.875rem;
}

/* ===== Main App ===== */
.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- Header --- */
.header {
  flex-shrink: 0;
  padding: 10px clamp(12px, 2vw, 28px);
  min-height: 60px;
  height: auto;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.header-point-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

.api-warn {
  font-size: 0.8125rem;
  color: var(--warn);
  margin: 0;
  padding: 4px 12px;
  background: var(--warn-bg);
  border-radius: var(--radius-xs);
  font-weight: 500;
  max-width: 260px;
  white-space: normal;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn:disabled:hover {
  color: var(--text-secondary);
  background: transparent;
}

.btn-accent {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.14);
}

.btn-accent:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-hover);
  border-color: rgba(99, 102, 241, 0.22);
}

.btn-accent.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.btn-icon {
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* --- Upload Zone --- */
.upload-zone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent-bg);
  border: 1px solid rgba(124, 92, 252, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--accent);
}

.upload-zone:hover,
.upload-zone.dragover {
  background: rgba(124, 92, 252, 0.14);
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

.upload-icon {
  display: flex;
  color: var(--accent);
}

.upload-icon svg {
  width: 16px;
  height: 16px;
}

.upload-text {
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ===== Main Content ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

/* --- Map --- */
.map-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--bg);
}

#map {
  position: absolute;
  inset: 0;
  overflow: visible;
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

.map-photo-workspace {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  width: min(440px, calc(100% - 24px));
  min-width: 360px;
  min-height: 280px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)),
    radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.16), transparent 34%);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(22px) saturate(180%);
  transition: transform var(--transition), opacity var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.map-photo-workspace-resize {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  z-index: 3;
  border-right: 2px solid rgba(99, 102, 241, 0.55);
  border-bottom: 2px solid rgba(99, 102, 241, 0.55);
  border-radius: 0 0 8px 0;
  cursor: nwse-resize;
  touch-action: none;
}

.map-photo-workspace-resize::before {
  content: '';
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(99, 102, 241, 0.32);
  border-bottom: 2px solid rgba(99, 102, 241, 0.32);
}

.map-photo-workspace.collapsed {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}

.map-photo-workspace-open {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lg);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.map-photo-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.map-photo-workspace-eyebrow {
  margin: 0 0 4px 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.map-photo-workspace-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.map-photo-workspace-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.map-photo-workspace-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.45;
  flex-shrink: 0;
}

.map-workspace-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.map-workspace-stats span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.map-workspace-stats strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.map-workspace-stats small {
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.map-workspace-stats span.is-hot {
  border-color: rgba(220, 38, 38, 0.14);
  background: rgba(254, 242, 242, 0.86);
}

.map-workspace-stats span.is-hot strong {
  color: #b91c1c;
}

.map-workspace-stats em,
.map-workspace-empty-state {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.78);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
}

.map-photo-workspace-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.06);
}

.map-workspace-mode-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.map-workspace-mode-btn strong {
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.map-workspace-mode-btn.active {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.09);
}

.map-workspace-mode-btn.active strong {
  background: var(--accent);
  color: #fff;
}

.map-photo-workspace-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(250, 250, 251, 0.95);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.map-photo-workspace-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.map-photo-workspace-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-right: 2px;
  padding-bottom: 2px;
}

.map-photo-filter-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.map-photo-filter-btn span {
  display: inline-flex;
  min-width: 18px;
  justify-content: center;
  color: var(--text-muted);
}

.map-photo-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.map-photo-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.map-photo-filter-btn.active span {
  color: rgba(255, 255, 255, 0.85);
}

.map-photo-workspace-selected {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(36vh, 340px);
  overflow-y: auto;
  padding-right: 2px;
}

.map-photo-selected-empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px dashed var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.map-photo-selected-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.12);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.map-photo-selected-top {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: start;
}

.map-photo-selected-image {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  background: var(--bg-hover);
  box-shadow: var(--shadow);
}

.map-photo-selected-meta {
  min-width: 0;
}

.map-photo-selected-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.map-photo-selected-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.map-photo-selected-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.map-photo-selected-badges,
.map-photo-list-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.map-photo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.map-photo-chip.is-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.map-photo-chip.is-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.map-photo-chip.is-accent {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-hover);
}

.map-photo-chip.is-muted {
  background: rgba(148, 163, 184, 0.14);
  color: #64748b;
}

.map-photo-selected-address,
.map-photo-selected-restricted {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.map-photo-selected-restricted {
  color: #9a3412;
}

.map-photo-selected-verification {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #f0c36a;
  border-radius: 8px;
  background: #fff8e8;
  color: #744b00;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.map-photo-pick-note {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  color: var(--accent-hover);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
}

.map-photo-selected-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.map-photo-selected-actions .btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding-inline: 10px;
  text-decoration: none;
}

.map-photo-selected-actions .btn:disabled,
.map-photo-selected-nav .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.map-photo-selected-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.map-photo-selected-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.map-photo-selected-form input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(250, 250, 251, 0.98);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}

.map-photo-selected-form button {
  grid-column: 1 / -1;
}

.map-photo-workspace-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 180px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.map-photo-load-more {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: 0 0 auto;
  justify-content: center;
  background: #fff;
  box-shadow: 0 -8px 18px rgba(32, 36, 43, 0.08);
}

.map-photo-workspace-violations {
  flex: 0 0 auto;
  min-height: 0;
}

.map-photo-workspace.is-violations-mode .map-photo-workspace-violations {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.map-photo-workspace.is-violations-mode .violations-panel {
  flex: 1 1 auto;
  min-height: 0;
}

.map-photo-workspace.is-violations-mode .violation-list {
  flex: 1 1 auto;
  max-height: none;
}

.violations-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.94), rgba(255, 255, 255, 0.92));
  box-shadow: 0 10px 24px rgba(120, 53, 15, 0.08);
}

.violations-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.violations-panel-eyebrow {
  margin: 0 0 2px 0;
  color: #b45309;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.violations-panel h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 800;
}

.violations-total {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 800;
}

.violation-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.violation-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid rgba(120, 53, 15, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #92400e;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 800;
  cursor: pointer;
}

.violation-tab span {
  color: rgba(146, 64, 14, 0.7);
}

.violation-tab.active {
  border-color: rgba(217, 119, 6, 0.3);
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.22);
}

.violation-tab.active span {
  color: rgba(255, 255, 255, 0.84);
}

.violation-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 2px;
}

.violation-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.violation-item:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 158, 11, 0.32);
  box-shadow: 0 10px 20px rgba(120, 53, 15, 0.1);
}

.violation-item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.violation-item-title {
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 800;
}

.violation-item-meta {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.violation-item-value {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 900;
  white-space: nowrap;
}

.violation-item.is-danger .violation-item-value {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.violation-item.is-warning .violation-item-value {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.violation-item.is-accent .violation-item-value {
  background: rgba(99, 102, 241, 0.14);
  color: var(--accent-hover);
}

.violation-empty {
  padding: 10px;
  border: 1px dashed rgba(120, 53, 15, 0.2);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.map-photo-list-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.map-photo-list-item:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.24);
  box-shadow: var(--shadow);
}

.map-photo-list-item.active {
  border-color: rgba(99, 102, 241, 0.32);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.map-photo-list-item.no-location {
  border-style: dashed;
}

.map-photo-list-thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: block;
}

.map-photo-route-number {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.22);
  z-index: 2;
}

.map-photo-list-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  background: var(--bg-hover);
}

.map-photo-list-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.map-photo-list-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.map-photo-list-meta {
  margin-top: 4px;
  color: var(--accent-hover);
  font-size: 0.75rem;
  font-weight: 700;
}

.map-photo-list-address {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-photo-list-empty {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--border-strong);
  background: rgba(248, 250, 252, 0.92);
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.map-coordinate-pick-hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 7;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  font-size: 0.8125rem;
  font-weight: 600;
}

.map-coordinate-pick-hint .btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
}

.map-coordinate-pick-hint .btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.map-wrap.is-picking-coordinate #map,
.map-wrap.is-picking-coordinate #map * {
  cursor: crosshair !important;
}

.yandex-photo-marker,
.yandex-cluster-marker {
  position: relative;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

.yandex-photo-marker-frame {
  width: 58px;
  height: 58px;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  border: 3px solid rgba(255, 255, 255, 0.94);
  background-color: #dbe4f0;
  background-size: cover;
  background-position: center;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.24);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.yandex-photo-marker-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  vertical-align: middle;
  pointer-events: none;
}

.yandex-photo-marker-frame.is-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #818cf8, #4f46e5);
}

.yandex-photo-marker-frame.is-fallback svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

.yandex-photo-marker.is-active .yandex-photo-marker-frame,
.yandex-photo-marker:hover .yandex-photo-marker-frame {
  transform: translateY(-4px) scale(1.05);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: 0 18px 34px rgba(79, 70, 229, 0.28);
}

.yandex-photo-marker-caption {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  display: none;
  max-width: 180px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.yandex-photo-marker.is-active .yandex-photo-marker-caption,
.yandex-photo-marker:hover .yandex-photo-marker-caption {
  display: block;
}

.map-endpoint-photo-wrap {
  position: relative;
  z-index: 1150;
}

.map-endpoint-photo {
  position: relative;
  display: inline-flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.map-endpoint-route-number {
  position: absolute;
  top: -9px;
  left: -9px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid #fff;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.28);
  z-index: 2;
  pointer-events: none;
}

.map-endpoint-photo-frame {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px;
  border: 3px solid rgba(255, 255, 255, 0.96);
  background: #dbe4f0;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.28);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.map-endpoint-photo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.map-endpoint-photo-empty {
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.map-endpoint-photo-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #111827;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-endpoint-photo:hover .map-endpoint-photo-frame,
.map-endpoint-photo.is-active .map-endpoint-photo-frame {
  transform: translateY(-3px) scale(1.06);
  border-color: #7c5cfc;
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.32);
}

.map-endpoint-photo.is-warning .map-endpoint-photo-frame {
  border-color: #fecaca;
  box-shadow: 0 18px 38px rgba(127, 29, 29, 0.28);
}

.map-endpoint-photo.is-warning .map-endpoint-photo-pin {
  background: #b91c1c;
}

.map-route-arrow-wrap {
  position: relative;
  z-index: 760;
}

.map-route-arrow {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
  transform: translate(-50%, -50%) rotate(var(--route-bearing));
  pointer-events: none;
}

.map-distance-card-wrap {
  position: relative;
  z-index: 700;
}

.map-distance-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  max-width: 104px;
  padding: 4px 10px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.94);
  color: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  font-family: 'DM Sans', system-ui, sans-serif;
}

.map-distance-card:hover {
  transform: translate(-50%, -50%) translateY(-2px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.34);
  background: rgba(17, 24, 39, 0.96);
}

.map-distance-card.is-warning {
  background: rgba(127, 29, 29, 0.96);
  box-shadow: 0 16px 34px rgba(127, 29, 29, 0.28);
}

.map-distance-photo {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(148, 163, 184, 0.35);
}

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

.map-distance-photo.is-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.map-distance-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.map-distance-card-label {
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.map-distance-card-names {
  display: none;
  max-width: 126px;
  margin-top: 2px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.625rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yandex-cluster-marker {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.yandex-cluster-marker-collage {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  padding: 2px;
}

.yandex-cluster-marker-cell {
  position: relative;
  display: block;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #dbe4f0;
  border-radius: 10px;
}

.yandex-cluster-marker-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.yandex-cluster-marker-cell.is-empty {
  background: linear-gradient(145deg, #c7d2fe, #a5b4fc);
}

.yandex-cluster-marker-count {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.22);
}

/* Popup — поверх карты */
.map-popup {
  position: absolute;
  z-index: 1000;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 0;
  min-width: 120px;
  max-width: 360px;
  pointer-events: auto;
}
.map-popup-close {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  z-index: 1;
}
.map-popup-close:hover {
  color: var(--text);
}
.map-popup-content {
  padding: 12px 28px 12px 12px;
  overflow: visible;
}
.map-popup-content .info-window {
  display: block;
}
.map-popup-content .info-window img,
.map-popup-content .info-window .info-window-photo {
  display: block !important;
  width: 100%;
  max-width: 320px;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #f0f0f0;
}

/* --- Measure Panel --- */
.measure-panel {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9375rem;
  z-index: 5;
  max-width: min(92vw, 520px);
}

.measure-panel #measureText {
  font-weight: 600;
  color: var(--text);
}

/* ===== Photo Strip (Bottom) ===== */
.photo-strip-container {
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  max-height: min(36vh, 340px);
  min-height: 0;
}

.photo-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.photo-strip-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.photo-strip-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.photo-strip-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.photo-strip-count {
  font-size: 0.6875rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.photo-strip-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition), transform var(--transition);
}

.photo-strip-toggle:hover {
  color: var(--text);
}

.photo-strip-toggle.collapsed svg {
  transform: rotate(180deg);
}

.photo-strip-size-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.photo-strip-size-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.photo-strip-scroll {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  flex: 1 1 auto;
  min-height: 0;
}

.photo-strip-container.collapsed .photo-strip-scroll {
  display: none;
}

.photo-strip-container.collapsed .progress-container {
  display: none;
}

.photo-strip-container.collapsed .close-points-warning {
  display: none;
}

.photo-strip-container.strip-compact {
  --thumb-size: 72px;
}

.photo-strip-container.strip-compact .photo-strip-scroll {
  gap: 10px;
  padding: 10px 16px;
}

/* Близкие точки (< 25 м) — предупреждение */
.close-points-warning {
  margin: 10px 12px 12px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--text);
  flex-shrink: 0;
  max-height: 112px;
  overflow-y: auto;
}

.close-points-warning-icon {
  display: inline-block;
  margin-right: 6px;
  color: #d97706;
  font-weight: bold;
}

.close-points-warning-text {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.close-points-warning-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.close-points-warning-list li {
  margin-top: 2px;
}

/* --- Photo Thumbnail --- */
.thumb-wrap {
  width: var(--thumb-size);
  min-width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  cursor: default;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  scroll-snap-align: start;
  background: var(--bg-elevated);
}

.thumb-wrap.has-location {
  border-color: var(--border-strong);
  cursor: pointer;
}

.thumb-wrap.has-location::after {
  content: '';
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--bg-elevated);
  z-index: 2;
}

.thumb-wrap.has-restricted {
  border-color: var(--warn);
}

.thumb-wrap.has-location:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.thumb-wrap.has-restricted:hover {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

.thumb-wrap.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.thumb-wrap.no-location {
  opacity: 0.45;
  border-style: dashed;
}

.thumb-wrap.has-coord-duplicate {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.thumb-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.85;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: color var(--transition), background var(--transition), opacity var(--transition);
}
.thumb-remove-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
  opacity: 1;
}

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

.thumb-route-number {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid #fff;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
  z-index: 4;
  pointer-events: none;
}

.thumb-warn {
  position: absolute;
  top: 32px;
  left: 4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
  z-index: 3;
}

.thumb-dup {
  position: absolute;
  bottom: 4px;
  right: 4px;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.28);
  z-index: 3;
  letter-spacing: 0.02em;
}

.thumb-coords {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 8.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.no-photos {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
  padding: 12px 20px;
  display: none;
  text-align: center;
}

/* ===== Progress Bar ===== */
.progress-container {
  padding: 14px 20px 16px;
  display: none;
  background: var(--bg-elevated, #f8f9fa);
  border-radius: 12px;
  margin: 0 12px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--border, rgba(0,0,0,0.06));
}

.progress-container.active {
  display: block;
}

.progress-steps {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.progress-step {
  color: var(--text-muted);
  opacity: 0.5;
  position: relative;
  transition: opacity 0.2s, color 0.2s;
}

.progress-step::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  vertical-align: middle;
  opacity: 0.5;
}

.progress-step.done {
  color: var(--success, #16a34a);
  opacity: 0.9;
}

.progress-step.done::before {
  content: '✓';
  width: auto;
  height: auto;
  font-size: 10px;
  line-height: 1;
  opacity: 1;
  background: transparent;
}

.progress-step.active {
  color: var(--accent, #7c5cfc);
  opacity: 1;
}

.progress-step.active::before {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--accent);
}

.progress-bar-wrap {
  height: 10px;
  background: rgba(0,0,0,0.07);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #7c5cfc), var(--accent-hover, #9370ff));
  border-radius: 5px;
  transition: width 0.35s ease-out;
  position: relative;
  min-width: 2%;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: progressShimmer 1.5s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  font-size: 0.9375rem;
  color: var(--text);
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
}

.progress-detail {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
  line-height: 1.35;
}

/* ===== Filters Panel ===== */
.filters-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  z-index: 8;
  width: min(320px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: none;
}

.filters-panel.open {
  display: block;
}

.filters-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.filter-radius {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-radius-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-radius-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-radius-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: color var(--transition);
  line-height: 1.35;
}

.filter-checkbox:hover {
  color: var(--text);
}

.filter-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ===== Info Window ===== */
.info-window {
  max-width: 300px;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.info-window img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 10px;
}

.info-details {
  font-size: 0.875rem;
  color: #333;
}

.info-address {
  margin: 0 0 8px 0;
  color: #222;
  font-weight: 500;
}

.info-panorama {
  margin: 8px 0 0 0;
  font-size: 0.8125rem;
}
.info-panorama a {
  color: var(--accent, #7c5cfc);
  text-decoration: none;
}
.info-panorama a:hover {
  text-decoration: underline;
}

.info-coords {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  font-size: 0.8125rem;
  color: #555;
}

.info-copy-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
}

.info-copy-btn:hover {
  border-color: #7c5cfc;
  color: #7c5cfc;
}

.info-restricted {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}

.info-restricted-title {
  font-weight: 700;
  font-size: 0.8125rem;
  color: #991b1b;
  margin-bottom: 6px;
  display: block;
}

.info-restricted-list {
  margin: 0;
  padding-left: 1.25rem;
}

.info-restricted li {
  margin: 4px 0;
  font-size: 0.8125rem;
}

.info-restricted-type {
  display: inline-block;
  font-weight: 600;
  color: #991b1b;
  margin-right: 4px;
}

.info-restricted-vicinity {
  font-size: 0.75rem;
  color: #888;
}

.info-window-restricted {
  padding: 8px 10px;
  min-width: 180px;
}

/* Подпись над точкой интереса на карте (Яндекс) */
.yandex-circle-marker-label {
  font-family: 'DM Sans', system-ui, sans-serif !important;
}

.info-window-restricted strong {
  color: #991b1b;
}

.info-loading {
  margin: 4px 0 0 0;
  color: #999;
  font-size: 0.8125rem;
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
}

.toast.success {
  border-color: var(--success);
  color: var(--success);
}

.toast.out {
  animation: toastOut 0.2s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(12px); }
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  overflow: auto;
}

.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 440px;
  max-height: calc(100vh - 48px);
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  overflow-y: auto;
}

.modal-content h2 {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.modal-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.modal-content .auth-form {
  margin-bottom: 16px;
}

.modal-content .auth-input {
  width: 100%;
  margin-bottom: 8px;
}

.manual-coords-content {
  max-width: 560px;
}

.manual-coords-batch {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.manual-coords-instruction {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
}

.manual-coords-instruction-title {
  margin: 0 0 6px 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.manual-coords-instruction p {
  margin: 0 0 6px 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.manual-coords-instruction p:last-child {
  margin-bottom: 0;
}

.zip-preview-content {
  max-width: 620px;
}

.zip-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.zip-preview-card {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.zip-preview-card span {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.25;
}

.zip-preview-card strong {
  color: var(--text);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.zip-preview-card small {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  word-break: break-word;
}

.zip-preview-card.is-danger {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(254, 242, 242, 0.9);
}

.zip-preview-card.is-warning {
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(255, 251, 235, 0.94);
}

.zip-preview-card.is-success {
  border-color: rgba(16, 185, 129, 0.18);
  background: rgba(236, 253, 245, 0.9);
}

.zip-preview-card.is-muted {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.95);
}

.zip-preview-note {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  background: rgba(99, 102, 241, 0.07);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.zip-preview-note + .zip-preview-note {
  margin-top: 8px;
}

.zip-preview-note code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-hover);
  font-size: 0.78em;
}

.zip-preview-note.is-warning {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(255, 251, 235, 0.95);
  color: #92400e;
}

.zip-preview-actions {
  margin-top: 16px;
}

/* ===== Photo modal (фото по клику на маркер) ===== */
.photo-modal .modal-content.photo-modal-content {
  position: relative;
  max-width: min(900px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.photo-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.photo-modal-close:hover {
  color: var(--text);
  background: var(--bg);
}

.photo-modal-body {
  overflow-y: auto;
  padding: 20px 24px 24px;
}

.photo-modal-body .info-window {
  max-width: none;
}

.photo-modal-body .info-window-photo,
.photo-modal-body .info-window img {
  max-height: min(62vh, 680px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 14px;
  display: block;
}

.photo-modal-body .info-edit-coords {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e0e0e0);
}
.photo-modal-body .info-edit-coords-trigger {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.875rem;
  color: var(--primary, #7c5cfc);
  background: none;
  border: 1px solid var(--primary, #7c5cfc);
  border-radius: 6px;
  cursor: pointer;
}
.photo-modal-body .info-edit-coords-trigger:hover {
  background: var(--primary, #7c5cfc);
  color: #fff;
}
.photo-modal-body .info-edit-coords-form {
  margin-top: 10px;
}
.photo-modal-body .info-edit-coords-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
}
.photo-modal-body .info-edit-coords-form input {
  width: 100%;
  max-width: 260px;
  margin-top: 4px;
  margin-left: 0;
  padding: 6px 8px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 4px;
}
.photo-modal-body .info-edit-coords-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.photo-modal-body .info-edit-coords-apply {
  padding: 6px 14px;
  font-size: 0.875rem;
  background: var(--primary, #7c5cfc);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.photo-modal-body .info-edit-coords-map {
  padding: 6px 14px;
  font-size: 0.875rem;
  background: transparent;
  color: var(--primary, #7c5cfc);
  border: 1px solid var(--primary, #7c5cfc);
  border-radius: 6px;
  cursor: pointer;
}
.photo-modal-body .info-edit-coords-apply:hover {
  opacity: 0.9;
}
.photo-modal-body .info-edit-coords-map:hover {
  background: rgba(124, 92, 252, 0.08);
}

.photo-modal-body .info-remove-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e0e0e0);
}
.photo-modal-body .info-remove-btn {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.875rem;
  color: var(--danger);
  background: none;
  border: 1px solid var(--danger);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.photo-modal-body .info-remove-btn:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ===== Upload confirm modal ===== */
.upload-confirm-modal {
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.upload-confirm-content {
  max-width: 520px;
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.upload-confirm-title {
  margin: 0 0 4px 0;
  font-size: 1.25rem;
}
.upload-confirm-hint {
  margin: 0 0 16px 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.upload-import-dropzone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.upload-import-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.upload-import-dropzone-title {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.upload-import-links {
  margin-bottom: 12px;
}
.upload-import-urls-input {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  margin-bottom: 8px;
}
.upload-import-errors {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: var(--radius-xs);
}
.upload-import-errors-title {
  margin: 0 0 6px 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #991b1b;
}
.upload-import-errors-list {
  margin: 0;
  padding-left: 18px;
  max-height: 140px;
  overflow: auto;
}
.upload-import-errors-list li {
  margin-bottom: 4px;
  color: #7f1d1d;
  font-size: 0.8125rem;
}
.upload-import-errors-list code {
  color: #991b1b;
  font-size: 0.75rem;
}
.upload-import-errors-more {
  margin: 6px 0 0 0;
  color: #7f1d1d;
  font-size: 0.75rem;
}
.upload-confirm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
  max-height: 42vh;
  padding: 4px 0;
}
.upload-confirm-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg-hover);
}
.upload-confirm-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.upload-confirm-name {
  padding: 4px 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-confirm-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.9;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: color var(--transition), background var(--transition);
}
.upload-confirm-remove:hover {
  color: var(--danger);
  background: var(--danger-bg);
}
.upload-confirm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.upload-confirm-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.upload-confirm-actions {
  display: flex;
  gap: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .map-photo-workspace {
    width: min(340px, calc(100% - 24px));
  }

  .header-actions .btn,
  .header-actions .upload-zone {
    padding-inline: 12px;
  }
}

@media (max-width: 960px) {
  .header-actions {
    justify-content: flex-start;
  }

  .header-actions .btn,
  .header-actions .upload-zone {
    flex: 1 1 auto;
    justify-content: center;
  }

  .header-point-count {
    order: -2;
  }

  .api-warn {
    order: -3;
    flex: 1 1 100%;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .header {
    height: auto;
    padding: 10px 12px;
  }

  .header-inner {
    align-items: stretch;
    gap: 10px;
  }

  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .header-actions .btn,
  .header-actions .upload-zone {
    min-height: 40px;
  }

  .brand {
    flex-direction: column;
    gap: 0;
  }

  .photo-strip-scroll {
    padding: 10px 12px;
    gap: 8px;
  }

  .photo-strip-container {
    max-height: min(42vh, 360px);
  }

  .photo-strip-header {
    align-items: stretch;
    padding: 8px 12px;
  }

  .photo-strip-left,
  .photo-strip-controls {
    width: 100%;
  }

  .photo-strip-controls .btn,
  .photo-strip-size-btn {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  .filters-panel {
    left: 12px;
    right: 12px;
    width: auto;
    min-width: unset;
    max-height: min(70vh, calc(100% - 24px));
  }

  .map-photo-workspace {
    left: 12px;
    right: 12px;
    width: auto !important;
    min-width: 0;
    height: auto !important;
    max-height: min(72vh, calc(100% - 24px));
    padding: 12px;
    gap: 10px;
  }

  .map-photo-workspace-resize {
    display: none;
  }

  .map-photo-workspace-selected {
    order: 2;
  }

  .map-photo-workspace-violations {
    order: 3;
  }

  .map-photo-workspace-list {
    order: 4;
    flex-basis: 120px;
  }

  .map-photo-selected-top {
    grid-template-columns: 72px 1fr;
  }

  .map-photo-selected-image {
    width: 72px;
    height: 72px;
  }

  .map-photo-selected-form {
    grid-template-columns: 1fr;
  }

  .map-photo-selected-actions .btn {
    flex-basis: calc(50% - 4px);
  }

  .map-coordinate-pick-hint {
    left: 12px;
    right: 12px;
    bottom: 16px;
    transform: none;
    border-radius: 18px;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .thumb-wrap {
    --thumb-size: 60px;
  }

  .photo-strip-container.strip-compact .thumb-wrap {
    --thumb-size: 54px;
  }

  .modal {
    padding: 12px;
    align-items: flex-start;
  }

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

  .photo-modal .modal-content.photo-modal-content {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .photo-modal-body {
    padding: 18px 14px 18px;
  }

  .upload-confirm-footer,
  .upload-confirm-actions {
    width: 100%;
  }

  .upload-confirm-actions .btn {
    flex: 1 1 0;
  }

  .zip-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .header-point-count,
  .header-actions .btn,
  .upload-text {
    font-size: 0.75rem;
  }

  .header-actions .btn,
  .header-actions .upload-zone {
    flex-basis: calc(33.333% - 4px);
    padding-inline: 8px;
  }

  .header-point-count {
    flex: 1 1 100%;
    text-align: center;
  }

  .map-photo-selected-top {
    grid-template-columns: 64px 1fr;
  }

  .map-photo-selected-image,
  .map-photo-list-thumb,
  .map-photo-list-thumb-wrap {
    width: 64px;
    height: 64px;
  }

  .map-photo-list-item {
    grid-template-columns: 64px 1fr;
  }

  .map-photo-workspace-filters {
    max-height: 74px;
  }

  .map-photo-filter-btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }

  .violation-list {
    max-height: 150px;
  }

  .zip-preview-grid {
    grid-template-columns: 1fr;
  }

  .map-photo-selected-actions .btn {
    flex-basis: 100%;
  }

  .close-points-warning {
    margin: 8px;
    max-height: 92px;
  }

  .progress-steps {
    gap: 8px;
    flex-wrap: wrap;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}
/* Геоконтроль: operational cartography layer */
:root { --bg:#f4f2ed; --bg-elevated:#fff; --border:#deddd8; --border-strong:#c7c7c1; --text:#20242b; --text-secondary:#58616f; --text-muted:#747d89; --accent:#1746a2; --accent-hover:#10377f; --accent-bg:rgba(23,70,162,.07); --accent-glow:rgba(23,70,162,.16); --radius:8px; --radius-sm:6px; }
body { font-family:system-ui,-apple-system,"Segoe UI",sans-serif; background:var(--bg); color:var(--text); }
:where(button,input,select,summary,[tabindex]):focus-visible { outline:3px solid rgba(23,70,162,.3); outline-offset:2px; }
.header { background:#fff; border-bottom:1px solid var(--border-strong); box-shadow:none; }
.header-inner { min-height:64px; max-width:none; padding:8px 16px; display:flex; align-items:center; gap:20px; }
.product-brand { display:flex; align-items:center; gap:10px; min-width:245px; }
.product-mark { display:grid; place-items:center; width:36px; height:36px; background:var(--accent); color:#fff; border-radius:4px; font-size:12px; font-weight:800; }
.product-brand strong,.product-brand small { display:block; }.product-brand small { color:var(--text-muted); font-size:11px; }
.header-actions { margin-left:auto; }.upload-zone { background:var(--accent); border-color:var(--accent); color:#fff; border-radius:5px; font-weight:700; }
.map-photo-workspace { border:1px solid var(--border-strong); border-radius:7px; box-shadow:0 12px 32px rgba(32,36,43,.16); background:#fff; }
.map-photo-workspace-eyebrow { color:var(--accent); font-size:10px; font-weight:800; letter-spacing:.11em; text-transform:uppercase; }
.map-photo-list-item,.map-photo-selected-card { border-radius:5px; box-shadow:none; }.map-photo-list-item.active { border-left:4px solid var(--accent); background:var(--accent-bg); }
.map-photo-chip { border-radius:3px; font-weight:650; }.map-photo-chip.is-danger { background:#fff1f0; color:#b42318; }
.modal-content { border:1px solid var(--border-strong); border-radius:8px; box-shadow:0 24px 64px rgba(22,26,33,.24); }
.settings-section { border-top:1px solid var(--border); padding:18px 0 4px; margin-top:18px; }.settings-section h3 { margin:0 0 12px; font-size:13px; text-transform:uppercase; letter-spacing:.08em; }
.settings-toggle,.settings-status { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:12px; background:#faf9f6; border:1px solid var(--border); border-radius:5px; }
.settings-toggle span,.settings-toggle small,.settings-status span,.settings-status small { display:block; }.settings-toggle small,.settings-status small { color:var(--text-muted); margin-top:2px; }
.status-dot { width:9px; height:9px; flex:0 0 9px; border-radius:50%; background:#2f855a; }.settings-status { justify-content:flex-start; margin:12px 0; }
.settings-advanced { margin:14px 0; border:1px solid var(--border); border-radius:5px; padding:11px 12px; }.settings-advanced summary { cursor:pointer; font-weight:650; }
.manual-coords-tabs { display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:4px; margin:16px 0; background:#ecebe6; border-radius:6px; }
.manual-coords-tab { min-height:40px; border:0; border-radius:4px; background:transparent; color:var(--text-secondary); font:inherit; font-weight:650; cursor:pointer; }.manual-coords-tab.active { background:#fff; color:var(--accent); box-shadow:0 1px 3px rgba(32,36,43,.12); }
[hidden] { display:none!important; }
@media(max-width:760px){.header-inner{align-items:flex-start;flex-wrap:wrap;padding:8px 10px;gap:8px}.product-brand{min-width:0;flex:1}.product-brand small{display:none}.header-actions{width:100%;flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start}.header-actions>*{flex:0 0 auto}.map-photo-workspace{inset:auto 0 0!important;width:100%!important;height:min(78vh,680px);max-width:none;border-radius:8px 8px 0 0}.modal-content{width:calc(100vw - 16px);max-height:calc(100vh - 16px);margin:8px;padding:20px}}
.auth-product{display:flex;align-items:flex-start;gap:14px;padding-bottom:22px;margin-bottom:22px;border-bottom:1px solid var(--border)}.auth-product .auth-subtitle{margin:3px 0 0}.auth-field{display:grid;gap:6px;font-size:13px;font-weight:650}.auth-field .auth-input{width:100%}

/* Observable background verification */
.browser-check-progress {
  margin: 12px;
  padding: 13px;
  min-width: 0;
  border: 1px solid #b8c8e6;
  border-left: 4px solid var(--accent);
  border-radius: 5px;
  background: #f6f8fc;
  color: var(--text);
}
.browser-check-progress.is-done { border-color: #b8d8c5; border-left-color: #2f855a; background: #f5faf7; }
.browser-check-progress.is-failed { border-color: #e7b9b5; border-left-color: #b42318; background: #fff7f6; }
.browser-check-progress-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.browser-check-progress-head > div { min-width: 0; }
.browser-check-progress-head strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.browser-check-kicker { display: block; margin-bottom: 2px; color: var(--text-secondary); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.browser-check-percent { flex: 0 0 auto; color: var(--accent); font: 800 20px/1 system-ui,-apple-system,"Segoe UI",sans-serif; letter-spacing: -.04em; }
.browser-check-coords { display: block; margin: 9px 0 8px; overflow-wrap: anywhere; color: var(--text-secondary); font-size: 11px; }
.browser-check-progress progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 2px; overflow: hidden; accent-color: var(--accent); }
.browser-check-progress progress::-webkit-progress-bar { background: #dfe5ef; }
.browser-check-progress progress::-webkit-progress-value { background: var(--accent); }
.browser-check-progress-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.browser-check-progress-meta span { min-width: 0; }
.browser-check-progress-meta strong,.browser-check-progress-meta small { display: block; }
.browser-check-progress-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.browser-check-progress-meta small { color: var(--text-secondary); font-size: 11px; }
.browser-check-query { min-width: 0; margin: 10px 0 0; padding-top: 9px; border-top: 1px solid var(--border); }
.browser-check-query span,.browser-check-query strong { display: block; }
.browser-check-query span { color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.browser-check-query strong { margin-top: 2px; overflow-wrap: anywhere; font-size: 11px; }
.browser-check-error { margin: 8px 0 0; color: #b42318; font-size: 11px; }
.browser-check-live-status { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:560px){.map-photo-workspace-selected:has(.browser-check-progress){max-height:370px}.browser-check-progress{margin:8px}.browser-check-query{margin-top:8px}}
@media(max-width:420px){.browser-check-progress{margin:8px;padding:11px}.browser-check-progress-meta{gap:5px}.browser-check-percent{font-size:18px}}

/* Restricted results: one object, one readable map treatment */
.map-restricted-inline-wrap {
  position: relative;
  z-index: 12;
  transform: translate(24px,-34px);
  pointer-events: auto;
}
.map-restricted-inline-offset-1 { transform: translate(24px,-62px); }
.map-restricted-inline-offset-2 { transform: translate(24px,-90px); }
.map-restricted-inline-offset-3 { transform: translate(24px,-118px); }
.map-restricted-inline-label {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 8px;
  border: 1px solid #fff;
  border-radius: 4px;
  background: #b42318;
  box-shadow: 0 2px 8px rgba(32,36,43,.22);
  color: #fff;
  font: 700 11px/1.25 system-ui,-apple-system,"Segoe UI",sans-serif;
  cursor: pointer;
}
.map-photo-selected-restricted { display: grid; gap: 2px; padding-left: 9px; border-left: 3px solid #b42318; }
.map-photo-selected-restricted strong { color: #b42318; font-size: 12px; }
.map-photo-selected-restricted span { color: var(--text-secondary); font-size: 11px; line-height: 1.35; }
.map-photo-selected-actions { display:grid; grid-template-columns:1fr!important; gap:7px; }
.map-photo-action-group { display:flex; flex-wrap:wrap; gap:6px; min-width:0; }
.map-photo-action-group .btn { flex:1 1 auto; min-width:0; }
.map-photo-action-group.is-coordinate-actions { padding-top:7px; border-top:1px solid var(--border); }
.map-photo-action-group.is-coordinate-actions .btn-accent { flex-basis:100%; }
@media(max-width:420px){
  .map-photo-workspace :where(small,.map-photo-chip,.map-photo-workspace-eyebrow,.map-photo-list-meta,.map-photo-list-address,.map-photo-selected-counter){font-size:11px!important}
  .map-restricted-inline-label{max-width:180px}
  .map-photo-action-group .btn{font-size:11px;min-height:36px;padding-inline:8px}
}
.batch-nbox-section {
  margin-top:14px;
  padding-top:13px;
  border-top:1px solid var(--border);
}
.batch-nbox-section-head,
.batch-nbox-results-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.batch-nbox-section h3,
.batch-nbox-results h3 {
  margin:0;
  font-size:13px;
}
.batch-nbox-section-head > span {
  color:var(--text-muted);
  font-size:11px;
}
.batch-nbox-scopes {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  margin-top:9px;
}
.batch-nbox-scope {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-width:0;
  min-height:38px;
  padding:7px 9px;
  border:1px solid var(--border-strong);
  border-radius:5px;
  background:#fff;
  color:var(--text-secondary);
  font:inherit;
  font-size:12px;
  font-weight:650;
  line-height:1.2;
  text-align:left;
  cursor:pointer;
}
.batch-nbox-scope span {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.batch-nbox-scope strong {
  display:grid;
  place-items:center;
  flex:0 0 auto;
  min-width:24px;
  min-height:22px;
  padding:2px 5px;
  border-radius:4px;
  background:#eef0f3;
  color:var(--text);
  font-size:11px;
}
.batch-nbox-scope:hover:not(:disabled) { border-color:#8096ba; background:#f7f9fc; }
.batch-nbox-scope.is-selected { border-width:2px; padding:6px 8px; }
.batch-nbox-scope.is-clean.is-selected { border-color:#15704f; background:#f2faf6; color:#11583f; }
.batch-nbox-scope.is-clean.is-selected strong { background:#d9f0e4; color:#11583f; }
.batch-nbox-scope.is-violations.is-selected { border-color:#b42318; background:#fff4f2; color:#8f1c14; }
.batch-nbox-scope.is-violations.is-selected strong { background:#f9dcd8; color:#8f1c14; }
.batch-nbox-scope.is-review.is-selected { border-color:#b26a00; background:#fff8eb; color:#7e4c00; }
.batch-nbox-scope.is-review.is-selected strong { background:#f5e4be; color:#7e4c00; }
.batch-nbox-scope.is-all.is-selected { border-color:var(--accent); background:var(--accent-bg); color:var(--accent); }
.batch-nbox-scope.is-all.is-selected strong { background:#dce5f7; color:var(--accent); }
.batch-nbox-scope:disabled { opacity:.42; cursor:not-allowed; }
.batch-nbox-upload {
  width:100%;
  min-height:42px;
  margin-top:8px;
  border-color:#156b52;
  background:#fff;
  color:#156b52;
  font-size:13px;
  font-weight:750;
}
.batch-nbox-upload:hover:not(:disabled) { background:#f1faf6; border-color:#0f5a44; color:#0f5a44; }
.batch-nbox-results {
  margin-top:14px;
  padding-top:13px;
  border-top:1px solid var(--border);
}
.batch-nbox-results[hidden] { display:none; }
.batch-nbox-results-head > div { min-width:0; }
.batch-nbox-results-head p {
  margin:3px 0 0;
  color:var(--text-secondary);
  font-size:11px;
}
.batch-nbox-copy-all {
  flex:0 0 auto;
  min-height:34px;
  border-color:var(--accent);
  color:var(--accent);
  font-weight:700;
}
.batch-nbox-copy-feedback {
  display:block;
  min-height:16px;
  margin-top:4px;
  color:#15704f;
  font-size:11px;
  font-weight:700;
  opacity:0;
  transition:opacity .12s ease;
}
.batch-nbox-copy-feedback.is-visible { opacity:1; }
.batch-nbox-results ol {
  display:grid;
  gap:5px;
  margin:4px 0 0;
  padding:0;
  list-style:none;
}
.batch-nbox-row {
  display:grid;
  grid-template-columns:26px minmax(0,1fr) 34px;
  align-items:center;
  gap:7px;
  min-width:0;
  padding:6px 7px;
  border:1px solid var(--border);
  border-radius:4px;
  background:#f8f9fb;
}
.batch-nbox-number {
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:4px;
  background:#e6ebf5;
  color:#173a70;
  font-size:11px;
  font-weight:800;
}
.batch-nbox-row-main {
  display:grid;
  min-width:0;
  gap:2px;
}
.batch-nbox-row-main a {
  overflow:hidden;
  color:var(--accent);
  font-size:12px;
  font-weight:650;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.batch-nbox-row-main code {
  overflow:hidden;
  color:var(--text-secondary);
  font-size:11px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.batch-nbox-row-copy {
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  padding:0;
  border:1px solid #b7c2d3;
  border-radius:4px;
  background:#fff;
  color:#173a70;
  cursor:pointer;
}
.batch-nbox-row-copy:hover { border-color:var(--accent); background:#f1f5fb; }
.batch-nbox-row-copy.is-copied { border-color:#15704f; background:#edf8f2; color:#15704f; }
.batch-nbox-errors {
  min-width:0;
  max-width:100%;
  margin-top:10px;
  padding:8px 9px;
  border-left:3px solid #b42318;
  background:#fff4f2;
  color:#8f1c14;
  font-size:11px;
  overflow-wrap:anywhere;
}
.batch-nbox-errors strong { display:block; }
.batch-nbox-errors ul { display:grid; min-width:0; max-width:100%; gap:4px; margin:5px 0 0; padding-left:16px; }
.batch-nbox-errors li { min-width:0; max-width:100%; overflow-wrap:anywhere; word-break:break-word; }
.batch-nbox-errors li span,
.batch-nbox-errors li small { display:block; min-width:0; max-width:100%; overflow-wrap:anywhere; word-break:break-word; }
.batch-nbox-errors li small { margin-top:1px; color:#a33a32; }
@media(max-width:420px) {
  .batch-nbox-scopes { grid-template-columns:1fr 1fr; gap:5px; }
  .batch-nbox-scope { min-height:40px; padding-inline:7px; font-size:11px; }
  .batch-nbox-scope.is-selected { padding-inline:6px; }
  .batch-nbox-results-head { align-items:stretch; flex-direction:column; }
  .batch-nbox-copy-all { width:100%; }
  .batch-nbox-row { grid-template-columns:24px minmax(0,1fr) 36px; padding:6px 5px; }
  .batch-nbox-row-copy { width:34px; height:34px; }
}

/* Refined product identity and help */
.product-brand{min-width:auto}.product-mark{width:32px;height:32px;flex-basis:32px;border-radius:50%;background:#163a70;font-size:14px}
.header-help{min-height:36px;white-space:nowrap;color:#173a70;border-color:#b8c7dd;background:#fff}
.header-settings{display:grid;place-items:center;width:36px;height:36px;min-width:36px;padding:0;font-size:17px;color:#173a70;border-color:#b8c7dd;background:#fff}
.upload-zone{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:7px 13px;border:1px solid #9eb3d4;border-radius:6px;background:#f3f6fb!important;color:#173a70!important;box-shadow:0 1px 2px rgba(23,58,112,.08)}
.upload-zone:hover{background:#e9eff8!important;border-color:#6e8fbe;transform:translateY(-1px)}.upload-icon{display:grid;place-items:center;width:24px;height:24px;border-radius:4px;background:#173a70;color:#fff}
.help-content{position:relative;max-width:460px}.help-content>.modal-x{position:absolute;right:16px;top:16px}.help-content ol{display:grid;gap:12px;margin:18px 0 0;padding:0;counter-reset:help;list-style:none}
.help-content li{position:relative;padding-left:36px}.help-content li:before{counter-increment:help;content:counter(help);position:absolute;left:0;top:0;display:grid;place-items:center;width:24px;height:24px;border-radius:4px;background:#173a70;color:#fff;font-size:11px;font-weight:800}
.help-content li strong,.help-content li span{display:block;font-size:12px}.help-content li span{margin-top:2px;color:var(--text-secondary)}
.batch-progress-card{position:relative}.batch-progress-cancel{position:absolute;right:14px;top:14px;width:34px;height:34px;border:1px solid var(--border);border-radius:5px;background:#fff;color:var(--text-secondary);font-size:22px;cursor:pointer}
.batch-progress-cancel:hover{border-color:#b42318;color:#b42318}.batch-progress-coffee>span{display:inline-block;margin-right:5px;font-size:16px}

/* Blocking state only for full batch processing */
.app.is-batch-processing { filter:blur(3px) brightness(.72); pointer-events:none; user-select:none; transition:filter .18s ease; }
.batch-progress-modal {
  position:fixed; inset:0; z-index:10000; display:grid; place-items:center; padding:18px;
  background:rgba(23,28,37,.42);
}
.batch-progress-modal[hidden] { display:none; }
.batch-progress-card {
  width:min(460px,100%); max-height:calc(100vh - 36px); overflow-x:hidden; overflow-y:auto; padding:24px;
  border:1px solid var(--border-strong); border-radius:8px; background:#fff;
  box-shadow:0 24px 70px rgba(20,27,39,.3);
}
.batch-progress-kicker { margin:0 0 4px; color:var(--accent); font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.batch-progress-card h2 { margin:0 0 18px; font-size:22px; letter-spacing:-.03em; }
.batch-progress-count { display:flex; align-items:end; justify-content:space-between; gap:12px; margin-bottom:8px; }
.batch-progress-count strong { font-size:24px; letter-spacing:-.04em; }.batch-progress-count span { color:var(--accent); font-size:16px; font-weight:800; }
.batch-progress-card progress { display:block; width:100%; height:10px; accent-color:var(--accent); }
.batch-progress-info { display:grid; grid-template-columns:1.4fr 1fr .8fr; gap:10px; margin:16px 0; }
.batch-progress-info div { min-width:0; }.batch-progress-info dt { color:var(--text-muted); font-size:11px; }.batch-progress-info dd { margin:2px 0 0; overflow:hidden; text-overflow:ellipsis; font-size:12px; font-weight:700; }
.batch-progress-status { margin:0; color:var(--text-secondary); font-size:12px; }
.batch-progress-coffee { margin:14px 0 0; padding:10px; border-left:3px solid #d88b16; background:#fff9ed; color:var(--text-secondary); font-size:12px; }
.batch-progress-summary { min-width:0; max-width:100%; margin:16px 0 12px; padding-top:14px; border-top:1px solid var(--border); font-size:12px; overflow-wrap:anywhere; }
.batch-progress-summary p { margin:8px 0 4px; }
.batch-progress-summary ul { min-width:0; max-width:100%; margin:0; padding-left:20px; color:var(--text-secondary); }
.batch-progress-summary li { min-width:0; max-width:100%; overflow-wrap:anywhere; word-break:break-word; }
.batch-progress-card > .btn { width:100%; margin-top:12px; min-height:42px; }
.export-action-group,.batch-export-actions { display:flex; flex-wrap:wrap; gap:5px; }
.export-action-group .btn,.batch-export-actions .btn { flex:1 1 auto; min-width:0; font-size:11px; }
.batch-export-actions { margin-top:8px; }.batch-export-actions[hidden]{display:none}
@media(max-width:420px){.batch-progress-card{padding:19px}.batch-progress-info{grid-template-columns:1fr 1fr}.batch-progress-info div:first-child{grid-column:1/-1}.batch-progress-card h2{font-size:19px}}

/* Evaluation refinements: reachable controls, denser master, legal map safe-area */
.workspace-export-bar {
  display:grid; grid-template-columns:.8fr 1fr 1.55fr; gap:4px; padding:6px 10px;
  border-bottom:1px solid var(--border); background:#faf9f6;
}
.workspace-export-bar .btn { min-width:0; min-height:36px; padding:5px 6px; white-space:normal; font-size:11px; line-height:1.15; }
@media(max-width:760px){
  .header-actions {
    scroll-snap-type:x mandatory;
    scroll-padding-inline:8px;
    scrollbar-width:thin;
    scrollbar-color:var(--border-strong) transparent;
    mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 26px),transparent 100%);
    padding-right:30px;
  }
  .header-actions > * { scroll-snap-align:start; scroll-snap-stop:always; }
}
@media(max-width:420px){
  .map-photo-workspace {
    inset:auto 0 56px 0!important;
    height:min(82vh,738px)!important;
    max-height:calc(100vh - 116px)!important;
  }
  .map-photo-workspace-header{padding:9px 11px}
  .map-photo-workspace-title{font-size:16px}
  .map-photo-workspace-modes{padding:5px 8px}
  .map-photo-workspace-search{margin:5px 8px;width:calc(100% - 16px);min-height:34px;padding-block:6px}
  .map-photo-workspace-filters{padding:4px 8px;gap:3px}
  .map-photo-filter-btn{min-height:30px;padding:4px 6px}
  .workspace-export-bar{padding:5px 8px}
  .workspace-export-bar .btn{min-height:34px}
  .map-photo-workspace:not(.is-detail-view) .map-photo-list-item{min-height:58px;padding:4px 8px;gap:7px}
  .map-photo-workspace:not(.is-detail-view) .map-photo-list-thumb-wrap,
  .map-photo-workspace:not(.is-detail-view) .map-photo-list-thumb{width:48px;height:48px;min-width:48px}
  .map-photo-workspace:not(.is-detail-view) .map-photo-chip{padding:1px 4px}
}

/* Compact master-detail queue */
.map-photo-workspace:not(.is-detail-view) .map-photo-workspace-list { flex:1 1 auto; min-height:160px; }
.map-photo-workspace:not(.is-detail-view) .map-photo-list-item {
  min-height:68px;
  padding:7px 9px;
  gap:9px;
  border:0;
  border-bottom:1px solid var(--border);
  border-radius:0;
}
.map-photo-workspace:not(.is-detail-view) .map-photo-list-item:hover { background:#f7f8fa; }
.map-photo-workspace:not(.is-detail-view) .map-photo-list-item.active { border-left:3px solid var(--accent); background:#f3f6fb; }
.map-photo-workspace:not(.is-detail-view) .map-photo-list-thumb-wrap,
.map-photo-workspace:not(.is-detail-view) .map-photo-list-thumb { width:52px; height:52px; min-width:52px; border-radius:4px; }
.map-photo-workspace:not(.is-detail-view) .map-photo-list-body { min-width:0; gap:2px; }
.map-photo-workspace:not(.is-detail-view) .map-photo-list-title { font-size:12px; line-height:1.2; }
.map-photo-workspace:not(.is-detail-view) .map-photo-list-meta { font-size:11px; line-height:1.2; color:var(--text-muted); }
.map-photo-workspace:not(.is-detail-view) .map-photo-list-badges { display:flex; gap:3px; overflow:hidden; white-space:nowrap; }
.map-photo-workspace:not(.is-detail-view) .map-photo-chip { flex:0 0 auto; max-width:145px; overflow:hidden; text-overflow:ellipsis; padding:2px 5px; font-size:11px; }
.map-photo-workspace.is-detail-view .map-photo-workspace-list { display:block!important; flex:1 1 auto; min-height:0; overflow-y:auto; padding:0; }
.point-detail-view { display:grid; gap:0; padding:0; border:0; background:#fff; }
.point-detail-toolbar {
  position:sticky; top:0; z-index:5; display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:8px;
  padding:9px 11px; border-bottom:1px solid var(--border); background:#fff;
}
.point-detail-toolbar > span { color:var(--text-secondary); font-size:11px; white-space:nowrap; }
.point-detail-toolbar > div { display:flex; gap:4px; }
.point-detail-back { justify-self:start; font-weight:700; color:var(--accent); }
.point-detail-view .map-photo-selected-top { padding:14px 12px; border-bottom:1px solid var(--border); }
.point-detail-view .map-photo-selected-image { width:76px; height:76px; border-radius:5px; }
.point-detail-view .map-photo-selected-title { margin:0; font-size:16px; line-height:1.2; }
.point-detail-coordinates {
  display:block; max-width:100%; margin:4px 0; padding:0; border:0; background:transparent;
  color:var(--accent); font:600 11px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace; cursor:pointer;
  overflow-wrap:anywhere; text-align:left;
}
.point-detail-section { padding:13px 12px; border-bottom:1px solid var(--border); }
.point-detail-section h4 {
  display:flex; align-items:center; justify-content:space-between; margin:0 0 9px;
  font-size:12px; line-height:1.2; text-transform:uppercase; letter-spacing:.05em;
}
.point-detail-section h4 span { color:var(--text-muted); font-size:11px; }
.restricted-detail-row { padding:9px 0; border-top:1px solid var(--border); }
.restricted-detail-row:first-of-type { border-top:0; padding-top:0; }
.restricted-detail-heading,.restricted-detail-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.restricted-detail-heading span { color:#b42318; font-size:11px; font-weight:750; }
.restricted-detail-heading strong { flex:0 0 auto; color:#b42318; font-size:13px; }
.restricted-detail-row h5 { margin:3px 0; font-size:13px; line-height:1.25; }
.restricted-detail-row p { margin:0 0 6px; color:var(--text-secondary); font-size:11px; line-height:1.35; }
.restricted-detail-foot span { color:var(--text-secondary); font-size:11px; }
.restricted-detail-foot a { color:var(--accent); font-size:11px; font-weight:650; }
.point-detail-empty { margin:0; color:var(--text-secondary); font-size:11px; line-height:1.4; }
.point-detail-empty.is-clear { padding:8px; border-left:3px solid #15704f; background:#f2faf6; color:#11583f; }
.point-detail-empty.is-clear strong,.point-detail-empty.is-clear span { display:block; }
.point-detail-empty.is-clear span { margin-top:2px; color:#3f6f5d; }
.point-detail-issues { display:grid; gap:7px; margin:0; padding:0; list-style:none; }
.point-detail-issues li { padding:8px; border-left:3px solid #d88b16; background:#fff9ed; }
.point-detail-issues strong,.point-detail-issues span { display:block; font-size:11px; line-height:1.35; }
.point-detail-issues span { margin-top:2px; color:var(--text-secondary); }
.point-detail-view .browser-check-progress { margin:12px; }
.point-detail-view .map-photo-selected-actions,.point-detail-view .map-photo-selected-form { margin:0 12px 12px; }
@media(max-width:420px){
  .map-photo-workspace:not(.is-detail-view) .map-photo-list-item{min-height:66px}
  .point-detail-toolbar{padding-inline:9px}
  .point-detail-view .map-photo-selected-top{grid-template-columns:64px 1fr}
  .point-detail-view .map-photo-selected-image{width:64px;height:64px}
}

/* Compact photo queue: keep the map usable when the list is long. */
@media (max-width: 1100px) {
  .map-photo-workspace {
    inset: 8px auto 8px 8px !important;
    width: min(420px, calc(100% - 16px)) !important;
    height: auto !important;
    max-width: none;
    max-height: none;
    padding: 12px;
    gap: 8px;
  }

  .map-photo-workspace-summary {
    display: none;
  }

  .map-photo-workspace-selected {
    max-height: 220px;
    flex: 0 0 auto;
  }

  .map-photo-selected-card {
    gap: 8px;
    padding: 10px;
  }

  .map-photo-selected-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-photo-selected-actions .btn {
    padding: 7px 6px;
    font-size: 0.72rem;
  }

  .map-photo-selected-form {
    display: none;
  }

  .map-photo-workspace-list {
    flex: 1 1 auto;
    min-height: 120px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .photo-strip-container {
    max-height: 52px;
  }

  .photo-strip-scroll,
  .photo-strip-container .close-points-warning {
    display: none;
  }

  .photo-strip-header {
    min-height: 52px;
  }
}

@media (max-width: 560px) {
  .map-photo-workspace {
    inset: auto 0 0 0 !important;
    width: 100% !important;
    height: min(72vh, 640px) !important;
    border-radius: 8px 8px 0 0;
  }

  .map-photo-workspace-selected {
    max-height: 190px;
  }

  .map-photo-selected-image {
    width: 56px;
    height: 56px;
  }

  .map-photo-selected-top {
    grid-template-columns: 56px 1fr;
  }
}

/* Final mobile layout overrides */
@media (max-width: 520px) {
  .header-actions {
    flex-wrap: wrap;
    overflow: visible;
    padding-right: 0;
    mask-image: none;
    gap: 6px;
  }

  .header-point-count,
  #rulerBtn,
  #panoramaBtn {
    display: none;
  }

  .header-actions .btn,
  .header-actions .upload-zone {
    flex: 0 1 auto;
  }

  .map-photo-workspace {
    inset: 0 0 56px 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 8px !important;
    gap: 5px !important;
  }

  .map-photo-workspace:not(.is-detail-view) .map-photo-list-item {
    min-height: 52px;
    padding: 3px 7px;
    gap: 6px;
  }

  .map-photo-workspace:not(.is-detail-view) .map-photo-workspace-list {
    gap: 3px;
  }

  .map-photo-workspace:not(.is-detail-view) .map-photo-list-thumb-wrap,
  .map-photo-workspace:not(.is-detail-view) .map-photo-list-thumb {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
}
