/* ClickFlowCloud — light enterprise workspace theme.
   Navy/slate shell, white content surfaces, controlled ClickFlow teal accent. */
:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --sidebar: #0f2038;
  --sidebar-2: #16294480;
  --topbar: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --navy: #0f2d60;
  --teal: #0beab5;
  --teal-ink: #067a63;
  --teal-soft: #e6faf4;
  --ok: #16a34a; --ok-soft: #e7f6ec;
  --warn: #b45309; --warn-soft: #fdf3e3;
  --amber: #c2410c; --amber-soft: #fdeee4;
  --danger: #dc2626; --danger-soft: #fdeaea;
  --info: #2563eb; --info-soft: #e8eefc;
  --r: 8px;
  --font-h: 'Manrope', sans-serif;
  --font-b: 'Inter', system-ui, sans-serif;
  --shadow-sm: 0 1px 2px rgba(15, 32, 56, 0.06);
  --shadow: 0 4px 16px rgba(15, 32, 56, 0.10);
  --shadow-lg: 0 12px 40px rgba(15, 32, 56, 0.22);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { font-family: var(--font-b); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
h1, h2, h3, h4 { font-family: var(--font-h); color: var(--navy); }
a { color: var(--teal-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ── Brand marks ── */
.brand-mark { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal), #05b98d); color: #042b22; font-family: var(--font-h); font-weight: 800; font-size: 12px; }
.brand-name { font-family: var(--font-h); font-weight: 800; font-size: 14px; letter-spacing: -0.01em; }
.brand-name span { color: var(--teal); }
.brand-tag { font-size: 11px; color: var(--text-faint); }

/* ── Sign in ── */
#login { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(160deg, #0f2038, #16345c); }
#login[hidden] { display: none; }
.login-card { width: min(420px, 100%); background: var(--surface); border-radius: 16px; padding: 36px; box-shadow: var(--shadow-lg); }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 26px; }
.login-brand .brand-tag { color: var(--text-muted); }
.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-sub { color: var(--text-muted); margin-bottom: 22px; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; font-weight: 500; }
.login-foot { margin-top: 22px; font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--border); padding-top: 16px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin: 14px 0 6px; }
input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
  color: var(--text); padding: 9px 11px; font-family: var(--font-b); font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-ink); box-shadow: 0 0 0 3px var(--teal-soft); }
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

/* ── App shell ── */
#app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
#app[hidden] { display: none; }

#sidebar { background: var(--sidebar); color: #cdd8ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; gap: 11px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid var(--sidebar-2); }
.side-brand .brand-name { color: #fff; }
.side-brand .brand-tag { color: #7d93b5; }
#nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group { margin-bottom: 14px; }
.nav-group-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #64789e; padding: 6px 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: #b7c4da; padding: 8px 10px; border-radius: 7px; font-size: 13.5px; font-weight: 500; }
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
.nav-item.active { background: rgba(11, 234, 181, 0.14); color: var(--teal); font-weight: 600; }
.nav-item.active .nav-ico { color: var(--teal); }
.nav-ico { width: 17px; height: 17px; color: #7d93b5; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.side-foot { padding: 14px; border-top: 1px solid var(--sidebar-2); }
.edition-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #64789e; margin-bottom: 8px; }
.edition-switch { display: flex; background: #0a1730; border-radius: 8px; padding: 3px; gap: 2px; }
.edition-switch button { flex: 1; border: none; background: none; color: #8ea3c4; padding: 6px 4px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.edition-switch button.active { background: var(--navy); color: #fff; }

#mainCol { display: flex; flex-direction: column; min-width: 0; }
#topbar { height: 60px; background: var(--topbar); border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 20; }
.top-left, .top-right { display: flex; align-items: center; gap: 14px; }
.ws-select { display: flex; align-items: center; gap: 9px; }
.ws-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
#workspaceSelect { width: auto; min-width: 240px; font-weight: 500; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; font-size: 15px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
#menuToggle { display: none; }
#menuToggle::before { content: '☰'; font-size: 17px; }

.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; }
.user-chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; font-family: var(--font-h); }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.chevron { color: var(--text-faint); }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 30; }
.dropdown[hidden] { display: none; }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.dropdown-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 9px 12px; border-radius: 7px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item.danger { color: var(--danger); }

#view { padding: 26px 30px 48px; max-width: 1240px; width: 100%; outline: none; }

/* ── Page headers ── */
.page-head { margin-bottom: 22px; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-sub { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; max-width: 720px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* ── Buttons ── */
.btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: var(--r);
  font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #042b22; }
.btn-primary:hover { filter: brightness(1.05); background: var(--teal); }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: #12376f; }
.btn-block { width: 100%; justify-content: center; margin-top: 18px; padding: 11px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--danger); border-color: #f0c6c6; }
.btn-danger:hover { background: var(--danger-soft); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .ico { width: 15px; height: 15px; }

/* ── Cards & panels ── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { font-size: 15px; font-weight: 700; }
.panel-head .hint, .hint { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.panel-note { font-size: 12.5px; color: var(--text-muted); margin: -4px 0 14px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1080px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ── Metric tiles ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; }
.tile .tile-ico { position: absolute; top: 16px; right: 16px; width: 18px; height: 18px; color: var(--text-faint); }
.tile .num { font-family: var(--font-h); font-size: 27px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.tile .lbl { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }
.tile.accent { border-top: 3px solid var(--teal); }
.tile.warn .num { color: var(--warn); }
.tile.danger .num { color: var(--danger); }
.tile.ok .num { color: var(--ok); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; background: var(--surface-2); }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data.rowlink tbody tr { cursor: pointer; }
.cell-strong { font-weight: 600; color: var(--text); }
.cell-sub { color: var(--text-muted); font-size: 12px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--border); }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.b-ok { background: var(--ok-soft); color: var(--ok); }
.badge.b-warn { background: var(--warn-soft); color: var(--warn); }
.badge.b-amber { background: var(--amber-soft); color: var(--amber); }
.badge.b-danger { background: var(--danger-soft); color: var(--danger); }
.badge.b-info { background: var(--info-soft); color: var(--info); }
.badge.b-muted { background: #eef1f6; color: var(--text-muted); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chain-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.chain-badge.ok { background: var(--ok-soft); color: var(--ok); }
.chain-badge.bad { background: var(--danger-soft); color: var(--danger); }

/* ── Empty & permission states ── */
.empty { text-align: center; color: var(--text-muted); padding: 34px 20px; }
.empty .empty-ico { width: 30px; height: 30px; color: var(--text-faint); margin: 0 auto 10px; display: block; }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 5px; }
.perm-note { display: flex; align-items: center; gap: 8px; background: var(--info-soft); border: 1px solid #cdddfb; color: #1e40af;
  border-radius: var(--r); padding: 9px 13px; font-size: 12.5px; margin-bottom: 16px; }
.perm-note .ico { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Coach ── */
.coach-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .coach-layout { grid-template-columns: 1fr; } }
.stage-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; box-shadow: var(--shadow-sm); }
.stage-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; color: var(--text-muted); }
.stage-row.current { background: var(--teal-soft); color: var(--navy); font-weight: 600; }
.stage-row.done { color: var(--text); }
.stage-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; background: #eef1f6; color: var(--text-muted); }
.stage-row.current .stage-num { background: var(--teal); color: #042b22; }
.stage-row.done .stage-num { background: var(--ok-soft); color: var(--ok); }
.coach-main { min-width: 0; }
.coach-prompt { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--teal); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.coach-prompt .tag { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--teal-ink); }
.coach-prompt .q { font-size: 16px; font-weight: 600; color: var(--navy); margin-top: 6px; font-family: var(--font-h); }
.coach-history { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.bubble { border-radius: 10px; padding: 12px 15px; font-size: 13.5px; line-height: 1.55; border: 1px solid var(--border); }
.bubble .tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 5px; display: flex; gap: 8px; align-items: center; }
.bubble.coach { background: var(--surface); }
.bubble.user { background: var(--surface-2); }
.bubble.challenge { border-left: 3px solid var(--amber); }
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
@media (max-width: 720px) { .examples { grid-template-columns: 1fr; } }
.example { border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; font-size: 12.5px; }
.example.weak { background: var(--danger-soft); border-color: #f0c6c6; }
.example.strong { background: var(--ok-soft); border-color: #bfe3c9; }
.example .ex-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.example.weak .ex-label { color: var(--danger); }
.example.strong .ex-label { color: var(--ok); }

/* ── Section cards (DNA library) ── */
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 15px 16px; box-shadow: var(--shadow-sm); }
.section-card h4 { font-size: 13.5px; text-transform: capitalize; margin-bottom: 3px; }
.section-card .sec-meta { font-size: 11.5px; color: var(--text-faint); margin-bottom: 9px; }
.section-card p { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.section-card .sec-foot { margin-top: 10px; display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--text-faint); }

/* ── Pack cards ── */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pack-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.pack-card h4 { font-size: 14px; margin-bottom: 4px; }
.pack-card .pack-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; flex: 1; margin-bottom: 12px; }
.pack-card .pack-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ── Detail rows ── */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--text-muted); }
.kv dd { color: var(--text); }
pre.code { background: #0f2038; color: #cde4ff; border-radius: 8px; padding: 14px; font-size: 12px; overflow-x: auto; line-height: 1.5;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.held-box { background: var(--amber-soft); border-left: 3px solid var(--amber); border-radius: 8px; padding: 12px 14px; font-size: 13px; font-style: italic; color: #7c2d12; margin: 8px 0; }

/* ── Drawer ── */
.drawer[hidden], .modal[hidden] { display: none; }
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-scrim, .modal-scrim { position: absolute; inset: 0; background: rgba(15, 32, 56, 0.4); }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(520px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn 0.18s ease; }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 16px; }
.drawer-body { padding: 20px 22px; overflow-y: auto; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 20px; }
.modal-card { position: relative; background: var(--surface); border-radius: 14px; width: min(440px, 100%); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 20px; }
.modal-body .field-label:first-child { margin-top: 0; }

/* ── Toast ── */
#toast { position: fixed; bottom: 22px; right: 22px; background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 18px;
  font-size: 13px; opacity: 0; transform: translateY(8px); transition: all 0.22s; pointer-events: none; max-width: 420px; z-index: 70; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: none; }
#toast.error { background: var(--danger); }

/* ── Conversational DNA Builder ── */
.builder { display: grid; grid-template-columns: 220px 1fr 320px; gap: 16px; align-items: start; height: calc(100vh - 210px); min-height: 480px; }
.builder-col-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); padding: 0 4px 10px; }
.builder-themes, .builder-captured { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-sm); height: 100%; overflow-y: auto; }
.theme-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 8px 9px; border-radius: 7px; font-size: 12.5px; color: var(--text-muted); }
.theme-row:hover { background: var(--surface-2); }
.theme-row.active { background: var(--teal-soft); color: var(--navy); font-weight: 600; }
.theme-row.done .stage-num { background: var(--ok-soft); color: var(--ok); }
.theme-row .theme-name { flex: 1; }
.theme-flag { font-size: 10px; font-weight: 700; color: var(--amber); background: var(--amber-soft); border-radius: 10px; padding: 1px 6px; }

.builder-convo { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.convo-scroll { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.convo-input { border-top: 1px solid var(--border); padding: 12px 14px; background: var(--surface-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; padding: 4px 11px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.chip:hover { border-color: var(--teal-ink); color: var(--teal-ink); }
.convo-row { display: flex; gap: 10px; align-items: flex-end; }
.convo-row textarea { flex: 1; min-height: 44px; resize: none; }
.convo-row .btn { flex-shrink: 0; }
.coach-reply { display: grid; gap: 8px; }
.coach-reply p { margin: 0; }
.coach-next-question { margin-top: 3px !important; padding: 10px 12px; border-left: 3px solid var(--teal); background: var(--teal-soft); border-radius: 0 7px 7px 0; }
.coach-next-question span { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-ink); }
.coach-next-question strong { display: block; color: var(--text); font-weight: 700; }

.builder-captured .cap-section-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin: 12px 4px 8px; }
.builder-captured .cap-section-label:first-child { margin-top: 0; }
.cap-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--surface); }
.cap-card.proposed { border-color: #f5d9a8; background: #fffdf8; }
.cap-card.done { border-color: #bfe3c9; background: #f6fbf7; }
.cap-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cap-head strong { font-size: 13px; }
.cap-card p { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.cap-meta { margin-top: 8px; font-size: 11px; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cap-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

@media (max-width: 1180px) {
  .builder { grid-template-columns: 1fr; height: auto; }
  .builder-themes, .builder-captured { height: auto; max-height: 300px; }
  .builder-convo { height: 60vh; }
}

/* ── Observation cards ── */
.obs-card { border: 1px solid var(--border); border-radius: 10px; padding: 13px 14px; margin-bottom: 10px; background: var(--surface); }
.obs-card.risk { border-color: #f5d9a8; background: #fffdf8; }
.obs-card.done { opacity: 0.75; }
.obs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.obs-cat { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--teal-ink); }
.obs-card strong { font-size: 13px; display: block; margin-bottom: 5px; }
.obs-card p { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.obs-why { margin-top: 6px; }
.obs-q { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 9px 11px; background: var(--teal-soft); border-radius: 8px; font-size: 12.5px; color: var(--navy); }
.obs-q .ico { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: var(--teal-ink); }
.obs-evidence { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.obs-evidence .evi { font-size: 11px; color: var(--text-faint); font-style: italic; background: var(--surface-2); border-radius: 5px; padding: 2px 7px; }
.obs-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.cap-divider { border-top: 1px solid var(--border); margin: 14px 0; }

/* One-time generated API key banner */
.keybanner { background: var(--teal-soft); border: 1px solid #a7ead6; border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.keybanner-head { display: flex; align-items: center; gap: 8px; color: #065f46; font-size: 14px; margin-bottom: 6px; }
.keybanner-head .ico { width: 17px; height: 17px; }
.keybanner p { color: #0f5132; }
.keybanner-key { background: #04241d; border-radius: 8px; padding: 12px 14px; margin: 10px 0; overflow-x: auto; }
.keybanner-key code { color: #7ff0d3; background: none; border: none; padding: 0; font-size: 13px; user-select: all; white-space: nowrap; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters select, .filters input { width: auto; min-width: 140px; }
.muted { color: var(--text-muted); }
.tiny { font-size: 11.5px; }
.stack > * + * { margin-top: 6px; }

/* ── Phase 11: onboarding / discovery ── */
.firstrun { display: flex; align-items: center; gap: 18px; justify-content: space-between;
  background: linear-gradient(180deg, var(--teal-soft), var(--surface)); border: 1px solid #bfeee0;
  border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.firstrun-main { min-width: 0; }
.firstrun-step { font-size: 11.5px; font-weight: 600; color: var(--teal-ink); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.firstrun h3 { font-size: 17px; margin-bottom: 7px; }
.firstrun-why { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--text-muted); }
.firstrun-why svg { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.firstrun .btn { flex: none; }

.journey { display: flex; flex-wrap: wrap; gap: 6px 4px; margin-bottom: 16px; }
.jstep { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px 5px 6px; }
.jstep.done { color: var(--ok); border-color: #bfe3c9; background: var(--ok-soft); }
.jdot { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 11px; font-weight: 700; color: var(--text-muted); }
.jstep.done .jdot { background: var(--ok); border-color: var(--ok); color: #fff; }
.jstep.done .jdot svg { width: 13px; height: 13px; }
.jlabel { white-space: nowrap; }

.ready-lite { text-align: center; padding: 10px 0 4px; }
.ready-state { display: inline-block; font-family: var(--font-h); font-size: 22px; font-weight: 800; color: var(--teal-ink); }
.ready-lite p { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.coverage { display: flex; flex-direction: column; gap: 9px; }
.cov-row { display: grid; grid-template-columns: 150px 1fr 84px; gap: 10px; align-items: center; }
.cov-label { font-size: 12px; color: var(--text); }
.cov-bar { height: 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.cov-fill { display: block; height: 100%; border-radius: 6px; }
.cov-fill.cov-good { background: var(--ok); }
.cov-fill.cov-partial { background: var(--warn); }
.cov-fill.cov-none { background: var(--border-strong); }
.cov-state { font-size: 11px; color: var(--text-muted); text-align: right; }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mode-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 15px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; display: flex; flex-direction: column; gap: 6px; }
.mode-card:hover { border-color: var(--teal); box-shadow: var(--shadow-sm); }
.mode-card h4 { font-size: 13.5px; }
.mode-card p { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.mode-q { display: flex; gap: 6px; align-items: flex-start; font-size: 11.5px; color: var(--teal-ink); margin-top: 2px; }
.mode-q svg { flex: none; width: 14px; height: 14px; margin-top: 1px; }

.draft-block { margin-bottom: 14px; }
.draft-block h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 7px; }
.draft-block ul { margin: 0; padding-left: 18px; }
.draft-block li { font-size: 12.5px; color: var(--text); line-height: 1.6; }
.draft-understand { padding: 8px 0; border-bottom: 1px solid var(--border); }
.draft-understand p { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

.gem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 11px; }
.gem-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; background: var(--surface); display: flex; flex-direction: column; gap: 7px; }
.gem-card.mini { padding: 9px 11px; margin-bottom: 8px; }
.gem-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gem-type { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--navy); }
.gem-text { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.gem-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gem-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── Phase 12: sessions, recap, dossier ── */
.session-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.session-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.session-focus { display: flex; align-items: center; gap: 6px; }
.session-focus svg { width: 15px; height: 15px; color: var(--teal-ink); }
.session-focus strong { color: var(--text); }
.session-stat { color: var(--text-faint); }
.conversation-guide { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: -4px 0 14px; padding: 11px 14px; border: 1px solid var(--border); border-left: 3px solid var(--teal); border-radius: 9px; background: var(--surface); color: var(--text-muted); }
.conversation-guide .label { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }
.conversation-guide strong { display: block; font-size: 13px; color: var(--text); }
.conversation-guide p { margin: 3px 0 0; max-width: 720px; font-size: 12px; line-height: 1.45; }
.conversation-guide-action { max-width: 210px; font-size: 11.5px; font-weight: 600; color: var(--teal-ink); text-align: right; }
@media (max-width: 760px) { .conversation-guide { align-items: flex-start; flex-direction: column; gap: 7px; } .conversation-guide-action { max-width: none; text-align: left; } }

/* A route through the deep discovery process: visible landmarks, never a
   questionnaire or a misleading percentage-complete claim. */
.discovery-route { margin: 0 0 14px; padding: 13px 14px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-sm); }
.discovery-route-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.discovery-route-head .label { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }
.discovery-route-head strong { display: block; font-size: 13px; color: var(--navy); }
.discovery-route-reassurance { max-width: 260px; color: var(--text-faint); font-size: 11.5px; text-align: right; }
.discovery-route-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin: 13px 0 10px; }
.discovery-route-step { min-width: 0; padding-top: 7px; border-top: 2px solid var(--border); color: var(--text-faint); }
.discovery-route-step > span { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 5px; border-radius: 50%; background: var(--surface-2); color: var(--text-faint); font-size: 10px; font-weight: 700; vertical-align: top; }
.discovery-route-step > span svg { width: 11px; height: 11px; }
.discovery-route-step b { display: inline; color: inherit; font-size: 10.5px; line-height: 1.25; }
.discovery-route-step.current { border-color: var(--teal); color: var(--navy); }
.discovery-route-step.current > span { background: var(--teal); color: #fff; }
.discovery-route-step.explored { border-color: #9ecdc4; color: var(--text-muted); }
.discovery-route-step.complete { border-color: var(--ok); color: var(--text-muted); }
.discovery-route-step.complete > span { background: var(--ok-soft); color: var(--ok); }
.discovery-route > p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }

.continue-panel { border-color: #bfeee0; }
.continue-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cont-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.cont-next { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--teal-ink); margin-top: 8px; }
.cont-next svg { flex: none; width: 15px; height: 15px; margin-top: 1px; }

.dossier-body { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.doss-section { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 15px 17px; box-shadow: var(--shadow-sm); }
.doss-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.doss-section-head h3 { font-size: 14px; }
.doss-item { padding: 8px 0; border-top: 1px solid var(--border); }
.doss-item:first-of-type { border-top: none; }
.doss-item p { font-size: 13px; color: var(--text); line-height: 1.55; }
.doss-source { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--text-faint); }
.doss-list { margin: 0; padding-left: 18px; }
.doss-list li { font-size: 12.5px; color: var(--text); line-height: 1.6; }

/* ── Phase 13: review checklist ── */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.chk-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.chk-row:last-child { border-bottom: none; }
.chk-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; flex: none; }
.chk-ready { background: var(--ok-soft); color: var(--ok); }
.chk-needs_review { background: var(--warn-soft); color: var(--warn); }
.chk-blocking { background: var(--danger-soft); color: var(--danger); }
.chk-label { flex: 1; font-size: 13px; color: var(--text); }
.pr-summary { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 13px; border-radius: 8px; font-size: 13px; font-family: var(--font-b); }
.pr-summary svg { flex: none; width: 17px; height: 17px; }
.pr-summary.ready { background: var(--ok-soft); border: 1px solid #bfe3c9; color: #166534; }
.pr-summary.partial { background: var(--warn-soft); border: 1px solid #f5d9a8; color: #92400e; }
.pr-summary.blocked { background: var(--danger-soft); border: 1px solid #f3c0c0; color: #991b1b; }

.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); margin: 10px 0 0; cursor: pointer; }
.checkline input { width: auto; }

/* ── Phase 19: Local Growth DNA builder ── */
.growth-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.growth-build { display: flex; flex-direction: column; gap: 14px; }
.growth-sentence { font-size: 14px; }
.growth-type-select, .growth-review select { font-size: 12.5px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
.growth-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gchip { font-size: 12.5px; padding: 7px 13px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; transition: all 0.12s; }
.gchip:hover:not(:disabled) { border-color: var(--teal); }
.gchip.on { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-ink); font-weight: 600; }
.gchip.add { border-style: dashed; color: var(--text-muted); }
.gchip:disabled { opacity: 0.6; cursor: default; }
.growth-sub { margin-bottom: 12px; }
.growth-sub-label { font-size: 11.5px; font-weight: 700; color: var(--navy); margin-bottom: 7px; }
.growth-review { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.growth-review > div { flex: 1; min-width: 0; }
.growth-review:last-child { border-bottom: none; }
.growth-review select { flex: none; }
.growth-source-insights summary, .growth-raw-review summary, .route-detail summary { cursor: pointer; color: var(--navy); font-size: 13px; font-weight: 600; }
.growth-source-insights[open] > summary, .growth-raw-review[open] > summary, .route-detail[open] > summary { margin-bottom: 10px; }
.source-insight-list { margin: 10px 0 12px; padding-left: 18px; color: var(--text); font-size: 13px; line-height: 1.55; }
.growth-raw-review { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.route-detail { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.growth-preview { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; }
.route-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 15px; box-shadow: var(--shadow-sm); }
.route-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.route-head h4 { font-size: 14px; color: var(--navy); }
.route-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.route-copy-area { width: 100%; min-height: 170px; resize: vertical; }
.route-angle { font-size: 13px; color: var(--text); margin: 8px 0; font-weight: 500; }
.route-headline { font-size: 14px; font-style: italic; color: var(--navy); margin: 6px 0; }
.route-para { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin: 6px 0 10px; }
.route-meta { margin: 0; display: grid; grid-template-columns: 92px 1fr; gap: 5px 10px; font-size: 11.5px; }
.route-meta dt { color: var(--text-faint); font-weight: 600; }
.route-meta dd { margin: 0; color: var(--text); }
.route-meta .badge { margin: 1px 2px 1px 0; }

/* ── Phase 20: first-run journey + Growth DNA steps ── */
.journey-panel .jsteps { display: flex; flex-direction: column; }
.jstep-row { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.jstep-row:last-child { border-bottom: none; }
.jstep-num { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; font-size: 12.5px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted); }
.jstep-row.current .jstep-num { background: var(--navy); border-color: var(--navy); color: #fff; }
.jstep-row.done .jstep-num { background: var(--ok); border-color: var(--ok); color: #fff; }
.jstep-row.done .jstep-num svg { width: 15px; height: 15px; }
.jstep-body { flex: 1; min-width: 0; }
.jstep-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.jstep-row.done .jstep-title { color: var(--text-muted); font-weight: 500; }
.jstep-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.opt-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; margin-left: 6px; }
.jstep-row .btn { flex: none; }
.source-block { border-color: #bfeee0; background: linear-gradient(180deg, var(--teal-soft), var(--surface)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.step-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--teal-ink); background: var(--teal-soft); border-radius: 4px; padding: 1px 6px; margin-right: 6px; vertical-align: middle; }
.sync-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.sync-banner svg { flex: none; width: 17px; height: 17px; }
.sync-banner.ok { background: var(--ok-soft); border: 1px solid #bfe3c9; color: #166534; }
.sync-banner.stale { background: var(--warn-soft); border: 1px solid #f5d9a8; color: #92400e; }
.sync-banner .btn { margin-left: auto; }
.whatnext { margin-top: 14px; }
.wn-opt { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 11px 13px; margin-bottom: 8px; cursor: pointer; transition: border-color 0.12s; }
.wn-opt:hover { border-color: var(--teal); }
.wn-opt.selected { border-color: var(--teal); background: var(--teal-soft); }

/* Lite Local Growth DNA: one calm decision at a time. The visual line is a
   subtle ClickFlowGrow thread through the journey, not a dashboard decoration. */
.lite-growth-experience { position: relative; padding: 10px 0 30px; }
.lite-growth-experience::before { content: ''; position: absolute; left: 20px; right: 20px; top: 55px; height: 1px; background: linear-gradient(90deg, transparent, var(--teal), transparent); opacity: 0.35; pointer-events: none; }
.lite-journey { position: relative; max-width: 840px; margin: 0 auto; }
.lite-journey-progress { margin: 8px 0 28px; display: grid; gap: 6px; color: var(--text-muted); font-size: 13px; }
.lite-journey-progress strong { color: var(--navy); font-size: 23px; font-family: var(--font-h); }
.lite-progress-track { height: 5px; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.lite-progress-track span { display: block; height: 100%; background: var(--teal); transition: width 0.2s; }
.wizard-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 34px; box-shadow: var(--shadow-sm); }
.wizard-card h2 { font-size: 25px; color: var(--navy); margin: 0 0 10px; font-family: var(--font-h); }
.wizard-card p { color: var(--text-muted); max-width: 680px; margin: 0 0 26px; line-height: 1.6; font-size: 14px; }
.wizard-card .growth-chips { gap: 9px; }
.recognition-card { border-color: #d7e8e8; }
.recognition-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.recognition-option { display: flex; align-items: flex-start; gap: 10px; min-height: 58px; padding: 13px 14px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; line-height: 1.35; text-align: left; cursor: pointer; }
.recognition-option:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-soft); }
.recognition-option.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-ink); box-shadow: inset 0 0 0 1px var(--teal); font-weight: 600; }
.recognition-option.add, .recognition-option.unsure { color: var(--text-muted); border-style: dashed; }
.recognition-mark { display: grid; place-items: center; flex: none; width: 18px; height: 18px; margin-top: -1px; border: 1px solid currentColor; border-radius: 50%; color: var(--teal-ink); font-size: 11px; font-weight: 700; }
.recognition-option:not(.on) .recognition-mark:empty { border-color: var(--border-strong); }
.recognition-option.unsure .recognition-mark { color: var(--text-muted); }
.recognition-group { padding: 18px 0 20px; border-bottom: 1px solid var(--border); }
.recognition-group:last-child { border-bottom: 0; padding-bottom: 0; }
.recognition-group .growth-sub-label { font-size: 14px; margin-bottom: 10px; }
.recognition-optional { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.recognition-optional summary { color: var(--navy); font-size: 14px; font-weight: 600; cursor: pointer; }
.recognition-optional[open] summary { margin-bottom: 12px; }
.recognition-optional p { font-size: 13px; margin-bottom: 16px; }
.wizard-select { width: 100%; max-width: 420px; font-size: 15px; padding: 10px 12px; }
.wizard-source-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.wizard-source-status { margin-top: 17px; color: var(--text-muted); font-size: 13px; }
.wizard-card .growth-source-insights { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.wizard-subhead { font-size: 14px; color: var(--navy); margin: 24px 0 10px; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.wizard-messages { display: flex; flex-direction: column; gap: 12px; }
.wizard-message-intro ol { margin: 0; padding-left: 22px; color: var(--text-muted); line-height: 1.7; }
.wizard-message-intro li + li { margin-top: 3px; }
.wizard-help { margin-bottom: 10px !important; font-size: 13px; }
.planned-use { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding: 11px 12px; border: 1px solid #bfeee0; border-radius: 7px; background: var(--teal-soft); color: var(--teal-ink); font-size: 13px; }
.wizard-result-empty { text-align: center; }
.wizard-result-empty p { margin-left: auto; margin-right: auto; }
.wizard-deeper { text-align: center; color: var(--text-muted); font-size: 13px; margin: 18px 0 0; }
.link-button { border: 0; background: none; color: var(--teal-ink); padding: 0; text-decoration: underline; cursor: pointer; font: inherit; }
.client-help { display: block; margin: 14px auto 0; border: 0; background: transparent; color: var(--teal-ink); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.assistant-help-copy { font-size: 15px; line-height: 1.65; color: var(--text); margin: 0 0 18px; }
.client-completion { text-align: center; padding: 44px 34px; }
.client-completion textarea { width: 100%; max-width: 620px; margin: 0 auto 18px; text-align: left; resize: vertical; }
.client-closing-label { display: block; max-width: 620px; margin: 0 auto 8px; text-align: left; }
.completion-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); margin-bottom: 12px; }
.completion-mark svg { width: 22px; height: 22px; }
.client-discovery-home { max-width: 760px; margin: 36px auto; }
.client-intro { padding: 18px 0 26px; border-bottom: 1px solid var(--border); }
.client-eyebrow, .client-step { display: inline-block; color: var(--teal-ink); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.client-intro h1 { margin: 10px 0 12px; color: var(--navy); font: 600 32px/1.15 var(--font-h); }
.client-intro p, .client-next p, .client-complete p, .client-reassurance p { color: var(--text-muted); line-height: 1.6; margin: 0; }
.client-next, .client-complete { display: flex; align-items: center; gap: 22px; margin: 28px 0 18px; padding: 26px; background: var(--surface); border: 1px solid #cfe7df; border-radius: 8px; box-shadow: var(--shadow-sm); }
.client-next > div, .client-complete > div { flex: 1; }
.client-next h2, .client-complete h2 { margin: 6px 0; color: var(--navy); font: 600 21px/1.25 var(--font-h); }
.client-complete .completion-mark { margin: 0; flex: none; }
.client-reassurance { display: flex; gap: 10px; padding: 14px 2px; font-size: 13px; }
.client-reassurance svg { width: 18px; height: 18px; color: var(--teal-ink); flex: none; }

/* Agency handoff: a quiet internal delivery brief, deliberately distinct from
   the client contribution journey and from the wider compliance workbench. */
.handoff-status { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.handoff-status.ready { border-color: #bfeee0; background: linear-gradient(90deg, var(--teal-soft), var(--surface)); }
.handoff-status.waiting { background: var(--surface-2); }
.handoff-status h2 { margin: 5px 0; color: var(--navy); font: 600 21px/1.25 var(--font-h); }
.handoff-status p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.handoff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.handoff-kv { display: grid; grid-template-columns: 112px 1fr; gap: 9px 12px; margin: 0; font-size: 13px; }
.handoff-kv dt { color: var(--text-faint); font-weight: 600; }
.handoff-kv dd { margin: 0; color: var(--text); line-height: 1.45; }
.handoff-item { padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.handoff-item:last-child { border-bottom: 0; }
.handoff-item strong, .handoff-item span { display: block; }
.handoff-item strong { color: var(--navy); margin-bottom: 3px; }
.handoff-item span, .handoff-note { color: var(--text-muted); line-height: 1.5; }
.handoff-list { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.handoff-routes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.handoff-route { border: 1px solid var(--border); border-radius: 7px; padding: 13px; }
.handoff-route strong { color: var(--navy); font-size: 13px; }
.handoff-route p { margin: 8px 0 5px; color: var(--teal-ink); font-weight: 600; font-size: 13px; }
.handoff-route span { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.handoff-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.handoff-actions .btn-recorded { color: var(--teal-ink); background: var(--teal-soft); border-color: #9fe5d2; cursor: default; }
.handoff-actions .btn-recorded:disabled { opacity: 1; }
.handoff-delivery-queue { margin-top: 18px; padding: 16px; border: 1px solid #bfeee0; border-radius: 8px; background: var(--teal-soft); }
.handoff-delivery-queue .panel-head { margin-bottom: 4px; }
.handoff-request-grid { display: grid; gap: 8px; margin-top: 12px; }
.handoff-request { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 12px; border: 1px solid #cceee3; border-radius: 6px; background: var(--surface); }
.handoff-request strong { display: block; color: var(--navy); font-size: 13px; }
.handoff-request p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.request-check { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--teal-ink); background: #d9f8ed; }
.request-check svg { width: 13px; height: 13px; }
.handoff-delivery-empty { display: flex; flex-direction: column; gap: 3px; margin-top: 16px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: 6px; color: var(--text-muted); font-size: 12px; }
.handoff-delivery-empty strong { color: var(--text); }
.review-complete { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 6px; color: var(--teal-ink); background: var(--teal-soft); font-size: 12px; font-weight: 700; }
.review-complete svg { width: 14px; height: 14px; }
.handoff-history { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); list-style: none; }
.handoff-history li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 12.5px; }
.handoff-history li span { color: var(--text-faint); }

/* Founder Discovery: a reflective Pro workspace, distinct from the quick
   local-growth form and the corporate AIOS console. */
.founder-intro { max-width: 800px; padding: 20px 0 28px; }
.founder-intro h1 { margin: 9px 0 12px; color: var(--navy); font: 600 32px/1.14 var(--font-h); }
.founder-intro p { max-width: 710px; margin: 0; color: var(--text-muted); line-height: 1.65; }
.founder-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; color: var(--text-faint); font-size: 12px; }
.founder-meta span { padding-right: 14px; border-right: 1px solid var(--border); }
.founder-meta span:last-child { border: 0; padding-right: 0; }
.founder-continue { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; margin-bottom: 18px; border: 1px solid #bfeee0; border-radius: 8px; background: linear-gradient(90deg, var(--teal-soft), var(--surface)); }
.founder-continue h2 { margin: 5px 0; color: var(--navy); font: 600 20px/1.25 var(--font-h); }
.founder-continue p { max-width: 600px; margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.founder-map { padding: 20px 0 34px; }
.founder-map > .panel-head { margin-bottom: 14px; }
.founder-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.founder-mode-card { display: flex; flex-direction: column; min-height: 240px; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.founder-mode-card.exploring { border-color: var(--teal); }
.founder-mode-card.captured { border-color: #bfe3c9; }
.founder-mode-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mode-number { color: var(--teal-ink); font-weight: 700; font-size: 12px; letter-spacing: .06em; }
.founder-mode-card h3 { margin: 18px 0 8px; color: var(--navy); font: 600 18px/1.25 var(--font-h); }
.founder-mode-card p { flex: 1; margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.founder-mode-progress { padding: 12px 0; color: var(--text-faint); font-size: 11.5px; }
.builder-mode { margin-bottom: 12px; }
.builder-mode-title { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; color: var(--text-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.builder-mode.active .builder-mode-title { color: var(--teal-ink); }
.builder-mode-title span { color: var(--text-faint); font-weight: 600; }
.founder-thread-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 14px; margin: 0 0 14px; border-left: 3px solid var(--teal); background: var(--surface); font-size: 13px; box-shadow: var(--shadow-sm); }
.founder-thread-bar strong { color: var(--navy); }
.founder-thread-bar span:not(.label) { color: var(--text-muted); flex: 1; min-width: 220px; }
.wn-opt strong { display: block; font-size: 13px; color: var(--navy); }
.wn-opt span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Founder Discovery can offer a way into a difficult question without
   converting the conversation into a questionnaire. */
.builder-discovery .builder-convo { box-shadow: var(--shadow-sm); }
.discovery-starters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 0 14px 10px; color: var(--text-muted); font-size: 11.5px; }
.starter-chip { border: 1px solid #cfe3df; background: #f6fcfa; color: var(--teal-ink); border-radius: 15px; padding: 5px 9px; font: inherit; font-size: 11.5px; cursor: pointer; }
.starter-chip:hover { border-color: var(--teal); background: var(--teal-soft); }

/* ── Responsive ── */
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  #sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform 0.2s; }
  #app.nav-open #sidebar { transform: none; box-shadow: var(--shadow-lg); }
  #menuToggle { display: grid; }
  #view { padding: 18px 16px 40px; }
  .ws-label { display: none; }
  #workspaceSelect { min-width: 150px; }
  .user-meta { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .firstrun { flex-direction: column; align-items: stretch; }
  .cov-row { grid-template-columns: 1fr 60px; }
  .cov-bar { display: none; }
  .continue-grid { grid-template-columns: 1fr; gap: 14px; }
  .session-bar { flex-direction: column; align-items: stretch; }
  .discovery-route-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .discovery-route-reassurance { max-width: none; text-align: left; }
  .discovery-route-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 9px; }
  .growth-grid { grid-template-columns: 1fr; }
  .growth-preview { position: static; }
  .growth-review { flex-direction: column; align-items: stretch; gap: 6px; }
  .route-meta { grid-template-columns: 1fr; gap: 2px; }
  .jstep-row { flex-wrap: wrap; }
  .jstep-row .btn { width: 100%; margin-top: 6px; }
  .wizard-card { padding: 20px; }
  .wizard-card h2 { font-size: 18px; }
  .wizard-source-actions .btn { width: 100%; }
  .client-next, .client-complete { align-items: flex-start; flex-direction: column; }
  .client-next .btn { width: 100%; }
  .handoff-grid, .handoff-routes { grid-template-columns: 1fr; }
  .handoff-status { flex-direction: column; }
  .handoff-kv { grid-template-columns: 1fr; gap: 2px; }
  .handoff-kv dt { margin-top: 8px; }
  .handoff-history li { flex-direction: column; gap: 2px; }
  .handoff-request { grid-template-columns: 22px minmax(0, 1fr); }
  .handoff-request .badge { grid-column: 2; justify-self: start; }
  .founder-mode-grid { grid-template-columns: 1fr; }
  .founder-continue { align-items: flex-start; flex-direction: column; }
  .recognition-options { grid-template-columns: 1fr; }
  .lite-growth-experience::before { left: 0; right: 0; }
  .discovery-starters { align-items: flex-start; flex-direction: column; }
}
