/* ── Variables ─────────────────────────────────────── */
:root {
  --accent: #e5a00d;
  --accent-dim: #c4880a;
  --bg-base: #1a1a2e;
  --bg-surface: #16213e;
  --bg-card: #0f3460;
  --bg-hover: #1e2d5a;
  --text-primary: #e8e8e8;
  --text-secondary: #9a9ab0;
  --text-dim: #555575;
  --border: #2a2a4a;
  --topnav-h: 60px;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 8px;
  --radius-sm: 4px;
}

/* ── Reset / base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); }
h1, h2, h3, h4 { color: var(--text-primary); margin: 0 0 .75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
input, select, textarea {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  width: 100%;
  font-size: .875rem;
  font-family: inherit;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
select option { background: var(--bg-surface); }

/* ── Clearable search boxes (wrapped at runtime by initClearableSearch in app.js) ── */
.search-box { position: relative; display: inline-block; }
.search-box input { width: 100%; padding-right: 1.8rem; }
.search-clear {
  position: absolute; top: 50%; right: .35rem; transform: translateY(-50%);
  display: none; align-items: center; justify-content: center;
  width: 1.3rem; height: 1.3rem; padding: 0; border: none; border-radius: 50%;
  background: transparent; color: var(--text-secondary); font-size: .82rem; line-height: 1;
  cursor: pointer;
}
.search-clear:hover { background: var(--bg-hover); color: var(--text-primary); }
.search-box.has-value .search-clear { display: flex; }

/* ── Top navigation bar ────────────────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 200;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.topnav-brand-logo { height: 42px; width: auto; display: block; }
.topnav-brand-text { display: flex; flex-direction: column; line-height: 1; }
.topnav-brand-name { font-size: 1rem; font-weight: 800; color: var(--accent); letter-spacing: -.01em; }
.topnav-brand-sub { font-size: .68rem; font-weight: 600; color: var(--text-dim); letter-spacing: .02em; margin-top: -1px; }

.topnav-links {
  display: flex;
  align-items: center;
  gap: .15rem;
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0 1rem;
}
.topnav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.topnav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.topnav-link.active { background: var(--bg-hover); color: var(--accent); }
.topnav-link .nav-icon { font-size: .9rem; }

.topnav-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
  margin-left: auto;
}
.topnav-user {
  font-size: .8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.topnav-user-dot {
  width: 8px; height: 8px;
  background: var(--success); border-radius: 50%;
}
.topnav-signout {
  font-size: .8rem;
  color: var(--text-dim);
  padding: .3rem .65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: color .15s, border-color .15s;
}
.topnav-signout:hover { color: var(--error); border-color: rgba(239,68,68,.4); }

/* Mobile hamburger in topnav */
.topnav-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 4px; flex-direction: column; gap: 4px;
}
.topnav-hamburger span { display: block; width: 20px; height: 2px; background: var(--text-primary); border-radius: 2px; }

/* Mobile dropdown nav */
.mobile-nav-menu {
  display: none;
  position: fixed;
  top: var(--topnav-h); left: 0; right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: .5rem 1rem;
  z-index: 199;
  flex-direction: column;
  gap: .2rem;
}
.mobile-nav-menu.open { display: flex; }
.mobile-nav-menu .topnav-link { width: 100%; }

/* Main content area */
.content {
  padding: calc(var(--topnav-h) + 1.75rem) 2rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
}

@media (max-width: 768px) {
  .topnav-links { display: none; }
  .topnav-hamburger { display: flex; }
  .topnav-right .topnav-user { display: none; }
  .content { padding: calc(var(--topnav-h) + 1rem) 1rem 1rem; }
  /* iOS/mobile Safari auto-zooms on focus into any field under 16px — this
     is what causes the page to stay zoomed in after closing a modal. */
  input, select, textarea, .ql-editor, textarea.html-source-area, span.list-row-text { font-size: 16px; }
  /* .btn-xs/.btn-icon are sized for dense desktop rows; on touch they're
     under the 44px (iOS) / 48dp (Android) tap-target minimum, which is
     risky next to destructive actions like note delete. */
  .btn-xs { padding: .5rem .75rem; font-size: .8rem; min-height: 40px; }
  .btn-icon { padding: .55rem; min-width: 40px; min-height: 40px; }
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: var(--radius);
  border: none; cursor: pointer; font-size: .875rem;
  font-family: inherit; font-weight: 600;
  transition: background .15s, opacity .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: #000; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dim); color: #000; }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-danger   { background: transparent; color: var(--error); border: 1px solid rgba(239,68,68,.4); }
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.12); border-color: var(--error); }
.btn-ghost    { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); border-color: var(--text-secondary); }
.btn-sm   { padding: .3rem .7rem; font-size: .78rem; }
.btn-xs   { padding: .2rem .5rem; font-size: .8rem; }
.btn-icon { padding: .35rem; border-radius: var(--radius-sm); }
.btn-full { width: 100%; justify-content: center; }

/* ── Page header ───────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.75rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-header h2 { margin: 0; }
.page-title-group { display: flex; flex-direction: column; gap: .2rem; }
.page-subtitle { color: var(--text-secondary); font-size: .85rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem;
  padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.card-title { font-size: .9rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.tile-title-link { color: inherit; text-decoration: none; }
.tile-title-link:hover { text-decoration: underline; }

.car-icon-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 50%;
  font-size: 17px; line-height: 1; flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--border);
  vertical-align: -8px;
}

/* ── Stat cards ────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.stat-value { font-size: 2.2rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.stat-card-link { cursor: pointer; transition: border-color .15s, background .15s; }
.stat-card-link:hover { border-color: var(--accent); background: var(--bg-hover); }

/* ── Tables ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
}
.data-table th {
  text-align: left; color: var(--text-dim);
  font-weight: 600; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .05em; padding: .5rem .75rem;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text-primary); }
.data-table th.sortable::after { content: '↕'; margin-left: .3rem; opacity: .35; font-size: .7em; }
.data-table th.sort-asc::after  { content: '▲'; opacity: .9; }
.data-table th.sort-desc::after { content: '▼'; opacity: .9; }

/* ── Alerts ────────────────────────────────────────── */
.alert {
  padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  font-size: .875rem; display: flex; align-items: center; gap: .6rem;
}
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-info    { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }

/* ── Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: .74rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-sm);
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
.badge-todo      { background: rgba(239,68,68,.15);   color: #fca5a5; }
.badge-doing     { background: rgba(245,158,11,.15);  color: #fcd34d; }
.badge-done      { background: rgba(34,197,94,.15);   color: #86efac; }
.badge-future    { background: rgba(139,92,246,.15); color: #c4b5fd; }
.badge-active    { background: rgba(59,130,246,.15);  color: #93c5fd; }
.badge-completed { background: rgba(34,197,94,.15);   color: #86efac; }
.badge-paused    { background: rgba(156,163,175,.12); color: #9ca3af; }
.badge-admin     { background: rgba(168,85,247,.15);  color: #d8b4fe; }
.badge-user      { background: rgba(156,163,175,.12); color: #9ca3af; }
.badge-enabled   { background: rgba(34,197,94,.15);   color: #86efac; }
.badge-disabled  { background: rgba(239,68,68,.15);   color: #fca5a5; }

/* ── Login / register page ─────────────────────────── */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-base);
}
.login-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 2.5rem; width: 100%; max-width: 400px;
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 2rem; }
.login-brand-logo { height: 70px; width: auto; flex-shrink: 0; }
.login-brand-text { text-align: left; }
.login-brand-name { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -.02em; line-height: 1; }
.login-brand-manager { font-size: .78rem; font-weight: 600; color: var(--text-dim); letter-spacing: .02em; margin-top: -.3rem; }
.login-brand-sub  { font-size: .8rem; color: var(--text-secondary); margin-top: .25rem; }
.login-field { margin-bottom: 1rem; }
.login-field label { display: block; margin-bottom: .35rem; color: var(--text-secondary); font-size: .8rem; }

/* ── WYSIWYG editor (Quill wrapper) ────────────────── */
.editor-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.editor-tabs {
  display: flex; background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.editor-tab {
  padding: .4rem .9rem; font-size: .78rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; border: none;
  background: none; font-family: inherit;
  border-bottom: 2px solid transparent; transition: color .15s;
}
.editor-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.editor-tab:hover:not(.active) { color: var(--text-primary); }
.editor-panel { display: none; }
.editor-panel.active { display: block; }
/* Quill overrides */
.ql-container { background: var(--bg-surface) !important; color: var(--text-primary) !important;
  font-size: .875rem !important; font-family: inherit !important; min-height: 220px; border: none !important; }
.ql-toolbar { background: var(--bg-card) !important; border-color: var(--border) !important; border-left: none !important; border-right: none !important; border-top: none !important; }
.ql-toolbar .ql-stroke   { stroke: var(--text-secondary) !important; }
.ql-toolbar .ql-fill     { fill:  var(--text-secondary) !important; }
.ql-toolbar .ql-picker-label { color: var(--text-secondary) !important; }
.ql-toolbar .ql-picker-options { background: var(--bg-card) !important; border-color: var(--border) !important; }
.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent) !important; }
.ql-toolbar button:hover .ql-fill,
.ql-toolbar button.ql-active .ql-fill   { fill:  var(--accent) !important; }
.ql-editor { color: var(--text-primary) !important; min-height: 220px; padding: 1rem !important; }
/* Custom toolbar buttons (clear formatting / insert date) — sized to match Quill's built-in icons */
.ql-toolbar button.ql-custom-btn svg { width: 18px; height: 18px; }
.ql-editor.ql-blank::before { color: var(--text-dim) !important; }
.html-source-area {
  width: 100%; min-height: 260px; display: block;
  background: #0a0a14; color: #c8d3f5; border: none; border-radius: 0;
  padding: 1rem; font-family: 'Courier New', monospace; font-size: .8rem; resize: vertical;
}
.html-source-area:focus { outline: none; }

/* ── Upload / attachments ──────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 1rem 1.5rem; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex; align-items: center; gap: .75rem; justify-content: center;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent); background: rgba(229,160,13,.05);
}
.upload-zone input[type="file"] { display: none; }
.upload-zone-hint { font-size: .8rem; color: var(--text-dim); }
.attachments-list { display: flex; flex-direction: column; gap: .4rem; margin-top: .75rem; }
.attachment-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .6rem; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border); font-size: .8rem;
}
.attachment-icon { color: var(--text-dim); flex-shrink: 0; }
.attachment-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer; user-select: none;
}
.attachment-name.expanded { white-space: normal; word-break: break-word; overflow: visible; text-overflow: clip; }
.attachment-size { color: var(--text-dim); flex-shrink: 0; font-size: .8rem; }
.attachment-actions { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }

/* ── Journal ───────────────────────────────────────── */
.journal-list { display: flex; flex-direction: column; gap: .75rem; }
.journal-entry-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; cursor: pointer; transition: border-color .15s, background .15s;
}
.journal-entry-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.journal-entry-date { font-size: .8rem; color: var(--text-dim); margin-bottom: .25rem; }
.journal-entry-title { font-weight: 600; font-size: .95rem; }
.journal-entry-preview {
  font-size: .8rem; color: var(--text-secondary); margin-top: .25rem;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ── Project cards ─────────────────────────────────── */
.project-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.project-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.1rem; cursor: pointer; transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: .5rem;
}
.project-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.project-card-name { font-weight: 700; font-size: .95rem; }
.project-card-desc { font-size: .8rem; color: var(--text-secondary); line-height: 1.4; }
.project-card-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fav-btn { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0; line-height: 1; flex-shrink: 0; }

/* ── Project detail: full-width notes, tiles row below ── */
.project-detail-grid { margin-bottom: 1.5rem; }

.project-tiles-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: start;
}
@media (max-width: 900px) { .project-tiles-row { grid-template-columns: 1fr; } }

/* Same idea, one more column — Garage's car detail page (Info/Tasks/Service/Reminders) */
.project-tiles-row-4 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; align-items: start;
}
@media (max-width: 1100px) { .project-tiles-row-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .project-tiles-row-4 { grid-template-columns: 1fr; } }

/* ── Garage ─────────────────────────────────────────── */
.car-thumb {
  position: relative; width: 64px; height: 64px; flex-shrink: 0;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-card); border: 1px solid var(--border);
}
.car-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.car-thumb-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 1.7rem; }
.car-clickable { cursor: pointer; }
.car-card-tasks-divider { border-top: 1px solid var(--border); margin: .6rem 0; }
.task-item-sm { padding: .3rem .4rem; }
.task-item-sm .task-title { font-size: .82rem; }

/* All-cars page: 2-up grid with a bigger photo per tile */
.car-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 800px) { .car-grid { grid-template-columns: 1fr; } }

.car-thumb-lg { width: 140px; height: 140px; }
.car-thumb-lg .car-thumb-fallback { font-size: 2.75rem; }

.car-card-section { margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.car-card-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.car-card-section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-dim); }
.car-card-section-viewall { font-size: .78rem; }

.photo-widget { display: flex; align-items: center; gap: 1rem; }
.photo-widget-preview {
  position: relative; width: 96px; height: 96px; flex-shrink: 0;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-card); border: 1px solid var(--border);
}
.photo-widget-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.photo-widget-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2rem; color: var(--text-dim); }
.photo-widget input[type="file"] { display: none; }

/* ── Notes feed ────────────────────────────────────── */
.notes-feed { display: flex; flex-direction: column; gap: .35rem; }
.note-accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-card); }
.note-acc-header {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .85rem; cursor: pointer; user-select: none;
}
.note-acc-header:hover { background: var(--bg-hover); }
.note-acc-chevron { font-size: .6rem; color: var(--text-dim); flex-shrink: 0; }
.note-acc-title { flex: 1; font-size: .875rem; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-acc-meta { font-size: .8rem; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; }
.note-acc-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.note-acc-body { padding: .9rem 1rem; border-top: 1px solid var(--border); }
.note-content { font-size: .875rem; line-height: 1.65; word-break: break-word; }
.note-content img { max-width: 100%; border-radius: var(--radius-sm); height: auto; }

/* ── Tasks ─────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: .4rem; }
.task-item {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .75rem .9rem; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius); transition: background .1s;
}
.task-item:hover { background: var(--bg-hover); }
.task-body { flex: 1; min-width: 0; }
.task-clickable { cursor: pointer; }
.task-clickable:hover .task-title { color: var(--accent); }
.task-title { font-size: .875rem; font-weight: 500; margin-bottom: .2rem; }
.task-title.done { text-decoration: line-through; color: var(--text-dim); }
.task-meta { font-size: .82rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.task-project-tag { color: var(--accent); font-size: .78rem; font-weight: 600; background: rgba(229,160,13,.1); padding: 1px 6px; border-radius: 3px; }
.task-actions { display: flex; gap: .25rem; flex-shrink: 0; }
.task-due-overdue { color: var(--error); }
.task-due-soon    { color: var(--warning); }

.quick-add {
  display: flex; gap: .5rem; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .5rem .75rem; margin-bottom: 1rem;
}
.quick-add input { background: none; border: none; padding: .2rem 0; flex: 1; font-size: .875rem; }
.quick-add input:focus { outline: none; }

/* ── Section headers ───────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.section-title { font-size: .8rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }

/* ── Pagination ────────────────────────────────────── */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1.5rem; }
.page-btn {
  padding: .35rem .7rem; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm); cursor: pointer; font-size: .8rem;
  font-family: inherit;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Loading / empty states ────────────────────────── */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; gap: .75rem; color: var(--text-secondary); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .4; }
.empty-state-text { font-size: .9rem; }

/* ── Modal ─────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7); z-index: 400;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.75rem; width: 100%;
  max-width: 560px; max-height: 90vh; overflow-y: auto;
}
.modal-lg { max-width: 1000px; }
.modal-xl { max-width: 1200px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-dim); font-size: 1.25rem; line-height: 1; padding: 0; transition: color .15s; }
.modal-close:hover { color: var(--text-primary); }
.modal-footer { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ── Form helpers ──────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .35rem; color: var(--text-secondary); font-size: .8rem; font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: .8rem; color: var(--text-dim); margin-top: .3rem; }

/* ── Toggle ────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.toggle-wrap input[type="checkbox"] { width: auto; display: none; }
.toggle-track { width: 36px; height: 20px; flex-shrink: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; position: relative; transition: background .2s; }
.toggle-track::after { content: ''; position: absolute; width: 14px; height: 14px; background: var(--text-dim); border-radius: 50%; top: 2px; left: 2px; transition: transform .2s, background .2s; }
.toggle-wrap input:checked + .toggle-track { background: rgba(229,160,13,.25); border-color: var(--accent); }
.toggle-wrap input:checked + .toggle-track::after { transform: translateX(16px); background: var(--accent); }
.toggle-label { font-size: .85rem; color: var(--text-secondary); }

/* ── Settings module reorder ────────────────────────── */
.drag-handle {
  cursor: grab; color: var(--text-dim); font-size: 1.1rem; line-height: 1;
  touch-action: none; user-select: none; flex-shrink: 0; padding: .2rem .1rem;
}
.settings-module-row.dragging { opacity: .6; background: var(--bg-hover); border-radius: var(--radius-sm); }

/* ── Responsive helpers ────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr; } }
.flex-wrap-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ── Lists module ──────────────────────────────────── */
.list-active-rows, .list-done-rows { display: flex; flex-direction: column; gap: .35rem; }
.list-row {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .7rem; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.list-row.dragging { opacity: .6; background: var(--bg-hover); }
.list-row-checked { opacity: .65; }
.list-row-checked .list-row-text { text-decoration: line-through; color: var(--text-dim); }
.list-item-checkbox { width: auto; flex-shrink: 0; margin: 0; }
.list-row-text { flex: 1; min-width: 0; font-size: .875rem; outline: none; word-break: break-word; }
.list-row-text[contenteditable="true"] { cursor: text; border-radius: 4px; padding: .1rem .3rem; margin: -.1rem -.3rem; }
.list-row-text[contenteditable="true"]:focus { background: var(--bg-hover); }
.list-row-divider { background: none; border: none; padding: .3rem 0; }
.list-divider-line { flex: 1; height: 1px; background: var(--border); }
.list-row-divider .list-row-text { flex: none; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.list-row-comment .list-row-text { font-style: italic; color: var(--text-secondary); }
.list-item-del { flex-shrink: 0; }

/* ── Toast ─────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 500; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1rem; font-size: .85rem; color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,.4); animation: slideIn .2s ease;
  min-width: 230px; max-width: 320px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.info    { border-left: 3px solid var(--info); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Utility ───────────────────────────────────────── */
.text-muted  { color: var(--text-secondary); }
.text-dim    { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--error); }
.text-sm { font-size: .8rem; }
.text-xs { font-size: .8rem; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.flex-1 { flex: 1; } .min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-wrap { white-space: nowrap; }
.hidden { display: none !important; }
.gap-sm { gap: .5rem; } .gap-md { gap: 1rem; }
.w-full { width: 100%; }

/* ── Project child tiles (inside project card) ─────── */
.project-card-children {
  display: flex; flex-direction: column; gap: .3rem;
  margin-top: .25rem; padding-top: .5rem;
  border-top: 1px solid var(--border);
}
.project-child-item {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .3rem .5rem; border-radius: var(--radius-sm);
  background: var(--bg-card); font-size: .78rem;
  cursor: pointer; transition: background .12s;
}
.project-child-item:hover { background: var(--bg-hover); }
.project-child-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card-more-children { font-size: .8rem; color: var(--text-dim); padding: .2rem .5rem; }

/* ── Accordion (project detail sub-projects) ────────── */
.accordion-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: .5rem; overflow: hidden;
}
.accordion-header {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .75rem 1rem; background: var(--bg-surface);
  cursor: pointer; user-select: none;
  transition: background .12s;
}
.accordion-header:hover { background: var(--bg-hover); }
.accordion-header-left { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; }
.accordion-header-right { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.accordion-chevron { font-size: .82rem; color: var(--text-dim); width: 1rem; text-align: center; flex-shrink: 0; transition: transform .15s; }
.accordion-item-name { font-weight: 600; font-size: .9rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-badge {
  font-size: .74rem; color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 99px; white-space: nowrap; flex-shrink: 0;
}
.accordion-body {
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  background: var(--bg-base);
}
.accordion-sub-section { padding-top: .75rem; margin-top: .75rem; border-top: 1px solid var(--border); }
.accordion-sub-section .accordion-item { background: var(--bg-surface); }
.accordion-sub-section .accordion-header { background: var(--bg-card); }
.accordion-sub-section .accordion-body { background: var(--bg-surface); }

/* Full-width notes inside accordion, tiles row below (shares .project-tiles-row) */
.acc-detail-grid { margin-bottom: 1.25rem; }

/* ── Theme overrides ───────────────────────────────── */
[data-theme="midnight"] {
  --bg-base: #0d0d0d;
  --bg-surface: #141414;
  --bg-card: #1c1c2e;
  --bg-hover: #252540;
  --accent: #6c63ff;
  --accent-dim: #5a52e0;
  --text-primary: #e8e8ff;
  --text-secondary: #9090c0;
  --text-dim: #505070;
  --border: #2a2a4a;
}
[data-theme="forest"] {
  --bg-base: #0f1a0f;
  --bg-surface: #141f14;
  --bg-card: #1a2b1a;
  --bg-hover: #223022;
  --accent: #4caf50;
  --accent-dim: #3d8b40;
  --text-primary: #dff0df;
  --text-secondary: #8fb89f;
  --text-dim: #506050;
  --border: #2a402a;
}
[data-theme="light"] {
  --bg-base: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #e8ecf4;
  --accent: #1565c0;
  --accent-dim: #0d47a1;
  --text-primary: #1a1a2e;
  --text-secondary: #444466;
  --text-dim: #888899;
  --border: #d0d4db;
}
/* Medium-brightness themes — muted, mid-contrast palettes that sit between
   the vivid dark themes above and the stark white Light theme. Modeled on
   some of the most widely used color schemes in the wild. */
[data-theme="nord"] {
  --bg-base: #2e3440;
  --bg-surface: #333a48;
  --bg-card: #3b4252;
  --bg-hover: #434c5e;
  --accent: #88c0d0;
  --accent-dim: #5e81ac;
  --text-primary: #eceff4;
  --text-secondary: #d8dee9;
  --text-dim: #7c8aa5;
  --border: #4c566a;
}
[data-theme="gruvbox"] {
  --bg-base: #282828;
  --bg-surface: #32302f;
  --bg-card: #3c3836;
  --bg-hover: #504945;
  --accent: #fe8019;
  --accent-dim: #d65d0e;
  --text-primary: #ebdbb2;
  --text-secondary: #bdae93;
  --text-dim: #7c6f64;
  --border: #45403d;
}
[data-theme="tokyonight"] {
  --bg-base: #24283b;
  --bg-surface: #1f2335;
  --bg-card: #2d3348;
  --bg-hover: #363b54;
  --accent: #7aa2f7;
  --accent-dim: #3d59a1;
  --text-primary: #c0caf5;
  --text-secondary: #a9b1d6;
  --text-dim: #565f89;
  --border: #363b54;
}
[data-theme="solarized"] {
  --bg-base: #eee8d5;
  --bg-surface: #fdf6e3;
  --bg-card: #fdf6e3;
  --bg-hover: #e3dcc5;
  --accent: #268bd2;
  --accent-dim: #1e6ba8;
  --text-primary: #073642;
  --text-secondary: #586e75;
  --text-dim: #93a1a1;
  --border: #d3cbb7;
}
[data-theme="light"] .topnav, [data-theme="solarized"] .topnav { background: var(--accent); border-color: var(--accent-dim); }
[data-theme="light"] .topnav-brand-name, [data-theme="solarized"] .topnav-brand-name,
[data-theme="light"] .topnav .topnav-link, [data-theme="solarized"] .topnav .topnav-link { color: rgba(255,255,255,.9); }
[data-theme="light"] .topnav-brand-sub, [data-theme="solarized"] .topnav-brand-sub { color: rgba(255,255,255,.7); }
[data-theme="light"] .topnav .topnav-link:hover, [data-theme="solarized"] .topnav .topnav-link:hover,
[data-theme="light"] .topnav .topnav-link.active, [data-theme="solarized"] .topnav .topnav-link.active { color: #fff; background: rgba(255,255,255,.15); }
[data-theme="light"] .mobile-nav-menu .topnav-link, [data-theme="solarized"] .mobile-nav-menu .topnav-link { color: var(--text-secondary); }
[data-theme="light"] .mobile-nav-menu .topnav-link:hover, [data-theme="solarized"] .mobile-nav-menu .topnav-link:hover,
[data-theme="light"] .mobile-nav-menu .topnav-link.active, [data-theme="solarized"] .mobile-nav-menu .topnav-link.active { color: var(--text-primary); background: var(--bg-hover); }

/* ── Global calendar ───────────────────────────────── */
#calendar-container { display: flex; flex-direction: column; gap: .6rem; }
.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: .6rem;
  overflow-x: auto;
}
.calendar-day {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.calendar-day-today { border-color: var(--accent); border-width: 2px; }
.calendar-day-today .calendar-day-date {
  background: var(--accent); color: var(--bg-surface);
  border-radius: 50%; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.calendar-today-tag {
  background: var(--accent); color: var(--bg-surface);
  border-radius: 4px; padding: 0 .35rem; font-size: .68rem; font-weight: 700;
  vertical-align: middle; margin-left: .3rem;
}
.calendar-day-month-start { border-top: 3px solid var(--accent-dim); }
.calendar-day-date-wrap { display: inline-flex; align-items: center; gap: .3rem; }
.calendar-month-tag {
  border: 1px solid var(--accent-dim); color: var(--accent-dim);
  border-radius: 4px; padding: 0 .3rem; font-size: .68rem; font-weight: 700;
  text-transform: uppercase;
}
.calendar-day-header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .5rem .65rem; font-size: .8rem; font-weight: 600;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.calendar-day-header:hover { background: var(--bg-hover); }
.calendar-day-expand-hint { font-size: .85rem; opacity: .7; margin-left: .25rem; }
.calendar-day-header:hover .calendar-day-expand-hint { opacity: 1; }
.calendar-day-body { padding: .5rem .5rem; display: flex; flex-direction: column; gap: .4rem; }
.calendar-block {
  background: var(--bg-hover);
  border-radius: 6px;
  padding: .35rem .5rem;
  font-size: .82rem;
}
.calendar-block-title { font-weight: 600; }
.calendar-block-meta { color: var(--text-dim); font-size: .78rem; }
.calendar-block-location {
  color: var(--text-dim); font-size: .78rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Class-schedule location: a bare room name truncates instead of wrapping/crushing its
   tile; a URL is rendered as "Online Link ↗" (see fmtLocation() in app.js) instead of
   the raw link, so it never needs truncating. */
.schedule-row-location { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-link { color: var(--accent); white-space: nowrap; }

/* Dated items (Task/Project/Assignment/Test/Meal) — one lane-grid per day, computed fresh
   per displayed week so a multi-day span lines up at the same row across the days it touches
   without ever spanning a real grid cell (keeps this safe under the mobile single-column
   stack below, where "row" alignment across days no longer applies anyway). */
.calendar-items {
  display: grid;
  grid-template-rows: repeat(var(--lanes), minmax(1.5rem, auto));
  gap: .25rem;
}
.calendar-item-block {
  display: flex; align-items: center; gap: .25rem;
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: .15rem .4rem;
  font-size: .8rem;
  line-height: 1.3;
  cursor: pointer;
  overflow: hidden;
}
.calendar-item-block:hover { color: var(--accent); }
.calendar-item-block .cal-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-item-block .cal-continue { color: var(--text-dim); font-weight: 700; flex-shrink: 0; }

/* Still-active item shown on a day after its due date has passed — see the `overdue`/`dueDateObj`
   handling in calendar/index.html's renderWeeks(), which keeps overdue-active items visible
   through today instead of vanishing the day after they're due. */
.calendar-item-block.cal-item-overdue { outline: 2px solid var(--error); outline-offset: -1px; }

/* ── Day-detail modal (opened by clicking a day's header) — same look as the
   mini day tile above, just full-width with wrapping instead of truncation
   since there's room to show whole titles/locations. ── */
.calendar-day-detail-body { display: flex; flex-direction: column; gap: .5rem; }
.calendar-item-block-wrap, .calendar-item-block-wrap .cal-item-title {
  overflow: visible; text-overflow: clip; white-space: normal;
}
.calendar-block-location-wrap { overflow: visible; text-overflow: clip; white-space: normal; }

.cal-type-task { border-left-color: var(--accent); }
.cal-type-project { border-left-color: #a855f7; }
.cal-type-assignment { border-left-color: #f59e0b; }
.cal-type-test { border-left-color: #ef4444; }
.cal-type-meal { border-left-color: #10b981; }
.cal-type-garage { border-left-color: #06b6d4; }

.calendar-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: .82rem; color: var(--text-dim); }
.calendar-legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.calendar-legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.calendar-legend-dot.cal-type-project { background: #a855f7; }
.calendar-legend-dot.cal-type-assignment { background: #f59e0b; }
.calendar-legend-dot.cal-type-test { background: #ef4444; }
.calendar-legend-dot.cal-type-meal { background: #10b981; }
.calendar-legend-dot.cal-type-garage { background: #06b6d4; }

@media (max-width: 700px) {
  .calendar-week { grid-template-columns: 1fr; overflow-x: visible; }
  .calendar-day { min-height: 0; }
}

/* ── Class schedule row editor ─────────────────────── */
.schedule-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin-bottom: .75rem; }

/* ── School note link checklist ────────────────────── */
.note-link-row { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .85rem; }
.note-link-row input[type="checkbox"] { width: auto; flex-shrink: 0; }

/* ── Journal secret-word lock/unlock ───────────────── */
.journal-gate-card { max-width: 460px; margin: 2rem auto; }
.journal-gate-card .icon-lg { font-size: 3rem; line-height: 1; margin-bottom: .5rem; }

/* ── Public marketing home page ────────────────────── */
.home-body { background: var(--bg-base); }

.home-nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 1.1rem 1.5rem;
}
.home-nav-brand { display: flex; align-items: center; gap: .6rem; }
.home-nav-logo { height: 36px; width: auto; }
.home-nav-brand .topnav-brand-name { font-size: 1.15rem; }
.home-nav-actions { display: flex; align-items: center; gap: .6rem; }

.home-hero {
  position: relative; overflow: hidden;
  max-width: 1120px; margin: 0 auto; padding: 3.5rem 1.5rem 2.5rem;
  display: flex; align-items: center; gap: 3rem;
}
.home-hero-glow {
  position: absolute; top: -180px; right: -160px; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(229,160,13,.22) 0%, rgba(229,160,13,0) 70%);
  pointer-events: none;
}
.home-hero-copy { flex: 1 1 480px; min-width: 0; position: relative; z-index: 1; }
.home-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #e5a00d; background: rgba(229,160,13,.12);
  border: 1px solid rgba(229,160,13,.3); border-radius: 999px; padding: .3rem .8rem;
  margin-bottom: 1.1rem;
}
.home-hero h1 {
  font-size: 2.6rem; line-height: 1.12; font-weight: 800; letter-spacing: -.02em;
  margin: 0 0 1rem;
}
.home-hero h1 em { color: var(--accent); font-style: normal; }
.home-hero-sub { font-size: 1.05rem; color: var(--text-secondary); max-width: 46ch; margin: 0 0 1.75rem; }
.home-hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; }
.home-hero-note { font-size: .8rem; color: var(--text-dim); margin-top: .9rem; }
.home-hero-visual { flex: 1 1 420px; min-width: 0; position: relative; z-index: 1; }

/* Fake "screenshot" — a lightweight CSS mockup of the dashboard, not a real capture,
   so it can never go stale as the actual UI evolves. */
.home-mock {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.5); overflow: hidden;
  transform: rotate(-1.2deg);
}
.home-mock-bar { display: flex; align-items: center; gap: .4rem; padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
.home-mock-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.home-mock-dot:nth-child(1) { background: #ef4444; }
.home-mock-dot:nth-child(2) { background: #f59e0b; }
.home-mock-dot:nth-child(3) { background: #22c55e; }
.home-mock-body { padding: 1rem; }
.home-mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .8rem; }
.home-mock-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .5rem; text-align: center; }
.home-mock-stat-num { font-size: 1.3rem; font-weight: 800; color: var(--accent); line-height: 1; }
.home-mock-stat-label { font-size: .62rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; margin-top: .25rem; }
.home-mock-row { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border); margin-bottom: .45rem; }
.home-mock-row-icon { font-size: .95rem; flex-shrink: 0; }
.home-mock-row-bar { height: 6px; border-radius: 3px; background: var(--border); flex: 1; overflow: hidden; }
.home-mock-row-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.home-mock-badge {
  position: absolute; bottom: -14px; left: -14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 999px; padding: .5rem .9rem;
  font-size: .8rem; font-weight: 700; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5);
  display: flex; align-items: center; gap: .4rem;
}

.home-section { max-width: 1120px; margin: 0 auto; padding: 3.5rem 1.5rem; }
.home-section-head { text-align: center; max-width: 620px; margin: 0 auto 2.25rem; }
.home-section-head h2 { font-size: 1.75rem; letter-spacing: -.01em; margin-bottom: .5rem; }
.home-section-head p { color: var(--text-secondary); margin: 0; }

.home-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.home-feature {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.35rem; transition: border-color .15s, transform .15s;
}
.home-feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.home-feature-icon {
  width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; background: rgba(229,160,13,.12); margin-bottom: .8rem;
}
.home-feature h3 { font-size: .98rem; margin-bottom: .3rem; }
.home-feature p { font-size: .85rem; color: var(--text-secondary); margin: 0; }

.home-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.home-step { text-align: center; }
.home-step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #000;
  font-weight: 800; display: flex; align-items: center; justify-content: center;
  margin: 0 auto .8rem; font-size: 1.05rem;
}
.home-step h3 { font-size: 1rem; margin-bottom: .3rem; }
.home-step p { font-size: .85rem; color: var(--text-secondary); margin: 0; }

.home-cta-band {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  border-radius: 18px; max-width: 1120px; margin: 0 auto 3.5rem; padding: 3rem 2rem;
  text-align: center;
}
.home-cta-band h2 { color: #000; font-size: 1.65rem; margin-bottom: .4rem; }
.home-cta-band p { color: rgba(0,0,0,.7); margin-bottom: 1.5rem; }
.home-cta-band .btn-primary { background: #0f0f0f; color: #fff; }
.home-cta-band .btn-primary:hover { background: #000; }

.home-footer {
  border-top: 1px solid var(--border); padding: 1.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
  max-width: 1120px; margin: 0 auto; color: var(--text-dim); font-size: .8rem;
}
.home-footer-brand { display: flex; align-items: center; gap: .5rem; }
.home-footer-brand img { height: 20px; width: auto; }

@media (max-width: 860px) {
  .home-hero { flex-direction: column; padding-top: 2.5rem; }
  .home-hero-copy { text-align: center; }
  .home-hero-sub { margin-left: auto; margin-right: auto; }
  .home-hero-ctas { justify-content: center; }
  .home-eyebrow { margin-left: auto; margin-right: auto; }
  .home-mock { transform: none; }
  .home-features { grid-template-columns: 1fr 1fr; }
  .home-steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .home-hero h1 { font-size: 2rem; }
  .home-features { grid-template-columns: 1fr; }
  .home-nav-brand .topnav-brand-text { display: none; }
}
.journal-lock-badge { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
