/* ===== Vegan Travel Toolkit — planner.css (clean) ===== */

/* Base */
body.page-planner { background:#fff; }
body.page-planner * { box-sizing:border-box; }

body.page-planner .container { max-width:1320px; margin:0 auto; padding:16px; }
body.page-planner .grid { display:grid; gap:16px; align-items:start; }
body.page-planner .cols-2 { grid-template-columns:1.15fr .85fr; }
@media (max-width:980px){ .cols-2{ grid-template-columns:1fr; } }

/* Inputs (scoped to planner) */
body.page-planner label{ display:grid; gap:6px; font-weight:700; color:#173b23; }
body.page-planner input,
body.page-planner select,
body.page-planner textarea{
  width:100%; padding:12px 14px; border:1px solid #cfe0d4; border-radius:12px;
  background:#fff; outline:0; font:inherit;
}
body.page-planner input:focus,
body.page-planner select:focus,
body.page-planner textarea:focus{
  border-color:#2e7d32; box-shadow:0 0 0 3px rgba(46,125,50,.18);
}

/* Buttons (match Start.php) */
body.page-planner .btn{
  border-radius:999px; font-weight:700; padding:8px 16px; font-size:14px;
  border:1px solid var(--line,#cfe0d4); background:#fff; color:var(--brand,#2e7d32);
  cursor:pointer; transition:transform .12s ease, background .15s ease, color .15s ease;
}
body.page-planner .btn.primary,
body.page-planner .btn-add,
body.page-planner .btn-save{
  background:var(--brand,#2e7d32); border:1px solid var(--brand,#2e7d32); color:#fff;
}
body.page-planner .btn.ghost,
body.page-planner .btn-secondary,
body.page-planner .btn-remove,
body.page-planner .btn-duplicate{
  background:#fff; border:1px solid var(--brand,#2e7d32); color:var(--brand,#2e7d32);
}
body.page-planner .btn:hover{ transform:translateY(-1px); background:var(--brand,#2e7d32); color:#fff; }

/* ===== Panels (details/summary cards) ===== */
.air-sec{
  margin:12px 0;
  border:1px solid var(--line,#e5e7eb);
  border-radius:14px;
  background:#fff;
  box-shadow:var(--shadow,0 1px 3px rgba(0,0,0,.06));
  overflow:hidden;
}
.air-sec > summary{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; padding:12px 14px; line-height:1.2; font-weight:800;
  cursor:pointer; user-select:none;
  background:linear-gradient(0deg,#eaf6ef,#f6fbf8);
  border-bottom:1px solid var(--line,#e5e7eb);
}
.air-sec[open] > summary{ background:#e6f4ea; }
.air-sec > summary::-webkit-details-marker{ display:none; }
/* Chevron icon in panel header */
.air-sec > summary .chev{ width:22px; height:22px; opacity:.55; flex:none; }
.air-sec .air-body{ padding:14px; }

#tripType[data-locked="0"] .lock{ display:none; }
#tripType[data-locked="1"] .lock{ display:inline; }

.route-string{ margin:6px 2px 2px; font-weight:800; opacity:.9; }
@media print{ .trip-type-switch{ display:none !important; } #routeString{ display:block !important; } }
/* hide Stops by default when in Single mode */

/* ===== Destination hero ===== */
#secDestination #hero_file,
#secDestination #hero_file + label,
#secDestination input[type="file"]{ display:none !important; }
#secDestination #hero_placeholder{ display:none !important; }
#secDestination figure.hero-wrap{ margin:10px 0 6px; padding:0; width:100%; display:block; }
#secDestination figure.hero-wrap > img{
  display:block; width:100%; max-width:100%; height:auto;
  border:1px solid #e7efe8; border-radius:12px; object-fit:cover; max-height:420px;
}
#secDestination .dest-actions{ display:flex; gap:10px; margin-top:10px; }
#secDestination .dest-actions .btn.small{ padding:6px 12px; font-size:14px; border-radius:8px; }

/* ===== Boarding pass ===== */
#secBoarding .bp-wrap{ display:grid; gap:12px; }
#secBoarding .bp-drop{
  display:block; width:100%; cursor:pointer;
  border:2px dashed #cfe0d4; border-radius:12px; background:#f6fbf7;
  padding:16px; text-align:center; transition:border-color .15s ease;
}
#secBoarding .bp-drop:hover{ border-color:#2e7d32; }
#secBoarding .bp-preview{
  display:none; background:#fff; border:1px solid #e7efe8; border-radius:12px; padding:10px;
}
#secBoarding .bp-preview img{ display:block; width:100%; height:auto; border-radius:10px; border:1px solid #e7efe8; }
.bp-wrap.has-preview .bp-drop{ display:none !important; }
.bp-wrap.has-preview .bp-preview{ display:block !important; }

/* ===== Task tracker ===== */
#secTasks #tasks_list{ display:grid; gap:12px; list-style:none; padding:0; margin:0; }
#secTasks #tasks_list .task-row{
  display:grid; grid-template-columns:auto 1fr 36px; align-items:center; gap:10px;
  padding:12px; border:1px solid var(--line,#d8e6da); border-radius:12px; background:#fff;
}
#secTasks #tasks_list .task-text{ min-height:44px; resize:vertical; }
#secTasks #tasks_list .task-delete{
  display:grid; place-items:center; width:36px; height:36px; padding:0; line-height:1;
  border-radius:10px; background:#f6fbf7; border:1px solid var(--line,#d8e6da); cursor:pointer;
}

/* ===== Countdown quick styling ===== */
#secTripCountdown #countdown_big{ font-size:35px; font-weight:700; text-align:center; color:#1b5e20; margin-bottom:6px; }
#secTripCountdown #countdown_meta{ text-align:center; color:#173b23; font-size:14px; }

/* ===== Donut + legend ===== */
#donut{ width:100% !important; height:auto; }
#legend{ display:grid; gap:8px; }
#legend .legend-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
#legend .left{ display:flex; align-items:center; gap:8px; min-width:0; }
#legend .swatch{ width:14px; height:14px; border-radius:3px; flex:none; }
#legend .label{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#legend .right{ display:flex; gap:6px; align-items:baseline; }
#legend .amt{ font-weight:600; }
#legend .legend-total{ margin-top:6px; font-weight:600; opacity:.9; }

#secCategoryBudget .lab-balance{ display:flex; align-items:baseline; gap:8px; margin:6px 0; }
#secCategoryBudget .lab-balance > span:first-child{ transform:translateY(1px); }
#secCategoryBudget .cat-balance{
  background:none !important; border:none !important; box-shadow:none !important;
  padding:0 !important; margin:0 !important; font-weight:700; line-height:1.2; color:#193d25;
}
#secCategoryBudget .cat-actions{ display:flex; gap:12px; margin:8px 0 12px; }
#secCategoryBudget .cat-totals,
#secCategoryBudget .totals-row,
#secCategoryBudget [data-totals]{
  background:#e6f4ea; border:none !important; border-radius:12px;
  padding:10px 14px; display:flex; align-items:center; justify-content:center;
  gap:28px; font-weight:800; color:#193d25; margin-top:10px;
}
#secCategoryBudget .cat-totals > *,
#secCategoryBudget .totals-row > *,
#secCategoryBudget [data-totals] > *{
  background:none !important; border:none !important; box-shadow:none !important;
  padding:0 !important; margin:0 !important;
}

/* ===== Mobile & overflow fixes ===== */
.hero-wrap img#hero_img{ width:100%; height:auto; display:block; }
figure.hero-wrap{ margin:0; }
html, body{ overflow-x:hidden; }
.container, .air-sec, .air-body{ max-width:100%; }

@media (max-width:900px){
  /* Stack the two columns and re-order sections */
  body.page-planner .grid.cols-2{
    display:flex !important; flex-direction:column !important; gap:12px !important; align-items:stretch !important;
  }
  body.page-planner .grid.cols-2 > .col.left,
  body.page-planner .grid.cols-2 > .col.right{ display:contents !important; }

  #secDestination   { order:10 !important; }
  #secTrip          { order:20 !important; }
  #secTripCountdown { order:30 !important; }
  #secOverallBudget { order:40 !important; }
  #secConverter     { order:50 !important; }
  #secTasks         { order:60 !important; }
  #secCategoryBudget{ order:70 !important; }
  #secDonut         { order:80 !important; }
  #secBoarding      { order:90 !important; }
  #secSummary       { order:999 !important; }

  /* Full-width bits */
  #secTripCountdown, #secTripCountdown .air-body,
  #secTripCountdown #countdown_big, #secTripCountdown #countdown_meta, #secTripCountdown #countdown_bar{ width:100% !important; }
  #secTasks, #secTasks .air-body, #secTasks #tasks_list{ width:100% !important; }
  #secBoarding, #secBoarding .air-body, #secBoarding .bp-wrap, #secBoarding .bp-drop, #secBoarding .bp-preview{ width:100% !important; }
}

/* --- Guardrails: don't style radios/checkboxes like text fields --- */
body.page-planner input[type="radio"],
body.page-planner input[type="checkbox"]{
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* --- Trip-type switch clickability & feedback --- */
.trip-type-switch{ position: relative; z-index: 2; }
.trip-type-switch .seg{ position: relative; display: inline-flex; align-items:center; cursor:pointer; }
.trip-type-switch .seg input{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;               /* full-pill click target */
}
/* optional: hover feedback so it “feels” clickable */
.trip-type-switch .seg:hover span{
  background: #fff;
  box-shadow: 0 0 0 1px var(--line,#d7e1d9) inset;
}

/* (old triptype rules removed) */
/* #plannerForm[data-triptype="single"] #secStops { display: none !important; } */
/* #plannerForm[data-triptype="multi"]  #secStops { display: block !important; } */

@media (max-width:768px){
  #vttStops{ order:15; }   /* show right under Destination on phones */
}
/* (keep a single copy of this rule) */
#vttStops[hidden]{ display:none !important; }

/* ===== vttStops Airbnb-like layout ===== */
#vttStops{
  --pad:16px;
  --ring:#dfe7e2;
  --bg:#fbfdfb;
}
#vttStops .stop-item{
  border:1px solid var(--ring);
  border-radius:16px;
  background:var(--bg);
  padding:var(--pad);
}
#vttStops .stop-item + .stop-item{ margin-top:12px; }

#vttStops .stop-grid{
  display:grid;
  grid-template-columns: minmax(220px,1.2fr) minmax(160px,.9fr) minmax(160px,.9fr);
  gap:14px;
  align-items:end;
}

#vttStops label span{
  display:block;
  margin-bottom:6px;
  font-weight:700;
}
#vttStops .input{
  border-radius:14px;
  padding:10px 14px;
  height:auto; /* let your theme size these naturally */
}

#vttStops .stop-note-wrap{
  grid-column: 1 / -1;      /* notes full width */
}
#vttStops .vtt-stop-note{
  min-height:90px;
}

#vttStops .stop-actions{
  grid-column: 1 / -1;      /* buttons under notes */
  display:flex;
  gap:12px;
  justify-content:flex-end;
  margin-top:4px;
}
#vttStops .stop-actions .btn{
  border-radius:999px;      /* pill buttons */
  padding:10px 16px;
  line-height:1.1;
}

/* Mobile stack */
@media (max-width: 780px){
  #vttStops .stop-grid{
    grid-template-columns: 1fr;
  }
  #vttStops .stop-actions{
    justify-content:flex-start;
  }
}
@media print {
  header, footer, nav, .btn, #task_prog_wrap, #task_prog_text,
  #vttTripToggle, .dest-actions, .bp-actions, #vttStopsWarnings { display:none !important; }

  .grid.cols-2 { display:block !important; }         /* single column for print */
  .air-sec { break-inside: avoid; }                  /* avoid cutting sections */
  body { background:#fff !important; }
}
/* Boarding pass: show drop only when "empty" */
#secBoarding .bp-drop{ display:none; align-items:center; justify-content:center; }
#secBoarding .bp-drop.empty{ display:flex; } /* or display:block if you prefer */
/* Hide any legacy Import/Export controls in Stops */
#vttStops .vtt-import,
#vttStops .vtt-export { display: none !important; }

/* === Category Budget (final) === */
#secCategoryBudget .air-head{
  display:flex; align-items:center; gap:10px; padding:12px 14px;
}
#secCategoryBudget .air-head h2{ margin:0; }
#secCategoryBudget #btnAddCat{
  margin-left:auto; border-radius:999px; padding:10px 14px; font-weight:700;
}
#secCategoryBudget .air-body{ padding:16px; }
#secCategoryBudget #catList{ display:grid; gap:14px; }

/* Card layout: Category | Budget | Actual, then Balance + Actions row */
#secCategoryBudget .cat-item{
  display:grid;
  gap:14px 16px;
  grid-template-columns:
    minmax(260px,1.4fr)  /* Category */
    minmax(150px,.8fr)   /* Budget   */
    minmax(150px,.8fr)   /* Actual   */
    1fr;                 /* spacer   */
  grid-template-areas:
    "cat budget actual ."
    "bal bal . actions";
  align-items:end;
  background:#fff; border:1px solid #e6ebe8; border-radius:14px;
  padding:16px; box-shadow:0 1px 2px rgba(0,0,0,.04);
}
#secCategoryBudget .cat-row{ display:contents; }
#secCategoryBudget .cat-row label:nth-child(1){ grid-area:cat; }
#secCategoryBudget .cat-row label:nth-child(2){ grid-area:budget; }
#secCategoryBudget .cat-row label:nth-child(3){ grid-area:actual; }

/* Inputs */
#secCategoryBudget label > span{
  display:block; font-size:13px; font-weight:600; color:#4b5563; margin:2px 0 6px;
}
#secCategoryBudget .input{
  width:100%; border:1px solid #dfe4e1; border-radius:12px; padding:12px 14px;
}
#secCategoryBudget .input:focus{
  outline:0; border-color:#22c55e; box-shadow:0 0 0 3px rgba(34,197,94,.15);
}

/* Balance + Actions row */
#secCategoryBudget .lab-balance{
  grid-area:bal; display:flex; align-items:center; gap:12px; margin-top:4px;
}
#secCategoryBudget .lab-balance > span:first-child{
  padding:8px 12px; border-radius:999px; border:1px solid #e6ebe8;
  background:#f4f7f5; font-weight:700; color:#334155;
}
#secCategoryBudget .lab-balance .cat-balance{
  font-weight:800; min-width:96px; text-align:right;
}
#secCategoryBudget .cat-actions{
  grid-area:actions; display:flex; align-items:center; justify-content:flex-end;
  gap:10px; flex-wrap:wrap; margin-top:4px;
}
#secCategoryBudget .cat-actions .btn{ border-radius:999px; padding:10px 14px; }

/* Mobile */
@media (max-width:820px){
  #secCategoryBudget .cat-item{
    grid-template-columns:1fr;
    grid-template-areas:"cat" "budget" "actual" "bal" "actions";
    align-items:stretch;
  }
  #secCategoryBudget .lab-balance{ justify-content:flex-start; gap:10px; }
  #secCategoryBudget .lab-balance .cat-balance{ text-align:left; }
  #secCategoryBudget .cat-actions{ justify-content:flex-start; }
}

/* ===== Equal-width columns for the planner layout ===== */

/* Mobile stays stacked (you already have this) */

/* Desktop & up: two equal columns */
@media (min-width: 769px){
  .grid.cols-2{
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; /* 50 / 50 */
    column-gap: 18px;   /* tweak if you want a bit more/less gap */
    row-gap: 18px;
    align-items: start;
  }
  /* ensure no legacy widths fight this */
  .grid.cols-2 .col.left,
  .grid.cols-2 .col.right{
    width: auto !important;
    flex: 0 0 auto;
    min-width: 0; /* prevent overflow from wide children */
  }
}

/* === Trip Summary: compact toolbar buttons === */
#secSummary .summary-actions{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin-top:16px;
}

/* Smaller, pill buttons just in the Summary toolbar */
#secSummary .summary-actions .btn{
  padding:8px 12px;                      /* compact */
  border-radius:12px;                     /* small pill */
  font-size:14px; line-height:1.1;
  border:1px solid #cfe0d4;
  background:#fff; color:#14532d;
  min-height:40px;                        /* comfortable touch target */
}
#secSummary .summary-actions .btn.primary{
  background:#2e7d32; color:#fff; border-color:#2e7d32;
}

/* Keep status on the far right on wide screens */
#secSummary .summary-actions [data-save-status]{
  margin-left:auto; color:#14532d; opacity:.85;
}

/* Mobile polish: a bit smaller, wrap status under the buttons */
@media (max-width:560px){
  #secSummary .summary-actions{ gap:6px; }
  #secSummary .summary-actions .btn{ padding:7px 10px; font-size:13px; min-height:38px; }
  #secSummary .summary-actions [data-save-status]{
    order:99; flex-basis:100%; text-align:right; margin-left:0; margin-top:4px;
  }
}

/* (Optional) subtle hover without “jump” */
#secSummary .summary-actions .btn:hover{
  background:#2e7d32; color:#fff; border-color:#2e7d32; transform:none;
}

/* (deduped) Overall Trip Budget row */
#secOverallBudget .ob-sub{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;        /* vertical, horizontal */
  margin-top: 6px;
  align-items: baseline;
}

/* Slightly smaller text on narrow phones to avoid crowding */
@media (max-width: 390px){
  #secOverallBudget .ob-sub { gap: 8px 16px; }
  #secOverallBudget .ob-sub span { font-size: 15px; }
}

/* --- iOS/Safari polish (put AFTER planner.css) --- */
html { -webkit-text-size-adjust: 100%; }

/* Prevent iOS "zoom on focus" & unify control height */
body.page-planner input,
body.page-planner select,
body.page-planner textarea {
  font-size: 16px;                 /* stops focus-zoom on iOS */
  min-height: 46px;                /* visually stable control height */
  line-height: 1.2;
}

/* Give selects a bit more right padding so the chevron never overlaps text */
body.page-planner select {
  padding-right: 40px;
  -webkit-appearance: none;
  appearance: none;
}

/* Tighten panel body padding slightly on phones so everything breathes evenly */
@media (max-width: 430px){
  .air-sec .air-body { padding: 14px 12px; }
}
/* Ensure Adults / Children / Pets stay tidy on mobile */
#secTrip .grid { row-gap: 10px; }
@media (max-width: 430px){
  #secTrip .grid[style*="repeat(3,1fr)"] { grid-template-columns: 1fr 1fr 1fr !important; }
  #secTrip .grid label .input { min-height: 46px; }
}

/* Keep the Balance pill & value left-aligned and roomy on phones */
@media (max-width: 820px){
  #secCategoryBudget .lab-balance{
    display: flex;
    justify-content: flex-start !important;
    gap: 10px;
  }
  #secCategoryBudget .lab-balance .cat-balance{ text-align: left; }
}

/* Make the fields a touch wider on large phones */
@media (min-width: 431px) and (max-width: 900px){
  #secCategoryBudget .cat-item{ padding: 18px 16px; }
}

/* Center that little bar consistently and avoid accidental overflow */
#secTripCountdown #countdown_bar { width: 100%; }
#secTripCountdown #countdown_bar span{
  margin: 0 auto; display: block; max-width: 180px;
}

/* Kill any horizontal scroll that some iOS toolbars can cause */
html, body { overflow-x: hidden; }

/* === Mobile padding fix for Trip Details date fields === */
@media (max-width: 768px){
  #secTrip .air-body {
    display: grid;
    gap: 10px 14px; /* adds vertical and horizontal breathing room */
  }

  /* Specifically add a small gap between Start and End date fields */
  #secTrip input[type="date"] {
    margin-bottom: 6px;  /* slight vertical separation if stacked */
  }

  /* On phones where they're side by side */
  #secTrip .air-body > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* === Small spacing fix under Add category button === */
#secCategoryBudget .air-head {
  margin-bottom: 8px;   /* adds gentle breathing space below header */
}

/* Ensure this spacing remains clean on smaller screens */
@media (max-width: 768px){
  #secCategoryBudget .air-head {
    margin-bottom: 10px; /* a touch more on phones */
  }
}
/* Trip details: add horizontal space between Start/End date on phones */
#secTrip .air-body > .grid:first-child{
  column-gap: 14px !important;     /* space between the two date inputs */
  grid-column-gap: 14px !important; /* older Safari */
}

/* Give a touch more space on very narrow screens */
@media (max-width: 390px){
  #secTrip .air-body > .grid:first-child{
    column-gap: 16px !important;
    grid-column-gap: 16px !important;
  }
}

/* Safety: prevent inputs from overflowing and crowding */
#secTrip .air-body > .grid:first-child > label{
  min-width: 0;   /* keeps each label/input from forcing tight squeeze */
}
/* Add spacing above the Category Budget button */
#secCategoryBudget .air-head {
  padding-bottom: 10px;
}

#secCategoryBudget .air-head .btn {
  margin-top: 4px;
  margin-bottom: 6px;
}
/* Fix spacing for "Add category" button in Category Budget header */
#secCategoryBudget summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 16px; /* add more bottom padding */
}

#secCategoryBudget summary .btn {
  margin-top: 2px;
  margin-bottom: 4px;
}
/* === Category Budget: give the "Add category" button breathing room === */

/* If the header is legacy (.air-head) or <summary>, pad under the green bar */
#secCategoryBudget .air-head,
#secCategoryBudget summary {
  padding-bottom: 14px;         /* space below the header */
}

/* If the button is inside the header */
#secCategoryBudget .air-head #btnAddCat,
#secCategoryBudget summary #btnAddCat {
  margin-top: 2px;
  margin-bottom: 6px;
}

/* If the upgrader moved the button into the body (first child), pad it too */
#secCategoryBudget .air-body > #btnAddCat {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 10px;             /* space from header divider */
  margin-bottom: 12px;          /* space above first card */
}

/* Ensure the body itself has comfortable top padding */
#secCategoryBudget .air-body {
  padding-top: 18px;
}
/* === Category Budget: make Duplicate/Remove always visible === */

/* Give the actions a real area next to/under Balance on desktop */
#secCategoryBudget .cat-item{
  /* original columns are fine */
  grid-template-areas:
    "cat budget actual ."
    "bal bal actions actions";  /* <- put actions in view, not in a tiny spacer */
}

/* Ensure the actions row actually shows */
#secCategoryBudget .cat-actions{
  display:flex !important;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  margin-top:4px;
}

/* Make sure buttons aren't collapsed by any global styles */
#secCategoryBudget .cat-actions .btn{
  display:inline-flex !important;
  padding:10px 14px;
  border-radius:999px;
}

/* On mobile, keep everything stacked (your existing rule stays) */
@media (max-width:820px){
  #secCategoryBudget .cat-item{
    grid-template-columns:1fr;
    grid-template-areas:
      "cat"
      "budget"
      "actual"
      "bal"
      "actions";
  }
  #secCategoryBudget .cat-actions{
    justify-content:flex-start;
  }
}
/* Add a little breathing room for the Add category button, header or body */
#secCategoryBudget .air-head,
#secCategoryBudget summary { padding-bottom:14px; }
#secCategoryBudget .air-body > #btnAddCat { margin:10px 0 12px; }
/* === Category Budget: keep actions away from the right edge === */
#secCategoryBudget .cat-item{
  box-sizing: border-box;
  padding-right: 22px;                 /* tiny internal gutter */
  overflow: visible;                    /* don't clip rounded buttons */
}

/* Actions area: stay inside, align right, wrap nicely */
#secCategoryBudget .cat-actions{
  justify-content: flex-end;
  padding-right: 4px;                   /* avoids hugging the border */
  max-width: 100%;
}

/* Make sure the grid doesn't force the actions column off the card */
#secCategoryBudget .cat-item{
  grid-template-columns:
    minmax(260px,1.3fr)                 /* Category */
    minmax(140px,.8fr)                  /* Budget  */
    minmax(140px,.8fr)                  /* Actual  */
    minmax(0, 0.9fr);                   /* Actions column shrinks if needed */
  grid-template-areas:
    "cat budget actual ."
    "bal bal actions actions";
}

/* On mobile keep your stacked layout (unchanged) */
@media (max-width:820px){
  #secCategoryBudget .cat-item{
    padding-right: 16px;                /* a bit smaller gutter on phones */
    grid-template-columns: 1fr;
    grid-template-areas:
      "cat"
      "budget"
      "actual"
      "bal"
      "actions";
  }
  #secCategoryBudget .cat-actions{
    justify-content: flex-start;
    padding-right: 0;
  }
}
#vttTripToggle .seg[data-locked="1"] { opacity:.75; cursor:pointer; }

/* Trip pills (buttons) */
#vttTripToggle.trip-type-switch{display:inline-flex; gap:6px; background:#f3f6f4; padding:4px; border-radius:12px; user-select:none;}
#vttTripToggle .seg{
  appearance:none; border:0; background:transparent; color:inherit;
  display:inline-flex; align-items:center; cursor:pointer;
  padding:6px 10px; border-radius:10px; font-weight:700;
}
#vttTripToggle .seg[aria-pressed="true"]{ background:#fff; box-shadow:0 0 0 1px #d7e1d9 inset; }
#vttRoute{ margin:6px 2px 2px; font-weight:800; opacity:.9 }

/* Attribute-based show/hide (new) */
#plannerForm[data-vtt-trip="single"] #vttStops { display:none !important; }
#plannerForm[data-vtt-trip="multi"]  #vttStops { display:block !important; }
#vttStops[hidden]{ display:none !important; }

/* (Optional) Stops UI cosmetics */
.stop-item{ border:1px solid #e5e7eb; border-radius:12px; padding:10px; background:#fafaf9; }
.stop-actions{ display:flex; gap:8px; }

/* Print */
@media print { #vttTripToggle{ display:none !important; } }

/* Tiny autosave fade */
[data-save-status].flash{ transition: opacity 1.2s ease; opacity: .15; }

/* Collapsible header styling for upgraded <details> sections */
details.air-sec > summary{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 14px; font-weight:900; cursor:pointer;
  background:var(--mint,#eaf6ee); border-bottom:1px solid #e5e7eb;
  list-style:none;
}
details.air-sec > summary::-webkit-details-marker{ display:none; }
details.air-sec > summary .chev{
  width:18px; height:18px; display:inline-grid; place-items:center;
  border-radius:999px; background:var(--brand,#1b5e20); color:#fff; font-weight:900;
  transition:transform .18s ease;
}
details.air-sec[open] > summary .chev{ transform:rotate(180deg); }


/* --- Tab Navigation --- */
.vtt-tabs { display: flex; gap: 10px; border-bottom: 2px solid #e5e7eb; margin-bottom: 24px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.vtt-tabs::-webkit-scrollbar { display: none; }
.vtt-tabs button { background: transparent; border: none; font-size: 1.05rem; font-weight: 600; color: #6b7280; padding: 12px 20px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s ease; white-space: nowrap; }
.vtt-tabs button:hover { color: #1f5a23; }
.vtt-tabs button.active { color: #1f5a23; border-bottom-color: #1f5a23; }

/* --- Tab Panes --- */
.tab-pane { display: none; animation: fadeIn 0.3s ease; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }


/* Keep your existing body padding */
details.air-sec .air-body{ padding:14px; }
/* --- Tab Navigation --- */
.vtt-tabs { display: flex; gap: 10px; border-bottom: 2px solid #e5e7eb; margin-bottom: 24px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.vtt-tabs::-webkit-scrollbar { display: none; }
.vtt-tabs button { background: transparent; border: none; font-size: 1.05rem; font-weight: 600; color: #6b7280; padding: 12px 20px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s ease; white-space: nowrap; }
.vtt-tabs button:hover { color: #1f5a23; }
.vtt-tabs button.active { color: #1f5a23; border-bottom-color: #1f5a23; }

/* --- Tab Panes --- */
.tab-pane { display: none; animation: fadeIn 0.3s ease; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   🌱 VEGAN TRIP PLANNER: PREMIUM STYLES
   ========================================================= */

/* --- Core Page & Branding --- */
body.page-planner { background:#fff; font-family: system-ui, -apple-system, sans-serif; color: #21452a; }
body.page-planner * { box-sizing:border-box; }
body.page-planner .container { max-width:1320px; width:100%; margin:0 auto; padding:0 16px; }

/* Desktop Grid Layout */
@media (min-width: 900px){
  body.page-planner .grid.cols-2{
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; /* 50 / 50 Split */
    column-gap: 20px; 
    row-gap: 20px;
    align-items: start;
  }
  body.page-planner .grid.cols-2 .col.left,
  body.page-planner .grid.cols-2 .col.right{ width: auto !important; flex: 0 0 auto; min-width: 0; }
}

/* --- The Tab System (Swipeable on Mobile) --- */
.vtt-tabs { display: flex; gap: 10px; border-bottom: 2px solid #f3f4f6; margin-bottom: 24px; margin-top: 16px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
.vtt-tabs::-webkit-scrollbar { display: none; }
.vtt-tabs button { background: transparent; border: none; font-size: 1.05rem; font-weight: 700; color: #6b7280; padding: 14px 20px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s ease; white-space: nowrap; scroll-snap-align: start; }
.vtt-tabs button:hover { color: #1f5a23; }
.vtt-tabs button.active { 
  color: #1b5e20; border-bottom: 3px solid #1b5e20; 
  background: linear-gradient(to top, #f0fdf4 0%, transparent 100%);
  border-top-left-radius: 8px; border-top-right-radius: 8px;
}
.tab-pane { display: none; animation: fadeIn 0.3s ease; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- Premium Cards (The Sections) --- */
.air-sec { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.03); margin-bottom: 24px; }
.air-head { background: linear-gradient(to right, #f4fbf6, #fff); padding: 16px 20px; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between;}
.air-head h2 { margin: 0; font-weight: 800; font-size: 1.1rem; color: #184b26; }
.air-body { padding: 20px; }

/* --- Inputs, Selects, Textareas --- */
body.page-planner label { display:grid; gap:6px; font-weight:700; color:#173b23; font-size: 0.95rem; }
body.page-planner .input,
body.page-planner select,
body.page-planner textarea {
  width:100%; padding:12px 14px; border:1px solid #d8e6da; border-radius:10px;
  background:#fff; outline:none; font-family: inherit; font-size: 1rem; /* Stops iOS Zoom */
  line-height: 1.3; transition: border-color 0.2s;
}
body.page-planner .input:focus,
body.page-planner select:focus,
body.page-planner textarea:focus { border-color:#2e7d32; box-shadow:0 0 0 3px rgba(46,125,50,.15); }
body.page-planner select { padding-right: 40px; -webkit-appearance: none; appearance: none; }

/* --- Beautiful Buttons --- */
body.page-planner .btn {
  border-radius: 10px; font-weight: 700; padding: 10px 16px; font-size: 0.95rem;
  border: 1px solid #cfe0d4; background: #fff; color: #1b5e20; cursor: pointer; 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); text-align: center;
}
body.page-planner .btn.primary { background: #2e7d32; color: #fff; border-color: #2e7d32; }
body.page-planner .btn.primary:hover { box-shadow: 0 6px 16px rgba(46, 125, 50, 0.25); transform: translateY(-2px); }
body.page-planner .btn.danger { color: #9b1c1c; border-color: #fca5a5; }
body.page-planner .btn.ghost { background: #fff; border: 1px solid #d8e6da; }
body.page-planner .btn.ghost:hover { border-color: #2e7d32; }
body.page-planner .btn.small { padding: 6px 12px; font-size: 0.85rem; }

/* --- Destination Hero Image --- */
#secDestination figure.hero-wrap { margin: 10px 0 6px; padding: 0; width: 100%; display: block; position: relative; }
#secDestination figure.hero-wrap > img {
  display: block; width: 100%; height: auto; object-fit: cover; 
  border-radius: 12px; border: 1px solid #e7efe8; max-height: 380px;
}
#secDestination #hero_placeholder { display: none !important; }
#secDestination .dest-actions { display: flex; gap: 10px; margin-top: 12px; }

/* --- Trip Type Toggle (Single vs Multi) --- */
.trip-type-switch{ display:inline-flex; gap:6px; background:#f3f6f4; padding:4px; border-radius:12px; user-select:none; }
.trip-type-switch .seg{ appearance:none; border:0; background:transparent; color:#6b7280; display:inline-flex; align-items:center; cursor:pointer; padding:8px 14px; border-radius:10px; font-weight:700; font-size: 0.95rem; transition: all 0.2s;}
.trip-type-switch .seg[aria-pressed="true"]{ background:#fff; color:#1b5e20; box-shadow:0 1px 3px rgba(0,0,0,0.05), 0 0 0 1px #d7e1d9 inset; }
.trip-type-switch .seg[data-locked="1"] { opacity:.6; cursor:not-allowed; }

/* --- Multi-City Stops (Airbnb-style) --- */
#vttStops .stop-item { border: 1px solid #e5e7eb; border-radius: 14px; background: #fafaf9; padding: 16px; margin-bottom: 12px;}
#vttStops .stop-grid { display:grid; grid-template-columns: minmax(220px,1.2fr) minmax(160px,.9fr) minmax(160px,.9fr); gap:14px; align-items:end; }
#vttStops .stop-note-wrap { grid-column: 1 / -1; }
#vttStops .vtt-stop-note { min-height: 60px; }
#vttStops .stop-actions { grid-column: 1 / -1; display:flex; gap:8px; justify-content:flex-end; margin-top:4px; }

/* --- Task Tracker (Micro-interactions) --- */
#secTasks #tasks_list{ display:grid; gap:10px; list-style:none; padding:0; margin:0; }
#secTasks #tasks_list .task-row{ display:grid; grid-template-columns:auto 1fr 36px; align-items:center; gap:10px; padding:12px; border:1px solid #d8e6da; border-radius:12px; background:#fff; transition: all 0.2s; }
#secTasks #tasks_list .task-row:has(input[type="checkbox"]:checked) { background: #fbfcfb; border-color: #dcfce7; }
#secTasks #tasks_list .task-row:has(input[type="checkbox"]:checked) .task-text { text-decoration: line-through; color: #9ca3af; }
#secTasks #tasks_list .task-text{ min-height:44px; resize:vertical; border: none; background: transparent; padding: 0; outline: none;}
#secTasks #tasks_list .task-delete{ display:grid; place-items:center; width:36px; height:36px; padding:0; line-height:1; border-radius:8px; background:#f9fafb; border:1px solid #e5e7eb; cursor:pointer; color: #9ca3af;}
#secTasks #tasks_list .task-delete:hover { color: #9b1c1c; border-color: #fca5a5; }

/* --- Boarding Pass Dropzone --- */
#secBoarding .bp-wrap{ display:grid; gap:12px; }
#secBoarding .bp-drop{ display:flex; align-items:center; justify-content:center; width:100%; cursor:pointer; border:2px dashed #cfe0d4; border-radius:12px; background:#f6fbf7; padding:30px 16px; text-align:center; transition:border-color .15s ease; }
#secBoarding .bp-drop:hover{ border-color:#2e7d32; }
#secBoarding .bp-preview{ display:none; background:#fff; border:1px solid #e7efe8; border-radius:12px; padding:10px; }
#secBoarding .bp-preview img{ display:block; width:100%; height:auto; border-radius:8px; }
.bp-wrap.has-preview .bp-drop{ display:none !important; }
.bp-wrap.has-preview .bp-preview{ display:block !important; }

/* --- Trip Countdown --- */
#secTripCountdown #countdown_big{ font-size:42px; font-weight:800; text-align:center; color:#1b5e20; margin-bottom:6px; line-height: 1; }
#secTripCountdown #countdown_meta{ text-align:center; color:#4b5563; font-size:14px; font-weight: 500; }

/* --- Category Budget Grid --- */
#secCategoryBudget .cat-item { display:grid; gap:14px 16px; align-items:end; background:#fff; border:1px solid #e6ebe8; border-radius:14px; padding:16px; margin-bottom: 12px; box-shadow:0 1px 2px rgba(0,0,0,.02); }
#secCategoryBudget .cat-item { grid-template-columns: minmax(260px,1.4fr) minmax(140px,.8fr) minmax(140px,.8fr) 1fr; grid-template-areas: "cat budget actual ." "bal bal actions actions"; }
#secCategoryBudget .cat-row{ display:contents; }
#secCategoryBudget .cat-row label:nth-child(1){ grid-area:cat; }
#secCategoryBudget .cat-row label:nth-child(2){ grid-area:budget; }
#secCategoryBudget .cat-row label:nth-child(3){ grid-area:actual; }
#secCategoryBudget .lab-balance{ grid-area:bal; display:flex; align-items:center; gap:12px; margin-top:4px; }
#secCategoryBudget .lab-balance > span:first-child{ padding:6px 12px; border-radius:999px; border:1px solid #e6ebe8; background:#f4f7f5; font-weight:700; color:#334155; font-size: 0.9rem;}
#secCategoryBudget .lab-balance .cat-balance{ font-weight:800; min-width:96px; font-size: 1.1rem; color: #184b26; }
#secCategoryBudget .cat-actions{ grid-area:actions; display:flex; align-items:center; justify-content:flex-end; gap:8px; margin-top:4px; }

/* --- Trip Summary Styling --- */
#secSummary .summary-row { padding: 12px 0; border-bottom: 1px dashed #e5e7eb; font-size: 1.05rem; }
#secSummary .summary-row:last-child { border-bottom: none; }
#secSummary .summary-row span { color: #6b7280; font-weight: 500; }
#secSummary .summary-row strong { color: #184b26; font-weight: 800; }
#secSummary .summary-actions { padding-top: 20px; border-top: 1px solid #e5e7eb; }

/* =========================================================
   📱 MOBILE OPTIMIZATIONS
   ========================================================= */
@media (max-width: 900px) {
  /* Stack Columns */
  body.page-planner .grid.cols-2 { display:flex !important; flex-direction:column !important; gap:16px !important; }
  
  /* Shrink padding */
  .vtt-wrap { padding: 0 12px; }
  .air-sec { border-radius: 12px; margin-bottom: 16px; }
  .air-head { padding: 12px 16px; }
  .air-body { padding: 16px; }

  /* Budget Category Layout on Mobile */
  #secCategoryBudget .cat-item {
    grid-template-columns: 1fr;
    grid-template-areas: "cat" "budget" "actual" "bal" "actions";
    padding: 16px 14px;
  }
  #secCategoryBudget .lab-balance { justify-content: flex-start; margin-top: 8px; }
  #secCategoryBudget .cat-actions { justify-content: flex-start; margin-top: 8px; }
  #secCategoryBudget .cat-actions .btn { flex: 1; text-align: center; }

  /* Multi-City Stops on Mobile */
  #vttStops .stop-grid { grid-template-columns: 1fr; gap: 12px; }
  #vttStops .stop-actions { justify-content: space-between; margin-top: 12px; }
  #vttStops .stop-actions .btn { flex: 1; text-align: center; }

  /* Action Rows / Toolbars */
  #secSummary .summary-actions { flex-direction: column; align-items: stretch; }
  #secSummary .summary-actions .btn { width: 100%; margin-bottom: 8px; }
  #secSummary .summary-actions [data-save-status] { text-align: center; margin: 0 auto; padding-top: 8px; }
}

/* Hide legacy styles */
#plannerForm[data-vtt-trip="single"] #vttStops { display:none !important; }
#plannerForm[data-vtt-trip="multi"]  #vttStops { display:block !important; }
#vttStops[hidden]{ display:none !important; }

/* Premium Budget Card Styling */
#secCategoryBudget .cat-item {
    background: #ffffff;
    border: 1px solid #eaf6ef;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#secCategoryBudget .cat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(27, 94, 32, 0.08);
}

/* Balance Badge Styling */
#secCategoryBudget .lab-balance span:first-child {
    background: #f4fbf6;
    color: #1b5e20;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #dbe9df;
}

/* Redesign Remove/Duplicate buttons to match your small premium style */
#secCategoryBudget .cat-actions .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 8px;
}
/* --- Live Trip Ledger Styles --- */
.ledger-row {
  display: grid;
  grid-template-columns: 80px 1fr 120px 80px 40px;
  align-items: center;
  gap: 15px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #eaf6ef;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ledger-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.06);
  border-color: #cfe0d4;
}
.ledger-date { font-size: 0.85rem; font-weight: 600; color: #6b7280; }
.ledger-info { font-weight: 700; color: #184b26; }
.ledger-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
  text-align: center;
}
.ledger-amt { font-weight: 900; color: #1b5e20; text-align: right; }
.ledger-del { color: #fca5a5; cursor: pointer; text-align: center; transition: color 0.2s; }
.ledger-del:hover { color: #9b1c1c; }

/* Mobile Ledger Layout */
@media (max-width: 768px) {
  .ledger-add-row { grid-template-columns: 1fr 1fr; }
  .btnLedgerAdd { grid-column: span 2; }
  .ledger-row {
    grid-template-columns: 1fr 1fr auto;
    grid-template-areas: "date amt del" "info info info" "badge badge badge";
    gap: 8px;
  }
  .ledger-date { grid-area: date; }
  .ledger-amt { grid-area: amt; }
  .ledger-del { grid-area: del; }
  .ledger-info { grid-area: info; }
  .ledger-badge { grid-area: badge; align-self: start; width: max-content; }
}
/* ========================================================================= */
/* ✨ PREMIUM APP OVERRIDES (Lovable UI Style) - REFINED                     */
/* ========================================================================= */

/* --- 1. Core Page & Branding --- */
body.page-planner .vtt-wrap { max-width: 1320px; width: 100%; margin: 0 auto; padding: 0 16px; font-family: system-ui, -apple-system, sans-serif; color: #1e293b; }

/* --- 2. Desktop Grid Layout --- */
body.page-planner .grid.cols-2 { display: grid; gap: 30px; align-items: start; }
@media (min-width: 900px){
  body.page-planner .grid.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* --- 3. 3-Step Intro Banner --- */
body.page-planner .step-banner { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; 
    background: #ffffff; border: 1px solid #f1f5f9; border-radius: 20px; padding: 24px; 
    margin-top: 16px; margin-bottom: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); 
}
body.page-planner .step-item { display: flex; align-items: center; gap: 16px; }
body.page-planner .step-icon { 
    font-size: 1.4rem; background: #f8fafc; border-radius: 12px; width: 48px; height: 48px; 
    display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.04); 
    flex-shrink: 0; color: #2e7d32; border: 1px solid #e2e8f0;
}
body.page-planner .step-text { font-size: 0.95rem; font-weight: 600; line-height: 1.4; color: #334155; }

/* --- 4. Tab Navigation --- */
body.page-planner .vtt-tabs { 
    display: flex; gap: 12px; border-bottom: 2px solid #f1f5f9; margin-bottom: 30px; 
    overflow-x: auto; padding-bottom: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; 
}
body.page-planner .vtt-tabs::-webkit-scrollbar { display: none; }
body.page-planner .vtt-tabs button { 
    background: transparent; border: none; font-size: 1.05rem; font-weight: 700; color: #64748b; 
    padding: 16px 24px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; 
    transition: all 0.2s ease; white-space: nowrap; 
}
body.page-planner .vtt-tabs button:hover { color: #1b5e20; }
body.page-planner .vtt-tabs button.active { 
  color: #1b5e20; border-bottom: 3px solid #1b5e20; 
  background: linear-gradient(to top, #f4fbf6 0%, transparent 100%);
  border-top-left-radius: 12px; border-top-right-radius: 12px;
}
body.page-planner .tab-pane { display: none; animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
body.page-planner .tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- 5. Soft Floating Cards (The Magic) --- */
/* Target ONLY the main section wrappers, not inner elements */
body.page-planner section.air-sec { 
  background: #ffffff !important; 
  border: 1px solid rgba(0,0,0,0.03) !important;
  border-radius: 24px !important; 
  overflow: hidden !important; 
  margin-bottom: 30px !important; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.03) !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease !important;
}
body.page-planner section.air-sec:hover {
  transform: translateY(-4px) !important; 
  box-shadow: 0 20px 40px rgba(27, 94, 32, 0.06), 0 4px 12px rgba(27, 94, 32, 0.04) !important; 
  border-color: #cfe0d4 !important;
}
body.page-planner section.air-sec > .air-head { background: transparent !important; padding: 24px 30px !important; border-bottom: 1px solid #f1f5f9 !important; display: flex !important; align-items: center !important; justify-content: space-between !important;}
body.page-planner section.air-sec > .air-head h2 { margin: 0 !important; font-weight: 900 !important; font-size: 1.25rem !important; color: #0f172a !important; letter-spacing: -0.3px !important; }
body.page-planner section.air-sec > .air-body { padding: 30px !important; }

/* --- Adjust Inner Grid Spacing (Fix for Trip Details) --- */
body.page-planner .air-body .grid { gap: 20px !important; margin-top: 20px !important; margin-bottom: 0 !important; }
body.page-planner .air-body .grid:first-child { margin-top: 0 !important; }
body.page-planner .air-body > label { margin-top: 24px !important; }
/* --- 6. Plush Inputs & Selects (FIXED PADDING) --- */
body.page-planner label { 
    display: flex !important; 
    flex-direction: column !important; 
    gap: 8px !important; 
    font-weight: 700 !important; 
    color: #334155 !important; 
    font-size: 0.95rem !important; 
}
body.page-planner .input, 
body.page-planner select.input, 
body.page-planner textarea.input {
    width: 100% !important; 
    box-sizing: border-box !important; /* This stops the inputs from overflowing the card */
    padding: 14px 16px !important; 
    border: 1px solid #cbd5e1 !important; 
    border-radius: 12px !important;
    background: #f8fafc !important; 
    outline: none !important; 
    font-family: inherit !important; 
    font-size: 1rem !important; 
    line-height: 1.4 !important; 
    transition: all 0.2s ease !important; 
    color: #1e293b !important; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.01) !important;
}
body.page-planner .input:hover, 
body.page-planner select.input:hover { background: #f1f5f9 !important; }
body.page-planner .input:focus, 
body.page-planner select.input:focus, 
body.page-planner textarea.input:focus { background: #ffffff !important; border-color:#2e7d32 !important; box-shadow:0 0 0 4px rgba(46,125,50,.15) !important; }
body.page-planner select.input { padding-right: 40px !important; -webkit-appearance: none !important; appearance: none !important; }

/* Ensure grids inside the air-body don't overflow */
body.page-planner .air-body .grid { 
    width: 100% !important; 
    box-sizing: border-box !important; 
}

/* --- 7. Premium Buttons --- */
body.page-planner .btn {
  border-radius: 12px; font-weight: 800; padding: 12px 20px; font-size: 0.95rem;
  border: 1px solid #cbd5e1; background: #fff; color: #475569; cursor: pointer; 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
body.page-planner .btn.primary { background: #2e7d32; color: #fff; border-color: #2e7d32; box-shadow: 0 4px 12px rgba(46,125,50,0.2); }
body.page-planner .btn.primary:hover { box-shadow: 0 8px 16px rgba(46, 125, 50, 0.3); transform: translateY(-2px); background: #1b5e20; }
body.page-planner .btn.danger { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }
body.page-planner .btn.danger:hover { background: #fee2e2; color: #991b1b; }
body.page-planner .btn.ghost { background: transparent; border: 1px solid #cbd5e1; color: #475569; }
body.page-planner .btn.ghost:hover { border-color: #2e7d32; color: #1b5e20; background: #f4fbf6; }
body.page-planner .btn.small { padding: 8px 14px; font-size: 0.85rem; border-radius: 10px; }

/* --- 8. Destination Hero Image & Route Text --- */
body.page-planner #secDestination figure.hero-wrap { margin: 16px 0 0 0 !important; padding: 0 !important; width: 100% !important; display: block !important; position: relative !important; }
body.page-planner #secDestination figure.hero-wrap > img {
  display: block !important; width: 100% !important; height: auto !important; object-fit: cover !important; 
  border-radius: 16px !important; border: 1px solid #e2e8f0 !important; max-height: 400px !important; box-shadow: 0 10px 25px rgba(0,0,0,0.05) !important;
}
body.page-planner #secDestination #hero_placeholder { display: none !important; }
body.page-planner #secDestination .dest-actions { display: flex; gap: 12px; margin-top: 16px; }

/* The Multi-City Route Text Fix */
body.page-planner #vttRoute {
    display: none !important;
}
/* --- 9. Trip Type Toggle (Single vs Multi) --- */
body.page-planner .trip-type-switch{ display:inline-flex; gap:6px; background:#f1f5f9; padding:6px; border-radius:16px; user-select:none; }
body.page-planner .trip-type-switch .seg{ appearance:none; border:0; background:transparent; color:#64748b; display:inline-flex; align-items:center; cursor:pointer; padding:10px 18px; border-radius:12px; font-weight:800; font-size: 0.95rem; transition: all 0.2s;}
body.page-planner .trip-type-switch .seg[aria-pressed="true"]{ background:#fff; color:#1b5e20; box-shadow:0 4px 10px rgba(0,0,0,0.05); }
body.page-planner .trip-type-switch .seg[data-locked="1"] { opacity:.5; cursor:not-allowed; }

/* --- 10. Multi-City Stops --- */
body.page-planner #vttStops .stop-item { border: 1px solid #e2e8f0; border-radius: 16px; background: #f8fafc; padding: 20px; margin-bottom: 16px; transition: border-color 0.2s; }
body.page-planner #vttStops .stop-item:hover { border-color: #cbd5e1; }
body.page-planner #vttStops .stop-grid { display:grid; grid-template-columns: minmax(220px,1.2fr) minmax(160px,.9fr) minmax(160px,.9fr); gap:16px; align-items:end; }
body.page-planner #vttStops .stop-note-wrap { grid-column: 1 / -1; }
body.page-planner #vttStops .vtt-stop-note { min-height: 80px; }
body.page-planner #vttStops .stop-actions { grid-column: 1 / -1; display:flex; gap:10px; justify-content:flex-end; margin-top:8px; }

/* --- 11. Trip Countdown --- */
body.page-planner #secTripCountdown #countdown_big{ 
    font-size: 3.5rem !important; 
    font-weight: 900 !important; 
    text-align: center !important; 
    background: linear-gradient(135deg, #1b5e20, #3b8f4a) !important; 
    -webkit-background-clip: text !important; 
    -webkit-text-fill-color: transparent !important; 
    margin-bottom: 8px !important; 
    line-height: 1.3 !important; /* Fixed cutoff issue */
    padding-bottom: 6px !important; 
}
body.page-planner #secTripCountdown #countdown_meta{ text-align:center !important; color:#64748b !important; font-size: 1rem !important; font-weight: 700 !important; letter-spacing: 0.5px !important; text-transform: uppercase !important; }

/* --- 12. Category Budget Grid --- */
body.page-planner #secCategoryBudget .cat-item { display:grid; gap:16px; align-items:end; background:#ffffff; border:1px solid #f1f5f9; border-radius:16px; padding:20px; margin-bottom: 16px; box-shadow:0 2px 8px rgba(0,0,0,.02); transition: transform 0.2s ease, box-shadow 0.2s ease;}
body.page-planner #secCategoryBudget .cat-item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(27,94,32,0.06); border-color: #e2e8f0; }
body.page-planner #secCategoryBudget .cat-item { grid-template-columns: minmax(260px,1.4fr) minmax(140px,.8fr) minmax(140px,.8fr) 1fr; grid-template-areas: "cat budget actual ." "bal bal actions actions"; }
body.page-planner #secCategoryBudget .cat-row{ display:contents; }
body.page-planner #secCategoryBudget .cat-row label:nth-child(1){ grid-area:cat; }
body.page-planner #secCategoryBudget .cat-row label:nth-child(2){ grid-area:budget; }
body.page-planner #secCategoryBudget .cat-row label:nth-child(3){ grid-area:actual; }
body.page-planner #secCategoryBudget .lab-balance{ grid-area:bal; display:flex; align-items:center; gap:12px; margin-top:8px; }
body.page-planner #secCategoryBudget .lab-balance > span:first-child{ padding:8px 16px; border-radius:999px; border:1px solid #e2e8f0; background:#f8fafc; font-weight:800; color:#475569; font-size: 0.9rem;}
body.page-planner #secCategoryBudget .lab-balance .cat-balance{ font-weight:900; min-width:96px; font-size: 1.2rem; color: #0f172a; }
body.page-planner #secCategoryBudget .cat-actions{ grid-area:actions; display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:8px; }

/* --- 13. Trip Summary Styling --- */
body.page-planner #secSummary .summary-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px dashed #e2e8f0; font-size: 1.05rem; }
body.page-planner #secSummary .summary-row:last-child { border-bottom: none; }
body.page-planner #secSummary .summary-row span { color: #64748b; font-weight: 600; }
body.page-planner #secSummary .summary-row strong { color: #0f172a; font-weight: 900; }
body.page-planner #secSummary .summary-actions { 
    background: #f8fafc; padding: 20px; border-radius: 16px; margin-top: 16px; 
    border: 1px solid #f1f5f9; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center;
}
body.page-planner #secSummary .summary-actions .btn { flex: 1 1 auto; min-width: 120px; }
body.page-planner #btnSave { width: 100%; height: 52px; font-size: 1.05rem; }

/* --- 14. Task Tracker (Micro-interactions) --- */
body.page-planner #secTasks #tasks_list{ display:grid; gap:12px; list-style:none; padding:0; margin:0; }
body.page-planner #secTasks #tasks_list .task-row{ display:grid; grid-template-columns:auto 1fr 40px; align-items:center; gap:14px; padding:14px; border:1px solid #f1f5f9; border-radius:16px; background:#fff; transition: all 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.02);}
body.page-planner #secTasks #tasks_list .task-row:hover { border-color: #cfe0d4; transform: translateX(2px); }
body.page-planner #secTasks #tasks_list .task-row:has(input[type="checkbox"]:checked) { background: #fbfcfb; border-color: #dcfce7; }
body.page-planner #secTasks #tasks_list .task-row:has(input[type="checkbox"]:checked) .task-text { text-decoration: line-through; color: #9ca3af; }
body.page-planner #secTasks #tasks_list .task-text{ min-height:44px; resize:vertical; border: none; background: transparent; padding: 0; outline: none; color: #334155; font-weight: 500;}
body.page-planner #secTasks #tasks_list .task-delete{ display:grid; place-items:center; width:40px; height:40px; padding:0; line-height:1; border-radius:10px; background:#f8fafc; border:1px solid #e2e8f0; cursor:pointer; color: #94a3b8; transition: all 0.2s;}
body.page-planner #secTasks #tasks_list .task-delete:hover { color: #b91c1c; border-color: #fca5a5; background: #fef2f2;}
body.page-planner #secTasks .task-check { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; border: 2px solid #cbd5e1; border-radius: 8px; cursor: pointer; position: relative; display: grid; place-content: center; transition: all 0.2s ease; margin: 0; background: #f8fafc;}
body.page-planner #secTasks .task-check::before { content: ""; width: 14px; height: 14px; transform: scale(0); transition: 120ms transform ease-in-out; box-shadow: inset 1em 1em white; background-color: white; transform-origin: center; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
body.page-planner #secTasks .task-check:checked { background-color: #2e7d32; border-color: #2e7d32; }
body.page-planner #secTasks .task-check:checked::before { transform: scale(1); }

/* --- 15. Boarding Pass Dropzone --- */
body.page-planner #secBoarding .bp-wrap{ display:grid; gap:16px; }
body.page-planner #secBoarding .bp-drop{ display:flex; align-items:center; justify-content:center; width:100%; cursor:pointer; border:2px dashed #cbd5e1; border-radius:16px; background:#f8fafc; padding:40px 20px; text-align:center; transition:all 0.3s ease; color: #64748b;}
body.page-planner #secBoarding .bp-drop:hover{ border-color:#2e7d32; background: #f4fbf6; color: #1b5e20; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(46, 125, 50, 0.08);}
body.page-planner #secBoarding .bp-preview{ display:none; background:#fff; border:1px solid #e2e8f0; border-radius:16px; padding:12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03);}
body.page-planner #secBoarding .bp-preview img{ display:block; width:100%; height:auto; border-radius:8px; }

/* --- 16. Premium Accordion Styling --- */
body.page-planner details.air-sec summary { display: flex; align-items: center; justify-content: space-between; padding: 24px 30px; background: transparent; border-bottom: 1px solid #f1f5f9; cursor: pointer; list-style: none; font-weight: 900; font-size: 1.25rem; color: #0f172a; user-select: none; }
body.page-planner details.air-sec summary::-webkit-details-marker { display: none; }
body.page-planner details.air-sec[open] summary .chev { transform: rotate(180deg); }
body.page-planner .collapse-toggle { display: none !important; }

/* =========================================================
   📱 MOBILE OPTIMIZATIONS
   ========================================================= */
@media (max-width: 900px) {
  body.page-planner .grid.cols-2 { display:flex !important; flex-direction:column !important; gap:20px !important; }
  body.page-planner .vtt-wrap { padding: 0 12px; }
  body.page-planner .step-banner { padding: 20px; gap: 16px; }
  body.page-planner section.air-sec { border-radius: 20px !important; margin-bottom: 20px !important; }
  body.page-planner section.air-sec > .air-head, 
  body.page-planner details.air-sec summary { padding: 20px 24px !important; }
  body.page-planner section.air-sec > .air-body { padding: 24px !important; }

  body.page-planner #secCategoryBudget .cat-item { grid-template-columns: 1fr; grid-template-areas: "cat" "budget" "actual" "bal" "actions"; padding: 20px; }
  body.page-planner #secCategoryBudget .lab-balance { justify-content: flex-start; margin-top: 12px; }
  body.page-planner #secCategoryBudget .cat-actions { justify-content: flex-start; margin-top: 12px; }
  body.page-planner #secCategoryBudget .cat-actions .btn { flex: 1; text-align: center; }

  body.page-planner #vttStops .stop-grid { grid-template-columns: 1fr; gap: 16px; }
  body.page-planner #vttStops .stop-actions { justify-content: space-between; margin-top: 16px; }
  body.page-planner #vttStops .stop-actions .btn { flex: 1; text-align: center; }

  body.page-planner #secSummary .summary-actions { flex-direction: column; align-items: stretch; }
  body.page-planner #secSummary .summary-actions .btn { width: 100%; margin-bottom: 10px; }
  body.page-planner #secSummary .summary-actions [data-save-status] { text-align: center; margin: 0 auto; padding-top: 10px; }
}

/* =========================================================
   🛠️ FINAL LAYOUT & OVERFLOW FIXES
   ========================================================= */

/* 1. Force strict box-sizing so padding stays inside the 100% width */
body.page-planner .air-sec,
body.page-planner .air-body,
body.page-planner .air-body *,
body.page-planner .air-body *::before,
body.page-planner .air-body *::after {
    box-sizing: border-box !important;
}

/* 2. Prevent grid blowout and force vertical spacing */
body.page-planner .air-body .grid {
    width: 100% !important;
    max-width: 100% !important;
    gap: 20px !important; 
    margin-bottom: 24px !important; 
}

/* Remove bottom margin on the last grid so the card doesn't stretch */
body.page-planner .air-body .grid:last-of-type {
    margin-bottom: 0 !important;
}

/* The magic rule: stops grid columns from stretching past the edge */
body.page-planner .air-body .grid > * {
    min-width: 0 !important; 
}

/* 3. Spacing for standalone labels (like Trip Notes) */
body.page-planner .air-body > label {
    margin-top: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    max-width: 100% !important;
}

/* 4. Ensure inputs fit perfectly inside grids without overflowing */
body.page-planner .input, 
body.page-planner select.input, 
body.page-planner textarea.input {
    width: 100% !important;
    max-width: calc(100% - 2px) !important; /* Forces the right edge back slightly */
    padding: 14px 16px !important;
    min-height: 48px !important; 
    margin-right: 2px !important; /* Adds a tiny buffer */
}

/* Let textareas grow naturally but start taller */
body.page-planner textarea.input {
    min-height: 100px !important; 
}
/* --- UNIFIED BOTANICAL HEADER SYSTEM --- */

/* Reset all headers first to ensure no leftovers */
.air-head, details.air-sec summary {
    background: #ffffff !important;
    border-bottom: 2px solid #f1f5f9 !important;
    color: #0f172a !important;
}

/* 1. Destination Setup - Soft Sage */
#secDestination .air-head, details#secDestination summary {
    background: #e9f0eb !important;
    border-bottom: 3px solid #cbdcd0 !important;
}

/* 2. Trip Details - Pale Mint */
#secTrip .air-head, details#secTrip summary {
    background: #e3f2e8 !important; 
    border-bottom: 3px solid #c1decb !important;
}

/* 3. Multi-stop route (stops list) */
#vttStops .air-head {
    background: #eef5f0 !important;
    border-bottom: 3px solid #d4e3d9 !important;
}

/* 4. Quick Facts - Laurel Green */
#secQuickFacts .air-head, details#secQuickFacts summary {
    background: #e6eee6 !important;
    border-bottom: 3px solid #c8d6c8 !important;
}

/* 5. Trip Countdown - Botanical Tint */
#secTripCountdown .air-head, details#secTripCountdown summary {
    background: #ddeadf !important;
    border-bottom: 3px solid #bccdbc !important;
}

/* 6. Overall Budget - Fern Green */
#secOverallBudget .air-head, details#secOverallBudget summary {
    background: #e2ede5 !important;
    border-bottom: 3px solid #c2d6c8 !important;
}

/* 7. Category Budget - Deep Tea */
#secCategoryBudget .air-head, details#secCategoryBudget summary {
    background: #d8e5d8 !important;
    border-bottom: 3px solid #b7ccb7 !important;
}

/* 8. Task Tracker - Soft Spruce */
#secTasks .air-head, details#secTasks summary {
    background: #e9f1ed !important;
    border-bottom: 3px solid #cbd8d3 !important;
}

/* 9. Trip Summary - Emerald Wash (Professional & Clear) */
#secSummary .air-head, details#secSummary summary {
    background: #d4e9d7 !important; /* Lighter than before for readability */
    border-bottom: 3px solid #acc9b1 !important;
}

/* Final Polish: Ensure all title text is bold and readable */
.air-head h2, details.air-sec summary span {
    color: #1e293b !important;
    font-weight: 800 !important;
    font-size: 1.1rem !important;
}

/* --- Planner grids: mirror planner.php <style> (keep in sync) --- */
body.page-planner #secCategoryBudget .cat-item {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(120px, 1fr) minmax(120px, 1fr) 1fr;
  grid-template-areas:
    'cat budget actual .'
    'bal bal actions actions';
  gap: 16px;
  align-items: end;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

body.page-planner #vttStops .stop-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  align-items: end;
}

@media (max-width: 899px) {
  body.page-planner #secCategoryBudget .cat-item {
    grid-template-columns: 1fr;
    grid-template-areas:
      'cat'
      'budget'
      'actual'
      'bal'
      'actions';
  }
  body.page-planner #vttStops .stop-grid {
    grid-template-columns: 1fr;
  }
}