/* ============================================================
   PLAN PAGE — MommaTrip redesign skin (app/templates/plan.html)
   Loaded via base.html's extra_css block. Tokens + .btn grammar come
   from styles.css. The drag-drop board, ticket cards, and modal chrome
   are page-specific and defined here. See ui-redesign/PORT-CONTRACT.md.
   The board renders the REAL emitted DOM from plan.html's inline
   renderer (renderItem/renderDayColumn/renderFocusCard) — no mockup
   markup (.item-glyph etc.) is used.
   ============================================================ */

/* ── Plan Layout ───────────────────────────────────────────── */
.plan-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-top: calc(var(--nav-height) + var(--demo-banner-h));
  overflow: hidden;
  background: var(--earth-50);
}

.plan-topbar {
  position: relative;
  z-index: 10;
  padding: 0.875rem 1.5rem;
  background: var(--white);
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-kicker {
  display: flex;
  align-items: center;
  margin: 0 0 0.375rem;
  color: var(--coral-dark, var(--terra-600));
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.page-kicker::before {
  content: '';
  width: 16px;
  height: 3px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 99px;
  background: currentColor;
}

.plan-topbar-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--forest-900);
  white-space: nowrap;
}
.plan-topbar-subtitle {
  font-size: 0.8125rem;
  color: var(--ink-400);
  white-space: nowrap;
}
.plan-topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 0.625rem;
  align-items: center;
  flex-wrap: wrap;
}
.plan-topbar-actions .btn {
  min-height: 42px;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  box-shadow: 3px 4px 0 var(--ink);
}
.plan-topbar-actions .btn:not(:disabled):hover { box-shadow: 5px 6px 0 var(--ink); }
.plan-topbar-actions .btn:not(:disabled):active { box-shadow: 1px 1px 0 var(--ink); }

/* Transport tips ticker */
.tips-ticker {
  border-bottom: 1.5px dashed var(--earth-300);
  background: var(--amber-100);
  color: var(--ink-700, var(--ink));
  padding: 0.5rem 1.5rem;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}
.tips-ticker-icon { font-size: 0.9rem; flex-shrink: 0; }
.tips-ticker-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
  transition: opacity var(--duration-mid) var(--ease-smooth);
}

/* Live sync indicator */
#sync-wrap { margin-left: 0.5rem; }
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--earth-200);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: var(--forest-100);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-600, var(--ink));
  white-space: nowrap;
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3f9b67;
  box-shadow: 0 0 0 3px rgba(63,155,103,0.15);
}
.sync-dot.syncing { background: var(--amber-500); animation: pulse 1.2s infinite; }
.sync-dot.error   { background: var(--terra-600); animation: none; box-shadow: none; }

@keyframes pulse { 50% { transform: scale(0.65); opacity: 0.5; } }

/* ── Main Plan Body ────────────────────────────────────────── */
.plan-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  background: var(--earth-50);
}

/* ── Unscheduled Panel ─────────────────────────────────────── */
.unscheduled-panel {
  width: 264px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--earth-200);
  background: var(--white);
  color: var(--ink);
  overflow: hidden;
}
.unscheduled-header {
  padding: 1rem 1.125rem 0.75rem;
  border-bottom: 1px solid var(--earth-150, var(--earth-200));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.unscheduled-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.unscheduled-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 22px;
  padding: 0.125rem 0.5rem;
  border-radius: 2rem;
  background: var(--amber-500);
  color: var(--ink-deep);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
}
.unscheduled-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.625rem;
  min-height: 120px;
}
.unscheduled-empty {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--forest-100);
  color: var(--ink-500);
}
.unscheduled-empty .empty-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--forest-600);
  animation: fadeIn 0.4s var(--ease-out);
}
.unscheduled-empty p {
  font-size: 0.8125rem;
  color: var(--ink-500);
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

/* Scrollbar styling */
.unscheduled-list::-webkit-scrollbar { width: 4px; }
.unscheduled-list::-webkit-scrollbar-track { background: transparent; }
.unscheduled-list::-webkit-scrollbar-thumb { background: var(--earth-300); border-radius: 2px; }

/* ── Day Columns Area ──────────────────────────────────────── */
.days-area {
  flex: 1;
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 1.125rem 1.125rem 1.125rem 0;
  scroll-padding-left: 1.125rem;
  background: var(--earth-50);
}
/* Custom scrollbar */
.days-area::-webkit-scrollbar { height: 6px; }
.days-area::-webkit-scrollbar-track { background: transparent; border-radius: 3px; }
.days-area::-webkit-scrollbar-thumb { background: var(--earth-300); border-radius: 3px; }

/* ── Day Column ────────────────────────────────────────────── */
.day-column {
  --ticket-muted: #f4ecd9;
  flex-shrink: 0;
  width: 272px;
  display: flex;
  flex-direction: column;
  background: var(--ticket-muted);
  border-radius: 16px 16px 8px 8px;
  border: 2px solid var(--ink);
  box-shadow: 5px 6px 0 var(--ink);
  margin-left: 1.125rem;
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-smooth), box-shadow var(--duration-fast) var(--ease-smooth);
}
.day-column.drag-over {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(255,202,86,0.4), 5px 6px 0 var(--ink);
}
.day-column.daytrip-conflict { border-color: var(--terra-600); }

.day-header {
  padding: 0.75rem 0.875rem;
  border-bottom: 2px dashed var(--earth-300);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
}
.day-label {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--forest-900);
  min-width: 0;
  flex: 1;
  outline: none;
  border-bottom: 1.5px solid transparent;
  transition: border-color var(--duration-fast);
}
.day-label:focus { border-bottom-color: var(--forest-400); }
.day-label:empty::before { content: attr(data-placeholder); color: var(--ink-300); }
.day-date {
  font-size: 0.68rem;
  color: var(--ink-300);
  font-family: var(--mono);
  white-space: nowrap;
}
.day-item-count {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--forest-200);
  color: var(--forest-800);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.day-expand-btn,
.day-delete-btn {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid var(--earth-200);
  background: var(--white);
  cursor: pointer;
  color: var(--ink-400);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast), color var(--duration-fast);
  flex-shrink: 0;
}
.day-expand-btn:hover { background: var(--forest-100); color: var(--forest-700); }
.day-delete-btn:hover { background: var(--terra-100); color: var(--terra-500); }

.daytrip-warning {
  margin: 0.6rem 0.6rem 0;
  padding: 0.5rem 0.65rem;
  background: var(--amber-100);
  border: 1px solid #e09064;
  border-radius: var(--radius-sm);
  color: #87351f;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.4;
}
.daytrip-warning.hidden { display: none; }

.weather-badge {
  font-size: 0.7rem;
  white-space: nowrap;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--earth-100);
  color: var(--ink-400);
}
.weather-badge.severe {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
}
.df-weather { font-size: 0.8rem; }
.weather-changed-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  margin: 0 0 0.75rem;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
  font-size: 0.82rem;
}
.weather-changed-banner.hidden { display: none; }
.weather-changed-banner button {
  background: none; border: none; color: inherit; font-size: 1.1rem; cursor: pointer; line-height: 1;
}

/* Quiet strip for a per-day nap annotation (on_the_go / travel_day) — same
   box model as .daytrip-warning, calm mint tint instead of warning amber. */
.nap-annotation {
  margin: 0.6rem 0.6rem 0;
  padding: 0.5rem 0.65rem;
  background: var(--mint-light);
  border: 1px solid var(--mint);
  border-radius: var(--radius-sm);
  color: var(--forest-700);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.4;
}

.day-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.625rem;
  min-height: 160px;
}
.day-list::-webkit-scrollbar { width: 4px; }
.day-list::-webkit-scrollbar-thumb { background: var(--earth-300); border-radius: 2px; }

.day-empty-zone {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--earth-300);
  border-radius: var(--radius-md);
  margin: 0.5rem;
  color: var(--ink-400);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.day-column.drag-over .day-empty-zone {
  border-color: var(--amber-500);
  color: var(--forest-700);
}

/* ── Trip Item Card (ticket) ───────────────────────────────── */
.trip-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.55rem 0.65rem;
  border-radius: 11px;
  background: var(--white);
  border: 1px solid rgba(18,63,59,0.2);
  box-shadow: 0 2px 0 rgba(9,47,44,0.1);
  margin-bottom: 0.4rem;
  cursor: default;
  transition:
    background var(--duration-fast),
    box-shadow var(--duration-fast),
    border-color var(--duration-fast),
    transform var(--duration-fast);
  position: relative;
  overflow: visible;
}
.trip-item:last-child { margin-bottom: 0; }
.trip-item:hover { border-color: var(--forest-400); box-shadow: 0 3px 0 rgba(9,47,44,0.16); }

.drag-handle {
  color: var(--ink-200);
  font-size: 1rem;
  cursor: grab;
  flex-shrink: 0;
  line-height: 1;
  padding: 2px;
  transition: color var(--duration-fast);
  touch-action: none;
}
.drag-handle:hover { color: var(--ink-400); }
.drag-handle:active { cursor: grabbing; }

.trip-item-thumb {
  width: 52px;
  height: 52px;
  border-radius: 0.55rem;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--earth-100);
}
.trip-item-thumb-wrap {
  width: 52px;
  height: 52px;
  border-radius: 0.55rem;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--earth-200);
}
.trip-item-thumb-wrap .trip-item-thumb { width: 100%; height: 100%; border-radius: 0; }

.trip-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.trip-item-name {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--forest-900);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.trip-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  align-items: center;
}
.trip-item-duration {
  font-size: 0.7rem;
  color: var(--ink-400);
}
.trip-item-time { font-size: 0.7rem; color: var(--forest-600); font-weight: 700; }
.trip-item-time.hidden { display: none; }
.trip-item-time.conflict { color: #92400e; }

.trip-item-type-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--forest-100);
  color: var(--forest-700);
  text-transform: uppercase;
  font-family: var(--mono);
}
.trip-item-type-badge.hotel   { background: var(--forest-100); color: var(--forest-700); }
.trip-item-type-badge.note    { background: #fdf3d8; color: #8a6d1d; }
.trip-item-type-badge.rental  { background: #e3ecf7; color: #2c5d8f; }
.trip-item-type-badge.flight  { background: #e8e3f7; color: #5b4a9e; }
.trip-item-type-badge.daytrip { background: var(--amber-100); color: #b45309; }
.trip-item-type-badge.nap     { background: var(--mint); color: var(--forest-700); }

/* ── Nap block (quiet, system-managed ticket) ──────────────────
   No drag handle, no actions — ensureNapEntries re-derives this tile on
   every render, so nothing on it is user-editable. Mint/paper quiet tint
   with the same hard ink border language, distinct from the amber warning
   strip above. */
.trip-item.nap-block {
  background: var(--mint-light);
  border: 1.5px solid var(--ink);
  box-shadow: none;
  cursor: default;
}
.trip-item.nap-block:hover { border-color: var(--ink); box-shadow: none; }
.nap-icon { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.trip-item.nap-block .trip-item-name { color: var(--forest-800); }
.trip-item.nap-block .trip-item-time { color: var(--forest-700); }

/* Same quiet treatment for the day-focus overlay's compact nap card */
.df-card.nap-block {
  align-items: center;
  background: var(--mint-light);
  border: 1.5px solid var(--ink);
  box-shadow: none;
}
.df-card.nap-block .df-name { color: var(--forest-800); }

.notes-preview {
  font-size: 0.72rem;
  color: var(--ink-300);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

/* Compact 2×2 button grid pinned to the right */
.trip-item-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  flex-shrink: 0;
  align-self: center;
}
.item-action-btn {
  width: 23px;
  height: 23px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-300);
  font-size: 0.72rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.item-action-btn:hover { background: var(--forest-100); color: var(--ink-600); }
.item-action-btn.remove:hover { background: var(--terra-100); color: var(--terra-500); }
.item-action-btn.info-btn {
  font-family: var(--font-display, Georgia, serif);
  font-style: italic;
  font-weight: 700;
  font-size: 0.74rem;
  position: relative;
}
.item-action-btn.info-btn::before {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border: 1.3px solid currentColor;
  border-radius: 50%;
  opacity: 0.55;
}
.item-action-btn.info-btn:hover { background: var(--forest-100); color: var(--forest-700); }

/* Notes popover */
.notes-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 5px 6px 0 var(--ink);
  padding: 0.75rem;
  animation: fadeUp 0.15s var(--ease-out);
}
.notes-popover.hidden { display: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.notes-textarea {
  width: 100%;
  height: 72px;
  resize: none;
  border: 1.5px solid var(--earth-200);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.625rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--ink-700, var(--ink));
  outline: none;
  background: var(--earth-50);
}
.notes-textarea:focus { border-color: var(--forest-400); }

/* SortableJS state classes */
.item-ghost {
  opacity: 0.4;
  background: var(--forest-100) !important;
  border-color: var(--forest-300) !important;
}
.item-chosen {
  box-shadow: 5px 6px 0 var(--ink) !important;
  z-index: 20;
}
.item-drag {
  opacity: 0 !important;
}

/* ── Add Day Button ────────────────────────────────────────── */
.add-day-col {
  flex-shrink: 0;
  width: 108px;
  margin-left: 1.125rem;
  display: flex;
  align-items: flex-start;
  padding-top: 1.125rem;
}
.add-day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 128px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--earth-300);
  background: transparent;
  cursor: pointer;
  color: var(--ink-300);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--mono);
  transition:
    border-color var(--duration-fast) var(--ease-smooth),
    color var(--duration-fast) var(--ease-smooth),
    background var(--duration-fast) var(--ease-smooth),
    transform var(--duration-fast) var(--ease-spring);
}
.add-day-btn:hover {
  border-color: var(--forest-400);
  color: var(--forest-600);
  background: var(--forest-100);
  transform: translateY(-2px);
}
.add-day-icon {
  font-size: 1.75rem;
  line-height: 1;
  transition: transform var(--duration-fast) var(--ease-spring);
}
.add-day-btn:hover .add-day-icon { transform: scale(1.2) rotate(90deg); }

/* ── Floating quick-look card (hover / info button) ─────────── */
/* Container box styling is also set inline in plan.html so it renders
   correctly even if this stylesheet is cached stale — keep them in sync. */
#tile-popover { -webkit-font-smoothing: antialiased; }

.tpop-photo-wrap { position: relative; }
.tpop-photo {
  width: 100%;
  height: 132px;
  object-fit: cover;
  display: block;
  background: var(--earth-100);
}
.tpop-strip {
  position: relative;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--earth-50), var(--earth-100));
  border-bottom: 1px solid var(--earth-150);
}
.tpop-strip-emoji { font-size: 1.9rem; line-height: 1; }
.tpop-chip {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 2rem;
  background: rgba(250, 246, 240, 0.92);
  color: var(--forest-700);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.tpop-chip.solid { position: static; background: var(--forest-100); }

.tpop-body { padding: 0.8rem 0.95rem 0.95rem; }
.tpop-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--forest-900);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}
.tpop-stars { color: #d99a2b; font-size: 0.78rem; margin-bottom: 0.35rem; }
.tpop-desc {
  font-size: 0.8125rem;
  color: var(--ink-500);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tpop-match { font-size: 0.75rem; color: var(--forest-600); font-style: italic; margin-bottom: 0.5rem; }
.tpop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
  font-size: 0.74rem;
  color: var(--ink-500);
}
.tpop-meta span { white-space: nowrap; }
.tpop-note {
  margin-top: 0.5rem;
  font-size: 0.76rem;
  color: var(--terra-600);
  font-style: italic;
}
.tpop-travel {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--earth-200);
  font-size: 0.74rem;
  color: var(--forest-700);
}

/* ── Day focus view (arrange one day with full-size cards) ──── */
#day-focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(9, 47, 44, 0.72);
  display: none;
  align-items: stretch;
  justify-content: center;
  padding: 1.25rem;
}
#day-focus-overlay.open { display: flex; }
#day-focus {
  background: var(--earth-50);
  border-radius: var(--radius-lg);
  border: 2px solid var(--ink);
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 10px 12px 0 rgba(9,47,44,0.3);
}
.df-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--forest-800);
  color: white;
}
.df-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.df-date { opacity: 0.7; font-size: 0.85rem; flex: 1; font-family: var(--mono); }
.df-nav-btn, .df-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.df-nav-btn:hover, .df-close:hover { background: rgba(255, 255, 255, 0.25); }
.df-nav-btn:disabled { opacity: 0.35; cursor: default; }
.df-hint { padding: 0.5rem 1.25rem; font-size: 0.75rem; color: var(--ink-400); border-bottom: 1px dashed var(--earth-300); background: var(--white); }
.df-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem 1.5rem; }
.df-anchor { font-size: 0.8125rem; color: var(--ink-400); padding: 0.25rem 0 0.625rem; }
.df-card {
  display: flex;
  gap: 1rem;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 3px 4px 0 rgba(9,47,44,0.14);
  padding: 0.875rem;
  margin-bottom: 0.75rem;
}
.df-card .df-drag { cursor: grab; color: var(--ink-200); font-size: 1.1rem; align-self: center; touch-action: none; }
.df-thumb {
  width: 108px;
  height: 108px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--earth-100);
}
.df-thumb-wrap {
  width: 108px;
  height: 108px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--earth-200);
}
.df-thumb-wrap .df-thumb { width: 100%; height: 100%; border-radius: 0; }
.df-info { flex: 1; min-width: 0; }
.df-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--forest-900); margin-bottom: 0.2rem; }
.df-desc { font-size: 0.8125rem; color: var(--ink-500); line-height: 1.45; margin-bottom: 0.375rem; }
.df-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: 0.75rem; color: var(--ink-400); margin-bottom: 0.375rem; }
.df-notes {
  width: 100%;
  border: 1px solid var(--earth-200);
  border-radius: var(--radius-sm);
  background: var(--earth-50);
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--ink-600, #444);
  padding: 0.375rem 0.5rem;
  resize: vertical;
  min-height: 30px;
  outline: none;
}
.df-notes:focus { border-color: var(--forest-400); background: var(--white); }
.df-actions { display: flex; flex-direction: column; gap: 4px; align-items: center; flex-shrink: 0; }
.df-move-select {
  margin-top: 2px;
  font-size: 0.7rem;
  padding: 2px 4px;
  border: 1px solid var(--earth-200);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink-500);
  max-width: 92px;
  cursor: pointer;
}
.df-travel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0 0.375rem 1.5rem;
  font-size: 0.75rem;
  color: var(--ink-300);
}
.df-empty {
  text-align: center;
  color: var(--ink-300);
  padding: 3rem 1rem;
  border: 2px dashed var(--earth-300);
  border-radius: var(--radius-lg);
}

/* ── Small modals (Add Flight / Add Note / Add Rental / Delete) ─── */
#flight-modal-overlay, .tp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 47, 44, 0.72);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#flight-modal-overlay.open, .tp-modal-overlay.open { display: flex; }
#flight-modal, .tp-modal {
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  width: min(440px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow-y: auto;
  box-shadow: 9px 10px 0 var(--ink);
}
#flight-modal header, .tp-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--forest-800);
  color: white;
  font-weight: 700;
}
#flight-modal header button, .tp-modal header button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  background: transparent;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
}
#flight-modal .fm-body, .tp-modal .fm-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.fm-row { display: flex; gap: 0.75rem; }
.fm-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.fm-field label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-400); }
.fm-field input,
.fm-field textarea,
.fm-field select {
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--earth-300);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--ink);
}
.fm-field input:focus, .fm-field textarea:focus, .fm-field select:focus {
  border-color: var(--forest-400);
  box-shadow: 0 0 0 3px var(--amber-100);
}
.fm-hint { border-left: 3px solid var(--amber-500); padding: 0.5rem 0.65rem; background: var(--amber-100); color: var(--ink-500); font-size: 0.75rem; line-height: 1.45; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.fm-hint a { color: var(--forest-600); font-weight: 700; }

.delete-copy { font-size: 0.9rem; color: var(--ink-600, var(--ink)); line-height: 1.45; margin: 0; }
.check-line { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--ink-500); cursor: pointer; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.25rem; }

/* Day-trip badge + same-day conflict warning (production hook, kept for
   backward compatibility with any cached markup outside renderItem). */
.day-column.daytrip-conflict { box-shadow: 0 0 0 2px rgba(245,158,11,0.5), 5px 6px 0 var(--ink); }

/* ── Mobile Plan ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .plan-body { flex-direction: column; }
  .unscheduled-panel {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--earth-200);
    flex-direction: column;
  }
  .days-area {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding-left: 0.5rem;
  }
  .day-column { width: 240px; }
  .plan-topbar-actions { width: 100%; }
  .fm-row { flex-direction: column; }
}
