﻿/* =============================================================
   ADVENTURELOG — app.css
   Layout: sidebar shell. Variables come from themes.css.
   ============================================================= */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
[x-cloak] { display: none !important; }
button { font-family: inherit; }

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

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w, 240px);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: visible;
  z-index: 200;
  transition: width .22s ease;
}
/* Collapsed sidebar — icons only */
.sidebar.collapsed {
  width: 56px;
  overflow: visible;
}
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-link span:not(.sidebar-link-badge),
.sidebar.collapsed .sidebar-link-badge {
  display: none;
}
.sidebar.collapsed .sidebar-logo {
  padding: 1.1rem .6rem;
  justify-content: center;
  gap: 0;
  flex-direction: column;
}
.sidebar.collapsed .sidebar-nav {
  padding: .5rem .35rem;
}
.sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: .65rem 0;
  gap: 0;
  position: relative;
}
.sidebar.collapsed .sidebar-user {
  justify-content: center;
  gap: 0;
}
/* Tooltip on hover when collapsed */
.sidebar.collapsed .sidebar-link::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
  font-size: .75rem;
  white-space: nowrap;
  padding: .3rem .6rem;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 999;
}
.sidebar.collapsed .sidebar-link:hover::after {
  opacity: 1;
}
/* Collapse toggle button */
.sidebar-collapse-btn {
  width: 24px; height: 24px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-sidebar);
  transition: background .15s, color .15s, transform .22s ease;
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar-collapse-btn:hover {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
  border-color: rgba(255,255,255,.2);
}
.sidebar.collapsed .sidebar-collapse-btn {
  transform: rotate(180deg);
  margin-left: 0;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: relative;
}
.sidebar-logo svg {
  width: 28px; height: 28px;
  flex-shrink: 0;
  color: var(--primary);
}
.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.al-brand {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-style: italic !important;
  font-size: 1.05rem !important;
  font-weight: 400 !important;
  color: var(--text-sidebar-active) !important;
  line-height: 1.2;
  white-space: nowrap;
}
.sidebar-logo-sub {
  font-size: .7rem;
  color: var(--text-sidebar);
  opacity: .8;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: .75rem .75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-sidebar);
  opacity: .5;
  padding: .9rem .5rem .3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm, 6px);
  color: var(--text-sidebar);
  font-size: .875rem;
  font-weight: 500;
  transition: background .12s, color .12s;
  text-decoration: none;
  position: relative;
}
.sidebar-link svg { flex-shrink: 0; opacity: .8; }
.sidebar-link:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
  text-decoration: none;
}
.sidebar-link:hover svg { opacity: 1; }
.sidebar-link.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
}
.sidebar-link.active svg { opacity: 1; }

.sidebar-link-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 5px;
  min-width: 16px;
  text-align: center;
  line-height: 16px;
  height: 16px;
}

/* Footer / user */
.sidebar-footer {
  padding: .75rem .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-user-name {
  font-size: .825rem;
  font-weight: 600;
  color: var(--text-sidebar-active);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-handle {
  font-size: .7rem;
  color: var(--text-sidebar);
  opacity: .7;
}

/* ── Main content ──────────────────────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w, 240px);
  transition: margin-left .22s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* Inner content padding */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.75rem 0;
  gap: 1rem;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.page-title small {
  display: block;
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: .15rem;
}
.page-content {
  padding: 1.25rem 1.75rem 2rem;
  flex: 1;
}

/* ── Avatars ───────────────────────────────────────────────── */
.avatar-sm  { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-xs  { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--primary-text, #fff);
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar-placeholder.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-placeholder.avatar-xs { width: 24px; height: 24px; font-size: .65rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius, 10px);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-text, #fff);
}
.btn-primary:hover { background: var(--primary-dark); color: var(--primary-text, #fff); }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg-subtle); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  padding-left: .5rem;
  padding-right: .5rem;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-subtle); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }

.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-xs { padding: .2rem .5rem; font-size: .75rem; }
.btn-full { width: 100%; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

.btn-google {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}
.btn-google:hover { background: var(--bg-subtle); }

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .875rem 1.125rem;
  border-bottom: 1px solid var(--border);
}
.card-title {
  flex: 1;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.card-title svg { color: var(--text-muted); }
.card-body { padding: 1rem 1.125rem; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-muted { background: var(--bg-subtle); color: var(--text-muted); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

/* ── Utilities ─────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: .875rem; }
.text-xs    { font-size: .75rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius, 10px);
  font-size: .875rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: var(--danger); }
.alert-success { background: var(--success-light); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: var(--warning); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .35rem;
  color: var(--text);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-row.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.25rem; }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=url], input[type=search],
select, textarea {
  width: 100%;
  padding: .55rem .75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  color: var(--text);
  font-size: .875rem;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 249,115,22), .12);
}
textarea { resize: vertical; min-height: 80px; }
.input-group { display: flex; gap: .5rem; }
.input-group input { flex: 1; }

/* ── Confirm banner ────────────────────────────────────────── */
.confirm-banner {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  background: var(--warning-light);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: .875rem 1rem;
}
.confirm-banner svg { color: var(--warning); flex-shrink: 0; }
.confirm-banner-text { flex: 1; }
.confirm-banner-title { font-weight: 600; font-size: .875rem; color: var(--text); }
.confirm-banner-sub   { font-size: .8rem; color: var(--text-muted); }

/* ── Dashboard stats ───────────────────────────────────────── */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .875rem;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: .875rem;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-value small { font-size: .875rem; font-weight: 400; color: var(--text-muted); }
.stat-label { font-size: .75rem; color: var(--text-muted); }

/* ── Dashboard grid ────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: .875rem;
  align-items: start;
}
.dashboard-aside { display: flex; flex-direction: column; gap: .875rem; }

/* ── Event list ────────────────────────────────────────────── */
.event-list { list-style: none; }
.event-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .625rem 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
}
.event-item:last-child { border-bottom: none; }
.event-dot-wrap { padding-top: 4px; }
.event-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.event-body { flex: 1; min-width: 0; }
.event-title-link {
  display: block;
  font-weight: 500;
  font-size: .875rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-title-link:hover { color: var(--primary); text-decoration: none; }
.event-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

/* ── Friend items ──────────────────────────────────────────── */
.friend-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
}
.friend-item:last-child { border-bottom: none; }
.friend-info { flex: 1; min-width: 0; }
.friend-name {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Auth pages ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.75rem;
}
.auth-logo svg { color: var(--primary); }
.auth-logo-name { font-size: 1.1rem; font-weight: 700; }
.auth-title    { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.auth-subtitle { font-size: .875rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.auth-footer   { text-align: center; font-size: .875rem; color: var(--text-muted); margin-top: 1.25rem; }
.divider { position: relative; text-align: center; margin: 1.25rem 0; }
.divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.divider span {
  position: relative;
  background: var(--bg-elevated);
  padding: 0 .875rem;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg, 16px);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.05rem; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: .25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}
.modal-close:hover { background: var(--bg-subtle); color: var(--text); }
.modal-body   { padding: 1.125rem 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

/* ── Calendar ──────────────────────────────────────────────── */
.calendar-layout {
  display: flex;
  gap: 1rem;
  height: calc(100vh - 120px);
}
.calendar-sidebar-filters {
  width: 220px;
  flex-shrink: 0;
  overflow-y: auto;
}
.calendar-main { flex: 1; min-width: 0; }
#calendar { height: 100%; }
.filter-section { margin-bottom: 1rem; }
.filter-section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
  color: var(--text);
  transition: background .1s;
}
.filter-item:hover { background: var(--bg-subtle); }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* FullCalendar overrides */
.fc .fc-toolbar-title { font-size: 1rem !important; font-weight: 600 !important; }
.fc .fc-button { font-size: .8rem !important; }
.fc .fc-daygrid-event { border-radius: 4px !important; font-size: .8rem !important; }

/* ── Diary ─────────────────────────────────────────────────── */
.diary-layout  { display: flex; gap: 1.25rem; align-items: flex-start; }
.diary-sidebar { width: 260px; flex-shrink: 0; position: sticky; top: 1.5rem; }
.diary-main    { flex: 1; min-width: 0; }

.timeline-entry {
  display: flex;
  gap: 1rem;
  margin-bottom: .875rem;
  position: relative;
}
.timeline-marker {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.timeline-card {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  box-shadow: var(--shadow-sm);
}
.timeline-date  { font-size: .75rem; color: var(--text-muted); margin-bottom: .25rem; }
.timeline-title { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }
.timeline-title a { color: var(--text); }
.timeline-title a:hover { color: var(--primary); }
.timeline-location { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: .25rem; }
.gpx-stats { display: flex; gap: 1rem; font-size: .8rem; margin: .5rem 0; flex-wrap: wrap; }
.diary-note { background: var(--bg-subtle); border-radius: var(--radius-sm); padding: .65rem .875rem; font-size: .875rem; }
.mood-picker { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.mood-btn {
  padding: .3rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  cursor: pointer;
  font-size: .85rem;
  transition: background .1s;
}
.mood-btn:hover, .mood-btn.selected { background: var(--primary-light); border-color: var(--primary); }
.note-form { margin-top: .75rem; padding: .875rem; background: var(--bg-subtle); border-radius: var(--radius-sm); }

.cat-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  font-size: .875rem;
}
.cat-stat:last-child { border-bottom: none; }
.cat-stat-vals { font-size: .75rem; color: var(--text-muted); }
.companion { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; font-size: .875rem; }

/* ── Planning ──────────────────────────────────────────────── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .875rem;
}
.plan-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.125rem;
  color: var(--text);
  transition: box-shadow .15s, transform .15s;
  text-decoration: none;
}
.plan-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.plan-status { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }
.status-draft     { color: var(--text-muted); }
.status-active    { color: var(--primary); }
.status-completed { color: var(--success); }
.status-cancelled { color: var(--danger); }
.plan-title { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.plan-dest, .plan-dates { font-size: .8rem; color: var(--text-muted); }
.plan-meta { display: flex; justify-content: space-between; margin-top: .75rem; font-size: .75rem; color: var(--text-muted); }
.budget-bar { height: 5px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; margin-top: .75rem; }
.budget-fill { height: 100%; border-radius: 999px; background: var(--success); transition: width .3s; }

/* Plan detail */
.tab-nav { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1rem; gap: .25rem; }
.tab-nav button {
  background: none;
  border: none;
  cursor: pointer;
  padding: .6rem 1rem;
  font-size: .875rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab-nav button:hover, .tab-nav button.active { color: var(--primary); border-bottom-color: var(--primary); }
.day-block { margin-bottom: 1.5rem; }
.day-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.day-header h3 { font-size: .95rem; font-weight: 600; }
.plan-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: .4rem;
  background: var(--bg-subtle);
  font-size: .875rem;
}
.item-details { flex: 1; }
.item-time { font-size: .75rem; color: var(--text-muted); margin-right: .5rem; }
.item-desc { font-size: .75rem; color: var(--text-muted); }
.item-cost { font-weight: 600; color: var(--primary); white-space: nowrap; }

/* Budget */
.budget-overview { margin-bottom: 1.25rem; }
.budget-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.budget-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.budget-table th, .budget-table td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.budget-table th { background: var(--bg-subtle); font-weight: 600; font-size: .8rem; }
.budget-total td { font-weight: 600; background: var(--bg-subtle); }

/* Packing */
.packing-item { display: flex; align-items: center; gap: .5rem; padding: .4rem; border-radius: var(--radius-sm); font-size: .875rem; }
.packing-item.packed { text-decoration: line-through; color: var(--text-muted); }
.pack-toggle { background: none; border: none; cursor: pointer; }

/* ── Friends page ──────────────────────────────────────────── */
.friends-layout { max-width: 640px; }
.user-list { list-style: none; }
.user-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
}
.user-item:last-child { border-bottom: none; }
.user-info { flex: 1; }
.user-info strong { display: block; font-size: .875rem; }
.user-info .muted { font-size: .75rem; color: var(--text-muted); }

/* ── Event detail ──────────────────────────────────────────── */
.event-detail { max-width: 800px; }
.event-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.tag {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .75rem;
  color: var(--text-muted);
}
.participant-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--bg-subtle);
  border-radius: 999px;
  padding: .2rem .6rem;
  font-size: .8rem;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-going, .status-attended { background: var(--success); }
.status-maybe   { background: var(--warning); }
.status-declined { background: var(--danger); }
.status-invited { background: var(--text-muted); }

/* ── Chat ──────────────────────────────────────────────────── */
.chat-messages { display: flex; flex-direction: column; gap: .75rem; max-height: 380px; overflow-y: auto; margin-bottom: 1rem; }
.chat-msg { display: flex; flex-direction: column; gap: .2rem; max-width: 75%; }
.chat-msg.own { align-self: flex-end; }
.chat-meta { font-size: .7rem; color: var(--text-muted); }
.chat-bubble { background: var(--bg-subtle); border-radius: 12px; padding: .55rem .875rem; font-size: .875rem; line-height: 1.5; }
.chat-msg.own .chat-bubble { background: var(--primary); color: var(--primary-text, #fff); }
.chat-input-row { display: flex; gap: .75rem; }
.chat-input-row textarea { flex: 1; resize: none; min-height: 60px; }

/* ── Availability poll ─────────────────────────────────────── */
.availability-summary { padding: 1rem; background: var(--bg-subtle); border-radius: var(--radius); }

/* ── Empty states ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: .875rem;
}
.empty-state svg { margin: 0 auto .75rem; opacity: .3; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; }

/* ── Theme switcher ────────────────────────────────────────── */
.theme-swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.theme-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s;
}
.theme-swatch:hover, .theme-swatch.active { transform: scale(1.15); border-color: var(--text); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s;
    z-index: 300;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .page-header  { padding: 1rem 1rem 0; }
  .page-content { padding: 1rem 1rem 1.5rem; }
  .diary-layout { flex-direction: column; }
  .diary-sidebar { width: 100%; position: static; }
  .calendar-layout { flex-direction: column; height: auto; }
  .calendar-sidebar-filters { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── Auth container alias ──────────────────────────────────── */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem 1rem;
}

/* ── Link helpers ──────────────────────────────────────────── */
.link-muted { color: var(--text-muted); font-size: .8rem; }

/* ── Form inline ───────────────────────────────────────────── */
.form-group-inline {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  margin-bottom: .75rem;
}
.form-group-inline label { font-weight: normal; }

/* ── Participants ──────────────────────────────────────────── */
.participants { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
.rsvp-row { display: flex; align-items: center; gap: .75rem; margin-top: .875rem; flex-wrap: wrap; }


/* ═══════════════════════════════════════════════════
   CUSTOM DOT CALENDAR
   ═══════════════════════════════════════════════════ */

/* Page layout */
/*
  Layout:
    closed: [cal-main flex:1] [friends 260px]
    open:   [cal-main 360px]  [event-panel flex:1]   (friends hidden)
*/
.cal-outer {
  display: flex;
  gap: 1rem;
  height: calc(100vh - 82px);
  overflow: hidden;
}

/* Main calendar area */
.cal-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: flex-basis .3s ease;
}
.cal-outer.panel-open .cal-column {
  flex: 1;
  min-width: 0;
}

/* Friends aside — right side, hidden (display:none) when panel open */
.cal-friends-aside {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  overflow-y: auto;
}
.cal-outer.panel-open .cal-friends-aside {
  display: none;
}

/* Slide-in event panel — hidden completely until panel open */
.cal-event-panel {
  display: none;
  flex: 0 0 340px;
  width: 340px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  flex-direction: column;
  overflow: hidden;
}
.cal-outer.panel-open .cal-event-panel {
  display: flex;
  animation: panelSlideIn .22s ease;
}
@keyframes panelSlideIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
.cal-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border);
  gap: .75rem;
}
.cal-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}
.cal-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: .2rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.cal-panel-close:hover { background: var(--bg-subtle); color: var(--text); }
.cal-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.cal-panel-meta-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.cal-panel-meta-row svg { flex-shrink: 0; color: var(--text-muted); }
.cal-panel-desc {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
}
.cal-panel-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .5rem;
}

.recurring-scope-banner {
  background: rgba(201,168,76,.08);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .82rem;
  color: var(--text-muted);
}
.recurring-scope-btns {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
}

.cal-layout {
  display: flex;
  gap: 1rem;
  height: calc(100vh - 82px);
  overflow: hidden;
}

/* ── Main calendar area ── */
.cal-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* Category chips row */
.cal-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.cal-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .6rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 500;
  transition: opacity .12s;
  background: var(--bg-elevated);
  color: var(--text);
  user-select: none;
}
.cal-cat-chip:not(.active) { opacity: .45; }
.cal-cat-chip.active { opacity: 1; }
.cal-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Calendar card */
.cal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Month nav */
.cal-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .875rem;
}
.cal-nav-title {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.cal-nav-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
  flex-shrink: 0;
}
.cal-nav-btn:hover { background: var(--border); }

/* Weekday header */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: .375rem;
}
.cal-wd {
  text-align: center;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .2rem 0;
}

/* Day grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;        /* zero gap so bars are seamless */
  flex: 1;
}
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .35rem 0 .3rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  min-height: 72px;
  border: 1.5px solid transparent;
  transition: background .08s, border-color .08s;
  position: relative;
  overflow: visible; /* bars bleed into neighbours */
}
.cal-day:hover { background: var(--bg-subtle); }

.cal-day-num {
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}
.cal-day.today .cal-day-num {
  background: var(--primary);
  color: var(--primary-text, #fff);
  font-weight: 700;
}
.cal-day.other-month { opacity: .3; cursor: default; }
.cal-day.other-month .cal-day-num { color: var(--text-muted); }

/* Drag selection */
.cal-day.in-range {
  background: var(--primary-light);
}
.cal-day.range-edge {
  background: var(--primary);
  border-color: var(--primary-dark);
}
.cal-day.range-edge .cal-day-num {
  color: var(--primary-text, #fff);
  font-weight: 700;
}

/* Single-day dots */
.cal-dots {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 3px;
  min-height: 7px;
}
.cal-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* Friend events — outline style vs filled own events */
.cal-dot--friend { width: 7px; height: 7px; }
.cal-bar--friend { box-shadow: none !important; }
.cal-bar--friend .cal-bar-label { opacity: .9; }
.cwg-ev.cwg-ev--friend .cwg-ev-title { color: inherit; }
.cwg-ev.cwg-ev--friend .cwg-ev-time  { color: inherit; opacity: .75; }
.cwg-ev.cwg-ev--friend .cwg-ev-who   { color: inherit; opacity: .65; }

/* ── Multi-day event bars ────────────────────────────────── */
.cal-bar {
  position: relative;
  height: 13px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  opacity: .92;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 2;
  border-radius: 0;
  width: 100%;
  box-shadow: -2px 0 0 0 var(--bar-bg), 2px 0 0 0 var(--bar-bg);
}
.cal-bar:hover { opacity: 1; filter: brightness(1.1); }

.cal-bar--start {
  width: 50%;
  margin-left: 50%;
  border-radius: 99px 0 0 99px;
  box-shadow: 2px 0 0 0 var(--bar-bg);
}
.cal-bar--end {
  width: 100%;
  margin-left: 0;
  border-radius: 0 99px 99px 0;
  box-shadow: -2px 0 0 0 var(--bar-bg);
}
.cal-bar--mid {
  border-radius: 0;
  width: 100%;
  box-shadow: -2px 0 0 0 var(--bar-bg), 2px 0 0 0 var(--bar-bg);
}
.cal-bar--single {
  width: 80%;
  margin-left: 10%;
  border-radius: 99px;
  box-shadow: none;
}
.cal-bar-label {
  position: absolute;
  left: 5px;
  font-size: .6rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
}

/* ── View switcher ──────────────────────────────────────── */
.cal-view-switcher {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.cal-view-switcher button {
  padding: .3rem .85rem;
  font-size: .78rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  line-height: 1.4;
}
.cal-view-switcher button:first-child { border-right: 1px solid var(--border); }
.cal-view-switcher button.active {
  background: var(--primary);
  color: var(--primary-text, #fff);
}
.cal-view-switcher button:not(.active):hover { background: var(--bg-subtle); color: var(--text); }

/* ── Week view ──────────────────────────────────────────── */
.cwg-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 480px;
  overflow: hidden;
}

/* Header: corner + 7 day cols */
.cwg-head {
  display: grid;
  grid-template-columns: var(--cwg-axis-w, 54px) repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
  z-index: 10;
}
.cwg-corner {
  border-right: 1px solid var(--border);
}
.cwg-head-day {
  text-align: center;
  padding: .4rem .2rem .3rem;
  border-left: 1px solid var(--border);
  cursor: pointer;
}
.cwg-head-dow {
  display: block;
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  font-weight: 500;
}
.cwg-head-num {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.4;
  color: var(--text);
  width: 34px;
  height: 34px;
  line-height: 34px;
  border-radius: 50%;
}
.cwg-head-day.today .cwg-head-num {
  background: var(--primary);
  color: var(--primary-text, #fff);
  font-weight: 700;
  font-size: 1rem;
}

/* All-day row */
.cwg-allday-row {
  display: grid;
  grid-template-columns: var(--cwg-axis-w, 54px) 1fr;
  border-bottom: 2px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
  min-height: 28px;
}
.cwg-allday-lbl {
  font-size: .58rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 3px 6px 3px 0;
  border-right: 1px solid var(--border);
}
.cwg-allday-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cwg-allday-cell {
  border-left: 1px solid var(--border);
  padding: 2px 1px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 24px;
}
.cwg-abar {
  height: 13px;
  font-size: .6rem;
  font-weight: 600;
  color: #fff;
  padding: 0 5px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: opacity .1s;
}
.cwg-abar:hover { opacity: .85; }
.cwg-abar--start  { border-radius: 99px 0 0 99px; }
.cwg-abar--end    { border-radius: 0 99px 99px 0; }
.cwg-abar--single { border-radius: 99px; }

/* Scrollable body */
.cwg-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
/* Total height = 24 hours × 56px */
.cwg-body-inner {
  display: flex;
  height: calc(24 * 56px);
  min-height: calc(24 * 56px);
}

/* Time axis */
.cwg-time-axis {
  width: var(--cwg-axis-w, 54px);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  left: 0;
  z-index: 5;
}
/* Each label sits at the TOP of its 56px slot, aligned with the hour line */
.cwg-hour-lbl {
  height: 56px;
  box-sizing: border-box;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 3px 6px 0;
  font-size: .6rem;
  color: var(--text-muted);
}
/* The actual line is a pseudo-element at the very top of the slot */
.cwg-hour-lbl::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
/* Hide label text (not the line) for midnight so the top edge is clean */
.cwg-hour-lbl:first-child span { visibility: hidden; }

/* Days area — 7 columns side by side */
.cwg-days-area {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  position: relative;
  /* Horizontal hour lines via repeating gradient */
  background-image: repeating-linear-gradient(
    to bottom,
    var(--border) 0, var(--border) 1px,
    transparent 1px, transparent 56px
  );
}
.cwg-day-col {
  position: relative;
  border-left: 1px solid var(--border);
  cursor: pointer;
  transition: background .08s;
}
.cwg-day-col:hover { background: rgba(0,0,0,.012); }
.cwg-day-col.today { background: rgba(var(--primary-rgb, 201,168,76), .03); }

/* Event block */
.cwg-ev {
  position: absolute;
  border-radius: 4px;
  padding: 3px 5px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: filter .1s, box-shadow .1s;
  z-index: 2;
  border-left: 3px solid rgba(0,0,0,.18);
  box-sizing: border-box;
  min-height: 18px;
}
.cwg-ev:hover {
  filter: brightness(1.08);
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
  z-index: 10;
}
.cwg-ev-title {
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cwg-ev-time {
  font-size: .62rem;
  color: rgba(255,255,255,.85);
  line-height: 1.2;
}
.cwg-ev-who {
  font-size: .6rem;
  color: rgba(255,255,255,.72);
  line-height: 1.2;
  font-style: italic;
}

/* Week drag-to-create preview */
.cwg-drag-preview {
  position: absolute;
  left: 2px; right: 2px;
  background: rgba(var(--primary-rgb, 201,168,76), .18);
  border: 1.5px solid var(--primary);
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
}

/* Current time line */
.cwg-now-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: #dc2626;
  z-index: 20;
  pointer-events: none;
}
.cwg-now-dot {
  position: absolute;
  left: -5px; top: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #dc2626;
}

/* ── Right panel: friends ── */
.cal-friends-panel {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  overflow-y: auto;
  flex-shrink: 0;
}
.cal-friend-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  cursor: pointer;
  transition: opacity .1s;
}
.cal-friend-row:last-child { border-bottom: none; }
.cal-friend-row:not(.active) { opacity: .5; }
.cal-friend-check {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .1s;
  margin-left: auto;
}
.cal-friend-row.active .cal-friend-check {
  background: var(--primary);
  border-color: var(--primary);
}
.cal-friend-name {
  font-size: .825rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-friend-events-count {
  font-size: .7rem;
  color: var(--text-muted);
}

/* ── Selected day strip ── */
.cal-selected-strip {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .8rem;
}
.cal-selected-ev {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem 0;
  color: var(--text);
  font-size: .8rem;
}
.cal-selected-ev-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════
   PLANNING — map cards + timeline tree
   ═══════════════════════════════════════════════════ */

/* Plan map grid */
.plan-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* Plan map card */
.plan-map-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, transform .15s;
  cursor: pointer;
}
.plan-map-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }

.plan-card-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.plan-card-header { padding: 1rem 1.125rem .75rem; }
.plan-card-status { margin-bottom: .4rem; }
.plan-title { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; line-height: 1.3; }
.plan-dest {
  display: flex; align-items: center; gap: .3rem;
  font-size: .8rem; color: var(--text-muted);
}
.plan-dest svg { flex-shrink: 0; }
.plan-card-body { padding: 0 1.125rem .75rem; flex: 1; }
.plan-card-meta-row { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .76rem; color: var(--text-muted); margin-bottom: .5rem; }
.plan-card-meta-row span { display: flex; align-items: center; gap: .25rem; }
.plan-progress-bar {
  height: 5px; background: var(--bg-subtle);
  border-radius: 999px; overflow: hidden; margin-top: .5rem;
}
.plan-progress-fill {
  height: 100%; border-radius: 999px;
  background: var(--success); transition: width .3s;
}
.plan-card-footer {
  padding: .75rem 1.125rem;
  border-top: 1px solid var(--border-subtle, var(--border));
  display: flex; align-items: center; gap: .35rem;
}
.plan-members { display: flex; gap: -4px; }
.plan-members .avatar-xs { border: 2px solid var(--bg-elevated); margin-left: -4px; }
.plan-members .avatar-xs:first-child { margin-left: 0; }

/* Badge accent for active plans */
.badge-accent { background: var(--accent-light); color: var(--accent); }

/* ── Plan detail ── */
.plan-detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  align-items: start;
}
.plan-detail-main { min-width: 0; }
.plan-detail-sidebar { display: flex; flex-direction: column; gap: 1rem; }

/* Plan header bar */
.plan-detail-bar {
  display: flex; align-items: flex-start; gap: 1rem;
  margin-bottom: 1.25rem;
}
.plan-detail-bar-info { flex: 1; min-width: 0; }
.plan-detail-bar-info h1 { font-size: 1.35rem; font-weight: 700; margin-bottom: .25rem; }
.plan-detail-meta { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .8rem; color: var(--text-muted); align-items: center; }

/* ── Timeline tree ── */
.timeline-tree { position: relative; }

/* Day wrapper: main content + accommodation bar side by side */
.tl-day-wrap {
  display: flex;
  align-items: stretch;
  margin-bottom: 1.75rem;
  gap: 0;
}

/* Day block */
.tl-day {
  flex: 1;
  min-width: 0;
}

/* ── Accommodation gutter — new design ── */
.tl-acc-gutter {
  width: 168px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  margin-left: .875rem;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  position: relative;
}
.tl-acc-gutter--empty {
  width: 168px;
  margin-left: .875rem;
  border-left: 1px solid var(--border);
}
/* Individual accommodation lane */
.acc-seg {
  flex: 1;
  min-height: 36px;
  position: relative;
  border-left: 2px solid var(--acc-color, var(--primary));
  padding: 5px 24px 5px 10px;
  font-size: .72rem;
  color: var(--acc-color, var(--primary));
}
.acc-seg--start {
  border-top: 2px solid var(--acc-color);
  border-radius: 5px 0 0 0;
  padding-top: 6px;
}
.acc-seg--end {
  border-bottom: 2px solid var(--acc-color);
  border-radius: 0 0 0 5px;
  padding-bottom: 6px;
}
.acc-seg--single {
  border-top: 2px solid var(--acc-color);
  border-bottom: 2px solid var(--acc-color);
  border-radius: 5px 0 0 5px;
}
.acc-seg-top {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-weight: 700;
  line-height: 1.3;
}
.acc-seg-bracket {
  font-family: monospace;
  font-size: .82rem;
  line-height: 1;
  flex-shrink: 0;
}
.acc-seg-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--acc-color);
  flex: 1;
  min-width: 0;
}
.acc-seg-detail {
  font-size: .65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  padding-left: 1.2em;
}
.acc-seg-nights {
  font-size: .65rem;
  color: var(--acc-color);
  opacity: .8;
  margin-top: 1px;
  padding-left: 1.2em;
}
.acc-seg-bottom {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: auto;
  padding-top: 2px;
}
.acc-seg-checkout {
  font-size: .65rem;
  font-style: italic;
  color: var(--acc-color);
  opacity: .7;
}
/* Delete button — appears on hover */
.acc-seg-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px; height: 16px;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: .6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s;
  line-height: 1;
}
.tl-day-wrap:hover .acc-seg-del { opacity: .6; }
.acc-seg-del:hover { opacity: 1 !important; background: var(--bg-subtle); border-color: var(--border); }

/* No-acc placeholder gutter */
.acc-gutter-add {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: 4px 0 0 10px;
}
.acc-gutter-add-btn {
  font-size: .65rem;
  color: var(--text-muted);
  opacity: 0;
  cursor: pointer;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  transition: opacity .15s;
  white-space: nowrap;
}
.tl-day-wrap:hover .acc-gutter-add-btn { opacity: .7; }
.acc-gutter-add-btn:hover { opacity: 1 !important; color: var(--primary); border-color: var(--primary); }

/* Gutter header above all days */
.tl-gutter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 0 0 6px 10px;
  margin-left: .875rem;
  border-left: 1px solid var(--border);
}

/* Add-accommodation inline form */
.tl-add-acc-wrap {
  margin-top: 1rem;
}
.tl-add-acc-form {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .875rem;
  margin-top: .5rem;
}
.tl-day-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .875rem;
  background: var(--bg-subtle);
  border-radius: var(--radius, 10px);
  border-left: 4px solid var(--primary);
  margin-bottom: .75rem;
  cursor: pointer;
}
.tl-day-num {
  font-size: .7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--primary); white-space: nowrap;
}
.tl-day-title { font-weight: 600; font-size: .9rem; flex: 1; }
.tl-day-title--placeholder { font-weight: 400; color: var(--text-muted); font-style: italic; }
.tl-day-date { font-size: .75rem; color: var(--text-muted); }

/* Items list under a day */
.tl-items {
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
  margin-left: .875rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* Single item */
.tl-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .6rem .875rem .6rem .75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  font-size: .875rem;
  transition: box-shadow .1s;
}
/* Branch connector */
.tl-item::before {
  content: '';
  position: absolute;
  left: -1.25rem;
  top: 1.1rem;
  width: 1rem;
  height: 1px;
  background: var(--border);
}
.tl-item:hover { box-shadow: var(--shadow-sm); }
.tl-item.done { opacity: .6; }
.tl-item.done .tl-item-title { text-decoration: line-through; }

.tl-item-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
/* type colors */
.tl-item.type-activity     .tl-item-icon { background: var(--primary-light); color: var(--primary); }
.tl-item.type-accommodation .tl-item-icon { background: var(--accent-light); color: var(--accent); }
.tl-item.type-transport    .tl-item-icon { background: var(--warning-light); color: var(--warning); }
.tl-item.type-food         .tl-item-icon { background: var(--success-light); color: var(--success); }
.tl-item.type-other        .tl-item-icon { background: var(--bg-subtle); color: var(--text-muted); }

.tl-item-body { flex: 1; min-width: 0; }
.tl-item-time { font-size: .7rem; color: var(--text-muted); font-weight: 600; }
.tl-item-title { font-weight: 600; display: block; }
.tl-item-desc { font-size: .775rem; color: var(--text-muted); margin-top: .1rem; }
.tl-item-cost { font-size: .825rem; font-weight: 700; color: var(--primary); white-space: nowrap; margin-top: .1rem; }
.tl-item-person { font-size: .75rem; color: var(--text-muted); }

.tl-item-actions { display: flex; gap: .25rem; opacity: 0; transition: opacity .1s; flex-shrink: 0; }
.tl-item:hover .tl-item-actions { opacity: 1; }

/* Add item form inside tree */
.tl-add-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: .825rem;
  cursor: pointer;
  transition: background .1s, color .1s;
  margin-top: .25rem;
  position: relative;
}
.tl-add-btn::before {
  content: '';
  position: absolute;
  left: -1.25rem; top: 1.1rem;
  width: 1rem; height: 1px;
  background: var(--border);
}
.tl-add-btn:hover { background: var(--bg-subtle); color: var(--text); border-style: solid; }

/* Quick-add row under each day */
.quick-add-row {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .5rem;
  padding-left: .5rem;
}
.quick-add-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .65rem;
  border-radius: 20px;
  border: 1.5px solid transparent;
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-elevated);
  transition: filter .1s, transform .07s;
}
.quick-add-btn:hover { filter: brightness(.95); transform: translateY(-1px); }
.quick-add-btn.type-accommodation { border-color: #6366f1; color: #6366f1; }
.quick-add-btn.type-transport     { border-color: #f59e0b; color: #b45309; }
.quick-add-btn.type-food          { border-color: #ef4444; color: #dc2626; }
.quick-add-btn.type-activity      { border-color: #22c55e; color: #16a34a; }
.quick-add-btn.type-other         { border-color: var(--border); color: var(--text-muted); }

.tl-add-form {
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  margin-top: .35rem;
  position: relative;
}
.tl-add-form::before {
  content: '';
  position: absolute;
  left: -1.25rem; top: 1.25rem;
  width: 1rem; height: 1px;
  background: var(--border);
}

/* Add day button */
.tl-add-day-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem 1rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius, 10px);
  background: none;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: background .1s, color .1s;
}
.tl-add-day-btn:hover { background: var(--bg-subtle); color: var(--text); }

/* Plan edit modal */
.plan-edit-modal {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: panelSlideIn .2s ease;
}
.plan-edit-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.plan-edit-modal__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.plan-edit-modal__body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.plan-edit-modal__section-label {
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .6rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.plan-edit-modal__row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: .75rem;
}

/* Budget overview */
.budget-row {
  display: flex; justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  font-size: .875rem;
}
.budget-row:last-child { border-bottom: none; }
.budget-total-row {
  display: flex; justify-content: space-between;
  padding: .6rem 0 0;
  font-weight: 700;
}

/* Packing */
.packing-section { margin-bottom: 1rem; }
.packing-section-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .5rem; }
.packing-item-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  font-size: .875rem;
}
.packing-item-row:last-child { border-bottom: none; }
.packing-item-row.packed span:not(.pack-person) { text-decoration: line-through; color: var(--text-muted); }
.pack-check { flex-shrink: 0; cursor: pointer; width: 16px; height: 16px; }
.pack-person { font-size: .75rem; color: var(--text-muted); margin-left: auto; }

/* ── Plan-level accommodation section ───────────────────── */
.plan-acc-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.plan-acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .75rem;
  gap: .5rem;
}
.plan-acc-header > span { display: flex; align-items: center; gap: .4rem; }
.plan-acc-form {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  margin-bottom: .75rem;
}
.acc-cards { display: flex; flex-direction: column; gap: .5rem; }
.acc-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  transition: box-shadow .15s;
}
.acc-card:hover { box-shadow: var(--shadow-sm); }
.acc-card.acc-done { opacity: .65; }
.acc-card-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: var(--accent-light, rgba(99,102,241,.1));
  color: var(--accent, #6366f1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.acc-card-body { flex: 1; min-width: 0; }
.acc-card-name { font-weight: 600; font-size: .9rem; margin-bottom: .15rem; }
.acc-card-loc { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: .25rem; margin-bottom: .2rem; }
.acc-card-dates { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; flex-wrap: wrap; gap: .15rem; }
.acc-card-actions { display: flex; gap: .25rem; flex-shrink: 0; }

/* tl-item-meta (cost + person line) */
.tl-item-meta { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }

/* ═══ Event view panel — plan summary tiles ═══ */
.ev-plan-tiles { margin-top: 1rem; }
.ev-plan-tiles-label, .ev-plan-tiles-hdr {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.ev-tiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.ev-tile {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.ev-tile--wide { grid-column: 1 / -1; }
.ev-tile-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.ev-tile-lbl {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ev-tile-acc {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .45rem .65rem;
  margin-top: .4rem;
}
.ev-budget-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  margin-top: .35rem;
  overflow: hidden;
}
.ev-budget-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--success);
}
.ev-map-tile {
  grid-column: 1 / -1;
  height: 140px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.ev-plan-actions {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}
.ev-no-plan {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem .75rem;
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--text-muted);
}

/* ═══ Event kind selector ═══ */
.event-kind-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}
.event-kind-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 1.1rem .75rem;
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  border-radius: var(--radius, 10px);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.event-kind-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.event-kind-icon { font-size: 1.75rem; line-height: 1; }
.event-kind-name { font-size: .88rem; font-weight: 700; color: var(--text); }
.event-kind-desc { font-size: .72rem; color: var(--text-muted); line-height: 1.4; }

/* ═══ Notebook diary cards ═══ */
.notebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.notebook-card {
  position: relative;
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 4px solid var(--nb-accent, var(--primary));
  border-radius: var(--radius, 10px);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.notebook-card:hover {
  transform: translateY(-2px) rotate(.4deg);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
/* Ruled lines */
.nb-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 27px,
    color-mix(in srgb, var(--nb-accent, var(--primary)) 8%, var(--border)) 28px
  );
  opacity: .6;
}
/* Spiral holes */
.nb-holes {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  background: color-mix(in srgb, var(--nb-accent, var(--primary)) 6%, var(--bg-subtle));
  border-right: 1px solid var(--border);
}
.nb-hole {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
}
/* Body */
.nb-body {
  position: relative;
  padding: 1rem 1rem 1rem 2.5rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.nb-top {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.nb-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nb-date {
  font-size: .7rem;
  color: var(--text-muted);
  flex: 1;
}
.nb-mood { font-size: .95rem; }
.nb-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.nb-location {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  color: var(--text-muted);
}
.nb-note {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-style: italic;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nb-stats {
  display: flex;
  gap: .75rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--nb-accent, var(--primary));
}
.nb-footer {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.nb-avatars { display: flex; }
.nb-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg-elevated);
  margin-left: -5px;
  object-fit: cover;
}
.nb-avatar:first-child { margin-left: 0; }
.nb-avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .55rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text);
}
.nb-tag {
  font-size: .68rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: 99px;
  padding: .1rem .45rem;
}
.nb-open {
  margin-left: auto;
  font-size: .72rem;
  color: var(--nb-accent, var(--primary));
  font-weight: 600;
}
.timeline-month-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .25rem 0;
  grid-column: 1 / -1;
  margin-top: .5rem;
}
