/* TandemX demo: light theme. Cobalt primary, lime highlight (fill only), coral for human decisions. */
:root {
  --bg: #f3f4f8;
  --bg-2: #eceef4;
  --surface: var(--surface);
  --surface-2: var(--surface-2);
  --line: var(--line);
  --line-2: #d3d8e4;
  --text: var(--text);
  --muted: var(--muted);
  --faint: #8a90a3;
  --accent: var(--accent);
  --accent-2: #1f45e0;
  --accent-ink: var(--surface);
  --accent-soft: rgba(43, 89, 255, 0.09);
  --lime: #c6f432;
  --lime-soft: rgba(198, 244, 50, 0.35);
  --lime-ink: #1b2400;
  --warn: #e8481f;
  --warn-soft: rgba(255, 90, 60, 0.1);
  --coral: #ff5a3c;
  --bad: #d93a3a;
  --bad-soft: rgba(217, 58, 58, 0.09);
  --ok: #138a4b;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 70, 0.06), 0 2px 8px rgba(20, 30, 70, 0.04);
  --shadow: 0 10px 30px rgba(20, 30, 70, 0.1), 0 2px 6px rgba(20, 30, 70, 0.05);
  --shadow-lg: 0 30px 80px rgba(20, 30, 70, 0.18);
  --font: "Geist Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque Variable", "Geist Variable", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono Variable", ui-monospace, "SF Mono", Menlo, monospace;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

/* ---------- Themes: Light (default), Dim (slate, between light and dark), Dark ----------
   Crisp neutral greys replace the old washed-out pastel; cobalt stays the action colour and lime the brand mark.
   Components read only these tokens, so one attribute on <html> switches the whole app. */
:root, [data-theme="light"] {
  --amber: #8a5a00; --amber-soft: rgba(245, 181, 68, 0.18); --ok-soft: rgba(18, 122, 68, 0.1);
  --bg: #ffffff; --bg-2: #f9f9f9; --surface: #ffffff; --surface-2: #f4f4f4;
  --line: #e5e5e5; --line-2: #d4d4d4; --text: #0d0d0d; --muted: #5d5d5d; --faint: #6e6e6e;
  --accent: #2348f2; --accent-2: #1a37c8; --accent-ink: #ffffff; --accent-soft: rgba(35, 72, 242, 0.08);
  --lime: #c6f432; --lime-soft: rgba(198, 244, 50, 0.32); --lime-ink: #18200a;
  --warn: #d9461d; --warn-soft: rgba(217, 70, 29, 0.1); --coral: #f0532f; --bad: #c9302c; --bad-soft: rgba(201, 48, 44, 0.08); --ok: #127a44;
  --shadow-sm: 0 1px 2px rgba(11, 14, 20, 0.06), 0 2px 8px rgba(11, 14, 20, 0.04);
  --shadow: 0 10px 30px rgba(11, 14, 20, 0.08), 0 2px 6px rgba(11, 14, 20, 0.04);
  --shadow-lg: 0 30px 80px rgba(11, 14, 20, 0.16);
  --glow: rgba(35, 72, 242, 0.06);
  color-scheme: light;
}
[data-theme="dim"] {
  --amber: #f5c26b; --amber-soft: rgba(245, 181, 68, 0.14); --ok-soft: rgba(79, 209, 139, 0.12);
  --bg: #212121; --bg-2: #181818; --surface: #2a2a2a; --surface-2: #2f2f2f;
  --line: #383838; --line-2: #4a4a4a; --text: #e3e3e3; --muted: #b4b4b4; --faint: #9a9a9a;
  --accent: #4c6fff; --accent-2: #6f8cff; --accent-ink: #ffffff; --accent-soft: rgba(127, 156, 255, 0.14);
  --lime: #c6f432; --lime-soft: rgba(198, 244, 50, 0.18); --lime-ink: #18200a;
  --warn: #ff8a5c; --warn-soft: rgba(255, 138, 92, 0.14); --coral: #ff7a5c; --bad: #ff6b66; --bad-soft: rgba(255, 107, 102, 0.12); --ok: #4fd18b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25); --shadow: 0 10px 30px rgba(0, 0, 0, 0.3); --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);
  --glow: rgba(127, 156, 255, 0.07);
  color-scheme: dark;
}
[data-theme="dark"] {
  --amber: #f5c26b; --amber-soft: rgba(245, 181, 68, 0.12); --ok-soft: rgba(79, 209, 139, 0.1);
  --bg: #0d0d0d; --bg-2: #090909; --surface: #141414; --surface-2: #1c1c1c;
  --line: #262626; --line-2: #333333; --text: #ededed; --muted: #a8a8a8; --faint: #8a8a8a;
  --accent: #2f5bff; --accent-2: #5a7cff; --accent-ink: #ffffff; --accent-soft: rgba(110, 139, 255, 0.14);
  --lime: #c6f432; --lime-soft: rgba(198, 244, 50, 0.14); --lime-ink: #18200a;
  --warn: #ff8a5c; --warn-soft: rgba(255, 138, 92, 0.12); --coral: #ff7a5c; --bad: #ff6b66; --bad-soft: rgba(255, 107, 102, 0.1); --ok: #4fd18b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow: 0 10px 30px rgba(0, 0, 0, 0.5); --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6);
  --glow: rgba(110, 139, 255, 0.05);
  color-scheme: dark;
}
html { transition: background-color .2s ease; }


* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(48vw 40vw at 85% -12%, var(--glow), transparent 70%); }
a { color: inherit; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: var(--text); }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); letter-spacing: -0.025em; line-height: 1.08; font-weight: 700; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
::selection { background: var(--lime); color: var(--lime-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-rows: 68px 1fr; }
.topbar { display: flex; align-items: center; gap: 22px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid rgba(211, 216, 228, 0.7); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 750; font-size: 18px; letter-spacing: -0.02em; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--tx-radius-sm); display: grid; place-items: center; }
.brand-mark img { width: 32px; height: 32px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13.5px; }
.crumbs a { text-decoration: none; color: var(--muted); padding: 5px 10px; border-radius: var(--tx-radius-box); transition: background 0.2s ease, color 0.2s ease; }
.crumbs a:hover { background: var(--surface); color: var(--text); }
.crumbs a:last-child { color: var(--text); font-weight: 550; }
.crumbs .sep { color: var(--faint); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.nav-signout i { display:none; }
.flow-intelligence { margin:12px;padding:16px;border:1px solid var(--line);border-radius:var(--tx-radius-box);background:var(--surface);overflow-wrap:anywhere;display:grid;gap:10px; }
.flow-assumption-review { display:flex;align-items:flex-start;gap:10px;font-size:14px;line-height:1.5; }
@media(max-width:640px) { .nav-signout span { display:none; }.nav-signout i { display:inline; } }
.budget { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--tx-radius-box); background: var(--surface); box-shadow: var(--shadow-sm); font-family: var(--mono); font-size: 12px; color: var(--text); }
.budget i { color: var(--accent); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }

.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 44px 28px 90px; }
.page-narrow { max-width: 920px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: var(--tx-radius-box); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform 0.25s var(--spring), background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 8px 22px rgba(43, 89, 255, 0.32); }
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 12px 28px rgba(43, 89, 255, 0.4); }
.btn-lime { background: var(--lime); color: var(--lime-ink); border-color: transparent; }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: none; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; color: var(--text); font-weight: 600; }
.field .help { font-size: 12.5px; color: var(--muted); }
.input { height: 46px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; width: 100%; }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.error { color: var(--bad); font-size: 13px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .span-2 { grid-column: span 2; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--bg); }
.login-art { position: relative; overflow: hidden; margin: 14px; border-radius: var(--tx-radius-box); background: #1737c9; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; }
.login-art .blob { position: absolute; border-radius: 50%; filter: blur(60px); z-index: -1; }
.login-art .b1 { width: 520px; height: 520px; background: #4f7bff; top: -160px; right: -120px; animation: drift 14s ease-in-out infinite alternate; }
.login-art .b2 { width: 420px; height: 420px; background: var(--lime); bottom: -200px; left: -80px; opacity: 0.8; animation: drift 18s ease-in-out infinite alternate-reverse; }
.login-art .b3 { width: 260px; height: 260px; background: var(--coral); bottom: 18%; right: 12%; opacity: 0.55; animation: drift 11s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }
.login-art .brand { color: #fff; }
.login-art h1 { font-size: clamp(38px, 4.4vw, 64px); max-width: 12ch; letter-spacing: -0.04em; font-weight: 800; }
.login-art h1 em { font-style: normal; background: var(--lime); color: var(--lime-ink); padding: 0 0.16em; border-radius: 0.18em; }
.login-art p { color: rgba(255, 255, 255, 0.82); max-width: 42ch; margin-top: 20px; font-size: 17px; }
.ticker { display: grid; gap: 10px; max-width: 360px; }
.ticker div { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--tx-radius-box); background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.22); font-size: 13.5px; animation: slidein 0.6s var(--spring) both; }
.ticker div:nth-child(2) { animation-delay: 0.15s; }
.ticker div:nth-child(3) { animation-delay: 0.3s; }
.ticker i { width: 26px; height: 26px; border-radius: var(--tx-radius-sm); display: grid; place-items: center; background: var(--lime); color: var(--lime-ink); font-size: 14px; }
@keyframes slidein { from { opacity: 0; transform: translateY(14px); } }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.login-card h2 { font-size: 30px; }
.login-card .sub { color: var(--muted); font-size: 14.5px; margin-top: -8px; }

/* ---------- headings ---------- */
.page-head { display: grid; gap: 12px; margin-bottom: 34px; max-width: 72ch; }
.page-head h1 { font-size: clamp(32px, 3.6vw, 50px); letter-spacing: -0.035em; font-weight: 800; }
.page-head h1 em { font-style: normal; color: var(--accent); }
.page-head p { color: var(--muted); font-size: 16.5px; }
.kicker { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- ERP picker ---------- */
.erp-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.erp-tile { grid-column: span 4; position: relative; overflow: hidden; text-align: left; border: 1px solid var(--line); border-radius: var(--tx-radius-box); background: var(--surface); padding: 22px; cursor: pointer; display: grid; gap: 14px; min-height: 176px; box-shadow: var(--shadow-sm); transition: transform 0.35s var(--spring), box-shadow 0.3s ease, border-color 0.3s ease; isolation: isolate; }
.erp-tile::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -70px; top: -70px; background: var(--tint, var(--accent)); opacity: 0.08; z-index: -1; transition: transform 0.5s var(--ease), opacity 0.3s ease; }
.erp-tile:hover { transform: translateY(-5px) rotate(-0.4deg); box-shadow: var(--shadow); border-color: transparent; }
.erp-tile:hover::after { transform: scale(1.6); opacity: 0.14; }
.erp-tile.quarter { grid-column: span 3; }
.erp-tile.native { grid-column: span 8; grid-row: span 2; background: var(--accent); color: #fff; border-color: transparent; min-height: 368px; padding: 32px; box-shadow: 0 20px 50px rgba(43, 89, 255, 0.3); }
.erp-tile.native::after { background: var(--lime); opacity: 0.9; width: 360px; height: 360px; right: -120px; top: -140px; filter: blur(50px); }
.erp-tile.native:hover::after { opacity: 1; transform: scale(1.15); }
.erp-tile.native h3 { font-size: 40px; font-weight: 800; }
.erp-tile.native .edition, .erp-tile.native .tagline { color: rgba(255, 255, 255, 0.85); }
.erp-tile h3 { font-size: 20px; }
.erp-tile .edition { color: var(--muted); font-size: 13px; margin-top: 4px; }
.erp-tile .tagline { color: var(--text); font-size: 14px; }
.erp-mono { width: 44px; height: 44px; border-radius: var(--tx-radius-box); display: grid; place-items: center; font-weight: 750; font-size: 15px; font-family: var(--display); flex: none; }
.erp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--tx-radius-box); background: var(--bg); font-size: 12px; font-weight: 550; color: var(--text); white-space: nowrap; }
.chip.ok { color: var(--lime-ink); background: var(--lime); }
.chip.blue { color: var(--accent); background: var(--accent-soft); }
.chip.warn { color: var(--warn); background: var(--warn-soft); }
.chip.bad { color: var(--bad); background: var(--bad-soft); }
.erp-tile.native .chip { background: rgba(255, 255, 255, 0.18); color: #fff; }
.erp-tile.native .chip.ok { background: var(--lime); color: var(--lime-ink); }
.native-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 12px; }
.native-stats b { display: block; font-size: 38px; font-family: var(--display); letter-spacing: -0.04em; font-weight: 800; }
.native-stats span { color: rgba(255, 255, 255, 0.8); font-size: 13px; }

/* ---------- ERP detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.detail > div, .overview > div { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.panel { border: 1px solid var(--line); border-radius: var(--tx-radius-box); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.panel-h h3 { font-size: 16.5px; }
.panel-h > i { width: 30px; height: 30px; border-radius: var(--tx-radius-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 16px; }
.panel-b { padding: 20px 22px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.step { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 15px 0; position: relative; }
.step > div { min-width: 0; }
.step + .step { border-top: 1px dashed var(--line); }
.step-num { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--surface); cursor: pointer; transition: transform 0.3s var(--spring), background 0.2s ease; }
.step-num:hover { transform: scale(1.1); border-color: var(--accent); color: var(--accent); }
.step.done .step-num { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.step h4 { font-size: 15.5px; font-weight: 650; cursor: pointer; font-family: var(--font); letter-spacing: -0.01em; }
.step.open h4 { color: var(--accent); }
.step p { color: var(--text); font-size: 14px; margin-top: 6px; animation: fadein 0.3s ease; }
pre.code { max-width: 100%; margin: 10px 0 0; padding: 13px 15px; border-radius: var(--radius-sm); background: var(--text); overflow-x: auto; font-family: var(--mono); font-size: 12.5px; color: #d6ddf0; white-space: pre; }
.surface-list { display: grid; gap: 14px; }
.surface-list > div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 13.5px; }
.surface-list .kind { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: var(--tx-radius-sm); height: 22px; display: grid; place-items: center; }
.surface-list b { font-weight: 650; }
.surface-list span { color: var(--muted); display: block; }
.authorize-card { padding: 24px; display: grid; gap: 14px; position: relative; overflow: hidden; isolation: isolate; }
.authorize-card::before { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -110px; border-radius: 50%; background: var(--lime); opacity: 0.45; filter: blur(40px); z-index: -1; }
.authorize-card h3 { font-size: 22px; }
.scope { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text); }
.scope i { color: var(--accent); margin-top: 3px; }
.limits li { color: var(--text); font-size: 13.5px; margin-bottom: 7px; }
.limits { padding-left: 18px; margin: 0; }
.limits li::marker { color: var(--coral); }

/* exposes table */
.xtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.xtable th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 14px; background: var(--surface-2); }
.xtable td { padding: 12px 14px; vertical-align: top; }
.xtable tr + tr td { border-top: 1px solid var(--line); }
.xtable .native { font-weight: 650; }
.xtable .ep { font-family: var(--mono); font-size: 11.5px; color: var(--muted); word-break: break-all; margin-top: 3px; }
.access { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- consent ---------- */
.consent-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.consent { width: 100%; max-width: 470px; border-radius: var(--tx-radius-box); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.5s var(--spring); }
.consent-top { padding: 34px 32px 24px; display: grid; justify-items: center; gap: 16px; text-align: center; background: linear-gradient(180deg, var(--accent-soft), transparent); }
.consent-logos { display: flex; align-items: center; gap: 16px; }
.consent-logos .erp-mono { width: 56px; height: 56px; border-radius: var(--tx-radius-box); font-size: 18px; box-shadow: var(--shadow); }
.consent-logos .dots { display: flex; gap: 5px; }
.consent-logos .dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); animation: pulse 1.4s ease-in-out infinite; }
.consent-logos .dots span:nth-child(2) { animation-delay: 0.2s; }
.consent-logos .dots span:nth-child(3) { animation-delay: 0.4s; }
.consent h2 { font-size: 22px; }
.consent-body { padding: 8px 32px 22px; display: grid; gap: 12px; }
.consent-actions { padding: 0 32px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent-note { font-size: 12px; color: var(--faint); text-align: center; padding: 0 32px 24px; }
@keyframes pulse { 50% { background: var(--accent); transform: scale(1.3); } }

/* ---------- hub (agents + registry) ---------- */
.hub { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: calc(100dvh - 68px); }
/* Native has no registry sidebar: its main content uses the whole hub. */
.hub:has(> .hub-main):not(:has(> .registry)) { grid-template-columns: minmax(0, 1fr); }
.hub > .hub-main { min-width: 0; }
.registry { padding: 26px 18px; position: sticky; top: 68px; height: calc(100dvh - 68px); overflow-y: auto; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.registry h3 { font-size: 17px; }
.registry .reg-sub { color: var(--muted); font-size: 12.5px; margin: 4px 0 16px; }
.reg-erp { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--tx-radius-box); background: var(--surface); box-shadow: var(--shadow-sm); margin-bottom: 8px; }
.reg-erp .erp-mono { width: 34px; height: 34px; font-size: 12px; border-radius: var(--tx-radius-sm); }
.reg-erp b { font-size: 13.5px; display: block; }
.reg-erp span { font-size: 12px; color: var(--muted); }
.reg-group { margin-bottom: 16px; }
.reg-group > div:first-child { font-size: 11px; color: var(--faint); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 6px 6px; }
.reg-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: var(--tx-radius-sm); font-size: 13.5px; cursor: default; transition: background 0.2s ease; }
.reg-item:hover { background: var(--surface); }
.reg-item i { width: 24px; height: 24px; border-radius: var(--tx-radius-sm); display: grid; place-items: center; font-size: 14px; background: var(--bg-2); color: var(--muted); }
.reg-item.on i { background: var(--accent-soft); color: var(--accent); }
.reg-item.off { opacity: 0.42; }
.reg-item.off span { text-decoration: line-through; text-decoration-color: var(--faint); }
.reg-item small { font-size: 11px; font-weight: 600; font-family: var(--mono); min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--tx-radius-box); display: grid; place-items: center; background: var(--bg-2); color: var(--muted); }
.reg-item.on small { background: var(--lime); color: var(--lime-ink); }
.reg-tip { font-size: 11.5px; color: var(--muted); padding: 0 8px 8px 42px; font-family: var(--mono); line-height: 1.45; animation: fadein 0.2s ease; }
.reg-meter { height: 8px; border-radius: var(--tx-radius-sm); background: var(--bg-2); overflow: hidden; margin: 10px 0 22px; }
.reg-meter span { display: block; height: 100%; border-radius: var(--tx-radius-sm); background: linear-gradient(90deg, var(--accent), #6f8cff); animation: grow 1s var(--ease); transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

.hub-main { padding: 40px 40px 90px; }
.hub-main > * { max-width: 1200px; }
.agent-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.agent-card { grid-column: span 3; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--tx-radius-box); background: var(--surface); padding: 28px; cursor: pointer; text-align: left; display: grid; gap: 12px; min-height: 250px; box-shadow: var(--shadow-sm); transition: transform 0.4s var(--spring), box-shadow 0.3s ease; isolation: isolate; }
.agent-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.agent-card.wide { grid-column: span 4; }
.agent-card.narrow { grid-column: span 2; }
.agent-card h3 { font-size: 26px; font-weight: 800; }
.agent-card p { color: var(--text); font-size: 14.5px; max-width: 44ch; }
.agent-card .ico { width: 50px; height: 50px; border-radius: var(--tx-radius-box); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 25px; transition: transform 0.4s var(--spring); }
.agent-card:hover .ico { transform: rotate(-8deg) scale(1.08); }
.agent-card .foot { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.agent-card .go { margin-left: auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: #fff; font-size: 18px; transition: transform 0.35s var(--spring); }
.agent-card:hover .go { transform: translateX(4px) rotate(-45deg); }
.agent-card .deco { position: absolute; border-radius: 50%; z-index: -1; filter: blur(30px); transition: transform 0.6s var(--ease); }
.agent-card:hover .deco { transform: scale(1.25); }
.agent-card.c-blue { background: var(--accent); color: #fff; border-color: transparent; }
.agent-card.c-blue p { color: rgba(255, 255, 255, 0.86); }
.agent-card.c-blue .ico { background: rgba(255, 255, 255, 0.18); color: #fff; }
.agent-card.c-blue .go { background: var(--lime); color: var(--lime-ink); }
.agent-card.c-blue .chip { background: rgba(255, 255, 255, 0.18); color: #fff; }
.agent-card.c-blue .chip.ok { background: var(--lime); color: var(--lime-ink); }
.agent-card.c-blue .coverage-note { color: #ffd3c9; }
.agent-card.c-blue .deco { width: 280px; height: 280px; right: -80px; bottom: -120px; background: var(--lime); opacity: 0.65; }
.agent-card.c-lime { background: var(--lime); border-color: transparent; color: var(--lime-ink); }
.agent-card.c-lime p { color: #2e3a07; }
.agent-card.c-lime .ico { background: rgba(27, 36, 0, 0.1); color: var(--lime-ink); }
.agent-card.c-lime .chip { background: rgba(27, 36, 0, 0.1); color: var(--lime-ink); }
.agent-card.c-lime .chip.ok { background: var(--lime-ink); color: var(--lime); }
.agent-card.c-lime .coverage-note { color: #7a2a14; }
.agent-card.c-lime .deco { width: 220px; height: 220px; right: -60px; top: -80px; background: var(--surface); opacity: 0.6; }
.agent-card.c-white .ico { background: var(--warn-soft); color: var(--coral); }
.agent-card.c-white .deco { width: 200px; height: 200px; right: -70px; bottom: -90px; background: var(--coral); opacity: 0.16; }
.agent-card.c-ink { background: var(--text); color: #fff; border-color: transparent; }
.agent-card.c-ink p { color: rgba(255, 255, 255, 0.72); }
.agent-card.c-ink .ico { background: rgba(198, 244, 50, 0.16); color: var(--lime); }
.agent-card.c-ink .go { background: var(--lime); color: var(--lime-ink); }
.agent-card.c-ink .chip { background: rgba(255, 255, 255, 0.1); color: #fff; }
.agent-card.c-ink .chip.ok { background: var(--lime); color: var(--lime-ink); }
.agent-card.c-ink .deco { width: 300px; height: 300px; right: -100px; top: -140px; background: var(--accent); opacity: 0.7; }
.coverage-note { font-size: 12.5px; color: var(--warn); font-weight: 500; }
.recent { display: grid; gap: 8px; }
.recent a { display: flex; gap: 12px; align-items: center; text-decoration: none; font-size: 13.5px; padding: 12px 16px; border-radius: var(--tx-radius-box); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform 0.3s var(--spring); }
.recent a:hover { transform: translateX(4px); }

/* ---------- overview ---------- */
.overview { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.player-frame { border-radius: var(--tx-radius-box); overflow: hidden; background: var(--surface); aspect-ratio: 16 / 9; box-shadow: var(--shadow); border: 1px solid var(--line); }
hyperframes-player { display: block; width: 100%; height: 100%; }
.ov-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: s; }
.ov-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 9px 0; font-size: 14.5px; font-weight: 600; animation: slidein 0.5s var(--spring) both; }
.ov-steps li:nth-child(2) { animation-delay: 0.05s; } .ov-steps li:nth-child(3) { animation-delay: 0.1s; } .ov-steps li:nth-child(4) { animation-delay: 0.15s; }
.ov-steps li:nth-child(5) { animation-delay: 0.2s; } .ov-steps li:nth-child(6) { animation-delay: 0.25s; } .ov-steps li:nth-child(7) { animation-delay: 0.3s; } .ov-steps li:nth-child(8) { animation-delay: 0.35s; }
.ov-steps li::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: var(--tx-radius-sm); display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.ov-steps small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }

/* ---------- run ---------- */
.run { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.2fr) minmax(290px, 0.9fr); gap: 14px; height: calc(100dvh - 68px); padding: 14px; }
.run > section { min-height: 0; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--tx-radius-box); box-shadow: var(--shadow-sm); border: 1px solid var(--line); overflow: hidden; }
.run .col-mid { background: transparent; border: 0; box-shadow: none; overflow: visible; }
.col-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 650; }
.col-h > i { width: 28px; height: 28px; border-radius: var(--tx-radius-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 15px; }
.col-h .muted { font-weight: 450; color: var(--muted); margin-left: auto; font-size: 12.5px; }
.col-scroll { overflow-y: auto; flex: 1; padding: 18px 20px; }

.stage-rail { display: flex; gap: 5px; padding: 6px 8px 0; }
.stage-rail span { flex: 1; height: 8px; border-radius: var(--tx-radius-sm); background: var(--line); transition: background 0.5s ease, transform 0.5s var(--spring); }
.stage-rail span.on { background: var(--accent); }
.stage-rail span.on:last-of-type, .stage-rail span.on + span:not(.on) { }
.stage-rail span.lost { background: var(--bad); }
.stage-label { padding: 10px 8px 0; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.stage-label b { color: var(--text); font-weight: 650; background: var(--surface); padding: 4px 12px; border-radius: var(--tx-radius-box); box-shadow: var(--shadow-sm); }

.stagecenter { flex: 1; display: grid; place-items: center; position: relative; padding: 20px; }
.stagecenter::before { content: ""; position: absolute; width: 440px; height: 440px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(43, 89, 255, 0.22), transparent 60%), radial-gradient(circle at 65% 65%, rgba(198, 244, 50, 0.55), transparent 55%); filter: blur(20px); pointer-events: none; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08) rotate(8deg); } }
.botwrap { position: relative; display: grid; justify-items: center; gap: 24px; width: 100%; max-width: 460px; }

/* the agent: a glossy cobalt blob with a face */
.bot { position: relative; width: 150px; height: 140px; animation: float 4s ease-in-out infinite; --bot-color: var(--accent); }
.bot-antenna { position: absolute; left: 50%; top: -18px; width: 4px; height: 22px; margin-left: -2px; background: #1a2d8f; border-radius: 3px; transform-origin: bottom; animation: wiggle 3s ease-in-out infinite; }
.bot-antenna::after { content: ""; position: absolute; left: 50%; top: -12px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(198, 244, 50, 0.35); }
.bot[data-mood="worried"] .bot-antenna::after { background: var(--coral); box-shadow: 0 0 0 4px rgba(255, 90, 60, 0.3); }
.bot[data-mood="lost"] .bot-antenna::after { background: var(--bad); }
.bot-head { position: absolute; inset: 0; border-radius: 46% 46% 42% 42% / 50% 50% 44% 44%; background: radial-gradient(circle at 30% 25%, #6f8cff, var(--bot-color) 55%, #1a3bd6); box-shadow: inset -8px -10px 20px rgba(10, 20, 90, 0.35), inset 6px 8px 16px rgba(255, 255, 255, 0.25), 0 24px 40px rgba(43, 89, 255, 0.35); transition: background 0.5s ease; }
.bot[data-mood="worried"] { --bot-color: #ff6a4a; }
.bot[data-mood="worried"] .bot-head { background: radial-gradient(circle at 30% 25%, #ffa48f, #ff6a4a 55%, #d63c1c); box-shadow: inset -8px -10px 20px rgba(90, 20, 10, 0.3), inset 6px 8px 16px rgba(255, 255, 255, 0.25), 0 24px 40px rgba(255, 90, 60, 0.35); }
.bot[data-mood="lost"] .bot-head { background: radial-gradient(circle at 30% 25%, #b8bccb, #7c8296 55%, #4d5263); box-shadow: 0 24px 40px rgba(20, 30, 70, 0.2); }
.bot[data-mood="done"] .bot-head, .bot[data-mood="happy"] .bot-head { animation: bounce 0.8s var(--spring); }
.bot-shine { position: absolute; left: 22%; top: 12%; width: 34px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); transform: rotate(-25deg); filter: blur(1px); }
.bot-face { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: flex; gap: 26px; }
.bot-eye { width: 18px; height: 24px; border-radius: var(--tx-radius-sm); background: var(--surface); position: relative; animation: blink 4.5s infinite; transition: height 0.3s ease, border-radius 0.3s ease; }
.bot-eye::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--text); left: 5px; top: 8px; transition: transform 0.3s ease; }
.bot[data-mood="thinking"] .bot-eye::after { animation: look 2.4s ease-in-out infinite; }
.bot[data-mood="happy"] .bot-eye, .bot[data-mood="done"] .bot-eye { height: 12px; border-radius: 12px 12px 4px 4px; }
.bot[data-mood="happy"] .bot-eye::after, .bot[data-mood="done"] .bot-eye::after { display: none; }
.bot-cheek { position: absolute; top: 56%; width: 16px; height: 9px; border-radius: 50%; background: #ff8fb1; opacity: 0; transition: opacity 0.4s ease; }
.bot-cheek.l { left: 20%; } .bot-cheek.r { right: 20%; }
.bot[data-mood="happy"] .bot-cheek, .bot[data-mood="done"] .bot-cheek { opacity: 0.8; }
.bot-mouth { position: absolute; left: 50%; top: 64%; width: 26px; height: 12px; margin-left: -13px; border-radius: 0 0 16px 16px; background: var(--text); transition: all 0.3s ease; overflow: hidden; }
.bot-mouth::after { content: ""; position: absolute; left: 6px; bottom: -3px; width: 14px; height: 8px; border-radius: 50%; background: #ff6f91; }
.bot[data-mood="thinking"] .bot-mouth { width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; }
.bot[data-mood="thinking"] .bot-mouth::after { display: none; }
.bot[data-mood="worried"] .bot-mouth { height: 5px; width: 22px; margin-left: -11px; border-radius: 4px; }
.bot[data-mood="worried"] .bot-mouth::after, .bot[data-mood="lost"] .bot-mouth::after { display: none; }
.bot[data-mood="lost"] .bot-mouth { height: 5px; border-radius: 4px; transform: rotate(-8deg); }
.bot[data-mood="working"] .bot-mouth { animation: talk 0.3s ease-in-out infinite alternate; }
.bot-arm { position: absolute; top: 58%; width: 26px; height: 14px; border-radius: var(--tx-radius-sm); background: #1f45e0; }
.bot-arm.l { left: -16px; transform-origin: right center; animation: wave-l 3.6s ease-in-out infinite; }
.bot-arm.r { right: -16px; transform-origin: left center; }
.bot[data-mood="done"] .bot-arm.r, .bot[data-mood="happy"] .bot-arm.r { animation: wave-r 0.6s ease-in-out 3; }
.bot[data-mood="worried"] .bot-arm { background: #d63c1c; }
.bot-shadow { width: 120px; height: 16px; border-radius: 50%; background: rgba(20, 30, 70, 0.18); filter: blur(5px); margin-top: -12px; animation: shadow 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }
@keyframes shadow { 50% { transform: scale(0.82); opacity: 0.6; } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }
@keyframes look { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(-3px, -3px); } 65% { transform: translate(3px, -3px); } }
@keyframes talk { to { height: 5px; } }
@keyframes wiggle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes wave-l { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(10deg); } }
@keyframes wave-r { 50% { transform: rotate(-40deg); } }
@keyframes bounce { 30% { transform: scale(1.08, 0.92); } 60% { transform: scale(0.96, 1.05); } }

.bubble { position: relative; max-width: 440px; padding: 16px 20px; border-radius: var(--tx-radius-box); background: var(--surface); font-size: 16px; font-weight: 550; text-align: center; box-shadow: var(--shadow); animation: pop 0.5s var(--spring); }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; margin-left: -8px; transform: rotate(45deg); background: var(--surface); border-radius: 3px; }
.bubble.worried { background: var(--warn-soft); color: var(--warn); } .bubble.worried::after { background: var(--warn-soft); }
.bubble.happy, .bubble.done { background: var(--lime); color: var(--lime-ink); } .bubble.happy::after, .bubble.done::after { background: var(--lime); }
.bubble.lost { background: var(--surface-2); color: var(--text); } .bubble.lost::after { background: var(--surface-2); }
.bubble .typing { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.bubble .typing span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.4; animation: dot 1s infinite; }
.bubble .typing span:nth-child(2) { animation-delay: 0.15s; } .bubble .typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.9); } }
.trail { display: grid; gap: 6px; width: 100%; max-width: 440px; }
.trail div { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; animation: fadein 0.4s ease; }
.trail div i { color: var(--ok); font-size: 12px; }
.trail div:nth-last-child(n + 4) { opacity: 0.55; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }

.mailbox-card { margin: 12px 8px 0; padding: 16px 18px; border-radius: var(--tx-radius-box); background: var(--text); color: #fff; font-size: 13.5px; display: grid; gap: 8px; box-shadow: var(--shadow); position: relative; overflow: hidden; isolation: isolate; }
.mailbox-card::before { content: ""; position: absolute; width: 200px; height: 200px; right: -60px; top: -90px; border-radius: 50%; background: var(--accent); filter: blur(40px); opacity: 0.8; z-index: -1; }
.mailbox-card .addr { font-family: var(--mono); font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.mailbox-card .addr button { color: var(--lime); }
.mailbox-card .link-btn { color: var(--lime); }
.cost-strip { margin: 0 8px; padding: 12px 16px; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-family: var(--mono); background: var(--surface); border-radius: var(--tx-radius-box); box-shadow: var(--shadow-sm); }
.cost-strip b { color: var(--text); font-weight: 600; }

/* transcript */
.msg { max-width: 90%; margin-bottom: 14px; animation: slidein 0.4s var(--spring) both; }
.msg .who { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; display: flex; gap: 6px; align-items: center; font-weight: 550; }
.msg .body { padding: 12px 15px; border-radius: 18px 18px 18px 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; white-space: pre-wrap; }
.msg.customer { margin-left: auto; }
.msg.customer .who { justify-content: flex-end; }
.msg.customer .body { background: var(--accent); color: #fff; border-color: transparent; border-radius: 18px 18px 6px 18px; }
.msg .subj { font-weight: 650; margin-bottom: 6px; font-size: 13px; }
.doc-card { margin-top: 10px; padding: 12px 14px; border-radius: var(--tx-radius-box); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; position: relative; overflow: hidden; }
.doc-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lime); }
.doc-card .row { display: flex; justify-content: space-between; gap: 10px; }
.doc-card .row span:first-child { color: var(--muted); }
.composer { padding: 12px 14px 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.composer textarea { min-height: 48px; max-height: 140px; border-radius: var(--tx-radius-box); }
.composer .btn { width: 48px; height: 48px; padding: 0; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 14px 0; border-top: 1px solid var(--line); }
.quick button { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--tx-radius-box); padding: 6px 12px; font-size: 12.5px; color: var(--text); cursor: pointer; transition: transform 0.25s var(--spring), border-color 0.2s ease; text-align: left; }
.quick button:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* crm */
.crm-block { margin-bottom: 20px; }
.crm-block h4 { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 9px; font-family: var(--font); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--muted); }
.kv span:nth-child(even) { text-align: right; font-weight: 550; }
.pipeline { display: grid; gap: 2px; }
.pipeline div { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--faint); padding: 5px 8px; border-radius: var(--tx-radius-sm); transition: background 0.3s ease; }
.pipeline div.on { color: var(--text); }
.pipeline div.on i { color: var(--ok); }
.pipeline div.cur { color: var(--accent); font-weight: 650; background: var(--accent-soft); }
.pipeline i { font-size: 15px; }
.deal-value { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.meter { height: 8px; border-radius: var(--tx-radius-sm); background: var(--bg-2); overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; border-radius: var(--tx-radius-sm); background: var(--lime); transition: width 0.6s var(--ease); }
.ptable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ptable td { padding: 7px 4px; border-top: 1px solid var(--line); }
.ptable td:last-child { text-align: right; font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.ptable .bad { color: var(--bad); } .ptable .good { color: var(--ok); }

/* prompt modal */
.overlay { position: fixed; inset: 0; background: rgba(15, 18, 34, 0.38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fadein 0.25s ease; }
.modal { width: 100%; max-width: 800px; border-radius: var(--tx-radius-box); background: var(--surface); box-shadow: var(--shadow-lg); padding: 30px; display: grid; gap: 20px; animation: pop 0.5s var(--spring); }
.modal h3 { font-size: 24px; font-weight: 800; }
.modal .sub { color: var(--muted); font-size: 13px; font-family: var(--mono); margin-top: 8px; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.opt { text-align: left; border: 2px solid var(--line); border-radius: var(--tx-radius-box); background: var(--surface); padding: 18px; display: grid; gap: 8px; cursor: pointer; transition: border-color 0.2s ease, transform 0.35s var(--spring), box-shadow 0.3s ease; align-content: start; }
.opt:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.opt:first-child { background: linear-gradient(160deg, rgba(198, 244, 50, 0.35), var(--surface) 60%); }
.opt b { font-size: 15.5px; }
.opt .price { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-family: var(--display); }
.opt .price small { font-size: 13px; color: var(--muted); font-weight: 500; font-family: var(--font); }
.opt .note { font-size: 12.5px; color: var(--muted); }
.opt .margin { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ok); }
.opt.override .margin { color: var(--warn); }

/* bank check */
.bank { width: 100%; max-width: 440px; border-radius: var(--tx-radius-box); background: var(--surface); padding: 18px 20px; display: grid; gap: 10px; box-shadow: var(--shadow); animation: pop 0.45s var(--spring); }
.bank-row { display: flex; justify-content: space-between; font-size: 13px; }
.bank-row span:first-child { color: var(--muted); }
.bank-bar { height: 8px; border-radius: var(--tx-radius-sm); background: var(--bg-2); overflow: hidden; }
.bank-bar span { display: block; height: 100%; width: 40%; border-radius: var(--tx-radius-sm); background: var(--accent); animation: scan 1.1s ease-in-out infinite; }
.bank.done .bank-bar span { width: 100%; animation: none; background: var(--lime); }
@keyframes scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.result-banner { width: 100%; max-width: 460px; padding: 20px; border-radius: var(--tx-radius-box); text-align: center; font-family: var(--display); font-size: 24px; font-weight: 800; box-shadow: var(--shadow); animation: pop 0.5s var(--spring); }
.result-banner.won { background: var(--lime); color: var(--lime-ink); }
.result-banner.lost { background: var(--warn-soft); color: var(--warn); }
.result-banner p { font-family: var(--font); font-weight: 450; font-size: 13.5px; margin-top: 4px; opacity: 0.85; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti span { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0.8; } }

/* designer */
.designer { display: grid; grid-template-columns: 270px minmax(0, 1fr) 310px; height: calc(100dvh - 68px); gap: 14px; padding: 14px; }
.designer > * { background: var(--surface); border-radius: var(--tx-radius-box); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.palette { padding: 18px; overflow-y: auto; }
.palette h4 { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; margin: 18px 0 8px; font-family: var(--font); font-weight: 700; }
.palette h4:first-child { margin-top: 0; }
.pal-item { width: 100%; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--tx-radius-box); border: 1px solid var(--line); background: var(--surface); margin-bottom: 6px; cursor: pointer; font-size: 13px; text-align: left; transition: transform 0.25s var(--spring), border-color 0.2s ease; }
.pal-item:hover { border-color: var(--accent); transform: translateX(3px); }
.pal-item i { width: 26px; height: 26px; border-radius: var(--tx-radius-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pal-item.preset i { background: var(--lime); color: var(--lime-ink); }
.pal-item.off { opacity: 0.4; cursor: not-allowed; transform: none; }
.canvas { overflow-y: auto; padding: 30px; display: grid; justify-items: center; align-content: start; gap: 0; background-color: var(--surface-2); background-image: radial-gradient(var(--line-2) 1.2px, transparent 1.2px); background-size: 22px 22px; }
.node { width: 100%; max-width: 460px; border: 2px solid var(--line); border-radius: var(--tx-radius-box); background: var(--surface); padding: 14px 16px; display: grid; gap: 10px; position: relative; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.35s var(--spring); animation: pop 0.4s var(--spring); }
.node:hover { transform: translateY(-2px); }
.node.sel { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.node.running { border-color: var(--coral); box-shadow: 0 0 0 5px var(--warn-soft); transform: scale(1.02); }
.node.ran { border-color: var(--lime); background: linear-gradient(90deg, rgba(198, 244, 50, 0.18), var(--surface) 40%); }
.node-top { display: flex; gap: 12px; align-items: center; }
.node-top > i { width: 36px; height: 36px; border-radius: var(--tx-radius-sm); display: grid; place-items: center; font-size: 18px; background: var(--accent-soft); color: var(--accent); flex: none; }
.node.trigger .node-top > i { background: var(--text); color: var(--lime); }
.node-top b { font-size: 14.5px; }
.node-top small { color: var(--muted); font-size: 12px; display: block; font-weight: 450; }
.node-x { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 16px; }
.connector { width: 3px; height: 28px; background: repeating-linear-gradient(var(--line-2) 0 5px, transparent 5px 9px); }
.seg { display: inline-flex; background: var(--bg); border-radius: var(--tx-radius-box); padding: 3px; gap: 2px; justify-self: start; }
.seg button { border: 0; background: transparent; border-radius: var(--tx-radius-box); padding: 5px 11px; font-size: 12px; font-weight: 550; color: var(--muted); cursor: pointer; transition: background 0.2s ease; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button.on.auto { background: var(--coral); color: #fff; }
.inspector { padding: 20px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.guard { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; font-weight: 550; }
.guard input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.guard span { color: var(--muted); display: block; font-size: 12px; font-weight: 400; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 13.5px; }
.skeleton { background: linear-gradient(90deg, var(--bg-2) 0%, var(--surface-2) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--tx-radius-box); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* admin */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; }
.admin-table th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface-2); }
.admin-table tr + tr td { border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .run { grid-template-columns: 1fr; height: auto; }
  .run > section { min-height: 440px; }
  .run .col-mid { order: -1; min-height: 560px; }
  .designer { grid-template-columns: 1fr; height: auto; }
  .hub { grid-template-columns: 1fr; }
  .registry { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 380px; padding: 30px 24px; }
  .detail, .overview { grid-template-columns: 1fr; }
  .erp-tile, .erp-tile.native, .erp-tile.quarter { grid-column: span 12; min-height: 0; }
  .agent-card, .agent-card.wide, .agent-card.narrow { grid-column: span 6; }
  .hub-main { padding: 26px 16px 60px; }
  .page { padding: 28px 16px 60px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .topbar { padding: 0 16px; }
  .crumbs, .top-right > span:not(.budget) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
.erp-grid, .agent-grid { grid-auto-flow: dense; }
.botwrap .bot { scale: 1.35; margin: 34px 0 22px; }
.botwrap .bot-shadow { scale: 1.35; }
@media (max-width: 900px) { .botwrap .bot, .botwrap .bot-shadow { scale: 1.1; } }

/* ---------- wide-screen fill (no dead whitespace) ---------- */
.page { max-width: min(1680px, 100%); padding-left: clamp(16px, 3vw, 56px); padding-right: clamp(16px, 3vw, 56px); }
.page-narrow { max-width: 980px; }
.hub-main { padding: 36px clamp(16px, 2.6vw, 48px) 48px; display: flex; flex-direction: column; min-height: calc(100dvh - 68px); }
.hub-main > * { max-width: none; }
.agent-grid { grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(250px, auto); }
.agent-card.wide { grid-column: span 7; }
.agent-card.narrow { grid-column: span 5; }
.agent-card h3 { font-size: clamp(26px, 2vw, 38px); }
.agent-card p { font-size: clamp(14.5px, 0.9vw, 17px); max-width: 52ch; }
.agent-card .ico { width: clamp(50px, 3.4vw, 64px); height: clamp(50px, 3.4vw, 64px); font-size: clamp(25px, 1.7vw, 32px); }
.overview { grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); }
.page-head h1 { font-size: clamp(32px, 3.2vw, 60px); }
.erp-grid { gap: clamp(14px, 1.1vw, 22px); }
.erp-tile.native { min-height: clamp(368px, 30vw, 520px); }
.erp-tile { min-height: clamp(176px, 14vw, 250px); }
.compose-row { display: flex; gap: 8px; flex-wrap: wrap; }
.compose-row a, .compose-row button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--tx-radius-box); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; border: 0; }
.compose-row .primary { background: var(--lime); color: var(--lime-ink); }
.compose-row .ghost { background: rgba(255, 255, 255, 0.14); color: #fff; }
@media (max-width: 1100px) {
  .agent-grid { grid-template-rows: none; max-height: none; min-height: 0; }
  .agent-card.wide, .agent-card.narrow { grid-column: span 6; }
  .overview { grid-template-columns: 1fr; }
}
@media (max-width: 900px) { .agent-card.wide, .agent-card.narrow { grid-column: span 12; } }
.pdf-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pdf-links a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: var(--tx-radius-box); background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; }
.pdf-links a:hover { background: var(--accent); color: #fff; }
.msg.customer .doc-card { color: var(--text); }
.tips { margin: 0 8px 10px; padding: 12px 14px 14px; border-radius: var(--tx-radius-box); background: var(--text); color: #fff; box-shadow: var(--shadow); position: relative; overflow: hidden; isolation: isolate; animation: slidein 0.5s var(--spring) both; }
.tips::before { content: ""; position: absolute; width: 180px; height: 180px; right: -60px; bottom: -110px; border-radius: 50%; background: var(--accent); filter: blur(36px); opacity: 0.75; z-index: -1; }
.tips-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tips-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--tx-radius-box); background: var(--lime); color: var(--lime-ink); font-size: 11.5px; font-weight: 700; }
.tips-count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, 0.55); }
.tips-nav { width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 11px; }
.tips-nav:hover { background: rgba(255, 255, 255, 0.22); }
.tips p { font-size: 14px; line-height: 1.45; animation: fadein 0.45s ease; min-height: 40px; }
.tips-reopen { align-self: flex-start; margin: 0 8px 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--tx-radius-box); border: 0; background: var(--text); color: var(--lime); font-weight: 600; font-size: 12.5px; cursor: pointer; }

/* ---------- designer v2: saved, branched ---------- */
.designer { grid-template-columns: 270px minmax(0, 1fr) 340px; }
.canvas { display: block; padding: 18px 22px 40px; }
.design-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 22px; position: sticky; top: 0; z-index: 2; background: var(--surface-2); padding: 6px 0; }
.design-bar .input { height: 36px; max-width: 260px; }
.design-bar select.input { max-width: 220px; }
.save-msg { font-size: 12.5px; color: var(--ok); font-weight: 600; }
.flow { display: grid; justify-items: center; }
.flow > .node { max-width: 520px; }
.lane { width: 100%; max-width: 520px; border: 2px dashed transparent; border-radius: var(--tx-radius-box); padding: 12px; display: grid; justify-items: center; cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; background: rgba(255, 255, 255, 0.5); }
.lane:hover { border-color: var(--line-2); }
.lane.on { border-color: var(--accent); background: rgba(43, 89, 255, 0.04); }
.lane-h { width: 100%; font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.lane.path .lane-h { text-transform: none; letter-spacing: 0; color: var(--text); font-size: 13.5px; display: grid; gap: 3px; }
.lane.path .lane-h span { font-size: 12px; color: var(--muted); font-weight: 450; }
.lane-empty { font-size: 12.5px; color: var(--faint); padding: 14px 0; }
.lane .node { max-width: none; }
.connector.sm { height: 16px; }
.router { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--tx-radius-box); background: var(--text); color: #fff; font-weight: 650; font-size: 13.5px; box-shadow: var(--shadow); position: relative; margin-bottom: 26px; }
.router i { color: var(--lime); }
.router::after { content: ""; position: absolute; left: 50%; bottom: -26px; width: 3px; height: 26px; margin-left: -1.5px; background: repeating-linear-gradient(var(--line-2) 0 5px, transparent 5px 9px); }
.paths { display: grid; gap: 12px; width: 100%; align-items: start; position: relative; }
.paths::before { content: ""; position: absolute; top: -1px; left: 12%; right: 12%; height: 2px; background: var(--line-2); }
.paths .lane { max-width: none; background: var(--surface); align-content: start; }
.paths .node { padding: 11px 12px; }
.paths .node .seg button { padding: 4px 8px; font-size: 11px; }
.node.st-done { border-color: var(--lime); }
.node.st-held { border-color: #9fb3ff; }
.node.st-waiting { border-color: #9fb3ff; }
.node.st-blocked { border-color: var(--coral); box-shadow: 0 0 0 4px var(--warn-soft); }
.node.st-queued { border-color: #f5b544; }
.node.st-warn { border-color: #f5b544; background: var(--amber-soft); }
.st-chip { justify-self: start; display: inline-flex; gap: 5px; align-items: center; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--tx-radius-box); }
.st-chip.st-done { background: var(--lime); color: var(--lime-ink); }
.st-chip.st-held, .st-chip.st-waiting { background: var(--accent-soft); color: var(--accent); }
.st-chip.st-blocked { background: var(--warn-soft); color: var(--warn); }
.st-chip.st-queued, .st-chip.st-warn { background: var(--amber-soft); color: var(--amber); }
.outcome { margin-top: 10px; width: 100%; padding: 10px 12px; border-radius: var(--tx-radius-box); font-size: 12.5px; font-weight: 600; animation: pop 0.4s var(--spring); }
.outcome.ok { background: var(--lime); color: var(--lime-ink); }
.outcome.stop { background: var(--warn-soft); color: var(--warn); }
.outcome.risk { background: var(--amber-soft); color: var(--amber); }
.pal-target { margin: 14px 0 0; padding: 9px 11px; border-radius: var(--tx-radius-box); background: var(--accent-soft); color: var(--accent); font-size: 12.5px; }
.sim-results { display: grid; gap: 8px; }
.sim-path { border: 1px solid var(--line); border-radius: var(--tx-radius-box); overflow: hidden; }
.sim-path-h { width: 100%; display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 0; background: var(--surface-2); cursor: pointer; text-align: left; font-size: 13px; }
.sim-path-h span { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.sim-steps { padding: 10px 12px; display: grid; gap: 8px; }
.sim-step { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: 12.5px; animation: fadein 0.3s ease; }
.sim-step > i { margin-top: 2px; }
.sim-step p { color: var(--muted); margin-top: 2px; }
.sim-step.st-done > i { color: var(--ok); }
.sim-step.st-held > i, .sim-step.st-waiting > i { color: var(--accent); }
.sim-step.st-blocked > i { color: var(--coral); }
.sim-step.st-queued > i, .sim-step.st-warn > i { color: var(--amber); }
.guard-tag { margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: var(--tx-radius-box); background: var(--text); color: var(--lime); }
.sim-outcome { font-weight: 650; font-size: 12.5px; padding-top: 4px; border-top: 1px dashed var(--line); }
@media (max-width: 1300px) { .paths { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 1100px) { .designer { grid-template-columns: 1fr; } .paths { grid-template-columns: 1fr !important; } }

/* ---------- designer v3: describe, playbook, replay ---------- */
.designer.no-palette { grid-template-columns: minmax(0, 1fr) 360px; }
.describe { background: var(--text); color: #fff; border-radius: var(--tx-radius-box); padding: 18px 18px 14px; margin-bottom: 16px; position: relative; overflow: hidden; isolation: isolate; }
.describe::before { content: ""; position: absolute; width: 320px; height: 320px; right: -120px; top: -180px; border-radius: 50%; background: var(--accent); filter: blur(50px); opacity: 0.7; z-index: -1; }
.describe label { font-family: var(--display); font-size: 20px; font-weight: 700; display: block; margin-bottom: 10px; }
.describe-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }
.describe-row textarea { min-height: 70px; background: rgba(255, 255, 255, 0.96); }
.describe-row .btn { height: auto; background: var(--lime); color: var(--lime-ink); box-shadow: none; }
.describe-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.describe-foot button { border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); color: #dfe4f2; border-radius: var(--tx-radius-box); padding: 5px 11px; font-size: 12px; cursor: pointer; }
.describe-foot button:hover { background: rgba(255, 255, 255, 0.16); }
.describe-foot span { margin-left: auto; font-size: 11.5px; color: rgba(255, 255, 255, 0.6); font-family: var(--mono); }
.draft-note { margin-top: 10px; padding: 9px 12px; border-radius: var(--tx-radius-box); background: rgba(198, 244, 50, 0.16); color: #e9ffb0; font-size: 13px; }
.view-toggle { display: inline-flex; background: var(--surface); border-radius: var(--tx-radius-box); padding: 4px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.view-toggle button { border: 0; background: transparent; border-radius: var(--tx-radius-box); padding: 7px 14px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.view-toggle button.on { background: var(--accent); color: #fff; }
.playbook { background: var(--surface); border-radius: var(--tx-radius-box); padding: 26px 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); max-width: 900px; font-size: 15.5px; }
.pb-when { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.pb-trigger { font: inherit; color: var(--accent); background: var(--accent-soft); border: 0; border-radius: var(--tx-radius-box); padding: 2px 10px; cursor: pointer; }
.pb-section { padding: 14px 0 12px; border-top: 1px dashed var(--line); }
.pb-section h4 { font-family: var(--font); font-size: 13px; font-weight: 700; color: var(--muted); text-transform: none; letter-spacing: 0; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pb-section h4 b { color: var(--text); }
.pb-section ol { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.pb-line { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--tx-radius-box); transition: background 0.2s ease; }
.pb-line:hover { background: var(--surface-2); }
.pb-num { width: 24px; height: 24px; border-radius: var(--tx-radius-sm); background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.pb-text { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pb-aut { font: inherit; font-size: 13px; border: 1px solid var(--line-2); border-radius: var(--tx-radius-box); padding: 2px 8px; background: var(--surface); color: var(--muted); cursor: pointer; }
.pb-aut.risk { border-color: var(--coral); color: var(--warn); background: var(--warn-soft); }
.pb-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--tx-radius-box); background: var(--bg); color: var(--muted); }
.pb-add { font: inherit; font-size: 13px; border: 1px dashed var(--line-2); border-radius: var(--tx-radius-box); padding: 4px 10px; background: transparent; color: var(--accent); cursor: pointer; margin-left: 34px; }
.pb-empty { color: var(--faint); font-size: 13px; margin: 0 0 8px 34px; }
.pb-router { display: flex; gap: 8px; align-items: center; margin: 6px 0 4px; padding: 10px 14px; border-radius: var(--tx-radius-box); background: var(--text); color: #fff; font-size: 14.5px; }
.pb-router i { color: var(--lime); }
.pb-path { padding-left: 14px; border-left: 3px solid var(--accent-soft); border-top: 0; margin-top: 8px; }
.pb-result { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--tx-radius-box); }
.pb-result.ok { background: var(--lime); color: var(--lime-ink); }
.pb-result.stop { background: var(--warn-soft); color: var(--warn); }
.pb-result.risk { background: var(--amber-soft); color: var(--amber); }
.pb-guards { margin-top: 16px; padding: 12px 14px; border-radius: var(--tx-radius-box); background: var(--surface-2); color: var(--text); font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.pb-guards i { color: var(--ok); }
.replay { border-radius: var(--tx-radius-box); border: 1px solid var(--line); padding: 14px; display: grid; gap: 12px; animation: pop 0.4s var(--spring); }
.replay-h { display: flex; justify-content: space-between; align-items: baseline; }
.replay-h span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.replay-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.replay-tiles div { border-radius: var(--tx-radius-box); padding: 10px 12px; display: grid; gap: 2px; }
.replay-tiles b { font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.replay-tiles span { font-size: 11.5px; line-height: 1.3; }
.t-lime { background: var(--lime); color: var(--lime-ink); }
.t-blue { background: var(--accent); color: #fff; }
.t-ink { background: var(--text); color: #fff; }
.t-white { background: var(--surface-2); border: 1px solid var(--line); }
.replay-bars { display: grid; gap: 7px; }
.rb { display: grid; grid-template-columns: 96px 1fr 26px; gap: 8px; align-items: center; font-size: 11.5px; }
.rb span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-bar { display: flex; height: 10px; border-radius: var(--tx-radius-sm); overflow: hidden; gap: 2px; animation: grow 0.8s var(--ease); transform-origin: left; }
.rb-bar i { display: block; min-width: 0; }
.rb em { font-style: normal; font-family: var(--mono); color: var(--muted); text-align: right; }
.replay-notes { display: grid; gap: 5px; font-size: 12.5px; }
.designer.no-palette .canvas { padding-left: max(22px, calc((100% - 1000px) / 2)); padding-right: max(22px, calc((100% - 1000px) / 2)); }
.designer.no-palette .playbook { max-width: none; }
.design-bar { justify-content: flex-start; }
.replay-bar { display: flex; align-items: center; gap: 8px; margin: 12px 8px 0; padding: 10px 12px; border-radius: var(--tx-radius-box); background: var(--text); color: #fff; }
.rp-badge { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.rp-badge i { color: var(--lime); }
.rp-track { flex: 1; height: 6px; border-radius: var(--tx-radius-sm); background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.rp-track span { display: block; height: 100%; background: var(--lime); transition: width 0.3s ease; }
.rp-speed { border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; border-radius: var(--tx-radius-box); padding: 3px 8px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.rp-speed.on { background: var(--lime); color: var(--lime-ink); }
.tips-nav.dark { background: rgba(255, 255, 255, 0.12); }
.handoff { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; padding: 10px 12px; border-radius: var(--tx-radius-box); background: var(--text); color: #fff; font-family: var(--font); font-size: 13px; font-weight: 500; text-decoration: none; }
.handoff b { color: var(--lime); font-weight: 650; }
.share-url { margin-top: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); word-break: break-all; }
/* chief of staff */
.cos-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.cos-stats > div { border-radius: var(--tx-radius-box); padding: 18px 20px; display: grid; gap: 4px; }
.cos-stats b { font-family: var(--display); font-size: 36px; font-weight: 800; letter-spacing: -0.03em; }
.cos-stats span { font-size: 13px; }
.cos-cols { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; align-items: start; }
.cos-cols h3 { font-size: 18px; margin-bottom: 12px; }
.cos-empty { color: var(--faint); font-size: 13.5px; }
.cos-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--tx-radius-box); padding: 16px; box-shadow: var(--shadow-sm); display: grid; gap: 10px; margin-bottom: 12px; animation: slidein 0.4s var(--spring) both; }
.cos-top { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; }
.cos-top b { display: block; font-size: 14.5px; }
.cos-top span { font-size: 12px; color: var(--muted); }
.cos-ico { width: 36px; height: 36px; border-radius: var(--tx-radius-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 17px; }
.cos-q { font-weight: 650; font-size: 14px; }
.cos-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.cos-last { font-size: 13.5px; color: var(--text); }
.cos-foot { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.cos-foot a { color: var(--accent); text-decoration: none; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.cos-open { margin-left: auto; }
.cos-handoff { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: #fff; background: var(--text); padding: 7px 12px; border-radius: var(--tx-radius-box); text-decoration: none; justify-self: start; }
.nav-inbox { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--tx-radius-box); background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text); font-weight: 600; font-size: 13px; }
.nav-inbox .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--tx-radius-box); background: var(--coral); color: #fff; font-size: 11px; display: grid; place-items: center; }
@media (max-width: 1100px) { .cos-cols { grid-template-columns: 1fr; } .cos-stats { grid-template-columns: 1fr 1fr; } }
.funnel { display: grid; gap: 8px; }
.fn { display: grid; grid-template-columns: 190px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
.fn-bar { height: 12px; border-radius: var(--tx-radius-sm); background: var(--bg-2); overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #6f8cff); border-radius: var(--tx-radius-sm); }
.fn b { text-align: right; font-family: var(--mono); }
.warm-row { cursor: pointer; }
.warm-row:hover td { background: var(--surface-2); }
.heat { display: inline-block; padding: 3px 10px; border-radius: var(--tx-radius-box); font-weight: 700; font-size: 12px; text-transform: capitalize; white-space: nowrap; }
.heat-hot { background: var(--coral); color: #fff; }
.heat-warm { background: var(--amber-soft); color: var(--amber); }
.heat-cold { background: var(--bg-2); color: var(--muted); }
.run-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.run-pill { position: relative; overflow: hidden; font-size: 11px; font-weight: 700; padding: 3px 8px 5px; border-radius: var(--tx-radius-sm); background: var(--bg-2); }
.run-pill i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.run-pill.won i { background: var(--ok); }
.run-pill.lost i { background: var(--coral); }
.warm-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 6px 4px 10px; }
.warm-detail h4 { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; font-family: var(--font); }
.act { font-size: 12.5px; padding: 3px 0; color: var(--text); }
.act .mono { color: var(--muted); margin-right: 6px; }
.h2h { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.h2h-side { display: grid; gap: 10px; }
.h2h-label { display: grid; gap: 2px; padding: 12px 16px; border-radius: var(--tx-radius-box); }
.h2h-label b { font-family: var(--display); font-size: 18px; }
.h2h-label span { font-size: 13px; }
.h2h-label.manual { background: var(--warn-soft); color: var(--warn); }
.h2h-label.agent { background: var(--lime); color: var(--lime-ink); }
.h2h-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.h2h-stats > div { border-radius: var(--tx-radius-box); padding: 16px 18px; display: grid; gap: 3px; }
.h2h-stats b { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.h2h-stats span { font-size: 12.5px; }
@media (max-width: 1000px) { .h2h { grid-template-columns: 1fr; } .h2h-stats { grid-template-columns: 1fr 1fr; } }
/* middle column scrolls instead of clipping cards on shorter screens */
.run .col-mid { overflow-y: auto; overflow-x: hidden; }
.run .col-mid > * { flex-shrink: 0; }
.run .col-mid .stagecenter { flex: 1 0 auto; min-height: 380px; }
.mailbox-card { overflow: visible; }
.mailbox-card::before { display: none; }
.mailbox-card { background: linear-gradient(135deg, var(--text) 60%, #1d3bd1); }
.fallback-link { margin: 8px 14px 12px; align-self: flex-start; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
/* tips sit at the top of the stage, compact and high-contrast */
.tips { margin: 12px 8px 0; padding: 10px 14px 12px; background: var(--lime); color: var(--lime-ink); box-shadow: var(--shadow); }
.tips::before { display: none; }
.tips-badge { background: var(--text); color: var(--lime); }
.tips-count { color: rgba(27, 36, 0, 0.6); }
.tips-nav { background: rgba(27, 36, 0, 0.1); color: var(--lime-ink); }
.tips-nav:hover { background: rgba(27, 36, 0, 0.2); }
.tips p { font-size: 15px; font-weight: 550; min-height: 0; }
.mailbox-card { margin-top: 10px; padding: 12px 16px; gap: 6px; }
.mailbox-card .addr { font-size: 16px; }
.fake-inbox { display: grid; gap: 6px; align-content: start; }
.fi-row { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--tx-radius-box); padding: 10px 12px; cursor: pointer; display: grid; gap: 3px; transition: border-color 0.2s ease, transform 0.25s var(--spring); }
.fi-row:hover { transform: translateX(2px); }
.fi-row.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fi-row.lead { background: linear-gradient(90deg, rgba(198, 244, 50, 0.3), var(--surface) 60%); }
.fi-top { display: flex; justify-content: space-between; font-size: 13px; }
.fi-top span { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.fi-subj { font-size: 12.5px; color: var(--text); }
.fi-subj.big { font-size: 15px; font-weight: 650; color: var(--text); }
.fi-tag { justify-self: start; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--tx-radius-box); background: var(--bg-2); color: var(--muted); }
.fi-tag.lead { background: var(--text); color: var(--lime); }
.fi-open { margin-top: 8px; padding: 14px; border-radius: var(--tx-radius-box); background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 8px; animation: fadein 0.3s ease; }
.fi-from { font-size: 12px; color: var(--muted); }
.fi-open p { white-space: pre-wrap; font-size: 13.5px; }
.fi-note { font-size: 12.5px; color: var(--muted); }
.btn-danger { background: var(--coral); color: #fff; border-color: transparent; }
.region-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.region-opt { text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: var(--tx-radius-box); padding: 16px 18px; cursor: pointer; display: grid; gap: 4px; transition: border-color 0.2s ease, transform 0.3s var(--spring); }
.region-opt:hover { transform: translateY(-2px); }
.region-opt.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.region-opt b { font-family: var(--display); font-size: 18px; }
.region-opt span { font-size: 13px; color: var(--muted); }
@media (max-width: 700px) { .region-pick { grid-template-columns: 1fr; } }
.bank-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.bank-rail { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--tx-radius-box); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.bank-rail b { display: block; font-size: 14px; }
.bank-rail span { font-size: 12.5px; color: var(--muted); }
.bank-ico { width: 40px; height: 40px; border-radius: var(--tx-radius-box); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 19px; }
.bank-ico.lean { background: var(--lime); color: var(--lime-ink); }
.bank-actions { display: flex; gap: 6px; align-items: center; }
.bank-hint { grid-column: 2 / -1; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.bank-detail { font-size: 12.5px; color: var(--ok); font-weight: 600; }
.pay-amount { font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.pay-note { font-size: 12px; color: var(--muted); }
.pay-status { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pay-done { display: flex; gap: 8px; align-items: center; padding: 14px; border-radius: var(--tx-radius-box); background: var(--lime); color: var(--lime-ink); font-weight: 650; }
.consent.pay .kv { font-size: 13.5px; }
@media (max-width: 1000px) { .bank-strip { grid-template-columns: 1fr; } }

/* ---------------- on-demand ERPNext launch sequence ---------------- */
.boot { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; overflow: hidden; background: radial-gradient(1200px 600px at 30% 110%, rgba(43, 89, 255, 0.16), transparent 60%), radial-gradient(800px 500px at 90% -10%, rgba(198, 244, 50, 0.28), transparent 60%), var(--bg); animation: bootin 0.5s var(--ease) both; }
.boot-stars { position: absolute; inset: 0; pointer-events: none; }
.boot-stars span { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.18; animation: drift 7s linear infinite; }
.boot-stars span:nth-child(3n) { background: var(--lime); opacity: 0.6; }
.boot-stars span:nth-child(5n) { background: var(--coral); opacity: 0.3; }
.boot-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 56px; align-items: center; width: 100%; max-width: 1040px; }
.boot-stage { display: grid; justify-items: center; gap: 30px; min-height: 420px; align-content: center; }
.boot-stage .bubble { min-height: 58px; }
.boot-bot { position: relative; z-index: 0; display: grid; justify-items: center; }
.boot-bot .bot { scale: 1.25; margin: 20px 0 10px; }
.boot-bot.launch { animation: liftoff 1.6s var(--ease) 0.4s forwards; }
.boot-flame { position: absolute; z-index: -1; left: 50%; top: calc(100% + 6px); width: 46px; height: 46px; margin-left: -23px; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%; background: radial-gradient(circle at 50% 30%, var(--surface) 0 18%, var(--lime) 40%, var(--coral) 72%, transparent 74%); filter: blur(0.5px); transform-origin: top; animation: flicker 0.16s ease-in-out infinite alternate; opacity: 0.35; transition: opacity 0.6s ease, height 0.6s ease; }
.boot-flame.s0 { height: 26px; opacity: 0.35; } .boot-flame.s1 { height: 44px; opacity: 0.6; } .boot-flame.s2 { height: 58px; opacity: 0.75; }
.boot-flame.s3 { height: 76px; opacity: 0.9; } .boot-flame.s4, .boot-flame.s5 { height: 96px; opacity: 1; }
.boot-pad { width: 180px; height: 14px; border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 30, 70, 0.18), transparent); }
.boot-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--tx-radius-box); padding: 28px; box-shadow: var(--shadow-lg); }
.boot-head { display: flex; justify-content: space-between; align-items: center; }
.boot-clock { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.boot-panel h2 { font-family: var(--display); font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; margin: 16px 0 8px; }
.boot-sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.boot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.boot-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--tx-radius-box); font-weight: 550; color: var(--faint); transition: background 0.4s ease, color 0.4s ease; animation: slidein 0.5s var(--spring) both; }
.boot-list li.done { color: var(--text); }
.boot-list li.now { color: var(--text); background: var(--accent-soft); }
.boot-list li.hold { color: var(--warn); background: var(--warn-soft); }
.boot-dot { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); font-size: 12px; transition: all 0.4s var(--spring); }
.boot-list li.done .boot-dot { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.boot-list li.now .boot-dot { border-color: var(--accent); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.boot-list li.hold .boot-dot { border-color: var(--coral); color: var(--coral); }
.boot-bar { height: 8px; border-radius: var(--tx-radius-box); background: var(--bg-2); overflow: hidden; margin: 20px 0 18px; }
.boot-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #6f8cff 60%, var(--lime)); transition: width 1s var(--ease); }
.boot-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes bootin { from { opacity: 0; } }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-60px); opacity: 0; } }
@keyframes flicker { from { transform: scaleY(0.9) scaleX(1.05); } to { transform: scaleY(1.08) scaleX(0.95); } }
@keyframes liftoff { 30% { transform: translateY(8px); } to { transform: translateY(-140vh); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) {
  .boot { place-items: start center; overflow-y: auto; }
  .boot-inner { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .boot-stage { min-height: 0; gap: 18px; }
  .boot-bot .bot { scale: 0.9; margin: 6px 0 0; }
  .boot-panel { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .boot-stars span, .boot-flame, .boot-bot.launch, .boot-list li.now .boot-dot { animation: none; }
}

/* live ERPNext documents in the CRM panel */
.erp-live h4 { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(19, 138, 75, 0.5); animation: livepulse 1.8s ease-out infinite; }
.erp-docs { display: grid; gap: 6px; }
.erp-docs > a, .erp-docs > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--tx-radius-box); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: inherit; text-decoration: none; animation: slidein 0.45s var(--spring) both; }
.erp-docs > div { grid-template-columns: minmax(0, 1fr) auto; }
.erp-docs > a:hover { border-color: var(--accent); background: var(--accent-soft); }
.erp-docs .mono { font-size: 12px; color: var(--muted); }
.erp-docs i { color: var(--accent); font-size: 16px; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 8px rgba(19, 138, 75, 0); } 100% { box-shadow: 0 0 0 0 rgba(19, 138, 75, 0); } }

/* Lean sandbox login helper on the pay page */
.sandbox-login { display: grid; gap: 8px; padding: 14px; border-radius: var(--tx-radius-box); background: var(--accent-soft); border: 1px solid rgba(43, 89, 255, 0.18); font-size: 13px; }
.sandbox-login > span { color: var(--muted); }
.copy-field { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.copy-field span { color: var(--muted); font-size: 12.5px; }
.copy-field code { font-family: var(--mono); font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--tx-radius-sm); padding: 6px 8px; overflow-wrap: anywhere; }

/* Check inbox now */
.sync-btn { display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin-top: 4px; padding: 8px 14px; border-radius: var(--tx-radius-box); border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; transition: background 0.2s ease; }
.sync-btn:hover { background: rgba(255, 255, 255, 0.24); }
.sync-btn:disabled { opacity: 0.8; cursor: progress; }
.spin { animation: spin 0.9s linear infinite; display: inline-block; }

/* credit explanations */
.credit-note { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; opacity: 0.8; }
.credit-est { margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.credit-est i { color: var(--accent); }
.credit-est span { text-decoration: underline dotted; cursor: help; }
.cost-help { position: relative; display: inline-flex; margin-left: 6px; color: var(--muted); cursor: help; vertical-align: middle; }
.cost-tip { position: absolute; left: 50%; bottom: calc(100% + 10px); width: 280px; transform: translateX(-50%); padding: 10px 12px; border-radius: var(--tx-radius-box); background: var(--text); color: #fff; font-family: var(--font); font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 5; }
.cost-help:hover .cost-tip, .cost-help:focus .cost-tip { opacity: 1; }
@media (max-width: 640px) { .cost-tip { left: 0; transform: none; width: 240px; } }

.reg-help { margin: -4px 0 12px; font-size: 12.5px; color: var(--muted); }
.reg-help summary { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; list-style: none; }
.reg-help summary::-webkit-details-marker { display: none; }
.reg-help p { margin: 8px 0 0; line-height: 1.5; }

/* designer flowchart: grow to the right so every path can be scrolled to, plus zoom */
.designer .canvas { overflow: auto; justify-items: normal; }
.flow { min-width: min-content; }
.zoom-bar { position: sticky; top: 0; left: 0; z-index: 3; display: inline-flex; align-items: center; gap: 4px; margin: 0 0 12px; padding: 4px; border-radius: var(--tx-radius-box); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.zoom-bar button { display: inline-flex; align-items: center; gap: 5px; height: 30px; min-width: 30px; justify-content: center; padding: 0 10px; border: 0; border-radius: var(--tx-radius-box); background: transparent; font-weight: 600; font-size: 12.5px; cursor: pointer; color: var(--text); }
.zoom-bar button:hover { background: var(--accent-soft); color: var(--accent); }
.zoom-bar span { min-width: 44px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* evidence behind agent claims */
.ev-link { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 8px; border-radius: var(--tx-radius-box); border: 1px solid var(--line-2); background: var(--surface); color: var(--accent); font-size: 11.5px; font-weight: 600; cursor: pointer; vertical-align: middle; }
.ev-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.ev-link.in-bubble { display: flex; margin: 10px auto 0; font-size: 12.5px; padding: 5px 12px; }
.ev-modal { max-width: 620px; width: 100%; display: grid; gap: 16px; max-height: 88dvh; overflow-y: auto; }
.ev-top { display: flex; align-items: center; justify-content: space-between; }
.ev-item { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--tx-radius-box); background: var(--surface-2); }
.ev-item h4 { margin: 0; font-size: 15px; }
.ev-src { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ev-item .ptable th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 4px 8px; }
.ev-quote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; font-size: 13.5px; line-height: 1.5; display: grid; gap: 4px; white-space: pre-wrap; }
.ev-quote b { font-size: 12px; color: var(--muted); }
.ev-swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.ev-swatches figure { margin: 0; display: grid; gap: 6px; }
.ev-swatches span { display: block; height: 84px; border-radius: var(--tx-radius-box); border: 1px solid var(--line-2); box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.04); }
.ev-swatches figcaption { font-size: 12px; color: var(--muted); display: grid; }
.ev-swatches figcaption b { color: var(--text); font-size: 12.5px; }

/* undo and talk-it-through on decisions */
.undo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--tx-radius-box); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: var(--shadow-sm); max-width: 100%; }
.undo-chip:hover { border-color: var(--coral); color: var(--warn); }
.decide-chat { display: grid; gap: 8px; padding-top: 14px; border-top: 1px dashed var(--line); }
.decide-chat form { display: flex; gap: 8px; }
.decide-chat input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: var(--tx-radius-box); border: 1px solid var(--line-2); font: inherit; font-size: 13.5px; background: var(--surface); }
.decide-chat input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.decide-chat small { color: var(--muted); font-size: 12px; }
.dc-q { justify-self: end; max-width: 85%; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--accent); color: #fff; font-size: 13.5px; }
.dc-a { justify-self: start; max-width: 92%; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; }
.dc-a.bad { background: var(--warn-soft); color: var(--warn); }
.modal { max-height: calc(100dvh - 40px); overflow-y: auto; }

/* setup: industry picker, Other research, product choice */
.setup-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 4px 0 10px; }
.vert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.vert-opt { display: grid; gap: 4px; align-content: start; text-align: left; padding: 14px; border-radius: var(--tx-radius-box); border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.25s var(--spring); font: inherit; color: inherit; }
.vert-opt:hover { border-color: var(--line-2); transform: translateY(-1px); }
.vert-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.vert-opt i { font-size: 22px; color: var(--accent); }
.vert-opt b { font-size: 14px; }
.vert-opt span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.vert-opt.other { border-style: dashed; }
.other-box { display: grid; gap: 10px; margin-bottom: 16px; }
.other-box label { font-weight: 600; font-size: 13.5px; }
.other-box textarea { resize: vertical; min-height: 64px; }
.other-actions { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.other-saved { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.other-saved .chip { cursor: pointer; border: 1px solid var(--line-2); }
.profile-card { display: grid; gap: 10px; }
.profile-card > div:first-child { display: grid; }
.profile-card > div:first-child span { font-size: 12.5px; color: var(--muted); }
.profile-card ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.profile-card small { color: var(--muted); }
.profile-foot { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.product-pick { margin-bottom: 14px; max-width: 520px; }
@media (max-width: 640px) { .vert-grid { grid-template-columns: 1fr 1fr; } .vert-opt span { display: none; } }

/* delivery promise inside the quote decision */
.delivery-pick { display: grid; gap: 10px; padding: 14px; border-radius: var(--tx-radius-box); background: var(--surface-2); border: 1px solid var(--line); }
.dp-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; }
.dp-head span { color: var(--muted); }
.dp-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.dp-opt { display: grid; gap: 3px; text-align: left; padding: 10px 12px; border-radius: var(--tx-radius-box); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.dp-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dp-opt b { font-size: 13.5px; }
.dp-opt b small { color: var(--coral); font-weight: 600; }
.dp-date { font-family: var(--mono); font-size: 12.5px; }
.dp-note { font-size: 12px; color: var(--muted); }

/* plant page */
.plant { display: grid; gap: 18px; }
.plant-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.plant-head h1 { display: flex; gap: 10px; align-items: center; font-size: 30px; }
.plant-head h1 i { color: var(--accent); }
.plant-head p { color: var(--muted); max-width: 70ch; margin-top: 6px; font-size: 14px; }
.plant-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plant-controls select { min-width: 220px; height: 38px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--tx-radius-box); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 8px 14px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--text); color: #fff; }
.plant-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.plant-kpis > div { padding: 14px 16px; border-radius: var(--tx-radius-box); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.plant-kpis b { font-family: var(--display); font-size: 24px; }
.plant-kpis span { font-size: 12.5px; color: var(--muted); }
.plant-kpis .warn b { color: var(--warn); }
.plant-kpis .ok b { color: var(--ok); }
.gantt-panel { overflow: hidden; }
.gantt-scroll { overflow-x: auto; }
.gantt { padding: 10px 16px 16px; display: grid; gap: 6px; }
.g-axis, .g-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 10px; align-items: center; }
.g-axis .g-track { height: 18px; }
.g-axis span { position: absolute; top: 0; font-size: 11px; color: var(--muted); white-space: nowrap; transform: translateX(2px); }
.g-label { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.g-label b { color: var(--text); margin-right: 4px; }
.g-track { position: relative; height: 30px; }
.g-row .g-track { background: var(--surface-2); border-radius: var(--tx-radius-sm); }
.g-day { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-bar { position: absolute; top: 5px; height: 20px; border-radius: var(--tx-radius-sm); opacity: 0.92; transition: opacity 0.15s ease, transform 0.15s ease; cursor: default; }
.g-bar.dim { opacity: 0.2; }
.g-bar.rework { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.35) 0 4px, transparent 4px 8px) !important; outline: 2px solid var(--coral); }
.g-down { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(15, 18, 34, 0.18) 0 6px, transparent 6px 12px); border-radius: var(--tx-radius-sm); }
.plant-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1100px) { .plant-grid { grid-template-columns: 1fr; } .g-axis, .g-row { grid-template-columns: 120px minmax(0, 1fr); } }
.table-scroll { overflow-x: auto; padding: 0 12px 12px; }
.ptable.orders td, .ptable.orders th { white-space: nowrap; }
.ptable th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; }
.ptable tr.hl td { background: var(--accent-soft); }
.ptable td.bad, .ptable small.bad { color: var(--warn); }
.ptable td.good { color: var(--ok); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.chip.tiny { font-size: 10.5px; padding: 1px 6px; margin-left: 4px; }
.po-line { font-size: 12.5px; }

/* production curveballs and the Order to Delivery card */
.disrupt-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; margin: 0 22px 10px; border-radius: var(--tx-radius-box); background: var(--warn-soft); font-size: 13px; }
.disrupt-bar span { font-weight: 600; color: var(--warn); display: inline-flex; gap: 6px; align-items: center; }
.agent-card.full { grid-column: 1 / -1; }
.agent-card.o2d { background: radial-gradient(600px 240px at 90% 0%, rgba(198, 244, 50, 0.25), transparent 60%), var(--text); color: #fff; }

/* Plant: your own data */
.import-panel { padding: 0; overflow: hidden; }
.import-toggle { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 20px; background: none; border: 0; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.import-toggle > i:first-child { font-size: 22px; color: var(--accent); }
.import-toggle span { display: grid; gap: 2px; min-width: 0; }
.import-toggle small { color: var(--muted); font-size: 13px; }
.import-body { padding: 0 20px 20px; display: grid; gap: 12px; }
.import-tabs button em { font-style: normal; font-family: var(--mono); font-size: 11px; margin-left: 6px; padding: 1px 6px; border-radius: var(--tx-radius-box); background: var(--lime); color: var(--lime-ink); }
.import-hint { margin: 0; font-size: 13px; }
.import-actions, .import-go { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.import-actions label { cursor: pointer; }
.import-text { width: 100%; min-height: 150px; font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre; overflow: auto; resize: vertical; padding: 12px; border-radius: var(--tx-radius-box); }
.import-result p { margin: 0 0 8px; font-weight: 600; }
.import-result p.warn { color: var(--warn); }
.import-result p.ok { color: var(--ok); }
.import-result tr.late td:last-child i { color: var(--warn); }
.import-result tr:not(.late) td:last-child i { color: var(--amber); }
@media (max-width: 640px) { .import-toggle { padding: 14px 16px; } .import-body { padding: 0 16px 16px; } }
.import-result .ptable th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 4px; }
.import-result .ptable td:last-child { text-align: left; font-family: inherit; font-size: 12.5px; font-weight: 400; }
.opt .margin.bad { color: var(--warn); }

/* Talk to sales */
.sales-btn { white-space: nowrap; }
.sales-modal { max-width: 640px; }
.sales-modal h3 { margin-top: 4px; }
.sales-lead { margin: 0; font-size: 14px; }
.sales-go { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sales-done { display: grid; gap: 14px; justify-items: start; }
.sales-done p { margin: 0; line-height: 1.55; }
.sales-modal textarea.input { height: auto; padding: 12px 14px; resize: vertical; font: inherit; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.login-sales { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 760px) {
  .top-right .avatar { display: none; }
  .sales-btn { padding: 0 10px; }
}
/* The data settings box: shown on a first visit, and from the "Demo data settings" link in the page footer. */
.data-settings-panel { position: fixed; bottom: 12px; left: 12px; width: min(440px, calc(100vw - 24px)); max-height: 65vh; overflow: auto; z-index: 1000; background: var(--surface); color: var(--text); padding: 18px; border: 1px solid var(--line-2); border-radius: var(--tx-radius-box); box-shadow: 0 8px 32px #0002; font-size: 13px; }
.data-settings-panel p { margin: 10px 0; font-size: 12px; line-height: 1.5; }
.data-settings-panel label { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; }
.data-settings-panel input { margin-top: 2px; flex-shrink: 0; }
.data-settings-panel > .ds-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ds-more { display: none; }

/* ---------- phone fit: nothing may widen the page past the viewport ---------- */
.shell { grid-template-columns: minmax(0, 1fr); }
.topbar, .top-right { min-width: 0; }
@media (max-width: 1100px) {
  /* .designer.no-palette out-ranks the single-column rule above, so restate it here */
  .designer, .designer.no-palette { grid-template-columns: minmax(0, 1fr); height: auto; }
  .designer > * { min-width: 0; }
}
@media (max-width: 900px) {
  .hub, .plant-grid { grid-template-columns: minmax(0, 1fr); }
  .plant-head > * { min-width: 0; max-width: 100%; }
  .plant-head h1 { flex-wrap: wrap; font-size: 24px; }
  .plant-controls select { min-width: 0; flex: 1 1 160px; }
}
@media (max-width: 640px) {
  /* header: logo mark and icons only, so Talk to sales and Sign out still fit */
  .topbar { gap: 10px; padding: 0 12px; }
  .brand { font-size: 0; gap: 0; }
  .top-right { gap: 8px; }
  .nav-inbox { font-size: 0; gap: 0; padding: 8px 10px; }
  .nav-inbox i { font-size: 17px; }
  .nav-inbox .count { font-size: 11px; margin-left: 5px; }
  .top-right .btn-ghost { padding: 0 8px; }
  .bank-strip { grid-template-columns: minmax(0, 1fr); }
  .bank-rail { grid-template-columns: 40px minmax(0, 1fr); }
  .bank-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .bank-hint { grid-column: 1 / -1; overflow-wrap: anywhere; }
}

/* ---------- feedback and self sign-up ---------- */
.feedback-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-kinds button { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: var(--tx-radius-box); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.feedback-kinds button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.signup-open { margin-top: 18px; width: 100%; max-width: 380px; }
.signup-card { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.signup-card h2 { font-size: 24px; }
.signup-note { margin-top: 18px; font-size: 13.5px; color: var(--muted); text-align: center; }
.verify-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 28px; background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text); }
.verify-bar > i { color: var(--accent); font-size: 18px; }
@media (max-width: 640px) { .verify-bar { padding: 12px 16px; } }

/* Native connection setup: scoped to this page, using the existing TandemX palette. */
.native-connect-page { max-width: 1120px; }
.native-connect-heading { max-width: 760px; margin-bottom: 30px; display: grid; gap: 16px; }
.native-connect-heading > a { justify-self: start; font-size: 13px; }
.native-connect-heading h1 { font-size: clamp(32px, 3.6vw, 48px); letter-spacing: -.035em; }
.native-connect-heading h1 span { color: var(--accent); }
.native-connect-heading > p { color: var(--muted); font-size: 16px; }
.native-connect-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: 24px; align-items: start; }
.native-connect-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--tx-radius-box); padding: 30px; box-shadow: var(--shadow-sm); display: grid; gap: 20px; min-width: 0; }
.native-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.native-connect-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--accent); background: var(--accent-soft); border-radius: var(--tx-radius-box); font-size: 25px; }
.native-connect-card h2, .native-synthetic-card h2 { font-size: 27px; }
.native-intro { color: var(--muted); margin-top: -8px; }
.native-connect-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.native-connect-steps li { display: flex; gap: 13px; align-items: flex-start; }
.native-connect-steps li > span { flex-shrink: 0; width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent); }
.native-connect-steps strong { font-size: 14px; }
.native-connect-steps p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.native-main-action { width: 100%; height: auto; min-height: 46px; padding: 12px 16px; white-space: normal; text-align: center; }
.native-pairing { padding: 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--tx-radius-box); display: grid; gap: 12px; }
.native-pairing-heading { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; font-size: 13px; }
.native-pairing-heading span, .native-pairing > p { font-size: 12px; color: var(--muted); }
.native-code { font: 700 clamp(24px, 3vw, 32px) var(--mono); letter-spacing: 3px; padding: 9px 0; }
.native-cancel { justify-self: center; font-size: 12px; padding: 5px; }
.native-scope { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 6px; font-size: 13px; }
.native-scope p, .native-scope small { color: var(--muted); }
.native-scope small { font-size: 12px; }
.native-synthetic-card { border-radius: var(--tx-radius-box); padding: 30px; display: grid; gap: 22px; color: white; background: radial-gradient(400px 220px at 90% 0%,rgba(43,89,255,.55),transparent),var(--text); }
.native-synthetic-card .chip { justify-self: start; background: rgba(255,255,255,.12); color: white; }
.native-synthetic-card > p { color: #c7cbd9; font-size: 14px; }
.native-synthetic-card > small { font-size: 12px; color: #b3b9cc; }
.native-synthetic-preview { border: 1px solid #353b54; border-radius: var(--tx-radius-box); padding: 20px; display: grid; gap: 10px; }
.native-synthetic-preview strong { color: var(--lime); font-size: 21px; }
.native-synthetic-preview span { color: #c7cbd9; font-size: 12px; }
.native-status { padding: 14px; border-radius: var(--tx-radius-box); background: var(--accent-soft); font-size: 13px; }
.native-error { padding: 14px; border-radius: var(--tx-radius-box); background: var(--bad-soft); color: var(--bad); font-size: 13px; }
.native-saved-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.native-results { margin-top: 24px; }
.native-results small { color: var(--muted); overflow-wrap: anywhere; }
.native-table-wrap { overflow-x: auto; }
.native-results table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.native-results th, .native-results td { padding: 12px; border-bottom: 1px solid var(--line); }
.native-results th { color: var(--muted); font-weight: 500; }
@media(max-width:760px) { .native-connect-grid { grid-template-columns: minmax(0,1fr); } .native-connect-card, .native-synthetic-card { padding: 22px; } .native-connect-page { padding: 28px 18px 70px; } }

/* Shared intelligence workspace and sales-led plans. */
.intelligence-page { max-width: 1440px; }
.intelligence-page .view-toggle { margin: 22px 0; }
.intel-account-strip, .intel-section-head, .intel-start-footer, .intel-hub-link { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.intel-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:12px; }
.intel-account-strip .intel-actions { margin-top:0; }
.intel-scenarios { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:22px 0; }
.intel-scenario { border:1px solid var(--line); background:var(--surface); border-radius:var(--radius); text-align:left; padding:24px; cursor:pointer; display:grid; gap:14px; }
.intel-scenario.selected { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
.intel-scenario p { color:var(--muted); }
.intel-start { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.intel-notes,.intel-start-footer { grid-column:1/-1; }
.intel-start-footer p { max-width:760px; font-size:13px; }
.intel-workspace { display:grid; grid-template-columns:280px minmax(0,1fr); gap:24px; margin-top:24px; align-items:start; }
.intel-detail { display:grid; gap:18px; min-width:0; }
.intel-detail .panel { display:grid; gap:14px; }
.intel-case-link { display:grid; gap:6px; background:transparent; border:1px solid var(--line); border-radius:var(--tx-radius-box); width:100%; text-align:left; margin-top:14px; padding:16px; cursor:pointer; }
.intel-case-link.selected { background:var(--accent-soft); border-color:var(--accent); }
.intel-case-link span,.intel-case-link small { color:var(--muted); font-size:12px; }
.intel-assessments { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.intel-assessments h3 { font-family:var(--font); font-size:16px; line-height:1.6; font-weight:550; letter-spacing:normal; }
.intel-model { font-size:12px; overflow-wrap:anywhere; }
.intel-alert { padding:16px; background:var(--warn-soft); border-radius:var(--tx-radius-box); margin:16px 0; }
.intel-evidence,.intel-history { border-top:1px solid var(--line); padding:14px 0; }
.intel-evidence summary,.intel-revise summary { cursor:pointer; }
.intel-evidence p { margin:12px 0; white-space:pre-wrap; }
.intel-revise > * { margin-top:14px; }
.intel-revise label { display:block; }
.intel-dependencies { font-size:12px; overflow-wrap:anywhere; padding-top:14px; }
.intel-hub-link { text-decoration:none; margin-bottom:24px; }
.intel-hub-link p { margin-top:10px; color:var(--muted); }
.budget { text-decoration:none; }
@media(max-width:1100px) { .intel-scenarios { grid-template-columns:1fr; }.intel-start { grid-template-columns:repeat(2,minmax(0,1fr)); }.top-right { gap:6px; }.topbar { padding:0 16px;gap:12px; }.crumbs { display:none; } }
@media(max-width:760px) { .intel-workspace,.intel-assessments { grid-template-columns:1fr; }.intel-start { grid-template-columns:1fr; }.intel-account-strip,.intel-start-footer,.intel-hub-link { flex-direction:column;align-items:flex-start; }.top-right .avatar { display:none; }.intel-section-head { align-items:flex-start; }.intel-detail h2 { font-size:24px; } }

.intelligence-page .panel:not(.intel-account-strip):not(.intel-start) { display:grid; gap:16px; }

/* Native finished-product evidence preview. */
.native-product-id{display:block;margin-top:6px;color:var(--muted,var(--muted));font-size:12px;overflow-wrap:anywhere;max-width:260px}
.native-product-state{display:inline-block;padding:5px 8px;border-radius:var(--tx-radius-sm);font-size:12px;font-weight:600}
.native-product-good{background:var(--ok-soft);color:var(--ok)}.native-product-review{background:var(--amber-soft);color:var(--amber)}
.native-results td{vertical-align:top}.native-results th{white-space:nowrap}.native-results .native-table-wrap{overflow-x:auto}

.exploration-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:20px 0}.exploration-branch{border:1px solid var(--line,#ddd);border-radius:var(--tx-radius-box);padding:20px;background:var(--surface,var(--surface))}.exploration-branch p{line-height:1.6}.exploration-branch details{margin-top:14px}.native-agent-page .panel{margin-bottom:20px}@media(max-width:900px){.exploration-grid{grid-template-columns:1fr}}

/* Native snapshot scenarios use the existing connection-card design. */
.native-scenario-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:20px 0}.native-scenario-field{display:grid;gap:8px;font-size:14px;font-weight:600}.native-scenario-field input,.native-scenario-field select{width:100%;min-width:0;padding:12px;border:1px solid var(--line-2);border-radius:var(--tx-radius-box);background:var(--surface);color:var(--text);font:inherit}.native-scenario-check{display:flex;gap:12px;align-items:flex-start;margin:24px 0;line-height:1.6}.native-scenario-check input{margin-top:6px}.native-handoffs{padding-left:24px}.native-handoffs li{padding:10px 0}.native-handoffs p{margin:6px 0;color:var(--muted)}.native-artifacts{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--surface-2);padding:20px;border-radius:var(--tx-radius-box);font-size:13px}@media(max-width:640px){.native-scenario-grid{grid-template-columns:1fr}}

/* A business story first; evidence and the manual walkthrough stay inspectable. */
.story-conclusion{padding:28px;border:1px solid var(--line);border-radius:var(--tx-radius-box);background:var(--surface);display:grid;gap:14px}.story-conclusion h2{font-size:clamp(24px,3vw,34px)}.story-conclusion p{max-width:85ch;line-height:1.65;color:var(--muted)}.story-next{padding:14px 18px;background:var(--accent-soft);border-radius:var(--tx-radius-box);color:var(--text)!important}.story-process{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;list-style:none;padding:24px 0;margin:0 0 12px;counter-reset:story}.story-process li{display:grid;gap:6px;border-top:2px solid var(--accent);padding-top:12px;counter-increment:story;font-size:14px}.story-process b:before{content:counter(story) '. ';color:var(--accent)}.story-process span{color:var(--muted);font-size:12px}.exploration-choice{text-align:left;padding:22px;border:1px solid var(--line);border-radius:var(--tx-radius-box);background:var(--surface);display:flex;flex-direction:column;gap:12px;cursor:pointer;min-width:0}.exploration-choice.selected{border:2px solid var(--accent);padding:21px;background:linear-gradient(145deg,var(--surface),var(--accent-soft))}.exploration-choice h3{font-size:20px}.exploration-choice p{font-size:14px;line-height:1.5;color:var(--muted)}.story-metric{font-family:var(--display);font-size:24px;letter-spacing:-.03em}.story-open{font-size:13px;font-weight:650;color:var(--accent);margin-top:auto}.story-timing{color:var(--text)!important}.story-analysis{padding:26px;background:var(--surface);border:1px solid var(--line);border-radius:var(--tx-radius-box);display:grid;gap:14px;overflow-wrap:anywhere}.story-analysis>p{max-width:90ch;line-height:1.7}.story-analysis details{border-top:1px solid var(--line);padding-top:12px}.story-analysis details p{margin-top:12px;color:var(--muted);line-height:1.6}.story-analysis summary,.story-setup>summary,.story-walkthrough>summary{cursor:pointer;font-weight:650}.story-handoffs{padding-left:24px;line-height:1.6}.story-handoffs li{padding:12px 0 12px 8px;border-bottom:1px solid var(--line)}.story-handoffs p{color:var(--muted);margin-top:6px}.story-boundary{font-size:12px;color:var(--muted);margin:14px 0 24px}.story-source{display:flex;flex-wrap:wrap;gap:12px 24px;align-items:center;padding:18px 0 24px}.story-source>span{font-size:13px;color:var(--muted);margin-left:auto}.story-source details{width:100%;font-size:13px;color:var(--muted)}.story-source details p{padding-top:10px}.story-demo-next{margin:24px 0;padding:28px;background:var(--surface);border:1px solid var(--line);border-radius:var(--tx-radius-box);display:flex;align-items:center;flex-wrap:wrap;gap:18px}.story-demo-next>div{flex:1;min-width:240px;display:grid;gap:12px}.story-demo-next p{line-height:1.6;color:var(--muted);max-width:75ch}.story-demo-next small{color:var(--muted);font-size:12px;line-height:1.6}.story-loading{padding:24px;margin:24px 0;border-radius:var(--tx-radius-box);background:var(--accent-soft);display:grid;gap:12px}.story-loading p{color:var(--muted)}.story-setup,.story-walkthrough{margin-top:24px}.story-setup>p,.story-walkthrough>p{margin:18px 0;color:var(--muted)}.story-setup form{margin-top:24px}.story-walkthrough table{width:100%;border-collapse:collapse;text-align:left;font-size:13px}.story-walkthrough th,.story-walkthrough td{padding:12px;border-bottom:1px solid var(--line)}.story-walkthrough .native-table-wrap{overflow-x:auto}
@media(max-width:900px){.story-process{grid-template-columns:repeat(2,minmax(0,1fr))}.exploration-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.exploration-choice{padding:16px}.exploration-choice.selected{padding:15px}.exploration-choice h3{font-size:17px}.story-metric{font-size:20px}}
@media(max-width:640px){.exploration-grid{grid-template-columns:1fr;gap:10px}.exploration-choice{display:grid;grid-template-columns:1fr auto;gap:8px 14px}.exploration-choice .kicker,.exploration-choice h3,.exploration-choice p{grid-column:1}.exploration-choice .story-metric{grid-column:2;grid-row:2;font-size:18px;max-width:140px;text-align:right}.exploration-choice .story-open{grid-column:2;grid-row:3;align-self:end;text-align:right}.story-conclusion,.story-analysis,.story-demo-next{padding:20px}.story-demo-next .btn{white-space:normal;height:auto;min-height:44px}.story-source>span{margin-left:0}.story-process{gap:12px}.story-process li{font-size:12px}}
.native-agent-page .page-head{margin-bottom:20px}.native-agent-page .page-head h1{font-size:clamp(28px,4vw,44px)}.native-agent-page .page-head>p{font-size:15px}.story-source{padding-top:10px;padding-bottom:16px}.story-effects{margin:0;padding-left:24px;display:grid;gap:12px;line-height:1.65}.story-effects li::marker{color:var(--accent);font-weight:700}
.hub-settings { margin-top: 32px; }
.hub-settings > summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 12px; }

.business-review-page{max-width:1180px}.business-access,.business-review-actions{display:flex;gap:24px;align-items:center;justify-content:space-between;margin:24px 0}.business-access{padding:28px;background:var(--surface);border:1px solid var(--line);border-radius:var(--tx-radius-box)}.business-access h2{font-size:22px;margin:0 0 10px}.business-access p{margin:0;color:var(--muted)}.business-review-actions span{color:var(--muted);font-size:14px}.business-findings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin:20px 0 36px}.business-finding{background:var(--surface);border:1px solid var(--line);border-radius:var(--tx-radius-box);padding:28px}.business-finding h3{font-size:23px;line-height:1.3;margin:0 0 20px}.business-finding p{line-height:1.65;color:var(--muted)}.business-finding details{margin-top:24px}.business-evidence{margin-top:30px}.business-evidence details{margin:16px 0}.business-review-page summary{cursor:pointer}.business-review-page section>h2{margin-top:38px}@media(max-width:900px){.business-findings{grid-template-columns:1fr}.business-access,.business-review-actions{align-items:stretch;flex-direction:column}}
.setup-optional > summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.setup-optional > .form-grid { margin-top: 14px; padding: 0; box-shadow: none; border: 0; background: none; }
.research-facts { margin-top: 12px; font-size: 13.5px; }
.research-facts > summary { cursor: pointer; color: var(--muted); }
.research-facts ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.research-found { display: grid; gap: 8px; width: 100%; max-width: 440px; min-height: 120px; align-content: start; }
.research-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--tx-radius-box); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; animation: slidein 0.5s var(--spring) both; }
.research-card i { color: var(--accent); margin-top: 2px; }
.research-card.fact i.ph-lightbulb { color: var(--muted); }
.research-card div { display: grid; gap: 2px; min-width: 0; }
.research-card b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.research-card span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .research-gate .boot-stage { min-height: 0; gap: 18px; } .research-gate .research-found { display: none; } }
.research-gate .boot-stage { gap: 44px; }

/* Business findings lead the connected home; run investigations stay alongside results. */
.business-review-embedded{max-width:none;margin-bottom:36px}.company-agent-heading{margin-top:36px}.company-agent-heading h2{font-size:30px}.flow-intelligence h3{margin:0 0 8px;font-size:18px}.flow-intelligence p{margin:0;line-height:1.6}.flow-intelligence details{margin-top:8px}.flow-intelligence summary{cursor:pointer;font-weight:600}.flow-evidence{display:grid;gap:12px;margin-top:16px}.flow-evidence h4{margin:12px 0 0}.flow-intelligence .exploration-results{margin-top:16px}

/* Native operational work stays within the company/agent journey. */
.operational-page{max-width:1200px}.operational-scope{display:grid;gap:8px;padding:20px 24px;background:var(--accent-soft);border:1px solid var(--line-2);border-radius:var(--tx-radius-box);margin-bottom:24px}.operational-scope span,.operational-start span{color:var(--muted);font-size:14px}.operational-inputs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:16px 0}.operational-inputs label{display:grid;gap:8px;font-weight:600;font-size:14px}.operational-inputs input,.operational-inputs select{width:100%;min-width:0;padding:14px;border:1px solid var(--line-2);border-radius:var(--tx-radius-box);background:var(--surface);color:inherit;font:inherit}.operational-preset{max-width:76ch;line-height:1.65}.operational-start{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-top:24px}.operational-settings{padding:16px 0}.operational-page summary{cursor:pointer;color:var(--accent);font-weight:600}.operational-page .panel{margin:24px 0}.operational-page .panel-b{padding:28px}.operational-finding h2{font-size:27px;line-height:1.3}.operational-finding p{line-height:1.65}.operational-alternatives{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:26px 0}.operational-alternative{text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:var(--tx-radius-box);padding:22px;cursor:pointer;color:inherit;font:inherit;display:grid;align-content:start;gap:12px}.operational-alternative.selected{border:2px solid var(--accent);padding:21px;background:var(--accent-soft)}.operational-alternative h3,.operational-alternative p{margin:0}.operational-alternative>span:not(.kicker){font-size:13px;color:var(--muted)}.operational-alternative>b{font-size:13px}.operational-timeline{list-style:none;margin:24px 0;padding:0;display:grid;gap:16px}.operational-timeline>li{border-left:3px solid #bad1c4;padding:12px 0 12px 20px}.operational-timeline>li.held{border-color:#d69b3e}.operational-timeline>li>div{display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap}.operational-timeline span{font-size:13px;color:var(--muted)}.operational-timeline p{line-height:1.6;max-width:90ch}.operational-page pre{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--surface-2);padding:18px;border-radius:var(--tx-radius-box);font-size:12px;max-height:420px;overflow:auto}.operational-custom{padding:18px;background:var(--surface-2);border-radius:var(--tx-radius-box)}.operational-custom ol{display:flex;flex-wrap:wrap;gap:12px 30px;padding-left:22px}.operational-evidence,.operational-history{border-top:1px solid var(--line);padding-top:20px}.operational-change h3{margin-top:0}.operational-change .btn{margin:16px 0}.operational-finding article{border-top:1px solid var(--line);padding-top:16px;margin-top:16px}
@media(max-width:760px){.operational-inputs,.operational-alternatives{grid-template-columns:1fr}.operational-page .panel-b{padding:20px}.operational-finding h2{font-size:23px}.operational-start .btn{width:100%}.operational-custom ol{display:block}.operational-custom li{margin:10px 0}}
.operational-process-name{display:block;width:100%;margin:12px 0 18px;padding:12px;border:1px solid var(--line-2);border-radius:var(--tx-radius-sm);font:inherit}

/* ---------- launch fixes: dialogs, ended runs, phone fit, floating controls ---------- */
/* A chip that carries a whole sentence wraps instead of widening the page. */
.chip-wrap { white-space: normal; height: auto; min-height: 26px; max-width: 100%; padding: 4px 10px; line-height: 1.35; border-radius: var(--tx-radius-box); }
.notice { padding: 12px 14px; border-radius: var(--tx-radius-box); background: var(--accent-soft); color: var(--text); font-size: 13.5px; font-weight: 500; }
.login-link { justify-self: start; text-align: left; font-size: 13.5px; line-height: 1.4; }
.login-link-box { margin-top: 14px; gap: 12px; }
.login-link-form { display: grid; gap: 12px; }
/* A run the server stopped: neutral, with a way to start again. */
.result-banner.ended { background: var(--surface-2); color: var(--text); }
.share-url { user-select: all; }
.share-url span { user-select: none; font-family: var(--font); }

/* Shared replay: the controls wrap under the title instead of running off a narrow screen. */
.replay-bar { flex-wrap: wrap; }
.rp-badge { flex: 1 1 100%; white-space: normal; min-width: 0; }
.rp-track { flex: 1 1 60px; min-width: 60px; }
.rp-cta { flex: 1 1 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; margin-top: 2px; border-radius: var(--tx-radius-box); background: var(--lime); color: var(--lime-ink); font-weight: 700; font-size: 13.5px; text-decoration: none; }
.rp-cta:hover { filter: brightness(0.96); }

/* The mascot's antenna floats up into whatever sits above it: keep the Undo button clear and on top. */
.undo-chip { position: relative; z-index: 2; margin-bottom: 30px; }

/* Designer: nothing in the panel is wider than the panel, so it never moves sideways. The describe card
   clips its own decoration, the flowchart scrolls in its own box, and playbook lines shrink to fit. */
.describe { overflow: clip; }
.describe-foot button { max-width: 100%; text-align: left; white-space: normal; }
.flow-scroll { max-width: 100%; overflow-x: auto; }
.pb-line { grid-template-columns: 26px minmax(0, 1fr) auto; }
.pb-trigger, .pb-aut { max-width: 100%; }
.pb-add { max-width: calc(100% - 34px); }

/* Chief of Staff: a long option label wraps inside its card instead of widening the column. */
.cos-cols > section { min-width: 0; }
.cos-opts .btn { height: auto; min-height: 34px; padding-top: 6px; padding-bottom: 6px; white-space: normal; text-align: left; border-radius: var(--tx-radius-box); }

/* Setting a password: a notice on the first page after an emailed sign-in link, and on Plan & credits. */
.pw-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; max-width: 640px; }
.pw-form .field { flex: 1 1 200px; }
.pw-form .btn { height: 46px; }
.pw-form .error, .pw-saved { flex: 1 1 100%; }
.pw-saved { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--ok); }
.pw-notice { position: relative; display: grid; gap: 12px; padding: 16px 48px 16px 16px; margin-bottom: 20px; }
.pw-notice > .tips-nav { position: absolute; top: 12px; right: 12px; }
.pw-notice p { display: flex; align-items: center; gap: 6px; }

/* Feedback and the data settings are part of the page, never floating over it: Feedback is an icon in
   the header, the data settings a link in the footer. The full-height run and designer screens have no
   room for a footer on a wide screen, so there the settings are an icon in the header too. */
.shell { grid-template-rows: 68px 1fr auto; }
.tb-icon { flex: none; width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text); font-size: 16px; cursor: pointer; }
.tb-icon:hover { color: var(--accent); }
.ds-icon { display: none; }
.page-foot, .foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding: 0 16px 14px; }
.foot-links { margin-top: 18px; }
.foot-link { padding: 8px 4px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.foot-link:hover { color: var(--accent); text-decoration: underline; }
@media (min-width: 1101px) {
  .shell.tall .page-foot { display: none; }
  .shell.tall .ds-icon { display: inline-grid; }
}
/* Room for the Feedback icon up to 760 px: "Sign out" and "Chief of Staff" are icons there, as on a phone,
   with the count of waiting decisions on the corner of its icon. */
.nav-inbox { white-space: nowrap; }
@media (max-width: 760px) {
  .nav-signout span { display: none; }
  .nav-signout i { display: inline; }
  .nav-inbox { position: relative; font-size: 0; gap: 0; padding: 8px 10px; }
  .nav-inbox i { font-size: 17px; }
  .nav-inbox .count { position: absolute; top: -5px; right: -6px; margin: 0; font-size: 11px; }
}

/* First visit: the data box is a short bar on a phone, so the sign-in form stays in view. "Options" opens it. */
.ds-details { display: block; }
@media (max-width: 640px) {
  .data-settings-panel:not(.expanded) { left: 8px; bottom: 8px; width: calc(100vw - 16px); padding: 10px 12px; }
  .data-settings-panel:not(.expanded) > p { margin: 2px 0 8px; }
  .data-settings-panel:not(.expanded) .ds-details, .data-settings-panel:not(.expanded) .ds-save { display: none; }
  .data-settings-panel:not(.expanded) .ds-more { display: inline-flex; }
  /* The sign-in form starts on the first screen: a shorter hero, no ticker. */
  .login-art { min-height: 0; margin: 10px; padding: 20px; gap: 14px; border-radius: var(--tx-radius-box); }
  .login-art .ticker { display: none; }
  .login-art h1 { font-size: 30px; max-width: none; }
  .login-art p { font-size: 14.5px; margin-top: 10px; }
  .login-form { padding: 22px 20px 140px; }
  .login-card h2 { font-size: 26px; }
  /* Header: the credits pill stays, as a number. */
  .topbar { gap: 8px; padding: 0 10px; }
  .top-right { gap: 6px; }
  .budget { gap: 5px; padding: 6px 10px; }
  .budget-word { display: none; }
  .tb-icon { width: 32px; height: 32px; }
}
/* Short phone screens: the hero gives way, so the whole sign-in form shows above the data bar. */
@media (max-width: 640px) and (max-height: 740px) {
  .login-art { padding: 16px 18px; }
  .login-art p { display: none; }
  .login-form { padding-top: 14px; }
  .data-settings-panel:not(.expanded) > b { display: none; }
  .data-settings-panel:not(.expanded) > p { margin-top: 0; }
}
@media (max-width: 640px) and (max-height: 620px) {
  .login-art { gap: 0; }
  .login-art h1 { display: none; }
}
@media (max-width: 374px) {
  .sales-btn { font-size: 0; gap: 0; }
  .sales-btn i { font-size: 15px; }
}
/* iPhone Safari zooms the page when a focused field is under 16px. */
@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select:not(.pb-trigger) { font-size: 16px !important; }
}

.brain-workspace{max-width:1200px;margin:auto}.brain-panel{border:1px solid #d8dde6;border-radius:var(--tx-radius-box);padding:24px;margin:24px 0}.brain-panel label{display:block;margin:12px 0}.brain-panel input:not([type=checkbox]),.brain-panel textarea,.brain-panel select{display:block;width:100%;max-width:720px;padding:10px;margin-top:6px}.brain-panel button{margin:8px 8px 8px 0;padding:10px 14px}.brain-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px;margin-top:16px}.brain-card{border:1px solid #d8dde6;border-radius:var(--tx-radius-sm);padding:16px;min-width:0}.brain-scroll{overflow:auto}.brain-panel pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:400px;overflow:auto}.brain-panel table{font-size:12px;border-collapse:collapse}.brain-panel td,.brain-panel th{padding:8px;border-bottom:1px solid #ddd;text-align:left;max-width:220px;overflow-wrap:anywhere}.brain-error{color:#a32020}

.brain-panel p{line-height:1.6;overflow-wrap:anywhere;margin:10px 0}.brain-panel h3{margin-top:16px}.brain-panel button{border:1px solid #d2d6df;border-radius:var(--tx-radius-sm);background:var(--surface);font-weight:600;cursor:pointer}.brain-panel button:disabled{opacity:.5;cursor:default}.brain-panel input:not([type=checkbox]),.brain-panel textarea,.brain-panel select{border:1px solid #cfd5df;border-radius:var(--tx-radius-sm);background:var(--surface);font:inherit}.brain-card small{display:block;line-height:1.5;color:#606c80}.brain-panel details{margin:12px 0}

/* Feedback is a labelled top-bar pill like the other actions; a <button> drops its native border. */
.nav-feedback { border: 0; cursor: pointer; font-family: inherit; }
