/* ═══════════════════════════════════════════════════════════════
   Model Distribution Checklist — neuronbim Tool
   style.css
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ────────────────────────── */
:root {
  --white:         #ffffff;
  --bg:            #F4F6F8;
  --accent:        #FF6F00;
  --accent-dark:   #cc5900;
  --accent-light:  #fff0e0;
  --accent-xlight: #fff7f0;
  --text:          #1A2530;
  --text-muted:    #8FA1B2;
  --border:        #d0d8e0;
  --dove:          #dde5ed;
  --header-bg:     #1A2530;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow:    0 3px 10px rgba(0,0,0,0.09);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.13);
  --green:        #2d9e6b;
  --green-dark:   #1e7a52;
  --green-bg:     #edf7f2;
  --green-border: #a3d9be;
  --radius:    8px;
  --radius-sm: 5px;
  --font-head: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img    { display: block; max-width: 100%; }
a      { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); font-size: 13px; outline: none; }

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

.hidden { display: none !important; }

/* ─── App Header ─────────────────────────────── */
#app-header {
  background: var(--header-bg);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid #2D3F4F;
  gap: 12px;
}
.header-left    { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-logo-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.header-logo    { height: 30px; width: auto; display: block; flex-shrink: 0; }
.header-brand   { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: #fff; display: flex; align-items: baseline; flex-shrink: 0; text-transform: lowercase; }
.topbim-top     { color: #fff; letter-spacing: -0.3px; }
.topbim-dot     { color: #4a6070; }
.topbim-bim     { color: var(--accent); letter-spacing: -0.3px; }
.header-divider { color: #4a6070; margin: 0 10px; font-weight: 300; font-size: 15px; flex-shrink: 0; }
.header-tool    { color: #cbd5e0; font-weight: 400; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ─── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.btn-primary         { background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(255,111,0,0.28); }
.btn-primary:hover   { background: var(--accent-dark); box-shadow: 0 4px 12px rgba(255,111,0,0.36); }
.btn-secondary       { background: transparent; color: #e2e8f0; border: 1px solid #4a6070; }
.btn-secondary:hover { border-color: #a0aec0; color: #fff; }
.btn-light           { background: var(--white); color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-light:hover     { border-color: var(--text-muted); color: var(--text); }
.btn-danger          { background: #fff; color: #ef4444; border: 1.5px solid #fca5a5; }
.btn-danger:hover    { background: #fef2f2; border-color: #ef4444; }
.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-icon:hover { background: #fee2e2; color: #ef4444; }
.btn-icon svg   { width: 14px; height: 14px; }
.btn-ghost { background: transparent; color: #94A3B8; border: 1px solid #3A4F60; }
.btn-ghost:hover { border-color: #6B7E8F; color: #CBD5E0; }

/* ─── Actions Dropdown ─────────────────────────────────────────────────────── */
.actions-dropdown-wrap { position: relative; }
.actions-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid #E2E8F0; border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); min-width: 160px; z-index: 300; padding: 4px 0;
}
.actions-dropdown.open { display: block; }
.dropdown-item {
  display: block; width: 100%; padding: 8px 16px; text-align: left;
  background: none; border: none; font-size: 13px; font-family: var(--font-body);
  color: #475569; cursor: pointer; white-space: nowrap;
}
.dropdown-item:hover:not(:disabled) { background: #F8FAFB; color: #1A2530; }
.dropdown-item:disabled { opacity: 0.38; cursor: not-allowed; }
.dropdown-divider { height: 1px; background: #E2E8F0; margin: 4px 0; }

/* ─── App Body ───────────────────────────────── */
#app-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  padding: 24px 28px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: flex-start;
}

/* ─── Cards ──────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.card + .card { margin-top: 16px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-title svg { width: 13px; height: 13px; }
.card-body { padding: 16px; }

/* Card modifier for checklist card */
.checklist-card { margin-top: 16px; }

/* ─── Project Info ───────────────────────────── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-full  { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #b0bec5; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,111,0,0.10);
  background: var(--white);
}
.form-group textarea { resize: vertical; min-height: 72px; }

/* Small label hint (e.g. "optional · max 500 chars") */
.label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; }

/* ─── Introduction Card ──────────────────────── */
.intro-body { overflow: hidden; max-height: 800px; transition: max-height 0.3s ease; }
.intro-body.collapsed { max-height: 0; }
.intro-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.intro-chevron { width: 14px; height: 14px; color: var(--text-muted); transition: transform .22s ease; }
.intro-chevron.open { transform: rotate(180deg); }
.btn-sm { padding: 4px 10px; font-size: 11.5px; }
.intro-title { font-family: var(--font-head); font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.intro-para  { font-size: 12.5px; color: var(--text); line-height: 1.65; margin-bottom: 10px; }
.intro-para:last-child { margin-bottom: 0; }
.intro-list  { margin: 0 0 10px 18px; display: flex; flex-direction: column; gap: 5px; }
.intro-list li { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.intro-list li::marker { color: var(--accent); }
.intro-textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 12.5px; font-family: var(--font-body); line-height: 1.65; resize: vertical; transition: border-color .15s, box-shadow .15s; }
.intro-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,111,0,0.10); background: var(--white); outline: none; }
.intro-edit-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* ─── Filter Bar ─────────────────────────────── */
.filter-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  background: var(--bg);
}
.filter-btn {
  padding: 4px 12px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--white);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .14s;
  white-space: nowrap;
}
.filter-btn:hover  { border-color: var(--accent); color: var(--accent); background: var(--accent-xlight); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ─── Checklist Items ────────────────────────── */
.checklist-wrap { padding: 14px; display: flex; flex-direction: column; gap: 10px; }

/* Category as a clean bordered card */
.cat-group {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s;
}
.cat-group:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

/* Category header — white, minimal */
.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 14px;
  background: var(--white);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background .12s;
}
.cat-header:hover { background: var(--bg); }

.cat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.cat-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .22s ease;
}
.cat-chevron.open { transform: rotate(180deg); }
.cat-name  { font-family: var(--font-head); font-size: 13.5px; font-weight: 700; color: var(--text); }
.cat-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cat-count { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); padding: 1px 7px; border-radius: 100px; white-space: nowrap; transition: background .25s, color .25s, border-color .25s; }
.cat-count.complete { background: var(--green-bg); border-color: var(--green-border); color: var(--green-dark); }
.cat-mini-bar-track { width: 52px; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.cat-mini-bar-fill  { height: 100%; background: var(--accent); border-radius: 2px; transition: width .35s ease, background .35s ease; }
.cat-mini-bar-fill.complete { background: var(--green); }
.cat-items { border-top: 1px solid var(--border); }

/* Checklist item — flat row with hairline divider */
.cl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  background: var(--white);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 0;
  transition: background .12s;
}
.cl-item:last-child { border-bottom: none; }
.cl-item:hover      { background: #fafbfc; }
.cl-item.is-checked { opacity: 0.55; background: var(--green-bg); }
.cl-item.is-checked .cl-text { text-decoration: line-through; color: var(--text-muted); }

.cl-cb          { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; accent-color: var(--accent); cursor: pointer; }
.cl-cb:checked  { accent-color: var(--green); }
.cl-body { flex: 1; min-width: 0; }
.cl-title-row { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.cl-text { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.45; }
.cl-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.p-badge { font-family: var(--font-mono); font-size: 9px; font-weight: 600; padding: 1px 6px; border-radius: 100px; letter-spacing: 0.2px; white-space: nowrap; }
.p-badge.critical { background: #fef2f2; color: #ef4444; }
.p-badge.high     { background: var(--accent-xlight); color: var(--accent-dark); }
.p-badge.medium   { background: #f1f5f9; color: #64748b; }

.ev-ok-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--green-bg);
  color: var(--green-dark);
  border: 1px solid var(--green-border);
  padding: 1px 6px;
  border-radius: 100px;
}

.ev-inline-panel { margin-top: 8px; }

.ev-entries { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

.ev-entry {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ev-entry-img {
  display: block;
  height: auto;
  min-width: 40px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity .12s;
}
.ev-entry-img:hover { opacity: 0.85; }
.ev-entry-slider-row { display: flex; align-items: center; }
.ev-size-slider {
  flex: 1;
  cursor: pointer;
  accent-color: var(--accent);
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.ev-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.ev-size-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.ev-entry-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ev-entry-bottom .ev-title-input { flex: 1; }
.ev-desc-input {
  width: 100%; resize: vertical; min-height: 46px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 8px; font-size: 12px; color: var(--text);
  background: var(--white); line-height: 1.4;
}
.ev-desc-input:focus { border-color: var(--accent); outline: none; }
.ev-desc-input::placeholder { color: var(--text-muted); }
.ev-title-input {
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  width: 100%;
  box-sizing: border-box;
}
.ev-title-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,111,0,0.1); }
.ev-title-input::placeholder { color: var(--text-muted); }
.ev-entry-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  font-size: 10.5px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color .12s, border-color .12s;
}
.ev-entry-remove:hover { color: #dc2626; border-color: #dc2626; }
.ev-entry-remove svg { width: 9px; height: 9px; }

.ev-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: border-color .15s, background .15s, color .15s;
}
.ev-upload-label:hover { border-color: var(--accent); background: #fff8f0; color: var(--accent); }
.ev-upload-label svg { width: 14px; height: 14px; flex-shrink: 0; }
.ev-upload-input { display: none; }

.cl-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; margin-top: 5px; }
.cl-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* ─── Empty State ────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state svg { margin: 0 auto 12px; opacity: 0.3; }
.empty-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.empty-desc  { font-size: 12.5px; }

/* ─── Right Column ───────────────────────────── */
.right-col { display: flex; flex-direction: column; gap: 16px; }

/* ─── Progress ───────────────────────────────── */
.progress-stats { display: flex; gap: 0; margin-bottom: 14px; }
.prog-stat { flex: 1; text-align: center; padding: 4px 0; }
.prog-stat:not(:last-child) { border-right: 1px solid var(--border); }
.prog-val { display: block; font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 3px; }
.prog-val.hi { color: var(--accent); transition: color .4s ease; }
.prog-val.hi.complete { color: var(--green-dark); }
.prog-lbl    { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.5px; }
.prog-bar-track { height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.prog-bar-fill  { height: 100%; background: linear-gradient(90deg, var(--accent) 0%, #ff9500 100%); border-radius: 4px; transition: width 0.4s cubic-bezier(0.4,0,0.2,1), background 0.4s ease; }
.prog-bar-fill.complete { background: linear-gradient(90deg, var(--green-dark) 0%, var(--green) 100%); }
.prog-pct-row   { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 5px; }

/* ─── Manage Section ─────────────────────────── */
.manage-section { display: flex; flex-direction: column; gap: 16px; }
.sub-label    { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 7px; }
.sub-label-sm { margin-bottom: 5px; }
.input-row  { display: flex; gap: 7px; }
.input-row input { flex: 1; }
.inline-input  { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 13px; transition: border-color .15s, box-shadow .15s; }
.inline-input:focus  { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,111,0,0.10); background: var(--white); }
.inline-select { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 13px; cursor: pointer; transition: border-color .15s; }
.inline-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,111,0,0.10); }

/* Add item form layout (replaces inline flex styles) */
.add-item-form { display: flex; flex-direction: column; gap: 8px; }

/* Add category button specific sizing */
#addCatBtn { padding: 8px 12px; }

.priority-btns { display: flex; gap: 5px; }
.p-btn { flex: 1; padding: 6px 4px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; border: 1.5px solid var(--border); background: var(--bg); color: var(--text-muted); cursor: pointer; text-align: center; transition: all .14s; }
.p-btn:hover { border-color: var(--text-muted); }
.p-btn.sel-critical { background: #fee2e2; border-color: #ef4444; color: #ef4444; }
.p-btn.sel-high     { background: var(--accent-xlight); border-color: var(--accent); color: var(--accent-dark); }
.p-btn.sel-medium   { background: #f1f5f9; border-color: #94a3b8; color: #475569; }

.toggle-rows { display: flex; flex-direction: column; gap: 5px; }
.toggle-row  { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; }
.toggle-row input { accent-color: var(--accent); cursor: pointer; }
.toggle-row svg   { width: 13px; height: 13px; flex-shrink: 0; }
.toggle-row.req-ev {
  color: #b45309;
  font-weight: 600;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.toggle-row.req-ev input { accent-color: #d97706; }

.add-item-btn { width: 100%; justify-content: center; padding: 8px; font-size: 13px; }

/* ─── Modals ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,37,48,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-box { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.22); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}
.modal-title { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--text); }
.modal-x { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 2px 6px; border-radius: 4px; }
.modal-x:hover { background: var(--bg); }
.modal-body   { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.modal-footer-spread { justify-content: space-between; }

.modal-preview { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; color: var(--text-muted); }
.modal-preview strong { color: var(--text); display: block; margin-bottom: 2px; font-size: 13px; }

.char-hint { text-align: right; font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }

/* ─── Confirm Dialog ─────────────────────────── */
.confirm-box { background: var(--white); border-radius: var(--radius); width: 100%; max-width: 360px; box-shadow: 0 24px 64px rgba(0,0,0,0.22); padding: 26px; }
.confirm-icon { width: 44px; height: 44px; background: #fee2e2; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: #ef4444; }
.confirm-icon svg { width: 20px; height: 20px; }
.confirm-title { font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.confirm-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 22px; }
.confirm-btns  { display: flex; gap: 8px; justify-content: flex-end; }

/* ─── Lightbox ───────────────────────────────── */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 2000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 20px; }
.lightbox-img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); box-shadow: 0 24px 80px rgba(0,0,0,0.5); }

/* ─── Toasts ─────────────────────────────────── */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.toast { background: #1a2530; color: #e2e8f0; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px; max-width: 300px; pointer-events: auto; animation: tin .25s cubic-bezier(0.4,0,0.2,1); }
.toast.ok   { border-left: 3px solid var(--green); }
.toast.err  { border-left: 3px solid #ef4444; }
.toast.warn { border-left: 3px solid #f59e0b; }
@keyframes tin { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ─── Tooltip System ────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 400;
  padding: 4px 9px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 9999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ─── Header Project Name ────────────────────── */
.header-project-name {
  font-size: 11.5px;
  color: #94a3b8;
  font-family: var(--font-mono);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}
.header-project-name:not(:empty) {
  padding-left: 14px;
  margin-left: 6px;
  border-left: 1px solid #4a6070;
}
.header-project-name.dirty { color: var(--accent); }

/* ─── Projects Modal ─────────────────────────── */
.modal-lg { max-width: 660px !important; }
.pm-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  background: var(--white);
  position: sticky;
  top: 53px;
  z-index: 1;
}
.pm-tab {
  padding: 10px 18px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .14s, border-color .14s;
  margin-bottom: -1px;
}
.pm-tab:hover { color: var(--text); }
.pm-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.pm-panel { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.pm-toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pm-save-form {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}
.pm-save-form input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  padding: 0;
  outline: none;
  min-width: 0;
}
.pm-save-form input::placeholder { color: var(--text-muted); }
.pm-save-form-btns { display: flex; gap: 5px; flex-shrink: 0; }
.pm-save-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.pm-save-hint strong { color: var(--text); font-weight: 600; }
.pm-list { display: flex; flex-direction: column; gap: 6px; }
.pm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .14s;
}
.pm-item:hover { border-color: var(--text-muted); }
.pm-item.pm-item-active { border-color: var(--accent); background: var(--accent-xlight); }
.pm-item-info { flex: 1; min-width: 0; }
.pm-item-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-item-meta { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }
.pm-item-actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.badge-builtin {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 1px 5px;
  border-radius: 100px;
  margin-left: 5px;
  vertical-align: middle;
}
.pm-empty {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.pm-empty svg { margin: 0 auto 10px; opacity: 0.3; }
.btn-danger-soft { color: #ef4444 !important; }
.btn-danger-soft:hover { border-color: #ef4444 !important; background: #fef2f2 !important; }

/* ─── Help Guide Modal ───────────────────────── */
.hg-body { max-height: 66vh; overflow-y: auto; }
.hg-section { margin-bottom: 20px; }
.hg-section:last-child { margin-bottom: 0; }
.hg-title {
  font-weight: 600; font-size: 12.5px; color: var(--text);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border); padding-bottom: 5px; margin-bottom: 9px;
}
.hg-ul, .hg-ol { padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.hg-ul li, .hg-ol li { font-size: 13px; color: var(--text); line-height: 1.5; }
.hg-note { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.hg-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hg-table td { padding: 5px 6px; vertical-align: top; border-bottom: 1px solid var(--border); }
.hg-table td:first-child { white-space: nowrap; padding-right: 12px; }
.hg-table tr:last-child td { border-bottom: none; }

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 900px) {
  #app-body { grid-template-columns: 1fr; }
  .right-col { order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .right-col > * { margin-top: 0 !important; }
}
@media (max-width: 600px) {
  #app-header { padding: 0 14px; }
  #app-body   { padding: 14px; gap: 12px; }
  .right-col  { grid-template-columns: 1fr; }
  .header-tool { display: none; }
  .info-grid   { grid-template-columns: 1fr; }
  .header-actions .btn-secondary { display: none; }
}
