:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f0f2f5; --ink: #0e1726; --muted: #5d6b7e; --faint: #94a0b1;
  --line: #e3e7ec; --accent: #0a6cc2; --accent-ink: #ffffff; --accent-soft: #e6f1fb; --gold: #b7860b; --gold-soft: #fbf4e0;
  --ok: #138a5b; --ok-soft: #e4f5ee; --bad: #c2362f; --bad-soft: #fcebea;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(14,23,38,.04), 0 8px 24px -12px rgba(14,23,38,.12);
  --ease: cubic-bezier(.2,.8,.2,1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1118; --surface: #131a23; --surface-2: #1a232e; --ink: #e8edf3; --muted: #9aa7b8; --faint: #637083;
    --line: #243040; --accent: #4ea3ec; --accent-ink: #06121f; --accent-soft: #13283d; --gold: #e0b43c; --gold-soft: #2b2412;
    --ok: #3cc28b; --ok-soft: #10291f; --bad: #f07b72; --bad-soft: #2e1615;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; }
.mark svg { width: 18px; height: 18px; }
.brand b { font-weight: 650; letter-spacing: -.01em; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav button { border: 0; background: none; padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 550; transition: background .2s, color .2s; }
.nav button:hover { color: var(--ink); background: var(--surface-2); }
.nav button[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.langs { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.langs button { border: 0; background: none; padding: 5px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: all .2s var(--ease); }
.langs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

main.wrap { padding-top: 36px; padding-bottom: 64px; }
.view { animation: rise .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h1 { font-size: 28px; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 6px; font-weight: 680; }
h2 { font-size: 17px; letter-spacing: -.01em; margin: 0 0 14px; font-weight: 640; }
.sub { color: var(--muted); margin: 0 0 24px; max-width: 60ch; }

/* cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.grid-book { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.aside { position: sticky; top: 84px; }
.section + .section { margin-top: 26px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.label .hint { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--faint); }

/* stepper */
.steps { display: flex; gap: 6px; margin-bottom: 20px; counter-reset: s; }
.steps li { list-style: none; flex: 1; font-size: 13px; font-weight: 600; color: var(--faint); padding-top: 10px; border-top: 3px solid var(--line); transition: color .3s, border-color .3s; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li::before { counter-increment: s; content: counter(s) "  "; font-variant-numeric: tabular-nums; }
.steps li.done { color: var(--muted); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.steps li.on { color: var(--ink); border-color: var(--accent); }
.steps { padding: 0; }

/* choice tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tile { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; transition: border-color .2s, background .2s, transform .2s var(--ease); position: relative; }
.tile:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tile:active { transform: scale(.985); }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.tile b { display: block; font-weight: 600; }
.tile small { color: var(--muted); font-size: 12.5px; }
.tile .price { float: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.tile.gold[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.tiles.two { grid-template-columns: 1fr 1fr; }

.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 550; color: var(--muted); transition: all .2s var(--ease); font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* calendar */
.days { display: grid; grid-template-columns: auto repeat(7, minmax(0, 1fr)) auto; gap: 6px; align-items: stretch; }
.days .nav-btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); width: 34px; display: grid; place-items: center; color: var(--muted); }
.days .nav-btn:disabled { opacity: .35; cursor: default; }
.day { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 8px 4px; text-align: center; transition: all .2s var(--ease); min-width: 0; }
.day span { display: block; font-size: 11.5px; color: var(--muted); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day b { display: block; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.3; }
.day small { display: block; font-size: 11px; color: var(--ok); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day.none small { color: var(--faint); }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.day[aria-pressed="true"] span, .day[aria-pressed="true"] small { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.hours { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.hour { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 6px; text-align: center; transition: all .18s var(--ease); font-variant-numeric: tabular-nums; animation: rise .35s var(--ease) both; }
.hour b { display: block; font-weight: 600; font-size: 14px; }
.hour small { display: block; font-size: 11px; color: var(--muted); }
.hour .bar { height: 3px; border-radius: 3px; background: var(--surface-2); margin-top: 5px; overflow: hidden; }
.hour .bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width .4s var(--ease); }
.hour.low .bar i { background: var(--gold); }
.hour:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.hour:disabled { cursor: not-allowed; opacity: .42; background: transparent; }
.hour:disabled .bar { visibility: hidden; }
.hour[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hour[aria-pressed="true"] small { color: inherit; opacity: .85; }
.hour[aria-pressed="true"] .bar { background: rgba(255,255,255,.3); }
.hour[aria-pressed="true"] .bar i { background: var(--accent-ink); }
.tz { font-size: 12px; color: var(--faint); margin-top: 10px; }
.free-hero { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.free-hero .big { font-size: 22px; font-weight: 650; letter-spacing: -.02em; text-transform: capitalize; }
.free-hero small { color: var(--muted); }

/* forms */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; font-weight: 550; }
.field label em { font-style: normal; color: var(--faint); font-weight: 450; }
.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .2s, box-shadow .2s; min-width: 0; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; text-transform: uppercase; letter-spacing: .04em; }
.field.bad .input { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: 12.5px; min-height: 0; }
.field .help { color: var(--faint); font-size: 12.5px; }
.phone { display: flex; gap: 6px; }
.phone select { width: 104px; flex: none; }
.driver { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; animation: rise .35s var(--ease); }
.driver:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 4px 0; }
.note { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-top: 18px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* buttons */
.actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 26px; align-items: center; }
.btn { border: 1px solid transparent; border-radius: var(--radius-sm); padding: 11px 18px; font-weight: 600; background: var(--accent); color: var(--accent-ink); transition: transform .15s var(--ease), filter .2s, opacity .2s; display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 7px 12px; font-size: 13.5px; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; background: var(--bad-soft); color: var(--bad); margin-top: 16px; animation: rise .3s var(--ease); }

/* summary */
.sum { padding: 20px; }
.sum dl { margin: 0; display: grid; gap: 12px; }
.sum dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.sum dd { margin: 2px 0 0; font-weight: 550; overflow-wrap: anywhere; }
.sum dd.empty { color: var(--faint); font-weight: 450; }
.sum .total { border-top: 1px dashed var(--line); padding-top: 12px; display: flex; justify-content: space-between; font-weight: 650; font-variant-numeric: tabular-nums; }
.review dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; }
.review dt { color: var(--muted); }
.review dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }

/* success */
.done { text-align: center; padding: 40px 24px; }
.done svg.ok { width: 64px; height: 64px; }
.done svg.ok circle { stroke: var(--ok); stroke-dasharray: 166; stroke-dashoffset: 166; animation: draw .6s var(--ease) forwards; }
.done svg.ok path { stroke: var(--ok); stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .4s .45s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.code { font: 650 30px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; margin: 8px 0 4px; }
.done .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.ticket { text-align: left; max-width: 520px; margin: 22px auto 0; }

/* booking card (AI + lookup) */
.bk { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--surface); }
.bk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.bk-code { font: 650 16px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.pill.cancelled { background: var(--bad-soft); color: var(--bad); }
.pill.demo { background: var(--surface-2); color: var(--muted); }
.bk-line { color: var(--muted); font-size: 14px; }
.bk-line b { color: var(--ink); font-weight: 600; }

/* chat */
.chat { display: flex; flex-direction: column; height: min(72vh, 720px); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head .input { width: auto; padding: 6px 10px; font-size: 13.5px; }
.log { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; animation: rise .3s var(--ease); overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 5px; }
.msg.assistant ul { margin: 6px 0; padding-left: 18px; }
.msg.assistant p { margin: 0 0 6px; } .msg.assistant p:last-child { margin: 0; }
.msg.bkmsg { background: none; padding: 0; width: min(420px, 100%); }
.dots { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.empty-chat { margin: auto; text-align: center; max-width: 440px; color: var(--muted); }
.empty-chat .orb { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 14px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--gold))); display: grid; place-items: center; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 13px; font-size: 13.5px; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { resize: none; max-height: 140px; min-height: 44px; }

.narrow { max-width: 560px; }
footer { color: var(--faint); font-size: 12.5px; padding: 24px 0 40px; border-top: 1px solid var(--line); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; animation: rise .3s var(--ease); }

@media (max-width: 900px) {
  .grid-book { grid-template-columns: 1fr; }
  .aside { position: static; order: -1; }
  .aside .sum { padding: 14px 16px; }
  .aside .sum dl { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .aside .sum .total { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; row-gap: 8px; }
  .nav { order: 3; width: 100%; margin: 0; }
  .nav button { flex: 1; padding: 7px 4px; font-size: 13.5px; }
  .langs { margin-left: auto; }
  .brand small { display: none; }
  h1 { font-size: 23px; }
  .pad { padding: 16px; }
  .steps li { font-size: 0; } .steps li::before { font-size: 13px; }
  .steps li.on { font-size: 13px; flex: 3; }
  .fields { grid-template-columns: 1fr; }
  .tiles.two { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; } .tile { padding: 10px 12px; }
  .days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .days .nav-btn { display: none; }
  .day b { font-size: 15px; } .day small { display: none; }
  .hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .review dl { grid-template-columns: 1fr; gap: 2px; } .review dd { margin-bottom: 8px; }
  .msg { max-width: 90%; }
  .chat { height: calc(100dvh - 210px); }
  .weeknav { display: flex !important; }
}
.weeknav { display: none; justify-content: space-between; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .top, .nav, footer, .row, .aside { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }

/* Qoldau handoff */
.handoff { margin-top: 20px; }
.handoff .btn { margin-bottom: 4px; }
.qsteps { list-style: none; padding: 0; margin: 20px 0 0; }
.qsteps li { border-top: 1px solid var(--line); padding: 14px 0; }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.qhead b { font-weight: 600; }
.qnote { font-size: 13px; color: var(--muted); line-height: 1.5; }
.qfields { display: flex; flex-wrap: wrap; gap: 10px; }
.qfield { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qlabel { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.copychip { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 7px 11px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; color: var(--ink); transition: border-color .2s, color .2s; max-width: 100%; }
.copychip:hover { border-color: var(--accent); color: var(--accent); }
.copychip .ci { color: var(--faint); font-size: 13px; flex: none; }
.copychip:hover .ci { color: var(--accent); }
.qofficial { font-size: 12px; color: var(--faint); margin: 16px 0 0; line-height: 1.55; border-top: 1px dashed var(--line); padding-top: 14px; }

/* Qoldau live load strip */
.qload { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); animation: rise .35s var(--ease); }
.qload-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.qload-title { font-size: 12.5px; font-weight: 650; }
.qload-asof { font-size: 11.5px; color: var(--faint); }
.qload-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.qcell { border-radius: 6px; padding: 5px 2px; text-align: center; background: color-mix(in oklab, var(--c) 16%, var(--surface)); border: 1px solid color-mix(in oklab, var(--c) 40%, transparent); cursor: default; min-width: 0; }
.qcell b { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.qcell i { display: block; font-style: normal; font-size: 12px; font-weight: 650; color: var(--c); font-variant-numeric: tabular-nums; line-height: 1.3; }
.qload-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 11.5px; color: var(--muted); gap: 10px; }
.qlegend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: 0; }
.qload-foot a { color: var(--accent); font-weight: 600; }
.qload-note { font-size: 11.5px; color: var(--faint); margin-top: 8px; line-height: 1.5; }
@media (max-width: 640px) { .qload-strip { grid-auto-flow: row; grid-template-columns: repeat(7, 1fr); } }

.pick-day { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 0 8px; text-transform: capitalize; }
.qcell em { display: block; font-style: normal; font-size: 9px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; }

.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); font-weight: 500; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
