@font-face {
  font-family: "XiaoYi Hui";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/fonts/xiaoyi-hui.woff2") format("woff2"),
       url("/fonts/xiaoyi-hui.woff") format("woff"),
       url("/fonts/xiaoyi-hui.ttf") format("truetype");
  unicode-range: U+56DE;
}

:root {
  --cream: #f4ebdd;
  --cream-deep: #eadcc8;
  --paper: #fffaf3;
  --ink: #2a1c14;
  --ink-soft: #5a4638;
  --muted: #7a6658;
  --line: rgba(42, 28, 20, 0.12);
  --terracotta: #c45c26;
  --terracotta-deep: #9c4318;
  --amber: #d4a054;
  --eye: #6b3a22;
  --sage: #6f7d62;
  --sage-soft: #dfe6d6;
  --ok: #3f6b45;
  --warn: #8a5a12;
  --danger: #9b2e1e;
  --sidebar: #2a1c14;
  --sidebar-text: #f4ebdd;
  --shadow: 0 8px 24px rgba(42, 28, 20, 0.06), 0 2px 6px rgba(42, 28, 20, 0.04);
  --shadow-lift: 0 18px 40px rgba(42, 28, 20, 0.10), 0 4px 10px rgba(42, 28, 20, 0.05);
  --radius: 18px;
  --font-display: "XiaoYi Hui", "ZCOOL XiaoWei", "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(1100px 520px at 12% -8%, rgba(212, 160, 84, 0.22), transparent 55%),
    radial-gradient(800px 420px at 92% 6%, rgba(196, 92, 38, 0.10), transparent 50%),
    linear-gradient(180deg, #f7f0e4 0%, var(--cream) 42%, #efe4d4 100%);
  background-size: 140% 140%, 140% 140%, 100% 100%;
  background-position: 0% 0%, 100% 0%, 0 0;
  animation: wash 22s ease-in-out infinite alternate;
  min-height: 100vh;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  z-index: 0;
}

@keyframes wash {
  to { background-position: 36% 18%, 64% 28%, 0 0; }
}

a { color: var(--terracotta-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terracotta); }

img { max-width: 100%; display: block; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--cream);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 20;
}
.skip:focus { top: 12px; }

/* ---------- Wordmark ---------- */
.mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
}
.mark.lg { width: 72px; height: 72px; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.wordmark .name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: 0.08em;
}
.wordmark .sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 3px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s var(--ease), background 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; }
.btn-primary {
  background: var(--terracotta);
  color: #fffaf3;
  box-shadow: 0 8px 20px rgba(196, 92, 38, 0.25);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 250, 243, 0.28) 48%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
  pointer-events: none;
}
.btn-primary:hover {
  background: var(--terracotta-deep);
  color: #fffaf3;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(196, 92, 38, 0.32);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: rgba(42, 28, 20, 0.05); color: var(--ink); transform: translateY(-1px); }
.btn-sage {
  background: var(--sage);
  color: #f6f8f3;
}
.btn-sage:hover { filter: brightness(0.95); color: #f6f8f3; }
.btn[disabled], .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn[disabled]::after, .btn:disabled::after { display: none; }

/* ---------- Public shell ---------- */
.site-header, .site-footer, main { position: relative; z-index: 1; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  max-width: calc(var(--max) + 56px);
  margin: 0 auto;
  position: sticky;
  top: 0;
  z-index: 6;
  background: rgba(244, 235, 221, 0.72);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid rgba(42, 28, 20, 0.06);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--ink); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  background: rgba(212, 160, 84, 0.28);
  color: var(--ink);
  border: 1px solid rgba(196, 92, 38, 0.2);
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 0 rgba(196, 92, 38, 0.45);
  animation: pulse 2.8s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 92, 38, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(196, 92, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 92, 38, 0); }
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 28px 28px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  margin: 0 0 12px;
}
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin: 0;
}
h1 { font-size: clamp(2.8rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 36em;
  margin: 16px 0 28px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-art {
  --px: 0px;
  --py: 0px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  transform: translate3d(var(--px), var(--py), 0);
  will-change: transform;
}
.hero-glow {
  position: absolute;
  width: 78%;
  height: 62%;
  top: 12%;
  left: 11%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 224, 0.85) 0%, rgba(212, 160, 84, 0.28) 42%, transparent 70%);
  filter: blur(18px);
  z-index: 0;
  animation: glow-breathe 8s ease-in-out infinite;
  pointer-events: none;
}
.hero-art::after {
  content: "";
  position: absolute;
  inset: -8% -18%;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 250, 243, 0.42) 48%, transparent 66%);
  transform: translateX(-55%);
  animation: sweep 9s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
  z-index: 2;
}
.hero-art .mascot {
  width: min(100%, 460px);
  height: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 18px 32px rgba(42, 28, 20, 0.14));
  animation: mascot-float 7s ease-in-out infinite;
}
.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.brand-lockup .bb-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand-lockup .bb-wordmark {
  height: 28px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
}
.brand-lockup.on-art {
  margin-top: -4px;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes sweep {
  0%, 22% { transform: translateX(-55%); opacity: 0; }
  40% { opacity: 0.9; }
  62%, 100% { transform: translateX(55%); opacity: 0; }
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 28px 8px;
}
.section-head {
  margin-bottom: 20px;
}
.section-head p {
  color: var(--muted);
  margin: 8px 0 0;
}

.wake-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.wake-chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s ease;
}
.wake-chip:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(196, 92, 38, 0.22);
}
.wake-chip strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.08em;
}
.wake-chip span {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.persona-grid, .steps, .stat-grid {
  display: grid;
  gap: 16px;
}
.persona-grid { grid-template-columns: 1fr 1fr; }
.steps { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s ease;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 250, 243, 0.5) 48%, transparent 68%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(196, 92, 38, 0.16);
}
.card:hover::after { transform: translateX(120%); }
.card > * { position: relative; z-index: 1; }
.card h3 { margin-bottom: 8px; font-size: 1.6rem; }
.card p { margin: 0; color: var(--ink-soft); }
.step-num {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--cream-deep);
  color: var(--ink);
  font-family: var(--font-display);
  margin-bottom: 10px;
}

.note {
  max-width: var(--max);
  margin: 28px auto 0;
  padding: 0 28px 8px;
}
.note-inner {
  border-radius: var(--radius);
  padding: 18px 22px;
  background: var(--sage-soft);
  color: #2c3528;
  border: 1px solid rgba(111, 125, 98, 0.3);
}
.note-inner strong { font-weight: 600; }

.site-footer {
  max-width: var(--max);
  margin: 48px auto 0;
  padding: 28px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Reveal ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.reveal {
  animation: rise 0.9s var(--ease) both;
}
.reveal-delay-2 { animation-delay: 0.14s; }
.wake-chip:nth-child(1) { animation: rise 0.7s var(--ease) 0.08s both; }
.wake-chip:nth-child(2) { animation: rise 0.7s var(--ease) 0.16s both; }
.wake-chip:nth-child(3) { animation: rise 0.7s var(--ease) 0.24s both; }
.wake-chip:nth-child(4) { animation: rise 0.7s var(--ease) 0.32s both; }
.persona-grid .card:nth-child(1),
.steps .card:nth-child(1) { animation: rise 0.75s var(--ease) 0.08s both; }
.persona-grid .card:nth-child(2),
.steps .card:nth-child(2) { animation: rise 0.75s var(--ease) 0.16s both; }
.steps .card:nth-child(3) { animation: rise 0.75s var(--ease) 0.24s both; }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  position: relative;
  z-index: 1;
}
.auth-glow {
  position: absolute;
  width: min(520px, 80vw);
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 160, 84, 0.28), rgba(196, 92, 38, 0.08) 46%, transparent 70%);
  filter: blur(12px);
  animation: glow-breathe 9s ease-in-out infinite;
  pointer-events: none;
}
.auth-card {
  width: min(100%, 420px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 30px;
  box-shadow: var(--shadow-lift);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 250, 243, 0.55) 48%, transparent 64%);
  transform: translateX(-60%);
  animation: sweep 8s ease-in-out 0.8s infinite;
  pointer-events: none;
  z-index: 0;
}
.auth-card > * { position: relative; z-index: 1; }
.auth-card h1 {
  font-size: 2.2rem;
  margin: 12px 0 6px;
  text-rendering: geometricPrecision;
}
.auth-wrap.leaving .auth-card {
  animation: auth-leave 0.42s var(--ease) forwards;
}
@keyframes auth-leave {
  to { opacity: 0; transform: translateY(-10px); }
}
.auth-card .hint { color: var(--muted); margin: 0 0 22px; }
label { display: block; font-size: 0.85rem; margin: 0 0 6px; color: var(--ink-soft); }
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(196, 92, 38, 0.45);
  border-color: var(--terracotta);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row .btn { flex: 1; }
.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.3em;
  margin: 0 0 10px;
}

/* ---------- Console ---------- */
body.console-body {
  background: var(--cream);
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
  animation: none;
  background-image:
    radial-gradient(900px 400px at 100% 0%, rgba(196, 92, 38, 0.07), transparent 50%),
    linear-gradient(180deg, #f7f0e4, var(--cream));
  background-size: auto;
  background-position: 0 0;
}
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 3;
  background-image: linear-gradient(180deg, #322218 0%, var(--sidebar) 40%, #21150f 100%);
}
.sidebar .wordmark { color: var(--sidebar-text); padding: 4px 8px 18px; }
.sidebar .wordmark .sub { color: rgba(244, 235, 221, 0.6); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(244, 235, 221, 0.82);
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 12px;
  border-left: 3px solid transparent;
  transition: background 0.28s var(--ease), color 0.28s var(--ease), border-color 0.28s var(--ease), transform 0.28s var(--ease);
}
.nav-item:hover { background: rgba(255, 250, 243, 0.07); color: #fffaf3; transform: translateX(2px); }
.nav-item.active {
  background: rgba(196, 92, 38, 0.22);
  color: #fffaf3;
  border-left-color: var(--amber);
}
.nav-spacer { flex: 1; }
.sidebar .logout {
  color: rgba(244, 235, 221, 0.7);
  background: transparent;
  border: 1px solid rgba(244, 235, 221, 0.18);
  width: 100%;
}
.sidebar .logout:hover {
  background: rgba(255, 250, 243, 0.07);
  color: #fffaf3;
}

.console-main {
  min-width: 0;
  position: relative;
}
.console-main::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(560px 380px at var(--mx, 86%) var(--my, 0%), rgba(212, 160, 84, 0.16), transparent 62%);
  z-index: 0;
  transition: opacity 0.4s ease;
}
.console-main > * { position: relative; z-index: 1; }
body.console-body .sidebar {
  animation: console-sidebar-in 0.72s var(--ease) backwards;
}
body.console-body .console-main {
  animation: console-main-in 0.72s var(--ease) 0.05s backwards;
}
@keyframes console-sidebar-in {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}
@keyframes console-main-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(244, 235, 221, 0.92);
  backdrop-filter: blur(12px);
  z-index: 2;
}
.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}
.persona-badge {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.persona-badge b { color: var(--ink); font-weight: 600; }

.page {
  padding: 28px;
  max-width: 960px;
}
.page h1 { font-size: 2.2rem; margin-bottom: 8px; }
.page .intro { color: var(--muted); margin: 0 0 22px; }
.page > * {
  animation: rise 0.55s var(--ease) both;
}
.page > *:nth-child(2) { animation-delay: 0.05s; }
.page > *:nth-child(3) { animation-delay: 0.1s; }
.page > *:nth-child(4) { animation-delay: 0.15s; }
.page > *:nth-child(n+5) { animation-delay: 0.18s; }

.stat-grid { grid-template-columns: repeat(4, 1fr); }
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.stat .label { font-size: 0.75rem; letter-spacing: 0.08em; color: var(--muted); }
.stat .value { font-family: var(--font-display); font-size: 1.5rem; margin-top: 6px; }
.status-ok { color: var(--ok); }
.status-missing { color: var(--warn); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 7px;
  background: var(--cream-deep);
  flex: 0 0 auto;
}
.dot.on { background: var(--ok); }
.dot.off { background: var(--amber); }

.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.device-list { display: grid; gap: 12px; }
.device {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: start;
}
.device h3 { font-size: 1.3rem; }
.meta { font-size: 0.85rem; color: var(--muted); }
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  background: var(--cream-deep);
}
.tag.online { background: var(--sage-soft); color: var(--ok); }
.tag.offline { background: #f0e0d0; color: var(--warn); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 28, 20, 0.45);
  display: none;
  place-items: center;
  z-index: 10;
  padding: 20px;
}
.modal-backdrop.open { display: grid; animation: fade-in 0.25s ease; }
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  width: min(100%, 480px);
  background: var(--paper);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  animation: rise 0.4s var(--ease);
}
.bind-code {
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 0.28em;
  text-align: center;
  padding: 12px 0 4px 0.28em;
}
.quiet { font-size: 0.85rem; color: var(--muted); }

/* Segmented */
.segmented {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--cream);
  margin-bottom: 16px;
}
.segmented button {
  border: 0;
  background: transparent;
  font: inherit;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.22s ease, color 0.22s ease;
}
.segmented button[aria-pressed="true"] {
  background: var(--terracotta);
  color: #fffaf3;
}

/* Chat */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  min-height: 420px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-banner {
  padding: 10px 16px;
  background: #f7e4c6;
  color: var(--warn);
  font-size: 0.9rem;
  display: none;
}
.chat-banner.show { display: block; }
.chat-log {
  flex: 1;
  overflow: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  animation: rise 0.35s var(--ease);
}
.msg.user {
  margin-left: auto;
  background: var(--terracotta);
  color: #fffaf3;
  border-bottom-right-radius: 6px;
}
.msg.assistant {
  background: var(--cream);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.msg .who { display: block; font-size: 0.72rem; opacity: 0.75; margin-bottom: 4px; }
.msg.system {
  margin: 0 auto;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-form textarea {
  margin: 0;
  min-height: 46px;
  max-height: 140px;
  border-radius: 14px;
}
.chat-form .btn {
  align-self: flex-end;
  flex: 0 0 auto;
  min-width: 5.6rem;
  white-space: nowrap;
}

.flash { font-size: 0.9rem; margin: 8px 0; }
.flash.ok { color: var(--ok); }
.flash.err { color: var(--danger); }

.hidden { display: none !important; }

@media (max-width: 900px) {
  .hero, .persona-grid, .steps, .stat-grid, .wake-grid {
    grid-template-columns: 1fr 1fr;
  }
  body.console-body { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    width: 230px;
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .hero-art { display: none; }
}
@media (max-width: 640px) {
  .site-header { padding: 16px; }
  .nav-links .hide-sm { display: none; }
  .hero, .section, .note, .page { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 24px; grid-template-columns: 1fr; }
  .hero-art { display: flex; }
  .hero-art .mascot { width: min(100%, 300px); }
  .brand-lockup .bb-wordmark { height: 24px; }
  .wake-grid, .persona-grid, .steps, .stat-grid { grid-template-columns: 1fr; }
  .site-footer { padding: 20px 16px 40px; }
  h1 { font-size: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body,
  .pill::before,
  .hero-glow,
  .hero-art::after,
  .hero-art .mascot,
  .auth-glow,
  .auth-card::after,
  .auth-wrap.leaving .auth-card,
  .reveal,
  .reveal-delay-2,
  .wake-chip,
  .persona-grid .card,
  .steps .card,
  .page > *,
  .msg,
  .modal,
  .modal-backdrop.open,
  body.console-body .sidebar,
  body.console-body .console-main,
  .card::after {
    animation: none !important;
    transition: none !important;
  }
  .hero-art { transform: none !important; }
  .card:hover, .wake-chip:hover, .stat:hover, .btn-primary:hover, .btn-ghost:hover, .nav-item:hover {
    transform: none;
  }
  .card::after, .auth-card::after { transform: none; }
}
html.reduce-motion {
  scroll-behavior: auto;
}
html.reduce-motion body,
html.reduce-motion .pill::before,
html.reduce-motion .hero-glow,
html.reduce-motion .hero-art::after,
html.reduce-motion .hero-art .mascot,
html.reduce-motion .auth-glow,
html.reduce-motion .auth-card::after,
html.reduce-motion .auth-wrap.leaving .auth-card,
html.reduce-motion .reveal,
html.reduce-motion .reveal-delay-2,
html.reduce-motion .wake-chip,
html.reduce-motion .persona-grid .card,
html.reduce-motion .steps .card,
html.reduce-motion .page > *,
html.reduce-motion .msg,
html.reduce-motion .modal,
html.reduce-motion .modal-backdrop.open,
html.reduce-motion body.console-body .sidebar,
html.reduce-motion body.console-body .console-main,
html.reduce-motion .card::after {
  animation: none !important;
  transition: none !important;
}
html.reduce-motion .hero-art { transform: none !important; }
html.reduce-motion .card:hover,
html.reduce-motion .wake-chip:hover,
html.reduce-motion .stat:hover,
html.reduce-motion .btn-primary:hover,
html.reduce-motion .btn-ghost:hover,
html.reduce-motion .nav-item:hover {
  transform: none;
}
html.reduce-motion .card::after,
html.reduce-motion .auth-card::after { transform: none; }
