/* Enklast – design tokens first, then layout. Mobile first. */
:root {
  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ink: #0a0a0f;
  --ink-2: #3c3f4a;
  --muted: #5d6170;
  --line: #e4e5ea;
  --bg: #ffffff;
  --bg-soft: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --accent: #1c5cff;
  --accent-ink: #ffffff;
  --success: #12805c;
  --danger: #c4283c;
  --warn-bg: #fff4dc;
  --warn-ink: #6b4a00;

  --sky-1: #b9d3fb;
  --sky-2: #d6e6fd;
  --sky-3: #eaf2fe;
  --sky-4: #f8fbff;

  --tile-blue: #dce8ff;
  --tile-sand: #f3ead9;
  --tile-mint: #d9f2e6;
  --tile-lilac: #e8e1f8;
  --tile-peach: #fde3d6;

  --radius-s: 12px;
  --radius-m: 20px;
  --radius-l: 28px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgb(10 10 15 / 6%), 0 6px 24px rgb(10 10 15 / 6%);
  --shadow-2: 0 20px 60px rgb(5 20 60 / 28%);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;

  --dur-fast: 120ms;
  --dur: 220ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.03em; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--radius-pill); z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- pills and buttons ---- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-pill);
  border: 1px solid transparent; font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), border-color var(--dur-fast);
}
.pill:active { opacity: .82; }
.pill-dark { background: var(--ink); color: var(--bg); }
.pill-dark:hover { opacity: .9; }
.pill-light { background: #fff; color: #0a0a0f; }
.pill-light:hover { background: #eef1f7; }
.pill-ghost { background: rgb(255 255 255 / 14%); color: #fff; border-color: rgb(255 255 255 / 28%); backdrop-filter: blur(10px); }
.pill-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.pill-outline:hover { border-color: var(--ink-2); }
.pill-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.pill-danger:hover { border-color: var(--danger); }
.pill-danger.is-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.account-data { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.account-data h3 { font-size: 16px; margin: 0 0 4px; }
.ask-form input { width: 100%; margin-top: var(--space-2); }
.pill-block { width: 100%; }
.pill[disabled] { opacity: .5; cursor: default; }
.linkish { background: none; border: 0; padding: 10px 0; color: var(--muted); text-decoration: underline; min-height: 44px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: var(--radius-pill); border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }

/* ---- top bar ---- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  color: var(--ink);
  transition: background var(--dur) var(--ease), box-shadow var(--dur);
}
.topbar.is-solid { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.04em; min-height: 44px; color: var(--ink); }
.brand img { width: 30px; height: 30px; }
.topnav { display: flex; gap: var(--space-2); align-items: center; }
#account-btn { font-size: 14px; padding: 0 14px; }

/* ---- hero ---- */
.hero { position: relative; color: var(--ink); overflow: hidden; isolation: isolate; }
.hero-sky {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(70% 60% at 85% 20%, rgb(255 255 255 / 90%) 0, transparent 60%),
    radial-gradient(60% 50% at 0% 80%, rgb(120 170 255 / 35%) 0, transparent 70%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 45%, var(--sky-3) 85%, var(--sky-4) 100%);
}
.hero-inner { max-width: 1180px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 104px) 16px 64px; display: grid; gap: var(--space-7); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-3); }
.eyebrow-light { color: var(--accent); }
.hero h1 { font-size: clamp(48px, 13vw, 104px); line-height: .95; font-weight: 800; }
.lead { font-size: 18px; line-height: 1.55; margin-top: var(--space-5); max-width: 34em; color: var(--ink-2); }
.ask {
  margin-top: var(--space-6); display: flex; align-items: center; gap: var(--space-2);
  background: #fff; color: #0a0a0f; border-radius: var(--radius-pill); padding: 6px 6px 6px 22px;
  box-shadow: 0 10px 40px rgb(28 92 255 / 14%), 0 1px 2px rgb(10 10 15 / 8%); border: 1px solid var(--line); max-width: 560px;
}
.ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; min-height: 48px; color: #0a0a0f; }
.ask input::placeholder { color: #6b7080; }
.ask-send, .send-btn {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center; border: 0; border-radius: var(--radius-pill);
  background: #0a0a0f; color: #fff; transition: opacity var(--dur-fast);
}
.ask-send:hover, .send-btn:hover { opacity: .88; }
.chips { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid rgb(10 10 15 / 10%);
  background: rgb(255 255 255 / 75%); color: var(--ink); font-size: 14px; font-weight: 500; backdrop-filter: blur(10px);
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.chip:hover { background: #fff; border-color: rgb(10 10 15 / 22%); }
.hero-note { margin-top: var(--space-4); font-size: 14px; color: var(--muted); }

.hero-visual { position: relative; width: min(420px, 100%); justify-self: center; padding: 84px 0; display: grid; place-items: center; }
.glass-card {
  width: min(290px, 80vw); padding: 24px; border-radius: var(--radius-l); text-align: center;
  background: rgb(255 255 255 / 72%); border: 1px solid rgb(255 255 255 / 90%); backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 30px 80px rgb(28 92 255 / 18%), 0 2px 6px rgb(10 10 15 / 6%);
}
.glass-label { font-size: 14px; color: var(--muted); }
.glass-amount { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 16px; }
.glass-qr { width: 132px; height: 132px; margin: 0 auto; padding: 12px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.glass-qr span { background: #0a0a0f; border-radius: 4px; }
.glass-qr span:nth-child(2), .glass-qr span:nth-child(4), .glass-qr span:nth-child(8) { background: transparent; border: 6px solid #0a0a0f; }
.glass-qr span:nth-child(5) { border-radius: 50%; }
.glass-hint { margin-top: 12px; font-size: 13px; color: var(--muted); }
.glass-pill { display: inline-block; margin-top: 16px; padding: 10px 18px; border-radius: var(--radius-pill); background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; }
.glass-bubble {
  position: absolute; max-width: 230px; padding: 12px 16px; border-radius: 18px; font-size: 14px; line-height: 1.4;
  background: #fff; color: var(--ink); box-shadow: var(--shadow-1); border: 1px solid var(--line);
}
.glass-bubble-1 { top: 0; left: 0; }
.glass-bubble-2 { bottom: 0; right: 0; }

/* ---- sections ---- */
.section { padding: var(--space-8) 16px; }
.wrap { max-width: 1180px; margin: 0 auto; }
.section h2 { font-size: clamp(34px, 7vw, 60px); line-height: 1.02; font-weight: 800; max-width: 14em; }
.bento { display: grid; gap: var(--space-3); margin-top: var(--space-6); }
.tile { border-radius: var(--radius-l); padding: 28px; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-3); }
.tile h3 { font-size: 26px; font-weight: 700; line-height: 1.1; }
.tile p { color: var(--ink-2); max-width: 30em; }
.tile-blue { background: var(--tile-blue); }
.tile-sand { background: var(--tile-sand); }
.tile-mint { background: var(--tile-mint); }
.tile-lilac { background: var(--tile-lilac); }
.tile-ink { background: var(--tile-peach); }
.section-dark { background: var(--tile-blue); }
.price { display: grid; gap: var(--space-7); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; column-gap: var(--space-4); padding: 20px; border-radius: var(--radius-m); background: #fff; box-shadow: var(--shadow-1); }
.steps li::before { content: counter(s); grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; }
.steps b { font-family: var(--font-display); font-size: 19px; }
.steps span { color: var(--ink-2); }
.footer { padding: var(--space-6) 16px calc(var(--space-6) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); justify-content: space-between; }

@media (min-width: 768px) {
  .hero-inner { grid-template-columns: 1.1fr .9fr; align-items: center; padding-top: 140px; padding-bottom: 96px; min-height: 92vh; }
  .bento { grid-template-columns: repeat(3, 1fr); }
  .tile-wide { grid-column: span 2; }
  .price { grid-template-columns: 1.2fr 1fr; align-items: center; }
  .topbar { padding-left: 32px; padding-right: 32px; }
  .section { padding-left: 32px; padding-right: 32px; }
}

/* ---- chat ---- */
body.in-chat { background: var(--bg-soft); }
body.in-chat .topbar { background: color-mix(in srgb, var(--bg-soft) 88%, transparent); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.chat { min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 76px) 16px 0; }
.thread { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-4); padding-bottom: 150px; }
.msg { display: flex; flex-direction: column; gap: var(--space-2); max-width: 100%; }
.msg-user { align-items: flex-end; }
.bubble { padding: 12px 16px; border-radius: 20px; max-width: min(88%, 620px); word-wrap: break-word; overflow-wrap: anywhere; }
.msg-user .bubble { background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg-assistant .bubble { background: var(--surface); box-shadow: var(--shadow-1); border-bottom-left-radius: 6px; }
.msg-assistant .bubble:empty { display: none; }
.bubble p + p { margin-top: 10px; }
.bubble a { color: var(--accent); }
.channel-tag { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.channel-tag svg { width: 14px; height: 14px; }
.divider { text-align: center; font-size: 13px; color: var(--muted); margin: var(--space-3) 0; }
.status { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.status[hidden] { display: none; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }
.error-note { color: var(--danger); font-size: 14px; }

.welcome { max-width: 760px; margin: 0 auto var(--space-4); padding: 20px; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow-1); display: grid; gap: var(--space-3); }
.welcome h2 { font-size: 22px; }

/* ---- cards in the chat ---- */
.card { width: min(100%, 520px); background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-1); padding: 18px; display: grid; gap: var(--space-3); }
.card-head { display: flex; align-items: center; gap: var(--space-3); }
.card-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.card-icon svg { width: 20px; height: 20px; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.2; }
.card-sub { font-size: 14px; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.card-actions .pill { min-height: 40px; font-size: 14px; padding: 0 16px; }
.amount { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.qr { background: #fff; border-radius: 16px; padding: 10px; width: 220px; max-width: 100%; justify-self: center; }
.qr svg { width: 100%; height: auto; }
.fields { display: grid; gap: 2px; margin: 0; }
.field { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 8px 0; border-top: 1px solid var(--line); }
.field dt { font-size: 13px; color: var(--muted); }
.field dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-all; }
.copy { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-pill); min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.copy svg { width: 16px; height: 16px; }
.copy.is-done { color: var(--success); border-color: var(--success); }
.field-value { display: flex; align-items: center; gap: var(--space-2); }
.warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius-s); padding: 10px 12px; font-size: 14px; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--surface-2); font-size: 13px; font-weight: 600; }
.badge-ok { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.mail-body { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); background: var(--surface-2); border-radius: var(--radius-s); padding: 12px; max-height: 220px; overflow: auto; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 44px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; font-weight: 500; }
.link-list a:hover { color: var(--accent); }
.link-list svg { width: 16px; height: 16px; flex: none; }
.choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choices .pill { min-height: 40px; font-size: 14px; }
.memory-line { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.library-group .memory-line { display: flex; width: 100%; padding: 6px 0; font-size: 14px; color: var(--ink-2); }
.library-group .memory-line > span { flex: 1; min-width: 0; }
.library-group .memory-line .card-actions { margin: 0; }
.managed-card { position: relative; }
.managed-card .card-head { position: relative; }
.managed-card .card-more { margin-left: auto; opacity: 1; }
.managed-card .side-menu { top: 44px; right: 8px; }
.card-status { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot-ok { background: #1f9d55; }
.routine-last { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.routine-last summary { cursor: pointer; color: var(--muted); }
.routine-last p { margin: 6px 0 0; white-space: pre-wrap; }
.pill-small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.memory-line svg { width: 14px; height: 14px; }

/* ---- composer ---- */
.composer { position: fixed; inset: auto 0 0 0; z-index: 15; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg-soft) 70%, transparent); }
.composer-row { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 4px; background: var(--surface); border-radius: 26px; padding: 6px; box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; padding: 12px 6px; max-height: 180px; line-height: 1.4; font-size: 16px; }
.composer .send-btn { background: var(--ink); color: var(--bg); width: 44px; height: 44px; }
/* Phones: the text box keeps room to write; "Ring mig" stays one message away ("ring mig"). */
@media (max-width: 480px) {
  .composer-row { gap: 0; padding: 4px; }
  .composer-row .icon-btn { width: 38px; height: 38px; }
  .composer .send-btn { width: 40px; height: 40px; }
  .composer textarea { padding: 10px 4px; }
  .composer #call-btn { display: none; }
}
.composer .send-btn[disabled] { opacity: .4; }
.composer-files { max-width: 760px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.file-chip button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.file-chip svg { width: 14px; height: 14px; }

/* ---- sheet (login) ---- */
.sheet { border: 0; padding: 24px; width: min(440px, calc(100vw - 24px)); border-radius: var(--radius-l); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.sheet::backdrop { background: rgb(5 8 20 / 55%); backdrop-filter: blur(4px); }
.sheet h2 { font-size: 26px; margin-bottom: var(--space-2); }
.sheet-close-row { display: flex; justify-content: flex-end; margin: -12px -12px 0 0; }
.verify { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.verify-step { display: grid; gap: var(--space-2); }
.verify label { font-size: 14px; font-weight: 600; }
.verify input { min-height: 52px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface-2); padding: 0 16px; font-size: 18px; letter-spacing: .02em; }
.verify input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.verify-error { color: var(--danger); font-size: 14px; }
.fine { font-size: 12px; color: var(--muted); }

/* ---- QR page ---- */
.qr-page { background: var(--bg-soft); min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.qr-sheet { width: min(440px, 100%); background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-1); padding: 28px; display: grid; gap: var(--space-3); text-align: center; }
.qr-sheet h1 { font-size: 26px; }
.qr-amount { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }
.qr-box { background: #fff; border-radius: 16px; padding: 12px; width: 280px; max-width: 100%; justify-self: center; }
.qr-box svg { width: 100%; height: auto; }
.pay-fields { margin: 0; display: grid; text-align: left; }
.pay-fields div { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.pay-fields dt { color: var(--muted); }
.pay-fields dd { margin: 0; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---- microphone ---- */
.mic-btn { position: relative; }
.mic-hero { color: #3c3f4a; }
.mic-btn.is-on { background: var(--danger); color: #fff; }
.mic-btn.is-on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--danger); opacity: .5; animation: ring 1.4s var(--ease) infinite; }
.mic-btn.is-busy { opacity: .6; }
.talk-btn.is-on { background: var(--ink); color: #fff; }
.talk-bar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; margin-bottom: 8px; border-radius: 14px; background: var(--surface-2); font-size: 14px; }
.talk-status { flex: 1; min-width: 0; color: var(--ink-2); }
.talk-pulse { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.talk-pulse i { width: 3px; height: 6px; border-radius: 2px; background: var(--ink); }
.talk-bar.is-speaking .talk-pulse i, .talk-bar.is-listening .talk-pulse i { animation: talk-wave 1s var(--ease) infinite; }
.talk-bar.is-listening .talk-pulse i { background: var(--ink-2); animation-duration: 1.6s; }
.talk-pulse i:nth-child(2) { animation-delay: .15s; }
.talk-pulse i:nth-child(3) { animation-delay: .3s; }
.talk-pulse i:nth-child(4) { animation-delay: .45s; }
@keyframes talk-wave { 0%, 100% { height: 6px; } 50% { height: 18px; } }
@media (prefers-reduced-motion: reduce) { .talk-pulse i { animation: none !important; height: 12px; } }
@keyframes ring { from { transform: scale(.9); opacity: .6 } to { transform: scale(1.25); opacity: 0 } }
.listening-note { max-width: 760px; margin: 0 auto 8px; font-size: 13px; color: var(--danger); display: flex; align-items: center; gap: 8px; }

/* ---- account and card ---- */
.account-card { margin: var(--space-4) 0; display: grid; gap: var(--space-3); }
.card-form { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.card-form label { font-size: 14px; font-weight: 600; }
.card-form input { min-height: 52px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface-2); padding: 0 16px; font-size: 17px; }
.card-form input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.card-element { min-height: 120px; }
.field-static { border-top: 0; padding: 4px 0; }
.saved-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 14px 16px; border-radius: var(--radius-m); background: var(--surface-2); font-weight: 600; }

.addon-card { margin-top: var(--space-2); }
.addon-card .saved-card span:last-child { font-family: var(--font-display); font-size: 20px; }
@media (min-width: 768px) { .tile-full { grid-column: 1 / -1; } }

/* ---- sidebar (as in Grok) and the apps place ---- */
.toplink { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.menu-btn { display: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 30; background: var(--surface); border-right: 1px solid var(--line); display: none; flex-direction: column; gap: var(--space-4); padding: calc(env(safe-area-inset-top) + 14px) 14px calc(env(safe-area-inset-bottom) + 14px); }
.sidebar .brand { padding: 0 6px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-app { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; text-decoration: none; font-weight: 600; color: var(--ink-2); }
.side-nav a:hover, .side-app:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.side-nav svg, .side-app svg { width: 20px; height: 20px; }
.side-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.side-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 12px 6px; }
.side-app .app-dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.side-app .app-dot svg { width: 15px; height: 15px; }
.side-foot { margin-top: auto; display: grid; gap: var(--space-2); }
.side-title { display: flex; align-items: center; justify-content: space-between; }
.side-add { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; text-decoration: none; color: var(--ink-2); font-size: 18px; font-weight: 500; }
.side-add:hover { background: var(--surface-2); }
.side-empty { font-size: 13px; color: var(--muted); padding: 0 12px; }
.chat-empty { min-height: 52vh; display: grid; place-content: center; text-align: center; gap: var(--space-4); }
.chat-empty h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; }
.chat-empty .chips { justify-content: center; }
.chat-empty .chip { color: var(--ink); background: var(--surface); border-color: var(--line); }
.library-group { margin-top: var(--space-6); display: grid; gap: var(--space-3); }
.library-group h2 { font-size: 15px; font-family: var(--font-body); letter-spacing: 0; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.library-empty { color: var(--muted); }
.side-account { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; font-weight: 600; }
.side-account small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.side-account .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.side-account .avatar svg { width: 16px; height: 16px; }
.side-backdrop { position: fixed; inset: 0; z-index: 25; background: rgb(5 8 20 / 40%); }

/* App mode: the chat or the apps are open. Desktop keeps the sidebar; mobile opens it as a drawer. */
body.app-mode .topnav, body.app-mode .topbar .brand { display: none; }
body.app-mode .menu-btn { display: inline-grid; }
@media (min-width: 900px) {
  body.app-mode .sidebar { display: flex; }
  body.app-mode .topbar { display: none; }
  body.app-mode .chat, body.app-mode .apps-view { margin-left: 264px; padding-top: 32px; }
  body.app-mode .composer { left: 264px; }
}
@media (max-width: 899px) {
  body.app-mode.side-open .sidebar { display: flex; box-shadow: var(--shadow-2); }
  body.app-mode .topbar { justify-content: flex-start; gap: 8px; }
  body.app-mode .topbar .brand { display: inline-flex; }
}
.apps-view { min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 80px) 16px 64px; background: var(--bg-soft); }
.apps-view h1 { font-size: clamp(30px, 4.5vw, 44px); line-height: 1.05; font-weight: 800; overflow-wrap: anywhere; }
.lead-dark { font-size: 18px; color: var(--ink-2); margin-top: var(--space-4); max-width: 36em; }
.apps-group { margin-top: var(--space-6); }
.apps-group h2 { font-size: 15px; font-family: var(--font-body); letter-spacing: 0; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-bottom: var(--space-3); }
.apps-grid { display: grid; gap: var(--space-3); }
@media (min-width: 768px) { .apps-grid { grid-template-columns: repeat(2, 1fr); } }
.app-tile { background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-1); padding: 18px; display: grid; grid-template-columns: 52px 1fr; gap: 6px 14px; align-items: start; }
.app-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; grid-row: span 3; color: #fff; }
.app-icon svg { width: 26px; height: 26px; }
.app-icon-ringer { background: linear-gradient(135deg, #1c5cff, #6fa3f2); }
.app-icon-order { background: linear-gradient(135deg, #f08a4b, #f6c28b); }
.app-icon-gmail { background: linear-gradient(135deg, #e5484d, #f59e9e); }
.app-icon-kivra { background: linear-gradient(135deg, #2bb673, #9be3bf); }
.app-icon-bank { background: linear-gradient(135deg, #0a0a0f, #4b4f5c); }
.app-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.app-tagline { color: var(--ink-2); font-size: 15px; }
.app-state { font-size: 13px; color: var(--muted); }
.app-state b { color: var(--success); font-weight: 600; }
.app-tile .pill { grid-column: 2; justify-self: start; min-height: 38px; font-size: 14px; margin-top: 6px; }
.sheet-wide { width: min(560px, calc(100vw - 24px)); }
.app-hero { display: flex; gap: 14px; align-items: center; margin-bottom: var(--space-4); }
.app-hero h2 { font-size: 26px; margin: 0; }
.app-section { margin-top: var(--space-4); display: grid; gap: var(--space-2); }
.app-section h3 { font-size: 15px; font-family: var(--font-body); letter-spacing: 0; }
.app-section ul { margin: 0; padding-left: 18px; color: var(--ink-2); }

.app-icon-juristen { background: linear-gradient(135deg, #2a2f45, #6b7393); }
.law-list { display: grid; gap: 2px; }
.law-item { border-top: 1px solid var(--line); padding: 10px 0; }
.law-item summary { cursor: pointer; min-height: 32px; list-style: none; }
.law-item summary::-webkit-details-marker { display: none; }
.law-item p { margin-top: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.law-item a { font-size: 14px; color: var(--accent); }
.app-icon-handla { background: linear-gradient(135deg, #7c4dff, #b9a3ff); }

.side-new { width: 100%; justify-content: flex-start; gap: 10px; padding: 0 14px; }
.side-new svg { width: 18px; height: 18px; }
.run-line { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.run-line summary { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); }
.run-line summary span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-line small { color: var(--muted); }
.run-line p { margin: 6px 0 0 16px; white-space: pre-wrap; color: var(--ink-2); }
.template-grid { display: grid; gap: var(--space-3); }
@media (min-width: 768px) { .template-grid { grid-template-columns: repeat(2, 1fr); } }
.template-tile { background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-1); padding: 14px 16px; display: grid; gap: 6px; justify-items: start; }
.side-search { position: absolute; top: 14px; right: 10px; }
.side-search svg { width: 20px; height: 20px; }
.search-sheet { width: min(860px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 64px)); padding: 0; border: 0; border-radius: var(--radius-m); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); overflow: hidden; }
.search-sheet[open] { display: flex; flex-direction: column; }
.search-sheet::backdrop { background: rgb(10 10 15 / 30%); }
.search-top { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-top svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-top input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 17px; }
.search-body { display: grid; grid-template-columns: 1fr; min-height: 0; flex: 1; }
@media (min-width: 720px) { .search-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.search-list { overflow-y: auto; padding: 8px; }
.search-preview { display: none; overflow-y: auto; padding: 16px 18px; border-left: 1px solid var(--line); background: var(--bg-soft); font-size: 14px; }
@media (min-width: 720px) { .search-preview { display: block; } }
.search-preview p { margin: 0 0 10px; }
.preview-user { color: var(--ink); font-weight: 600; }
.preview-assistant { color: var(--ink-2); }
.search-head { margin: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.search-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.search-item svg { width: 16px; height: 16px; }
.search-item:has(svg) { grid-template-columns: auto 1fr; }
.search-item[aria-selected="true"] { background: var(--surface-2); }
.search-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item small { color: var(--muted); }
.search-snippet { grid-column: 1 / -1; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { margin: 12px 10px; color: var(--muted); font-size: 14px; }
/* Product cards as in Grok: picture on top, name, rating, price, shop, one line, buttons. Side by
   side, scrolled sideways when there is no room. */
.product-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 260px); justify-content: start; gap: 10px; margin-top: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.product-tile { scroll-snap-align: start; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.product-tile.is-pick { border-color: var(--ink); }
.product-pic { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--line); }
.product-pic img { width: 100%; height: 100%; object-fit: contain; padding: 12px; box-sizing: border-box; }
.product-pic.is-empty { background: var(--surface-2); }
.product-pic.is-empty svg { width: 36px; height: 36px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.product-pic .badge { position: absolute; top: 8px; left: 8px; }
.product-body { display: flex; flex-direction: column; gap: 4px; padding: 12px; flex: 1; }
.product-name { margin: 0; font-weight: 600; line-height: 1.3; }
.product-tile .product-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-fullname { margin: 0 0 6px; font-weight: 600; color: var(--ink); }
.product-price { margin: 2px 0 0; font-weight: 700; font-size: 17px; }
.product-shop { margin: 0; font-size: 13px; color: var(--muted); }
.product-rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); }
.product-rating svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.product-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.product-details { font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.product-details ul { margin: 0 0 6px; padding-left: 18px; }
.product-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 6px; }
.product-links a { color: var(--ink-2); }
.product-small { margin: 0; color: var(--muted); font-size: 12px; }
/* Suggestions on a web errand card: a plain list. */
.web-card .product-list { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
.product-row { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.product-row.is-pick { border-color: var(--ink); }
.product-main { min-width: 0; flex: 1; display: grid; gap: 4px; justify-items: start; }
.product-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.product-meta b { color: var(--ink); }
.card-sub.is-late { color: var(--danger); font-weight: 600; }
.product-variant { margin: 0; font-size: 13px; color: var(--muted); }
.web-summary { margin: 8px 0 0; line-height: 1.45; }
.web-shot { display: block; width: 100%; margin-top: 10px; border-radius: var(--radius-s); border: 1px solid var(--line); }
.web-remaining { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }
.web-visited { margin-top: 8px; font-size: 13px; color: var(--muted); }
.web-visited ul { margin: 4px 0 0; padding-left: 18px; }
.product-deal { margin: 2px 0 0; font-size: 13px; color: var(--success); font-weight: 600; }
.product-disclosure { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.product-compare { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.product-compare a { color: var(--ink-2); }
.product-reason { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.side-subtitle { margin: 10px 0 2px; font-size: 12px; }
.side-chat-row { position: relative; display: flex; align-items: center; border-radius: 10px; }
.side-chat-row:hover, .side-chat-row:focus-within { background: var(--surface-2); }
.side-chat { display: block; flex: 1; min-width: 0; min-height: 38px; line-height: 38px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-size: 14px; }
/* A long title fades out at the end, as in Grok; on hover it fades earlier to make room for "…". */
.side-chat-title { display: block; overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.side-chat-row:hover .side-chat-title, .side-chat-row:focus-within .side-chat-title { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent calc(100% - 30px)); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent calc(100% - 30px)); }
.side-chat-row:hover .side-chat { color: var(--ink); }
.side-chat[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.side-chat-more { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; opacity: 0; }
.side-chat-more svg { width: 18px; height: 18px; }
.side-chat-row:hover .side-chat-more, .side-chat-more:focus-visible, .side-chat-more[aria-expanded="true"] { opacity: 1; }
.side-chat-more:hover { background: var(--line); color: var(--ink); }
.side-chat-row > .side-chat-more { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
@media (hover: none) {
  .side-chat-more { opacity: 1; }
  .side-chat-title { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent calc(100% - 30px)); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent calc(100% - 30px)); }
}
.side-menu { position: absolute; right: 4px; top: 36px; z-index: 30; min-width: 160px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / .12); }
.side-menu button { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.side-menu button:hover { background: var(--surface-2); }
.side-menu button.is-danger { color: var(--danger); }
.sidebar { overflow-y: auto; }
.msg.is-queued .bubble { opacity: .6; }
/* Steps at the top of an answer, as Grok shows them while it works: one quiet line. */
.turn-steps { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.turn-steps summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; color: var(--muted); }
.turn-steps summary::-webkit-details-marker { display: none; }
.turn-steps-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.turn-steps-list li.done { color: var(--muted); }
.turn-steps-list li:not(.done) { color: var(--ink-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8) } 50% { opacity: .9; transform: scale(1) } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; opacity: .6; } }
.turn-shot { display: block; width: 240px; max-width: 70%; height: auto; margin: 6px 0 10px; border-radius: 10px; border: 1px solid var(--line, #e3e5e9); box-shadow: var(--shadow-1); }
.turn-steps .turn-shot { margin-top: 8px; }
/* Grok's question form: one question at a time, lettered answers, "Något annat", "Hoppa". */
.questions-card { display: grid; gap: 10px; }
.questions-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.questions-q { margin: 0; font-weight: 600; }
.questions-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.questions-list { display: grid; gap: 6px; }
.questions-opt, .questions-other { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.questions-opt:hover, .questions-opt:focus-visible { background: var(--surface-2); }
.questions-key { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600; }
.questions-key svg { width: 15px; height: 15px; }
.questions-other input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; }
.questions-title { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.questions-nav { display: flex; justify-content: flex-end; gap: 16px; }
.questions-skip { border: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.questions-done { margin: 0; color: var(--muted); }
/* The privacy page (/integritet); styles live here, as the CSP allows no inline style. */
body.policy-page { background: var(--bg, #f4f5f7); }
.policy { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; line-height: 1.6; color: var(--ink, #111); }
.policy h1 { font-size: 32px; margin: 8px 0 4px; }
.policy h2 { font-size: 20px; margin: 32px 0 8px; }
.policy p, .policy li { font-size: 16px; }
.policy ul { padding-left: 20px; }
.policy table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0; }
.policy th, .policy td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line, #e3e5e9); }
.policy .muted { color: var(--muted, #667); font-size: 14px; }
.policy a { color: inherit; }
.policy .table-wrap { overflow-x: auto; }
/* Pairing by SMS: the code the person sends to Enklast. */
.verify-reply { margin: 0 0 10px; line-height: 1.5; }
.verify-code { font-size: 22px; letter-spacing: 3px; }
.verify-wait { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 10px 0 4px; }
