/* ================================================================
   PREPARED TRAVEL — WIZARD STYLES v3.4
   ================================================================ */

:root {
  --purple:      #7D78E6;
  --purple-lt:   #BABBFA;
  --purple-xlt:  #F4F4FE;
  --navy:        #2B2E4A;
  --slate:       #ABAFD4;
  --bg:          #FAF8F4;
  --surface:     #FFFFFF;
  --surface2:    #F5F6FA;
  --surface3:    #F4F4FE;
  --border:      #E6E3DB;
  --border-md:   #ABAFD4;
  --t1:          #2B2E4A;
  --t2:          #484C6E;
  --t3:          #7A7E9A;
  --t4:          #ABAFD4;
  --green:       #27805A;
  --green-lt:    #E5F5EE;
  --amber:       #C67B1A;
  --amber-lt:    #FEF3E2;
  --red:         #C0392B;
  --red-lt:      #FCEAEA;
  --r:           10px;
  --r-sm:        6px;
  --r-lg:        16px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;
  --step-max:    860px;
  --sidebar-w:   360px;
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-out:    cubic-bezier(.16,1,.3,1);
  --t:           180ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* FIX A: overflow-x:hidden on html (not just body) stops iOS Safari from creating a
   shifted scroll container when audio preview content renders wide content.
   Without this, position:fixed elements (mobile bar, sheet backdrop) appear offset
   to the right whenever the Audio format card is selected on mobile. */
html { font-size: 17px; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-body);
  color: var(--t1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-color: #FAF8F4;
  background-image:
    linear-gradient(rgba(43,46,74,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43,46,74,.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ================================================================
   MASTHEAD
   ================================================================ */
.masthead {
  position: sticky; top: 0; z-index: 200;
  background: rgba(250,248,244,.97);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 58px;
}
.masthead-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.masthead-brand img { width: 26px; height: 26px; object-fit: contain; }
.masthead-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }
.masthead-right { display: flex; align-items: center; gap: 14px; }
.masthead-progress { display: flex; align-items: center; gap: 5px; }
.btn-reset { background: var(--purple-xlt); border: 1px solid var(--purple-lt); color: var(--purple); border-radius: 16px; padding: 5px 13px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; cursor: pointer; transition: all var(--t) ease; }
.btn-reset:hover { background: var(--red-lt); border-color: var(--red); color: var(--red); }
.progress-pip { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: background var(--t) ease, transform var(--t) var(--ease-spring); }
.progress-pip.done   { background: var(--navy); }
.progress-pip.active { background: var(--purple); transform: scale(1.6); }

/* ================================================================
   PAGE LAYOUT
   ================================================================ */
.page-wrap {
  max-width: calc(var(--step-max) + var(--sidebar-w) + 80px);
  margin: 0 auto; padding: 0 20px 160px;
  display: grid; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1040px) {
  .page-wrap { grid-template-columns: var(--step-max) var(--sidebar-w); gap: 40px; padding: 0 40px 140px; align-items: start; }
}
.steps-col { padding-top: 36px; min-width: 0; overflow: hidden; }

/* ================================================================
   STEP CHROME
   ================================================================ */
.step { position: relative; margin-bottom: 10px; }
.step::after { content: ''; position: absolute; left: 27px; bottom: -10px; width: 1px; height: 10px; background: var(--border); }
.step:last-child::after { display: none; }

/* Stub */
.step-stub {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  cursor: not-allowed;
  transition: opacity var(--t) ease, background var(--t) ease, border-color var(--t) ease, box-shadow var(--t) ease;
  user-select: none;
}
.step.locked .step-stub { background: var(--surface2); border-color: var(--border); cursor: not-allowed; }
.step.unlocked .step-stub,
.step.done     .step-stub { opacity: 1; cursor: pointer; background: var(--surface); border-style: solid; }
.step.unlocked .step-stub:hover,
.step.done     .step-stub:hover { border-color: var(--purple-lt); box-shadow: 0 2px 10px rgba(125,120,230,.1); background: var(--purple-xlt); }
.step.active   .step-stub { display: none; }

.stub-num {
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--surface3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--t4); flex-shrink: 0; transition: all var(--t) var(--ease-spring);
}
.step.unlocked .stub-num { background: var(--navy);   border-color: var(--navy);   color: #fff; }
.step.done     .stub-num { background: var(--purple); border-color: var(--purple); color: #fff; }
.stub-label { font-size: 13px; font-weight: 500; color: var(--t3); flex: 1; }
.step.unlocked .stub-label { color: var(--t2); }
.step.done     .stub-label { color: var(--t1); }
.stub-summary { font-family: var(--font-mono); font-size: 11px; color: var(--t4); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.done .stub-summary { color: var(--purple); }
.stub-edit { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--purple); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; opacity: 0; transition: opacity var(--t) ease; }
.step.done:hover .stub-edit { opacity: 1; }

/* Body */
.step-body { background: var(--surface); border: 1px solid var(--purple-lt); border-radius: var(--r); box-shadow: 0 4px 28px rgba(125,120,230,.1), 0 0 0 3px var(--purple-xlt); display: none; overflow: hidden; }
.step.active .step-body { display: block; }
.step-body-inner { padding: 24px 24px 20px; animation: stepOpen 300ms var(--ease-out) both; }
@keyframes stepOpen { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.step-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.step-num-badge { width: 32px; height: 32px; border-radius: 50%; background: var(--purple); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 13px; font-weight: 500; flex-shrink: 0; margin-top: 2px; }
.step-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--purple); margin-bottom: 4px; }
.step-title { font-family: var(--font-display); font-size: 25px; font-weight: 700; line-height: 1.15; color: var(--navy); letter-spacing: -.02em; }
.step-subtitle { font-size: 14px; color: var(--t3); margin-top: 4px; line-height: 1.55; }

.step-foot { display: flex; align-items: center; justify-content: space-between; padding: 13px 24px 16px; border-top: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.step-hint { font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; color: var(--t4); }
.step-hint strong { color: var(--purple); }

.btn-continue { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: #fff; border: none; border-radius: 24px; padding: 10px 22px; font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--t) var(--ease-spring); letter-spacing: .01em; white-space: nowrap; }
.btn-continue:hover:not(:disabled) { background: var(--purple); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(125,120,230,.28); }
.btn-continue:active { transform: translateY(0); }
.btn-continue:disabled { opacity: .3; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-continue .arrow { transition: transform var(--t) var(--ease-spring); }
.btn-continue:not(:disabled):hover .arrow { transform: translateX(3px); }

/* ================================================================
   SECTION LABELS
   ================================================================ */
.section-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--t4); margin: 16px 0 8px; display: flex; align-items: center; justify-content: space-between; }

.link-btn { background: var(--surface3); color: var(--purple); border: 1px solid var(--purple-lt); border-radius: 12px; padding: 3px 10px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; cursor: pointer; transition: all var(--t) ease; }
.link-btn:hover { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ================================================================
   STEP 1 — LANGUAGES
   ================================================================ */
.search-wrap { position: relative; margin-bottom: 4px; }
.search-wrap input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 24px; padding: 9px 14px 9px 36px; font-family: var(--font-body); font-size: 16px; color: var(--t1); outline: none; transition: border-color var(--t) ease, box-shadow var(--t) ease; }
.search-wrap input::placeholder { color: var(--t4); }
.search-wrap input:focus { border-color: var(--purple-lt); box-shadow: 0 0 0 3px var(--purple-xlt); }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--t3); pointer-events: none; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; max-width: 100%; }
.chip-row.hidden { display: none; }

/* Language chips — selected = purple */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--t2); font-size: 14px; cursor: pointer; transition: all var(--t) ease; user-select: none; white-space: nowrap; touch-action: manipulation; }
.chip:hover    { border-color: var(--purple-lt); background: var(--purple-xlt); color: var(--purple); }
.chip.selected { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 500; }

/* Add-on chips — dashed, no emoji */
.chip.chip-addon { border-style: dashed; border-color: var(--border-md); color: var(--t3); font-size: 12px; background: transparent; }
.chip.chip-addon:hover { border-style: solid; border-color: var(--purple-lt); background: var(--purple-xlt); color: var(--purple); }
.chip.chip-addon.selected { border-style: solid; background: transparent; border-color: var(--purple-lt); color: var(--purple); font-weight: 500; }
.chip.chip-addon.selected-custom { border-style: solid; background: transparent; border-color: var(--amber); color: var(--amber); font-weight: 500; }

/* Custom chip nudge — shown when search has no matches */
.chip.chip-addon.nudge {
  border-style: solid;
  border-color: var(--purple-lt);
  background: var(--purple-xlt);
  color: var(--purple);
  font-weight: 600;
  animation: nudgePulse 1.4s var(--ease-spring) 2;
}
@keyframes nudgePulse {
  0%   { box-shadow: 0 0 0 0 rgba(125,120,230,.4); }
  50%  { box-shadow: 0 0 0 5px rgba(125,120,230,0); }
  100% { box-shadow: 0 0 0 0 rgba(125,120,230,0); }
}

/* ----------------------------------------------------------------
   Lang no-match block
   Visibility is class-driven (.visible) so CSS display:flex
   cannot be overridden by the hidden attribute or any UA stylesheet.
   Default is display:none; .visible switches to display:flex.
   ---------------------------------------------------------------- */
.lang-no-match {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--purple-xlt);
  border: 1px solid var(--purple-lt);
  border-radius: var(--r-sm);
}

.lang-no-match.visible {
  display: flex;
  animation: stepOpen 200ms var(--ease-out) both;
}

.lang-no-match-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--purple);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

.lang-no-match-text strong {
  color: var(--purple);
  font-weight: 600;
}

.lang-no-match-btn {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t) var(--ease-spring);
  touch-action: manipulation;
  flex-shrink: 0;
}

.lang-no-match-btn:hover {
  background: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(125,120,230,.28);
}

/* ================================================================
   STEP 2 — ALLERGENS
   ================================================================ */

/* Allergen search: reuses .search-wrap + .search-icon from Step 1.
   The .allergen-search-wrap modifier adds bottom margin to match the
   previous standalone wrapper spacing. */
.allergen-search-wrap {
  margin-bottom: 12px;
}

/* #allergen-search inherits padding-left from .search-wrap input rule above.
   Override font-size to 16px to prevent iOS Safari autozoom on focus. */
#allergen-search {
  font-size: 16px;
}

/* Hide browser's native clear button — JS resets on empty query */
#allergen-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Grid */
.allergen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 4px; }

.allergen-cat { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 12px 10px; cursor: pointer; transition: all var(--t) ease; background: var(--bg); user-select: none; }
.allergen-cat:hover          { border-color: var(--purple-lt); background: var(--purple-xlt); }
.allergen-cat.has-selections { border-color: var(--purple-lt); background: var(--purple-xlt); }
.allergen-cat.expanded       { grid-column: 1 / -1; background: var(--surface); border-color: var(--purple-lt); box-shadow: 0 2px 14px rgba(125,120,230,.07); }

.cat-header { display: flex; align-items: center; gap: 8px; }
.cat-icon   { font-size: 18px; line-height: 1; }
.cat-name   { font-size: 14px; font-weight: 500; color: var(--t1); flex: 1; line-height: 1.3; }
.cat-badge  { min-width: 18px; height: 18px; background: var(--purple); color: #fff; border-radius: 9px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; display: none; align-items: center; justify-content: center; padding: 0 5px; }
.allergen-cat.has-selections .cat-badge { display: flex; }
.cat-toggle-hint { font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; color: var(--t4); margin-top: 4px; text-align: right; }

.cat-items-wrap { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); animation: stepOpen 220ms var(--ease-out) both; }
.allergen-cat.expanded .cat-items-wrap { display: block; }
.cat-items-actions { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.btn-select-all { background: none; border: 1px solid var(--border); border-radius: 12px; padding: 3px 10px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--t3); cursor: pointer; transition: all var(--t) ease; touch-action: manipulation; }
.btn-select-all:hover        { border-color: var(--purple-lt); color: var(--purple); background: var(--purple-xlt); }
.btn-select-all.all-selected { border-color: var(--purple); color: var(--purple); background: var(--purple-xlt); }
.cat-items { display: flex; flex-wrap: wrap; gap: 6px; }

.item-chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--t2); font-size: 13px; cursor: pointer; transition: all var(--t) ease; user-select: none; touch-action: manipulation; }
.item-chip:hover    { border-color: var(--purple-lt); background: var(--purple-xlt); color: var(--purple); }
.item-chip.selected { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 500; }

/* ================================================================
   STEP 3 — FORMATS
   ================================================================ */
.format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 480px) { .format-grid { grid-template-columns: repeat(4, 1fr); } }

.format-card { border: 1px solid var(--border); border-radius: var(--r); padding: 16px 10px 13px; cursor: pointer; transition: all var(--t) ease; background: var(--bg); text-align: center; user-select: none; position: relative; touch-action: manipulation; }
.format-card:hover { border-color: var(--purple-lt); background: var(--purple-xlt); box-shadow: 0 4px 14px rgba(125,120,230,.15); }
.format-card.selected { border-color: var(--purple); background: var(--purple-xlt); }
.format-check { display: none; position: absolute; top: 6px; right: 8px; width: 16px; height: 16px; background: var(--purple); color: #fff; border-radius: 50%; font-size: 9px; align-items: center; justify-content: center; line-height: 16px; }
.format-card.selected .format-check { display: flex; }
.format-icon  { font-size: 22px; margin-bottom: 6px; }
.format-name  { font-size: 13px; font-weight: 600; color: var(--t1); line-height: 1.3; }
.format-price { font-family: var(--font-mono); font-size: 11px; color: var(--t4); margin-top: 3px; }

/* FIX B: Format hint */
.format-hint {
  display: none;
  margin-top: 10px;
  padding: 9px 13px;
  background: var(--green-lt);
  border: 1px solid #B3E0CB;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  line-height: 1.5;
}
.format-hint.visible { display: block; }

/* Dialect */
.dialect-picker { display: none; margin-top: 12px; padding: 12px 14px; background: var(--amber-lt); border: 1px solid #F5D9A8; border-radius: var(--r-sm); }
.dialect-picker.visible { display: block; }
.dialect-picker-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; }
.dialect-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dialect-chip { padding: 5px 13px; border-radius: 20px; border: 1px solid #F5D9A8; background: #fff; color: var(--amber); font-size: 12px; font-weight: 500; cursor: pointer; transition: all var(--t) ease; user-select: none; touch-action: manipulation; }
.dialect-chip:hover    { background: var(--amber-lt); border-color: var(--amber); }
.dialect-chip.selected { background: var(--amber); border-color: var(--amber); color: #fff; }
.dialect-error { display: none; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--red); }
.dialect-error.visible { display: block; }

/* ================================================================
   FORMAT PREVIEWS — pill strip + single panel
   ================================================================ */
.format-previews { display: none; margin-top: 16px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.format-previews.has-sections { display: block; }

.format-preview-pills { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 14px 10px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.format-preview-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 13px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--t3); font-family: var(--font-mono); font-size: 11px; cursor: pointer; transition: all var(--t) ease; user-select: none; touch-action: manipulation; }
.format-preview-pill:hover  { border-color: var(--purple-lt); color: var(--purple); background: var(--purple-xlt); }
.format-preview-pill.active { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 500; }

#format-preview-panel { background: var(--surface); }
.preview-panel-inner  { padding: 14px 16px 16px; }

.mockup-hero { width: 100%; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface2); margin-bottom: 8px; }
.mockup-hero img { width: 100%; height: auto; display: block; object-fit: contain; }

.mockup-thumbs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin-bottom: 10px; }
.mockup-thumbs::-webkit-scrollbar { display: none; }
.preview-thumb { flex-shrink: 0; width: 76px; height: 52px; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: border-color var(--t) ease; background: var(--surface2); touch-action: manipulation; }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-thumb:hover  { border-color: var(--purple-lt); }
.preview-thumb.active { border-color: var(--purple); }

.format-desc { font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.5; padding: 10px 14px; background: var(--purple-xlt); border-radius: var(--r-sm); border: 1px solid var(--purple-lt); margin-bottom: 10px; }

/* Audio */
.audio-lang-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.audio-lang-tab { padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--t2); font-family: var(--font-mono); font-size: 10px; cursor: pointer; transition: all var(--t) ease; touch-action: manipulation; }
.audio-lang-tab:hover  { border-color: var(--purple-lt); color: var(--purple); }
.audio-lang-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

#audio-voice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.audio-voice-card { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; display: flex; align-items: center; gap: 10px; background: var(--surface3); transition: all var(--t) ease; }
.audio-voice-card:hover   { border-color: var(--purple-lt); }
.audio-voice-card.playing { border-color: var(--purple); background: var(--purple-xlt); }
.audio-play-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: #fff; border: none; cursor: pointer;
  /* FIX 1b: font-size >= 16px prevents iOS Safari autozoom on focus;
     touch-action: manipulation suppresses double-tap zoom */
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--t) var(--ease-spring);
  touch-action: manipulation;
}
.audio-play-btn:hover   { background: var(--purple); transform: scale(1.08); }
.audio-play-btn.playing { background: var(--purple); }
.audio-voice-info  { flex: 1; min-width: 0; }
.audio-voice-label { font-size: 11px; font-weight: 600; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-voice-sub   { font-family: var(--font-mono); font-size: 10px; color: var(--t4); }

/* ================================================================
   STEP 4 — CHECKOUT
   ================================================================ */
.checkout-block { margin-bottom: 18px; }
.checkout-block-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--purple); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.co-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.co-row:last-child { border-bottom: none; }
.co-lbl   { font-size: 13px; color: var(--t1); font-weight: 500; }
.co-meta  { font-family: var(--font-mono); font-size: 11px; color: var(--t4); margin-top: 2px; }
.co-price { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--purple); white-space: nowrap; }
.co-lang-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.co-lang-chip { padding: 3px 9px; border-radius: 11px; background: var(--surface3); border: 1px solid var(--border); font-size: 11px; color: var(--t2); }
.co-lang-en     { background: var(--green-lt);  border-color: #B3E0CB; color: var(--green); position: relative; cursor: default; }
.co-lang-custom { background: var(--amber-lt);  border-color: #F5D9A8; color: var(--amber); }
.co-lang-en[data-tooltip]:hover::after,
.co-lang-en[data-tooltip].tooltip-open::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 0;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  white-space: normal;
  width: 220px;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(43,46,74,.18);
}
.co-lang-en[data-tooltip]:hover::before,
.co-lang-en[data-tooltip].tooltip-open::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 12px;
  border: 5px solid transparent;
  border-top-color: var(--navy);
  z-index: 51;
  pointer-events: none;
}
.co-allergen-block { margin-top: 6px; }
.co-allergen-row   { font-size: 12px; padding: 3px 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.co-allergen-cat   { font-weight: 600; color: var(--t1); white-space: nowrap; }
.co-allergen-items { color: var(--t3); font-size: 11px; }

.checkout-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 0; border-top: 2px solid var(--navy); margin-top: 4px; }
.checkout-total-lbl   { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }
.checkout-total-price { font-family: var(--font-mono); font-size: 20px; font-weight: 500; color: var(--purple); }

.btn-checkout { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--purple); color: #fff; border: none; border-radius: var(--r); padding: 15px 24px; font-family: var(--font-body); font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 20px; transition: all var(--t) var(--ease-spring); letter-spacing: .01em; touch-action: manipulation; }
.btn-checkout:hover:not(:disabled) { background: var(--navy); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(43,46,74,.22); }
.btn-checkout:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.checkout-loading { display: none; align-items: center; justify-content: center; gap: 10px; padding: 12px; font-size: 13px; color: var(--t3); }
.checkout-loading.visible { display: flex; }
.checkout-error { display: none; padding: 10px 14px; background: var(--red-lt); border: 1px solid #F5C6C2; border-radius: var(--r-sm); font-size: 13px; color: var(--red); margin-top: 10px; }
.checkout-error.visible { display: block; }
.checkout-legal { font-family: var(--font-mono); font-size: 10px; letter-spacing: .02em; color: var(--t4); text-align: center; margin-top: 12px; line-height: 1.7; }
.checkout-legal a { color: var(--purple); text-decoration: none; }
.checkout-legal a:hover { text-decoration: underline; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar { display: none; position: sticky; top: 76px; padding-top: 36px; height: fit-content; }
@media (min-width: 1040px) { .sidebar { display: block; } }

.preview-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: 0 2px 14px rgba(43,46,74,.05); }
.preview-card-head { background: var(--navy); padding: 11px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-card-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--purple-lt); }
.preview-lang-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.preview-lang-tab { padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: transparent; color: rgba(255,255,255,.4); font-family: var(--font-mono); font-size: 10px; cursor: pointer; transition: all var(--t) ease; touch-action: manipulation; }
.preview-lang-tab:hover  { border-color: rgba(255,255,255,.35); color: rgba(255,255,255,.7); }
.preview-lang-tab.active { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: #fff; }

.preview-card-body { padding: 16px; min-height: 160px; font-size: 13px; line-height: 1.65; }
.preview-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 150px; gap: 8px; text-align: center; }
.preview-empty-icon { font-size: 26px; opacity: .18; }
.preview-empty-text { font-size: 12px; color: var(--t4); max-width: 175px; line-height: 1.5; }

.pv-line        { margin-bottom: 5px; color: var(--t1); font-size: 13px; line-height: 1.55; }
.pv-line strong { font-weight: 600; }
.pv-line.muted  { font-size: 11px; color: var(--t4); font-style: italic; }
.pv-heading { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--purple); margin-bottom: 6px; margin-top: 4px; }
.pv-divider { height: 1px; background: var(--border); margin: 10px 0; }

.preview-cart { border-top: 1px solid var(--border); padding: 12px 16px; background: var(--surface3); }
.cart-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--t3); margin-bottom: 5px; }
.cart-row.total { font-weight: 700; font-size: 13px; color: var(--t1); border-top: 1px solid var(--border); padding-top: 7px; margin-top: 3px; }
.cart-row.total span:last-child { color: var(--purple); }

/* ================================================================
   MOBILE BOTTOM BAR
   ================================================================ */
.mobile-bar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: rgba(255,255,255,.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 14px rgba(43,46,74,.06); }
@media (max-width: 1039px) { .mobile-bar { display: block; } }
.mobile-bar-inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.mobile-bar-info  { flex: 1; min-width: 0; }
.mobile-bar-title { font-size: 13px; font-weight: 600; color: var(--t1); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-bar-sub   { font-size: 11px; color: var(--t3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-bar-btns  { display: flex; gap: 6px; flex-shrink: 0; }
.mobile-bar-btn { background: var(--navy); color: #fff; border: none; border-radius: 18px; padding: 8px 13px; font-family: var(--font-body); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all var(--t) var(--ease-spring); touch-action: manipulation; }
.mobile-bar-btn:hover { background: var(--purple); }
.mobile-bar-btn.ghost { background: var(--surface3); color: var(--t2); border: 1px solid var(--border); }
.mobile-bar-btn.ghost:hover { background: var(--purple-xlt); border-color: var(--purple-lt); color: var(--purple); }

/* ================================================================
   MOBILE SHEET
   ================================================================ */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(43,46,74,.4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 150; opacity: 0; pointer-events: none; transition: opacity 280ms ease; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.mobile-sheet { position: fixed; bottom: 0; left: 0; right: 0; z-index: 160; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -8px 40px rgba(43,46,74,.2); transform: translateY(100%); transition: transform 320ms var(--ease-out); max-height: 88vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.mobile-sheet.open { transform: translateY(0); }
.sheet-grabber {
  width: 100%; height: 28px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: grab; touch-action: none; user-select: none; margin-top: 4px;
}
.sheet-grabber::before {
  content: ''; display: block; width: 36px; height: 4px;
  background: var(--border-md); border-radius: 2px;
}
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sheet-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.sheet-close { width: 28px; height: 28px; border-radius: 50%; background: var(--surface2); border: none; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; color: var(--t3); transition: all var(--t) ease; touch-action: manipulation; }
.sheet-close:hover { background: var(--border); color: var(--t1); }
.sheet-tabs { display: flex; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.sheet-tab { flex: 1; padding: 10px 12px; text-align: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--t4); cursor: pointer; border-bottom: 2px solid transparent; transition: all var(--t) ease; background: none; border-top: none; border-left: none; border-right: none; margin-bottom: -1px; touch-action: manipulation; }
.sheet-tab:hover  { color: var(--t2); }
.sheet-tab.active { color: var(--purple); border-bottom-color: var(--purple); }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; -webkit-overflow-scrolling: touch; }
.sheet-panel        { display: none; }
.sheet-panel.active { display: block; }

.sheet-pv-lang-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sheet-pv-lang-tab { padding: 4px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--t3); font-family: var(--font-mono); font-size: 10px; cursor: pointer; transition: all var(--t) ease; touch-action: manipulation; }
.sheet-pv-lang-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.sheet-dlv-section { margin-bottom: 20px; }
.sheet-dlv-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--purple); margin-bottom: 8px; }

/* Mobile deliverable cards */
.sheet-dlv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.sheet-dlv-card-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px 0; }
.sheet-dlv-card-icon { font-size: 22px; flex-shrink: 0; }
.sheet-dlv-card-name { font-size: 15px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.sheet-dlv-card-price { font-family: var(--font-mono); font-size: 11px; color: var(--purple); margin-top: 2px; }
.sheet-dlv-card-desc { font-size: 13px; color: var(--t2); line-height: 1.55; padding: 8px 16px 12px; }
.sheet-dlv-audio-player { padding: 0 16px 16px; }
.sheet-dlv-hero-wrap { padding: 0 16px; background: var(--surface2); }
.sheet-dlv-hero-wrap img { width: 100%; height: auto; display: block; object-fit: contain; border-radius: var(--r-sm); }
.sheet-dlv-thumbs { display: flex; gap: 8px; padding: 10px 16px 14px; overflow-x: auto; scrollbar-width: none; }
.sheet-dlv-thumbs::-webkit-scrollbar { display: none; }
.sheet-dlv-thumb { flex-shrink: 0; width: 60px; height: 44px; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: border-color var(--t) ease; background: var(--surface2); touch-action: manipulation; }
.sheet-dlv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-dlv-thumb.active { border-color: var(--purple); }
.sheet-dlv-thumb:hover  { border-color: var(--purple-lt); }

/* ================================================================
   MODALS
   ================================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(43,46,74,.32); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 300; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; animation: fadeIn 180ms ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box { background: var(--surface); border-radius: var(--r-lg); padding: 28px 26px 24px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(43,46,74,.25); animation: modalIn 300ms var(--ease-out) both; }
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-title    { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; margin-bottom: 6px; }
.modal-subtitle { font-size: 13px; color: var(--t3); line-height: 1.55; margin-bottom: 16px; }
.modal-sub-note { font-size: 12px; color: var(--t3); line-height: 1.5; margin-bottom: 16px; margin-top: -8px; }
.modal-callout  { background: var(--surface3); border: 1px solid var(--border); border-left: 3px solid var(--purple); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 16px; font-size: 12px; color: var(--t2); line-height: 1.65; }
.modal-callout.modal-callout-warn { background: var(--red-lt); border-color: #F5C6C2; border-left-color: var(--red); color: var(--red); }
.modal-callout.modal-callout-warn strong { color: var(--red); }
.modal-callout strong { color: var(--t1); display: block; margin-bottom: 4px; font-size: 13px; }
.modal-callout ul { padding-left: 16px; margin-top: 4px; }
.modal-callout li { margin-bottom: 2px; }
.btn-modal-danger { background: var(--red) !important; }
.btn-modal-danger:hover { background: #9b2c2c !important; }
.modal-input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 14px; font-family: var(--font-body); font-size: 16px; color: var(--t1); outline: none; margin-bottom: 16px; transition: border-color var(--t) ease, box-shadow var(--t) ease; }
.modal-input:focus { border-color: var(--purple-lt); box-shadow: 0 0 0 3px var(--purple-xlt); }
.modal-input::placeholder { color: var(--t4); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Custom modal multi-lang chips */
.custom-modal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; min-height: 0; }
.custom-lang-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 12px; border-radius: 16px; background: var(--amber-lt); border: 1px solid #F5D9A8; color: var(--amber); font-size: 12px; font-weight: 500; }
.custom-lang-chip button { background: none; border: none; cursor: pointer; color: var(--amber); font-size: 11px; line-height: 1; padding: 0 1px; opacity: .7; transition: opacity var(--t) ease; touch-action: manipulation; }
.custom-lang-chip button:hover { opacity: 1; }
.custom-modal-input-row { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.custom-modal-input-row .modal-input { margin-bottom: 0; flex: 1; }
.btn-modal-add { background: var(--surface3); border: 1px solid var(--border); color: var(--purple); border-radius: var(--r-sm); padding: 10px 14px; font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all var(--t) ease; flex-shrink: 0; touch-action: manipulation; }
.btn-modal-add:hover { background: var(--purple-xlt); border-color: var(--purple-lt); }
.btn-modal-cancel  { background: none; border: 1px solid var(--border); color: var(--t2); border-radius: 20px; padding: 9px 18px; font-family: var(--font-body); font-size: 13px; cursor: pointer; transition: all var(--t) ease; touch-action: manipulation; }
.btn-modal-cancel:hover { border-color: var(--border-md); color: var(--t1); }
.btn-modal-clear   { background: none; border: 1px solid var(--border); color: var(--t3); border-radius: 20px; padding: 9px 18px; font-family: var(--font-body); font-size: 13px; cursor: pointer; transition: all var(--t) ease; margin-right: auto; touch-action: manipulation; }
.btn-modal-clear:hover { border-color: var(--red, #c53030); color: var(--red, #c53030); }
.btn-modal-confirm { background: var(--navy); color: #fff; border: none; border-radius: 20px; padding: 9px 20px; font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--t) var(--ease-spring); touch-action: manipulation; }
.btn-modal-confirm:hover { background: var(--purple); }

/* ================================================================
   TOAST
   ================================================================ */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--navy); color: #fff; font-family: var(--font-mono); font-size: 12px; letter-spacing: .03em; padding: 9px 18px; border-radius: 20px; z-index: 900; pointer-events: none; opacity: 0; transition: opacity 200ms ease, transform 200ms var(--ease-spring); white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================================================================
   UTILITIES
   ================================================================ */
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 4px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin 650ms linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ================================================================
   NO TEXT SELECTION ON CARD PREVIEW
   ================================================================ */
.pv-noselect { user-select: none; -webkit-user-select: none; }

/* ================================================================
   SIDEBAR FORMAT PREVIEWS (step 4 only)
   ================================================================ */
.sidebar-fmt-previews { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.sidebar-fmt-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.sidebar-fmt-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface2); color: var(--t3); font-family: var(--font-mono); font-size: 10px; cursor: pointer; transition: all var(--t) ease; touch-action: manipulation; }
.sidebar-fmt-pill:hover  { border-color: var(--purple-lt); color: var(--purple); background: var(--purple-xlt); }
.sidebar-fmt-pill.active { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 500; }
.sidebar-fmt-panel .mockup-hero { max-height: none; }
.sidebar-fmt-panel .mockup-hero img { max-height: none; }
.sidebar-fmt-panel .audio-lang-tabs { margin-bottom: 8px; }
.sidebar-audio-voices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* ================================================================
   FORMAT CARD TOOLTIP — body-level div
   ================================================================ */
.format-card { position: relative; }
.format-grid { overflow: visible; }
.fmt-tooltip {
  position: fixed;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  white-space: normal;
  width: 210px;
  text-align: left;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(43,46,74,.22);
}
.fmt-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--navy);
}

/* ================================================================
   AUDIO SCRIPT TEXT (English TTS preview)
   ================================================================ */
.audio-en-script {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--t3);
  font-style: italic;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

/* ================================================================
   MOBILE SHEET — vertical stack for deliverable images
   ================================================================ */
.sheet-mockup-scroll { display: flex; flex-direction: column; gap: 10px; }
.sheet-mockup-item { width: 100%; }
.sheet-mockup-item img { width: 100%; height: auto; border-radius: var(--r-sm); display: block; border: 1px solid var(--border); object-fit: contain; }