/* ═══════════════════════════════════════════════
   Home — Light & Warm
   Two Dots / Is This Seat Taken inspired
   Shared CSS: tokens, base, buttons, forms, modal,
   toast, animations loaded via base.html
   ═══════════════════════════════════════════════ */

/* ── Dashboard-specific tokens ── */
:root {
  /* Status (Dashboard uses --ok/--warn/--off alongside shared --success/--danger/--warning) */
  --ok: #6EA86E;
  --warn: #E8C44A;
  --off: #D4CFC8;

  /* Dashboard-specific shadows & radii */
  --shadow-photo: 0 8px 30px rgba(44, 40, 37, 0.12);
  --r-photo: 20px;
  --r-round: 50%;

  /* Override shared radii — Dashboard uses slightly larger values */
  --r-sm: 12px;
  --r-md: 18px;

  /* Override shared shadows — Dashboard has slightly different values */
  --shadow-sm: 0 1px 4px rgba(44, 40, 37, 0.06);
  --shadow-md: 0 4px 16px rgba(44, 40, 37, 0.08);
}

/* ── Dashboard body additions ── */
body {
  min-height: 100vh;
}

html { scroll-behavior: smooth; }

/* ── Subtle background warmth ──────────────── */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(224, 112, 82, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(91, 141, 184, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ── Top Bar ───────────────────────────────── */
.topbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px var(--sp-lg) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-brand {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-icon {
  width: 118%;
  height: 118%;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 50%;
  image-rendering: high-quality;
}

/* Dog avatars have transparent backgrounds — don't clip to circle */
.topbar-brand.is-pet {
  overflow: visible;
  border-radius: 0;
}

.topbar-brand.is-pet .brand-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
}

.topbar-brand:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(224, 112, 82, 0.3);
}

.topbar-brand.is-pet:hover {
  box-shadow: none;
}

.topbar-pets {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pet-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  transition: transform 0.15s;
  cursor: pointer;
  image-rendering: high-quality;
}

.pet-icon:hover {
  transform: scale(1.15);
}

.topbar-nav {
  display: flex;
  gap: 8px;
}

.topbar-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 6px 14px;
  border-radius: 100px;
  transition: all 0.2s;
}

.topbar-link:hover { color: var(--ink-2); }

.topbar-link.active {
  color: var(--ink);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-round);
  border: 2px solid var(--bg-subtle);
  image-rendering: high-quality;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--ink-4);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  transition: color 0.2s;
}

.btn-logout:hover { color: var(--dot-red); }
.logout-form { display: flex; }

/* ── Lab Stats ────────────────────────────── */
.lab-stats-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all 0.2s;
}

.lab-stats-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.lab-stats-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lab-stats-card-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.lab-stats-card-ext {
  color: var(--ink-4);
  flex-shrink: 0;
  margin-left: 2px;
}

.lab-stat {
  display: flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

/* ── Greeting ──────────────────────────────── */
.greeting {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-lg) var(--sp);
  position: relative;
}

.greeting-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.greeting h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.greeting-quote {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  font-style: italic;
  color: var(--ink-4);
}

.greeting-meta {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lab-stats-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
}

.greeting-meta .sep {
  color: var(--ink-4);
}

/* ── Page Shell ────────────────────────────── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-lg) var(--sp-xl);
}

/* ── Hero: Photo + Live ────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: minmax(240px, 380px);
  gap: var(--sp);
  margin-bottom: var(--sp);
}

.hero-photo {
  position: relative;
  border-radius: var(--r-photo);
  overflow: hidden;
  background: var(--bg-subtle);
}

.hero-photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 1s ease;
  opacity: 0;
}

.hero-photo img.active { opacity: 1; }
.hero-photo img[src=""] { opacity: 0; }

.hero-photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 20px 16px;
  background: linear-gradient(to top, rgba(44, 40, 37, 0.5) 0%, transparent 100%);
  font-size: 13px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.2px;
}

.hero-photo-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
}

.hero-photo-loading.hidden { display: none; }

.hero-live {
  border-radius: var(--r-photo);
  overflow: hidden;
  background: var(--bg-subtle);
}

.hero-live iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.hero-live-label {
  position: absolute;
  top: 12px;
  left: 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-3);
}

/* ── App Dock ──────────────────────────────── */
.dock {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 0 auto 12px;
  max-width: 600px;
  background: var(--bg-surface);
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
  padding: 14px 28px;
}

.dock-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-app:hover {
  transform: translateY(-4px);
}

.dock-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: box-shadow 0.25s ease, background 0.2s;
}

.dock-app:hover .dock-icon {
  box-shadow: var(--shadow-md);
  background: var(--bg-hover);
}

.dock-icon img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
}

.dock-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: var(--r-round);
  background: var(--off);
  border: 2px solid var(--bg-subtle);
  transition: background 0.3s;
}

.dock-status.running {
  background: var(--ok);
}

.dock-status.stopped {
  background: var(--danger);
}

.dock-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Apps Dock (home page tile grid) ────────── */
/* ── Greeting-inline App Dock ── */
.greeting-apps {
  position: absolute;
  top: 50%;
  right: var(--sp-lg);
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(243, 237, 228, 0.7);
  padding: 24px 22px 14px;
  border-radius: 24px;
  box-shadow: 0 2px 10px rgba(44, 40, 37, 0.1);
}

.greeting-apps .dock-label {
  position: absolute;
  top: 6px;
  left: 18px;
  font-size: 9px;
  font-weight: 800;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  opacity: 0.6;
  user-select: none;
}

.app-tile {
  text-align: center;
  text-decoration: none;
  position: relative;
  transition: transform 0.2s var(--ease-out);
}

.app-tile:hover {
  transform: translateY(-3px);
}

.app-tile-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-3);
  margin-top: 2px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.app-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(44, 40, 37, 0.15);
}

.app-tile-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.app-tile-icon--avatar {
  background: none !important;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid rgba(44, 40, 37, 0.15);
  box-shadow: 0 2px 8px rgba(44, 40, 37, 0.12);
  opacity: 0.8;
  transition: box-shadow 0.2s var(--ease-out),
              border-color 0.2s,
              opacity 0.2s;
}

.app-tile:hover .app-tile-icon--avatar {
  opacity: 1;
}

.app-tile-icon--avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  image-rendering: high-quality;
  transform: scale(1.14);
}

/* Per-app accent rings */
.app-tile-icon--avatar.app-tile-icon--bookshelf    { border-color: #6A9AC4; }
.app-tile-icon--avatar.app-tile-icon--cocktails    { border-color: #C46B6B; }
.app-tile-icon--avatar.app-tile-icon--recipes      { border-color: #6B9E6B; }
.app-tile-icon--avatar.app-tile-icon--screenroom   { border-color: #A98BFA; }
.app-tile-icon--avatar.app-tile-icon--beangpt      { border-color: #D4A44C; }

/* Hover: accent glow */
.app-tile:hover .app-tile-icon--avatar.app-tile-icon--bookshelf  { box-shadow: 0 4px 16px rgba(106, 154, 196, 0.4); }
.app-tile:hover .app-tile-icon--avatar.app-tile-icon--cocktails  { box-shadow: 0 4px 16px rgba(196, 107, 107, 0.4); }
.app-tile:hover .app-tile-icon--avatar.app-tile-icon--recipes    { box-shadow: 0 4px 16px rgba(107, 158, 107, 0.4); }
.app-tile:hover .app-tile-icon--avatar.app-tile-icon--screenroom { box-shadow: 0 4px 16px rgba(169, 139, 250, 0.4); }
.app-tile:hover .app-tile-icon--avatar.app-tile-icon--beangpt    { box-shadow: 0 4px 16px rgba(212, 164, 76, 0.4); }

/* Per-app accent gradients */
.app-tile-icon--bookshelf    { background: linear-gradient(145deg, #6A9AC4, #4A7CA7); }
.app-tile-icon--cocktails    { background: linear-gradient(145deg, #D08A42, #A8652A); }
.app-tile-icon--recipes      { background: linear-gradient(145deg, #D08A42, #A8652A); }
.app-tile-icon--screenroom   { background: linear-gradient(145deg, #A98BFA, #7B5DD4); }
.app-tile-icon--movies-tv    { background: linear-gradient(145deg, #A98BFA, #7B5DD4); }
.app-tile-icon--beangpt       { background: linear-gradient(145deg, #D4A44C, #B8892F); }
.app-tile-icon--documents    { background: linear-gradient(145deg, #7DB06B, #5A8A4C); }
.app-tile-icon--photos       { background: linear-gradient(145deg, #E0B656, #B8923E); }
.app-tile-icon--wiki         { background: linear-gradient(145deg, #8B8178, #6B6158); }
.app-tile-icon--comics       { background: linear-gradient(145deg, #D4685A, #B84A3C); }
.app-tile-icon--smart-home   { background: linear-gradient(145deg, #5B9E8F, #3D7A6B); }


/* ── Link Shelf ────────────────────────────── */
.shelf-wrap {
  position: relative;
  margin-bottom: 16px;
}

.shelf-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-4);
  margin-bottom: 8px;
}

.shelf {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.shelf::-webkit-scrollbar { display: none; }

.shelf-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 48px;
  background: linear-gradient(to right, transparent, var(--bg-page));
  pointer-events: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  opacity: 1;
  transition: opacity 0.3s;
}

.shelf-wrap.scrolled-end::after {
  opacity: 0;
}

.shelf-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 14px;
  background: var(--bg-surface);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.shelf-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.shelf-item img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
}

.shelf-item .fallback {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
}

/* ── Home Controls (HA) ────────────────────── */
.home-panel {
  margin-bottom: 16px;
}

.home-panel-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-3);
  margin-bottom: 12px;
}

#ha-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.ha-loading {
  font-size: 14px;
  color: var(--ink-3);
  padding: 12px 0;
}

.ha-climate {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--r-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.ha-climate:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ha-climate-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: -0.1px;
  margin-bottom: 6px;
}

.ha-climate-temp {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ha-climate-current {
  font-size: 36px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ha-climate-target {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}

.ha-climate-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.ha-climate-target-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ha-temp-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-round);
  border: 2px solid var(--bg-hover);
  background: var(--bg-surface);
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1;
  box-shadow: 0 1px 3px rgba(44, 40, 37, 0.06);
}

.ha-temp-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink);
  border-color: var(--ink-4);
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(44, 40, 37, 0.1);
}

.ha-temp-btn:active {
  transform: scale(0.92);
}

.ha-temp-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.ha-idle-btn {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-3);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.ha-idle-btn:hover {
  background: rgba(224, 112, 82, 0.1);
  color: var(--dot-red);
}

.ha-climate.is-off .ha-idle-btn {
  color: var(--dot-red);
  background: rgba(224, 112, 82, 0.1);
}

.ha-climate.is-off .ha-idle-btn:hover {
  background: rgba(224, 112, 82, 0.18);
}

.ha-climate-action {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 100px;
}

.ha-climate-action.heating {
  background: rgba(224, 112, 82, 0.12);
  color: var(--dot-red);
}

.ha-climate-action.cooling {
  background: rgba(91, 141, 184, 0.12);
  color: var(--dot-blue);
}

.ha-climate-action.idle, .ha-climate-action.off {
  background: var(--bg-subtle);
  color: var(--ink-3);
}

.ha-mode-toggle {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  padding: 3px;
}

.ha-mode-btn {
  flex: 1;
  padding: 5px 0;
  border: none;
  border-radius: calc(var(--r-sm) - 2px);
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ha-mode-btn:hover {
  color: var(--ink-2);
}

.ha-mode-btn.active.heat {
  background: rgba(224, 112, 82, 0.15);
  color: var(--dot-red);
  box-shadow: 0 1px 3px rgba(224, 112, 82, 0.15);
}

.ha-mode-btn.active.cool {
  background: rgba(91, 141, 184, 0.15);
  color: var(--dot-blue);
  box-shadow: 0 1px 3px rgba(91, 141, 184, 0.15);
}

.ha-switch-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ha-switch {
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.ha-switch:hover {
  background: var(--bg-subtle);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ha-switch-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ha-toggle {
  width: 34px;
  height: 18px;
  border-radius: 9px;
  background: var(--off);
  position: relative;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.ha-toggle.on {
  background: var(--ok);
  box-shadow: 0 0 8px rgba(110, 168, 110, 0.3);
}

.ha-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: var(--r-round);
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ha-toggle.on::after {
  transform: translateX(16px);
}

/* ── Today Section ───────────────────────────── */
.today-section {
  margin-bottom: 16px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.today-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.today-col {
  min-width: 0;
}

@media (max-width: 600px) {
  .today-grid {
    grid-template-columns: 1fr;
  }

  /* Card: tighter padding on mobile */
  .today-card {
    padding: 14px 16px;
  }

  /* Mood: stable height on mobile so picker state doesn't collapse */
  #mood-widget .today-card {
    min-height: 220px;
  }

  /* Locked mood: single face needs less height than the 6-face picker */
  #mood-widget .today-card:has(.mood-picker--locked) {
    min-height: 190px;
  }

  /* BeanGPT: stable height on mobile (no grid stretch to lean on) */
  .today-card--chat {
    height: auto;
    min-height: 260px;
    max-height: 340px;
  }

  .chat-empty {
    padding: 20px 16px 14px;
    gap: 12px;
  }

  /* ── Mood Picker ── */
  .mood-picker {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .mood-btn {
    width: 48px;
    min-width: 0;
    flex-shrink: 1;
  }

  .mood-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  /* Labels always visible on touch — no hover */
  .mood-btn-label {
    opacity: 1;
    font-size: 10px;
  }

  /* Locked face: slightly smaller */
  .mood-picker--locked .mood-btn.selected .mood-img {
    width: 90px;
    height: 90px;
  }

  .mood-picker--locked .mood-btn[data-mood="6"].selected .mood-img {
    width: 100px;
    height: 100px;
  }

  /* ── 7-Day Strip ── */
  .mood-strip {
    gap: 2px;
  }

  .mood-strip-img {
    width: 36px;
    height: 36px;
  }

  .mood-strip-empty {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .mood-strip-name {
    font-size: 8px;
  }

  /* ── Month Calendar ── */
  .mood-cal-img {
    width: 30px;
    height: 30px;
  }

  .mood-cal-day {
    min-height: 36px;
  }

  .mood-cal-row {
    gap: 2px;
  }

  /* ── History Toggle: bigger touch target ── */
  .mood-history-toggle {
    font-size: 12px;
    padding: 10px 0 2px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Mood toggle (header button): bigger touch target */
  .mood-toggle {
    font-size: 12px;
    padding: 6px 12px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
}

/* Ultra-narrow screens (iPhone SE, small Androids) */
@media (max-width: 380px) {
  .mood-btn {
    width: 42px;
    min-width: 0;
    flex-shrink: 1;
  }

  .mood-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .mood-strip-img {
    width: 30px;
    height: 30px;
  }

  .mood-strip-empty {
    width: 30px;
    height: 30px;
  }

  .mood-cal-img {
    width: 24px;
    height: 24px;
  }

  .mood-picker--locked .mood-btn.selected .mood-img {
    width: 76px;
    height: 76px;
  }

  .mood-picker--locked .mood-btn[data-mood="6"].selected .mood-img {
    width: 84px;
    height: 84px;
  }

  #mood-widget .today-card {
    min-height: 160px;
  }
}

/* Touch devices */
@media (pointer: coarse) {
  /* Disable hover-only transforms on touch */
  .mood-btn:hover {
    transform: none;
  }

  .mood-btn.selected:hover {
    transform: scale(1.2);
  }

  .mood-strip-day:hover .mood-strip-img {
    transform: none;
  }

  .mood-cal-day:hover .mood-cal-img {
    transform: none;
  }

  /* Always show fav button on touch (no hover state) */
  .fav-btn {
    opacity: 0.4;
  }
  .fav-btn.active {
    opacity: 1;
  }

  /* Disable hover transforms on service cards */
  .svc-card:hover {
    transform: none;
  }

  /* Disable hover transforms on dock apps */
  .dock-app:hover {
    transform: none;
  }

  .dock-app:hover .dock-icon {
    box-shadow: var(--shadow-sm);
    background: var(--bg-subtle);
  }
}

.today-card {
  background: var(--bg-surface);
  border-radius: var(--r-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.today-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.today-card-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

/* ── Mood (inside today) ── */
.mood-toggle {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-4);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}

.mood-toggle:hover {
  color: var(--ink-2);
  background: var(--bg-subtle);
}

.mood-view {
  display: none;
  animation: moodFadeIn 0.2s ease;
  flex: 1;
  min-height: 0;
}

.mood-view--active {
  display: flex;
  flex-direction: column;
}

/* Center the picker faces vertically, but let history scroll naturally */
#mood-view-input.mood-view--active {
  justify-content: center;
}

@keyframes moodFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mood-picker {
  display: flex;
  justify-content: center;
  gap: 16px;
  transition: gap 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mood-btn {
  width: 64px;
  border-radius: var(--r-round);
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mood-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 50%;
  image-rendering: high-quality;
}

.mood-btn-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-4);
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mood-btn:hover .mood-btn-label {
  opacity: 1;
}

.mood-btn.selected .mood-btn-label {
  opacity: 1;
  color: var(--ink-2);
}

.mood-btn:hover {
  transform: scale(1.15);
}

.mood-btn.selected {
  transform: scale(1.2);
  filter: drop-shadow(0 2px 8px rgba(232, 196, 74, 0.5));
}

/* Locked state: only selected face visible, centered and enlarged */
.mood-picker--locked {
  gap: 0;
}

.mood-picker--locked .mood-btn {
  width: 0;
  height: 0;
  opacity: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
  transform: scale(0);
}

.mood-picker--locked .mood-btn.selected {
  width: auto;
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
  transform: scale(1);
  filter: none;
  cursor: pointer;
}

.mood-picker--locked .mood-btn.selected .mood-img {
  width: 125px;
  height: 125px;
}

.mood-picker--locked .mood-btn.selected .mood-btn-label {
  opacity: 1;
  color: var(--ink-1);
  font-size: 13px;
  font-weight: 700;
}

.mood-picker--locked .mood-btn.selected:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 2px 8px rgba(232, 196, 74, 0.35));
}

/* ── Dog mood (level 6) — better than great ── */
.mood-btn[data-mood="6"].selected {
  filter: drop-shadow(0 2px 12px rgba(250, 160, 80, 0.7));
}

.mood-picker--locked .mood-btn[data-mood="6"].selected .mood-img {
  width: 135px;
  height: 135px;
  animation: dogWag 1.4s ease-in-out infinite;
}

.mood-picker--locked .mood-btn[data-mood="6"].selected .mood-btn-label {
  color: var(--ink-1);
  letter-spacing: 0.5px;
}

.mood-picker--locked .mood-btn[data-mood="6"].selected:hover {
  filter: drop-shadow(0 2px 10px rgba(250, 160, 80, 0.5));
}

/* Dog avatars have transparent backgrounds — don't clip to circle */
.mood-btn[data-mood="6"] .mood-img,
.mood-strip-img[data-mood="6"],
.mood-cal-img[data-mood="6"] {
  border-radius: 0;
}

@keyframes dogWag {
  0%, 100% { transform: rotate(-6deg) scale(1); }
  20%       { transform: rotate(6deg)  scale(1.03); }
  40%       { transform: rotate(-4deg) scale(1); }
  60%       { transform: rotate(5deg)  scale(1.03); }
  80%       { transform: rotate(-3deg) scale(1); }
}

.mood-history {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

/* ── 7-day strip view ── */
.mood-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.mood-strip-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.mood-strip-day.today {
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  padding: 6px 2px;
}

.mood-strip-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mood-strip-day:hover .mood-strip-img {
  transform: scale(1.15);
}

.mood-strip-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-3);
  line-height: 1;
  text-transform: capitalize;
}

.mood-strip-empty {
  width: 56px;
  height: 56px;
  border-radius: var(--r-round);
  border: 2px dashed var(--ink-4);
  opacity: 0.25;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 300;
  color: var(--ink-4);
  line-height: 1;
}

.mood-strip-empty::after {
  content: '+';
}

.mood-strip-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-4);
  line-height: 1;
}

.mood-strip-day.today .mood-strip-label {
  color: var(--ink-2);
  font-weight: 700;
}

.mood-history-toggle {
  background: none;
  border: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-4);
  cursor: pointer;
  padding: 6px 0 0;
  text-align: center;
  transition: color 0.15s ease;
}

.mood-history-toggle:hover {
  color: var(--ink-2);
}

.mood-month-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-3);
  text-align: center;
  margin-bottom: 4px;
}

.mood-cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.mood-cal-header {
  margin-bottom: 2px;
}

.mood-cal-dow {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-4);
  text-align: center;
  line-height: 1;
}

.mood-cal-blank {
  aspect-ratio: 1;
}

.mood-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  position: relative;
  padding: 2px 0;
  min-height: 44px;
}

.mood-cal-day.today {
  background: var(--bg-subtle);
}

.mood-cal-day.future {
  opacity: 0.3;
}

.mood-cal-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-4);
  line-height: 1;
}

.mood-cal-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mood-cal-day:hover .mood-cal-img {
  transform: scale(1.25);
}

.mood-cal-empty {
  width: 14px;
  height: 14px;
  border-radius: var(--r-round);
  border: 1.5px dashed var(--ink-4);
  opacity: 0.35;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 300;
  color: var(--ink-4);
  line-height: 1;
}

.mood-cal-empty::after {
  content: '+';
}

/* ── Clickable past days ── */
.mood-cal-day.clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.mood-cal-day.clickable:hover {
  background: var(--bg-subtle);
}

.mood-cal-day.clickable:hover .mood-cal-empty {
  opacity: 0.6;
}

.mood-strip-day.clickable {
  cursor: pointer;
}

.mood-strip-day.clickable:hover .mood-strip-empty {
  opacity: 0.6;
}

/* ── Date pill (editing past day) ── */
.mood-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(232, 196, 74, 0.1);
  border: 1px solid rgba(232, 196, 74, 0.25);
  border-radius: 6px;
  padding: 4px 12px;
  margin-bottom: 8px;
}

.mood-date-pill-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(232, 196, 74, 0.9);
}

.mood-date-pill-close {
  font-size: 10px;
  color: var(--ink-4);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s ease;
}

.mood-date-pill-close:hover {
  color: var(--ink-2);
}


/* ── BeanGPT Chat (in today-card) ────────────── */
.today-card--chat {
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 320px;
  max-height: 500px;
  background: var(--bg-surface);
}

.today-card--chat .today-card-header {
  padding: 14px 18px 0;
  margin-bottom: 0;
}

.today-card--chat .today-card-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.chat-model-select {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-subtle);
  border: 1.5px solid transparent;
  border-radius: 100px;
  padding: 5px 26px 5px 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  width: auto;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A9A29A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-color: var(--bg-subtle);
}

.chat-model-select:hover {
  background-color: var(--bg-hover);
  border-color: var(--ink-4);
  color: var(--ink-2);
}

.chat-model-select:focus {
  border-color: var(--dot-blue);
  box-shadow: 0 0 0 2px rgba(91, 141, 184, 0.12);
  background-color: var(--bg-surface);
}

.chat-messages {
  background: var(--bg-surface);
  margin: 0;
  border-radius: 0;
  padding: 16px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(171, 162, 154, 0.5) transparent;
  cursor: text;
  position: relative;
}

.chat-bubble {
  padding: 8px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  max-width: 85%;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: chatBubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatBubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--dot-blue);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px rgba(91, 141, 184, 0.22);
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--bg-subtle);
  color: var(--ink);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 6px rgba(44, 40, 37, 0.06);
}

/* ── Chat input row ── */
.chat-input-row {
  display: flex;
  gap: 0;
  margin: 0;
  overflow: hidden;
  background: var(--bg-surface);
  border-top: 1px solid rgba(44, 40, 37, 0.08);
  box-shadow: 0 -3px 10px rgba(44, 40, 37, 0.04);
  transition: background 0.2s, border-color 0.2s;
}

.chat-input-row:focus-within {
  background: var(--bg-surface);
  border-color: rgba(91, 141, 184, 0.3);
  box-shadow: 0 -3px 10px rgba(44, 40, 37, 0.04), inset 0 1px 0 rgba(91, 141, 184, 0.1);
}

.chat-input-row .chat-input {
  flex: 1;
  padding: 13px 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  box-shadow: none;
  width: auto;
}

.chat-input-row .chat-input:focus {
  border: none;
  background: transparent;
  box-shadow: none;
}

.chat-input::placeholder {
  color: var(--ink-4);
  font-weight: 500;
}

.chat-send {
  padding: 12px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.chat-send-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--r-round);
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(44, 40, 37, 0.1);
  image-rendering: high-quality;
}

.chat-send:hover .chat-send-avatar {
  transform: scale(1.35) rotate(10deg);
  box-shadow: 0 3px 10px rgba(44, 40, 37, 0.15);
}

/* ── Chat empty state ── */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 14px;
  flex: 1;
}

.chat-empty-hero {
  position: relative;
  width: 64px;
  height: 64px;
  animation: beanFloat 3s ease-in-out infinite;
}

.chat-empty-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--r-round);
  object-fit: cover;
  image-rendering: high-quality;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(44, 40, 37, 0.12);
  border: 2px solid var(--bg-subtle);
}

.chat-empty-ring {
  position: absolute;
  inset: -6px;
  border-radius: var(--r-round);
  border: 2px solid var(--ink-4);
  opacity: 0.35;
}

@keyframes beanFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}


.chat-empty-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: -0.01em;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chat-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px 7px 10px;
  background: var(--bg-surface);
  border: 1.5px solid var(--bg-hover);
  border-radius: 100px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(44, 40, 37, 0.07);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s, border-color 0.2s;
}

.chat-suggestion-icon {
  font-size: 13px;
  line-height: 1;
}

.chat-suggestion:nth-child(1) { border-color: rgba(91, 141, 184, 0.45); }
.chat-suggestion:nth-child(2) { border-color: rgba(151, 117, 250, 0.45); }
.chat-suggestion:nth-child(3) { border-color: rgba(224, 112, 82, 0.45); }

.chat-suggestion:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 12px rgba(44, 40, 37, 0.08);
}

.chat-suggestion:nth-child(1):hover { background: rgba(91, 141, 184, 0.08); color: var(--dot-blue); border-color: rgba(91, 141, 184, 0.35); }
.chat-suggestion:nth-child(2):hover { background: rgba(151, 117, 250, 0.08); color: var(--dot-purple); border-color: rgba(151, 117, 250, 0.35); }
.chat-suggestion:nth-child(3):hover { background: rgba(224, 112, 82, 0.08); color: var(--dot-red); border-color: rgba(224, 112, 82, 0.35); }

.chat-suggestion:active {
  transform: translateY(0) scale(0.97);
}

/* ── Typing indicator ── */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  align-self: flex-start;
  background: var(--bg-subtle);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(44, 40, 37, 0.05);
  animation: chatBubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-typing-dots {
  display: flex;
  gap: 4px;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-round);
  animation: typingPulse 1.4s infinite ease-in-out;
}

.chat-typing-dot:nth-child(1) { background: var(--dot-blue); }
.chat-typing-dot:nth-child(2) { background: var(--dot-purple); animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { background: var(--dot-pink); animation-delay: 0.4s; }

.chat-typing-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-4);
  animation: typingFade 2s infinite ease-in-out;
}

@keyframes typingPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

@keyframes typingFade {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Gauges — small inline */
.sys-gauge {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  vertical-align: middle;
  margin-right: 3px;
}

.sys-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.sys-gauge .gauge-bg {
  fill: none;
  stroke: var(--bg-subtle);
  stroke-width: 4;
}

.sys-gauge .gauge-fill {
  fill: none;
  stroke: var(--ok);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray 0.8s ease, stroke 0.3s;
}

.sys-gauge .gauge-fill.warn { stroke: var(--warn); }
.sys-gauge .gauge-fill.danger { stroke: var(--danger); }

/* ── Services Page ─────────────────────────── */
.service-category {
  margin-bottom: var(--sp-lg);
}

.category-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
  padding-left: 4px;
}
.services-toolbar {
  margin-bottom: var(--sp-lg);
}
.services-toolbar .search-input {
  width: 100%;
  max-width: 360px;
  padding: 10px 14px 10px 38px;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23A9A29A' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}
.services-toolbar .search-input:focus {
  border-color: var(--accent);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.services-toolbar .search-input::placeholder {
  color: var(--ink-4);
}

.services-empty {
  text-align: center;
  padding: 48px 24px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.svc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.svc-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.svc-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.svc-card-icon img {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
}

/* Avatar variant for suite services */
.svc-card-icon--avatar {
  background: none;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(44, 40, 37, 0.15);
  box-shadow: 0 1px 4px rgba(44, 40, 37, 0.1);
}
.svc-card-icon--avatar img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: contain;
  filter: none;
  image-rendering: high-quality;
  transform: scale(1.14);
}
/* Per-app accent rings (matching dock) */
.svc-card-icon--avatar.svc-card-icon--bookshelf  { border-color: #6A9AC4; }
.svc-card-icon--avatar.svc-card-icon--cocktails  { border-color: #C46B6B; }
.svc-card-icon--avatar.svc-card-icon--recipes    { border-color: #6B9E6B; }
.svc-card-icon--avatar.svc-card-icon--screenroom { border-color: #A98BFA; }
.svc-card-icon--avatar.svc-card-icon--beangpt    { border-color: #D4A44C; }

.svc-card-body {
  min-width: 0;
}

.svc-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.svc-card-desc {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-card-updated {
  color: var(--ink-4);
}

.svc-card .status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-round);
  background: var(--off);
  flex-shrink: 0;
  transition: background 0.3s;
}

.svc-card .status-dot.running { background: var(--ok); }
.svc-card .status-dot.stopped { background: var(--danger); }

.services-grid--featured {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.svc-card--featured {
  padding: 18px 22px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}

.svc-card--featured .svc-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.svc-card--featured .svc-card-icon img {
  width: 26px;
  height: 26px;
}

.svc-card--featured .svc-card-title {
  font-size: 16px;
}

.svc-card--featured .svc-card-desc {
  font-size: 13px;
}

.svc-card--featured:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-photo);
}

/* ── Favorite button ──────────────────────── */
.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ink-4);
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  line-height: 0;
  border-radius: var(--r-round);
  flex-shrink: 0;
  margin-left: auto;
}

.svc-card:hover .fav-btn,
.fav-btn.active {
  opacity: 1;
}

.fav-btn.active {
  color: var(--dot-yellow);
}

.fav-btn.active svg {
  fill: var(--dot-yellow);
}

.fav-btn:hover {
  color: var(--dot-yellow);
}

.svc-card.lan-only {
  opacity: 0.5;
  cursor: default;
}

.svc-card.lan-only:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.lan-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--bg-subtle);
  padding: 1px 5px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

/* ── Login ─────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-page);
}

.login-card {
  text-align: center;
  width: 100%;
  max-width: 340px;
  padding: 40px;
}

.login-logo {
  font-size: 36px;
  font-weight: 800;
  color: var(--dot-red);
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 36px;
}

.login-error {
  background: rgba(224, 112, 82, 0.08);
  border: 1px solid rgba(224, 112, 82, 0.2);
  color: var(--dot-red);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 28px;
  background: var(--bg-surface);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.2s;
  box-shadow: var(--shadow-md);
}

.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-photo);
}

/* ── Animations ────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Notifications ────────────────────────── */
.notif-trigger {
  position: relative;
}

.notif-btn {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  position: relative;
}

.notif-btn:hover { color: var(--ink); }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--dot-red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 3px;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  background: var(--bg-surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-subtle);
}

.notif-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.notif-mark-all {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--dot-blue);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.notif-mark-all:hover {
  background: rgba(91, 141, 184, 0.08);
}

.notif-list {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.notif-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-4);
}

.notif-row {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--bg-subtle);
  cursor: pointer;
  transition: background 0.15s;
}

.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--bg-subtle); }

.notif-row.unread {
  border-left: 3px solid var(--dot-blue);
  padding-left: 13px;
}

.notif-row.read {
  opacity: 0.55;
}

.notif-row-content {
  flex: 1;
  min-width: 0;
}

.notif-row-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-row-body {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-top: 1px;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-row-body.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.notif-row-meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-group-badge {
  background: var(--bg-subtle);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
}

.notif-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
}

.notif-source-icon {
  font-size: 11px;
  line-height: 1;
}

.notif-row.unread.status-success {
  border-left-color: var(--dot-green);
}

.notif-row.unread.status-error {
  border-left-color: var(--dot-red);
}

.notif-row.unread.status-warning {
  border-left-color: var(--dot-yellow);
}

/* Toast notifications */
.notif-toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.notif-toast {
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  width: 320px;
  pointer-events: auto;
  animation: notifSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid var(--dot-blue);
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
}

.notif-toast.status-success {
  border-left-color: var(--dot-green);
}

.notif-toast.status-error {
  border-left-color: var(--dot-red);
}

.notif-toast.status-warning {
  border-left-color: var(--dot-yellow);
}

.notif-toast.dismissing {
  opacity: 0;
  transform: translateX(100%);
}

.notif-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.notif-toast-body {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-top: 2px;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes notifSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Drops (file sharing) ────────────────── */
.drops-trigger {
  position: relative;
}

.drops-btn {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  position: relative;
}

.drops-btn:hover { color: var(--ink); }

.drops-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--dot-red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.drops-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  background: var(--bg-surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
}

.drops-list {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.drops-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-4);
}

.drops-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--bg-subtle);
  transition: background 0.15s;
}

.drops-row:last-child { border-bottom: none; }
.drops-row:hover { background: var(--bg-subtle); }

.drops-row-info {
  flex: 1;
  min-width: 0;
}

.drops-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drops-row-meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}

.drops-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.drops-row-btn {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: color 0.15s, background 0.15s;
}

.drops-row-btn:hover {
  color: var(--ink);
  background: var(--bg-hover);
}

.drops-row-btn.delete:hover {
  color: var(--dot-red);
  background: rgba(224, 112, 82, 0.08);
}

.drops-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--dot-blue);
  cursor: pointer;
  border-top: 1px solid var(--bg-subtle);
  transition: background 0.15s;
}

.drops-upload-btn:hover { background: var(--bg-subtle); }

.drops-row.just-added {
  animation: dropHighlight 2s ease-out;
}

@keyframes dropHighlight {
  0% { background: rgba(110, 168, 110, 0.15); }
  100% { background: transparent; }
}

/* ── Deploy stamp ── */
.deploy-stamp {
  text-align: center;
  font-size: 10px;
  color: var(--ink-4);
  padding: var(--sp-sm) 0 var(--sp-lg);
  letter-spacing: 0.3px;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 16px var(--sp) 0; }
  .greeting { padding: var(--sp) var(--sp) 8px; }
  .greeting h1 { font-size: 24px; }
  .greeting-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .page { padding: 0 var(--sp) var(--sp-lg); }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(200px, 240px) minmax(200px, 240px);
  }

  .dock {
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 20px;
    border-radius: var(--r-lg);
  }

  .dock-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .dock-icon img { width: 24px; height: 24px; }

  .shelf { gap: 8px; }

  .ha-row { flex-direction: column; }

  .services-grid { grid-template-columns: 1fr; }
  .services-grid--featured { grid-template-columns: 1fr; }

  #ha-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  /* Greeting apps: static on tablets */
  .greeting-apps {
    position: relative;
    transform: none;
    justify-content: center;
    margin-top: 10px;
    gap: 16px;
    padding: 22px 20px 10px;
  }

  .app-tile-icon { width: 44px; height: 44px; }
  .app-tile-icon--avatar { width: 44px; height: 44px; }
  .app-tile-label { font-size: 10px; }

  .lab-stats-card {
    flex-wrap: wrap;
    gap: 8px 12px;
    width: 100%;
  }

  /* Panels: anchor to viewport edges on mobile so they don't clip */
  .notif-panel,
  .drops-panel {
    position: fixed;
    top: 64px;
    left: 16px;
    right: 16px;
    width: auto;
  }
}

@media (max-width: 480px) {
  /* Keep nav visible — use compact pill style */
  .topbar-nav {
    gap: 4px;
  }

  .topbar-link {
    font-size: 13px;
    padding: 5px 12px;
  }

  .topbar-brand { width: 44px; height: 44px; }
  .pet-icon { width: 24px; height: 24px; }
  .topbar-pets { gap: 3px; }
  .topbar-left { gap: 8px; }
  .dock { gap: 12px; }

  /* Hide non-essential topbar items to make room for nav */
  .topbar-pets { display: none; }
  .topbar-avatar { display: none; }
  .btn-logout { display: none; }
  .logout-form { display: none; }

  /* Lab stats: compact layout */
  .lab-stats-card {
    font-size: 12px;
    padding: 6px 10px;
    gap: 6px 10px;
  }

  .lab-stats-card-ext { display: none; }

  .greeting h1 { font-size: 20px; }

  /* Hero: compact on phones */
  .hero {
    grid-template-rows: minmax(180px, 200px) minmax(180px, 200px);
  }

  /* Chat: slightly wider bubbles, bigger send target */
  .chat-bubble {
    max-width: 90%;
  }

  .chat-send {
    padding: 14px 16px;
  }

  /* Panels: tighter margins on small phones */
  .notif-panel,
  .drops-panel {
    left: 12px;
    right: 12px;
  }

  /* Mood buttons: ensure adequate touch target */
  .mood-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ── Reading Queue ── */
.reading-queue-section {
  margin-top: var(--sp-xl);
}

.rq-card {
  background: var(--bg-surface);
  border-radius: var(--r-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.rq-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
}

.rq-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: var(--sp-sm);
}

.rq-input {
  flex: 1;
}

.rq-for-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-sm);
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
}

.rq-for-toggle input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--ink-4);
  border-radius: 3px;
  background: var(--bg-page);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all var(--duration-fast) ease;
}

.rq-for-toggle input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.rq-for-toggle input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}

.rq-for-toggle input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rq-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-subtle);
}

.rq-item:last-child {
  border-bottom: none;
}

.rq-favicon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 2px;
}

.rq-favicon--empty {
  background: var(--bg-subtle);
}

.rq-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rq-title {
  font-size: var(--font-size);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rq-title:hover {
  color: var(--accent);
}

.rq-domain {
  font-size: 11px;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rq-meta {
  font-size: var(--font-size-sm);
  color: var(--ink-3);
  white-space: nowrap;
}

.rq-from {
  margin-left: 4px;
  color: var(--accent);
}

.rq-done-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--bg-subtle);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease-out);
}

.rq-done-btn:hover {
  border-color: var(--success);
  color: var(--success);
  background: rgba(75, 160, 75, 0.08);
}

.rq-empty {
  padding: var(--sp-lg) 0 var(--sp-sm);
  text-align: center;
  color: var(--ink-3);
}
.rq-empty img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: high-quality;
  margin: 0 auto var(--sp-xs);
  display: block;
}
.rq-empty h3 {
  font-size: var(--font-size);
  font-weight: 600;
  margin: 0;
}

/* ── Dev Footer ────────────────────────────────── */
.dev-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 2px solid var(--bg-hover);
  padding: 12px 16px;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(44, 40, 37, 0.06);
}

.dev-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

.view-as-label {
  font-size: var(--font-size);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-as-select {
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--bg-hover);
  background: var(--bg-page);
  color: var(--ink);
  font-size: var(--font-size);
  cursor: pointer;
}

.view-as-select:hover {
  border-color: var(--accent);
}
