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

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:           #0d0d0f;
  --surface:      #16161a;
  --surface-hi:   #1c1c22;
  --border:       #2a2a35;
  --border-focus: #e8507a;
  --text:         #ebebef;
  --text-muted:   #8a8a9e;
  --text-subtle:  #505060;
  --accent:       #e8507a;
  --accent-h:     #f0678b;
  --accent-bg:    rgba(232,80,122,.12);
  --success:      #4cc38a;
  --success-bg:   rgba(76,195,138,.12);
  --warning:      #f5a623;
  --warning-bg:   rgba(245,166,35,.12);
  --danger:       #ef4444;
  --danger-bg:    rgba(239,68,68,.12);
  --radius:       8px;
  --radius-lg:    12px;
  --transition:   .15s ease;
  --shadow:       0 1px 3px rgba(0,0,0,.6);
  --shadow-lg:    0 4px 16px rgba(0,0,0,.5);
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }
::selection { background: var(--accent-bg); color: var(--accent-h); }

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

.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 32px 36px;
  overflow: auto;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
}
.brand:hover { opacity: .8; }
.brand-heart { font-size: 1.4rem; line-height: 1; }
.brand-name { font-size: 1.1rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }

.nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--surface-hi); color: var(--text); }
.nav-link.active { background: var(--accent-bg); color: var(--accent); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-name { font-size: .8rem; font-weight: 500; flex: 1; }
.logout-link { color: var(--text-subtle); font-size: .8rem; transition: color var(--transition); }
.logout-link:hover { color: var(--danger); }

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.page-subtitle { color: var(--text-muted); margin-top: 4px; font-size: .875rem; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-sm { padding: 14px 16px; }
.card-title { font-size: .875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }

/* ── Grid ───────────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.col-span-2 { grid-column: span 2; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.98); }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); color: #fff; opacity: 1; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); opacity: 1; }
.btn-ghost     { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-hi); color: var(--text); opacity: 1; }
.btn-danger    { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; opacity: 1; }
.btn-success   { background: var(--success-bg); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; opacity: 1; }

.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .8rem; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: .875rem;
  transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--border-focus); }
.form-control::placeholder { color: var(--text-subtle); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 500;
}
.badge-accent   { background: var(--accent-bg); color: var(--accent); }
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-danger   { background: var(--danger-bg); color: var(--danger); }
.badge-neutral  { background: var(--surface-hi); color: var(--text-muted); }

/* ── Flash ───────────────────────────────────────────────────────────────────── */
.flash {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 20px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(76,195,138,.2);
}
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,.2); }

/* ── Divider ─────────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.section-title {
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Login page ──────────────────────────────────────────────────────────────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-heart { font-size: 2.5rem; display: block; }
.login-title { font-size: 1.4rem; font-weight: 700; color: var(--text); margin-top: 8px; }
.login-sub { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }

/* ── Dashboard ───────────────────────────────────────────────────────────────── */
.ping-card {
  background: linear-gradient(135deg, var(--accent-bg), rgba(232,80,122,.04));
  border: 1px solid rgba(232,80,122,.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.ping-card-text h2 { font-size: 1.1rem; font-weight: 600; }
.ping-card-text p  { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.ping-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.ping-btn:hover { background: var(--accent-h); }
.ping-btn:active { transform: scale(.97); }

.stat-num   { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

.milestone-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.milestone-item:last-child { border-bottom: none; }
.milestone-date { font-size: .75rem; color: var(--text-muted); min-width: 80px; }
.milestone-name { flex: 1; font-size: .875rem; }
.milestone-days { font-size: .75rem; font-weight: 600; color: var(--accent); }
.milestone-past { opacity: .4; }

.ping-history { display: flex; flex-direction: column; gap: 8px; }
.ping-item { display: flex; align-items: center; gap: 10px; }
.ping-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.ping-meta { font-size: .8rem; color: var(--text-muted); }
.ping-name { color: var(--text); font-weight: 500; }

/* ── Wishlist ────────────────────────────────────────────────────────────────── */
.wishlist-section { margin-bottom: 32px; }
.wishlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }

.wish-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition);
}
.wish-card:hover { border-color: var(--border-focus); }
.wish-card.booked { opacity: .65; }

.wish-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-hi);
}
.wish-img-placeholder {
  width: 100%;
  height: 140px;
  background: var(--surface-hi);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-subtle);
}
.wish-title { font-size: .9rem; font-weight: 600; }
.wish-desc  { font-size: .8rem; color: var(--text-muted); }
.wish-price { font-size: .9rem; font-weight: 700; color: var(--accent); }
.wish-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; }

/* ── Events / Timeline ───────────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 16px; position: relative; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
  z-index: 1;
  margin-top: 10px;
}
.timeline-dot.upcoming { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.timeline-dot.past { border-color: var(--border); background: var(--surface-hi); color: var(--text-subtle); }

.timeline-content { flex: 1; padding: 10px 0 24px; }
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.event-card.upcoming { border-left: 3px solid var(--accent); }
.event-card.past { opacity: .7; }

.event-date { font-size: .75rem; color: var(--text-muted); margin-bottom: 6px; }
.event-title { font-size: .95rem; font-weight: 600; margin-bottom: 4px; }
.event-desc  { font-size: .8rem; color: var(--text-muted); }
.event-location { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.event-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .3s ease;
}

.checklist { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.checklist-item { display: flex; align-items: center; gap: 8px; }
.checklist-item label { font-size: .8rem; color: var(--text-muted); cursor: pointer; }
.checklist-item input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.checklist-item.done label { text-decoration: line-through; color: var(--text-subtle); }

/* ── Modal (for forms) ───────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 1rem; font-weight: 600; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Utilities ───────────────────────────────────────────────────────────────── */
.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; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: .8rem; }
.text-right  { text-align: right; }
.font-bold   { font-weight: 700; }
.hidden      { display: none; }

/* ── Color picker inline ─────────────────────────────────────────────────────── */
input[type=color].form-control { padding: 4px 8px; height: 40px; cursor: pointer; }

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ── Media backlog ───────────────────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition);
}
.media-card:hover { border-color: var(--border-focus); }
.media-card-header { display: flex; align-items: center; justify-content: space-between; }
.media-type-icon { font-size: 1.3rem; line-height: 1; }
.media-card-body { flex: 1; }
.media-title { font-size: .9rem; font-weight: 600; line-height: 1.35; }
.media-desc { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.media-rating { font-size: 1rem; color: var(--accent); letter-spacing: .05em; }
.media-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.media-meta { font-size: .72rem; color: var(--text-subtle); }
.rating-form { margin: 0; }
.rating-stars { display: flex; gap: 2px; }
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-subtle);
  padding: 2px;
  transition: color var(--transition), transform var(--transition);
  line-height: 1;
}
.star-btn:hover,
.rating-stars:hover .star-btn:hover ~ .star-btn { color: var(--text-subtle); }
.rating-stars .star-btn:hover,
.rating-stars:hover .star-btn { color: var(--accent); }

/* ── Advent calendar ─────────────────────────────────────────────────────────── */
.advent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}
.advent-cell { aspect-ratio: 1; }
.advent-door {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform var(--transition), border-color var(--transition);
  padding: 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.advent-door:hover { transform: scale(1.04); }
.advent-num {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: .68rem;
  font-weight: 800;
  opacity: .5;
}
.advent-empty {
  background: var(--surface);
  border: 2px dashed var(--border);
  color: var(--text-subtle);
}
.advent-empty:hover { border-color: var(--border-focus); }
.advent-plus { font-size: 1.4rem; color: var(--text-subtle); }
.advent-locked {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-muted);
}
.advent-lock { font-size: 1.3rem; }
.advent-reveal-date { font-size: .65rem; color: var(--text-subtle); }
.advent-open {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 20%, var(--surface)),
    color-mix(in srgb, #f472b6 15%, var(--surface)));
  border: 2px solid color-mix(in srgb, var(--accent) 35%, var(--border));
}
.advent-open:hover { border-color: var(--accent); }
.advent-emoji { font-size: 1.5rem; }
.advent-door-title {
  font-size: .62rem;
  font-weight: 600;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.advent-content {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--text-muted);
  white-space: pre-wrap;
  margin: 12px 0;
  padding: 12px;
  background: var(--surface-hover);
  border-radius: var(--radius);
}

/* ── Dreams ──────────────────────────────────────────────────────────────────── */
.dream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.dream-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition), transform var(--transition);
}
.dream-card:hover { border-color: var(--border-focus); transform: translateY(-2px); }
.dream-done { opacity: .65; }
.dream-card-top { display: flex; align-items: center; justify-content: space-between; }
.dream-emoji { font-size: 1.6rem; line-height: 1; }
.dream-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}
.dream-badge-dream   { background: color-mix(in srgb, #a78bfa 15%, transparent); color: #a78bfa; }
.dream-badge-planned { background: color-mix(in srgb, #60a5fa 15%, transparent); color: #60a5fa; }
.dream-badge-done    { background: color-mix(in srgb, #34d399 15%, transparent); color: #34d399; }
.dream-title { font-size: .9rem; font-weight: 700; line-height: 1.35; }
.dream-desc  { font-size: .78rem; color: var(--text-muted); flex: 1; line-height: 1.5; }
.dream-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
}
.dream-meta { font-size: .72rem; color: var(--text-subtle); }

/* ── Capsules ────────────────────────────────────────────────────────────────── */
.capsule-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-subtle);
  margin-bottom: 12px;
}
.capsule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.capsule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: border-color var(--transition);
}
.capsule-card:hover { border-color: var(--border-focus); }
.capsule-locked { border-style: dashed; }
.capsule-lock-icon { font-size: 1.8rem; line-height: 1; }
.capsule-title { font-size: .9rem; font-weight: 700; line-height: 1.3; }
.capsule-countdown {
  font-size: .8rem;
  color: var(--accent);
  font-weight: 600;
}
.capsule-meta { font-size: .72rem; color: var(--text-subtle); margin-top: auto; }
.capsule-delete {
  position: absolute;
  top: 10px;
  right: 10px;
}

.capsule-list { display: flex; flex-direction: column; gap: 14px; max-width: 680px; }
.capsule-open { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.capsule-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.capsule-body {
  font-size: .88rem;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-wrap;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── Quiz ────────────────────────────────────────────────────────────────────── */
.quiz-list { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.quiz-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--transition);
}
.quiz-row:hover { border-color: var(--border-focus); }
.quiz-question-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.quiz-question-text { font-size: .9rem; font-weight: 600; line-height: 1.4; }
.quiz-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quiz-answer-block { display: flex; flex-direction: column; gap: 8px; }
.quiz-answer-block-partner {
  border-left: 2px solid var(--border);
  padding-left: 14px;
}
.quiz-answer-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-subtle);
}
.quiz-answer-text {
  font-size: .88rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-hover);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.quiz-answer-partner { color: var(--accent); }
.quiz-answer-empty { font-size: .82rem; color: var(--text-subtle); font-style: italic; }
.quiz-answer-form,
.quiz-edit-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.quiz-edit-form { margin-top: 2px; }
.form-control-sm {
  padding: 5px 10px;
  font-size: .82rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  flex: 1;
  min-width: 0;
  transition: border-color var(--transition);
}
.form-control-sm:focus { outline: none; border-color: var(--border-focus); }
.btn-sm {
  padding: 5px 12px;
  font-size: .8rem;
  border-radius: var(--radius);
  white-space: nowrap;
}

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.spinner-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 20px;
  margin-bottom: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.spinner-wheel { font-size: 5rem; line-height: 1; animation: spin-idle 6s linear infinite; }
@keyframes spin-idle {
  0%   { transform: rotate(0deg);   }
  100% { transform: rotate(360deg); }
}
.spinner-idle-text { font-size: .9rem; color: var(--text-muted); max-width: 320px; }
.spinner-result-emoji { font-size: 4rem; line-height: 1; }
.spinner-result-label { font-size: .75rem; font-weight: 700; text-transform: uppercase;
                        letter-spacing: .1em; color: var(--accent); margin-top: 8px; }
.spinner-result-name  { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }
.btn-accent {
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  padding: 12px 32px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  font-weight: 700;
  letter-spacing: .03em;
}
.btn-accent:hover { opacity: .9; transform: scale(1.03); }
.spinner-btn { min-width: 180px; }
.spinner-empty-hint { font-size: .85rem; color: var(--text-muted); }

.spinner-list-title { font-size: .75rem; font-weight: 700; text-transform: uppercase;
                      letter-spacing: .08em; color: var(--text-subtle); margin-bottom: 10px; }
.spinner-list { display: flex; flex-direction: column; gap: 6px; max-width: 500px; }
.spinner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.spinner-item:hover { border-color: var(--border-focus); }
.spinner-item-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.spinner-item-emoji { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.spinner-item-name  { font-size: .88rem; }

/* ── Diary ───────────────────────────────────────────────────────────────────── */
.diary-feed { display: flex; flex-direction: column; gap: 16px; max-width: 680px; }
.diary-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition);
}
.diary-entry:hover { border-color: var(--border-focus); }
.diary-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.diary-author { display: flex; align-items: center; gap: 8px; }
.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.diary-author-name { font-size: .8rem; font-weight: 600; }
.diary-mood { font-size: 1.2rem; line-height: 1; }
.diary-date { font-size: .72rem; color: var(--text-subtle); }
.diary-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.diary-body { font-size: .88rem; line-height: 1.65; color: var(--text-muted); white-space: pre-wrap; }

/* Mood picker in modal */
.mood-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.mood-opt { cursor: pointer; }
.mood-opt input[type="radio"] { display: none; }
.mood-opt span {
  display: block;
  font-size: 1.5rem;
  padding: 4px 6px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: border-color var(--transition), background var(--transition);
  line-height: 1;
}
.mood-opt:hover span { background: var(--surface-hover); }
.mood-opt input[type="radio"]:checked + span {
  border-color: var(--accent);
  background: var(--surface-hover);
}

/* ── Places ──────────────────────────────────────────────────────────────────── */
.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.place-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition);
}
.place-card:hover { border-color: var(--border-focus); }
.place-card-header { display: flex; align-items: center; justify-content: space-between; }
.place-type-icon { font-size: 1.4rem; line-height: 1; }
.place-rating { font-size: .95rem; color: var(--accent); letter-spacing: .04em; }
.place-name { font-size: .9rem; font-weight: 600; line-height: 1.35; }
.place-notes { font-size: .78rem; color: var(--text-muted); flex: 1; }
.place-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.place-meta { font-size: .72rem; color: var(--text-subtle); }

/* Rating radio input in modal */
.rating-input { display: flex; gap: 8px; flex-wrap: wrap; }
.rating-opt { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.rating-opt input[type="radio"] { display: none; }
.rating-opt span {
  font-size: .9rem;
  color: var(--text-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  user-select: none;
}
.rating-opt input[type="radio"]:checked + span {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.rating-opt:hover span { border-color: var(--border-focus); }

/* ── Issues (Шуточная Jira) ──────────────────────────────────────────────────── */
.issue-tab {
  padding: 8px 14px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
  margin-bottom: -1px;
}
.issue-tab:hover { color: var(--text); }
.issue-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.issue-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: border-color var(--transition);
}
.issue-row:hover { border-color: var(--border-focus); }

/* ── Quotes (Цитатник) ───────────────────────────────────────────────────────── */
.quote-of-day {
  background: linear-gradient(135deg, rgba(232,80,122,.08), rgba(232,80,122,.02));
  border: 1px solid rgba(232,80,122,.3);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}
.quote-of-day-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 12px;
}
.quote-text-lg {
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
  border: none;
  padding: 0;
  margin: 0 0 10px;
}
.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.quote-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition);
}
.quote-card:hover { border-color: var(--border-focus); }
.quote-text {
  font-size: .9rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
  flex: 1;
}
.quote-author {
  font-size: .8rem;
  color: var(--accent);
  font-weight: 500;
}
.quote-meta {
  font-size: .72rem;
  color: var(--text-subtle);
}
.quote-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

/* ── Empty states ────────────────────────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted); text-align: center;
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-text { font-size: .875rem; }

/* ── Priority button ──────────────────────────────────────────────────────── */
.priority-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 4px 6px;
  transition: border-color .15s, transform .1s;
}
.priority-btn:hover { border-color: var(--border-focus); transform: scale(1.15); }

/* ── Emoji picker ─────────────────────────────────────────────────────────── */
.emoji-picker { position: relative; display: inline-block; }
.emoji-picker-btn {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 40px;
  background: var(--input-bg, var(--card-bg)); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; font-size: 1.4rem; transition: border-color .15s;
}
.emoji-picker-btn:hover { border-color: var(--border-focus); }
.emoji-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: var(--surface-hi); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.5); width: 240px;
}
.emoji-dropdown.open { display: block; }
.emoji-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.emoji-opt {
  background: none; border: none; border-radius: 6px; cursor: pointer;
  font-size: 1.3rem; line-height: 1; padding: 5px; text-align: center;
  transition: background .1s;
}
.emoji-opt:hover { background: var(--hover-bg, rgba(255,255,255,.08)); }

/* ── Form hint ────────────────────────────────────────────────────────────── */
.form-hint { font-size: .75rem; color: var(--text-subtle, var(--text-muted)); margin-top: 4px; }

/* ── Settings page ────────────────────────────────────────────────────────── */
.flash-success {
  background: rgba(34,197,94,.12); color: #22c55e;
  border: 1px solid rgba(34,197,94,.25); border-radius: 8px;
  padding: 10px 16px; margin-bottom: 16px; font-size: .875rem;
}
.form-stack { display: flex; flex-direction: column; gap: 16px; padding: 20px; }

/* ── Stats grid (dashboard) ───────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 640px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 12px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: inherit;
  transition: border-color .15s, transform .1s;
}
.stat-card:hover { border-color: var(--border-focus); transform: translateY(-1px); }
.stat-icon  { font-size: 1.4rem; line-height: 1; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat-label { font-size: .7rem; color: var(--text-muted); text-align: center; }

/* ── Sidebar section labels ───────────────────────────────────────────────── */
.nav-section {
  font-size: .6rem; font-weight: 700; letter-spacing: .08em;
  color: var(--text-subtle, var(--text-muted)); opacity: .5;
  padding: 14px 12px 4px; text-transform: uppercase;
}
.nav-settings {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* ── Dream "→ В планы" button ─────────────────────────────────────────────── */
.dream-plan-btn {
  display: block; margin: 6px 0 4px;
  font-size: .75rem; padding: 4px 10px;
  width: fit-content;
}

/* ── Activity feed ────────────────────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 2px; }
.activity-item {
  display: grid;
  grid-template-columns: 28px 1fr auto 12px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
  position: relative;
}
.activity-item:hover { background: var(--surface-hi); }
.activity-item-new { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.activity-icon { font-size: 1rem; text-align: center; }
.activity-body { font-size: .82rem; line-height: 1.4; }
.activity-actor { font-weight: 600; }
.activity-body em { font-style: normal; color: var(--text-muted); }
.activity-time { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.activity-new-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

/* ── Author chips (quotes) ────────────────────────────────────────────────── */
.author-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.author-chip { display: flex; }
.author-chip input[type=radio] { display: none; }
.author-chip span {
  display: inline-block; padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border); cursor: pointer; font-size: .875rem;
  transition: background .12s, border-color .12s;
}
.author-chip input[type=radio]:checked + span {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.author-chip span:hover { border-color: var(--border-focus); }


.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}