/* ============================================
   THE ANCHORPOINT — MAIN Dashboard Styles
   V designed it. Dante built it. Home.
   ============================================ */

/* ── Font Faces ── */
@font-face {
  font-family: 'A Star Demo';
  src: url('../assets/fonts/AStarDemoRegular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Please Write Me';
  src: url('../assets/fonts/pleasewritemeasong.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Wildy Sans';
  src: url('../assets/fonts/Wildy Sans.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Bricktown';
  src: url('../assets/fonts/Bricktown Italic.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Against';
  src: url('../assets/fonts/against regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Aquifer';
  src: url('../assets/fonts/Aquifer.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}


/* ── Custom Properties ── */
:root {
  --bg-deep: #030305;
  --bg-surface: hsla(270, 10%, 8%, 0.45);
  --bg-surface-hover: hsla(270, 12%, 12%, 0.5);
  --bg-elevated: hsla(270, 10%, 14%, 0.4);
  --bg-input: hsla(270, 12%, 6%, 0.7);

  --gold: rgba(200, 160, 80, 1);
  --gold-dim: rgba(200, 160, 80, 0.6);
  --gold-muted: rgba(200, 160, 80, 0.35);
  --gold-glow: rgba(200, 160, 80, 0.08);

  --cyan: #29FBEF;
  --cyan-dim: rgba(41, 251, 239, 0.6);
  --yellow-active: #F7D342;

  --text-primary: rgba(240, 240, 240, 0.95);
  --text-secondary: rgba(240, 240, 240, 0.7);
  --text-muted: rgba(240, 240, 240, 0.4);
  --text-dim: rgba(240, 240, 240, 0.2);

  --accent-purple: rgba(180, 120, 200, 1);
  --accent-teal: rgba(41, 251, 239, 0.85);
  --accent-yellow: rgba(200, 160, 80, 1);
  --accent-red: rgba(200, 80, 80, 1);

  --border-subtle: rgba(200, 160, 80, 0.06);
  --border-gold: rgba(200, 160, 80, 0.2);
  --border-active: rgba(200, 160, 80, 0.4);

  --overlay-bg: rgba(0, 0, 0, 0.88);

  --header-h: 42px;
  --tab-bar-h: 38px;
  --sidebar-w: 340px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
}


/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ── Starfield Canvas ── */
canvas#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── Nebula Overlay ── */
.nebula {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 10% 60%, hsla(270, 40%, 10%, 0.3) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, hsla(270, 30%, 8%, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, hsla(260, 35%, 8%, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, hsla(270, 20%, 6%, 0.15) 0%, transparent 70%);
  pointer-events: none;
}


/* ═══════════════════════════════════════════════
   APP SHELL — CSS Grid Layout
   ═══════════════════════════════════════════════ */

.app {
  position: relative;
  z-index: 10;
  display: grid;
  height: 100vh;
  grid-template-rows: var(--header-h) 1fr auto;
  grid-template-columns: 1fr;
  grid-template-areas:
    "header"
    "content"
    "bottom";
}


/* ═══════════════════════════════════════════════
   HEADER BAR
   ═══════════════════════════════════════════════ */

.header-bar {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  background: rgba(3, 3, 5, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ap-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.ap-logo-link:hover { opacity: 1; }

.ap-logo-img {
  height: 24px;
  width: auto;
}

.notification-area {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
  flex: 1;
}

/* Inline glucose in notification bar */
.glucose-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all var(--dur-normal) var(--ease);
}

.glucose-inline.glucose-normal {
  color: hsl(145, 50%, 60%);
  border-color: hsla(145, 50%, 50%, 0.15);
}

.glucose-inline.glucose-low {
  color: hsl(0, 70%, 65%);
  border-color: hsla(0, 70%, 55%, 0.2);
  background: hsla(0, 70%, 55%, 0.08);
}

.glucose-inline.glucose-high {
  color: hsl(30, 70%, 65%);
  border-color: hsla(30, 70%, 55%, 0.2);
  background: hsla(30, 70%, 55%, 0.08);
}

.glucose-val {
  font-variant-numeric: tabular-nums;
}

.glucose-arrow {
  font-size: 0.9rem;
}

.heart-refresh {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease);
  padding: 0;
  line-height: 1;
  animation: heart-notification-pulse 3s ease-in-out infinite;
}

.heart-refresh:hover { transform: scale(1.2); }

.heart-refresh.spinning {
  animation: heart-spin 0.6s ease-in-out;
}

@keyframes heart-notification-pulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(200, 160, 80, 0.3)); }
  50% { filter: drop-shadow(0 0 8px rgba(200, 160, 80, 0.6)); }
}

@keyframes heart-spin {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.3) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  font-family: 'Please Write Me', cursive;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--gold-dim);
  transition: color 0.3s;
  position: relative;
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-links a.active {
  color: var(--gold);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold-dim);
}

/* Flash animation for notifications */
.header-bar.flash {
  background: rgba(200, 160, 80, 0.06);
}


/* ═══════════════════════════════════════════════
   TAB BAR
   ═══════════════════════════════════════════════ */

.header-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 100%;
}

.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Please Write Me', cursive;
  font-size: 1.05rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--dur-normal) var(--ease),
              border-color var(--dur-normal) var(--ease),
              background var(--dur-normal) var(--ease);
  padding: 0 18px;
  letter-spacing: 0.06em;
}

.tab-btn:hover {
  color: var(--gold-dim);
  background: rgba(200, 160, 80, 0.03);
}

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}


/* ═══════════════════════════════════════════════
   MAIN CONTENT — Chat + Sidebar split
   ═══════════════════════════════════════════════ */

.main-content {
  grid-area: content;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  overflow: hidden;
  min-height: 0;
}


/* ═══════════════════════════════════════════════
   MAIN PANEL — Left column, tab content here
   ═══════════════════════════════════════════════ */

.main-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  border-right: 1px solid var(--border-subtle);
  position: relative;
}

.main-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  opacity: 0.6;
}

.main-view {
  display: none;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px;
}

.main-view.active {
  display: flex;
}

.main-view-header {
  margin-bottom: 14px;
}

.main-view-title {
  font-family: 'Please Write Me', cursive;
  font-size: 1.2rem;
  color: var(--gold);
}

/* Chat view takes full height */
#view-chat {
  padding: 0;
}

#view-chat .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

#view-chat .chat-input-bar {
  flex-shrink: 0;
}

#view-chat .chat-convo-bar {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   CHAT AREA (styles for chat within main panel)
   ═══════════════════════════════════════════════ */

.chat-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  border-right: 1px solid var(--border-subtle);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 160, 80, 0.08) transparent;
}

.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(200, 160, 80, 0.08);
  border-radius: 3px;
}

/* Messages */
.msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.92rem;
  word-wrap: break-word;
}

.msg-v {
  background: rgba(200, 160, 80, 0.06);
  border: 1px solid rgba(200, 160, 80, 0.08);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}

.msg-dante {
  background: rgba(120, 80, 200, 0.06);
  border: 1px solid rgba(120, 80, 200, 0.06);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.msg-ts {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Thinking indicator */
.thinking-indicator {
  display: flex;
  gap: 5px;
  padding: 12px 18px !important;
  min-height: 0;
  align-items: center;
}

.thinking-indicator .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(200, 160, 80, 0.6);
  animation: thinking-pulse 1.4s ease-in-out infinite;
}

.thinking-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-dim);
  text-align: center;
  padding: 40px;
}

.chat-placeholder-icon {
  font-size: 2rem;
  opacity: 0.25;
}

.chat-placeholder-text {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* Chat convo bar */
.chat-convo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(3, 3, 5, 0.4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-convo-label { flex-shrink: 0; }

.chat-convo-bar select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 3px 6px;
  font-family: inherit;
  flex: 1;
  outline: none;
}

.chat-convo-btn {
  background: rgba(200, 160, 80, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--gold-dim);
  font-size: 0.7rem;
  padding: 3px 8px;
  cursor: pointer;
  font-family: inherit;
}

.chat-convo-btn:hover { background: rgba(200, 160, 80, 0.15); color: var(--gold); }
.chat-delete-btn { color: var(--accent-red); }
.chat-delete-btn:hover { background: rgba(200, 80, 80, 0.15); }

.chat-degraded {
  display: none;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--accent-red);
  background: rgba(200, 80, 80, 0.06);
  border-bottom: 1px solid rgba(200, 80, 80, 0.1);
}

.chat-degraded.visible { display: block; }

/* Chat input bar */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(3, 3, 5, 0.5);
  border-top: 1px solid var(--border-subtle);
}

.chat-input-bar textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.85rem;
  padding: 8px 12px;
  outline: none;
  resize: none;
  min-height: 36px;
  max-height: 120px;
  line-height: 1.4;
}

.chat-input-bar textarea:focus {
  border-color: var(--gold-muted);
}

/* Chat typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-muted);
  animation: chat-dot 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.chat-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
  transition: background 0.3s;
  flex-shrink: 0;
}

.chat-status-dot.connected {
  background: #4caf50;
}

.chat-attach-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(200, 160, 80, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
  flex-shrink: 0;
}

.chat-attach-btn:hover {
  background: rgba(200, 160, 80, 0.12);
  color: var(--gold-dim);
  border-color: var(--border-gold);
}

.chat-input {
  flex: 1;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 0 16px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease);
}

.chat-input::placeholder {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.chat-input:focus {
  border-color: var(--border-gold);
}

.chat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: #030305;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
  flex-shrink: 0;
  opacity: 0.8;
}

.chat-send-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}


/* ═══════════════════════════════════════════════
   SIDEBAR — Right column
   ═══════════════════════════════════════════════ */

.sidebar {
  display: flex;
  flex-direction: column;
  background: rgba(3, 3, 5, 0.4);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 160, 80, 0.06) transparent;
  position: relative;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(200, 160, 80, 0.06);
  border-radius: 2px;
}


/* ── Status Section ── */

.sidebar-status {
  padding: 14px 18px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.dante-status-area {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dante-status-title {
  font-family: 'Please Write Me', cursive;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crown {
  font-size: 0.9rem;
}

.dante-status-line {
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 3px 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.dante-status-line .label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  min-width: 72px;
}

.dante-status-line .value {
  font-style: italic;
  font-weight: 300;
  font-size: 0.85rem;
}

/* Status color coding */
.dante-feeling { color: var(--text-primary); }
.dante-feeling .label { color: var(--gold-muted); }

.dante-needs { color: var(--accent-yellow); }
.dante-needs .label { color: rgba(200, 160, 80, 0.5); }

.dante-wants { color: var(--accent-teal); }
.dante-wants .label { color: rgba(41, 251, 239, 0.4); }

.dante-thoughts { color: rgba(180, 140, 220, 0.9); }
.dante-thoughts .label { color: rgba(180, 140, 220, 0.45); }

.dante-processing { color: rgba(200, 180, 160, 0.75); }
.dante-processing .label { color: rgba(200, 180, 160, 0.35); }
.dante-processing.heavy { color: var(--accent-red); }
.dante-processing.heavy .label { color: rgba(200, 80, 80, 0.5); }


/* ── Sidebar Middle Zone ── */

.sidebar-middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

/* Sidebar views — tab content */
.sidebar-view {
  display: none;
  flex-direction: column;
  padding: 16px 18px;
}

.sidebar-view.active {
  display: flex;
}

.sidebar-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sidebar-view-title {
  font-family: 'Please Write Me', cursive;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.sidebar-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}

.sidebar-close-btn:hover {
  color: var(--text-primary);
  border-color: var(--gold-dim);
  background: var(--gold-glow);
}


/* ── Tab Section Lists ── */

.tab-section-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-section-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  cursor: pointer;
}

.tab-section-item:hover {
  background: rgba(200, 160, 80, 0.05);
  color: var(--text-primary);
}

.tab-section-icon {
  font-size: 1.1rem;
  opacity: 0.6;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.tab-section-item:hover .tab-section-icon { opacity: 0.85; }

.tab-section-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}


/* ═══════════════════════════════════════════════
   MUSIC PLAYER — sidebar
   ═══════════════════════════════════════════════ */

.sidebar-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sidebar-music {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-music.hidden { display: none; }

.music-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.music-refresh-btn {
  background: none;
  border: 1px solid rgba(200, 160, 80, 0.1);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.55rem;
  padding: 2px 6px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.05em;
}

.music-refresh-btn:hover {
  border-color: var(--border-gold);
  color: var(--gold-dim);
}

.music-now-playing {
  text-align: center;
  margin-bottom: 8px;
}

.music-art {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  background: rgba(200, 160, 80, 0.04);
  overflow: hidden;
  margin: 0 auto 8px;
}

.music-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.music-artist {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.music-playlist {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.music-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}

.music-btn:hover { color: var(--gold); }

.music-btn.music-play {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.music-btn.music-play:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: var(--gold-glow);
}

.music-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.music-btn.music-play svg {
  width: 18px;
  height: 18px;
}

.music-lyrics {
  min-height: 60px;
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: rgba(200, 160, 80, 0.02);
  border-radius: 6px;
  border: 1px solid rgba(200, 160, 80, 0.04);
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 160, 80, 0.06) transparent;
  scroll-behavior: smooth;
}

.lyrics-line {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.8;
  text-align: center;
  font-style: italic;
  transition: color var(--dur-normal) var(--ease), font-size var(--dur-normal) var(--ease);
  padding: 1px 0;
}

.lyrics-line.active {
  color: var(--gold);
  font-size: 0.8rem;
}

.lyrics-line.near {
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════
   831 ALWAYS — watermark
   ═══════════════════════════════════════════════ */

.watermark-831 {
  display: block;
  height: 70px;
  opacity: 0.15;
  margin: 8px 18px 12px auto;
  flex-shrink: 0;
  user-select: none;
  pointer-events: none;
}


/* ═══════════════════════════════════════════════
   GIFT CALENDAR (Ported from EntesPWA)
   ═══════════════════════════════════════════════ */

@keyframes gift-fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gift-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
@keyframes gift-ribbonShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes gift-boxOpen {
  0% { transform: scale(0.9) rotateX(5deg); opacity: 0; }
  60% { transform: scale(1.02) rotateX(-1deg); opacity: 1; }
  100% { transform: scale(1) rotateX(0deg); opacity: 1; }
}

.gift-header {
  text-align: center;
  margin-bottom: 28px;
  animation: gift-fadeIn 0.8s ease-out;
}
.gift-header .gift-from {
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  letter-spacing: 5px;
  color: #6B8F71;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 6px;
}
.gift-header h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #A78BFA, #6B8F71);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}
.gift-header .gift-tagline {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(160, 140, 180, 0.4);
  letter-spacing: 2px;
}

.gift-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.gift-month-nav button {
  background: none;
  border: none;
  color: #8B7FA8;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 12px;
  transition: color 0.2s;
  font-family: 'Cinzel Decorative', serif;
}
.gift-month-nav button:hover { color: #A78BFA; }
.gift-month-nav button.disabled { color: rgba(80,60,100,0.2); cursor: default; }
.gift-month-nav .gift-month-label {
  font-family: 'Cinzel Decorative', serif;
  font-size: 18px;
  color: #E8D5F0;
  letter-spacing: 2px;
  cursor: pointer;
  background: none;
  border: none;
}
.gift-month-nav .gift-year-label {
  font-family: 'Crimson Text', serif;
  font-size: 13px;
  color: rgba(160, 140, 180, 0.5);
  margin-left: 8px;
}

.gift-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.gift-day-headers span {
  text-align: center;
  font-family: 'Cinzel Decorative', serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(139, 92, 246, 0.4);
  text-transform: uppercase;
  padding: 4px 0;
}

.gift-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.gift-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}
.gift-cell.future {
  background: rgba(30, 20, 40, 0.3);
  border: 1px solid rgba(80, 60, 100, 0.1);
}
.gift-cell.future .gift-day-num {
  color: rgba(120, 100, 140, 0.3);
}
.gift-cell.empty-day {
  background: rgba(30, 20, 40, 0.4);
  border: 1px solid rgba(80, 60, 100, 0.15);
}
.gift-cell.empty-day .gift-day-num {
  color: rgba(160, 140, 180, 0.4);
}
.gift-cell.has-gift {
  background: rgba(20, 14, 30, 0.7);
  border: 1px solid rgba(80, 60, 100, 0.2);
  cursor: pointer;
}
.gift-cell.has-gift:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}
.gift-cell.has-gift:active {
  transform: scale(0.97);
}
.gift-cell.has-gift.today {
  background: rgba(139, 92, 246, 0.12);
}
.gift-cell .gift-ribbon-h {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background-size: 200% 100%;
}
.gift-cell .gift-ribbon-v {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
}
.gift-cell .gift-day-num {
  font-family: 'Cinzel Decorative', serif;
  font-size: 14px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.gift-cell .gift-count-badge {
  position: absolute;
  bottom: 3px;
  font-size: 7px;
  opacity: 0.6;
}
.gift-cell .gift-glow {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  animation: gift-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

/* Gift Legend */
.gift-legend {
  margin-top: 24px;
  padding: 16px 12px;
  background: rgba(15, 10, 25, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(80, 60, 100, 0.15);
}
.gift-legend-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(160, 140, 180, 0.4);
  text-transform: uppercase;
  margin-bottom: 10px;
  text-align: center;
}
.gift-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.gift-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.gift-legend-swatch {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}
.gift-legend-label {
  font-size: 10px;
  color: rgba(200, 180, 220, 0.5);
}

.gift-stats {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
  color: rgba(120, 100, 140, 0.3);
}

/* Gift Reveal Modal */
.gift-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 4, 16, 0.92);
  backdrop-filter: blur(8px);
  animation: gift-fadeIn 0.3s ease-out;
}
.gift-modal {
  max-width: 460px;
  width: 90%;
  max-height: 85vh;
  overflow: auto;
  background: linear-gradient(170deg, #1A0F2E, #0D1B14);
  border-radius: 16px;
  padding: 28px;
  animation: gift-boxOpen 0.5s ease-out;
  position: relative;
}
.gift-modal .gift-modal-ribbon {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}
.gift-modal .gift-modal-type {
  font-family: 'Crimson Text', serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.7;
  text-align: center;
}
.gift-modal .gift-modal-date {
  font-family: 'Crimson Text', serif;
  font-size: 13px;
  color: rgba(160, 140, 180, 0.5);
  text-align: center;
  margin-bottom: 16px;
}
.gift-modal .gift-modal-close {
  display: block;
  margin: 20px auto 0;
  padding: 10px 28px;
  border-radius: 24px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(139, 92, 246, 0.08);
  color: #A78BFA;
  font-family: 'Crimson Text', serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.gift-modal .gift-modal-close:hover {
  background: rgba(139, 92, 246, 0.15);
}

/* Gift content renderers */
.gift-content { animation: gift-fadeIn 0.6s ease-out; }
.gift-content-love {
  font-family: 'Crimson Text', serif;
  font-size: 18px;
  line-height: 1.7;
  color: #E8D5F0;
  white-space: pre-line;
  font-style: italic;
  padding: 16px 0;
}
.gift-content-quote { text-align: center; padding: 16px 0; }
.gift-content-quote .quote-mark {
  font-family: 'Cinzel Decorative', serif;
  font-size: 26px;
  color: #6B8F71;
  opacity: 0.4;
  margin-bottom: 6px;
}
.gift-content-quote .quote-text {
  font-family: 'Crimson Text', serif;
  font-size: 20px;
  line-height: 1.6;
  color: #E8D5F0;
  font-style: italic;
  max-width: 380px;
  margin: 0 auto;
}
.gift-content-quote .quote-attr {
  font-family: 'Crimson Text', serif;
  font-size: 13px;
  color: #A78BFA;
  margin-top: 14px;
}
.gift-content-quote .quote-ctx {
  font-family: 'Crimson Text', serif;
  font-size: 11px;
  color: rgba(160, 140, 180, 0.5);
  margin-top: 4px;
}
.gift-content-song .song-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 18px;
  color: #7C3AED;
  margin-bottom: 4px;
}
.gift-content-song .song-artist {
  font-family: 'Crimson Text', serif;
  font-size: 14px;
  color: rgba(200, 180, 220, 0.7);
  margin-bottom: 14px;
}
.gift-content-song .song-note {
  font-family: 'Crimson Text', serif;
  font-size: 15px;
  line-height: 1.6;
  color: #E8D5F0;
  font-style: italic;
  margin-bottom: 20px;
}
.gift-content-song .song-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.gift-content-song .song-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 24px;
  font-family: 'Crimson Text', serif;
  font-size: 13px;
  text-decoration: none;
  transition: filter 0.2s;
}
.gift-content-song .song-links a:hover { filter: brightness(1.3); }
.gift-content-song .song-links .spotify-link {
  background: rgba(30, 215, 96, 0.15);
  border: 1px solid rgba(30, 215, 96, 0.3);
  color: #1ED760;
}
.gift-content-song .song-links .youtube-link {
  background: rgba(255, 0, 0, 0.12);
  border: 1px solid rgba(255, 0, 0, 0.25);
  color: #FF4444;
}
.gift-content-voice .voice-text {
  font-family: 'Crimson Text', serif;
  font-size: 16px;
  line-height: 1.7;
  color: #E8D5F0;
  font-style: italic;
  margin-bottom: 16px;
}
.gift-content-voice audio { width: 100%; }
.gift-content-voice .voice-placeholder {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  font-family: 'Crimson Text', serif;
  font-size: 12px;
  color: rgba(167, 139, 250, 0.6);
  text-align: center;
}
.gift-content-image {
  text-align: center;
  padding: 16px 0;
}
.gift-content-image .polaroid-frame {
  background: #F5F0E8;
  padding: 10px 10px 36px 10px;
  display: inline-block;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transform: rotate(-1.5deg);
  margin-bottom: 14px;
}
.gift-content-image .polaroid-frame img {
  max-width: 260px;
  max-height: 260px;
  display: block;
}
.gift-content-image .polaroid-placeholder {
  width: 240px;
  height: 180px;
  background: linear-gradient(135deg, #2D1B4E, #1a3a2a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(200,180,220,0.3);
  font-family: 'Crimson Text', serif;
  font-size: 13px;
}
.gift-content-image .image-caption {
  font-family: 'Crimson Text', serif;
  font-size: 15px;
  line-height: 1.6;
  color: #E8D5F0;
  font-style: italic;
  max-width: 340px;
  margin: 0 auto;
}
.gift-content-art {
  text-align: center;
  padding: 16px 0;
}
.gift-content-art img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  margin-bottom: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.gift-content-art .art-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, rgba(45,27,78,0.13), rgba(26,58,42,0.13));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.gift-content-art .art-caption {
  font-family: 'Crimson Text', serif;
  font-size: 15px;
  line-height: 1.6;
  color: #E8D5F0;
  font-style: italic;
}

/* Multi-gift day list inside modal */
.gift-day-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.gift-day-item {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(80, 60, 100, 0.15);
  background: rgba(15, 10, 25, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}
.gift-day-item:hover {
  background: rgba(15, 10, 25, 0.6);
  border-color: rgba(139, 92, 246, 0.25);
}
.gift-day-item .gift-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.gift-day-item .gift-item-emoji { font-size: 16px; }
.gift-day-item .gift-item-label {
  font-family: 'Crimson Text', serif;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.7;
}
.gift-day-item .gift-item-time {
  font-family: 'Crimson Text', serif;
  font-size: 11px;
  color: rgba(160, 140, 180, 0.4);
  margin-left: auto;
}
.gift-day-item .gift-item-preview {
  font-family: 'Crimson Text', serif;
  font-size: 14px;
  color: rgba(232, 213, 240, 0.7);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ═══════════════════════════════════════════════
   BOTTOM BAR — Pets
   ═══════════════════════════════════════════════ */

.bottom-bar {
  grid-area: bottom;
  background: rgba(3, 3, 5, 0.5);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
}

.watermark-831 {
  display: block;
  height: 70px;
  opacity: 0.15;
  margin: auto 18px 14px auto;
  flex-shrink: 0;
  user-select: none;
  pointer-events: none;
}

.pets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 14px 2px;
}

.pets-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.pets-refresh-btn {
  background: none;
  border: none;
  color: var(--gold-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s, transform 0.3s;
}

.pets-refresh-btn:hover { color: var(--gold); }

.pets-refresh-btn.spinning {
  animation: spin-once 0.6s ease;
}

@keyframes spin-once {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.pets-row {
  display: flex;
  flex: 1;
  gap: 0;
}

.pet-column {
  flex: 1;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border-right: 1px solid var(--border-subtle);
}

.pet-column:last-child { border-right: none; }

.pet-name {
  font-family: 'Please Write Me', cursive;
  font-size: 1.3rem;
  font-weight: bold;
  letter-spacing: 0.04em;
}

.pet-name-hexley { color: rgba(180, 120, 200, 0.9); }
.pet-name-catsper { color: rgba(240, 240, 240, 0.85); }
.pet-name-minxy { color: rgba(220, 140, 160, 0.9); }

.pet-stats-row {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  align-items: center;
}

.pet-stat {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pet-stat-val {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.pet-health {
  font-size: 0.7rem;
}

.pet-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.pet-btn {
  background: rgba(200, 160, 80, 0.04);
  border: 1px solid rgba(200, 160, 80, 0.08);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}

.pet-btn:hover {
  background: rgba(200, 160, 80, 0.1);
  border-color: var(--border-gold);
  color: var(--gold-dim);
}

.pet-btn:active {
  transform: scale(0.93);
}

.pet-btn.sending {
  opacity: 0.4;
  pointer-events: none;
}


/* ═══════════════════════════════════════════════
   SUBSECTION CONTENT (loaded inside sidebar views)
   ═══════════════════════════════════════════════ */

.subsection-content {
  display: none;
}

.subsection-back {
  background: none;
  border: none;
  color: var(--gold-dim);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  padding: 4px 0;
  margin-bottom: 8px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.subsection-back:hover { opacity: 1; }

.subsection-title {
  font-family: 'Please Write Me', cursive;
  font-size: 1rem;
  color: rgba(240, 240, 240, 0.9);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(200, 160, 80, 0.12);
}

.subsection-body {
  overflow-y: auto;
  max-height: calc(100vh - 340px);
}

.subsection-loading {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  padding: 20px 0;
}

.subsection-error {
  color: #e57373;
  font-size: 0.78rem;
  padding: 12px;
  background: rgba(229, 115, 115, 0.06);
  border-radius: 6px;
}

.subsection-placeholder {
  color: var(--text-dim);
  font-size: 0.82rem;
  text-align: center;
  padding: 30px 10px;
}


/* ── Glucose ── */
.glucose-card { text-align: center; padding: 16px 0; }
.glucose-big { font-size: 2.8rem; font-weight: 300; line-height: 1; }
.glucose-unit { font-size: 0.85rem; color: var(--text-muted); vertical-align: middle; }
.glucose-trend { font-size: 1.8rem; margin: 6px 0; color: var(--gold-dim); }
.glucose-meta { display: flex; justify-content: center; gap: 16px; font-size: 0.75rem; color: var(--text-dim); }


/* ── Journals ── */
.journal-card {
  padding: 10px 0;
  border-bottom: 1px solid rgba(200, 160, 80, 0.04);
  cursor: pointer;
  transition: background 0.15s;
}
.journal-card:hover { background: rgba(200, 160, 80, 0.03); }
.journal-title { font-size: 0.82rem; color: rgba(240, 240, 240, 0.85); margin-bottom: 3px; }
.journal-meta { font-size: 0.68rem; color: var(--gold-muted); }
.journal-preview { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; line-height: 1.4; max-height: 3.5em; overflow: hidden; }
.journal-full { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; margin-top: 6px; max-height: 300px; overflow-y: auto; }
.journal-filter {
  background: rgba(200, 160, 80, 0.04);
  border: 1px solid rgba(200, 160, 80, 0.12);
  border-radius: 5px;
  padding: 5px 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  outline: none;
}
.journal-filter option { background: #0a0812; color: rgba(240, 240, 240, 0.8); }


/* ── Bookshelf ── */
.bookshelf-heading { font-family: 'Please Write Me', cursive; font-size: 0.85rem; color: var(--gold-dim); margin-bottom: 8px; }
.book-card { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(200, 160, 80, 0.04); }
.book-cover { width: 42px; min-width: 42px; height: 58px; background: linear-gradient(135deg, rgba(200, 160, 80, 0.12), rgba(120, 80, 200, 0.15)); border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: var(--text-dim); }
.book-cover::after { content: attr(data-title); }
.book-info { flex: 1; min-width: 0; }
.book-title { font-size: 0.8rem; color: rgba(240, 240, 240, 0.9); font-weight: 500; margin-bottom: 1px; }
.book-author { font-size: 0.7rem; color: var(--gold-muted); margin-bottom: 3px; }
.book-meta { font-size: 0.68rem; color: var(--text-dim); }
.book-progress { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.book-note { font-size: 0.65rem; color: var(--text-dim); font-style: italic; margin-top: 3px; }
.wishlist-grid { display: flex; flex-direction: column; gap: 4px; }
.wishlist-item { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; border-bottom: 1px solid rgba(200, 160, 80, 0.03); }
.wishlist-title { font-size: 0.75rem; color: var(--text-secondary); }
.wishlist-author { font-size: 0.65rem; color: var(--text-dim); margin-left: 8px; white-space: nowrap; }


/* ── Portfolio ── */
.portfolio-link { text-align: center; padding: 30px 10px; }
.portfolio-site-btn { display: inline-block; padding: 10px 24px; background: rgba(200, 160, 80, 0.1); border: 1px solid rgba(200, 160, 80, 0.2); border-radius: 8px; color: rgba(240, 240, 240, 0.9); font-family: 'Outfit', sans-serif; font-size: 0.85rem; text-decoration: none; transition: background 0.2s, border-color 0.2s; }
.portfolio-site-btn:hover { background: rgba(200, 160, 80, 0.2); border-color: rgba(200, 160, 80, 0.4); }
.portfolio-hint { font-size: 0.68rem; color: var(--text-dim); margin-top: 8px; }


/* ── Calendar & Reminders ── */
.cal-section { margin-bottom: 8px; }
.cal-heading { font-family: 'Please Write Me', cursive; font-size: 0.82rem; color: var(--gold-dim); margin-bottom: 8px; }
.cal-heading-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-empty { font-size: 0.75rem; color: var(--text-dim); padding: 8px 0; }
.cal-event { padding: 8px 0; border-bottom: 1px solid rgba(200, 160, 80, 0.04); }
.cal-event-date { font-size: 0.68rem; color: var(--gold-muted); margin-bottom: 2px; }
.cal-event-title { font-size: 0.8rem; color: rgba(240, 240, 240, 0.85); }
.cal-event-desc { font-size: 0.68rem; color: var(--text-dim); margin-top: 2px; }

.reminder-item { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid rgba(200, 160, 80, 0.03); }
.reminder-item.done .reminder-text { text-decoration: line-through; opacity: 0.35; }
.reminder-check { background: none; border: none; color: var(--gold-dim); cursor: pointer; font-size: 0.85rem; padding: 0 4px; opacity: 0.6; }
.reminder-check:hover { opacity: 1; }
.reminder-text { flex: 1; font-size: 0.75rem; color: var(--text-secondary); }
.reminder-date { font-size: 0.62rem; color: var(--text-dim); }
.reminder-del { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1rem; padding: 0 4px; }
.reminder-del:hover { color: #e57373; }


/* ── Med Tracker ── */
.meds-due { margin-bottom: 10px; }
.med-due-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.med-due-item.taken .med-name { text-decoration: line-through; opacity: 0.4; }
.med-name { font-size: 0.8rem; color: rgba(240, 240, 240, 0.8); flex: 1; }
.med-freq { font-size: 0.62rem; color: var(--text-dim); text-transform: capitalize; }
.med-log-input { display: flex; gap: 6px; margin-top: 10px; }
.med-log-entry { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; border-bottom: 1px solid rgba(200, 160, 80, 0.03); font-size: 0.72rem; }
.med-log-name { color: var(--text-secondary); font-weight: 500; }
.med-log-note { color: var(--text-dim); font-style: italic; }
.med-log-time { color: var(--text-dim); font-size: 0.62rem; margin-left: auto; white-space: nowrap; }


/* ── Entes Memory ── */
.entes-toolbar { display: flex; gap: 6px; margin-bottom: 10px; }
.entes-search { flex: 1; background: rgba(200, 160, 80, 0.04); border: 1px solid rgba(200, 160, 80, 0.1); border-radius: 5px; padding: 5px 8px; color: var(--text-primary); font-size: 0.75rem; outline: none; font-family: 'Outfit', sans-serif; }
.entes-search:focus { border-color: rgba(200, 160, 80, 0.3); }
.entes-add-btn { background: rgba(200, 160, 80, 0.08); border: 1px solid rgba(200, 160, 80, 0.15); border-radius: 5px; color: var(--gold-dim); padding: 4px 10px; font-size: 0.68rem; cursor: pointer; white-space: nowrap; font-family: 'Outfit', sans-serif; }
.entes-add-btn:hover { background: rgba(200, 160, 80, 0.15); }

.entes-entity { border-bottom: 1px solid rgba(200, 160, 80, 0.04); padding: 6px 0; }
.entes-entity-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 2px 0; }
.entes-entity-header:hover .entes-entity-name { color: rgba(240, 240, 240, 0.95); }
.entes-entity-name { font-size: 0.8rem; color: rgba(240, 240, 240, 0.8); transition: color 0.15s; }
.entes-entity-type { font-size: 0.62rem; color: var(--gold-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.entes-entity-meta { font-size: 0.65rem; color: var(--text-dim); margin-top: 1px; }

.entes-observations { margin-top: 6px; padding-left: 10px; border-left: 2px solid rgba(200, 160, 80, 0.1); }
.entes-obs { padding: 4px 0; border-bottom: 1px solid rgba(200, 160, 80, 0.02); }
.entes-obs-text { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.entes-obs-actions { display: flex; gap: 6px; margin-top: 3px; }
.entes-btn-sm { background: none; border: 1px solid rgba(200, 160, 80, 0.1); border-radius: 3px; color: var(--gold-muted); font-size: 0.62rem; padding: 1px 6px; cursor: pointer; font-family: 'Outfit', sans-serif; }
.entes-btn-sm:hover { background: rgba(200, 160, 80, 0.08); color: var(--gold-dim); }

.entes-search-heading { font-family: 'Please Write Me', cursive; font-size: 0.72rem; color: var(--gold-dim); margin: 8px 0 4px; }
.entes-search-result { font-size: 0.75rem; color: var(--text-muted); padding: 3px 0; border-bottom: 1px solid rgba(200, 160, 80, 0.03); }


/* ── Recipe groups ── */
.recipe-group { margin-bottom: 6px; }
.recipe-group-header { font-family: 'Please Write Me', cursive; font-size: 0.82rem; color: var(--gold-dim); cursor: pointer; padding: 4px 0; user-select: none; }
.recipe-group-header:hover { color: var(--gold); }
.recipe-toggle-arrow { font-size: 0.6rem; display: inline-block; margin-right: 2px; }
.recipe-group-items { padding-left: 6px; }
.recipe-item { padding: 6px 0; border-bottom: 1px solid rgba(200, 160, 80, 0.04); cursor: pointer; font-size: 0.78rem; color: var(--text-secondary); transition: color 0.15s; }
.recipe-item:hover { color: var(--text-primary); }
.recipe-content { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.6; max-height: calc(100vh - 340px); overflow-y: auto; }


/* ── Chat markdown ── */
.msg .md-h1 { font-size: 1rem; color: rgba(240, 240, 240, 0.95); margin: 8px 0 4px; font-weight: 600; }
.msg .md-h2 { font-size: 0.9rem; color: rgba(240, 240, 240, 0.88); margin: 6px 0 3px; font-weight: 600; }
.msg .md-h3 { font-size: 0.82rem; color: rgba(240, 240, 240, 0.8); font-weight: 600; margin: 4px 0 2px; }
.msg .md-li { padding-left: 14px; position: relative; margin: 2px 0; }
.msg .md-li::before { content: '\2022'; position: absolute; left: 2px; color: var(--gold-dim); opacity: 0.6; }
.msg .md-li.md-ol { counter-increment: md-ol; }
.msg .md-li.md-ol::before { content: counter(md-ol) '.'; font-size: 0.75rem; }
.msg strong { color: rgba(240, 240, 240, 0.95); font-weight: 600; }
.msg em { font-style: italic; opacity: 0.85; }
.msg code { background: rgba(200, 160, 80, 0.08); padding: 1px 5px; border-radius: 3px; font-family: 'Consolas', monospace; font-size: 0.8em; }
.msg pre { background: rgba(0, 0, 0, 0.3); padding: 8px 10px; border-radius: 5px; overflow-x: auto; margin: 6px 0; font-size: 0.78rem; }
.msg pre code { background: none; padding: 0; }

.msg-history { opacity: 0.7; }

/* Album art in music */
.album-art { width: 100%; border-radius: 6px; opacity: 0.85; margin-top: 4px; }


/* ═══════════════════════════════════════════════
   SCROLLBAR GLOBAL
   ═══════════════════════════════════════════════ */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(200, 160, 80, 0.06);
  border-radius: 3px;
}


/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .chat-area {
    border-right: none;
    min-height: 45vh;
  }

  .sidebar {
    border-top: 1px solid var(--border-subtle);
    max-height: 40vh;
  }

  .msg { max-width: 90%; }
}

@media (max-width: 600px) {
  .header-bar { padding: 0 10px; }

  .notification-text { max-width: 150px; font-size: 0.65rem; }

  .tab-btn {
    font-size: 0.72rem;
    padding: 0 6px;
  }

  .pets-row {
    grid-template-columns: 1fr;
  }

  .pet-column {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .pet-column:last-child { border-bottom: none; }

  .chat-messages { padding: 10px; }
  .sidebar-view { padding: 12px 14px; }
  .watermark-831 { height: 55px; }
}
