:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #5f5f5f;
  --accent: #ff6a3d;
  --accent-dark: #d84f28;
  --mint: #2bb39b;
  --line: #efe9e1;
  --shadow: 0 20px 40px rgba(16, 24, 40, 0.12);
  --soft-shadow: 0 10px 20px rgba(16, 24, 40, 0.08);
  --radius: 18px;
}

[hidden] {
  display: none !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 200, 180, 0.4), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(170, 230, 220, 0.35), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(255, 220, 160, 0.3), transparent 55%);
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 32px;
}

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

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-topbar .logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-topbar .logo-row .eyebrow {
  margin-bottom: 0;
}



.hero-text {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

.app-hero {
  margin-bottom: 16px;
}

.app-nav {
  padding: 14px 18px;
  border-radius: 14px;
}

.app-nav .admin-topbar {
  margin-bottom: 0;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}

.app-header-brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
}

.app-header-subline {
  margin: 0;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header-subline:empty {
  display: none;
}

.app-nav .logo-row {
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.app-nav .logo-row .logo-image {
  flex-shrink: 0;
}

.app-nav .logo-row h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header-actions.app-header-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-self: center;
}

.app-nav .logo-image {
  width: 42px;
  height: 42px;
}

.app-nav h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  line-height: 1.1;
}

.app-nav .eyebrow {
  letter-spacing: 0.08em;
}

.app-nav .app-header-brand > .app-header-subline {
  margin-inline-start: 4px;
}

.language-select {
  width: auto;
  min-width: 120px;
  min-height: 42px;
  padding: 8px 10px;
}

/* App header: profile / language / logout — compact menu on phones */
.app-header-actions {
  position: relative;
  align-items: center;
  gap: 8px;
}

.pwa-install-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
  flex-shrink: 0;
}

.pwa-install-button .pwa-install-icon {
  display: block;
}

.pwa-install-button:not([hidden]) {
  display: inline-grid;
}

@media (max-width: 768px) {
  .pwa-install-button:not([hidden]) {
    display: inline-grid;
  }
}

@media (min-width: 769px) {
  .pwa-install-button:not([hidden]) {
    display: none;
  }
}

.app-header-actions .nav-menu-toggle {
  display: none;
}

.app-header-actions .nav-account-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.app-header-actions .nav-account-field {
  display: contents;
}

.app-header-actions .nav-account-field-label {
  display: none;
}

.app-header-actions .nav-account-menu .requires-auth {
  display: none;
}

body:not(.is-authenticated) .app-header-actions .nav-account-menu .nav-account-item.requires-auth {
  display: none;
}

body.is-authenticated .app-header-actions .nav-account-menu .requires-auth {
  display: inline-flex;
}

body.is-authenticated .app-header-actions .nav-account-menu .requires-auth.icon-button {
  align-items: center;
}

.nav-menu-toggle-icon {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -8px 0 currentColor, 0 8px 0 currentColor;
}

@keyframes nav-account-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    position: relative;
  }

  .app-header-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-right: 4px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .app-header-brand .logo-row {
    width: 100%;
    max-width: 100%;
  }

  .admin-hero .app-header-brand .logo-row {
    align-items: center;
  }

  .admin-hero .app-nav .logo-row h1 {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.15;
  }

  .app-header-brand > .app-header-subline {
    margin-inline-start: 54px;
    max-width: calc(100% - 52px);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    line-height: 1.2;
  }

  .app-header-actions {
    flex-wrap: nowrap;
    gap: 6px;
    align-self: flex-start;
    flex-shrink: 0;
    position: relative;
  }

  .app-nav .logo-row h1 {
    font-size: clamp(0.9rem, 3.6vw, 1.15rem);
  }

  .admin-hero .app-nav .logo-row h1 {
    font-size: clamp(0.82rem, 3.2vw, 1.05rem);
  }

  .app-header-actions .nav-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .app-header-actions.nav-account-open .nav-menu-toggle {
    border-color: var(--accent);
    background: #fff0e9;
    color: var(--accent-dark);
  }

  .app-topbar {
    overflow: visible;
  }

  .app-nav .admin-topbar {
    overflow: visible;
  }

  .app-header-actions .nav-account-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 220;
    width: min(288px, calc(100vw - 36px));
    min-width: 0;
    max-width: calc(100vw - 36px);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid #e8e2d9;
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(20, 24, 32, 0.16);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .app-header-actions.nav-account-open .nav-account-menu {
    display: flex;
    animation: nav-account-menu-in 0.2s ease;
  }

  .app-header-actions .nav-account-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px 14px;
    margin: 0;
    border-radius: 12px;
  }

  .app-header-actions .nav-account-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .app-header-actions .nav-account-menu .language-select {
    width: 100%;
    min-width: 0;
  }

  .app-header-actions .nav-account-item {
    width: 100%;
    justify-content: flex-start;
    text-align: start;
    padding: 12px 14px;
    margin: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    transform: none;
  }

  .app-header-actions .nav-account-item:hover {
    background: #faf7f2;
    transform: none;
  }

  body.is-authenticated .app-header-actions .nav-account-menu .requires-auth {
    display: flex;
    width: 100%;
  }

  .app-header-actions .nav-account-menu .nav-account-mode-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px 14px;
    margin: 0;
    border-radius: 12px;
  }

  .app-header-actions .nav-account-menu .nav-account-mode-field:has(.mode-toggle[hidden]) {
    display: none;
  }

  .app-header-actions .nav-account-menu .mode-toggle {
    width: 100%;
    display: inline-flex;
    padding: 2px;
    gap: 2px;
  }

  .app-header-actions .nav-account-menu .mode-toggle button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1;
    text-align: center;
    transform: none;
  }

  .app-header-actions .nav-account-menu .mode-toggle button:hover {
    transform: none;
  }
}

.icon-button {
  gap: 8px;
}

.button-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

html[data-theme='dark'] .button-icon {
  background: var(--accent);
  color: #fff;
}

@media (min-width: 769px) {
  .app-header-actions .nav-account-menu {
    align-items: stretch;
    gap: 6px;
  }

  .app-header-actions .nav-account-menu .nav-account-item,
  .app-header-actions .nav-account-menu .language-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    height: 34px;
    min-width: 0;
    padding: 0 11px;
    margin: 0;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
  }

  .app-header-actions .nav-account-menu .language-select {
    min-width: 102px;
    padding: 0 24px 0 10px;
    justify-content: flex-start;
  }

  .app-header-actions .nav-account-menu .icon-button {
    gap: 6px;
  }

  .app-header-actions .nav-account-menu .mode-toggle {
    gap: 2px;
    padding: 2px;
  }

  .app-header-actions .nav-account-menu .mode-toggle button {
    min-width: 0;
    min-height: 28px;
    height: 28px;
    padding: 0 8px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    transform: none;
  }

  .app-header-actions .nav-account-menu .mode-toggle button:hover {
    transform: none;
  }
}

[dir="rtl"] .app-nav .eyebrow {
  margin-left: 0;
  margin-right: 4px;
}

.hero-text h1 {
  font-family: 'Fraunces', serif;
  font-size: 2.8rem;
  margin-bottom: 16px;
}

.app-nav.hero-text h1 {
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  margin-bottom: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-card {
  background: linear-gradient(140deg, #1e1e24, #2e2f3a);
  color: #f9f6f2;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
}

.hero-card-inner h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  color: #f9f6f2;
  text-decoration: none;
  font-size: 0.95rem;
  margin-top: 16px;
  transition: all 0.2s ease;
}

.ghost-button:hover {
  border-color: #ffffff;
  transform: translateY(-1px);
}

.grid {
  display: grid;
  gap: 20px;
  margin-bottom: 28px;
}

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

.full-row {
  width: 100%;
}

.full-row .panel {
  width: 100%;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--soft-shadow);
}

body.admin-map-home .container > .panel {
  display: none;
}

body.user-map-home .container > .panel.requires-auth {
  display: none;
}

body.admin-section-view .admin-map-panel {
  display: none;
}

body.user-section-view .user-map-panel {
  display: none;
}

body.admin-section-view .container > .panel:not(.admin-section-active) {
  display: none;
}

body.user-section-view .container > .panel.requires-auth:not(.user-section-active) {
  display: none;
}

.admin-section-active {
  position: relative;
}

.user-section-active {
  position: relative;
}

.admin-section-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #efe5dc;
  background: #fffaf5;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: var(--soft-shadow);
}

.admin-section-close:hover {
  border-color: var(--accent);
  background: #fff0e9;
  transform: translateY(-1px);
}

.bt-map-surface {
  touch-action: none;
  overscroll-behavior: contain;
}

html.bt-lock-page-zoom {
  touch-action: pan-x pan-y;
}

html.bt-lock-page-zoom body {
  touch-action: pan-x pan-y;
}

html.bt-lock-page-zoom .bt-map-surface,
html.bt-lock-page-zoom .admin-map-shell,
html.bt-lock-page-zoom .admin-places-map,
html.bt-lock-page-zoom .user-street-map,
html.bt-lock-page-zoom .street-map,
html.bt-lock-page-zoom #segment-planner-map {
  touch-action: none;
}

.user-map-panel {
  margin-bottom: 28px;
  overscroll-behavior: contain;
}

.user-street-map {
  min-height: 620px;
}

.user-map-stat {
  position: absolute;
  top: 86px;
  right: 24px;
  z-index: 510;
  max-width: calc(100% - 48px);
}

.user-map-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--soft-shadow);
  color: #1a1a1a;
  font-size: 0.9rem;
  font-weight: 700;
  pointer-events: auto;
}

.user-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.15);
}

.legend-dot.mine {
  background: #2bb39b;
}

.legend-dot.other {
  background: #ff6a3d;
}

.admin-map-panel {
  margin-bottom: 28px;
}

.admin-map-shell {
  position: relative;
  overflow: hidden;
  overscroll-behavior: contain;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.bt-map-permission-banner {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 600;
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.bt-map-permission-banner[hidden] {
  display: none !important;
}

.bt-map-permission-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #1a1a1a;
}

.bt-map-permission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bt-map-permission-enable {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bt-map-permission-dismiss {
  padding: 8px 12px;
  font-size: 0.88rem;
}

html[data-theme='dark'] .bt-map-permission-banner {
  border-color: #334155;
  background: rgba(15, 23, 42, 0.92);
}

html[data-theme='dark'] .bt-map-permission-text {
  color: var(--ink);
}

.street-map .bt-map-permission-banner {
  left: 10px;
  right: 10px;
  bottom: 10px;
}

@media (max-width: 768px) {
  .bt-map-permission-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}

.admin-map-tabs {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.admin-map-tabs button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 12px;
  border-color: #efe5dc;
  background: #fffaf5;
  color: #2d2d2d;
  white-space: nowrap;
}

.admin-map-tabs button.admin-tab-with-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-tab-badge {
  flex-shrink: 0;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  box-sizing: border-box;
}

.admin-map-tabs button:hover {
  border-color: var(--accent);
  background: #fff0e9;
  transform: translateY(-1px);
}

.admin-map-header {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.admin-map-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  line-height: 1;
}

.admin-map-header .eyebrow {
  margin-bottom: 8px;
}

.admin-map-stat {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(26, 26, 26, 0.84);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--soft-shadow);
  z-index: 510;
}

.admin-map-shell > .admin-map-stat,
.admin-map-shell > .user-map-stat {
  position: absolute;
  top: 86px;
  right: 24px;
  max-width: calc(100% - 48px);
}

.admin-places-map {
  min-height: 620px;
  background: linear-gradient(120deg, #f7efe5, #e8f6f2);
}

.bt-map-expand-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 620;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.94);
  color: #1a1a1a;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.bt-map-expand-btn:hover {
  transform: translateY(-1px);
}

.bt-map-expand-btn.is-expanded .bt-map-expand-icon-open {
  transform: rotate(180deg);
}

.street-map:not(.is-loading):not(.is-error) {
  position: relative;
}

.bt-map-shell-expanded {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
}

.bt-map-shell-expanded.admin-map-shell {
  display: flex;
  flex-direction: column;
}

.bt-map-shell-expanded.street-map {
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
}

.bt-map-shell-expanded.admin-posts-map-panel {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--surface);
}

.bt-map-shell-expanded .admin-places-map,
.bt-map-shell-expanded .street-map,
.bt-map-shell-expanded .admin-posts-street-map {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0 !important;
  height: 100% !important;
}

.bt-map-shell-expanded .admin-map-tabs,
.bt-map-shell-expanded .admin-map-header,
.bt-map-shell-expanded .admin-posts-map-header {
  flex-shrink: 0;
}

body.bt-map-expand-open {
  overflow: hidden;
}

.admin-map-shell .gm-fullscreen-control,
.admin-places-map .gm-fullscreen-control,
.user-street-map .gm-fullscreen-control,
.street-map .gm-fullscreen-control,
#segment-planner-map .gm-fullscreen-control,
.bt-map-surface .gm-fullscreen-control,
.bt-map-surface .gm-bundled-control-on-bottom,
.admin-map-shell .gm-bundled-control-on-bottom,
.admin-places-map .gm-bundled-control-on-bottom,
.street-map .gm-bundled-control-on-bottom,
.bt-map-surface .gmnoprint[role="group"],
.admin-map-shell .gmnoprint[role="menubar"] {
  display: none !important;
}

.admin-places-map.is-loading,
.admin-places-map.is-error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 20px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.admin-places-map.is-error {
  background: linear-gradient(120deg, #fff4ed, #fff9f5);
}

.map-place-popup {
  max-width: 300px;
  color: #1a1a1a;
  font-family: 'Space Grotesk', sans-serif;
}

.map-place-popup h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.map-place-popup p {
  margin: 8px 0;
}

.map-place-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.map-place-badges span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff0e9;
  color: #8b341d;
  font-size: 0.78rem;
  font-weight: 700;
}

.map-place-popup dl {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.map-place-popup dl div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
}

.map-place-popup dt {
  color: #666;
  font-weight: 700;
}

.map-place-popup dd {
  margin: 0;
}

.map-place-note {
  padding-top: 8px;
  border-top: 1px solid #efe9e1;
}

.poi-map-popup {
  max-width: 280px;
  color: #1a1a1a;
  font-family: 'Space Grotesk', sans-serif;
}

.poi-map-popup h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.poi-map-popup p {
  margin: 6px 0;
  font-size: 0.9rem;
  color: #444;
}

.poi-map-popup .poi-google-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--accent, #2563eb);
}

.poi-map-popup .poi-add-btn {
  margin-top: 10px;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.94rem;
}

.poi-map-popup.poi-map-loading {
  padding: 4px 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  width: min(420px, 90vw);
  box-shadow: var(--shadow);
  text-align: center;
}

.modal h3 {
  margin-bottom: 10px;
}

.modal p {
  white-space: pre-line;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.modal.modal--places {
  width: min(920px, 96vw);
  max-height: min(88vh, 900px);
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
}

.modal.modal--places h3 {
  flex-shrink: 0;
  padding-right: 4px;
}

.modal.modal--places #modal-message {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  text-align: left;
  margin-top: 8px;
}

.modal-places-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.places-modal-table {
  width: 100%;
  min-width: 720px;
}

.places-modal-table th,
.places-modal-table td {
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.places-modal-table .places-modal-delete {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .modal.modal--places {
    width: min(100vw - 20px, 100%);
    max-height: min(92vh, 100%);
    padding: 16px;
  }

  .modal-places-scroll {
    overflow-x: visible;
  }

  .places-modal-table {
    min-width: 0;
  }

  .places-modal-table,
  .places-modal-table thead,
  .places-modal-table tbody,
  .places-modal-table tr,
  .places-modal-table td {
    display: block;
    width: 100%;
  }

  .places-modal-table thead {
    display: none;
  }

  .places-modal-table tbody {
    display: grid;
    gap: 12px;
  }

  .places-modal-table tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--surface);
  }

  .places-modal-table td {
    border: none;
    padding: 6px 0;
  }

  .places-modal-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .places-modal-table td[data-label='Actions'] {
    padding-top: 10px;
  }

  .places-modal-table td[data-label='Actions']::before {
    margin-bottom: 8px;
  }

  .places-modal-table .places-modal-delete {
    width: 100%;
    justify-content: center;
  }

  .modal.modal--places .modal-actions {
    flex-shrink: 0;
    margin-top: 14px;
  }

  .modal.modal--places .modal-actions button {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.requires-auth {
  display: none;
}

.requires-guest {
  display: block;
}

body.is-authenticated .requires-auth {
  display: block;
}

body.is-authenticated .requires-auth.grid {
  display: grid;
}

body.is-authenticated .requires-guest {
  display: none;
}

body.is-authenticated .requires-guest.grid {
  display: none;
}

body.is-authenticated.user-section-view .user-map-panel {
  display: none;
}

body.is-authenticated.user-map-home .container > .panel.requires-auth {
  display: none;
}

body.is-authenticated.user-section-view .container > .panel.requires-auth:not(.user-section-active) {
  display: none;
}

.panel h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.form {
  display: grid;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e1ded8;
  background: #fbfaf8;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select {
  appearance: auto;
  -webkit-appearance: menulist;
  min-height: 48px;
  cursor: pointer;
  background: #fff;
  color: #111;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

select option {
  background: #fff;
  color: #111;
}

.select-search-input {
  min-height: 42px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.2);
}

@keyframes bt-login-autofill-start {
  from {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}

#login-username:-webkit-autofill,
#login-password:-webkit-autofill {
  animation-name: bt-login-autofill-start;
  animation-duration: 0.01s;
}

#post-place-autocomplete-container,
#suggest-place-autocomplete-container {
  width: 100%;
}

#post-place-autocomplete-container gmp-place-autocomplete,
#post-place-autocomplete-container gmp-basic-place-autocomplete,
#suggest-place-autocomplete-container gmp-place-autocomplete,
#suggest-place-autocomplete-container gmp-basic-place-autocomplete {
  display: block;
  width: 100%;
}

.unified-place-search {
  margin-bottom: 1rem;
}

.unified-place-search label > span:first-of-type {
  display: block;
  margin-bottom: 6px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

button.secondary {
  background: var(--mint);
}

button.secondary:hover {
  background: #239b86;
}

button.ghost {
  background: transparent;
  border: 1px solid #d9d5cf;
  color: var(--muted);
}

button.ghost:hover {
  background: #f1eeea;
}

select option:disabled {
  color: #9b9b9b;
  background-color: #f2f2f2;
}

a.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid #d9d5cf;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

a.ghost:hover {
  background: #f1eeea;
}

.form-message {
  min-height: 18px;
  color: var(--accent-dark);
  font-size: 0.9rem;
}

.form-message.subtle {
  color: var(--muted);
}

.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 16px;
  min-width: 0;
}

.section-header > * {
  min-width: 0;
}

.section-header > div:first-child {
  flex: 1 1 200px;
}

.section-header > input[type='text'],
.section-header > input[type='search'],
.section-header > input[type='email'],
.section-header > input[type='password'] {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
}

.section-header > select {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
}

.section-header > .admin-actions {
  flex: 1 1 220px;
  justify-content: flex-end;
  align-items: center;
}

.section-header .admin-actions select,
.section-header .admin-actions input {
  flex: 1 1 140px;
  min-width: 0;
  max-width: 100%;
}

#auth-section .logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-image {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--soft-shadow);
}

#user-territory-label {
  font-size: 0.95rem;
}

.toggle-row {
  justify-content: center;
  position: relative;
  cursor: default;
  text-align: center;
}

.toggle-row h2 {
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.panel.admin-section-active > .toggle-row {
  padding-right: 52px;
  box-sizing: border-box;
}

.panel.admin-section-active {
  overflow-x: hidden;
}

.toggle-row .admin-actions {
  position: absolute;
  right: 0;
}

.collapsible {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 0;
}

.collapsible.is-open {
  max-height: 10000px;
  overflow-x: hidden;
  overflow-y: visible;
  opacity: 1;
  min-width: 0;
}

.posts-container {
  display: grid;
  gap: 16px;
}

.posts-scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.post-card {
  padding: 18px;
  border-radius: 14px;
  background: #fdfbf8;
  border: 1px solid #eee8df;
}

.post-card h3 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.post-edit {
  margin-top: 12px;
  display: none;
  gap: 12px;
}

.post-card.is-editing .post-edit {
  display: grid;
}

.post-card.is-editing .post-body {
  display: none;
}

.post-card.is-editing .edit-post {
  display: none;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}

.muted {
  color: var(--muted);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #efe9e1;
  font-size: 0.95rem;
  word-wrap: break-word;
}

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

.file-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid #d9d5cf;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
}

.import-places-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #efe9e1;
  border-radius: 12px;
  background: #faf8f5;
}

.import-places-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.import-places-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 12px;
}

.import-default-user {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  flex: 1;
}

.import-default-user input {
  padding: 10px 12px;
  border: 1px solid #d9d5cf;
  border-radius: 10px;
}

.reset-input {
  min-width: 140px;
}

.username-input {
  min-width: 140px;
}

.admin-table th,
.admin-table td {
  vertical-align: middle;
}

.admin-table td:last-child {
  min-width: 200px;
}

.panel {
  overflow: visible;
}

.users-table-wrap {
  overflow-x: auto;
}

.users-table-wrap {
  max-height: 360px;
  overflow-y: auto;
}

.users-table .users-flag-col {
  min-width: 6.5rem;
  vertical-align: bottom;
}

.users-table .users-flag-col span {
  display: block;
  margin-bottom: 4px;
}

.users-table .users-col-toggle {
  display: block;
  width: 100%;
  padding: 2px 4px;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
}

.users-bulk-toolbar {
  display: none;
}

.users-list-shell {
  display: grid;
  gap: 12px;
}

.cluster-row-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.cluster-row-actions .ghost {
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

.posts-table-wrap {
  max-height: 360px;
  overflow-y: auto;
}

.scroll-window {
  max-height: 320px;
  overflow-y: auto;
}

.streets-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.streets-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.assignment-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.assignment-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--surface);
  margin-top: 16px;
}

.assignment-card h3 {
  margin-top: 0;
}

.assignment-scroll-region {
  max-height: 430px;
  overflow-y: auto;
  overflow-x: auto;
  margin-top: 10px;
  padding-right: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.assignment-scroll-region .admin-table {
  margin-top: 0;
}

.assignment-scroll-region .admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff7ef;
}

.assignment-scroll-region > .muted {
  padding: 14px;
}

.street-pool-manual-form {
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.street-pool-manual-form > .muted {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.5;
}

.street-pool-manual-row {
  display: grid;
  grid-template-columns: minmax(240px, 2.2fr) minmax(200px, 1fr) minmax(180px, auto);
  gap: 16px 20px;
  align-items: end;
}

.street-pool-manual-row label {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.street-pool-manual-row input,
.street-pool-manual-row select {
  min-height: 56px;
  padding: 14px 18px;
  font-size: 1.1rem;
  border-radius: 14px;
}

.street-pool-manual-row select {
  min-height: 56px;
  padding-right: 40px;
}

.street-pool-manual-row button {
  min-height: 56px;
  padding: 14px 22px;
  font-size: 1rem;
  white-space: nowrap;
  align-self: end;
}

@media (max-width: 900px) {
  .street-pool-manual-row {
    grid-template-columns: 1fr 1fr;
  }

  .street-pool-manual-row button {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
  }
}

.street-pool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.street-pool-source-col {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.street-pool-delete-btn {
  justify-self: start;
  min-height: 48px;
  padding: 12px 18px;
  font-size: 1rem;
  color: #8b341d;
  border-color: #e8b4a2;
  background: #fff6f1;
}

.street-pool-delete-btn:hover {
  border-color: var(--accent);
  background: #ffe8de;
  color: var(--accent-dark);
}

.street-pool-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.street-pool-grid select[multiple] {
  min-height: 320px;
  padding: 8px;
  font-family: 'Space Grotesk', sans-serif;
}

.street-pool-actions {
  display: grid;
  gap: 12px;
}

.street-pool-actions button {
  min-width: 56px;
}

.street-pool-hint {
  margin: 12px 0 0;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.compact-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.compact-form button {
  width: fit-content;
}

.cluster-detail {
  margin-top: 16px;
}

.streets-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 12px;
}

#assigned-streets-list.streets-cards--returned-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

#assigned-streets-list.streets-cards--returned-scroll::-webkit-scrollbar {
  width: 8px;
}

#assigned-streets-list.streets-cards--returned-scroll::-webkit-scrollbar-thumb {
  background: #d9d5cf;
  border-radius: 999px;
}

.admin-posts-workspace {
  margin-bottom: 24px;
}

.admin-posts-workspace-head {
  margin-bottom: 16px;
}

.admin-posts-workspace-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 8px;
}

.admin-posts-workspace-head-row h3 {
  margin: 0;
}

.admin-posts-pool-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}

.admin-posts-pool-switch-label {
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.2;
  transition: color 0.15s ease;
}

.admin-posts-pool-switch-label.is-active {
  color: var(--ink);
}

.admin-posts-pool-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.admin-posts-pool-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.admin-posts-pool-toggle-track {
  display: block;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #d4cec6;
  transition: background 0.2s ease;
  position: relative;
}

.admin-posts-pool-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.22);
  transition: transform 0.2s ease;
}

.admin-posts-pool-toggle input:checked + .admin-posts-pool-toggle-track {
  background: var(--accent);
}

.admin-posts-pool-toggle input:checked + .admin-posts-pool-toggle-track::after {
  transform: translateX(16px);
}

.admin-posts-pool-toggle input:focus-visible + .admin-posts-pool-toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.admin-posts-workspace-head h3 {
  margin: 0 0 8px;
}

.admin-posts-workspace-head .muted {
  margin: 0;
  max-width: 70ch;
  line-height: 1.55;
}

.admin-posts-workspace-body {
  display: grid;
  gap: 18px;
  align-items: stretch;
}

.admin-posts-workspace-body:has(.admin-posts-map-panel:not([hidden])) {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .admin-posts-workspace-body:has(.admin-posts-map-panel:not([hidden])) {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 380px);
  }
}

.admin-posts-street-picker-card {
  width: 100%;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

@media (min-width: 900px) {
  .admin-posts-workspace-body:not(:has(.admin-posts-map-panel:not([hidden]))) .admin-posts-street-picker-card {
    max-width: 420px;
  }
}

.admin-posts-street-picker {
  display: grid;
  gap: 12px;
  width: 100%;
}

.admin-posts-street-picker-search-label,
.admin-posts-street-picker-list-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-posts-street-picker .select-search-input {
  min-height: 48px;
  padding: 12px 16px;
  font-size: 1.05rem;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 2px rgba(26, 26, 26, 0.04);
}

.admin-posts-street-picker .completed-street-listbox {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: 0;
  max-height: min(42vh, 280px);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(26, 26, 26, 0.04);
  text-align: left;
}

.completed-street-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.completed-street-item:hover {
  background: rgba(255, 106, 61, 0.08);
}

.completed-street-item.is-selected {
  background: #fff0e9;
  color: #1a1a1a;
  font-weight: 600;
}

.completed-street-item[hidden] {
  display: none !important;
}

.completed-street-listbox.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 768px) {
  .admin-posts-street-picker .completed-street-listbox {
    max-height: min(36vh, 240px);
  }

  .completed-street-item {
    padding: 12px 12px;
    font-size: 1rem;
  }
}

.admin-posts-street-picker-hint {
  margin: 0;
  padding-top: 2px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

.admin-posts-map-panel {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.admin-posts-map-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.admin-posts-map-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.admin-posts-street-map {
  flex: 1;
  min-height: 280px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.06);
}

@media (min-width: 900px) {
  .admin-posts-street-map {
    min-height: 340px;
  }

  .admin-posts-street-picker .completed-street-listbox {
    max-height: min(40vh, 320px);
    flex: 1;
  }

  .admin-posts-street-picker {
    min-height: 340px;
    grid-template-rows: auto auto 1fr auto;
  }
}

.map-place-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #efe9e1;
}

.map-place-popup-actions .ghost {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.88rem;
}

.post-card.is-map-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 106, 61, 0.18);
}

.assignment-tabs {
  display: inline-flex;
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 4px;
  padding: 6px;
  border-radius: 999px;
  background: #f4eee7;
}

.assignment-tabs button {
  min-width: 110px;
}

.assignment-tabs button.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f4eee7;
}

.mode-toggle[hidden] {
  display: none;
}

.mode-toggle button {
  min-width: 86px;
}

.mode-toggle button.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.suggestion-approve-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #efe9e1;
  border-radius: 12px;
  background: #faf7f2;
}

.street-card {
  border-radius: 16px;
  border: 1px solid #efe9e1;
  background: #fff;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.street-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 106, 61, 0.2);
}

.street-map {
  height: 180px;
  background: linear-gradient(120deg, #f7efe5, #f1f6ff);
  border-bottom: 1px solid #ece7df;
  overflow: hidden;
}

.street-map[hidden] {
  display: none;
}

.street-map.is-loading,
.street-map.is-error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.street-map.is-error {
  background: linear-gradient(120deg, #fff4ed, #fff9f5);
}

.street-map.street-map--free-for-all {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef6ff 0%, #f7efe5 55%, #fff4ed 100%);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.street-card.street-card--free-for-all.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.street-map-fallback {
  margin: 0;
}

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

.street-card .card-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.segment-planner-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}

.segment-planner-grid > * {
  min-width: 0;
  max-width: 100%;
}

#segment-planner-content .section-header .admin-actions {
  flex: 1 1 200px;
  min-width: 0;
}

#segment-planner-street {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 960px) {
  .admin-posts-workspace-body,
  .admin-posts-workspace-body:has(.admin-posts-map-panel:not([hidden])) {
    grid-template-columns: 1fr;
  }

  .admin-posts-street-picker-card {
    order: 1;
  }

  .admin-posts-map-panel {
    order: 2;
  }

  .admin-posts-workspace-body:not(:has(.admin-posts-map-panel:not([hidden]))) .admin-posts-street-picker-card {
    max-width: none;
  }

  .admin-posts-street-map {
    min-height: 260px;
  }

  #admin-posts-container .section-header,
  #users-content .section-header,
  #segment-planner-content > .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  #admin-posts-container .section-header > div:first-child,
  #users-content .section-header > div:first-child,
  #segment-planner-content > .section-header > div:first-child {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  #admin-posts-container .section-header > input[type='text'],
  #admin-posts-container .section-header > input[type='search'],
  #users-content .section-header > input[type='text'],
  #users-content .section-header > input[type='search'] {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  #admin-posts-container .section-header > .admin-actions,
  #users-content .section-header > .admin-actions,
  #segment-planner-content > .section-header > .admin-actions {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  #admin-posts-container .section-header > .admin-actions > button,
  #admin-posts-container .section-header > .admin-actions > .file-label,
  #users-content .section-header > .admin-actions > button,
  #users-content .section-header > .admin-actions > .file-label {
    flex: 1 1 160px;
    min-width: 0;
    max-width: 100%;
  }

  #segment-planner-content > .section-header .admin-actions > select,
  #segment-planner-content > .section-header .admin-actions > button {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 100%;
  }

  #segment-planner-content .assignment-card > .admin-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #segment-planner-content .assignment-card > .admin-actions > button,
  #segment-planner-content .assignment-card > .admin-actions > .file-label {
    flex: 1 1 min(100%, 220px);
    min-width: 0;
    justify-content: center;
  }
}

.planner-map {
  height: 420px;
}

.segment-summary {
  margin: 10px 0 14px;
}

.segment-list-cards {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.segment-list-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segment-list-card.is-selected {
  border-color: #ff8a5c;
  background: #fff3eb;
}

.segment-card-main,
.segment-card-meta,
.segment-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.segment-card-main {
  justify-content: space-between;
}

.segment-card-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.segment-card-actions {
  padding-top: 2px;
}

.segment-action {
  padding: 7px 10px;
  min-height: 34px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.segment-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #efe9e1;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdfb, #fff7f0);
}

.segment-editor h4 {
  margin: 0;
}

.assignment-report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.assignment-delete-btn {
  margin-left: auto;
  padding: 6px 10px;
  color: #8b5a5a;
  line-height: 0;
}

.assignment-delete-btn:hover {
  color: #b42318;
  background: #fdecea;
}

.assignment-trash-icon {
  display: block;
}

.assignment-table .card-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-table tr.is-selected {
  background: #fff3eb;
}

#segment-planner-map-hint {
  margin-top: 12px;
}

.segment-location-note {
  color: var(--muted);
}

.segment-route-guidance {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-left: 3px solid #ff8a5c;
  background: #fff7f0;
}

.segment-route-guidance:empty {
  display: none;
}

#segment-geometry-input {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  resize: vertical;
}

@media (max-width: 700px) {
  .panel {
    overflow-x: hidden;
    overflow-y: visible;
  }

  .collapsible.is-open {
    max-height: none;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .admin-actions:not(.app-header-actions) {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-map-tabs {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .admin-map-shell > .admin-map-stat,
  .admin-map-shell > .user-map-stat,
  .user-map-stat {
    top: 68px;
    right: 12px;
    left: auto;
    bottom: auto;
    max-width: min(calc(100% - 24px), 240px);
    font-size: 0.78rem;
    line-height: 1.25;
    padding: 8px 10px;
  }

  .admin-map-header {
    left: 12px;
    right: 68px;
    bottom: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-map-header h2 {
    font-size: 1.15rem;
  }

  .user-map-header .user-map-legend {
    display: none;
  }

  .bt-map-expand-btn {
    right: 10px;
    bottom: 10px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }

  .bt-map-permission-banner {
    right: 68px;
    bottom: 10px;
    left: 10px;
  }

  .admin-places-map {
    min-height: 520px;
  }

  .user-street-map {
    min-height: 520px;
  }

  .user-map-legend {
    justify-content: flex-start;
  }

  .streets-grid {
    grid-template-columns: 1fr;
  }

  .assignment-grid {
    grid-template-columns: 1fr;
  }

  .street-pool-grid {
    grid-template-columns: 1fr;
  }

  .street-pool-manual-row {
    grid-template-columns: 1fr;
  }

  .street-pool-manual-row button {
    grid-column: auto;
    width: 100%;
  }

  .street-pool-manual-row input,
  .street-pool-manual-row select {
    min-height: 52px;
    font-size: 1.05rem;
  }

  .segment-planner-grid {
    grid-template-columns: 1fr;
  }

  .street-pool-actions {
    grid-template-columns: 1fr 1fr;
  }

  .compact-form {
    grid-template-columns: 1fr;
  }

  .reset-input {
    width: 100%;
    min-width: 0;
  }

  .assignment-table,
  .assignment-table tbody,
  .assignment-table tr,
  .assignment-table td {
    display: block;
    width: 100%;
  }

  .assignment-table thead {
    display: none;
  }

  .assignment-table tbody {
    display: grid;
    gap: 14px;
  }

  .assignment-table tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    background: var(--surface);
  }

  .assignment-table td {
    border-bottom: none;
    padding: 6px 0;
  }

  .assignment-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .assignment-table td:last-child {
    min-width: 0;
  }

  .assignment-table td:last-child button {
    width: 100%;
  }

  .assignment-table td:last-child .assignment-delete-btn {
    width: auto;
    max-width: 3.5rem;
    margin-left: auto;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #efe9e1;
  font-size: 0.85rem;
  color: var(--muted);
}

footer {
  text-align: center;
  color: var(--muted);
  margin-top: 40px;
  font-size: 0.9rem;
}

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero-text h1 {
    font-size: 2.1rem;
  }

  .app-nav.hero-text h1 {
    font-size: 1.2rem;
  }

  .panel {
    padding: 20px;
  }

  .user-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  body.is-authenticated .logout-button {
    display: inline-flex;
  }
}

@media (max-width: 760px) {
  .section-header {
    align-items: stretch;
  }

  .section-header > input,
  .section-header > .admin-actions {
    width: 100%;
  }

  .admin-actions:not(.app-header-actions) {
    width: 100%;
  }

  .admin-actions:not(.app-header-actions) > button,
  .admin-actions:not(.app-header-actions) > .file-label,
  .admin-actions:not(.app-header-actions) > input,
  .admin-actions:not(.app-header-actions) > select {
    flex: 1 1 100%;
    min-width: 0;
  }

  .users-table-wrap,
  #cluster-list {
    overflow-x: visible;
  }

  .users-bulk-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .users-bulk-toggle-group {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .users-bulk-toggle-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .users-bulk-toolbar .users-col-toggle {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.3;
    min-height: 40px;
  }

  .users-table-wrap {
    max-height: none;
  }

  .users-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: start;
  }

  .users-table td:not(.users-flag-cell) {
    grid-column: 1 / -1;
  }

  .users-table .users-flag-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
  }

  .users-table .users-flag-cell::before {
    margin-bottom: 0;
    text-transform: none;
    font-size: 0.84rem;
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
  }

  .users-table .users-flag-cell input[type='checkbox'] {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    margin: 0;
  }

  .clusters-table,
  .clusters-table tbody,
  .clusters-table tr,
  .clusters-table td {
    display: block;
    width: 100%;
  }

  .users-table,
  .users-table tbody {
    display: block;
    width: 100%;
  }

  .users-table thead,
  .clusters-table thead {
    display: none;
  }

  .users-table tbody,
  .clusters-table tbody {
    display: grid;
    gap: 12px;
  }

  .users-table tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: var(--surface);
  }

  .clusters-table tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: var(--surface);
  }

  .users-table td:not(.users-flag-cell) {
    border-bottom: none;
    padding: 7px 0;
    min-width: 0;
    display: block;
    width: 100%;
  }

  .clusters-table td {
    border-bottom: none;
    padding: 7px 0;
    min-width: 0;
  }

  .users-table td:not(.users-flag-cell)::before,
  .clusters-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .users-table td:last-child,
  .clusters-table td:last-child {
    min-width: 0;
  }

  .username-input,
  .name-input,
  .reset-input,
  .users-table select {
    width: 100%;
    min-width: 0;
  }
}

.profile-name-hint {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

input[readonly][disabled],
input.field-readonly {
  background: #f0ebe4;
  color: var(--muted);
  cursor: not-allowed;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #12151c;
  --surface: #1c2330;
  --ink: #eef1f6;
  --muted: #a8b3c4;
  --accent: #ff7a52;
  --accent-dark: #ff9b7d;
  --mint: #3fd0b6;
  --line: #334155;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  --soft-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme='dark'] .ambient {
  opacity: 0.22;
}

html[data-theme='dark'] .hero-text,
html[data-theme='dark'] .panel,
html[data-theme='dark'] .admin-map-shell,
html[data-theme='dark'] .app-header-actions .nav-account-menu {
  background: var(--surface);
  border-color: #2a3344;
}

html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
  background: #151b26;
  border-color: #334155;
  color: var(--ink);
}

html[data-theme='dark'] input[readonly][disabled] {
  background: #0f141d;
  color: #8b98ab;
}

html[data-theme='dark'] button.ghost {
  border-color: #3d4d66;
  color: var(--ink);
}

html[data-theme='dark'] button.ghost:hover,
html[data-theme='dark'] .app-header-actions .nav-account-item:hover {
  background: #252f42;
}

html[data-theme='dark'] .admin-table th {
  background: #252f42;
}

html[data-theme='dark'] .admin-table td {
  border-bottom-color: var(--line);
}

html[data-theme='dark'] .admin-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme='dark'] .assignment-scroll-region .admin-table thead th {
  background: #252f42;
}

html[data-theme='dark'] .street-pool-manual-form,
html[data-theme='dark'] .assignment-card {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme='dark'] .street-pool-manual-form > .muted,
html[data-theme='dark'] .street-pool-grid label,
html[data-theme='dark'] .street-pool-hint {
  color: var(--muted);
}

html[data-theme='dark'] .street-pool-delete-btn {
  background: #252f42;
  border-color: #475569;
  color: var(--accent-dark);
}

html[data-theme='dark'] .street-pool-delete-btn:hover {
  background: #2f3a4f;
  border-color: var(--accent);
  color: #fff;
}

html[data-theme='dark'] .street-pool-grid select[multiple] {
  background: #151b26;
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme='dark'] .assignment-table tr {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme='dark'] .assignment-delete-btn:hover {
  color: #fca5a5;
  background: rgba(180, 35, 24, 0.18);
}

html[data-theme='dark'] .segment-list-card.is-selected {
  background: #252f42;
  border-color: var(--accent);
}

html[data-theme='dark'] .badge {
  background: #2a3344;
  color: var(--muted);
}

html[data-theme='dark'] .post-card.is-map-focused {
  outline-color: var(--accent);
  background: #252f42;
}

html[data-theme='dark'] .admin-section-close {
  background: #252f42;
  border-color: #475569;
  color: #eef1f6;
  box-shadow: var(--soft-shadow);
}

html[data-theme='dark'] .admin-section-close:hover {
  background: #2f3a4f;
  border-color: var(--accent);
  color: #fff;
}

html[data-theme='dark'] .street-card,
html[data-theme='dark'] .post-card {
  background: var(--surface);
  border-color: #334155;
  color: var(--ink);
}

html[data-theme='dark'] .street-card h3,
html[data-theme='dark'] .street-card .card-body,
html[data-theme='dark'] .street-card .card-meta,
html[data-theme='dark'] .post-card h3,
html[data-theme='dark'] .post-card .post-meta,
html[data-theme='dark'] .post-card .post-body {
  color: var(--ink);
}

html[data-theme='dark'] .street-card .card-meta,
html[data-theme='dark'] .post-card .post-meta span {
  color: var(--muted);
}

html[data-theme='dark'] .street-map {
  background: #151b26;
  border-bottom-color: #334155;
}

html[data-theme='dark'] .assignment-tabs,
html[data-theme='dark'] .mode-toggle {
  background: #252f42;
  border: 1px solid #334155;
}

html[data-theme='dark'] .assignment-tabs button.ghost,
html[data-theme='dark'] .mode-toggle button.ghost {
  background: transparent;
  border-color: #475569;
  color: var(--ink);
}

html[data-theme='dark'] .assignment-tabs button.ghost.is-active,
html[data-theme='dark'] .mode-toggle button.ghost.is-active,
html[data-theme='dark'] .assignment-tabs button.is-active,
html[data-theme='dark'] .mode-toggle button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

html[data-theme='dark'] .admin-map-tabs {
  background: rgba(28, 35, 48, 0.92);
  border-color: #334155;
}

html[data-theme='dark'] .admin-map-tabs button {
  background: #252f42;
  border-color: #475569;
  color: var(--ink);
}

html[data-theme='dark'] .admin-map-tabs button:hover {
  background: #2f3a4f;
  border-color: var(--accent);
  color: var(--ink);
}

html[data-theme='dark'] .user-map-legend {
  background: rgba(28, 35, 48, 0.92);
  color: var(--ink);
  border: 1px solid #334155;
}

html[data-theme='dark'] .user-map-legend .legend-dot {
  border-color: #334155;
}

html[data-theme='dark'] .admin-map-header,
html[data-theme='dark'] .admin-map-stat,
html[data-theme='dark'] .user-map-stat {
  color: var(--ink);
}

html[data-theme='dark'] .import-places-panel,
html[data-theme='dark'] .suggestion-approve-panel {
  background: #252f42;
  border-color: #334155;
  color: var(--ink);
}

html[data-theme='dark'] .file-label {
  background: #252f42;
  border-color: #475569;
  color: var(--ink);
}

html[data-theme='dark'] .file-label:hover {
  background: #2f3a4f;
  border-color: var(--accent);
}

html[data-theme='dark'] select option {
  background: #1c2330;
  color: var(--ink);
}

html[data-theme='dark'] .toggle-row h2,
html[data-theme='dark'] .section-header h2,
html[data-theme='dark'] .section-header h3,
html[data-theme='dark'] .panel h2,
html[data-theme='dark'] .panel h3 {
  color: var(--ink);
}

html[data-theme='dark'] .admin-places-map,
html[data-theme='dark'] .user-street-map,
html[data-theme='dark'] .admin-posts-street-map,
html[data-theme='dark'] #segment-planner-map {
  background: #151b26;
}

html[data-theme='dark'] .admin-posts-street-picker-card,
html[data-theme='dark'] .bt-map-expand-btn {
  border-color: #334155;
  background: rgba(15, 23, 42, 0.92);
  color: var(--ink);
}

html[data-theme='dark'] .admin-posts-map-panel {
  background: var(--surface);
  border-color: var(--line);
}

html[data-theme='dark'] .admin-posts-street-picker .select-search-input,
html[data-theme='dark'] .admin-posts-street-picker .completed-street-listbox {
  background: #151b26;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

html[data-theme='dark'] .completed-street-item.is-selected {
  background: rgba(255, 122, 82, 0.24);
  color: var(--ink);
}

html[data-theme='dark'] .completed-street-item:hover {
  background: rgba(255, 122, 82, 0.12);
}

html[data-theme='dark'] .admin-posts-pool-toggle-track {
  background: #475569;
}

html[data-theme='dark'] .admin-posts-pool-toggle-track::after {
  background: #eef1f6;
}

html[data-theme='dark'] .admin-posts-pool-switch-label:not(.is-active) {
  color: var(--muted);
}

html[data-theme='dark'] .street-card button.ghost,
html[data-theme='dark'] .post-card button.ghost {
  border-color: #475569;
  color: var(--ink);
  background: #1c2330;
}

html[data-theme='dark'] .street-card button.ghost:hover,
html[data-theme='dark'] .post-card button.ghost:hover {
  background: #2f3a4f;
  border-color: var(--accent);
}

html[data-theme='dark'] .form-message {
  color: var(--muted);
}

html[data-theme='dark'] .muted {
  color: var(--muted);
}

/* Google Maps InfoWindow shell (POI + saved-place popups) */
.gm-style .gm-style-iw-c {
  max-height: none !important;
}

.gm-style .gm-style-iw-d {
  overflow: visible !important;
  max-height: none !important;
}

.gm-style .gm-style-iw-chr {
  flex-shrink: 0;
}

.gm-style .gm-style-iw-c button.gm-ui-hover-effect {
  opacity: 1 !important;
  top: 0 !important;
  right: 0 !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.gm-style .gm-style-iw-c button.gm-ui-hover-effect > img,
.gm-style .gm-style-iw-c button.gm-ui-hover-effect > span {
  display: none !important;
}

.gm-style .gm-style-iw-c button.gm-ui-hover-effect::after {
  content: '×';
  display: block;
  color: #1a1a1a;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  pointer-events: none;
}

html[data-theme='dark'] .gm-style .gm-style-iw-c {
  background: var(--surface) !important;
  border-color: #334155 !important;
  box-shadow: var(--soft-shadow) !important;
}

html[data-theme='dark'] .gm-style .gm-style-iw-chr,
html[data-theme='dark'] .gm-style .gm-style-iw-ch,
html[data-theme='dark'] .gm-style .gm-style-iw-d {
  background: var(--surface) !important;
  color: var(--ink) !important;
}

html[data-theme='dark'] .gm-style .gm-style-iw-ch {
  display: none !important;
}

html[data-theme='dark'] .gm-style .gm-style-iw-tc::after {
  background: var(--surface) !important;
  box-shadow: -2px 2px 2px 0 rgba(0, 0, 0, 0.2) !important;
}

html[data-theme='dark'] .gm-style .gm-style-iw-chr {
  background: var(--surface) !important;
}

html[data-theme='dark'] .gm-style .gm-style-iw-d {
  color: var(--ink) !important;
  background: var(--surface) !important;
  overflow: auto !important;
}

html[data-theme='dark'] .poi-map-popup,
html[data-theme='dark'] .map-place-popup,
.poi-map-popup.is-dark,
.map-place-popup.is-dark {
  color: #eef1f6 !important;
  background: transparent;
}

html[data-theme='dark'] .poi-map-popup h3,
html[data-theme='dark'] .map-place-popup h3,
.poi-map-popup.is-dark h3,
.map-place-popup.is-dark h3 {
  color: #eef1f6 !important;
}

html[data-theme='dark'] .poi-map-popup p,
.poi-map-popup.is-dark p {
  color: #a8b3c4 !important;
}

html[data-theme='dark'] .poi-map-popup .poi-google-link,
.poi-map-popup.is-dark .poi-google-link {
  color: #ff7a52 !important;
}

html[data-theme='dark'] .poi-map-popup .poi-add-btn,
.poi-map-popup.is-dark .poi-add-btn {
  background: #ff7a52;
  color: #fff;
  border: none;
  border-radius: 12px;
}

html[data-theme='dark'] .poi-map-popup.poi-map-loading,
.poi-map-popup.is-dark.poi-map-loading {
  color: #a8b3c4 !important;
}

html[data-theme='dark'] .map-place-popup dt,
.map-place-popup.is-dark dt {
  color: #a8b3c4;
}

html[data-theme='dark'] .map-place-badges span,
.map-place-popup.is-dark .map-place-badges span {
  background: rgba(255, 122, 82, 0.18);
  color: #ff9b7d;
}

html[data-theme='dark'] .map-place-note,
html[data-theme='dark'] .map-place-popup-actions,
.map-place-popup.is-dark .map-place-note,
.map-place-popup.is-dark .map-place-popup-actions {
  border-top-color: #334155;
}

html[data-theme='dark'] .poi-map-popup .poi-add-btn:disabled,
.poi-map-popup.is-dark .poi-add-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

html[data-theme='dark'] .gm-style .gm-style-iw-c button.gm-ui-hover-effect::after {
  color: var(--ink);
}
