/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0d0f14;
  --surface: #161a23;
  --surface2: #1e2430;
  --surface3: #252d3d;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);
  --accent: #4fffb0;
  --accent2: #ff6b6b;
  --accent3: #ffe8b2;
  --accent4: #97cbff;
  --text: #e8eaf0;
  --text2: #8a93a8;
  --text3: #555f75;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --panel-w: 420px;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
}

input,
select,
textarea {
  font-family: var(--font-body);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface3);
  border-radius: 4px;
}

/* MAP */
#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* HEADER */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 54px;
  background: rgba(13, 15, 20, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

#header .logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-spacer {
  flex: 1;
}

.hdr-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
}

.hdr-btn:hover {
  background: var(--surface3);
  border-color: var(--accent);
  color: var(--accent);
}

.hdr-btn.primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}

.hdr-btn.primary:hover {
  background: #3de89a;
}

.hdr-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* MAIN PANEL */
#main-panel {
  position: fixed;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  width: min(880px, calc(100vw - 24px));
  max-height: calc(100vh - 74px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
}

#main-panel>* {
  pointer-events: auto;
}

/* WELCOME CARD */
#welcome-card {
  background: rgba(22, 26, 35, 0.96);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 28px 32px 24px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}

#welcome-card h1 {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

#welcome-card h1 span {
  color: var(--accent);
}

#welcome-card p {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 18px;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.wf-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.wf-item i {
  color: var(--accent);
  font-size: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}

.wf-item .wf-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}

.wf-item .wf-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.welcome-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface3);
}

.btn.accent {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}

.btn.accent:hover {
  background: #3de89a;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border2);
}

.btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.danger {
  border-color: var(--accent2);
  color: var(--accent2);
  background: transparent;
}

.btn.danger:hover {
  background: rgba(255, 107, 107, 0.1);
}

.btn.sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 6px;
  gap: 5px;
}

.btn.xs {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 5px;
  gap: 4px;
}

/* TRIPS SECTION */
#trips-section {
  background: rgba(22, 26, 35, 0.96);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  margin-top: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}

.trips-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.trips-header h2 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
}

.trip-count {
  background: var(--surface3);
  color: var(--text2);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}

#trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  min-height: 0;
}

.trip-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 150px;
}

.trip-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.trip-card-thumb {
  height: 80px;
  background: var(--surface3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.trip-card-thumb i {
  font-size: 28px;
  color: var(--text3);
}

.trip-card-body {
  padding: 10px 12px;
  flex: 1;
}

.trip-card-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-card-meta {
  font-size: 11px;
  color: var(--text2);
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.trip-tag {
  background: var(--surface3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}

.trip-card-actions {
  display: flex;
  gap: 4px;
  padding: 6px 8px 8px;
}

.trip-card-actions button {
  flex: 1;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 11px;
  transition: var(--transition);
}

.trip-card-actions button:hover {
  background: var(--surface3);
  color: var(--text);
}

.trip-card-actions button.view {
  border-color: var(--accent);
  color: var(--accent);
}

.trip-card-actions button.view:hover {
  background: rgba(79, 255, 176, 0.1);
}

.year-group-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 0 4px;
  grid-column: 1/-1;
}

.empty-trips {
  padding: 40px 20px;
  text-align: center;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-trips i {
  font-size: 40px;
  opacity: 0.3;
}

/* SIDE PANEL */
#side-panel {
  position: fixed;
  top: 54px;
  right: 0;
  bottom: 0;
  width: var(--panel-w);
  background: rgba(13, 15, 20, 0.97);
  backdrop-filter: blur(24px);
  border-left: 1px solid var(--border2);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#side-panel.open {
  transform: translateX(0);
}

.sp-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sp-header h2 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-close {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sp-close:hover {
  background: var(--surface2);
  color: var(--text);
}

.sp-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sp-tab {
  flex: 1;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
}

.sp-tab:hover {
  color: var(--text);
}

.sp-tab.active {
  color: var(--accent);
}

.sp-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.sp-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

/* INFO CARDS */
.info-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.info-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: var(--text2);
}

.stat-value {
  font-size: 13px;
  font-weight: 600;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  margin: 2px;
  background: var(--surface3);
  color: var(--text);
}

/* STOP LIST */
.seg-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.seg-item:hover {
  border-color: var(--border2);
  background: var(--surface2);
}

.seg-item.highlighted {
  border-color: var(--accent);
  background: rgba(79, 255, 176, 0.05);
}

.seg-item.hidden-seg {
  opacity: 0.4;
}

.seg-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.seg-info {
  flex: 1;
  min-width: 0;
}

.seg-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg-meta {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}

.seg-actions {
  display: flex;
  gap: 4px;
  align-items: flex-start;
  flex-shrink: 0;
}

.seg-btn {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text3);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.seg-btn:hover {
  border-color: var(--border2);
  color: var(--text2);
}

.seg-btn.on {
  border-color: var(--accent);
  color: var(--accent);
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  width: min(640px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.modal-header h3 {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  flex: 1;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--surface2);
  color: var(--text);
}

.modal-body {
  padding: 18px 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

/* WIZARD */
#wizard-modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 85vh;
}

.wizard-steps {
  display: flex;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  gap: 0;
  flex-shrink: 0;
}

.wz-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.wz-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface3);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.wz-step.active .wz-step-num {
  background: var(--accent);
  color: #000;
}

.wz-step.done .wz-step-num {
  background: rgba(79, 255, 176, 0.2);
  color: var(--accent);
}

.wz-step-label {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}

.wz-step.active .wz-step-label {
  color: var(--text);
}

.wz-step-line {
  flex: 1;
  height: 1px;
  background: var(--border2);
  margin: 0 6px;
}

.wz-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}

.wz-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* UPLOAD */
.upload-area {
  border: 2px dashed var(--border2);
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface2);
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(79, 255, 176, 0.05);
}

.upload-area i {
  font-size: 36px;
  color: var(--text3);
  margin-bottom: 10px;
  display: block;
}

.upload-area p {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
}

.upload-area strong {
  color: var(--accent);
}

.expandable {
  margin-top: 12px;
}

.expand-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--text2);
  font-size: 12px;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
  transition: var(--transition);
}

.expand-toggle:hover {
  border-color: var(--border2);
  color: var(--text);
}

.expand-content {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  border-top: none;
  padding: 12px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.7;
  display: none;
}

.expand-content.open {
  display: block;
}

.expand-content ol {
  padding-left: 18px;
}

.expand-content li {
  margin-bottom: 4px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface3);
  border-radius: 20px;
  font-size: 11px;
  margin: 2px;
}

.file-chip i {
  color: var(--accent);
  font-size: 10px;
}

/* SETTINGS */
.setting-group {
  margin-bottom: 18px;
}

.setting-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.setting-label {
  font-size: 13px;
  flex: 1;
}

.setting-value {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.slider-row label {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  justify-content: space-between;
}

.slider-row label span {
  color: var(--accent);
  font-weight: 600;
}

input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--surface3);
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.db-input {
  width: 100%;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
  outline: none;
}

.db-input:focus {
  border-color: var(--accent);
}

.db-input.sm {
  height: 28px;
  font-size: 12px;
}

/* PLACE TAGGING */
#wz-step3 {
  display: flex;
  flex-direction: column;
}

.tag-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 320px;
}

.tag-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
}

.place-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.place-item:hover {
  border-color: var(--border2);
}

.place-item.selected {
  border-color: var(--accent);
  background: rgba(79, 255, 176, 0.05);
}

.place-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.place-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.place-name {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-freq {
  font-size: 11px;
  color: var(--text2);
}

.place-addr {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 6px;
}

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

.tag-btn {
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 10px;
  transition: var(--transition);
  cursor: pointer;
}

.tag-btn:hover {
  border-color: var(--border2);
  color: var(--text);
}

.tag-btn.active {
  font-weight: 700;
}

.tag-btn[data-tag=home].active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79, 255, 176, 0.12);
}

.tag-btn[data-tag=work].active {
  border-color: var(--accent4);
  color: var(--accent4);
  background: rgba(116, 185, 255, 0.12);
}

.tag-btn[data-tag=chores].active {
  border-color: var(--accent3);
  color: var(--accent3);
  background: rgba(255, 209, 102, 0.12);
}

.tag-btn[data-tag=ignore].active {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(255, 107, 107, 0.12);
}

.tag-btn[data-tag=none].active {
  border-color: var(--text2);
  color: var(--text2);
}

#wizard-mini-map {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* TRIP RESULTS */
.result-trip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
}

.result-trip-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.result-trip-name {
  font-size: 13px;
  font-weight: 500;
}

.result-trip-meta {
  font-size: 11px;
  color: var(--text2);
}

.stat-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.stat-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.stat-badge i {
  color: var(--accent);
  margin-right: 4px;
}

/* TOAST */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(400px, calc(100vw - 40px));
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toastIn 0.25s ease;
}

.toast.error {
  border-color: var(--accent2);
}

.toast.success {
  border-color: var(--accent);
}

.toast.warning {
  border-color: var(--accent3);
}

.toast i {
  font-size: 14px;
  flex-shrink: 0;
}

.toast.error i {
  color: var(--accent2);
}

.toast.success i {
  color: var(--accent);
}

.toast.warning i {
  color: var(--accent3);
}

.toast.info i {
  color: var(--accent4);
}

.toast-msg {
  font-size: 13px;
  flex: 1;
  line-height: 1.4;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* MAP CONTROLS */
#map-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(22, 26, 35, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.map-ctrl-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* SPINNER */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* PROGRESS */
.progress-bar-wrap {
  background: var(--surface3);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}

/* POPUP */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  border: 1px solid var(--border2) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow) !important;
  color: var(--text) !important;
}

.leaflet-popup-content {
  margin: 14px 16px !important;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
}

.leaflet-popup-tip-container {
  display: none;
}

.popup-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.popup-meta {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 4px;
  line-height: 1.5;
}

.popup-link {
  margin-top: 8px;
}

.popup-link a {
  font-size: 11px;
  color: var(--accent);
}

/* CUSTOM MARKERS */
.custom-div-icon {
  background: none !important;
  border: none !important;
}

.map-marker {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.map-marker i {
  transform: rotate(45deg);
  font-size: 12px;
  color: #000;
}

.map-marker.stop {
  background: var(--accent);
}

.map-marker.eat {
  background: var(--accent3);
}

.map-marker.attraction {
  background: #c44dff;
}

.map-marker.photo {
  background: var(--accent4);
}

.map-marker.stay {
  background: #ff8c69;
}

.map-marker.start {
  background: #fff;
  border-color: var(--accent);
}

.map-marker.end {
  background: var(--accent2);
}

.map-marker.flight {
  background: var(--accent4);
  border-radius: 50%;
  transform: none;
}

.flight-icon-marker {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent4);
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(116, 185, 255, 0.6));
}

/* TOOLTIP */
[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface3);
  color: var(--text);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}

[data-tip]:hover::after {
  opacity: 1;
}

/* INLINE EDIT */
.inline-edit {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline-edit input {
  flex: 1;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--surface2);
  color: var(--text);
  padding: 0 8px;
  font-size: 13px;
  outline: none;
}

/* RESPONSIVE */
@media(max-width:700px) {
  :root {
    --panel-w: calc(100vw - 0px);
  }

  #main-panel {
    width: calc(100vw - 12px);
  }

  #welcome-card {
    padding: 18px;
  }

  #welcome-card h1 {
    font-size: 20px;
  }

  .welcome-features {
    grid-template-columns: 1fr 1fr;
  }

  #header {
    padding: 0 10px;
    gap: 6px;
  }

  .hdr-btn span {
    display: none;
  }

  #trips-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .tag-layout {
    grid-template-columns: 1fr;
  }

  #wizard-mini-map {
    height: 200px;
  }
}

@media(max-width:480px) {
  .welcome-features {
    grid-template-columns: 1fr;
  }

  #trips-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* SECTION LABELS */
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

/* INLINE TAG SELECT */
.tag-select {
  height: 24px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 11px;
  padding: 0 4px;
  outline: none;
  cursor: pointer;
}

.tag-select:focus {
  border-color: var(--accent);
}

/* Slideshow guide overlay (managed by JS) */
#slideshow-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  display: none;
}

body.slideshow-active #slideshow-guide-overlay {
  display: block;
}

body.slideshow-active #map {
  z-index: 999 !important;
  border: 2px solid var(--accent) !important;
  border-radius: 4px;
}
