/* FS Recap Builder — web edition.
   The palette and proportions follow the Mac app's Theme.swift, which in turn
   follows the generated recap, so the tool and what it produces look like one
   family. */

:root {
  --forest-dark: #2c5f2d;
  --forest: #3e6b33;
  --leaf: #4a7c2f;
  --moss: #97bc62;
  --ink: #1d2b1f;
  --muted: #5c6b5e;
  --canvas: #f6f8f4;
  --card-line: #e3e8e0;
  --warn: #c0392b;
  --opportunity: #d97706;
  --caution: #f4c542;
  --info: #2f6fb0;
  --win: #2e7d32;
  --gradient: linear-gradient(135deg, #2c5f2d, #4a7c2f);

  --moss-06: rgba(151, 188, 98, 0.06);
  --moss-08: rgba(151, 188, 98, 0.08);
  --moss-10: rgba(151, 188, 98, 0.10);
  --moss-12: rgba(151, 188, 98, 0.12);
  --moss-14: rgba(151, 188, 98, 0.14);
  --moss-15: rgba(151, 188, 98, 0.15);
  --moss-18: rgba(151, 188, 98, 0.18);
  --moss-20: rgba(151, 188, 98, 0.20);
  --moss-22: rgba(151, 188, 98, 0.22);
  --moss-40: rgba(151, 188, 98, 0.40);
  --moss-45: rgba(151, 188, 98, 0.45);
  --moss-50: rgba(151, 188, 98, 0.50);
  --warn-08: rgba(192, 57, 43, 0.08);
  --warn-15: rgba(192, 57, 43, 0.15);
  --warn-16: rgba(192, 57, 43, 0.16);
  --warn-40: rgba(192, 57, 43, 0.40);
  --warn-45: rgba(192, 57, 43, 0.45);
  --leaf-14: rgba(74, 124, 47, 0.14);
  --win-08: rgba(46, 125, 50, 0.08);
  --win-12: rgba(46, 125, 50, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--leaf); }
img { max-width: 100%; }
[hidden] { display: none !important; }

#app { height: 100%; }

/* ---------- Page chrome (the Mac window's layout) ---------- */

.page { height: 100vh; display: flex; flex-direction: column; background: var(--canvas); }
.page-scroll { flex: 1; overflow: auto; min-height: 0; }
.page-content { padding: 28px; }
.page-content.narrow { max-width: 860px; margin: 0 auto; }
.footer {
  border-top: 1px solid var(--card-line);
  background: var(--canvas);
  padding: 18px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.spacer { flex: 1; }
.divider { height: 1px; background: var(--card-line); flex: none; }

/* ---------- Brand header ---------- */

.brand-header {
  background: var(--gradient);
  color: #fff;
  padding: 22px 28px;
  flex: none;
}
.brand-top { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.brand-mark { display: flex; align-items: center; gap: 10px; }
.brand-mark svg { width: 15px; height: 15px; opacity: .9; }
.brand-mark span { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; opacity: .85; }
.brand-title { font-size: 24px; font-weight: 700; margin: 10px 0 0; }
.brand-subtitle { font-size: 13px; opacity: .9; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .2); color: rgba(255, 255, 255, .95);
  font-size: 11px; font-weight: 500; max-width: 260px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip svg { width: 10px; height: 10px; flex: none; }
.chip.dim { background: rgba(255, 255, 255, .10); color: rgba(255, 255, 255, .7); }
.chip-text { overflow: hidden; text-overflow: ellipsis; }
.user-chip { cursor: pointer; border: 0; }
.user-chip:hover { background: rgba(255, 255, 255, .28); }

.step-trail { display: flex; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.step-trail .st { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: rgba(255, 255, 255, .6); }
.step-trail .st .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.step-trail .st.reached { color: #fff; }
.step-trail .st.reached .dot { background: #fff; }
.step-trail .st.current { font-weight: 700; }
.step-trail .line { width: 14px; height: 1px; background: rgba(255, 255, 255, .3); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .12s ease-out, opacity .12s ease-out, background .12s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn svg { width: 14px; height: 14px; flex: none; }
.btn-primary {
  background: var(--gradient); color: #fff;
  font-size: 14px; font-weight: 600;
  padding: 11px 22px; border-radius: 10px;
}
.btn-primary:active:not(:disabled) { opacity: .85; }
.btn-primary:disabled { background: rgba(128, 128, 128, .35); cursor: default; }
.btn-secondary {
  background: var(--moss-14); color: var(--forest);
  font-size: 13px; font-weight: 500;
  padding: 9px 16px; border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--moss-40);
}
.btn-secondary:hover:not(:disabled) { background: var(--moss-20); }
.btn-secondary:active:not(:disabled) { background: rgba(151, 188, 98, .25); }
.btn-secondary:disabled { opacity: .45; cursor: default; }
.btn-capsule { border-radius: 999px; padding: 11px 18px; }
.btn-capsule svg { width: 15px; height: 15px; }
.btn-waiting { background: rgba(0, 0, 0, .06); color: var(--muted); font-size: 14px; font-weight: 600; cursor: default; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 11px; font-weight: 500; color: var(--leaf);
  display: inline-flex; align-items: center; gap: 4px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.warn { color: var(--warn); }
.link-btn.moss { color: var(--moss); }
.link-btn.muted { color: var(--muted); }
.link-btn:disabled { opacity: .45; cursor: default; text-decoration: none; }
.link-btn svg { width: 12px; height: 12px; }
.icon-btn { background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; line-height: 0; }
.busy-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, .12); border-top-color: var(--leaf);
  animation: spin .8s linear infinite; flex: none;
}
.busy-spinner.large { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards & panels ---------- */

.card {
  background: #fff; border: 1px solid var(--card-line); border-radius: 12px; padding: 14px;
}
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.row.top { align-items: flex-start; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-14 { gap: 14px; } .gap-16 { gap: 16px; } .gap-18 { gap: 18px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.t-9 { font-size: 9px; } .t-95 { font-size: 9.5px; } .t-10 { font-size: 10px; } .t-105 { font-size: 10.5px; }
.t-11 { font-size: 11px; } .t-115 { font-size: 11.5px; } .t-12 { font-size: 12px; } .t-125 { font-size: 12.5px; }
.t-13 { font-size: 13px; } .t-135 { font-size: 13.5px; } .t-14 { font-size: 14px; } .t-15 { font-size: 15px; }
.t-16 { font-size: 16px; } .t-19 { font-size: 19px; }
.w5 { font-weight: 500; } .w6 { font-weight: 600; } .w7 { font-weight: 700; }
.caps { text-transform: uppercase; }
.c-warn { color: var(--warn); } .c-moss { color: var(--moss); } .c-leaf { color: var(--leaf); }
.c-forest { color: var(--forest); } .c-forest-dark { color: var(--forest-dark); } .c-win { color: var(--win); }
.c-ink { color: var(--ink); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mono { font-family: var(--mono); }
.italic { font-style: italic; }
.selectable { user-select: text; }

.pill {
  display: inline-flex; align-items: center;
  font-size: 9.5px; font-weight: 600; padding: 2px 6px; border-radius: 999px; white-space: nowrap;
}
.pill.draft { background: rgba(0, 0, 0, .07); color: var(--muted); }
.pill.needsReview { background: var(--warn-16); color: var(--warn); }
.pill.approved { background: var(--moss-22); color: var(--forest-dark); }
.pill.posted { background: var(--leaf-14); color: var(--leaf); }
.pill.kind { background: var(--moss-14); color: var(--moss); }
.pill.edited { font-size: 9px; padding: 1px 5px; background: var(--moss-15); color: var(--moss); }
.pill.house { font-size: 9px; padding: 1px 5px; background: var(--moss-14); color: var(--moss); }
.pill.live { background: var(--win-12); color: var(--win); }

.step-card-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--moss-20); color: var(--forest); font-size: 11px; font-weight: 700;
}
.step-num.small { width: 20px; height: 20px; font-size: 10.5px; }
.step-num.done { background: var(--win); color: #fff; }
.step-num svg { width: 10px; height: 10px; }

.error-box {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px; border-radius: 10px; background: var(--warn-08); color: var(--warn);
  font-size: 12px; white-space: pre-wrap; user-select: text;
}
.error-box svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.ok-box {
  display: flex; align-items: center; gap: 8px;
  padding: 12px; border-radius: 10px; background: var(--win-08);
}
.note-box {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border-radius: 10px; background: var(--moss-12);
}

/* ---------- Form controls ---------- */

.input, .textarea, .select {
  border: 1px solid #cfd6cb; border-radius: 6px; background: #fff;
  padding: 5px 8px; font-size: 13px; min-width: 0;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(74, 124, 47, .18);
}
.input:disabled, .select:disabled, .textarea:disabled { background: #f2f4f0; color: var(--muted); }
.textarea { resize: vertical; line-height: 1.45; }
.select { padding-right: 24px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6b776b 50%), linear-gradient(135deg, #6b776b 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.search-box {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 8px; background: var(--canvas); border: 1px solid var(--card-line);
}
.search-box input { border: 0; background: transparent; outline: none; flex: 1; font-size: 12.5px; }
.search-box svg { width: 11px; height: 11px; color: var(--muted); }

.switch { position: relative; width: 32px; height: 19px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; inset: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: #d9ddd6; transition: background .15s; }
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s;
}
.switch input:checked ~ .track { background: var(--leaf); }
.switch input:checked ~ .knob { transform: translateX(13px); }
.switch input:disabled { cursor: default; }
.switch input:disabled ~ .track { opacity: .5; }

.checkbox { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; }
.checkbox input { width: 14px; height: 14px; margin: 0; accent-color: var(--leaf); }

.segmented {
  display: flex; background: rgba(0, 0, 0, .06); border-radius: 8px; padding: 2px; gap: 2px;
}
.segmented button {
  flex: 1; border: 0; background: transparent; border-radius: 6px; padding: 5px 10px;
  font-size: 12.5px; cursor: pointer; color: var(--ink);
}
.segmented button.on { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); font-weight: 500; }

.stepper { display: inline-flex; border: 1px solid #cfd6cb; border-radius: 6px; overflow: hidden; flex: none; }
.stepper button { border: 0; background: #fff; width: 24px; height: 22px; cursor: pointer; font-size: 14px; line-height: 1; color: var(--ink); }
.stepper button + button { border-left: 1px solid #cfd6cb; }
.stepper button:disabled { color: #b5bcb3; cursor: default; }

.radio-list { display: flex; flex-direction: column; gap: 6px; }
.radio { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.radio input { margin: 0; accent-color: var(--leaf); }

/* macOS "grouped" form */
.form { padding: 10px 26px 26px; }
.form-section { margin-top: 14px; }
.form-section > .fs-title { font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 7px 10px; }
.form-section > .fs-body {
  background: #fff; border: 1px solid var(--card-line); border-radius: 10px;
}
.fs-row { padding: 9px 12px; display: flex; align-items: center; gap: 10px; min-height: 38px; }
.fs-row + .fs-row { border-top: 1px solid #edf0ea; }
.fs-row.top { align-items: flex-start; }
.fs-row.col { flex-direction: column; align-items: stretch; }
.fs-row .fs-label { font-size: 13px; }
.fs-row .fs-field { flex: 1; display: flex; justify-content: flex-end; min-width: 0; }
.fs-row .fs-field .input { width: 100%; max-width: 440px; text-align: left; }
.fs-disabled { opacity: .6; pointer-events: none; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 30, 20, .32);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  width: 100%; max-width: 420px; padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.modal.wide { max-width: 640px; }
.modal h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.modal .modal-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.modal .modal-buttons.inline { flex-direction: row; justify-content: flex-end; }
.modal .btn-destructive {
  background: var(--warn); color: #fff; font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 10px;
}
.modal-list { max-height: 360px; overflow: auto; border: 1px solid var(--card-line); border-radius: 8px; }
.modal-list a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; font-size: 12px; text-decoration: none; color: var(--ink); }
.modal-list a + a { border-top: 1px solid #edf0ea; }
.modal-list a:hover { background: var(--moss-08); }

.menu {
  position: fixed; z-index: 1100; background: #fff; border-radius: 8px; padding: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06); min-width: 180px;
}
.menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 6px 10px; border-radius: 5px; font-size: 13px; cursor: pointer;
}
.menu button:hover { background: var(--leaf); color: #fff; }
.menu .menu-sep { height: 1px; background: var(--card-line); margin: 4px 2px; }
.menu .menu-head { padding: 6px 10px 4px; font-size: 11px; color: var(--muted); }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #1f2a20; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 12.5px; z-index: 1200; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); max-width: 80vw;
}

/* ---------- Library ---------- */

.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; flex-wrap: wrap; flex: none; }
.status-line { display: flex; align-items: center; gap: 6px; padding: 0 18px 6px; font-size: 11.5px; color: var(--muted); flex: none; }
.status-line svg { width: 13px; height: 13px; color: var(--moss); flex: none; }
.filter-tabs { display: flex; gap: 6px; padding: 0 18px 10px; flex-wrap: wrap; flex: none; }
.filter-tab {
  border: 0; background: transparent; border-radius: 7px; padding: 6px 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted);
}
.filter-tab.on { background: var(--moss-18); color: var(--forest-dark); font-weight: 600; }
.filter-tab .count {
  font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 999px;
  background: rgba(0, 0, 0, .06); color: var(--muted);
}
.filter-tab .count.warn { background: var(--warn-16); color: var(--warn); }
.library-split { flex: 1; display: flex; min-height: 0; }
.principal-list { width: 260px; min-width: 220px; flex: none; overflow: auto; padding: 10px; border-right: 1px solid var(--card-line); }
.principal-row {
  width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; margin-bottom: 4px;
}
.principal-row.on { background: var(--moss-14); }
.principal-row:hover:not(.on) { background: var(--moss-06); }
.principal-logo {
  width: 26px; height: 26px; border-radius: 4px; background: #fff; object-fit: contain; flex: none;
}
.principal-logo.placeholder { background: var(--moss-12); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.principal-logo.placeholder svg { width: 11px; height: 11px; }
.recap-list { flex: 1; overflow: auto; padding: 16px; min-width: 0; }
.recap-row {
  background: #fff; border: 1px solid var(--card-line); border-radius: 10px; padding: 14px;
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px;
}
.recap-row.waiting { border: 1.5px solid var(--warn-45); }
.recap-row .actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 40px; }
.empty-state svg.big { width: 40px; height: 40px; color: var(--moss-50); }

/* ---------- Import & Repsly ---------- */

.source-button {
  width: 100%; border: 0; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px;
  background: var(--moss-10); box-shadow: inset 0 0 0 1px var(--moss-45);
}
.source-button:hover { background: var(--moss-14); }
.or-divider { display: flex; align-items: center; gap: 10px; font-size: 10px; font-weight: 700; color: var(--muted); }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--card-line); }
.logo-thumb { background: #fff; border-radius: 8px; border: 1px solid var(--card-line); object-fit: contain; flex: none; }
.logo-thumb.placeholder { background: var(--moss-12); display: flex; align-items: center; justify-content: center; color: var(--muted); border: 0; }
.logo-thumb.placeholder svg { width: 16px; height: 16px; }
.preset {
  border: 0; cursor: pointer; font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 999px;
  background: var(--moss-15); color: var(--forest);
}
.preset:disabled { opacity: .5; cursor: default; }
.progress { height: 6px; border-radius: 999px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.progress > div { height: 100%; background: var(--leaf); border-radius: 999px; transition: width .3s; }
.progress.indeterminate > div { width: 30%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
.cache-panel { padding: 12px; border: 1px solid var(--card-line); border-radius: 8px; background: var(--moss-06); }
.cache-panel.covered { background: var(--moss-08); }
.selectable-row {
  width: 100%; border: 0; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px;
  background: var(--moss-06); box-shadow: inset 0 0 0 1px var(--card-line);
}
.selectable-row.on { background: var(--moss-18); }
.selectable-row svg { width: 16px; height: 16px; flex: none; }
.filter-chip {
  border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 500;
  background: var(--moss-20); color: var(--forest);
}
.filter-chip.out { background: rgba(128, 128, 128, .12); color: var(--muted); }
.filter-chip svg { width: 10px; height: 10px; }
.explorer-result {
  height: 160px; overflow: auto; background: #fff; border: 1px solid var(--card-line); border-radius: 8px;
  padding: 8px; font-family: var(--mono); font-size: 10.5px; white-space: pre-wrap; user-select: text;
}

/* ---------- Clarifying questions ---------- */

.question-box { display: flex; gap: 10px; align-items: flex-start; padding: 16px; border-radius: 12px; background: var(--moss-10); font-size: 14px; }
.question-box svg { width: 16px; height: 16px; color: var(--leaf); flex: none; margin-top: 1px; }
.option-list { background: #fff; border: 1px solid var(--card-line); border-radius: 12px; overflow: hidden; }
.option-row {
  width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left;
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px;
}
.option-row + .option-row { border-top: 1px solid #edf0ea; }
.option-row.on { background: var(--moss-12); }
.option-row.empty { opacity: .55; }
.option-row svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

/* ---------- Review ---------- */

.review-list { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.panel { background: #fff; border: 1px solid var(--card-line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.group-header {
  position: sticky; top: 0; z-index: 5; background: var(--canvas);
  display: flex; align-items: baseline; gap: 8px; padding: 8px 0; margin: 0 -24px; padding-left: 24px; padding-right: 24px;
}
.review-card {
  background: #fff; border: 1px solid var(--card-line); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  content-visibility: auto; contain-intrinsic-size: auto 320px;
}
.remove-visit svg { width: 16px; height: 16px; }
.status-chip { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.status-chip.complete { background: var(--moss-15); color: var(--moss); }
.status-chip.revisit { background: var(--warn-15); color: var(--warn); }
.notes-field { background: var(--moss-08); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.notes-field textarea {
  width: 100%; border: 1px solid var(--card-line); border-radius: 8px; background: #fff;
  padding: 8px 10px; font-size: 12.5px; line-height: 1.45; resize: none; min-height: 44px; overflow: hidden; outline: none;
}
.notes-field textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(74, 124, 47, .15); }
.badge-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.badge-chip button { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; display: inline-flex; }
.badge-chip button svg { width: 8px; height: 8px; stroke-width: 3.2; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, 100px); gap: 8px; }
.photo-thumb { position: relative; width: 100px; height: 100px; }
.photo-thumb .ph-img {
  width: 100px; height: 100px; border-radius: 8px; overflow: hidden; border: 1px solid var(--card-line);
  background: rgba(128, 128, 128, .08); display: block;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .ph-label {
  position: absolute; left: 4px; bottom: 4px; font-size: 7.5px; font-weight: 700; letter-spacing: .02em;
  background: rgba(44, 95, 45, .88); color: #fff; padding: 2px 5px; border-radius: 4px; pointer-events: none;
}
.photo-thumb .ph-remove { position: absolute; top: 3px; right: 3px; }
.photo-thumb .ph-remove svg { width: 17px; height: 17px; }
.photo-thumb .ph-retry {
  width: 100%; height: 100%; border: 0; background: var(--warn-08); color: var(--warn); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9px; font-weight: 500;
}
.photo-thumb .ph-retry svg { width: 16px; height: 16px; }
.values-row { display: flex; align-items: center; gap: 8px; }
.values-row .label { width: 170px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.values-row .input { max-width: 180px; width: 180px; font-size: 11.5px; padding: 3px 7px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; border-radius: 8px; background: var(--moss-10); }
.tile b { font-size: 18px; color: var(--forest-dark); }
.tile span { font-size: 9px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.summary-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .summary-cols { grid-template-columns: 1fr; } }
.summary-list { background: var(--canvas); border: 1px solid var(--card-line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 5px; }
.summary-item { display: flex; align-items: flex-start; gap: 5px; }
.summary-item textarea {
  flex: 1; border: 0; background: transparent; resize: none; font-size: 11.5px; line-height: 1.4;
  padding: 0; min-height: 16px; overflow: hidden; outline: none;
}
.summary-item textarea:focus { background: #fff; box-shadow: 0 0 0 2px rgba(74, 124, 47, .2); border-radius: 3px; }
.summary-item .bullet { font-size: 12px; line-height: 1.3; }
.summary-item button svg { width: 10px; height: 10px; }
.box-textarea { width: 100%; border: 1px solid var(--card-line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; resize: none; overflow: hidden; outline: none; min-height: 60px; }
.box-textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(74, 124, 47, .15); }
.signoff { border-width: 1.5px; }
.signoff.complete { border-color: var(--moss-50); }
.signoff.incomplete { border-color: var(--warn-40); }
.others-banner { background: #fff7e6; color: #7a4d00; font-size: 11.5px; padding: 7px 28px; border-bottom: 1px solid #f1ddb0; flex: none; }
.unsaved-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--opportunity); margin-right: 5px; vertical-align: middle; }

/* ---------- Design ---------- */

.design-split { flex: 1; display: flex; min-height: 0; }
.design-editor { width: 460px; min-width: 380px; flex: none; overflow: auto; border-right: 1px solid var(--card-line); }
.design-preview { flex: 1; overflow: auto; padding: 18px; background: #f6f8f4; min-width: 0; }
.color-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.color-row input[type=color] { width: 44px; height: 22px; border: 1px solid #cfd6cb; border-radius: 5px; padding: 1px; background: #fff; cursor: pointer; flex: none; }
.color-row .hex { width: 90px; font-family: var(--mono); font-size: 11px; }
.badge-sample { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pv-header { border-radius: 10px; padding: 14px; color: #fff; }
.pv-kicker { font-size: 8.5px; font-weight: 700; letter-spacing: 1.1px; opacity: .85; }
.pv-title { font-size: 19px; font-weight: 700; margin: 6px 0; }
.pv-fact { background: rgba(255, 255, 255, .14); border-radius: 6px; padding: 5px 8px; }
.pv-fact b { display: block; font-size: 15px; }
.pv-fact span { font-size: 7px; font-weight: 600; opacity: .9; text-transform: uppercase; }
.pv-box { background: #fff; border: 1px solid var(--card-line); border-radius: 8px; padding: 9px; position: relative; }
.pv-off { position: absolute; top: 6px; right: 6px; font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 999px; background: rgba(92, 107, 94, .2); color: var(--muted); }
.pv-dim { opacity: .35; }
.pv-cell { width: 54px; text-align: center; padding: 2px 0; border-radius: 4px; font-size: 10px; }

/* ---------- Done / onboarding / auth ---------- */

.center-stack { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 30px; text-align: center; }
.done-check { width: 84px; height: 84px; border-radius: 50%; background: var(--win-12); display: flex; align-items: center; justify-content: center; color: var(--win); }
.done-check svg { width: 52px; height: 52px; }
.hero { background: var(--gradient); color: #fff; text-align: center; padding: 40px 20px 32px; display: flex; flex-direction: column; align-items: center; gap: 14px; flex: none; }
.hero-logo { width: 88px; height: 88px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); display: flex; align-items: center; justify-content: center; margin-top: 8px; }
.hero-logo img { width: 56px; height: 56px; object-fit: contain; }
.hero-logo svg { width: 34px; height: 34px; color: var(--leaf); }
.hero h1 { font-size: 26px; margin: 0; }
.hero p { font-size: 13.5px; opacity: .9; margin: 0; max-width: 380px; }

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--card-line); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .06); }
.auth-card .brand-header { padding: 22px 26px; }
.auth-body { padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 12px; }
.auth-body label { font-size: 11px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.auth-body .input { padding: 8px 10px; font-size: 13.5px; }

.users-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.users-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--card-line); }
.users-table td { padding: 8px 10px; border-bottom: 1px solid #edf0ea; vertical-align: middle; }

@media (max-width: 760px) {
  .library-split, .design-split { flex-direction: column; }
  .principal-list, .design-editor { width: auto; border-right: 0; border-bottom: 1px solid var(--card-line); max-height: 40vh; }
  .page-content { padding: 18px; }
  .brand-header { padding: 18px; }
}
