/* ============================================================
   SOFTWARE FACTORY — App (logged-in) + Pricing
   ============================================================ */

/* ---------- PRICING (public) ---------- */
.price-hero { text-align: center; max-width: 760px; margin: 0 auto; }
.bill-toggle { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 100px; padding: 5px; margin-top: 26px; }
.bill-toggle button { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); background: transparent; border: 0;
  padding: 8px 16px; border-radius: 100px; transition: .15s; }
.bill-toggle button.on { background: linear-gradient(180deg, var(--blue), var(--blue-deep)); color: #fff; }
.bill-toggle .save { color: var(--success); font-size: 11px; margin-left: 2px; }

.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: stretch; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; } }
.plan { display: flex; flex-direction: column; background: linear-gradient(180deg, var(--surface), var(--navy));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 20px; position: relative; transition: .18s; }
.plan:hover { border-color: var(--line-2); transform: translateY(-3px); }
.plan--featured { border-color: var(--blue); box-shadow: 0 0 40px -16px var(--glow-blue); }
.plan--featured::before { content: "Most popular"; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #fff;
  background: linear-gradient(180deg, var(--blue), var(--blue-deep)); padding: 4px 12px; border-radius: 100px; white-space: nowrap; }
.plan__name { font-family: var(--display); font-size: 17px; font-weight: 600; }
.plan__desc { font-size: 12.5px; color: var(--text-3); min-height: 32px; margin-top: 3px; }
.plan__price { display: flex; align-items: baseline; gap: 3px; margin: 16px 0 4px; }
.plan__price .amt { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.plan__price .per { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.plan__credits { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; color: var(--blue-hi);
  background: rgba(59,130,246,.10); border: 1px solid rgba(59,130,246,.2); border-radius: 100px; padding: 5px 11px; margin-bottom: 16px; align-self: flex-start; }
.plan__credits svg { width: 13px; height: 13px; }
.plan__cta { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: var(--r);
  font-family: var(--sans); font-weight: 500; font-size: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); color: var(--text); transition: .15s; margin-bottom: 18px; }
.plan__cta:hover { background: var(--surface-3); }
.plan--featured .plan__cta { background: linear-gradient(180deg, var(--blue), var(--blue-deep)); border-color: transparent; color: #fff; }
.plan__feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.plan__feats li { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.plan__feats li svg { width: 14px; height: 14px; color: var(--success); flex: none; margin-top: 2px; }
.plan__feats li.off { color: var(--text-3); }
.plan__feats li.off svg { color: var(--line-2); }

/* credit packs */
.packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 820px) { .packs { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .packs { grid-template-columns: 1fr; } }
.pack { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; text-align: center; transition: .18s; }
.pack:hover { border-color: var(--purple); transform: translateY(-3px); }
.pack__amt { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.pack__amt .unit { font-size: 13px; color: var(--purple-hi); font-family: var(--mono); display: block; margin-top: 2px; }
.pack__price { font-family: var(--mono); font-size: 14px; color: var(--text-2); margin: 12px 0 16px; }
.pack__rate { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* action cost table */
.cost-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cost-table th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.cost-table th:last-child, .cost-table td:last-child { text-align: right; }
.cost-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.cost-table tr:last-child td { border-bottom: 0; }
.cost-table .cc { font-family: var(--mono); color: var(--blue-hi); font-weight: 500; }
.cost-table .cc::after { content: " cr"; color: var(--text-3); font-weight: 400; font-size: 11px; }

/* ============================================================
   APP SHELL (logged-in)
   ============================================================ */
:root {
  --app-sidebar-width: 244px;
  --app-header-height: 69px;
}
body.app-body { background: var(--bg); overflow-x: hidden; }
.app-shell { display: grid; grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr); min-height: 100vh; width: 100%; overflow-x: clip; }
@media (min-width: 941px) {
  body:has([data-app-shell-nav])::after { background-position: var(--app-sidebar-width) 0; }
}
.app-side { border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.app-side__brand { display: flex; align-items: center; gap: 10px; height: var(--app-header-height); padding: 0 20px; border-bottom: 1px solid var(--line); }
.app-side__brand .brand__mark { width: 28px; height: 28px; }
.app-side__brand .brand__text { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.app-side__brand .at { color: var(--text-3); font-family: var(--mono); font-size: 11px; }
.app-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.app-nav__label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3);
  padding: 14px 10px 6px; }
.app-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r); color: var(--text-2);
  font-size: 14px; transition: .14s; position: relative; }
.app-nav a svg { width: 17px; height: 17px; flex: none; }
.app-nav a:hover { background: rgba(255,255,255,.03); color: var(--text); }
.app-nav a.on { background: rgba(59,130,246,.12); color: var(--blue-hi); }
.app-nav a .badge-n { margin-left: auto; font-family: var(--mono); font-size: 10px; background: var(--surface-3); color: var(--text-2);
  border-radius: 100px; padding: 2px 7px; }
.app-account { position: relative; border-top: 1px solid var(--line); padding: 8px; }
.app-side__user { padding: 6px; display: flex; align-items: center; gap: 11px; border-radius: var(--r); cursor: pointer; list-style: none; transition: .14s; }
.app-side__user::-webkit-details-marker { display: none; }
.app-side__user:hover,
.app-account[open] .app-side__user { background: rgba(255,255,255,.03); }
.app-side__user .meta { min-width: 0; }
.app-side__user .nm { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.app-side__user .lv { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.app-account__chev { margin-left: auto; display: grid; place-items: center; width: 20px; height: 20px; color: var(--text-3); transition: transform .16s ease; }
.app-account__chev svg { width: 14px; height: 14px; }
.app-account[open] .app-account__chev { transform: rotate(180deg); }
.app-account__menu { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 8px); z-index: 80;
  display: grid; gap: 2px; padding: 7px; background: var(--navy); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.app-account__menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px; transition: .14s; }
.app-account__menu a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.app-account__menu a svg { width: 15px; height: 15px; flex: none; }
.app-account__menu a.danger { color: #fca5a5; }
.app-account__menu a.danger:hover { background: rgba(239,68,68,.12); color: #fecaca; }
.app-account__menu .logout-form--menu { display: block; margin: 0; }
.app-account__menu .logout-form--menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: #fca5a5; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: .14s; }
.app-account__menu .logout-form--menu button:hover { background: rgba(239,68,68,.12); color: #fecaca; }
.app-account__menu .logout-form--menu button svg { width: 15px; height: 15px; flex: none; }
.app-account__sep { height: 1px; background: var(--line); margin: 4px 2px; }

.app-content { min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.app-top { display: flex; align-items: center; gap: 14px; min-height: var(--app-header-height); padding: 14px 26px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.app-top h1 { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.app-top__sub { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.app-top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.app-burger { display: none; background: none; border: 1px solid var(--line-2); border-radius: var(--r-sm); width: 38px; height: 36px; color: var(--text); }
.app-burger svg { width: 18px; height: 18px; margin: auto; }

/* credits pill */
.credits-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--text);
  background: linear-gradient(180deg, var(--surface-2), var(--navy)); border: 1px solid var(--line-2); border-radius: 100px; padding: 7px 8px 7px 13px; }
.credits-pill .spark { width: 14px; height: 14px; color: var(--blue-hi); }
.credits-pill b { font-weight: 600; }
.credits-pill .plus { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; }
.credits-pill .plus svg { width: 13px; height: 13px; }

.app-main { padding: 26px; max-width: 1200px; width: 100%; overflow-x: hidden; }
.app-main--wide { max-width: 1320px; }

/* compact credits pill on small screens */
@media (max-width: 520px) {
  .app-top { padding: 12px 16px; gap: 10px; }
  .app-top h1 { font-size: 16px; }
  .credits-pill { font-size: 12px; padding: 6px 6px 6px 11px; }
  .credits-pill .lbl-credits { display: none; }
  .app-main { padding: 16px; }
}

/* dashboard */
.dash-row { display: grid; gap: 16px; }
.kpi-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .kpi-cards { grid-template-columns: 1fr 1fr; } }
.kpi-card { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.kpi-card__top { display: flex; align-items: center; justify-content: space-between; }
.kpi-card__ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: rgba(59,130,246,.10); color: var(--blue-hi); border: 1px solid rgba(59,130,246,.2); }
.kpi-card__ico svg { width: 17px; height: 17px; }
.kpi-card__ico.p { background: rgba(139,92,246,.10); color: var(--purple-hi); border-color: rgba(139,92,246,.22); }
.kpi-card__ico.g { background: rgba(34,197,94,.10); color: #4ade80; border-color: rgba(34,197,94,.22); }
.kpi-card__ico.o { background: rgba(249,115,22,.10); color: var(--warning); border-color: rgba(249,115,22,.22); }
.kpi-card__delta { font-family: var(--mono); font-size: 11px; color: var(--success); }
.kpi-card__val { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-top: 12px; line-height: 1; }
.kpi-card__lbl { font-family: var(--mono); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 7px; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.panel-card { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-card__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-card__head h3 { font-family: var(--display); font-size: 15px; font-weight: 600; }
.panel-card__head a { font-family: var(--mono); font-size: 12px; color: var(--blue-hi); }
.panel-card__body { padding: 8px 20px 16px; }

/* activity list */
.act { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: 0; }
.act__ico { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.act__ico svg { width: 15px; height: 15px; }
.act__meta { min-width: 0; flex: 1; }
.act__t { font-size: 13.5px; color: var(--text); }
.act__time { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.act__amt { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.act__amt.minus { color: var(--warning); } .act__amt.plus { color: #4ade80; }

/* quick actions */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qa { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r); border: 1px solid var(--line);
  background: rgba(255,255,255,.02); transition: .15s; }
.qa:hover { border-color: var(--line-2); transform: translateY(-2px); background: rgba(255,255,255,.03); }
.qa__ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: rgba(59,130,246,.10); color: var(--blue-hi); }
.qa__ico svg { width: 17px; height: 17px; }
.qa b { font-family: var(--display); font-size: 14px; font-weight: 600; }
.qa span { font-size: 12px; color: var(--text-3); }

/* reputation widget */
.rep-card { padding: 20px; }
.rep-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.rep-level { font-family: var(--display); font-size: 18px; font-weight: 600; }
.rep-sub { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.rep-bar { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; margin-bottom: 8px; }
.rep-bar__fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--purple)); transition: width .8s cubic-bezier(.2,.7,.2,1); }
.rep-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* ---------- WALLET ---------- */
.wallet-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .wallet-hero { grid-template-columns: 1fr; } }
.balance-card { background: linear-gradient(140deg, #0c1530, #0a0f1f 60%, #140c2a); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 28px; position: relative; overflow: hidden; }
[data-theme="light"] .balance-card { background: linear-gradient(140deg, #eef3fb, #fff 60%, #f3eefb); }
.balance-card__lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.balance-card__amt { font-family: var(--display); font-size: 52px; font-weight: 600; letter-spacing: -.03em; line-height: 1; margin: 10px 0 4px; }
.balance-card__amt .unit { font-size: 18px; color: var(--blue-hi); }
.balance-card__row { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.bk-list { display: grid; gap: 10px; }
.bk { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line); border-radius: var(--r); }
.bk__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.bk__n { font-size: 13.5px; color: var(--text-2); flex: 1; }
.bk__v { font-family: var(--display); font-size: 16px; font-weight: 600; }
.bk__exp { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }

/* usage chart */
.usage-bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 10px; }
.usage-bars .ub { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.usage-bars .ub__bar { width: 100%; max-width: 30px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--blue), rgba(37,99,235,.3)); min-height: 4px; transition: height .7s cubic-bezier(.2,.7,.2,1); }
.usage-bars .ub__bar.p { background: linear-gradient(180deg, var(--purple), rgba(139,92,246,.3)); }
.usage-bars .ub__l { font-family: var(--mono); font-size: 10px; color: var(--text-3); }

/* ---------- REWARDS / GAMIFICATION ---------- */
.level-track { display: flex; align-items: center; overflow-x: auto; padding-bottom: 8px; gap: 0; }
.lvl { flex: 1 1 0; min-width: 104px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; position: relative; padding: 0 4px; }
.lvl::after { content: ""; position: absolute; top: 25px; left: 50%; right: -50%; height: 2px; background: var(--line-2); z-index: 0; }
.lvl:last-child::after { display: none; }
.lvl.done::after { background: linear-gradient(90deg, var(--blue), var(--purple)); }
.lvl__badge { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--surface-2); border: 1.5px solid var(--line-2); color: var(--text-3); font-family: var(--display); font-weight: 600; }
.lvl__badge svg { width: 22px; height: 22px; }
.lvl.done .lvl__badge { border-color: transparent; background: linear-gradient(180deg, var(--blue), var(--purple)); color: #fff; }
.lvl.current .lvl__badge { border-color: var(--blue); color: var(--blue-hi); box-shadow: 0 0 18px -4px var(--glow-blue); }
.lvl__n { font-family: var(--display); font-size: 13px; font-weight: 500; }
.lvl__r { font-family: var(--mono); font-size: 10px; color: var(--text-3); }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 12px; }
.bdg { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 18px 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.bdg.locked { opacity: .42; }
.bdg__ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(150deg, var(--blue), var(--purple)); color: #fff; }
.bdg.locked .bdg__ic { background: var(--surface-3); color: var(--text-3); }
.bdg__ic svg { width: 22px; height: 22px; }
.bdg b { font-family: var(--display); font-size: 12.5px; font-weight: 500; }
.bdg span { font-family: var(--mono); font-size: 10px; color: var(--text-3); }

.lead-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lead-row:last-child { border-bottom: 0; }
.lead-row.me { background: rgba(59,130,246,.06); margin: 0 -16px; padding-inline: 16px; border-radius: var(--r); }
.lead-row__rank { font-family: var(--mono); font-size: 13px; color: var(--text-3); width: 28px; flex: none; }
.lead-row__rank.top { color: var(--blue-hi); }
.lead-row__meta { flex: 1; min-width: 0; }
.lead-row__nm { font-size: 13.5px; font-weight: 600; }
.lead-row__lv { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.lead-row__pts { font-family: var(--display); font-size: 15px; font-weight: 600; }
.lead-row__pts span { font-family: var(--mono); font-size: 10px; color: var(--text-3); font-weight: 400; }

.pending { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.pending:last-child { border-bottom: 0; }
.pending__st { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 100px; }
.pending__st.rev { background: rgba(249,115,22,.14); color: var(--warning); }
.pending__st.ok { background: rgba(34,197,94,.14); color: #4ade80; }

.section-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin: 30px 0 14px; }
.section-label:first-child { margin-top: 0; }

/* ============================================================
   CHECKOUT
   ============================================================ */
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .9fr); gap: 22px; align-items: start; width: 100%; max-width: 980px; }
.checkout-grid > * { min-width: 0; }
@media (max-width: 860px) { .checkout-grid { grid-template-columns: 1fr; } }
.co-card { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.co-card h2 { font-family: var(--display); font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.co-card__sub { font-size: 13px; color: var(--text-3); margin-bottom: 22px; }

/* payment form */
.co-field { margin-bottom: 16px; }
.co-field label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 7px; }
.co-input { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--text);
  font-family: var(--sans); font-size: 15px; padding: 12px 14px; transition: .15s; }
.co-input::placeholder { color: var(--text-3); }
.co-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.16); }
.co-card-wrap { position: relative; }
.co-card-wrap .brands { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; gap: 5px; }
.co-card-wrap .brands span { width: 26px; height: 17px; border-radius: 3px; background: var(--surface-3); }
.co-card-wrap .brands .visa { background: linear-gradient(180deg,#1a1f71,#2a3aa0); }
.co-card-wrap .brands .mc { background: linear-gradient(90deg,#eb001b 50%,#f79e1b 50%); opacity:.9; }
.co-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.co-field.err .co-input { border-color: #f87171; }
.co-field .co-msg { font-family: var(--mono); font-size: 11px; color: #f87171; margin-top: 6px; display: none; }
.co-field.err .co-msg { display: block; }
.co-secure { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.co-secure svg { width: 14px; height: 14px; color: var(--success); }

/* order summary */
.co-summary { position: sticky; top: 90px; }
.os-item { display: flex; align-items: center; gap: 13px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.os-item__ic { width: 46px; height: 46px; border-radius: var(--r); display: grid; place-items: center; flex: none;
  background: linear-gradient(150deg, var(--blue), var(--purple)); color: #fff; }
.os-item__ic svg { width: 22px; height: 22px; }
.os-item__n { font-family: var(--display); font-size: 16px; font-weight: 600; }
.os-item__d { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.os-feats { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.os-feats li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); }
.os-feats li svg { width: 14px; height: 14px; color: var(--success); flex: none; margin-top: 2px; }
.os-line { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); padding: 6px 0; }
.os-line .v { font-family: var(--mono); color: var(--text); }
.os-promo { display: flex; gap: 8px; margin: 12px 0; }
.os-promo .co-input { padding: 9px 12px; font-size: 13px; }
.os-promo button { font-family: var(--sans); font-size: 13px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.os-promo button:hover { background: var(--surface-3); }
.os-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; }
.os-total .lbl { font-family: var(--display); font-size: 15px; font-weight: 600; }
.os-total .amt { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.os-total .amt small { font-size: 13px; color: var(--text-3); font-family: var(--mono); font-weight: 400; }
.co-pay-btn { width: 100%; justify-content: center; margin-top: 18px; }
.co-pay-btn .spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: cospin .7s linear infinite; }
@keyframes cospin { to { transform: rotate(360deg); } }
.co-terms { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); text-align: center; margin-top: 12px; line-height: 1.5; }

/* segmented (pack/billing switch on checkout) */
.co-seg { display: flex; gap: 6px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); padding: 5px; margin-bottom: 18px; }
.co-seg button { flex: 1; font-family: var(--mono); font-size: 12px; color: var(--text-2); background: transparent; border: 0; padding: 8px; border-radius: var(--r-sm); transition: .14s; }
.co-seg button.on { background: var(--surface-3); color: var(--text); }

/* success */
.co-success { max-width: 540px; margin: 6vh auto 0; text-align: center; background: linear-gradient(180deg, var(--surface), var(--navy));
  border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 44px 36px; }
.co-success__tick { width: 70px; height: 70px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(34,197,94,.14); border: 1px solid rgba(34,197,94,.35); color: #4ade80; animation: copop .5s cubic-bezier(.2,1.4,.4,1); }
.co-success__tick svg { width: 34px; height: 34px; }
@keyframes copop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.co-success h2 { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 10px; }
.co-success p { color: var(--text-2); margin: 0 auto 8px; max-width: 40ch; }
.co-receipt { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; margin: 24px 0; text-align: left; }
.co-receipt .rrow { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.co-receipt .rrow .k { color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.co-receipt .rrow .v { color: var(--text); font-weight: 500; }
.co-receipt .rrow.big .v { font-family: var(--display); font-size: 16px; color: #4ade80; }
.co-credit-fly { font-family: var(--display); font-size: 40px; font-weight: 600; color: var(--blue-hi); letter-spacing: -.02em; }

/* mobile app shell */
@media (max-width: 940px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-side { position: fixed; top: 0; bottom: 0; left: 0; width: 270px; height: 100vh; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; }
  .app-side.show { transform: none; box-shadow: var(--shadow-lg); }
  .app-burger { display: grid; place-items: center; }
  .app-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; opacity: 0; pointer-events: none; transition: .2s; }
  .app-scrim.show { opacity: 1; pointer-events: auto; }
}

/* ---- app-shell additions (Blazor) ---- */
.app-scrim { display: none; }

/* app status badges (community.css defines these for the public board; app-shell
   pages don't load community.css, so they're mirrored here) */
.status { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  border-radius: 100px; padding: 4px 10px; white-space: nowrap; }
.status .s-dot { width: 7px; height: 7px; border-radius: 50%; }
.status.review { background: rgba(249,115,22,.12); color: var(--warning); } .status.review .s-dot { background: var(--warning); }
.status.approved { background: rgba(59,130,246,.12); color: var(--blue-hi); } .status.approved .s-dot { background: var(--blue); }
.status.building { background: rgba(139,92,246,.12); color: var(--purple-hi); } .status.building .s-dot { background: var(--purple); animation: blip 1.8s infinite; }
.status.live { background: rgba(34,197,94,.12); color: #4ade80; } .status.live .s-dot { background: var(--success); }
.status.team { background: rgba(34,211,238,.12); color: var(--cyan); } .status.team .s-dot { background: var(--cyan); }

/* ---- Rendered markdown (agent chat + AI Founder thread) ---- */
.md { line-height: 1.6; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .6em; }
.md ul, .md ol { margin: .3em 0 .7em; padding-left: 1.35em; }
.md li { margin: .15em 0; }
.md li > p { margin: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: .9em 0 .4em; line-height: 1.3; font-family: var(--display); }
.md h1 { font-size: 1.3em; } .md h2 { font-size: 1.18em; } .md h3 { font-size: 1.06em; } .md h4 { font-size: 1em; }
.md strong { color: var(--text); font-weight: 600; }
.md a { color: var(--blue-hi); text-decoration: underline; }
.md code { font-family: var(--mono); font-size: .88em; background: rgba(255,255,255,.08); padding: .12em .38em; border-radius: 4px; }
.md pre { background: rgba(0,0,0,.28); border: 1px solid var(--line-2); border-radius: 8px; padding: 11px 13px; overflow-x: auto; margin: .6em 0; }
.md pre code { background: none; padding: 0; font-size: .85em; line-height: 1.5; }
.md blockquote { border-left: 3px solid var(--line-2); margin: .6em 0; padding: .1em 0 .1em 12px; color: var(--text-2); }
.md table { border-collapse: collapse; margin: .6em 0; font-size: .92em; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line-2); padding: 6px 10px; text-align: left; }
.md th { background: rgba(255,255,255,.05); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--line-2); margin: .8em 0; }

/* Module switcher on the sidebar brand (Foundry Suite: SF / Knowledge / Agent / Company). */
.app-modules { position: relative; }
.app-modules > summary { list-style: none; cursor: pointer; }
.app-modules > summary::-webkit-details-marker { display: none; }
.app-modules__chev { margin-left: auto; display: grid; place-items: center; width: 20px; height: 20px; color: var(--text-3); transition: transform .16s ease; }
.app-modules__chev svg { width: 14px; height: 14px; }
.app-modules[open] .app-modules__chev { transform: rotate(180deg); }
.app-modules__menu { position: absolute; left: 8px; right: 8px; top: calc(100% - 2px); z-index: 80;
  display: grid; gap: 2px; padding: 7px; background: var(--navy); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.app-modules__head { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); padding: 6px 8px 4px; }
.app-mod { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px; text-decoration: none; }
.app-mod b { font-weight: 600; color: var(--text); font-size: 13.5px; }
.app-mod svg { width: 16px; height: 16px; flex: none; }
.app-mod__t { flex: 1; }
a.app-mod:hover { background: rgba(255,255,255,.04); }
.app-mod.is-active { background: rgba(59,130,246,.08); }
.app-mod__badge { font-family: var(--mono); font-size: 10px; color: var(--blue-hi); }
.app-mod.is-soon { opacity: .55; }
.app-mod__soon { font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.app-modules__foot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.app-modules__foot a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13px; text-decoration: none; }
.app-modules__foot a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.app-modules__foot svg { width: 15px; height: 15px; flex: none; }

/* Module switcher — shared "kf-switch" design so /dashboard reads identically
   to the Knowledge / Agent / Company Foundry shells. Toggled via <details>. */
.kf-switch { position: relative; height: var(--app-header-height); box-sizing: border-box; padding: 0 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.kf-switch > summary { list-style: none; cursor: pointer; }
.kf-switch > summary::-webkit-details-marker { display: none; }
.kf-switch__btn { display: flex; align-items: center; gap: 11px; width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 11px; color: var(--text); transition: .15s; text-align: left; }
.kf-switch__btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.kf-switch__btn .brand__mark { width: 26px; height: 26px; flex: none; }
.kf-switch__lbl { min-width: 0; flex: 1; }
.kf-switch__lbl b { display: block; font-family: var(--display); font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.kf-switch__lbl span { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); letter-spacing: .04em; }
.kf-switch__chev { width: 15px; height: 15px; color: var(--text-3); transition: transform .18s ease; flex: none; }
.kf-switch[open] .kf-switch__chev,
.kf-switch.open .kf-switch__chev { transform: rotate(180deg); }
.kf-switch__menu { position: absolute; top: calc(100% - 4px); left: 12px; right: auto; width: max-content; min-width: 232px; max-width: calc(100vw - 28px); z-index: 70;
  background: var(--navy); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 7px; display: none; }
.kf-switch[open] > .kf-switch__menu,
.kf-switch.open > .kf-switch__menu { display: block; animation: kfpop .15s ease; }
@keyframes kfpop { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.kf-switch__head { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 8px 9px 6px; }
.kf-mod { display: flex; align-items: center; gap: 11px; padding: 9px 9px; border-radius: var(--r); transition: .14s; text-decoration: none; }
.kf-mod:hover { background: rgba(255,255,255,.04); }
.kf-mod[aria-current="true"] { background: rgba(59,130,246,.12); }
.kf-mod__ic { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); }
.kf-mod__ic svg { width: 16px; height: 16px; }
.kf-mod__ic.kf { background: linear-gradient(150deg, var(--blue), var(--purple)); border-color: transparent; color: #fff; }
.kf-mod__ic.sf { color: var(--blue-hi); }
.kf-mod__ic.af { color: var(--purple-hi); }
.kf-mod__ic.cf { color: #34d399; }
.kf-mod__ic.if { color: #2dd4bf; }
.kf-mod__ic.auto { color: #f59e0b; }
.kf-mod__ic.sig { color: #22d3ee; }
.kf-mod__ic.gf { color: #f472b6; }
.kf-mod__ic.sec { color: #f87171; }
/* In the switcher dropdown, only the selected module's icon shows its accent.
   Every other module icon stays neutral until you switch to it. The 4-class
   specificity here overrides both the tints above and the per-module gradient
   overrides (.kf-mod__ic.sig etc.). The switcher *button* icon sits outside
   .kf-switch__menu, so the current module always stays lit. */
.kf-switch__menu .kf-mod:not(.on) .kf-mod__ic {
  background: var(--surface-2);
  border-color: var(--line-2);
  color: var(--text-2);
}
.kf-mod__meta { min-width: 0; flex: 1; }
.kf-mod__meta b { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.15; white-space: nowrap; }
.kf-mod__meta span { font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.kf-mod__live { font-family: var(--mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 100px; flex: none; color: #4ade80; background: rgba(34,197,94,.14); }
.kf-mod--locked { cursor: not-allowed; }
.kf-mod--locked .kf-mod__ic, .kf-mod--locked .kf-mod__meta { opacity: .55; }
.kf-mod--locked .kf-mod__live { color: #f59e0b; background: rgba(245,158,11,.16); }
.kf-switch__foot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
.kf-switch__foot a { display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: var(--r); font-size: 12.5px; color: var(--text-2); transition: .14s; text-decoration: none; }
.kf-switch__foot a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.kf-switch__foot svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }

/* ============================================================
   KF / AF design-system primitives (ported from design assets)
   Used by admin pages, team-chats, and agentic-team pages so app
   pages match their mockups. These are the canonical app-shell
   copies — agentic.css does not redefine them.
   ============================================================ */

/* ---- panel ---- */
.kf-panel { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line); border-radius: var(--r-lg); }
.kf-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.kf-panel__head h3 { font-family: var(--display); font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.kf-panel__head h3 svg { width: 16px; height: 16px; color: var(--text-3); }
.kf-panel__head .sub { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.kf-panel__head a { font-family: var(--mono); font-size: 12px; color: var(--blue-hi); display: inline-flex; align-items: center; gap: 5px; }
.kf-panel__body { padding: 18px 20px; }

/* ---- grids ---- */
.kf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kf-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.kf-grid-2 > *, .kf-grid-3 > * { min-width: 0; }
@media (max-width: 980px) { .kf-grid-2, .kf-grid-3 { grid-template-columns: 1fr; } }
.kf-cols-3-2 { grid-template-columns: 1.5fr 1fr; }
.kf-cols-2-3 { grid-template-columns: 1fr 1.5fr; }
@media (max-width: 880px) { .kf-cols-3-2, .kf-cols-2-3 { grid-template-columns: 1fr; } }
.kf-stack { display: grid; gap: 16px; }
.kf-divlabel { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 4px 0 2px; }
.kf-eyebrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--purple-hi); margin-bottom: 12px; }
.kf-eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--purple); }

/* ---- badges (status) ---- */
.kf-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 500;
  padding: 3px 9px 3px 8px; border-radius: 100px; border: 1px solid var(--line-2); color: var(--text-2); background: rgba(255,255,255,.02); white-space: nowrap; }
.kf-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.kf-badge.is-ok { color: #4ade80; background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); }
.kf-badge.is-ok .kf-badge__dot { background: #4ade80; }
.kf-badge.is-busy { color: var(--blue-hi); background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.28); }
.kf-badge.is-busy .kf-badge__dot { background: var(--blue-hi); }
.kf-badge.is-wait { color: var(--text-3); }
.kf-badge.is-bad { color: #f87171; background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.28); }
.kf-badge.is-bad .kf-badge__dot { background: #f87171; }
.kf-badge.is-muted { color: var(--text-3); background: var(--surface-2); }

/* ---- data table ---- */
.kf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kf-table th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.kf-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.kf-table tr:last-child td { border-bottom: 0; }
.kf-table tbody tr { transition: background .14s; }
.kf-table tbody tr:hover { background: rgba(255,255,255,.02); }
.kf-table .name { color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 10px; }
.kf-table .name .fic { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); }
.kf-table .name .fic svg { width: 15px; height: 15px; }
.kf-table .mono { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.kf-rowact { display: flex; gap: 5px; justify-content: flex-end; }
.kf-rowact button, .kf-rowact a { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; background: transparent;
  border: 1px solid var(--line); color: var(--text-3); transition: .14s; cursor: pointer; }
.kf-rowact button:hover, .kf-rowact a:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.kf-rowact button.danger:hover { color: #f87171; border-color: rgba(248,113,113,.3); background: rgba(248,113,113,.08); }
.kf-rowact button:disabled { opacity: .45; cursor: not-allowed; }
.kf-rowact button svg, .kf-rowact a svg { width: 15px; height: 15px; }

/* ---- empty state ---- */
.kf-empty { text-align: center; padding: 54px 24px; max-width: 440px; margin: 0 auto; }
.kf-empty__ic { width: 64px; height: 64px; margin: 0 auto 20px; border-radius: var(--r-xl); display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(59,130,246,.16), rgba(139,92,246,.16)); border: 1px solid var(--line-2); color: var(--blue-hi); }
.kf-empty__ic svg { width: 28px; height: 28px; }
.kf-empty h3 { font-family: var(--display); font-size: 19px; font-weight: 600; }
.kf-empty p { color: var(--text-3); font-size: 14px; margin: 8px auto 20px; max-width: 38ch; }

/* ---- form kit ---- */
.kf-field { margin-bottom: 16px; }
.kf-field > label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 8px; }
.kf-input, .kf-select, .kf-textarea { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--text); font-family: var(--sans); font-size: 14.5px; padding: 11px 13px; transition: .15s; }
.kf-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.kf-input::placeholder, .kf-textarea::placeholder { color: var(--text-3); }
.kf-input:focus, .kf-select:focus, .kf-textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.16); }
.kf-check-inline { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }

/* ---- segmented control ---- */
.kf-seg { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); padding: 4px; flex-wrap: wrap; }
.kf-seg button { display: inline-flex; align-items: center; gap: 7px; font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--text-2); background: transparent; border: 0; padding: 8px 14px; border-radius: var(--r-sm); transition: .14s; white-space: nowrap; cursor: pointer; }
.kf-seg button svg { width: 15px; height: 15px; }
.kf-seg button:hover { color: var(--text); }
.kf-seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.kf-seg .n { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* ---- stepper (lifecycle) ---- */
.kf-stepper { display: flex; align-items: flex-start; gap: 0; margin: 6px 0 8px; }
.kf-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 11px; position: relative; text-align: center; }
.kf-step::after { content: ""; position: absolute; top: 21px; left: 50%; right: -50%; height: 2px; background: var(--line-2); z-index: 0; }
.kf-step:last-child::after { display: none; }
.kf-step.done::after { background: linear-gradient(90deg, var(--success), var(--blue)); }
.kf-step__dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--surface-2); border: 1.5px solid var(--line-2); color: var(--text-3); transition: .2s; }
.kf-step__dot svg { width: 19px; height: 19px; }
.kf-step.done .kf-step__dot { background: linear-gradient(160deg, var(--success), #15803d); border-color: transparent; color: #fff; }
.kf-step.active .kf-step__dot { border-color: var(--blue); color: var(--blue-hi); box-shadow: 0 0 0 4px rgba(59,130,246,.16); }
.kf-step__lbl { font-family: var(--display); font-size: 13px; font-weight: 500; color: var(--text-2); }
.kf-step.done .kf-step__lbl, .kf-step.active .kf-step__lbl { color: var(--text); }
.kf-step__meta { font-family: var(--mono); font-size: 10px; color: var(--text-3); }
@media (max-width: 600px) { .kf-stepper { overflow-x: auto; padding-bottom: 10px; } .kf-step { flex: 0 0 auto; min-width: 82px; } }

/* ---- key/value + question chips + relation row ---- */
.kf-kv { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.kf-kv:last-child { border-bottom: 0; }
.kf-kv__k { font-size: 13.5px; color: var(--text-2); }
.kf-kv__v { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.kf-qchip { font-size: 12.5px; color: var(--text-2); padding: 7px 13px; border-radius: 100px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.02); transition: .14s; cursor: pointer; text-decoration: none; }
.kf-qchip:hover { color: var(--text); border-color: var(--blue); background: rgba(59,130,246,.06); }
.kf-rel { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; }

/* ---- agent roster cards (af) ---- */
.af-av { display: inline-grid; place-items: center; border-radius: var(--r); border: 1px solid var(--line-2); flex: none; }
.af-av svg { width: 55%; height: 55%; }
.af-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.af-card { background: linear-gradient(180deg, var(--surface), var(--navy)); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; transition: .18s; position: relative; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.af-card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.af-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--blue), var(--purple)); opacity: 0; transition: .2s; }
.af-card:hover::before { opacity: 1; }
.af-card__top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.af-card__name { font-family: var(--display); font-size: 16px; font-weight: 600; }
.af-card__role { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.af-card__desc { font-size: 13px; color: var(--text-2); line-height: 1.5; margin-bottom: 14px; flex: 1; }
.af-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.cf-tchip { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); padding: 3px 9px; border-radius: 100px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); }

/* ---- domain avatar tints used by mockups (extend sf.css dom-*) ---- */
.dom-pm     { --a1:#3B82F6; --a2:#2563EB; }
.dom-eng    { --a1:#22C55E; --a2:#15803D; }
.dom-data   { --a1:#22D3EE; --a2:#0E7490; }
.dom-design { --a1:#8B5CF6; --a2:#6D28D9; }

/* ---- admin enable/disable toggle (admin-ai-team) ---- */
.adm-toggle { width: 40px; height: 23px; border-radius: 100px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: .16s; cursor: pointer; padding: 0; flex: none; }
.adm-toggle span { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--text-3); transition: .16s; }
.adm-toggle.on { background: linear-gradient(90deg, var(--blue), var(--blue-deep)); border-color: transparent; }
.adm-toggle.on span { left: 19px; background: #fff; }

/* ---- stacked-avatar chips (team-chats) ---- */
.chat-avs { display: inline-flex; }
.chat-avs .av { margin-left: -6px; border: 2px solid var(--bg-2); }
.chat-avs .av:first-child { margin-left: 0; }
@media (max-width: 640px) { .act .chat-avs { display: none; } }

/* ---- search input pill (admin filters) ---- */
.adm-search { display: flex; align-items: center; max-width: 280px; width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 12px; }
.adm-search input { background: none; border: 0; outline: none; color: var(--text); font-size: 13.5px; padding: 9px 0; width: 100%; }
.adm-search input::placeholder { color: var(--text-3); }
.adm-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }

/* ---- shared foundry help ---- */
.foundry-help { position: relative; display: inline-flex; }
.foundry-help__button, .foundry-help__close { display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); cursor: pointer; transition: .14s; }
.foundry-help__button { width: 34px; height: 34px; }
.foundry-help__close { width: 30px; height: 30px; background: transparent; }
.foundry-help__button:hover, .foundry-help__close:hover { border-color: var(--line-2); background: var(--surface-2); color: var(--text); }
.foundry-help__button svg, .foundry-help__close svg { width: 16px; height: 16px; }
.foundry-help__panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 85; width: min(420px, calc(100vw - 24px)); max-height: min(620px, calc(100vh - 96px)); overflow: auto; padding: 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--navy); box-shadow: var(--shadow-lg); }
.foundry-help__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.foundry-help__eyebrow, .foundry-help-page__eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.foundry-help__head h2 { margin: 3px 0 0; font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--text); }
.foundry-help__summary, .foundry-help__about, .foundry-help__fallback { margin: 12px 0 0; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.foundry-help__about { color: var(--text-3); }
.foundry-help__section { margin-top: 14px; }
.foundry-help__section h3 { margin: 0 0 7px; font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--text); }
.foundry-help__section ul, .foundry-help-page__section ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.foundry-help__section li, .foundry-help-page__section li { margin: 6px 0; line-height: 1.45; }
.foundry-help__more { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; color: var(--blue-hi); font-family: var(--mono); font-size: 12px; text-decoration: none; }
.foundry-help__more svg { width: 14px; height: 14px; }

.foundry-help-page { width: min(1040px, calc(100vw - 32px)); margin: 0 auto; padding: clamp(28px, 5vw, 56px) 0; }
.foundry-help-page__hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.foundry-help-page__hero h1, .foundry-help-page__empty h1 { margin: 6px 0 0; font-family: var(--display); font-size: clamp(28px, 4vw, 42px); font-weight: 600; color: var(--text); }
.foundry-help-page__hero p, .foundry-help-page__about p, .foundry-help-page__empty p { margin: 10px 0 0; max-width: 760px; color: var(--text-2); line-height: 1.65; }
.foundry-help-page__module, .foundry-help-page__back { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--text); background: var(--surface); text-decoration: none; white-space: nowrap; }
.foundry-help-page__module:hover, .foundry-help-page__back:hover { background: var(--surface-2); }
.foundry-help-page__module svg { width: 15px; height: 15px; }
.foundry-help-page__about, .foundry-help-page__section, .foundry-help-page__empty { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(180deg, var(--surface), var(--navy)); }
.foundry-help-page__about h2, .foundry-help-page__section h2 { margin: 0 0 8px; font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--text); }
.foundry-help-page__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.foundry-help-page__section { margin-top: 0; }
.foundry-help-page__empty { max-width: 520px; text-align: center; margin-inline: auto; }
.foundry-help-page__icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--blue-hi); background: var(--surface-2); }
.foundry-help-page__icon svg { width: 22px; height: 22px; }
.foundry-help-page__back { margin-top: 18px; }
@media (max-width: 760px) {
  .foundry-help__panel { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; max-height: calc(100vh - 96px); }
  .foundry-help-page__hero { display: grid; }
  .foundry-help-page__grid { grid-template-columns: 1fr; }
}
