:root {
  --ink: #10302e; --muted: #4a6360; --teal: #0f5c57; --teal-d: #0a423e;
  --cream: #f6f0e4; --paper: #fffdf8; --line: #d9d0bd; --coral: #b8452d;
  --out: #d8efcf; --wall: #ece3d0; --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
  background: radial-gradient(1200px 500px at 85% -10%, #dcebe4 0, transparent 60%), var(--cream);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { display: flex; align-items: center; gap: 12px 20px; padding: 10px 20px; flex-wrap: wrap; }
.brandmark { display: flex; align-items: center; gap: 8px; font: 700 1.05rem var(--serif); color: var(--teal); margin-right: auto; }
.tabs { display: flex; gap: 4px; background: #e8dfcb; padding: 4px; border-radius: 999px; }
.tabs button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.tabs button[aria-selected="true"] { background: var(--teal); color: #fff; }
.lang { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.lang button { border: 0; background: transparent; font-weight: 700; padding: 6px 8px; border-radius: 8px; color: var(--muted); }
.lang button[aria-pressed="true"] { color: var(--teal); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.flag { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 20px; padding: 6px 14px; font-size: .85rem; font-weight: 600; text-align: center; color: #5b3a00; background: #fbe9b7; border: 1px solid #e8cf86; border-radius: 999px; align-self: center; max-width: calc(100% - 40px); }
.flag .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #c98a00; }

main { flex: 1; min-height: 0; overflow: auto; }

/* simulator layout */
.sim { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: 1fr 392px 1fr; gap: 36px; align-items: center; max-width: 1240px; margin: 0 auto; padding: 16px 24px 20px; }
.sim[hidden], .how[hidden] { display: none; }
.intro { justify-self: end; max-width: 330px; }
.intro h1 { font: 700 2rem/1.15 var(--serif); margin: 0 0 12px; color: var(--teal-d); text-wrap: balance; }
.intro p { color: var(--muted); margin: 0 0 14px; }
.intro ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.intro li { padding-left: 24px; position: relative; font-weight: 500; }
.intro li::before { content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; border-radius: 4px; background: var(--coral); transform: rotate(45deg) scale(.8); }

.phone { height: min(780px, 100%); width: 392px; padding: 10px; border-radius: 44px; background: #14201f; box-shadow: 0 30px 60px -20px rgba(16, 48, 46, .45), 0 0 0 2px #2c3b3a inset; }
.chat { height: 100%; border-radius: 34px; overflow: hidden; display: flex; flex-direction: column; background: var(--wall); }

.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--teal); color: #fff; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #e9f4ef; color: var(--teal); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who strong { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: .78rem; opacity: .9; }
.icon-btn { margin-left: auto; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; transition: background .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .26); }
.icon-btn:focus-visible { outline-color: #fff; }

.log { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; background-image: radial-gradient(rgba(16, 48, 46, .07) 1px, transparent 1.2px); background-size: 18px 18px; overscroll-behavior: contain; }
.sysnote { align-self: center; font-size: .75rem; font-weight: 600; color: #5b3a00; background: #fbe9b7; padding: 4px 12px; border-radius: 999px; margin-bottom: 4px; text-align: center; }
.msg { max-width: 84%; padding: 8px 12px 6px; border-radius: 14px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); overflow-wrap: anywhere; animation: pop .22s ease-out both; }
.msg.bot { align-self: flex-start; border-top-left-radius: 4px; }
.msg.user { align-self: flex-end; border-top-right-radius: 4px; background: var(--out); }
.msg p { margin: 0; white-space: pre-line; }
.msg .time { display: block; text-align: right; font-size: .68rem; color: var(--muted); margin-top: 2px; }
.msg.user .time::after { content: " ✓✓"; color: #2a7f6b; letter-spacing: -2px; }
.svc-list { list-style: none; margin: 8px 0 2px; padding: 0; display: grid; gap: 6px; }
.svc-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: .92rem; }
.svc-list b { white-space: nowrap; color: var(--teal); }
.svc-list small { display: block; color: var(--muted); }

.card { margin-top: 8px; border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: 10px; padding: 10px 12px; background: var(--paper); min-width: 220px; }
.card h4 { margin: 0 0 6px; font-size: .95rem; color: var(--teal); }
.card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: .88rem; }
.card dt { color: var(--muted); }
.card dd { margin: 0; font-weight: 600; text-align: right; }

.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border-radius: 14px; border-top-left-radius: 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #7d9692; animation: blink 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; max-height: 36%; overflow-y: auto; background: rgba(255, 253, 248, .6); border-top: 1px solid var(--line); }
.chips:empty { display: none; }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--teal); background: #fff; color: var(--teal); font-weight: 600; font-size: .92rem; line-height: 1.2; text-align: left; transition: background .15s, color .15s, transform .12s; }
.chip:hover { background: var(--teal); color: #fff; }
.chip:active { transform: scale(.97); }
.chip:disabled { opacity: .5; cursor: default; }

.composer { display: flex; gap: 8px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: #f3ecdc; }
.composer input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: 16px; }
.composer input:focus { border-color: var(--teal); }
.send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: grid; place-items: center; transition: transform .12s, background .15s; }
.send:hover { background: var(--teal-d); }
.send:active { transform: scale(.94); }

/* business panel */
.panel { justify-self: start; width: 100%; max-width: 330px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px; max-height: 100%; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel h2 { margin: 0; font: 700 1.2rem var(--serif); color: var(--teal-d); }
.count { font-size: .78rem; font-weight: 700; color: var(--teal); background: #dcebe4; padding: 2px 10px; border-radius: 999px; }
.count:empty { display: none; }
.panel .sub { margin: 4px 0 12px; font-size: .85rem; color: var(--muted); }
.bookings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; overflow-y: auto; }
.bookings li { padding: 10px 12px; border-radius: 12px; background: #f3f8f5; border: 1px solid #cfe1d9; animation: pop .25s ease-out both; overflow-wrap: anywhere; }
.bookings li strong { display: block; }
.bookings li span { display: block; font-size: .86rem; color: var(--muted); }
.bookings .badge { display: inline-block; margin-top: 4px; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--teal); color: #fff; }
.bookings .ref { font-size: .75rem; }
.empty { margin: 0; padding: 14px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: .9rem; text-align: center; }

/* how it connects */
.how { max-width: 1180px; margin: 0 auto; padding: 24px; }
.how h2 { font: 700 1.9rem/1.2 var(--serif); margin: 0 0 8px; color: var(--teal-d); }
.lead { color: var(--muted); margin: 0 0 28px; max-width: 62ch; }
.flow { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 34px; max-width: 560px; margin-inline: auto; }
.flow li { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.flow li:not(:last-child)::after { content: "↓"; position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); font-size: 1.4rem; color: var(--coral); font-weight: 700; }
.num { width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.flow h3 { margin: 2px 0 0; font-size: 1.02rem; }
.flow p { margin: 0; font-size: .9rem; color: var(--muted); }
.tag { margin-top: auto; align-self: flex-start; font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #fbe9b7; color: #5b3a00; }
.client-title { font: 700 1.25rem var(--serif); margin: 0 0 10px; color: var(--teal-d); }
.client { margin: 0 0 20px; padding-left: 20px; display: grid; gap: 6px; max-width: 68ch; }
.note { color: var(--muted); font-size: .85rem; margin: 0; }

@media (min-width: 1100px) {
  .flow { grid-template-columns: repeat(6, 1fr); gap: 26px; max-width: none; }
  .flow li:not(:last-child)::after { content: "→"; left: auto; right: -22px; bottom: auto; top: 22px; transform: none; }
}
@media (max-width: 1000px) {
  .intro, .panel { display: none; }
  .sim { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); justify-items: center; padding: 12px; }
}
@media (max-width: 520px) {
  .top { padding: 8px 12px; gap: 6px 10px; }
  .brandmark { font-size: .95rem; }
  .tabs { order: 3; width: 100%; }
  .tabs button { flex: 1; padding: 7px 8px; font-size: .92rem; }
  .flag { margin: 0 12px 6px; font-size: .78rem; padding: 4px 10px; border-radius: 12px; }
  .sim { padding: 0; }
  .phone { width: 100%; height: 100%; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .chat { border-radius: 0; }
  .how { padding: 16px 12px 28px; }
  .how h2 { font-size: 1.5rem; }
}

@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
