/* spao.me — light, friendly, feed-style.
   Soft gray background, white cards, calm blue accent. Like a private,
   minimal Facebook for one person. Edit the design tokens at the top to
   re-theme everything. */

:root {
  --bg:        #f0f2f5;
  --surface:   #ffffff;
  --surface-2: #f6f7f9;
  --border:    #e4e6eb;
  --text:      #1c1e21;
  --muted:     #65676b;
  --accent:    #3b6cb6;
  --accent-2:  #2f5694;
  --accent-soft:#e7f0fb;
  --danger:    #dc3545;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow:    0 2px 6px rgba(0,0,0,0.08);
}

/* Accent-color themes (set on <body data-accent="…">) */
body[data-accent="amber"]  { --accent: #d49a3a; --accent-2: #a4742a; --accent-soft: #fdf3e0; }
body[data-accent="rose"]   { --accent: #c46c5b; --accent-2: #9c5347; --accent-soft: #fbecea; }
body[data-accent="green"]  { --accent: #5a7d6a; --accent-2: #436252; --accent-soft: #ecf3ee; }
body[data-accent="violet"] { --accent: #8261a6; --accent-2: #614779; --accent-soft: #f0e7fb; }
body[data-accent="blue"]   { /* default values in :root */ }

:root {

  --serif: 'Iowan Old Style', 'Apple Garamond', 'Charter', 'Baskerville', 'Times New Roman', serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono:  ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --r: 8px;
  --r-card: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; display: flex; flex-direction: column; }

main.page {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* Auth pages (login, 2FA setup, 2FA verify) — centered card on plain bg */
body.auth { background: var(--bg); }
body.auth main.page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  max-width: 100%;
  padding: 2rem 1rem;
}

/* --- Headings --- */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.6rem; color: var(--text); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.8rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

a {
  color: var(--accent);
  text-decoration: none;
  border: none;
}
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
code.break { word-break: break-all; }

/* --- Header (the FB-style top bar) --- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .bar {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 0.3rem; align-items: center; }
.nav a {
  padding: 0.45rem 0.85rem;
  border-radius: var(--r);
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav form.inline { display: inline; margin: 0; }
.nav .link {
  padding: 0.45rem 0.85rem;
  border-radius: var(--r);
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
}
.nav .link:hover { background: var(--surface-2); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- Forms --- */
form { margin: 0.8rem 0; }
form.inline { display: inline; }
label { display: block; margin: 0 0 0.9rem; font-size: 0.9rem; color: var(--text); font-weight: 500; }
label span { display: block; margin-bottom: 0.35rem; }

input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="search"], textarea, select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
}
textarea { resize: vertical; min-height: 5rem; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button, .button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-2); text-decoration: none; }
button.danger, .button.danger { background: var(--danger); }
button.danger:hover, .button.danger:hover { background: #b02a3a; }
button.danger-outline, .button.danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
button.danger-outline:hover, .button.danger-outline:hover { background: var(--danger); color: #fff; }
button.link, .link {
  background: none;
  color: var(--accent);
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  border: none;
  cursor: pointer;
  font-weight: 500;
}
button.link:hover, .link:hover { text-decoration: underline; background: none; }

/* --- Cards (used for diary entries, settings sections, dashboard widgets) --- */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

/* --- Auth pages (login / 2FA) --- */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 2rem 2rem 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.auth-card .brand-mark {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}
.auth-card h1 { font-size: 1.25rem; text-align: center; margin: 0 0 0.4rem; font-weight: 500; }
.auth-card .auth-sub { text-align: center; color: var(--muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.auth-card form { margin-top: 1rem; }
.auth-card button[type="submit"] { width: 100%; padding: 0.7rem; font-size: 1rem; }
.qr { display: flex; justify-content: center; margin: 1rem 0 1.5rem; padding: 0.9rem; background: var(--surface-2); border-radius: var(--r); border: 1px solid var(--border); }
details summary { cursor: pointer; padding: 0.5rem 0; color: var(--muted); font-size: 0.9rem; }
details code { display: inline-block; margin: 0.15rem 0; font-size: 0.85em; }

/* --- Messages --- */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.msg { padding: 0.7rem 1rem; border-radius: var(--r); margin-bottom: 0.5rem; font-size: 0.92rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--muted); box-shadow: var(--shadow-sm); }
.msg-error   { border-left-color: var(--danger); background: #fff5f5; }
.msg-success { border-left-color: #2d8a4a; background: #f3f9f4; }
.msg-info    { border-left-color: var(--accent); background: var(--accent-soft); }

/* --- Dashboard (feed-style) --- */
.composer {
  background: var(--surface);
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.composer .avatar { flex-shrink: 0; width: 40px; height: 40px; font-size: 1rem; }
.composer-link {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 24px;
  padding: 0.7rem 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.composer-link:hover { background: #eaecef; color: var(--muted); text-decoration: none; }
.hero { padding: 0; margin: 0 0 0.5rem; }
.hero h1 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.hero p { color: var(--muted); }

.section-title { margin: 1.4rem 0 0.6rem 0.25rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.see-all { display: block; text-align: center; padding: 0.6rem; color: var(--accent); font-size: 0.9rem; font-weight: 500; }
.see-all:hover { text-decoration: underline; }

.phases.muted { padding: 0.75rem 1rem; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--r-card); color: var(--muted); margin-top: 1.5rem; }
.phases.muted h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0; }
.phases.muted ul { list-style: none; padding: 0; margin: 0; font-size: 0.88rem; }
.phases.muted li { padding: 0.25rem 0; border: none; }

/* --- Entry feed cards (used on dashboard + diary list) --- */
.entries { list-style: none; padding: 0; margin: 0; }
.entry-row {
  margin-bottom: 1rem;
}
.entry-link {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem 1.4rem;
  color: inherit;
  transition: box-shadow 0.15s ease;
}
.entry-link:hover { box-shadow: var(--shadow); text-decoration: none; }
.entry-meta {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.entry-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.4rem; line-height: 1.35; color: var(--text); }
.entry-link:hover .entry-title { color: var(--accent); }
.entry-excerpt { margin: 0.2rem 0 0.6rem; font-size: 0.93rem; line-height: 1.55; color: var(--text); }
.entry-tags { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.5rem; }
.tag {
  font-size: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent-2);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-weight: 500;
}
a.tag:hover { background: var(--accent); color: #fff; text-decoration: none; }
.mood {
  font-size: 0.78rem;
  color: var(--accent-2);
  font-weight: 500;
  background: var(--accent-soft);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }

/* --- Page header (with action button) --- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.page-header h1 { margin: 0; }

/* --- Filter bar --- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
}
.filters input[type="search"] { flex: 1 1 200px; padding: 0.45rem 0.7rem; }
.filters select { width: auto; padding: 0.45rem 0.7rem; }
.filters button { padding: 0.45rem 0.9rem; }

/* --- Single entry view (detail page) --- */
.entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem 2rem;
}
.entry header { margin-bottom: 1.5rem; }
.entry h1 { font-size: 1.7rem; margin: 0.4rem 0 0.4rem; }
.entry-meta-line { color: var(--muted); margin: 0.4rem 0 0; font-size: 0.88rem; }
.entry-body { font-size: 1rem; line-height: 1.7; color: var(--text); }
.entry-body h1, .entry-body h2, .entry-body h3 { margin-top: 1.5rem; }
.entry-body p { margin: 0 0 1rem; }
.entry-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.2rem 1rem;
  margin: 1rem 0;
  color: var(--muted);
  font-style: italic;
  background: var(--surface-2);
  border-radius: 0 var(--r) var(--r) 0;
}
.entry-body code { background: var(--surface-2); padding: 0.12em 0.35em; border-radius: 4px; }
.entry-body pre { background: var(--surface-2); padding: 0.85rem 1rem; border-radius: var(--r); overflow-x: auto; font-family: var(--mono); font-size: 0.88rem; border: 1px solid var(--border); }
.entry-body pre code { background: none; padding: 0; }
.entry-body img { max-width: 100%; border-radius: var(--r); margin: 0.4rem 0; }
.entry-body ul, .entry-body ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.entry-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.entry-actions {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}
.entry-actions .muted { margin-left: auto; font-size: 0.82rem; }

/* --- Entry form --- */
.entry-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.75rem;
}
.entry-form textarea {
  font-size: 1rem;
  line-height: 1.65;
  min-height: 14rem;
}
.entry-form .actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.75rem; }
.entry-form .markdown-help { margin-top: 1.5rem; font-size: 0.85rem; color: var(--muted); }

/* --- Settings cards --- */
.settings .card h2 { margin-top: 0; }

/* --- Activity log table --- */
table.activity { width: 100%; border-collapse: collapse; font-size: 0.85rem; background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
table.activity th, table.activity td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); }
table.activity tr:last-child td { border-bottom: none; }
table.activity th { color: var(--muted); font-weight: 500; background: var(--surface-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.activity .ua { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }

.pager { margin-top: 1rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; }

/* --- Delete confirm --- */
.confirm { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 1.75rem 2rem; box-shadow: var(--shadow-sm); }
.confirm .preview { margin: 1rem 0 1.5rem; padding: 1rem; background: var(--surface-2); border-radius: var(--r); border: 1px solid var(--border); }
.confirm .preview h2 { margin-top: 0.5rem; }
.confirm .actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 1rem; }

small.error { color: var(--danger); display: block; margin-top: 0.3rem; font-weight: 500; }
small.muted { color: var(--muted); font-weight: normal; }

/* --- Full-width cover band (above the content column) --- */
.cover-band {
  width: 100%;
  aspect-ratio: 3.5 / 1;
  max-height: 380px;
  background: linear-gradient(135deg, #c1d8f7 0%, #e7f0fb 50%, #f7d6c7 100%);
  overflow: hidden;
}
.cover-band .cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-band .cover-placeholder { width: 100%; height: 100%; }

/* --- Profile band: avatar overlaps cover on the LEFT, like Facebook --- */
.profile-band {
  width: 100%;
  padding: 0 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.profile-id-left {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  padding-bottom: 1rem;
  margin-top: -72px;            /* avatar pulled up over the cover band */
}
.profile-id-left .avatar-wrap {
  width: 144px;
  height: 144px;
  flex-shrink: 0;
}
.profile-id-left .profile-name { flex: 1; padding-bottom: 0.5rem; min-width: 0; }
.profile-id-left .profile-name h1 { margin: 0; font-size: 1.75rem; font-weight: 700; }
.profile-id-left .profile-name .bio { margin: 0.2rem 0 0; font-size: 0.95rem; }

@media (max-width: 600px) {
  .profile-id-left { gap: 0.75rem; margin-top: -56px; }
  .profile-id-left .avatar-wrap { width: 100px; height: 100px; }
  .profile-id-left .profile-name h1 { font-size: 1.35rem; }
}

/* --- Profile header card (avatar + name overlapping the cover band) --- */
.profile-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}
.profile-header.no-cover {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-top: -72px;            /* avatar overlaps the band above */
}
.profile-header.no-cover .profile-id {
  margin-top: 0;
  padding-bottom: 1rem;
}
.cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2.7 / 1;
  background: linear-gradient(135deg, #c1d8f7 0%, #e7f0fb 50%, #f7d6c7 100%);
  cursor: pointer;
  overflow: hidden;
}
.cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-placeholder { width: 100%; height: 100%; }
.cover-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.cover:hover .cover-overlay { opacity: 1; }
.cover .cam { font-size: 1rem; }
.cover-form { margin: 0; }
.avatar-form { margin: 0; }

.profile-id {
  position: relative;
  padding: 0 1.5rem 1.25rem;
  margin-top: -56px;       /* avatar overlaps cover */
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.avatar-wrap {
  flex-shrink: 0;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.avatar-wrap.static { cursor: default; }
.avatar-wrap.static .avatar-overlay { display: none; }
.avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.avatar-wrap:hover .avatar-overlay { opacity: 1; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-initial {
  width: 100%; height: 100%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 600;
  text-transform: uppercase;
  font-family: var(--serif);
}
.profile-name { flex: 1; padding-bottom: 0.5rem; }
.profile-name h1 { margin: 0; font-size: 1.6rem; font-weight: 700; }
.profile-name .bio { margin: 0.2rem 0 0; color: var(--text); font-size: 0.95rem; }
.profile-name .bio.muted { color: var(--muted); }
.edit-profile { align-self: flex-end; margin-bottom: 0.5rem; }

/* Header avatar (small, top bar) */
.header-avatar {
  width: 36px; height: 36px;
  padding: 0;
  overflow: hidden;
  border: none;
}
.header-avatar:hover { text-decoration: none; }
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Composer avatar that may contain image */
.composer .avatar.small img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.composer .avatar.small { overflow: hidden; padding: 0; }

/* Settings image previews */
.current-image { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.avatar-preview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.cover-preview { width: 100%; max-width: 480px; aspect-ratio: 3 / 1; object-fit: cover; border-radius: var(--r); border: 1px solid var(--border); }
.danger-link { color: var(--danger); }
.danger-link:hover { color: #b02a3a; text-decoration: underline; }

/* `hidden` attribute must always win, even over our own rules below. */
[hidden] { display: none !important; }

input[type="file"]:not([hidden]) {
  display: block;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
}

/* --- Library --- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.album-tile a { display: block; color: inherit; border: none; }
.album-tile a:hover { text-decoration: none; }
.album-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-cover-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem; }
.album-name { margin-top: 0.4rem; font-weight: 600; font-size: 0.95rem; }
.album-meta { margin-top: 0.1rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.photo-grid li a {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  border-radius: var(--r);
  overflow: hidden;
  position: relative;
  border: none;
}
.photo-grid li a:hover { opacity: 0.9; text-decoration: none; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid li.video-tile a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(135deg, #2a3e5a, #3b6cb6);
  color: #fff;
  font-size: 0.85rem;
  padding: 0.5rem;
}
.photo-grid .play { font-size: 2rem; }
.photo-grid .vname { margin-top: 0.25rem; text-align: center; }

.photo-frame { background: #000; border-radius: var(--r-card); overflow: hidden; margin-bottom: 1rem; }
.photo-frame img { width: 100%; max-height: 80vh; object-fit: contain; display: block; }
.video-frame { background: #000; border-radius: var(--r-card); overflow: hidden; margin-bottom: 1rem; }
.video-frame video { width: 100%; max-height: 80vh; display: block; }

/* --- Memory picker grid --- */
fieldset.picker { border: 1px solid var(--border); border-radius: var(--r); padding: 0.75rem 1rem 0.5rem; margin: 1rem 0; }
fieldset.picker legend { padding: 0 0.5rem; font-weight: 600; font-size: 0.9rem; }
.picker-grid li.pickable { cursor: pointer; position: relative; outline: 3px solid transparent; outline-offset: -3px; transition: outline-color 0.1s ease; }
.picker-grid li.pickable.selected { outline-color: var(--accent); }
.picker-grid li.pickable.selected::after {
  content: "✓";
  position: absolute;
  top: 4px; right: 4px;
  background: var(--accent);
  color: #fff;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.memory-thumb-row { display: flex; gap: 0.3rem; align-items: center; margin-top: 0.5rem; }
.memory-thumb-row img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--r); }
.memory-thumb-row .more { font-size: 0.85rem; color: var(--muted); font-weight: 600; padding: 0 0.5rem; }

/* --- Vision board --- */
.vision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.vision-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.vision-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: none; }
.vision-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vision-card-body { padding: 0.75rem 1rem; flex: 1; }
.vision-card-body h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.vision-card-actions { display: flex; gap: 0.6rem; align-items: center; padding: 0.4rem 1rem 0.6rem; border-top: 1px solid var(--border); font-size: 0.85rem; }
.vision-card-actions form { margin: 0; }

.vision-blue   { border-top: 4px solid #3b6cb6; }
.vision-amber  { border-top: 4px solid #d49a3a; }
.vision-rose   { border-top: 4px solid #c46c5b; }
.vision-green  { border-top: 4px solid #5a7d6a; }
.vision-violet { border-top: 4px solid #8261a6; }

.empty-row { margin: 0 0 1rem; }

/* --- Timeline / Search --- */
.header-search { display: inline-flex; margin: 0; }
.header-search input[type="search"] {
  width: 160px;
  padding: 0.35rem 0.7rem;
  font-size: 0.88rem;
  background: var(--surface-2);
  border-radius: 20px;
  border: 1px solid var(--border);
}
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item { margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 1rem 1.25rem; }
.t-meta { display: flex; gap: 0.6rem; align-items: center; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.4rem; }
.t-link { display: flex; gap: 0.8rem; color: inherit; border: none; }
.t-link:hover { text-decoration: none; }
.t-link:hover .t-title { color: var(--accent); }
.t-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: var(--r); flex-shrink: 0; }
.t-content { flex: 1; min-width: 0; }
.t-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.2rem; }
.t-excerpt { margin: 0; color: var(--text); font-size: 0.92rem; line-height: 1.5; }
.kind {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
.kind-diary    { background: #e7f0fb; color: #2f5694; }
.kind-quote    { background: #fdf3e0; color: #8e5a18; }
.kind-memory   { background: #f3e8d4; color: #7a5320; }
.kind-photo    { background: #e7f5ea; color: #2f6f3e; }
.kind-video    { background: #f0e7fb; color: #5a3a8a; }

/* --- Thoughts --- */
.thought-composer textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.7rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 4rem;
}
.thought-composer button { margin-top: 0.5rem; }
.thoughts { list-style: none; padding: 0; margin: 0; }
.thought { display: block; }
.thought-body { font-size: 1rem; line-height: 1.6; }
.thought-body p:last-child { margin-bottom: 0; }
.thought-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.thought-meta .actions { display: flex; gap: 0.85rem; align-items: center; }
.thought-meta .actions a { font-size: 0.85rem; }

/* --- Accent picker (settings) --- */
.accent-picker { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.accent-option { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.75rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; background: var(--surface); margin: 0; font-weight: 500; font-size: 0.88rem; color: var(--text); }
.accent-option input[type="radio"] { width: 0; height: 0; opacity: 0; position: absolute; }
.accent-option:has(input:checked) { border-color: var(--text); }
.accent-option .swatch { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.accent-blue   .swatch { background: #3b6cb6; }
.accent-amber  .swatch { background: #d49a3a; }
.accent-rose   .swatch { background: #c46c5b; }
.accent-green  .swatch { background: #5a7d6a; }
.accent-violet .swatch { background: #8261a6; }

/* --- Dashboard: section-card grid (launcher) --- */
.welcome { margin-bottom: 1.5rem; }
.welcome h1 { margin: 0 0 0.25rem; font-size: 1.8rem; font-weight: 700; }
.welcome p { margin: 0; }

.section-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.section-grid > li { display: block; }
.section-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  padding: 1.4rem 1.4rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.section-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.section-card .sec-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
}
.section-card .sec-name { font-size: 1.25rem; font-weight: 700; margin-top: 0.6rem; color: var(--text); }
.section-card .sec-meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }
.section-card .drag-handle {
  position: absolute;
  top: 0.6rem; right: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: -2px;
  opacity: 0;
  transition: opacity 0.15s ease;
  cursor: grab;
  user-select: none;
}
.section-card { position: relative; }
.section-card:hover .drag-handle { opacity: 0.6; }

.section-item { cursor: grab; }
.section-item.dragging { opacity: 0.4; }
.section-item.dragging .section-card { transform: none; }
.section-item.drop-target .section-card { outline: 2px dashed var(--accent); outline-offset: -2px; }

.sec-diary    { border-top-color: #3b6cb6; }
.sec-diary    .sec-icon { background: #e7f0fb; color: #2f5694; }
.sec-thoughts { border-top-color: #d49a3a; }
.sec-thoughts .sec-icon { background: #fdf3e0; color: #8e5a18; }
.sec-library  { border-top-color: #5a7d6a; }
.sec-library  .sec-icon { background: #ecf3ee; color: #2f6f3e; }
.sec-memories { border-top-color: #c46c5b; }
.sec-memories .sec-icon { background: #fbecea; color: #9c5347; }
.sec-vision   { border-top-color: #8261a6; }
.sec-vision   .sec-icon { background: #f0e7fb; color: #614779; }
.sec-timeline { border-top-color: #65676b; }
.sec-timeline .sec-icon { background: #eef0f3; color: #65676b; font-size: 1.4rem; }

/* --- Small screens --- */
@media (max-width: 600px) {
  main.page { padding: 1rem 0.6rem; }
  .nav a, .nav .link { padding: 0.45rem 0.6rem; font-size: 0.88rem; }
  .auth-card { padding: 1.5rem 1.25rem; }
  .entry { padding: 1.25rem 1.25rem; }
  .entry-form { padding: 1.25rem 1.25rem; }
}
