/* ── Theme: dark (default) ── */
:root, html[data-theme="dark"] {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --accent: #e8a000;
  --accent2: #c06000;
  --text: #e0e0e0;
  --muted: #666;
  --ok-fg: #4caf50;
  --warn-fg: #f9a825;
  --danger-fg: #ef5350;
  --blue-fg: #29b6f6;
  --radius: 6px;
  --font: 'Courier New', monospace;
  --sidebar-w: 200px;
}
/* ── Theme: midnight ── */
html[data-theme="midnight"] {
  --bg: #0b0f1a;
  --surface: #111827;
  --surface2: #1c2638;
  --border: #263347;
  --accent: #38bdf8;
  --accent2: #0ea5e9;
  --text: #e2e8f0;
  --muted: #4b6080;
  --ok-fg: #34d399;
  --warn-fg: #fbbf24;
  --danger-fg: #f87171;
  --blue-fg: #60a5fa;
}
/* ── Theme: race ── */
html[data-theme="race"] {
  --bg: #0a0000;
  --surface: #160000;
  --surface2: #1f0000;
  --border: #330000;
  --accent: #ef4444;
  --accent2: #b91c1c;
  --text: #fef2f2;
  --muted: #6b2222;
  --ok-fg: #4ade80;
  --warn-fg: #fb923c;
  --danger-fg: #ef4444;
  --blue-fg: #60a5fa;
}
/* ── Theme: light ── */
html[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface2: #ebebeb;
  --border: #d1d5db;
  --accent: #b45309;
  --accent2: #92400e;
  --text: #111827;
  --muted: #6b7280;
  --ok-fg: #15803d;
  --warn-fg: #b45309;
  --danger-fg: #b91c1c;
  --blue-fg: #1d4ed8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; min-height: 100vh; transition: background .2s, color .2s; }

/* ── Header ── */
header { background: var(--surface); border-bottom: 2px solid var(--accent); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1300px; margin: 0 auto; padding: 10px 14px 0; }
.logo-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.logo { color: var(--accent); font-size: 20px; font-weight: bold; letter-spacing: 3px; }
.subtitle { color: var(--muted); font-size: 11px; }
.tab-bar { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab { background: none; border: none; border-bottom: 3px solid transparent; color: var(--muted); cursor: pointer; font-family: var(--font); font-size: 12px; letter-spacing: 1px; padding: 7px 16px; white-space: nowrap; transition: color .15s; }
.tab:hover { color: var(--text); }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); }

main { max-width: 1300px; margin: 0 auto; padding: 16px 14px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Layout: sidebar ── */
html[data-layout="sidebar"] body { display: flex; flex-direction: row; min-height: 100vh; }
html[data-layout="sidebar"] header { border-bottom: none; border-right: 2px solid var(--accent); bottom: 0; flex-shrink: 0; left: 0; position: fixed; top: 0; width: var(--sidebar-w, 200px); z-index: 100; }
html[data-layout="sidebar"] .header-inner { display: flex; flex-direction: column; height: 100%; max-width: none; overflow-y: auto; padding: 16px 12px 12px; width: 100%; }
html[data-layout="sidebar"] .logo-row { align-items: flex-start; border-bottom: 1px solid var(--border); flex-direction: column; gap: 3px; margin-bottom: 0; padding-bottom: 14px; }
html[data-layout="sidebar"] .auth-info { margin-top: 10px; }
html[data-layout="sidebar"] .tab-bar { flex-direction: column; gap: 1px; margin-top: 14px; overflow: visible; }
html[data-layout="sidebar"] .tab { border-bottom: none; border-left: 3px solid transparent; padding: 8px 10px; text-align: left; }
html[data-layout="sidebar"] .tab.active { border-bottom-color: transparent; border-left-color: var(--accent); }
html[data-layout="sidebar"] main { flex: 1 1 0; min-width: 0; margin-left: var(--sidebar-w, 200px); max-width: none; padding: 16px 20px; width: calc(100% - var(--sidebar-w, 200px)); }
html[data-layout="sidebar"] #public-landing { margin-left: var(--sidebar-w, 200px); }

/* ── Sidebar hamburger toggle (mobile) ── */
.sidebar-hamburger { display: none; background: none; border: none; color: var(--text); cursor: pointer; font-size: 18px; padding: 4px 8px; }
html[data-layout="sidebar"] .sidebar-hamburger { display: block; position: fixed; top: 10px; left: calc(var(--sidebar-w, 200px) - 30px); z-index: 200; }
html[data-layout="sidebar"] header.sidebar-collapsed { transform: translateX(calc(-1 * var(--sidebar-w, 200px))); }
html[data-layout="sidebar"] header { transition: transform .22s ease; }
html[data-layout="sidebar"] main,
html[data-layout="sidebar"] #public-landing { transition: margin-left .22s ease; }
html[data-layout="sidebar"] body.sidebar-collapsed main,
html[data-layout="sidebar"] body.sidebar-collapsed #public-landing { margin-left: 0; }
html[data-layout="sidebar"] body.sidebar-collapsed .sidebar-hamburger { left: 8px; }
html[data-layout="sidebar"] body.sidebar-collapsed header { transform: translateX(calc(-1 * var(--sidebar-w, 200px))); }

@media (max-width: 768px) {
  html[data-layout="sidebar"] header {
    border-right: none; border-top: 2px solid var(--accent);
    bottom: 0; height: 56px; left: 0; right: 0; top: auto; width: 100%;
  }
  html[data-layout="sidebar"] .header-inner {
    align-items: center; flex-direction: row; gap: 8px; height: 100%;
    overflow: visible; padding: 4px 10px;
  }
  html[data-layout="sidebar"] .logo-row {
    border-bottom: none; flex-direction: row; align-items: center;
    gap: 6px; margin-bottom: 0; padding-bottom: 0; flex-shrink: 0;
  }
  html[data-layout="sidebar"] .subtitle,
  html[data-layout="sidebar"] .auth-info { display: none; }
  html[data-layout="sidebar"] .tab-bar {
    flex-direction: row; flex: 1; gap: 0; margin-top: 0; overflow-x: auto;
  }
  html[data-layout="sidebar"] .tab {
    border-left: none; border-top: 3px solid transparent; padding: 6px 10px;
  }
  html[data-layout="sidebar"] .tab.active {
    border-left-color: transparent; border-top-color: var(--accent);
  }
  html[data-layout="sidebar"] main { margin-left: 0; padding-bottom: 72px; }
  html[data-layout="sidebar"] #public-landing { margin-left: 0; padding-bottom: 72px; }
  html[data-layout="sidebar"] .sidebar-hamburger { display: none; }
}

/* ── Shared ── */
.toolbar { align-items: center; display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; padding: 14px; }
.card-title { color: var(--accent); font-size: 11px; letter-spacing: 2px; margin-bottom: 12px; text-transform: uppercase; }
select { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 13px; padding: 6px 8px; }
.muted { color: var(--muted); font-size: 12px; }

/* ── Progress bar ── */
#progress-bar-wrap { align-items: center; display: flex; gap: 10px; margin-bottom: 14px; }
#progress-bar { background: var(--surface2); border-radius: 4px; flex: 1; height: 6px; overflow: hidden; }
#progress-bar::after { background: var(--accent); border-radius: 4px; content: ''; display: block; height: 100%; transition: width .4s; width: var(--pct, 0%); }
#progress-label { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ── Checklist ── */
.section-group { margin-bottom: 22px; }
.section-header { border-bottom: 1px solid var(--border); color: var(--accent); display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: 2px; margin-bottom: 8px; padding-bottom: 5px; text-transform: uppercase; }
.section-count { color: var(--muted); font-size: 10px; }
.checklist-item { align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: var(--radius); display: flex; gap: 10px; margin-bottom: 4px; padding: 9px 12px; transition: border-color .15s; }
.checklist-item:hover { border-color: #3a3a3a; }
.checklist-item.purchased { border-left-color: var(--ok-fg); }
.checklist-item.installed { border-left-color: var(--ok-fg); }
.checklist-item.researching { border-left-color: var(--warn-fg); }
.checklist-item.skipped { opacity: .35; }
.checklist-item.purchased .item-name, .checklist-item.installed .item-name { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.2); }
.item-check input[type=checkbox] { accent-color: var(--accent); cursor: pointer; height: 16px; margin: 0; width: 16px; flex-shrink: 0; }
.item-body { flex: 1; min-width: 0; }
.item-name { font-size: 13px; line-height: 1.4; }
.item-meta { color: var(--muted); font-size: 11px; margin-top: 3px; display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.item-meta a { color: var(--accent2); text-decoration: none; }
.item-meta a:hover { text-decoration: underline; }
.item-meta code.pn { color: var(--muted); font-size: 10px; background: var(--surface2); border-radius: 2px; padding: 0 4px; }
.item-deps { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.dep-chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; color: var(--muted); font-size: 10px; letter-spacing: .3px; padding: 1px 6px; white-space: nowrap; }
.dep-chip.dep-done { color: var(--ok-fg); border-color: rgba(76,175,80,.3); opacity: .7; }
.item-actions { align-items: center; display: flex; gap: 3px; flex-shrink: 0; }
.item-actions .status-select { background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; color: var(--text); font-family: var(--font); font-size: 10px; padding: 3px 5px; max-width: 100px; }
.btn-icon { background: none; border: 1px solid transparent; border-radius: 3px; color: var(--muted); cursor: pointer; font-family: var(--font); font-size: 13px; padding: 3px 6px; line-height: 1; transition: color .1s, border-color .1s; }
.btn-icon:hover { color: var(--text); border-color: var(--border); }
.btn-icon.note-active { color: var(--accent); }
.item-note-row { background: var(--surface2); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 4px; margin-top: -4px; padding: 8px 12px; }
.note-textarea { background: var(--surface); border: 1px solid var(--border); border-radius: 3px; color: var(--text); font-family: var(--font); font-size: 12px; line-height: 1.5; padding: 6px 8px; resize: vertical; width: 100%; }
.note-textarea:focus { border-color: var(--accent); outline: none; }

/* ── Gantt ── */
.gantt-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.gantt-legend-item { align-items: center; display: flex; gap: 6px; font-size: 11px; }
.gantt-legend-dot { border-radius: 2px; height: 10px; width: 10px; flex-shrink: 0; }

.gantt-scroll { overflow-x: auto; padding-bottom: 8px; }
.gantt-header { border-bottom: 1px solid var(--border); display: flex; margin-bottom: 4px; padding-bottom: 4px; position: relative; }
.gantt-week-label { color: var(--muted); font-size: 10px; text-align: center; position: absolute; }

.gantt-row { align-items: center; display: flex; margin-bottom: 3px; min-height: 34px; }
.gantt-row:hover { background: rgba(255,255,255,.02); border-radius: var(--radius); }
.gantt-label { color: var(--text); flex-shrink: 0; font-size: 12px; line-height: 1.3; overflow: hidden; padding-right: 10px; }
.gantt-label small { color: var(--muted); display: block; font-size: 10px; margin-top: 1px; }
.gantt-bar-area { flex-shrink: 0; height: 28px; position: relative; }
.gantt-bar {
  align-items: center;
  border-radius: 4px;
  color: rgba(0,0,0,.85);
  display: flex;
  height: 22px;
  margin-top: 3px;
  overflow: hidden;
  padding: 0 7px;
  position: absolute;
  top: 0;
  transition: opacity .15s;
  white-space: nowrap;
}
.gantt-bar:hover { filter: brightness(1.15); }
.gantt-bar.complete { opacity: .5; }
.gantt-bar.in_progress { box-shadow: 0 0 6px rgba(255,255,255,.2); }
.gantt-bar-label { font-size: 10px; font-weight: bold; overflow: hidden; pointer-events: none; text-overflow: ellipsis; white-space: nowrap; }
.gantt-grid-line { border-left: 1px dashed #222; bottom: 0; pointer-events: none; position: absolute; top: 0; }

/* ── Costs ── */
.cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .cost-grid { grid-template-columns: 1fr; } }
.cost-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cost-stat { background: var(--surface2); border-radius: var(--radius); padding: 12px; }
.cost-stat .cs-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.cost-stat .cs-value { color: var(--text); font-size: 22px; font-weight: bold; margin-top: 4px; }
.cost-stat .cs-value.outstanding { color: var(--warn-fg); }
.cost-stat .cs-value.actual { color: var(--ok-fg); }

.cost-row { align-items: center; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 14px 1fr 90px 90px 90px; gap: 10px; padding: 8px 4px; }
.cost-row:last-child { border-bottom: none; }
.cost-row-dot { border-radius: 2px; height: 12px; width: 12px; }
.cost-row-name { font-size: 12px; }
.cost-row-val { font-size: 12px; text-align: right; }
.cost-row-val.outstanding { color: var(--warn-fg); }
.cost-row-val.actual { color: var(--ok-fg); }
.cost-header { color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }

/* ── Setup guide ── */
.setup-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; padding: 20px; }
.setup-title { color: var(--accent); font-size: 16px; font-weight: bold; letter-spacing: 1px; margin-bottom: 8px; }
.setup-desc { color: var(--muted); font-size: 13px; margin-bottom: 18px; line-height: 1.5; }
.setup-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.setup-step { display: flex; gap: 14px; align-items: flex-start; }
.step-num { background: var(--accent); border-radius: 50%; color: #000; flex-shrink: 0; font-size: 12px; font-weight: bold; height: 24px; line-height: 24px; text-align: center; width: 24px; }
.step-body { font-size: 13px; line-height: 1.6; }
.step-body a { color: var(--accent2); }
.setup-code { background: #000; border-radius: var(--radius); color: #aaa; font-family: var(--font); font-size: 11px; margin-top: 6px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; }
.setup-note { background: #1a1a00; border: 1px solid #333300; border-radius: var(--radius); color: #aaa; font-size: 12px; line-height: 1.6; padding: 10px 12px; }
.setup-note code { background: #000; border-radius: 3px; color: var(--warn-fg); font-size: 11px; padding: 1px 4px; }

/* ── Photos ── */
.photo-grid { columns: 2; gap: 8px; }
@media (min-width: 600px) { .photo-grid { columns: 3; } }
@media (min-width: 900px) { .photo-grid { columns: 4; } }
.photo-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); break-inside: avoid; margin-bottom: 8px; overflow: hidden; }
.photo-card img { display: block; width: 100%; height: auto; }
.photo-card .photo-meta { color: var(--muted); font-size: 10px; padding: 5px 7px; }
.photo-card .photo-desc { color: var(--text); font-size: 12px; padding: 0 7px 6px; }

/* ── Chat ── */
.chat-wrap { display: flex; flex-direction: column; gap: 10px; }
.chat-history { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; height: 60vh; overflow-y: auto; padding: 14px; }
.chat-msg { max-width: 88%; }
.chat-msg.user { align-self: flex-end; }
.chat-msg.assistant { align-self: flex-start; }
.chat-bubble { border-radius: var(--radius); font-size: 13px; line-height: 1.6; padding: 9px 13px; white-space: pre-wrap; }
.user .chat-bubble { background: #152030; }
.assistant .chat-bubble { background: var(--surface2); border: 1px solid var(--border); }
.chat-input-row { display: flex; gap: 8px; }
textarea { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); flex: 1; font-family: var(--font); font-size: 13px; padding: 8px 10px; resize: none; }
textarea:focus { border-color: var(--accent); outline: none; }

/* ── Services ── */
.service-row { align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; gap: 12px; margin-bottom: 6px; padding: 10px 14px; }
.service-name { flex: 1; }
.active-status { color: var(--ok-fg); }
.inactive-status { color: var(--danger-fg); }

/* ── Buttons ── */
.btn { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; font-family: var(--font); font-size: 13px; padding: 8px 14px; transition: background .15s; }
.btn:hover { background: #2a2a2a; }
.btn-ok { border-color: #2a7a3a; color: var(--ok-fg); }
.btn-ok:hover { background: #2a7a3a; color: #fff; }
.btn-sm { background: none; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); cursor: pointer; font-family: var(--font); font-size: 11px; padding: 4px 10px; }
.btn-sm:hover { color: var(--text); border-color: #444; }

/* ── Modal ── */
.modal-overlay { background: rgba(0,0,0,.7); bottom:0; left:0; position:fixed; right:0; top:0; z-index:200; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); left: 50%; max-height: 90vh; max-width: 680px; overflow-y: auto; padding: 20px; position: fixed; top: 50%; transform: translate(-50%, -50%); width: 96%; z-index: 201; }
.modal-title { color: var(--accent); font-size: 14px; font-weight: bold; letter-spacing: 2px; margin-bottom: 14px; text-transform: uppercase; }
.modal-divider { color: var(--muted); font-size: 11px; margin: 14px 0; text-align: center; }
.modal-actions { border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; padding-top: 12px; }

/* ── Smart add ── */
.smart-add-wrap { display: flex; gap: 8px; margin-bottom: 10px; }
.smart-add-wrap textarea { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 13px; padding: 8px; resize: none; }
.smart-preview { background: #0a1a0a; border: 1px solid #2a4a2a; border-radius: var(--radius); margin-bottom: 10px; padding: 10px 12px; }
.preview-label { color: var(--ok-fg); font-size: 11px; letter-spacing: 1px; margin-bottom: 4px; text-transform: uppercase; }
.preview-note { font-size: 12px; line-height: 1.5; }

/* ── Form grid ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 4px; }
.form-grid .full-width { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 13px; padding: 6px 8px; }
.form-grid input:focus, .form-grid textarea:focus { border-color: var(--accent); outline: none; }

/* ── Item expand ── */
.item-expand { background: #0e0e1a; border: 1px solid #2a2a44; border-top: none; border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 5px; margin-top: -5px; }
.expand-inner { padding: 10px 14px 12px; }
.expand-label { color: var(--accent); font-size: 10px; letter-spacing: 1px; margin-bottom: 8px; text-transform: uppercase; }
.expand-notes { background: var(--surface2); border-radius: var(--radius); color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 8px; padding: 8px 10px; }
.dep-group { margin-bottom: 8px; }
.dep-group-label { color: var(--muted); font-size: 10px; letter-spacing: 1px; margin-bottom: 4px; text-transform: uppercase; }
.dep-checkbox { align-items: center; cursor: pointer; display: flex; font-size: 11px; gap: 6px; padding: 2px 0; }
.dep-checkbox input { accent-color: var(--accent); cursor: pointer; }
.dep-tag { background: #1a1a3a; border-radius: 3px; color: #6080c0; font-size: 10px; margin-left: 6px; padding: 1px 5px; }
.danger-sm { color: var(--danger-fg) !important; margin-top: 10px; }

/* ── Settings ── */
.settings-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.key-input-row { display: flex; gap: 8px; margin-top: 8px; }
.key-input-row input { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); flex: 1; font-family: var(--font); font-size: 13px; padding: 7px 10px; }
.key-input-row input:focus { border-color: var(--accent); outline: none; }
.badge-ok   { background: #1a3a1a; border-radius: 3px; color: var(--ok-fg); font-size: 11px; padding: 3px 8px; }
.badge-warn { background: #3a1a1a; border-radius: 3px; color: var(--danger-fg); font-size: 11px; padding: 3px 8px; }
.status-badge-row { margin-bottom: 12px; }
.link { color: var(--accent2); }
/* ── Media grid — CSS columns masonry: each column flows independently, no dead space ── */
.media-drop-zone { min-height: 200px; }
.media-grid {
  columns: 190px;
  column-gap: 4px;
  padding: 4px 0;
}
@media (max-width: 480px) { .media-grid { columns: 2; } }
/* Date group header — spans all columns */
.media-date-hdr {
  column-span: all;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 10px 2px 4px;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.media-date-hdr:first-child { border-top: none; margin-top: 0; padding-top: 2px; }
.media-thumb {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 4px;
  overflow: hidden;
  position: relative;
  transition: border-color .15s;
}
.media-thumb:hover { border-color: var(--accent); }
.media-thumb img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity .3s;
}
.media-thumb img.loaded { opacity: 1; }
.media-thumb-inner { position: relative; }
.video-thumb { background: #111; display:flex; align-items:center; justify-content:center; aspect-ratio: 16/9; }
.video-thumb img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.video-play-icon { color: #fff; font-size: 28px; position: relative; text-shadow: 0 1px 4px #000a; z-index:1; }
.media-thumb-caption { color: var(--muted); font-size: 10px; line-height: 1.3; overflow: hidden; padding: 4px 6px; text-overflow: ellipsis; white-space: nowrap; }
.media-thumb-badge { background: var(--accent); border-radius: 3px; bottom: 6px; color: #000; font-size: 9px; font-weight: bold; padding: 1px 4px; position: absolute; right: 6px; }
/* Metadata hover overlay */
.media-meta-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.82));
  padding: 28px 7px 7px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.media-thumb:hover .media-meta-overlay { opacity: 1; pointer-events: auto; }
.media-meta-desc { color: #ddd; font-size: 10px; line-height: 1.4; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.media-meta-links { display: flex; flex-wrap: wrap; gap: 2px; }
.media-meta-link { border-radius: 2px; font-size: 9px; padding: 1px 5px; cursor: pointer; }
.media-meta-link.part { background: rgba(0,0,0,.55); border: 1px solid var(--accent); color: var(--accent); }
.media-meta-link.checklist { background: rgba(0,0,0,.55); border: 1px solid var(--ok-fg); color: var(--ok-fg); }

/* ── Full viewer ── */
.viewer-overlay { align-items: center; background: rgba(0,0,0,.92); bottom:0; display:flex; justify-content:center; left:0; position:fixed; right:0; top:0; z-index:2000; flex-direction: column; padding-bottom: 90px; }
.viewer-inner { max-height: 88vh; max-width: 92vw; overflow: auto; position: relative; flex: 0 1 auto; }
.viewer-close { background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.15); border-radius: 50%; color: rgba(255,255,255,.8); cursor: pointer; font-size: 16px; height: 34px; width: 34px; display: flex; align-items: center; justify-content: center; position: fixed; right: 20px; top: 16px; z-index: 2010; transition: background .15s, color .15s; }
.viewer-close:hover { background: rgba(255,255,255,.15); color: #fff; }
.viewer-meta { background: rgba(0,0,0,.6); border-radius: 0 0 var(--radius) var(--radius); color: #ccc; font-size: 12px; padding: 8px 12px; }
.viewer-meta p { margin: 2px 0; }
/* ── Viewer toolbar: floating pill bar ── */
.viewer-toolbar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2010;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(8,8,8,.86);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50px;
  padding: 5px 8px;
  box-shadow: 0 6px 28px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.06) inset;
}
.vt-btn {
  background: none;
  border: none;
  border-radius: 50%;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  width: 38px;
  transition: background .14s, color .14s, transform .1s;
  flex-shrink: 0;
}
.vt-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vt-btn:hover { background: rgba(255,255,255,.13); color: #fff; }
.vt-btn:active { transform: scale(.93); }
.vt-btn.vt-nav { width: 44px; height: 44px; }
.vt-btn.vt-nav svg { width: 22px; height: 22px; }
.vt-btn.vt-del:hover { background: rgba(239,83,80,.22); color: var(--danger-fg); }
.vt-divider { width: 1px; height: 22px; background: rgba(255,255,255,.14); margin: 0 3px; flex-shrink: 0; }
.vt-status { color: var(--ok-fg); font-size: 11px; padding: 0 6px; white-space: nowrap; letter-spacing: .5px; }

/* ── Right-click menu ── */
.ctx-menu { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 16px #0006; min-width: 160px; position: fixed; z-index: 3000; }
.ctx-item { cursor: pointer; font-size: 13px; padding: 8px 14px; }
.ctx-item:hover { background: var(--surface2); }
.ctx-sep { border-top: 1px solid var(--border); margin: 4px 0; }
.ctx-danger { color: var(--danger-fg); }

/* ── Photo modal ── */
.photo-modal { max-height: 90vh; max-width: 1000px; overflow-y: auto; width: 96vw; }
.photo-modal-layout { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.photo-modal-media { min-height: 200px; }
.photo-modal-right { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.photo-analysis-box { background: var(--surface2); border-radius: var(--radius); font-size: 12px; line-height: 1.6; padding: 10px 12px; }
.photo-modal-notes textarea { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 12px; padding: 8px; width: 100%; }
.photo-chat-history { flex: 1; font-size: 12px; max-height: 200px; overflow-y: auto; }
@media (max-width:700px) { .photo-modal-layout { grid-template-columns: 1fr; } }

/* ── Login overlay ── */
.login-overlay { align-items: center; background: var(--bg); bottom: 0; display: flex; justify-content: center; left: 0; position: fixed; right: 0; top: 0; z-index: 9000; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-width: 360px; padding: 32px 28px; width: 94%; }
.login-brand { color: var(--accent); font-size: 22px; font-weight: bold; letter-spacing: 4px; margin-bottom: 4px; text-align: center; }
.login-sub { color: var(--muted); font-size: 11px; margin-bottom: 24px; text-align: center; }
.login-hint { color: var(--warn-fg); font-size: 12px; margin-bottom: 12px; text-align: center; }
.login-input { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); display: block; font-family: var(--font); font-size: 13px; margin-bottom: 8px; padding: 9px 12px; width: 100%; }
.login-input:focus { border-color: var(--accent); outline: none; }

/* ── Auth info in header ── */
.auth-info { align-items: center; display: flex; gap: 8px; margin-left: auto; }

/* ── Settings ── */
.settings-grid-single { grid-template-columns: 1fr; max-width: 620px; }

/* ── Theme picker ── */
.theme-section { display: flex; flex-direction: column; gap: 16px; }
.theme-section-label { color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.theme-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-swatch { align-items: center; background: var(--surface2); border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; transition: border-color .15s; min-width: 80px; }
.theme-swatch:hover { border-color: var(--accent); }
.theme-swatch.active { border-color: var(--accent); }
.theme-swatch-dot { border-radius: 50%; height: 20px; width: 20px; }
.theme-swatch-name { color: var(--text); font-size: 11px; }
.layout-options { display: flex; gap: 10px; flex-wrap: wrap; }
.layout-btn { background: var(--surface2); border: 2px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; font-family: var(--font); font-size: 12px; padding: 10px 18px; transition: border-color .15s; }
.layout-btn:hover { border-color: var(--accent); }
.layout-btn.active { border-color: var(--accent); color: var(--accent); }

/* ── API Usage Panel ── */
.usage-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; padding: 8px 14px; }
.usage-header { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.usage-title { color: var(--muted); font-size: 11px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; }
.usage-summary { color: var(--text); flex: 1; font-size: 11px; }
.usage-btns { display: flex; gap: 4px; }
.usage-breakdown { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.usage-row { align-items: center; display: flex; font-size: 11px; gap: 8px; padding: 3px 0; }
.usage-ep { color: var(--muted); flex: 1; min-width: 80px; }
.usage-bar-wrap { background: var(--surface2); border-radius: 2px; flex: 2; height: 4px; overflow: hidden; }
.usage-bar { background: var(--accent); border-radius: 2px; height: 4px; transition: width .3s; }
.usage-cost { color: var(--text); font-size: 11px; min-width: 46px; text-align: right; }
.usage-calls { color: var(--muted); font-size: 10px; min-width: 28px; text-align: right; }

/* ── Build Brain Panel ── */
.brain-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; padding: 10px 14px; }
.brain-header { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.brain-title { color: var(--accent); font-size: 11px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; }
.brain-meta { color: var(--muted); flex: 1; font-size: 11px; min-width: 100px; }
.brain-btns { display: flex; gap: 4px; }
.brain-notes-text { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 12px; margin-top: 8px; padding: 8px; resize: vertical; width: 100%; }

/* ── Build Advisor Panel ── */
.advisor-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 10px 14px; }
.advisor-header { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.advisor-title { color: var(--accent); font-size: 11px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; }
.advisor-meta { color: var(--muted); flex: 1; font-size: 11px; }
.advisor-btns { display: flex; gap: 6px; }
.advisor-summary { background: #0a1a0a; border: 1px solid #2a4a2a; border-radius: var(--radius); color: #aaa; font-size: 12px; line-height: 1.6; margin-bottom: 8px; padding: 10px 12px; }
.advisor-todos { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.todo-item { align-items: flex-start; background: var(--surface2); border-radius: var(--radius); display: flex; gap: 8px; padding: 7px 10px; }
.todo-icon { flex-shrink: 0; font-size: 13px; font-weight: bold; margin-top: 1px; width: 14px; text-align: center; }
.todo-content { flex: 1; font-size: 12px; line-height: 1.5; }
.todo-actions { display: flex; gap: 4px; flex-shrink: 0; margin-top: 1px; }
.todo-actions .btn-sm { font-size: 10px; padding: 1px 5px; }
.todo-empty { color: var(--muted); font-size: 12px; padding: 6px 4px; }

/* ── Action badges in chat ── */
.chat-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 4px 14px; }
.action-badge { background: #0a2a1a; border: 1px solid #2a6a3a; border-radius: 3px; color: var(--ok-fg); font-size: 10px; padding: 2px 7px; }

/* ── Item action buttons ── */
.item-edit-btn { margin-left: 4px; }
.item-del-btn { opacity: .4; }
.item-del-btn:hover { opacity: 1; color: var(--danger-fg); border-color: var(--danger-fg); }
.item-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 4px; align-self: center; }

.save-msg { font-size: 12px; margin-top: 6px; min-height: 18px; }
.save-msg-ok  { color: var(--ok-fg); }
.save-msg-err { color: var(--danger-fg); }
.sync-log { background: #0a0a0a; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); font-size: 11px; margin: 0 0 14px; max-height: 180px; overflow-y: auto; padding: 10px 12px; }
.sync-log-lines div { color: var(--muted); line-height: 1.6; }
.sync-log-lines div:last-child { color: var(--text); }
.sync-log-ok div:last-child  { color: var(--ok-fg); }
.sync-log-err div:last-child { color: var(--danger-fg); }
/* ── Upload Jobs Panel ── */
#jobs-panel { margin: 0 0 14px; }
.job-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.job-card-header { align-items: center; display: flex; gap: 10px; padding: 8px 12px; }
.job-card-name { color: var(--text); flex: 1; font-size: 12px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card-status { border-radius: 4px; font-size: 10px; font-weight: 700; padding: 2px 6px; text-transform: uppercase; }
.job-status-uploading    { background: #1a3a6b; color: #7ab4ff; }
.job-status-processing   { background: #1a3a2a; color: #4caf80; }
.job-status-queued       { background: #2a2a3a; color: #9090cc; }
.job-status-scanning     { background: #1a3a2a; color: #4caf80; }
.job-status-thumbnailing { background: #1a3a2a; color: #4caf80; }
.job-status-done         { background: #1a3a1a; color: var(--ok-fg); }
.job-status-error        { background: #3a1a1a; color: var(--danger-fg); }
.job-status-cancelled    { background: #2a2a2a; color: var(--muted); }
.job-status-cancelling   { background: #3a2a1a; color: #e8a000; }
.job-card-cancel { background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); cursor: pointer; font-size: 10px; padding: 2px 7px; }
.job-card-cancel:hover { border-color: var(--danger-fg); color: var(--danger-fg); }
.job-progress-bar-wrap { background: var(--surface); height: 4px; }
.job-progress-bar { background: var(--accent); height: 4px; transition: width .3s; }
.job-card-detail { color: var(--muted); font-size: 11px; padding: 0 12px 8px; }
.phase-row { align-items: center; display: flex; gap: 6px; margin: 2px 0; }
.phase-label { color: var(--muted); flex-shrink: 0; font-size: 9px; letter-spacing: .6px; text-transform: uppercase; width: 46px; }
.phase-bar-wrap { background: var(--border); border-radius: 2px; flex: 1; height: 4px; overflow: hidden; }
.phase-bar { border-radius: 2px; height: 100%; transition: width .4s; background: var(--accent); }
.phase-pct { color: var(--muted); flex-shrink: 0; font-size: 9px; text-align: right; width: 26px; }
.phase-done .phase-label { color: var(--ok-fg); }
.phase-done .phase-bar   { background: var(--ok-fg); }
.phase-done .phase-pct   { color: var(--ok-fg); }
.phase-active .phase-label { color: var(--accent); }
.phase-active .phase-pct   { color: var(--accent); }
.phase-pending .phase-bar  { background: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
/* ── Item Chat Panel ── */
.item-chat-backdrop { display: none; position: fixed; inset: 0; z-index: 290; }
.item-chat-panel { background: var(--surface); border-left: 2px solid var(--accent); bottom: 0; display: flex; flex-direction: column; position: fixed; right: 0; top: 0; transform: translateX(100%); transition: transform .22s cubic-bezier(.4,0,.2,1); width: 360px; z-index: 300; }
.item-chat-panel.open { transform: translateX(0); }
.item-chat-backdrop.open { display: block; }
.item-chat-header { align-items: flex-start; background: var(--surface2); border-bottom: 1px solid var(--border); display: flex; gap: 8px; justify-content: space-between; padding: 12px 14px; flex-shrink: 0; }
.item-chat-header-text { flex: 1; min-width: 0; }
.item-chat-title { color: var(--accent); font-size: 12px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-chat-meta { color: var(--muted); font-size: 10px; margin-top: 2px; }
.item-chat-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 2px; }
.item-chat-close:hover { color: var(--text); }
.item-chat-photos { display: flex; flex-shrink: 0; gap: 6px; overflow-x: auto; padding: 8px 12px; scrollbar-width: thin; }
.item-chat-photos:empty { display: none; }
.item-chat-photo-thumb { border: 1px solid var(--border); border-radius: 4px; cursor: pointer; flex-shrink: 0; height: 56px; object-fit: cover; width: 72px; }
.item-chat-photo-thumb:hover { border-color: var(--accent); }
.item-chat-history { flex: 1; overflow-y: auto; padding: 10px 12px; }
.item-chat-input-row { border-top: 1px solid var(--border); display: flex; flex-shrink: 0; gap: 6px; padding: 8px 10px; }
.item-chat-input-row textarea { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); flex: 1; font-family: var(--font); font-size: 12px; padding: 6px 8px; resize: none; }

/* ── Photo tag editor ── */
.photo-modal-tags { border-bottom: 1px solid var(--border); margin-bottom: 10px; padding-bottom: 10px; }
.photo-modal-tags-label { color: var(--muted); font-size: 10px; letter-spacing: 1px; margin-bottom: 6px; text-transform: uppercase; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; min-height: 22px; }
.tag-chip { align-items: center; background: #0a2a1a; border: 1px solid #2a5a3a; border-radius: 3px; color: var(--ok-fg); display: flex; font-size: 10px; gap: 4px; padding: 2px 6px; }
.tag-chip-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; padding: 0 1px; }
.tag-chip-remove:hover { color: var(--danger-fg); }
.tag-add-row { display: flex; gap: 6px; }
.tag-input { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); flex: 1; font-family: var(--font); font-size: 11px; padding: 4px 7px; }

/* ── Tag badge on media thumbs ── */
.media-thumb-tag-badge { background: #0a2a1a; border: 1px solid #2a5a3a; border-radius: 3px; bottom: 4px; color: var(--ok-fg); font-size: 9px; left: 4px; padding: 1px 4px; position: absolute; }

/* ── Build-category tag chips on thumbnail ── */
.thumb-tags { bottom: 4px; display: flex; flex-wrap: wrap; gap: 2px; left: 4px; pointer-events: none; position: absolute; right: 4px; }
.thumb-tag { background: rgba(0,0,0,.72); border: 1px solid rgba(255,255,255,.12); border-radius: 2px; color: #ddd; font-size: 8px; letter-spacing: .3px; padding: 1px 4px; white-space: nowrap; }

/* ── Tag filter bar chips ── */
.tag-filter-chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; color: var(--muted); cursor: pointer; font-family: var(--font); font-size: 10px; letter-spacing: .5px; padding: 3px 9px; transition: border-color .1s, color .1s; white-space: nowrap; }
.tag-filter-chip:hover { border-color: var(--accent); color: var(--text); }
.tag-filter-chip.active { background: rgba(232,160,0,.1); border-color: var(--accent); color: var(--accent); }

/* ── Multi-select states ── */
.media-thumb.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.media-grid.select-mode .media-thumb { cursor: pointer; }
.media-grid.select-mode .media-thumb:hover:not(.selected) { outline: 2px solid var(--muted); outline-offset: -2px; }

/* ── Search + sort inputs ── */
.media-search { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 11px; padding: 4px 8px; width: 140px; }
.media-search:focus { border-color: var(--accent); outline: none; }
.media-sort-sel { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 11px; padding: 4px 6px; }
.media-sort-sel:focus { border-color: var(--accent); outline: none; }

/* ── Profile photo avatar ── */
.profile-avatar { border: 2px solid var(--border); border-radius: 50%; height: 52px; object-fit: cover; width: 52px; flex-shrink: 0; }
.profile-avatar-sm { border: 2px solid var(--border); border-radius: 50%; height: 36px; object-fit: cover; width: 36px; flex-shrink: 0; }

@media (max-width: 800px) { .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 500px) { .form-grid { grid-template-columns: 1fr; } }

/* ── Login compact modal ── */
.login-compact { max-width: 360px; padding: 28px 28px 24px; position: relative; }
.modal-close-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; position: absolute; right: 12px; top: 12px; padding: 2px 6px; }
.modal-close-x:hover { color: var(--text); }

/* ── Public landing ── */
.landing-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 16px 0; }

.landing-hero { align-items: flex-start; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; margin-bottom: 24px; }
.landing-build-title { color: var(--accent); font-size: 22px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; }
.landing-engine { color: var(--text); font-size: 13px; margin-top: 5px; }
.landing-builder { color: var(--muted); font-size: 11px; letter-spacing: 1px; margin-top: 4px; text-transform: uppercase; }
.landing-hero-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.landing-link-btn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-family: var(--font); font-size: 12px; padding: 7px 16px; text-decoration: none; transition: border-color .15s, color .15s; }
.landing-link-btn:hover { border-color: var(--accent); color: var(--accent); }

.landing-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px; margin-bottom: 14px; }
.landing-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.landing-stat-val { font-size: 26px; font-weight: bold; }
.landing-stat-label { color: var(--muted); font-size: 10px; letter-spacing: 1px; margin-top: 2px; text-transform: uppercase; }

.landing-progress-wrap { align-items: center; display: flex; gap: 12px; margin-bottom: 24px; }
.landing-progress-bar { background: var(--surface2); border-radius: 4px; flex: 1; height: 8px; overflow: hidden; }
.landing-progress-bar div { background: var(--accent); border-radius: 4px; height: 100%; transition: width .6s; }
.landing-prog-label { color: var(--muted); font-size: 11px; white-space: nowrap; }

.landing-section-title { color: var(--accent); font-size: 10px; letter-spacing: 2px; margin-bottom: 12px; text-transform: uppercase; }

.landing-phases { display: flex; flex-direction: column; gap: 7px; margin-bottom: 28px; }
.lp-row { align-items: center; display: grid; grid-template-columns: 160px 1fr 50px; gap: 10px; }
@media(max-width:600px) { .lp-row { grid-template-columns: 110px 1fr 40px; } }
.lp-name { color: var(--text); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-bar-wrap { background: var(--surface2); border-radius: 3px; height: 16px; overflow: hidden; position: relative; }
.lp-bar-bg { height: 100%; opacity: .2; width: 100%; border-radius: 3px; position: absolute; inset: 0; }
.lp-bar-fill { height: 100%; border-radius: 3px; position: absolute; top: 0; left: 0; transition: width .6s; }
.lp-count { color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; }

.landing-photos-hdr { align-items: center; display: flex; justify-content: space-between; margin-bottom: 12px; }
.landing-see-all { color: var(--accent); font-size: 12px; text-decoration: none; }
.landing-see-all:hover { text-decoration: underline; }

.landing-photos { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); margin-bottom: 28px; }
.landing-photo { aspect-ratio: 4/3; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; overflow: hidden; position: relative; }
.landing-photo:hover { border-color: var(--accent); }
.landing-photo img { display: block; height: 100%; object-fit: cover; width: 100%; }
.landing-photo-ph { align-items: center; bottom: 0; color: var(--muted); display: flex; flex-direction: column; gap: 4px; justify-content: center; left: 0; position: absolute; right: 0; top: 0; }
.landing-photo-ph svg { height: 28px; opacity: .3; width: 28px; }

.landing-empty { color: var(--muted); font-size: 12px; padding: 10px 0; margin-bottom: 24px; }

.landing-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; margin-top: 24px; padding: 16px; text-align: center; }
.landing-footer a { color: var(--accent); opacity: .7; text-decoration: none; }
.landing-footer a:hover { opacity: 1; }

/* ── Home dashboard grid ── */
.home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; padding: 4px 0; }
.home-full { grid-column: 1 / -1; }
.home-col2 { grid-column: 1; }
.home-col1 { grid-column: 2; }

/* Stats strip — compact single row, no card box */
.home-stats-strip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-stat-pills { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.home-stat-pill { background: var(--surface2); border-radius: 4px; padding: 6px 12px; text-align: center; min-width: 72px; }
.home-stat-pill .spv { font-size: 18px; font-weight: bold; line-height: 1.2; }
.home-stat-pill .spl { color: var(--muted); font-size: 9px; letter-spacing: 1px; margin-top: 2px; text-transform: uppercase; }
.home-prog-wrap { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.home-prog-bar { flex: 1; background: var(--surface2); border-radius: 4px; height: 8px; overflow: hidden; }
.home-prog-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #ffcc00); transition: width .6s; width: 0%; }

/* Photos card: fill available height */
.home-photos-card { display: flex; flex-direction: column; min-height: 320px; }
.home-photos-grid { flex: 1; display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 1fr; gap: 3px; border-radius: 4px; overflow: hidden; }
.home-photo-cell { background: var(--surface2); overflow: hidden; cursor: pointer; }
.home-photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s; }
.home-photo-cell img:hover { opacity: .85; }
@media (max-width: 860px) { .home-photos-grid { grid-template-columns: repeat(4, 1fr); } }

/* Tasks card: fixed height, scrollable */
.home-tasks-card { display: flex; flex-direction: column; }
.home-tasks-scroll { flex: 1; overflow-y: auto; scrollbar-width: thin; max-height: 520px; }
.home-task-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.home-task-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.home-task-name { flex: 1; min-width: 0; font-size: 12px; color: var(--text); line-height: 1.4; }
.home-task-sec { font-size: 10px; color: var(--muted); margin-top: 1px; }
.home-task-badge { font-size: 9px; letter-spacing: .5px; padding: 1px 6px; border-radius: 2px; background: rgba(232,160,0,.15); color: var(--accent); border: 1px solid rgba(232,160,0,.3); white-space: nowrap; flex-shrink: 0; }

/* Budget mini card */
.home-budget-card { display: flex; flex-direction: column; gap: 10px; }
.home-budget-bar-wrap { background: var(--surface2); border-radius: 4px; height: 6px; overflow: hidden; }
.home-budget-bar-fill { height: 100%; border-radius: 4px; background: var(--ok-fg); transition: width .6s; }
.home-budget-cat { display: flex; justify-content: space-between; align-items: center; font-size: 11px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.home-budget-cat:last-child { border-bottom: none; }

@media (max-width: 860px) { .home-grid { grid-template-columns: 1fr; } .home-col2, .home-col1 { grid-column: 1; } }

/* ── Parts tab ── */
.parts-summary-row { display: grid; grid-template-columns: repeat(auto-fill,minmax(100px,1fr)); gap: 8px; margin-bottom: 12px; }
.parts-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.parts-stat-val { font-size: 20px; font-weight: bold; }
.parts-stat-lbl { color: var(--muted); font-size: 10px; letter-spacing: 1px; margin-top: 2px; text-transform: uppercase; }

.part-row { align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: var(--radius) var(--radius) 0 0; cursor: pointer; display: flex; gap: 10px; margin-bottom: 0; padding: 9px 12px; transition: border-color .15s; user-select: none; }
.part-row:hover { border-color: #3a3a3a; }
.part-row.part-open { border-bottom-color: var(--accent); border-left-color: var(--accent); }
.part-wrap { margin-bottom: 6px; }
.part-status { flex-shrink: 0; font-size: 14px; font-weight: bold; width: 16px; text-align: center; }
.part-body { flex: 1; min-width: 0; }
.part-name { font-size: 13px; line-height: 1.3; }
.part-meta { color: var(--muted); font-size: 11px; margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.part-meta a { color: var(--accent2); text-decoration: none; }
.part-cat { background: var(--surface2); border-radius: 3px; font-size: 10px; padding: 1px 5px; }
.part-cost { color: var(--warn-fg); font-size: 12px; white-space: nowrap; }
.part-actions { align-items: center; display: flex; gap: 4px; flex-shrink: 0; }
.item-meta-link { color: var(--accent2) !important; text-decoration: none; }
.item-meta-link:hover { text-decoration: underline; }
/* Part expand panel */
.part-detail { background: var(--surface2); border: 1px solid var(--accent); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 14px 16px; }
.part-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; font-size: 11px; margin-bottom: 12px; }
.part-detail-field { display: flex; flex-direction: column; gap: 2px; }
.part-detail-label { color: var(--muted); font-size: 10px; letter-spacing: .5px; text-transform: uppercase; }
.part-detail-val { color: var(--text); }
.part-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.part-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.part-edit-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.part-edit-grid input, .part-edit-grid select, .part-edit-grid textarea { background: var(--surface); border: 1px solid var(--border); border-radius: 3px; color: var(--text); font-family: var(--font); font-size: 12px; padding: 4px 6px; }
.part-edit-grid textarea { resize: vertical; min-height: 50px; }
.part-edit-full { grid-column: 1 / -1; }
/* Part AI chat */
.part-ai-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 10px; padding: 10px; }
.part-ai-history { font-size: 12px; max-height: 220px; overflow-y: auto; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.part-ai-msg { background: var(--surface2); border-radius: 4px; padding: 6px 8px; white-space: pre-wrap; line-height: 1.5; }
.part-ai-msg.user { background: rgba(255,165,0,.08); border-left: 2px solid var(--accent); }
.part-ai-msg.assistant { border-left: 2px solid var(--ok-fg); }
.part-ai-input-row { display: flex; gap: 6px; }
.part-ai-input-row textarea { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; color: var(--text); font-family: var(--font); font-size: 12px; padding: 6px 8px; resize: none; height: 52px; }
.part-ai-thinking { color: var(--muted); font-size: 11px; font-style: italic; padding: 4px 0; }

/* ── Add Wizard ── */
.wizard-type-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; padding: 16px 12px; text-align: center; transition: border-color .15s; }
.wizard-type-card:hover { border-color: var(--accent); }
.wt-icon { color: var(--accent); font-size: 24px; margin-bottom: 6px; }
.wt-label { color: var(--text); font-size: 13px; font-weight: bold; margin-bottom: 4px; }
.wt-desc { color: var(--muted); font-size: 11px; line-height: 1.4; }

/* ── Claude suggestions ── */
.suggestion-row { align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; gap: 10px; margin-bottom: 5px; padding: 8px 12px; }
.sug-type { border-radius: 3px; font-size: 10px; letter-spacing: 1px; padding: 2px 6px; text-transform: uppercase; flex-shrink: 0; }
.sug-suggestion { background: #0a2a1a; color: var(--ok-fg); }
.sug-observation { background: #1a1a2a; color: var(--blue-fg); }
.sug-warning { background: #2a1a0a; color: var(--warn-fg); }
.sug-question { background: #1a1a1a; color: var(--muted); }
.sug-error { background: #2a0a0a; color: var(--danger-fg); }
.sug-content { flex: 1; font-size: 12px; line-height: 1.5; }

/* ── Blog photo strips (public build log) ── */
.blog-photos { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.blog-photo-thumb { border-radius: 4px; cursor: pointer; height: 72px; object-fit: cover; transition: opacity .15s; width: 96px; }
.blog-photo-thumb:hover { opacity: .85; }
.blog-photo-more { align-items: center; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; color: var(--muted); display: flex; font-size: 11px; height: 72px; justify-content: center; width: 64px; }

/* ── Build log admin editor ── */
.blog-admin-entry { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: var(--radius); margin-bottom: 8px; padding: 12px 14px; }
.blog-admin-entry.pinned { border-left-color: var(--accent); }
.blog-admin-entry.unpublished { opacity: .55; }
.blog-admin-title { color: var(--text); font-size: 13px; font-weight: bold; line-height: 1.4; }
.blog-admin-meta { color: var(--muted); font-size: 10px; margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.blog-admin-body { color: var(--muted); font-size: 11px; line-height: 1.65; margin-top: 8px; white-space: pre-wrap; word-break: break-word; }
.blog-expand-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-family: var(--font); font-size: 10px; letter-spacing: 1px; margin-top: 5px; padding: 0; text-transform: uppercase; }
.blog-expand-btn:hover { text-decoration: underline; }
.blog-admin-actions { display: flex; gap: 5px; margin-top: 8px; }
.blog-editor-modal { max-width: 680px; width: 95vw; }
.blog-editor-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.blog-editor-label { color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.blog-editor-input { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 12px; padding: 6px 8px; width: 100%; }
.blog-editor-input:focus { border-color: var(--accent); outline: none; }
.blog-editor-textarea { min-height: 120px; resize: vertical; }
.blog-editor-checks { display: flex; gap: 14px; }
.blog-editor-check { align-items: center; cursor: pointer; display: flex; font-size: 12px; gap: 6px; }
/* Blog photo picker */
.blog-photo-picker { border: 1px solid var(--border); border-radius: var(--radius); max-height: 240px; overflow-y: auto; padding: 6px; margin-top: 6px; }
.blog-pick-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.blog-pick-thumb { border: 2px solid transparent; border-radius: 3px; cursor: pointer; height: 60px; object-fit: cover; width: 80px; transition: border-color .1s; }
.blog-pick-thumb.selected { border-color: var(--accent); }
.blog-pick-thumb:hover:not(.selected) { border-color: var(--muted); }
.sug-time { color: var(--muted); font-size: 10px; white-space: nowrap; }

/* ── Claude 2-column layout ── */
.claude-grid { display: grid; grid-template-columns: 1fr 360px; gap: 12px; align-items: start; }
.claude-chat-col { min-width: 0; }
.claude-side-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (max-width: 900px) { .claude-grid { grid-template-columns: 1fr; } }

/* ── Scan modal full-width ── */
.scan-modal-wide { max-width: min(96vw, 900px); max-height: 90vh; overflow-y: auto; }
.scan-config-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.scan-num-input { background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; color: var(--text); font-family: var(--font); font-size: 12px; padding: 3px 5px; text-align: center; width: 48px; margin: 0 4px; }

/* Live scan two-panel */
.scan-live-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.scan-live-left { display: flex; flex-direction: column; gap: 6px; }
.scan-live-img { border-radius: 6px; height: 160px; object-fit: cover; width: 100%; cursor: pointer; }
.scan-live-fname { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-live-status { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--accent); font-size: 10px; letter-spacing: 1px; padding: 3px 8px; text-align: center; text-transform: uppercase; }
.scan-live-right { display: flex; flex-direction: column; min-width: 0; }
.scan-live-label { color: var(--muted); font-size: 10px; letter-spacing: 1px; margin-bottom: 4px; text-transform: uppercase; }
.scan-live-stream { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--text); flex: 1; font-size: 11px; line-height: 1.65; max-height: 160px; min-height: 80px; overflow-y: auto; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }

/* Scan history in Claude sidebar */
.scan-hist-session { border: 1px solid var(--border); border-radius: 4px; margin-bottom: 6px; overflow: hidden; }
.scan-hist-header { align-items: center; cursor: pointer; display: flex; gap: 8px; padding: 7px 10px; }
.scan-hist-header:hover { background: var(--surface2); }
.scan-hist-thumbs { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px 10px 8px; }
.scan-hist-thumb { border-radius: 3px; cursor: pointer; height: 52px; object-fit: cover; width: 68px; }
.scan-hist-obs { color: var(--muted); font-size: 10px; line-height: 1.5; padding: 0 10px 6px; }
.scan-hist-props { color: var(--ok-fg); font-size: 10px; padding: 0 10px 6px; }

/* Scan result cards (completed) */
.scan-photo-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.scan-photo-header { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; }
.scan-thumb { border-radius: 4px; cursor: pointer; flex-shrink: 0; height: 72px; object-fit: cover; width: 96px; }
.scan-photo-obs { color: var(--text); font-size: 11px; line-height: 1.6; }
.scan-photo-fname { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.scan-proposals { border-top: 1px solid var(--border); padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; }
.scan-proposal { align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; display: flex; gap: 8px; padding: 7px 10px; }
.scan-proposal input[type=checkbox] { flex-shrink: 0; margin-top: 2px; }
.scan-prop-label { flex: 1; }
.scan-prop-name { color: var(--text); font-size: 12px; }
.scan-prop-change { color: var(--muted); font-size: 10px; margin-top: 2px; }
.scan-prop-change .arrow { color: var(--accent); }
.scan-prop-change .to { color: var(--ok-fg); }
.scan-prop-reason { color: var(--muted); font-size: 10px; font-style: italic; margin-top: 2px; }
.scan-conf { color: var(--muted); font-size: 9px; white-space: nowrap; }
.scan-approve-bar { border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; padding: 8px 12px; }
.scan-no-props { color: var(--muted); font-size: 11px; font-style: italic; padding: 6px 0; }
.scan-description { color: var(--text); font-size: 11px; line-height: 1.6; margin-bottom: 4px; }
.scan-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.scan-tag { background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; color: var(--accent); font-size: 9px; padding: 1px 5px; }
.scan-phase-badge { background: var(--surface2); border: 1px solid var(--accent); border-radius: 3px; color: var(--accent); display: inline-block; font-size: 9px; letter-spacing: 1px; margin-bottom: 4px; padding: 1px 6px; text-transform: uppercase; }
.scan-proposal.high-conf { border-color: var(--ok-fg); }
.scan-conf.high { color: var(--ok-fg); font-weight: bold; }
.scan-section-label { color: var(--muted); font-size: 9px; letter-spacing: 1px; margin-top: 4px; text-transform: uppercase; }
.scan-summary-panel { background: var(--surface); border: 1px solid var(--ok-fg); border-radius: var(--radius); margin-bottom: 14px; padding: 12px 14px; }
.scan-summary-title { color: var(--ok-fg); font-size: 11px; font-weight: bold; letter-spacing: 1px; margin-bottom: 8px; text-transform: uppercase; }
.scan-summary-narrative { color: var(--text); font-size: 12px; line-height: 1.7; margin-bottom: 10px; white-space: pre-wrap; }
.scan-summary-newparts { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.scan-summary-newpart { background: var(--surface2); border: 1px solid var(--accent); border-radius: 3px; color: var(--accent); font-size: 10px; padding: 2px 7px; }
.scan-apply-all-bar { border-top: 1px solid var(--border); display: flex; justify-content: flex-end; padding-top: 10px; margin-top: 6px; }

/* ── Documents tab ── */
.docs-list { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.doc-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; transition: border-color .15s; }
.doc-card:hover { border-color: var(--accent); }
.doc-card.expanded { border-left-color: var(--accent); }
.doc-card-header { display: flex; align-items: flex-start; gap: 10px; }
.doc-type-badge { background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; color: var(--muted); font-size: 9px; letter-spacing: 1px; padding: 2px 6px; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; margin-top: 1px; }
.doc-type-badge.sales_order { border-color: var(--accent); color: var(--accent); }
.doc-type-badge.manual { border-color: var(--blue-fg); color: var(--blue-fg); }
.doc-type-badge.invoice, .doc-type-badge.receipt { border-color: var(--ok-fg); color: var(--ok-fg); }
.doc-type-badge.spec { border-color: var(--warn-fg); color: var(--warn-fg); }
.doc-card-title { color: var(--text); font-size: 13px; font-weight: bold; flex: 1; line-height: 1.4; }
.doc-card-meta { color: var(--muted); font-size: 10px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.doc-card-summary { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 8px; }
.doc-card-preview { color: var(--muted); font-size: 11px; font-style: italic; margin-top: 6px; white-space: pre-wrap; word-break: break-word; max-height: 80px; overflow: hidden; }
.doc-card-body { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; display: none; }
.doc-card.expanded .doc-card-body { display: block; }
.doc-full-content { background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 11px; line-height: 1.7; max-height: 400px; overflow-y: auto; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.doc-tag { background: var(--surface2); border: 1px solid var(--border); border-radius: 3px; color: var(--muted); font-size: 10px; padding: 2px 6px; }
.doc-links { color: var(--muted); font-size: 10px; margin-top: 8px; }
.doc-links a { color: var(--accent); text-decoration: none; }
.doc-card-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ── Photo scan modal ── */
.scan-photo-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.scan-photo-header { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; }
.scan-thumb { border-radius: 4px; cursor: pointer; flex-shrink: 0; height: 72px; object-fit: cover; width: 96px; }
.scan-photo-obs { color: var(--text); font-size: 11px; line-height: 1.6; }
.scan-photo-fname { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.scan-proposals { border-top: 1px solid var(--border); padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; }
.scan-proposal { align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; display: flex; gap: 8px; padding: 7px 10px; }
.scan-proposal input[type=checkbox] { flex-shrink: 0; margin-top: 2px; }
.scan-prop-label { flex: 1; }
.scan-prop-name { color: var(--text); font-size: 12px; }
.scan-prop-change { color: var(--muted); font-size: 10px; margin-top: 2px; }
.scan-prop-change .from { color: var(--muted); }
.scan-prop-change .arrow { color: var(--accent); }
.scan-prop-change .to { color: var(--ok-fg); }
.scan-prop-reason { color: var(--muted); font-size: 10px; font-style: italic; margin-top: 2px; }
.scan-conf { color: var(--muted); font-size: 9px; white-space: nowrap; }
.scan-approve-bar { border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; padding: 8px 12px; }
.scan-no-props { color: var(--muted); font-size: 11px; font-style: italic; padding: 6px 0; }

/* ── Changelog tab ── */
.changelog-list { display: flex; flex-direction: column; gap: 0; padding-top: 8px; }
.cl-entry { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cl-entry:last-child { border-bottom: none; }
.cl-hash { font-family: monospace; font-size: .78rem; color: var(--accent); min-width: 58px; padding-top: 2px; }
.cl-body { flex: 1; min-width: 0; }
.cl-msg { font-size: .9rem; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-meta { display: flex; gap: 10px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.cl-date { font-size: .75rem; color: var(--muted); }
.cl-author { font-size: .75rem; color: var(--muted); }
.cl-badge { font-size: .65rem; padding: 1px 7px; border-radius: 99px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cl-badge-local    { background: #1a3a1a; color: #5fba5f; }
.cl-badge-github   { background: #1a1a3a; color: #6e8efb; }
.cl-badge-backfill { background: #2a2420; color: #c09060; }
.cl-branch { font-size: .72rem; color: var(--muted); opacity: .7; }
.cl-body-text { font-size: .78rem; color: var(--muted); margin-top: 5px; white-space: pre-wrap; border-left: 2px solid var(--border); padding-left: 8px; line-height: 1.5; }

/* ── App footer ── */
#app-footer { position: fixed; bottom: 0; left: 0; right: 0; height: 22px; background: var(--surface); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 14px; z-index: 900; pointer-events: none; }
.footer-version { font-size: .68rem; font-family: monospace; color: var(--accent); font-weight: 600; }
.footer-sha { font-size: .68rem; font-family: monospace; color: var(--muted); }
.footer-branch { font-size: .68rem; color: var(--muted); }
.footer-sep { font-size: .68rem; color: var(--border); }
.tab-content { padding-bottom: 30px; }

/* ── Changelog version banner ── */
.cl-version-banner { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: baseline; gap: 12px; }
.cl-version-num { font-size: 1.4rem; font-family: monospace; color: var(--accent); font-weight: 700; }
.cl-version-sha { font-size: .8rem; font-family: monospace; color: var(--muted); }
.cl-version-date { font-size: .75rem; color: var(--muted); }
.cl-version-branch { font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--surface2); color: var(--muted); }
