/* ============================================================================
   Elewana / Cheli & Peacock — AI Quote Builder skin
   Clean, light, professional SaaS in the C&P brand: navy context bar,
   crimson primary, amber/green semantics, white cards, tabular numbers.
   Self-contained (load AFTER the Google Fonts link). Used by quote/*.html.
   ========================================================================== */
:root {
  --navy:        #1b2532;
  --navy-2:      #232f3e;
  --navy-line:   #2c3a4c;
  --crimson:     #8c2733;
  --crimson-2:   #76202b;
  --crimson-wash:#f7e9eb;
  --paper:       #eceef0;
  --paper-2:     #f3f4f6;
  --card:        #ffffff;
  --ink:         #1c2430;
  --ink-2:       #46505e;
  --muted:       #707b8a;
  --faint:       #98a2b0;
  --line:        #e3e6ea;
  --line-2:      #eef0f3;
  --amber:       #c2941f;
  --amber-ink:   #8a6a14;
  --amber-bg:    #fcf4dd;
  --amber-line:  #ecdcab;
  --green:       #2f7d4f;
  --green-bg:    #e7f3ea;
  --green-line:  #c5e2cf;
  --font:        "Manrope","Helvetica Neue",system-ui,-apple-system,sans-serif;
  --r:           10px;
  --r-sm:        7px;
  --shadow:      0 1px 2px rgba(20,24,31,.06), 0 1px 1px rgba(20,24,31,.04);
  --shadow-pop:  0 12px 40px rgba(20,24,31,.18);
  --pad:         clamp(16px, 3vw, 34px);
}
* { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body.qb {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 96px;            /* room for sticky action bar */
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---- top tools bar (light) ------------------------------------------------ */
.tools-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: 56px; padding: 0 var(--pad);
  background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.tools-bar__brand { display: flex; align-items: center; gap: 10px; }
.tools-bar__logo { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.tools-bar__title { font-weight: 700; letter-spacing: -.01em; }
.tools-bar__title small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.tools-bar__menu { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.tools-bar__menu a { padding: 7px 11px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.tools-bar__menu a:hover { background: var(--paper-2); color: var(--ink); }
.tools-bar__menu a.is-active { color: var(--crimson); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }

/* ---- navy context / breadcrumb bar --------------------------------------- */
.context-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 13px var(--pad); background: var(--navy); color: #cfd6df;
}
.crumbs { display: flex; align-items: center; gap: 9px; font-size: 13px; min-width: 0; }
.crumbs a, .crumbs span { color: #aeb8c4; white-space: nowrap; }
.crumbs a:hover { color: #fff; }
.crumbs .sep { color: #5b6675; }
.crumbs .is-active { color: #fff; font-weight: 600; }
.role-toggle { margin-left: auto; display: inline-flex; background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: 8px; padding: 3px; }
.role-toggle__btn { padding: 6px 14px; border-radius: 6px; border: 0; background: transparent; color: #aeb8c4; font-weight: 600; font-size: 13px; cursor: pointer; }
.role-toggle__btn.is-active { background: var(--crimson); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; }
.who__name { font-size: 13px; color: #fff; font-weight: 600; line-height: 1.15; text-align: right; }
.who__role { font-size: 11px; color: #8a95a3; }

/* ---- layout --------------------------------------------------------------- */
.qmain { max-width: 1240px; margin: 0 auto; padding: var(--pad); }
.qgrid { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.qrail { position: sticky; top: 80px; display: grid; gap: 16px; }
@media (max-width: 940px) { .qgrid { grid-template-columns: 1fr; } .qrail { position: static; } }

/* ---- cards ---------------------------------------------------------------- */
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.qcard__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.qcard__title { font-weight: 700; letter-spacing: -.01em; }
.qcard__body { padding: 18px; }
.qcard__head .spacer, .row .spacer { flex: 1; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
h1.page-title { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.row { display: flex; align-items: center; gap: 12px; }

/* ---- service header (matches the reference) ------------------------------ */
.svc-h__where { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.svc-h__name { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin: 4px 0 6px; }
.svc-h__meta { color: var(--ink-2); }
.svc-h__pax { display: inline-flex; gap: 14px; align-items: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--ink-2); }

/* ---- warning banner (amber) ---------------------------------------------- */
.warn { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: var(--r); color: var(--amber-ink); }
.warn__icon { width: 26px; height: 26px; flex: none; border-radius: 50%; background: rgba(194,148,31,.18); color: var(--amber); display: grid; place-items: center; font-weight: 800; }
.warn b { color: #6f5410; }
.warn__action { margin-left: auto; }

/* ---- fields / selects ----------------------------------------------------- */
.field label { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.select, .input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, textarea:focus { outline: 2px solid var(--crimson); outline-offset: 1px; }

/* ---- guest allocation ----------------------------------------------------- */
.alloc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .alloc { grid-template-columns: 1fr; } }
.alloc-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.alloc-card.is-short { border-color: var(--amber-line); background: var(--amber-bg); }
.alloc-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.alloc-card__label { font-weight: 700; }
.alloc-card__sub { font-size: 12px; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.stepper button { width: 38px; height: 38px; border: 0; background: #fff; font-size: 18px; cursor: pointer; color: var(--ink-2); }
.stepper button:hover { background: var(--paper-2); }
.stepper input { width: 46px; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- ledger rail ---------------------------------------------------------- */
.ledger__tabs { display: inline-flex; background: var(--paper-2); border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.ledger__tab { padding: 7px 16px; border: 0; background: transparent; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.ledger__tab.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.ledger__total-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ledger__total { font-size: 34px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.ledger__total .cur { font-size: 18px; color: var(--muted); font-weight: 700; vertical-align: .25em; margin-right: 2px; }
.ledger__rows { margin-top: 16px; display: grid; gap: 9px; }
.lrow { display: flex; justify-content: space-between; font-size: 14px; }
.lrow__label { color: var(--ink-2); }
.lrow__val { font-variant-numeric: tabular-nums; font-weight: 600; }
.lrow--total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 750; }
.lrow--total .lrow__val { font-size: 16px; }
.sys-tag { font-size: 11px; color: var(--faint); letter-spacing: .08em; text-transform: uppercase; }

/* ---- pills ---------------------------------------------------------------- */
.margin-pill, .spill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.margin-pill { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-line); }
.margin-pill--warn { background: var(--amber-bg); color: var(--amber-ink); border-color: var(--amber-line); }
.spill--draft { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.spill--ok { background: var(--green-bg); color: var(--green); }
.spill--warn { background: var(--amber-bg); color: var(--amber-ink); }
.spill--dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---- source provenance badges --------------------------------------------- */
.src { font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 5px; text-transform: uppercase; }
.src--a { background: #eaf1ec; color: #3a6b4c; }   /* Elewana Direct  */
.src--b { background: #f5ece4; color: #9a5a34; }   /* Partner / DMC   */
.src--c { background: #f4efe1; color: #897423; }   /* Negotiated      */

/* ---- buttons -------------------------------------------------------------- */
.qbtn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; transition: background .15s, transform .05s; }
.qbtn:active { transform: translateY(1px); }
.qbtn--primary { background: var(--crimson); color: #fff; }
.qbtn--primary:hover { background: var(--crimson-2); }
.qbtn--dark { background: var(--navy); color: #fff; }
.qbtn--dark:hover { background: #121a25; }
.qbtn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.qbtn--ghost:hover { background: var(--paper-2); }
.qbtn--sm { padding: 7px 12px; font-size: 13px; }
.qbtn--block { width: 100%; justify-content: center; }
.lnk { color: var(--crimson); font-weight: 700; cursor: pointer; }

/* ---- sticky action bar ---------------------------------------------------- */
.action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; align-items: center; gap: 18px; padding: 12px var(--pad); background: var(--navy); color: #fff; border-top: 1px solid var(--navy-line); }
.action-bar__total { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.action-bar__total small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #8a95a3; }
.action-bar__warn { display: flex; align-items: center; gap: 8px; padding: 7px 13px; background: rgba(194,148,31,.16); border: 1px solid rgba(194,148,31,.4); color: #f0d999; border-radius: 8px; font-size: 13px; font-weight: 600; }
.action-bar .spacer { flex: 1; }

/* ---- PACKAGE: component rows ---------------------------------------------- */
.pkg-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.view-toggle { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.view-toggle__btn { padding: 8px 16px; border: 0; background: transparent; border-radius: 6px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.view-toggle__btn.is-active { background: var(--navy); color: #fff; }
.components { display: grid; gap: 10px; }
.component { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .05s; }
.component:hover { border-color: #cfd6df; box-shadow: var(--shadow); }
.component:active { transform: translateY(1px); }
.component.is-flagged { border-color: var(--amber-line); }
.component__media { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--paper-2); }
.component__icon { width: 56px; height: 56px; border-radius: 8px; background: var(--paper-2); display: grid; place-items: center; color: var(--muted); }
.component__name { font-weight: 700; letter-spacing: -.01em; }
.component__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); }
.component__value { text-align: right; }
.component__sell { font-weight: 750; font-size: 16px; font-variant-numeric: tabular-nums; }
.component__sub { font-size: 11px; color: var(--muted); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.chev { color: var(--faint); }
.internal-only { } /* toggled off in trade view via body.trade */
body.trade .internal-only { display: none !important; }

/* ---- assistant panel ------------------------------------------------------ */
.assistant { display: flex; flex-direction: column; min-height: 320px; }
.assistant__log { display: grid; gap: 10px; padding: 16px; overflow-y: auto; flex: 1; }
.amsg { max-width: 90%; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.amsg--ai { background: var(--paper-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.amsg--user { background: var(--navy); color: #fff; justify-self: end; border-bottom-right-radius: 4px; }
.amsg--note { font-size: 12px; color: var(--green); background: var(--green-bg); border: 1px solid var(--green-line); }
.assistant__chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 12px; }
.chip-btn { font-size: 12px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); cursor: pointer; }
.chip-btn:hover { border-color: var(--crimson); color: var(--crimson); }
.assistant__form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.assistant__form .input { flex: 1; }
.thinking { display: inline-flex; gap: 4px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: tk 1s infinite; }
.thinking i:nth-child(2){ animation-delay: .15s } .thinking i:nth-child(3){ animation-delay: .3s }
@keyframes tk { 0%,80%,100%{opacity:.25;transform:translateY(0)} 40%{opacity:1;transform:translateY(-3px)} }

/* ---- modal ---------------------------------------------------------------- */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(20,28,40,.55); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.is-open { display: flex; }
.modal { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: #fff; border-radius: 14px; box-shadow: var(--shadow-pop); }
.modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.modal__x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; background: none; border: 0; }
.modal__body { padding: 20px; display: grid; gap: 16px; }
.modal__foot { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line-2); }

/* ---- partner: variant request + alternatives ------------------------------ */
.alt-card { border: 1px solid var(--line); border-left: 3px solid var(--crimson); border-radius: var(--r); padding: 14px; background: #fff; }
.alt-card__name { font-weight: 750; }
.alt-card__delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.alt-card__delta.is-down { color: var(--green); } .alt-card__delta.is-up { color: var(--crimson); }
.divider { height: 1px; background: var(--line-2); margin: 4px 0; }

/* ---- editorial hero for trade view ---------------------------------------- */
.trade-hero { position: relative; border-radius: 14px; overflow: hidden; min-height: 240px; display: flex; align-items: flex-end; color: #fff; }
.trade-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.trade-hero__scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15,22,32,.85), rgba(15,22,32,.1)); }
.trade-hero__inner { position: relative; padding: 26px; }

.stagger > * { opacity: 0; transform: translateY(8px); animation: rise .5s cubic-bezier(.16,1,.3,1) forwards; }
.stagger > *:nth-child(1){animation-delay:.04s}.stagger > *:nth-child(2){animation-delay:.1s}
.stagger > *:nth-child(3){animation-delay:.16s}.stagger > *:nth-child(4){animation-delay:.22s}
.stagger > *:nth-child(5){animation-delay:.28s}.stagger > *:nth-child(6){animation-delay:.34s}
.stagger > *:nth-child(7){animation-delay:.4s}.stagger > *:nth-child(8){animation-delay:.46s}
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce){ .stagger>*{animation:none;opacity:1;transform:none} }

/* ---- AI assistant dock — right side bar, collapsible ----------------------- */
body.qb { --dock-w: 384px; padding-right: var(--dock-w); transition: padding-right .22s ease; }
body.qb.dock-collapsed { --dock-w: 54px; }
body.qb.trade { --dock-w: 0px; }
.ai-dock { position: fixed; top: 0; right: 0; bottom: 0; width: var(--dock-w); z-index: 55;
  background: #fff; border-left: 1px solid var(--line); box-shadow: -10px 0 34px rgba(20,28,40,.10);
  display: flex; flex-direction: column; overflow: hidden; transition: width .22s ease; }
.ai-dock__head { display: flex; align-items: center; gap: 9px; height: 56px; flex: none; padding: 0 12px 0 16px; background: var(--navy); color: #fff; }
.ai-dock__spark { width: 20px; height: 20px; flex: none; color: #e7c98a; }
.ai-dock__title { font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.ai-dock__rail { display: none; writing-mode: vertical-rl; transform: rotate(180deg); color: #fff; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; }
.ai-dock__toggle { margin-left: auto; flex: none; width: 30px; height: 30px; border: 0; border-radius: 7px; background: rgba(255,255,255,.14); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.ai-dock__toggle:hover { background: rgba(255,255,255,.26); }
.ai-dock__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ai-dock .assistant__log { flex: 1; min-height: 0; }
.ai-dock .assistant__chips { border-top: 1px solid var(--line-2); padding-top: 12px; }
body.qb.dock-collapsed .ai-dock__body, body.qb.dock-collapsed .ai-dock__title, body.qb.dock-collapsed .ai-dock #mode-dot { display: none; }
body.qb.dock-collapsed .ai-dock__head { flex-direction: column; height: 100%; padding: 16px 0; gap: 16px; justify-content: flex-start; cursor: pointer; }
body.qb.dock-collapsed .ai-dock__toggle { margin: 0; }
body.qb.dock-collapsed .ai-dock__rail { display: block; }
.action-bar { right: var(--dock-w); transition: right .22s ease; }
@media (max-width: 1000px) { body.qb { --dock-w: 0 !important; } .ai-dock { display: none; } .action-bar { right: 0 !important; } }
