@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  --bg: #0f172a;
  --surface: rgba(12, 21, 38, 0.9);
  --surface-strong: rgba(12, 21, 38, 0.82);
  --text: #e2e8f0;
  --muted: #c0ccda;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 15px 45px rgba(15, 23, 42, 0.35);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
}

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

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  overflow: hidden;
  overscroll-behavior: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--accent-2);
  margin: 0 0 6px;
}

.ui-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  touch-action: pan-x pan-y;
  background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.08), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.12), transparent 40%),
    var(--bg);
}

.gm-style .marker-label {
  background: #fff;
  border: 1px solid #0f172a;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.menu-visibility-toggle {
  position: fixed;
  left: calc(18px + var(--safe-left));
  top: calc(18px + var(--safe-top));
  z-index: 22;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(12, 20, 36, 0.92);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

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

.map-tools {
  position: fixed;
  top: calc(18px + var(--safe-top));
  right: calc(18px + var(--safe-right));
  z-index: 22;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.map-tool {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.7);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.map-tool .btn-icon {
  width: 20px;
  height: 20px;
  color: #f8fafc;
}

.details-panel {
  position: fixed;
  top: calc(16px + var(--safe-top));
  bottom: calc(16px + var(--safe-bottom));
  left: calc(16px + var(--safe-left));
  width: min(380px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(10, 16, 30, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  z-index: 21;
  pointer-events: auto;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.details-panel[data-visible="false"] {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}

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

.details-panel[data-view="content"] .details-panel-head {
  display: none;
}

.details-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.panel-menu {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.panel-menu[hidden] {
  display: none;
}

.menu-btn {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(12, 20, 36, 0.88);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 600;
  text-align: left;
  width: 100%;
}

.menu-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.menu-btn[data-import-status]::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  top: 6px;
  right: 6px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.04);
}

.menu-btn[data-import-status="running"]::after {
  background: #f97316;
}

.menu-btn[data-import-status="completed"]::after {
  background: #22c55e;
}

.menu-btn[data-import-status="error"]::after {
  background: #ef4444;
}

.btn-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  background: linear-gradient(140deg, #f8fafc, #cbd5e1);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.search-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E");
}

.filter-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Cline x1='5' y1='6' x2='19' y2='6'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cline x1='5' y1='18' x2='19' y2='18'/%3E%3Ccircle cx='9' cy='6' r='2'/%3E%3Ccircle cx='15' cy='12' r='2'/%3E%3Ccircle cx='11' cy='18' r='2'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Cline x1='5' y1='6' x2='19' y2='6'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cline x1='5' y1='18' x2='19' y2='18'/%3E%3Ccircle cx='9' cy='6' r='2'/%3E%3Ccircle cx='15' cy='12' r='2'/%3E%3Ccircle cx='11' cy='18' r='2'/%3E%3C/svg%3E");
}

.list-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Crect x='5' y='4' width='14' height='16' rx='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='16' y2='12'/%3E%3Cline x1='8' y1='16' x2='13' y2='16'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Crect x='5' y='4' width='14' height='16' rx='2'/%3E%3Cline x1='8' y1='8' x2='16' y2='8'/%3E%3Cline x1='8' y1='12' x2='16' y2='12'/%3E%3Cline x1='8' y1='16' x2='13' y2='16'/%3E%3C/svg%3E");
}

.pin-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Cpath d='M12 21s7-7.03 7-11.5A7 7 0 0 0 12 2a7 7 0 0 0-7 7.5C5 13.97 12 21 12 21Z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Cpath d='M12 21s7-7.03 7-11.5A7 7 0 0 0 12 2a7 7 0 0 0-7 7.5C5 13.97 12 21 12 21Z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E");
}

.upload-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='M8 7l4-4 4 4'/%3E%3Cpath d='M4 15v2a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-2'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='M8 7l4-4 4 4'/%3E%3Cpath d='M4 15v2a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-2'/%3E%3C/svg%3E");
}

.person-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M6 20c0-3.314 2.686-6 6-6s6 2.686 6 6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M6 20c0-3.314 2.686-6 6-6s6 2.686 6 6'/%3E%3C/svg%3E");
}

.fit-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Cpath d='M8 8h3V5'/%3E%3Cpath d='M16 8h-3V5'/%3E%3Cpath d='M8 16h3v3'/%3E%3Cpath d='M16 16h-3v3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Cpath d='M8 8h3V5'/%3E%3Cpath d='M16 8h-3V5'/%3E%3Cpath d='M8 16h3v3'/%3E%3Cpath d='M16 16h-3v3'/%3E%3C/svg%3E");
}

.table-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cline x1='9' y1='4' x2='9' y2='20'/%3E%3Cline x1='15' y1='4' x2='15' y2='20'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cline x1='9' y1='4' x2='9' y2='20'/%3E%3Cline x1='15' y1='4' x2='15' y2='20'/%3E%3C/svg%3E");
}

.menu-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Cline x1='4' y1='6' x2='20' y2='6'/%3E%3Cline x1='4' y1='12' x2='20' y2='12'/%3E%3Cline x1='4' y1='18' x2='20' y2='18'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='2' fill='none'%3E%3Cline x1='4' y1='6' x2='20' y2='6'/%3E%3Cline x1='4' y1='12' x2='20' y2='12'/%3E%3Cline x1='4' y1='18' x2='20' y2='18'/%3E%3C/svg%3E");
}

.menu-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.25);
  margin: 4px 0;
  border-radius: 999px;
}

.panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.panel-content[hidden] {
  display: none;
}

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

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.panel {
  width: 100%;
  pointer-events: auto;
  transform: none;
  opacity: 1;
  transition: none;
  max-height: none;
  overflow-y: visible;
}

.data-panel {
  width: min(1100px, calc(100% - 32px));
  max-height: 80vh;
}

.data-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.data-controls .clearable-input {
  flex: 1 1 260px;
}

.data-controls .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #cbd5f5;
}

.data-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.data-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}

.data-tab.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.25);
}

.data-tab-panel[hidden] {
  display: none;
}

.data-tag-table {
  display: grid;
  gap: 10px;
}

.data-tag-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 120px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-strong);
}

.data-tag-row.data-tag-header {
  background: var(--surface);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.data-tag-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.data-table {
  /* border-radius: 18px; */
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.75);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}

.data-table .tabulator {
  background: transparent;
  color: #f8fafc;
}

.data-table .tabulator-header {
  background: rgba(30, 41, 59, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.data-table .tabulator-row {
  /* background: rgba(15, 23, 42, 0.25); */
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.data-table .tabulator-row.is-closed {
  opacity: 0.55;
}

.data-table .tabulator-row.tabulator-row-even {
  /* background: rgba(30, 41, 59, 0.5); */
}

.data-table .tabulator-row.tabulator-selectable:hover {
  background: rgba(59, 130, 246, 0.2);
}

.data-table .tabulator-cell {
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  /* color: #f1f5f9; */
}

.data-table .tabulator-cell.tabulator-editing {
  overflow: visible;
}

.data-table .tabulator-cell:last-child {
  border-right: none;
}

.data-table .tabulator .tabulator-footer {
  background: rgba(30, 41, 59, 0.95);
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
}

.table-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.table-action-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.table-action-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

.table-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.table-list-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.panel.is-open {
  transform: none;
  opacity: 1;
}

.panel::before {
  display: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.panel-head,
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.panel-head h3,
.card-head h3 {
  margin: 0;
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  background: rgba(59, 130, 246, 0.7);
  border: 1px solid var(--border);
  color: #f8fafc;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.status-row .hint {
  flex: 1;
}

.warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}

.pwa-update {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  z-index: 30;
  pointer-events: auto;
  box-shadow: var(--shadow);
}

.pwa-update[hidden] {
  display: none;
}

@media (max-width: 640px) {
  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

.map-warning {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 30;
  pointer-events: auto;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 12;
  pointer-events: auto;
}

.sheet-backdrop[hidden] {
  display: none;
}

.input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.input-row input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 15px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input-row input::placeholder,
textarea::placeholder,
select::placeholder,
.tag-input input::placeholder {
  color: #9fb0c6;
}

.input-row input:focus,
textarea:focus,
.tag-input:focus-within {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.clearable-input {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.clearable-input input,
.clearable-input textarea {
  padding-right: 34px;
}

.input-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.input-clear:hover {
  background: rgba(148, 163, 184, 0.35);
}

.input-clear.inline {
  position: static;
  transform: none;
  margin-left: auto;
  align-self: center;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:focus-visible,
.filter-tag:focus-visible,
.list-edit:focus-visible,
.small-link:focus-visible,
.icon-close:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.9);
  outline-offset: 2px;
}

.tag-input input:focus,
.tag-input input:focus-visible {
  outline: none;
}

.menu-btn.primary,
button.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b1021;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(34, 211, 238, 0.25);
}

button.primary:active {
  transform: translateY(1px);
}

button.ghost {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border);
}

button.wide {
  width: 100%;
  margin-top: 12px;
}

.search-results {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.result {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.result .info {
  display: grid;
  gap: 4px;
}

.result h4 {
  margin: 0;
}

.result .address {
  color: #cbd5e1;
  font-size: 13px;
}

.selection-card .address {
  color: #cbd5e1;
  margin-top: 4px;
}

.selection-card .meta {
  color: #cbd5e1;
  font-size: 13px;
  margin: 6px 0 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: #cbd5e1;
  margin-bottom: 10px;
  font-size: 14px;
}

.field.stack {
  gap: 10px;
}

.strong {
  color: var(--text);
  font-weight: 600;
}

.radio-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.radio-row input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--accent);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

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

.tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-strong);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

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

.tag-input-field {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.chip {
  background: rgba(59, 130, 246, 0.25);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip .remove {
  background: transparent;
  border: none;
  color: #d7e3f0;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
}

.tag-input input {
  border: none;
  background: transparent;
  padding: 4px;
  flex: 1;
  min-width: 140px;
  color: var(--text);
  font-size:15px;
}

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

.tag-suggestion-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 8;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
}

.tag-suggestion-item {
  border: 1px solid transparent;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
}

.tag-suggestion-item.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.3);
}

.tag-editor {
  position: relative;
}

.tag-editor input {
  width: 100%;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.filter-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}

.filter-tab.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.25);
}

.filter-tab-panel {
  margin-top: 10px;
}

.filter-tag {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: #e5edf6;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}

.filter-tag.active {
  background: rgba(59, 130, 246, 0.35);
  border-color: var(--accent);
}

.list-checkboxes {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.list-checkbox {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-strong);
}

.list-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.list-checkbox-text {
  display: grid;
  gap: 2px;
}

.list-checkbox.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.list-pill {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.list-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.list-body {
  display: grid;
  gap: 4px;
  flex: 1;
}

.list-name {
  font-weight: 600;
}

.list-desc {
  color: #cbd5e1;
  font-size: 13px;
}

.list-edit {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}

.list-edit:hover {
  border-color: var(--accent);
}

select#list-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
}

.saved-panel {
  max-height: 60vh;
  overflow-y: auto;
}

.saved-list {
  display: grid;
  gap: 10px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}

.saved-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 4px;
}

.saved-item h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.saved-item .small {
  color: #d7e0ea;
  font-size: 12px;
}

.saved-item .open-status {
  font-weight: 600;
  color: #22c55e;
  font-size: 12px;
}

.saved-item.is-closed {
  opacity: 0.55;
}

.saved-item.is-closed .open-status {
  color: #fca5a5;
}

.saved-item .open-status.unknown {
  color: #cbd5e1;
}

.tag-badge {
  display: inline-flex;
  background: rgba(14, 116, 144, 0.45);
  color: #e0f2fe;
  border: 1px solid rgba(125, 211, 252, 0.6);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 6px;
}

.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.small-link {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.35);
}

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

.filter-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

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

.business-status {
  margin-top: 4px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 600;
}

.opening-hours {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.opening-hours-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}

.hours-list {
  display: grid;
  gap: 4px;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #cbd5e1;
}

.lists-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}

.list-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.list-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-row-text {
  display: grid;
  gap: 2px;
}

.list-meta {
  color: #cbd5e1;
  font-size: 13px;
}

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


.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
}

.modal[hidden] {
  display: none !important;
}

.modal-content {
  background: #0b1224;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  width: min(480px, 100%);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.icon-close:hover {
  color: var(--accent);
}

.icon-close.mini {
  font-size: 18px;
  padding: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.icon-close.mini:hover {
  border-color: var(--accent);
  color: #f8fafc;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

button.small {
  padding: 8px 12px;
  font-size: 13px;
}

button.danger {
  color: #fca5a5;
  border-color: #ef4444;
}

a {
  color: #05a4f7;
}

a:hover {
  color: #73cbfa;
}

.map-note a{
  color:var(--accent);
}

.map-note a:hover{
  color:var(--accent-2);
}

@media (max-width: 960px) {
  .details-panel {
    width: min(360px, calc(100% - 32px));
  }
}

@media (max-width: 720px) {
  .menu-visibility-toggle {
    left: 50%;
    top: auto;
    bottom: calc(18px + var(--safe-bottom));
    transform: translateX(-50%);
  }

  .details-panel {
    top: auto;
    bottom: calc(12px + var(--safe-bottom));
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 120px);
    border-radius: 20px;
  }

  .details-panel[data-visible="false"] {
    transform: translateY(calc(100% + 24px));
  }

  .panel::before {
    display: block;
    content: "";
    width: 44px;
    height: 4px;
    margin: 2px auto 12px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.3);
  }

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

  .menu-btn {
    padding: 12px;
  }

  .panel-content-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row input,
  textarea,
  select,
  .tag-input input {
    font-size: 16px;
  }
}
