/* DENTI — one-page dental AI concierge
   Palette: deep forest / porcelain / lime. No purple gradients, no beige+brass. */

:root {
  --ink: #10201a;
  --ink-2: #35463e;
  --muted: #5f6f66;
  --muted-2: #78867e;
  --paper: #eef2ea;
  --surface: #fbfcf8;
  --surface-2: #f2f5ef;
  --line: rgba(16, 32, 26, 0.09);
  --line-strong: rgba(16, 32, 26, 0.16);
  --forest: #0e211a;
  --forest-2: #173429;
  --lime: #c7f36b;
  --lime-strong: #b8ec4e;
  --danger: #b8442c;
  --solid: #0e211a;
  --solid-ink: #f8faf3;
  --shadow: 0 28px 90px rgba(14, 33, 26, 0.14), 0 2px 8px rgba(14, 33, 26, 0.04);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius-shell: 30px;
  --radius-bubble: 18px;
  --radius-card: 22px;
  --app-h: 100dvh;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #edf3ea;
    --ink-2: #c6d2c9;
    --muted: #9aa89f;
    --muted-2: #7d8b82;
    --paper: #07110c;
    --surface: #0f1b15;
    --surface-2: #15241c;
    --line: rgba(237, 243, 234, 0.09);
    --line-strong: rgba(237, 243, 234, 0.17);
    --forest: #0a1710;
    --forest-2: #12291e;
    --solid: #c7f36b;
    --solid-ink: #0e211a;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.44), 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(900px 620px at 8% 4%, rgba(199, 243, 107, 0.22), transparent 58%),
    radial-gradient(760px 560px at 96% 92%, rgba(112, 160, 140, 0.18), transparent 60%),
    var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(900px 620px at 8% 4%, rgba(199, 243, 107, 0.08), transparent 58%),
      radial-gradient(760px 560px at 96% 92%, rgba(74, 125, 102, 0.12), transparent 60%),
      var(--paper);
  }
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

svg {
  display: block;
  fill: currentColor;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

::selection {
  background: var(--lime);
  color: var(--forest);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.brand-panel :focus-visible,
.hook-card :focus-visible {
  outline-color: var(--lime);
}

.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;
}

/* ---------- page + shell ---------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.shell {
  width: min(1180px, calc(100vw - 48px));
  height: min(820px, calc(100dvh - 48px));
  min-height: 560px;
  display: grid;
  grid-template-columns: 0.92fr 1.18fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-shell);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* ---------- brand panel ---------- */

.brand-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 32px 34px 28px;
  color: #f7f9f1;
  background: var(--forest);
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(430px 330px at 86% 8%, rgba(199, 243, 107, 0.17), transparent 66%),
    linear-gradient(158deg, transparent 42%, rgba(0, 0, 0, 0.22));
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 78%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 78%);
}

.brand-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ring {
  position: absolute;
  border: 1px solid rgba(199, 243, 107, 0.15);
  border-radius: 50%;
}

.ring--one {
  width: 430px;
  height: 430px;
  top: -150px;
  right: -155px;
}

.ring--two {
  width: 286px;
  height: 286px;
  top: -78px;
  right: -82px;
  border-color: rgba(255, 255, 255, 0.08);
}

.brand-tooth {
  position: absolute;
  right: -44px;
  bottom: 88px;
  width: 270px;
  height: 270px;
  color: var(--lime);
  opacity: 0.07;
  transform: rotate(-12deg);
}

.brand-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--lime);
  color: var(--forest);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-word {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-kicker {
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-align: right;
  color: rgba(247, 249, 241, 0.54);
}

.brand-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
  padding: 48px 0 42px;
}

.brand-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 22px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(247, 249, 241, 0.8);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(199, 243, 107, 0.12);
}

.brand-headline {
  margin: 0;
  font-size: clamp(40px, 4.15vw, 58px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.055em;
  color: #f6f8f0;
}

.brand-headline em {
  font-style: normal;
  color: var(--lime);
}

.brand-sub {
  margin: 24px 0 0;
  font-size: 14.5px;
  line-height: 1.75;
  letter-spacing: -0.012em;
  color: rgba(247, 249, 241, 0.7);
}

.brand-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.status-pulse {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(199, 243, 107, 0.11);
  animation: pulse 2.4s ease-out infinite;
}

.status-card strong {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: rgba(247, 249, 241, 0.92);
}

.status-card span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: rgba(247, 249, 241, 0.58);
}

.brand-note {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.65;
  color: rgba(247, 249, 241, 0.52);
}

.brand-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: rgba(247, 249, 241, 0.4);
}

.brand-foot-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- chat panel ---------- */

.chat-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.chat-header {
  flex: none;
  height: 76px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.chat-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--lime);
}

.avatar--header {
  width: 38px;
  height: 38px;
  box-shadow: 0 0 0 1px var(--line), 0 6px 16px rgba(14, 33, 26, 0.12);
}

.avatar--header svg {
  width: 19px;
  height: 19px;
}

.avatar--msg {
  width: 30px;
  height: 30px;
  margin-top: 2px;
}

.avatar--msg svg {
  width: 15px;
  height: 15px;
}

.chat-identity-text {
  min-width: 0;
}

.chat-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.ai-badge {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--lime);
  color: var(--forest);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 3px 0 0;
  font-size: 10.5px;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.online-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #65b87b;
  box-shadow: 0 0 0 3px rgba(101, 184, 123, 0.12);
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.icon-btn:active {
  transform: scale(0.95);
}

.cta-pill {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--solid);
  color: var(--solid-ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s;
}

.cta-pill svg {
  width: 14px;
  height: 14px;
}

.cta-pill:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.cta-pill:active {
  transform: scale(0.98);
}

.scope-bar {
  flex: none;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: -0.012em;
  color: var(--muted);
}

.scope-bar svg {
  width: 13px;
  height: 13px;
  opacity: 0.75;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 28px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  scroll-behavior: smooth;
}

.chat-scroll::-webkit-scrollbar {
  width: 6px;
}

.chat-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.chat-stream {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-stream.is-empty {
  min-height: 100%;
  justify-content: center;
}

.day-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 2px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.day-divider::before,
.day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- messages ---------- */

.msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  animation: msg-in 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.msg--user {
  justify-content: flex-end;
}

.msg-content {
  min-width: 0;
  max-width: calc(100% - 42px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.msg--user .msg-content {
  max-width: 84%;
  align-items: flex-end;
}

.bubble {
  max-width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-bubble) 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.72;
  letter-spacing: -0.014em;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(14, 33, 26, 0.03);
}

.bubble p {
  margin: 0;
}

.bubble p + p {
  margin-top: 8px;
}

.bubble strong {
  font-weight: 750;
  color: var(--ink);
}

.bubble-note {
  margin-top: 10px !important;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.bubble-text {
  white-space: pre-wrap;
}

.msg--user .bubble {
  border-color: transparent;
  border-radius: var(--radius-bubble) var(--radius-bubble) 6px var(--radius-bubble);
  background: var(--solid);
  color: var(--solid-ink);
  box-shadow: 0 6px 18px rgba(14, 33, 26, 0.1);
}

.msg--user .bubble strong {
  color: inherit;
}

.is-streaming .bubble-text::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: currentColor;
  opacity: 0.55;
  animation: blink 1s step-end infinite;
}

.empty-guide {
  margin-top: 2px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.guide-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.guide-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.45;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.guide-num {
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.guide-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.guide-copy strong {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}

.guide-copy span {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--muted);
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.chip:active {
  transform: scale(0.98);
}

/* typing */

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 1px;
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  animation: typing 1.25s ease-in-out infinite;
}

.typing-bubble span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-bubble span:nth-child(3) {
  animation-delay: 0.3s;
}

/* hook */

.msg--hook {
  align-items: flex-start;
}

.msg--hook .msg-content {
  flex: 1;
  width: auto;
  max-width: none;
}

.hook-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 20px 20px 18px;
  border-radius: var(--radius-card);
  background: var(--forest);
  color: #f7f9f1;
  box-shadow: 0 16px 44px rgba(14, 33, 26, 0.2);
}

.hook-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(280px 200px at 100% 0%, rgba(199, 243, 107, 0.19), transparent 68%),
    linear-gradient(145deg, transparent 45%, rgba(0, 0, 0, 0.2));
}

.hook-card::after {
  content: "";
  position: absolute;
  right: -74px;
  bottom: -92px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(199, 243, 107, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.hook-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hook-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--lime);
  color: var(--forest);
}

.hook-icon svg {
  width: 15px;
  height: 15px;
}

.hook-label {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: rgba(247, 249, 241, 0.64);
}

.hook-title {
  position: relative;
  z-index: 1;
  max-width: 32ch;
  margin: 16px 0 0;
  font-size: 22px;
  line-height: 1.34;
  font-weight: 750;
  letter-spacing: -0.045em;
  color: #f7f9f1;
}

.hook-copy {
  position: relative;
  z-index: 1;
  max-width: 44ch;
  margin: 9px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  letter-spacing: -0.012em;
  color: rgba(247, 249, 241, 0.7);
}

.hook-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
}

.hook-btn {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s, background 0.2s, border-color 0.2s;
}

.hook-btn--primary {
  border: 1px solid transparent;
  background: var(--lime);
  color: var(--forest);
}

.hook-btn--primary:hover {
  background: var(--lime-strong);
  transform: translateY(-1px);
}

.hook-btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: rgba(247, 249, 241, 0.75);
}

.hook-btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.hook-btn:active {
  transform: scale(0.98);
}

.hook-note {
  position: relative;
  z-index: 1;
  margin: 13px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(247, 249, 241, 0.56);
}

/* error */

.msg--error .bubble {
  border-color: rgba(184, 68, 44, 0.24);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}

.retry-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.retry-btn:hover {
  background: var(--surface-2);
}

/* ---------- scroll to bottom ---------- */

.scroll-bottom {
  position: absolute;
  right: 26px;
  bottom: 106px;
  z-index: 5;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(14, 33, 26, 0.12);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.scroll-bottom.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.scroll-bottom:hover {
  background: var(--surface-2);
}

.scroll-bottom svg {
  width: 16px;
  height: 16px;
}

/* ---------- composer ---------- */

.composer-wrap {
  flex: none;
  position: relative;
  z-index: 4;
  padding: 10px 24px 16px;
  background: linear-gradient(to top, var(--surface) 72%, rgba(251, 252, 248, 0));
}

@media (prefers-color-scheme: dark) {
  .composer-wrap {
    background: linear-gradient(to top, var(--surface) 72%, rgba(15, 27, 21, 0));
  }
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 7px 7px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(14, 33, 26, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.composer:focus-within {
  border-color: color-mix(in srgb, var(--ink) 45%, var(--line-strong));
  box-shadow: 0 0 0 3px rgba(199, 243, 107, 0.26), 0 8px 30px rgba(14, 33, 26, 0.06);
}

#messageInput {
  flex: 1;
  min-width: 0;
  min-height: 30px;
  max-height: 120px;
  padding: 8px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

#messageInput::placeholder {
  color: var(--muted);
  opacity: 1;
}

.send-btn {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--solid);
  color: var(--solid-ink);
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s, background 0.2s, opacity 0.2s;
}

.send-btn svg {
  width: 18px;
  height: 18px;
}

.send-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.send-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.send-btn.is-stop {
  background: var(--lime);
  color: var(--forest);
}

.stop-icon {
  display: none;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: currentColor;
}

.send-btn.is-stop .send-icon {
  display: none;
}

.send-btn.is-stop .stop-icon {
  display: block;
}

.composer-note {
  margin: 8px 0 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--muted);
}

.composer-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- lead dialog ---------- */

.lead-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: var(--app-h, 100dvh);
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}

.lead-dialog:not([open]) {
  display: none;
}

.lead-dialog[open] {
  display: grid;
  align-items: end;
  justify-items: center;
}

.lead-dialog::backdrop {
  background: rgba(8, 20, 15, 0.56);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lead-sheet {
  position: relative;
  width: min(440px, calc(100% - 32px));
  max-height: calc(var(--app-h, 100dvh) - 32px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(8, 20, 15, 0.35);
  animation: sheet-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sheet-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.sheet-close:hover {
  color: var(--ink);
  background: var(--line);
}

.sheet-close svg {
  width: 16px;
  height: 16px;
}

.sheet-handle {
  display: none;
}

.sheet-head {
  padding-right: 24px;
}

.sheet-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--lime);
  color: var(--forest);
}

.sheet-icon svg {
  width: 22px;
  height: 22px;
}

.sheet-eyebrow {
  margin: 0 0 7px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.sheet-head h2,
.lead-success h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.sheet-sub {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.65;
  letter-spacing: -0.012em;
  color: var(--muted);
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -0.015em;
  outline: 0;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input::placeholder {
  color: var(--muted);
  opacity: 1;
  font-size: 14px;
}

.field input:focus {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(199, 243, 107, 0.28);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(184, 68, 44, 0.1);
}

.field-error {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--danger);
}

.consent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
}

.consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.consent input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.consent-box {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  transition: background 0.2s, border-color 0.2s;
}

.consent-box svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s;
}

.consent input:checked + .consent-box {
  border-color: var(--solid);
  background: var(--solid);
  color: var(--solid-ink);
}

.consent input:checked + .consent-box svg {
  opacity: 1;
  transform: none;
}

.consent input:focus-visible + .consent-box {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.consent-text {
  padding-top: 1px;
  font-size: 12px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.privacy-toggle {
  margin-top: 1px;
  padding: 0;
  border: 0;
  -webkit-tap-highlight-color: transparent;
  background: none;
  color: var(--ink);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.privacy-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.privacy-box dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.privacy-box dl div {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 8px;
}

.privacy-box dt {
  font-weight: 650;
  color: var(--ink-2);
}

.privacy-box dd {
  margin: 0;
}

.privacy-box p {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.privacy-box a {
  color: inherit;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(184, 68, 44, 0.08);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
}

.submit-btn {
  position: relative;
  width: 100%;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 15px;
  background: var(--solid);
  color: var(--solid-ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s, opacity 0.2s;
}

.submit-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.submit-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.submit-btn.is-loading .submit-label {
  display: none;
}

.submit-btn.is-loading .submit-spinner {
  display: block;
}

.form-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.form-note svg {
  width: 12px;
  height: 12px;
}

.lead-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 10px;
}

.success-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 16px;
  background: var(--lime);
  color: var(--forest);
}

.success-mark svg {
  width: 26px;
  height: 26px;
}

.lead-success .submit-btn {
  margin-top: 24px;
}

/* ---------- toast + misc ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--forest);
  color: #f7f9f1;
  font-size: 12px;
  letter-spacing: -0.01em;
  box-shadow: 0 16px 40px rgba(8, 20, 15, 0.28);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--forest);
  color: #f7f9f1;
  font-size: 13px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 0.84fr 1.16fr;
  }

  .brand-panel {
    padding: 28px 28px 24px;
  }

  .brand-headline {
    font-size: clamp(38px, 4.4vw, 50px);
  }

  .brand-kicker {
    font-size: 8px;
  }

  .chat-header {
    padding: 0 20px;
  }

  .chat-scroll {
    padding: 24px 22px 10px;
  }

  .composer-wrap {
    padding: 10px 20px 15px;
  }
}

@media (max-width: 960px) {
  body {
    background: var(--surface);
  }

  .page {
    padding: 0;
  }

  .shell {
    width: 100%;
    height: var(--app-h, 100dvh);
    min-height: 0;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--surface);
  }

  .brand-panel {
    display: none;
  }

  .chat-panel {
    height: 100%;
  }

  .chat-header {
    height: calc(66px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 16px 0;
  }

  .scope-bar {
    min-height: 32px;
    padding: 5px 16px;
    font-size: 10px;
  }

  .chat-scroll {
    padding: 18px 16px 8px;
  }

  .chat-stream {
    gap: 16px;
  }

  .composer-wrap {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .scroll-bottom {
    right: 16px;
    bottom: calc(104px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  .chat-header {
    height: calc(64px + env(safe-area-inset-top));
  }

  .avatar--header {
    width: 36px;
    height: 36px;
  }

  .chat-name {
    font-size: 14.5px;
  }

  .chat-status {
    font-size: 10px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .cta-pill {
    height: 36px;
    padding: 0 12px;
    font-size: 11.5px;
  }

  .cta-pill svg {
    display: none;
  }

  .chat-identity {
    gap: 9px;
  }

  .chat-actions {
    gap: 6px;
  }

  .scope-bar {
    justify-content: flex-start;
    padding-left: 16px;
  }

  .chat-scroll {
    padding: 16px 14px 8px;
  }

  .chat-stream {
    gap: 15px;
  }

  .msg {
    gap: 8px;
  }

  .avatar--msg {
    width: 28px;
    height: 28px;
  }

  .msg-content {
    max-width: calc(100% - 36px);
  }

  .msg--user .msg-content {
    max-width: 88%;
  }

  .bubble {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.7;
    border-radius: 16px 16px 16px 6px;
  }

  .msg--user .bubble {
    border-radius: 16px 16px 6px 16px;
  }

  .bubble-note {
    font-size: 11px;
  }

  .chip {
    min-height: 33px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .hook-card {
    padding: 18px 17px 16px;
    border-radius: 20px;
  }

  .hook-title {
    margin-top: 14px;
    font-size: 20px;
  }

  .hook-copy {
    font-size: 12px;
  }

  .hook-actions {
    gap: 7px;
    margin-top: 15px;
  }

  .hook-btn {
    min-height: 39px;
    padding: 0 13px;
    font-size: 11.5px;
  }

  .composer-wrap {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .composer {
    padding: 6px 6px 6px 14px;
    border-radius: 22px;
  }

  #messageInput {
    font-size: 16px;
    padding: 7px 0;
  }

  .send-btn {
    width: 42px;
    height: 42px;
  }

  .composer-note {
    margin-top: 7px;
    font-size: 10.5px;
  }

  .scroll-bottom {
    right: 14px;
    bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .lead-sheet {
    width: 100%;
    max-height: calc(var(--app-h, 100dvh) - 12px);
    padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 26px 26px 0 0;
  }

  .sheet-handle {
    display: block;
    width: 38px;
    height: 4px;
    margin: -8px auto 16px;
    border-radius: 999px;
    background: var(--line-strong);
  }

  .sheet-close {
    top: 14px;
    right: 14px;
  }

  .sheet-head {
    padding-right: 30px;
  }

  .sheet-head h2,
  .lead-success h2 {
    font-size: 24px;
  }

  .sheet-sub {
    font-size: 13px;
  }

  .lead-form {
    margin-top: 20px;
  }
}

@media (min-width: 641px) {
  .lead-dialog[open] {
    align-items: center;
  }
}

@media (max-height: 720px) and (min-width: 961px) {
  .brand-copy {
    padding: 26px 0 20px;
  }

  .brand-headline {
    font-size: 42px;
  }

  .brand-sub {
    margin-top: 18px;
  }

  .brand-note {
    display: none;
  }

  .chat-header {
    height: 68px;
  }

  .chat-scroll {
    padding-top: 18px;
  }
}

/* ---------- motion ---------- */

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.42;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(199, 243, 107, 0.26);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(199, 243, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(199, 243, 107, 0);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.bubble-tag {
  display: inline-block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.hook-btn.is-done {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 249, 241, 0.5);
  cursor: default;
  transform: none;
}

@media (max-width: 640px) {
  .empty-guide {
    padding: 14px 16px;
    border-radius: 16px;
  }

  .guide-steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .guide-steps li {
    align-items: center;
  }

  .guide-copy {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
  }

  .guide-copy strong {
    flex: none;
  }

  .guide-copy span {
    font-size: 10px;
  }

  .hook-note {
    font-size: 10.5px;
  }
}

@media (max-height: 700px) {
  .chat-stream.is-empty {
    justify-content: flex-start;
  }
}

@media (max-height: 620px) {
  .empty-guide {
    display: none;
  }
}
