/* =========================================================================
   INSTAFLO — Calm (full-app)
   One clear action per screen. Warm paper + ink. Single lime accent.
   Hairline borders. Soft elevation. No hard shadows, no violet.
   ========================================================================= */

/* TOKENS ----------------------------------------------------------------- */
:root {
  --accent:       oklch(0.86 0.16 126);
  --accent-hover: oklch(0.82 0.16 126);
  --accent-press: oklch(0.78 0.16 126);
  --accent-soft:  oklch(0.95 0.06 126);
  --on-accent:    oklch(0.24 0.012 80);

  /* tertiary (violet) — part of the palette, reserved for a single future
     meaning (new people / lead capture). Not applied on any screen yet;
     lime stays the one working accent. */
  --tertiary:      oklch(0.53 0.23 286);
  --tertiary-soft: oklch(0.95 0.04 286);
  --tertiary-mellow: oklch(0.64 0.12 286);   /* softened, muted purple */
  --on-tertiary:   oklch(0.99 0 0);

  --paper:   oklch(0.982 0.004 95);
  --surface: oklch(1 0 0);
  --sunken:  oklch(0.965 0.004 95);
  --raised:  oklch(0.993 0.003 95);

  --ink:   oklch(0.26 0.010 80);
  --ink-2: oklch(0.46 0.008 80);
  --ink-3: oklch(0.62 0.006 80);
  --ink-4: oklch(0.78 0.004 80);

  --line:   oklch(0.912 0.004 90);
  --line-2: oklch(0.950 0.003 90);

  --up:        oklch(0.54 0.13 155);
  --up-soft:   oklch(0.95 0.05 155);
  --dn:        oklch(0.54 0.14 28);
  --dn-soft:   oklch(0.96 0.04 28);
  --warn:      oklch(0.64 0.12 78);
  --warn-soft: oklch(0.96 0.05 78);

  --shadow-xs: 0 1px 2px oklch(0.26 0.01 80 / 0.04);
  --shadow-sm: 0 1px 3px oklch(0.26 0.01 80 / 0.05), 0 2px 6px oklch(0.26 0.01 80 / 0.04);
  --shadow-md: 0 2px 8px oklch(0.26 0.01 80 / 0.07), 0 6px 20px oklch(0.26 0.01 80 / 0.05);
  --shadow-lg: 0 4px 14px oklch(0.26 0.01 80 / 0.08), 0 14px 36px oklch(0.26 0.01 80 / 0.07);

  --r-xs:   5px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-xl:   26px;
  --r-pill: 999px;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-sans:    "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, Menlo, monospace;
}

[data-theme="dark"] {
  --accent:       oklch(0.86 0.16 126);
  --accent-hover: oklch(0.90 0.15 126);
  --accent-press: oklch(0.80 0.16 126);
  --accent-soft:  oklch(0.33 0.08 126);
  --on-accent:    oklch(0.20 0.012 80);

  --tertiary:      oklch(0.72 0.17 286);
  --tertiary-soft: oklch(0.33 0.09 286);
  --tertiary-mellow: oklch(0.68 0.13 286);
  --on-tertiary:   oklch(0.99 0 0);

  --paper:   oklch(0.200 0.006 80);
  --surface: oklch(0.245 0.007 80);
  --sunken:  oklch(0.222 0.006 80);
  --raised:  oklch(0.278 0.007 80);

  --ink:   oklch(0.950 0.005 90);
  --ink-2: oklch(0.740 0.006 85);
  --ink-3: oklch(0.600 0.006 80);
  --ink-4: oklch(0.460 0.006 80);

  --line:   oklch(0.320 0.006 80);
  --line-2: oklch(0.290 0.006 80);

  --up-soft:   oklch(0.32 0.05 155);
  --dn-soft:   oklch(0.32 0.04 28);
  --warn-soft: oklch(0.32 0.05 78);

  --shadow-xs: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.35), 0 2px 6px oklch(0 0 0 / 0.28);
  --shadow-md: 0 2px 8px oklch(0 0 0 / 0.42), 0 8px 22px oklch(0 0 0 / 0.38);
  --shadow-lg: 0 4px 14px oklch(0 0 0 / 0.48), 0 16px 40px oklch(0 0 0 / 0.52);
}

/* BASE ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; color: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; cursor: pointer; }
::selection { background: var(--accent); color: var(--on-accent); }
#root { height: 100%; }

/* TYPE HELPERS ----------------------------------------------------------- */
.sys  { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }

/* =========================================================================
   SHELL
   ========================================================================= */
.shell { display: grid; grid-template-columns: 252px 1fr; height: 100%; }

/* SIDEBAR ---------------------------------------------------------------- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  gap: 2px;
  height: 100%;
  overflow: hidden;
}
.side-scroll { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.sidebar .brand { padding-bottom: 20px; }
.brand img { width: 30px; height: 30px; flex: none; }
.brand .word { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -.03em; }
.brand .word .o { color: var(--accent); }

.nav-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .10em; text-transform: uppercase; color: var(--ink-4);
  padding: 14px 12px 5px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 14.5px;
  position: relative; transition: background .14s, color .14s;
}
.nav-item i { font-size: 20px; color: var(--ink-3); transition: color .14s; flex: none; }
.nav-item:hover { background: var(--sunken); color: var(--ink); }
.nav-item:hover i { color: var(--ink-2); }
.nav-item.active { background: var(--sunken); color: var(--ink); font-weight: 600; }
.nav-item.active i { color: var(--ink); }
.nav-item.active::before {
  content: "";
  position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-item .count {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  color: var(--ink-3); background: var(--sunken); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: var(--r-pill);
}
.nav-item.active .count { background: var(--raised); border-color: var(--line); }

.side-foot { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; flex: none; }

.theme-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); width: 100%; text-align: left;
  font-size: 14.5px; font-weight: 500;
  transition: background .14s, color .14s;
}
.theme-toggle i { font-size: 20px; color: var(--ink-3); flex: none; }
.theme-toggle:hover { background: var(--sunken); color: var(--ink); }

.acct {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; width: 100%; text-align: left;
  border-radius: var(--r-md); cursor: pointer;
  transition: background .14s;
  border-top: 1px solid var(--line);
}
.acct:hover { background: var(--sunken); }
.acct .meta { min-width: 0; flex: 1; line-height: 1.25; }
.acct .meta .h { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct .meta .s { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.acct-caret { transition: transform .14s; }

/* account switcher popover */
.acct-switcher { position: relative; margin-top: 6px; }
.acct-popover {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 50;
  animation: modalIn .16s ease both;
}
.ap-label { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-4); padding: 6px 10px 4px; }
.ap-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: var(--r-md); cursor: pointer;
  transition: background .12s; text-align: left;
}
.ap-row:hover { background: var(--sunken); }
.ap-row.on { background: var(--accent-soft); }
.ap-av {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ap-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ap-handle { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-meta { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.ap-check { font-size: 16px; color: var(--accent); flex: none; }
.ap-dot { width: 16px; height: 16px; flex: none; display: flex; align-items: center; justify-content: center; }
.ap-dot span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); display: block; }
.ap-div { height: 1px; background: var(--line-2); margin: 5px 4px; }
.ap-add {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border-radius: var(--r-md); cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: background .12s, color .12s;
}
.ap-add:hover { background: var(--sunken); color: var(--ink); }
.ap-add i { font-size: 16px; color: var(--accent); }

/* TOPBAR ----------------------------------------------------------------- */
.main { display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
.topbar {
  flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  z-index: 5;
}
.topbar .titles h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: -.022em; line-height: 1.1;
}
.topbar .titles .sub { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.topbar .spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 8px 14px; width: 230px;
  transition: border-color .14s, box-shadow .14s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search i { font-size: 15px; color: var(--ink-3); flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13.5px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }

.iconbtn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); display: flex; align-items: center; justify-content: center;
  flex: none; position: relative; transition: background .14s, color .14s;
}
.iconbtn:hover { background: var(--sunken); color: var(--ink); }
.iconbtn i { font-size: 17px; }
.iconbtn .ndot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--tertiary); border: 1.5px solid var(--surface);
}

.topbar-divider { width: 1px; height: 22px; background: var(--line); flex: none; }

/* home header status pill */
.hdr-status {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap;
  padding: 7px 14px 7px 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.hdr-status .hs-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--accent-press);
  animation: stbeat 1.8s ease-in-out infinite;
}

/* analytics period picker */
.period-picker { position: relative; }
.period-picker .btn.on { border-color: var(--ink-4); background: var(--sunken); }
.period-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  min-width: 168px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 1px;
  animation: pm-in .13s ease;
}
@keyframes pm-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.period-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 11px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--ink-2); text-align: left; width: 100%;
  transition: background .12s, color .12s;
}
.period-item:hover { background: var(--sunken); color: var(--ink); }
.period-item.on { color: var(--ink); font-weight: 600; }
.period-item.on i { color: var(--accent); }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  font-family: var(--font-sans); font-weight: 600; font-size: 14px;
  padding: 9px 17px; border-radius: var(--r-pill);
  border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap; cursor: pointer;
  transition: background .14s, border-color .14s, transform .1s, box-shadow .14s;
}
.btn i { font-size: 16px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); box-shadow: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--sunken); border-color: var(--ink-4); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }
.btn-danger { background: transparent; color: var(--dn); }
.btn-danger:hover { background: var(--dn-soft); }
.btn-sm { font-size: 13px; padding: 7px 13px; }
.btn-sm i { font-size: 14px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.btn:disabled { background: var(--sunken) !important; color: var(--ink-4) !important; border-color: transparent !important; cursor: not-allowed; box-shadow: none !important; pointer-events: none; }

/* =========================================================================
   CARDS
   ========================================================================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

/* =========================================================================
   INPUTS
   ========================================================================= */
.input {
  display: flex; align-items: center; gap: 8px;
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 13px;
  transition: border-color .14s, box-shadow .14s;
}
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.input i { font-size: 16px; color: var(--ink-3); flex: none; }
.input input, .input textarea {
  border: 0; outline: 0; background: transparent;
  font-size: 14px; color: var(--ink); width: 100%; resize: none; line-height: 1.5;
}
.input input::placeholder, .input textarea::placeholder { color: var(--ink-3); }
.input-surface { background: var(--surface); border-color: var(--line); }
.input-surface:focus-within { background: var(--surface); }

/* =========================================================================
   TOGGLE
   ========================================================================= */
.toggle {
  width: 40px; height: 23px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--sunken);
  position: relative; flex: none; cursor: pointer;
  transition: background .16s, border-color .16s;
}
.toggle.on { background: var(--accent); border-color: transparent; }
.toggle .knob {
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-xs);
  transition: left .18s cubic-bezier(.2,.9,.3,1.15);
}
.toggle.on .knob { left: 19px; }

/* =========================================================================
   PILLS + TAGS
   ========================================================================= */
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2); background: var(--accent-soft);
  border-radius: var(--r-pill); padding: 4px 10px; white-space: nowrap;
}
.live-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.live-pill .dot.beat { animation: beat 1.8s infinite; }
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.tag {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--r-xs); padding: 2px 7px; display: inline-block;
}
.draft-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 3px 10px; white-space: nowrap;
}
.paused-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--warn); background: var(--warn-soft);
  border-radius: var(--r-pill); padding: 3px 10px; white-space: nowrap;
}

/* =========================================================================
   AVATAR
   ========================================================================= */
.avatar {
  border-radius: 50%;
  background: var(--sunken); border: 1px solid var(--line);
  color: var(--ink-2); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: var(--font-display); flex: none; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================================
   LAYOUT HELPERS
   ========================================================================= */
.content { flex: 1; overflow-y: auto; padding: 26px 28px 48px; }
.content > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.content-col { display: flex; flex-direction: column; gap: 0; }
.section-head { display: flex; align-items: center; gap: 11px; margin: 0 0 16px; }
.section-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.015em; }
.section-head .spacer { flex: 1; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty-state i { font-size: 34px; margin-bottom: 12px; display: block; }
.empty-state .t { font-weight: 600; color: var(--ink-2); font-size: 15px; }
.empty-state .s { font-size: 13.5px; margin-top: 4px; }

/* =========================================================================
   STAT GRID
   ========================================================================= */
.stat-grid-wrap { margin-bottom: 24px; }
.sg-header { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 6px; }
.sg-period { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); background: var(--sunken); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 4px 10px; }
.sg-period i { color: var(--ink-4); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 0; }
.stat { padding: 18px 20px; }
.stat .s-ico {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--sunken); display: flex; align-items: center; justify-content: center;
  flex: none; margin-bottom: 14px;
}
.stat .s-ico i { font-size: 17px; color: var(--ink-2); }
.stat .s-lbl { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.stat .s-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 30px; letter-spacing: -.025em; line-height: 1; margin: 8px 0 9px;
}
.stat .s-delta { font-family: var(--font-mono); font-size: 11px; display: flex; align-items: center; gap: 4px; }
.stat .s-delta.up { color: var(--up); }
.stat .s-delta.dn { color: var(--dn); }
.stat .s-delta.flat { color: var(--ink-3); }

/* =========================================================================
   AUTO ROWS
   ========================================================================= */
.autos-card { padding: 0; overflow: visible; border-radius: var(--r-lg); }
.autos-card .auto-row:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.autos-card .auto-row:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); border-bottom: 0; }
.auto-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-2);
  transition: background .14s;
}
.auto-row:last-child { border-bottom: 0; }
.auto-row:hover { background: var(--sunken); }
.auto-row .a-ico {
  width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--sunken); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex: none;
  transition: background .14s;
}
.auto-row .a-ico i { font-size: 17px; color: var(--ink-2); }
.auto-row.live .a-ico { background: var(--accent-soft); border-color: transparent; }
.auto-row.live .a-ico i { color: var(--on-accent); }
.auto-row .a-info { min-width: 0; flex: 1; }
.auto-row .a-info .h { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.auto-row .a-info .s { font-size: 13px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.auto-row .a-sent { text-align: right; flex: none; min-width: 48px; }
.auto-row .a-sent .v { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.auto-row .a-sent .k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.rowbtn {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  color: var(--ink-3); display: flex; align-items: center; justify-content: center;
  transition: background .14s, color .14s; flex: none;
}
.rowbtn:hover, .rowbtn.active { background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.rowbtn i { font-size: 15px; }

/* row options menu */
.row-menu-wrap { position: relative; flex: none; }
.row-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 5px; min-width: 160px;
  animation: modalIn .14s ease both;
}
.rm-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); cursor: pointer; transition: background .12s, color .12s; text-align: left;
}
.rm-item i { font-size: 15px; color: var(--ink-3); }
.rm-item:hover { background: var(--sunken); color: var(--ink); }
.rm-item.danger { color: var(--dn); }
.rm-item.danger i { color: var(--dn); }
.rm-item.danger:hover { background: var(--dn-soft, oklch(0.97 0.03 25)); }
.rm-div { height: 1px; background: var(--line-2); margin: 4px 2px; }

/* danger button */
.btn-danger { background: var(--dn, oklch(0.55 0.22 25)); color: #fff; border: none; }
.btn-danger:hover { background: oklch(0.48 0.22 25); }

/* delete confirm modal */
.del-confirm { max-width: 420px; }

/* =========================================================================
   HOME SCREEN
   ========================================================================= */
.greet { margin-bottom: 14px; }
.content.home .greet { margin-bottom: 20px; }
.content.home > .agent-composer,
.content.home > .home-composer-bar { margin-bottom: 30px; }
.content.home > .stat-grid-wrap { margin-bottom: 30px; }
.content.home > .limit-banner { margin-bottom: 22px; }
.greet h2 { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -.025em; line-height: 1.1; }
.greet p { font-size: 15px; color: var(--ink-2); margin-top: 7px; line-height: 1.5; max-width: 64ch; }
.greet p b { color: var(--ink); font-weight: 600; }

.home-split { display: grid; grid-template-columns: 1fr 308px; gap: 20px; align-items: start; }
.home-rail { display: flex; flex-direction: column; gap: 16px; }
.panel { padding: 18px 20px; }
.panel .ph { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.panel .ph h4 { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.panel .ph .sp { flex: 1; }

/* mini chart */
.minichart { display: flex; align-items: flex-end; gap: 6px; height: 106px; margin-top: 14px; overflow: visible; }
.minichart .mc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; position: relative; }
.minichart .mc-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--surface); font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
  padding: 4px 8px; border-radius: var(--r-sm);
  pointer-events: none; opacity: 0; transition: opacity .12s;
  z-index: 10;
}
.minichart .mc-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--ink);
}
.minichart .mc-col:hover .mc-bar { filter: brightness(0.88); }
.minichart .mc-bar:hover .mc-tip { opacity: 1; }
.minichart .mc-bar { width: 100%; max-width: 20px; background: var(--sunken); border: 1px solid var(--line-2); border-radius: 4px 4px 0 0; transition: height .6s cubic-bezier(.2,.8,.2,1); position: relative; }
.minichart .mc-col.peak .mc-bar { background: var(--accent); border-color: transparent; }
.minichart .mc-col .mc-d { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); }
.chart-foot { display: flex; align-items: baseline; gap: 7px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line-2); }
.chart-foot .cf-big { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -.02em; }
.chart-foot .cf-cap { font-size: 12px; color: var(--ink-3); }

/* activity feed */
.feed { display: flex; flex-direction: column; margin-top: 12px; }
.act { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.act:last-child { border-bottom: 0; }
.act .a-ai { width: 26px; height: 26px; border-radius: 50%; background: var(--sunken); flex: none; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.act .a-ai i { font-size: 13px; color: var(--ink-2); }
.act .a-ai.acc { background: var(--accent-soft); }
.act .a-ai.acc i { color: var(--on-accent); }
.act .a-txt { min-width: 0; flex: 1; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.act .a-txt b { color: var(--ink); font-weight: 600; }
.act .a-txt .a-t { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin-top: 2px; }

/* =========================================================================
   AUTOMATIONS SCREEN
   ========================================================================= */
.filter-tabs { display: flex; gap: 3px; background: var(--sunken); border-radius: var(--r-md); padding: 4px; margin-bottom: 16px; width: fit-content; }
.filter-tab {
  font-size: 13.5px; font-weight: 600; padding: 6px 16px;
  border-radius: var(--r-sm); background: transparent; color: var(--ink-2);
  cursor: pointer; transition: background .14s, color .14s; white-space: nowrap;
}
.filter-tab:hover { background: var(--raised); color: var(--ink); }
.filter-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* =========================================================================
   BUILDER
   ========================================================================= */
.builder-shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 420px; overflow: hidden; }
.canvas-area {
  overflow: auto;
  background-color: var(--paper);
  background-image: radial-gradient(oklch(0.905 0.004 90) 1px, transparent 1px);
  background-size: 22px 22px;
}
[data-theme="dark"] .canvas-area {
  background-image: radial-gradient(oklch(0.285 0.006 80) 1px, transparent 1px);
}
.builder-flow { padding: 36px; max-width: 480px; margin: 0 auto; }

.builder-title-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 2px 8px; margin-left: -8px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.builder-title-btn:disabled { cursor: default; }
.builder-title-btn h1 { margin: 0; }
.builder-title-btn:not(:disabled):hover { background: var(--sunken); border-color: var(--line); }
.builder-title-pencil { font-size: 14px; color: var(--ink-3); opacity: 0; transition: opacity .12s; }
.builder-title-btn:hover .builder-title-pencil { opacity: 1; }
.builder-title-input {
  font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--accent); border-radius: var(--r-sm);
  padding: 2px 8px; margin-left: -8px; outline: 0; min-width: 240px; max-width: 460px; width: 100%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.bnode {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: box-shadow .14s, border-color .14s;
  overflow: hidden;
}
.bnode:hover { box-shadow: var(--shadow-md); }
.bnode.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm); }
.bnode .nhead {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.bnode .nhead .ni { width: 30px; height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex: none; }
.bnode .nhead .ni i { font-size: 16px; }
.bnode .nhead .nt { font-weight: 600; font-size: 14px; flex: 1; }
.bnode.trigger .ni { background: var(--accent-soft); }
.bnode.trigger .ni i { color: var(--on-accent); }
.bnode.action .ni { background: var(--sunken); }
.bnode.action .ni i { color: var(--ink-2); }
.bnode.source .ni { background: var(--sunken); }
.bnode.source .ni i { color: var(--ink-2); }

.insp-choice.active { border-color: var(--accent); background: var(--accent-soft); }
.insp-choice.soon { opacity: .75; cursor: not-allowed; background: var(--sunken); }
.insp-choice.soon:hover { background: var(--sunken); }
.insp-choice.locked { cursor: pointer; }
.insp-choice.locked:hover { border-color: var(--accent); }
.pro-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent);
  padding: 2px 7px; border-radius: var(--r-pill);
}
.opt-config { padding: 14px 0 18px 2px; }
.opt-note {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 12px; font-size: 12.5px; color: var(--ink-3); line-height: 1.45;
}
.opt-note i { font-size: 14px; color: var(--ink-4); margin-top: 1px; flex: none; }

.post-chosen { display: flex; align-items: center; gap: 9px; }
.post-chosen .pc-thumb { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.post-chosen .pc-meta { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); margin-top: 2px; font-weight: 400; }

.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.post-cell { text-align: left; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); transition: border-color .14s, box-shadow .14s; }
.post-cell:hover { border-color: var(--accent); box-shadow: var(--shadow-xs); }
.post-cell.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.post-cell .pcell-thumb { display: flex; align-items: center; justify-content: center; height: 100px; font-size: 30px; background: var(--sunken); position: relative; }
.post-cell .pcell-kind { position: absolute; top: 6px; left: 6px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 1px 5px; }
.post-cell .pcell-check { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.post-cell .pcell-check i { font-size: 11px; }
.post-cell .pcell-cap { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-2); padding: 7px 8px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-seeall { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 10px; padding: 9px; border: 1px dashed var(--ink-4); border-radius: var(--r-md); background: var(--sunken); color: var(--ink-2); font-size: 13px; font-weight: 600; transition: background .14s, border-color .14s; }
.post-seeall:hover { background: var(--raised); border-color: var(--ink-3); border-style: solid; }
.post-seeall i { font-size: 15px; }
.post-grid-lg { grid-template-columns: repeat(3, 1fr); gap: 12px; }
.post-grid-lg .pcell-thumb { height: 150px; font-size: 42px; }
.post-grid-lg .pcell-cap { font-size: 12.5px; padding: 9px 10px; }
.bnode.cond .ni { background: var(--warn-soft); }
.bnode.cond .ni i { color: var(--warn); }
.bnode .nbody { padding: 17px 18px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.bnode .nbody b { color: var(--ink); font-weight: 600; }

.connector { width: 1px; height: 24px; background: var(--line); margin: 0 auto; }
.add-step {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px dashed var(--ink-3); background: var(--surface);
  color: var(--ink-3); margin: 0 auto; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
}
.add-step:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--on-accent); border-style: solid; }
.add-step i { font-size: 16px; }

.inspector {
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden; padding: 0;
  display: flex; flex-direction: column; gap: 0;
}
.insp-body { flex: 1; overflow-y: auto; padding: 22px 20px; min-height: 0; display: flex; flex-direction: column; gap: 0; }
.insp-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.insp-h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; margin: 4px 0 0; }

.chip-kw {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-soft); border: 1px solid oklch(0.88 0.09 126);
  border-radius: var(--r-pill); padding: 3px 10px;
  font-size: 12px; font-weight: 600; color: var(--on-accent);
  margin: 0 5px 5px 0;
}
.chip-kw i { font-size: 10px; cursor: pointer; opacity: .7; }
.chip-kw i:hover { opacity: 1; }

.insp-choice {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--surface);
  transition: background .14s, border-color .14s; cursor: pointer;
}
.insp-choice:hover { background: var(--sunken); }
.insp-choice .ic { font-size: 16px; color: var(--ink-2); flex: none; }
.insp-choice .ic-info { flex: 1; }
.insp-choice .ic-info .ct { font-weight: 600; font-size: 13.5px; }
.insp-choice .ic-info .cs { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

.dm-preview {
  background: var(--tertiary-soft); border-radius: var(--r-md);
  padding: 11px 13px; font-size: 13px; color: var(--ink);
  line-height: 1.55;
}
.dm-text { white-space: pre-wrap; }
.dm-links { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.dm-linkbtn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--tertiary-mellow); border: 1px solid var(--tertiary-mellow);
  border-radius: var(--r-sm); padding: 9px 14px;
  font-size: 13px; font-weight: 600; color: var(--on-tertiary);
}

/* =========================================================================
   INBOX
   ========================================================================= */
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: 296px 1fr; overflow: hidden; }
.conv-list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface); display: flex; flex-direction: column; }
.conv-search { padding: 12px 12px 10px; border-bottom: 1px solid var(--line-2); flex: none; }

.conv {
  display: flex; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  transition: background .14s; cursor: pointer; align-items: flex-start;
}
.conv:hover { background: var(--sunken); }
.conv.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.conv .cv-meta { min-width: 0; flex: 1; }
.conv .cv-top { display: flex; align-items: center; gap: 6px; }
.conv .cv-name { font-weight: 600; font-size: 13.5px; }
.conv .cv-time { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.conv .cv-snip { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv .cv-unread { width: 7px; height: 7px; border-radius: 50%; background: var(--tertiary); flex: none; margin-top: 5px; }

.thread { display: flex; flex-direction: column; height: 100%; min-width: 0; overflow: hidden; }
.thread-head { display: flex; align-items: center; gap: 11px; padding: 13px 18px; border-bottom: 1px solid var(--line); flex: none; }
.thread-body { flex: 1; overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; gap: 9px; background: var(--paper); }
.bubble { max-width: 68%; padding: 10px 14px; border-radius: var(--r-lg); font-size: 13.5px; line-height: 1.45; }
.bubble.them { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: var(--r-xs); align-self: flex-start; }
.bubble.me { background: var(--ink); color: var(--paper); border-bottom-right-radius: var(--r-xs); align-self: flex-end; }
.bubble.auto { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: var(--r-xs); align-self: flex-end; }
.bubble-tag { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); align-self: flex-end; margin: -4px 4px 0; display: flex; align-items: center; gap: 4px; }
.thread-compose { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex: none; }

/* =========================================================================
   ANALYTICS
   ========================================================================= */
.chart-big { display: flex; align-items: flex-end; gap: 9px; height: 150px; }
.chart-big .cb-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-big .cb-bar { width: 100%; max-width: 34px; background: var(--sunken); border: 1px solid var(--line-2); border-radius: 5px 5px 0 0; transition: height .55s cubic-bezier(.2,.8,.2,1); }
.chart-big .cb-col.peak .cb-bar { background: var(--accent); border-color: transparent; }
.chart-big .cb-col .cb-d { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }

.bars-h { display: flex; flex-direction: column; gap: 11px; }
.bar-h { display: flex; align-items: center; gap: 11px; }
.bar-h .bh-name { font-size: 12.5px; font-weight: 500; width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); flex: none; }
.bar-h .bh-track { flex: 1; height: 7px; background: var(--sunken); border-radius: var(--r-pill); overflow: hidden; }
.bar-h .bh-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .55s cubic-bezier(.2,.8,.2,1); }
.bar-h .bh-val { font-family: var(--font-mono); font-size: 11px; width: 46px; text-align: right; color: var(--ink-2); flex: none; }

.analytics-callout {
  margin-top: 16px; padding: 20px 24px;
  display: flex; align-items: center; gap: 20px;
  background: var(--sunken); border-radius: var(--r-lg); border: 1px solid var(--line);
}
.analytics-callout .ac-big { font-family: var(--font-display); font-weight: 700; font-size: 46px; letter-spacing: -.03em; line-height: 1; color: var(--ink); flex: none; }
.analytics-callout .ac-desc .t { font-weight: 600; font-size: 15.5px; }
.analytics-callout .ac-desc .s { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

/* ---- Analytics (rebuilt) ------------------------------------------------ */
.an-content { display: flex; flex-direction: column; gap: 16px; }
.an-content > * { margin-top: 0; min-width: 0; width: 100%; }
.an-split > *, .an-triple > * { min-width: 0; }
.an-card { padding: 20px 22px; min-width: 0; }

/* link-click geography */
.an-geo-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(220px, 1fr); gap: 20px; margin-top: 6px; }
.an-geo .an-geo-map { min-width: 0; height: 340px; background: var(--sunken); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.an-geo-map svg { width: 100%; height: 100%; }
.jvm-tooltip { background: var(--ink) !important; border: none !important; border-radius: 7px !important; padding: 5px 10px !important; font-family: var(--font-sans) !important; font-size: 12px !important; font-weight: 600 !important; box-shadow: var(--shadow-md) !important; }
.an-geo-list { display: flex; flex-direction: column; gap: 2px; align-self: center; }
.an-geo-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--r-sm); transition: background .12s; cursor: default; }
.an-geo-row.on { background: var(--sunken); }
.an-geo-rank { width: 16px; font-size: 12px; font-weight: 700; color: var(--ink-4); font-family: var(--font-mono); flex: none; text-align: center; }
.an-geo-flag { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; flex: none; }
.an-geo-city { font-size: 13px; font-weight: 600; color: var(--ink); flex: none; width: 74px; }
.an-geo-bar { flex: 1; height: 6px; background: var(--sunken); border-radius: var(--r-pill); overflow: hidden; min-width: 0; }
.an-geo-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .8s cubic-bezier(.4,.9,.3,1); }
.an-geo-pct { font-size: 12.5px; font-weight: 600; color: var(--ink-2); font-family: var(--font-mono); flex: none; width: 34px; text-align: right; }
@media (max-width: 960px) { .an-geo-body { grid-template-columns: 1fr; } }

.an-toolbar { display: flex; align-items: center; gap: 10px; }
.an-tb-title { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.an-scope { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.an-scope i { color: var(--ink-3); }
.an-dot { color: var(--ink-4); }
.an-sub { color: var(--ink-3); }
.an-period { display: inline-flex; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.an-seg-b { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 5px 13px; border-radius: var(--r-pill); transition: background .12s, color .12s; }
.an-seg-b:hover { color: var(--ink); }
.an-seg-b.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* KPI cards */
.an-kpis { gap: 14px; }
.an-kpi { display: flex; flex-direction: column; }
.an-kpi .s-num { margin: 8px 0 3px; }
.an-kpi-sub { font-size: 11.5px; color: var(--ink-3); margin-bottom: 10px; }
.an-kpi .s-delta { margin-top: auto; }
.an-delta-word { color: var(--ink-4); }

/* locked (Pro-gated) KPI card */
.an-kpi-locked { position: relative; }
.an-kpi-locked .s-ico { background: var(--accent-soft); }
.an-kpi-locked .s-ico i { color: var(--accent); }
.an-kpi-protag { position: absolute; top: 16px; right: 16px; }
.an-lock-num { color: var(--ink-4); letter-spacing: .08em; -webkit-user-select: none; user-select: none; }
.an-lock-btn {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: .02em; color: var(--on-accent); background: var(--accent);
  border: none; border-radius: var(--r-pill); padding: 7px 13px; cursor: pointer;
  transition: background .14s;
}
.an-lock-btn:hover { background: var(--accent-press); }

.an-split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.an-triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: start; }

.an-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 10px; }
.an-badge b { color: var(--ink); font-family: var(--font-mono); }
.an-badge.lime { color: var(--up); background: var(--up-soft); border-color: transparent; font-weight: 600; }
.an-hint, .an-metric ~ .an-hint { font-size: 11.5px; color: var(--ink-4); }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: 4px; }
.fn-row { display: flex; flex-direction: column; gap: 7px; }
.fn-top { display: flex; align-items: center; gap: 11px; }
.fn-ico { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; flex: none; }
.fn-ico i { font-size: 15px; color: var(--ink-2); }
.fn-label { display: flex; flex-direction: column; font-size: 13.5px; font-weight: 600; color: var(--ink); flex: 1; }
.fn-note { font-size: 11px; font-weight: 400; color: var(--ink-3); }
.fn-fig { display: flex; align-items: baseline; gap: 9px; flex: none; }
.fn-val { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.fn-pct { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); width: 38px; text-align: right; }
.fn-track { height: 12px; background: var(--sunken); border-radius: var(--r-pill); overflow: hidden; margin-left: 41px; }
.fn-bar { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.fn-bar.end { background: var(--up); }
.fn-drop { display: flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin: 2px 0 6px 41px; }

/* quality */
.qual-list { display: flex; flex-direction: column; gap: 15px; }
.qual-row { display: flex; flex-direction: column; gap: 6px; }
.qual-head { display: flex; align-items: baseline; justify-content: space-between; }
.qual-k { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.qual-v { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.qual-v.mono { font-family: var(--font-mono); font-size: 14px; }
.qual-track { height: 7px; background: var(--sunken); border-radius: var(--r-pill); overflow: hidden; }
.qual-fill { height: 100%; border-radius: var(--r-pill); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.qual-fill.good { background: var(--up); }
.qual-fill.warn { background: var(--warn); }
.qual-target { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--warn); }
.qual-target.ok { color: var(--ink-4); }
.qual-foot { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.qual-foot i { color: var(--warn); font-size: 14px; margin-top: 1px; flex: none; }

/* trend */
.an-metric { display: flex; gap: 6px; }
.an-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 11px; transition: all .12s; }
.an-chip:hover { border-color: var(--ink-4); color: var(--ink); }
.an-chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.an-chip.on i { color: var(--surface); }
.an-trend { height: 168px; margin-top: 6px; }
.an-trend .cb-col { cursor: default; }
.an-trend .cb-col:hover .cb-bar { filter: brightness(0.94); }
.an-trend.dense { gap: 4px; }
.an-trend.dense .cb-bar { max-width: 22px; border-radius: 3px 3px 0 0; }

/* line-chart trend */
.an-line { width: 100%; margin-top: 6px; }
.an-line-svg { display: block; overflow: visible; }
.an-line-grid { stroke: var(--line-2); stroke-width: 1; }
.an-line-path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.an-line-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.an-line-dot.peak { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.an-line-lbl { font-family: var(--font-mono); font-size: 10px; fill: var(--ink-3); }

/* secondary — avg response time (footer under flow table) */
.an-resp-foot { display: flex; align-items: center; gap: 14px; padding: 16px 4px 2px; margin-top: 14px; border-top: 1px solid var(--line); }
.an-sec-ico { width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; flex: none; }
.an-sec-ico i { font-size: 18px; color: var(--ink-2); }
.an-sec-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.an-sec-lbl { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.an-sec-sub { font-size: 12px; color: var(--ink-3); }
.an-sec-fig { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.an-sec-num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.an-sec-delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 11px; }
.an-sec-delta.up { color: var(--up); }

/* wide top-posts grid (full-width card) */
.an-posts-wide { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.an-posts-wide .an-post:nth-last-child(2):nth-child(odd) { border-bottom: none; }
@media (max-width: 720px) { .an-posts-wide { grid-template-columns: 1fr; } }

/* flow performance table */
.an-table-wrap { overflow-x: auto; }
.an-table { width: 100%; border-collapse: collapse; }
.an-table thead th { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 0 14px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.an-table thead th.num { text-align: right; }
.an-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.an-table tbody tr:last-child td { border-bottom: none; }
.an-table tbody tr:hover td { background: var(--raised); }
.an-table td.num { text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.an-table td.num.rev { font-weight: 700; }
.an-flow { display: flex; align-items: center; gap: 10px; }
.an-flow-ico { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; flex: none; }
.an-flow-ico i { font-size: 14px; color: var(--ink-2); }
.an-flow-name { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; color: var(--ink); }
.an-flow-status { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; width: fit-content; padding: 1px 6px; border-radius: var(--r-xs); }
.an-flow-status.live { color: var(--tertiary); background: var(--tertiary-soft); }
.an-flow-status.paused { color: var(--ink-3); background: var(--sunken); }
.an-ctr { display: flex; align-items: center; gap: 9px; min-width: 120px; }
.an-ctr-track { flex: 1; height: 6px; background: var(--sunken); border-radius: var(--r-pill); overflow: hidden; }
.an-ctr-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.an-ctr-v { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); width: 34px; text-align: right; flex: none; }

/* keyword names */
.bar-h .bh-name.kw { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: .03em; width: 62px; color: var(--ink); }

/* audience stacked bar */
.stack-bar { display: flex; height: 14px; border-radius: var(--r-pill); overflow: hidden; background: var(--sunken); margin-bottom: 16px; }
.stack-seg { height: 100%; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.stack-legend { display: flex; flex-direction: column; gap: 10px; }
.sl-row { display: flex; align-items: center; gap: 9px; }
.sl-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.sl-k { font-size: 13px; color: var(--ink-2); flex: 1; }
.sl-v { font-family: var(--font-mono); font-size: 12px; color: var(--ink); font-weight: 700; }

/* top posts */
.an-posts { display: flex; flex-direction: column; gap: 4px; }
.an-post { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.an-post:last-child { border-bottom: none; }
.ap-rank { width: 22px; height: 22px; border-radius: var(--r-xs); background: var(--sunken); font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink-3); display: flex; align-items: center; justify-content: center; flex: none; }
.ap-body { flex: 1; min-width: 0; }
.ap-t { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-kind { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); margin-top: 2px; }
.ap-v { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink); flex: none; }

/* top posts — leaderboard */
.lb { display: flex; flex-direction: column; gap: 8px; }
.lb-top {
  display: flex; align-items: center; gap: 16px; padding: 18px;
  border-radius: var(--r-lg); background: var(--accent-soft);
  border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  margin-bottom: 6px;
}
.lb-top-medal {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px color-mix(in oklch, var(--accent) 55%, transparent);
}
.lb-top-medal i { font-size: 23px; }
.lb-top-main { flex: 1; min-width: 0; }
.lb-top-kind { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--on-accent); }
.lb-top-t { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); margin: 3px 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-top-bar { height: 6px; background: color-mix(in oklch, var(--accent) 25%, var(--surface)); border-radius: var(--r-pill); overflow: hidden; }
.lb-top-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .75s cubic-bezier(.2,.8,.2,1); }
.lb-top-fig { text-align: right; flex: none; }
.lb-top-v { font-family: var(--font-display); font-size: 27px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.lb-top-lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }

.lb-rows { display: flex; flex-direction: column; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--line-2); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 24px; height: 24px; border-radius: var(--r-xs); background: var(--sunken); font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-3); display: flex; align-items: center; justify-content: center; flex: none; }
.lb-body { width: 200px; flex: none; min-width: 0; }
.lb-t { font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-kind { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); margin-top: 2px; }
.lb-track { flex: 1; height: 6px; background: var(--sunken); border-radius: var(--r-pill); overflow: hidden; }
.lb-fill { height: 100%; background: color-mix(in oklch, var(--accent) 60%, var(--sunken)); border-radius: var(--r-pill); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.lb-v { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--ink); width: 48px; text-align: right; flex: none; }
@media (max-width: 640px) { .lb-body { width: 130px; } }

.an-callout { margin-top: 0; }
.an-callout .ac-desc { flex: 1; }

@media (max-width: 900px) {
  .an-split, .an-triple { grid-template-columns: 1fr; }
}

/* =========================================================================
   SETTINGS
   ========================================================================= */
.settings-body { flex: 1; overflow-y: auto; padding: 26px 28px 48px; }
.settings-inner { max-width: 620px; display: flex; flex-direction: column; gap: 28px; }
.settings-section .s-sh { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }

.conn-account { display: flex; align-items: center; gap: 13px; padding: 18px 20px; }
.conn-account .ca-info { flex: 1; min-width: 0; }
.conn-account .ca-info .h { font-weight: 600; font-size: 15px; }
.conn-account .ca-info .s { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.plan-row { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.plan-row .pr-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; flex: none; }
.plan-row .pr-meta { flex: 1; }
.plan-row .pr-meta .t { font-size: 14px; font-weight: 500; }
.plan-row .pr-meta .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.plan-stats { border-top: 1px solid var(--line-2); padding: 14px 20px; display: flex; gap: 24px; }
.plan-stats .ps-item { text-align: center; }
.plan-stats .ps-item .v { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }

.settings-row {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row .sr-label { flex: 1; }
.settings-row .sr-label .t { font-weight: 500; font-size: 14px; }
.settings-row .sr-label .s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

/* =========================================================================
   ONBOARDING
   ========================================================================= */
.onb { height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.onb-left { padding: 48px 52px; display: flex; flex-direction: column; justify-content: center; align-items: center; overflow-y: auto; background: var(--surface); }
.onb-left > * { max-width: 440px; width: 100%; }
.onb-left > .brand { margin-bottom: 28px; }
.onb-steps { margin-bottom: 28px; }
.onb-right {
  background: var(--paper); border-left: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; padding: 48px;
  position: relative; overflow: hidden;
}
.onb-right::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(oklch(0.905 0.004 90) 1px, transparent 1px);
  background-size: 20px 20px;
}
[data-theme="dark"] .onb-right {
  background: var(--sunken);
}
[data-theme="dark"] .onb-right::before {
  background-image: radial-gradient(oklch(0.285 0.006 80) 1px, transparent 1px);
}
.onb-visual { position: relative; z-index: 1; text-align: center; max-width: 320px; }
.onb-visual .ov-big { font-family: var(--font-display); font-weight: 700; font-size: 88px; letter-spacing: -.04em; line-height: .88; color: var(--ink); }
.onb-visual .ov-label { font-size: 15px; color: var(--ink-2); margin-top: 16px; line-height: 1.5; }
.onb-visual .ov-sys { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 8px; letter-spacing: .06em; text-transform: uppercase; }

.onb-steps { display: flex; gap: 6px; margin-bottom: 42px; }
.onb-steps .os { height: 4px; flex: 1; border-radius: var(--r-pill); background: var(--line); transition: background .3s; }
.onb-steps .os.done { background: var(--ink-4); }
.onb-steps .os.cur { background: var(--accent); }

.onb-q { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 3.8vw, 40px); letter-spacing: -.03em; line-height: 1.06; margin: 0 0 10px; }
.onb-sub { font-size: 15.5px; color: var(--ink-2); line-height: 1.5; margin: 0 0 28px; max-width: 36ch; }

.onb-connect {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 18px; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--paper);
  font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
  transition: background .14s, border-color .14s;
  text-align: left;
}
.onb-connect:hover { border-color: var(--ink-4); background: var(--sunken); }
.onb-connect.connected { background: var(--accent-soft); border-color: var(--accent); color: var(--on-accent); }
.onb-connect i { font-size: 20px; flex: none; }

.onb-choice {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--line);
  border-radius: var(--r-md); margin-bottom: 9px; background: var(--surface);
  transition: background .14s, border-color .14s; cursor: pointer;
}
.onb-choice:hover { background: var(--sunken); border-color: var(--ink-4); }
.onb-choice.sel { background: var(--accent-soft); border-color: var(--accent); }
.onb-choice .oc-ci { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; }
.onb-choice .oc-ci i { font-size: 18px; color: var(--ink-2); }
.onb-choice.sel .oc-ci { background: var(--surface); }
.onb-choice.sel .oc-ci i { color: var(--on-accent); }
.onb-choice .oc-body { flex: 1; min-width: 0; }
.onb-choice .oc-body .ct { font-weight: 600; font-size: 14px; }
.onb-choice .oc-body .cs { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.onb-choice.sel .ct { color: var(--on-accent); }
.onb-choice.sel .cs { color: color-mix(in oklab, var(--on-accent) 72%, transparent); }
.onb-choice .oc-chk { color: var(--accent); font-size: 19px; opacity: 0; flex: none; transition: opacity .14s; }
.onb-choice.sel .oc-chk { opacity: 1; }

.onb-actions { display: flex; align-items: center; gap: 11px; margin-top: auto; padding-top: 24px; }

/* ---- connect: spinner + connecting/done states ---- */
.onb-connect.connecting { color: var(--ink-2); cursor: progress; }
.onb-connect:disabled { cursor: default; }
.onb-spin {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--accent);
  animation: onb-spin .7s linear infinite;
}
@keyframes onb-spin { to { transform: rotate(360deg); } }

.onb-account {
  display: flex; align-items: center; gap: 12px; margin-top: 16px;
  padding: 12px 14px; border: 1.5px solid var(--ink);
  border-radius: var(--r-md, 14px); background: var(--surface);
  box-shadow: 3px 3px 0 var(--ink);
}
.onb-account .oa-body { flex: 1; min-width: 0; }
.onb-account .oa-name { font-weight: 700; font-size: 14px; }
.onb-account .oa-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.onb-account .oa-badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font: var(--text-label, 700 12px/1 monospace); font-size: 11px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--success);
}
.onb-account .oa-badge i { font-size: 13px; }

/* ---- multiselect checkbox ---- */
.onb-choice .oc-box {
  width: 22px; height: 22px; flex: none; border-radius: 7px;
  border: 1.5px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  transition: background .14s, border-color .14s;
}
.onb-choice .oc-box i { font-size: 13px; color: transparent; transition: color .12s; }
.onb-choice.multi.sel .oc-box { background: var(--accent); border-color: var(--accent); }
.onb-choice.multi.sel .oc-box i { color: var(--on-accent); }

/* ---- entrance for choices ---- */
.onb-choice.rise { opacity: 0; animation: onb-rise .42s cubic-bezier(0.2,0.8,0.2,1) forwards; }
@keyframes onb-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ===================== RIGHT-PANEL POWER VISUALS ===================== */
.onb-right { perspective: 1000px; }
.ov-stage { position: relative; z-index: 1; width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.ov-cap { text-align: center; max-width: 320px; }
.ov-cap .ov-big { font-family: var(--font-display); font-weight: 700; font-size: 64px; letter-spacing: -.04em; line-height: .9; color: var(--ink); }
.ov-cap .ov-label { font-size: 15px; color: var(--ink-2); margin-top: 12px; line-height: 1.5; }
.ov-cap .ov-sys { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 8px; letter-spacing: .06em; text-transform: uppercase; }

.pop-in { animation: onb-pop .5s cubic-bezier(0.2,0.9,0.3,1.2) both; }
@keyframes onb-pop { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }

/* DM mock (step 0) */
.dm-mock {
  width: 100%; background: var(--surface); border: 1.5px solid var(--ink);
  border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.dm-row { display: flex; align-items: flex-end; gap: 8px; }
.dm-row.mine { justify-content: flex-end; }
.dm-av { width: 24px; height: 24px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--accent), var(--violet, #7c5cff)); }
.dm-bubble { font-size: 13.5px; line-height: 1.4; padding: 9px 12px; border-radius: 14px; max-width: 80%; background: var(--sunken); color: var(--ink); }
.dm-bubble.lime { background: var(--accent); color: var(--on-accent); font-weight: 600; border-bottom-right-radius: 5px; }
.dm-typing { display: flex; gap: 4px; padding: 4px 2px; }
.dm-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); animation: dm-blink 1.2s infinite; }
.dm-typing span:nth-child(2) { animation-delay: .2s; }
.dm-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dm-blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* voice card (step 1) */
.voice-card {
  width: 100%; background: var(--surface); border: 1.5px solid var(--ink);
  border-radius: 18px; box-shadow: 5px 5px 0 var(--accent); padding: 22px;
}
.voice-card .vc-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.voice-card .vc-quote { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; margin: 10px 0 8px; }
.voice-card .vc-sub { font-size: 13.5px; color: var(--ink-2); }

/* build card (step 2) */
.build-card {
  width: 100%; background: var(--surface); border: 1.5px solid var(--ink);
  border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); padding: 16px; min-height: 150px;
}
.build-card .bc-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.build-card .bc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.build-card .bc-list { display: flex; flex-direction: column; gap: 8px; }
.build-card .bc-empty { font-size: 13px; color: var(--ink-3); padding: 8px 2px; }
.build-card .bc-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--raised); }
.build-card .bc-ic { width: 20px; height: 20px; flex: none; border-radius: 6px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.build-card .bc-t { flex: 1; font-weight: 600; font-size: 13.5px; }
.build-card .bc-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--success); }

@media (prefers-reduced-motion: reduce) {
  .pop-in, .onb-choice.rise, .dm-typing span, .onb-spin { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* =========================================================================
   NEW FLOW MODAL
   ========================================================================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: oklch(0.26 0.01 80 / 0.18);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: overlayIn .18s ease both;
}
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  animation: overlayIn .18s ease both;
}
[data-theme="dark"] .modal-overlay { background: oklch(0 0 0 / 0.3); }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 600px; max-height: 100%;
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .22s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.modal-head { padding: 24px 26px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: flex-start; gap: 12px; }
.modal-head .mh-txt { flex: 1; }
.modal-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.025em; line-height: 1.1; }
.modal-head .mh-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }
.modal-head .mh-close {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); transition: background .14s, color .14s;
}
.modal-head .mh-close:hover { background: var(--sunken); color: var(--ink); }
.modal-head .mh-close i { font-size: 17px; }

.modal-body { padding: 18px 22px 22px; overflow-y: auto; }
/* billing-detail edit modal */
.modal.bill-edit { width: 440px; max-width: calc(100vw - 40px); }
.bill-edit .be-field { display: flex; flex-direction: column; gap: 7px; }
.bill-edit .be-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }
.bill-edit .be-hint { font-size: 12px; color: var(--ink-3); }
.bill-edit .input { align-items: flex-start; }
.tmpl-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); padding: 4px 4px 10px; }

.tmpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tmpl-grid-single { grid-template-columns: 1fr; }
.tmpl-grid-single .tmpl-card { align-items: center; }
.tmpl-card .tc-arrow { color: var(--ink-3); font-size: 18px; flex: none; align-self: center; }
.tmpl-card:hover .tc-arrow { color: var(--on-accent); }
.tmpl-card.soon {
  cursor: not-allowed; opacity: 1;
  background: var(--sunken); border-color: var(--line);
}
.tmpl-card.soon:hover { background: var(--sunken); border-color: var(--line); box-shadow: none; transform: none; }
.tmpl-card.soon .tc-ico { background: var(--surface); border-color: var(--line); }
.tmpl-card.soon .tc-ico i { color: var(--ink-3); }
.tmpl-card.soon .tc-t { color: var(--ink-3); }
.tmpl-card.soon .tc-s { color: var(--ink-4); }
.tmpl-card .tc-badge.soon { color: var(--ink-3); background: var(--raised); border: 1px solid var(--line); }
.tmpl-card {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  padding: 20px 18px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--surface);
  transition: background .14s, border-color .14s, box-shadow .14s, transform .1s;
  position: relative;
}
.tmpl-card:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-sm); }
.tmpl-card:active { transform: translateY(1px); }
.tmpl-card .tc-ico {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex: none;
  background: var(--sunken); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: background .14s, border-color .14s;
}
.tmpl-card:hover .tc-ico { background: var(--surface); border-color: var(--accent); }
.tmpl-card .tc-ico i { font-size: 18px; color: var(--ink-2); }
.tmpl-card:hover .tc-ico i { color: var(--on-accent); }
.tmpl-card .tc-body { min-width: 0; flex: 1; }
.tmpl-card .tc-t { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.tmpl-card .tc-s { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.tmpl-card .tc-badge {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent); border-radius: var(--r-pill);
  padding: 2px 7px; white-space: nowrap;
}

.tmpl-blank {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; border: 1px dashed var(--ink-4);
  border-radius: var(--r-md); background: var(--sunken);
  transition: background .14s, border-color .14s; margin-top: 2px;
}
.tmpl-blank:hover { border-color: var(--ink-3); background: var(--raised); border-style: solid; }
.tmpl-blank .tb-ico { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); }
.tmpl-blank .tb-ico i { font-size: 18px; color: var(--ink-2); }
.tmpl-blank .tb-body { flex: 1; }
.tmpl-blank .tb-t { font-weight: 600; font-size: 14px; }
.tmpl-blank .tb-s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.tmpl-blank .tb-arrow { color: var(--ink-3); font-size: 18px; flex: none; }

/* =========================================================================
   ANIMATIONS
   ========================================================================= */
.fade-in { animation: fadeUp .32s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeUp {
  from { transform: translateY(12px); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none; }
}

/* =========================================================================
   CONTACTS
   ========================================================================= */
.cts-content { display: flex; flex-direction: column; min-height: 0; padding-bottom: 26px; }
.cts-content > * { width: 100%; }
.cts-tabs { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cts-tabs .filter-tab { display: inline-flex; align-items: center; gap: 7px; }

/* ---- table card ---- */
.cts-table-card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; }

.ct-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.ct-search { flex: 1; min-width: 220px; max-width: 360px; border-radius: var(--r-pill); padding: 8px 14px; }

/* status segmented control */
.ct-segment { display: inline-flex; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.ct-seg {
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  padding: 6px 13px; border-radius: var(--r-pill); white-space: nowrap;
  transition: background .12s, color .12s;
}
.ct-seg:hover { color: var(--ink); }
.ct-seg.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* filter dropdown */
.ct-filter { position: relative; }
.ct-filter .btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.flt-badge { font-family: var(--font-mono); font-size: 10px; font-weight: 700; background: var(--accent); color: var(--on-accent); border-radius: var(--r-pill); padding: 1px 6px; }
.flt-backdrop { position: fixed; inset: 0; z-index: 30; }
.flt-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 31; width: 270px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px; animation: modalIn .16s ease both;
}
.flt-head { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); padding: 8px 10px 6px; }
.flt-search { display: flex; align-items: center; gap: 7px; margin: 0 4px 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunken); }
.flt-search .fs-ico { font-size: 13px; color: var(--ink-4); flex: none; }
.flt-search input { border: none; background: transparent; outline: none; font-size: 13px; color: var(--ink); width: 100%; font-family: inherit; }
.flt-search input::placeholder { color: var(--ink-4); }
.flt-menu-list { max-height: 260px; overflow-y: auto; }
.flt-empty { font-size: 12.5px; color: var(--ink-4); padding: 12px 10px; text-align: center; }
.flt-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; transition: background .12s; text-align: left; }
.flt-item:hover { background: var(--sunken); }
.flt-item.on { background: var(--accent-soft); }
.flt-item .fi-ico { font-size: 15px; color: var(--ink-3); flex: none; }
.flt-item.on .fi-ico { color: var(--on-accent); }
.flt-item .fi-name { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flt-item .fi-count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); flex: none; }
.flt-item .fi-check { font-size: 13px; color: var(--accent); flex: none; }

.flt-pill {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  font-size: 12.5px; font-weight: 600; padding: 6px 8px 6px 12px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent);
  cursor: pointer; white-space: nowrap;
}
.flt-pill .fp-x { font-size: 11px; color: var(--ink-3); background: var(--surface); border-radius: 50%; width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s; cursor: pointer; }
.flt-pill .fp-x:hover { background: var(--ink); color: var(--surface); }
.flt-pill .fp-k { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin-right: 1px; }

/* prominent flow filter button */
.ct-flowbtn {
  display: inline-flex; align-items: center; gap: 8px; flex: none; max-width: 260px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  padding: 8px 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs);
  transition: background .12s, border-color .12s;
}
.ct-flowbtn:hover { border-color: var(--ink-4); }
.ct-flowbtn.on { border-color: var(--accent); background: var(--accent-soft); }
.ct-flowbtn .fb-flow { font-size: 15px; color: var(--accent); flex: none; }
.ct-flowbtn .fb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-flowbtn .fb-caret { font-size: 12px; color: var(--ink-3); flex: none; }

/* menu variants */
.flt-menu-wide { width: 300px; }
.flt-menu-right { left: auto; right: 0; width: 236px; }
.flt-menu-cols { width: 248px; }
.col-toggle-list { display: flex; flex-direction: column; gap: 1px; max-height: 340px; overflow-y: auto; }
.col-toggle { gap: 11px; }
.col-toggle:disabled { cursor: default; opacity: .72; }
.col-toggle:disabled:hover { background: transparent; }
.col-toggle .ct-check { flex: none; }
.col-toggle.on { background: transparent; }
.col-toggle.on:hover { background: var(--sunken); }
.col-toggle .fi-name { font-weight: 500; }
.flt-sec { padding-top: 2px; }
.flt-note { font-size: 11px; color: var(--ink-4); line-height: 1.4; padding: 8px 10px 4px; }

/* tri-state segmented control inside popover */
.flt-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; margin: 0 6px 8px; }
.flt-seg-b { font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 6px 6px; border-radius: calc(var(--r-sm) - 2px); white-space: nowrap; text-align: center; transition: background .12s, color .12s; }
.flt-seg-b:hover { color: var(--ink); }
.flt-seg-b.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* tag multi-select */
.flt-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px 8px; }
.flt-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); transition: background .12s, border-color .12s, color .12s; }
.flt-tag:hover { border-color: var(--ink-4); }
.flt-tag.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.flt-tag .ftg-n { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.flt-tag.on .ftg-n { color: var(--ink-3); }

/* popover footer */
.flt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 6px 4px; margin-top: 2px; border-top: 1px solid var(--line-2); }

/* toolbar spacer + active-filter bar */
.ct-tb-spacer { flex: 1; min-width: 8px; }
.ct-filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line-2); background: var(--sunken); flex: none; }
.ct-filterbar .cfb-ico { font-size: 14px; color: var(--ink-3); flex: none; }
.ct-clearall { font-size: 12px; font-weight: 600; color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; margin-left: 2px; transition: color .12s; }
.ct-clearall:hover { color: var(--ink); }

.ct-countbar, .ct-selbar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line-2); flex: none; }
.ct-count { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.ct-count .in { color: var(--ink-3); font-weight: 400; }
.ct-selbar b { font-size: 13px; }
.ct-selbar { background: var(--accent-soft); }

/* resync / refresh contact data */
.ct-toolbar { position: relative; }
.ct-sync { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.ct-synced { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.ct-syncbtn { gap: 6px; }
.ct-syncbtn .sync-i { font-size: 14px; transition: transform .2s; }
.ct-syncbtn:not(:disabled):hover .sync-i { transform: rotate(45deg); }
.ct-syncbtn.syncing { color: var(--accent-press); border-color: var(--accent); background: var(--accent-soft); opacity: 1; }
.ct-syncbtn.syncing .sync-i { animation: sync-spin .8s linear infinite; transform: none; }
@keyframes sync-spin { to { transform: rotate(360deg); } }

/* indeterminate progress line under the toolbar */
.ct-syncline { position: relative; height: 2px; background: var(--line-2); overflow: hidden; flex: none; }
.ct-syncline span { position: absolute; inset: 0 auto 0 0; width: 35%; background: var(--accent); border-radius: 2px; animation: sync-slide 1.15s ease-in-out infinite; }
@keyframes sync-slide {
  0%   { left: -35%; }
  100% { left: 100%; }
}

/* sync result banner */
.ct-syncbar { display: flex; align-items: center; gap: 9px; padding: 9px 16px; border-bottom: 1px solid var(--line-2); flex: none; background: var(--accent-soft); animation: syncbar-in .22s ease; }
@keyframes syncbar-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.ct-syncbar .csb-ok { font-size: 16px; color: var(--accent-press); flex: none; }
.ct-syncbar .csb-msg { font-size: 12.5px; color: var(--ink); }
.ct-syncbar .csb-msg b { font-weight: 700; color: var(--accent-press); }
.ct-syncbar .csb-x { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: var(--r-sm); color: var(--ink-3); font-size: 12px; transition: background .12s, color .12s; }
.ct-syncbar .csb-x:hover { background: var(--surface); color: var(--ink); }

/* brief highlight on rows that just picked up new data */
.ct-row.just-synced td { animation: row-flash 2.4s ease; }
@keyframes row-flash {
  0%   { background: var(--accent-soft); }
  70%  { background: var(--accent-soft); }
  100% { background: transparent; }
}

/* pagination footer */
.ct-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line-2); flex: none; background: var(--surface); flex-wrap: wrap; }
.ctp-info { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.ctp-nav { display: flex; align-items: center; gap: 8px; }
.ctp-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); transition: background .12s, border-color .12s, color .12s; }
.ctp-btn:hover:not(:disabled) { background: var(--sunken); border-color: var(--ink-4); color: var(--ink); }
.ctp-btn:disabled { opacity: .4; cursor: not-allowed; }
.ctp-btn i { font-size: 12px; }
.ctp-pages { display: flex; align-items: center; gap: 3px; }
.ctp-page { min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--r-sm); font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-3); transition: background .12s, color .12s; }
.ctp-page:hover { background: var(--sunken); color: var(--ink); }
.ctp-page.on { background: var(--accent); color: var(--on-accent); }

.cts-empty { text-align: center; color: var(--ink-3); padding: 50px 16px; font-size: 13.5px; }
.cts-empty i { display: block; font-size: 28px; margin-bottom: 8px; }

/* checkbox */
.ct-check { position: relative; display: inline-flex; cursor: pointer; }
.ct-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.ct-check span { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--ink-4); background: var(--surface); display: block; transition: background .12s, border-color .12s; position: relative; }
.ct-check span::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 5px; height: 9px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .12s; }
.ct-check input:checked + span { background: var(--accent); border-color: var(--accent); }
.ct-check input:checked + span::after { transform: rotate(45deg) scale(1); }

/* table */
.ct-scroll { overflow: auto; flex: 1; min-height: 0; }
.ct-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ct-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--raised);
  text-align: left; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ct-table thead th.sortable { cursor: pointer; user-select: none; }
.ct-table thead th.sortable:hover { color: var(--ink); }
.ct-table thead th .sort-i { font-size: 11px; margin-left: 5px; vertical-align: middle; opacity: .5; }
.ct-table thead th.on .sort-i { opacity: 1; color: var(--ink); }

.ct-row { cursor: pointer; transition: background .12s; }
.ct-row td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.ct-row:hover { background: var(--sunken); }
.ct-row.active { background: var(--accent-soft); }
.ct-row.checked { background: var(--accent-soft); }
.col-check { width: 40px; padding-left: 16px !important; }

.cn-wrap { display: flex; align-items: center; gap: 10px; }
.cn-id { min-width: 0; }
.cn-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.cn-handle { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.col-email { font-size: 13px; color: var(--ink-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.col-role { font-size: 13px; color: var(--ink-2); }
.col-realname { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.col-followers { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.col-loc { font-size: 13px; color: var(--ink-2); }
.col-phone { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.muted { color: var(--ink-4); }

.list-chips { display: flex; align-items: center; gap: 5px; }
.list-chip { font-size: 11.5px; font-weight: 500; color: var(--ink-2); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px 8px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.list-chip.more { color: var(--ink-3); padding: 3px 7px; cursor: default; }
.chip-pop {
  position: fixed; transform: translate(-50%, calc(-100% - 8px));
  display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; width: max-content; z-index: 200;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg); padding: 6px; pointer-events: none;
}
.chip-pop-item { font-size: 11.5px; font-weight: 500; color: var(--ink-2); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px 8px; white-space: nowrap; }

.score-cell { display: flex; align-items: center; gap: 8px; }
.score-bar { width: 56px; height: 6px; border-radius: var(--r-pill); background: var(--sunken); overflow: hidden; flex: none; }
.score-bar span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); }
.score-cell b { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-2); width: 22px; }

.col-active { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.col-source .src { font-size: 12px; color: var(--ink-3); }
.col-follows { white-space: nowrap; }
.follows-yes { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--tertiary); }
.follows-yes .fi { font-size: 14px; }
.col-follows .muted { font-size: 12.5px; }

.status-dot {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3);
}
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sc); }

/* ---- slide-over drawer ---- */
.drawer-overlay { position: fixed; inset: 0; z-index: 60; background: oklch(0.26 0.01 80 / 0.32); animation: overlayIn .18s ease both; }
[data-theme="dark"] .drawer-overlay { background: oklch(0 0 0 / 0.5); }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: clamp(340px, 34vw, 480px); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-close { position: absolute; top: 16px; right: 16px; z-index: 3; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--sunken); color: var(--ink-3); transition: background .14s, color .14s; }
.drawer-close:hover { background: var(--line); color: var(--ink); }
.drawer-close i { font-size: 16px; }

/* detail panel (used inside drawer) */
.cts-detail { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.cd-head { display: flex; align-items: center; gap: 14px; padding: 26px 22px 16px; padding-right: 58px; }
.cd-head .cd-id { flex: 1; min-width: 0; }
.cd-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-handle { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-actions { display: flex; align-items: center; gap: 8px; padding: 0 22px 20px; border-bottom: 1px solid var(--line-2); }
.cd-msg { flex: 1; justify-content: center; }
.cd-act-icon { flex: none; width: 34px; padding-left: 0; padding-right: 0; justify-content: center; }
.cd-del:hover { color: var(--dn); border-color: color-mix(in oklab, var(--dn) 40%, var(--line)); background: color-mix(in oklab, var(--dn) 8%, var(--surface)); }

.cd-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line-2); background: var(--sunken); }
.cd-stat { padding: 14px 16px; border-right: 1px solid var(--line-2); min-width: 0; }
.cd-stat:last-child { border-right: 0; }
.cd-stat .v { font-family: var(--font-display); font-weight: 700; font-size: clamp(16px, 2.2vw, 20px); letter-spacing: -.02em; white-space: nowrap; line-height: 1.1; color: var(--ink); }
.cd-stat .v .u { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.cd-stat .k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; white-space: nowrap; }

.cd-scroll { overflow-y: auto; flex: 1; min-height: 0; padding: 20px 22px 26px; }
.cd-section + .cd-section { margin-top: 26px; }
.cd-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 12px; }
/* subtle per-contact refresh, tucked beside the section label */
.cd-label-row { display: flex; align-items: center; justify-content: flex-start; gap: 4px; }
.cd-sync { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: var(--r-sm); color: var(--ink-4); font-size: 13px; opacity: .45; transition: opacity .14s, color .14s, background .14s; }
.cd-sync:hover { opacity: 1; color: var(--ink-2); background: var(--sunken); }
.cd-sync:disabled { cursor: default; }
.cd-sync.spinning { opacity: 1; color: var(--ink-3); }
.cd-sync.spinning :where(i, [class*="ph-"]) { animation: sync-spin .8s linear infinite; display: inline-block; }
.cd-sync.ok { opacity: 1; color: var(--accent-press); }

.cd-info { display: flex; flex-direction: column; gap: 2px; }
.ci-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.ci-row i { font-size: 15px; color: var(--ink-3); flex: none; }
.ci-row .ci-label { font-size: 12.5px; color: var(--ink-3); width: 76px; flex: none; }
.ci-row .ci-value { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.ci-row .ci-value.missing { color: var(--ink-4); font-weight: 400; font-style: italic; }
.cd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.cd-lists { font-size: 12.5px; color: var(--ink-2); margin-top: 14px; display: flex; align-items: center; gap: 6px; }
.cd-lists i { color: var(--ink-3); }
.cd-lists b { font-weight: 600; }

/* timeline */
.timeline { position: relative; padding-left: 6px; }
.timeline::before { content: ""; position: absolute; left: 20px; top: 8px; bottom: 18px; width: 2px; background: var(--line); }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-node {
  width: 30px; height: 30px; border-radius: 50%; flex: none; z-index: 1;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: var(--accent-soft); color: var(--ink); border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.tl-item.type-purchase .tl-node { background: var(--up-soft); color: var(--up); }
.tl-item.type-click .tl-node,
.tl-item.type-dm .tl-node { background: var(--accent-soft); color: var(--on-accent); }
.tl-item.origin .tl-node { background: var(--ink); color: var(--surface); box-shadow: 0 0 0 1px var(--ink); }
.tl-body { flex: 1; min-width: 0; padding-top: 4px; }
.tl-top { display: flex; align-items: baseline; gap: 8px; }
.tl-title { font-weight: 600; font-size: 13.5px; }
.tl-time { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; flex: none; }
.tl-detail { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* lists grid */
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; align-content: start; }
.list-card { padding: 18px; cursor: pointer; transition: border-color .14s, box-shadow .14s, transform .12s; display: flex; flex-direction: column; }
.list-card:hover { border-color: var(--ink-4); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.lc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.lc-ico { width: 38px; height: 38px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--accent-soft); color: var(--on-accent); }
.lc-ico.up { background: var(--violet-soft, oklch(0.95 0.04 286)); color: var(--violet, oklch(0.53 0.23 286)); }
.lc-type { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.lc-new { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--on-accent); background: var(--accent); border-radius: var(--r-pill); padding: 2px 8px; }
.lc-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.015em; }
.lc-rule { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.4; }
.lc-rule i { color: var(--ink-3); flex: none; }
.lc-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.lc-count { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.lc-count span { font-family: var(--font-sans); font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.lc-growth { font-family: var(--font-mono); font-size: 11px; color: var(--up); }
.list-card.new {
  border: 1.5px dashed var(--line); background: var(--raised); align-items: center; justify-content: center;
  text-align: center; gap: 4px; min-height: 180px; box-shadow: none;
}
.list-card.new:hover { border-color: var(--accent); background: var(--accent-soft); }
.ln-plus { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.ln-t { font-weight: 700; font-size: 15px; }
.ln-s { font-size: 12.5px; color: var(--ink-3); max-width: 200px; }

/* new-list modal extras */
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line-2); }
.nl-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.nl-mode {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: border-color .14s, color .14s, background .14s;
}
.nl-mode i { font-size: 16px; }
.nl-mode:hover { color: var(--ink); }
.nl-mode.on { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.nl-rules { display: flex; flex-direction: column; gap: 8px; }
.nl-rule { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color .14s, background .14s; }
.nl-rule:hover { background: var(--sunken); }
.nl-rule input { position: absolute; opacity: 0; pointer-events: none; }
.nl-rule .nr-ico { width: 30px; height: 30px; border-radius: var(--r-sm); flex: none; display: flex; align-items: center; justify-content: center; background: var(--sunken); color: var(--ink-2); font-size: 15px; }
.nl-rule .nr-t { flex: 1; font-size: 13.5px; font-weight: 500; }
.nl-rule .nr-check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; }
.nl-rule .nr-check i { font-size: 12px; color: transparent; }
.nl-rule:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.nl-rule:has(input:checked) .nr-ico { background: var(--accent); color: var(--on-accent); }
.nl-rule:has(input:checked) .nr-check { background: var(--accent); border-color: var(--accent); }
.nl-rule:has(input:checked) .nr-check i { color: var(--on-accent); }
.nl-upload {
  border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 36px 20px; text-align: center;
  color: var(--ink-3); cursor: pointer; transition: border-color .14s, background .14s;
}
.nl-upload:hover { border-color: var(--accent); background: var(--accent-soft); }
.nl-upload i { font-size: 30px; color: var(--ink-3); }
.nl-upload .nu-t { font-weight: 600; font-size: 14px; color: var(--ink); margin-top: 10px; }
.nl-upload .nu-s { font-size: 12.5px; margin-top: 4px; }
.nl-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); margin-top: 16px; }
.nl-hint i { color: var(--accent); font-size: 14px; flex: none; }

@media (max-width: 640px) {
  .drawer { width: 100vw; }
}

/* inspector done bar */
.insp-done-bar {
  display: flex; justify-content: center;
  padding: 16px 20px; border-top: 1px solid var(--line-2);
  background: var(--surface); flex: none;
}
.insp-done-bar .btn { width: 100%; justify-content: center; font-size: 15px; padding: 13px 24px; }
.idb-hint { display: none; }

/* =========================================================================
   AGENTS
   ========================================================================= */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.agent-card { padding: 18px; cursor: pointer; display: flex; flex-direction: column; transition: border-color .14s, box-shadow .14s, transform .12s; }
.agent-card:hover { border-color: var(--ink-4); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ac-head { display: flex; align-items: center; gap: 11px; }
.ac-ico { width: 40px; height: 40px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; font-size: 19px; background: var(--tertiary-soft); color: var(--tertiary); }
.ac-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.ac-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.ac-edit { opacity: 0; transition: opacity .14s; }
.agent-card:hover .ac-edit { opacity: 1; }
.ac-prompt { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-top: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ac-caps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cap-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px 9px; }
.cap-chip i { color: var(--ink-3); }
.ac-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line-2); }
.ac-stat { font-size: 12.5px; color: var(--ink-3); }
.ac-stat b { font-family: var(--font-display); font-size: 15px; color: var(--ink); margin-right: 3px; }
.ac-edited { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }

.tpl-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.agent-tpl { display: flex; align-items: center; gap: 12px; padding: 14px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer; text-align: left; transition: border-color .14s, box-shadow .14s, transform .12s; }
.agent-tpl:hover { border-color: var(--ink-4); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.agent-tpl.blank { border-style: dashed; background: var(--raised); }
.agent-tpl .at-ico { width: 36px; height: 36px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; font-size: 17px; background: var(--accent-soft); color: var(--on-accent); }
.agent-tpl .at-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agent-tpl .at-t { font-weight: 700; font-size: 13.5px; }
.agent-tpl .at-s { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.agent-tpl .at-arrow { color: var(--ink-4); flex: none; transition: transform .14s, color .14s; }
.agent-tpl:hover .at-arrow { color: var(--ink-2); transform: translateX(2px); }

/* composer ---------------------------------------------------------------- */
.agent-composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.agent-composer::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 0% 0%, var(--accent-soft) 0%, transparent 42%);
  opacity: .6;
}
.acm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; position: relative; }
.acm-spark {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--tertiary-mellow); color: var(--on-tertiary); box-shadow: var(--shadow-xs);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
}
.acm-spark > i { transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.agent-composer:hover .acm-spark,
.home-composer-bar:hover .acm-spark { transform: translateY(-1px) scale(1.06); box-shadow: var(--shadow-sm); }
.agent-composer:hover .acm-spark > i,
.home-composer-bar:hover .acm-spark > i { animation: acm-spark-pop .55s ease; }
@keyframes acm-spark-pop {
  0% { transform: rotate(0) scale(1); }
  45% { transform: rotate(18deg) scale(1.22); }
  70% { transform: rotate(-8deg) scale(1.08); }
  100% { transform: rotate(0) scale(1); }
}
.acm-titles .acm-t { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.015em; }
.acm-titles .acm-s { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.acm-collapse {
  margin-left: auto; width: 30px; height: 30px; flex: none; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  color: var(--ink-3); background: transparent; border: 1px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.acm-collapse:hover { background: var(--sunken); color: var(--ink); border-color: var(--line); }

/* collapsed home composer bar */
.home-composer-bar {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 13px 16px; box-shadow: var(--shadow-sm);
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.home-composer-bar:hover { border-color: var(--ink-4); box-shadow: var(--shadow-md); }
.home-composer-bar .acm-spark { width: 34px; height: 34px; font-size: 17px; }
.hcb-text { display: flex; flex-direction: column; line-height: 1.3; }
.hcb-t { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.015em; color: var(--ink); }
.hcb-s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.hcb-open {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 13px;
  transition: background .12s, color .12s;
}
.hcb-open i { font-size: 13px; }
.home-composer-bar:hover .hcb-open { background: var(--accent-soft); color: var(--accent-press); }

.acm-input {
  position: relative; display: block; width: 100%; resize: none;
  border: 1px solid var(--line); background: var(--sunken);
  border-radius: var(--r-lg); padding: 14px 15px;
  font-family: inherit; font-size: 15px; color: var(--ink); line-height: 1.55;
  min-height: 140px; outline: 0; transition: border-color .14s, box-shadow .14s, background .14s;
}
.acm-input::placeholder { color: var(--ink-3); }
.acm-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }

.acm-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; position: relative; }
.acm-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 5px 6px 5px 11px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); max-width: 260px;
}
.acm-chip > i { font-size: 13px; color: var(--ink-3); flex: none; }
.acm-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acm-chip-x {
  width: 18px; height: 18px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink-3); background: transparent; transition: background .12s, color .12s;
}
.acm-chip-x:hover { background: var(--line); color: var(--ink); }

.acm-urlrow { display: flex; align-items: center; gap: 8px; margin-top: 11px; position: relative; }

.acm-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; position: relative; }
.acm-attach { display: flex; gap: 6px; flex: 1; }
.acm-attach-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 7px 13px; transition: background .12s, border-color .12s, color .12s;
}
.acm-attach-btn i { font-size: 15px; color: var(--ink-3); }
.acm-attach-btn:hover { background: var(--sunken); border-color: var(--ink-4); color: var(--ink); }
.acm-go { display: flex; align-items: center; gap: 10px; }
.acm-kbd { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); letter-spacing: .04em; }

.acm-working {
  display: inline-flex; align-items: center; gap: 7px; margin-left: auto;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-press);
}
.acm-working .acm-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: beat 1.8s infinite; }

/* building agent card ----------------------------------------------------- */
.agent-card.building { cursor: default; border-style: dashed; }
.agent-card.building:hover { transform: none; box-shadow: none; border-color: var(--line); }
.ac-ico.building { background: var(--tertiary-soft); }
.ac-spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.build-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
}
.build-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.cap-skel {
  height: 24px; width: 92px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--sunken) 25%, var(--line-2) 50%, var(--sunken) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.cap-skel:nth-child(2) { width: 70px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.ac-build-bar { margin-top: 16px; height: 4px; border-radius: var(--r-pill); background: var(--sunken); overflow: hidden; }
.ac-build-bar > span { display: block; height: 100%; width: 40%; border-radius: var(--r-pill); background: var(--accent); animation: buildbar 2.4s ease-in-out forwards; }
@keyframes buildbar { 0% { width: 8%; } 70% { width: 78%; } 100% { width: 96%; } }

/* segmented control */
.seg { display: inline-flex; background: var(--sunken); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--ink-3); transition: background .14s, color .14s; }
.seg button i { font-size: 15px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.seg.sm button { padding: 5px 10px; font-size: 12.5px; }
.bk-tabs { align-self: flex-start; margin-bottom: 4px; }
.bk-res { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.bk-res-head { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.bk-res-head i { font-size: 15px; color: var(--ink-3); }

.bk-cat-empty { display: flex; flex-direction: column; gap: 18px; }
.bk-cat-intro { display: flex; align-items: flex-start; gap: 14px; }
.bk-cat-ico { width: 42px; height: 42px; flex: none; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.bk-cat-intro .h { font-weight: 700; font-size: 16px; }
.bk-cat-intro .s { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin-top: 2px; max-width: 560px; }
.bk-cat-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bk-cat-card { padding: 22px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bk-cat-optico { width: 40px; height: 40px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 19px; margin-bottom: 4px; }
.bk-cat-optico.shopify { background: oklch(0.94 0.05 145); color: oklch(0.55 0.15 145); }
.bk-cat-optico.link { background: var(--sunken); color: var(--ink-2); }
.bk-cat-card .h { font-weight: 700; font-size: 15px; }
.bk-cat-card .s { font-size: 13px; color: var(--ink-2); line-height: 1.5; flex: 1; }
.bk-cat-card .btn { margin-top: 8px; }
.bk-cat-form { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }
.bk-cat-form .input { width: 100%; }
.bk-cat-form .btn:disabled { opacity: .5; pointer-events: none; }

/* builder — immersive automation shell */
.agent-build-wrap { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: var(--paper); overflow: hidden; animation: stFadeIn .18s ease; }
@keyframes stFadeIn { from { opacity: 0; } to { opacity: 1; } }
.ab-header { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.ab-hdiv { width: 1px; height: 24px; background: var(--line); }
.ab-hico { width: 34px; height: 34px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; font-size: 16px; background: var(--tertiary-soft); color: var(--tertiary); }
.ab-name-btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: var(--ink); padding: 4px 6px; border-radius: var(--r-sm); }
.ab-name-btn:hover { background: var(--sunken); }
.ab-name-pencil { font-size: 13px; color: var(--ink-3); }
.ab-name-input { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: var(--ink); background: var(--sunken); border: 1px solid var(--accent); border-radius: var(--r-sm); padding: 4px 8px; outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.ab-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.ab-status.draft { background: var(--sunken); color: var(--ink-3); }
.ab-status.live { background: var(--up-soft); color: var(--up); border-color: transparent; }
.ab-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.ab-active { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }

.ab-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.ab-config { flex: 1; min-width: 0; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); min-height: 0; }
.ab-body .atx { width: 480px; flex: none; min-width: 0; }

.ab-config { padding: 22px 24px 32px; }
.ab-config > .ab-field { max-width: 620px; margin-left: auto; margin-right: auto; }
.ab-field + .ab-field { margin-top: 26px; }
.ab-label { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; display: block; }
.ab-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; margin-bottom: 11px; }
.ab-iconrow { display: flex; gap: 10px; margin-top: 11px; align-items: stretch; }
.ab-iconpick { position: relative; flex: none; }
.ab-iconbox { position: relative; width: 46px; height: 46px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); color: var(--tertiary); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; transition: border-color .14s, background .14s; overflow: hidden; }
.ab-iconbox:hover, .ab-iconbox.on { border-color: var(--tertiary); background: var(--tertiary-soft); }
.ab-iconbox-edit { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in oklch, var(--ink) 52%, transparent); color: #fff; font-size: 15px; opacity: 0; transition: opacity .14s; }
.ab-iconbox:hover .ab-iconbox-edit, .ab-iconbox.on .ab-iconbox-edit { opacity: 1; }
.ab-iconpop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 38px); gap: 7px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.ab-iconpop .ip { width: 38px; height: 38px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-3); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 17px; transition: border-color .12s, background .12s, color .12s; }
.ab-iconpop .ip:hover { color: var(--ink); border-color: var(--ink-4); }
.ab-iconpop .ip.on { border-color: var(--tertiary); background: var(--tertiary-soft); color: var(--tertiary); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.icon-pick .ip { width: 38px; height: 38px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-3); display: flex; align-items: center; justify-content: center; font-size: 17px; cursor: pointer; transition: border-color .14s, color .14s, background .14s; }
.icon-pick .ip:hover { color: var(--ink); }
.icon-pick .ip.on { border-color: var(--tertiary); background: var(--tertiary-soft); color: var(--tertiary); }
.ab-prompt { width: 100%; min-height: 132px; resize: vertical; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 13px 15px; font-family: var(--font-sans); font-size: 14px; line-height: 1.6; color: var(--ink); outline: 0; transition: border-color .14s, box-shadow .14s; }
.ab-prompt:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ab-prompt::placeholder { color: var(--ink-4); }

.ab-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.ab-suggest > i { color: var(--accent); }
.sug-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-pill); padding: 3px 9px; cursor: pointer; }
.sug-chip i { font-size: 10px; }
.sug-all { font-size: 12px; font-weight: 700; color: var(--accent-press); text-decoration: underline; cursor: pointer; }

.cap-list { display: flex; flex-direction: column; gap: 8px; }
.cap-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .14s, background .14s; }
.cap-row:hover { background: var(--sunken); }
.cap-row .cr-ico { width: 32px; height: 32px; border-radius: var(--r-sm); flex: none; display: flex; align-items: center; justify-content: center; background: var(--sunken); color: var(--ink-2); font-size: 16px; }
.cap-row .cr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cap-row .cr-t { font-weight: 600; font-size: 13.5px; }
.cap-row .cr-s { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.cap-row .cr-box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; }
.cap-row .cr-box i { font-size: 12px; color: transparent; }
.cap-row.on { border-color: var(--accent); background: var(--accent-soft); }
.cap-row.on .cr-ico { background: var(--accent); color: var(--on-accent); }
.cap-row.on .cr-box { background: var(--accent); border-color: var(--accent); }
.cap-row.on .cr-box i { color: var(--on-accent); }

/* read-only capability rows (built-in agents) — compact, side by side, toned down */
.cap-list.read { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 900px) { .cap-list.read { grid-template-columns: 1fr; } }
.cap-row.read { cursor: default; padding: 9px 12px; gap: 10px; border-color: var(--line); background: var(--surface); }
.cap-row.read:hover { background: var(--sunken); }
.cap-row.read .cr-ico { width: 26px; height: 26px; font-size: 14px; background: var(--sunken); color: var(--ink-2); }
.cap-row.read .cr-t { font-size: 13px; }
.cap-row.read .cr-s { font-size: 11.5px; }

/* built-in badges */
.ab-builtin { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 10px; white-space: nowrap; }
.ab-builtin i { font-size: 11px; }
.ac-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.builtin-tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 2px 7px; }
.builtin-tag i { font-size: 10px; }

/* post-watch picker (comment agents) */
.watch-seg { margin-top: 2px; }
.watch-count { font-size: 12.5px; color: var(--ink-3); margin-top: 12px; }
.watch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.watch-seeall { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--accent-press); background: none; border: 0; cursor: pointer; padding: 0; }
.watch-seeall i { font-size: 11px; }
.watch-seeall:hover { text-decoration: underline; }
.aifc-post-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-style: dashed; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.aifc-post-more i { font-size: 24px; color: var(--ink-3); }
.aifc-post-more:hover { border-color: var(--ink-4); background: var(--sunken); }
.watch-modal-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(20,24,20,.42); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 32px; animation: watch-fade .14s ease; }
@keyframes watch-fade { from { opacity: 0; } to { opacity: 1; } }
.watch-modal { width: min(680px, 100%); max-height: 82vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 24px 64px rgba(20,24,20,.28); overflow: hidden; }
.watch-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.watch-modal-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.watch-modal-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.watch-modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 18px 20px; overflow-y: auto; }
.watch-modal-foot { display: flex; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }

.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.kb-row .kb-ico { width: 30px; height: 30px; border-radius: var(--r-sm); flex: none; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--on-accent); font-size: 15px; }
.kb-row .kb-label { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-row .kb-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); flex: none; }
.kb-row .kb-x { width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: var(--ink-3); transition: background .12s, color .12s; }
.kb-row .kb-x:hover { background: var(--dn-soft); color: var(--dn); }
.kb-row .kb-x i { font-size: 12px; }
.kb-empty { font-size: 12.5px; color: var(--ink-4); padding: 8px 2px; font-style: italic; }
.kb-add { border: 1.5px solid var(--accent); border-radius: var(--r-md); padding: 11px; background: var(--surface); }
.kb-add input, .kb-add textarea { width: 100%; border: 0; outline: 0; background: transparent; font-family: var(--font-sans); font-size: 13.5px; color: var(--ink); resize: vertical; }
.kb-add textarea { min-height: 64px; line-height: 1.5; }
.kb-add-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.kb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.kb-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 13px; cursor: pointer; transition: border-color .14s, color .14s, background .14s; }
.kb-btn:hover { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.kb-btn i { font-size: 15px; }

/* ===== live test — AI-automation test-drive look (stage + trace) ===== */
.atx { display: flex; flex-direction: column; min-height: 0; background: var(--paper); overflow: hidden; }
.atx-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.atx-htxt { flex: 1; min-width: 0; }
.atx-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.atx-title i { color: var(--accent-press); font-size: 15px; }
.atx-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.atx-body { flex: 1; min-height: 0; display: flex; }
.atx-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--paper); }
.atx-post { margin: 16px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; flex: none; }
.atx-post-head { display: flex; align-items: center; gap: 10px; padding: 10px 13px; }
.atx-post-who { line-height: 1.2; }
.atx-post-switch { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 9px; cursor: pointer; }
.atx-post-switch:hover { color: var(--ink); border-color: var(--ink-4); }
.atx-post-switch i { font-size: 11px; }
.atx-post-who b { font-size: 13px; }
.atx-post-media { height: 104px; display: flex; align-items: center; justify-content: center; font-size: 44px; background: var(--sunken); }
.atx-post-cap { padding: 10px 13px; font-size: 13px; color: var(--ink); line-height: 1.45; }
.atx-post-cap b { margin-right: 5px; }

.atx-feed { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.atx-feed-empty { margin: auto; text-align: center; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.atx-feed-empty .ate-ico { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--sunken); color: var(--ink-3); margin-bottom: 4px; }
.atx-feed-empty .ate-t { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.atx-feed-empty .ate-s { font-size: 12.5px; }
.atx-turn { display: flex; flex-direction: column; gap: 10px; }
.atx-comment { display: flex; gap: 9px; align-items: flex-start; }
.atx-comment-body { font-size: 13.5px; line-height: 1.45; }
.atx-comment-body b { margin-right: 6px; }
.atx-reply { display: flex; gap: 9px; align-items: flex-start; margin-left: 36px; animation: stPopY .22s ease; }
.atx-reply-body { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.atx-reply-body b { color: var(--ink); margin-right: 6px; }
.atx-auto-tag { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-press); background: var(--accent-soft); padding: 1px 6px; border-radius: var(--r-pill); margin-left: 4px; }
@keyframes stPopY { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.atx-action { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 12px; animation: stPopY .22s ease; }
.atx-action i { font-size: 14px; color: var(--accent-press); }
.atx-action.warn i { color: var(--dn); }

.atx-dm-card { border: 1px dashed var(--line); border-radius: var(--r-md); padding: 12px; background: var(--surface); animation: stPopY .22s ease; }
.atx-dm-card.inline { border: 0; padding: 0; background: transparent; }
.atx-dm-card-head { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); font-family: var(--font-mono); margin-bottom: 10px; }
.atx-dm-row { display: flex; gap: 9px; align-items: flex-end; }
.atx-dm-av { width: 27px; height: 27px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--on-accent); font-size: 13px; }
.atx-dm-bubble { max-width: 80%; padding: 9px 13px; font-size: 13.5px; line-height: 1.45; border-radius: 15px; }
.atx-dm-bubble.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 5px; margin-left: auto; }
.atx-dm-bubble.agent { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 5px; display: flex; flex-direction: column; gap: 7px; }
.atx-dm-bubble.typing { display: inline-flex; flex-direction: row; gap: 4px; align-items: center; }
.atx-dm-bubble.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); animation: dm-blink 1.2s infinite; }
.atx-dm-bubble.typing span:nth-child(2) { animation-delay: .2s; }
.atx-dm-bubble.typing span:nth-child(3) { animation-delay: .4s; }
.atx-dm-bubble.agent .at-cite { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); background: var(--sunken); border-radius: var(--r-pill); padding: 2px 8px; align-self: flex-start; }
.atx-dm-bubble.agent .at-cite i { color: var(--accent); }

.atx-suggest { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 18px 0; flex: none; }
.atx-sug { white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 12px; cursor: pointer; transition: border-color .14s, color .14s; }
.atx-sug:hover { border-color: var(--accent); color: var(--ink); }
.atx-compose { display: flex; align-items: center; gap: 8px; padding: 14px 18px; flex: none; }
.atx-compose-input { flex: 1; border-radius: var(--r-pill); padding: 10px 16px; }

/* inline trace — collapsible “what the agent did” under each turn */
.atx-trace-inline { align-self: flex-start; max-width: 92%; }
.atx-trace-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 11px; cursor: pointer; transition: color .14s, border-color .14s; }
.atx-trace-toggle:hover { color: var(--ink); border-color: var(--ink-4); }
.atx-trace-toggle > i { font-size: 13px; color: var(--ink-3); }
.atx-trace-count { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--accent-press); background: var(--accent-soft); border-radius: var(--r-pill); padding: 1px 6px; }
.atx-trace-caret { font-size: 11px; transition: transform .16s; }
.atx-trace-inline.open .atx-trace-caret { transform: rotate(180deg); }
.atx-trace-steps { display: flex; flex-direction: column; gap: 7px; margin: 8px 0 2px; padding: 11px 13px; border-left: 2px solid var(--line); background: var(--surface); border-radius: 0 var(--r-md) var(--r-md) 0; animation: stPopY .18s ease; }
.atx-trace-step { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.4; color: var(--ink); }
.atx-trace-step i { font-size: 15px; color: var(--up); flex: none; margin-top: 1px; }
.atx-trace-step.off { color: var(--ink-3); }
.atx-trace-step.off i { color: var(--ink-4); }

@media (max-width: 1180px) { .ab-body .atx { width: 420px; } }
@media (max-width: 980px) {
  .ab-body { flex-direction: column; overflow-y: auto; }
  .ab-config { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); flex: none; }
  .ab-body .atx { width: 100%; flex: none; height: 620px; }
  .atx-body { min-height: 0; }
}

/* =========================================================================
   PLAN & USAGE — home banners + pipeline + settings plan cards
   ========================================================================= */

/* near-limit (subtle strip) */
.limit-banner.near {
  display: flex; align-items: center; gap: 13px;
  background: var(--warn-soft); border: 1px solid color-mix(in oklch, var(--warn) 32%, transparent);
  border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: 22px; cursor: pointer;
  transition: border-color .14s;
}
.limit-banner.near:hover { border-color: color-mix(in oklch, var(--warn) 55%, transparent); }
.limit-banner.near .lb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.lb-near-copy { font-size: 13.5px; color: var(--ink-2); }
.lb-near-copy b { color: var(--ink); font-weight: 700; }
.limit-banner.near .lb-meter { flex: 1; max-width: 200px; height: 6px; border-radius: var(--r-pill); background: color-mix(in oklch, var(--warn) 22%, var(--surface)); overflow: hidden; }
.limit-banner.near .lb-meter span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--warn); }
.lb-near-link { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }

/* limit reached (prominent action card) */
.limit-banner.reached {
  display: flex; align-items: center; gap: 20px;
  background: var(--warn-soft); border: 1px solid color-mix(in oklch, var(--warn) 38%, transparent);
  border-radius: var(--r-xl); padding: 22px 24px; margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.limit-banner.reached .lb-main { display: flex; gap: 16px; flex: 1; min-width: 0; }
.limit-banner.reached .lb-ico {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: var(--warn); color: oklch(1 0 0);
}
.lb-kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in oklch, var(--warn) 70%, var(--ink)); }
.limit-banner.reached h3 { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 4px; }
.limit-banner.reached p { font-size: 14px; color: var(--ink-2); line-height: 1.5; max-width: 540px; }
.limit-banner.reached p b { color: var(--ink); font-weight: 700; }
.lb-cta { flex: none; }

/* pending pipeline */
.pipeline-card { padding: 0; overflow: hidden; margin-bottom: 22px; }
.pl-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.pl-h h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.pl-h .sys { display: block; margin-top: 3px; color: var(--ink-3); }
.pl-head .paused-tag { margin-left: auto; }
.pl-list { display: flex; flex-direction: column; }
.pl-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.pl-row:last-child { border-bottom: 0; }
.pl-ai { width: 34px; height: 34px; flex: none; border-radius: var(--r-md); background: var(--sunken); display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 16px; }
.pl-txt { flex: 1; min-width: 0; }
.pl-top { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.pl-top b { font-weight: 700; }
.pl-snip { font-size: 13px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-t { font-size: 12px; color: var(--ink-4); white-space: nowrap; flex: none; }
.pl-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--sunken); }

/* settings — plan cards */
.plan-card { border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.plan-card.free { background: var(--surface); border: 1px solid var(--line); }
.plan-card.free.reached { border-color: color-mix(in oklch, var(--dn) 30%, transparent); }
.pc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pc-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.pc-status { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--ink-3); }
.pc-status.reached { border-color: color-mix(in oklch, var(--dn) 40%, transparent); color: var(--dn); background: var(--dn-soft); }
.pc-label { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.pc-meter-row { display: flex; align-items: baseline; justify-content: space-between; }
.pc-left { font-family: var(--font-display); font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.pc-left.ok { color: var(--ink); }
.pc-left.warn { color: var(--warn); }
.pc-left.danger { color: var(--dn); }
.pc-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.pc-meter { height: 8px; border-radius: var(--r-pill); background: var(--sunken); overflow: hidden; margin-top: 12px; }
.pc-meter span { display: block; height: 100%; border-radius: var(--r-pill); transition: width .4s ease; }
.pc-meter.ok span { background: var(--accent); }
.pc-meter.warn span { background: var(--warn); }
.pc-meter.danger span { background: var(--dn); }
.pc-meta { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin-top: 10px; }
.pc-paused { color: var(--dn); }
.pc-upsell { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px; background: var(--sunken); border-radius: var(--r-md); }
.pu-info { flex: 1; min-width: 0; }
.pu-h { font-family: var(--font-display); font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pu-price { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.pu-s { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* settings — pro card */
.plan-card.pro {
  display: flex; align-items: center; gap: 18px;
  background: var(--accent); border: 1px solid var(--accent-press); color: var(--on-accent);
}
.pc-badge { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; flex: none; }
.pc-pro-info { flex: 1; min-width: 0; }
.pc-pro-info .t { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.pc-pro-info .s { font-size: 13px; color: color-mix(in oklch, var(--on-accent) 72%, transparent); margin-top: 2px; }
.pc-manage { background: var(--on-accent); color: var(--accent); flex: none; }
.pc-manage:hover { background: var(--ink); }

/* any-comment toggle (trigger step) */
.any-comment-card {
  display: flex; align-items: center; gap: 13px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 13px 15px; margin-top: 16px; transition: border-color .14s, background .14s;
}
.any-comment-card:hover { border-color: var(--ink-4); }
.any-comment-card.on { border-color: var(--accent); background: var(--accent-soft); }
.any-comment-card .ac-star {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--sunken); color: var(--ink-2); transition: background .14s, color .14s;
}
.any-comment-card.on .ac-star { background: var(--accent); color: var(--on-accent); }
.any-comment-card .ac-info { flex: 1; min-width: 0; }
.any-comment-card .ac-t { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.any-comment-card .ac-s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

/* upgrade modal */
.upgrade-modal { max-width: 460px; position: relative; }
.upm-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink-3); z-index: 2; transition: background .14s, color .14s; }
.upm-close:hover { background: var(--surface); color: var(--ink); }
.upm-close i { font-size: 17px; }
.upm-hero { padding: 30px 28px 22px; background: var(--accent-soft); border-bottom: 1px solid var(--line-2); }
.upm-badge {
  display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 13px;
  letter-spacing: -.01em; color: var(--on-accent); background: var(--accent);
  padding: 3px 12px; border-radius: var(--r-pill); margin-bottom: 14px;
}
.upm-hero h2 { font-family: var(--font-display); font-weight: 700; font-size: 23px; letter-spacing: -.025em; line-height: 1.12; }
.upm-hero p { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.upm-perks { padding: 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.upm-perk { display: flex; align-items: flex-start; gap: 13px; }
.upm-pi {
  width: 34px; height: 34px; flex: none; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: var(--accent-soft); color: var(--accent-press);
}
.upm-pt .h { font-weight: 700; font-size: 14.5px; }
.upm-pt .s { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.upm-foot { padding: 20px 28px 24px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.upm-price { display: flex; align-items: baseline; gap: 4px; }
.upm-price b { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.upm-price span { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.upm-price em { font-family: var(--font-mono); font-size: 11px; font-style: normal; color: var(--ink-4); margin-left: 8px; }
.upm-actions { display: flex; align-items: center; gap: 8px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 80; display: flex; align-items: center; gap: 11px;
  background: var(--ink); color: var(--paper);
  padding: 13px 18px 13px 14px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  animation: toastIn .32s cubic-bezier(.2,.8,.2,1) both;
}
.toast-ico {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  background: var(--accent); color: var(--on-accent);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* newly published row highlight */
.auto-row.just-published { animation: rowPublish 2.6s ease both; }
@keyframes rowPublish {
  0%   { background: var(--accent-soft); }
  70%  { background: var(--accent-soft); }
  100% { background: transparent; }
}

/* =========================================================================
   PLANS & BILLING
   ========================================================================= */
.billing-inner { max-width: 680px; }

/* full-width secondary/primary buttons inside compare tiles */
.btn-block { width: 100%; justify-content: center; margin-top: auto; }

/* Pro "since" pill on the current-plan card */
.pc-since {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; flex: none;
  color: color-mix(in oklch, var(--on-accent) 78%, transparent);
  background: color-mix(in oklch, var(--on-accent) 14%, transparent);
  padding: 5px 11px; border-radius: var(--r-pill);
}

/* ---- Plan comparison ---------------------------------------------------- */
.plan-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cmp-tile {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm);
}
.cmp-tile.current { border-color: var(--line); }
.cmp-tile.pro { border-color: var(--accent-press); box-shadow: 0 0 0 1px var(--accent-press), var(--shadow-md); }
.cmp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cmp-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.cmp-current, .cmp-best {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; padding: 4px 9px; border-radius: var(--r-pill);
}
.cmp-current { color: var(--ink-2); background: var(--sunken); border: 1px solid var(--line); }
.cmp-current.on-accent { color: var(--on-accent); background: var(--accent); border-color: var(--accent-press); }
.cmp-best { color: var(--on-accent); background: var(--accent); }
.cmp-price { display: flex; align-items: baseline; gap: 3px; margin-top: 16px; }
.cmp-price b { font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: -.03em; }
.cmp-price span { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.cmp-note { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.cmp-feats { list-style: none; padding: 0; margin: 18px 0 20px; display: flex; flex-direction: column; gap: 11px; }
.cmp-feats li { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 1.35; }
.cmp-feats li i { font-size: 15px; margin-top: 1px; flex: none; }
.cmp-feats li.on { color: var(--ink); }
.cmp-feats li.on i { color: var(--accent-press); }
.cmp-feats li.off { color: var(--ink-4); }
.cmp-feats li.off i { color: var(--ink-4); }

/* ---- Payment method ----------------------------------------------------- */
.pay-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.pay-info { flex: 1; min-width: 0; }
.pay-info .h { font-weight: 600; font-size: 14.5px; }
.pay-info .s { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.card-mark {
  width: 46px; height: 32px; flex: none; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--ink) 0%, color-mix(in oklch, var(--ink) 70%, var(--accent)) 100%);
  position: relative;
}
.card-mark .cm-dot { position: absolute; top: 10px; width: 12px; height: 12px; border-radius: 50%; }
.card-mark .cm-dot.a { right: 18px; background: color-mix(in oklch, var(--accent) 80%, white); opacity: .9; }
.card-mark .cm-dot.b { right: 10px; background: var(--accent); mix-blend-mode: screen; }

.pay-empty, .inv-empty {
  display: flex; align-items: center; gap: 14px; padding: 20px;
}
.pe-ico, .ie-ico {
  width: 42px; height: 42px; flex: none; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--sunken); color: var(--ink-3);
}
.pe-txt .t, .ie-txt .t { font-weight: 600; font-size: 14.5px; }
.pe-txt .s, .ie-txt .s { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* ---- Next payment ------------------------------------------------------- */
.next-pay { display: grid; grid-template-columns: minmax(160px, 0.9fr) 1.1fr; gap: 0; overflow: hidden; }
.np-left {
  padding: 22px; background: var(--accent-soft);
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--line);
}
.np-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-press); }
.np-amt { font-family: var(--font-display); font-weight: 800; font-size: 38px; letter-spacing: -.03em; line-height: 1; margin-top: 8px; }
.np-when { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.np-right { padding: 18px 20px; display: flex; flex-direction: column; gap: 0; }
.np-line { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
.np-line .l { color: var(--ink-3); }
.np-line .r { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.np-on { color: var(--accent-press); font-size: 15px; }
.np-cancel { align-self: flex-start; margin-top: 12px; margin-left: -13px; color: var(--ink-3); background: transparent; border-radius: var(--r-sm); transition: background .14s, color .14s; }
.np-cancel:hover { color: var(--dn); background: var(--dn-soft); }

/* ---- Billing history ---------------------------------------------------- */
.inv-table { padding: 4px 0; }
.inv-head, .inv-row {
  display: grid; grid-template-columns: 1.6fr 1fr 0.9fr 44px;
  align-items: center; gap: 10px; padding: 0 18px;
}
.inv-head {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
  padding-top: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2);
}
.inv-row { padding-top: 13px; padding-bottom: 13px; border-bottom: 1px solid var(--line-2); }
.inv-row:last-child { border-bottom: 0; }
.inv-cell { min-width: 0; }
.inv-id .iv-no { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--ink); display: block; }
.inv-id .iv-desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: block; }
.inv-date { font-size: 13.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }
.iv-last {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-press); background: var(--accent-soft);
  padding: 2px 7px; border-radius: var(--r-pill); align-self: flex-start;
}
.inv-amt { font-weight: 700; font-size: 14px; display: flex; align-items: baseline; gap: 8px; }
.inv-head .inv-amt, .inv-head .inv-act { justify-self: end; font-weight: 700; }
.iv-paid {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--up); background: var(--up-soft); padding: 2px 7px; border-radius: var(--r-pill);
}
.inv-row .inv-amt { justify-self: end; }
.inv-act { justify-self: end; }
.iv-dl {
  width: 34px; height: 34px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); border: 1px solid var(--line); background: var(--surface); font-size: 15px;
  transition: background .14s, color .14s, border-color .14s;
}
.iv-dl:hover { background: var(--sunken); color: var(--ink); border-color: var(--ink-4); }

@media (max-width: 560px) {
  .plan-compare { grid-template-columns: 1fr; }
  .next-pay { grid-template-columns: 1fr; }
  .np-left { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* =========================================================================
   AUTOMATIONS — redesigned list (rows / grid, quick stats, inline edit)
   ========================================================================= */
.autos-content { display: flex; flex-direction: column; min-height: 0; padding-bottom: 26px; }
.autos-content > * { width: 100%; }
.autos-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; }

/* search clear button inside the pill */
.ct-search-x { flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; color: var(--ink-3); background: var(--raised); transition: background .12s, color .12s; }
.ct-search-x:hover { background: var(--ink); color: var(--surface); }

/* status segmented control in the toolbar */
.a-statusseg { display: inline-flex; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.a-seg-b { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 5px 12px; border-radius: var(--r-pill); transition: background .14s, color .14s; white-space: nowrap; }
.a-seg-b:hover { color: var(--ink); }
.a-seg-b.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.a-seg-n { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--ink-4); }
.a-seg-b.on .a-seg-n { color: var(--accent-press); }

/* layout toggle */
.a-layout-toggle { display: inline-flex; gap: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; flex: none; }
.a-layout-toggle button { width: 30px; height: 28px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 15px; transition: background .14s, color .14s; }
.a-layout-toggle button:hover { color: var(--ink); }
.a-layout-toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

.flt-div { height: 1px; background: var(--line-2); margin: 4px 6px; }

/* the scrollable list / grid region */
.autos-shell .ct-countbar .ct-count { white-space: nowrap; }
.autos-shell .ct-countbar .ct-check { opacity: 0; transition: opacity .12s; }
.autos-shell .ct-countbar:hover .ct-check { opacity: 1; }
.autos-list, .autos-grid { flex: 1; min-height: 0; overflow-y: auto; }
.autos-list { display: flex; flex-direction: column; }
.autos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 16px; align-content: start; }

/* status pill */
.st-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px 3px 8px; border-radius: var(--r-pill); white-space: nowrap; letter-spacing: .01em; }
.st-pill .st-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.st-pill.live { background: var(--sunken); color: var(--ink-2); }
.st-pill.live .st-dot { background: var(--accent-press); animation: stbeat 1.8s ease-in-out infinite; }
.st-pill.paused { background: var(--warn-soft, color-mix(in oklch, var(--warn) 16%, transparent)); color: var(--warn); }
.st-pill.paused .st-dot { background: var(--warn); }
.st-pill.draft { background: var(--sunken); color: var(--ink-3); }
.st-pill.draft .st-dot { background: var(--ink-4); }
@keyframes stbeat { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }
.st-pill.arch { background: var(--sunken); color: var(--ink-3); }
.st-pill.arch .st-arch-i { font-size: 12px; }

/* =========================================================================
   ARCHIVE
   ========================================================================= */
/* subtle archived link in the count bar */
.ct-archlink {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  padding: 4px 10px; border-radius: var(--r-pill);
  transition: background .14s, color .14s;
}
.ct-archlink i { font-size: 14px; color: var(--ink-4); transition: color .14s; }
.ct-archlink:hover { background: var(--sunken); color: var(--ink); }
.ct-archlink:hover i { color: var(--ink-2); }

/* archived-view banner */
.ct-archbanner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; margin: 0 0 2px;
  background: var(--sunken); border-bottom: 1px solid var(--line);
  color: var(--ink-2); font-size: 13px;
}
.ct-archbanner .cab-ico { font-size: 15px; color: var(--ink-3); flex: none; }
.ct-archbanner .cab-txt { flex: 1; }
.ct-archbanner .cab-back {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  padding: 5px 11px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  transition: background .14s, border-color .14s;
}
.ct-archbanner .cab-back:hover { background: var(--paper); border-color: var(--ink-4); }

/* muted archived rows */
.auto-row.archived { background: color-mix(in oklab, var(--sunken) 60%, var(--surface)); }
.auto-row.archived:hover { background: color-mix(in oklab, var(--sunken) 60%, var(--surface)); }
.auto-row.archived .a-name { color: var(--ink-2); }
.auto-row.archived .a-ico { opacity: .7; }
.auto-row.archived .a-stats, .auto-card.archived .ac-stats { opacity: .7; }
.auto-card.archived { background: color-mix(in oklab, var(--sunken) 60%, var(--surface)); }
.ar-restore { flex: none; white-space: nowrap; }

/* undo snackbar */
.undo-snack {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 90; display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper);
  padding: 11px 12px 11px 16px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  animation: toastIn .32s cubic-bezier(.2,.8,.2,1) both;
}
.undo-snack .us-ico { font-size: 15px; color: color-mix(in oklab, var(--paper) 72%, transparent); flex: none; }
.undo-snack .us-msg { font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.undo-snack .us-undo {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12.5px; font-weight: 700; color: var(--paper);
  padding: 6px 12px; border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--paper) 16%, transparent);
  transition: background .14s;
}
.undo-snack .us-undo:hover { background: color-mix(in oklab, var(--paper) 26%, transparent); }
.undo-snack .us-x {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  color: color-mix(in oklab, var(--paper) 65%, transparent); transition: background .14s, color .14s;
}
.undo-snack .us-x:hover { background: color-mix(in oklab, var(--paper) 16%, transparent); color: var(--paper); }

/* inline-editable name */
.a-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; color: var(--ink); text-align: left; border-radius: var(--r-sm); }
.a-name .a-name-pen { font-size: 12px; color: var(--ink-4); opacity: 0; transition: opacity .12s; }
.a-name:hover .a-name-pen { opacity: 1; }
.a-name-input { font-family: var(--font-body, inherit); font-weight: 600; font-size: 14.5px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--accent); border-radius: var(--r-sm); padding: 3px 8px; outline: none; min-width: 180px; max-width: 320px; }

/* quick-stat cell */
.a-stat { width: 86px; flex: none; }
.a-stat .as-v { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: var(--ink); display: inline-flex; align-items: baseline; gap: 4px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.a-stat .as-v .as-i { font-size: 12px; color: var(--ink-4); position: relative; top: 1px; }
.a-stat.accent .as-v .as-i { color: var(--accent-press); }
.a-stat .as-k { font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

/* ---- ROW layout ---- */
.auto-row { display: block; padding: 0; border-bottom: 1px solid var(--line-2); transition: background .14s; }
.auto-row:last-child { border-bottom: 0; }
.auto-row:hover { background: var(--sunken); }
.auto-row.open { background: var(--sunken); }
.auto-row.checked { background: var(--accent-soft); }
.ar-main { display: flex; align-items: center; gap: 13px; padding: 13px 16px; cursor: pointer; }
.ar-check { flex: none; }

/* checkbox hidden upfront — overlays the flow icon on hover / when selecting */
.ar-select { position: relative; width: 38px; height: 38px; flex: none; }
.ar-select .a-ico { position: absolute; inset: 0; transition: opacity .12s; }
.ar-select .ar-check { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .12s; }
.auto-row:hover .ar-select .ar-check,
.auto-row.checked .ar-select .ar-check,
.autos-list.has-selection .ar-select .ar-check { opacity: 1; pointer-events: auto; }
.auto-row:hover .ar-select .a-ico,
.auto-row.checked .ar-select .a-ico,
.autos-list.has-selection .ar-select .a-ico { opacity: 0; pointer-events: none; }
.dens-compact .ar-main { padding: 9px 16px; }
.auto-row .a-ico { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--sunken); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; transition: background .14s, opacity .12s; }
.auto-row .a-ico i { font-size: 17px; color: var(--ink-2); }
.auto-row.live .a-ico { background: var(--accent-soft); border-color: transparent; }
.auto-row.live .a-ico i { color: var(--accent-press); }
.auto-row .a-info { min-width: 0; flex: 1; }
.auto-row .a-info .h { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.auto-row .a-info .s { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.dens-compact .auto-row .a-info .s { display: none; }
.auto-row.is-agent.live .a-ico, .auto-card.is-agent.live .a-ico { background: var(--tertiary-soft); border-color: transparent; }
.auto-row.is-agent.live .a-ico i, .auto-card.is-agent.live .a-ico i { color: var(--tertiary); }
.a-agent-tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); background: var(--sunken); border-radius: var(--r-xs); padding: 2px 7px; }
.a-agent-tag i { font-size: 10px; }
.auto-row .a-info .s.a-instr { max-width: 520px; }
.a-stats { display: flex; align-items: center; gap: 12px; flex: none; padding-right: 4px; }
.a-stats .a-stat { text-align: left; }
.ar-controls { display: flex; align-items: center; gap: 8px; flex: none; }

/* per-flow zero-state (no DMs sent yet) */
.a-zero { display: flex; align-items: center; gap: 11px; }
.a-zero .az-ico { width: 34px; height: 34px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; background: var(--sunken); border: 1px dashed var(--ink-4); color: var(--ink-3); font-size: 16px; }
.a-zero .az-t { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.a-zero .az-s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
/* row variant: sits where the stat strip would, right-aligned before controls */
.a-zero-row { flex: none; width: 282px; box-sizing: border-box; }
.dens-compact .a-zero-row .az-s { display: none; }
/* draft flows get a warm nudge on the icon */
.auto-row:not(.live) .a-zero-row .az-ico,
.auto-card:not(.live) .a-zero-card .az-ico { border-color: var(--accent); color: var(--accent-press); background: var(--accent-soft); border-style: dashed; }
/* card variant: fills the stats area, centered, dashed frame */
.a-zero-card { flex-direction: column; text-align: center; gap: 9px; padding: 18px 14px; margin-top: 12px; border-top: 1px dashed var(--line); }
.a-zero-card .az-txt { display: flex; flex-direction: column; align-items: center; }
.dens-compact .a-zero-card { padding: 13px 14px; }
.ar-caret i { transition: transform .16s cubic-bezier(.2,.8,.2,1); }
.auto-row.open .ar-caret i { transform: rotate(180deg); }
@media (max-width: 780px) { .a-stat:nth-child(3) { display: none; } .a-zero-row { width: 184px; } }
@media (max-width: 620px) { .a-stats { gap: 12px; } .a-stat:nth-child(2) { display: none; } .a-zero-row { width: 86px; } .a-zero-row .az-txt { display: none; } }

/* ---- expandable mini-editor ---- */
.a-expand { padding: 4px 16px 16px 67px; animation: axIn .18s ease both; }
.dens-compact .a-expand { padding-left: 16px; }
.auto-card .a-expand { padding: 0 16px 16px; }
@keyframes axIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ax-grid { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 14px; margin-bottom: 14px; }
.auto-card .ax-grid { grid-template-columns: 1fr; gap: 10px; }
.ax-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; }
.ax-lbl { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 8px; }
.ax-trigger { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ax-tt { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ax-tt i { font-size: 14px; color: var(--ink-3); }
.ax-arrow { font-size: 13px; color: var(--ink-4); }
.ax-reply { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.ax-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- CARD layout ---- */
.auto-card { position: relative; cursor: pointer; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); transition: box-shadow .14s, border-color .14s; }
.auto-card:hover { box-shadow: var(--shadow-md); border-color: var(--ink-4); }
.auto-card.checked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.auto-card.live { border-color: color-mix(in oklch, var(--accent) 40%, var(--line)); }
.ac-top { display: flex; align-items: center; gap: 10px; padding: 13px 14px 0; }
.ac-controls { display: flex; align-items: center; gap: 4px; }
.auto-card .a-ico { width: 34px; height: 34px; border-radius: var(--r-md); background: var(--sunken); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; transition: opacity .12s; }
.auto-card .a-ico i { font-size: 16px; color: var(--ink-2); }
.auto-card.live .a-ico { background: var(--accent-soft); border-color: transparent; }
.auto-card.live .a-ico i { color: var(--accent-press); }
/* card checkbox hidden upfront — overlays the icon on hover / when selecting */
.ac-check { position: absolute; top: 13px; left: 14px; width: 34px; height: 34px; z-index: 2; display: flex; align-items: center; justify-content: center; background: var(--surface); border-radius: var(--r-md); opacity: 0; pointer-events: none; transition: opacity .12s; }
.auto-card:hover .ac-check,
.auto-card.checked .ac-check,
.autos-grid.has-selection .ac-check { opacity: 1; pointer-events: auto; }
.auto-card:hover .ac-top .a-ico,
.auto-card.checked .ac-top .a-ico,
.autos-grid.has-selection .ac-top .a-ico { opacity: 0; }
.ac-body { padding: 11px 14px 0; }
.ac-name { font-weight: 600; }
.ac-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.dens-compact .ac-desc { -webkit-line-clamp: 1; min-height: 0; }

/* trigger keyword + details line */
.a-trig { display: inline-flex; align-items: center; gap: 5px; }
.a-trig-i { font-size: 11px; color: var(--ink-4); flex: none; }
.ac-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; padding: 14px; margin-top: 12px; border-top: 1px solid var(--line-2); }

/* ⋯ menu portaled to a fixed position so the scroll container can't clip it */
.row-menu-fixed { position: fixed; top: 0; left: 0; z-index: 3000; width: 160px; min-width: 160px; }
.a-name { cursor: inherit; }
.dens-compact .ac-stats { padding: 11px 14px; gap: 9px 10px; }
.ac-foot { display: flex; align-items: center; gap: 8px; padding: 0 14px 14px; }
.ac-edit { flex: 1; justify-content: center; }

/* keep the publish highlight working on both */
.auto-row.just-published, .auto-card.just-published { animation: rowPublish 2.6s ease both; }

/* disabled nav item + "Soon" tag */
.nav-item.disabled { cursor: not-allowed; color: var(--ink-3); }
.nav-item.disabled:hover { background: transparent; color: var(--ink-3); }
.nav-item.disabled i { color: var(--ink-4); }
.nav-item.disabled:hover i { color: var(--ink-4); }
.soon-tag {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 2px 8px; white-space: nowrap;
}

/* =========================================================================
   COMING SOON
   ========================================================================= */
.cs-content { display: flex; align-items: center; justify-content: center; min-height: calc(100% - 20px); }
.cs-content > * { margin: 0; }
.cs-card {
  position: relative; overflow: hidden;
  width: 100%; max-width: 560px;
  padding: 44px 44px 38px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  animation: csIn .5s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes csIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cs-glow {
  position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 380px; height: 300px; pointer-events: none;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 72%);
  opacity: .75;
}
.cs-ico {
  position: relative;
  width: 74px; height: 74px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-press);
  font-size: 34px; margin-bottom: 22px;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 40%, transparent);
}
.cs-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); margin-bottom: 12px; }
.cs-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-press);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent);
  animation: csPulse 1.9s ease-out infinite;
}
@keyframes csPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}
.cs-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 27px; letter-spacing: -.028em; line-height: 1.08; color: var(--ink);
  text-wrap: balance;
}
.cs-blurb {
  font-size: 15px; line-height: 1.55; color: var(--ink-2);
  margin-top: 12px; max-width: 44ch; text-wrap: pretty;
}
.cs-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  width: 100%; margin: 28px 0 30px;
}
.cs-feat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  padding: 15px 14px; border-radius: var(--r-md);
  background: var(--sunken); border: 1px solid var(--line-2); text-align: left;
}
.cs-feat-ico {
  width: 34px; height: 34px; border-radius: var(--r-sm); flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 17px;
}
.cs-feat-t { font-weight: 600; font-size: 13.5px; color: var(--ink); line-height: 1.2; }
.cs-feat-s { font-size: 12px; color: var(--ink-3); line-height: 1.35; margin-top: 3px; }
.cs-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cs-eta { color: var(--ink-4); }

@media (max-width: 720px) {
  .cs-features { grid-template-columns: 1fr; }
}

/* =========================================================================
   AI-FIRST — Home prompt bar, AI flow builder, Connect AI, agent building
   ========================================================================= */

/* ---- Sidebar "New" badge ---- */
.nav-new {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent);
  padding: 2px 7px; border-radius: var(--r-pill); line-height: 1.4;
}
.nav-item.active .nav-new { background: var(--accent); }

/* ---- Home AI prompt bar ---- */
.home-aibar {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 22px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.home-aibar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 100% 0%, var(--accent-soft) 0%, transparent 46%);
  opacity: .7;
}
.hab-spark {
  width: 40px; height: 40px; flex: none; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--tertiary); color: var(--on-tertiary); box-shadow: var(--shadow-xs);
  position: relative;
}
.hab-main { flex: 1; min-width: 0; position: relative; }
.hab-inputrow {
  display: flex; align-items: center; gap: 10px;
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 6px 6px 6px 16px;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.hab-inputrow:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.hab-inputrow input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 14.5px; color: var(--ink); font-family: var(--font-sans);
}
.hab-inputrow input::placeholder { color: var(--ink-3); }
.hab-inputrow .btn { flex: none; }
.hab-examples { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.hab-examples .sys { color: var(--ink-4); margin-right: 2px; }
.hab-ex {
  font-size: 12.5px; color: var(--ink-2); font-weight: 500;
  background: var(--sunken); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 5px 12px;
  transition: background .12s, border-color .12s, color .12s;
}
.hab-ex:hover { background: var(--accent-soft); border-color: oklch(0.88 0.09 126); color: var(--ink); }

/* ---- New-flow modal: AI CTA ---- */
.ai-flow-cta {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: var(--r-lg);
  padding: 16px 18px; margin-bottom: 18px;
  transition: transform .12s cubic-bezier(0.2,0.8,0.2,1), box-shadow .14s;
  box-shadow: var(--shadow-md);
}
.ai-flow-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.afc-spark {
  width: 42px; height: 42px; flex: none; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: var(--tertiary-mellow); color: var(--on-tertiary);
}
.afc-body { flex: 1; min-width: 0; }
.afc-t { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.015em; }
.afc-badge {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--accent); color: var(--on-accent);
  padding: 2px 7px; border-radius: var(--r-pill);
}
.afc-s { font-size: 13px; color: oklch(0.82 0.004 95); margin-top: 3px; }
.afc-arrow { font-size: 18px; color: var(--paper); flex: none; opacity: .7; }
.ai-flow-cta:hover .afc-arrow { opacity: 1; }

/* ---- New-flow modal: chat box ---- */
.nf-chat {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--accent);
  border-radius: var(--r-lg); padding: 14px 14px 12px;
  box-shadow: 0 0 0 4px var(--accent-soft);
  margin-bottom: 22px;
}
.nf-chat-top { display: flex; align-items: flex-start; gap: 12px; }
.nf-chat-spark {
  width: 30px; height: 30px; flex: none; border-radius: var(--r-md); margin-top: 2px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--tertiary-mellow); color: var(--on-tertiary);
}
.nf-chat-input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: var(--font-sans); font-size: 14.5px; line-height: 1.5; color: var(--ink);
  resize: none; min-height: 46px; padding: 4px 0;
}
.nf-chat-input::placeholder { color: var(--ink-4); }

.nf-chat-files { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 42px; }
.nf-file {
  display: inline-flex; align-items: center; gap: 7px; max-width: 220px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 5px 6px 5px 11px; font-size: 12.5px; color: var(--ink-2);
}
.nf-file > i { font-size: 13px; color: var(--tertiary-mellow); flex: none; }
.nf-file-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-file-x {
  width: 18px; height: 18px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); transition: background .12s, color .12s;
}
.nf-file-x:hover { background: var(--raised); color: var(--ink); }
.nf-file-x i { font-size: 10px; }

.nf-chat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nf-chat-tools { display: flex; align-items: center; gap: 6px; }
.nf-tool {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 6px 13px; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2);
  cursor: pointer; transition: border-color .14s, color .14s, background .14s;
}
.nf-tool:hover { border-color: var(--ink-4); color: var(--ink); background: var(--sunken); }
.nf-tool i { font-size: 15px; }
.nf-chat-send { flex: none; }

/* ---- New-flow modal: card layout ---- */
.modal.nf-modal { max-width: 940px; max-height: 90vh; display: flex; flex-direction: column; }
.nf-modal .modal-head { border-bottom: 0; padding: 22px 28px 2px; flex: none; }
.nf-body { padding: 16px 28px 24px; overflow-y: auto; }
.nf-body .nf-chat { margin-bottom: 16px; }

.nf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.nf-card {
  display: flex; flex-direction: column; text-align: left; position: relative;
  padding: 14px 14px 14px; border: 1px solid var(--line);
  border-radius: 18px; background: var(--surface); cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.nf-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); transform: translateY(-3px); }

/* coming-soon (disabled) state */
.nf-card.is-soon { cursor: default; }
.nf-card.is-soon:hover { border-color: var(--line); box-shadow: none; transform: none; }
.nf-card.is-soon .nf-art { filter: grayscale(.45); opacity: .5; }
.nf-card.is-soon .nf-cat,
.nf-card.is-soon .nf-t,
.nf-card.is-soon .nf-s { color: var(--ink-4); }
.nf-card.is-soon .nf-start { color: var(--ink-4); }
.nf-card.is-soon .nf-start i { display: none; }
.nf-soon {
  position: absolute; top: 24px; right: 24px; z-index: 2;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 4px 10px; box-shadow: var(--shadow-xs);
}
.nf-soon.nf-new { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.nf-card:active { transform: translateY(-1px); }

.nf-art {
  height: 104px; border-radius: 12px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.nf-card.tone-lime .nf-art { background: linear-gradient(152deg, #e8f3bd, #f7fadf 72%); }
.nf-card.tone-blue .nf-art { background: linear-gradient(152deg, #cee2fb, #ecf4fe 72%); }
.nf-card.tone-pink .nf-art { background: linear-gradient(152deg, #fbd9e3, #fdeef1 72%); }
[data-theme="dark"] .nf-card.tone-lime .nf-art { background: linear-gradient(152deg, #3a4118, #23260f 74%); }
[data-theme="dark"] .nf-card.tone-blue .nf-art { background: linear-gradient(152deg, #1e3352, #14203a 74%); }
[data-theme="dark"] .nf-card.tone-pink .nf-art { background: linear-gradient(152deg, #4a2330, #2c1620 74%); }

.nf-cat {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--ink-4);
}
.nf-t {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  letter-spacing: -.022em; line-height: 1.15; color: var(--ink); margin-top: 8px;
}
.nf-s { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; margin: 4px 0 12px; }
.nf-start {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 13.5px; color: var(--ink);
  padding: 9px 0 2px; margin-top: auto; border-top: 1px solid var(--line-2);
}
.nf-start i { color: var(--ink-3); font-size: 16px; transition: transform .16s, color .16s; }
.nf-card:hover .nf-start i { transform: translateX(4px); color: var(--ink); }

.nf-foot { justify-content: center; border-top: 0; padding-top: 6px; padding-bottom: 22px; }
.nf-browse {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: 0;
  font-family: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink-2);
  cursor: pointer; padding: 7px 14px; border-radius: var(--r-pill); transition: background .14s, color .14s;
}
.nf-browse:hover { color: var(--ink); background: var(--sunken); }
.nf-browse i { font-size: 15px; }

/* flow illustrations — native-surface scenes */
.nf-art { --g: #dde0e4; --g2: #c8ccd2; --bub: #eceef1; --media: linear-gradient(135deg, #e2e5ea, #eef0f4); }
[data-theme="dark"] .nf-art { --g: rgba(255,255,255,.2); --g2: rgba(255,255,255,.34); --bub: rgba(255,255,255,.13); --media: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.07)); }

.art { position: relative; display: flex; align-items: center; justify-content: center; }
.nf-art .art { transform: scale(.78); }
.a-plane {
  position: absolute; right: -9px; bottom: -9px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 9px rgba(0,0,0,.2); border: 2.5px solid var(--surface);
}
.a-plane i { font-size: 13px; color: var(--on-accent); }

/* comment → post scene */
.a-post {
  position: relative; width: 130px; background: var(--surface); border-radius: 14px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.09);
}
.a-post .ap-media { height: 44px; border-radius: 9px; background: var(--media); }
.a-post .ap-acts { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.a-post .ap-acts i { font-size: 14px; color: var(--g2); }
.a-post .ap-acts i:first-child { color: #e8558a; }
.a-post .ap-cmt { display: flex; align-items: center; gap: 7px; }
.a-post .ap-av { width: 15px; height: 15px; border-radius: 50%; background: var(--g2); flex: none; }
.a-post .ap-line { flex: 1; height: 8px; border-radius: 4px; background: var(--g); }

/* story scene */
.a-story {
  position: relative; width: 80px; height: 116px; border-radius: 16px; padding: 9px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, #a9cdf7, #d3e6fc); box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
[data-theme="dark"] .a-story { background: linear-gradient(160deg, #274468, #1b2c44); }
.a-story .as-ring { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2.5px solid #4a86e0; }
.a-story .as-reply { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.92); border-radius: 20px; padding: 5px 8px; }
[data-theme="dark"] .a-story .as-reply { background: rgba(255,255,255,.18); }
.a-story .as-heart { display: flex; }
.a-story .as-heart i { font-size: 11px; color: #e8558a; }
.a-story .as-rl { flex: 1; height: 6px; border-radius: 3px; background: #b9c0c8; }
[data-theme="dark"] .a-story .as-rl { background: rgba(255,255,255,.4); }

/* dm chat scene */
.a-chat {
  width: 138px; background: var(--surface); border-radius: 14px; padding: 11px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.09);
}
.a-chat .ac-head { display: flex; align-items: center; gap: 7px; margin-bottom: 1px; }
.a-chat .ac-av { width: 18px; height: 18px; border-radius: 50%; background: var(--g2); }
.a-chat .ac-nm { width: 50px; height: 7px; border-radius: 4px; background: var(--g); }
.a-chat .ac-in { align-self: flex-start; background: var(--bub); border-radius: 11px 11px 11px 4px; padding: 8px 9px; display: flex; flex-direction: column; gap: 5px; }
.a-chat .ac-out { align-self: flex-end; background: var(--accent); border-radius: 11px 11px 4px 11px; padding: 8px 9px; display: flex; flex-direction: column; gap: 5px; }
.a-chat .ac-in .l { height: 5px; border-radius: 3px; background: var(--g2); }
.a-chat .ac-in .l.a { width: 46px; } .a-chat .ac-in .l.b { width: 30px; }
.a-chat .ac-out .l { height: 5px; border-radius: 3px; background: var(--on-accent); opacity: .85; }
.a-chat .ac-out .l.a { width: 42px; } .a-chat .ac-out .l.b { width: 26px; }

@media (max-width: 820px) {
  .nf-grid { grid-template-columns: 1fr; }
  .nf-agent-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ---- New-flow modal: AI agent picks ---- */
.nf-agents-head { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; }
.nf-ah-line { flex: 1; height: 1px; background: var(--line); }
.nf-ah-txt { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.nf-ah-txt i { font-size: 13px; color: var(--tertiary-mellow); }
.nf-agent-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.nf-agent {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color .16s, box-shadow .16s, transform .12s;
}
.nf-agent:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.nf-agent:active { transform: none; }
.nf-agent-ico {
  width: 38px; height: 38px; border-radius: var(--r-md); flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--tertiary-soft); color: var(--tertiary-mellow); font-size: 19px;
}
.nf-agent-body { flex: 1; min-width: 0; }
.nf-agent-tr { display: flex; align-items: center; gap: 7px; }
.nf-agent-t { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.015em; }
.nf-agent-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--tertiary-mellow); background: var(--tertiary-soft); border-radius: var(--r-pill); padding: 2px 6px;
}
.nf-agent-badge i { font-size: 9px; }
.nf-agent-s { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.35; margin-top: 2px; }
.nf-agent-arrow { flex: none; font-size: 15px; color: var(--ink-4); transition: transform .16s, color .16s; }
.nf-agent:hover .nf-agent-arrow { transform: translateX(3px); color: var(--ink-2); }
.nf-agent.create { background: var(--surface); border-style: dashed; border-color: var(--line); }
.nf-agent.create:hover { border-color: var(--line-2); }
.nf-agent.create .nf-agent-ico { background: var(--sunken); color: var(--ink-3); }
.nf-agent.create .nf-agent-arrow { color: var(--ink-4); }

/* ---- Builder "generated with AI" tag ---- */
.ai-made-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  color: var(--accent-press); background: var(--accent-soft);
  border: 1px solid oklch(0.88 0.09 126);
  padding: 3px 9px; border-radius: var(--r-pill);
}
.ai-made-tag i { font-size: 12px; }

/* ---- AI flow builder ---- */
.aiflow-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.aiflow-spark { background: var(--tertiary-mellow) !important; color: var(--on-tertiary) !important; }

/* background-agent context bar */
.aiflow-agentbar {
  flex: none; display: flex; align-items: center; gap: 11px;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: var(--tertiary-mellow); color: var(--ink-2); font-size: 13px;
}
.aiflow-agentbar .afa-ico {
  width: 28px; height: 28px; flex: none; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--surface); color: var(--on-tertiary); box-shadow: var(--shadow-xs);
}
.aiflow-agentbar .afa-txt { min-width: 0; }
.aiflow-agentbar .afa-txt b { color: var(--ink); font-weight: 600; }
.aiflow-agentbar .afa-files { display: flex; gap: 6px; margin-left: 6px; flex-wrap: wrap; }
.aiflow-agentbar .afa-file {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 3px 9px; font-size: 11.5px; color: var(--ink-2);
}
.aiflow-agentbar .afa-file i { font-size: 12px; color: var(--ink-3); }
.aiflow-agentbar .afa-link {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--accent-press); cursor: pointer; white-space: nowrap;
}
.aiflow-agentbar .afa-link i { font-size: 11px; }
.aiflow-agentbar .afa-link:hover { text-decoration: underline; }

/* single-column conversational thread */
.aiflow-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--paper); }
.aift-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 24px 18px; }
.aift-inner { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.aift-compose { flex: none; border-top: 1px solid var(--line-2); background: var(--paper); padding: 14px 24px 12px; }
.aift-composeinner { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.aift-hint { max-width: 720px; margin: 9px auto 4px; text-align: center; color: var(--ink-4); font-size: 11px; }

.aifc-colwide { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* building card (inline) */
.aifc-buildcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px; padding: 15px 17px; box-shadow: var(--shadow-xs);
  min-width: 250px;
}
.aifc-buildhead { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 14px; }
.aifc-buildspin { width: 15px; height: 15px; flex: none; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: aiflowspin .7s linear infinite; }
@keyframes aiflowspin { to { transform: rotate(360deg); } }
.aifc-buildsteps { display: flex; flex-direction: column; gap: 11px; }
.aifc-bstep { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); opacity: 0; animation: bstepIn .4s ease forwards; }
.aifc-bcheck { width: 20px; height: 20px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; background: var(--accent); color: var(--on-accent); }

/* finished flow — inline artifact card */
.aifc-flowcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden;
  animation: nodeIn .34s cubic-bezier(0.2,0.8,0.2,1) both;
}
.aifc-flowhead { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.aifc-flowicon { width: 38px; height: 38px; flex: none; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--accent-soft); color: var(--accent-press); }
.aifc-flowtitles { flex: 1; min-width: 0; }
.aifc-flowname { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; letter-spacing: -.015em; }
.aifc-flowbody { padding: 24px 18px; background: var(--sunken); position: relative; }
.aifc-flowbody::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; opacity: .5; }
[data-theme="dark"] .aifc-flowbody::before { background-image: radial-gradient(oklch(0.285 0.006 80) 1px, transparent 1px); }
.aifc-flowbody .aifp-flow { position: relative; z-index: 1; }
.aifc-flowactions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); }

/* chat side */
.aiflow-chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--paper); }
.aifc-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 26px 12px; display: flex; flex-direction: column; gap: 16px; }
.aifc-scroll > * { max-width: 560px; width: 100%; margin: 0 auto; }
.aifc-user {
  align-self: flex-end; max-width: 82%;
  background: var(--accent); color: var(--on-accent);
  border-radius: 16px 16px 4px 16px; padding: 10px 14px;
  font-size: 14px; line-height: 1.5; margin-left: auto;
  box-shadow: var(--shadow-xs);
}
.aifc-airow { display: flex; gap: 10px; align-items: flex-start; }
.aifc-av {
  width: 30px; height: 30px; flex: none; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--tertiary-mellow); color: var(--on-tertiary);
}
.aifc-abubble {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px; padding: 12px 15px;
  font-size: 14px; line-height: 1.55; color: var(--ink); max-width: 88%;
  box-shadow: var(--shadow-xs);
}
.aifc-abubble b { font-weight: 700; }
.aifc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.aifc-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 8px 14px;
  font-size: 13px; font-weight: 600; color: var(--ink);
  transition: background .12s, border-color .12s, transform .1s;
}
.aifc-chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.aifc-chip:active { transform: scale(0.97); }
.aifc-pro {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--tertiary); background: var(--tertiary-soft);
  padding: 1px 6px; border-radius: var(--r-pill);
}
.aifc-abubble.typing { display: inline-flex; gap: 4px; align-items: center; padding: 15px; }

/* inline post picker */
.aifc-postgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; width: 300px; max-width: 100%; }
.aifc-post { display: flex; flex-direction: column; text-align: left; border-radius: var(--r-md); overflow: hidden; border: 1.5px solid var(--line); background: var(--surface); transition: border-color .12s, transform .1s, box-shadow .12s; }
.aifc-post:not(:disabled):hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.aifc-post:not(:disabled):active { transform: scale(0.98); }
.aifc-post.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.aifc-post:disabled { cursor: default; opacity: .55; }
.aifc-post.picked:disabled { opacity: 1; }
.aifc-post-thumb { position: relative; height: 62px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: var(--sunken); }
.aifc-post-kind { position: absolute; top: 5px; left: 5px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; border-radius: var(--r-pill); }
.aifc-post-check { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; background: var(--accent); color: var(--on-accent); }
.aifc-post-cap { padding: 7px 9px; font-size: 11.5px; font-weight: 600; color: var(--ink); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aifp-postemoji { font-size: 20px; line-height: 1; }

.aifc-abubble.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); animation: dm-blink 1.2s infinite; }
.aifc-abubble.typing span:nth-child(2) { animation-delay: .18s; }
.aifc-abubble.typing span:nth-child(3) { animation-delay: .36s; }
.aifc-compose { flex: none; display: flex; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line-2); background: var(--paper); }
.aifc-compose > * { max-width: 560px; }
.aifc-compose .input { margin: 0 auto; }

/* preview side */
.aiflow-preview { display: flex; flex-direction: column; min-height: 0; background: var(--sunken); position: relative; }
.aiflow-preview::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5;
}
[data-theme="dark"] .aiflow-preview::before { background-image: radial-gradient(oklch(0.285 0.006 80) 1px, transparent 1px); }
.aifp-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--surface);
  position: relative; z-index: 1;
}
.aifp-ready {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent-press);
}
.aifp-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 30px 28px; position: relative; z-index: 1; }
.aifp-empty {
  max-width: 300px; margin: 40px auto 0; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.aifp-empty-ico {
  width: 60px; height: 60px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: var(--surface); border: 1px dashed var(--ink-4); color: var(--ink-3); margin-bottom: 16px;
}
.aifp-empty-t { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.aifp-empty-s { font-size: 13px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }

.aifp-building { max-width: 300px; margin: 30px auto 0; display: flex; flex-direction: column; gap: 12px; }
.aifp-bstep {
  display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: var(--ink-2); font-weight: 500;
  opacity: 0; animation: bstepIn .4s ease forwards;
}
.aifp-bcheck {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  background: var(--accent); color: var(--on-accent);
}
@keyframes bstepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.aifp-flow { max-width: 360px; margin: 0 auto; }
.aifp-node {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.aifp-node.appear { animation: nodeIn .34s cubic-bezier(0.2,0.8,0.2,1) both; }
@keyframes nodeIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.aifp-node .nhead { display: flex; align-items: center; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.aifp-node .nhead .ni { width: 30px; height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex: none; background: var(--sunken); }
.aifp-node .nhead .ni i { font-size: 16px; color: var(--ink-2); }
.aifp-node .nhead .nt { font-weight: 600; font-size: 13.5px; flex: 1; }
.aifp-node .nbody { padding: 15px 16px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.aifp-node .nbody b { color: var(--ink); font-weight: 600; }

.aifp-foot {
  flex: none; display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface);
  position: relative; z-index: 1;
}

/* ---- Agent building step ---- */
.ac-buildstep {
  display: flex; align-items: center; gap: 9px; margin: 12px 0 14px;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
}
.ac-buildstep i { font-size: 15px; color: var(--accent-press); flex: none; }
.ac-ell { animation: ellblink 1.4s steps(4) infinite; }
@keyframes ellblink { 0% { opacity: .2; } 50% { opacity: 1; } 100% { opacity: .2; } }

/* =========================================================================
   CONNECT AI SCREEN
   ========================================================================= */
.connect-content { padding-bottom: 60px; }

.connect-hero {
  padding: 32px 30px 26px; text-align: center; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
}
.ch-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 460px; height: 220px; pointer-events: none;
  background: radial-gradient(60% 80% at 50% 0%, var(--accent-soft) 0%, transparent 70%);
  opacity: .8;
}
.ch-bridge { display: flex; align-items: center; gap: 0; position: relative; margin-bottom: 20px; }
.ch-lockup { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.ch-word { font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -.02em; color: var(--ink); }
.ch-node {
  width: 60px; height: 60px; border-radius: var(--r-lg); flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow-md);
}
.ch-node.dmflo { background: var(--ink); }
.ch-wire { width: 76px; height: 2px; background: var(--line); position: relative; overflow: hidden; }
.ch-pulse {
  position: absolute; top: 0; left: -30%; width: 30%; height: 100%;
  background: var(--accent); border-radius: 2px; animation: wirepulse 1.8s ease-in-out infinite;
}
@keyframes wirepulse { 0% { left: -30%; } 100% { left: 100%; } }
.ch-title { font-family: var(--font-display); font-weight: 700; font-size: 27px; letter-spacing: -.025em; position: relative; }
.ch-blurb { font-size: 14.5px; color: var(--ink-2); max-width: 52ch; margin: 10px auto 0; line-height: 1.55; position: relative; }
.ch-seg { margin-top: 20px; position: relative; }
.ch-seg button { padding: 8px 20px; font-size: 14px; }

.connect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; align-items: start; }

.connect-setup { padding: 22px; }
.cs-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.connect-setup .cs-h { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.015em; }
.connect-setup .cs-s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.conn-off {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
  background: var(--sunken); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: var(--r-pill);
}
.cs-steps { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 0 0 20px; padding: 0; }
.cs-steps li { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.cs-num {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  background: var(--ink); color: var(--paper);
}
.cs-field { margin-bottom: 16px; }
.cs-flabel { display: block; margin-bottom: 7px; color: var(--ink-4); }
.cs-copyrow {
  display: flex; align-items: center; gap: 8px;
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 6px 6px 6px 13px;
}
.cs-copyrow code {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-copy {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 6px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  transition: background .12s, border-color .12s, color .12s;
}
.cs-copy:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.cs-copy i { font-size: 13px; }
.cs-fnote { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); margin-top: 9px; }
.cs-fnote i { font-size: 13px; color: var(--up); }
.cs-cta { width: 100%; justify-content: center; margin-top: 6px; }

.connect-example { padding: 20px; display: flex; flex-direction: column; }
.ce-head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.ce-av, .ce-aiav {
  width: 34px; height: 34px; flex: none; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
}
.ce-h { font-weight: 600; font-size: 14px; }
.ce-s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.ce-thread { display: flex; flex-direction: column; gap: 12px; }
.ce-user {
  align-self: flex-end; max-width: 88%;
  background: var(--accent); color: var(--on-accent);
  border-radius: 16px 16px 4px 16px; padding: 11px 14px;
  font-size: 13.5px; line-height: 1.5; box-shadow: var(--shadow-xs);
}
.ce-airow { display: flex; gap: 10px; align-items: flex-start; }
.ce-aiav { width: 30px; height: 30px; font-size: 14px; }
.ce-aibubble {
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px; padding: 12px 14px;
  font-size: 13.5px; line-height: 1.55; color: var(--ink); flex: 1;
}
.ce-aibubble b { font-weight: 700; }
.ce-action {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 9px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--accent-press);
}
.ce-aidot { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; background: var(--accent); color: var(--on-accent); }
.ce-foot { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 16px; color: var(--ink-4); }

.ai-cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ai-cap { padding: 18px; display: flex; flex-direction: column; align-items: flex-start; transition: box-shadow .14s, transform .12s; }
.ai-cap:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.aic-ico {
  width: 40px; height: 40px; border-radius: var(--r-md); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--accent-soft); color: var(--accent-press); margin-bottom: 13px;
}
.aic-t { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.aic-s { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.aic-ex {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 14px;
  background: var(--sunken); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; font-style: italic;
}
.aic-ex i { font-size: 13px; color: var(--ink-4); flex: none; margin-top: 2px; font-style: normal; }

.connect-manual {
  display: flex; align-items: center; gap: 10px; margin-top: 24px;
  background: var(--sunken); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 13px 16px; font-size: 13px; color: var(--ink-2); line-height: 1.5;
}
.connect-manual i { font-size: 16px; color: var(--ink-3); flex: none; }

@media (max-width: 1080px) {
  .connect-grid { grid-template-columns: 1fr; }
  .ai-cap-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1240px) {
  .aiflow-body { grid-template-columns: 1fr 1fr; }
}

/* =========================================================================
   BRAND KIT
   ========================================================================= */
.brand-body { flex: 1; overflow-y: auto; padding: 26px 28px 48px; }
.brand-inner { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.brand-inner.wide { max-width: 1180px; }

.bk-banner {
  display: flex; align-items: center; gap: 15px;
  padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--accent-soft); border: 1px solid transparent;
}
.bk-banner-ico {
  width: 40px; height: 40px; border-radius: var(--r-md); flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--accent-press); font-size: 20px;
}
.bk-banner-txt { flex: 1; min-width: 0; }
.bk-banner-txt .h { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.bk-banner-txt .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; line-height: 1.45; }
.bk-banner .btn { flex: none; white-space: nowrap; }

.bk-section { display: flex; flex-direction: column; }
.bk-sh { display: flex; align-items: baseline; gap: 10px; margin: 0 0 11px; }
.bk-sh-note { font-size: 12.5px; color: var(--ink-3); }
.bk-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }

.bk-field { display: flex; flex-direction: column; gap: 8px; }
.bk-flabel { font-weight: 600; font-size: 13.5px; }
.bk-input textarea, .bk-input input { line-height: 1.5; }

.bk-tones { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-tone {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 7px 13px;
  transition: background .12s, border-color .12s, color .12s;
}
.bk-tone:hover { border-color: var(--ink-4); }
.bk-tone.on { background: var(--accent-soft); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.bk-tone i { font-size: 12px; }
.bk-tone-add { font-size: 13px; font-weight: 500; color: var(--ink-2); border: 1px dashed var(--line-2); background: none; border-radius: 999px; padding: 6px 12px; outline: none; min-width: 120px; }
.bk-tone-add:focus { border-style: solid; border-color: var(--accent); color: var(--ink); }
.bk-tone-add::placeholder { color: var(--ink-3); }
.bk-sample { display: flex; align-items: flex-start; gap: 10px; }
.bk-sample-av {
  width: 34px; height: 34px; border-radius: var(--r-md); flex: none; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-press); font-size: 16px;
}

.bk-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bk-glabel { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.bk-glabel i { font-size: 16px; }
.bk-glabel.do i { color: var(--up); }
.bk-glabel.dont i { color: var(--dn); }
.bk-list { display: flex; flex-direction: column; gap: 8px; }
.bk-li { display: flex; align-items: center; gap: 9px; }
.bk-li-mark {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.bk-li.tone-do .bk-li-mark { background: var(--up-soft); color: var(--up); }
.bk-li.tone-dont .bk-li-mark { background: var(--dn-soft); color: var(--dn); }
.bk-li input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 13.5px; color: var(--ink); line-height: 1.4; padding: 3px 0;
  border-bottom: 1px solid transparent;
}
.bk-li input:focus { border-bottom-color: var(--line); }
.bk-li-x {
  width: 22px; height: 22px; border-radius: var(--r-sm); flex: none; opacity: 0;
  display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 11px;
  transition: opacity .12s, background .12s;
}
.bk-li:hover .bk-li-x { opacity: 1; }
.bk-li-x:hover { background: var(--sunken); color: var(--dn); }
.bk-li-add {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 4px 2px;
}
.bk-li-add:hover { color: var(--ink); }
.bk-li-add i { font-size: 11px; }

/* products */
.bk-shopbar { display: flex; align-items: center; gap: 12px; }
.bk-shop-ico {
  width: 40px; height: 40px; border-radius: var(--r-md); flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-press); font-size: 20px;
}
.bk-shop-meta { flex: 1; min-width: 0; }
.bk-shop-meta .h { font-weight: 600; font-size: 14.5px; }
.bk-shop-meta .s { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.bk-pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
.bk-ptable-scroll { margin-top: 6px; border: 1px solid var(--line-2); border-radius: var(--r-md); overflow-x: auto; }
.bk-ptable { width: 100%; min-width: 760px; border-collapse: collapse; }
.bk-ptable thead th { position: sticky; top: 0; z-index: 1; background: var(--sunken); text-align: left; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.bk-ptable tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.bk-ptable tbody tr:last-child td { border-bottom: 0; }
.bk-ptable tbody tr:hover { background: var(--sunken); }
.bk-ptprod { display: flex; align-items: center; gap: 11px; }
.bk-pt-prod { min-width: 200px; }
.bk-pt-desc { max-width: 360px; }
.bk-pt-link { white-space: nowrap; }
.bk-ptable .bk-pname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.bk-ptable .bk-pblurb { display: block; }
.bk-pcard {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--sunken); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 12px;
}
.bk-phead { display: flex; align-items: center; gap: 11px; }
.bk-pblurb { font-size: 12px; line-height: 1.45; color: var(--ink-3); text-wrap: pretty; }
.bk-plink { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--accent-press); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-plink i { font-size: 11px; flex: none; }
.bk-plink:hover { text-decoration: underline; }
.bk-pthumb {
  width: 42px; height: 42px; border-radius: var(--r-sm); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.bk-pthumb.tone-lime { background: var(--accent-soft); }
.bk-pthumb.tone-blue { background: oklch(0.93 0.05 240); }
.bk-pthumb.tone-pink { background: oklch(0.93 0.05 350); }
[data-theme="dark"] .bk-pthumb.tone-blue { background: oklch(0.36 0.07 240); }
[data-theme="dark"] .bk-pthumb.tone-pink { background: oklch(0.36 0.07 350); }
.bk-pbody { flex: 1; min-width: 0; }
.bk-pname { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-pmeta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.bk-pprice { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.bk-pstock { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); }
.bk-pstock.ok  { color: var(--up); background: var(--up-soft); }
.bk-pstock.low { color: var(--warn); background: var(--warn-soft); }
.bk-pstock.out { color: var(--dn); background: var(--dn-soft); }

.bk-connect { display: flex; flex-direction: column; gap: 4px; }
.bk-connect-opt { display: flex; flex-direction: column; gap: 12px; }
.bk-co-head { display: flex; align-items: center; gap: 12px; }
.bk-co-ico {
  width: 40px; height: 40px; border-radius: var(--r-md); flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--sunken); color: var(--ink-2); font-size: 19px;
}
.bk-co-ico.shopify { background: var(--accent-soft); color: var(--accent-press); }
.bk-co-t { font-weight: 600; font-size: 14px; }
.bk-co-s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.bk-connect-or { display: flex; align-items: center; text-align: center; margin: 6px 0; color: var(--ink-4); }
.bk-connect-or::before, .bk-connect-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.bk-connect-or span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; padding: 0 12px; }
.bk-url-row { display: flex; gap: 8px; }

/* pinned Brand Kit row inside agent knowledge base */
.kb-pinned { background: var(--accent-soft); border-color: transparent !important; }
.kb-pinned .kb-ico { background: var(--surface); }
.kb-pinned .kb-label { white-space: normal; overflow: visible; }
.kb-ico.brand { color: var(--accent-press); }
.kb-sublabel { display: block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; color: var(--ink-3); letter-spacing: .02em; margin-top: 2px; }
.kb-pin-tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-press); background: var(--surface); border-radius: var(--r-pill); padding: 3px 9px; white-space: nowrap;
}
.kb-open {
  width: 26px; height: 26px; border-radius: var(--r-sm); flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: 13px;
}
.kb-open:hover { background: var(--surface); color: var(--ink); }

.kb-nudge { display: flex; align-items: center; gap: 13px; padding: 15px 16px; border: 1px dashed var(--tertiary-mellow); border-radius: var(--r-md); background: var(--tertiary-soft); }
.kb-nudge-ico { width: 38px; height: 38px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--tertiary); font-size: 19px; }
.kb-nudge-txt { flex: 1; min-width: 0; }
.kb-nudge-txt .h { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.kb-nudge-txt .s { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.45; }
.kb-nudge-cta { flex: none; white-space: nowrap; }

@media (max-width: 900px) {
  .bk-guide, .bk-pgrid { grid-template-columns: 1fr; }
}

/* Brand Kit — derived / read / edit / empty / scanning */
.bk-source, .bk-banner { display: flex; align-items: center; gap: 15px; padding: 16px 18px; border-radius: var(--r-lg); }
.bk-source { background: var(--surface); border: 1px solid var(--line); }
.bk-source-ico, .bk-empty-ico, .bk-scan-ico { width: 40px; height: 40px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-press); font-size: 20px; }
.bk-source-txt { flex: 1; min-width: 0; }
.bk-source-txt .h { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.bk-source-txt .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; line-height: 1.45; }
.bk-source .btn { flex: none; }

.bk-sh { display: flex; align-items: center; gap: 10px; margin: 0 0 11px; }
.bk-sh-sp { flex: 1; }
.bk-auto { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-press); background: var(--accent-soft); border-radius: var(--r-pill); padding: 3px 9px; }
.bk-auto i { font-size: 11px; }
.bk-edit { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 5px 10px; border-radius: var(--r-pill); }
.bk-edit:hover { background: var(--sunken); color: var(--ink); }
.bk-edit i { font-size: 14px; }

.bk-read { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.bk-read:last-child { border-bottom: 0; }
.bk-read-l { flex: none; width: 120px; font-size: 12.5px; color: var(--ink-3); padding-top: 1px; }
.bk-read-v { flex: 1; font-size: 14px; color: var(--ink); line-height: 1.5; }
.bk-missing { color: var(--ink-4); font-style: italic; }

.bk-li-txt { flex: 1; font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.bk-tone.read { cursor: default; }
.bk-tone.read:hover { border-color: var(--accent); }
.bk-sample-read { flex: 1; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; background: var(--sunken); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 11px 13px; }

.bk-empty-wrap { display: flex; flex-direction: column; align-items: center; padding-top: 12px; }
.bk-empty-hero { text-align: center; max-width: 460px; margin-bottom: 22px; display: flex; flex-direction: column; align-items: center; }
.bk-empty-ico { width: 52px; height: 52px; border-radius: var(--r-lg); font-size: 26px; margin-bottom: 16px; }
.bk-empty-hero h2 { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; }
.bk-empty-hero p { font-size: 14.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.5; }
.bk-empty-card { width: 100%; max-width: 520px; }
.bk-empty-or { display: flex; align-items: center; color: var(--ink-4); margin: 2px 0; }
.bk-empty-or::before, .bk-empty-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.bk-empty-or span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; padding: 0 12px; }
.bk-drop { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px; border: 1.5px dashed var(--line); border-radius: var(--r-md); background: var(--sunken); font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: border-color .12s, color .12s; }
.bk-drop:hover { border-color: var(--accent); color: var(--ink); }
.bk-scan-cta { justify-content: center; width: 100%; padding: 13px; font-size: 15px; margin-top: 4px; }

.bk-scan { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px; }
.bk-scan-ico { width: 52px; height: 52px; border-radius: var(--r-lg); margin-bottom: 18px; }
.bk-scan h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; margin-bottom: 18px; }
.bk-scan-steps { list-style: none; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.bk-scan-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-4); transition: color .2s; }
.bk-scan-steps li i { font-size: 17px; }
.bk-scan-steps li.on { color: var(--ink); font-weight: 600; }
.bk-scan-steps li.on i { color: var(--accent-press); }
.bk-scan-steps li.done { color: var(--ink-2); }
.bk-scan-steps li.done i { color: var(--up); }

/* manual entry + links & resources */
.bk-manual-link { margin-top: 18px; font-size: 13.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.bk-manual-link b { color: var(--tertiary); font-weight: 700; }
.bk-manual-link:hover b { text-decoration: underline; }
.bk-manual-link i { font-size: 12px; color: var(--tertiary); }

.bk-linklist { display: flex; flex-direction: column; gap: 8px; }
.bk-linkrow { display: flex; align-items: center; gap: 11px; padding: 10px 12px; background: var(--sunken); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.bk-row-x { flex: none; width: 26px; height: 26px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 11px; opacity: 0; transition: opacity .12s, background .12s, color .12s; }
.bk-linkrow:hover .bk-row-x { opacity: 1; }
.bk-row-x:hover { background: var(--dn-soft); color: var(--dn); }
.bk-link-ico { width: 34px; height: 34px; border-radius: var(--r-sm); flex: none; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-press); font-size: 16px; }
.bk-link-body { flex: 1; min-width: 0; }
.bk-link-label { font-weight: 600; font-size: 13.5px; }
.bk-link-url { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-link-type { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 3px 9px; flex: none; white-space: nowrap; }
.bk-linkedit { display: flex; align-items: center; gap: 8px; }
.bk-link-select { flex: none; width: 150px; font-family: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 9px; }
.bk-link-select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bk-link-in { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; outline: 0; }
.bk-link-in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bk-linkedit .bk-li-x { opacity: 1; }

.bk-integration { display: flex; align-items: center; gap: 14px; }
.bk-int-ico { width: 44px; height: 44px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-press); font-size: 21px; }
.bk-int-txt { flex: 1; min-width: 0; }
.bk-int-txt .h { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.bk-int-txt .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; line-height: 1.45; }
.bk-integration .btn { flex: none; white-space: nowrap; }

/* Integrations */
.int-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.int-tab { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink-3); padding: 11px 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s; }
.int-tab i { font-size: 16px; }
.int-tab:hover { color: var(--ink); }
.int-tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.int-tab-new { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tertiary); background: var(--tertiary-soft); border-radius: var(--r-pill); padding: 2px 7px; }
.int-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.int-app { padding: 20px; display: flex; flex-direction: column; }
.int-app-top { display: flex; align-items: center; gap: 12px; }
.int-app-ico { width: 46px; height: 46px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; font-size: 23px; }
.int-app-id { flex: 1; min-width: 0; }
.int-app-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.int-app-cat { margin-top: 2px; }
.int-app-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin: 14px 0 16px; flex: 1; }
.int-app-cta { align-self: flex-start; }
.int-mcp .connect-col { display: flex; flex-direction: column; }
