/* ===========================================================================
   BFI Trip Planner — "500 Kaki Dian Emas · Dosier Ekspedisi Nusantara"
   Untuk semua trip pelayanan se-Indonesia (bukan terkunci satu wilayah).
   Aesthetic: deep-sea cartography Nusantara + parchment field-journal,
   aksen emas = kaki dian (Why 1). Display Fraunces · Body Spline Sans ·
   Data Spline Sans Mono.
   =========================================================================== */

:root {
  --abyss:   #061119;
  --deep:    #0a1c27;
  --sea:     #0f2735;
  --sea-line:#1b3d51;
  --paper:   #f1e4c9;
  --paper-2: #e9d8b6;
  --paper-line: #d8c39a;
  --ink:     #23323b;
  --ink-dim: #3d4b53; /* Darkened from #5c6b6b to satisfy WCAG AA contrast (4.5:1) on parchment */
  --saffron: #e3a23a;
  --gold:    #efc873;
  --clove:   #c0492c;
  --foam:    #5fb3a8;
  --foam-dk: #2f6f6a;
  --serif: "Fraunces", Georgia, serif;
  --sans:  "Spline Sans", system-ui, sans-serif;
  --mono:  "Spline Sans Mono", ui-monospace, monospace;
  --shadow: 0 15px 35px rgba(0,0,0,.25), 0 5px 15px rgba(0,0,0,.15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: #e9ddc6;
  line-height: 1.55;
  background:
    radial-gradient(120% 80% at 12% -10%, #10303f 0%, transparent 55%),
    radial-gradient(130% 90% at 100% 0%, #123a3a 0%, transparent 50%),
    radial-gradient(100% 120% at 50% 120%, #0c2230 0%, transparent 60%),
    var(--abyss);
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/></svg>");
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: repeating-radial-gradient(circle at 85% 8%, transparent 0 38px, rgba(95,179,168,.05) 38px 39px);
  opacity: .6;
}
main, header, section { position: relative; z-index: 1; }

/* --------------------------------------------------------------- Masthead */
.topbar { max-width: 980px; margin: 0 auto; padding: 46px 28px 8px; }
.topbar .eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--foam); margin: 0 0 12px;
  display: flex; align-items: center; gap: 12px;
}
.topbar .eyebrow::before { content: "🕎"; filter: saturate(1.2); }
.topbar h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: .96; margin: 0;
  color: var(--paper); letter-spacing: -.01em;
}
.topbar h1 em { font-style: italic; font-weight: 400; color: var(--saffron); }
.topbar .lede {
  font-family: var(--serif); font-style: italic; font-size: 1.1rem;
  color: #b6c4c8; margin: 14px 0 0; max-width: 46ch;
}
.topbar .coords {
  font-family: var(--mono); font-size: .74rem; color: #8ba0aa;
  margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px 22px;
  border-top: 1px solid var(--sea-line); padding-top: 14px;
}
.topbar .coords b { color: var(--foam); font-weight: 500; }

/* ------------------------------------------------------------- Wizard panel */
.wizard { max-width: 720px; margin: 28px auto 80px; padding: 0 24px; }

#tripForm {
  background:
    linear-gradient(var(--paper-line) 1px, transparent 1px) 0 0 / 100% 36px,
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  background-blend-mode: soft-light, normal;
  border-radius: 6px; border: 1px solid #c9b489; box-shadow: var(--shadow);
  padding: 8px 0 28px; color: var(--ink); position: relative; overflow: hidden;
}
#tripForm::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 8px;
  background: linear-gradient(var(--clove), #93341f);
  box-shadow: inset -1px 0 2px rgba(0,0,0,.3);
}

.step {
  border: none; padding: 22px 34px 8px; margin: 0;
  opacity: 0; transform: translateY(14px);
  animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards;
}
.step:nth-of-type(1) { animation-delay: .08s; }
.step:nth-of-type(2) { animation-delay: .20s; }
.step:nth-of-type(3) { animation-delay: .32s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.step legend {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--clove); padding: 0; margin-bottom: 6px;
  display: flex; align-items: baseline; gap: 10px;
}
.step legend::before {
  font-family: var(--serif); font-size: 1.5rem; font-style: italic;
  color: var(--saffron); line-height: 1;
}
.step:nth-of-type(1) legend::before { content: "I"; }
.step:nth-of-type(2) legend::before { content: "II"; }
.step:nth-of-type(3) legend::before { content: "III"; }

label {
  display: block; margin: 16px 0 0;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: #6a5a3b;
}

input, textarea {
  width: 100%; margin-top: 7px; padding: 10px 8px;
  font-family: var(--serif); font-size: 1.12rem; color: var(--ink);
  background: transparent; border: none; border-bottom: 1.5px solid #bda77f;
  border-radius: 0; transition: border-color .25s, box-shadow .25s, background-color .25s;
}
input::placeholder, textarea::placeholder { color: #7c6a49; font-style: italic; opacity: 0.85; }
input:focus, textarea:focus {
  outline: none; border-bottom-color: var(--clove);
  box-shadow: 0 2px 0 -1px var(--saffron);
  background-color: rgba(227,162,58,0.03);
}
input[type="date"] { font-family: var(--mono); font-size: 1rem; }
input[type="number"] { font-family: var(--mono); }
textarea { resize: vertical; border: 1.5px solid #bda77f; border-radius: 4px; padding: 10px; }

.focus { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.focus label {
  margin: 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 1px solid #c2ab7e; border-radius: 999px;
  background: rgba(255,255,255,.25); cursor: pointer; font-size: .75rem;
  color: #554426; transition: all .2s; user-select: none;
}
.focus label:hover { border-color: var(--clove); color: var(--clove); background: rgba(255,255,255,.45); }
.focus input { width: auto; margin: 0; accent-color: var(--clove); }
.focus label:has(input:checked) {
  background: var(--saffron); border-color: var(--saffron); color: #3a2606;
  box-shadow: 0 3px 12px -4px rgba(227,162,58,.7);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  margin-top: 30px;
  padding: 0 34px;
}
@media (min-width: 561px) {
  .actions {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
  .actions button {
    width: auto;
    flex: 0 1 auto;
  }
}

button {
  font-family: var(--mono); font-weight: 600; font-size: .82rem;
  letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
  border: none; border-radius: 4px; padding: 15px 34px; color: #2a1a04;
  background: linear-gradient(180deg, var(--gold), var(--saffron));
  box-shadow: 0 6px 18px -6px rgba(227,162,58,.6), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .15s, box-shadow .15s, filter .15s, background .15s;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 8px 24px -4px rgba(227,162,58,.7); }
button:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: wait; transform: none; filter: grayscale(.3); }
#genBtn::after { content: " ⟶"; }

.hint {
  margin: 12px 34px 0; padding: 0;
  font-family: var(--sans); font-size: .82rem; font-style: italic;
  color: #635332;
}

details.optional { margin: 6px 34px 0; border-top: 1px dashed var(--paper-line); }
details.optional > summary {
  list-style: none; cursor: pointer; padding: 16px 0 4px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--foam-dk);
  display: flex; align-items: center; gap: 8px;
  min-height: 44px;
}
details.optional > summary::-webkit-details-marker { display: none; }
details.optional > summary::before { content: "⊕"; font-size: 1rem; color: var(--clove); }
details.optional[open] > summary::before { content: "⊖"; }
details.optional .step { padding-left: 0; padding-right: 0; animation: none; opacity: 1; transform: none; }

.status {
  text-align: center; margin: 22px auto 0; font-family: var(--mono);
  font-size: .85rem; color: var(--gold); letter-spacing: .04em;
  font-weight: 500;
  animation: pulse-gold 2s infinite ease-in-out;
}
@keyframes pulse-gold {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; text-shadow: 0 0 8px rgba(239,200,115,0.4); }
}

/* Log langkah live — transparansi proses agentik (pecah leg, susun, gabung) */
.job-log {
  max-width: 520px; margin: 16px auto 0; padding: 16px 20px;
  list-style: none; font-family: var(--mono); font-size: .78rem;
  color: #8ba0aa; letter-spacing: .03em;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--sea-line);
  border-radius: 6px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}
.job-log li { padding: 4px 0; border-bottom: 1px solid rgba(27,61,81,0.25); }
.job-log li:last-child { border-bottom: none; }
.job-log li::before { content: "✓ "; color: var(--foam); }
.job-log li:last-child { color: var(--gold); }
.job-log li:last-child.log-active::before { content: "⏳ "; color: var(--gold); }

/* ------------------------------------------------------------ Output / report */
.output { max-width: 920px; margin: 30px auto 90px; padding: 0 24px; }
.output-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; align-items: center; }
.output-bar button {
  background: transparent; color: var(--foam); border: 1px solid var(--foam-dk);
  box-shadow: none; padding: 10px 18px; min-height: 44px;
}
.output-bar button:hover { background: rgba(95,179,168,.12); color: #fff; border-color: var(--foam); transform: translateY(-1px); }
#backBtn { margin-left: auto; color: #8ba0aa; border-color: var(--sea-line); }
#backBtn:hover { border-color: var(--foam); color: #fff; }

.document {
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  color: var(--ink); border: 1px solid #c9b489; border-radius: 6px;
  box-shadow: 0 15px 35px rgba(0,0,0,.2), 0 5px 15px rgba(0,0,0,.1), inset 0 0 50px rgba(139,115,85,.05);
  padding: 44px 48px 40px; position: relative;
}
.document::before {
  content: "❧"; position: absolute; top: 20px; right: 30px;
  font-size: 1.6rem; color: var(--clove); opacity: .5;
}
.document h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem); line-height: 1.05;
  margin: 0 0 6px; color: #1a2730; max-width: 80%;
}
.document > p {
  font-family: var(--serif); font-style: italic; font-size: 1.1rem;
  color: #4a3f2a; margin: 0 0 8px; padding-bottom: 18px;
  border-bottom: 2px solid var(--clove);
}

.day { border-top: 1px solid var(--paper-line); padding: 22px 0 18px 30px; position: relative; }
.day::before {
  content: ""; position: absolute; left: 4px; top: 30px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--saffron); box-shadow: 0 0 0 3px rgba(227,162,58,.25);
}
.day::after {
  content: ""; position: absolute; left: 8px; top: 38px; bottom: -1px;
  width: 1px; background: var(--paper-line);
}
.day:last-child::after { display: none; }
.day h3 { font-family: var(--serif); font-size: 1.18rem; font-weight: 600; margin: 0 0 8px; color: var(--foam-dk); }
.day > p { font-family: var(--serif); color: #4a3f2a; margin: 0 0 10px; }

/* trow: row di itinerari (transport + lodging) */
.trow {
  display: flex; align-items: flex-start; flex-wrap: wrap;
  gap: 0; padding: 8px 0;
  border-bottom: 1px solid rgba(189,167,127,.12);
}
.trow:last-child { border-bottom: none; }
.trow-tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  flex: 1; min-width: 0; padding-right: 10px;
}
.trow-price {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  justify-content: flex-end;
}
.tag {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .04em;
  color: #2b403e; background: rgba(95,179,168,.14);
  border: 1px solid rgba(47,111,106,.35); border-radius: 3px; padding: 4px 10px;
}
/* .price: input harga di trow (transport/lodging) */
.price {
  width: 130px; margin: 0; padding: 4px 6px;
  font-family: var(--mono); font-size: .84rem; color: #1a2730;
  text-align: right;
  background: transparent; border: none;
  border-bottom: 1.5px solid rgba(189,167,127,.55);
  border-radius: 0; transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.price::placeholder { color: #826e47; font-style: italic; font-size: .76rem; }
.price:focus {
  outline: none; border-bottom-color: var(--clove);
  box-shadow: 0 2px 0 -1px var(--saffron);
  background: rgba(227,162,58,.04);
}
.badge {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .06em;
  text-transform: uppercase; color: #8a7447; white-space: nowrap;
}
.badge-stale { color: #a05a18; cursor: pointer; text-decoration: underline dotted; }
.badge-stale:hover { color: var(--clove); }
.leg {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .06em; text-transform: uppercase;
  color: #1e524e; background: rgba(95,179,168,.16); border-radius: 3px;
  padding: 3px 8px; margin-left: 8px; vertical-align: middle;
}
.tnote {
  font-family: var(--serif); font-size: .82rem; color: #8a3a22;
  margin: 3px 0 6px 4px; padding-left: 8px; border-left: 2px solid rgba(192,73,44,.4);
  flex-basis: 100%;
}
.dnote {
  font-family: var(--serif); font-size: .84rem; color: #4a3f2a;
  margin: 10px 0 2px; padding: 8px 12px; background: rgba(227,162,58,.10);
  border-radius: 4px;
}

.cost {
  margin-top: 24px; padding: 16px 18px; background: rgba(35,50,59,.04);
  border-top: 2px solid var(--saffron); border-radius: 0 0 3px 3px;
  font-family: var(--mono); font-size: .92rem; color: #34291a;
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline;
}
.cost b { font-family: var(--serif); font-size: 1.15rem; color: var(--clove); }

.ministry {
  margin-top: 24px; padding: 16px 18px; background: rgba(95,179,168,.08);
  border-left: 3px solid var(--foam-dk); border-radius: 0 4px 4px 0;
  font-family: var(--serif); color: #2c3b3a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.ministry b {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--foam-dk); display: block; margin-bottom: 4px;
}

.colophon {
  max-width: 980px; margin: 0 auto; padding: 0 28px 50px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: #56707c;
}
.colophon span { color: var(--saffron); }

/* --------------------------------------------------------- Purpose grid */
.purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0 24px;
}
.pcard {
  background: linear-gradient(165deg, var(--sea) 0%, var(--ink) 100%);
  border: 1px solid var(--sea-line); border-radius: 12px;
  padding: 24px 20px; position: relative; overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.pcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35), inset 0 0 12px rgba(95,179,168,0.1);
  border-color: var(--foam);
}
.pcard .pn {
  font-family: var(--serif); font-size: 2.8rem; font-weight: 300;
  color: var(--saffron); opacity: .35; line-height: 1; margin-bottom: 6px;
}
.pcard h4 {
  font-family: var(--serif); font-size: 1.1rem; color: var(--paper);
  margin: 0 0 8px; font-weight: 600;
}
.pcard p { color: #cbd5e1; font-size: .88rem; margin: 0; line-height: 1.5; } /* Satisfies contrast against dark card background */

/* --------------------------------------------------------- Opportunity table */
.otable {
  width: 100%; border-collapse: collapse; font-size: .88rem;
  margin: 20px 0 16px;
}
.otable th {
  text-align: left; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--saffron);
  padding: 0 12px 12px; border-bottom: 1px solid var(--sea-line);
}
.otable td {
  padding: 12px; border-bottom: 1px solid rgba(27,61,81,.5);
  color: var(--ink);
}
.otable tr:nth-child(even) td { background: rgba(35,50,59,.04); }
.otable .loc { font-family: var(--serif); font-size: 1rem; color: #1a2730; font-weight: 600; }
.otable .num { font-family: var(--mono); text-align: center; font-weight: 600; color: #34291a; }

/* --------------------------------------------------------- Destination cards */
.dest-card {
  border-left: 3px solid var(--saffron); padding: 14px 16px;
  margin: 12px 0; background: rgba(227,162,58,.05); border-radius: 0 6px 6px 0;
}
.dest-card h4 {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
  color: #1a2730; margin: 0 0 6px;
}
.dest-card p { font-family: var(--serif); color: #4a3f2a; margin: 0 0 8px; font-size: .92rem; }
.dest-contacts { margin: 0; padding-left: 16px; font-family: var(--mono); font-size: .76rem; color: #4a3f2a; }
.dest-contacts li { padding: 2px 0; }

/* --------------------------------------------------------- Budget breakdown */
.budget {
  margin-top: 22px; padding: 20px 20px 16px;
  background: rgba(255,255,255,.55);
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.02);
}
.bbreak { display: flex; flex-direction: column; gap: 0; }

/* Each budget row */
.brow {
  padding: 12px 0 10px;
  border-bottom: 1px solid rgba(189,167,127,.18);
}
.brow:last-of-type { border-bottom: none; }

/* Row header: 2-column grid — label | inputs */
.brow .bh {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bh-label {
  font-family: var(--serif); font-size: .92rem; color: #34291a;
  line-height: 1.3; padding-right: 8px;
}
.bh-inputs {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.bh-inputs .price {
  width: 130px; min-width: 100px; max-width: 150px;
  font-family: var(--mono); font-size: .84rem; color: #1a2730;
  background: transparent; border: none;
  border-bottom: 1.5px solid rgba(189,167,127,.6);
  border-radius: 0; padding: 4px 6px; text-align: right;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.bh-inputs .price::placeholder { color: #826e47; font-style: italic; font-size: .76rem; }
.bh-inputs .price:focus {
  outline: none; border-bottom-color: var(--clove);
  box-shadow: 0 2px 0 -1px var(--saffron);
  background: rgba(227,162,58,.04);
}
.bh-sep {
  font-family: var(--mono); color: #b3a079; font-size: .8rem;
  flex-shrink: 0; user-select: none;
}

/* Progress bar — track tipis, tersembunyi saat kosong */
.bbar {
  height: 5px; border-radius: 4px;
  background: rgba(189,167,127,.2);
  overflow: hidden;
  transition: opacity .3s;
}
.bbar.bbar-empty { opacity: 0; height: 2px; }
.bbar i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--saffron), var(--clove));
  transition: width .4s ease;
}

/* Total row */
.btot {
  border-top: 2px solid var(--saffron) !important;
  border-bottom: none !important;
  margin-top: 6px;
  padding-top: 14px !important;
}
.btot .bh { margin-bottom: 0; }
.btot .bh-label {
  font-family: var(--mono); font-size: .75rem;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--foam-dk); font-weight: 600;
}
.bh-totals { gap: 8px; }
.btot-val {
  font-family: var(--mono); font-size: .95rem; font-weight: 700;
  color: var(--clove); min-width: 130px; text-align: right;
  display: inline-block;
}
.btot-val:only-child,
.btot-val:first-child { color: #34291a; }
.bh-totals .bh-sep { color: var(--saffron); font-weight: 600; }

/* ======================================================= Plan Hero (§1) */
.plan-hero {
  border-bottom: 2px solid var(--saffron);
  padding: 0 0 24px;
  margin-bottom: 36px;
}
.plan-hero-label {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .26em;
  text-transform: uppercase; color: var(--foam); margin-bottom: 10px;
}
.plan-hero h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.7rem, 3.5vw, 2.6rem); line-height: 1.05;
  margin: 0 0 10px; color: #1a2730; max-width: 90%;
}
.plan-summary {
  font-family: var(--serif); font-style: italic; font-size: 1.08rem;
  color: #4a3f2a; margin: 0 0 14px;
}
.hero-cost-pill {
  display: inline-block;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .06em;
  color: var(--clove); background: rgba(192,73,44,.08);
  border: 1px solid rgba(192,73,44,.25); border-radius: 3px;
  padding: 5px 14px;
}

/* ======================================================= Section chrome */
.purposes-section,
.gambaran-section,
.itinerari-section,
.budget-section {
  margin: 0 0 40px;
}
.section-header {
  display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--paper-line); padding-bottom: 10px; margin-bottom: 14px;
}
.section-num {
  font-family: var(--serif); font-size: 2rem; font-weight: 300;
  color: var(--saffron); opacity: .55; line-height: 1; flex-shrink: 0;
}
.section-header h3 {
  font-family: var(--serif); font-size: 1.22rem; font-weight: 600;
  color: #1a2730; margin: 0;
}
.section-lede {
  font-family: var(--serif); font-style: italic; font-size: .9rem;
  color: var(--ink-dim); margin: 0 0 18px;
}

/* ======================================================= Purposes (§2 → "Tiga Maksud") */
.purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 0;
}
.pcard {
  background: linear-gradient(165deg, var(--sea) 0%, var(--ink) 100%);
  border: 1px solid var(--sea-line); border-radius: 12px;
  padding: 22px 20px; position: relative; overflow: hidden;
}
.pn-badge {
  font-family: var(--serif); font-size: 2.2rem; font-weight: 300;
  color: var(--saffron); opacity: .75; line-height: 1; margin-bottom: 2px;
  transition: transform 0.3s ease;
}
.pcard:hover .pn-badge {
  transform: translateY(-2px) scale(1.05);
  color: var(--gold);
}
.pn-sub {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--foam); margin-bottom: 8px;
}
.pcard h4 {
  font-family: var(--serif); font-size: 1.05rem; color: var(--paper);
  margin: 0 0 7px; font-weight: 600;
}
.pcard p { color: #cbd5e1; font-size: .88rem; margin: 0; }

/* ======================================================= Gambaran Besar stat cards (§3) */
.dest-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.dest-stat-card {
  border: 1px solid var(--paper-line); border-radius: 8px;
  overflow: hidden;
  background-color: rgba(255,255,255,0.4);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.dest-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border-color: var(--saffron);
}
.dest-stat-header {
  background: var(--sea); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 2px solid var(--saffron);
}
.dest-stat-header h4 {
  font-family: var(--serif); font-size: 1.08rem; font-weight: 600;
  color: var(--paper); margin: 0; flex: 1;
}
.dest-days {
  font-family: var(--mono); font-size: .65rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold);
  background: rgba(239,200,115,.12); border: 1px solid rgba(239,200,115,.3);
  border-radius: 3px; padding: 2px 8px; white-space: nowrap;
}
.skor-misi {
  font-family: var(--mono); font-size: .65rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold);
  background: rgba(239,200,115,.12); border: 1px solid rgba(239,200,115,.3);
  border-radius: 3px; padding: 2px 8px; white-space: nowrap;
}
.skor-faktor {
  padding: 8px 14px;
  font-family: var(--mono); font-size: .68rem; color: #435158;
  border-top: 1px solid var(--paper-line); background: rgba(239,200,115,.05);
}
.mission-route {
  margin: 26px 0; padding: 18px 20px;
  border: 1px solid var(--paper-line); border-left: 4px solid var(--gold);
  background: rgba(239,200,115,.03);
  border-radius: 4px;
}
.mission-route h4 {
  font-family: var(--serif); font-size: 1.05rem; margin: 0 0 6px;
  color: #1a2730;
  font-weight: 600;
}
.mission-route ol {
  margin: 8px 0 0; padding-left: 22px;
  font-family: var(--mono); font-size: .78rem; color: #4a3f2a;
}
.mission-route li { padding: 3px 0; }
.mission-map {
  height: 320px; margin: 16px 0 4px;
  border: 2px solid #dfd3b6; border-radius: 8px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  z-index: 0; /* di bawah kontrol UI halaman */
}
@media print { .mission-map { display: none; } } /* peta tile butuh jaringan — versi cetak pakai diagram SVG */
/* Diagram rute SVG statis: offline-first — tampil di cetak/unduhan, di layar
   digantikan peta Leaflet live. */
.route-svg { display: none; margin: 12px 0; }
.route-svg svg { width: 100%; height: auto; }
@media print { .route-svg { display: block; } }

.pokok-doa {
  margin: 26px 0; padding: 18px 22px;
  border: 1px solid var(--paper-line); border-left: 4px solid var(--clove);
  background: rgba(192,73,44,0.02);
  border-radius: 4px;
}
.pokok-doa h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
}
.pokok-doa ul {
  margin: 8px 0 0; padding-left: 20px;
  font-size: .92rem; line-height: 1.55; color: #33404a;
}
.pokok-doa li { padding: 4px 0; }
.mr-score {
  color: #707e86; font-size: .68rem;
}
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--paper-line); /* gap acts as divider lines */
}
.stat-cell {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 6px 8px; background: #fff; text-align: center;
}
.stat-icon { font-size: .9rem; line-height: 1; margin-bottom: 3px; }
.stat-val {
  font-family: var(--mono); font-size: .96rem; font-weight: 600;
  color: #1a2730; line-height: 1;
}
.stat-label {
  font-family: var(--mono); font-size: .55rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-dim); margin-top: 3px;
  line-height: 1.2;
}
.dest-peluang {
  padding: 10px 14px;
  font-family: var(--serif); font-size: .86rem; color: #4a3f2a;
  border-top: 1px solid var(--paper-line); background: rgba(239,200,115,.05);
}
.dest-contacts {
  margin: 0; padding: 8px 14px 10px 26px;
  list-style: disc;
  font-family: var(--mono); font-size: .72rem; color: #4a3f2a;
  border-top: 1px solid var(--paper-line);
}
.dest-contacts li { padding: 2px 0; }
.kc-nama { font-weight: 600; color: #1a2730; }
.kc-detail { color: var(--ink-dim); }

/* ======================================================= Itinerari day cards (§4) */
.day-cards { display: flex; flex-direction: column; gap: 0; }
.day-card {
  display: flex; gap: 0;
  border-top: 1px solid var(--paper-line);
  position: relative;
}
.day-card::before {
  content: ""; position: absolute; left: 50px; top: 0; bottom: 0;
  width: 1px; background: var(--paper-line);
}
.day-card:last-child::before { bottom: auto; height: 28px; }
.day-card-marker {
  width: 50px; flex-shrink: 0; padding: 18px 0 18px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; z-index: 1;
}
.day-card-marker::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--saffron); box-shadow: 0 0 0 3px rgba(227,162,58,.2);
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.day-card:hover .day-card-marker::after {
  transform: scale(1.2);
  background: var(--clove);
  box-shadow: 0 0 0 4px rgba(192,73,44,.2);
}
.day-num {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--foam-dk); writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.day-card-body {
  flex: 1; min-width: 0; /* flex item boleh menyusut — tanpa ini trow meluber keluar kertas */
  padding: 16px 16px 16px 18px;
}
.day-location {
  font-family: var(--serif); font-size: 1.08rem; font-weight: 600;
  color: var(--foam-dk); margin-bottom: 8px;
}
.day-acts {
  font-family: var(--serif); color: #4a3f2a; font-size: .9rem;
  margin: 0 0 10px; padding-left: 0; line-height: 1.6;
  list-style: none;
}
.day-acts li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 4px;
}
.day-acts li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--saffron);
  font-size: 1.15rem;
  line-height: 1;
  top: 0px;
}

/* Budget section wrapper — retains existing .budget / .bbreak / .brow internals */
.budget-section .budget {
  margin-top: 0;
}

/* ======================================================= Responsive */
@media (max-width: 560px) {
  .document { padding: 28px 22px; }
  .document h2 { max-width: 100%; }
  .step { padding: 20px 22px 6px; }
  .actions { padding: 0 22px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dest-cards-grid { grid-template-columns: 1fr; }
  .purpose-grid { grid-template-columns: 1fr; }
  .day-card-marker { width: 36px; }
  .day-card::before { left: 36px; }

  /* Budget responsive: stack inputs vertically */
  .brow .bh { grid-template-columns: 1fr; gap: 6px; }
  .bh-inputs { justify-content: flex-start; flex-wrap: wrap; }
  .bh-inputs .price { width: 120px; }
  .btot-val { min-width: 110px; font-size: .88rem; }

  /* trow responsive: stack tags above price */
  .trow { flex-wrap: wrap; }
  .trow-tags { flex: 1 1 100%; padding-right: 0; padding-bottom: 6px; }
  .trow-price { flex: 1 1 100%; justify-content: flex-end; }
  .price { width: 120px; }
}

@media print {
  body { background: #fff; color: #111; }
  body::before, body::after { display: none; }
  .topbar, .wizard, .output-bar, .colophon { display: none !important; }
  .document { box-shadow: none; border: none; background: #fff; padding: 0; }
  .document::before { display: none; }
  .day::before { box-shadow: none; }
  .price { border: none; color: #111; background: none; }
  /* Sections: print-safe */
  .pcard { background: #fff; border: 1px solid #ccc; border-radius: 4px; }
  .pcard .pn-badge, .pcard .pn-sub, .pcard h4, .pcard p { color: #111; }
  .dest-stat-card { border: 1px solid #ccc; }
  .dest-stat-header { background: #f0f0f0; }
  .dest-stat-header h4, .dest-days { color: #111; }
  .stat-grid { background: #fff; }
  .stat-val { color: #111; }
  .stat-label { color: #555; }
  .dest-peluang, .dest-contacts, .kc-nama, .kc-detail { color: #111; }
  .section-header h3, .plan-hero h2, .plan-summary { color: #111; }
  .section-num { color: #555; }
  .day-location { color: #111; }
  .day-acts { color: #333; }
  .day-card { border-top-color: #ccc; }
  .day-card::before { background: #ccc; }
  .day-card-marker::after { background: #999; box-shadow: none; }
  .day-num { color: #555; }
  .budget { background: #f9f9f9; border-color: #999; }
  .bh-label, .bh-inputs .price, .btot-val { color: #111; }
  .bbar { background: #ddd; opacity: 1 !important; }
  .bbar i { background: #777; }
  /* Legacy classes retained for compat */
  .dest-card { border-left-color: #999; background: #f9f9f9; }
  .dest-card h4, .dest-card p, .dest-contacts { color: #111; }
  .otable th { color: #555; border-bottom-color: #999; }
  .otable td { color: #111; border-bottom-color: #ccc; }
  .otable tr:nth-child(even) td { background: #f7f7f7; }
}

/* --------------------------------------------------- Chat revisi (Iterasi 1) */
.chat-revise {
  margin-top: 34px; padding: 22px 24px; border: 1px solid rgba(198,164,92,.35);
  border-radius: 10px; background: rgba(255,255,255,.03);
}
.chat-revise label {
  display: block; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 10px;
}
.chat-revise textarea {
  width: 100%; box-sizing: border-box; font-family: var(--sans);
  font-size: 1rem; padding: 12px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.25);
  color: inherit; resize: vertical;
}
.chat-revise .actions { margin-top: 14px; padding: 0; text-align: right; }

.budget-note {
  margin: 10px 0 18px; font-family: var(--mono); font-size: .72rem;
  color: #8ba0aa; letter-spacing: .04em;
}

/* Funnel live per-kabupaten (spec §0.2) — angka real-time panel; "—" = belum/gagal fetch */
.funnel-live {
  padding: 8px 14px;
  font-family: var(--mono); font-size: .7rem; color: #435158;
  border-top: 1px solid var(--paper-line);
}
.funnel-live [data-fl] { color: var(--gold, #b8933f); font-weight: 700; }

/* ── Iterasi 4: Laporkan ke Panel (loop pasca-trip, sesi SSO) ─────────── */
.lapor-btn {
  margin-top: 10px; width: 100%; min-height: 44px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  background: transparent; color: var(--gold);
  border: 1px dashed rgba(239, 200, 115, .55); border-radius: 6px;
  cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.lapor-btn:hover { border-color: var(--gold); background: rgba(239, 200, 115, .08); }
.lapor-form { margin-top: 10px; display: grid; gap: 8px; }
.lapor-form input, .lapor-form select, .lapor-form textarea {
  width: 100%; padding: 10px 8px; font-size: .85rem;
  border: 1.5px solid #bda77f; border-radius: 3px; background: var(--paper);
  color: var(--ink);
}
.lapor-form textarea { resize: vertical; min-height: 64px; }
.lapor-form button { min-height: 44px; }
.lapor-hasil { font-size: .8rem; line-height: 1.5; color: var(--ink-dim); }

/* ── Wave 1 penyelarasan halaman emas (10 Jul) ────────────────────────── */
.hero-chips { margin: 14px 0 4px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero-chip {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em;
  padding: 6px 12px; border: 1px solid rgba(239, 200, 115, .4);
  border-radius: 999px; color: var(--gold);
}
.leg-divider {
  margin: 26px 0 12px; display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--saffron);
}
.leg-divider::before, .leg-divider::after {
  content: ""; flex: 1; border-top: 1px dashed rgba(227, 162, 58, .45);
}
.dest-denom { margin-top: 8px; font-size: .78rem; color: #435158; }
.dest-contacts-table, .peluang-table {
  width: 100%; margin-top: 10px; border-collapse: collapse; font-size: .8rem;
}
.dest-contacts-table th, .peluang-table th {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .1em;
  text-transform: uppercase; color: #6a5a3b; text-align: left;
  padding: 6px 8px; border-bottom: 1px solid var(--paper-line);
}
.dest-contacts-table td, .peluang-table td {
  padding: 6px 8px; border-bottom: 1px solid rgba(216, 195, 154, .5);
  vertical-align: top;
}
.dest-contacts-table .kc-nama { font-weight: 600; }
.dest-contacts-table .kc-kontak { font-family: var(--mono); font-size: .74rem; white-space: nowrap; }
.peluang-table .pt-kota { font-weight: 600; }
.peluang-scroll { overflow-x: auto; }

/* ── Wave 2: Risiko & Keputusan (§06 emas) + grup leg + per-orang ────────── */
.risk-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin-top: 14px;
}
.rcard {
  background: var(--paper, #f7f2e7); border: 1px solid var(--paper-line);
  border-left: 4px solid #e3a23a; border-radius: 8px; padding: 14px 16px;
}
.rcard.crit { border-left-color: #c0392b; }
.rcard h4 { margin: 8px 0 6px; font-size: .95rem; }
.rcard p { margin: 0; font-size: .84rem; color: #435158; line-height: 1.5; }
.rcard .badge {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
}
.rcard .badge.red { background: #c0392b; color: #fff; }
.rcard .badge.amb { background: rgba(227, 162, 58, .18); color: #8a6215; }
.leg-group { margin-top: 18px; }
.leg-group-title {
  margin: 0 0 10px; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase; color: #6a5a3b;
}
.brow.bpp .bh-label { font-size: .8rem; color: #6a5a3b; }
