/* ── TOKENS ── */
:root {
  --ink:        #1C1917;
  --ink-2:      #44403C;
  --ink-3:      #78716C;
  --ink-4:      #A8A29E;
  --paper:      #FAFAF8;
  --paper-2:    #F5F4F0;
  --paper-3:    #ECEAE4;
  --rule:       #E2DED8;
  --saffron:    #D4622A;
  --saffron-lt: #FCF0EA;
  --saffron-dk: #A8481A;
  --teal:       #0D6E6E;
  --teal-lt:    #E8F4F4;
  --gold:       #C49A2A;
  --gold-lt:    #FBF5E6;
  --green:      #2A7A4A;
  --green-lt:   #EAF5EE;
  --radius:     14px;
  --radius-sm:  8px;
  --radius-xs:  5px;
  --shadow:     0 2px 12px rgba(28,25,23,0.08);
  --shadow-lg:  0 8px 32px rgba(28,25,23,0.14);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper-2);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.header {
  background: var(--ink);
  padding: 0 1.5rem;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.header-brand {
  display: flex; align-items: baseline; gap: 6px;
}
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 500;
  color: #fff; letter-spacing: -0.02em;
}
.brand-name span { color: var(--saffron); }
.brand-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--saffron); margin-bottom: 2px;
  box-shadow: 0 0 8px var(--saffron);
}
.brand-sub {
  font-size: 10px; color: rgba(255,255,255,0.45);
  letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 500; margin-left: 2px;
  font-family: 'DM Mono', monospace;
}
.header-right {
  display: flex; align-items: center; gap: 10px;
}
.lang-row {
  display: flex; gap: 0;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; overflow: hidden;
}
.lang-btn {
  padding: 4px 10px; font-size: 11px; font-weight: 500;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.5); border-right: 1px solid rgba(255,255,255,0.1);
  transition: all 0.15s; font-family: 'DM Sans', sans-serif;
}
.lang-btn:last-child { border-right: none; }
.lang-btn.active { background: var(--saffron); color: #fff; }

/* ── PAGE SHELL ── */
.page {
  max-width: 640px; margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ── PROGRESS TRAIL ── */
.progress-trail {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 2rem;
}
.trail-step {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--ink-4);
  font-family: 'DM Mono', monospace;
  transition: color 0.3s;
}
.trail-step.active { color: var(--saffron); }
.trail-step.done   { color: var(--green); }
.trail-num {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
  transition: all 0.3s;
}
.trail-step.active .trail-num { background: var(--saffron); color: #fff; border-color: var(--saffron); }
.trail-step.done   .trail-num { background: var(--green);   color: #fff; border-color: var(--green); }
.trail-label { white-space: nowrap; }
.trail-line {
  flex: 1; height: 1px; background: var(--rule);
  margin: 0 8px; min-width: 16px;
}

/* ── SCREEN PANELS ── */
.screen { display: none; animation: fadeUp 0.28s ease; }
.screen.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SCREEN HEADER ── */
.screen-head {
  margin-bottom: 1.5rem;
}
.screen-eyebrow {
  font-size: 11px; font-weight: 600; color: var(--saffron);
  text-transform: uppercase; letter-spacing: 0.12em;
  font-family: 'DM Mono', monospace; margin-bottom: 4px;
}
.screen-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem; font-weight: 500;
  color: var(--ink); line-height: 1.2; letter-spacing: -0.02em;
}
.screen-sub {
  font-size: 13px; color: var(--ink-3); margin-top: 6px;
}

/* ── FORM CARD ── */
.form-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* ── FIELD ── */
.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.07em;
  font-family: 'DM Mono', monospace;
}
.field-hint {
  font-size: 11px; color: var(--ink-4); margin-top: 4px;
}

/* Text inputs */
input[type=text], input[type=time], textarea {
  width: 100%; padding: 11px 14px;
  background: var(--paper-2); border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm); color: var(--ink);
  font-family: 'DM Sans', sans-serif; font-size: 15px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=text]:focus, input[type=time]:focus, textarea:focus {
  border-color: var(--saffron); box-shadow: 0 0 0 3px var(--saffron-lt);
}
input::placeholder { color: var(--ink-4); }
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }

/* ── STEPPER ── */
.stepper {
  display: flex; align-items: center; gap: 0;
  border: 1.5px solid var(--rule); border-radius: var(--radius-sm);
  overflow: hidden; width: fit-content;
}
.stepper-btn {
  width: 44px; height: 44px; background: var(--paper-2);
  border: none; cursor: pointer; font-size: 20px;
  color: var(--ink-2); display: flex; align-items: center; justify-content: center;
  transition: background 0.12s; user-select: none;
  font-weight: 300;
}
.stepper-btn:hover { background: var(--paper-3); }
.stepper-btn:active { background: var(--saffron-lt); }
.stepper-val {
  width: 64px; text-align: center;
  font-family: 'Playfair Display', serif; font-size: 1.4rem;
  font-weight: 500; color: var(--ink);
  border-left: 1.5px solid var(--rule); border-right: 1.5px solid var(--rule);
}
.stepper-unit {
  font-size: 11px; color: var(--ink-4); font-family: 'DM Mono', monospace;
  margin-left: 10px;
}

/* ── TRIP TYPE CARDS ── */
.type-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.type-card {
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 10px;
  background: var(--paper-2); user-select: none;
}
.type-card:hover { border-color: var(--ink-3); background: var(--paper); }
.type-card.selected {
  border-color: var(--saffron); background: var(--saffron-lt);
  box-shadow: 0 0 0 3px rgba(212,98,42,0.12);
}
.type-card-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.type-card-text { }
.type-card-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.type-card-sub  { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.type-card-full { grid-column: span 2; }

/* ── RADIO GROUP ── */
.radio-group { display: flex; flex-direction: column; gap: 6px; }
.radio-group.horizontal { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.radio-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--rule); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s; user-select: none;
  background: var(--paper-2);
}
.radio-opt:hover { border-color: var(--ink-3); }
.radio-opt.selected { border-color: var(--saffron); background: var(--saffron-lt); }
.radio-opt input[type=radio] { display: none; }
.radio-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--ink-4); flex-shrink: 0;
  transition: all 0.15s; position: relative;
}
.radio-opt.selected .radio-dot {
  border-color: var(--saffron); background: var(--saffron);
  box-shadow: inset 0 0 0 3px #fff;
}
.radio-text { font-size: 14px; color: var(--ink); }
.radio-text small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; }

/* ── CHECKBOX CHIPS ── */
.chip-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 13px; border: 1.5px solid var(--rule);
  border-radius: 20px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; user-select: none;
  background: var(--paper-2); color: var(--ink-2);
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.selected {
  border-color: var(--saffron); background: var(--saffron-lt);
  color: var(--saffron-dk);
}

/* ── TOGGLE ── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info { }
.toggle-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.toggle-desc  { font-size: 12px; color: var(--ink-3); }
.toggle-switch {
  position: relative; width: 40px; height: 22px;
  flex-shrink: 0; cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-track {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--paper-3); border: 1.5px solid var(--rule);
  transition: all 0.2s; display: block;
}
.toggle-switch input:checked + .toggle-track {
  background: var(--saffron); border-color: var(--saffron);
}
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  pointer-events: none;
}
.toggle-switch input:checked ~ .toggle-thumb { left: 21px; }

/* Conditional reveal */
.conditional { display: none; margin-top: 8px; }
.conditional.visible { display: block; }

/* ── SUMMARY STRIP ── */
.summary-strip {
  background: var(--ink); color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 1.25rem; font-size: 13px;
}
.summary-tag {
  background: rgba(255,255,255,0.12);
  border-radius: 4px; padding: 3px 9px;
  font-size: 12px; font-family: 'DM Mono', monospace;
  white-space: nowrap;
}

/* ── TIME ROW ── */
.time-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

/* ── BUTTONS ── */
.btn-primary {
  width: 100%; padding: 15px;
  background: var(--saffron); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(212,98,42,0.35);
}
.btn-primary:hover { background: var(--saffron-dk); box-shadow: 0 6px 18px rgba(212,98,42,0.45); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(212,98,42,0.3); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-back {
  background: none; border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm); padding: 10px 18px;
  font-size: 14px; font-weight: 500; color: var(--ink-3);
  cursor: pointer; transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.btn-back:hover { border-color: var(--ink-3); color: var(--ink); }

.btn-row {
  display: flex; gap: 10px; margin-top: 1.25rem;
  align-items: center;
}
.btn-row .btn-primary { flex: 1; }

/* output rendered externally — no inline output panel */


/* Error */
.error-box {
  background: #FEF2F2; border: 1.5px solid #FECACA;
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 13px; color: #7F1D1D; line-height: 1.6;
  margin-top: 1rem; display: none;
}
.error-box.visible { display: block; }
.error-box strong { display: block; margin-bottom: 4px; font-size: 14px; }

/* ── PROMPT PANEL ── */
.prompt-panel {
  display: none; margin-top: 1.25rem;
  border: 1.5px solid var(--saffron);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.prompt-panel.visible { display: block; }

.prompt-panel-head {
  background: var(--ink); color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.prompt-panel-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 500;
}
.prompt-panel-sub {
  font-size: 11px; color: rgba(255,255,255,0.55);
  margin-top: 2px; font-family: 'DM Mono', monospace;
}

.prompt-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}
.btn-copy-prompt {
  padding: 7px 16px; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--saffron); color: #fff; border: none;
  font-family: 'DM Sans', sans-serif; transition: all 0.15s;
}
.btn-copy-prompt:hover { background: var(--saffron-dk); }
.btn-open-claude, .btn-open-gemini {
  padding: 7px 14px; border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1); color: #fff;
  font-family: 'DM Sans', sans-serif; transition: all 0.15s;
  text-decoration: none; display: inline-flex; align-items: center;
}
.btn-open-claude:hover, .btn-open-gemini:hover { background: rgba(255,255,255,0.2); }

.prompt-steps {
  display: flex; flex-direction: column; gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--rule);
}
.prompt-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
}
.prompt-step:last-child { border-bottom: none; }
.prompt-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--saffron-lt); color: var(--saffron);
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.prompt-step-text { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.prompt-step-text strong { color: var(--ink); }
.prompt-step-text a { color: var(--saffron); text-decoration: none; font-weight: 600; }
.prompt-step-text a:hover { text-decoration: underline; }

.prompt-preview {
  background: var(--paper-2); border-top: 1px solid var(--rule);
  padding: 14px 18px;
}
.prompt-preview-label {
  font-size: 11px; font-weight: 600; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: 0.1em;
  font-family: 'DM Mono', monospace; margin-bottom: 8px;
}
.prompt-preview-text {
  font-size: 12px; color: var(--ink-3); line-height: 1.6;
  font-family: 'DM Mono', monospace;
  max-height: 120px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}

.prompt-meta {
  padding: 10px 18px; background: var(--paper-3);
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11px; font-family: 'DM Mono', monospace; color: var(--ink-3);
  border-top: 1px solid var(--rule);
}
.prompt-meta-badge {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 4px; padding: 2px 8px;
}

.prompt-footer {
  padding: 12px 18px;
  display: flex; gap: 8px; flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  align-items: center; justify-content: space-between;
}
.prompt-footer-left { font-size: 12px; color: var(--ink-3); }
.btn-revise {
  padding: 8px 16px; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--paper-2); color: var(--ink-2);
  border: 1.5px solid var(--rule);
  font-family: 'DM Sans', sans-serif; transition: all 0.15s;
}
.btn-revise:hover { border-color: var(--saffron); color: var(--saffron); }

/* Copy flash */
.copy-flash {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 999;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.copy-flash.show { opacity: 1; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--paper-3); border-radius: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .type-grid { grid-template-columns: 1fr; }
  .type-card-full { grid-column: span 1; }
  .time-row { grid-template-columns: 1fr; }
  .screen-title { font-size: 1.4rem; }
  .page { padding: 1.25rem 0.75rem 3rem; }
  .output-body { padding: 16px; }
}

/* ── WELCOME BACK BANNER ── */
.welcome-back {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 1.75rem;
  display: flex; align-items: flex-start; gap: 16px;
  flex-wrap: wrap;
  animation: fadeUp 0.3s ease;
}
.wb-icon {
  font-size: 28px; line-height: 1;
  flex-shrink: 0; margin-top: 2px;
}
.wb-body { flex: 1; min-width: 160px; }
.wb-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 500;
  color: #fff; margin-bottom: 4px;
}
.wb-trip {
  font-size: 13px; font-weight: 600;
  color: var(--saffron);
  font-family: 'DM Mono', monospace;
  margin-bottom: 3px;
}
.wb-sub {
  font-size: 12px; color: rgba(255,255,255,0.55);
}
.wb-actions {
  display: flex; flex-direction: column; gap: 8px;
  flex-shrink: 0; align-self: center;
}
.wb-btn-continue {
  padding: 10px 18px;
  background: var(--saffron); color: #fff;
  border: none; border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s; white-space: nowrap;
}
.wb-btn-continue:hover { background: var(--saffron-dk); }
.wb-btn-new {
  padding: 9px 18px;
  background: transparent; color: rgba(255,255,255,0.7);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s; white-space: nowrap; text-align: center;
}
.wb-btn-new:hover { border-color: rgba(255,255,255,0.5); color: #fff; }
@media (max-width: 480px) {
  .welcome-back { flex-direction: column; gap: 14px; }
  .wb-actions { flex-direction: row; width: 100%; }
  .wb-btn-continue, .wb-btn-new { flex: 1; text-align: center; }
}
