:root {
  --paper: #f5f8ff;
  --paper-2: #edf3ff;
  --mist: #e7efff;
  --blush: #f2f6ff;
  --ink: #102341;
  --ink-soft: #405675;
  --muted: #5f7391;
  --faint: #5f7391;
  --line: rgba(34, 78, 143, 0.13);
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --jade: #2f6fed;
  --jade-dark: #1f5bd8;
  --night: #12366b;
  --danger: #d93b51;
  --shadow-low: 0 8px 24px rgba(30, 74, 138, 0.08);
  --shadow-mid: 0 18px 48px rgba(30, 74, 138, 0.14);
  --shadow-dock: 0 -10px 32px rgba(30, 74, 138, 0.09);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --keyboard-offset: 0px;
  --visual-viewport-height: 100dvh;
  color-scheme: light;
  font-family: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #eaf0fb;
  color: var(--ink);
}

.invite-gate {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 24px;
  background: var(--paper);
}

.invite-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--jade);
  color: #ffffff;
  font: 800 38px/1 inherit;
  box-shadow: 0 14px 30px rgba(47, 111, 237, 0.24);
}

.invite-gate h1 { margin: 10px 0 12px; }
.invite-form { margin-top: 28px; }
.invite-form label { display: block; margin-bottom: 8px; font-weight: 700; }
.invite-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}
.invite-form .primary-action { width: 100%; margin-top: 14px; }
.invite-error { margin-top: 12px; color: var(--danger); }

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(47, 111, 237, 0.24);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: #eaf0fb;
}

.phone {
  width: min(100vw, 460px);
  min-height: 100vh;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

.phone::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  width: min(100vw, 460px);
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(245, 248, 255, 0) 34%);
  z-index: 0;
}

.screen,
.call-screen,
.chat-screen {
  position: relative;
  z-index: 1;
}

.screen {
  min-height: 100vh;
  padding: 18px 18px calc(112px + var(--safe-bottom));
}

.home-screen {
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(94px + var(--safe-bottom));
  background: transparent;
}

.topbar {
  height: 52px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-low);
}

.icon-button.hidden {
  visibility: hidden;
}

.titlebar {
  min-width: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.hero-card {
  flex: 0 0 auto;
  margin-top: 12px;
  min-height: 220px;
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.82), rgba(246, 235, 220, 0.94)),
    #f6ede2;
  box-shadow: var(--shadow-mid);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 23px;
  border: 1px solid rgba(126, 98, 67, 0.12);
  pointer-events: none;
}

.hero-topline {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: auto;
}

.memory-scene {
  position: relative;
  z-index: 1;
  height: 170px;
  margin: 18px -8px 22px;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(224, 203, 176, 0.45)),
    linear-gradient(90deg, rgba(206, 181, 151, 0.18), rgba(255, 255, 255, 0.55));
  box-shadow: inset 0 0 70px rgba(116, 85, 50, 0.12);
}

.scene-window {
  position: absolute;
  left: 74px;
  top: 18px;
  width: 170px;
  height: 84px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.1) 49%, rgba(150,118,82,0.12) 50%, rgba(255,255,255,0.1) 51%),
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(229,211,184,0.6));
  box-shadow: 0 20px 45px rgba(158, 124, 83, 0.2);
}

.scene-book {
  position: absolute;
  left: 94px;
  bottom: 34px;
  width: 140px;
  height: 44px;
  border-radius: 7px 18px 10px 8px;
  background:
    linear-gradient(90deg, #f8f1e8 0 48%, #e7d6c0 49% 51%, #fff8ef 52%),
    #f8f1e8;
  transform: rotate(-4deg);
  box-shadow: 0 16px 26px rgba(118, 86, 51, 0.16);
}

.scene-cup {
  position: absolute;
  right: 42px;
  bottom: 36px;
  width: 38px;
  height: 34px;
  border-radius: 5px 5px 16px 16px;
  background: #efe0cb;
  box-shadow: 0 12px 24px rgba(118, 86, 51, 0.14);
}

.scene-vase {
  position: absolute;
  right: 88px;
  bottom: 33px;
  width: 22px;
  height: 54px;
  border-radius: 12px 12px 8px 8px;
  background: #d7bea0;
  opacity: 0.8;
}

.kicker {
  display: block;
  color: var(--jade-dark);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 9px;
}

.hero-card .kicker {
  color: var(--jade-dark);
  margin-top: 28px;
}

.headline {
  margin: 0;
  max-width: 10.5em;
  font-size: clamp(30px, 7.5vw, 38px);
  line-height: 1.16;
  font-weight: 850;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 21em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.62;
}

.panel {
  margin-top: 14px;
  background: rgba(255, 252, 247, 0.92);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-low);
  backdrop-filter: blur(18px);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.topic-note {
  color: var(--jade-dark);
  font-size: 12px;
  font-weight: 750;
}

.pill {
  border-radius: 999px;
  background: #efe2d0;
  color: var(--jade-dark);
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.topic-title {
  margin: 12px 0 6px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
}

.body-copy {
  color: var(--muted);
  line-height: 1.68;
  margin: 0;
}

.feature-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.feature {
  background: rgba(255, 252, 247, 0.8);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow-low);
}

.feature strong {
  display: block;
  font-size: 17px;
  margin-bottom: 5px;
}

.feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #f2e6d6;
  color: var(--jade-dark);
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  font-weight: 900;
}

.feature span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.home-actions {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 14px;
}

.main-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100vw, 460px);
  z-index: 24;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0), rgba(255, 252, 247, 0.92) 22%, rgba(255, 252, 247, 0.99));
  box-shadow: 0 -18px 36px rgba(90, 67, 45, 0.08);
}

.tab-item {
  min-height: 58px;
  border-radius: 18px;
  color: var(--muted);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 850;
}

.tab-item.active {
  color: var(--ink);
  background: #fffdf9;
  box-shadow: 0 10px 24px rgba(90, 67, 45, 0.11);
}

.tab-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.tab-label {
  font-size: 12px;
  line-height: 1;
}

.bottom-dock,
.control-dock,
.composer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100vw, 460px);
  z-index: 20;
}

.bottom-dock {
  padding: 16px 18px calc(16px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(251, 251, 247, 0), rgba(251, 251, 247, 0.94) 26%, rgba(251, 251, 247, 0.99));
}

.primary-action {
  width: 100%;
  min-height: 82px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 18%, rgba(154, 123, 82, 0.35), transparent 30%),
    var(--night);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 18px 28px;
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.22);
}

.primary-action strong {
  font-size: 25px;
  line-height: 1.05;
}

.primary-action span {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
}

.dock-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secondary-action {
  min-height: 52px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 850;
  box-shadow: var(--shadow-low);
}

.call-screen,
.chat-screen {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px 14px calc(118px + var(--safe-bottom));
}

.chat-screen {
  padding-bottom: calc(118px + var(--safe-bottom) + var(--keyboard-offset));
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(180deg, rgba(247, 239, 229, 0.88), rgba(246, 236, 224, 0.95));
}

.orb-zone {
  flex: 0 0 auto;
  padding: 20px 0 18px;
  text-align: center;
}

.orb {
  width: 132px;
  height: 132px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: radial-gradient(circle at 38% 28%, #ffffff, #e8f5f2 54%, #eaf3fb);
  box-shadow:
    inset 0 0 0 9px rgba(255, 255, 255, 0.92),
    0 22px 52px rgba(18, 168, 132, 0.2);
}

.call-screen .orb {
  background: radial-gradient(circle at 38% 28%, #fffdf8, #f1e3d1 58%, #eadbc7);
  box-shadow:
    inset 0 0 0 9px rgba(255, 255, 255, 0.92),
    0 22px 52px rgba(154, 123, 82, 0.2);
}

.orb::before,
.orb::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orb::before {
  inset: -9px;
  border: 1px solid rgba(18, 168, 132, 0.2);
}

.orb::after {
  inset: -20px;
  border: 1px solid rgba(18, 168, 132, 0.28);
  opacity: 0;
}

.orb.listening::after {
  animation: pulse 1.8s cubic-bezier(0.19, 1, 0.22, 1) infinite;
}

.orb-text {
  font-size: 48px;
  font-weight: 900;
  color: var(--ink-soft);
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.18); opacity: 0; }
}

.status-main {
  max-width: 360px;
  margin: 0 auto;
  font-size: 21px;
  line-height: 1.38;
  font-weight: 900;
}

.status-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.message-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 22px;
  scroll-behavior: smooth;
}

.message-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.message-row {
  display: flex;
  margin: 10px 0;
}

.message-row.elder {
  justify-content: flex-end;
}

.bubble {
  max-width: 84%;
  border-radius: 19px;
  padding: 14px 16px;
  line-height: 1.6;
  font-size: 16px;
  word-break: break-word;
  box-shadow: var(--shadow-low);
}

.assistant .bubble {
  background: rgba(255, 252, 247, 0.96);
  color: var(--ink-soft);
  border-top-left-radius: 7px;
}

.elder .bubble {
  background: linear-gradient(150deg, #9a7b52, #7d6140);
  color: #fff;
  border-top-right-radius: 7px;
}

.bubble-meta {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.74;
}

.chat-image {
  display: block;
  width: min(100%, 260px);
  max-height: 260px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
}

.live-bubble {
  min-width: 128px;
}

.thinking-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes blink {
  50% { opacity: 0.25; transform: translateY(-2px); }
}

.control-dock {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 15px 22px calc(15px + var(--safe-bottom));
  background: rgba(255, 252, 247, 0.92);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  box-shadow: var(--shadow-dock);
  backdrop-filter: blur(18px);
}

.control {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.round-button {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background: var(--surface-solid);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-low);
}

.round-button.active {
  background: var(--jade);
  color: #fff;
}

.round-button.dark {
  background: var(--night);
  color: #fff;
}

.round-button.danger {
  color: var(--danger);
}

.icon {
  width: 27px;
  height: 27px;
  display: block;
}

.topic-shelf {
  flex: 0 0 auto;
  padding: 8px 0 10px;
}

.topic-label {
  display: block;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.chips {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 0 2px 4px;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink-soft);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--shadow-low);
}

.composer {
  bottom: var(--keyboard-offset);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px 48px;
  gap: 10px;
  align-items: center;
  padding: 14px 14px calc(14px + var(--safe-bottom));
  background: rgba(255, 252, 247, 0.94);
  box-shadow: var(--shadow-dock);
  backdrop-filter: blur(18px);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  transition: bottom 160ms ease-out;
}

.composer .round-button {
  width: 48px;
  height: 48px;
  min-width: 48px;
}

.input-wrap {
  height: 52px;
  border-radius: 26px;
  background: rgba(246, 240, 232, 0.96);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.input-wrap.recording {
  background: #f2e6d6;
  outline: 2px solid rgba(154, 123, 82, 0.24);
}

.message-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.message-input::placeholder {
  color: #9aa39d;
}

.send-ready {
  background: var(--jade);
  color: #fff;
}

.voice-button {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

html.keyboard-open .topic-shelf {
  display: none;
}

html.keyboard-open .composer {
  padding-bottom: 14px;
  border-radius: 22px 22px 0 0;
}

@media (max-width: 380px) {
  .composer {
    grid-template-columns: 46px minmax(0, 1fr) 46px 46px;
    gap: 7px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .composer .round-button {
    width: 46px;
    height: 46px;
    min-width: 46px;
  }

  .input-wrap {
    padding: 0 13px;
  }
}

.records-list,
.memoir-view {
  padding-bottom: 124px;
}

.record-item {
  margin-top: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 17px;
  box-shadow: var(--shadow-low);
}

.record-title {
  margin: 0 0 8px;
  font-size: 18px;
}

.record-meta {
  color: var(--muted);
  font-size: 13px;
}

.book-cover {
  flex: 0 0 118px;
  min-height: 118px;
  margin-top: 10px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 252, 247, 0.88), rgba(224, 205, 181, 0.94)),
    #eadbc8;
  color: var(--ink);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-mid);
}

.book-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
}

.book-cover-content {
  position: relative;
  z-index: 1;
}

.book-title {
  margin: 0;
  font-size: 25px;
  line-height: 1.16;
}

.book-cover-content > p:last-child {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.memoir-view {
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(88px + var(--safe-bottom));
}

.field-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.field-stack .title-field {
  grid-column: 1 / -1;
}

.field-stack input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  outline: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.memoir-actions {
  flex: 0 0 auto;
  margin-top: 8px;
}

.memoir-actions .secondary-action {
  min-height: 48px;
  border: 1px solid var(--line);
  box-shadow: none;
}

.confirmation-panel {
  flex: 0 0 auto;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fffaf3;
  box-shadow: 0 8px 22px rgba(90, 67, 45, 0.08);
}

.confirmation-panel.needs-confirmation {
  background: #fff3e7;
}

.confirmation-panel.is-clear {
  background: #f2eee7;
}

.confirmation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.confirmation-head strong,
.confirmation-head span {
  display: block;
}

.confirmation-head strong {
  font-size: 15px;
}

.confirmation-head div > span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.confirmation-count {
  min-width: 32px;
  height: 32px;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  background: #ead7c1;
  color: #71452f;
  font-weight: 900;
}

.confirmation-question {
  display: -webkit-box;
  overflow: hidden;
  margin: 9px 0 0;
  color: #55382a;
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.confirmation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}

.confirmation-actions button {
  min-height: 48px;
  border-radius: 12px;
  background: #fffdf9;
  color: var(--ink);
  font-weight: 850;
}

.confirmation-actions button:first-child {
  background: var(--night);
  color: #fffdf9;
}

.memoir-reader {
  min-height: 0;
  flex: 1 1 auto;
  margin-top: 10px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: var(--shadow-low);
}

.reader-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.reader-toolbar div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.reader-toolbar strong {
  color: var(--ink);
  font-size: 15px;
}

.reader-page {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding: 13px 6px 8px;
}

.reader-kicker {
  margin: 0 0 5px;
  color: var(--jade-dark);
  font-size: 12px;
  font-weight: 850;
}

.reader-page h2 {
  margin: 0 0 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  line-height: 1.25;
}

.reader-summary {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.reader-body {
  margin: 0;
  color: var(--ink-soft);
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  line-height: 1.7;
}

.reader-empty {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.reader-empty strong {
  color: var(--ink);
}

.reader-controls {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  align-items: center;
  gap: 8px;
}

.reader-controls button {
  min-height: 48px;
  border-radius: 12px;
  background: #eee3d5;
  color: var(--ink);
  font-weight: 850;
}

.reader-controls button:disabled {
  opacity: 0.38;
  cursor: default;
}

.reader-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.reader-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d5c8b9;
}

.reader-dots span.active {
  width: 16px;
  border-radius: 999px;
  background: var(--jade-dark);
}

.chapter {
  margin-top: 16px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  line-height: 1.78;
  box-shadow: var(--shadow-low);
}

.chapter h3 {
  margin-top: 0;
}

.profile-card {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.92);
  box-shadow: var(--shadow-low);
}

.profile-mark {
  width: 66px;
  height: 66px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--night);
  color: #fffdf9;
  font: 38px/1 serif;
}

.profile-title {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.stats-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-tile {
  min-height: 88px;
  border-radius: 18px;
  padding: 14px 10px;
  background: rgba(255, 252, 247, 0.86);
  box-shadow: var(--shadow-low);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.stat-tile strong {
  font-size: 25px;
  line-height: 1;
}

.stat-tile span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.profile-row {
  width: 100%;
  min-height: 76px;
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  align-items: center;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 252, 247, 0.9);
  box-shadow: var(--shadow-low);
}

.profile-row > span {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: #efe2d0;
  color: var(--jade-dark);
}

.profile-row strong,
.profile-row em {
  display: block;
}

.profile-row strong {
  font-size: 16px;
}

.profile-row em {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

/*
  BLUE ARCHIVE SYSTEM
  Bright white surfaces, precise cobalt actions, cool borders and calm navy type.
  The product reads as a trusted digital archive while retaining large, forgiving controls.
*/
.topbar .icon-button.hidden {
  display: grid !important;
  visibility: hidden;
}

.icon-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

.titlebar {
  color: var(--ink);
  font-size: 16px;
}

.hero-card {
  border-radius: 16px;
  color: #ffffff;
  background: #1f5fd6;
  box-shadow: 0 18px 38px rgba(31, 95, 214, 0.22);
}

.hero-card::before {
  display: none;
}

.hero-card .kicker,
.hero-card .hero-copy {
  color: #dbe9ff;
}

.panel,
.feature,
.record-item,
.profile-card,
.stat-tile,
.profile-row,
.memoir-reader,
.chapter {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: none;
}

.topic-note,
.kicker,
.reader-kicker {
  color: var(--jade-dark);
}

.pill,
.feature-icon,
.profile-row > span {
  background: #e8f0ff;
  color: var(--jade-dark);
}

.main-tabbar {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.tab-item {
  border-radius: 14px;
}

.tab-item.active {
  color: var(--jade-dark);
  background: #e9f1ff;
  box-shadow: none;
}

.primary-action {
  min-height: 78px;
  border-radius: 16px;
  background: var(--jade);
  box-shadow: 0 14px 30px rgba(47, 111, 237, 0.24);
}

.primary-action span {
  color: #dbe9ff;
}

.secondary-action {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
}

.secondary-action:active,
.chip:active,
.profile-row:active,
.reader-controls button:active:not(:disabled) {
  background: #e8f0ff;
}

.call-screen,
.chat-screen {
  background: var(--paper);
}

.orb,
.call-screen .orb {
  background: #e8f1ff;
  box-shadow: inset 0 0 0 9px #ffffff, 0 18px 38px rgba(47, 111, 237, 0.16);
}

.orb::before {
  border-color: rgba(47, 111, 237, 0.22);
}

.orb::after {
  border-color: rgba(47, 111, 237, 0.34);
}

.orb-text {
  color: var(--night);
}

.bubble {
  border-radius: 16px;
  box-shadow: none;
}

.assistant .bubble {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink-soft);
}

.elder .bubble {
  background: var(--jade);
  color: #ffffff;
}

.control-dock,
.composer {
  border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-dock);
  backdrop-filter: blur(16px);
}

.round-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

.round-button.active,
.send-ready {
  border-color: transparent;
  background: var(--jade);
  color: #ffffff;
}

.round-button.dark {
  border-color: transparent;
  background: var(--night);
}

.chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink-soft);
  box-shadow: none;
}

.input-wrap {
  border: 1px solid var(--line);
  background: #f1f5fc;
}

.input-wrap.recording {
  background: #e8f0ff;
  outline-color: rgba(47, 111, 237, 0.24);
}

.message-input::placeholder {
  color: #5b6f8d;
}

.book-cover {
  border: 0;
  border-radius: 16px;
  background: #173f7a;
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(23, 63, 122, 0.2);
}

.book-cover-content > p:last-child,
.book-cover .kicker {
  color: #dbe9ff;
}

.field-stack input {
  background: #ffffff;
}

.confirmation-panel {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: none;
}

.confirmation-panel.is-clear {
  background: #edf4ff;
}

.confirmation-panel.needs-confirmation {
  border-color: rgba(196, 118, 22, 0.2);
  background: #fff8ea;
}

.confirmation-count {
  background: #dce9ff;
  color: var(--jade-dark);
}

.confirmation-question {
  color: #6b4a1e;
}

.confirmation-actions button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.confirmation-actions button:first-child {
  border-color: transparent;
  background: var(--jade);
  color: #ffffff;
}

.reader-page h2,
.reader-body {
  font-family: inherit;
}

.reader-controls button {
  border: 1px solid var(--line);
  background: #edf4ff;
  color: var(--jade-dark);
}

.reader-dots span {
  background: #bfcee4;
}

.reader-dots span.active {
  background: var(--jade);
}

.profile-mark {
  border-radius: 16px;
  background: var(--jade);
  color: #ffffff;
  font-family: inherit;
  font-weight: 850;
}

button {
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background-color 160ms ease-out, color 160ms ease-out;
}

button:active {
  transform: scale(0.98);
}

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

.hidden {
  display: none !important;
}

@media (min-width: 760px) {
  .phone,
  .bottom-dock,
  .control-dock,
  .composer,
  .main-tabbar {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 360px) {
  .headline {
    font-size: 30px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .bubble {
    max-width: 88%;
  }
}

@media (max-height: 800px) {
  .home-screen .hero-card {
    min-height: 184px;
  }

  .home-screen .hero-card .kicker {
    margin-top: 18px;
  }

  .home-screen .feature-grid {
    display: none;
  }

  .memoir-view .book-cover {
    flex-basis: 92px;
    min-height: 92px;
  }

  .memoir-view .book-title {
    font-size: 21px;
  }

  .memoir-view .book-cover-content > p:last-child {
    display: none;
  }

  .memoir-view .reader-summary {
    display: none;
  }

  .memoir-view .reader-page {
    padding-top: 8px;
  }
}
