* {
  box-sizing: border-box;
}

:root {
  --bg: #08111f;
  --panel: rgba(6, 16, 35, 0.96);
  --panel-soft: rgba(12, 26, 53, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7f9fd;
  --muted: #b1bdd3;
  --chip: #13284d;
  --chip-active: #214b95;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --accent: #5da5ff;
  --inset-top: env(safe-area-inset-top, 0px);
  --inset-right: env(safe-area-inset-right, 0px);
  --inset-bottom: env(safe-area-inset-bottom, 0px);
  --inset-left: env(safe-area-inset-left, 0px);
  --mobile-float-gap: 12px;
  --mobile-toggle-size: 46px;
  --browser-chrome-top: 0px;
  --browser-chrome-bottom: 0px;
}

html, body {
  margin: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: Inter, Arial, sans-serif;
  background: #020814;
  color: var(--text);
}

html {
  height: -webkit-fill-available;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

.hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(83, 136, 255, 0.16), transparent 32%),
    linear-gradient(180deg, #071120 0%, #08101c 100%);
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background: rgba(6, 16, 35, 0.96);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 8px 0 12px;
  font-size: 34px;
  line-height: 1.05;
}

.auth-lede {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 15px;
}

.auth-field {
  display: block;
  margin: 0 0 16px;
}

.auth-field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #c8d7ef;
  letter-spacing: 0.02em;
}

.auth-field-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(140, 182, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #f5f8ff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 14px;
}

.auth-field-input::placeholder {
  color: #6f84a8;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.auth-field-input:focus {
  outline: none;
  border-color: rgba(131, 180, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(83, 136, 255, 0.18);
}

.auth-field-hint {
  display: block;
  margin-top: 8px;
  color: #7f93b5;
  font-size: 12px;
  line-height: 1.35;
}

.auth-meta {
  margin: 0 0 18px;
  color: #8ea5c8;
  font-size: 14px;
}

.auth-btn {
  width: 100%;
}

.auth-error-panel {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 120, 140, 0.25);
  background: rgba(255, 80, 100, 0.08);
}

.auth-error-title {
  margin: 0;
  color: #ffb3c0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.auth-error-detail {
  margin: 6px 0 0;
  color: #d9a0ab;
  font-size: 13px;
  line-height: 1.45;
}

.auth-error {
  margin: 14px 0 0;
  color: #ff9eb0;
  font-size: 14px;
}

.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(10, 20, 40, 0.9);
}

.user-bar-identity {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-display-name {
  color: #d8e5ff;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-display-name.hidden {
  display: none;
}

.user-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.user-bar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8e5ff;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.user-bar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.user-bar-icon-btn .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
}

.sidebar .user-bar {
  gap: 8px;
  border: 1px solid #dfe7f3;
  border-radius: 10px;
  padding: 5px 8px;
  background: #fff;
  flex-shrink: 0;
  margin-top: auto;
}

.sidebar .user-display-name {
  color: #1c2740;
  font-size: 12px;
}

.sidebar .user-bar-icon-btn {
  width: 28px;
  height: 28px;
  border-color: #dfe7f3;
  border-radius: 8px;
  background: #f7f9fc;
  color: #5a7090;
}

.sidebar .user-bar-icon-btn:hover {
  background: #edf3ff;
  border-color: #b8c9e6;
  color: #2563eb;
}

.sidebar .user-bar-icon-btn .material-symbols-outlined {
  font-size: 17px;
}

.user-email {
  color: #d8e5ff;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .user-email {
  color: #5a7090;
  font-size: 11px;
  font-weight: 500;
}

.user-email--secondary {
  font-size: 10px;
  font-weight: 500;
  color: #8a9bb5;
}

.sidebar .user-email--secondary {
  font-size: 10px;
  color: #8a9bb5;
}

.sign-out-btn {
  padding: 8px 12px;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar .sign-out-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 380px 1fr;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  height: 100vh;
  height: 100dvh;
}

.sidebar {
  background: #f7f9fc;
  border-right: 1px solid #e3eaf5;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  color: #1c2740;
}

.brand {
  letter-spacing: 0.18em;
  font-size: 13px;
  font-weight: 800;
  color: #a7d5ff;
}

.sidebar-brand {
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
  color: #8a9bb5;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-add-place-btn {
  width: 100%;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  flex-shrink: 0;
}

.sidebar-add-place-btn .material-symbols-outlined {
  font-size: 20px;
}

.sidebar-close-btn {
  display: none;
  align-items: center;
  gap: 6px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.24);
}

.sidebar-close-btn .material-symbols-outlined {
  font-size: 18px;
}

.sidebar-backdrop {
  display: none;
}

.search-wrap {
  margin-top: 0;
}

.search-done-btn {
  display: none;
}

.sidebar #searchInput {
  width: 100%;
  border: 1px solid #ccd6eb;
  background: #fff;
  color: #1b2a44;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
}

.sidebar #searchInput::placeholder {
  color: #9aaac0;
}

.sidebar .filter-chip {
  border: 1px solid #dfe7f3;
  background: #fff;
  color: #4b5d7c;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
}

.sidebar .filter-chip.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.sidebar .list-meta {
  color: #7a8da8;
  font-size: 12px;
  font-weight: 500;
}

.sidebar .place-card {
  background: #fff;
  border: 1px solid #e3eaf5;
  box-shadow: 0 4px 14px rgba(15, 27, 55, 0.06);
}

.sidebar .place-card:hover,
.sidebar .place-card.active {
  border-color: #c5d4ea;
  box-shadow: 0 6px 18px rgba(15, 27, 55, 0.08);
}

.sidebar .place-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1b2a44;
}

.sidebar .place-card p {
  color: #6b7f9e;
  font-size: 13px;
  font-weight: 400;
  white-space: pre-line;
}

.sidebar .place-badge {
  color: #4b5d7c;
  font-weight: 600;
  background: #f0f4fa;
}

.sidebar .empty-state {
  color: #7a8da8;
  border-color: #dfe7f3;
  background: #fff;
}

.sidebar .empty-state-title {
  margin: 0;
  color: #2f3f58;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.sidebar .empty-state-detail {
  margin: 8px 0 0;
  color: #6b7f9e;
  font-size: 13px;
  line-height: 1.45;
}

.sidebar .welcome-panel {
  text-align: left;
}

.sidebar .empty-state-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.sidebar .empty-state-btn {
  width: 100%;
  font-size: 14px;
  padding: 12px 16px;
}

.sidebar .empty-state-actions .btn.primary {
  background: #0d1b3d;
}

.sidebar .empty-state-actions .btn.secondary {
  background: #f5f8ff;
}

#searchInput {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(10, 20, 40, 0.9);
  color: white;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 15px;
  outline: none;
}

#searchInput::placeholder {
  color: #8795b0;
}

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

.filter-chip {
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--chip);
  color: #d8e5ff;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.filter-chip-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.filter-chip .category-icon {
  display: block;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 20;
}

.filter-chip.active {
  background: var(--chip-active);
  color: white;
  border-color: rgba(138, 186, 255, 0.45);
}

.list-meta {
  color: #8ea5c8;
  font-size: 13px;
  padding: 2px 4px 0;
}

.places-list {
  overflow: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar .places-list {
  flex: 1;
  min-height: 0;
}

.place-card {
  background: linear-gradient(180deg, rgba(13, 24, 47, 0.96), rgba(11, 20, 38, 0.98));
  border: 1px solid rgba(140, 182, 255, 0.12);
  border-radius: 22px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.place-card--compact {
  padding: 10px 12px;
}

.place-card:hover,
.place-card.active {
  transform: translateY(-1px);
  border-color: rgba(131, 180, 255, 0.36);
}

.place-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.15;
}

.place-card p {
  margin: 0;
  color: #c2cee2;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.place-badge {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #dbe8ff;
  background: rgba(255,255,255,0.08);
  padding: 7px 10px;
  border-radius: 999px;
}

.place-badge .category-icon {
  display: block;
  flex-shrink: 0;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 20;
}

.sidebar-footer {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15, 25, 45, 0.92);
  border-radius: 18px;
  padding: 14px 16px;
  color: #c6d2e8;
  font-size: 13px;
  line-height: 1.45;
}

.sidebar-footer strong {
  display: block;
  margin-bottom: 8px;
  color: white;
}

.sidebar-footer ol {
  margin: 0;
  padding-left: 18px;
}

.map-area {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: #d6dde8;
}

#map {
  height: 100%;
  width: 100%;
}

.map-search-wrap {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: min(408px, calc(100% - 240px));
}

.map-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  border: 1px solid #dfe7f3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(15, 27, 55, 0.12);
  backdrop-filter: blur(8px);
}

.map-current-location-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #dfe7f3;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(15, 27, 55, 0.12);
  color: #4b5d7c;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-current-location-btn:hover {
  background: #f0f4fa;
  border-color: #c5d4ea;
  color: #2563eb;
}

.map-current-location-btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.map-current-location-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.map-current-location-btn .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
}

.map-search-icon {
  flex-shrink: 0;
  font-size: 20px;
  color: #7a8da8;
  line-height: 1;
}

#mapSearchInput {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #1b2a44;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
}

#mapSearchInput::placeholder {
  color: #9aaac0;
}

#mapSearchInput::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.map-search-suggestions {
  margin-top: 6px;
  border: 1px solid #dfe7f3;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(15, 27, 55, 0.14);
  overflow: hidden;
}

.map-search-suggestion {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef2f8;
  background: transparent;
  color: #30456f;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.map-search-suggestion:last-child {
  border-bottom: 0;
}

.map-search-suggestion:hover,
.map-search-suggestion:focus-visible,
.map-search-suggestion.active {
  background: #f0f4fa;
  color: #1b2a44;
  outline: none;
}

.map-search-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 10px 10px 12px;
  border: 1px solid #dfe7f3;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(15, 27, 55, 0.14);
}

.map-search-action.hidden {
  display: none;
}

.map-search-action-copy {
  min-width: 0;
}

.map-search-action-label {
  display: block;
  color: #7a8da8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-search-action-name {
  display: block;
  margin-top: 2px;
  color: #1b2a44;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-search-save-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.map-search-action.is-saving {
  opacity: 0.92;
}

.map-search-action.is-saving .map-search-save-btn:disabled {
  opacity: 0.72;
}

.map-search-action-dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid #dfe7f3;
  border-radius: 999px;
  background: #fff;
  color: #4b5d7c;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.map-search-action-dismiss:hover {
  background: #f3f7fd;
  border-color: #c5d4ea;
  color: #1b2a44;
}

.map-type-switch {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 3;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 14px;
  background: rgba(10, 17, 31, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.map-type-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  padding: 0;
  font: inherit;
  color: #b8c7e6;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.map-type-btn .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
}

.map-type-btn:hover {
  color: #ecf3ff;
  background: rgba(255, 255, 255, 0.08);
}

.map-type-btn.active {
  color: #0a111f;
  background: #ecf3ff;
}

.map-add-place-fab {
  display: none;
}

.popup-card {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 4;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  background: rgba(250, 252, 255, 0.98);
  color: #1c2740;
  border-radius: 28px;
  box-shadow: 0 20px 70px rgba(15, 27, 55, 0.3);
  overflow: hidden;
}

.popup-card.hidden {
  display: none;
}

.popup-top {
  position: relative;
  flex-shrink: 0;
  color: white;
  padding: 18px 18px 16px;
  min-height: 178px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
}

.popup-top--placeholder {
  background-image: linear-gradient(135deg, #5f718f 0%, #8ea3c4 55%, #cfd9ea 100%);
}

.popup-photo-attribution {
  position: absolute;
  bottom: 12px;
  right: 14px;
  z-index: 2;
  max-width: 55%;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.92);
  text-align: right;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.popup-photo-attribution a {
  color: inherit;
  text-decoration: underline;
}

.popup-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,18,40,0.12), rgba(7,18,40,0.62));
}

.popup-top-content {
  position: relative;
  z-index: 1;
}

.popup-top h2 {
  margin: 0;
  font-size: 42px;
  line-height: 1.02;
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: #20304d;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.popup-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 18px 22px 18px;
  overflow: hidden;
}

.popup-type {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  color: #4b5d7c;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 12px;
  min-width: 0;
}

.popup-type .category-icon {
  display: block;
  flex-shrink: 0;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 20;
}

.material-symbols-outlined.category-icon {
  user-select: none;
}

.popup-description {
  margin: 0 0 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  font-size: 17px;
  line-height: 1.55;
  color: #596781;
  white-space: pre-line;
}

.popup-description .text-link,
.place-card .text-link {
  color: #2f5fd0;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.popup-description .text-link:hover,
.place-card .text-link:hover {
  color: #1d4ed8;
}

.popup-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.popup-footer {
  display: flex;
  flex-shrink: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.popup-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.popup-edit-btn {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #ccd6eb;
  border-radius: 999px;
  background: #fff;
  color: #30456f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.popup-edit-btn:hover {
  background: #f3f7fd;
  border-color: #9eb4dc;
}

.popup-actions .btn {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
}

.popup-delete-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e2c4c8;
  border-radius: 999px;
  background: #fff5f6;
  color: #b42338;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.popup-delete-btn:hover {
  background: #ffe8eb;
  border-color: #d48492;
}

.popup-delete-icon {
  display: block;
}

.edit-place-card {
  width: min(420px, 100%);
}

.edit-place-title {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.2;
  color: #1b2a44;
}

.edit-place-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #4b5d7c;
}

.edit-field input,
.edit-field textarea,
.edit-field select {
  width: 100%;
  border: 1px solid #ccd6eb;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  color: #1b2a44;
  background: #fff;
}

.edit-field textarea {
  resize: vertical;
  min-height: 96px;
}

.edit-field-hint {
  color: #7a8da8;
  font-size: 12px;
  line-height: 1.4;
}

.edit-field--icon {
  gap: 8px;
}

.edit-icon-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.edit-icon-suggestion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid #ccd6eb;
  border-radius: 50%;
  background: #f7faff;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.edit-icon-suggestion:hover {
  background: #edf3ff;
  border-color: #9db4e0;
}

.edit-icon-suggestion.active {
  border-color: #2563eb;
  background: #edf3ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.edit-icon-suggestion .category-icon {
  line-height: 1;
}

.edit-place-error {
  margin: 0;
  color: #b42338;
  font-size: 13px;
  font-weight: 600;
}

.add-place-lede {
  margin: -8px 0 14px;
  color: #5a7090;
  font-size: 14px;
  line-height: 1.45;
}

.add-place-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: #edf2fa;
  border: 1px solid #dfe7f3;
}

.add-place-mode-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #5a7090;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.add-place-mode-btn.active {
  color: #1b2a44;
  background: #fff;
  box-shadow: 0 1px 2px rgba(27, 42, 68, 0.08);
}

.add-place-mode-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.add-place-panel.hidden {
  display: none;
}

.add-place-identify-panel.hidden {
  display: none;
}

.add-place-photo-field {
  gap: 10px;
}

.add-place-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.add-place-photo-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 148px;
  padding: 18px 16px;
  border: 1px dashed #b8c7df;
  border-radius: 14px;
  background: #f7faff;
  color: #4b5d7c;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.add-place-photo-picker:hover {
  background: #edf3ff;
  border-color: #9db4e0;
}

.add-place-photo-picker.is-dragover {
  border-color: #2563eb;
  background: #edf3ff;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.add-place-photo-picker .material-symbols-outlined {
  font-size: 32px;
  color: #2563eb;
}

.add-place-photo-picker-text {
  font-size: 14px;
  font-weight: 700;
  color: #1b2a44;
}

.add-place-photo-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.add-place-photo-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #ccd6eb;
  background: #edf2fa;
}

.add-place-photo-remove {
  align-self: flex-start;
}

.add-place-processing {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #edf3ff;
  border: 1px solid #c9d9f5;
  color: #1b2a44;
}

.add-place-processing.hidden {
  display: none;
}

.add-place-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #c9d9f5;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: add-place-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.add-place-processing p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.add-place-card.is-processing .add-place-mode,
.add-place-card.is-processing .add-place-panel,
.add-place-card.is-processing .add-place-identify-panel,
.add-place-card.is-processing .add-place-review-panel,
.add-place-card.is-processing .add-place-actions {
  opacity: 0.55;
}

.add-place-card.is-processing .edit-field input,
.add-place-card.is-processing .add-place-mode-btn,
.add-place-card.is-processing .add-place-photo-picker,
.add-place-card.is-processing .add-place-photo-remove {
  pointer-events: none;
}

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

.settings-card {
  width: min(1080px, calc(100vw - 48px));
  max-width: 100%;
  box-sizing: border-box;
}

.settings-dialog .confirm-dialog-card.settings-card {
  width: min(1080px, calc(100vw - 48px));
}

.settings-form {
  gap: 14px;
}

.settings-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 14px;
  background: #edf2fa;
  border: 1px solid #dfe7f3;
}

.settings-tab {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #5a7090;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.settings-tab.active {
  color: #1b2a44;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 27, 55, 0.08);
}

.settings-tab:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.settings-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-tab-panel.hidden {
  display: none;
}

.settings-tab-placeholder {
  margin: 0;
  padding: 14px 12px;
  border-radius: 12px;
  background: #f7f9fc;
  border: 1px dashed #ccd6eb;
  color: #5a7090;
  font-size: 13px;
  line-height: 1.45;
}

.settings-pref-slot {
  margin-top: 0;
}

.settings-prefs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 20px;
}

.settings-prefs-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.settings-dropdown {
  position: relative;
  min-width: 0;
}

.settings-dropdown-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #dfe7f3;
  border-radius: 12px;
  background: #fff;
  color: #1b2a44;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.settings-dropdown-trigger:hover,
.settings-dropdown-trigger:focus-visible {
  border-color: #b8c9e4;
  background: #f8faff;
}

.settings-dropdown.is-open .settings-dropdown-trigger,
.settings-dropdown-trigger[aria-expanded="true"] {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  background: #f5f9ff;
}

.settings-dropdown-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #1b2a44;
}

.settings-dropdown-value {
  justify-self: end;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #5a7090;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-dropdown-chevron {
  flex-shrink: 0;
  font-size: 20px;
  color: #7a8da8;
  transition: transform 0.15s ease;
}

.settings-dropdown.is-open .settings-dropdown-chevron {
  transform: rotate(180deg);
}

.settings-dropdown-panel {
  margin-top: 6px;
  padding: 8px;
  border: 1px solid #dfe7f3;
  border-radius: 12px;
  background: #f8faff;
  max-height: min(240px, 40vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-dropdown-panel.hidden {
  display: none;
}

.settings-dropdown-panel .settings-chip-grid {
  gap: 6px;
}

.settings-dropdown-panel .settings-option-list {
  gap: 4px;
}

.settings-dropdown-panel .settings-chip {
  padding: 7px 10px;
  font-size: 11px;
}

.settings-dropdown-panel .settings-option {
  padding: 8px 10px;
}

.settings-dropdown-panel .settings-tone-description {
  font-size: 11px;
}

.settings-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-chip {
  border: 1px solid #ccd6eb;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: #4b5d7c;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.settings-chip:hover,
.settings-chip:focus-visible {
  border-color: #9eb4d8;
}

.settings-chip.is-selected {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.settings-option-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #dfe7f3;
  border-radius: 12px;
  background: #fff;
  color: #1b2a44;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.settings-option:hover,
.settings-option:focus-visible {
  border-color: #b8c9e4;
  background: #f8faff;
}

.settings-option.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  background: #f5f9ff;
}

.settings-option-indicator {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid #b8c9e4;
  background: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.settings-option.is-selected .settings-option-indicator {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: inset 0 0 0 3px #fff;
}

.settings-option-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.settings-tone-option {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.settings-tone-option-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-tone-description {
  margin: 0;
  padding-left: 26px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: #7a8da8;
}

.settings-travel-profile-meta {
  display: flex;
  justify-content: flex-end;
}

.settings-chatgpt-hint {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 12px;
  background: #f7f9fc;
  border: 1px solid #dfe7f3;
}

.settings-chatgpt-hint-text {
  margin: 0;
  color: #5a7090;
  font-size: 13px;
  line-height: 1.45;
}

.settings-copy-prompt-btn {
  align-self: flex-start;
  min-height: 40px;
  padding: 10px 14px;
  font-size: 13px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#settingsTravelProfile {
  min-height: 140px;
  resize: vertical;
}

.settings-dialog-actions {
  margin-top: 4px;
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding:
    max(20px, var(--inset-top))
    max(20px, var(--inset-right))
    max(20px, var(--inset-bottom))
    max(20px, var(--inset-left));
  background: rgba(8, 17, 31, 0.45);
  box-sizing: border-box;
}

.confirm-dialog.hidden {
  display: none;
}

body.overlay-scroll-locked {
  overflow: hidden;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding:
    max(20px, var(--inset-top))
    max(20px, var(--inset-right))
    max(20px, var(--inset-bottom))
    max(20px, var(--inset-left));
  background: rgba(8, 17, 31, 0.55);
  box-sizing: border-box;
}

.onboarding-overlay.hidden {
  display: none;
}

.onboarding-card {
  width: min(420px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, #101d36 0%, #0a1428 100%);
  border: 1px solid rgba(140, 182, 255, 0.16);
  border-radius: 24px;
  padding: 28px 26px 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  color: #eef4ff;
}

.onboarding-card .brand {
  margin-bottom: 14px;
}

.onboarding-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.onboarding-lede {
  margin: 0 0 16px;
  color: #a9b9d4;
  font-size: 15px;
  line-height: 1.45;
}

.onboarding-steps {
  margin: 0 0 20px;
  padding-left: 20px;
  color: #c5d3ea;
  font-size: 14px;
  line-height: 1.5;
}

.onboarding-steps li + li {
  margin-top: 6px;
}

.onboarding-btn {
  width: 100%;
}

.prefs-wizard-card {
  width: min(520px, 100%);
  max-width: 100%;
  max-height: min(720px, calc(100dvh - 40px));
  min-height: 280px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 22px 22px 20px;
}

.prefs-wizard-header {
  flex-shrink: 0;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prefs-wizard-progress {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ca8d8;
}

.prefs-wizard-progress-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prefs-wizard-progress-dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(140, 182, 255, 0.18);
  transition: background 0.15s ease, transform 0.15s ease;
}

.prefs-wizard-progress-dot.is-active {
  background: #5b9cff;
  transform: scaleY(1.35);
}

.prefs-wizard-progress-dot.is-complete {
  background: rgba(91, 156, 255, 0.55);
}

.prefs-wizard-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.prefs-wizard-content {
  min-height: 120px;
}

.prefs-wizard-screen-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.prefs-wizard-screen-lede {
  margin: 0 0 16px;
  color: #a9b9d4;
  font-size: 15px;
  line-height: 1.45;
}

.prefs-wizard-screen-slot {
  min-height: 48px;
}

.prefs-wizard-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(140, 182, 255, 0.12);
}

.prefs-wizard-skip {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 14px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: #5b9cff;
  color: #061224;
}

.prefs-wizard-skip:hover {
  background: #7eb3ff;
}

.prefs-wizard-next {
  min-width: 120px;
  margin-left: auto;
  padding: 12px 20px;
  font-size: 14px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: #ffffff;
  color: #0d1b3d;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.prefs-wizard-next:hover {
  background: #eef4ff;
}

.mobile-add-place-hint {
  display: none;
}

.mobile-add-place-hint-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(300px, 100%);
  padding: 22px 20px 18px;
  border-radius: 22px;
  background: rgba(10, 20, 40, 0.92);
  border: 1px solid rgba(140, 182, 255, 0.2);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.mobile-add-place-hint-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #eef4ff;
}

.mobile-add-place-hint-copy {
  margin: 0;
  color: #a9b9d4;
  font-size: 14px;
  line-height: 1.45;
}

.mobile-add-place-hint-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  background: #ffffff;
  color: #0d1b3d;
  border: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-add-place-hint-btn:hover {
  background: #eef4ff;
}

.mobile-add-place-hint-dismiss {
  border: 0;
  background: transparent;
  color: #8ca8d8;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.prefs-wizard-card--motivations {
  width: min(560px, 100%);
}

.motivation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.motivation-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 2px solid rgba(140, 182, 255, 0.14);
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.45);
  cursor: pointer;
  overflow: visible;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) {
  .motivation-card:hover {
    border-color: rgba(140, 182, 255, 0.42);
    transform: translateY(-1px);
  }
}

.motivation-card:focus-visible {
  border-color: rgba(140, 182, 255, 0.42);
  outline: 2px solid rgba(91, 156, 255, 0.45);
  outline-offset: 2px;
}

.motivation-card:active {
  transform: scale(0.97);
}

.motivation-card.is-selected {
  border-color: #5b9cff;
  box-shadow: 0 0 0 2px rgba(91, 156, 255, 0.28);
}

.motivation-card-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 11px;
}

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

.motivation-card-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 2;
  transform: translateX(-50%) translateY(6px);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(6, 12, 24, 0.92);
  border: 1px solid rgba(140, 182, 255, 0.22);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  color: #eef4ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

.motivation-card:hover .motivation-card-hint,
.motivation-card:focus-visible .motivation-card-hint,
.motivation-card:active .motivation-card-hint {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (hover: none) {
  .motivation-card.is-selected .motivation-card-hint {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

.motivation-card-check {
  position: absolute;
  top: 7px;
  right: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(6, 12, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.motivation-card-check .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}

.motivation-card.is-selected .motivation-card-check {
  background: #5b9cff;
  border-color: #7eb3ff;
  color: #061224;
}

.effort-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.effort-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 14px 14px;
  border: 2px solid rgba(140, 182, 255, 0.14);
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.45);
  color: #eef4ff;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

@media (hover: hover) {
  .effort-option:hover {
    border-color: rgba(140, 182, 255, 0.42);
    background: rgba(12, 24, 44, 0.72);
  }
}

.effort-option:focus-visible {
  border-color: rgba(140, 182, 255, 0.42);
  background: rgba(12, 24, 44, 0.72);
  outline: 2px solid rgba(91, 156, 255, 0.45);
  outline-offset: 2px;
}

.effort-option:active {
  transform: scale(0.99);
}

.effort-option.is-selected {
  border-color: #5b9cff;
  box-shadow: 0 0 0 2px rgba(91, 156, 255, 0.28);
  background: rgba(16, 34, 62, 0.88);
}

.effort-option-indicator {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(140, 182, 255, 0.45);
  background: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.effort-option.is-selected .effort-option-indicator {
  border-color: #5b9cff;
  background: #5b9cff;
  box-shadow: inset 0 0 0 3px #0a1428;
}

.effort-option-label {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.avoid-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avoid-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 14px 14px;
  border: 2px solid rgba(140, 182, 255, 0.14);
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.45);
  color: #eef4ff;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

@media (hover: hover) {
  .avoid-option:hover {
    border-color: rgba(140, 182, 255, 0.42);
    background: rgba(12, 24, 44, 0.72);
  }
}

.avoid-option:focus-visible {
  border-color: rgba(140, 182, 255, 0.42);
  background: rgba(12, 24, 44, 0.72);
  outline: 2px solid rgba(91, 156, 255, 0.45);
  outline-offset: 2px;
}

.avoid-option:active {
  transform: scale(0.99);
}

.avoid-option.is-selected {
  border-color: #5b9cff;
  box-shadow: 0 0 0 2px rgba(91, 156, 255, 0.28);
  background: rgba(16, 34, 62, 0.88);
}

.avoid-option-label {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.avoid-option-check {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(140, 182, 255, 0.28);
  color: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.avoid-option-check .material-symbols-outlined {
  font-size: 15px;
  line-height: 1;
}

.avoid-option.is-selected .avoid-option-check {
  background: #5b9cff;
  border-color: #7eb3ff;
  color: #061224;
}

.confirm-dialog-card {
  width: min(360px, 100%);
  background: rgba(250, 252, 255, 0.98);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 20px 70px rgba(15, 27, 55, 0.3);
}

.confirm-dialog-card p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.45;
  color: #1c2740;
  font-weight: 600;
}

.confirm-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.confirm-dialog-actions .btn {
  padding: 10px 14px;
  font-size: 13px;
}

.confirm-delete-yes {
  background: #b42338;
}

.confirm-delete-yes:hover {
  background: #912030;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  background: #0d1b3d;
  color: white;
}

.btn.secondary {
  background: white;
  color: #30456f;
  border: 1px solid #ccd6eb;
}

.mobile-toggle {
  display: none;
  position: absolute;
  top: calc(var(--mobile-float-gap) + var(--inset-top) + var(--browser-chrome-top));
  left: calc(var(--mobile-float-gap) + var(--inset-left));
  z-index: 7;
  border: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(8, 17, 31, 0.94);
  color: white;
  font-size: 24px;
  box-shadow: var(--shadow);
}

.mobile-toggle--close {
  font-size: 30px;
  line-height: 1;
}

.app-toast {
  position: absolute;
  left: calc(16px + var(--inset-left));
  right: calc(16px + var(--inset-right));
  bottom: calc(24px + var(--inset-bottom) + var(--browser-chrome-bottom));
  transform: none;
  z-index: 9;
  width: auto;
  max-width: none;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 14px 40px rgba(15, 27, 55, 0.24);
  pointer-events: none;
}

.app-toast--info {
  background: rgba(250, 252, 255, 0.98);
  color: #1b2a44;
  border: 1px solid #dfe7f3;
}

.app-toast--error {
  background: #fff5f6;
  color: #9f1239;
  border: 1px solid #f1c5cd;
}

.app-toast--success {
  background: #f0fdf6;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.empty-state {
  color: #9fb1cf;
  font-size: 14px;
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
}

.empty-state-title {
  margin: 0;
  color: #d8e4f8;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.empty-state-detail {
  margin: 8px 0 0;
  color: #9fb1cf;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: absolute;
    top: var(--browser-chrome-top);
    left: 0;
    bottom: auto;
    width: min(390px, 100%);
    height: calc(100dvh - var(--browser-chrome-top) - var(--browser-chrome-bottom));
    max-height: calc(100dvh - var(--browser-chrome-top) - var(--browser-chrome-bottom));
    z-index: 6;
    transform: translateX(-101%);
    transition: transform 0.22s ease;
    box-shadow: 0 12px 40px rgba(15, 27, 55, 0.14);
    padding-top: calc(14px + var(--inset-top));
    padding-right: calc(12px + var(--inset-right));
    padding-bottom: calc(12px + var(--inset-bottom));
    padding-left: calc(12px + var(--inset-left));
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Compact chrome while searching — maximizes room for results above keyboard */
  .sidebar.sidebar--search-active {
    gap: 6px;
  }

  .sidebar.sidebar--search-active .sidebar-brand,
  .sidebar.sidebar--search-active .sidebar-add-place-btn,
  .sidebar.sidebar--search-active .filter-bar,
  .sidebar.sidebar--search-active .user-bar {
    display: none;
  }

  .sidebar.sidebar--search-active .sidebar-header {
    justify-content: flex-end;
  }

  .sidebar.sidebar--search-active .list-meta {
    flex-shrink: 0;
    padding: 0 2px;
  }

  .search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .sidebar #searchInput {
    flex: 1;
    min-width: 0;
  }

  .search-done-btn {
    display: none;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    font-size: 15px;
    font-weight: 600;
    padding: 6px 2px;
    cursor: pointer;
    line-height: 1;
  }

  .sidebar.sidebar--search-active .search-done-btn {
    display: inline-flex;
    align-items: center;
  }

  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
    padding-bottom: 2px;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex-shrink: 0;
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 4;
    border: 0;
    background: rgba(8, 17, 31, 0.42);
    cursor: pointer;
  }

  .sidebar-backdrop.hidden {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .map-search-wrap {
    left: calc(var(--mobile-float-gap) + var(--inset-left) + var(--mobile-toggle-size) + 8px);
    right: calc(var(--mobile-float-gap) + var(--inset-right));
    width: auto;
    transform: none;
    top: calc(
      var(--inset-top) + var(--browser-chrome-top) + var(--mobile-float-gap) +
        var(--mobile-toggle-size) + 8px
    );
  }

  .map-search-action {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-right: 42px;
  }

  .map-search-save-btn {
    width: 100%;
  }

  .map-search-action-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .map-type-switch {
    top: calc(var(--inset-top) + var(--browser-chrome-top) + var(--mobile-float-gap));
    bottom: auto;
    left: auto;
    right: calc(var(--mobile-float-gap) + var(--inset-right));
    width: auto;
    max-width: none;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  .map-type-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
  }

  .map-add-place-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: calc(20px + var(--inset-bottom) + var(--browser-chrome-bottom));
    right: calc(var(--mobile-float-gap) + var(--inset-right));
    z-index: 5;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 16px;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  }

  .map-add-place-fab:hover {
    background: #1d4ed8;
  }

  .map-add-place-fab:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
  }

  .map-add-place-fab .material-symbols-outlined {
    font-size: 28px;
    line-height: 1;
  }

  .popup-card {
    position: fixed;
    z-index: 8;
    left: calc(var(--mobile-float-gap) + var(--inset-left));
    right: calc(var(--mobile-float-gap) + var(--inset-right));
    width: auto;
    max-width: none;
    transform: none;
    top: calc(var(--inset-top) + var(--browser-chrome-top) + var(--mobile-float-gap));
    bottom: calc(var(--inset-bottom) + var(--browser-chrome-bottom) + var(--mobile-float-gap));
    max-height: none;
    height: auto;
  }

  .app-toast {
    bottom: calc(72px + var(--inset-bottom) + var(--browser-chrome-bottom));
  }

  .popup-top {
    min-height: 132px;
  }

  .popup-top h2 {
    font-size: 30px;
  }

  .popup-description {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .popup-top {
    min-height: 112px;
  }

  .popup-top h2 {
    font-size: 24px;
  }

  .popup-body {
    padding: 16px 16px 14px;
  }

  .popup-footer {
    align-items: flex-end;
  }

  .popup-actions {
    flex-direction: column;
  }

  .popup-actions .btn {
    width: 100%;
  }

  #prefsWizardOverlay:not(.hidden),
  #onboardingOverlay:not(.hidden) {
    align-items: flex-end;
    padding: 0;
    padding-bottom: var(--inset-bottom);
  }

  #onboardingOverlay .onboarding-card,
  .prefs-wizard-card {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    padding-top: calc(18px + var(--inset-top));
    padding-right: calc(18px + var(--inset-right));
    padding-bottom: calc(16px + var(--inset-bottom));
    padding-left: calc(18px + var(--inset-left));
  }

  body.overlay-scroll-locked .mobile-toggle {
    visibility: hidden;
    pointer-events: none;
  }

  .prefs-wizard-card {
    max-height: calc(100dvh - var(--browser-chrome-top) - var(--browser-chrome-bottom));
    min-height: min(62dvh, 560px);
  }

  .onboarding-card h2,
  .prefs-wizard-screen-title,
  .onboarding-lede,
  .prefs-wizard-screen-lede,
  .onboarding-steps,
  .effort-option-label,
  .avoid-option-label {
    overflow-wrap: anywhere;
  }

  .prefs-wizard-progress {
    font-size: 13px;
    color: #a8c4f0;
  }

  .prefs-wizard-progress-dots {
    gap: 6px;
  }

  .prefs-wizard-progress-dot {
    height: 5px;
  }

  .prefs-wizard-screen-title {
    font-size: 22px;
  }

  .prefs-wizard-screen-lede {
    font-size: 14px;
    margin-bottom: 14px;
  }

  .prefs-wizard-body {
    overscroll-behavior: contain;
    padding-bottom: 4px;
  }

  .prefs-wizard-actions {
    gap: 8px;
    padding-top: 14px;
    margin-top: 14px;
    background: linear-gradient(180deg, rgba(10, 20, 40, 0) 0%, rgba(10, 20, 40, 0.92) 18%);
  }

  .prefs-wizard-skip,
  .prefs-wizard-next {
    min-height: 48px;
  }

  .prefs-wizard-skip {
    min-width: 88px;
  }

  .prefs-wizard-next {
    flex: 1;
    max-width: none;
    justify-content: center;
  }

  .motivation-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .motivation-card {
    min-height: 88px;
  }

  .motivation-card-hint {
    font-size: 11px;
    padding: 5px 8px;
    max-width: calc(100% - 10px);
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  .motivation-card-check {
    width: 22px;
    height: 22px;
  }

  .effort-option {
    min-height: 52px;
    padding: 12px 14px;
  }

  .avoid-option {
    min-height: 52px;
    padding: 12px 14px;
  }

  .onboarding-btn {
    min-height: 48px;
  }

  #addPlaceDialog:not(.hidden) {
    align-items: flex-end;
    padding: 0;
    padding-bottom: var(--inset-bottom);
  }

  #addPlaceDialog .add-place-card {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - var(--browser-chrome-top) - var(--browser-chrome-bottom));
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 24px 24px 0 0;
    padding-top: calc(18px + var(--inset-top));
    padding-right: calc(18px + var(--inset-right));
    padding-bottom: calc(16px + var(--inset-bottom));
    padding-left: calc(18px + var(--inset-left));
  }

  #addPlaceDialog .add-place-lede,
  #addPlaceDialog .edit-field-hint,
  #addPlaceDialog .add-place-error,
  #addPlaceDialog .add-place-processing p {
    overflow-wrap: anywhere;
  }

  #addPlaceDialog .confirm-dialog-actions .btn {
    min-height: 48px;
  }

  #addPlaceDialog .add-place-mode-btn {
    min-height: 44px;
  }

  .mobile-add-place-hint:not(.hidden) {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
      calc(24px + var(--inset-top))
      calc(20px + var(--inset-right))
      calc(24px + var(--inset-bottom))
      calc(20px + var(--inset-left));
    background: rgba(8, 17, 31, 0.42);
    box-sizing: border-box;
  }

  .settings-dialog:not(.hidden) {
    align-items: flex-end;
    padding: 0;
    padding-bottom: var(--inset-bottom);
  }

  .settings-dialog .settings-card {
    width: 100%;
    max-height: calc(100dvh - var(--browser-chrome-top) - var(--browser-chrome-bottom));
    border-radius: 24px 24px 0 0;
    padding: calc(18px + var(--inset-top)) 18px calc(16px + var(--inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .settings-prefs-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settings-dropdown-trigger {
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) minmax(88px, auto) 20px;
  }

  .settings-tabs {
    gap: 4px;
  }

  .settings-tab {
    min-height: 44px;
    padding: 10px 8px;
  }

  .settings-dialog-actions .btn {
    min-height: 48px;
  }

  .settings-chip {
    min-height: 36px;
    padding: 8px 11px;
  }

  .settings-option {
    min-height: 44px;
    padding: 10px 12px;
  }

  .settings-tone-description {
    padding-left: 0;
  }

  .settings-copy-prompt-btn {
    align-self: stretch;
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  #settingsTravelProfile {
    min-height: 120px;
  }
}
