/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg-primary: #FFFDFB;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #FBF6EF;
  --bg-warm: #FFF8F3;
  --text-primary: #1F1814;
  --text-secondary: #7D6F62;
  --text-tertiary: #B8A99A;
  --text-muted: #D4C8BC;
  --border-primary: #EDE3D8;
  --border-secondary: #F4EDE4;
  --border-light: #FAF6F1;
  --shadow-xs: 0 1px 2px rgba(40,25,10,0.03);
  --shadow-sm: 0 2px 8px rgba(40,25,10,0.05);
  --shadow-md: 0 6px 20px rgba(40,25,10,0.08);
  --shadow-lg: 0 16px 40px rgba(40,25,10,0.12);
  --shadow-glow: 0 0 0 1px rgba(242,104,58,0.08), 0 4px 20px rgba(242,104,58,0.12);
  --accent: #F2683A;
  --accent-light: #FFF0E8;
  --accent-dark: #D45020;
  --accent-gradient: linear-gradient(135deg, #F2683A 0%, #FF8C5A 100%);
  --ai-color: #7C6FF7;
  --ai-light: #F8F7FF;
  --ai-border: rgba(124,111,247,0.15);
  --ai-glow: 0 0 0 1px rgba(124,111,247,0.10), 0 4px 16px rgba(124,111,247,0.10);
  --ai-text: #5B4FD8;
  --success: #3FA86A;
  --success-bg: rgba(63,168,106,0.08);
  --success-border: rgba(63,168,106,0.25);
  --warning: #E08A1B;
  --warning-bg: rgba(224,138,27,0.08);
  --danger: #E26060;
  --danger-bg: rgba(226,96,96,0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-full: 9999px;
  --font-display: 'Lexend', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-number: 'Lexend', 'SF Mono', 'PingFang SC', monospace;
  --font-serif: 'DM Serif Display', 'Noto Serif SC', serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  background: #F0E8DD;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(ellipse 900px 500px at 20% -20%, rgba(242,104,58,0.10), transparent 60%),
    radial-gradient(ellipse 700px 450px at 85% 110%, rgba(124,111,247,0.07), transparent 55%),
    radial-gradient(ellipse 600px 400px at 50% 50%, rgba(200,160,120,0.06), transparent 70%);
}

/* ============================================================
   PHONE FRAME
   ============================================================ */
.phone-frame {
  width: 390px;
  height: 844px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  background: var(--bg-primary);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.6),
    0 0 0 2px rgba(180,160,140,0.12),
    0 2px 8px rgba(60,30,10,0.04),
    0 8px 30px rgba(60,30,10,0.08),
    0 30px 80px rgba(60,30,10,0.16),
    0 0 140px rgba(242,104,58,0.10);
  user-select: none;
}

/* Status bar */
.status-bar {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 28px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-display);
}
.status-bar .time { font-size: 13px; letter-spacing: 0.5px; }
.status-bar .icons { display: flex; align-items: center; gap: 6px; }
.status-bar .icons svg { width: 15px; height: 15px; }

/* Screen area */
.screen {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

/* Page container */
.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out-expo), transform 0.35s var(--ease-out-expo);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.page.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.page::-webkit-scrollbar { width: 0; }

/* Page header */
.page-header {
  padding: 16px 20px 12px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, var(--bg-primary) 60%, transparent);
}
.page-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.page-body {
  flex: 1;
  padding: 0 16px 24px;
}

/* ============================================================
   TAB BAR
   ============================================================ */
.tab-bar {
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: rgba(255,253,251,0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-secondary);
  padding: 0 8px 8px;
  position: relative;
  z-index: 100;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.25s var(--ease-out-expo);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.tab-btn .tab-icon { transition: all 0.25s var(--ease-out-expo); }
.tab-btn .tab-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.25s var(--ease-out-expo);
}
.tab-btn.active .tab-label { color: var(--accent); }
.tab-btn:not(.active) .tab-label { color: var(--text-tertiary); }
.tab-btn.active::before {
  content: '';
  position: absolute;
  top: -1px;
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent-gradient);
}

/* Center tab (pet) special treatment */
.tab-btn.tab-center {
  position: relative;
  margin-top: -18px;
}
.tab-btn.tab-center .tab-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(242,104,58,0.35);
  transition: all 0.25s var(--ease-out-expo);
}
.tab-btn.tab-center:active .tab-icon-wrap {
  transform: scale(0.92);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-primary);
  transition: all 0.2s ease;
}
.card-ai {
  background: var(--ai-light);
  border: 1px solid var(--ai-border);
  box-shadow: var(--ai-glow);
}
.card-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(224,138,27,0.22);
}
.card-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}
.card-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(226,96,96,0.22);
}
.card-accent {
  background: var(--accent-light);
  border: 1px solid rgba(242,104,58,0.18);
}
.card-pressable:active {
  transform: scale(0.985);
  background: var(--bg-tertiary);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-ai     { background: rgba(124,111,247,0.10); color: var(--ai-text); }
.badge-success { background: rgba(63,168,106,0.10); color: var(--success); }
.badge-warning { background: rgba(224,138,27,0.10); color: var(--warning); }
.badge-danger  { background: rgba(226,96,96,0.10); color: var(--danger); }
.badge-accent  { background: rgba(242,104,58,0.10); color: var(--accent); }
.badge-neutral { background: rgba(125,111,98,0.07); color: var(--text-secondary); }
.badge-dot {
  width: 5px; height: 5px; border-radius: 50%;
  flex-shrink: 0;
}
.badge-dot.success { background: var(--success); }
.badge-dot.warning { background: var(--warning); }
.badge-dot.danger  { background: var(--danger); }
.badge-dot.accent  { background: var(--accent); }

/* ============================================================
   BUTLER PAGE — Pet Avatar Zone
   ============================================================ */
.avatar-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 20px 20px;
}
.avatar-ring {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.avatar-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  background: linear-gradient(135deg, var(--accent), #FFB088, var(--accent)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}
.avatar-ring .glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242,104,58,0.15) 0%, transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 0.8; transform: scale(1.05); }
}
.avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #FFD4C0, #FFE8DB);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.avatar-img svg { width: 70px; height: 70px; }
.pet-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}
.pet-status-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pet-status-text { font-size: 12px; color: var(--text-secondary); }

.pet-greeting {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  color: var(--ai-text);
  background: var(--ai-light);
  border: 1px solid var(--ai-border);
  max-width: 280px;
  text-align: center;
  line-height: 1.5;
}
.pet-swipe-hint {
  margin-top: 9px;
  color: var(--text-tertiary);
  font-size: 10px;
  letter-spacing: .2px;
}
.pet-swipe-target { touch-action: pan-y; cursor: grab; }
.pet-swipe-target:active { cursor: grabbing; }

/* Brand bar */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px;
}
.brand-logo {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  opacity: 0.5;
}
.brand-actions { display: flex; align-items: center; gap: 16px; }
.brand-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px; position: relative;
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
}
.brand-btn .dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid white;
}

/* Pet info tags */
/* ============================================================
   DAILY REPORT CARD
   ============================================================ */
.report-card { margin-bottom: 14px; }
.report-card .report-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.report-card .report-title {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  font-family: var(--font-display); letter-spacing: -0.2px;
}
.report-card .report-body {
  font-size: 13px; line-height: 1.65; color: var(--text-secondary);
  margin-bottom: 12px;
}
.report-card .report-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border-light);
}
.report-footer .source { font-size: 10.5px; color: var(--ai-text); }
.report-footer .action {
  font-size: 12px; font-weight: 600; color: var(--ai-text);
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   DEVICE SNAPSHOT ROW
   ============================================================ */
.device-snapshot-row { display: flex; gap: 10px; margin-bottom: 14px; }
.device-snapshot {
  flex: 1; padding: 14px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.device-snapshot:active { transform: scale(0.97); background: var(--bg-tertiary); }
.device-snapshot .ds-icon { margin-bottom: 8px; color: var(--text-secondary); }
.device-snapshot .ds-label { font-size: 11px; font-weight: 600; color: var(--text-primary); }
.device-snapshot .ds-value { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }
.device-snapshot .ds-status { margin-top: 6px; }

/* ============================================================
   UNIFIED FEED
   ============================================================ */
.section-title {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  margin-bottom: 10px; letter-spacing: -0.2px;
}
.feed-list { display: flex; flex-direction: column; gap: 10px; }
.feed-item {
  display: flex; gap: 12px; padding: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.feed-item:active { transform: scale(0.985); background: var(--bg-tertiary); }
.feed-item .fi-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fi-icon.insight { background: var(--ai-light); color: var(--ai-color); }
.fi-icon.alert  { background: var(--warning-bg); color: var(--warning); }
.fi-icon.event  { background: var(--accent-light); color: var(--accent); }
.feed-item .fi-content { flex: 1; min-width: 0; }
.fi-content .fi-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.fi-content .fi-desc  { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; }
.fi-content .fi-time  { font-size: 10px; color: var(--text-tertiary); margin-top: 6px; }

/* Multi-Agent activity feed */
.agent-feed-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:10px; }
.agent-feed-heading .section-title { margin:0; }
.agent-feed-heading small { color:var(--text-tertiary); font-size:10px; }
.agent-feed { position:relative; gap:11px; }
.agent-card {
  position:relative; padding:14px; overflow:hidden; border:1px solid var(--border-primary);
  border-radius:17px; background:#fff; box-shadow:0 4px 14px rgba(65,45,30,.035);
  cursor:pointer;
}
.agent-card.priority { border-color:#efc8c5; background:linear-gradient(145deg,#fff,#fff8f7); }
.agent-card.auto { border-color:#d7e8dd; background:linear-gradient(145deg,#fff,#f8fcf9); }
.agent-card.info { border-color:#e5e0f2; }
.agent-card.is-abnormal { box-shadow:0 5px 18px rgba(226,96,96,.10); }
.agent-abnormal-badge {
  padding:4px 7px; border-radius:999px; color:var(--danger);
  background:var(--danger-bg); font-size:9.5px; font-weight:800; white-space:nowrap;
}
.agent-card-head { display:flex; align-items:center; gap:9px; }
.agent-avatar {
  width:32px; height:32px; display:grid; place-items:center; flex:none;
  border-radius:10px; color:#fff; font-size:11px; font-weight:800; letter-spacing:.3px;
}
.agent-avatar.health { background:#e57d70; }
.agent-avatar.device { background:#66a27c; }
.agent-avatar.behavior { background:#8076bf; }
.agent-identity { min-width:0; flex:1; }
.agent-name { font-size:11.5px; font-weight:750; }
.agent-meta { margin-top:2px; color:var(--text-tertiary); font-size:9.5px; }
.agent-kind {
  padding:4px 7px; border-radius:999px; color:var(--text-tertiary);
  background:var(--bg-tertiary); font-size:9.5px; font-weight:700; white-space:nowrap;
}
.agent-card.priority .agent-kind { color:var(--danger); background:var(--danger-bg); }
.agent-card.auto .agent-kind { color:var(--success); background:var(--success-bg); }
.agent-card-title { margin-top:12px; font-size:13.5px; font-weight:800; line-height:1.4; }
.agent-card-desc { margin-top:5px; color:var(--text-secondary); font-size:11.5px; line-height:1.6; }
.agent-evidence { margin-top:9px; padding:8px 10px; border-radius:10px; background:rgba(255,255,255,.72); color:var(--text-tertiary); font-size:10.5px; line-height:1.5; }
.agent-action-row { display:flex; align-items:center; gap:8px; margin-top:12px; }
.agent-action-row button {
  min-height:34px; padding:8px 13px; border-radius:10px; font-family:var(--font-body);
  font-size:11px; font-weight:750; cursor:pointer;
}
.agent-primary { flex:1; border:0; background:var(--accent); color:#fff; }
.agent-card.priority .agent-primary { background:var(--danger); }
.agent-secondary { border:1px solid var(--border-primary); background:#fff; color:var(--text-secondary); }
.agent-discuss { flex:1; border:1px solid var(--ai-border); background:var(--ai-light); color:var(--ai-text); }
.agent-action-state { flex:1; display:flex; align-items:center; gap:6px; color:var(--success); font-size:10.5px; font-weight:700; }
.agent-action-state::before { content:'✓'; width:17px; height:17px; display:grid; place-items:center; border-radius:50%; background:var(--success-bg); }
.agent-card.is-complete .agent-primary { background:var(--success); }
.agent-card.is-undone { opacity:.72; }
.agent-card.is-undone .agent-action-state { color:var(--text-tertiary); }
.agent-card.is-undone .agent-action-state::before { content:'↶'; background:var(--bg-tertiary); }

/* ============================================================
   PERSISTENT AI INPUT BAR
   ============================================================ */
.persistent-ai-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  padding: 10px 16px 14px;
  background: linear-gradient(180deg, transparent, var(--bg-primary) 35%);
  pointer-events: none;
}
.persistent-ai-bar .ai-input-wrap {
  pointer-events: auto;
}
/* Push page content above the persistent bar */
.page { padding-bottom: 72px; }

/* ============================================================
   GLOBAL AI INPUT
   ============================================================ */
.ai-input-bar {
  flex-shrink: 0;
  padding: 10px 16px 16px;
  background: linear-gradient(180deg, transparent, var(--bg-primary) 30%);
}
.ai-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 4px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}
.ai-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.ai-input-wrap input {
  flex: 1; border: none; outline: none;
  font-size: 13px; font-family: var(--font-body);
  color: var(--text-primary); background: transparent;
  padding: 10px 0;
}
.ai-input-wrap input::placeholder { color: var(--text-tertiary); }
.ai-input-send {
  width: 38px; height: 38px;
  border-radius: 50%; border: none;
  background: var(--accent-gradient);
  color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ai-input-send:active { transform: scale(0.9); opacity: 0.8; }

/* ============================================================
   HEALTH PAGE
   ============================================================ */
.weekly-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  cursor: pointer;
  transition: all 0.2s ease;
}
.weekly-banner:active { transform: scale(0.985); }
.weekly-banner .wb-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: rgba(63,168,106,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--success);
}
.weekly-banner .wb-content { flex: 1; min-width: 0; }
.wb-content .wb-title { font-size: 12.5px; font-weight: 700; color: var(--success); margin-bottom: 2px; }
.wb-content .wb-desc  { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.health-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.metric-card {
  padding: 14px 12px; text-align: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}
.metric-card .mc-icon { margin-bottom: 6px; }
.metric-card .mc-value {
  font-family: var(--font-number); font-size: 22px; font-weight: 700;
  letter-spacing: -1px; margin-bottom: 2px;
}
.metric-card .mc-label { font-size: 10.5px; color: var(--text-tertiary); font-weight: 500; }
.metric-card .mc-sub   { font-size: 10px; margin-top: 4px; }
.mc-sub.good { color: var(--success); }
.mc-sub.warn { color: var(--warning); }

.behavior-card { margin-bottom: 14px; }
.behavior-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
}
.behavior-row + .behavior-row { border-top: 1px solid var(--border-light); }
.behavior-row .br-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.br-icon.water  { background: rgba(66,153,225,0.10); color: #4299E1; }
.br-icon.food   { background: rgba(242,104,58,0.10); color: var(--accent); }
.br-icon.litter { background: rgba(124,111,247,0.10); color: var(--ai-color); }
.behavior-row .br-info { flex: 1; }
.br-info .br-label { font-size: 12.5px; font-weight: 600; }
.br-info .br-desc  { font-size: 10.5px; color: var(--text-tertiary); margin-top: 1px; }
.behavior-row .br-value { text-align: right; }
.br-value .br-num  { font-family: var(--font-number); font-size: 17px; font-weight: 700; }
.br-value .br-unit { font-size: 10px; color: var(--text-tertiary); }

/* Trend Charts */
.trend-tab-btn {
  font-size: 10.5px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--radius-full); border: 1px solid var(--border-primary);
  background: var(--bg-secondary); color: var(--text-tertiary);
  cursor: pointer; transition: all 0.15s ease;
  font-family: var(--font-body);
}
.trend-tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.trend-bars { display: flex; align-items: flex-end; gap: 6px; height: 100px; padding: 0 4px; }
.trend-bar-wrap { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.trend-bar {
  width: 100%; border-radius: 4px 4px 0 0; transition: height 0.5s var(--ease-out-expo);
}
.trend-bar.water  { background: linear-gradient(180deg, #63B3ED, #4299E1); }
.trend-bar.food   { background: linear-gradient(180deg, #FFB088, #F2683A); }
.trend-bar.litter { background: linear-gradient(180deg, #B8A8F0, #7C6FF7); }
.trend-bar-label { font-size: 9px; color: var(--text-tertiary); }
.trend-line-section { margin-bottom: 14px; }
.trend-line-title { font-size: 10.5px; color: var(--text-secondary); margin-bottom: 4px; }
.trend-line-chart { display: block; width: 100%; height: 100px; overflow: visible; }
.trend-line-grid { stroke: var(--border-light); stroke-width: 1; }
.trend-line-path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trend-line-path.water { stroke: #4299E1; fill: none; }
.trend-line-dot.water { stroke: #4299E1; fill: #4299E1; }
.trend-line-path.food { stroke: var(--accent); fill: none; }
.trend-line-dot.food { stroke: var(--accent); fill: var(--accent); }
.trend-line-path.litter { stroke: var(--ai-color); fill: none; }
.trend-line-dot.litter { stroke: var(--ai-color); fill: var(--ai-color); }
.trend-line-dot { stroke: var(--bg-primary); stroke-width: 1.5; }

/* Anomaly Log */
.anomaly-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0;
}
.anomaly-item + .anomaly-item { border-top: 1px solid var(--border-light); }
.anomaly-item .ai-status {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 3px; flex-shrink: 0;
}
.ai-status.resolved { background: var(--success); }
.ai-status.active   { background: var(--danger); }
.anomaly-item .ai-body { flex: 1; }
.ai-body .ai-title { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.ai-body .ai-desc  { font-size: 10.5px; color: var(--text-secondary); }
.ai-body .ai-time  { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }

.ai-health-entry {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; margin-top: 4px;
  border-radius: var(--radius-lg);
  background: var(--ai-light);
  border: 1px solid var(--ai-border);
  box-shadow: var(--ai-glow);
  cursor: pointer;
  transition: all 0.2s ease;
}
.ai-health-entry:active { transform: scale(0.985); }
.ai-health-entry .ahe-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124,111,247,0.15), rgba(124,111,247,0.06));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--ai-color);
}
.ai-health-entry .ahe-content { flex: 1; }
.ahe-content .ahe-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.ahe-content .ahe-desc  { font-size: 11px; color: var(--text-secondary); }

/* Health page — conclusion and action first */
.health-consult-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; border: 1px solid var(--ai-border);
  border-radius: var(--radius-full); background: var(--ai-light);
  color: var(--ai-text); font-size: 11px; font-weight: 700; cursor: pointer;
}
.health-section-label { margin:17px 1px 9px; color:var(--text-primary); font-size:13px; font-weight:750; }
.health-priority-stack { display:flex; flex-direction:column; }
.health-priority-stack .care-overview-card { order:1; }
.health-priority-stack .health-anomaly-card { order:2; }
.health-priority-stack.has-active-anomaly .health-anomaly-card { order:0; }
.health-anomaly-card { padding:15px 16px; margin-bottom:14px; }
.health-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.health-card-head h4 { font-size:13px; font-weight:700; }
.health-card-count { color:var(--text-tertiary); font-size:10px; }
.health-context-action {
  display:flex; align-items:center; justify-content:center; gap:5px; width:100%;
  margin-top:8px; padding:8px; border:0; border-top:1px solid var(--border-light);
  background:transparent; color:var(--ai-text); font-size:11px; font-weight:700; cursor:pointer;
}
.today-health-card { padding:4px 16px; margin-bottom:14px; }
.today-health-row { display:grid; grid-template-columns:74px minmax(0,1fr) auto; align-items:center; gap:10px; padding:13px 0; }
.today-health-row + .today-health-row { border-top:1px solid var(--border-light); }
.today-health-name { color:var(--text-secondary); font-size:12px; }
.today-health-detail { color:var(--text-tertiary); font-size:10.5px; }
.today-health-value { text-align:right; color:var(--text-primary); font-size:13px; font-weight:750; }
.today-health-value small { margin-left:4px; font-size:10px; font-weight:600; }
.today-health-value .normal { color:var(--success); }
.today-health-value .watch { color:var(--warning); }
.health-data-stamp { padding:10px 0 12px; border-top:1px solid var(--border-light); color:var(--text-tertiary); font-size:10px; text-align:center; }
.weekly-summary-card { padding:17px 16px 15px; margin-bottom:14px; border-color:#dce9dc; background:linear-gradient(135deg,#f7fbf6,#fff); cursor:pointer; }
.weekly-summary-kicker { color:var(--success); font-size:10px; font-weight:750; }
.weekly-summary-title { margin-top:5px; font-size:15px; font-weight:800; }
.weekly-summary-copy { margin-top:6px; color:var(--text-secondary); font-size:11.5px; line-height:1.65; }
.weekly-summary-points { display:grid; gap:7px; margin-top:12px; }
.weekly-summary-point { display:flex; gap:8px; color:var(--text-secondary); font-size:11px; }
.weekly-summary-point span { width:5px; height:5px; margin-top:5px; border-radius:50%; background:var(--success); flex:none; }
.weekly-summary-point.watch span { background:var(--warning); }
.weekly-summary-link { margin-top:12px; padding-top:10px; border-top:1px solid var(--border-light); color:var(--accent); font-size:11px; font-weight:700; text-align:right; }
.health-trend-disclosure { margin-bottom:14px; overflow:hidden; }
.health-trend-toggle { display:flex; align-items:center; width:100%; padding:15px 16px; border:0; background:#fff; color:var(--text-primary); text-align:left; }
.health-trend-toggle strong { display:block; font-size:13px; }
.health-trend-toggle small { display:block; margin-top:3px; color:var(--text-tertiary); font-size:10.5px; font-weight:400; }
.health-trend-body { display:block; padding:0 16px 16px; border-top:1px solid var(--border-light); }
.health-trend-controls { display:flex; justify-content:flex-end; gap:4px; padding:12px 0; }

/* ============================================================
   PET PAGE
   ============================================================ */
.photo-hero {
  position: relative; width: 100%; height: 240px;
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 14px; background: var(--bg-tertiary);
}
.photo-hero img {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-hero .ph-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.45));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px;
}
.ph-overlay .ph-name { font-size: 17px; font-weight: 700; color: white; font-family: var(--font-display); }
.ph-overlay .ph-info { font-size: 11px; color: rgba(255,255,255,0.8); margin-top: 2px; }

.photo-dots {
  position: absolute; bottom: 16px; right: 16px;
  display: flex; gap: 5px;
}
.photo-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.4); transition: all 0.2s ease;
}
.photo-dot.active { background: white; width: 18px; border-radius: 3px; }

/* Video highlight cover */
.video-highlight {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  cursor: pointer; transition: all 0.15s ease;
}
.video-highlight:active { background: var(--bg-tertiary); }
.video-highlight .vh-cover {
  width: 64px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 24px; position: relative; overflow: hidden;
}
.video-highlight .vh-cover::after {
  content: '▶'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: white;
  background: rgba(0,0,0,0.2);
}
.video-highlight .vh-info { flex: 1; }
.vh-info .vh-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.vh-info .vh-meta  { font-size: 10.5px; color: var(--text-secondary); }
.video-highlight .vh-badge {
  font-size: 10px; font-weight: 600; color: var(--accent);
  background: var(--accent-light); padding: 4px 10px;
  border-radius: var(--radius-full); white-space: nowrap;
}

.video-strip { display: flex; gap: 10px; margin-bottom: 14px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.video-strip::-webkit-scrollbar { height: 0; }
.video-card {
  min-width: 130px; height: 100px;
  border-radius: var(--radius-md); overflow: hidden;
  position: relative; flex-shrink: 0; scroll-snap-align: start;
  background: var(--bg-tertiary); cursor: pointer;
}
.video-card .vc-thumb { width: 100%; height: 100%; object-fit: cover; }
.video-card .vc-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2);
}
.video-card .vc-play-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.video-card .vc-duration {
  position: absolute; bottom: 6px; right: 6px;
  font-size: 9px; color: white; font-weight: 600;
  background: rgba(0,0,0,0.5); padding: 2px 6px; border-radius: 4px;
}

/* Growth Summary (one-liner, click to expand) */
.growth-summary {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  border: 1px solid rgba(242,104,58,0.15);
  cursor: pointer; transition: all 0.2s ease;
}
.growth-summary:active { transform: scale(0.985); }
.growth-summary .gs-emoji { font-size: 30px; flex-shrink: 0; }
.growth-summary .gs-line {
  font-size: 13px; font-weight: 600; color: var(--accent-dark);
  line-height: 1.6;
}
.growth-summary .gs-line .gs-num {
  font-family: var(--font-number); font-size: 16px; font-weight: 700;
  color: var(--accent); margin: 0 2px;
}
.growth-summary .gs-arrow { color: var(--accent); margin-left: auto; flex-shrink: 0; font-size: 14px; }

/* Adventure Diary */
.diary-chapter {
  background: #fffaf5;
  border-radius: var(--radius-lg);
  border: 1px solid #eee1d7;
  overflow: hidden;
  margin-bottom: 16px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(73,49,35,.06);
}
.diary-chapter:active { transform: scale(.985); }
.diary-illustration {
  width: 100%;
  height: 190px;
  display: block;
  object-fit: cover;
  border-bottom: 0;
}
.diary-preview { padding: 16px 16px 17px; }
.diary-preview-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.diary-chapter .dc-week { color: var(--accent-dark); font-size: 11px; font-weight: 750; }
.diary-preview-top time { color: var(--text-tertiary); font-size: 10.5px; }
.diary-chapter .dc-title { display: block; margin-top: 8px; color: #352b27; font-family: "Songti SC", "STSong", serif; font-size: 21px; font-weight: 700; }
.diary-excerpt { margin: 8px 0 0; color: #6f625a; font-family: "Songti SC", "STSong", serif; font-size: 14px; line-height: 1.7; }
.diary-read-more { display: inline-block; margin-top: 10px; color: var(--accent-dark); font-size: 11px; font-weight: 800; }
.postcard {
  overflow: hidden;
  border: 1px solid #ead9cb;
  border-radius: 22px;
  background: #fffaf3;
  box-shadow: 0 12px 30px rgba(71,47,35,.1);
}
.postcard-image { width: 100%; height: 246px; display: block; object-fit: cover; }
.postcard-content { padding: 19px 19px 17px; }
.postcard-kicker { color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.postcard h2 { margin: 7px 0 12px; color: #352b27; font-family: "Songti SC", "STSong", serif; font-size: 27px; line-height: 1.15; }
.postcard-copy { margin: 0; color: #554940; font-family: "Songti SC", "STSong", serif; font-size: 15px; line-height: 1.78; white-space: pre-line; }
.postcard-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 11px; border-top: 1px solid #eddfd4; color: #9a8c82; font-size: 10.5px; }
.postcard-share { width: 100%; margin-top: 13px; padding: 11px; border: 1px solid #edcbbb; border-radius: 14px; background: #fff7f0; color: var(--accent-dark); font-size: 13px; font-weight: 800; cursor: pointer; }

/* ============================================================
   MEMORY — Polaroid Scrapbook
   ============================================================ */
.memory-scrapbook {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 6px 4px 14px; margin-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.memory-scrapbook::-webkit-scrollbar { height: 0; }
.memory-polaroid {
  min-width: 140px; flex-shrink: 0;
  scroll-snap-align: start;
  padding: 8px 8px 28px 8px;
  background: #FEFCF8;
  border-radius: 3px;
  box-shadow:
    0 1px 3px rgba(60,30,10,0.06),
    0 4px 12px rgba(60,30,10,0.08),
    0 0 0 1px rgba(0,0,0,0.03);
  position: relative;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
}
.memory-polaroid:nth-child(odd)  { transform: rotate(-1.8deg); }
.memory-polaroid:nth-child(even) { transform: rotate(1.5deg); }
.memory-polaroid:nth-child(3n)   { transform: rotate(-0.6deg); }
.memory-polaroid:active {
  transform: rotate(0deg) scale(0.96) !important;
  box-shadow: 0 2px 6px rgba(60,30,10,0.1), 0 8px 20px rgba(60,30,10,0.14);
  z-index: 5;
}
/* Washi tape at top */
.memory-polaroid::before {
  content: ''; position: absolute;
  top: -4px; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: 44px; height: 12px; border-radius: 2px;
  opacity: 0.7;
}
.memory-polaroid:nth-child(1)::before  { background: rgba(242,104,58,0.45); }
.memory-polaroid:nth-child(2)::before  { background: rgba(124,111,247,0.35); }
.memory-polaroid:nth-child(3)::before  { background: rgba(63,168,106,0.35); }
.memory-polaroid:nth-child(4)::before  { background: rgba(224,138,27,0.4); }
.memory-polaroid:nth-child(5)::before  { background: rgba(66,153,225,0.35); }
.memory-polaroid:nth-child(6)::before  { background: rgba(242,104,58,0.35); }
/* Photo area */
.memory-polaroid .mp-photo {
  width: 124px; height: 110px; border-radius: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; margin: 0 auto;
  position: relative; overflow: hidden;
}
.memory-polaroid .mp-photo.no-photo {
  border: 1.5px dashed rgba(0,0,0,0.08);
  background: transparent !important;
}
.memory-polaroid .mp-photo.no-photo::after {
  content: '+'; font-size: 28px; color: var(--text-muted);
  position: absolute; font-weight: 300;
}
/* Caption */
.memory-polaroid .mp-caption {
  text-align: center; margin-top: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  font-family: var(--font-display); letter-spacing: -0.1px;
  line-height: 1.3;
}
.memory-polaroid .mp-date {
  text-align: center; font-size: 9.5px; color: var(--text-tertiary);
  margin-top: 2px; font-family: var(--font-number);
}
/* Add new polaroid */
.memory-add {
  min-width: 140px; flex-shrink: 0; scroll-snap-align: start;
  border: 2px dashed var(--border-primary); border-radius: 3px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px;
  cursor: pointer; transition: all 0.2s ease;
  color: var(--text-tertiary);
}
.memory-add:active { border-color: var(--accent); color: var(--accent); }
.memory-add .ma-plus {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-tertiary); display: flex;
  align-items: center; justify-content: center;
  font-size: 18px;
}
.memory-add .ma-label { font-size: 11px; font-weight: 600; }

/* ============================================================
   TIME CAPSULE — Glass Capsule
   ============================================================ */
.capsule-row {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 4px 0 12px; margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.capsule-row::-webkit-scrollbar { height: 0; }
.glass-capsule {
  min-width: 160px; flex-shrink: 0;
  padding: 18px 16px; border-radius: var(--radius-lg);
  position: relative; overflow: hidden; cursor: pointer;
  transition: all 0.3s var(--ease-out-expo);
  border: 1px solid rgba(255,255,255,0.5);
}
.glass-capsule::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 120% 80% at 50% 100%, rgba(255,255,255,0.25), transparent 60%),
              linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.15) 40%, rgba(255,255,255,0.4) 100%);
  z-index: 0;
}
/* Ready capsule — warm glow */
.glass-capsule.ready {
  background: linear-gradient(160deg, #FFF5EC 0%, #FFFDFB 30%, #FFF8F2 100%);
  box-shadow: 0 0 0 1px rgba(242,104,58,0.1), 0 2px 16px rgba(242,104,58,0.08);
}
.glass-capsule.ready::after {
  content: ''; position: absolute; top: -30%; right: -20%;
  width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242,104,58,0.12) 0%, transparent 70%);
  z-index: 0; animation: capsuleGlow 3s ease-in-out infinite;
}
@keyframes capsuleGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
/* Locked capsule — frosted */
.glass-capsule.locked {
  background: linear-gradient(160deg, #F8F6F4 0%, #F5F3F0 30%, #F8F6F4 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 6px rgba(0,0,0,0.04);
}
.glass-capsule.locked::before {
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.glass-capsule .gc-content { position: relative; z-index: 1; }
.glass-capsule .gc-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 10px;
}
.glass-capsule.ready  .gc-icon { background: rgba(242,104,58,0.1); }
.glass-capsule.locked .gc-icon { background: rgba(0,0,0,0.04); }
.glass-capsule .gc-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; font-family: var(--font-display); }
.glass-capsule .gc-date  { font-size: 10.5px; color: var(--text-tertiary); font-family: var(--font-number); }
.glass-capsule .gc-status {
  display: inline-block; margin-top: 10px; font-size: 10px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-full);
}
.glass-capsule.ready  .gc-status { background: rgba(242,104,58,0.1); color: var(--accent); }
.glass-capsule.locked .gc-status { background: rgba(0,0,0,0.05); color: var(--text-tertiary); }
/* Lock seal */
.glass-capsule.locked .gc-seal {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #E8E4E0, #D8D4D0);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
/* Capsule metal caps (top/bottom) */
.glass-capsule .gc-cap {
  position: absolute; left: 15%; right: 15%; height: 6px;
  background: linear-gradient(180deg, rgba(180,160,140,0.5), rgba(200,180,160,0.3));
  border-radius: 3px; z-index: 1;
}
.glass-capsule .gc-cap.top { top: 0; border-radius: 0 0 4px 4px; }
.glass-capsule .gc-cap.bottom { bottom: 0; border-radius: 4px 4px 0 0; }

/* ============================================================
   OLD STYLES (kept for reference, replaced by above)
   ============================================================ */

/* Radar Chart */
.radar-container {
  display: flex; justify-content: center; padding: 8px 0;
}
.radar-container svg { max-width: 280px; width: 100%; }

.growth-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  border: 1px solid rgba(242,104,58,0.15);
}
.growth-banner .gb-icon { font-size: 28px; }
.growth-banner .gb-text { font-size: 13px; font-weight: 600; color: var(--accent-dark); }
.growth-banner .gb-days { font-family: var(--font-number); font-size: 20px; font-weight: 700; color: var(--accent); }

.timeline { margin-bottom: 14px; position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border-primary); border-radius: 1px;
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before {
  content: ''; position: absolute; left: -20px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent-light);
}
.timeline-item .tl-date { font-size: 10.5px; color: var(--text-tertiary); margin-bottom: 4px; }
.timeline-item .tl-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.timeline-item .tl-desc { font-size: 11.5px; color: var(--text-secondary); line-height: 1.5; }
.timeline-item.has-media { padding:12px; border:1px solid var(--border-light); border-radius:15px; background:#fff; }
.timeline-item.has-media::before { left:-33px; top:18px; }
.tl-source { margin-top:4px; color:var(--text-tertiary); font-size:9.5px; }
.tl-media-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:10px; }
.tl-media-grid.single { grid-template-columns:1fr; }
.tl-media {
  position:relative; width:100%; height:94px; overflow:hidden; padding:0;
  border:0; border-radius:11px; background:#eee center/cover no-repeat; cursor:pointer;
}
.tl-media-grid.single .tl-media { height:132px; }
.tl-media::after { content:''; position:absolute; inset:0; background:linear-gradient(transparent 55%,rgba(25,18,14,.38)); }
.tl-media-type {
  position:absolute; z-index:2; left:7px; bottom:6px; padding:3px 6px;
  border-radius:6px; background:rgba(25,18,14,.55); color:#fff; font-size:9px; font-weight:650;
}
.tl-play {
  position:absolute; z-index:2; top:50%; left:50%; width:30px; height:30px;
  display:grid; place-items:center; transform:translate(-50%,-50%);
  border-radius:50%; background:rgba(255,255,255,.9); color:var(--accent); font-size:11px;
  box-shadow:0 3px 10px rgba(0,0,0,.16);
}
.tl-media-count { position:absolute; z-index:2; right:7px; bottom:6px; color:#fff; font-size:9px; }

/* ============================================================
   MEMORY CAPSULES
   ============================================================ */
.memory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.memory-capsule {
  position: relative; border-radius: var(--radius-md); overflow: hidden;
  aspect-ratio: 1; cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}
.memory-capsule:active { transform: scale(0.95); }
.memory-capsule .mc-bg {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 12px;
  text-align: center;
}
.memory-capsule .mc-emoji { font-size: 36px; margin-bottom: 8px; }
.memory-capsule .mc-label { font-size: 12px; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.memory-capsule .mc-date  { font-size: 10px; color: var(--text-tertiary); }
.memory-capsule .mc-lock {
  position: absolute; top: 8px; right: 8px;
  font-size: 12px; opacity: 0.6;
}
.memory-capsule.sealed { filter: grayscale(0.3); }
.memory-capsule.sealed .mc-emoji { filter: blur(4px); }
.memory-capsule.sealed .mc-label { color: var(--text-tertiary); }

/* ============================================================
   DEVICE PAGE
   ============================================================ */
.device-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.device-card-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.device-card-item:active { transform: scale(0.985); }
.device-card-item .dci-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dci-icon.feeder   { background: var(--accent-light); color: var(--accent); }
.dci-icon.waterer  { background: rgba(66,153,225,0.10); color: #4299E1; }
.dci-icon.litterbox { background: rgba(124,111,247,0.10); color: var(--ai-color); }
.device-card-item .dci-info { flex: 1; }
.dci-info .dci-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.dci-info .dci-model { font-size: 11px; color: var(--text-tertiary); }
.device-card-item .dci-status { text-align: right; }
.dci-status .dci-battery { font-size: 10.5px; color: var(--text-tertiary); margin-bottom: 4px; }

.add-device-btn {
  width: 100%; padding: 16px;
  border: 2px dashed var(--border-primary);
  border-radius: var(--radius-lg);
  background: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s ease;
  font-family: var(--font-body);
}
.add-device-btn:active { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   DEVICE DETAIL OVERLAY
   ============================================================ */
.overlay {
  position: absolute; inset: 0; z-index: 200;
  background: var(--bg-primary);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-spring);
  display: flex; flex-direction: column;
}
.overlay.open { transform: translateY(0); }
.overlay-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; height: 52px;
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
}
.overlay-header button {
  background: none; border: none; padding: 4px;
  cursor: pointer; color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
}
.overlay-header .oh-title { font-size: 15px; font-weight: 700; font-family: var(--font-display); }
.overlay-body { flex: 1; overflow-y: auto; padding: 16px; }
.overlay-body::-webkit-scrollbar { width: 0; }

.mall-intro { display:flex; flex-direction:column; gap:4px; margin-bottom:14px; }
.mall-intro span { font-size:14px; font-weight:750; color:var(--text-primary); }
.mall-intro small { color:var(--text-tertiary); font-size:10.5px; }
.mall-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.mall-product { min-width:0; overflow:hidden; border:1px solid var(--border-secondary); border-radius:14px; background:#fff; }
.mall-product-icon { height:92px; overflow:hidden; background:linear-gradient(135deg,#FFF4E8,#FBE9DA); }
.mall-product-icon img { display:block; width:100%; height:100%; object-fit:cover; }
.mall-product-info { padding:10px; }
.mall-product-info strong { display:block; overflow:hidden; color:var(--text-primary); font-size:12px; white-space:nowrap; text-overflow:ellipsis; }
.mall-product-info p { height:28px; margin-top:4px; overflow:hidden; color:var(--text-tertiary); font-size:9.5px; line-height:1.45; }
.mall-product-bottom { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-top:8px; }
.mall-product-bottom b { color:var(--accent-dark); font-family:var(--font-number); font-size:13px; }
.mall-product-bottom button { padding:4px 8px; border:0; border-radius:var(--radius-full); background:var(--accent-light); color:var(--accent-dark); font-size:10px; cursor:pointer; }
.mall-footnote { margin-top:16px; color:var(--text-tertiary); font-size:10px; text-align:center; }

.detail-tabs {
  display: flex; border-bottom: 1px solid var(--border-primary);
  padding: 0 16px;
}
.detail-tab {
  flex: 1; padding: 12px 0; text-align: center;
  font-size: 13px; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.detail-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.detail-stat {
  padding: 16px; text-align: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}
.detail-stat .ds-value {
  font-family: var(--font-number); font-size: 26px; font-weight: 700;
  letter-spacing: -1px; margin-bottom: 4px;
}
.detail-stat .ds-label { font-size: 11px; color: var(--text-tertiary); }

.control-panel { display: flex; flex-direction: column; gap: 12px; }
.control-btn {
  width: 100%; padding: 14px; border-radius: var(--radius-md);
  border: none; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font-body);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.control-btn:active { transform: scale(0.97); }
.control-btn.primary { background: var(--accent-gradient); color: white; box-shadow: 0 4px 12px rgba(242,104,58,0.3); }
.control-btn.secondary { background: var(--bg-tertiary); color: var(--text-primary); }
.control-btn.danger { background: var(--danger-bg); color: var(--danger); }

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-header-card {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 16px; margin-bottom: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  cursor: pointer;
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-light), #FFE0D0);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 24px;
}
.profile-info .pi-name { font-size: 16px; font-weight: 700; margin-bottom: 3px; font-family: var(--font-display); }
.profile-info .pi-phone { font-size: 12px; color: var(--text-secondary); }

.account-hero { display:flex; align-items:center; gap:12px; padding:16px; border-radius:16px; background:linear-gradient(135deg,#FFF4E8,#FFFDFB); }
.account-avatar { display:flex; align-items:center; justify-content:center; width:48px; height:48px; border-radius:50%; background:var(--accent-light); font-size:24px; }
.account-hero strong, .account-hero span { display:block; }
.account-hero strong { color:var(--text-primary); font-size:16px; }
.account-hero span { margin-top:4px; color:var(--text-secondary); font-size:11px; }
.account-membership { display:grid; grid-template-columns:1fr auto; gap:6px 10px; margin-top:12px; padding:14px 16px; border-radius:14px; background:linear-gradient(135deg,#FFF2D6,#FFF9ED); }
.account-membership span { color:#9D6A18; font-size:13px; font-weight:750; }
.account-membership b { color:#9D6A18; font-size:13px; text-align:right; }
.account-membership small { grid-column:1 / -1; color:#B28B50; font-size:10px; }
.account-section-title { margin:22px 2px 8px; color:var(--text-tertiary); font-size:11px; font-weight:700; }
.account-menu { overflow:hidden; border:1px solid var(--border-secondary); border-radius:14px; background:#fff; }
.account-menu button { display:flex; align-items:center; justify-content:space-between; width:100%; padding:14px 15px; border:0; border-bottom:1px solid var(--border-light); background:transparent; color:var(--text-primary); font:inherit; font-size:12px; text-align:left; cursor:pointer; }
.account-menu button:last-child { border-bottom:0; }
.account-menu button b { color:var(--text-tertiary); font-size:18px; font-weight:400; }
.account-menu button small { margin-left:6px; color:var(--text-tertiary); font-size:10px; }
.account-footnote { margin-top:22px; color:var(--text-tertiary); font-family:var(--font-serif); font-size:12px; text-align:center; }

.membership-cards { display: flex; gap: 10px; margin-bottom: 20px; }
.member-card {
  flex: 1; padding: 16px; border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  transition: all 0.2s ease;
}
.member-card:active { transform: scale(0.97); }
.member-card.vip  { background: linear-gradient(135deg, #FFF5EC, #FFE8D8); border: 1px solid rgba(242,104,58,0.2); }
.member-card.mall { background: var(--ai-light); border: 1px solid var(--ai-border); }
.member-card .mcard-title { font-size: 13px; font-weight: 700; }
.member-card .mcard-desc  { font-size: 10.5px; color: var(--text-secondary); }
.member-card .mcard-badge {
  align-self: flex-start; padding: 2px 8px; border-radius: var(--radius-full);
  font-size: 10px; font-weight: 600;
}
.mcard-badge.vip  { background: rgba(242,104,58,0.15); color: var(--accent); }
.mcard-badge.mall { background: rgba(124,111,247,0.12); color: var(--ai-text); }

.menu-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  overflow: hidden; margin-bottom: 12px;
}
.menu-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.menu-row:active { background: var(--bg-tertiary); }
.menu-row + .menu-row { border-top: 1px solid var(--border-light); }
.menu-row .mr-left { display: flex; align-items: center; gap: 10px; }
.menu-row .mr-icon { color: var(--text-secondary); }
.menu-row .mr-label { font-size: 14px; }
.menu-row .mr-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.menu-row .mr-arrow { color: var(--text-muted); }

/* ============================================================
   OVERLAY: PET SWITCHER
   ============================================================ */
.pet-switcher-overlay {
  position: absolute; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 0.35s ease;
}
.pet-switcher-overlay.open { background: rgba(0,0,0,0.35); pointer-events: auto; }
.pet-switcher-sheet {
  margin-top: auto;
  background: var(--bg-secondary);
  border-radius: 22px 22px 0 0;
  padding: 8px 16px 24px;
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-spring);
}
.pet-switcher-overlay.open .pet-switcher-sheet { transform: translateY(0); }
.switcher-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border-primary); margin: 6px auto 16px;
}
.switcher-title {
  font-size: 15px; font-weight: 700; text-align: center;
  margin-bottom: 16px; font-family: var(--font-display);
}
.switcher-pet {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: var(--radius-md);
  cursor: pointer; transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.switcher-pet:active { background: var(--bg-tertiary); }
.switcher-pet.active { background: var(--accent-light); }
.switcher-pet img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.switcher-pet .sp-info { flex: 1; }
.sp-info .sp-name { font-size: 14px; font-weight: 600; }
.sp-info .sp-breed { font-size: 11px; color: var(--text-secondary); }
.switcher-pet .sp-check { color: var(--accent); opacity: 0; }
.switcher-pet.active .sp-check { opacity: 1; }

/* ============================================================
   OVERLAY: NOTIFICATIONS
   ============================================================ */
.notif-overlay {
  position: absolute; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  background: var(--bg-primary);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-spring);
}
.notif-overlay.open { transform: translateY(0); }

/* ============================================================
   CONSULT PAGE
   ============================================================ */
.consult-tabs {
  display: flex; padding: 0 16px;
  border-bottom: 1px solid var(--border-primary);
}
.consult-tab {
  flex: 1; padding: 12px 0; text-align: center;
  font-size: 12.5px; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.consult-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; max-width: 85%; }
.chat-msg.assistant { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }
.chat-msg .cm-bubble {
  padding: 12px 16px; border-radius: 18px;
  font-size: 13px; line-height: 1.55;
}
.chat-msg.assistant .cm-bubble {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-left-radius: 6px;
}
.chat-msg.user .cm-bubble {
  background: var(--accent-gradient);
  color: white;
  border-bottom-right-radius: 6px;
}

.chat-disclaimer {
  text-align: center; padding: 10px 16px;
  font-size: 10px; color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-light);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.anim-fade-up {
  animation: fadeInUp 0.5s var(--ease-out-expo) both;
}
.anim-fade-scale {
  animation: fadeInScale 0.4s var(--ease-out-back) both;
}

/* Staggered children */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.40s; }

/* Ripple */
.ripple {
  position: relative; overflow: hidden;
}
.ripple::after {
  content: ''; position: absolute;
  inset: 0; background: radial-gradient(circle, currentColor 10%, transparent 10%) center;
  transform: scale(10); opacity: 0; transition: transform 0.5s, opacity 0.6s;
}
.ripple:active::after { transform: scale(0); opacity: 0.08; transition: 0s; }

/* ============================================================
   SCROLLBAR HIDE
   ============================================================ */
.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* ============================================================
   RESPONSIVE (small screens)
   ============================================================ */
@media (max-width: 420px) {
  .phone-frame { width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
  body { padding: 0; }
}

/* ============================================================
   DESIGN PHILOSOPHY PANELS — Three-column editorial layout
   Left: overall philosophy. Right: per-tab philosophy.
   Both dissolve into the warm page background.
   ============================================================ */
.app-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 36px;
  max-width: 1520px;
  width: 100%;
}

/* ── LEFT: Overall Design Philosophy (static) ── */
.design-panel-left {
  flex: 0 0 310px;
  max-width: 340px;
  background: transparent;
  border: none;
  box-shadow: none;
  position: sticky;
  top: 32px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 0 4px 24px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(180,150,120,0.2) transparent;
}
.design-panel-left::-webkit-scrollbar { width: 3px; }
.design-panel-left::-webkit-scrollbar-track { background: transparent; }
.design-panel-left::-webkit-scrollbar-thumb { background: rgba(180,150,120,0.25); border-radius: 3px; }

/* thin rule between left panel and phone */
.design-panel-left::after {
  content: '';
  position: absolute;
  right: -18px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(180,150,120,0.30) 12%, rgba(180,150,120,0.30) 88%, transparent 100%);
}
.dpl-header {
  margin-bottom: 26px;
}
.dpl-brand {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.75;
}
.dpl-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: 0.2px;
  margin-bottom: 12px;
}
.dpl-title .dpl-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dpl-sub {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.dpl-sub::after {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent-gradient);
  margin-top: 16px;
  opacity: 0.5;
}
.dpl-section {
  margin-bottom: 24px;
}
.dpl-section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}
.dpl-text {
  font-size: 13px;
  line-height: 1.72;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.dpl-principle {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-primary);
  padding: 10px 0 10px 16px;
  border-left: 2px solid rgba(242,104,58,0.25);
  margin-bottom: 6px;
  position: relative;
}
.dpl-principle .dpl-num {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
  display: block;
  margin-bottom: 2px;
}
.dpl-quote {
  font-family: var(--font-serif);
  font-size: 16px;
  font-style: italic;
  line-height: 1.55;
  color: var(--text-primary);
  padding: 16px 0 14px 18px;
  border-left: 3px solid var(--accent);
  margin-top: 10px;
  opacity: 0.85;
}

/* ── RIGHT: Per-Tab Design Philosophy (switches with tabs) ── */
.design-panel {
  flex: 0 0 370px;
  max-width: 410px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  position: sticky;
  top: 32px;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}
/* thin rule left of right panel */
.design-panel::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(180,150,120,0.30) 12%, rgba(180,150,120,0.30) 88%, transparent 100%);
}

.dp-header {
  padding: 0 0 24px 0;
  border-bottom: none;
  flex-shrink: 0;
  position: relative;
}
.dp-header::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent-gradient);
  margin-top: 16px;
  opacity: 0.5;
}
.dp-header-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.3px;
}
.dp-header-title .dp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gradient);
  flex-shrink: 0;
}
.dp-header-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 6px;
  margin-left: 18px;
  font-style: italic;
}

.dp-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(180,150,120,0.2) transparent;
}
.dp-body::-webkit-scrollbar { width: 3px; }
.dp-body::-webkit-scrollbar-track { background: transparent; }
.dp-body::-webkit-scrollbar-thumb { background: rgba(180,150,120,0.25); border-radius: 3px; }

.design-section {
  display: none;
  animation: dsSlideIn 0.4s var(--ease-out-expo);
}
.design-section.active { display: block; }

@keyframes dsSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ds-icon-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.ds-emoji { font-size: 34px; line-height: 1; }

.ds-tab-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.ds-tagline {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 26px;
  padding: 5px 0;
  background: none;
  border-radius: 0;
  display: inline-block;
  opacity: 0.8;
}

.ds-block { margin-bottom: 22px; }

.ds-block-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ds-block-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent-gradient);
  flex-shrink: 0;
  opacity: 0.6;
}

/* concept block: barely-there warm glass */
.ds-concept {
  font-size: 17px;
  line-height: 1.78;
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(251,246,239,0.55) 0%, rgba(255,248,243,0.35) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: 12px;
  padding: 18px 20px;
  border: none;
  border-left: 3px solid var(--accent);
  box-shadow: 0 1px 3px rgba(80,50,20,0.04);
}

.ds-points {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ds-points li {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 9px 0 9px 20px;
  position: relative;
  border-bottom: none;
}
.ds-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(180,150,120,0.45);
}
.ds-points li .pt-label {
  font-weight: 600;
  color: var(--text-primary);
}

/* AI badge: whisper of purple on warm ground */
.ds-ai-badge {
  font-size: 15px;
  color: var(--ai-text);
  background: linear-gradient(135deg, rgba(124,111,247,0.04) 0%, rgba(124,111,247,0.02) 100%);
  border: none;
  border-left: 2px solid rgba(124,111,247,0.28);
  border-radius: 0 10px 10px 0;
  padding: 16px 18px;
  line-height: 1.7;
  margin-top: 18px;
}
.ds-ai-badge .ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--ai-text);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  opacity: 0.8;
}

/* ============================================================
   CARE RECORDS — v4 护理记录风格
   一级页面：紧凑总览卡片 → 点击进入二级 overlay
   ============================================================ */

/* ── 一级页面：护理总览卡片 ── */
.care-overview-card {
  margin-bottom: 14px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border-secondary);
  border-left: 4px solid var(--warning);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.care-overview-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.care-overview-card:active {
  transform: scale(0.985);
  background: var(--bg-tertiary);
}
.cov-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cov-title {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 7px;
}
.cov-ai-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, #7C6FF7, #A78BFA);
  flex-shrink: 0;
}
.cov-badge {
  font-size: 10.5px; font-weight: 700; padding: 3px 9px;
  border-radius: 10px; flex-shrink: 0;
  background: var(--danger-bg); color: var(--danger);
}
.cov-ai-summary {
  font-size: 11.5px; color: var(--text-secondary); line-height: 1.6;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(124,111,247,0.03), rgba(124,111,247,0.01));
  border-radius: 8px;
  border-left: 2px solid rgba(124,111,247,0.2);
}
.cov-items {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 6px;
}
.cov-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary);
  padding: 5px 0;
}
.cov-item-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.cov-item-dot.warn   { background: #F59E0B; }
.cov-item-dot.danger { background: var(--danger); }
.cov-item-icon { font-size: 13px; flex-shrink: 0; }
.cov-item-label { font-weight: 500; flex: 1; }
.cov-item-label .cov-tag {
  font-size: 10px; font-weight: 600; margin-left: 4px;
}
.cov-item-date {
  color: var(--text-tertiary); font-size: 10.5px;
  flex-shrink: 0;
}
.cov-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  padding-top: 8px; margin-top: 2px;
  border-top: 0.5px solid var(--border-secondary);
  font-size: 11px; color: var(--accent); font-weight: 600;
}
.cov-empty { text-align: center; padding: 16px 12px 8px; }
.cov-empty-icon { font-size: 24px; margin-bottom: 6px; opacity: 0.7; }
.cov-empty-text { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 2px; }
.cov-empty-sub { font-size: 11px; color: var(--text-tertiary); }

/* ── 二级 overlay：完整护理记录 ── */
.care-section { margin-bottom: 18px; }
.care-cat-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
  font-size: 13px; font-weight: 700; color: var(--text-primary);
}
.care-cat-icon { font-size: 16px; }
.care-cat-count { font-size: 11px; color: var(--text-tertiary); font-weight: 400; }
.care-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
  box-shadow: var(--shadow-xs);
  border: 0.5px solid var(--border-secondary);
  transition: all 0.15s ease;
  cursor: pointer;
}
.care-item:active { transform: scale(0.98); background: var(--bg-tertiary); }
.care-item-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.care-item-icon.health  { background: #FFECE0; color: #F57C3D; }
.care-item-icon.groom   { background: #E8F0FF; color: #7C6FF7; }
.care-item-icon.clean   { background: #E8F8E8; color: #4CAF50; }
.care-item-body { flex: 1; min-width: 0; }
.care-item-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.care-item-date { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.care-item-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.care-status {
  font-size: 10.5px; font-weight: 600; padding: 3px 10px;
  border-radius: 10px; flex-shrink: 0; white-space: nowrap;
}
.care-status.done   { background: var(--success-bg); color: var(--success); }
.care-status.warn   { background: var(--warning-bg); color: #C27800; }
.care-status.danger { background: var(--danger-bg); color: var(--danger); }
.care-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 0; margin-top: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-tertiary);
  border: 1px dashed var(--border-primary); border-radius: 10px;
  cursor: pointer; transition: all 0.15s ease;
}
.care-add-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }
.care-add-btn:active { background: var(--bg-tertiary); }
.care-expand-btn {
  text-align: center; padding: 8px 0;
  font-size: 11.5px; color: var(--accent); font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.care-expand-btn:hover { opacity: 0.7; }
.care-expand-btn:active { opacity: 0.5; }

/* Stack on narrow viewports */
@media (max-width: 1300px) {
  .app-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 28px;
  }
  .design-panel-left,
  .design-panel {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    max-height: none;
    position: static;
  }
  .design-panel-left::after,
  .design-panel::before { display: none; }
}

/* ============================================================
   DIRECTION 01 OVERRIDE · Faithful warm editorial replica
   Keep the existing interaction model; restyle the shell and
   core components to match UI/design-demos/01-faithful-replica.
   ============================================================ */
:root {
  --bg-primary: #f8f4f1;
  --bg-secondary: #fffdfb;
  --bg-tertiary: #f1ebe7;
  --text-primary: #2d2927;
  --text-secondary: #756b65;
  --text-tertiary: #9b928c;
  --border-primary: #eee5df;
  --border-secondary: #e8ded7;
  --border-light: #f2ebe6;
  --accent: #ff7547;
  --accent-light: #fff0e9;
  --accent-dark: #f26139;
  --accent-gradient: linear-gradient(135deg, #ff8058, #ff6d43);
  --radius-xl: 28px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  align-items: flex-start;
  padding: 36px 32px 58px;
  background: radial-gradient(circle at 45% -10%, #fff9f4 0, #f5ede7 48%, #eadfd8 100%);
}

.app-wrapper {
  align-items: flex-start;
  gap: 30px;
  max-width: 1360px;
}

.design-panel-left {
  flex: 0 0 min(900px, 62vw);
  max-width: 900px;
  position: static;
  max-height: none;
  padding: 0;
}
.design-panel-left::after,
.design-panel { display: none; }
.dpl-header { margin-bottom: 0; }
.dpl-brand {
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--accent-dark);
  opacity: 1;
}
.dpl-title {
  font-family: "Songti SC", "STSong", serif;
  font-size: 34px;
  line-height: 1.12;
  color: #352b27;
  margin: 8px 0;
}
.dpl-title .dpl-accent {
  color: var(--accent-dark);
  background: none;
  -webkit-text-fill-color: currentColor;
}
.dpl-sub {
  max-width: 780px;
  color: #746a64;
  font-size: 14px;
  line-height: 1.7;
}
.dpl-sub::after,
.dpl-section,
.dpl-quote { display: none; }
.dpl-page-content {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(180,150,120,.28);
}
.dpl-page-kicker {
  margin-bottom: 16px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
#visibleDesignContent {
  max-width: 820px;
  animation: dsSlideIn .35s var(--ease-out-expo);
}
#visibleDesignContent .ds-icon-row { margin-bottom: 4px; }
#visibleDesignContent .ds-tab-name { font-size: 25px; }
#visibleDesignContent .ds-tagline { margin-bottom: 20px; }
#visibleDesignContent .ds-block { margin-bottom: 18px; }
#visibleDesignContent .ds-concept { max-width: 780px; }
#visibleDesignContent .ds-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
}
#visibleDesignContent .ds-points li { margin-bottom: 0; }
#visibleDesignContent .ds-ai-badge { max-width: 780px; }
.ds-requirements { margin-top: 24px; }
.ds-requirement-list { display:grid; gap:10px; }
.ds-requirement-card {
  padding:14px 15px; border:1px solid #eadfd8; border-radius:14px;
  background:rgba(255,253,251,.72);
}
.ds-requirement-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.ds-requirement-head strong { color:var(--text-primary); font-size:13px; }
.ds-requirement-head span { color:var(--accent-dark); font-size:9.5px; font-weight:750; white-space:nowrap; }
.ds-requirement-card dl { display:grid; grid-template-columns:74px minmax(0,1fr); gap:6px 10px; margin:10px 0 0; }
.ds-requirement-card dt { color:var(--text-tertiary); font-size:13px; font-weight:700; }
.ds-requirement-card dd { margin:0; color:var(--text-secondary); font-size:13px; line-height:1.6; }
@media (max-width: 1120px) {
  #visibleDesignContent .ds-points { grid-template-columns: 1fr; }
}

.phone-frame {
  width: 417px;
  height: 876px;
  flex: 0 0 417px;
  max-height: none;
  padding: 12px;
  border-radius: 60px;
  background: #000;
  box-shadow: 0 0 0 2px #1f2937, 0 20px 60px rgba(55,34,22,.24);
}
.status-bar {
  height: 54px;
  margin: 0;
  padding: 0 32px;
  align-items: center;
  background: #f8f4f1;
  border-radius: 48px 48px 0 0;
  font-size: 16px;
  z-index: 20;
}
.status-bar::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  width: 124px;
  height: 36px;
  transform: translateX(-50%);
  background: #000;
  border-radius: 999px;
}
.screen {
  background: #f8f4f1;
  border-radius: 0 0 48px 48px;
}
.page { padding-bottom: 76px; }
.page-body { padding: 0 16px 24px; }
.brand-bar {
  height: 56px;
  padding: 8px 20px 9px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: sticky;
  top: 0;
  z-index: 8;
}
.brand-logo { font-size: 17px; font-weight: 900; letter-spacing: .04em; opacity: 1; }
.brand-actions { gap: 8px; }
.brand-actions { margin-left: auto; }
.brand-btn {
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
  border-radius: 14px; background: #fff;
  box-shadow: 0 4px 18px rgba(61,42,31,.08);
}
.avatar-zone {
  align-items: flex-start;
  padding: 8px 20px 18px;
  min-height: 270px;
  background: #f2ded0 url('../static/xiaobai-3d-avatar.png') center 44% / cover no-repeat;
  overflow: hidden;
}
.avatar-zone::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,.48), transparent 34%, #f8f4f1 100%);
  pointer-events: none;
}
.avatar-zone > * { position: relative; z-index: 1; }
.avatar-ring { width: 0; height: 0; margin: 0; }
.avatar-ring .glow, .avatar-ring::before { display: none; }
.avatar-img, .avatar-ring .avatar-img {
  position: absolute;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.avatar-img img { display: block; }
.avatar-zone .pet-name {
  font-size: 27px;
  font-weight: 900;
  color: #2d2927;
  margin: 0;
}
.pet-status-row { margin: 0 0 0 8px; }
.pet-greeting {
  position: absolute;
  top: 126px;
  right: 18px;
  max-width: 120px;
  padding: 13px 18px;
  border: 0;
  border-radius: 50% 48% 48% 46%;
  background: rgba(255,247,239,.78);
  color: var(--accent-dark);
  font-weight: 780;
  line-height: 1.4;
}
.card, .device-snapshot, .feed-item, .metric-card {
  border-radius: 24px;
  border-color: rgba(239,229,221,.8);
  box-shadow: 0 8px 24px rgba(73,49,35,.055);
}
.report-card {
  padding: 0;
  overflow: hidden;
  border: 0;
}
.report-card .report-header {
  margin: 0;
  padding: 14px 17px;
  background: var(--accent);
  color: white;
}
.report-card .report-header .badge { color: white; background: transparent; padding: 0; }
.report-card .report-header span:last-child { color: rgba(255,255,255,.78) !important; }
.report-card .report-body { padding: 16px 17px 0; margin-bottom: 12px; }
.report-card .report-footer { margin: 0 17px; padding: 10px 0 16px; }
.device-snapshot-row { gap: 9px; }
.device-snapshot { padding: 12px 9px; }
.device-snapshot .ds-icon { color: var(--accent); }
.badge-accent, .badge-ai { background: #fff0e9; color: var(--accent-dark); }
.feed-item { padding: 13px; }
.tab-bar {
  height: 76px;
  padding: 7px 5px 5px;
  background: rgba(255,255,255,.96);
  border-top-color: rgba(228,219,213,.8);
}
.tab-btn.active .tab-label { color: var(--accent); }
.tab-btn.tab-center .tab-icon-wrap { background: var(--accent); border-radius: 14px; box-shadow: 0 8px 16px rgba(255,117,71,.27); }
.tab-btn.tab-center { margin-top: -17px; }
.tab-btn.active::before { display: none; }

/* Pet page · real memory archive */
.time-memory {
  margin: 2px 0 16px;
  padding: 17px;
  background: #fffdfb;
  border: 1px solid rgba(239,229,221,.9);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(73,49,35,.055);
}
.time-memory-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.time-memory-heading h3 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  color: #352b27;
}
.time-memory-heading p {
  margin: 4px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
}
.memory-filter {
  display: flex;
  gap: 5px;
  margin: 15px 0 10px;
  padding: 4px;
  background: #f1ebe7;
  border-radius: 14px;
}
.memory-filter button {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 7px 4px;
  background: transparent;
  color: #80766f;
  font-size: 12px;
  cursor: pointer;
}
.memory-filter button.active {
  background: #fff;
  color: var(--accent-dark);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(60,40,30,.08);
}
.time-memory-list { display: grid; gap: 8px; }
.memory-record {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: #fff;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.memory-record:active { transform: scale(.985); background: #fff8f4; }
.memory-thumb {
  width: 52px;
  height: 52px;
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background-color: #efe7e0;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.38);
}
.memory-record-copy { min-width: 0; flex: 1; }
.memory-record-copy b { display: block; font-size: 13px; }
.memory-record-copy small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-record-arrow { color: var(--text-tertiary); font-size: 20px; line-height: 1; }
.capsule-record {
  border-style: dashed;
  border-color: #e7cbbb;
  background: linear-gradient(100deg, #fff8f2, #fffdfb);
}
.capsule-thumb { position: relative; filter: saturate(.72); }
.capsule-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(67,49,39,.12), rgba(255,245,235,.56));
}
.capsule-thumb i {
  position: absolute;
  z-index: 1;
  top: 50%; left: 50%;
  width: 27px; height: 27px;
  display: grid; place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255,250,247,.88);
  color: #6f625a;
}
.capsule-state {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f3ece6;
  color: #81756d;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.memory-save {
  width: 100%;
  margin-top: 11px;
  padding: 10px;
  border: 1px dashed #e6c8b9;
  border-radius: 14px;
  background: #fffaf6;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.memory-save span { font-size: 16px; vertical-align: -1px; }

/* Xiaohongshu-style memory feed */
.time-memory-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}
.memory-record {
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #eee1d7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(73,49,35,.045);
}
.memory-record:active { transform: scale(.975); background: #fff8f4; }
.memory-record .memory-thumb {
  width: 100%;
  height: 132px;
  border-radius: 0;
  box-shadow: none;
}
.memory-record:nth-child(2n) .memory-thumb { height: 156px; }
.memory-record-copy {
  display: block;
  padding: 10px 10px 11px;
  text-align: left;
}
.memory-record-copy b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-record-copy small {
  margin-top: 5px;
  overflow: hidden;
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.memory-record-copy em {
  display: block;
  margin-top: 6px;
  color: #b49b8d;
  font-size: 10px;
  font-style: normal;
}
.memory-record-arrow { display: none; }
.capsule-record { border-style: solid; }
.capsule-record .capsule-state {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 9px;
  background: rgba(255,250,247,.9);
  box-shadow: 0 2px 7px rgba(40,25,16,.12);
}
.capsule-record { position: relative; }
.capsule-record .memory-record-copy { padding-right: 9px; }
.capsule-record .memory-thumb { filter: saturate(.72); }
.memory-feed-empty {
  grid-column: 1 / -1;
  padding: 30px 15px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}
.time-memory-list.capsule-feed {
  grid-template-columns: 1fr;
  gap: 12px;
}
.capsule-feed .capsule-record {
  min-height: 106px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px;
  overflow: visible;
  border: 1px solid #e8d7cb;
  border-radius: 18px;
  background: #fffaf6;
  box-shadow: 0 7px 18px rgba(97,68,48,.06);
}
.capsule-feed .capsule-record::before {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: -4px;
  width: 3px;
  border-radius: 3px;
  background: #e9b795;
}
.capsule-feed .capsule-record .memory-thumb {
  width: 88px;
  height: 88px;
  border-radius: 13px;
  filter: saturate(.68) sepia(.08);
}
.capsule-feed .capsule-record .memory-record-copy {
  padding: 5px 0;
}
.capsule-feed .capsule-record .memory-record-copy b {
  font-size: 14px;
}
.capsule-feed .capsule-record .memory-record-copy small {
  margin-top: 8px;
  color: #a58d7f;
  font-size: 11px;
  line-height: 1.5;
}
.capsule-feed .capsule-record .capsule-state {
  position: static;
  align-self: center;
  padding: 6px 8px;
  border: 1px solid #ecd8ca;
  background: #fff;
  color: #a2765d;
  font-size: 10px;
}
.capsule-feed .capsule-record.opened .capsule-state {
  border-color: #d8e6d4;
  color: #76916d;
}
.capsule-feed .capsule-record.sealed .capsule-thumb::after {
  background: linear-gradient(135deg, rgba(67,49,39,.2), rgba(255,245,235,.7));
}
.memory-detail-media {
  height: 240px;
  overflow: hidden;
  border-radius: 18px;
  background-position: center;
  background-size: cover;
}
.gallery-media { position: relative; touch-action: pan-y; }
.gallery-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(255,250,247,.86);
  color: #4f443d;
  font-size: 29px;
  line-height: 28px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(30,20,14,.18);
}
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-nav:active { transform: translateY(-50%) scale(.92); }
.gallery-count {
  position: absolute;
  z-index: 2;
  right: 11px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(35,27,22,.56);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.memory-detail-media.sealed { position: relative; filter: saturate(.68); }
.memory-detail-media.sealed::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(50,39,32,.33);
  backdrop-filter: blur(3px);
}
.memory-detail-lock {
  position: absolute;
  z-index: 1;
  top: 50%; left: 50%;
  display: grid;
  justify-items: center;
  gap: 6px;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}
.memory-detail-lock svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,.2)); }
.memory-detail-meta { margin-top: 14px; color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.memory-detail-copy { margin: 7px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.memory-owner-record {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid #f0e7e0;
  border-radius: 17px;
  background: #fffaf6;
}
.owner-record-label {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff0e9;
  color: var(--accent-dark);
  font-size: 10.5px;
  font-weight: 800;
}
.memory-owner-record p {
  margin: 10px 0 8px;
  color: #4d433e;
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  line-height: 1.65;
}
.memory-owner-record footer { color: var(--text-tertiary); font-size: 11px; }
.save-moment-form { display: flex; flex-direction: column; }
.save-moment-intro { margin: 0 0 16px; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.memory-photo-picker {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto;
  column-gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 88px;
  padding: 8px;
  border: 1.5px dashed #e5c8b9;
  border-radius: 18px;
  background: #fffaf6;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.memory-photo-picker > span {
  grid-row: 1 / 3;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 12px;
  background: #fff0e9;
  color: var(--accent);
  font-size: 28px;
  background-position: center;
  background-size: cover;
}
.memory-photo-picker > span.has-photo { box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.memory-photo-picker b { align-self: end; font-size: 13px; }
.memory-photo-picker small { align-self: start; color: var(--text-tertiary); font-size: 11px; line-height: 1.45; }
.save-moment-label { margin: 18px 0 7px; color: var(--text-primary); font-size: 12px; font-weight: 750; }
.save-moment-label em { color: var(--text-tertiary); font-style: normal; font-weight: 400; }
.memory-note-input, .memory-event-select {
  width: 100%;
  border: 1px solid var(--border-primary);
  border-radius: 14px;
  outline: none;
  background: #fff;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}
.memory-note-input { padding: 11px 12px; line-height: 1.55; resize: vertical; }
.memory-event-select { height: 42px; padding: 0 12px; }
.memory-note-input:focus, .memory-event-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,117,71,.1); }
.save-memory-confirm {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.save-memory-confirm:active { transform: scale(.985); }
.save-moment-hint { margin: 10px 0 0; color: var(--text-tertiary); font-size: 10.5px; line-height: 1.55; text-align: center; }

@media (max-width: 900px) {
  body { padding: 24px 16px 40px; }
  .app-wrapper { flex-direction: column; align-items: center; }
  .design-panel-left { flex: 0 0 auto; width: min(900px, 100%); }
}
@media (max-width: 440px) {
  .phone-frame { width: 100vw; height: 100vh; padding: 0; border-radius: 0; }
  .status-bar { border-radius: 0; }
  .screen { border-radius: 0; }
}

/* ============================================================
   DESIGN REVIEW LAYOUT
   Top-level concept, centered phone, symmetric page notes.
   ============================================================ */
.design-hero {
  width: min(1440px, 100%);
  margin: 0 auto 28px;
  text-align: center;
}
body {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.design-hero-brand {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}
.design-hero h1 {
  margin: 0;
  color: var(--text-primary);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 400;
  letter-spacing: -.04em;
}
.design-hero h1 span { color: var(--accent); }
.design-hero p {
  max-width: 620px;
  margin: 10px auto 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}
.app-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 417px minmax(0, 1fr);
  align-items: start;
  gap: 30px;
  width: min(1440px, 100%);
  max-width: none;
}
.design-panel-left,
.design-panel {
  display: flex;
  flex-direction: column;
  width: auto;
  min-width: 0;
  max-width: none;
  flex: none;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.design-panel-left { padding: 0 4px 24px 0; }
.design-panel { padding: 0 0 24px 4px; }
.design-panel-left::after,
.design-panel::before { display: none; }
.design-panel-left > .dpl-header,
.design-panel-left > .dpl-section,
.design-panel-left > .dpl-quote { display: none; }
.dpl-page-content { margin-top: 0; padding-top: 0; border-top: 0; }
.dpl-page-kicker { margin-bottom: 14px; }
#visibleDesignContent .ds-points { grid-template-columns: 1fr; }
#visibleDesignContent .ds-requirements { display: none; }
#designPanel .dp-body > .design-section { display: none !important; }
#designRequirementContent { display: block; }
#designPanel .dp-body { padding-top: 0; }

@media (max-width: 1179px) {
  .app-wrapper { display: flex; flex-direction: column; align-items: center; }
  .phone-frame { order: 0; }
  .design-panel-left,
  .design-panel {
    width: min(720px, 100%);
    max-height: none;
    position: static;
  }
  .design-panel-left { order: 1; padding-right: 0; }
  .design-panel { order: 2; padding-left: 0; }
}

/* Pet profile: factual identity plus warm, explainable personality notes. */
.pet-profile-card { margin-bottom: 14px; padding: 17px; }
.pet-profile-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.pet-profile-kicker { color:var(--accent-dark); font-size:10px; font-weight:800; letter-spacing:.12em; }
.pet-profile-heading h4 { margin-top:4px; font-size:17px; font-weight:800; }
.pet-profile-paw { display:grid; width:30px; height:30px; place-items:center; border-radius:50%; color:var(--accent); background:var(--accent-light); font-size:15px; }
.pet-profile-facts { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:9px; padding-bottom:15px; border-bottom:1px solid var(--border-light); }
.pet-profile-facts div { display:flex; flex-direction:column; gap:3px; }
.pet-profile-facts span { color:var(--text-tertiary); font-size:10px; }
.pet-profile-facts b { color:var(--text-primary); font-size:12px; font-weight:700; }
.pet-personality-heading { display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin:15px 0 9px; }
.pet-personality-heading span { color:var(--text-primary); font-size:12px; font-weight:800; }
.pet-personality-heading small { color:var(--text-tertiary); font-size:9.5px; }
.pet-personality-list { display:flex; flex-direction:column; gap:8px; }
.pet-personality-item { display:grid; grid-template-columns:25px minmax(0,1fr); gap:8px; align-items:start; padding:9px 10px; border-radius:13px; background:var(--bg-tertiary); }
.pet-personality-index { display:grid; width:23px; height:23px; place-items:center; border-radius:50%; color:var(--accent-dark); background:#fff; font-family:var(--font-number); font-size:8px; font-weight:800; }
.pet-personality-item strong { color:var(--text-primary); font-size:11.5px; font-weight:800; }
.pet-personality-item p { margin-top:3px; color:var(--text-secondary); font-size:10.5px; line-height:1.55; }

/* Unified bottom navigation: four equal destinations, one interaction language. */
.tab-bar {
  height: 76px;
  padding: 7px 10px 6px;
  gap: 6px;
  background: rgba(255,255,255,.96);
  border-top: 1px solid rgba(228,219,213,.8);
}
.tab-btn,
.tab-btn.tab-center {
  height: 58px;
  min-width: 0;
  margin-top: 0;
  padding: 7px 4px 6px;
  gap: 4px;
  border-radius: 15px;
  color: var(--text-tertiary);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.tab-btn .tab-icon,
.tab-btn.tab-center .tab-icon-wrap {
  width: 22px;
  height: 22px;
  background: transparent;
  color: currentColor;
  box-shadow: none;
  border-radius: 0;
  transition: transform .2s ease, color .2s ease;
}
.tab-btn.tab-center .tab-icon-wrap { display: contents; }
.tab-btn .tab-label {
  color: currentColor !important;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1px;
}
.tab-btn.active {
  color: var(--accent);
  background: transparent;
}
.tab-btn.active .tab-icon {
  width: 32px;
  height: 32px;
  padding: 5px;
  transform: translateY(-1px);
  border-radius: 50%;
  background: var(--accent-light);
}
.tab-btn.active::before { display: none; }
.tab-btn:active { transform: scale(.95); }

/* The notification control floats over the hero and no longer reserves a blank row. */
.brand-bar {
  height: 0;
  padding: 0;
  position: absolute;
  inset: 0 0 auto;
  background: transparent;
  pointer-events: none;
}
.brand-actions {
  position: absolute;
  top: 10px;
  right: 20px;
  margin-left: 0;
  pointer-events: auto;
}

/* Consult has its own composer; remove the shared page bottom reserve so it
   sits at the same baseline as the global composer on the other pages. */
#page-consult {
  padding-bottom: 0;
}
#page-consult .ai-input-bar {
  padding: 10px 16px 14px;
}

/* Let the page and navigation read as one continuous screen inside the frame. */
.phone-frame {
  padding: 4px;
  border-radius: 56px;
}
.screen {
  border-radius: 0;
}
.tab-bar {
  border-radius: 0 0 52px 52px;
}
