/* ===== COPY BUTTON ===== */

.copy-btn {
  margin-top: 4.8px;
  background: var(--clr-bg);
  color: var(--clr-text-muted);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  height: 37.59px;
  width: 37.59px;
  padding: 0;
  font-size: .95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  box-sizing: border-box;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.copy-btn:hover {
  /* No hover effect */
}
.copy-btn svg {
  flex-shrink: 0;
}

/* ===== EXPENSE SUMMARY ===== */
.expense-summary-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.1rem;
  font-size: 1.02rem;
}
/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg: #f4f1ee;
  --clr-surface: #ffffff;
  --clr-primary: #3a86ff;
  --clr-primary-hover: #2570e0;
  --clr-text: #1e1e1e;
  --clr-text-muted: #6b6b6b;
  --clr-border: #e0dcd7;
  --clr-danger: #e63946;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 14px rgba(0,0,0,.1);
  --transition: .2s ease;
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
}

/* ===== VIEWS ===== */
.view { display: none; }
.view.active { display: block; }

/* ===== BUTTONS ===== */
.btn {
  border: none; cursor: pointer; font-size: .9rem; font-weight: 600;
  border-radius: 8px; padding: .55rem 1.1rem; transition: background var(--transition), transform var(--transition);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--clr-primary); color: #fff; }
.btn-primary:hover { background: var(--clr-primary-hover); }
.btn-ghost { background: transparent; color: var(--clr-text-muted); }
.btn-ghost:hover { background: var(--clr-border); }
.btn-danger-sm { background: transparent; color: var(--clr-danger); }
.btn-danger-sm:hover { background: #fde8ea; }
.btn-cancel { background: transparent; color: var(--clr-danger); border: 1px solid var(--clr-danger); }
.btn-cancel:hover { background: #fde8ea; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; }

/* ===== HOME ===== */
.home-header {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 1rem;
}
.home-header h1 { font-size: 1.6rem; }
.home-header-actions { display: flex; align-items: center; gap: .6rem; }
.btn-logout { font-size: .8rem; opacity: .7; }
.btn-logout:hover { opacity: 1; }

/* ===== LOGIN SCREEN ===== */
.login-screen {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: var(--clr-bg);
  align-items: center; justify-content: center;
}
.login-screen.open { display: flex; }
.login-card {
  background: var(--clr-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 1.2rem;
  text-align: center;
}
.login-logo { font-size: 1.6rem; }
.login-sub { font-size: .9rem; color: var(--clr-text-muted); line-height: 1.5; }
.login-input {
  width: 100%; padding: .65rem .9rem;
  border: 1px solid var(--clr-border); border-radius: 8px;
  font-size: 1rem; background: var(--clr-bg);
  color: var(--clr-text); outline: none;
  transition: border-color var(--transition);
  text-align: center;
  margin-top: .8rem;
}
.login-input:focus { border-color: var(--clr-primary); }
.login-btn { width: 100%; padding: .7rem; font-size: .95rem; margin-top: .6rem; }
.login-msg { font-size: .85rem; color: var(--clr-text-muted); }
.login-msg:empty { display: none; }

.trips-grid {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem 2rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem;
}

.trip-card {
  background: var(--clr-surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow var(--transition), transform var(--transition);
}
.trip-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ===== POPUP MODAL (FLIGHT DELETE) ===== */
.popup-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(30, 30, 30, 0.32);
  z-index: 1002;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.popup-overlay.active {
  display: flex;
}
.popup-modal {
  background: var(--clr-surface);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 2rem 2.2rem 1.5rem;
  min-width: 320px;
  max-width: 90vw;
  text-align: center;
  animation: popupIn 0.18s cubic-bezier(.4,1.6,.6,1) both;
}
@keyframes popupIn {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.popup-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: var(--clr-danger);
}
.popup-content p {
  color: var(--clr-text-muted);
  margin-bottom: 1.2rem;
}
.popup-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.popup-actions .btn {
  min-width: 90px;
}

.bookmark-note-modal.popup-modal {
  width: 420px;
  max-width: min(420px, 92vw);
  box-sizing: border-box;
  text-align: left;
}
.bookmark-note-modal .popup-actions {
  justify-content: flex-end;
}
.bookmark-note-modal .bookmark-note-header {
  text-align: left;
  margin-bottom: 0.75rem;
}
.bookmark-note-modal #bookmark-note-place-title {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--clr-text);
  line-height: 1.3;
  word-break: break-word;
}
.bookmark-note-modal .bookmark-note-subtitle {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--clr-text-muted);
}
.bookmark-note-modal .popup-content textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.2rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--clr-bg);
  color: var(--clr-text);
  text-align: left;
  box-sizing: border-box;
  resize: vertical;
  min-height: 5rem;
}
.bookmark-note-modal .popup-content textarea:focus {
  outline: none;
  border-color: var(--clr-primary);
}
.trip-card-cover {
  height: 160px; background: linear-gradient(135deg, #667eea, #764ba2);
  background-size: cover; background-position: center;
  position: relative; overflow: hidden;
}
.cover-reposition-btn {
  position: absolute; bottom: .5rem; right: .5rem;
  background: rgba(0,0,0,.52); color: #fff; border: none;
  border-radius: 6px; padding: .3rem .6rem; font-size: .75rem;
  cursor: pointer; opacity: 0; transition: opacity .2s;
  white-space: nowrap;
}
.trip-card:hover .cover-reposition-btn { opacity: 1; }
.trip-card-body { padding: 1rem; }
.trip-card-body h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.trip-card-body p { font-size: .82rem; color: var(--clr-text-muted); }

.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 4rem 1rem;
  color: var(--clr-text-muted); font-size: 1.05rem;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; justify-content: center; align-items: center; z-index: 100;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--clr-surface); border-radius: var(--radius);
  padding: 2rem; width: 90%; max-width: 480px;
  box-shadow: var(--shadow-md); animation: modalIn .25s ease;
  box-sizing: border-box;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal h2 { margin-bottom: 1.2rem; font-size: 1.3rem; }
.modal label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .9rem; color: var(--clr-text-muted); }
.modal input[type="text"],
.modal input[type="date"],
.modal input[type="url"],
.modal textarea {
  display: block; width: 100%; max-width: 100%; margin-top: .3rem;
  padding: .55rem .7rem; border: 1px solid var(--clr-border); border-radius: 8px;
  font-size: .95rem; background: var(--clr-bg); color: var(--clr-text);
  font-family: inherit; box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
}
.modal input:focus, .modal textarea:focus { outline: none; border-color: var(--clr-primary); }
.modal input[type="file"] { margin-top: .4rem; font-size: .85rem; }
.form-row { display: flex; gap: 1rem; }
.form-row label { flex: 1; min-width: 0; overflow: hidden; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .5rem; }

.cover-preview {
  margin-top: .5rem; border-radius: 8px; overflow: hidden;
}
.cover-preview img { width: 100%; display: block; object-fit: cover; max-height: 260px; }
.cover-preview-drag {
  width: 100%; height: 260px;
  background-size: contain; background-repeat: no-repeat; background-color: #1a1a1a;
  cursor: grab; user-select: none; position: relative;
}
.cover-preview-drag:active { cursor: grabbing; }
.cover-drag-hint {
  position: absolute; bottom: .4rem; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.5); color: #fff;
  font-size: .72rem; padding: .2rem .55rem; border-radius: 4px;
  pointer-events: none; white-space: nowrap;
}
.reposition-modal { max-width: 500px; }
.reposition-hint { font-size: .85rem; color: var(--clr-text-muted); margin-bottom: .8rem; }
.reposition-change-btn { margin-right: auto; }
.reposition-stage {
  width: 100%; height: 320px;
  background-size: contain; background-repeat: no-repeat; background-position: 50% 50%; background-color: #1a1a1a;
  border-radius: 8px; cursor: grab; user-select: none; margin-bottom: .5rem;
  border: 1px solid var(--clr-border);
}
.reposition-stage:active { cursor: grabbing; }

/* ===== BOARD HEADER ===== */
.board-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem; background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border); position: sticky; top: 0; z-index: 100;
}
.board-title-wrap { flex: 1; }
.board-title-wrap h2 { font-size: 1.2rem; }
.board-dates { font-size: .8rem; color: var(--clr-text-muted); }

/* ===== TABS ===== */
.board-tabs {
  display: flex; gap: .25rem; padding: .5rem 1.5rem;
  background: var(--clr-surface); border-bottom: 1px solid var(--clr-border);
  position: relative;
  z-index: 20;
}
.tab {
  border: none; background: none; cursor: pointer;
  padding: .5rem 1rem; font-size: .88rem; font-weight: 600;
  color: var(--clr-text-muted); border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tab:hover { color: var(--clr-text); background: var(--clr-bg); }
.tab.active { color: var(--clr-primary); border-bottom-color: var(--clr-primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-empty {
  text-align: center; padding: 4rem 1rem;
  color: var(--clr-text-muted); font-size: .95rem;
}

.section-label {
  padding: .8rem 1.5rem .2rem; font-size: .95rem; font-weight: 700;
  color: var(--clr-text-muted);
}

.is-hidden { display: none !important; }

/* ===== IDEAS (Maps + bookmarks) ===== */
.ideas-panel {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.ideas-toolbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 0 .5rem;
}
.ideas-title {
  margin: 0; font-size: 1rem; font-weight: 700; color: var(--clr-text);
}
.ideas-bookmarks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  flex-wrap: wrap;
  margin: 1rem 0 .5rem;
}
.ideas-bookmarks-heading {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--clr-text-muted);
  letter-spacing: .02em;
}
.ideas-itinerary-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  user-select: none;
}
.ideas-itinerary-toggle-label {
  white-space: nowrap;
  font-size: 0.9rem;
}
.ideas-itinerary-toggle-input {
  cursor: pointer;
  accent-color: var(--clr-primary);
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}
.ideas-search-row {
  margin-bottom: .65rem;
  /* Above #ideas-map-wrap (later sibling) so autocomplete dropdown isn’t behind the map; below .board-header / .board-tabs */
  position: relative;
  z-index: 5;
}
.ideas-search-wrap-inner {
  width: 100%;
  min-height: 2.85rem;
  box-sizing: border-box;
  /* Keep Places autocomplete + dropdown light even when OS/browser prefers dark */
  color-scheme: light;
}
/* PlaceAutocompleteElement (gmp-place-autocomplete) */
.ideas-search-wrap-inner gmp-place-autocomplete.ideas-search-input {
  width: 100%;
  display: block;
  color-scheme: light;
  --gmp-mat-color-surface: var(--clr-surface);
  --gmp-mat-color-on-surface: var(--clr-text);
  /* Tame Material focus ring (default primary is Google blue) */
  --gmp-mat-color-primary: var(--clr-text-muted);
  --gmp-mat-color-outline-decorative: var(--clr-border);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  outline: none;
}
.ideas-search-wrap-inner gmp-place-autocomplete.ideas-search-input:focus-within {
  outline: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--clr-border);
}
.ideas-search-wrap-inner gmp-place-autocomplete.ideas-search-input::part(input) {
  outline: none !important;
  box-shadow: none !important;
  /* iOS Safari zooms inputs with font-size below 16px on focus */
  font-size: 16px;
}
.ideas-search-wrap-inner gmp-place-autocomplete.ideas-search-input:focus-within::part(input) {
  outline: none !important;
  box-shadow: none !important;
}
.ideas-search-input {
  width: 100%; box-sizing: border-box;
  min-height: 2.85rem;
  padding: .85rem 1rem; font-size: 16px;
  border: 1px solid var(--clr-border); border-radius: 10px;
  background: var(--clr-surface); color: var(--clr-text);
  font-family: inherit; box-shadow: var(--shadow-sm);
}
.ideas-selection {
  display: flex; align-items: center; gap: .85rem;
  margin-bottom: .75rem; padding: .75rem 1rem;
  background: #fff; border: 1px solid var(--clr-border); border-radius: 10px;
}
.ideas-selection.ideas-selection--overlay {
  position: absolute;
  top: .65rem;
  left: .65rem;
  right: .65rem;
  margin-bottom: 0;
  /* Above Google Maps panes inside #ideas-map (sibling stacking can still need a high value) */
  z-index: 1001;
  pointer-events: auto;
  box-shadow: var(--shadow-md);
}
.ideas-selection-thumb-wrap {
  flex-shrink: 0; width: 72px; height: 72px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--clr-border); background: #f5f5f5;
  position: relative;
}
.ideas-selection-thumb {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover;
}
.ideas-selection-thumb[hidden] {
  display: none !important;
}
.ideas-selection-thumb-ph {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; opacity: .45; pointer-events: none;
}
.ideas-selection-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: .2rem;
}
.ideas-selection-name {
  font-weight: 600; font-size: .9rem; margin: 0; color: var(--clr-text);
  word-break: break-word;
}
.ideas-selection-rating {
  font-size: .78rem; color: var(--clr-text-muted); font-weight: 500; line-height: 1.35;
}
.ideas-selection-rating.is-hidden { display: none !important; }
.ideas-rating-stars { color: #f5b400; letter-spacing: .02em; }
.ideas-rating-num { font-weight: 600; color: var(--clr-text); margin-left: .15rem; }
.ideas-rating-count { color: var(--clr-text-muted); font-weight: 500; }
.ideas-selection-actions {
  display: flex; flex-direction: column; align-items: stretch; gap: .4rem;
  flex-shrink: 0;
}
@media (min-width: 480px) {
  .ideas-selection-actions {
    flex-direction: row; align-items: center;
  }
}
.ideas-action-btn { font-size: .82rem; padding: .65rem .9rem; white-space: nowrap; }
.ideas-action-btn.ideas-action-btn--done {
  background: var(--clr-border);
  color: var(--clr-text-muted);
  cursor: not-allowed;
  box-shadow: none;
  font-weight: 600;
  border: none;
}
.ideas-action-btn.ideas-action-btn--done:hover {
  background: var(--clr-border);
  color: var(--clr-text-muted);
}
.ideas-no-key {
  padding: 1rem; margin-bottom: .75rem; border-radius: 8px;
  background: #fff8e6; border: 1px solid #f0d78c; color: #6b5a1a; font-size: .85rem;
}
.ideas-map-wrap {
  position: relative;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--clr-border); box-shadow: var(--shadow-sm);
}
.ideas-map {
  width: 100%; height: min(420px, 55vh); min-height: 280px;
  background: #e8e8e8;
}
.ideas-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  align-items: stretch;
  margin-top: 0;
}
@media (max-width: 960px) {
  .ideas-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ideas-list { grid-template-columns: 1fr; }
}
.ideas-list > .panel-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.25rem 1rem;
}
.ideas-list-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .5rem;
  padding: .75rem .75rem .85rem;
  background: #fff;
  border: 1px solid var(--clr-border); border-radius: 10px; box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: visible;
}
.ideas-list-card-thumb-wrap {
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 140px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--clr-border); background: #f5f5f5;
  position: relative;
}
.ideas-list-card-thumb {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.ideas-list-card-thumb-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; opacity: .45;
}
.ideas-list-card-main { flex: 1; min-width: 0; }
.ideas-list-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .35rem;
  margin-bottom: .25rem;
}
.ideas-list-card-name-rating {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.ideas-list-card-name {
  font-weight: 600;
  font-size: .85rem;
  margin: 0;
  word-break: break-word;
  line-height: 1.3;
}
.ideas-list-card-rating {
  font-size: .76rem;
  line-height: 1.35;
  margin: 0;
}
.ideas-list-card-addr { font-size: .78rem; color: var(--clr-text-muted); line-height: 1.35; }
.ideas-list-card-note { font-size: 0.85rem; color: var(--clr-text-muted); line-height: 1.35; word-break: break-word; }
.ideas-list-card-aside {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .45rem;
  width: 100%;
  margin-top: auto;
}
.ideas-card-menu-anchor {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 2;
}
.ideas-card-more {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 8px;
  color: var(--clr-text-muted); background: transparent;
  cursor: pointer;
  transition: color var(--transition), opacity var(--transition);
}
.ideas-card-more:hover {
  color: var(--clr-primary);
}
.ideas-card-more:focus-visible {
  outline: 2px solid var(--clr-primary); outline-offset: 2px;
}
.ideas-card-menu {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 11rem;
  z-index: 10040;
  padding: .25rem 0;
  background: #fff; border: 1px solid var(--clr-border); border-radius: 10px;
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column;
}
.ideas-card-menu-item {
  display: block; width: 100%; margin: 0; padding: .5rem .85rem;
  border: 0; background: transparent;
  font: inherit; font-size: .82rem; text-align: left; color: var(--clr-text);
  cursor: pointer;
  transition: background var(--transition);
}
.ideas-card-menu-item:hover { background: var(--clr-surface); }
.ideas-card-menu-item-danger { color: #c62828; }
.ideas-card-menu-item-danger:hover { background: rgba(198, 40, 40, .08); }
.ideas-card-add-btn {
  font-size: .78rem; padding: .75rem .75rem; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.ideas-card-add-btn.ideas-card-add-btn--added {
  background: var(--clr-border);
  color: var(--clr-text-muted);
  cursor: not-allowed;
  box-shadow: none;
  font-weight: 600;
}
.ideas-card-add-btn.ideas-card-add-btn--added:hover {
  background: var(--clr-border);
  color: var(--clr-text-muted);
}
/* Google Places autocomplete above map */
.pac-container { z-index: 10050; }

/* ===== FLIGHTS ===== */
.flights-panel {
  max-width: 600px; margin: 0 auto; padding: 1.5rem; overflow: hidden;
}
.flights-panel { text-align: center; }
.flights-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; text-align: left; }

.flight-card {
  background: var(--clr-surface); border-radius: var(--radius);
  padding: 1.2rem 1.5rem; box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border); cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}
.flight-card:hover { box-shadow: var(--shadow-md); }
.flight-card-edit { cursor: default; }
.flight-card-edit:hover { box-shadow: var(--shadow-sm); }

/* ===== HOTELS ===== */
.hotels-panel { max-width: 600px; margin: 0 auto; padding: 1.5rem; text-align: center; }
.hotels-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; text-align: left; }
.hotel-card {
  background: var(--clr-surface); border-radius: var(--radius);
  padding: 1.2rem 1.5rem; box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border); cursor: pointer;
  transition: box-shadow var(--transition);
  overflow: hidden;
}
.hotel-card:hover { box-shadow: var(--shadow-md); }
.hotel-card-edit { cursor: default; }
.hotel-card-edit:hover { box-shadow: var(--shadow-sm); }
.hotel-summary { display: flex; align-items: center; gap: 1rem; }
.hotel-icon { font-size: 1.6rem; flex-shrink: 0; }
.hotel-info { flex: 1; min-width: 0; }
.hotel-name { font-size: 1rem; font-weight: 700; margin-bottom: .45rem; }
.hotel-dates { font-size: .82rem; color: var(--clr-text-muted); margin-bottom: .35rem; }
.hotel-map-link {
  font-size: .8rem; color: var(--clr-primary); text-decoration: none;
  display: inline-flex; align-items: center; gap: .3rem; margin-top: .15rem;
}
.hotel-map-link:hover { text-decoration: underline; }
.hotel-delete {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  color: var(--clr-text-muted); font-size: 1.1rem; padding: 0 2px;
  line-height: 1; opacity: 0; transition: opacity var(--transition);
}
.hotel-card:hover .hotel-delete { opacity: 1; }
.hotel-delete:hover { color: var(--clr-danger); }

/* Summary view */
.flight-summary-header {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .8rem;
}
.airline-logo {
  height: 20px; width: 20px; object-fit: contain; border-radius: 3px;
}
.flight-num {
  font-size: .95rem; font-weight: 700; color: var(--clr-text);
  letter-spacing: .3px; flex: 1;
}
.flight-route {
  display: flex; align-items: center; gap: .8rem;
}
.flight-endpoint { text-align: left; min-width: 80px; }
.flight-endpoint-right { text-align: right; }
.flight-time { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.flight-date { font-size: .78rem; color: var(--clr-text-muted); margin-bottom: .15rem; }
.flight-airport {
  font-size: .9rem; font-weight: 700; color: var(--clr-text-muted);
  margin-top: .1rem;
}
.flight-route-line {
  flex: 1; display: flex; align-items: center; gap: 0;
  color: var(--clr-text-muted); font-size: .85rem;
}
.route-dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 2px solid var(--clr-text-muted); flex-shrink: 0;
}
.route-dash {
  flex: 1; height: 0; border-top: 2px dashed #ccc;
}
.route-plane {
  font-size: 1rem; margin: 0 .15rem; flex-shrink: 0;
  transform: rotate(0deg);
}

/* Edit view */
.flight-row {
  display: flex; gap: .75rem; align-items: flex-end; margin-bottom: .6rem;
}
.flight-row:last-of-type { margin-bottom: 0; }
.flight-label {
  display: flex; flex-direction: column; font-size: .78rem; font-weight: 600;
  color: var(--clr-text-muted); flex: 1; gap: .2rem; min-width: 0; overflow: hidden;
}
.flight-label-full { flex: 1 1 100%; }
.flight-input {
  padding: .45rem .6rem; border: 1px solid var(--clr-border); border-radius: 8px;
  font-size: .9rem; background: var(--clr-bg); color: var(--clr-text); width: 100%;
  min-width: 0; max-width: 100%; box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
}
.flight-input:focus { outline: none; border-color: var(--clr-primary); }
.flight-delete {
  flex-shrink: 0; opacity: .5; margin-bottom: .2rem; font-size: 1.1rem;
  background: none; border: none; cursor: pointer; color: var(--clr-text-muted);
  padding: 0 2px; line-height: 1; transition: opacity var(--transition);
}
.flight-card:hover .flight-delete { opacity: 1; }
.flight-delete:hover { color: var(--clr-danger); }
.flight-actions { justify-content: flex-end; margin-top: .3rem; }
.flight-local {
  margin-top: .7rem; font-size: .8rem; color: var(--clr-primary);
  background: #eef4ff; padding: .4rem .7rem; border-radius: 6px;
}

/* ===== KANBAN BOARD ===== */
.board {
  display: flex; gap: 1rem; padding: 1.2rem 1.5rem;
  overflow-x: auto; min-height: calc(100vh - 70px);
  align-items: flex-start;
}

.column {
  flex: 0 0 280px; background: var(--clr-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  max-height: calc(100vh - 100px);
}
.column-header {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .75rem 1rem; font-weight: 700; font-size: .85rem;
  border-bottom: 1px solid var(--clr-border); text-align: left;
  position: sticky; top: 0; background: var(--clr-surface);
  border-radius: var(--radius) var(--radius) 0 0;
}
.column-header-left { flex: 0 0 auto; min-width: 0; text-align: left; }
.column-header .day-name { font-size: .7rem; font-weight: 500; color: var(--clr-text-muted); }
.column-header .day-date { display: block; font-size: .85rem; font-weight: 700; color: var(--clr-text); }
.column-header-weather {
  flex: 1 1 auto; min-width: 0; font-size: .62rem; font-weight: 500; color: var(--clr-text-muted);
  text-align: right; line-height: 1.35; max-width: 58%;
}
.column-header-weather .wx-line { white-space: nowrap; }
.column-header-weather .wx-muted { opacity: .6; }

.column-body {
  padding: .5rem; flex: 1; overflow-y: auto;
  min-height: 60px;
  transition: background var(--transition);
}
.column-body.drag-over { background: #e8f0fe; }

/* ===== ACTIVITY CARD ===== */
.activity {
  background: var(--clr-bg); border-radius: 8px; padding: .65rem .8rem;
  margin-bottom: .45rem; cursor: grab; font-size: .88rem;
  border: 1px solid transparent;
  transition: box-shadow var(--transition), border var(--transition);
  display: flex; flex-direction: column; align-items: flex-start;
}
.activity:active { cursor: grabbing; }
.activity.dragging { opacity: .4; }
.activity:hover { border-color: var(--clr-primary); box-shadow: var(--shadow-sm); }
.activity-main {
  display: flex; align-items: flex-start; gap: .4rem; width: 100%;
}
.activity-text {
  flex: 1; min-height: 1.2em; word-break: break-word;
}
.activity-placeholder { color: var(--clr-text-muted); font-style: italic; }
.activity-pin {
  flex-shrink: 0; text-decoration: none; font-size: 1rem;
  opacity: .5; transition: opacity var(--transition);
}
.activity:hover .activity-pin { opacity: 1; }
.activity-pin:hover { transform: scale(1.15); }
.activity-map-link {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .75rem; color: var(--clr-primary); text-decoration: none;
  margin-top: .3rem; padding: .15rem .5rem; border-radius: 4px;
  background: #eef4ff; transition: background var(--transition);
}
.activity-map-link:hover { background: #dce8fc; text-decoration: underline; }
.activity-delete {
  background: none; border: none; cursor: pointer; color: var(--clr-text-muted);
  font-size: .85rem; padding: 0 2px; line-height: 1; flex-shrink: 0;
  opacity: 0; transition: opacity var(--transition);
}
.activity:hover .activity-delete { opacity: 1; }
.activity-delete:hover { color: var(--clr-danger); }

/* ===== ACTIVITY MODAL ===== */
.activity-modal { max-width: 450px; width: 90vw; }
.activity-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.activity-modal-header h2 { margin: 0; }
.activity-modal-trash {
  background: none; border: none; cursor: pointer; font-size: 1.2rem;
  opacity: .5; transition: opacity var(--transition);
  padding: .2rem;
}
.activity-modal-trash:hover { opacity: 1; }
.activity-modal label { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; font-size: .85rem; font-weight: 600; color: var(--clr-text-muted); }
.activity-modal input, .activity-modal textarea, .activity-modal select {
  padding: .5rem .7rem; border: 1px solid var(--clr-border); border-radius: 8px;
  font-size: .9rem; background: var(--clr-bg); color: var(--clr-text); width: 100%;
  font-family: inherit; resize: vertical;
}
.activity-modal select {
  cursor: pointer; font-weight: 500; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b6b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .65rem center;
  padding-right: 2rem;
}
.activity-modal input:focus, .activity-modal textarea:focus, .activity-modal select:focus { outline: none; border-color: var(--clr-primary); }
.activity-modal .act-edit-date-wrap { margin-bottom: 1rem; }
.activity-badges { display: flex; gap: .35rem; margin-top: .3rem; flex-wrap: wrap; }

.activity-note-icon {
  font-size: 1rem;
  margin-left: 0.18em;
  vertical-align: middle;
  opacity: 1;
}


/* ===== ADD ACTIVITY ===== */
.add-activity-btn {
  width: 100%; background: none; border: 1px dashed var(--clr-border);
  border-radius: 8px; padding: .5rem; color: var(--clr-text-muted);
  cursor: pointer; font-size: .82rem; margin-top: .2rem;
  transition: background var(--transition), color var(--transition);
}
.add-activity-btn:hover { background: var(--clr-bg); color: var(--clr-text); }

/* ===== SCROLLBAR ===== */
.board::-webkit-scrollbar, .column-body::-webkit-scrollbar { height: 6px; width: 6px; }
.board::-webkit-scrollbar-thumb, .column-body::-webkit-scrollbar-thumb {
  background: #ccc; border-radius: 3px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  /* General spacing */
  .home-header { padding: 1.2rem 1rem .6rem; }
  .home-header h1 { font-size: 1.3rem; }
  .trips-grid { padding: 0 1rem 1.5rem; gap: 1rem; grid-template-columns: 1fr; }

  /* Board header */
  .board-header { padding: .75rem 1rem; gap: .5rem; }
  .board-title-wrap h2 { font-size: 1rem; }
  .board-dates { font-size: .72rem; }
  #btn-back { padding: .4rem .6rem; font-size: .8rem; }
  #btn-refresh, #btn-delete-trip { padding: .4rem .6rem; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; }

  /* Tabs */
  .board-tabs { padding: .4rem .75rem; gap: .1rem; }
  .tab { padding: .45rem .55rem; font-size: .78rem; }

  /* Flights & Hotels */
  .flights-panel, .hotels-panel, .finance-panel { padding: 1rem; }
  .flight-card, .hotel-card, .expense-card { padding: .9rem 1rem; }
  .flight-row { flex-direction: column; gap: .5rem; align-items: stretch; }
  .flight-row .flight-label { width: 100%; }
  .flight-row.flight-actions { flex-direction: row; align-items: center; }

  /* Flight route */
  .flight-time { font-size: 1.1rem; }
  .flight-endpoint { min-width: 60px; }
  .flight-route { gap: .4rem; }
  .flight-summary-header { flex-wrap: wrap; }

  /* Modal */
  .modal { padding: 1.3rem; width: 92%; }
  .modal h2 { font-size: 1.15rem; margin-bottom: 1rem; }
  .form-row { flex-direction: column; gap: 0; }

  /* Popup modal */
  .popup-modal { padding: 1.5rem 1.3rem 1.2rem; min-width: 0; width: 90vw; }

  /* Kanban */
  .board { padding: .8rem .75rem; gap: .75rem; }
  .column { flex: 0 0 260px; }
  .column-header-weather { font-size: .58rem; max-width: 58%; }

  .ideas-panel { padding: 1.5rem; }
  .ideas-toolbar { flex-wrap: wrap; }
  .ideas-selection.ideas-selection--overlay {
    flex-wrap: wrap;
    align-items: flex-start;
    top: .45rem;
    left: .45rem;
    right: .45rem;
    padding: .65rem .75rem;
    gap: .65rem;
  }
  .ideas-selection.ideas-selection--overlay .ideas-selection-actions {
    flex-basis: 100%;
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    gap: .5rem;
  }
  .ideas-selection.ideas-selection--overlay .ideas-action-btn {
    flex: 1;
    min-width: 0;
    text-align: center;
  }
  .ideas-map { height: min(360px, 50vh); min-height: 220px; }
  .ideas-list { gap: .65rem; }
  .ideas-card-add-btn { width: 100%; text-align: center; }

  /* Expense cards */
  .expense-cat-icon { font-size: 1.3rem; }
  .expense-card-main { gap: .5rem; }
  .expense-item-name { font-size: .88rem; }
  .expense-amount { font-size: .9rem; }

  /* Category buttons wrap better */
  .cat-toggle { gap: .35rem; }
  .cat-btn { padding: .3rem .55rem; font-size: .74rem; }

  /* Activity modal */
  .activity-modal { width: 92vw; }

  /* Prevent iOS zoom on input focus */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ===== FINANCE ===== */
.finance-panel { max-width: 600px; margin: 0 auto; padding: 1.5rem; }
.currency-item-toggle { display: flex; border: 1px solid var(--clr-border); border-radius: 8px; overflow: hidden; }
.currency-item-btn {
  padding: .45rem 1rem; border: none; background: var(--clr-bg);
  font-size: .85rem; font-weight: 600; cursor: pointer;
  color: var(--clr-text-muted); transition: background var(--transition), color var(--transition);
}
.currency-item-btn.active { background: var(--clr-primary); color: #fff; }

.expense-summary {
  margin-bottom: 1.2rem;
}
.expense-summary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}
.expense-summary-table th, .expense-summary-table td {
  text-align: center;
  padding: .5rem 0.3rem;
}
.expense-summary-table th {
  font-size: .82rem;
  color: var(--clr-text-muted);
  font-weight: 600;
}
.expense-summary-table td {
  font-size: 1.08rem;
  font-weight: 700;
  background: var(--clr-surface);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
}
.expense-summary-table tr:not(:last-child) td {
  border-bottom: none;
}
.expense-summary-currency {
  font-size: .9rem;
  font-weight: 700;
  color: var(--clr-primary);
  padding-right: .5rem;
}
.expense-summary-filter {
  margin-bottom: .7rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.expense-summary-filter label {
  font-size: .9rem;
  color: var(--clr-text-muted);
  font-weight: 600;
}
.expense-summary-filter {
  margin-bottom: .7rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
}
.expense-summary-filter-label {
  font-size: .9rem;
  color: var(--clr-text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.expense-summary-cat-toggle {
  flex: 1;
  display: flex;
  gap: .4rem;
}
.expense-summary-cat-toggle .cat-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: .4rem 0.5rem;
  font-size: .85rem;
}
#expense-summary-container { margin-bottom: 0.5rem; }
.btn-add-expense {
  display: block;
  margin: 0.7rem auto 1rem auto;
}
.expenses-list { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1rem; }
.expense-card {
  background: var(--clr-surface); border-radius: var(--radius);
  padding: 1rem 1.2rem; box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border); cursor: pointer;
  transition: box-shadow var(--transition);
  display: flex; align-items: center; gap: .8rem;
  position: relative;
}
.expense-card:hover { box-shadow: var(--shadow-md); }
.expense-card-edit { cursor: default; border-color: var(--clr-primary); }
.expense-card-edit:hover { box-shadow: var(--shadow-sm); }
.expense-card-content {
  display: flex; align-items: center; flex: 1; min-width: 0; width: 100%;
}
.expense-card-main {
  display: flex; align-items: center; flex: 1; min-width: 0; gap: .8rem;
}
.expense-card-right {
  display: flex; flex-direction: column; align-items: flex-end;
  margin-left: auto; flex-shrink: 0;
}
.expense-cat-icon { font-size: 1.6rem; flex-shrink: 0; }
.expense-info { flex: 1; min-width: 0; }
.expense-item-name { font-size: .95rem; font-weight: 700; }
.expense-meta { font-size: .78rem; color: var(--clr-text-muted); margin-top: .15rem; }
.expense-amount { font-size: 1rem; font-weight: 700; text-align: right; white-space: nowrap; }
.expense-amount-converted {
  color: var(--clr-text-muted); font-size: .78rem; text-align: right;
  margin-top: 2px; font-weight: 400;
}
.expense-delete {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--clr-text-muted); font-size: 1.1rem; padding: 0 2px;
  line-height: 1; opacity: 0; transition: opacity var(--transition);
}
.expense-card:hover .expense-delete { opacity: 1; }
.expense-delete:hover { color: var(--clr-danger); }
.expense-edit-actions {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}
.expense-edit-actions-right {
  display: flex; gap: .6rem;
}

/* ===== EXPENSE FILTER ===== */
.expense-filter-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; margin-left: auto; padding: 0 .3rem;
  opacity: 0.5; transition: opacity var(--transition);
}
.expense-filter-btn:hover { opacity: 1; }
.expense-filter-btn.active { opacity: 1; }
.expense-filter-modal {
  text-align: left; max-width: 400px;
}
.expense-filter-modal .popup-content h3 {
  color: var(--clr-text);
}
.filter-section-title {
  font-size: .85rem; font-weight: 600; margin-bottom: .6rem; margin-top: 1.2rem;
  color: var(--clr-text-muted);
}
.filter-section-title:first-child { margin-top: 0; }
#expense-filter-category { margin-top: .5rem; }
#expense-filter-user { margin-top: .5rem; }
.filter-popup-actions {
  display: flex; gap: .8rem; margin-top: 1.5rem;
}
.btn-filter-clear {
  flex: 1; padding: .7rem; font-size: .95rem; font-weight: 600;
  background: transparent; color: var(--clr-text-muted);
  border: 1px solid var(--clr-border);
  border-radius: 8px; cursor: pointer;
  transition: background var(--transition);
}
.btn-filter-clear:hover { background: var(--clr-bg); }
.btn-filter-view {
  flex: 2; padding: .7rem; font-size: .95rem; font-weight: 600;
  background: var(--clr-primary); color: #fff; border: none;
  border-radius: 8px; cursor: pointer;
  transition: background var(--transition);
}
.btn-filter-view:hover { background: var(--clr-primary-hover); }

/* Him/Her toggle full width */
.user-toggle {
  display: flex;
  width: 100%;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  overflow: hidden;
}
.user-btn {
  flex: 1 1 50%;
  padding: .4rem 0;
  border: none;
  background: var(--clr-bg);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--clr-text-muted);
  transition: background var(--transition), color var(--transition);
}
.user-btn.active {
  background: var(--clr-primary);
  color: #fff;
}

/* Currency toggle */
.currency-toggle-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .6rem;
}
.currency-toggle-label {
  font-size: .85rem;
  color: var(--clr-text-muted);
  font-weight: 600;
  flex: 1;
}
.currency-toggle-btn {
  position: relative;
  width: 44px; height: 24px;
  border-radius: 24px;
  border: none;
  background: #e0dcd7;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease;
}
.currency-toggle-btn.active {
  background: var(--clr-primary);
}
.currency-toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: transform .2s ease;
}
.currency-toggle-btn.active .currency-toggle-knob {
  transform: translateX(20px);
}
.cat-toggle { display: flex; flex-wrap: wrap; gap: .4rem; }
.cat-btn {
  padding: .35rem .7rem; border: 1px solid var(--clr-border); border-radius: 8px;
  background: var(--clr-bg); font-size: .78rem; cursor: pointer;
  color: var(--clr-text-muted); transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.cat-btn.active { background: var(--clr-primary); color: #fff; border-color: var(--clr-primary); }

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: var(--clr-primary);
  color: #fff;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.4s, bottom 0.4s;
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  bottom: 48px;
}
