/* mind/assets/mind.css */
:root {
  --teal: #00687B;
  --teal-light: #00a898;
  --teal-dim: rgba(0,104,123,0.15);
  --bg: #0b0f19;
  --bg-card: #0f172a;
  --bg-nav: #111827;
  --border: #1f2937;
  --border-2: #2d3748;
  --text: #e2e8f0;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --text-4: #334155;
  color-scheme: dark;
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif; font-size: 14px; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* ── NAV ── */
nav { background: var(--bg-nav); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; height: 52px; gap: 4px; flex-shrink: 0; z-index: 100; position: sticky; top: 0; }
.mind-brand { font-size: 20px; text-decoration: none; margin-right: 10px; flex-shrink: 0; line-height: 1; }
.mind-tabs { display: flex; gap: 2px; }
.mind-tab { padding: 5px 12px; border-radius: 6px; font-size: 13px; color: var(--text-3); text-decoration: none; transition: all 0.15s; white-space: nowrap; }
.mind-tab:hover { color: #cbd5e1; background: #1f2937; }
.mind-tab.active { color: var(--teal-light); background: var(--teal-dim); }
.nav-spacer { flex: 1; }

/* ── AUTH BUTTON ── */
.auth-btn { display: flex; align-items: center; gap: 5px; padding: 5px 12px; background: none; border: 1px solid var(--border-2); border-radius: 8px; color: var(--text-3); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; letter-spacing: 0.04em; transition: all 0.15s; margin-right: 8px; white-space: nowrap; }
.auth-btn:hover { border-color: var(--teal); color: var(--teal-light); }
.auth-btn--connected { color: #34d399; border-color: #065f46; }
.auth-btn--connected:hover { color: #6ee7b7; border-color: #34d399; background: rgba(5,46,22,0.4); }

/* ── MIND BRAND ICON ── */
.mind-icon {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 7px;
  background: linear-gradient(145deg, #00c4b4 0%, #00687B 100%);
  display: flex; align-items: flex-start; justify-content: center;
  overflow: hidden; flex-shrink: 0; text-decoration: none;
}
.mind-icon-bk {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 43%; height: 71%; background: rgba(255,255,255,0.92);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}

/* ── CONNECT DOT ── */
.connect-btn { display:flex;align-items:center;justify-content:center;background:#0a1410;border:none;border-radius:50%;width:22px;height:22px;padding:0;cursor:pointer;transition:all 0.2s;flex-shrink:0;margin-right:4px; }
.connect-dot { width:8px;height:8px;border-radius:50%;background:#374151;flex-shrink:0;transition:all 0.2s; }
.connect-btn.connected { background:#022c22; }
.connect-btn.connected .connect-dot { background:#34d399;animation:pulse-cdot 2s ease-in-out infinite; }
.connect-btn:hover { background:#1a0505; }
.connect-btn:hover .connect-dot { background:#ef4444; }
.connect-btn.connected:hover { background:#064e3b; }
.connect-btn.connected:hover .connect-dot { background:#6ee7b7;animation:none; }
@keyframes pulse-cdot { 0%,100%{box-shadow:0 0 0 0 rgba(52,211,153,0.4)} 50%{box-shadow:0 0 0 4px rgba(52,211,153,0)} }

/* ── HAMBURGER ── */
.nav-hamburger { display:none;background:none;border:none;color:#94a3b8;cursor:pointer;padding:6px;border-radius:6px;margin-left:8px;transition:color 0.15s;flex-shrink:0;align-items:center;justify-content:center; }
.nav-hamburger:hover { color:#f1f5f9; }

/* ── MOBILE OVERLAY ── */
.mobile-nav-overlay { display:none;position:fixed;top:52px;left:0;right:0;bottom:0;background:#0b0f19;z-index:200;flex-direction:column;padding:16px 20px 24px;overflow-y:auto; }
.mobile-nav-overlay.open { display:flex; }
.mobile-nav-links { display:flex;flex-direction:column;gap:4px;flex:1; }
.mobile-nav-link { display:block;padding:14px 16px;border-radius:10px;font-size:16px;font-weight:500;color:#94a3b8;text-decoration:none;transition:background 0.15s,color 0.15s;border:1px solid transparent; }
.mobile-nav-link:hover { background:#111827;color:#f1f5f9; }
.mobile-nav-link.active { background:#1e293b;color:#f8fafc;border-color:#334155; }
.mobile-nav-dock { padding:20px 0 8px;border-top:1px solid #1f2937;display:flex;gap:16px;justify-content:center;align-items:center;flex-wrap:wrap; }
.mobile-dock-item { display:flex;align-items:center;justify-content:center;width:52px;height:52px;border-radius:14px;background:#0a1e20;border:1px solid #0d3d45;text-decoration:none;transition:background 0.2s; }
.mobile-dock-item.active { background:var(--teal-dim);border-color:var(--teal); }
.mobile-dock-item:hover { background:#0d3d45; }
.mobile-dock-item svg { width:24px;height:24px; }

/* ── DOCK (mind pages) ── */
.dock { display: flex; gap: 6px; align-items: center; }
.dock-item { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: #0a1e20; border: 1px solid #0d3d45; transition: all 0.2s; text-decoration: none; color: var(--text-2); }
.dock-item:hover { background: #0d3d45; border-color: var(--teal); }
.dock-item.active { background: var(--teal); border-color: var(--teal-light); color: white; box-shadow: 0 0 14px rgba(0,168,152,0.45); }
.dock-item svg { width: 18px; height: 18px; }

/* ── LAYOUT ── */
.app { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar { width: 280px; min-width: 240px; background: var(--bg-card); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0; }
.sidebar-search { padding: 10px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.search-wrap { position: relative; }
.search-wrap input { width: 100%; background: #1e293b; border: 1px solid var(--border-2); border-radius: 8px; padding: 6px 10px 6px 28px; color: var(--text); font-size: 13px; outline: none; transition: border-color 0.15s; font-family: inherit; }
.search-wrap input:focus { border-color: var(--teal); }
.search-wrap input::placeholder { color: var(--text-4); }
.search-icon { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.section-list { flex: 1; overflow-y: auto; }
.section-list::-webkit-scrollbar { width: 4px; }
.section-list::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 2px; }
.section-header { display: flex; align-items: center; gap: 6px; padding: 8px 12px 6px; cursor: pointer; user-select: none; border-bottom: 1px solid rgba(31,41,55,0.5); position: sticky; top: 0; background: var(--bg-card); z-index: 1; transition: background 0.12s; }
.section-header:hover { background: #131f30; }
.section-chevron { font-size: 9px; color: rgba(255,255,255,0.5); transition: transform 0.2s; flex-shrink: 0; }
.section-header.open .section-chevron { transform: rotate(90deg); }
.section-name { font-size: 11px; font-weight: 700; color: #ffffff; text-transform: uppercase; letter-spacing: 0.08em; flex: 1; }
.section-count { font-size: 10px; color: rgba(255,255,255,0.4); }
.section-files { display: none; }
.section-files.open { display: block; }
.file-item { padding: 7px 12px 7px 18px; cursor: pointer; border-left: 3px solid transparent; transition: all 0.12s; }
.file-item:hover { background: #131f30; }
.file-item.active { background: rgba(0,104,123,0.1); border-left-color: var(--teal); }
.file-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.file-date { font-size: 11px; color: var(--text-3); }
.file-preview { font-size: 11px; color: var(--text-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.sidebar-footer { padding: 10px 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.btn-new { width: 100%; padding: 8px; background: var(--teal); color: white; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background 0.15s; font-family: inherit; }
.btn-new:hover { background: #005a6b; }

/* ── MAIN PANEL ── */
.main-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* States */
.connect-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px; text-align: center; }
.connect-state svg { width: 48px; height: 48px; opacity: 0.2; color: var(--teal); }
.connect-state h2 { font-size: 18px; color: var(--text-3); }
.connect-state p { font-size: 13px; color: var(--text-4); max-width: 300px; line-height: 1.6; }
.btn-connect { padding: 10px 24px; background: var(--teal); color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; font-family: inherit; }
.btn-connect:hover { background: #005a6b; }
.loading-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--border); border-top-color: var(--teal); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { font-size: 13px; color: var(--text-3); }
.welcome-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-4); }
.welcome-state svg { width: 48px; height: 48px; opacity: 0.12; }
.welcome-state p { font-size: 13px; }

/* ── EDITOR ── */
.editor-panel { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.editor-panel::-webkit-scrollbar { width: 4px; }
.editor-panel::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 2px; }
.editor-topbar { padding: 8px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--bg-card); flex-wrap: wrap; }
input[type="date"]#entry-date { background: #1e293b; border: 1px solid var(--border-2); border-radius: 6px; color: var(--text-2); font-size: 12px; padding: 4px 8px; outline: none; cursor: pointer; }
input[type="date"]#entry-date:focus { border-color: var(--teal); }
.mood-picker { display: flex; gap: 4px; flex-wrap: wrap; }
.mood-btn { padding: 2px 8px; border-radius: 20px; font-size: 11px; border: 1px solid var(--border-2); background: #1e293b; color: var(--text-2); cursor: pointer; transition: all 0.12s; font-family: inherit; }
.mood-btn:hover { border-color: var(--teal); color: var(--teal-light); }
.mood-btn.selected { background: var(--teal-dim); border-color: var(--teal); color: var(--teal-light); }
.topbar-spacer { flex: 1; }
.btn-icon { background: none; border: 1px solid var(--border-2); color: var(--text-2); width: 30px; height: 30px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.12s; }
.btn-icon:hover { border-color: #64748b; color: var(--text); }
.btn-icon.danger:hover { border-color: #ef4444; color: #ef4444; }
.btn-save { padding: 4px 14px; background: var(--teal); color: white; border: none; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s; font-family: inherit; }
.btn-save:hover { background: #005a6b; }
.btn-save:disabled { background: var(--border-2); cursor: default; }
.photo-area { padding: 6px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--bg-card); }
.photo-upload-btn { display: flex; align-items: center; gap: 5px; padding: 4px 10px; background: #1e293b; border: 1px dashed var(--border-2); border-radius: 7px; color: var(--text-3); font-size: 12px; cursor: pointer; transition: all 0.12s; font-family: inherit; }
.photo-upload-btn:hover { border-color: var(--teal); color: var(--teal-light); }
.photo-hint { font-size: 11px; color: var(--text-3); }
.editor-tags { padding: 6px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--bg-card); }
.tag-label { font-size: 11px; color: var(--text-4); }
.tag-badge { font-size: 11px; padding: 1px 7px; border-radius: 20px; background: #1e293b; color: var(--text-2); border: 1px solid var(--border-2); display: flex; align-items: center; gap: 3px; }
.tag-badge button { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 11px; padding: 0; line-height: 1; }
.tag-badge button:hover { color: #ef4444; }
#tag-input { background: none; border: none; color: var(--text); font-size: 12px; outline: none; width: 90px; font-family: inherit; }
#tag-input::placeholder { color: var(--text-4); }
.save-indicator { font-size: 0.65rem; color: var(--text-4); transition: color 0.2s; }
.save-indicator.saved { color: #34d399; }
.save-indicator.saving { color: var(--teal-light); }
.editor-body { display: flex; flex-direction: column; }
#entry-title { background: none; border: none; color: #f1f5f9; font-size: 20px; font-weight: 700; outline: none; width: 100%; line-height: 1.3; padding: 18px 20px 8px; font-family: inherit; resize: none; }
#entry-title::placeholder { color: var(--text-4); }
#editor { flex: 1; padding: 8px 20px 24px; outline: none; font-size: 0.92rem; line-height: 1.75; color: var(--text); min-height: 200px; }
#editor:empty::before { content: "Write anything…"; color: var(--text-4); pointer-events: none; }
#editor h1 { font-size: 1.3rem; font-weight: 700; color: #f1f5f9; margin: 1rem 0 0.5rem; }
#editor h2 { font-size: 1.1rem; font-weight: 700; color: #cbd5e1; margin: 0.8rem 0 0.4rem; }
#editor h3 { font-size: 0.9rem; font-weight: 700; color: #94a3b8; margin: 0.6rem 0 0.3rem; }
#editor p { margin-bottom: 0.75rem; }
#editor b, #editor strong { color: var(--teal-light); }
#editor i, #editor em { color: #a5b4fc; font-style: italic; }
#editor ul, #editor ol { margin: 0.4rem 0 0.75rem 1.6rem; }
#editor li { margin: 0.2rem 0; }
#editor blockquote { border-left: 3px solid var(--teal); margin: 0.75rem 0; padding: 6px 14px; color: var(--text-3); font-style: italic; }
#editor hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.obs-img { max-width: 100%; border-radius: 8px; display: block; margin: 8px 0; }
.check-item { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.check-item input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--teal); cursor: pointer; flex-shrink: 0; margin: 0; }
.check-item span { flex: 1; background: transparent !important; outline: none; min-width: 4px; line-height: 1.75; }
.check-item.done span { text-decoration: line-through; color: var(--text-4); }

/* ── VIEW ── */
.view-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.view-topbar { padding: 8px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; background: var(--bg-card); flex-shrink: 0; }
.view-date-str { font-size: 13px; color: var(--text-3); flex: 1; }
.view-date-str strong { color: var(--text); }
.view-scroll { flex: 1; overflow-y: auto; padding: 20px; }
.view-scroll::-webkit-scrollbar { width: 4px; }
.view-scroll::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 2px; }
.view-title { font-size: 22px; font-weight: 700; color: #f1f5f9; margin-bottom: 8px; line-height: 1.3; }
.view-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.view-divider { border: none; border-top: 1px solid var(--border); margin: 0 0 16px; }
.view-content { font-size: 15px; line-height: 1.75; color: #cbd5e1; }
.view-content h1 { font-size: 1.3rem; font-weight: 700; color: #f1f5f9; margin: 1rem 0 0.5rem; }
.view-content h2 { font-size: 1.1rem; font-weight: 700; color: #cbd5e1; margin: 0.8rem 0 0.4rem; }
.view-content h3 { font-size: 0.9rem; font-weight: 700; color: #94a3b8; margin: 0.6rem 0 0.3rem; }
.view-content b, .view-content strong { color: var(--teal-light); }
.view-content blockquote { border-left: 3px solid var(--teal); margin: 0.75rem 0; padding: 6px 14px; color: var(--text-3); font-style: italic; }
.view-content hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.view-content ul, .view-content ol { margin: 0.4rem 0 0.75rem 1.6rem; }
.view-content li { margin: 0.2rem 0; }
.view-content p { margin-bottom: 0.75rem; }
.view-content .obs-img { max-width: 100%; border-radius: 8px; display: block; margin: 8px 0; }

/* ── MOODS ── */
.mood-happy    { background: #14532d !important; border-color: #16a34a !important; color: #86efac !important; }
.mood-grateful { background: #451a03 !important; border-color: #d97706 !important; color: #fcd34d !important; }
.mood-reflective { background: var(--teal-dim) !important; border-color: var(--teal) !important; color: var(--teal-light) !important; }
.mood-anxious  { background: #4c0519 !important; border-color: #e11d48 !important; color: #fda4af !important; }
.mood-neutral  { background: #1e293b !important; border-color: #475569 !important; color: #94a3b8 !important; }
.mood-low      { background: #1c1917 !important; border-color: #78716c !important; color: #a8a29e !important; }

/* ── CALENDAR ── */
.cal-layout { display: flex; flex: 1; overflow: hidden; }
.cal-grid-pane { width: 360px; min-width: 300px; border-right: 1px solid var(--border); overflow-y: auto; padding: 12px; flex-shrink: 0; }
.cal-grid-pane::-webkit-scrollbar { width: 4px; }
.cal-grid-pane::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 2px; }
.cal-split-pane { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.cal-split-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-4); font-size: 13px; }
.cal-split-empty svg { opacity: 0.25; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-nav-btn { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 6px; font-family: inherit; transition: all 0.12s; }
.cal-nav-btn:hover { background: var(--border); color: var(--text); }
.cal-month-label { font-size: 14px; font-weight: 700; color: var(--text); }
.cal-dow-row { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 2px; }
.cal-dow { font-size: 10px; font-weight: 600; color: var(--text-4); text-align: center; padding: 3px 0; }
.cal-cells { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-cell { aspect-ratio: 1; border-radius: 6px; overflow: hidden; position: relative; background: #111827; }
.cal-cell.empty { background: transparent; pointer-events: none; }
.cal-cell.has-entry { cursor: pointer; }
.cal-cell.has-entry:hover { outline: 1px solid var(--teal); }
.cal-cell.selected { outline: 2px solid var(--teal) !important; }
.cal-cell.today-cell { outline: 1px solid rgba(0,104,123,0.4); }
.cal-cell-num { font-size: 11px; font-weight: 700; color: white; position: absolute; top: 2px; left: 3px; line-height: 1; z-index: 2; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.cal-cell.no-entry .cal-cell-num { color: var(--text-4); font-weight: 400; text-shadow: none; }
.cal-cell:not(.has-entry) .cal-cell-num { color: var(--text-4); font-weight: 400; text-shadow: none; }
.cal-cell.today-cell .cal-cell-num { color: var(--teal-light) !important; font-weight: 700; text-shadow: none; }
.cal-cell-img { width: 100%; height: 100%; object-fit: cover; display: block; background-size: cover; background-position: center; position: absolute; inset: 0; }
.cal-cell-dot { position: absolute; bottom: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); z-index: 2; }
.cal-cell-cover { position: absolute; inset: 0; background: rgba(0,104,123,0.3); z-index: 1; }

/* ── CALENDAR SPLIT PANE CONTENT ── */
.split-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.split-date-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.split-count { font-size: 11px; color: var(--text-3); font-weight: 400; background: var(--border); border-radius: 4px; padding: 1px 7px; }
.split-entries { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.split-entries::-webkit-scrollbar { width: 4px; }
.split-entries::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 2px; }
.split-no-entries { color: var(--text-4); font-size: 13px; text-align: center; padding: 24px 0; }
.split-entry { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s; }
.split-entry:hover { border-color: var(--teal); }
.split-entry-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.split-entry-preview { font-size: 12px; color: var(--text-3); line-height: 1.5; margin-top: 5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.split-entry-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.split-entry-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.7; color: var(--text-2); }
.split-entry-body h1,.split-entry-body h2,.split-entry-body h3 { color: var(--text); margin: 8px 0 4px; }
.split-entry-body img { max-width: 100%; border-radius: 6px; margin: 4px 0; }

/* ── MEDIA ── */
.page-container { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.page-container::-webkit-scrollbar { width: 4px; }
.page-container::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 2px; }
.media-page { flex: 1; overflow-y: auto; }
.media-page::-webkit-scrollbar { width: 4px; }
.media-page::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 2px; }
.media-inner { max-width: 680px; margin: 0 auto; padding: 16px 16px 60px; }
.media-header { display: flex; align-items: center; justify-content: space-between; padding: 0 0 8px; }
.media-count { font-size: 12px; color: var(--text-4); font-weight: 500; }
.media-date-group { margin-bottom: 28px; }
.media-date-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.media-date-label { font-size: 15px; font-weight: 700; color: var(--text); }
.media-date-count { font-size: 10px; color: var(--text-4); background: var(--border); border-radius: 4px; padding: 1px 7px; font-weight: 600; }
.media-preview-text { font-size: 13px; color: var(--text-3); font-style: italic; margin-bottom: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }
.photo-thumb-wrap { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: #1f2937; cursor: pointer; transition: outline 0.12s; }
.photo-thumb-wrap:hover { outline: 2px solid var(--teal); }
.photo-thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.3s; }
.photo-thumb[src=""] { opacity: 0; }
.photo-thumb-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 5px 4px; background: linear-gradient(transparent, rgba(0,0,0,0.65)); color: white; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.empty-media, .media-empty { padding: 40px; text-align: center; color: var(--text-4); font-size: 13px; }

/* ── LIGHTBOX ── */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 300; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lb-close { position: fixed; top: 16px; right: 16px; z-index: 310; width: 36px; height: 36px; border-radius: 50%; background: rgba(15,23,42,0.85); border: 1px solid #374151; color: #94a3b8; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; backdrop-filter: blur(4px); line-height: 1; }
.lb-close:hover { color: #f87171; border-color: #ef4444; }
.lb-prev, .lb-next { position: fixed; top: 50%; transform: translateY(-50%); z-index: 310; width: 44px; height: 44px; border-radius: 50%; background: rgba(15,23,42,0.85); border: 1px solid #374151; color: #e2e8f0; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; backdrop-filter: blur(4px); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-prev:hover, .lb-next:hover { background: rgba(0,104,123,0.4); border-color: var(--teal); }
.lightbox-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: min(92vw, 960px); }
.lightbox-img { max-width: min(92vw, 960px); max-height: 78dvh; border-radius: 10px; object-fit: contain; display: block; transition: opacity 0.25s; }
.lightbox-meta { background: rgba(17,24,39,0.9); border: 1px solid var(--border); border-radius: 10px; padding: 10px 20px; text-align: center; min-width: 200px; backdrop-filter: blur(4px); }
.lightbox-date { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }
.lightbox-title { font-size: 13px; color: var(--text); min-height: 0; }
.lb-note-link { color: var(--teal-light); text-decoration: none; border-bottom: 1px solid rgba(0,168,152,0.4); transition: border-color 0.15s; }
.lb-note-link:hover { border-color: var(--teal-light); }

/* ── TIMELINE ── */
.timeline-page { flex: 1; overflow-y: auto; }
.timeline-page::-webkit-scrollbar { width: 4px; }
.timeline-page::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 2px; }
.timeline-inner { max-width: 680px; margin: 0 auto; padding: 20px 16px 60px; }
.timeline-year-group { margin-bottom: 36px; }
.timeline-year-label { font-size: 24px; font-weight: 800; color: var(--teal); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid rgba(0,104,123,0.25); }
.timeline-month-group { margin-bottom: 20px; }
.timeline-month-label { font-size: 10px; font-weight: 700; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 8px; padding-left: 2px; }
.timeline-entries { display: flex; flex-direction: column; gap: 6px; }
.timeline-entry { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s; display: flex; gap: 12px; align-items: flex-start; }
.timeline-entry:hover { border-color: var(--teal); }
.t-date { min-width: 34px; display: flex; flex-direction: column; align-items: center; flex-shrink: 0; padding-top: 2px; }
.t-dow { font-size: 9px; font-weight: 600; color: var(--text-4); text-transform: uppercase; }
.t-day { font-size: 20px; font-weight: 700; color: var(--text-2); line-height: 1; }
.t-body { flex: 1; min-width: 0; }
.t-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; }
.t-preview { font-size: 12px; color: var(--text-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 5px; }
.t-meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.t-section { font-size: 10px; color: var(--text-4); }
.t-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #1f2937; }

/* ── COMMON BADGES ── */
.mood-tag { font-size: 10px; padding: 1px 6px; border-radius: 10px; }
.tag-chip { font-size: 10px; padding: 1px 6px; border-radius: 10px; background: #1e293b; color: var(--text-2); border: 1px solid var(--border-2); }

/* ── SYNC BAR ── */
.sync-bar { height: 2px; background: var(--teal-dim); position: sticky; top: 52px; z-index: 89; overflow: hidden; }
.sync-bar.syncing::after { content: ''; display: block; height: 100%; width: 40%; background: var(--teal); animation: slide-sync 1.2s linear infinite; }
@keyframes slide-sync { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ── TOAST ── */
.toast { position: fixed; bottom: 20px; right: 20px; background: #1e293b; border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 16px; font-size: 13px; color: var(--text); z-index: 999; opacity: 0; transform: translateY(6px); transition: all 0.2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ── MOBILE ── */
/* ── MOBILE BACK BUTTON ── */
.mob-back {
  display: none; align-items: center; justify-content: center;
  width: 30px; height: 30px; background: none;
  border: 1px solid var(--border-2); border-radius: 7px;
  color: var(--text-2); cursor: pointer; flex-shrink: 0;
  transition: all 0.12s;
}
.mob-back:hover { border-color: #64748b; color: var(--text); }
.mob-back svg { width: 14px; height: 14px; }

@media (max-width: 700px) {
  /* Two-panel slide layout */
  .app { position: relative; overflow: hidden; }
  .sidebar {
    width: 100%; min-width: 0; border-right: none;
    position: absolute; inset: 0;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    z-index: 2; display: flex;
  }
  .main-panel {
    width: 100%;
    position: absolute; inset: 0;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    transform: translateX(100%);
    z-index: 3;
    background: var(--bg);
  }
  .app.mob-detail .sidebar  { transform: translateX(-30%); }
  .app.mob-detail .main-panel { transform: translateX(0); }

  .mob-back { display: flex; }

  /* Calendar */
  .cal-grid-pane { width: 100%; border-right: none; min-width: 0; }
  .cal-split-pane { display: none; }
  body { overflow: auto; }
  .mind-tabs { display: none; }
  .dock { display: none; }
  .nav-hamburger { display: flex; }
}
