:root {
  color-scheme: light;
  --ink: #24312c;
  --ink-soft: #52625b;
  --paper: #f4f2eb;
  --surface: #fbfaf6;
  --surface-strong: #ffffff;
  --line: #d8d9d0;
  --moss: #526c5d;
  --moss-dark: #354b3f;
  --moss-pale: #e5ebe5;
  --danger: #8b4d45;
  --shadow: 0 12px 30px rgba(42, 54, 48, 0.1);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --serif: ui-serif, "Songti SC", "Noto Serif CJK SC", STSong, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.drawer-open { overflow: hidden; }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid rgba(82, 108, 93, 0.32);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  background: var(--moss-dark);
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid rgba(82, 98, 91, 0.13);
  background: rgba(244, 242, 235, 0.94);
  backdrop-filter: blur(18px);
}
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-seal {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #f9f6ed;
  background: var(--moss-dark);
  font-family: var(--serif);
  font-size: 22px;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 0.08em; }
.brand-copy small { margin-top: 4px; color: var(--ink-soft); font-size: 12px; letter-spacing: 0.06em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.text-button, .icon-button, .identity-pill, .voice-button, .quick-starts button {
  border: 0;
  cursor: pointer;
  background: transparent;
}
.text-button { padding: 8px 10px; color: var(--ink-soft); font-size: 14px; }
.text-button:hover { color: var(--moss-dark); }
.identity-pill {
  min-width: 42px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--moss-dark);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(520px, 1.18fr);
  gap: clamp(28px, 5vw, 84px);
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 64px);
}
.avatar-stage { position: sticky; top: 104px; align-self: start; min-width: 0; }
.avatar-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(82, 98, 91, 0.16);
  border-radius: var(--radius-lg);
  background: #dfe4dc;
  box-shadow: var(--shadow);
}
.avatar-frame::before {
  position: absolute;
  z-index: 3;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}
.avatar-frame img,
.avatar-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.avatar-frame video { position: absolute; z-index: 1; inset: 0; background: #dfe4dc; }
.avatar-frame img { position: relative; z-index: 0; transition: transform 360ms ease, filter 360ms ease; }
.avatar-frame[data-state="listening"] img { transform: scale(1.012); filter: saturate(0.96) contrast(1.01); }
.avatar-frame[data-state="thinking"] img { filter: saturate(0.88) brightness(0.98); }
.avatar-frame[data-state^="speaking"] img,
.avatar-frame[data-state="scripture-reading"] img { transform: scale(1.008); }
.avatar-light {
  position: absolute;
  z-index: 4;
  right: 26px;
  bottom: 26px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7da18a;
  box-shadow: 0 0 0 7px rgba(125, 161, 138, 0.18);
}
.avatar-state {
  position: absolute;
  z-index: 5;
  bottom: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 120px);
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: white;
  background: rgba(36, 49, 44, 0.72);
  backdrop-filter: blur(12px);
  font-size: 13px;
}
.state-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #d9eadb; }
.avatar-media-actions {
  position: absolute;
  z-index: 6;
  right: 16px;
  top: 16px;
  display: flex;
  gap: 7px;
}
.avatar-media-actions button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  cursor: pointer;
  color: white;
  background: rgba(36, 49, 44, 0.72);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 700;
}
.avatar-caption { padding: 22px 10px 0; }
.avatar-caption h2 { margin: 4px 0 8px; font-family: var(--serif); font-size: clamp(23px, 2.2vw, 32px); line-height: 1.3; }
.eyebrow { margin: 0; color: var(--moss); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.quiet-note, .privacy-note, .drawer-intro, .care-control p { color: var(--ink-soft); font-size: 13px; }

.conversation { min-width: 0; padding-top: clamp(18px, 4vw, 62px); }
.hero { max-width: 760px; }
.hero h1 {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 14px 0 22px;
  font-family: var(--serif);
  font-size: clamp(32px, 4.2vw, 62px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero h1 span { display: block; }
.hero-emphasis { margin-top: 10px; color: var(--moss-dark); }
.product-explanation { max-width: 650px; margin: 0; color: var(--ink-soft); font-family: var(--serif); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.75; }
.first-use {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(251, 250, 246, 0.72);
}
.first-use p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.first-use button { flex: 0 0 auto; border: 0; cursor: pointer; color: var(--moss-dark); background: transparent; font-weight: 700; }

.composer {
  margin-top: 30px;
  padding: 20px;
  border: 1px solid rgba(82, 98, 91, 0.16);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(42, 54, 48, 0.07);
}
.composer > label { display: block; margin: 0 0 10px; font-family: var(--serif); font-size: 18px; font-weight: 700; }
.input-wrap { position: relative; }
textarea {
  display: block;
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: 16px 74px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: #fbfaf6;
  line-height: 1.7;
}
textarea::placeholder { color: #6e7b75; }
textarea:focus { border-color: var(--moss); background: white; }
.voice-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-width: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--moss-dark);
  font-size: 13px;
  font-weight: 700;
}
.voice-button.is-listening { color: white; background: var(--moss-dark); }
.quick-starts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick-starts button {
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}
.quick-starts button:hover { border-color: #9aaca1; color: var(--moss-dark); background: var(--moss-pale); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; }
.privacy-note { margin: 0; }
.primary-button, .secondary-button, .danger-button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 700;
}
.primary-button { border: 1px solid var(--moss-dark); color: white; background: var(--moss-dark); }
.primary-button:hover { background: #293e33; }
.primary-button:disabled { cursor: wait; opacity: 0.62; }
.secondary-button { border: 1px solid var(--line); color: var(--moss-dark); background: var(--surface-strong); }
.danger-button { border: 1px solid rgba(139, 77, 69, 0.28); color: var(--danger); background: #fff9f7; }

.response {
  margin: 34px 0 24px;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgba(82, 98, 91, 0.16);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}
.response-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.response-heading h2 { margin: 4px 0 0; font-family: var(--serif); font-size: clamp(24px, 2.5vw, 34px); line-height: 1.3; text-wrap: balance; }
.icon-button { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: var(--surface); font-size: 13px; }
.response-sections { display: grid; gap: 16px; }
.response-section { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.response-section[data-kind="scripture"] { border-color: #cfc5ae; background: #faf7ef; }
.response-section[data-kind="commentary"] { border-color: #cbd5ce; background: #f4f7f3; }
.response-section h3 { margin: 0 0 8px; color: var(--moss-dark); font-size: 14px; letter-spacing: 0.04em; }
.response-section p { margin: 0; white-space: pre-wrap; }
.response-section blockquote { margin: 0; padding: 0; border: 0; font-family: var(--serif); font-size: 19px; line-height: 1.85; }
.source-card { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(82, 98, 91, 0.15); color: var(--ink-soft); font-size: 12px; }
.source-card a { width: fit-content; max-width: 100%; overflow-wrap: anywhere; color: var(--moss-dark); font-weight: 700; }
.source-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.scripture-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.scripture-controls button { min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--moss-dark); background: white; }
.scripture-controls button:disabled { cursor: not-allowed; opacity: 0.55; }
.memory-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

.drawer { position: fixed; z-index: 40; inset: 0; display: none; }
.drawer[aria-hidden="false"] { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(31, 39, 35, 0.42); backdrop-filter: blur(4px); }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(520px, 94vw); height: 100%; overflow-y: auto; padding: 28px; background: var(--surface); box-shadow: -12px 0 30px rgba(31, 39, 35, 0.16); }
.drawer-panel.compact { width: min(460px, 94vw); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.drawer-header h2 { margin: 4px 0 0; font-family: var(--serif); font-size: 28px; }
.drawer-intro { margin: 18px 0 22px; }
.memory-list { display: grid; gap: 12px; }
.memory-empty { padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--ink-soft); text-align: center; }
.memory-item { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.memory-item.is-resolved { opacity: 0.72; }
.memory-item h3 { margin: 0 0 7px; font-size: 16px; }
.memory-item p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.memory-item-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.memory-item-actions button { min-height: 38px; padding: 6px 8px; border: 0; cursor: pointer; color: var(--moss-dark); background: transparent; font-size: 12px; }
.memory-item-actions button[data-action="delete"] { color: var(--danger); }
.care-control { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.care-control p { margin: 3px 0 0; }
.switch { position: relative; display: inline-flex; align-items: center; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch > span:not(.sr-only) { position: relative; display: block; width: 46px; height: 26px; border-radius: 999px; background: #c8cec9; transition: background 160ms ease; }
.switch > span:not(.sr-only)::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(31, 39, 35, 0.2); content: ""; transition: transform 160ms ease; }
.switch input:checked + span { background: var(--moss); }
.switch input:checked + span::after { transform: translateX(20px); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.toast { position: fixed; z-index: 80; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 12px 15px; border-radius: 12px; color: white; background: var(--moss-dark); box-shadow: var(--shadow); font-size: 14px; }
.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; }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; width: min(760px, 100%); padding: 24px; }
  .avatar-stage { position: static; display: grid; grid-template-columns: minmax(180px, 0.68fr) minmax(220px, 1fr); align-items: end; gap: 22px; }
  .avatar-frame { max-height: 480px; }
  .avatar-caption { padding: 0 0 16px; }
  .conversation { padding-top: 10px; }
}

@media (max-width: 600px) {
  body {
    background:
      radial-gradient(circle at 18% -6%, rgba(105, 133, 116, 0.18), transparent 32%),
      #f3f5f1;
  }

  .topbar {
    min-height: 66px;
    padding: max(9px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 9px max(14px, env(safe-area-inset-left));
    border-bottom-color: rgba(53, 75, 63, 0.08);
    background: rgba(247, 248, 245, 0.88);
    backdrop-filter: blur(20px) saturate(1.15);
  }
  .brand-lockup { gap: 10px; }
  .brand-seal {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 21px;
    box-shadow: 0 5px 12px rgba(42, 54, 48, 0.16);
  }
  .brand-copy strong { font-size: 18px; letter-spacing: 0.07em; }
  .brand-copy small { display: block; margin-top: 2px; font-size: 10px; letter-spacing: 0.04em; }
  .top-actions { gap: 2px; }
  .top-actions .text-button,
  .identity-pill { min-height: 44px; }
  .top-actions .text-button { padding-inline: 7px; font-size: 13px; }
  .identity-pill {
    min-width: 44px;
    padding-inline: 10px;
    border-color: rgba(53, 75, 63, 0.2);
    background: rgba(255, 255, 255, 0.72);
  }

  .app-shell { display: block; width: 100%; padding: 12px 14px 30px; }
  .avatar-stage { position: relative; top: auto; display: block; }
  .avatar-frame {
    width: 100%;
    max-height: none;
    aspect-ratio: 16 / 10;
    border: 0;
    border-radius: 18px;
    background: #d8dfd7;
    box-shadow: 0 18px 36px rgba(38, 52, 45, 0.16);
  }
  .avatar-frame::before { border-color: rgba(255, 255, 255, 0.32); }
  .avatar-frame::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    background: linear-gradient(180deg, rgba(23, 36, 29, 0.02) 36%, rgba(23, 36, 29, 0.64) 100%);
    content: "";
    pointer-events: none;
  }
  .avatar-frame img, .avatar-frame video { object-position: center 16%; }
  .avatar-state {
    top: 14px;
    bottom: auto;
    left: 14px;
    max-width: calc(100% - 96px);
    padding: 7px 11px;
    border-color: rgba(255, 255, 255, 0.36);
    background: rgba(35, 50, 42, 0.58);
    font-size: 12px;
  }
  .avatar-light { top: 19px; right: 19px; bottom: auto; }
  .avatar-media-actions { top: 56px; right: 12px; }
  .avatar-caption {
    position: absolute;
    z-index: 5;
    right: 18px;
    bottom: 17px;
    left: 18px;
    padding: 0;
    color: white;
    pointer-events: none;
  }
  .avatar-caption .eyebrow { color: rgba(255, 255, 255, 0.76); font-size: 10px; line-height: 1.45; letter-spacing: 0.06em; }
  .avatar-caption h2 { max-width: 86%; margin: 4px 0 0; color: white; font-size: 21px; line-height: 1.32; text-shadow: 0 2px 10px rgba(16, 24, 20, 0.28); }
  .avatar-caption .quiet-note { color: rgba(255, 255, 255, 0.8); }

  .conversation {
    display: flex;
    flex-direction: column;
    padding-top: 18px;
  }
  .hero {
    position: relative;
    order: 1;
    overflow: hidden;
    padding: 20px 18px 18px;
    border-radius: 18px;
    background: #e9eee8;
  }
  .hero::after {
    position: absolute;
    right: -8px;
    bottom: -36px;
    color: rgba(53, 75, 63, 0.055);
    font-family: var(--serif);
    font-size: 118px;
    line-height: 1;
    content: "取";
    pointer-events: none;
  }
  .hero > .eyebrow {
    position: relative;
    z-index: 1;
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--moss-dark);
    background: rgba(255, 255, 255, 0.56);
    font-size: 10px;
    line-height: 1.35;
    letter-spacing: 0.06em;
  }
  .hero h1 {
    position: relative;
    z-index: 1;
    gap: 1px;
    margin: 12px 0 12px;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.48;
    letter-spacing: -0.012em;
    text-wrap: pretty;
  }
  .hero h1 span { display: block; }
  .hero h1 span::after { content: none; }
  .hero h1 span:nth-child(3) { margin-top: 3px; }
  .hero-emphasis {
    margin-top: 11px;
    padding-top: 11px;
    border-top: 1px solid rgba(53, 75, 63, 0.18);
    color: var(--moss-dark);
    font-size: 29px;
    line-height: 1.28;
  }
  .product-explanation { position: relative; z-index: 1; max-width: 94%; font-size: 14.5px; line-height: 1.68; }

  .response { order: 2; }
  .composer {
    position: relative;
    order: 3;
    margin-top: 14px;
    padding: 17px;
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 28px rgba(37, 52, 44, 0.1);
  }
  .composer > label { margin-bottom: 10px; font-size: 20px; line-height: 1.35; }
  .input-wrap { border-radius: 14px; }
  textarea {
    min-height: 104px;
    padding: 14px 70px 14px 14px;
    border-color: #dfe5df;
    border-radius: 14px;
    background: #f6f8f5;
    line-height: 1.65;
  }
  textarea:focus {
    border-color: #819487;
    background: #fbfcfa;
    box-shadow: 0 0 0 4px rgba(82, 108, 93, 0.1);
  }
  .voice-button {
    right: 9px;
    bottom: 9px;
    min-width: 54px;
    min-height: 44px;
    border-color: rgba(53, 75, 63, 0.16);
    background: rgba(255, 255, 255, 0.86);
  }
  .quick-starts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
    overflow: visible;
    padding-bottom: 0;
  }
  .quick-starts button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 64px;
    padding: 10px;
    border: 0;
    border-radius: 14px;
    color: #405248;
    background: #f1f4f0;
    font-size: 12.5px;
    line-height: 1.38;
    text-align: left;
    white-space: normal;
    transition: transform 160ms ease, background 160ms ease;
  }
  .quick-starts button::before {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 50%;
    color: var(--moss-dark);
    background: #dfe8df;
    font-family: var(--serif);
    font-size: 13px;
    font-weight: 700;
  }
  .quick-starts button:nth-child(1)::before { content: "听"; }
  .quick-starts button:nth-child(2)::before { content: "歇"; }
  .quick-starts button:nth-child(3)::before { content: "静"; }
  .quick-starts button:nth-child(4)::before { content: "经"; }
  .quick-starts button:active { transform: scale(0.985); background: #e7ede7; }

  .composer-actions { align-items: stretch; flex-direction: column; gap: 8px; margin-top: 13px; }
  .primary-button {
    position: relative;
    order: -1;
    width: 100%;
    min-height: 52px;
    padding-right: 46px;
    border-radius: 14px;
    box-shadow: 0 7px 13px rgba(38, 57, 47, 0.18);
  }
  .primary-button::after {
    position: absolute;
    top: 50%;
    right: 18px;
    font-size: 18px;
    font-weight: 400;
    content: "→";
    transform: translateY(-52%);
  }
  .privacy-note { width: 100%; margin: 0; font-size: 11.5px; line-height: 1.5; text-align: center; }

  .first-use {
    order: 4;
    align-items: center;
    gap: 9px;
    margin: 11px 2px 0;
    padding: 10px 0 0;
    border: 0;
    border-top: 1px solid rgba(82, 98, 91, 0.12);
    border-radius: 0;
    background: transparent;
  }
  .first-use::before {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 1px solid rgba(53, 75, 63, 0.18);
    border-radius: 50%;
    color: var(--moss-dark);
    font-size: 9px;
    font-weight: 800;
    content: "AI";
  }
  .first-use p { font-size: 11px; line-height: 1.58; }
  .first-use button { min-width: 50px; min-height: 44px; margin: 0 -4px 0 0; padding: 5px 4px; font-size: 12px; }

  .response { margin-top: 16px; padding: 16px; border-radius: 16px; }
  .response-heading { align-items: flex-start; }
  .response-section { padding: 15px; }
  .response-section blockquote { font-size: 18px; }
  .drawer-panel { top: auto; bottom: 0; width: 100%; height: min(88vh, 760px); padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
  .toast { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); left: 14px; max-width: none; }
}

/* Approved mobile art direction: preserve jueban-master-v1 and reproduce the selected layout. */
@media (max-width: 600px) {
  body {
    background: #f5f3ee;
  }

  .topbar {
    min-height: 78px;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    border-bottom: 0;
    background: rgba(245, 243, 238, 0.94);
    backdrop-filter: blur(18px) saturate(1.08);
  }
  .brand-lockup { gap: 11px; }
  .brand-seal {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #29483a;
    font-size: 26px;
    box-shadow: none;
  }
  .brand-copy { line-height: 1.12; }
  .brand-copy strong {
    font-size: 22px;
    letter-spacing: 0.04em;
  }
  .brand-copy small {
    display: block;
    margin-top: 5px;
    color: #4c5d55;
    font-size: 12px;
    letter-spacing: 0;
  }
  .top-actions { gap: 5px; }
  .top-actions .text-button {
    min-height: 44px;
    padding-inline: 7px;
    color: #2d4037;
    font-size: 14px;
  }
  .identity-pill {
    min-width: 48px;
    min-height: 48px;
    padding: 0 12px;
    border-color: rgba(41, 72, 58, 0.22);
    background: rgba(250, 249, 245, 0.76);
    font-size: 15px;
  }

  .app-shell {
    display: block;
    width: 100%;
    padding: 12px 14px 30px;
  }

  .avatar-stage {
    position: relative;
    top: auto;
    display: block;
  }
  .avatar-frame {
    width: 100%;
    max-height: none;
    aspect-ratio: 1.78 / 1;
    border: 0;
    border-radius: 18px;
    background: #9ca79d;
    box-shadow: 0 8px 18px rgba(39, 56, 47, 0.13);
  }
  .avatar-frame::before {
    z-index: 3;
    border-color: rgba(255, 255, 255, 0.24);
  }
  .avatar-frame::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    background:
      linear-gradient(90deg, rgba(39, 55, 47, 0.82) 0%, rgba(44, 60, 52, 0.66) 36%, rgba(44, 60, 52, 0.1) 70%, transparent 100%),
      linear-gradient(180deg, rgba(21, 31, 26, 0.03) 54%, rgba(21, 31, 26, 0.18) 100%);
    content: "";
    pointer-events: none;
  }
  .avatar-frame img,
  .avatar-frame video {
    object-position: 72% 16%;
  }
  .avatar-state {
    top: 16px;
    bottom: auto;
    left: 18px;
    max-width: calc(100% - 100px);
    padding: 8px 13px;
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(43, 72, 58, 0.68);
    font-size: 12px;
  }
  .state-dot {
    width: 8px;
    height: 8px;
    background: #a8d4b5;
  }
  .avatar-light { display: none; }
  .avatar-media-actions {
    top: 14px;
    right: 14px;
  }
  .avatar-caption {
    position: absolute;
    z-index: 5;
    top: 67px;
    right: auto;
    bottom: auto;
    left: 20px;
    width: 61%;
    padding: 0;
    color: white;
    pointer-events: none;
  }
  .avatar-caption .eyebrow {
    color: rgba(255, 255, 255, 0.82);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0.02em;
  }
  .avatar-caption h2 {
    max-width: 100%;
    margin: 7px 0 0;
    color: white;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 9px rgba(17, 26, 21, 0.28);
  }
  .avatar-divider {
    display: block;
    width: 30px;
    height: 1px;
    margin: 10px 0 8px;
    background: rgba(255, 255, 255, 0.66);
  }
  .avatar-slogan {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12.5px;
    line-height: 1.45;
  }
  .avatar-caption .quiet-note {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 10px;
  }

  .conversation {
    display: block;
    padding-top: 0;
  }
  .hero {
    position: relative;
    overflow: visible;
    max-width: none;
    margin: 0;
    padding: 32px 6px 28px 56px;
    border-radius: 0;
    background: transparent;
  }
  .hero::before {
    position: absolute;
    top: 30px;
    bottom: 28px;
    left: 20px;
    width: 1px;
    background: rgba(58, 88, 72, 0.48);
    content: "";
  }
  .hero::after { display: none; content: none; }
  .hero-marker {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 4px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: #f6f4ee;
    background: #617565;
    transform: translateY(-50%);
  }
  .hero-marker svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }
  .hero > .eyebrow { display: none; }
  .hero h1 {
    gap: 6px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.48;
    letter-spacing: -0.02em;
    text-wrap: pretty;
  }
  .hero h1 span {
    display: block;
  }
  .hero h1 span:nth-child(3) {
    margin-top: 0;
    font-size: 16.5px;
  }
  .hero-emphasis {
    margin-top: 8px;
    padding-top: 0;
    border-top: 0;
    color: #29483a;
    font-size: 28px;
    font-weight: 650;
    line-height: 1.28;
  }
  .hero-emphasis::after {
    display: block;
    width: 28px;
    height: 1px;
    margin-top: 9px;
    background: rgba(41, 72, 58, 0.48);
    content: "";
  }
  .product-explanation {
    max-width: 100%;
    margin-top: 13px;
    color: #59675f;
    font-family: var(--sans);
    font-size: 12.5px;
    line-height: 1.58;
  }

  .response {
    margin: 0 0 14px;
    padding: 16px;
    border-radius: 16px;
  }

  .composer {
    position: relative;
    margin: 0;
    padding: 18px;
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 7px 16px rgba(44, 58, 51, 0.09);
  }
  .composer > label {
    margin-bottom: 13px;
    color: #29483a;
    font-family: var(--sans);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
  }
  .input-wrap { border-radius: 14px; }
  textarea {
    min-height: 88px;
    padding: 15px 58px 15px 15px;
    border-color: #dedfd9;
    border-radius: 13px;
    color: #2a3832;
    background: #f7f5f1;
    font-size: 15px;
    line-height: 1.6;
  }
  textarea::placeholder { color: #747d78; }
  textarea:focus {
    border-color: #84968b;
    background: #fbfaf7;
    box-shadow: 0 0 0 4px rgba(82, 108, 93, 0.09);
  }
  .voice-button {
    right: 10px;
    bottom: 10px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #617565;
  }
  .voice-button:not(.is-listening) {
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }
  .voice-button:not(.is-listening)::before {
    display: block;
    width: 25px;
    height: 25px;
    margin: auto;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M26 6C15 7 8 12 8 21c6 1 13-2 16-8M8 25c4-7 9-11 16-14' fill='none' stroke='%23617565' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    content: "";
  }
  .voice-button.is-listening {
    border-radius: 999px;
    color: white;
    background: #29483a;
    font-size: 11px;
  }

  .composer-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    margin-top: 14px;
  }
  .primary-button {
    position: relative;
    order: 0;
    width: 100%;
    min-height: 56px;
    padding: 12px 52px 12px 20px;
    border: 0;
    border-radius: 13px;
    color: white;
    background: #29483a;
    box-shadow: none;
    font-size: 17px;
    font-weight: 650;
  }
  .primary-button::after {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 58px;
    height: 42px;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 42'%3E%3Cpath d='M60 4C38 6 24 15 23 34c13 2 27-6 34-20M20 39c9-15 20-24 37-31' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' opacity='.22'/%3E%3C/svg%3E");
    content: "";
    transform: translateY(-50%);
  }
  .privacy-note { display: none; }

  .quick-starts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    overflow: visible;
  }
  .quick-starts button {
    display: flex;
    min-width: 0;
    min-height: 104px;
    padding: 11px 5px 10px;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    gap: 7px;
    border: 0;
    border-radius: 15px;
    color: #30433a;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 5px 12px rgba(48, 61, 54, 0.07);
    font-size: 11px;
    line-height: 1.36;
    text-align: center;
    white-space: normal;
    transition: transform 160ms ease, background 160ms ease;
  }
  .quick-starts button::before { display: none; content: none; }
  .quick-starts button svg {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    fill: none;
    stroke: #5f7566;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }
  .quick-starts button span { display: block; }
  .quick-starts button:active {
    transform: scale(0.98);
    background: #edf1ec;
  }

  .first-use {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 0;
    padding: 11px 13px;
    border: 1px solid rgba(82, 98, 91, 0.12);
    border-radius: 14px;
    background: rgba(249, 248, 244, 0.72);
  }
  .first-use::before { display: none; content: none; }
  .disclosure-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    fill: none;
    stroke: #6f8777;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
  }
  .first-use p {
    margin: 0;
    color: #69736e;
    font-size: 10.8px;
    line-height: 1.5;
  }
  .first-use button { display: none; }

  .drawer-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(88vh, 760px);
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }
  .toast {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 340px) {
  .app-shell { padding-right: 10px; padding-left: 10px; }
  .hero h1 { font-size: 20px; }
  .hero-emphasis { font-size: 27px; }
  .quick-starts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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