@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Poppins:wght@300;400;500;600;700&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────── */
:root {
  --bg:          #FAF6EF;
  --surface:     #FFFDF9;
  --surface-2:   #F5EDD8;
  --surface-3:   #EDE0C4;
  --brown-900:   #2D1F16;
  --brown-800:   #3D2B1F;
  --brown-700:   #5C3D2E;
  --brown-600:   #7C5444;
  --brown-500:   #8B6355;
  --brown-300:   #C4A882;
  --accent:      #C4896F;
  --accent-h:    #B07455;
  --accent-l:    #F2E0D6;
  --accent-ll:   #FAF0EB;
  --maw:         #9B6B8E;
  --maw-l:       #F0E8EF;
  --border:      rgba(139,99,85,0.12);
  --border-2:    rgba(139,99,85,0.22);
  --shadow-s:    0 2px 8px rgba(45,31,22,0.06);
  --shadow:      0 4px 20px rgba(45,31,22,0.09);
  --shadow-l:    0 8px 36px rgba(45,31,22,0.13);
  --text:        #2D1F16;
  --text-2:      #6B4F3A;
  --text-m:      #9C7B68;
  --r-s:         8px;
  --r:           14px;
  --r-l:         22px;
  --sidebar:     240px;
  --ease:        cubic-bezier(0.34,1.56,0.64,1);
  --ease-out:    cubic-bezier(0.22,1,0.36,1);
}

/* ─── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

/* Noise grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

/* ─── Typography ─────────────────────────────────────────────────────── */
.display { font-family: 'Lora', serif; }
h1,h2,h3 { font-family: 'Lora', serif; font-weight: 500; line-height: 1.3; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-m); }

/* ─── Login Page ─────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 15% 85%, rgba(196,137,111,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(155,107,142,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(237,224,196,0.30) 0%, transparent 70%),
    var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-l);
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-l);
  animation: slideUp 0.6s var(--ease-out) both;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo .logo-icon {
  font-size: 42px;
  display: block;
  margin-bottom: 10px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.login-logo h1 {
  font-size: 32px;
  color: var(--brown-800);
  letter-spacing: -0.5px;
}
.login-logo p {
  color: var(--text-m);
  font-size: 13px;
  margin-top: 4px;
}

.user-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  background: var(--surface-2);
  padding: 5px;
  border-radius: var(--r);
}
.user-toggle button {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: calc(var(--r) - 4px);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-m);
  transition: all 0.25s;
}
.user-toggle button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-s);
}
.user-toggle button .emoji { margin-right: 6px; font-size: 16px; }

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-s);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196,137,111,0.12);
}
.form-group textarea {
  resize: vertical;
  min-height: 100px;
}
.form-group .input-wrap {
  position: relative;
}
.form-group .input-wrap input {
  padding-right: 44px;
}
.form-group .input-wrap .eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-m); font-size: 16px; padding: 4px;
  transition: color 0.2s;
}
.form-group .input-wrap .eye-btn:hover { color: var(--text-2); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--r-s);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
  justify-content: center;
  letter-spacing: 0.02em;
}
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(196,137,111,0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text-2);
}
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger {
  background: #f5e8e8;
  color: #8b3333;
}
.btn-danger:hover { background: #f0d0d0; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--r-s); background: none; border: none; color: var(--text-m); font-size: 18px; transition: all 0.2s; }
.btn-icon:hover { color: var(--text); background: var(--surface-2); }

.login-error {
  background: #fce8e8;
  color: #8b3333;
  border-radius: var(--r-s);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }

/* ─── App Layout ─────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar);
  background: var(--brown-800);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s var(--ease-out);
}
.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo {
  font-family: 'Lora', serif;
  font-size: 20px;
  color: var(--surface-2);
  letter-spacing: -0.3px;
}
.sidebar-logo span { color: var(--accent); }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--r-s);
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.08); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  background: var(--accent);
  flex-shrink: 0;
}
.user-avatar.maw { background: var(--maw); }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 14px 10px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-s);
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
.nav-item.active { background: var(--accent); color: white; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.25); color: white; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer .nav-item { color: rgba(255,255,255,0.35); }
.sidebar-footer .nav-item:hover { color: rgba(255,255,255,0.6); }

/* ─── Main Content ───────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.section-view {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 32px;
  max-width: 1100px;
  width: 100%;
  animation: fadeIn 0.3s ease both;
}
.section-view.active {
  display: flex;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title { font-size: 26px; color: var(--brown-800); }
.section-subtitle { font-size: 13px; color: var(--text-m); margin-top: 2px; }

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-s);
  padding: 20px;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* ─── Home Section ───────────────────────────────────────────────────── */
#section-home .greeting-card {
  background: linear-gradient(135deg, var(--brown-800) 0%, var(--brown-700) 100%);
  color: white;
  border-radius: var(--r-l);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
#section-home .greeting-card::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(196,137,111,0.25) 0%, transparent 70%);
  border-radius: 50%;
}
.greeting-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.greeting-text h2 { font-family: 'Lora', serif; font-size: 24px; color: rgba(255,255,255,0.95); }
.greeting-text p { color: rgba(255,255,255,0.55); font-size: 13px; margin-top: 4px; }
.greeting-date { text-align: right; }
.greeting-date .date-big { font-family: 'Lora', serif; font-size: 15px; color: rgba(255,255,255,0.8); }
.greeting-date .time-big { font-size: 28px; font-weight: 700; color: white; letter-spacing: -1px; }
.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.home-stat {
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-s);
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
}
.home-stat .stat-label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 4px; }
.home-stat .stat-value { font-size: 18px; font-weight: 700; color: white; }
.home-stat .stat-sub { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 1px; }

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.home-widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; }
.widget-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-m); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

/* Weather widget */
.weather-display { display: flex; align-items: center; gap: 16px; }
.weather-icon { font-size: 44px; }
.weather-info .temp { font-size: 32px; font-weight: 700; color: var(--brown-800); letter-spacing: -1px; }
.weather-info .desc { font-size: 13px; color: var(--text-2); }
.weather-info .city { font-size: 11px; color: var(--text-m); margin-top: 2px; }

/* Quick links on home */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.quick-link-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px;
  background: var(--surface-2);
  border-radius: var(--r-s);
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid transparent;
  text-align: center;
}
.quick-link-chip:hover { background: var(--surface-3); border-color: var(--border-2); transform: translateY(-2px); }
.quick-link-chip .link-emoji { font-size: 22px; }
.quick-link-chip .link-name { font-size: 11px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

/* Reminder preview */
.reminder-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.reminder-item:last-child { border-bottom: none; padding-bottom: 0; }
.reminder-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }
.reminder-dot.urgent { background: #e87070; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.3); } }
.reminder-content .r-title { font-size: 13px; font-weight: 500; color: var(--text); }
.reminder-content .r-date { font-size: 11px; color: var(--text-m); margin-top: 1px; }

/* Counter */
.counter-display { text-align: center; padding: 10px; }
.counter-number { font-family: 'Lora', serif; font-size: 52px; color: var(--accent); line-height: 1; }
.counter-label { font-size: 12px; color: var(--text-m); margin-top: 6px; }

/* ─── Safety Section ─────────────────────────────────────────────────── */
.safety-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
}
.safety-card:hover { box-shadow: var(--shadow); }
.safety-site-icon {
  width: 38px; height: 38px; border-radius: var(--r-s);
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.safety-info { flex: 1; min-width: 0; }
.safety-site { font-weight: 600; font-size: 14px; color: var(--text); }
.safety-user { font-size: 12px; color: var(--text-m); margin-top: 1px; }
.safety-password { display: flex; align-items: center; gap: 8px; }
.safety-password .pwd-hidden { font-family: monospace; font-size: 14px; color: var(--text-2); letter-spacing: 2px; }
.safety-actions { display: flex; gap: 6px; flex-shrink: 0; }
.safety-tag {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px;
  background: var(--accent-l); color: var(--accent-h);
}

/* ─── Notes Section ──────────────────────────────────────────────────── */
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.note-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.note-card.private { border-left: 3px solid var(--accent); }
.note-card.shared { border-left: 3px solid var(--brown-300); }
.note-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.note-author { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--accent-l); color: var(--accent-h); }
.note-author.maw { background: var(--maw-l); color: var(--maw); }
.note-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--surface-3); color: var(--text-m); }
.note-title { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.note-preview { font-size: 12px; color: var(--text-m); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-date { font-size: 11px; color: var(--text-m); margin-top: 10px; }
.mention { color: var(--accent); font-weight: 600; }

/* ─── Lists Section ──────────────────────────────────────────────────── */
.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.list-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.list-emoji { font-size: 28px; margin-bottom: 8px; }
.list-name { font-weight: 600; font-size: 15px; color: var(--text); }
.list-count { font-size: 12px; color: var(--text-m); margin-top: 2px; }
.list-progress { height: 4px; background: var(--surface-3); border-radius: 2px; margin-top: 12px; }
.list-progress-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s var(--ease-out); }

.list-detail-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.back-btn {
  background: var(--surface-2); border: none; border-radius: var(--r-s);
  padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: background 0.2s;
}
.back-btn:hover { background: var(--surface-3); }

.list-items { display: flex; flex-direction: column; gap: 6px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  transition: all 0.2s;
}
.list-item.done { opacity: 0.5; }
.list-item-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border-2); background: transparent;
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-size: 11px;
}
.list-item-check.checked { background: var(--accent); border-color: var(--accent); color: white; }
.list-item-text { flex: 1; font-size: 13px; color: var(--text); }
.list-item.done .list-item-text { text-decoration: line-through; color: var(--text-m); }
.list-item-by { font-size: 10px; color: var(--text-m); white-space: nowrap; }
.list-item-del { opacity: 0; color: var(--text-m); background: none; border: none; font-size: 16px; cursor: pointer; transition: all 0.2s; padding: 2px; }
.list-item:hover .list-item-del { opacity: 1; }
.list-item-del:hover { color: #c45555; }

.add-item-bar {
  display: flex; gap: 10px;
  margin-top: 12px;
}
.add-item-bar input {
  flex: 1; padding: 11px 16px;
  border: 1.5px solid var(--border-2); border-radius: var(--r-s);
  background: var(--surface); color: var(--text); font-size: 13px;
  font-family: inherit; outline: none; transition: border-color 0.2s;
}
.add-item-bar input:focus { border-color: var(--accent); }
.add-item-bar button {
  padding: 11px 18px; background: var(--accent); color: white; border: none;
  border-radius: var(--r-s); font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.add-item-bar button:hover { background: var(--accent-h); }

/* ─── Memories Section ───────────────────────────────────────────────── */
.memory-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.memory-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.memory-img { width: 100%; height: 180px; object-fit: cover; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.memory-body { padding: 16px; }
.memory-date { font-size: 11px; color: var(--text-m); margin-bottom: 6px; }
.memory-title { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 6px; }
.memory-preview { font-size: 12px; color: var(--text-m); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── Watchlist Section ──────────────────────────────────────────────── */
.watchlist-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.watchlist-tab {
  padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1.5px solid var(--border-2); background: transparent; color: var(--text-m); transition: all 0.2s;
}
.watchlist-tab.active { background: var(--accent); border-color: var(--accent); color: white; }
.watchlist-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  margin-bottom: 10px; transition: box-shadow 0.2s;
}
.watchlist-card:hover { box-shadow: var(--shadow); }
.watchlist-thumb {
  width: 48px; height: 48px; border-radius: var(--r-s);
  background: var(--surface-2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.watchlist-info { flex: 1; min-width: 0; }
.watchlist-title { font-weight: 600; font-size: 14px; color: var(--text); }
.watchlist-type { font-size: 11px; color: var(--text-m); margin-top: 1px; }
.watchlist-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.watchlist-rating { font-size: 13px; }
.watchlist-notes { font-size: 12px; color: var(--text-m); }
.type-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--surface-2); color: var(--text-2); }

/* ─── Links Section ──────────────────────────────────────────────────── */
.link-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.link-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-2); }
.link-card .link-icon { font-size: 22px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-radius: var(--r-s); flex-shrink: 0; }
.link-card .link-info { flex: 1; min-width: 0; }
.link-card .link-title { font-weight: 600; font-size: 13px; color: var(--text); }
.link-card .link-url { font-size: 11px; color: var(--text-m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.link-card .link-arrow { color: var(--text-m); font-size: 14px; }

/* ─── Reminders Section ──────────────────────────────────────────────── */
.reminder-full-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  margin-bottom: 10px; transition: box-shadow 0.2s;
}
.reminder-full-card.today { border-left: 3px solid var(--accent); background: var(--accent-ll); }
.reminder-full-card:hover { box-shadow: var(--shadow); }
.reminder-bell { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.reminder-detail { flex: 1; min-width: 0; }
.reminder-detail .r-title { font-weight: 600; font-size: 14px; color: var(--text); }
.reminder-detail .r-desc { font-size: 12px; color: var(--text-m); margin-top: 3px; }
.reminder-detail .r-date { font-size: 11px; color: var(--text-m); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.r-repeat { font-size: 10px; background: var(--surface-2); padding: 2px 8px; border-radius: 20px; color: var(--text-m); }

/* ─── Simple Content Sections (Logement, Voyages etc.) ──────────────── */
.simple-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.content-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px; cursor: pointer; transition: all 0.2s;
}
.content-block:hover { box-shadow: var(--shadow); }
.content-block .block-icon { font-size: 28px; margin-bottom: 10px; }
.content-block .block-title { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.content-block .block-preview { font-size: 12px; color: var(--text-m); }
.content-block .block-date { font-size: 11px; color: var(--text-m); margin-top: 10px; }

/* ─── Settings Section ───────────────────────────────────────────────── */
.settings-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); margin-bottom: 16px; overflow: hidden;
}
.settings-group-title {
  padding: 14px 20px;
  background: var(--surface-2);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-m); border-bottom: 1px solid var(--border);
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-info .setting-label { font-size: 14px; font-weight: 500; color: var(--text); }
.settings-row-info .setting-desc { font-size: 12px; color: var(--text-m); margin-top: 2px; }
.settings-row-action { flex-shrink: 0; }

/* ─── Modals ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(45,31,22,0.45);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--r-l);
  padding: 28px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-l);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s var(--ease);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.modal-header h3 { font-size: 18px; color: var(--brown-800); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-m); padding: 4px; border-radius: var(--r-s); transition: all 0.2s; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ─── Search bar ─────────────────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border-2);
  border-radius: var(--r-s); padding: 10px 14px;
  margin-bottom: 18px;
}
.search-bar input {
  flex: 1; border: none; background: transparent; font-family: inherit;
  font-size: 13px; color: var(--text); outline: none;
}
.search-bar .search-icon { color: var(--text-m); font-size: 16px; }
.search-bar:focus-within { border-color: var(--accent); }

/* ─── FAB (Floating Action Button) ──────────────────────────────────── */
.fab {
  position: fixed; bottom: 28px; right: 28px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: white;
  font-size: 24px; border: none;
  box-shadow: 0 4px 20px rgba(196,137,111,0.45);
  cursor: pointer; transition: all 0.25s var(--ease);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.fab:hover { transform: scale(1.1) rotate(45deg); background: var(--accent-h); }

/* ─── Tabs ───────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px; padding-bottom: 0;
}
.tab-btn {
  padding: 9px 18px; border: none; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--text-m);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all 0.2s;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--text-2); }

/* ─── Toast Notifications ────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9000; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.toast {
  background: var(--brown-900); color: white;
  padding: 12px 20px; border-radius: var(--r);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-l);
  animation: toastIn 0.3s var(--ease) both;
  display: flex; align-items: center; gap: 10px;
}
.toast.success .toast-icon { color: #7ecb8a; }
.toast.error .toast-icon { color: #e87070; }
.toast.info .toast-icon { color: var(--accent); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ─── Empty State ────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-m);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 14px; opacity: 0.6; }
.empty-state h3 { font-family: 'Lora', serif; font-size: 18px; color: var(--text-2); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ─── Category header ────────────────────────────────────────────────── */
.category-header {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-m); margin: 22px 0 10px;
}
.category-header:first-child { margin-top: 0; }

/* ─── Badges / Tags ──────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.badge-paw { background: var(--accent-l); color: var(--accent-h); }
.badge-maw { background: var(--maw-l); color: var(--maw); }

/* ─── Utility ────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-m); }
.text-sm { font-size: 12px; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ─── Mobile Responsive ──────────────────────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--brown-800);
  padding: 12px 16px;
  align-items: center; justify-content: space-between;
  z-index: 200;
}
.mobile-menu-btn { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 22px; cursor: pointer; padding: 4px; }
.mobile-logo { font-family: 'Lora', serif; font-size: 18px; color: var(--surface-2); }
.mobile-logo span { color: var(--accent); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; padding-top: 56px; }
  .section-view { padding: 20px 16px; }
  .home-stats { grid-template-columns: 1fr 1fr; }
  .home-stats .home-stat:last-child { grid-column: span 2; }
  .home-grid { grid-template-columns: 1fr; }
  .simple-section-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .greeting-top { flex-direction: column; }
  .greeting-date { text-align: left; }
  .modal { padding: 20px; border-radius: var(--r); }
  .fab { bottom: 20px; right: 16px; }
}

/* ─── Keychain (Safety) ──────────────────────────────────────────────── */
.keychain-group {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 6px;
  background: var(--surface);
}
.keychain-entry { border-bottom: 1px solid var(--border); }
.keychain-entry:last-child { border-bottom: none; }

.keychain-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.keychain-row:hover { background: var(--surface-2); }

.kc-icon {
  width: 40px; height: 40px;
  background: var(--surface-2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.kc-info { flex: 1; min-width: 0; }
.kc-site { font-size: 14px; font-weight: 600; color: var(--text); }
.kc-user { font-size: 12px; color: var(--text-m); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-arrow { font-size: 10px; color: var(--text-m); flex-shrink: 0; }

.keychain-detail {
  background: var(--bg);
  padding: 4px 16px 16px;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.2s ease both;
}
.kc-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.kc-detail-row:last-of-type { border-bottom: none; }
.kc-detail-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-m);
  width: 100px; flex-shrink: 0;
}
.kc-detail-value {
  flex: 1; font-size: 13px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: 'Poppins', monospace;
}
.kc-pwd-display { letter-spacing: 2px; }
.kc-copy-btn {
  background: var(--accent-l); color: var(--accent-h);
  border: none; border-radius: 6px;
  padding: 5px 12px; font-size: 11px; font-weight: 600;
  cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.kc-copy-btn:hover { background: var(--surface-3); }
.kc-detail-actions {
  display: flex; gap: 8px; padding-top: 12px; flex-wrap: wrap;
}

/* ─── Home Enhancements ──────────────────────────────────────────────── */
.home-message-card {
  background: linear-gradient(135deg, #FDF6ED 0%, #F5EDD8 100%);
  border: 1.5px dashed var(--brown-300);
  border-radius: var(--r);
  padding: 18px 20px;
  position: relative;
}
.home-message-card .msg-from {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-m); margin-bottom: 8px;
}
.home-message-card .msg-content {
  font-family: 'Lora', serif; font-size: 15px; color: var(--brown-700);
  line-height: 1.7; min-height: 40px;
}
.home-message-card .msg-meta { font-size: 11px; color: var(--text-m); margin-top: 8px; }
.home-message-card .msg-empty { color: var(--text-m); font-size: 13px; font-style: italic; }
.home-message-card .msg-edit-btn {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; color: var(--text-m);
  font-size: 14px; cursor: pointer; padding: 4px 8px;
  border-radius: var(--r-s); transition: all 0.2s;
}
.home-message-card .msg-edit-btn:hover { background: var(--surface-3); color: var(--text); }

.home-list-widget .list-mini-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.home-list-widget .list-mini-item:last-child { border-bottom: none; }
.home-list-widget .list-mini-check {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--border-2); flex-shrink: 0;
}

.home-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.home-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.home-full { margin-bottom: 16px; }

@media (max-width: 900px) {
  .home-3col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .home-3col, .home-2col { grid-template-columns: 1fr; }
}

/* ─── Local Mode & Timeline Additions ─────────────────────────────────── */
.local-warning {
  background: rgba(196, 137, 111, 0.12);
  border: 1px solid rgba(196, 137, 111, 0.28);
  color: var(--brown-700);
  border-radius: var(--r-m);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 16px;
}

.kc-note-block {
  background: var(--surface-2);
  border-radius: var(--r-s);
  padding: 12px 14px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
  margin: 8px 0 12px;
}

.timeline-hero {
  background: linear-gradient(135deg, rgba(196,137,111,.18), rgba(155,107,142,.14));
  border: 1px solid var(--border-2);
  border-radius: var(--r-l);
  padding: 18px 20px;
  margin-bottom: 18px;
  color: var(--brown-800);
  line-height: 1.55;
}
.timeline-hero span { color: var(--text-m); font-size: 13px; }
.timeline-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 8px;
}
.timeline-list:before {
  content: '';
  position: absolute;
  left: 26px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border-2);
}
.timeline-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  position: relative;
}
.timeline-dot {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--bg);
  border: 1.5px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 1;
  box-shadow: var(--shadow-s);
}
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-m);
  padding: 14px 16px;
  box-shadow: var(--shadow-s);
}
.timeline-item.locked .timeline-card { opacity: .72; }
.timeline-date {
  color: var(--text-m);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.timeline-title {
  color: var(--brown-800);
  font-family: 'Lora', serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}
.timeline-text {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
}
.timeline-photo {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--r-s);
  margin: 8px 0 10px;
}

@media (max-width: 640px) {
  .timeline-item { grid-template-columns: 42px 1fr; }
  .timeline-list:before { left: 21px; }
  .timeline-dot { width: 32px; height: 32px; font-size: 15px; }
}

/* Web sync status */
.sync-status{position:fixed;right:18px;bottom:18px;z-index:3000;padding:7px 11px;border-radius:999px;font-size:11px;font-weight:600;background:rgba(255,255,255,.92);border:1px solid var(--border);box-shadow:var(--shadow);color:var(--text-m);backdrop-filter:blur(8px);transition:.2s}
.sync-status.syncing{color:#8a641f}.sync-status.saved{opacity:.7}.sync-status.error{color:#b33b3b;border-color:#efb2b2}
@media(max-width:700px){.sync-status{right:10px;bottom:10px}}


/* ─── Home message composer & household weather (v2.4) ───────────── */
.home-message-compose {
  display: grid;
  grid-template-columns: minmax(220px, 520px) auto;
  align-items: center;
  gap: 10px;
  max-width: 720px;
}
.home-message-input {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-s);
  font-family: 'Lora', serif;
  font-size: 16px;
  line-height: 1.2;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.home-message-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(203,143,113,.12); }
.home-message-send { width: auto; min-width: 104px; padding-inline: 18px; white-space: nowrap; }
.household-weather-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.person-weather-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-s); padding: 13px; min-width: 0; }
.person-weather-title { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-m); margin-bottom: 10px; }
.person-weather-card .weather-display.compact { gap: 10px; }
.person-weather-card .weather-icon { font-size: 30px; }
.person-weather-card .weather-info .temp { font-size: 23px; }
.person-weather-card .weather-info .desc { font-size: 11px; }
.person-weather-card .weather-info .city { font-size: 10px; }
.person-weather-time { font-size: 9px; color: var(--text-m); margin-top: 8px; }
.person-weather-empty { font-size: 12px; color: var(--text-m); line-height: 1.5; margin-bottom: 8px; }

@media (max-width: 700px) {
  input, textarea, select { font-size: 16px !important; }
  .home-message-compose { grid-template-columns: minmax(0, 1fr) auto; max-width: none; }
  .home-message-send { min-width: 82px; padding-inline: 12px; }
  .household-weather-grid { grid-template-columns: 1fr; }
}
