/* AQskill web chat - visitor pages (landing + chat). Tokens from aqskill-chat-designs. */
:root {
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --surface-2: #F1EEE7;
  --ink: #111111;
  --ink-2: #44413C;
  --ink-3: #55524E;
  --ink-4: #5F5B55;
  --line: #E8E4DC;
  --line-2: #DDD8CC;
  --yellow: #FFC914;
  --yellow-2: #F5B800;
  --yellow-soft: #FFF3C4;
  --yellow-ink: #5C4300;
  --orange: #F2683C;
  --link: #C2410C;
  --green: #2F9E44;
  --green-ink: #2F6B3A;
  --amber-soft: #FFF1DF;
  --amber-ink: #8A4300;
  --blue-soft: #E6ECFB;
  --blue-ink: #2447A8;
  --plum-soft: #F4E4F1;
  --plum-ink: #7A2A6C;
  --red-ink: #9B2118;
  --dark: #0A0A0A;
  --radius: 16px;
  --shadow: 0 10px 32px rgba(16, 32, 30, 0.07);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
a:hover { color: var(--yellow-ink); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 2px; border-radius: 6px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.brand svg, .brand img { flex: none; display: block; }
.brand img { height: 30px; width: auto; }
.chat-side .brand img { height: 26px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 20px; min-height: 44px; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { color: #fff; background: #2a2a2a; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { color: var(--ink); background: var(--yellow-2); }
.btn-outline { background: var(--surface); color: var(--ink); border: 1.5px solid #D2CDC0; }
.btn-outline:hover { color: var(--ink); border-color: var(--ink-4); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.chip { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 40px; }
.chip:hover { border-color: var(--yellow-2); background: var(--yellow-soft); color: var(--ink); }

/* ---------- landing ---------- */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 48px; max-width: 1344px; margin: 0 auto; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; font-size: 15px; font-weight: 600; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--link); }

.hero { display: flex; flex-wrap: wrap; gap: 56px; padding: 40px 48px 32px; max-width: 1344px; margin: 0 auto; align-items: flex-start; }
.hero-main { flex: 1 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero-copy { display: flex; flex-direction: column; gap: 18px; }
.pill { align-self: flex-start; background: var(--yellow-soft); color: var(--yellow-ink); font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.hero h1 { margin: 0; font-size: clamp(36px, 5vw, 54px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 800; }
.hero h1 span { color: var(--orange); }
.hero-lede { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-3); max-width: 520px; }

.ask-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.composer-row { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--yellow-2); border-radius: 16px; padding: 6px 6px 6px 18px; background: var(--surface); }
.composer-row input, .composer-row textarea { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px; background: transparent; color: var(--ink); min-height: 44px; }
.composer-row textarea { resize: none; padding: 11px 0; max-height: 160px; line-height: 1.45; }
.icon-btn { width: 48px; height: 48px; border-radius: 12px; border: 0; background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--yellow-2); }
.icon-btn.ghost { background: transparent; color: var(--ink-2); }
.icon-btn.ghost:hover { background: var(--surface-2); }
.icon-btn.recording { background: #FCE8E6; color: var(--red-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fineprint { margin: 0; font-size: 13px; color: var(--ink-4); line-height: 1.5; }

.topics { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.topics h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.08em; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.topic { text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; text-align: left; }
.topic:hover { border-color: var(--yellow-2); color: var(--ink); box-shadow: var(--shadow); }
.topic strong { font-size: 17px; }
.topic span.desc { font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.topic-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }

.wa-banner { padding: 0 48px 40px; max-width: 1344px; margin: 0 auto; }
.wa-banner > div { background: var(--dark); color: #F5F5F5; border-radius: 22px; padding: 24px 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.wa-banner strong { font-size: 18px; }
.wa-banner span { font-size: 15px; color: #D4D4D4; }
.wa-banner a { color: #fff; text-decoration: none; font-weight: 700; border: 1.5px solid #8A8A8A; padding: 12px 20px; border-radius: 12px; }
.wa-banner a:hover { border-color: #fff; color: #fff; }

.site-footer { padding: 20px 48px; max-width: 1344px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font-size: 13px; color: var(--ink-4); }
.site-footer a { color: var(--ink-4); }

/* ---------- chat ---------- */
.chat-page { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.chat-side { flex: 0 0 288px; background: var(--surface); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.chat-side .brand { font-size: 20px; padding: 0 8px; }
.side-label { font-size: 12px; font-weight: 700; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.08em; padding: 0 8px 4px; }
.recent { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 60px; }
.recent button { text-align: left; border: 0; background: transparent; font-size: 14px; font-weight: 500; padding: 10px 12px; border-radius: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--ink); }
.recent button:hover { background: var(--bg); }
.recent button[aria-current="true"] { background: var(--surface-2); font-weight: 700; }
.recent .empty { font-size: 13px; color: var(--ink-4); padding: 4px 12px; }
.save-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.save-card strong { font-size: 14px; }
.save-card p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.save-card button { text-align: center; font-weight: 700; font-size: 14px; color: var(--link); border: 1.5px solid var(--yellow-2); border-radius: 10px; padding: 10px; background: var(--surface); cursor: pointer; }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 32px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-top .who { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 14px; }
.avatar.agent { background: var(--blue-soft); color: var(--blue-ink); }
.status-line { font-size: 13px; color: var(--green-ink); display: flex; align-items: center; gap: 6px; }
.status-line i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.menu-btn { display: none; }

.thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.thread-inner { max-width: 860px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.welcome { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding-top: 8vh; }
.welcome h1 { margin: 0; font-size: clamp(26px, 3.5vw, 34px); letter-spacing: -0.02em; }
.welcome p { margin: 0; color: var(--ink-3); max-width: 560px; }

.msg-user { align-self: flex-end; max-width: 75%; background: var(--ink); color: #fff; border-radius: 18px 18px 4px 18px; padding: 14px 18px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg-user .tag { display: block; font-size: 12px; opacity: 0.7; margin-bottom: 4px; }
.msg-user img { display: block; max-width: 260px; max-height: 260px; border-radius: 10px; margin-bottom: 8px; }
.msg-bot { display: flex; gap: 12px; align-items: flex-start; }
.msg-bot .stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1; }
.bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; padding: 14px 20px; font-size: 16px; line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere; align-self: flex-start; max-width: 100%; }
.bubble p { margin: 0 0 10px; }
.bubble p:last-child, .bubble ul:last-child { margin-bottom: 0; }
.bubble ul { margin: 0 0 10px; padding-left: 20px; }
.bubble li { margin: 2px 0; }
.bubble .who { display: block; font-size: 12px; font-weight: 700; color: var(--blue-ink); margin-bottom: 4px; }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow-2); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { background: #F7CF5C; animation-delay: 0.15s; }
.typing span:nth-child(3) { background: #F3DC8A; animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } .thread { scroll-behavior: auto; } }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card:first-child { border-color: var(--yellow-2); }
.card .tag { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--yellow-soft); color: var(--yellow-ink); }
.card .tag.bundle { background: var(--blue-soft); color: var(--blue-ink); }
.card strong { font-size: 15px; line-height: 1.3; }
.card .meta { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.card a { margin-top: auto; text-align: center; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--ink); background: var(--yellow); border-radius: 10px; padding: 10px; }
.card a:hover { background: var(--yellow-2); color: var(--ink); }

.msg-tools { display: flex; align-items: center; gap: 8px; }
.msg-tools button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.msg-tools button[aria-pressed="true"] { background: var(--yellow-soft); border-color: var(--yellow-2); color: var(--yellow-ink); }

.handoff-banner { align-self: stretch; background: var(--amber-soft); color: var(--amber-ink); border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 1.5; }
.handoff-banner strong { display: block; margin-bottom: 2px; }
.handoff-banner a { color: var(--amber-ink); font-weight: 700; }
/* Slim "waiting for the support team" strip above the message box. */
.queue-strip { display: flex; align-items: center; gap: 8px; background: var(--amber-soft); color: var(--amber-ink); border-radius: 999px; padding: 6px 6px 6px 14px; font-size: 13px; line-height: 1.35; }
.queue-strip .queue-text { flex: 1; min-width: 0; }
.queue-strip a { color: var(--amber-ink); font-weight: 700; white-space: nowrap; }
.queue-strip button { flex: none; border: 1px solid #E9C79A; background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; border-radius: 999px; padding: 6px 12px; min-height: 32px; cursor: pointer; white-space: nowrap; }
.queue-strip button:hover { border-color: var(--amber-ink); }
.queue-dot { width: 8px; height: 8px; border-radius: 50%; background: #D9822B; flex: none; animation: blink 1.6s infinite ease-in-out; }
@media (prefers-reduced-motion: reduce) { .queue-dot { animation: none; } }
/* "Get a notification when we reply" card, offered once after Max's first answer. */
.notify-card { align-self: stretch; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; background: var(--surface); border: 1.5px solid var(--yellow-2); border-radius: 16px; padding: 14px 16px; }
.notify-card-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--yellow-soft); color: var(--yellow-ink); display: flex; align-items: center; justify-content: center; flex: none; }
.notify-card-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--ink-3); line-height: 1.45; }
.notify-card-text strong { color: var(--ink); font-size: 15px; }
.notify-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notify-card-actions .btn { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn-notify { color: var(--amber-ink); border-color: #E9C79A; }
.btn-notify:hover { color: var(--amber-ink); border-color: var(--amber-ink); }
.chat-top > .btn + .btn { margin-left: 8px; }
#tip-text p { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.btn-end { color: var(--red-ink); border-color: #E7B4AF; }
.btn-end:hover { color: var(--red-ink); border-color: var(--red-ink); }
.queue-note { align-self: center; background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; text-align: center; }
.error-note { align-self: center; background: #FCE8E6; color: var(--red-ink); font-size: 14px; padding: 8px 14px; border-radius: 999px; }

.composer { max-width: 860px; width: 100%; margin: 0 auto; padding: 12px 32px 20px; display: flex; flex-direction: column; gap: 10px; }
.composer .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.composer .chips::-webkit-scrollbar { display: none; }
.composer .chip { flex: none; background: var(--surface); }
.composer .fineprint { text-align: center; font-size: 12px; }
.attach-preview { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); }
.attach-preview img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; color: #fff; background: rgba(255,255,255,0.12); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; text-decoration: none; font-weight: 600; font-size: 14px; word-break: break-all; }
.file-chip:hover { color: #fff; background: rgba(255,255,255,0.2); }
.attach-preview button { border: 0; background: transparent; color: var(--link); font-weight: 700; cursor: pointer; }

dialog { border: 0; border-radius: 18px; padding: 0; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
dialog::backdrop { background: rgba(10, 10, 10, 0.45); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dialog-body h2 { margin: 0; font-size: 20px; }
.dialog-body p { margin: 0; color: var(--ink-3); font-size: 14px; }
.dialog-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.dialog-body input { font: inherit; font-size: 15px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; min-height: 44px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.form-error { color: var(--red-ink); font-size: 14px; }

@media (max-width: 900px) {
  .site-header, .hero, .wa-banner, .site-footer { padding-left: 16px; padding-right: 16px; }
  .hero { gap: 32px; padding-top: 16px; }
  .site-nav { gap: 16px; }
  .topic-grid { grid-template-columns: 1fr; }
  .chat-side { position: fixed; inset: 0 auto 0 0; width: 288px; z-index: 30; transform: translateX(-100%); transition: transform 0.2s ease; }
  .chat-side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
  .side-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 25; }
  .menu-btn { display: flex; }
  .chat-top { padding: 10px 12px; }
  .thread-inner { padding: 16px 14px; gap: 16px; }
  .composer { padding: 10px 14px 14px; }
  .msg-user { max-width: 85%; padding: 12px 14px; font-size: 15px; }
  .bubble { padding: 12px 14px; font-size: 15px; }
  .cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 236px; overflow-x: auto; padding-bottom: 4px; }
  .top-support-label { display: none; }
  .notify-label { display: none; }
  .chat-top .btn { padding: 8px 12px; min-height: 40px; font-size: 14px; white-space: nowrap; flex: none; }
  .chat-top .who { flex: 1; }
  .chat-top .who > div { overflow: hidden; }
  .status-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .status-line i { vertical-align: middle; margin-right: 4px; }
  .queue-strip { border-radius: 14px; }
}
@media (min-width: 901px) { .side-scrim { display: none; } }
