/* Soldek.ai — customer AI insurer app. White, chat-first, ChatGPT-like.
   Tenant accent arrives via --accent (set from branding by app.js); every tint is
   derived with color-mix so white-labelling recolors the whole surface. */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f6f3;
  --text: #0a2540;
  --muted: #5c6b7f;
  --line: #eceae6;
  --line-2: #dcd9d3;
  --accent: #ea580c;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #ffffff);
  --accent-line: color-mix(in srgb, var(--accent) 35%, #ffffff);
  --accent-ring: color-mix(in srgb, var(--accent) 18%, #ffffff);
  --ok: #067647;
  --ok-bg: #e7f6ee;
  --warn: #b54708;
  --warn-bg: #fdf0e6;
  --info: #175cd3;
  --info-bg: #eaf1fd;
  --shadow: 0 1px 2px rgba(10, 37, 64, 0.06);
  --shadow-lg: 0 4px 12px rgba(10, 37, 64, 0.06), 0 16px 40px rgba(10, 37, 64, 0.10);
  --radius: 16px;
  --col: 46rem; /* reading column: log content, hero and cards all align to it */
  --side-w: 260px; /* desktop sidebar width */
  --bubble: #f1efea; /* user bubble: calm warm gray on the white canvas */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: #d92d20; font-size: 0.85rem; min-height: 1.1em; margin-top: 10px; text-align: center; }

/* Filled brandmark: solid accent rounded square with the tenant initial —
   mirrors the favicon (orange rounded square, white S). */
.orb {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700; font-size: 1.3rem;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}
.orb--sm { width: 24px; height: 24px; border-radius: 7px; font-size: 0.72rem; box-shadow: none; }
.orb--side { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: 0.18s;
}
.btn--primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
}
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--text); }

/* ---------------- login ---------------- */
.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 480px at 50% -10%, var(--accent-soft), transparent 65%),
    var(--bg-soft);
}
.login__card {
  width: 100%; max-width: 410px; background: #fff;
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 42px 32px; text-align: center;
  position: relative; overflow: hidden;
}
.login__card .orb { margin-bottom: 22px; }
.login h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 10px; }
.login h1 em { font-style: normal; color: var(--accent); }
.login .muted { line-height: 1.55; margin: 0 0 26px; font-size: 0.95rem; }
.login__perks {
  list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 11px; text-align: left;
}
.login__perks li {
  position: relative; padding-left: 28px; font-size: 0.92rem; color: var(--text);
}
.login__perks li::before {
  content: ""; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--accent);
}
.login__form { display: grid; gap: 12px; }
/* Optional password row: hidden until the server answers 401 password_required. */
.login__pw { display: grid; gap: 8px; }
.login__pw-msg { margin: 0; font-size: 0.85rem; color: var(--muted); text-align: left; }
.login__form input {
  width: 100%; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px;
  font: inherit; background: #fff; color: var(--text);
}
.login__form input::placeholder { color: var(--muted); }
.login__form input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, #fff);
}
.login__foot {
  margin-top: 26px; font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.login__foot .dot, .pill--ai i {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 7px; vertical-align: middle;
}

/* ---------------- app shell ---------------- */
.app { display: flex; flex-direction: column; height: 100dvh; }
.top {
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.top__inner {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  max-width: var(--col); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 700; letter-spacing: -0.01em; font-size: 0.95rem; }
.brand__sub { font-size: 0.7rem; color: var(--muted); }
.pill {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted);
}
.pill--ai { color: var(--muted); border-color: var(--line); background: #fff; }

/* Quiet header identity cluster (customer initial + first name). */
.who { display: inline-flex; align-items: center; gap: 8px; }
.who__disc {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
  font-size: 0.8rem; font-weight: 700;
}
.who__name { font-size: 0.82rem; font-weight: 600; color: var(--muted); }

/* NL/EN language switch: Vicaro-style segmented pill, hairline border,
   active side tinted with the tenant accent on a subtle background. */
.lang {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border: 1px solid var(--line-2); border-radius: 999px;
  background: #fff;
}
.lang__btn {
  border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted); padding: 4px 9px; border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.lang__btn:hover { color: var(--text); }
.lang__btn--active { color: var(--accent); background: var(--accent-soft); }
.lang__btn--active:hover { color: var(--accent); }
.lang__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.lang--login { position: absolute; top: 14px; right: 14px; }

.iconbtn {
  display: flex; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer;
  padding: 6px; border-radius: 8px;
}
.iconbtn:hover { background: var(--bg-soft); }
.iconbtn span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

.menu {
  position: absolute; top: 58px; z-index: 6;
  left: max(12px, calc(50% - var(--col) / 2 + 12px)); width: min(360px, calc(100% - 24px));
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden; padding: 6px;
  animation: menuIn 0.16s ease-out; transform-origin: top left;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
}
.menu__item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer; color: var(--text);
  padding: 10px 12px; border-radius: 8px; font: inherit;
}
.menu__item:hover { background: var(--bg-soft); }
.menu__item strong { font-weight: 600; }
.menu__item span { font-size: 0.78rem; color: var(--muted); }
.menu__item--ghost strong { color: var(--accent); }

/* ---------------- sidebar (desktop shell; display:flex at >=1024px) ---------------- */
.side {
  display: none;
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--side-w);
  flex-direction: column;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  z-index: 4;
  padding: 14px 12px 16px;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.side__brandtxt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.side__name {
  font-size: 0.92rem; font-weight: 700; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side__sub { font-size: 0.68rem; color: var(--muted); }
.side__brand .pill--ai { margin-left: auto; background: #fff; }
.side__nav { display: grid; gap: 2px; margin-top: 4px; }
.side__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 0.88rem; font-weight: 550;
  color: var(--text); text-align: left; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.side__item svg { flex: none; color: var(--muted); }
.side__item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.side__item--active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side__item--active svg { color: var(--accent); }
.side__item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.side__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__foot { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.lang--side { justify-self: start; margin: 4px 0 4px 10px; }
.side__user {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px;
  border-radius: 10px; background: #fff; border: 1px solid var(--line);
}
.side__disc {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
  font-weight: 700; font-size: 0.85rem;
}
.side__usertxt { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side__username {
  font-size: 0.85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side__useremail {
  font-size: 0.72rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------- chat log ---------------- */
/* Full-width scroll container so the scrollbar hugs the viewport edge
   (ChatGPT-style); the content column is centered with the padding formula,
   which keeps it aligned with .top__inner and .composer__inner. */
.log {
  flex: 1; overflow-y: auto;
  padding: 28px max(16px, calc(50% - var(--col) / 2)) 16px;
  display: flex; flex-direction: column; gap: 20px;
  width: 100%;
  scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.log::-webkit-scrollbar { width: 8px; }
.log::-webkit-scrollbar-track { background: transparent; }
.log::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 999px;
  border: 2px solid transparent; background-clip: padding-box;
}
/* overflow:hidden zeroes a flex item's min-height, letting cards collapse once
   the log overflows — never shrink log entries. */
.log > * { flex-shrink: 0; }
.msg { max-width: 100%; line-height: 1.6; font-size: 0.95rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg strong { font-weight: 650; }
/* markdown-lite code: fenced blocks + inline snippets from mdLite() */
.msg .mdcode {
  display: block; margin: 8px 0; padding: 10px 12px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem; line-height: 1.55; color: var(--text);
  white-space: pre; overflow-x: auto;
}
.msg code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}
.msg .mdcode code { border: 0; background: none; padding: 0; }
.airow { display: flex; gap: 12px; align-items: flex-start; align-self: flex-start; max-width: 100%; }
.airow > .msg { min-width: 0; }
.airow, .msg--me { animation: fadeUp 0.18s ease-out both; }
/* AI avatar disc carries the tenant initial — same identity as .orb everywhere. */
.airow .avatar {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--accent-line);
  flex: none; margin-top: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  color: var(--accent); font-size: 0.7rem; font-weight: 700;
  box-shadow: none;
}
.msg--ai {
  background: transparent; color: var(--text);
  padding: 2px 0; border-radius: 0;
}
.msg--ai ul, .msg--ai ol { margin: 6px 0 0; padding-left: 20px; }
.msg--ai li { margin: 2px 0; }
.msg--me {
  align-self: flex-end; max-width: 75%;
  background: var(--bubble); color: var(--text);
  border: 0;
  padding: 11px 16px; border-radius: 18px;
}
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2){ animation-delay: 0.2s; } .typing i:nth-child(3){ animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100%{opacity:.25} 40%{opacity:1} }
.typing__label {
  margin-left: 10px; font-size: 0.82rem; color: var(--muted);
  animation: labelIn 0.25s ease-out both;
}
@keyframes labelIn { from { opacity: 0; } }
.airow--thinking .msg--ai { display: flex; align-items: center; min-height: 28px; }
/* Composing pulse — the initial avatar breathes a soft accent ring. */
.airow--thinking .avatar { animation: avatarRing 1.3s ease-in-out infinite; }
@keyframes avatarRing {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 28%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 10%, transparent); }
}

/* Hover copy affordance on finished AI replies (hidden on touch). */
.msgcopy {
  opacity: 0; width: 28px; height: 28px; flex: none; align-self: flex-start;
  margin-top: 1px; border: 0; border-radius: 6px; background: none;
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
  transition: opacity 0.15s, background 0.15s;
}
.airow:hover .msgcopy, .msgcopy:focus-visible { opacity: 1; }
.msgcopy:hover { background: var(--bg-soft); color: var(--text); }
@media (hover: none) {
  .msgcopy { display: none; }
}

/* ---------------- hero (rich empty state) ---------------- */
.hero { padding: 10px 0 4px; text-align: center; }
/* Vertical centering in the empty state: auto margins on the flex item — never
   justify-content:center on .log (it clips overflow in a scroll container).
   Collapses gracefully to 0 if the hero is ever taller than the viewport. */
.log > .hero:only-child { margin-top: auto; margin-bottom: auto; }
.hero__hi {
  font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em;
  animation: fadeUp 0.3s ease-out both;
}
.hero__sub {
  color: var(--muted); font-size: 0.95rem; line-height: 1.5; margin-top: 5px;
  animation: fadeUp 0.3s ease-out 0.06s both;
}
.starters {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px;
}
.starter {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; /* content stays left-aligned */
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; font: inherit; color: var(--text); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  animation: fadeUp 0.3s ease-out both;
}
.starter:nth-child(1) { animation-delay: 0.10s; }
.starter:nth-child(2) { animation-delay: 0.16s; }
.starter:nth-child(3) { animation-delay: 0.22s; }
.starter:nth-child(4) { animation-delay: 0.28s; }
.starter:hover {
  border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px);
}
.starter:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
.starter__icon {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent);
}
.starter__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.starter__title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.starter__sub { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.trust {
  margin-top: 18px; font-size: 0.72rem; color: var(--muted); line-height: 1.6;
  animation: fadeUp 0.3s ease-out 0.34s both;
}
/* Desktop empty state (1440x900 demo target): larger greeting, airier grid. */
@media (min-width: 900px) {
  .hero__hi { font-size: 2rem; }
  .hero__sub { font-size: 1rem; margin-top: 8px; }
  .starters { gap: 12px; margin-top: 30px; max-width: 41rem; margin-left: auto; margin-right: auto; }
  .starter { padding: 15px 16px; }
  .starter__icon { width: 36px; height: 36px; }
  .trust { margin-top: 26px; }
}

/* ---------------- cards ---------------- */
.card {
  align-self: stretch; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  animation: fadeUp 0.24s both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
}
.airow + .card { margin-top: -8px; }
.card__head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.card__eyebrow {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.card__total { display: flex; align-items: baseline; gap: 8px; }
.card__price {
  font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.card__per { color: var(--muted); font-size: 0.9rem; }
.card__sub { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.card__body { padding: 10px 20px 16px; }

.item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.item__name { font-weight: 600; }
.item__price { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item__why { color: var(--muted); font-size: 0.85rem; margin-top: 3px; }
.drivers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.driver {
  font-size: 0.72rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); background: var(--bg-soft);
}
.driver--up { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, #fff); background: var(--warn-bg); }
.driver--down { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, #fff); background: var(--ok-bg); }

.card__foot { padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfaf8; }
.card__actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.card__foot-meta { margin-left: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.66rem; font-weight: 650; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 6px;
  border: 1px solid transparent;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
.badge--ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 28%, #fff); }
.badge--warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, #fff); }
.badge--info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 28%, #fff); }

.kv {
  display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 550; }

.xai { font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.xai i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* quick replies: quiet grey pills that wrap above the composer */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 10px; }
.chips:empty { padding: 0; } /* keep #chips locatable for the tour, drop dead space */
.chip {
  border: 1px solid var(--line-2); background: #fff; color: var(--text); border-radius: 999px;
  padding: 7px 13px; font: inherit; font-size: 0.82rem; cursor: pointer; transition: 0.15s;
  animation: chipIn 0.18s both;
}
@keyframes chipIn {
  from { opacity: 0; transform: translateY(4px); }
}
.chip:nth-child(2) { animation-delay: 0.03s; }
.chip:nth-child(3) { animation-delay: 0.06s; }
.chip:nth-child(4) { animation-delay: 0.09s; }
.chip:nth-child(5) { animation-delay: 0.12s; }
.chip:hover { background: var(--bg-soft); border-color: var(--line-2); color: var(--text); }

/* ---------------- composer ---------------- */
.composer {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  position: sticky; bottom: 0;
}
.composer__inner {
  max-width: var(--col); margin: 0 auto;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}
/* One ChatGPT-style pill: hairline border, soft shadow, send button inside.
   Focus = low-opacity accent border + soft ring, never a saturated outline. */
.composer__row {
  display: flex; gap: 6px; align-items: center;
  background: #fff; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 5px 5px 5px 10px;
  box-shadow: 0 1px 3px rgba(10, 37, 64, 0.05), 0 4px 16px rgba(10, 37, 64, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer__row:focus-within {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent),
    0 4px 16px rgba(10, 37, 64, 0.04);
}
.composer__row input {
  flex: 1; min-width: 0; padding: 10px 8px; border: 0; border-radius: 999px;
  font: inherit; font-size: 0.95rem; background: none; color: var(--text);
}
.composer__row input::placeholder { color: var(--muted); }
.composer__row input:focus { outline: none; }
.send {
  width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%;
  background: var(--bg-soft); color: var(--muted); display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.composer__row.has-text .send {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.15);
}
.composer__row.has-text .send:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}
.send:active { transform: scale(0.94); }
.send:disabled { opacity: 0.5; cursor: default; }
.composer__hint { font-size: 0.72rem; color: var(--muted); margin-top: 7px; text-align: center; }

/* ---------------- toast ---------------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 10;
  transform: translateX(-50%);
  background: var(--text); color: #fff;
  border-radius: 12px; padding: 12px 16px;
  box-shadow: var(--shadow-lg); font-size: 0.9rem;
  max-width: min(90vw, 420px);
  animation: toastIn 0.2s both;
  transition: opacity 0.2s, transform 0.2s;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
}

/* ---------------- responsive ---------------- */
/* Desktop shell (1440x900 demo target): fixed sidebar owns identity and nav,
   the header disappears, the reading column widens to ~768px and the composer
   floats as an elevated pill over a fade-out — ChatGPT proportions. */
@media (min-width: 1024px) {
  :root { --col: 48rem; }
  /* z-index above the panel (9): the docked panel slides out from underneath
     the sidebar and the sidebar stays interactive while it is open. */
  .side { display: flex; z-index: 10; }
  .app { padding-left: var(--side-w); }
  .top { display: none; }
  #toast { left: calc(50% + var(--side-w) / 2); }
  .log { gap: 28px; padding-top: 40px; padding-bottom: 24px; }
  .msg { font-size: 1rem; line-height: 1.65; }
  .msg--me { max-width: 70%; }
  .composer {
    border-top: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff 28px);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .composer__inner { padding: 10px 24px 18px; }
  .composer__row {
    padding: 7px 7px 7px 14px;
    box-shadow: 0 2px 6px rgba(10, 37, 64, 0.05), 0 12px 32px rgba(10, 37, 64, 0.08);
  }
  .composer__row input { font-size: 1rem; padding: 11px 8px; }
  .send { width: 40px; height: 40px; }
}

@media (max-width: 720px) {
  .airow { max-width: 100%; }
  .msg--me { max-width: 92%; }
  .log { padding: 20px max(12px, calc(50% - var(--col) / 2)) 10px; }
}

@media (max-width: 480px) {
  .card__price { font-size: 1.7rem; }
  .composer__row input { font-size: max(16px, 0.97rem); }
  .starters { grid-template-columns: 1fr; }
  .hero__hi { font-size: 1.25rem; }
  .chips {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; }
  .card__head { padding: 14px 14px 10px; }
  .card__body { padding: 6px 14px 12px; }
  .kv { font-size: 0.85rem; }
  .brand__sub { display: none; }
  .who__name { display: none; }
  .top__inner { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .chip, #toast { animation: none; }
  .lang__btn { transition: none; }
  .airow, .msg--me, .menu { animation: none; }
  .hero__hi, .hero__sub, .starter, .trust, .typing__label { animation: none; }
  .typing i { animation: none; opacity: 0.5; }
  .airow--thinking .avatar { animation: none; }
  .msgcopy { transition: none; }
  #toast { transition: none; }
  .send:active { transform: none; }
  .starter:hover, .composer__row.has-text .send:hover { transform: none; }
}
