@property --bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #f8f1f4;
}
@property --bg-elev {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff;
}
@property --bg-card {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff;
}
@property --bg-soft {
  syntax: "<color>";
  inherits: true;
  initial-value: #f0e6eb;
}
@property --line {
  syntax: "<color>";
  inherits: true;
  initial-value: #e2d4dc;
}
@property --text {
  syntax: "<color>";
  inherits: true;
  initial-value: #211b25;
}
@property --muted {
  syntax: "<color>";
  inherits: true;
  initial-value: #7a6b78;
}
@property --nav-bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffffff;
}
@property --nav-border {
  syntax: "<color>";
  inherits: true;
  initial-value: #eadfe5;
}
@property --hero-bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #fff7fa;
}
@property --status-bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #f0e8ed;
}
@property --field-bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #fff;
}

:root,
[data-theme="light"] {
  --coral: #f4a7b9;
  --fog: #9b8aa6;
  --cold: #7eb6d9;
  --comfort: #a8d5ba;
  --notice: #f5c97b;
  /* 浅色：日常 / Onboarding / 心绪 / 我的 */
  --bg: #f8f1f4;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-soft: #f0e6eb;
  --line: #e2d4dc;
  --text: #211b25;
  --muted: #7a6b78;
  --nav-bg: #ffffff;
  --nav-border: #eadfe5;
  --hero-bg: #fff7fa;
  --status-bg: #f0e8ed;
  --toast-bg: #3a3144;
  --toast-fg: #f6eef2;
  --field-bg: #fff;
  --radius: 12px;
  --max: 480px;
  --nav-h: 64px;
}

[data-theme="dark"] {
  --bg: #16121c;
  --bg-elev: #221c28;
  --bg-card: #2b2433;
  --bg-soft: #332c3a;
  --line: #5d4d61;
  --text: #f6eef2;
  --muted: #c3b4c4;
  --nav-bg: #1d1724;
  --nav-border: #3a3144;
  --hero-bg: #332c3a;
  --status-bg: #2f2838;
  --toast-bg: #3a3144;
  --toast-fg: #f6eef2;
  --field-bg: #1b1622;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
}

#app {
  width: min(100%, var(--max));
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

#app.subpage {
  padding-bottom: env(safe-area-inset-bottom);
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: var(--coral); }

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px;
  min-height: 52px;
}

.topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  flex: 1;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text);
}

.icon-btn:hover { background: #ffffff12; }

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page {
  padding: 4px 16px 24px;
}

.hero {
  background: var(--hero-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.hero h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.streak {
  min-width: 66px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4a7b923;
  text-align: center;
}

.streak strong {
  display: block;
  color: var(--coral);
  font-size: 1.4rem;
}

.streak span {
  font-size: 0.72rem;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 22px 0 8px;
}

.section-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.section-head span {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.moods {
  display: flex;
  gap: 4px;
}

.mood {
  flex: 1;
  height: 68px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mood span { font-size: 1.35rem; }
.mood small { font-size: 0.7rem; color: var(--muted); }
.mood.selected { background: color-mix(in srgb, var(--mood, var(--coral)) 18%, transparent); border-color: var(--mood, var(--coral)); }

.cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
}

.card {
  min-width: 86%;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 14px 12px 20px;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  text-align: left;
}

.pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 6px;
  background: #f4a7b926;
  font-size: 0.78rem;
}

.card h4 {
  margin: 18px 0 10px;
  font-size: 1.15rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
}

.card-actions .hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: auto;
}

.calendar {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.cal-day {
  width: 18px;
  height: 34px;
  border-radius: 5px;
  background: var(--bg-soft);
}

.status {
  margin-top: 14px;
  background: var(--status-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 52px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  width: 100%;
  text-align: left;
}

.status-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.status.is-connected,
.status.is-connected [data-status-text],
.status.is-connected .status-copy > span:first-child {
  color: var(--comfort);
}

.status.is-connected .status-hint {
  color: color-mix(in srgb, var(--comfort) 75%, var(--muted));
}

.status-float-slot {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 0 16px 8px;
  background: transparent;
}

.status.status-float {
  margin-top: 0;
  background: color-mix(in srgb, var(--status-bg) 55%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
}

.page-with-float {
  padding-top: 4px;
}

.device-section-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.device-block {
  margin-bottom: 14px;
}

.device-block .status {
  margin-top: 0;
}

.disclaimer {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--max));
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.64rem;
}

.nav button.active { color: var(--coral); }

.intimacy-home {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 60px - var(--nav-h) - env(safe-area-inset-bottom));
}

.entry-stack {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  min-height: 280px;
  margin: 4px 0 16px;
}

.entry {
  --entry-tint: var(--coral);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: 100%;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  text-align: left;
  border-radius: 28px;
  background:
    linear-gradient(165deg,
      color-mix(in srgb, var(--entry-tint) 26%, var(--bg-card)) 0%,
      var(--bg-card) 72%);
  border: 1px solid color-mix(in srgb, var(--entry-tint) 32%, var(--line));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--entry-tint) 14%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

.entry::before {
  width: 150px;
  height: 150px;
  right: -42px;
  top: -58px;
  background: color-mix(in srgb, var(--entry-tint) 22%, transparent);
}

.entry::after {
  width: 72px;
  height: 72px;
  right: 28px;
  bottom: -22px;
  background: color-mix(in srgb, var(--entry-tint) 14%, transparent);
}

.entry-scenario { --entry-tint: var(--coral); }
.entry-control { --entry-tint: color-mix(in srgb, var(--fog) 62%, var(--coral)); }

.entry-ico {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--entry-tint);
  background: color-mix(in srgb, var(--entry-tint) 24%, var(--bg-elev));
  box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--entry-tint) 12%, transparent);
}

.entry-ico .icon {
  width: 30px;
  height: 30px;
  stroke-width: 1.7;
}

/* 爱心路径偏下，光学居中；只用描边，避免 fill+stroke 叠成双心 */
.entry-scenario .entry-ico .icon {
  fill: none;
  stroke: currentColor;
  transform: translateY(1px);
}

.entry-copy { max-width: 16em; }
.entry h3 { margin: 0 0 6px; font-size: 1.38rem; letter-spacing: 0.01em; }
.entry p { margin: 0; color: var(--muted); font-size: 0.98rem; line-height: 1.45; }

@media (hover: hover) {
  .entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px color-mix(in srgb, var(--entry-tint) 20%, transparent);
  }
}

.entry:active { transform: scale(0.985); }

@media (prefers-reduced-motion: reduce) {
  .entry { transition: none; }
  .entry:hover,
  .entry:active { transform: none; }
}

.lead {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.sub {
  margin: 0 0 18px;
  color: var(--muted);
}

.note {
  background: #f5c97b1c;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  gap: 10px;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
}

.stop {
  width: 100%;
  height: 76px;
  border-radius: 14px;
  background: #f5c97b;
  color: #2a1f12;
  font-size: 1.45rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.stop:hover { filter: brightness(1.05); }

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

.power-actions button {
  min-height: 50px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--status-bg);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 650;
}

.power-actions .power-on.active {
  color: var(--comfort);
  border-color: color-mix(in srgb, var(--comfort) 65%, var(--line));
  background: color-mix(in srgb, var(--comfort) 12%, var(--status-bg));
}

.power-actions .power-off.active {
  color: var(--muted);
  border-color: var(--muted);
}

.power-actions button:disabled,
.control-page input:disabled,
.control-page .modes button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.power-hint {
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.auto-control-badge {
  display: inline-flex;
  align-self: center;
  margin: 8px auto 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--comfort) 14%, transparent);
  color: var(--comfort);
  font-size: 0.78rem;
}

.control-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 52px - env(safe-area-inset-bottom));
  padding-left: 12px;
  padding-right: 12px;
}

.control-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-height: 150px;
  padding: 10px 6px 6px;
}

.control-page .level {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 650;
}

.control-page input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 48px;
  background: transparent;
}

.control-page input[type="range"]::-webkit-slider-runnable-track {
  height: 18px;
  border-radius: 999px;
  background: var(--status-bg);
}

.control-page input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px #0004;
}

.control-page input[type="range"]::-moz-range-track {
  height: 18px;
  border-radius: 999px;
  background: var(--status-bg);
}

.control-page input[type="range"]::-moz-range-thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px #0004;
}

.level {
  margin: 24px 0 8px;
  font-size: 1.2rem;
  text-align: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--coral);
}

.modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 24px;
}

.modes button {
  border-radius: 10px;
  padding: 12px 8px;
  background: var(--status-bg);
}

.modes button.active {
  background: #f4a7b926;
  outline: 1.5px solid var(--coral);
}

.control-page .modes {
  margin-top: 8px;
}

.control-page .modes button {
  padding: 15px 8px;
  font-size: 1rem;
}

.control-page .hint {
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 14px 0 8px;
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 10px;
}

.list-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
}

.list-row.is-dim {
  opacity: 0.55;
}

.plugin-invite {
  margin: 12px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.plugin-advanced {
  margin: 28px 0 12px;
}

.plugin-advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.plugin-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}
.group { color: var(--coral); font-size: 0.8rem; margin: 24px 0 4px; }

/* 通道切换（蓝牙 / WiFi）。沿用 .modes button 的选中样式，
   免得同一个界面里出现两种"被选中"的视觉语言。 */
.chip {
  border-radius: 999px;
  padding: 6px 14px;
  margin: 4px 8px 4px 0;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.85rem;
}

.chip.active {
  background: #f4a7b926;
  outline: 1.5px solid var(--coral);
}

.list-row input[type="text"],
.list-row input[type="password"] {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--text);
  font-size: 0.95rem;
  border: 1px solid var(--line);
}

.list-row small .primary {
  margin: 8px 0 4px;
}

.primary, .ghost {
  width: 100%;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

.primary { background: var(--coral); color: #2a1520; }
.ghost { border: 1px solid var(--line); }

.scene {
  min-height: calc(100dvh - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 4px 20px;
}

.scene .grow { flex: 1; display: grid; place-items: center; }
.dots { display: flex; gap: 8px; margin: 24px 0; }
.dots i {
  width: 26px;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-soft);
  display: block;
}
.dots i.on { background: var(--coral); }

.sheet-bg {
  position: fixed;
  inset: 0;
  background: #0008;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}

.sheet {
  width: min(100%, var(--max));
  background: var(--bg-elev);
  border-radius: 16px 16px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 85dvh;
  overflow: auto;
}

.grab {
  width: 42px;
  height: 4px;
  border-radius: 2px;
  background: #5b5166;
  margin: 8px auto 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-fg);
  padding: 10px 16px;
  border-radius: 10px;
  z-index: 30;
  max-width: min(90vw, 420px);
}

#app.subpage + .toast, .subpage ~ .toast { bottom: 24px; }

textarea, .field {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  min-height: 120px;
  resize: vertical;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 20px 0;
}

/* —— Onboarding —— */
#app.onboarding {
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
}

.ob-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
}

.ob-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.ob-panel.ob-in {
  opacity: 1;
  transform: translateY(0);
}

.ob-panel.ob-out {
  opacity: 0;
  transform: translateY(-6px);
}

.ob-center {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px 8px;
}

.ob-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
}

.ob-kicker {
  margin: 0;
  color: var(--fog);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.ob-welcome {
  margin: 12px 0 0;
  font-size: 1.85rem;
  line-height: 1.45;
  font-weight: 650;
  color: var(--text);
}

.ob-stack h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.35;
}

.ob-sub {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.ob-age {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 18px 0 4px;
}

.ob-age strong {
  font-size: 2.6rem;
  color: var(--coral);
}

.ob-range {
  width: 100%;
  accent-color: var(--coral);
  margin: 8px 0 18px;
}

.ob-cta {
  margin-top: auto;
}

.ob-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.ob-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
}

.ob-bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 0.95rem;
}

.ob-bubble.ai {
  align-self: flex-start;
  background: var(--bg-soft);
}

.ob-bubble.me {
  align-self: flex-end;
  background: #f4a7b933;
}

.ob-input {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--field-bg);
  resize: vertical;
}

.ob-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
}

.ob-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.ob-card .ghost {
  width: auto;
  flex-shrink: 0;
  padding: 10px 14px;
}

.ob-choice {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ob-choice span {
  color: var(--muted);
  font-size: 0.86rem;
}

.ob-choice.selected {
  border-color: var(--coral);
  background: #f4a7b91a;
}

.ob-pair {
  margin: 12px 0;
  padding: 28px 16px;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: var(--bg-soft);
}

.ob-pair.ok {
  border-style: solid;
  border-color: var(--comfort);
  color: var(--text);
  background: #a8d5ba22;
}

.ob-placeholder {
  flex: 1;
  min-height: 180px;
  margin: 12px 0 20px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--bg-soft);
}

.ob-label {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.ob-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--field-bg);
}

.ob-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.ob-gift-card {
  margin: 8px 0 16px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}

.ob-gift-card h3 {
  margin: 14px 0 8px;
  font-size: 1.2rem;
}

.ob-gift-card > p {
  margin: 0 0 8px;
  line-height: 1.5;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ob-voice-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.ob-voice-btn {
  width: 100%;
  min-height: 48px;
}

.ob-voice-btn.listening {
  border-color: var(--coral);
  background: #f4a7b91a;
  color: var(--text);
}

.demo-note {
  margin: 28px 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.page .ob-choice {
  margin-bottom: 10px;
}

.page .ob-label {
  display: block;
  margin: 14px 0 6px;
}

.page select.ob-field {
  appearance: none;
}

.danger-row strong {
  color: #c45c6a;
}

.danger-btn {
  background: #c45c6a !important;
  color: #fff !important;
}

.notice-banner {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(92vw, 420px);
  width: max-content;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--coral) 45%, var(--line));
  background: color-mix(in srgb, var(--bg-elev) 88%, var(--coral));
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.danger-icon { color: #ff9b9b; }

.flow-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #4a4054;
  border-radius: 8px;
  background: #211b27;
}

.flow-note > span { color: var(--comfort); }
.flow-note div { display: flex; flex-direction: column; gap: 4px; }
.flow-note small { color: var(--muted); line-height: 1.4; }
.compact-flow { margin: 14px 0; }

.session-row {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.session-date, .session-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.session-date strong { font-size: 0.86rem; }
.session-date small, .session-main small { color: var(--muted); font-size: 0.74rem; }
.session-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quality {
  color: var(--quality, var(--comfort));
  border: 1px solid color-mix(in srgb, var(--quality, var(--comfort)) 45%, transparent);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.7rem;
  white-space: nowrap;
}

.record-title { padding: 8px 0 18px; }
.record-title h2 { margin: 10px 0 6px; font-size: 1.45rem; }
.record-title p { margin: 0; color: var(--muted); }
.mode-mark {
  display: inline-flex;
  color: var(--mode, var(--coral));
  font-size: 0.78rem;
  font-weight: 650;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #4a4054;
  border-left: 1px solid #4a4054;
}

.fact-grid div {
  min-height: 78px;
  padding: 12px;
  border-right: 1px solid #4a4054;
  border-bottom: 1px solid #4a4054;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.fact-grid span { color: var(--muted); font-size: 0.74rem; }
.fact-grid strong { font-size: 0.96rem; }

.record-section, .data-path {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.record-section h3, .data-path h3 { margin: 0 0 10px; font-size: 1rem; }
.record-section > p, .data-path li { color: var(--muted); line-height: 1.65; }
.data-path ol { margin: 0; padding-left: 22px; }

.mini-chart {
  height: 138px;
  padding: 12px 8px 22px;
  border-left: 1px solid #4a4054;
  border-bottom: 1px solid #4a4054;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
}

.chart-col {
  height: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  position: relative;
}

.chart-col > span { width: 10px; min-height: 4px; border-radius: 3px 3px 0 0; }
.pressure-bar { height: var(--pressure); background: var(--comfort); }
.level-bar { height: var(--level); background: var(--coral); }
.chart-col small { position: absolute; bottom: -19px; color: var(--muted); font-size: 0.66rem; }
.chart-legend { display: flex; gap: 16px; margin-top: 9px; color: var(--muted); font-size: 0.72rem; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; display: inline-block; border-radius: 2px; }
.pressure-key { background: var(--comfort); }
.level-key { background: var(--coral); }

.trend-copy { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.trend-copy span { color: var(--comfort); }
.trend-copy p { margin: 0; color: var(--text); }
.microcopy { color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.feedback { margin-top: 14px; padding-left: 12px; border-left: 3px solid var(--coral); }
.feedback p { margin: 5px 0 0; color: var(--muted); }

.saved-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.saved-note p { flex: 1; margin: 0; line-height: 1.55; }
.inline-command {
  min-height: 44px;
  margin-top: 10px;
  color: var(--coral);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.note-detail-page { padding-bottom: 150px; }
.note-scope-actions {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--max));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #1d1724f2;
  border-top: 1px solid #3a3144;
  backdrop-filter: blur(12px);
}

.note-scope-actions button {
  min-height: 66px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.note-scope-actions button:last-child { background: var(--coral); color: #2a1520; border-color: var(--coral); }
.note-scope-actions strong { font-size: 0.92rem; }
.note-scope-actions small { font-size: 0.68rem; opacity: 0.8; }

.scope-list { border-top: 1px solid #3a3144; }
.scope-list div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.scope-list span { color: var(--muted); text-align: right; }
.danger {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  background: #d85f68;
  color: white;
  font-weight: 650;
}

.persona-row {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 10px;
}

.persona-row .avatar { background: color-mix(in srgb, var(--coral) 22%, transparent); color: var(--coral); }
.persona-row strong { display: block; }
.persona-row small { color: var(--muted); }
.persona-row .chev { margin-left: auto; color: var(--muted); }
.persona-row.selected { outline: 1px solid var(--coral); }

.persona-row strong .icon {
  width: 14px;
  height: 14px;
  fill: var(--coral);
  stroke: var(--coral);
  vertical-align: -2px;
  margin-left: 4px;
}

.persona-swipe {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 10px;
  touch-action: pan-y;
}
.persona-swipe .persona-row {
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  touch-action: pan-y;
}
.persona-swipe-actions {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  z-index: 0;
}
.persona-swipe-actions button {
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  font-size: 0.72rem;
}
.persona-swipe-actions .icon {
  stroke: #fff;
  fill: none;
}
.persona-swipe-pin { background: #e8a0b0; }
.persona-swipe-pin.on { background: #d85f68; }
.persona-swipe-pin.on .icon { fill: #fff; }
.persona-swipe-delete { background: #c45c5c; }

.form-label {
  display: block;
  margin: 16px 0 8px;
  font-size: 0.88rem;
  font-weight: 650;
}

.form-input {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #2b2433;
  padding: 12px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.on { border-color: var(--coral); color: var(--text); background: #f4a7b918; }

.records-page { padding-bottom: 108px; }
.records-ask {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(100%, var(--max));
  padding: 10px 12px;
  background: #1d1724f2;
  border-top: 1px solid #3a3144;
  backdrop-filter: blur(12px);
}
.records-ask button {
  width: 100%;
  min-height: 56px;
  border-radius: 8px;
  background: var(--coral);
  color: #2a1520;
  font-weight: 650;
}
.older-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.older-row small { color: var(--muted); }
.ref-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  line-height: 1.55;
}
.ref-card p { margin: 0 0 10px; }
.dual-chart { display: grid; gap: 16px; }

.sleep-page { padding-bottom: 24px; }
.sleep-hero {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
}
.sleep-duration {
  font-size: 2.05rem;
  font-weight: 700;
  margin: 4px 0 0;
  letter-spacing: -0.03em;
}
.sleep-bar {
  display: flex;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
  background: var(--bg-soft);
}
.sleep-bar.empty {
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.78rem;
  height: 36px;
}
.sleep-seg { min-width: 2px; height: 100%; }
.sleep-seg-quiet { background: #b7a7c9; }
.sleep-seg-varied { background: #f5c97b; }
.sleep-seg-restless { background: #9bb9c9; }
.sleep-legend {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}
.sleep-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}
.sleep-contrast {
  margin: 14px 0 0;
  line-height: 1.55;
}
.sleep-night-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.sleep-night-date { color: var(--text); }
.sleep-night-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  text-align: right;
}
.sleep-night-meta small { color: var(--muted); }
.sleep-mood-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mood, var(--muted));
  display: inline-block;
}

#app.chat-view { padding-bottom: 82px; }
#app.chat-view > .topbar,
#app.chat-view > .chat-sticky-head {
  position: sticky;
  top: 0;
  z-index: 16;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
#app.chat-view > .chat-sticky-head > .topbar {
  position: static;
  border-bottom: 0;
  background: transparent;
}
.insight-page { min-height: calc(100dvh - 134px); background: var(--bg); }
.scope-strip {
  min-height: 42px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.scope-strip strong { color: var(--coral); font-size: 0.82rem; }
.scope-strip span { color: var(--muted); font-size: 0.72rem; }
.source-strip { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.source-strip span { flex: none; padding: 5px 8px; border-radius: 6px; background: var(--bg-card); color: var(--muted); font-size: 0.7rem; border: 1px solid var(--line); }
.chat-sticky-head .source-strip {
  padding-top: 0;
  padding-bottom: 12px;
  background: transparent;
}
.chat-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 8px;
}
.chat-tools .chat-tool {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.72rem;
}
.chat-thread { padding: 8px 14px 24px; overflow-y: auto; }
.chat-day { text-align: center; color: var(--muted); font-size: 0.68rem; padding: 7px; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; margin: 12px 0; }
.bubble-row.user { justify-content: flex-end; }
.avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--coral); color: #321722; font-weight: 750; }
.im-thread .avatar { border-radius: 50%; }
.bubble {
  max-width: min(78%, 330px);
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.bubble-row.user .bubble { background: #a8d5ba; color: #14271d; border-color: transparent; }
.im-thread .bubble {
  padding: 10px 14px;
  line-height: 1.5;
}
.im-thread .bubble-row.assistant .bubble {
  border-radius: 18px 18px 18px 6px;
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid var(--line);
}
.im-thread .bubble-row.user .bubble {
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, var(--coral), color-mix(in srgb, var(--coral) 72%, var(--fog)));
  color: #2a1520;
  box-shadow: none;
  border: 0;
}
.bubble-stack {
  display: flex;
  flex-direction: column;
  max-width: min(78%, 330px);
  min-width: 0;
}
.bubble-stack .bubble { max-width: 100%; }
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  min-height: 1.15em;
}
.typing-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--coral) 62%, transparent);
  animation: typing-bounce 0.9s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}
.memory-offer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}
.memory-offer p { margin: 0 0 6px; }
.memory-offer-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.memory-offer button {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 0.72rem;
}
.memory-offer.kept {
  border-top: none;
  padding-top: 4px;
  font-size: 0.72rem;
}
.typing { color: var(--muted); }
.save-insight { margin-top: 7px; min-height: 38px; color: var(--coral); display: flex; align-items: center; gap: 6px; }
.chat-composer {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--max));
  min-height: 70px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: end;
  gap: 8px;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.chat-composer textarea {
  min-height: 44px;
  max-height: 104px;
  resize: none;
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 11px;
}

.chat-composer button { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--coral); color: #2a1520; }
.chat-composer button:disabled { opacity: 0.5; }
.compact { padding: 8px 0; }

.avatar.has-photo { overflow: hidden; padding: 0; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top-avatar { width: 32px; height: 32px; font-size: 0.85rem; }
.avatar-edit { display: flex; align-items: center; gap: 12px; margin: 8px 0 8px; flex-wrap: wrap; }
.avatar-preview { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar-upload { position: relative; overflow: hidden; }
.persona-guide .ob-hint { margin: 0 0 16px; color: var(--muted); font-size: 0.85rem; }
.persona-new-row .avatar { background: color-mix(in srgb, var(--coral) 28%, transparent); }

#app.call-view { padding-bottom: 0; }
#app.from-call.chat-view {
  animation: chat-rise 0.32s ease-out;
}
.call-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #16121c;
  color: #f6eef2;
  transition: transform 0.32s ease-out, opacity 0.32s ease-out;
}
.call-screen.call-to-chat {
  transform: translateY(-18%);
  opacity: 0;
}
.call-voice-layer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: center;
  padding: 28px 20px calc(20px + env(safe-area-inset-bottom));
  touch-action: none;
}
.call-screen[data-call-stage="connected"] .call-voice-layer { touch-action: pan-y; }
.call-header-block,
.call-live-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.call-kicker { letter-spacing: 0.18em; text-transform: uppercase; color: #c3b4c4; font-size: 0.72rem; margin: 0; }
.call-voice-layer h2 { margin: 0; font-size: 1.45rem; color: #f6eef2; font-weight: 650; }
.call-voice-layer .sub { margin: 0; color: #c3b4c4; }
.call-duration {
  margin: 0;
  color: #c3b4c4;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}
.call-stage {
  position: relative;
  width: 176px;
  height: 176px;
  display: grid;
  place-items: center;
}
.call-rings { position: absolute; inset: 8px; }
.call-rings i {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--coral) 45%, transparent);
  border-radius: 50%;
  animation: call-ring 1.6s ease-out infinite;
}
.call-rings i:nth-child(2) { animation-delay: 0.35s; }
.call-rings i:nth-child(3) { animation-delay: 0.7s; }
.call-avatar {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 104px;
  font-size: 2.1rem;
  border-radius: 50%;
}
.call-screen[data-call-stage="ringing"] .call-avatar {
  animation: call-shake 0.55s ease-in-out infinite;
}
.call-screen[data-call-stage="ringing"] .call-voice-layer {
  justify-content: center;
}
.call-screen[data-call-stage="connected"] .call-avatar {
  animation: none;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--coral) 28%, transparent);
}
.call-screen[data-call-stage="connected"] .call-rings { display: none; }
.call-screen[data-call-stage="connected"] .call-kicker { letter-spacing: 0.12em; }
.call-screen[data-call-stage="ringing"] .call-duration { display: none; }
.call-live-block,
.call-connected-controls {
  opacity: 0;
  transform: translateX(48px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition: transform 0.32s ease, opacity 0.32s ease, max-height 0.32s ease;
}
.call-screen[data-call-stage="connected"] .call-live-block,
.call-screen[data-call-stage="connected"] .call-connected-controls {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  max-height: 320px;
  overflow: visible;
}
.call-screen[data-call-stage="connected"] .call-connected-controls {
  padding: 4px 0 8px;
}
.call-answer-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  transition: transform 0.32s ease, opacity 0.32s ease, max-height 0.32s ease;
}
.call-screen[data-call-stage="connected"] .call-answer-rail {
  opacity: 0;
  transform: translateX(-64px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  margin: 0;
}
.call-rail-decline {
  border: 0;
  background: transparent;
  color: #c3b4c4;
  font-size: 0.85rem;
}
.call-slider {
  position: relative;
  width: 100%;
  height: 64px;
  border-radius: 999px;
  background: color-mix(in srgb, #f6eef2 12%, transparent);
  border: 1px solid color-mix(in srgb, #f6eef2 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-x;
  user-select: none;
}
.call-slider-hint {
  pointer-events: none;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: #c3b4c4;
  animation: call-hint-pulse 1.6s ease-in-out infinite;
}
.call-slider-knob {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: #3dbe6e;
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 1;
}
.call-slider-knob .icon { width: 22px; height: 22px; }
.call-up-hint {
  margin: 0;
  color: #c3b4c4;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.call-connected-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
}
.call-text {
  color: #f6eef2;
  border-color: color-mix(in srgb, #f6eef2 22%, transparent);
  background: transparent;
}
.call-hangup-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ce6254, #c25549);
  color: #fff;
  display: grid;
  place-items: center;
}
.call-hangup-btn .icon { width: 26px; height: 26px; }
.call-subtitle-panel {
  width: 100%;
  max-width: 360px;
  height: 168px;
  flex: none;
  border-radius: 16px;
  background: color-mix(in srgb, #2b2433 72%, transparent);
  border: 1px solid color-mix(in srgb, #f6eef2 10%, transparent);
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  text-align: left;
  mask-image: linear-gradient(to bottom, transparent, #000 18%);
}
.call-line {
  display: grid;
  gap: 2px;
  max-width: 92%;
}
.call-line.assistant { align-self: start; }
.call-line.user { align-self: end; text-align: right; }
.call-who {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: #c3b4c4;
  font-weight: 650;
}
.call-subtitle-panel p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #f6eef2;
}
.call-subtitle-panel [data-call-user] { color: var(--coral); }
.call-subtitle-panel .aside,
.bubble .aside {
  color: var(--muted);
  font-size: 0.88em;
}
.call-waveform {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 56px;
  width: min(100%, 220px);
}
.call-waveform i {
  width: 5px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--coral) 78%, #f6eef2);
  height: 28%;
  animation: call-wave 1.1s ease-in-out infinite;
}
.call-waveform i:nth-child(odd) { animation-delay: 0.12s; }
.call-waveform i:nth-child(3n) { animation-delay: 0.28s; }
.call-waveform[data-wave="speaking"] i { animation-duration: 0.7s; background: var(--coral); }
.call-waveform[data-wave="hearing"] i { animation-duration: 0.55s; }
.scenario-composer { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.hold-mic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  color: var(--coral);
  border: 1px solid var(--line);
  touch-action: none;
  user-select: none;
}
.chat-composer .hold-mic { background: var(--bg-soft); color: var(--coral); }
.hold-mic.listening { background: var(--coral); color: #2a1520; border-color: transparent; }

@keyframes call-ring {
  from { transform: scale(0.72); opacity: 0.7; }
  to { transform: scale(1.18); opacity: 0; }
}
@keyframes call-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-7deg) translateY(-1px); }
  50% { transform: rotate(7deg); }
  75% { transform: rotate(-4deg); }
}
@keyframes call-wave {
  0%, 100% { height: 22%; }
  50% { height: 88%; }
}
@keyframes call-hint-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes chat-rise {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.persona-guide {
  padding-bottom: 28px;
}

.persona-guide-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
}

.persona-guide-thread .bubble-row {
  margin: 0;
}

.persona-guide-thread .bubble {
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 14px;
  max-width: 92%;
}

.persona-guide-thread .bubble-row.user .bubble {
  background: color-mix(in srgb, var(--coral) 28%, var(--bg-elev));
  color: var(--text);
}

.persona-vibe-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 4px;
}

button.persona-vibe {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
}

button.persona-vibe.on {
  border-color: var(--coral);
  background: #f4a7b918;
  color: var(--text);
}

.persona-guide .ob-input {
  min-height: 72px;
}

.quiz-link {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

button.text-link {
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.quiz-block {
  margin: 0 0 18px;
}

.quiz-block h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 650;
}

.quiz-block .ob-field {
  margin-top: 8px;
}

@media (max-width: 360px) {
  .session-row { grid-template-columns: 52px minmax(0, 1fr) 20px; }
  .session-row .quality { display: none; }
  .note-scope-actions strong { font-size: 0.84rem; }
  .note-scope-actions small { font-size: 0.64rem; }
}

.lab-page .stop { margin: 8px 0 16px; }
.lab-card {
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
}
.lab-card h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}
.lab-kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.88rem;
}
.lab-kv span { color: var(--muted); }
.lab-kv strong { text-align: right; font-weight: 600; }
.lab-note {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 6px 0 0;
  text-align: left;
}
.lab-leds { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 16px; }
.lab-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  text-align: left;
}
.lab-check input { margin-top: 3px; }
.lab-reject {
  color: var(--coral);
  font-size: 0.85rem;
  margin: 8px 0 12px;
  text-align: left;
}
