/* ArriviGo design system — mobile-first. Ink / warm paper / brass. */
:root {
  --ink: #101418;
  --ink-2: #2a323b;
  --paper: #faf8f4;
  --card: #ffffff;
  --line: #e7e2d8;
  --brass: #c9a557;
  --brass-deep: #a8853d;
  --green: #1fa97c;
  --red: #d5484a;
  --muted: #7a7f87;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16,20,24,.07), 0 8px 24px rgba(16,20,24,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--paper); color: var(--ink);
  line-height: 1.5; font-size: 16px;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1080px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,248,244,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-weight: 800; letter-spacing: .12em; font-size: 17px; display: flex; align-items: center; gap: 7px; }
.logo .tick { color: var(--brass); font-weight: 900; }
.nav-links { display: flex; gap: 14px; align-items: center; font-size: 14px; font-weight: 600; }
.nav-links a.cta { background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; }

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 13px 20px; border-radius: 12px; width: 100%;
}
.btn.brass { background: linear-gradient(135deg, var(--brass), var(--brass-deep)); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn.green { background: var(--green); }
.btn.danger { background: var(--red); }
.btn:active { transform: translateY(1px); }
label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 5px; color: var(--ink-2); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px;
  padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--card); color: var(--ink); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brass); }
textarea { min-height: 92px; resize: vertical; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); font-size: 13.5px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: #eee9df; color: var(--ink-2); }
.pill.gold { background: #f4ead2; color: var(--brass-deep); }
.pill.green { background: #dcf3ea; color: #157a5a; }
.pill.red { background: #fbe2e2; color: #a53434; }
.pill.blue { background: #e3ecf7; color: #2b5d92; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 26px; text-align: left; }
.hero h1 { font-size: clamp(30px, 7.5vw, 46px); line-height: 1.08; letter-spacing: -.02em; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--brass-deep); }
.hero p.lead { margin-top: 12px; font-size: 17px; color: var(--ink-2); max-width: 34ch; }
.hero .btn { margin-top: 20px; }
.promo { margin-top: 26px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--ink); }
.promo video { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* ---------- vertical grid ---------- */
.vgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.vcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; min-height: 108px;
}
.vcard .ic { font-size: 24px; }
.vcard b { font-size: 14px; line-height: 1.25; }
.vcard span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.vcard.lux { border-top: 3px solid var(--brass); }
.vcard.any { grid-column: 1 / -1; border-top: 3px solid var(--ink); background: linear-gradient(180deg, #fff, #fdf9f0); min-height: 0; }
@media (min-width: 760px) { .vgrid { grid-template-columns: repeat(3, 1fr); } .vcard.any { grid-column: 1 / -1; } }

/* ---------- steps ---------- */
.steps { counter-reset: s; margin-top: 8px; }
.steps li { list-style: none; display: flex; gap: 12px; padding: 10px 0; align-items: flex-start; }
.steps li::before {
  counter-increment: s; content: counter(s);
  min-width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
}

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 9px 0 9px 6px; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 15px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--muted);
}
.tl-item.k-outreach_sent::before, .tl-item.k-question::before { border-color: var(--ink); }
.tl-item.k-reply::before { border-color: #2b5d92; }
.tl-item.k-quote::before { border-color: var(--brass); background: var(--brass); }
.tl-item.k-payment::before, .tl-item.k-booked::before, .tl-item.k-completed::before { border-color: var(--green); background: var(--green); }
.tl-item.k-escalation::before { border-color: var(--red); background: var(--red); }
.tl-item .t { font-size: 11.5px; color: var(--muted); }
.tl-item b { font-size: 14.5px; }
.tl-item .body { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; white-space: pre-wrap; }
.tl-item .actor { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tl-item .actor.assistant { color: var(--brass-deep); }
.tl-item .actor.supplier { color: #2b5d92; }
.tl-item .actor.iain { color: var(--red); }
.waiting { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; padding: 10px 0 0 6px; }
.dotpulse { display: inline-flex; gap: 3px; }
.dotpulse i { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); animation: dp 1.2s infinite; }
.dotpulse i:nth-child(2) { animation-delay: .2s; } .dotpulse i:nth-child(3) { animation-delay: .4s; }
@keyframes dp { 0%,60%,100% { opacity: .25 } 30% { opacity: 1 } }

/* ---------- quotes ---------- */
.quote-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--card); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.quote-card.best { border-color: var(--brass); background: #fffdf6; }
.quote-card .price { font-size: 20px; font-weight: 800; }
.quote-card .price small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- stats receipt ---------- */
.receipt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.receipt .cell { background: #f4f1e9; border-radius: 11px; padding: 10px 6px; }
.receipt .cell b { font-size: 19px; display: block; }
.receipt .cell span { font-size: 11px; color: var(--muted); }

/* ---------- tables (admin) ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f6f3ec; }
tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- chat bubbles (admin takeover) ---------- */
.chat { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.bub { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; white-space: pre-wrap; }
.bub.out { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.bub.in { align-self: flex-start; background: #edeae2; border-bottom-left-radius: 4px; }
.bub .en { display: block; font-size: 11px; opacity: .7; margin-top: 4px; border-top: 1px dashed rgba(255,255,255,.25); padding-top: 3px; }
.bub.in .en { border-top-color: rgba(0,0,0,.15); }

/* ---------- misc ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.statgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .statgrid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { font-size: 22px; display: block; }
.stat span { font-size: 12px; color: var(--muted); }
.footer { margin: 48px 0 32px; text-align: center; color: var(--muted); font-size: 12.5px; }
.flash { background: #dcf3ea; color: #157a5a; padding: 10px 14px; border-radius: 11px; font-size: 14px; font-weight: 600; }
.section-t { margin: 26px 0 10px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.price-big { font-size: 34px; font-weight: 800; }
.price-big small { font-size: 14px; color: var(--muted); font-weight: 600; }
details summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 6px 0; }
.admin-nav { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; font-size: 13px; font-weight: 700; }
.admin-nav a { padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.admin-nav a.on { background: var(--ink); color: #fff; }

/* ---------- supplier search (SERP look) ---------- */
.serp-box { position: relative; }
.serp-box input { padding-left: 42px; border-radius: 999px; box-shadow: var(--shadow); border-color: var(--card); }
.serp-box input:focus { border-color: var(--brass); }
.serp-glass { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.serp-result { display: flex; gap: 10px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.serp-check { padding-top: 4px; }
.serp-check input { width: 18px; height: 18px; accent-color: var(--brass-deep); }
.serp-url { font-size: 12px; color: #1a7a4f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { font-size: 18px; color: #1a0dab; font-weight: 500; line-height: 1.25; margin: 1px 0; }
.serp-title:hover { text-decoration: underline; cursor: pointer; }
.serp-snippet { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.serp-stars { color: #e7711b; font-weight: 700; }
.serp-bar {
  position: sticky; bottom: 12px; margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 10px 10px 18px;
  font-size: 14px; font-weight: 700; box-shadow: 0 8px 30px rgba(16,20,24,.35);
}
.serp-bar .btn { width: auto; }

/* ---------- chat widgets (mission chat + helpdesk) ---------- */
.chatbox { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; padding: 4px 0; }
.chatbox .bub.user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.chatbox .bub.assistant { align-self: flex-start; background: #f0ece2; color: var(--ink); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 6px; margin-top: 8px; }
.chat-input input { flex: 1; }
.chat-input .btn { width: auto; }
.help-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--brass), var(--brass-deep)); color: #fff;
  font-size: 24px; box-shadow: 0 8px 24px rgba(16,20,24,.3);
}
.help-panel {
  position: fixed; right: 12px; bottom: 80px; z-index: 91;
  width: min(360px, calc(100vw - 24px));
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 16px 48px rgba(16,20,24,.28); padding: 14px; display: none;
}
.help-panel.open { display: block; }
.typing { font-size: 12px; color: var(--muted); padding: 2px 6px; display: none; }
