/* ── Chunk Planner — Modus B ──────────────────────────────────── */

/* ── Setup form ───────────────────────────────────────────────── */
.setup-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 2rem 1rem;
}

.setup-card {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 2.5rem 2rem;
  max-width: 560px;
  width: 100%;
}

.setup-card h1 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
  color: var(--text-primary);
}

.setup-card .setup-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1.8rem;
}

.setup-field {
  margin-bottom: 1.2rem;
}

.setup-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.setup-field input,
.setup-field textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.98rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.2s;
  resize: vertical;
}

.setup-field input:focus,
.setup-field textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.setup-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pref-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.pref-chip {
  padding: 0.3rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--brand-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pref-chip:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* ── Structured preference questions ─────────────────────────── */
.pref-questions {
  margin-bottom: 1.2rem;
}

.pref-question {
  margin-bottom: 0.85rem;
}

.pref-question-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.pref-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pref-option {
  padding: 0.3rem 0.85rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pref-option:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.pref-option.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.setup-optional-toggle {
  font-size: 0.88rem;
  color: var(--brand-primary);
  cursor: pointer;
  user-select: none;
  margin-bottom: 1rem;
  display: inline-block;
}

.setup-btn {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.2s;
}

.setup-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Trip header ──────────────────────────────────────────────── */
.trip-header {
  margin-bottom: 1.5rem;
}

.trip-header-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  justify-content: space-between;
}

.trip-header h1 {
  font-size: 1.6rem;
  margin: 0 0 0.3rem;
  color: var(--text-primary);
}

.trip-header .trip-dates {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.trip-header .trip-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

/* ── Chunk overview ───────────────────────────────────────────── */
.chunks-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chunk-connector {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0 0.3rem 1.5rem;
  position: relative;
}

.chunk-connector::before {
  content: '';
  position: absolute;
  left: 2rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.chunk-merge-btn {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  cursor: pointer;
  z-index: 1;
  transition: background 0.2s, color 0.2s;
}

.chunk-merge-btn:hover {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

.chunk-card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border-left: 4px solid transparent;
  padding: 1.2rem 1.4rem;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
}

.chunk-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.chunk-card.past {
  opacity: 0.55;
  border-left-color: #cbd5e1;
  background: #f8fafc;
}

.chunk-card.active-chunk {
  border-left-color: var(--brand-primary);
  box-shadow: 0 4px 16px rgba(67,176,179,0.18);
}

.chunk-card.future {
  border-left-color: var(--brand-accent);
}

.chunk-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.chunk-title-group {
  flex: 1;
  min-width: 0;
}

.chunk-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chunk-region {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.chunk-badges {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}

.badge-active {
  background: #d1fae5;
  color: #065f46;
}

.badge-pending {
  background: #fff7ed;
  color: #c2410c;
}

.badge-count {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.chunk-dates {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-top: 0.6rem;
}

.chunk-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.chunk-action-btn {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.chunk-action-btn:hover {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

.chunk-action-btn.danger:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.chunk-warning {
  font-size: 0.8rem;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  margin: 0.3rem 0;
}

.add-chunk-btn {
  margin-top: 1.2rem;
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.add-chunk-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* ── Inline edit form inside chunk card ───────────────────────── */
.chunk-edit-form {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chunk-edit-form input {
  padding: 0.5rem 0.7rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-size: 0.93rem;
  font-family: inherit;
}

.chunk-edit-form input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.chunk-edit-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.chunk-edit-form .form-actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Chunk detail (day view) ──────────────────────────────────── */
.chunk-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.back-btn {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.back-btn:hover {
  background: #e2e8f0;
}

.chunk-detail-title {
  flex: 1;
}

.chunk-detail-title h2 {
  margin: 0 0 0.15rem;
  font-size: 1.35rem;
  color: var(--text-primary);
}

.chunk-detail-title .detail-dates {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.generate-chunk-btn {
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: inherit;
}

.generate-chunk-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Day card ─────────────────────────────────────────────────── */
.day-card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 1.2rem;
  overflow: hidden;
}

.day-card-header {
  background: var(--brand-primary);
  color: white;
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-card-header h3 {
  margin: 0;
  font-size: 1rem;
}

.day-card-date {
  font-size: 0.82rem;
  opacity: 0.85;
}

.day-card-body {
  padding: 1rem 1.2rem;
}

/* ── Activity card ────────────────────────────────────────────── */
.activity-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  background: #fff;
  transition: border-color 0.15s;
}

.activity-card.pending {
  border-color: #fdba74;
  background: #fff7ed;
}

.activity-card-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.activity-name {
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--text-primary);
}

.activity-source-badge {
  font-size: 0.7rem;
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-desc {
  font-size: 0.87rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  line-height: 1.5;
}

.activity-location {
  font-size: 0.8rem;
  color: var(--brand-primary);
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.activity-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.accept-btn {
  padding: 0.35rem 0.85rem;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.accept-btn:hover {
  background: #a7f3d0;
}

.reject-btn {
  padding: 0.35rem 0.85rem;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.reject-btn:hover {
  background: #fecaca;
}

.edit-activity-btn,
.delete-activity-btn {
  padding: 0.35rem 0.75rem;
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}

.delete-activity-btn:hover {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* ── Bulk actions bar ─────────────────────────────────────────── */
.bulk-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0.9rem;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.bulk-actions span {
  flex: 1;
  min-width: 120px;
}

.bulk-accept-all {
  padding: 0.3rem 0.8rem;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.bulk-reject-all {
  padding: 0.3rem 0.8rem;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ── Add activity form ────────────────────────────────────────── */
.add-activity-section {
  margin-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.add-activity-section button {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 7px;
  border: 1.5px dashed #cbd5e1;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.add-activity-section button:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.new-activity-form {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.new-activity-form input,
.new-activity-form textarea {
  padding: 0.5rem 0.7rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.new-activity-form input:focus,
.new-activity-form textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.new-activity-form .form-actions {
  display: flex;
  gap: 0.5rem;
}

.save-btn {
  padding: 0.4rem 1rem;
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
}

.cancel-btn {
  padding: 0.4rem 1rem;
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
}

/* ── Retry error box ──────────────────────────────────────────── */
.error-box {
  background: #fff1f2;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
}

.error-box h3 { margin: 0 0 0.5rem; color: #991b1b; }
.error-box p  { color: var(--text-secondary); margin: 0 0 0.8rem; font-size: 0.9rem; }

.retry-btn {
  padding: 0.55rem 1.2rem;
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

/* ── Loading ──────────────────────────────────────────────────── */
.loading {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.loading-icon {
  height: 18px;
}

/* ── Stacked planner layout (map above content) ───────────────── */
.planner-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.planner-map-col {
  width: 100%;
}

.planner-content-col {
  min-width: 0;
}

.chunk-map-sticky {
  width: 100%;
  height: 400px;
  min-height: 250px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

@media (max-width: 900px) {
  .chunk-map-sticky {
    height: 280px;
  }
}

@media (max-width: 600px) {
  .chunk-map-sticky {
    height: 220px;
  }
}

/* ── Map (legacy inline, kept for backwards compat) ───────────── */
.chunk-map {
  width: 100%;
  height: 380px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.chunk-map-legend {
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  max-width: 160px;
}

/* ── Day card header generate button ─────────────────────────── */
.day-generate-btn {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s;
  flex-shrink: 0;
}

.day-generate-btn:hover {
  background: rgba(255,255,255,0.3);
}

.day-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Move activity button ─────────────────────────────────────── */
.move-activity-btn {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: var(--text-secondary);
  cursor: pointer;
}

.move-activity-btn:hover {
  background: #e0e7ff;
  border-color: #7589d5;
  color: #3730a3;
}

/* ── Inline expanded chunk ────────────────────────────────────── */
.chunk-preview {
  /* override previous compact styles — now full-width detail */
  border-top: 1px solid #e2e8f0;
  padding-top: 0;
  margin-top: 0.75rem;
}

.inline-chunk-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.6rem 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.5rem;
}

/* Day cards inside expanded chunk inherit all detail-view styles */
.chunk-preview .day-card {
  margin-bottom: 0.75rem;
}

/* ── Single-activity generate form ───────────────────────────── */
.gen-single-form {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.75rem;
  margin-bottom: 0;
}

.gen-single-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gen-single-inner textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  box-sizing: border-box;
}

.gen-single-inner textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(67,176,179,0.15);
}

/* ── Chunk expand button ──────────────────────────────────────── */
.chunk-expand-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}

.chunk-expand-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

/* ── Chunk preview panel ──────────────────────────────────────── */
.chunk-preview {
  margin-top: 0.8rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.75rem;
}

.chunk-preview-days {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chunk-preview-day {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.preview-day-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preview-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.preview-activity-list li {
  font-size: 0.85rem;
  color: var(--text-primary);
  padding: 0.15rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.preview-activity-list li::before {
  content: "·";
  color: var(--brand-primary);
  font-weight: 700;
  flex-shrink: 0;
}

.preview-activity-list li.preview-pending {
  color: var(--text-secondary);
  font-style: italic;
}

.preview-pending-tag {
  font-size: 0.7rem;
  background: #fff7ed;
  color: #c2410c;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  font-style: normal;
}

.preview-loading,
.preview-empty {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
}

/* ── Location pin icon ────────────────────────────────────────── */
.loc-pin-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 3px;
  position: relative;
  top: -1px;
}

/* ── Drag and drop ────────────────────────────────────────────── */
.activity-card[data-activity-id] {
  cursor: grab;
}
.activity-card[data-activity-id]:active {
  cursor: grabbing;
}
.activity-card.dnd-over {
  outline: 2px dashed var(--brand-accent, #43b0b3);
  outline-offset: 2px;
}
.day-card-body.dnd-over {
  background: rgba(67, 176, 179, 0.07);
  border-radius: 6px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .setup-dates { grid-template-columns: 1fr; }

  /* Stack title above badges so title isn't hidden */
  .chunk-card-header {
    flex-direction: column;
    gap: 0.4rem;
  }
  .chunk-badges {
    justify-content: flex-start;
  }

  /* Wrap header buttons so Samenwerken doesn't go off-screen */
  .trip-header-top {
    flex-wrap: wrap;
  }
  .trip-header-top > div {
    flex-shrink: 1;
    flex-wrap: wrap;
  }

  .chunk-detail-header { flex-direction: column; align-items: flex-start; }
  .bulk-actions { flex-direction: column; }

  /* Smaller legend so it doesn't cover most of the map */
  .chunk-map-legend {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    max-width: 110px;
    line-height: 1.5;
    max-height: 80px;
    overflow-y: auto;
  }

  .chunk-map-sticky {
    height: 220px;
  }
}

/* ── Trip status bar (countdown + completeness) ─────────────── */

.trip-status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.6rem 0 0.2rem;
}

.countdown-badge {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  white-space: nowrap;
}

.countdown-badge.countdown-active {
  background: #d1fae5;
  color: #065f46;
}

.countdown-badge.countdown-done {
  background: #f1f5f9;
  color: #64748b;
}

.completeness-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 160px;
}

.completeness-bar-track {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.completeness-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  border-radius: 99px;
  transition: width 0.4s ease;
}

.completeness-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── Activity status toggle ──────────────────────────────────── */

.status-toggle-btn {
  padding: 0.25rem 0.7rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.status-toggle-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.status-toggle-btn.done {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.status-done-badge {
  font-size: 0.7rem;
  background: #d1fae5;
  color: #065f46;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-card.activity-done {
  opacity: 0.8;
}

.activity-card.activity-done .activity-name {
  color: #94a3b8;
}

/* ── Paklijst panel ──────────────────────────────────────────── */

.packing-panel-wrapper {
  margin-top: 1.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.packing-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.packing-toggle-btn:hover { background: #f1f5f9; }

.packing-toggle-btn #packing-meter {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.packing-toggle-btn #packing-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

#packing-panel {
  padding: 0.75rem 1rem 1rem;
  background: #fff;
  border-top: 1.5px solid #e2e8f0;
}

.packing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.packing-item:last-child { border-bottom: none; }

.packing-item-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  cursor: pointer;
  font-size: 0.9rem;
}

.packing-item-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--brand-primary);
}

.packing-item.checked .packing-item-name {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.packing-category {
  font-size: 0.73rem;
  background: #f1f5f9;
  color: var(--text-secondary);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
}

.packing-delete-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  flex-shrink: 0;
  transition: color 0.15s;
}

.packing-delete-btn:hover { color: #ef4444; }

.packing-add-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.packing-add-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.2s;
}

.packing-add-row input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.packing-add-btn {
  padding: 0.5rem 0.85rem;
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

.packing-add-btn:hover { opacity: 0.85; }

.packing-empty {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.5rem 0;
  margin: 0;
}

/* ── AI suggestion items ─────────────────────────────── */
.packing-suggestions-section {
  margin-bottom: 0.5rem;
}

.packing-suggestions-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  margin: 0.5rem 0 0.35rem;
}

.packing-item.packing-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: 7px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.4rem;
}

.packing-item.packing-suggestion:last-child { border-bottom: 1.5px solid #fcd34d; }

.packing-suggestion-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.packing-suggestion-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.packing-approve-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1.5px solid #fcd34d;
  border-radius: 5px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.packing-approve-btn:hover {
  background: #fde68a;
}

/* ── Activity todo list ──────────────────────────────────────── */
.activity-todo-section {
  margin-top: 0.55rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.45rem;
}

.activity-todo-toggle {
  background: none;
  border: none;
  padding: 0.15rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  text-align: left;
}

.activity-todo-toggle:hover { color: var(--text-primary); }

.todo-badge {
  font-size: 0.75rem;
  color: var(--brand-primary);
  font-weight: 600;
}

.activity-todo-list {
  margin-top: 0.45rem;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.2rem 0;
}

.todo-item-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  cursor: pointer;
}

.todo-item-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  accent-color: var(--brand-primary);
}

.todo-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.todo-item.checked .todo-text {
  color: #94a3b8;
  text-decoration: line-through;
}

.todo-delete-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.todo-delete-btn:hover { color: #ef4444; }

.todo-add-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.todo-input {
  flex: 1;
  font-size: 0.82rem;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 0.25rem 0.5rem;
  outline: none;
}

.todo-input:focus { border-color: var(--brand-primary); }

.todo-add-btn {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.25rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
}

.todo-add-btn:hover { opacity: 0.85; }

.todo-loading {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0.25rem 0;
}
