/* 深圳想去的地方 — Eva-01 dark / Eva-00 light theme */

/* === Eva-01 (default dark): 黑 + 紫 + 螢光綠 === */
:root,
:root[data-theme="eva01"] {
  --bg: #000000;
  --bg-elevated: #0a0512;
  --surface: #0e0a18;
  --surface-2: #1a1426;
  --border: #2a1f3a;
  --border-strong: #5B2A86;
  --text: #f0f0f5;
  --text-muted: #a89cb8;
  --accent: #39ff14;          /* Eva 螢光綠 */
  --accent-2: #9b4dff;        /* Eva 亮紫 (高飽和) */
  --accent-2-dim: #5B2A86;    /* Eva 深紫 (低飽和) */
  --accent-3: #ff7a00;        /* Eva 橙 (for 茶飲 type) */
  --accent-glow: rgba(57, 255, 20, 0.25);
  --purple-glow: rgba(155, 77, 255, 0.22);
  --type-restaurant: #39ff14;
  --type-massage: #FA0203;
  --type-tea: #ff7a00;
  --type-dessert: #ffb800;
  --type-shopping: #9b4dff;
  --type-attraction: #00d9ff;
  --danger: #ff3860;
  --success: #39ff14;
  --shadow: 0 2px 12px rgba(155, 77, 255, 0.15), 0 2px 8px rgba(0,0,0,0.7);
  --radius: 14px;
  --radius-sm: 8px;
  --header-pattern:
    linear-gradient(135deg, #2a0f4a 0%, #5B2A86 40%, #1a0524 100%);
  --purple-accent-bar: linear-gradient(90deg,
    transparent 0%, var(--accent-2) 20%, var(--accent-2) 80%, transparent 100%);
  --green-accent-bar: linear-gradient(90deg,
    transparent 0%, var(--accent) 15%, var(--accent) 85%, transparent 100%);
}

/* === Eva-00 (light): 白 + 黃 + 灰 === */
:root[data-theme="eva00"] {
  --bg: #f5f5f0;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #efefe8;
  --border: #d8d8d0;
  --border-strong: #ffb800;
  --text: #1a1a1a;
  --text-muted: #6a6a6a;
  --accent: #ffb800;
  --accent-2: #888888;
  --accent-2-dim: #aaaaaa;
  --accent-3: #ff8800;
  --accent-glow: rgba(255, 184, 0, 0.18);
  --purple-glow: rgba(0,0,0,0);
  --type-restaurant: #22b80e;
  --type-massage: #FA0203;
  --type-tea: #ff8800;
  --type-dessert: #d49000;
  --type-shopping: #6b46c1;
  --type-attraction: #0284c7;
  --danger: #d92e4f;
  --success: #1c7d3a;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --header-pattern: linear-gradient(180deg, #ffffff 0%, #f5f5f0 100%);
  --purple-accent-bar: linear-gradient(90deg,
    transparent 0%, var(--accent) 20%, var(--accent) 80%, transparent 100%);
  --green-accent-bar: linear-gradient(90deg,
    transparent 0%, var(--accent) 20%, var(--accent) 80%, transparent 100%);
}

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

html { height: 100%; }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei",
               "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  transition: background 0.25s, color 0.25s;
}

/* === Layered backgrounds ===
   Eva-01: scan-line (green) + vignette (purple) — green-dominant now
   Eva-00: nothing
*/
:root[data-theme="eva01"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at top, rgba(57, 255, 20, 0.05) 0%, transparent 55%),
    repeating-linear-gradient(0deg, transparent 0, transparent 2px,
      rgba(57, 255, 20, 0.018) 2px, rgba(57, 255, 20, 0.018) 3px);
  z-index: 0;
}
/* Stacking context: only set z-index + isolation, don't touch position.
   Avoid the trap where this overrides .app-header/.toolbar position rules. */
:root[data-theme="eva01"] body > * { isolation: isolate; }

/* Green accent bar removed — was fixed under header but stayed during scroll.
   Header already has its own green accent border (see .app-header shadow).
*/

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: var(--header-pattern);
  border-bottom: 1px solid var(--border-strong);
  box-shadow:
    0 4px 16px rgba(155, 77, 255, 0.25),
    0 1px 0 var(--accent);
}
.app-header h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
:root[data-theme="eva01"] .app-header h1 {
  color: var(--accent);
  text-shadow:
    0 0 8px var(--accent-glow),
    0 0 16px var(--accent-glow);
  font-family: "Consolas", "SF Mono", "Courier New", monospace;
}
.header-actions { display: flex; gap: 6px; }
.btn-icon {
  background: rgba(26, 20, 38, 0.6);
  border: 1px solid var(--border-strong);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
:root[data-theme="eva00"] .btn-icon {
  background: var(--surface);
  border-color: var(--border);
}
.btn-icon:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
:root[data-theme="eva01"] .btn-icon:hover {
  color: var(--accent);
}
.btn-icon.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
:root[data-theme="eva01"] .btn-icon.active {
  box-shadow: 0 0 16px var(--accent);
}

/* === Toolbar: NON-STICKY, sits in normal flow, scrolls away with content === */
.toolbar {
  position: static;
  background: var(--bg-elevated);
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  display: block;
  overflow: visible;
}
:root[data-theme="eva01"] .toolbar {
  background: linear-gradient(180deg, rgba(10, 30, 18, 0.96) 0%, rgba(10, 5, 18, 0.98) 100%);
  border-bottom: 1px solid var(--accent);
  box-shadow: 0 2px 12px rgba(57, 255, 20, 0.08);
}
.search-row {
  padding: 0 12px 8px 12px;
  width: 100%;
  display: block;
}
.search-row input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  -webkit-appearance: none;
  display: block;
}
.search-row input::placeholder { color: var(--text-muted); }
.search-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

/* Each filter-group is a vertical block: label on its own line, then horizontal-scroll chips */
.filter-row {
  display: block;
  width: 100%;
}
.filter-group {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}
.filter-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  display: block;
  width: 100%;
  padding: 0 12px 4px 12px;
}
:root[data-theme="eva01"] .filter-label {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}

/* Chips: horizontal-scroll, NO wrap, fixed height */
.chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 6px;
  padding: 2px 12px 6px 12px;
  width: 100%;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
:root[data-theme="eva01"] .chip {
  background: rgba(26, 20, 38, 0.6);
  border-color: var(--border-strong);
}
.chip:hover { border-color: var(--accent); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 800;
  text-shadow: none;
}
:root[data-theme="eva01"] .chip.active {
  background: var(--accent);
  color: #000;
  border-color: #000;
  box-shadow: 0 0 8px var(--accent-glow);
}
:root[data-theme="eva00"] .chip.active {
  background: var(--accent);
  color: #000;
  border-color: #c89400;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.places {
  padding: 14px 12px 120px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 1;  /* below sticky toolbar (z-index: 20) to prevent overlap */
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  position: relative;
  transition: all 0.2s;
  touch-action: manipulation;
  z-index: 1;
}
:root[data-theme="eva01"] .card {
  background: linear-gradient(135deg, #0e0a18 0%, #14182a 100%);
  border-color: var(--border-strong);
}
.card:hover {
  border-color: var(--accent);
}
:root[data-theme="eva01"] .card:hover {
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}
:root[data-theme="eva01"] .card:hover .name {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}
.card.visited { opacity: 0.55; }
.card.visited .name { text-decoration: line-through; }
.card.selected {
  border-color: var(--accent);
  background: var(--surface-2);
}
:root[data-theme="eva01"] .card.selected {
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 16px var(--accent-glow),
    inset 0 0 20px rgba(57, 255, 20, 0.06);
}
.card.dragging { opacity: 0.4; transform: scale(0.98); }
.card.ghost {
  background: var(--surface-2);
  border-style: dashed;
  border-color: var(--accent);
}

.card-check {
  position: absolute;
  top: 10px; left: 10px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: all 0.15s;
}
body.edit-mode .card-check { display: flex; }
.card-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.card-check.checked::after {
  content: "✓";
  color: #000;
  font-size: 14px;
  font-weight: bold;
}

.card-thumb {
  width: 88px;
  flex-shrink: 0;
  background: var(--surface-2);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb.placeholder {
  color: var(--text-muted);
}
.card-thumb.placeholder svg { width: 32px; height: 32px; }
.card-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.card-body {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.3;
  flex: 1;
  word-break: break-word;
  transition: color 0.2s;
}
:root[data-theme="eva01"] .name {
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Per-type badge colors */
.type-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  color: #000;
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.type-badge.t-餐廳 { background: var(--type-restaurant); color: #000; }
.type-badge.t-按摩 { background: var(--type-massage); color: #fff; border-color: var(--type-massage); }
.type-badge.t-茶飲 { background: var(--type-tea); color: #000; }
.type-badge.t-甜品 { background: var(--type-dessert); color: #000; }
.type-badge.t-購物 { background: var(--type-shopping); color: #fff; border-color: var(--type-shopping); }
.type-badge.t-景點 { background: var(--type-attraction); color: #000; }

.area {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
:root[data-theme="eva01"] .area::before {
  content: "▸";
  color: var(--accent);
  font-size: 11px;
  text-shadow: 0 0 6px var(--accent-glow);
}

.addresses {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;  /* allow text wrapping inside flex */
}
.addresses .addr {
  display: block;  /* simpler layout, allow text wrap freely */
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;  /* break long unbreakable strings */
  padding-left: 12px;
  position: relative;
}
.addresses .addr::before {
  content: "›";
  color: var(--accent);
  position: absolute;
  left: 0;
  font-weight: 700;
}
:root[data-theme="eva01"] .addresses .addr::before {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}
.addresses .addr.primary {
  color: var(--text);
}

.address {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notes {
  font-size: 12px;
  color: var(--text);
  background: var(--surface-2);
  padding: 6px 9px;
  border-radius: 6px;
  margin-top: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.4;
}
:root[data-theme="eva01"] .notes {
  border-left: 3px solid var(--accent-2);
  background: linear-gradient(90deg, rgba(155, 77, 255, 0.12) 0%, rgba(57, 255, 20, 0.04) 100%);
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.15s;
}
:root[data-theme="eva01"] .action-btn {
  background: rgba(26, 20, 38, 0.6);
  border-color: var(--border-strong);
}
.action-btn:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }
:root[data-theme="eva01"] .action-btn:hover {
  box-shadow: 0 0 8px var(--accent-glow);
}
.action-btn svg { width: 13px; height: 13px; }
.action-btn.ig { color: #e1306c; }
:root[data-theme="eva01"] .action-btn.ig {
  color: var(--accent);
}

/* Visit button: green tint when not visited, stronger when visited */
.action-btn.action-visit {
  color: var(--text-muted);
}
:root[data-theme="eva01"] .action-btn.action-visit {
  color: var(--accent);
  border-color: rgba(57, 255, 20, 0.4);
}
:root[data-theme="eva01"] .action-btn.action-visit:hover {
  background: rgba(57, 255, 20, 0.15);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.card.visited .action-btn.action-visit {
  background: rgba(57, 255, 20, 0.15);
  color: var(--accent);
}

.drag-handle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0 4px;
  cursor: grab;
  align-self: stretch;
}
body.edit-mode .drag-handle { display: flex; align-items: center; }

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 14px;
}

/* Edit bar — fixed bottom, hidden via display:none by default */
.edit-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  z-index: 40;
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: none;
  box-shadow: 0 -4px 16px var(--purple-glow);
}
body.edit-mode .edit-bar { display: block; }
:root[data-theme="eva01"] .edit-bar {
  background: linear-gradient(180deg, #14182a 0%, #0a0512 100%);
  border-top: 2px solid var(--accent);
  box-shadow:
    0 -4px 24px var(--accent-glow),
    0 -1px 0 var(--accent-2);
}
:root[data-theme="eva00"] .edit-bar {
  border-top: 2px solid var(--accent);
  background: var(--surface);
}
.edit-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}
#selected-count { flex: 1; font-size: 13px; color: var(--text-muted); font-weight: 600; }
:root[data-theme="eva01"] #selected-count {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}

.btn-primary, .btn-secondary, .btn-danger {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 700;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { filter: brightness(1.1); }
:root[data-theme="eva01"] .btn-primary {
  box-shadow: 0 0 14px var(--accent-glow);
}
.btn-primary:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
:root[data-theme="eva01"] .btn-secondary {
  background: rgba(26, 20, 38, 0.6);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface); border-color: var(--accent); }
.btn-danger {
  background: var(--danger);
  color: white;
}
:root[data-theme="eva01"] .btn-danger {
  box-shadow: 0 0 10px rgba(255, 56, 96, 0.4);
}
.btn-danger:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.18s;
}
.modal.hidden { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--surface);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-up 0.22s;
  border-top: 2px solid var(--accent);
}
:root[data-theme="eva01"] .modal-card {
  background: linear-gradient(180deg, #14182a 0%, #0e0a18 100%);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -8px 32px var(--accent-glow);
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-strong);
}
.modal-head h2 { font-size: 16px; font-weight: 700; }
:root[data-theme="eva01"] .modal-head h2 {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: "Consolas", "SF Mono", "Courier New", monospace;
  text-shadow: 0 0 8px var(--accent-glow);
}
.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  line-height: 1;
  width: 32px; height: 32px;
  cursor: pointer;
  border-radius: 6px;
}
.btn-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
:root[data-theme="eva01"] .field-label {
  color: var(--accent);
  text-shadow: 0 0 4px var(--accent-glow);
}
.modal-body input[type="text"],
.modal-body input[type="url"],
.modal-body select,
.modal-body textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  outline: none;
  resize: vertical;
}
:root[data-theme="eva01"] .modal-body input,
:root[data-theme="eva01"] .modal-body select,
:root[data-theme="eva01"] .modal-body textarea {
  background: rgba(10, 5, 18, 0.7);
  border-color: var(--border-strong);
}
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modal-body label input,
.modal-body label select,
.modal-body label textarea {
  color: var(--text);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.addr-list { display: flex; flex-direction: column; gap: 6px; }
.addr-row { display: flex; gap: 6px; align-items: center; }
.addr-row input { flex: 1; }
.addr-row .addr-remove {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.addr-row .addr-remove:hover { color: var(--danger); border-color: var(--danger); }
.btn-add-addr {
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
:root[data-theme="eva01"] .btn-add-addr {
  color: var(--accent);
  border-color: var(--accent);
}
.btn-add-addr:hover { border-color: var(--accent); color: var(--accent); }

#btn-extract { margin-top: 4px; }
.status-msg {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
  min-height: 0;
  word-break: break-word;
  border: 1px solid var(--border);
}
.status-msg.error {
  background: rgba(255, 56, 96, 0.1);
  color: var(--danger);
  border-color: var(--danger);
}
.status-msg.ok {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}
:root[data-theme="eva01"] .status-msg.ok {
  text-shadow: 0 0 4px var(--accent-glow);
}
.status-msg:empty { display: none; }

.preview-card {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preview-card.hidden { display: none; }
.preview-thumb-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface);
  border-radius: 6px;
  overflow: hidden;
}
.preview-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.preview-fields { display: flex; flex-direction: column; gap: 8px; }
.preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.preview-actions .btn-primary { flex: 1; }

/* Address picker modal */
.picker-card { max-width: 480px; }
.picker-actions {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}
.picker-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.picker-item:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.picker-num {
  background: var(--accent);
  color: #000;
  font-weight: 800;
  font-size: 11px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.picker-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

/* Image search modal */
.img-search-card { max-width: 720px; }
.img-search-query {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  word-break: break-all;
}
.img-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 680px) {
  .img-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.img-candidate {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: all 0.15s;
  position: relative;
  aspect-ratio: 4/3;
}
.img-candidate:hover {
  border-color: var(--accent);
  transform: scale(1.02);
}
.img-candidate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg);
}
.img-candidate .img-src {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: var(--accent);
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
}

.manual-paste {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.manual-paste summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
  list-style: none;
  user-select: none;
}
.manual-paste summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 6px;
  font-size: 9px;
  transition: transform 0.15s;
}
.manual-paste[open] summary::before {
  transform: rotate(90deg);
}
.manual-paste-body {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.manual-paste-body input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.manual-paste-body input:focus {
  border-color: var(--accent);
}

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  z-index: 60;
  animation: toast-in 0.2s;
  max-width: 90vw;
  word-break: break-word;
}
:root[data-theme="eva01"] .toast {
  color: var(--accent);
  text-shadow: 0 0 4px var(--accent-glow);
}
.toast.hidden { display: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Pull-to-refresh indicator */
#ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s, opacity 0.2s;
  box-shadow: var(--shadow);
}
:root[data-theme="eva01"] #ptr-indicator {
  color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}
#ptr-indicator.ready { border-color: var(--accent); }
.ptr-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  display: none;
}
#ptr-indicator.spinning .ptr-spinner {
  display: block;
  animation: ptr-spin 0.8s linear infinite;
}
@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 680px) {
  body { font-size: 14px; }
  .app-header { padding: 16px 24px 12px; }
  .app-header h1 { font-size: 20px; }
  .toolbar { padding: 10px 0; }
  .search-row { padding: 0 24px 8px 24px; }
  .filter-label { padding: 0 24px 4px 24px; }
  .chips { padding: 2px 24px 6px 24px; }
  .places {
    padding: 16px 24px 100px;
    max-width: 1080px;  /* 1080p-friendly, ultrawide won't be too wide */
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);  /* 3-column card grid */
    gap: 12px;
  }
  .card-thumb { width: 100%; height: 140px; }  /* thumb goes on top in 3-col */
  .card {
    flex-direction: column;  /* stack thumb above body for 3-col */
  }
  .card-body { padding: 10px 12px 12px; }
  .card-check { top: 8px; left: 8px; }
  .empty { grid-column: 1 / -1; }
  .drag-handle { display: none !important; }  /* hide drag handle in 3-col, use edit-mode buttons */
}