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

:root {
  --bg:          #eef1f8;
  --surface:     #ffffff;
  --surface2:    #f2f5fc;
  --border:      #d0d5e8;
  --text:        #1a1e30;
  --muted:       #6b7485;
  --accent:      #3d7cf7;
  --accent-dim:  rgba(61,124,247,0.10);
  --danger:      #d92c2c;
  --danger-dim:  rgba(217,44,44,0.10);
  --warn:        #c27a0a;
  --warn-dim:    rgba(194,122,10,0.12);
  --success:     #0a8f6a;

  --type-local_class:    #0d9488;
  --type-private_lesson: #c2366b;
  --type-workshop:       #2563eb;
  --type-judging:        #b45309;
  --type-competition:    #d92c2c;
  --type-performance:    #6d28d9;
  --type-photoshoot:     #c2410c;
  --type-studio:         #0369a1;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
}

/* ── Dark Theme ──────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:          #0c0f1a;
  --surface:     #141828;
  --surface2:    #1c2138;
  --border:      #2e3560;
  --text:        #eceef8;
  --muted:       #8b93c4;
  --accent:      #6ba3ff;
  --accent-dim:  rgba(107,163,255,0.15);
  --danger:      #f07070;
  --danger-dim:  rgba(240,112,112,0.15);
  --warn:        #f0c46a;
  --warn-dim:    rgba(240,196,106,0.15);
  --success:     #5ccba8;

  --type-local_class:    #5ccba8;
  --type-private_lesson: #f48fb1;
  --type-workshop:       #6ba3ff;
  --type-judging:        #f0c46a;
  --type-competition:    #f07070;
  --type-performance:    #c792ea;
  --type-photoshoot:     #fb923c;
  --type-studio:         #82b1ff;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
  --shadow:    0 2px 10px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
}

[data-theme="dark"] .event-card {
  background: linear-gradient(145deg, var(--surface2) 0%, var(--surface) 100%) !important;
}
[data-theme="dark"] .glance-sidebar {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .glance-item {
  background: var(--surface2);
}
[data-theme="dark"] .topnav {
  background: var(--surface);
  border-bottom-color: var(--border);
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}

/* ── Top Nav ─────────────────────────────────────────────── */
.topnav {
  display: flex;
  align-items: center;
  height: 54px; padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}

.topnav-brand { flex-shrink: 0; display: flex; align-items: center; margin-right: 16px; }
.topnav-left  { display: flex; align-items: center; gap: 24px; }

/* Everything after the brand lives in one centered flex group */
.topnav-center {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 16px;
}

/* Nav page buttons */
.nav-links { display: flex; gap: 4px; }

/* Utility icons separated from page links by a thin rule */
.topnav-controls {
  display: flex; align-items: center; gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.app-title {
  font-size: 1rem; font-weight: 700; letter-spacing: 0.3px;
  color: var(--text);
}

.nav-btn {
  background: none; border: none; color: var(--muted);
  padding: 6px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.875rem; font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav-btn:hover { color: var(--text); background: var(--surface2); }
.nav-btn.active { color: var(--accent); background: var(--accent-dim); }

/* .topnav-right removed — controls now live in .topnav-controls inside .topnav-center */

.btn-lang {
  background: none; border: 1px solid var(--border);
  color: var(--muted); padding: 4px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.8rem;
}
.btn-lang:hover { border-color: var(--accent); color: var(--accent); }

.btn-theme {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  padding: 4px 8px; font-size: 1rem; line-height: 1;
  transition: border-color 0.15s, background 0.15s;
}
.btn-theme:hover { border-color: var(--accent); background: var(--accent-dim); }

.btn-logout {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  padding: 4px 8px; font-size: 1rem; line-height: 1;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.btn-logout:hover { border-color: #e55; color: #e55; background: rgba(200,50,50,0.08); }

/* ── Background watermark ────────────────────────────────── */
#bg-watermark {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  filter: blur(4px) saturate(0.5);
  opacity: 0;
  transition: opacity 0.9s ease;
}

/* ── Sections ────────────────────────────────────────────── */
.main-content { position: relative; z-index: 1; padding: 20px 24px; max-width: 1400px; margin: 0 auto; }
.section { display: none; }
.section.active { display: block; }

/* ── Stats Bar ───────────────────────────────────────────── */
.stats-bar {
  display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}

.stat-chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px;
  display: flex; flex-direction: column; align-items: center;
  min-width: 110px; cursor: default;
}
.stat-chip.stat-alert { border-color: transparent; }
.stat-chip.stat-alert.has-alerts {
  background: var(--danger-dim); border-color: var(--danger);
}

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

/* ── Alert Banners ───────────────────────────────────────── */
#alert-area { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.alert-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.875rem; line-height: 1.4;
}
.alert-banner.alert-conflict {
  background: var(--danger-dim); border: 1px solid rgba(224,87,87,0.3);
  transition: background 0.15s;
}
.alert-banner.alert-conflict:hover { background: rgba(224,87,87,0.18); }
.alert-conflict-hint { font-size: 0.78rem; font-weight: 400; opacity: 0.7; }
.alert-conflict-link {
  color: var(--danger); font-weight: 600; text-decoration: underline;
  text-decoration-style: dotted; cursor: pointer;
}
.alert-conflict-link:hover { text-decoration-style: solid; }
.alert-banner.alert-imminent {
  background: var(--warn-dim); border: 1px solid rgba(224,168,87,0.3);
}
.alert-banner.alert-perf {
  background: rgba(181,123,238,0.10); border: 1px solid rgba(181,123,238,0.3);
}
.alert-icon { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }

/* ── Add-to-contacts prompt ──────────────────────────────── */
.add-contact-prompt {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9000; display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1.5px solid var(--accent);
  border-radius: var(--radius); padding: 16px 22px;
  box-shadow: var(--shadow-lg); font-size: 0.875rem;
  animation: popIn 0.2s ease;
}
.add-contact-msg { color: var(--text); }
.add-contact-actions { display: flex; gap: 8px; flex-shrink: 0; }
@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── Occurrence performance details ──────────────────────── */
.occ-perf-details { display: flex; gap: 12px; align-items: center; margin-top: 3px; font-size: 0.78rem; color: var(--muted); flex-wrap: wrap; }
.occ-video-link { color: var(--accent); text-decoration: none; }
.occ-video-link:hover { text-decoration: underline; }
.occ-ws-details { margin-top: 3px; font-size: 0.78rem; color: var(--muted); }

/* Workshop date rows */
.workshop-date-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.workshop-day-lbl {
  font-size: 0.78rem; color: var(--muted); width: 42px; flex-shrink: 0;
}
.alert-text strong { display: block; }

/* ── Filter Bar ──────────────────────────────────────────── */
/* ── Dashboard action bar ──────────────────────────────────── */
.dash-action-bar {
  display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
}
.dash-action-btn {
  padding: 11px 22px; border-radius: 22px; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; border: 2px solid transparent; letter-spacing: 0.01em;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  white-space: nowrap;
}
.dash-action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.18); filter: brightness(1.08); }
.dash-action-btn:active { transform: translateY(0); box-shadow: none; }
.dash-action-primary {
  background: #ede0ff; color: #6b21a8; border-color: #d8b4fe;
}
.dash-action-primary:hover { background: #e0ccff; border-color: #c084fc; }
.dash-action-secondary {
  background: var(--surface2); color: var(--text); border-color: var(--border);
}
.dash-action-secondary:hover { border-color: var(--accent); }
.dash-action-ai {
  background: #dbeafe; color: #1d4ed8; border-color: #93c5fd;
}
.dash-action-ai:hover { background: #bfdbfe; border-color: #60a5fa; }
[data-theme="dark"] .dash-action-primary {
  background: rgba(167,139,250,0.18); color: #d8b4fe; border-color: rgba(167,139,250,0.4);
}
[data-theme="dark"] .dash-action-primary:hover { background: rgba(167,139,250,0.28); }
[data-theme="dark"] .dash-action-ai {
  background: rgba(147,197,253,0.15); color: #93c5fd; border-color: rgba(147,197,253,0.35);
}
[data-theme="dark"] .dash-action-ai:hover { background: rgba(147,197,253,0.25); }

.quick-add-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.quick-add-label {
  font-size: 0.75rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-right: 2px;
}
.quick-add-btn {
  padding: 5px 13px; border-radius: 16px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.quick-add-btn:hover {
  border-color: var(--accent); background: var(--accent-dim, var(--surface2));
  transform: translateY(-1px);
}

.quick-add-edit-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.85rem; opacity: 0.45; padding: 2px 4px;
  border-radius: 4px; transition: opacity 0.15s;
}
.quick-add-edit-btn:hover { opacity: 1; }

.qae-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--border);
  cursor: grab; border-radius: 6px; transition: background 0.1s;
}
.qae-row:last-child { border-bottom: none; }
.qae-row.qae-dragging { opacity: 0.4; }
.qae-row.qae-drag-over { background: var(--accent-dim, var(--surface2)); border-color: var(--accent); }
.qae-handle { color: var(--muted); font-size: 1rem; cursor: grab; padding: 0 2px; user-select: none; flex-shrink: 0; }
.qae-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.88rem; user-select: none; }

.tmpl-group-header { font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:var(--muted); padding:10px 4px 4px; margin-top:4px; border-bottom:1px solid var(--border); }
.ti-library-details { border-top:1px dashed var(--border); margin-top:8px; }
.ti-library-summary { font-size:0.82rem; color:var(--accent); cursor:pointer; padding:6px 2px; list-style:none; user-select:none; }
.ti-library-summary:hover { opacity:0.8; }

#task-org-modal .modal-box { width:min(800px,96vw); max-height:88vh; display:flex; flex-direction:column; }
#task-org-content { flex:1; overflow-y:auto; padding:4px 0; }
.task-org-section { border:1px solid var(--border); border-radius:8px; margin-bottom:8px; overflow:hidden; }
.task-org-header { display:flex; align-items:center; gap:8px; font-size:0.86rem; font-weight:600; padding:8px 12px; background:var(--surface2); cursor:pointer; user-select:none; list-style:none; }
.task-org-header:hover { background:var(--accent-dim,var(--surface2)); }
.task-org-count { margin-left:auto; font-size:0.75rem; font-weight:400; color:var(--muted); background:var(--border); border-radius:10px; padding:1px 7px; }
.task-org-list { padding:0 4px; }
.task-org-row { display:flex; align-items:center; gap:8px; padding:6px 8px; border-bottom:1px solid var(--border); font-size:0.84rem; }
.task-org-row:last-child { border-bottom:none; }
.task-org-row.qae-dragging { opacity:0.35; }
.task-org-row.qae-drag-over { background:var(--accent-dim,var(--surface2)); }
.task-org-title { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.task-org-title.tmpl-disabled { color:var(--muted); text-decoration:line-through; }
.task-org-days-label { font-size:0.74rem; color:var(--muted); flex-shrink:0; }
.task-org-del { font-size:0.75rem; padding:2px 6px; flex-shrink:0; }
.task-org-add-row { display:flex; align-items:center; gap:6px; padding:6px 12px 8px; border-top:1px dashed var(--border); }
.task-org-new-input { flex:1; min-width:80px; font-size:0.83rem; padding:4px 8px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text); }
.task-org-new-input:focus { outline:none; border-color:var(--accent); }

.travel-footer-actions { display:none; gap:10px; padding:12px 0 4px; border-top:1px solid var(--border); margin-top:8px; flex-shrink:0; }

.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; flex-wrap: wrap;
}

.search-input {
  flex: 1; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 0.875rem;
}
.search-input:focus { outline: none; border-color: var(--accent); }

.filter-select {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 0.875rem; cursor: pointer;
}

.filter-toggle {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 0.875rem; cursor: pointer;
  user-select: none;
}

/* ── Dashboard Layout ────────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .dashboard-layout { grid-template-columns: 1fr; }
}

/* ── Event Cards ─────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: default;
}
.event-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}

.card-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.type-badge {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 2px 8px; border-radius: 20px;
  border: 1px solid currentColor;
}

.star-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--muted); padding: 0 0 0 8px;
  flex-shrink: 0; line-height: 1;
  transition: color 0.15s;
}
.star-btn.starred { color: var(--warn); }
.star-btn:hover { color: var(--warn); }

.card-name {
  font-size: 1rem; font-weight: 600; color: var(--accent);
  margin-bottom: 4px; cursor: pointer;
}
.card-name:hover { text-decoration: underline; }

.card-location {
  font-size: 0.8rem; color: var(--muted); margin-bottom: 12px;
}

.card-next {
  font-size: 0.85rem; margin-bottom: 4px;
}
.card-next strong { color: var(--text); }
.card-next .countdown {
  font-size: 0.75rem; color: var(--muted); margin-top: 2px;
}
.card-next .countdown.soon { color: var(--warn); }
.card-next .countdown.imminent { color: var(--danger); }

.card-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 12px 0 10px;
}

.card-footer {
  display: flex; align-items: center; gap: 10px;
}

.card-stats { display: flex; gap: 14px; flex: 1; }
.card-stat { display: flex; flex-direction: column; align-items: center; }
.card-stat .sn { font-size: 1rem; font-weight: 700; }
.card-stat .sl { font-size: 0.7rem; color: var(--muted); }

.card-conflict-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); flex-shrink: 0;
  title: 'Conflict';
}

/* ── At a Glance Sidebar ─────────────────────────────────── */
.glance-sidebar {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  box-shadow: var(--shadow-sm);
  position: sticky; top: 74px;
}

.glance-header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 12px;
}
.glance-icon {
  font-size: 1.6rem; line-height: 1; flex-shrink: 0;
}
.sidebar-title {
  font-size: 1rem; font-weight: 800; color: var(--text);
  letter-spacing: -0.2px;
}
.sidebar-subtitle {
  font-size: 0.72rem; color: var(--muted); margin-top: 1px;
}

.glance-list { display: flex; flex-direction: column; gap: 6px; }
.glance-ai-btn {
  width: 100%; margin-top: 12px; padding: 9px 0;
  background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.82rem; font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.glance-ai-btn:hover { background: #bfdbfe; border-color: #60a5fa; }
[data-theme="dark"] .glance-ai-btn {
  background: rgba(147,197,253,0.12); color: #93c5fd; border-color: rgba(147,197,253,0.3);
}
[data-theme="dark"] .glance-ai-btn:hover { background: rgba(147,197,253,0.22); }

.glance-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface);
  border-left: 3px solid;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s;
}
.glance-item:hover { background: var(--surface2); }
.glance-date {
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  min-width: 36px; padding-top: 2px; text-transform: uppercase;
  letter-spacing: 0.3px;
}
.glance-info { flex: 1; }
.glance-name { font-size: 0.85rem; font-weight: 600; }
.glance-loc  { font-size: 0.72rem; color: var(--muted); }
.glance-time { font-size: 0.68rem; color: var(--accent); font-weight: 600; margin-top: 1px; }
.glance-activity {
  display: inline-block; margin-left: 6px;
  font-size: 0.7rem; font-weight: 500; color: var(--muted);
  background: var(--surface2); border-radius: 4px; padding: 0 5px;
  vertical-align: middle;
}
.glance-empty {
  color: var(--muted); font-size: 0.85rem; text-align: center;
  padding: 24px 0; font-style: italic;
}

/* ── Glance Range Toggles ────────────────────────────────── */
.glance-toggles {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px;
}
.glance-toggle {
  background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 20px;
  padding: 3px 10px; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all 0.12s;
}
.glance-toggle:hover { border-color: var(--accent); color: var(--text); }
.glance-toggle.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 0.875rem;
  cursor: pointer; transition: border-color 0.15s;
}
.btn-secondary:hover { border-color: var(--accent); }

.btn-danger {
  background: var(--danger-dim); color: var(--danger);
  border: 1px solid rgba(224,87,87,0.3); border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 0.875rem;
  cursor: pointer;
}
.btn-danger:hover { background: rgba(224,87,87,0.25); }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

.btn-ai {
  background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd;
  border-radius: var(--radius-sm); padding: 8px 18px;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, border-color 0.15s; white-space: nowrap;
}
.btn-ai:hover { background: #bfdbfe; border-color: #60a5fa; }
[data-theme="dark"] .btn-ai { background: rgba(147,197,253,0.15); color: #93c5fd; border-color: rgba(147,197,253,0.35); }
[data-theme="dark"] .btn-ai:hover { background: rgba(147,197,253,0.25); }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  padding: 24px;
}
.modal-wide { max-width: 740px; }

.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 12px;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }

.modal-header-actions { display: flex; gap: 8px; align-items: center; }

.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 1.1rem; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; flex-shrink: 0;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }

.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ── Form Elements ───────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.form-row { display: flex; gap: 12px; }
.form-group label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 52px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  font-size: 0.78rem; cursor: pointer; padding: 4px 6px;
  border-radius: 4px; white-space: nowrap;
}
.pw-toggle:hover { color: var(--text); }

.phone-input-row { display: flex; gap: 6px; }
.phone-cc-select {
  flex: 0 0 76px; width: 76px; min-width: 0;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 4px; font-size: 0.8rem; font-family: inherit;
}
.phone-cc-select:focus { outline: none; border-color: var(--accent); }
.phone-num-input { flex: 1; }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 0.875rem; font-family: inherit;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }

.form-check { display: flex; align-items: center; margin: 3px 0; }
.form-check input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.form-check label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 15px; border-radius: 20px; cursor: pointer;
  font-size: 0.82rem; font-weight: 500; user-select: none;
  border: 1.5px solid var(--border); color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.form-check label:hover { border-color: var(--accent); color: var(--text); }
.form-check label:has(input[type="checkbox"]:checked) {
  background: rgba(39,174,96,0.12); border-color: #27ae60; color: #27ae60;
}
.form-check label:has(input[type="checkbox"]:checked):hover { background: rgba(39,174,96,0.2); }

.divider-label {
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-top: 1px solid var(--border); padding-top: 14px;
}

.occurrence-inline { display: flex; flex-direction: column; gap: 12px; }

/* ── Conflict Warning ────────────────────────────────────── */
.conflict-banner {
  background: var(--danger-dim); border: 1px solid rgba(224,87,87,0.4);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.82rem; line-height: 1.5;
}
.conflict-banner strong { color: var(--danger); display: block; margin-bottom: 4px; }

/* ── Occurrence List (detail modal) ─────────────────────── */
.detail-meta { color: var(--muted); font-size: 0.875rem; margin-bottom: 16px; line-height: 1.7; }
.detail-location { font-size: 0.85rem; color: var(--muted); margin-left: 8px; }

.detail-body h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); margin-bottom: 10px; }

.occurrence-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.occ-row {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
}
.occ-row.occ-conflict {
  background: var(--danger-dim); border-color: rgba(224,87,87,0.45);
}
.occ-instance-row.occ-conflict {
  background: var(--danger-dim); border-radius: var(--radius-sm);
  padding: 3px 6px; margin: 1px 0;
}
.occ-conflict-badge {
  font-size: 0.68rem; font-weight: 700; color: var(--danger);
  background: rgba(224,87,87,0.15); border: 1px solid rgba(224,87,87,0.4);
  border-radius: 3px; padding: 1px 5px; white-space: nowrap; flex-shrink: 0;
}
.btn-occ-conflict-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.75rem; font-weight: 600; padding: 4px 12px;
  border-radius: 20px; border: 1.5px solid rgba(224,87,87,0.5);
  background: var(--danger-dim); color: var(--danger);
  cursor: pointer; margin-bottom: 10px; transition: all 0.15s;
}
.btn-occ-conflict-toggle:hover { background: rgba(224,87,87,0.2); }
.btn-occ-conflict-toggle.active {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.occ-row-info { flex: 1; }
.occ-row-name { font-weight: 600; font-size: 0.9rem; }
.occ-time-badge { margin-left:8px; font-size:0.72rem; font-weight:500; color:var(--accent); }
.occ-row-dates { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.occ-status { font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; }
.occ-status.upcoming  { background: var(--accent-dim); color: var(--accent); }
.occ-status.active    { background: rgba(76,175,147,0.15); color: var(--success); }
.occ-status.completed { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.occ-status.cancelled { background: var(--danger-dim); color: var(--danger); }

.occ-form-inline {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  margin-top: 8px; display: flex; flex-direction: column; gap: 12px;
}

/* ── Series Occurrence Row ───────────────────────────────── */
.occ-series-row {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
}
.occ-series-header {
  display: flex; align-items: center; gap: 8px;
}
.btn-expand {
  font-size: 1rem !important;
  transition: transform 0.2s ease, border-color 0.15s !important;
  line-height: 1;
}
.occ-series-info { flex: 1; }
.series-expand {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.occ-instance-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem; padding: 2px 0;
}
.occ-instance-row span:first-child { flex: 1; color: var(--muted); }
.occ-conflict-badge + span { flex: 1; color: var(--muted); }

/* ── Modal Season List (edit modal for studio events) ───── */
.modal-season-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px;
}
.modal-season-row.is-editing {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.modal-season-info { flex: 1; min-width: 0; }
.modal-season-label { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; }
.modal-season-dates { font-size: 0.85rem; }
.modal-season-pattern { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.modal-season-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Scope Delete Dialog ─────────────────────────────────── */
.scope-dialog-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.scope-dialog {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  max-width: 340px; width: 100%;
}
.scope-dialog-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.scope-dialog-sub   { font-size: 0.875rem; color: var(--muted); margin-bottom: 16px; }
.scope-dialog-actions {
  display: flex; flex-direction: column; gap: 8px;
}
.scope-dialog-actions button {
  width: 100%; padding: 9px 14px; font-size: 0.875rem;
  border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 500; text-align: left;
}

/* ── Profile Panel ───────────────────────────────────────── */
.profile-save-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px;
  margin-bottom: 4px; max-width: 560px;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.profile-save-inline {
  display: flex; align-items: center; gap: 12px; margin-top: 4px;
}
.profile-panel {
  max-width: 560px; display: flex; flex-direction: column; gap: 16px;
}
.profile-panel h2 { font-size: 1.1rem; font-weight: 700; }

.profile-section-title {
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-top: 1px solid var(--border); padding-top: 14px;
  margin-top: 4px;
}

/* ── Recurring Until Date ────────────────────────────────── */
.form-input-sm {
  width: 100%; padding: 6px 10px; font-size: 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.form-input-sm:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ── Private Lesson Until Row ────────────────────────────── */
.pl-until-row {
  display: flex; align-items: flex-end; gap: 10px;
  padding-top: 10px; border-top: 1px solid var(--border); margin-top: 4px;
}
.pl-or {
  font-size: 0.8rem; color: var(--muted); font-style: italic;
  padding-bottom: 10px; flex-shrink: 0;
}

/* ── Radio Group ─────────────────────────────────────────── */
.radio-group {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.radio-option {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.875rem; font-weight: 500;
  transition: border-color 0.12s, background 0.12s;
  user-select: none;
}
.radio-option input[type="radio"] { display: none; }
.radio-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.radio-option:hover { border-color: var(--accent); }

/* ── Input Prefix (@handles, etc.) ───────────────────────── */
.input-prefix-wrap {
  display: flex; align-items: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.input-prefix-wrap:focus-within { border-color: var(--accent); }
.input-prefix {
  padding: 8px 6px 8px 10px; color: var(--muted);
  font-size: 0.875rem; flex-shrink: 0; user-select: none;
}
.input-prefix-wrap input {
  border: none !important; background: transparent !important;
  padding-left: 2px !important; flex: 1;
}
.input-prefix-wrap input:focus { outline: none !important; }

/* ── Recurrence Widget ───────────────────────────────────── */
.recurrence-options {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}

.recurrence-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; flex-wrap: wrap;
}
.recurrence-row select {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 5px 8px; font-size: 0.875rem;
}
.recurrence-row select:focus { outline: none; border-color: var(--accent); }

.rec-interval-input {
  width: 58px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 8px; font-size: 0.875rem; text-align: center;
}
.rec-interval-input:focus { outline: none; border-color: var(--accent); }

.recurrence-days {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.rec-days-label {
  font-size: 0.8rem; color: var(--muted); margin-right: 2px;
}
.day-check { display: flex; align-items: center; cursor: pointer; }
.day-check input[type="checkbox"] { display: none; }
.day-check span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 28px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600;
  color: var(--muted); cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.day-check input:checked + span {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent);
}
.day-check:hover span { border-color: var(--accent); color: var(--text); }

/* ── Placeholder ─────────────────────────────────────────── */
.placeholder-panel {
  text-align: center; padding: 80px 20px; color: var(--muted);
}
.placeholder-icon { font-size: 3rem; margin-bottom: 12px; }
.placeholder-panel h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px;
  color: var(--muted);
}
.empty-state .big { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

/* ── Name Suggestions Dropdown ───────────────────────────── */
.name-suggestions, .suggestions-box {
  position: absolute; top: 100%; left: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); margin-top: 2px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.name-suggestions { right: 0; }
.suggestion-header {
  padding: 6px 12px; font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.suggestion-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer;
  transition: background 0.1s;
}
.suggestion-item:hover { background: var(--accent-dim); }
.suggestion-item .s-name { flex: 1; font-size: 0.875rem; font-weight: 500; }
.suggestion-item .s-loc  { font-size: 0.75rem; color: var(--muted); }
.suggestion-item .s-count { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

/* ── Calendar toolbar ────────────────────────────────────── */
.cal-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 14px; flex-wrap: wrap;
}
.cal-search-input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px;
  color: var(--text); font-size: 0.875rem; width: 200px; outline: none;
  transition: border-color 0.15s;
}
.cal-search-input:focus { border-color: var(--accent); }
.cal-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-filter-btn {
  padding: 5px 13px; border-radius: 20px; font-size: 0.8rem;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; transition: all 0.15s;
}
.cal-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Type chips + performing toggle ─────────────────────── */
.cal-type-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap; min-height: 28px;
}
.cal-type-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-type-chip {
  padding: 3px 11px; border-radius: 20px; font-size: 0.75rem;
  border: 1px solid; background: transparent; cursor: pointer;
  font-weight: 600; transition: all 0.15s;
}
.cal-type-chip:hover { opacity: 0.85; }
.cal-performing-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--muted); cursor: pointer; margin-left: auto;
}
.cal-performing-label input { accent-color: var(--accent); }

/* ── FullCalendar container ──────────────────────────────── */
#fullcalendar-container {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 12px;
  margin-bottom: 24px; overflow: hidden;
}

/* ── FullCalendar theme overrides ────────────────────────── */
.fc {
  --fc-border-color:      var(--border);
  --fc-page-bg-color:     var(--surface);
  --fc-neutral-bg-color:  var(--surface2);
  --fc-today-bg-color:    rgba(61,124,247,0.07);
  --fc-small-font-size:   0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
}
.fc .fc-button {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); font-size: 0.8rem;
  padding: 4px 10px; cursor: pointer; transition: all 0.15s;
  box-shadow: none !important; text-transform: capitalize;
}
.fc .fc-button:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--accent) !important; border-color: var(--accent) !important;
  color: #fff !important;
}
.fc .fc-button:focus { box-shadow: none !important; outline: none; }

/* Bigger, more visible prev/next arrows */
.fc .fc-prev-button,
.fc .fc-next-button {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  font-size: 1.1rem !important;
  padding: 4px 16px !important;
  font-weight: 700 !important;
}
.fc .fc-prev-button:hover,
.fc .fc-next-button:hover {
  background: var(--accent) !important;
  color: #fff !important;
}
.fc .fc-toolbar { flex-wrap: nowrap !important; align-items: center !important; gap: 8px; }
.fc .fc-toolbar-chunk { display: flex !important; align-items: center !important; gap: 4px; flex-wrap: nowrap !important; }
.fc .fc-toolbar-title { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 0 8px; white-space: nowrap; }
.fc .fc-col-header-cell { background: var(--surface2); }
.fc .fc-col-header-cell-cushion {
  color: var(--muted); font-weight: 700; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.5px; text-decoration: none;
}
.fc .fc-daygrid-day-number {
  color: var(--muted); font-size: 0.8rem; text-decoration: none;
}
.fc .fc-day-today .fc-daygrid-day-number { color: var(--accent); font-weight: 700; }
.fc .fc-daygrid-day.fc-day-today { background: var(--fc-today-bg-color); }
.fc .fc-event {
  border-radius: 4px; font-size: 0.73rem; font-weight: 600;
  cursor: pointer; padding: 1px 4px;
}
.fc .fc-holiday {
  font-size: 0.68rem; font-style: italic; opacity: 0.55;
  pointer-events: none; padding: 0 3px;
}
.fc .fc-daygrid-more-link { color: var(--accent); font-size: 0.72rem; font-weight: 600; }
.fc .fc-timegrid-slot { height: 28px; }
.fc .fc-timegrid-slot-label { color: var(--muted); font-size: 0.7rem; }
.fc .fc-scrollgrid, .fc-theme-standard td, .fc-theme-standard th { border-color: var(--border); }
.fc .fc-list-event:hover td { background: var(--surface2); cursor: pointer; }
.fc .fc-list-day-cushion { background: var(--surface2); }
[data-theme="dark"] .fc .fc-col-header-cell { background: var(--surface2); }
[data-theme="dark"] .fc .fc-button { background: var(--surface2); }

/* ── Calendar event list ─────────────────────────────────── */
.cal-list-section { margin-top: 4px; }
.cal-list-title { font-size: 1rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.cal-list-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border-left: 3px solid;
  box-shadow: var(--shadow-sm); margin-bottom: 6px;
  cursor: pointer; transition: background 0.15s;
}
.cal-list-row:hover { background: var(--surface2); }
.cal-list-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-list-name { font-weight: 600; font-size: 0.9rem; }
.cal-list-badge {
  font-size: 0.7rem; padding: 1px 8px; border-radius: 20px;
  border: 1px solid; font-weight: 600; white-space: nowrap;
}
.cal-list-perf-badge {
  font-size: 0.7rem; padding: 1px 8px; border-radius: 20px;
  background: rgba(181,123,238,0.15); color: #b57bee;
  border: 1px solid rgba(181,123,238,0.4); font-weight: 600;
}
.cal-list-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }
.cal-list-empty { color: var(--muted); font-size: 0.875rem; padding: 24px 0; text-align: center; }

/* ── Contacts page ───────────────────────────────────────── */
.contacts-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 14px; flex-wrap: wrap;
}
.contacts-tabs {
  display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
}
.contacts-tab {
  padding: 5px 16px; border-radius: 16px; font-size: 0.83rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--muted);
  transition: all 0.15s;
}
.contacts-tab.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.contacts-empty {
  color: var(--muted); font-size: 0.875rem;
  padding: 32px 0; text-align: center;
}
.contacts-group-header {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--muted); padding: 10px 4px 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 2px;
}
.contact-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); margin-bottom: 6px;
  transition: background 0.15s;
}
.contact-row:hover { background: var(--surface2); }
.contact-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 3px; }
.contact-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }
.contact-link { color: var(--accent); text-decoration: none; }
.contact-link:hover { text-decoration: underline; }
.contact-notes { font-size: 0.75rem; color: var(--muted); margin-top: 3px; font-style: italic; }
.contact-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.contact-edit-panel {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.contact-edit-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px;
}
.cep-type-bar {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.cep-type-btn {
  padding: 5px 14px; border-radius: 16px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--muted);
  transition: all 0.15s;
}
.cep-type-btn.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ── Event detail — linked contacts ──────────────────────── */
.detail-contact-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.detail-contact-row:last-child { border-bottom: none; }
.detail-contact-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.detail-contact-info { flex: 1; min-width: 0; }
.detail-contact-name { font-weight: 600; font-size: 0.85rem; }
.detail-contact-role {
  margin-left: 6px; font-size: 0.68rem; padding: 1px 6px;
  border-radius: 10px; background: var(--accent-dim);
  color: var(--accent); font-weight: 600; text-transform: capitalize;
}
.detail-contact-email { font-size: 0.75rem; color: var(--muted); display: block; }
.detail-contact-actions { display: flex; gap: 6px; }

.contact-suggest-banner {
  margin-top: 10px; padding: 10px 14px; background: var(--warn-dim);
  border: 1px solid rgba(194,122,10,0.25); border-radius: var(--radius-sm);
  font-size: 0.82rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ── Nav avatar ──────────────────────────────────────────── */
.nav-avatar-wrap {
  width: 30px; height: 30px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); transition: border-color 0.2s;
}
.nav-avatar-wrap:hover { border-color: var(--accent); }
.nav-avatar { width: 100%; height: 100%; object-fit: cover; }
.nav-avatar-placeholder { font-size: 0.9rem; line-height: 1; }

/* ── My Journey ──────────────────────────────────────────── */
.journey-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.journey-title { font-size: 1.4rem; font-weight: 700; }
.journey-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.journey-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.journey-stat-num { font-size: 1.5rem; font-weight: 700; color: var(--accent); line-height: 1; }
.journey-stat-lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.journey-body {
  display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: stretch;
}
@media (max-width: 700px) { .journey-body { grid-template-columns: 1fr; } }

/* timeline */
.journey-timeline-col {
  height: calc(100vh - 220px); min-height: 400px; max-height: 900px; overflow-y: auto;
}
.journey-timeline { display: flex; flex-direction: column; }
.journey-year-header {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  padding: 10px 0 4px; border-top: 1px solid var(--border); margin-top: 8px;
}
.journey-year-header:first-child { border-top: none; margin-top: 0; }
.journey-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 4px; border-radius: var(--radius-sm); cursor: default;
  transition: background 0.15s;
}
.journey-item:hover { background: var(--surface2); }
.journey-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.journey-dot.future { background: #4caf50; border: 2px solid #4caf50; }
.journey-item-text { flex: 1; min-width: 0; }
.journey-item-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journey-item-meta { font-size: 0.74rem; color: var(--muted); }
.journey-item.future .journey-item-name { color: #4caf50; }

/* map */
.journey-map-col { position: relative; display: flex; flex-direction: column; }
.journey-map {
  flex: 1; min-height: 400px; max-height: 900px;
  height: calc(100vh - 220px);
  border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden;
}
.journey-map-empty {
  flex: 1; min-height: 400px; max-height: 900px;
  height: calc(100vh - 220px); display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border-radius: var(--radius); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.875rem;
}
.journey-loading {
  display: flex; align-items: center; justify-content: center;
  height: 120px; color: var(--muted); font-size: 0.875rem;
}

/* Journey visited stats cards */
.journey-visited-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: stretch; }
.jvs-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  text-align: center; min-width: 110px;
}
.jvs-num  { font-size: 2.6rem; font-weight: 700; color: var(--accent); line-height: 1; }
.jvs-lbl  { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 8px; }
.jvs-sub  { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
/* continent breakdown card keeps left-aligned rows */
.jvs-card.jvs-continent { align-items: flex-start; text-align: left; min-width: 210px; }
.jvs-bar-row  { display: flex; align-items: center; gap: 6px; margin-top: 5px; width: 100%; }
.jvs-bar-name { font-size: 0.68rem; color: var(--muted); width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jvs-bar-track { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.jvs-bar-fill  { height: 100%; border-radius: 2px; background: var(--accent); }
.jvs-bar-pct   { font-size: 0.65rem; color: var(--muted); width: 34px; text-align: right; white-space: nowrap; }

/* Journey search bar */
.journey-search-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
  position: relative; z-index: 500;
}
.journey-search-bar input {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text); font-size: 0.85rem;
  width: 140px;
}
.journey-search-bar input:focus { outline: none; border-color: var(--accent); }
.journey-search-bar select {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text); font-size: 0.85rem;
}
.journey-search-bar select:focus { outline: none; border-color: var(--accent); }

/* Journey filter chips */
.journey-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.journey-chip {
  font-size: 0.75rem; font-weight: 600; padding: 4px 10px;
  border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--muted);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.journey-chip:hover { border-color: var(--accent); color: var(--accent); }
.journey-chip.active { opacity: 1; }
/* Leaflet popup tweaks */
.journey-popup { font-family: system-ui, sans-serif; font-size: 0.78rem; min-width: 160px; }
.journey-popup-city { font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; }
.journey-popup-event { padding: 2px 0; border-bottom: 1px solid #eee; }
.journey-popup-event:last-child { border-bottom: none; }
.journey-popup-type { display: inline-block; font-size: 0.7rem; font-weight: 600; border-radius: 3px; padding: 1px 5px; margin-right: 4px; }
.jsearch-row { font-size: 0.8rem; padding: 2px 0; color: #444; }
.cem-lang-btn {
  padding: 3px 12px; border-radius: 12px; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--muted); transition: all 0.15s;
}
.cem-lang-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cem-lang-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.journey-popup-future { color: #4caf50; font-weight: 600; }

/* ── Welcome Wizard ───────────────────────────────────────── */
.wizard-overlay {
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6);
}
.wizard-box {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 96%; max-width: 580px;
  max-height: 92vh; overflow-y: auto; padding: 28px 32px 24px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative;
}
.wizard-close-btn {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  font-size: 1rem; color: var(--muted); border-radius: var(--radius-sm);
  line-height: 1;
}
.wizard-close-btn:hover { background: var(--surface2); color: var(--text); }

/* ── Wizard tour screens ──────────────────────────────────── */
.wz-tour-screens {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.wz-screen-card { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wz-screen {
  width: 100%; aspect-ratio: 4/3; background: var(--surface2);
  border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden;
}
.wz-screen-nav {
  height: 14px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 3px; padding: 0 5px;
}
.wz-nav-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: 0.35; }
.wz-nav-line { height: 3px; width: 18px; border-radius: 2px; background: var(--muted); opacity: 0.25; }
.wz-nav-line.w-long { width: 32px; }
.wz-screen-body { padding: 5px; }
.wz-mock-block { border-radius: 3px; }
.wz-mock-line { height: 5px; border-radius: 2px; background: var(--muted); opacity: 0.35; display: block; }
.wz-cal-cell { height: 8px; border-radius: 2px; background: var(--border); opacity: 0.4; }
.wz-cal-event { opacity: 0.9 !important; }
.wz-screen-label { font-size: 0.8rem; font-weight: 600; color: var(--text); margin-top: 2px; }
.wz-screen-desc { font-size: 0.72rem; color: var(--muted); text-align: center; line-height: 1.3; }
.wizard-progress-wrap {
  display: flex; align-items: center; gap: 12px;
}
.wizard-progress-track {
  flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.wizard-progress-fill {
  height: 100%; background: var(--accent); border-radius: 2px;
  transition: width 0.4s ease;
}
.wizard-step-label { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.wizard-step { animation: wz-fade 0.25s ease; }
@keyframes wz-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wizard-hero {
  font-size: 3.5rem; text-align: center; margin-bottom: 10px; line-height: 1;
}
.wizard-step-icon {
  font-size: 2rem; text-align: center; margin-bottom: 8px;
}
.wizard-title {
  font-size: 1.4rem; font-weight: 800; color: var(--text);
  text-align: center; margin-bottom: 6px;
}
.wizard-desc {
  font-size: 0.87rem; color: var(--muted); text-align: center;
  line-height: 1.6; margin-bottom: 10px;
}
.wizard-highlights {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 8px;
}
.wz-hl {
  background: var(--accent-dim); color: var(--accent);
  padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
}
.wz-help-tip {
  margin-top: 16px; font-size: 0.82rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 14px; text-align: center;
}
.wz-help-tip strong { color: var(--text); font-weight: 700; }
.wizard-form { display: flex; flex-direction: column; gap: 10px; }
.wizard-cloud-hints {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 0.78rem; color: var(--muted);
}
.wz-cloud-hint em { font-style: normal; opacity: 0.7; }

/* contract drop zone in wizard */
.wz-contract-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 24px 16px; cursor: pointer;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface2); font-size: 0.83rem; color: var(--muted);
  transition: border-color 0.2s, background 0.2s;
}
.wz-contract-drop:hover, .wz-contract-drop.drag-over {
  border-color: var(--accent); background: var(--accent-dim); color: var(--text);
}
.wz-terms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.wizard-tour { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.wz-tour-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.wz-tour-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1.3; }
.wz-tour-item span { font-size: 0.8rem; color: var(--muted); }
.wizard-nav {
  display: flex; align-items: center; gap: 8px;
  padding-top: 4px; border-top: 1px solid var(--border);
}
/* Photo step */
.wizard-photo-area {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.wizard-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--surface2); border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.wizard-photo-actions {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-align: center;
}

/* ── Travel modal ────────────────────────────────────────── */
.travel-modal-box {
  max-width: 680px; width: 96%; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.travel-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 40px 0; color: var(--muted);
}
.travel-spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: travel-spin 0.8s linear infinite;
}
@keyframes travel-spin { to { transform: rotate(360deg); } }
.travel-error {
  padding: 16px; background: var(--danger-dim);
  border-radius: var(--radius-sm); color: var(--danger);
  font-size: 0.85rem; line-height: 1.5;
}
.travel-content {
  overflow-y: auto; flex: 1; padding-right: 2px;
}
.travel-section { border-bottom: 1px solid var(--border); }
.travel-section:last-child { border-bottom: none; }
.travel-section-header {
  width: 100%; text-align: left; background: none; border: none;
  padding: 11px 0; cursor: pointer; display: flex;
  align-items: center; justify-content: space-between;
  color: var(--text); font-size: 0.9rem; font-weight: 600;
  gap: 8px;
}
.travel-section-header:hover { color: var(--accent); }
.ts-header-right {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.ts-chevron {
  font-size: 0.7rem; color: var(--muted);
  transition: transform 0.2s ease;
}
.ts-dismiss {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 0.75rem; padding: 2px 5px;
  border-radius: 3px; line-height: 1; opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.travel-section:hover .ts-dismiss { opacity: 1; }
.ts-dismiss:hover { color: var(--danger); background: rgba(217,44,44,0.1); }
.hidden-travel-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; background: var(--surface2); border-radius: var(--radius-sm);
  margin-bottom: 6px; font-size: 0.85rem; color: var(--text);
}
.travel-section-body { padding-bottom: 12px; }
.travel-para {
  color: var(--text); font-size: 0.85rem; line-height: 1.6;
  margin: 0;
}
.travel-list {
  margin: 0; padding-left: 18px;
  color: var(--text); font-size: 0.85rem; line-height: 1.7;
}
/* ── Safety section ─────────────────────────────────────── */
.ts-safety-section {
  background: linear-gradient(135deg, rgba(217,44,44,0.06) 0%, rgba(194,122,10,0.05) 100%);
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(217,44,44,0.25) !important;
  margin: 4px 0;
  padding: 0 10px;
}
.ts-safety-section:last-child { border-bottom: 1.5px solid rgba(217,44,44,0.25) !important; }
.ts-safety-header {
  color: var(--danger) !important;
  font-size: 0.92rem !important;
}
.ts-safety-header:hover { color: var(--danger) !important; opacity: 0.8; }
[data-theme="dark"] .ts-safety-section {
  background: linear-gradient(135deg, rgba(240,112,112,0.08) 0%, rgba(240,196,106,0.06) 100%);
  border-color: rgba(240,112,112,0.3) !important;
}
/* ── Visa section ──────────────────────────────────────────── */
.ts-visa-section {
  background: linear-gradient(135deg, rgba(39,174,96,0.06) 0%, rgba(26,188,156,0.05) 100%);
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(39,174,96,0.28) !important;
  margin: 4px 0;
  padding: 0 10px;
}
.ts-visa-section:last-child { border-bottom: 1.5px solid rgba(39,174,96,0.28) !important; }
.ts-visa-header { color: #27ae60 !important; font-size: 0.92rem !important; }
.ts-visa-header:hover { color: #27ae60 !important; opacity: 0.8; }
[data-theme="dark"] .ts-visa-section {
  background: linear-gradient(135deg, rgba(46,204,113,0.08) 0%, rgba(26,188,156,0.06) 100%);
  border-color: rgba(46,204,113,0.3) !important;
}
[data-theme="dark"] .ts-visa-header { color: #2ecc71 !important; }

/* ── Travel chat ─────────────────────────────────────────── */
.travel-notes-section {
  margin-top: 18px; padding: 14px 16px;
  background: var(--surface2); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.travel-notes-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 10px;
}
.travel-notes-input {
  width: 100%; resize: vertical; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.84rem; padding: 8px 10px;
  font-family: inherit; line-height: 1.5;
}
.travel-notes-input:focus { outline: none; border-color: var(--accent); }

.travel-chat-section {
  flex-direction: column;
  margin-top: 18px; gap: 14px;
  background: linear-gradient(135deg, var(--accent-dim) 0%, var(--surface2) 100%);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
}
.travel-chat-header {
  display: flex; align-items: flex-start; gap: 12px;
}
.travel-chat-icon {
  font-size: 1.6rem; line-height: 1; flex-shrink: 0; margin-top: 2px;
}
.travel-chat-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 3px;
}
.travel-chat-subtitle {
  font-size: 0.8rem; color: var(--muted); line-height: 1.4;
}
.travel-chat-messages {
  max-height: 260px; overflow-y: auto; display: flex;
  flex-direction: column; gap: 10px;
}
.travel-message {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.875rem; line-height: 1.6; max-width: 92%;
  white-space: pre-wrap;
}
.travel-message.user {
  background: var(--accent); color: #fff;
  align-self: flex-end; border-radius: var(--radius) 4px var(--radius) var(--radius);
}
.travel-message.assistant {
  background: var(--surface); color: var(--text);
  align-self: flex-start; border-radius: 4px var(--radius) var(--radius) var(--radius);
  border: 1px solid var(--border);
}
.travel-typing { color: var(--muted); font-size: 1.2rem; letter-spacing: 4px; }
.travel-chat-input-row {
  display: flex; gap: 10px; align-items: center;
}
.travel-chat-input-field {
  flex: 1; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 0.9rem; outline: none; transition: border-color 0.15s;
}
.travel-chat-input-field:focus { border-color: var(--accent); }
.travel-chat-input-field::placeholder { color: var(--muted); }
.cal-list-travel-btn {
  margin-left: auto; flex-shrink: 0;
}

/* ── Task System ─────────────────────────────────────────── */
.detail-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.detail-section-header h4 { font-size: 0.95rem; font-weight: 600; }

/* Progress bar */
.task-progress-wrap {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.task-progress-bar {
  flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.task-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
.task-progress-label { font-size: 0.75rem; color: var(--muted); flex-shrink: 0; }

/* Task rows */
.task-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 6px;
  border-bottom: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--surface2); }
.task-row.task-done { opacity: 0.55; }
.task-row.task-overdue { border-left: 3px solid var(--danger); }
.task-row.task-urgent  { border-left: 3px solid #e0a857; }
.task-row.task-soon    { border-left: 3px solid #5b9cf6; }

/* Checkbox */
.task-check-label { flex-shrink: 0; display: flex; align-items: center; padding-top: 2px; cursor: pointer; }
.task-checkbox { display: none; }
.task-check-custom {
  width: 16px; height: 16px; border: 2px solid var(--border); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.15s;
}
.task-checkbox:checked + .task-check-custom {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.task-checkbox:checked + .task-check-custom::after { content: '✓'; font-size: 0.65rem; font-weight: 700; }

/* Task body */
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 0.85rem; font-weight: 500; word-break: break-word; }
.task-row.task-done .task-title { text-decoration: line-through; }
.task-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.task-goal-date { font-size: 0.75rem; color: var(--muted); }
.task-goal-date.task-overdue, .task-urgency.task-overdue { color: var(--danger); font-weight: 600; }
.task-goal-date.task-urgent,  .task-urgency.task-urgent  { color: var(--warn); font-weight: 600; }
.task-goal-date.task-soon,    .task-urgency.task-soon    { color: var(--accent); }
.task-urgency { font-size: 0.72rem; }

.task-notes-wrap { margin-top: 6px; }
.task-notes-input {
  width: 100%; font-size: 0.8rem; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); resize: vertical; min-height: 50px;
}
.task-notes-save { margin-top: 4px; }

/* Task actions */
.task-actions { display: flex; gap: 4px; flex-shrink: 0; }
.task-email-btn, .task-notes-toggle, .task-del-btn { font-size: 0.78rem; padding: 3px 6px; }

/* Custom task form */
.task-custom-form {
  display: flex; align-items: center; gap: 6px; padding: 8px 0;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.task-custom-form input[type="text"] { font-size: 0.83rem; padding: 5px 8px; }
.task-custom-form input[type="date"] { font-size: 0.83rem; padding: 5px 6px; }

/* All done banner */
.task-all-done {
  text-align: center; padding: 12px; font-size: 0.9rem; font-weight: 600;
  color: var(--success); margin-top: 6px;
  background: rgba(10,143,106,0.07); border-radius: var(--radius-sm);
}

/* Init dialog */
.task-init-overlay { align-items: flex-start; padding-top: 60px; }
.task-init-dialog { max-width: 580px; width: 96%; max-height: 80vh; overflow-y: auto; }
.task-init-list { display: flex; flex-direction: column; gap: 6px; }
.task-init-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}
.task-init-row:last-child { border-bottom: none; }
.task-init-check {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; cursor: pointer;
  font-size: 0.78rem; font-weight: 500; user-select: none; flex-shrink: 0;
  border: 1.5px solid var(--border); color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.task-init-check input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.task-init-check:hover { border-color: var(--accent); color: var(--text); }
.task-init-check:has(input[type="checkbox"]:checked) { background: rgba(39,174,96,0.12); border-color: #27ae60; color: #27ae60; }
.task-init-check:has(input[type="checkbox"]:checked):hover { background: rgba(39,174,96,0.2); }
.task-init-title { flex: 1; font-size: 0.84rem; }
.task-init-dates {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0; flex-wrap: wrap;
  justify-content: flex-end;
}

/* Dashboard To-Do sidebar card */
.todo-sidebar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 14px; margin-top: 12px;
}
.todo-sidebar-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.todo-empty { color: var(--muted); font-size: 0.83rem; padding: 8px 0; text-align: center; }
.todo-item {
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface2);
  display: flex; flex-direction: column; gap: 3px;
  transition: background 0.15s;
}
.todo-item:hover { background: var(--surface); }
.todo-item.task-overdue { border-left: 3px solid var(--danger); }
.todo-item.task-urgent  { border-left: 3px solid #e0a857; }
.todo-item.task-soon    { border-left: 3px solid var(--accent); }
.todo-event-name { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.todo-task-title { font-size: 0.83rem; font-weight: 600; }
.todo-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.todo-date { font-size: 0.73rem; color: var(--muted); }
.todo-date.task-overdue { color: var(--danger); font-weight: 600; }
.todo-date.task-urgent  { color: var(--warn);   font-weight: 600; }
.todo-date.task-soon    { color: var(--accent);  }
.todo-urgency { font-size: 0.72rem; }
.todo-urgency.task-overdue { color: var(--danger); }
.todo-urgency.task-urgent  { color: var(--warn); }
.todo-urgency.task-soon    { color: var(--accent); }
.todo-more { font-size: 0.72rem; color: var(--muted); }
.todo-done-btn { margin-top: 4px; align-self: flex-start; font-size: 0.75rem; padding: 2px 8px; }

/* Task template manager in profile */
.task-template-list { display: flex; flex-direction: column; gap: 2px; }
.task-tmpl-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 4px;
  border-bottom: 1px solid var(--border); font-size: 0.84rem;
}
.task-tmpl-row:last-child { border-bottom: none; }
.task-tmpl-title { flex: 1; }
.task-tmpl-title.tmpl-disabled { color: var(--muted); text-decoration: line-through; }
.task-tmpl-days { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tmpl-days-input { width: 52px !important; }
.task-tmpl-sys { font-size: 0.68rem; color: var(--muted); padding: 2px 5px;
  background: var(--surface2); border-radius: 4px; flex-shrink: 0; }
.task-tmpl-del { font-size: 0.75rem; padding: 2px 6px; flex-shrink: 0; }

/* Toggle switch */
.task-tmpl-toggle { position: relative; display: inline-block; width: 30px; height: 17px; flex-shrink: 0; cursor: pointer; }
.task-tmpl-toggle input { opacity: 0; width: 0; height: 0; }
.tmpl-toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 17px; transition: 0.2s;
}
.tmpl-toggle-slider::before {
  content: ''; position: absolute; height: 11px; width: 11px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: 0.2s;
}
input:checked + .tmpl-toggle-slider { background: var(--accent); }
input:checked + .tmpl-toggle-slider::before { transform: translateX(13px); }

/* Memories section */
.memories-highlight-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--muted);
  user-select: none;
}
.memories-highlight-toggle input { accent-color: var(--accent); cursor: pointer; }
.memories-posts-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;
}
.memory-post-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface2); margin-bottom: 6px;
}
.memory-post-platform { font-size: 1rem; flex-shrink: 0; }
.memory-post-info { flex: 1; min-width: 0; }
.memory-post-url {
  font-size: 0.82rem; color: var(--accent); text-decoration: none;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.memory-post-url:hover { text-decoration: underline; }
.memory-post-caption { font-size: 0.78rem; color: var(--muted); margin-top: 1px; }

/* Itinerary display */
.itin-card { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.itin-block { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.itin-block-header {
  padding: 7px 14px; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  background: var(--surface2); color: var(--muted); border-bottom: 1px solid var(--border);
}
.itin-block-flight .itin-block-header { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.itin-block-hotel  .itin-block-header { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
[data-theme="dark"] .itin-block-flight .itin-block-header { background: rgba(147,197,253,0.12); color: #93c5fd; border-color: rgba(147,197,253,0.25); }
[data-theme="dark"] .itin-block-hotel  .itin-block-header { background: rgba(134,239,172,0.1); color: #86efac; border-color: rgba(134,239,172,0.25); }
.itin-block-body { padding: 12px 14px; background: var(--surface); }
.itin-block-body + .itin-block-body { border-top: 1px solid var(--border); }
.itin-flight-route { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.itin-flight-num   { font-weight: 700; font-size: 0.9rem; color: var(--accent); flex-shrink: 0; }
.itin-flight-cities { font-size: 0.95rem; font-weight: 600; }
.itin-flight-meta  { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.82rem; color: var(--muted); }
.itin-hotel-name   { font-size: 0.95rem; font-weight: 600; margin-bottom: 5px; }
.itin-hotel-dates  { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.83rem; color: var(--muted); }
.itin-hotel-dates strong { color: var(--text); }
.itin-conf-row     { font-size: 0.78rem; color: var(--muted); margin-top: 5px; }
.itin-conf-row strong { color: var(--text); }
.itin-misc-line    { font-size: 0.83rem; padding: 1px 0; }

/* Verification results */
.itin-verify-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.itin-verify-title { font-size: 0.8rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.itin-verify-row { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0;
  border-bottom: 1px solid var(--border); }
.itin-verify-row:last-child { border-bottom: none; }
.itin-verify-icon { font-size: 1rem; flex-shrink: 0; }
.itin-verify-check { font-size: 0.83rem; font-weight: 600; }
.itin-verify-detail { font-size: 0.78rem; color: var(--muted); }
.itin-verify-fail .itin-verify-check { color: var(--danger); }
.itin-verify-warn .itin-verify-check { color: var(--warn); }
.itin-verify-pass .itin-verify-check { color: var(--success); }
.itin-verify-error { color: var(--danger); font-size: 0.83rem; padding: 8px; }

/* ── Help button ─────────────────────────────────────────── */
.btn-help {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--surface2);
  color: var(--muted); font-size: 0.85rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-help:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* ── Help modal ──────────────────────────────────────────── */
.help-modal-box { max-width: 520px; }
.help-modal-content { padding: 4px 0 2px; }
.help-section-desc {
  font-size: 0.9rem; color: var(--muted); margin-bottom: 16px; line-height: 1.5;
}
.help-highlights { display: flex; flex-direction: column; gap: 8px; }
.help-highlight {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 10px 12px; border-left: 3px solid var(--accent);
}
.help-highlight-icon { font-size: 1.1rem; flex-shrink: 0; }
.help-highlight-text { font-size: 0.84rem; line-height: 1.45; }
.help-highlight-title { font-weight: 600; margin-bottom: 2px; }
.help-highlight-desc { color: var(--muted); }

/* ── Card task badge ─────────────────────────────────────── */
.card-footer-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.card-task-badge {
  font-size: 0.72rem; font-weight: 600;
  background: var(--accent-dim); color: var(--accent);
  border-radius: 10px; padding: 2px 7px; white-space: nowrap;
}
.card-task-all-done {
  background: rgba(10,143,106,0.1); color: var(--success);
}

/* ── Contracts ───────────────────────────────────────────── */
.contracts-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.contracts-header h2 { margin: 0; font-size: 1.3rem; }
.contracts-filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

.contract-upload-panel {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.contract-drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.88rem; color: var(--muted); margin-top: 12px;
}
.contract-drop-zone:hover, .contract-drop-zone.drag-over {
  border-color: var(--accent); background: rgba(91,156,246,0.05);
}
.contract-drop-icon { font-size: 2rem; margin-bottom: 8px; }

.contract-list { display: flex; flex-direction: column; gap: 8px; }
.contract-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.contract-row:hover { border-color: var(--accent); background: var(--surface3, var(--surface2)); }
.contract-row-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.contract-row-name { font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contract-row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contract-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.contract-row-sm { padding: 8px 12px; }
.contract-row-sm .contract-row-left { flex-direction: row; align-items: center; gap: 8px; }

.contract-badge {
  font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.contract-badge-baseline { background: rgba(91,156,246,0.15); color: #5b9cf6; }
.contract-badge-review   { background: rgba(224,168,87,0.15); color: #e0a857; }
.contract-event-link { font-size: 0.78rem; color: var(--muted); }
.contract-analyzed-dot { font-size: 0.78rem; color: var(--success); font-weight: 600; }

/* Contract detail modal */
.contract-modal-box {
  width: min(760px, 95vw); max-height: 88vh;
  display: flex; flex-direction: column;
}
.contract-modal-body {
  overflow-y: auto; padding: 16px 0; flex: 1;
}
.analysis-section {
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px;
  background: var(--surface2); border: 1px solid var(--border);
}
.analysis-section-title {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 8px; color: var(--text);
}
.analysis-section-body { font-size: 0.86rem; color: var(--text); line-height: 1.65; }
.analysis-covered { border-color: rgba(10,143,106,0.3); background: rgba(10,143,106,0.06); }
.analysis-covered .analysis-section-title { color: var(--success); }
.analysis-missing  { border-color: rgba(224,168,87,0.35); background: rgba(224,168,87,0.07); }
.analysis-missing  .analysis-section-title { color: #e0a857; }
.analysis-red      { border-color: rgba(217,44,44,0.35); background: rgba(217,44,44,0.07); }
.analysis-red      .analysis-section-title { color: var(--danger); }

/* ── AI Chat ─────────────────────────────────────────────── */
#ai-chat-fab {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 900;
  width: 52px; height: 52px; border-radius: 50%;
  background: #dbeafe; color: #1d4ed8;
  border: 2px solid #93c5fd;
  font-size: 1.3rem; cursor: pointer; box-shadow: 0 4px 16px rgba(147,197,253,0.35);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
#ai-chat-fab:hover  { transform: translateX(-50%) scale(1.08); background: #bfdbfe; box-shadow: 0 6px 22px rgba(147,197,253,0.5); }
#ai-chat-fab.active { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
[data-theme="dark"] #ai-chat-fab {
  background: rgba(147,197,253,0.15); color: #93c5fd; border-color: rgba(147,197,253,0.35);
}
[data-theme="dark"] #ai-chat-fab:hover { background: rgba(147,197,253,0.25); }

.ai-chat-panel {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%); z-index: 901;
  width: 380px; max-width: calc(100vw - 32px);
  height: 520px; max-height: calc(100vh - 110px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  display: flex; flex-direction: column; overflow: hidden;
}
.ai-chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-chat-header-left { display: flex; align-items: center; gap: 10px; }
.ai-chat-avatar { font-size: 1.4rem; }
.ai-chat-title { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.ai-chat-subtitle { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.ai-chat-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1rem; padding: 4px 8px;
  border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.ai-chat-close:hover { color: var(--text); background: var(--surface2); }

.ai-chat-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-chat-welcome {
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 0.83rem; color: var(--muted); line-height: 1.5;
}
.ai-chat-welcome em { color: var(--accent); font-style: normal; }

.ai-chat-msg { display: flex; }
.ai-chat-msg-user  { justify-content: flex-end; }
.ai-chat-msg-assistant { justify-content: flex-start; }
.ai-chat-bubble {
  max-width: 88%; padding: 9px 13px; border-radius: 14px;
  font-size: 0.84rem; line-height: 1.55;
}
.ai-chat-msg-user .ai-chat-bubble {
  background: var(--accent); color: #fff; border-bottom-right-radius: 4px;
}
.ai-chat-msg-assistant .ai-chat-bubble {
  background: var(--surface2); color: var(--text); border-bottom-left-radius: 4px;
}

/* Typing indicator */
.ai-chat-typing .ai-chat-bubble {
  display: flex; align-items: center; gap: 4px; padding: 12px 16px;
}
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); display: inline-block;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}

.ai-chat-nav-note {
  text-align: center; font-size: 0.75rem; color: var(--muted);
  padding: 4px 0; font-style: italic;
}

.ai-chat-input-bar {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.ai-chat-input {
  flex: 1; resize: none; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px;
  background: var(--surface2); color: var(--text);
  font-size: 0.84rem; line-height: 1.4; max-height: 120px;
  font-family: inherit; overflow-y: auto;
}
.ai-chat-input:focus { outline: none; border-color: var(--accent); }
.ai-chat-send {
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 9px 14px; cursor: pointer;
  font-size: 0.9rem; flex-shrink: 0; transition: background 0.15s;
}
.ai-chat-send:hover    { background: var(--accent-hover, var(--accent)); filter: brightness(1.1); }
.ai-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-mic-btn {
  background: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 10px; cursor: pointer; font-size: 0.9rem; flex-shrink: 0;
  color: var(--muted); transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ai-mic-btn:hover { color: var(--text); border-color: var(--accent); }
.ai-mic-btn.listening {
  background: rgba(217,44,44,0.1); color: var(--danger);
  border-color: var(--danger); animation: mic-pulse 1s infinite;
}
@keyframes mic-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ── Weather Pills (occurrence rows) ─────────────────────── */
.weather-pill {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid transparent; border-radius: 12px;
  padding: 1px 7px; font-size: 0.7rem; font-weight: 500;
  cursor: pointer; transition: background 0.15s, color 0.15s;
  vertical-align: middle; margin-left: 6px; white-space: nowrap;
}
.weather-pill:hover { background: var(--accent); color: #fff; }

/* Forecast button on imminent banners */
.btn-forecast {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(100,149,237,0.13); border: 1px solid rgba(100,149,237,0.3);
  border-radius: 12px; padding: 2px 10px; cursor: pointer;
  font-size: 0.76rem; color: var(--text); transition: background 0.15s;
  margin-left: 8px; vertical-align: middle; white-space: nowrap;
}
.btn-forecast:hover { background: rgba(100,149,237,0.28); }

/* Forecast modal */
.forecast-modal-box {
  max-width: 700px; width: 95vw;
  max-height: 88vh; display: flex; flex-direction: column;
}
.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 10px; padding: 4px 0 8px;
}
.forecast-day {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 6px;
  text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.forecast-day.forecast-day-event {
  border-color: var(--accent); background: var(--accent-dim);
}
.forecast-date  { font-size: 0.74rem; font-weight: 600; color: var(--muted); line-height: 1.2; }
.forecast-icon  { font-size: 1.6rem; line-height: 1.1; }
.forecast-desc  { font-size: 0.66rem; color: var(--muted); line-height: 1.2; }
.forecast-temps { display: flex; gap: 5px; align-items: baseline; }
.forecast-high  { font-weight: 700; font-size: 0.9rem; }
.forecast-low   { font-size: 0.78rem; color: var(--muted); }
.forecast-precip{ font-size: 0.68rem; color: var(--muted); }

/* Single-day featured forecast card */
.forecast-featured-day {
  text-align: center; padding: 28px 20px 20px;
  background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: var(--radius); margin-bottom: 14px;
}
.forecast-featured-label { font-size: 1.1rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.forecast-featured-icon  { font-size: 3.6rem; line-height: 1.1; margin: 8px 0; }
.forecast-featured-desc  { font-size: 1rem; margin-bottom: 10px; }
.forecast-featured-temps { font-size: 1.5rem; font-weight: 700; display: flex; justify-content: center; align-items: baseline; gap: 4px; }
.forecast-sep            { color: var(--muted); font-weight: 400; }
.forecast-other-days     { margin-top: 4px; }
.forecast-other-days summary {
  cursor: pointer; font-size: 0.8rem; color: var(--muted);
  padding: 6px 0; user-select: none; list-style: none;
}
.forecast-other-days summary:hover { color: var(--text); }

/* Weather & Packing section inside travel modal */
.weather-season-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 10px;
}
.weather-season-icon { font-size: 2.2rem; line-height: 1; flex-shrink: 0; }
.weather-season-name { font-weight: 600; font-size: 0.95rem; }
.weather-temp-range  { font-size: 0.88rem; color: var(--accent); font-weight: 500; margin-top: 2px; }
.weather-packing-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-top: 12px;
}
.weather-packing-title {
  font-weight: 600; font-size: 0.8rem;
  margin-bottom: 6px; color: var(--muted);
}
@media (max-width: 480px) {
  .weather-packing-grid { grid-template-columns: 1fr; }
  .forecast-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}

/* ── Hamburger (hidden on desktop) ───────────────────────── */
.nav-hamburger { display: none; }

/* ═══════════════════════════════════════════════════════════
   MOBILE  ≤ 768px
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Hamburger button ── */
  .nav-hamburger {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text);
    font-size: 1.3rem; width: 36px; height: 36px;
    border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0;
  }
  .nav-hamburger:hover { background: var(--surface2); }

  /* ── Nav links → full-width dropdown ── */
  .topnav-center { justify-content: flex-end; gap: 4px; }

  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 300;
    flex-direction: column;
    background: var(--surface2); border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow-lg); padding: 6px 0;
  }
  .nav-links.mobile-open { display: flex; }
  .nav-btn {
    padding: 13px 20px; border-radius: 0;
    text-align: left; font-size: 0.95rem; width: 100%;
  }

  /* ── Main content padding ── */
  .main-content { padding: 12px; }

  /* ── Form rows → single column ── */
  .form-row { flex-direction: column; gap: 8px; }
  .form-row .form-group { width: 100% !important; min-width: 0 !important; }

  /* ── Modals → full-width sheet (slides up from bottom) ── */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box,
  .modal-wide {
    width: 100vw; max-width: 100vw;
    max-height: 95vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 16px 24px;
  }
  #task-org-modal .modal-box { max-height: 95vh; width: 100vw; max-width: 100vw; }
  #quick-add-editor-modal .modal-box { max-width: 100vw; }

  /* ── Travel modal ── */
  .travel-modal-box {
    width: 100vw; max-width: 100vw; max-height: 95vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  /* ── Wizard → true full screen ── */
  .wizard-box {
    width: 100vw; max-width: 100vw;
    min-height: 100vh; max-height: 100vh;
    border-radius: 0; padding: 20px 16px 32px;
  }

  /* ── Close button — pinned top-right, always tappable ── */
  .modal-box, .modal-wide, .travel-modal-box { position: relative; }
  .modal-close {
    position: absolute; top: 12px; right: 12px;
    width: 40px; height: 40px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface2); border-radius: 50%;
    font-size: 1.1rem; z-index: 2;
  }
  .modal-header { padding-right: 52px; flex-wrap: wrap; }
  .modal-header-actions { flex-wrap: wrap; gap: 6px; }

  /* ── Calendar toolbar → stacked ── */
  .fc .fc-toolbar {
    flex-direction: column !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
  }
  .fc .fc-toolbar-chunk {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  .fc .fc-toolbar-title {
    white-space: normal !important;
    text-align: center !important;
    font-size: 1rem !important;
  }
  .cal-search-input { width: 100%; max-width: 100%; }

  /* ── Wizard tour → 2 columns (not 3) ── */
  .wz-tour-screens { grid-template-columns: 1fr 1fr !important; }

  /* ── Journey search inputs → stretch ── */
  .journey-search-bar { flex-wrap: wrap; }
  .journey-search-bar input { width: 100% !important; flex: 1; min-width: 0; }

  /* ── Journey: map first on mobile, timeline below ── */
  .journey-body { display: flex !important; flex-direction: column; }
  .journey-map-col  { order: -1; }
  .journey-timeline-col { order: 1; }

  /* ── Journey visited stats → compact on mobile ── */
  .journey-visited-stats { gap: 6px; margin-bottom: 10px; }
  .jvs-card { padding: 10px 12px; min-width: 80px; }
  .jvs-num  { font-size: 1.6rem; }
  .jvs-lbl  { font-size: 0.62rem; margin-top: 4px; }
  .jvs-card.jvs-continent { min-width: 160px; }
}

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