/* =========================================================================
   App Factory — Publish V2 control room
   Self-contained styles (fx- prefix). Reuses the dashboard's platinum tokens
   (--bg/--text/--accent/--accent-2/--muted) with safe fallbacks so it renders
   even if a token name drifts. Loaded after admin.css.
   ========================================================================= */

.fx {
  --fx-line: rgba(255, 255, 255, 0.10);
  --fx-line-soft: rgba(255, 255, 255, 0.06);
  --fx-card: rgba(255, 255, 255, 0.025);
  --fx-card-hi: rgba(255, 255, 255, 0.045);
  --fx-text: var(--text, #f1f3f8);
  --fx-mut: var(--muted, #8a93a6);
  --fx-accent: var(--accent-2, #f2705a);      /* coral = "live/active" */
  --fx-plat: var(--accent-strong, #c7cedb);   /* platinum = neutral hi */
  --fx-ok: #4ade80;
  --fx-warn: #fbbf24;
  --fx-idle: #6b7280;
  font-family: var(--font-sans, "Geist", system-ui, sans-serif);
  color: var(--fx-text);
  padding: 22px 0 40px;
}

.fx__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.fx__title {
  font-family: var(--font-sans, "Syne", "Geist", sans-serif);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.fx__title-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--fx-idle);
  box-shadow: 0 0 0 0 rgba(242, 112, 90, 0.5);
}
.fx.is-running .fx__title-dot { background: var(--fx-accent); animation: fx-pulse 1.6s ease-out infinite; }
.fx.is-done .fx__title-dot { background: var(--fx-ok); }
.fx__sub { color: var(--fx-mut); font-size: 13px; margin: 4px 0 0; max-width: 60ch; }

.fx__actions { display: flex; gap: 10px; align-items: center; }
.fx-btn {
  font-family: var(--font-mono, "Geist Mono", monospace);
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 11px 18px; border-radius: 0;
  border: 1px solid var(--fx-line); background: transparent; color: var(--fx-text);
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
}
.fx-btn:hover { background: var(--fx-card-hi); }
.fx-btn:active { transform: scale(0.98); }
.fx-btn--primary { background: var(--fx-accent); border-color: var(--fx-accent); color: #140a08; }
.fx-btn--primary:hover { filter: brightness(1.07); background: var(--fx-accent); }
.fx-btn:disabled { opacity: .4; cursor: not-allowed; }
.fx-btn--ghost { color: var(--fx-mut); }

/* Overall progress rail */
.fx__progress { margin: 18px 0 24px; }
.fx__progress-track { height: 3px; background: var(--fx-line-soft); position: relative; overflow: hidden; }
.fx__progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--fx-plat), var(--fx-accent)); transition: width .6s cubic-bezier(.16,1,.3,1); }
.fx__progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--font-mono, monospace); font-size: 11px; color: var(--fx-mut); letter-spacing: .04em; text-transform: uppercase; }

/* Workspace: pipeline (left) beside its artifacts (right) */
.fx__workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .fx__workspace { grid-template-columns: 1fr; } }
.fx__ws-main { min-width: 0; }
.fx__ws-side { min-width: 0; position: sticky; top: 64px; }
@media (max-width: 900px) { .fx__ws-side { position: static; margin-top: 22px; } }

/* Sticky "Working on…" context bar */
.fx-ctx { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: rgba(12,15,21,.92); backdrop-filter: blur(10px);
  border: 1px solid var(--fx-line); border-radius: 9px; padding: 11px 16px; margin: 20px 0 14px; position: sticky; top: 0; z-index: 6; }
.fx-ctx.is-empty { color: var(--fx-mut); }
.fx-ctx__empty { font-family: var(--font-mono, monospace); font-size: 12px; }
.fx-ctx__empty b { color: var(--fx-text); }
.fx-ctx__id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.fx-ctx__label { font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--fx-accent); flex: none; }
.fx-ctx__app { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.fx-ctx__acct { font-family: var(--font-mono, monospace); font-size: 10px; color: var(--fx-mut); border: 1px solid var(--fx-line); border-radius: 20px; padding: 2px 9px; }
.fx-ctx__new { font-family: var(--font-mono, monospace); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--fx-warn); }
.fx-ctx__prog { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 1 1 170px; max-width: 320px; }
.fx-ctx__track { flex: 1; height: 3px; background: var(--fx-line-soft); border-radius: 999px; overflow: hidden; }
.fx-ctx__meta { font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--fx-mut); white-space: nowrap; }

/* Pipeline of agents — vertical stepper inside the workspace */
.fx__pipeline { display: flex; flex-direction: column; gap: 10px; }

.fx-agent {
  position: relative;
  border: 1px solid var(--fx-line-soft);
  background: var(--fx-card);
  padding: 14px 16px;
  min-height: 0;
  display: flex; flex-direction: column;
  transition: border-color .2s, background .2s;
  overflow: hidden;
}
.fx-agent::before { /* corner accents */
  content: ""; position: absolute; top: 0; left: 0; width: 10px; height: 10px;
  border-top: 1px solid var(--fx-line); border-left: 1px solid var(--fx-line);
}
.fx-agent.is-working { border-color: rgba(242,112,90,0.45); background: var(--fx-card-hi); }
.fx-agent.is-done    { border-color: rgba(74,222,128,0.30); }
.fx-agent.is-blocked { border-color: rgba(251,191,36,0.45); }

.fx-agent__top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fx-agent__face {
  position: relative;
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--fx-line);
}
.fx-agent.is-working .fx-agent__face { border-color: var(--fx-accent); }
.fx-agent.is-working .fx-agent__face::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid transparent; border-top-color: var(--fx-accent); border-right-color: rgba(242,112,90,.4);
  animation: fx-spin 1.1s linear infinite;
}
.fx-agent__id { min-width: 0; }
.fx-agent__name { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.fx-agent__role { font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--fx-mut); margin-top: 2px; }

.fx-agent__status {
  align-self: flex-start;
  font-family: var(--font-mono, monospace); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border: 1px solid var(--fx-line);
  color: var(--fx-idle);
  margin-bottom: 10px;
}
.fx-agent.is-working .fx-agent__status { color: var(--fx-accent); border-color: rgba(242,112,90,.45); }
.fx-agent.is-done .fx-agent__status    { color: var(--fx-ok); border-color: rgba(74,222,128,.4); }
.fx-agent.is-blocked .fx-agent__status { color: var(--fx-warn); border-color: rgba(251,191,36,.5); }

.fx-agent__task { font-size: 12px; color: var(--fx-text); min-height: 0; margin-bottom: 10px; line-height: 1.35; }
.fx-agent__task .fx-agent__task-mut { color: var(--fx-mut); }

.fx-agent__bar { height: 2px; background: var(--fx-line-soft); margin-bottom: 10px; overflow: hidden; }
.fx-agent__bar-fill { height: 100%; width: 0%; background: var(--fx-accent); transition: width .5s ease; }
.fx-agent.is-done .fx-agent__bar-fill { background: var(--fx-ok); }

.fx-agent__log { list-style: none; margin: 6px 0 0; padding: 0; font-family: var(--font-mono, monospace); font-size: 10.5px; line-height: 1.5; color: var(--fx-mut); }
.fx-agent__log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(3px); animation: fx-logline .35s ease forwards; }
.fx-agent__log li::before { content: "› "; color: var(--fx-accent); }

/* Gate card */
.fx__gate {
  border: 1px solid rgba(251,191,36,0.45);
  background: rgba(251,191,36,0.05);
  padding: 18px 20px; margin-bottom: 24px;
  display: none;
}
.fx.is-gate .fx__gate { display: block; animation: fx-logline .3s ease; }
.fx__gate-label { font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--fx-warn); margin-bottom: 6px; }
.fx__gate-prompt { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.fx__gate-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fx-idea {
  text-align: left; cursor: pointer; padding: 14px; border: 1px solid var(--fx-line);
  background: var(--fx-card); color: var(--fx-text); transition: border-color .15s, background .15s;
}
.fx-idea:hover { border-color: var(--fx-accent); background: var(--fx-card-hi); }
.fx-idea__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.fx-idea__kw { font-weight: 700; font-size: 15px; }
.fx-idea__type { font-family: var(--font-mono, monospace); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--fx-plat); border: 1px solid var(--fx-line); padding: 2px 7px; white-space: nowrap; }
.fx-idea__build { margin-top: 9px; font-family: var(--font-mono, monospace); font-size: 10.5px; color: var(--fx-ok); }
.fx-idea__stats { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--fx-mut); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fx-idea__stats b { color: var(--fx-ok); font-weight: 700; }
.fx__gate-actions { display: flex; gap: 10px; }

/* Artifacts panel */
.fx__artifacts { border: 1px solid var(--fx-line); border-radius: 10px; background: var(--fx-card); padding: 16px; }
.fx__artifacts-title { font-family: var(--font-mono, monospace); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fx-mut); margin-bottom: 14px; }
.fx__artifact-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }

/* Collapsible artifact groups (sidebar) */
.fx__ws-side .fx-artgroup__title { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.fx__ws-side .fx-artgroup__title::before { content: "▾"; font-size: 9px; color: var(--fx-mut); transition: transform .15s; }
.fx__ws-side .fx-artgroup.is-collapsed .fx-artgroup__title::before { transform: rotate(-90deg); }
.fx-artgroup.is-collapsed .fx-artgroup__title { margin-bottom: 0; }
.fx-artgroup.is-collapsed .fx__artifact-grid, .fx-artgroup.is-collapsed .fx-techrow { display: none; }
.fx-artifact { border: 1px solid var(--fx-line-soft); background: var(--fx-card); padding: 12px 14px; opacity: .45; transition: opacity .3s, border-color .3s; }
.fx-artifact.is-set { opacity: 1; border-color: var(--fx-line); }
.fx-artifact__k { font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--fx-mut); margin-bottom: 5px; }
.fx-artifact__v { font-family: var(--font-mono, monospace); font-size: 13px; color: var(--fx-text); word-break: break-all; }
.fx-artifact__v a { color: var(--fx-plat); text-decoration: none; border-bottom: 1px solid var(--fx-line); }
.fx-artifact__v a:hover { color: var(--fx-text); border-bottom-color: var(--fx-accent); }
.fx-artifact--editable { cursor: text; opacity: 1; }
.fx-artifact--editable:hover { border-color: color-mix(in srgb, var(--fx-accent) 45%, var(--fx-line)); }
.fx-artifact--editable .fx-artifact__k::after { content: " ✎"; color: var(--fx-mut); opacity: 0; transition: opacity .15s; }
.fx-artifact--editable:hover .fx-artifact__k::after { opacity: .8; }
.fx-artifact__edit { width: 100%; box-sizing: border-box; background: var(--bg, #07080c); border: 1px solid var(--fx-accent); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 13px; padding: 3px 6px; border-radius: 2px; }
.fx-artifact__edit:focus { outline: none; }
.fx-artifact__edit--err { border-color: #ef4444; }

/* Artifact groups — organized, scannable sections */
.fx-artgroup { margin-bottom: 20px; }
.fx-artgroup:last-child { margin-bottom: 0; }
.fx-artgroup__title { font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--fx-plat); margin-bottom: 9px; opacity: .9; }

/* Tech stack chips */
.fx-techrow { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-tech { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--fx-mut); border: 1px solid var(--fx-line-soft); background: var(--fx-card); padding: 4px 9px; }

/* Publish account — lives inside the Registrar card */
.fx-agent__acct { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--fx-line-soft); }
.fx-agent__acct.is-set { border-top-color: rgba(242,112,90,.45); }
.fx-agent__acct.is-muted { opacity: .7; }
/* Narrow (1/4-width) card → stack the label on its own line, select + ⚙ below. */
.fx-agent__acct-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin-bottom: 6px; }
.fx-agent__acct-label { flex: 0 0 100%; font-family: var(--font-mono, monospace); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--fx-mut); }
.fx-agent__acct-sel { flex: 1 1 auto; min-width: 0; background: var(--bg, #07080c); border: 1px solid var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 11px; padding: 6px 8px; }
.fx-agent__acct-sel:focus { outline: none; border-color: var(--fx-plat); }
.fx-agent__acct.is-set .fx-agent__acct-sel { border-color: rgba(242,112,90,.4); }
.fx-agent__acct-hint { font-family: var(--font-mono, monospace); font-size: 9px; line-height: 1.45; color: var(--fx-mut); }
.fx-agent__acct-hint b { color: var(--fx-text); font-weight: 600; }

/* Monetization panel (subscriptions + consumables) — Registrar card.
   One coherent panel: a shared header, two labelled sections, and a shared
   3-column row grid [label | price | suffix] so prices align across both. */
.fx-mon { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--fx-line-soft); }
.fx-mon__cont { margin-top: 12px; }
.fx-mon__head { font-family: var(--font-mono, monospace); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fx-text); margin-bottom: 10px; }
.fx-mon__head-sub { font-weight: 400; opacity: .55; text-transform: none; letter-spacing: 0; }
.fx-mon__section-label { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono, monospace); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--fx-mut); margin-bottom: 7px; }
.fx-mon__tag { font-weight: 400; font-size: 8px; padding: 1px 5px; border: 1px solid var(--fx-line); border-radius: 3px; color: var(--fx-mut); text-transform: none; letter-spacing: 0; }
.fx-mon__offering { display: flex; align-items: center; gap: 5px; margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .8; }
.fx-mon__offering input { width: 74px; background: var(--bg, #07080c); border: 1px solid var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 10px; padding: 3px 6px; }
.fx-mon__offering input:focus { outline: none; border-color: var(--fx-plat); }
/* shared row grid: label grows, price + suffix are fixed and thus aligned */
.fx-mon__row { display: grid; grid-template-columns: 1fr auto 30px; align-items: center; gap: 8px; margin-bottom: 5px; }
.fx-mon__row--off { opacity: .5; }
.fx-mon__row--off .fx-mon__suffix { color: var(--fx-mut); font-style: italic; }
.fx-mon__label { display: flex; align-items: center; gap: 6px; min-width: 0; font-family: var(--font-mono, monospace); font-size: 11px; color: var(--fx-text); }
.fx-mon__credits { width: 68px; flex: none; background: var(--bg, #07080c); border: 1px solid var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 11px; padding: 5px 7px; text-align: right; }
.fx-mon__credits:focus { outline: none; border-color: var(--fx-plat); }
.fx-mon__unit { font-size: 10px; color: var(--fx-mut); }
.fx-mon__price-wrap { display: flex; align-items: center; gap: 4px; }
.fx-mon__cur { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--fx-mut); }
.fx-mon__price { width: 62px; flex: none; background: var(--bg, #07080c); border: 1px solid var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 11px; padding: 5px 7px; text-align: right; }
.fx-mon__price:focus { outline: none; border-color: var(--fx-plat); }
.fx-mon__suffix { font-family: var(--font-mono, monospace); font-size: 10px; color: var(--fx-mut); text-align: center; }
.fx-mon__del { width: 30px; background: transparent; border: 1px solid var(--fx-line); color: var(--fx-mut); font-size: 10px; cursor: pointer; padding: 5px 0; }
.fx-mon__del:hover { border-color: var(--fx-accent); color: var(--fx-accent); }
.fx-mon__actions { display: flex; gap: 6px; margin-top: 8px; }
.fx-mon__btn { font-family: var(--font-mono, monospace); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px; border: 1px solid var(--fx-line); background: transparent; color: var(--fx-text); cursor: pointer; transition: background .15s; }
.fx-mon__btn:hover { background: var(--fx-card-hi); }
.fx-mon__hint { margin-top: 6px; font-family: var(--font-mono, monospace); font-size: 9px; line-height: 1.4; color: var(--fx-mut); }

/* Builder input panel (Registrar-style), inside the Builder card */
.fx-builder { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--fx-line-soft); }
.fx-builder__row { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.fx-builder__lbl { font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--fx-mut); flex: none; }
.fx-builder__row input { flex: 1; min-width: 0; background: var(--bg, #07080c); border: 1px solid var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 11px; padding: 6px 8px; }
.fx-builder__row input:focus { outline: none; border-color: var(--fx-plat); }
.fx-builder__row input:disabled { opacity: .55; }
.fx-builder__hint { font-family: var(--font-mono, monospace); font-size: 9px; line-height: 1.5; color: var(--fx-mut); }
.fx-builder__hint code { color: var(--fx-text); font-size: 9px; }
.fx-builder__hint--warn { color: var(--fx-accent); margin-top: 4px; }
.fx-builder__inst { width: 100%; box-sizing: border-box; resize: vertical; background: var(--bg, #07080c); border: 1px solid var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 11px; line-height: 1.4; padding: 6px 8px; margin-bottom: 6px; }
.fx-builder__inst:focus { outline: none; border-color: var(--fx-plat); }
.fx-builder__inst:disabled { opacity: .55; }
.fx-builder__rerun { width: 100%; font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 600; padding: 7px 10px; border: 1px solid var(--fx-line); background: transparent; color: var(--fx-text); cursor: pointer; transition: background .15s; }
.fx-builder__rerun:hover:not(:disabled) { background: var(--fx-card-hi); border-color: var(--fx-plat); }
.fx-builder__rerun:disabled { opacity: .5; cursor: not-allowed; }

@keyframes fx-spin { to { transform: rotate(360deg); } }
@keyframes fx-pulse { 0% { box-shadow: 0 0 0 0 rgba(242,112,90,.5); } 70% { box-shadow: 0 0 0 8px rgba(242,112,90,0); } 100% { box-shadow: 0 0 0 0 rgba(242,112,90,0); } }
@keyframes fx-logline { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .fx-agent.is-working .fx-agent__face::after { animation: none; }
  .fx__title-dot { animation: none !important; }
  .fx-agent__log li { animation: none; opacity: 1; transform: none; }
}

/* Scout config — Apptweak API key */
.fx-config {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--fx-line-soft); background: var(--fx-card);
  padding: 14px 16px; margin-bottom: 24px;
  transition: border-color .2s, background .2s;
}
.fx-config.is-warn { border-color: var(--fx-accent); background: rgba(242, 112, 90, 0.06); }
.fx-config.is-set  { border-color: rgba(74, 222, 128, 0.28); }
.fx-config__face {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center; font-size: 18px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--fx-line);
}
.fx-config.is-set .fx-config__face  { border-color: rgba(74, 222, 128, 0.4); }
.fx-config.is-warn .fx-config__face { border-color: var(--fx-accent); }
.fx-config__body { flex: 1; min-width: 0; }
.fx-config__title { font-weight: 700; font-size: 13px; margin-bottom: 7px; }
.fx-config__row { display: flex; gap: 8px; margin-bottom: 7px; max-width: 560px; }
.fx-config__input {
  flex: 1; min-width: 0;
  background: var(--bg, #07080c); border: 1px solid var(--fx-line); color: var(--fx-text);
  font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: .04em;
  padding: 9px 11px;
}
.fx-config__input:focus { outline: none; border-color: var(--fx-plat); }
.fx-config__hint { font-family: var(--font-mono, monospace); font-size: 10.5px; color: var(--fx-mut); letter-spacing: .02em; }
.fx-config__inline-label { font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--fx-mut); white-space: nowrap; align-self: center; }

/* Per-stage Run button + "ready to run" highlight */
.fx-agent__run { margin-left: auto; align-self: center; font-size: 10px; padding: 6px 11px; white-space: nowrap; }
.fx-agent.is-ready { border-color: rgba(199, 206, 219, 0.42); background: var(--fx-card-hi); }
.fx-agent.is-ready .fx-agent__face { border-color: var(--fx-plat); }
.fx-agent.is-ready .fx-agent__run { animation: fx-pulse 1.8s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .fx-agent.is-ready .fx-agent__run { animation: none; } }

/* Apptweak API key — compact, inside the Scout card */
.fx-agent__key { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--fx-line-soft); }
.fx-agent__key.is-warn { border-top-color: var(--fx-accent); }
.fx-agent__key-row { display: flex; align-items: center; gap: 6px; }
.fx-agent__key-mask { flex: 1; min-width: 0; font-family: var(--font-mono, monospace); font-size: 12px; color: var(--fx-ok); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-agent__key-input { flex: 1; min-width: 0; background: var(--bg, #07080c); border: 1px solid var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .04em; padding: 6px 8px; }
.fx-agent__key-input:focus { outline: none; border-color: var(--fx-plat); }
.fx-agent__key.is-warn .fx-agent__key-input { border-color: var(--fx-accent); }
.fx-agent__key-btn { flex: none; font-family: var(--font-mono, monospace); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 6px 9px; border: 1px solid var(--fx-line); background: transparent; color: var(--fx-text); cursor: pointer; white-space: nowrap; transition: background .15s; }
.fx-agent__key-btn:hover { background: var(--fx-card-hi); }
.fx-agent__key-btn--go { background: var(--fx-accent); border-color: var(--fx-accent); color: #140a08; }
.fx-agent__key-hint { margin-top: 6px; font-family: var(--font-mono, monospace); font-size: 9px; line-height: 1.4; color: var(--fx-mut); }

/* Manual keyword entry — inside the Scout card */
.fx-agent__manual { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--fx-line-soft); }
.fx-agent__manual-lbl { font-family: var(--font-mono, monospace); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--fx-mut); margin-bottom: 6px; }
.fx-agent__manual-row { display: flex; gap: 6px; }
.fx-agent__manual-input { flex: 1; min-width: 0; background: var(--bg, #07080c); border: 1px solid var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 11px; padding: 6px 8px; }
.fx-agent__manual-input:focus { outline: none; border-color: var(--fx-plat); }
.fx-agent__manual-go { flex: none; background: var(--fx-accent); border: 1px solid var(--fx-accent); color: #140a08; font-weight: 700; font-size: 12px; line-height: 1; padding: 6px 11px; cursor: pointer; transition: filter .15s; }
.fx-agent__manual-go:hover { filter: brightness(1.08); }
.fx-agent__manual-go:disabled { opacity: .5; cursor: not-allowed; }
.fx-agent__manual-ctx { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; }
.fx-agent__manual-hint { margin-top: 6px; font-family: var(--font-mono, monospace); font-size: 9px; line-height: 1.4; color: var(--fx-mut); }
.fx-agent__manual-hint b { color: var(--fx-text); font-weight: 600; }

/* Publishing pipeline board — live status of every app in the factory */
.fx-board { margin: 26px 0; border: 1px solid var(--fx-line); background: var(--fx-card); padding: 16px; }
.fx-board__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fx-board__title { font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.fx-board__count { font-family: var(--font-mono, monospace); font-size: 10px; color: var(--fx-mut); }
.fx-board__new { margin-left: auto; flex: none; background: transparent; border: 1px solid var(--fx-line); color: var(--fx-text); font-size: 11px; font-weight: 600; padding: 4px 11px; height: 26px; cursor: pointer; border-radius: 2px; transition: color .15s, border-color .15s; }
.fx-board__new:hover { color: var(--fx-accent); border-color: color-mix(in srgb, var(--fx-accent) 55%, transparent); }
.fx-board__refresh { flex: none; background: transparent; border: 1px solid var(--fx-line); color: var(--fx-mut); width: 26px; height: 26px; cursor: pointer; font-size: 13px; line-height: 1; border-radius: 2px; transition: color .15s, border-color .15s; }
.fx-board__refresh:hover { color: var(--fx-text); border-color: var(--fx-plat); }
.fx-board__refresh.is-spin { animation: fx-board-spin .8s linear infinite; }
@keyframes fx-board-spin { to { transform: rotate(360deg); } }
.fx-board__collapse { flex: none; background: transparent; border: none; color: var(--fx-mut); cursor: pointer; font-size: 12px; line-height: 1; padding: 2px 4px; margin-left: -4px; transition: color .15s; }
.fx-board__collapse:hover { color: var(--fx-text); }
.fx-board__list { display: flex; flex-direction: column; gap: 6px; max-height: 330px; overflow-y: auto; padding-right: 2px; }
.fx-board__list::-webkit-scrollbar { width: 8px; }
.fx-board__list::-webkit-scrollbar-thumb { background: var(--fx-line); border-radius: 4px; }
.fx-board.is-collapsed .fx-board__list { display: none; }
.fx-board__empty { font-family: var(--font-mono, monospace); font-size: 10px; color: var(--fx-mut); padding: 14px 0; text-align: center; }
.fx-board__empty b { color: var(--fx-text); font-weight: 700; }

.fx-board__entry { display: flex; flex-direction: column; }
.fx-board__item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--fx-line-soft); background: var(--bg, #07080c); padding: 10px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.fx-board__item:hover { border-color: var(--fx-line); background: color-mix(in srgb, var(--fx-card-hi) 50%, var(--bg, #07080c)); }
.fx-board__item.is-live { border-color: color-mix(in srgb, var(--fx-ok) 40%, var(--fx-line)); }
.fx-board__item.is-active { border-color: color-mix(in srgb, var(--fx-accent) 42%, var(--fx-line)); }
.fx-board__item.is-expanded { border-bottom-color: transparent; }
.fx-board__chev { flex: none; width: 12px; color: var(--fx-mut); font-size: 10px; transition: transform .15s; }
.fx-board__item.is-expanded .fx-board__chev { transform: rotate(90deg); color: var(--fx-text); }
.fx-board__dot { flex: none; color: var(--fx-accent); font-size: 9px; line-height: 1; }
.fx-board__idx { flex: none; width: 16px; font-family: var(--font-mono, monospace); font-size: 11px; color: var(--fx-mut); text-align: right; }
.fx-board__main { flex: 1 1 150px; min-width: 0; }
.fx-board__name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.fx-board__meta { font-family: var(--font-mono, monospace); font-size: 9.5px; color: var(--fx-mut); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-board__badge { flex: none; font-family: var(--font-mono, monospace); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 5px; border: 1px solid var(--fx-line); color: var(--fx-mut); border-radius: 2px; }
.fx-board__badge.is-live { color: var(--fx-ok); border-color: color-mix(in srgb, var(--fx-ok) 50%, transparent); }

.fx-board__stages { flex: 2 1 320px; display: flex; flex-wrap: wrap; gap: 5px; }
.fx-board__stage { font-family: var(--font-mono, monospace); font-size: 9.5px; padding: 3px 8px; border: 1px solid var(--fx-line-soft); border-radius: 999px; white-space: nowrap; color: var(--fx-mut); }
.fx-board__stage.is-done { color: var(--fx-ok); border-color: color-mix(in srgb, var(--fx-ok) 38%, transparent); background: color-mix(in srgb, var(--fx-ok) 9%, transparent); }
.fx-board__stage.is-active { color: var(--fx-accent); border-color: color-mix(in srgb, var(--fx-accent) 45%, transparent); background: color-mix(in srgb, var(--fx-accent) 10%, transparent); }
.fx-board__stage.is-wait { color: var(--fx-mut); opacity: .6; }

.fx-board__prog { flex: none; display: flex; align-items: center; gap: 8px; width: 130px; }
.fx-board__bar { flex: 1; height: 4px; background: var(--fx-line-soft); overflow: hidden; border-radius: 999px; }
.fx-board__bar-fill { height: 100%; background: var(--fx-accent); transition: width .5s ease; border-radius: 999px; }
.fx-board__item.is-live .fx-board__bar-fill { background: var(--fx-ok); }
.fx-board__pct { flex: none; width: 34px; text-align: right; font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fx-text); }

.fx-board__del { flex: none; background: transparent; border: none; color: var(--fx-mut); cursor: pointer; font-size: 13px; padding: 2px 4px; opacity: .5; transition: opacity .15s, color .15s; }
.fx-board__del:hover { opacity: 1; color: var(--fx-warn); }
.fx-board__del:disabled { cursor: default; opacity: .4; }

/* Expanded per-app artifacts drawer */
.fx-board__detail { border: 1px solid color-mix(in srgb, var(--fx-accent) 42%, var(--fx-line)); border-top: 1px solid var(--fx-line-soft); background: color-mix(in srgb, var(--fx-card) 55%, var(--bg, #07080c)); padding: 14px; }
.fx-board__art-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 22px; margin-bottom: 14px; }
.fx-board__art-title { font-family: var(--font-mono, monospace); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fx-mut); margin-bottom: 7px; }
.fx-board__art-item { display: flex; gap: 10px; font-size: 11.5px; padding: 2px 0; align-items: baseline; }
.fx-board__art-item .k { flex: none; width: 86px; color: var(--fx-mut); font-family: var(--font-mono, monospace); font-size: 9.5px; }
.fx-board__art-item .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fx-text); }
.fx-board__art-item a.v { color: var(--fx-plat); text-decoration: none; }
.fx-board__art-item a.v:hover { color: var(--fx-accent); text-decoration: underline; }
.fx-board__detail-empty { font-family: var(--font-mono, monospace); font-size: 10.5px; color: var(--fx-mut); margin-bottom: 14px; }
.fx-board__detail-actions { display: flex; gap: 8px; }
.fx-board__open { font-size: 11.5px; }

@media (max-width: 720px) {
  .fx-board__item { flex-wrap: wrap; }
  .fx-board__stages { flex-basis: 100%; order: 3; }
  .fx-board__prog { width: auto; flex: 1 1 120px; }
}

/* ==========================================================================
   Publish-accounts manager — modal, master–detail (list + editor).
   Reuses the factory tokens: coral = active, platinum = focus, green = set.
   ========================================================================== */
.fx-agent__acct-manage { flex: none; display: grid; place-items: center; align-self: stretch; width: 30px; background: transparent; border: 1px solid var(--fx-line); color: var(--fx-mut); font-size: 12px; padding: 0; cursor: pointer; transition: color .15s, border-color .15s; }
.fx-agent__acct-manage:hover { color: var(--fx-text); border-color: var(--fx-plat); }

.fx-modal { /* mounted on <body>, so it carries the factory tokens itself */
  --fx-line: rgba(255,255,255,.10); --fx-line-soft: rgba(255,255,255,.06);
  --fx-card: rgba(255,255,255,.025); --fx-card-hi: rgba(255,255,255,.045);
  --fx-text: var(--text, #f1f3f8); --fx-mut: var(--muted, #8a93a6);
  --fx-accent: var(--accent-2, #f2705a); --fx-plat: var(--accent-strong, #c7cedb);
  --fx-ok: #4ade80; --fx-warn: #fbbf24; --fx-idle: #6b7280;
  position: fixed; inset: 0; z-index: 1000; display: none; }
.fx-modal.is-open { display: grid; place-items: center; }
.fx-modal__backdrop { position: absolute; inset: 0; background: rgba(4,5,8,.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.fx-modal__panel { position: relative; z-index: 1; width: min(920px, 94vw); max-height: 88vh; display: flex; flex-direction: column; background: var(--bg, #07080c); border: 1px solid var(--fx-line); box-shadow: 0 24px 80px rgba(0,0,0,.6); animation: fx-modal-in .18s ease-out; }
@keyframes fx-modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fx-modal__panel { animation: none; } }
.fx-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--fx-line-soft); }
.fx-modal__title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fx-modal__sub { font-family: var(--font-mono, monospace); font-size: 10px; font-weight: 400; letter-spacing: 0; color: var(--fx-mut); }
.fx-modal__x { flex: none; background: transparent; border: 1px solid var(--fx-line); color: var(--fx-mut); font-size: 12px; width: 28px; height: 28px; cursor: pointer; transition: color .15s, border-color .15s; }
.fx-modal__x:hover { color: var(--fx-text); border-color: var(--fx-plat); }
.fx-modal__body { display: flex; min-height: 0; flex: 1; }

.fx-acct-list { flex: none; width: 240px; border-right: 1px solid var(--fx-line-soft); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.fx-acct-list__empty { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--fx-mut); line-height: 1.6; padding: 10px 4px; }
.fx-acct-new { width: 100%; flex: none; background: transparent; border: 1px dashed var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 700; padding: 9px; cursor: pointer; transition: border-color .15s, background .15s; }
.fx-acct-new:hover { border-color: var(--fx-plat); background: var(--fx-card); }
.fx-acct-new.is-active { border-style: solid; border-color: var(--fx-accent); color: var(--fx-accent); }
.fx-acct-item { text-align: left; width: 100%; flex: none; background: var(--fx-card); border: 1px solid var(--fx-line-soft); border-left: 2px solid transparent; padding: 10px; cursor: pointer; transition: background .15s, border-color .15s; }
.fx-acct-item:hover { background: var(--fx-card-hi); }
.fx-acct-item.is-active { border-left-color: var(--fx-accent); background: var(--fx-card-hi); }
.fx-acct-item.is-off { opacity: .5; }
.fx-acct-item__top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.fx-acct-item__name { font-size: 12.5px; font-weight: 600; color: var(--fx-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-acct-item__co { flex: none; font-family: var(--font-mono, monospace); font-size: 9px; color: var(--fx-mut); white-space: nowrap; }
.fx-acct-item__chips { display: flex; flex-wrap: wrap; gap: 3px; }
.fx-chip { font-family: var(--font-mono, monospace); font-size: 8px; text-transform: uppercase; letter-spacing: .04em; padding: 2px 5px; border: 1px solid var(--fx-line-soft); color: var(--fx-idle); }
.fx-chip.is-on { color: var(--fx-ok); border-color: rgba(74,222,128,.4); }

.fx-acct-editor { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-acct-editor__empty { margin: auto; text-align: center; padding: 40px; max-width: 380px; }
.fx-acct-editor__empty-ic { font-size: 34px; opacity: .45; margin-bottom: 14px; }
.fx-acct-editor__empty-t { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.fx-acct-editor__empty-s { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--fx-mut); line-height: 1.6; }
.fx-acct-editor__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--fx-line-soft); }
.fx-acct-editor__title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-acct-editor__scroll { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 18px; }

.fx-toggle { display: inline-flex; align-items: center; gap: 7px; flex: none; font-family: var(--font-mono, monospace); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--fx-mut); cursor: pointer; }
.fx-toggle input { accent-color: var(--fx-accent); width: 15px; height: 15px; }

.fx-grp { display: flex; flex-direction: column; gap: 10px; }
.fx-grp__title { font-family: var(--font-mono, monospace); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--fx-plat); }
.fx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fx-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fx-f__label { font-family: var(--font-mono, monospace); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--fx-mut); }
.fx-f__req { color: var(--fx-accent); }
.fx-f__input { background: rgba(0,0,0,.25); border: 1px solid var(--fx-line); color: var(--fx-text); font-family: var(--font-mono, monospace); font-size: 12px; padding: 8px 10px; width: 100%; }
.fx-f__input:focus { outline: none; border-color: var(--fx-plat); }
select.fx-f__input { cursor: pointer; }
.fx-f__area { resize: vertical; line-height: 1.5; }
.fx-f__hint { font-family: var(--font-mono, monospace); font-size: 9px; color: var(--fx-mut); line-height: 1.4; }

/* "Shared by every account" strip — the infra the accounts no longer configure */
.fx-shared { font-family: var(--font-mono, monospace); font-size: 9.5px; color: var(--fx-mut); line-height: 1.6; border: 1px dashed var(--fx-line-soft); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.fx-shared__lead { width: 100%; color: var(--fx-mut); margin-bottom: 2px; }
.fx-shared span:not(.fx-shared__lead) { color: var(--fx-text); opacity: .85; white-space: nowrap; }
.fx-shared code { font-size: 9px; color: var(--fx-plat); background: rgba(255,255,255,.04); padding: 1px 4px; }

/* One manual step — Play Console admin grant for a new account */
.fx-manual { border: 1px solid rgba(251,191,36,.4); background: rgba(251,191,36,.05); padding: 13px 14px; border-radius: 7px; }
.fx-manual.is-done { border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.05); }
.fx-manual .fx-grp__title { color: var(--fx-warn); }
.fx-manual.is-done .fx-grp__title { color: var(--fx-ok); }
.fx-manual__lead { margin: 0; font-size: 12px; line-height: 1.5; color: var(--fx-mut); }
.fx-manual__lead b { color: var(--fx-text); }
.fx-manual__sa { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fx-manual__sa code { flex: 1; min-width: 0; font-family: var(--font-mono, monospace); font-size: 11.5px; color: var(--fx-plat); background: rgba(255,255,255,.05); border: 1px solid var(--fx-line); padding: 7px 9px; border-radius: 5px; overflow-x: auto; white-space: nowrap; }
.fx-manual__copy { font-size: 10px; flex: none; }
.fx-manual__done { align-self: flex-start; font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--fx-text); }
.fx-manual.is-done .fx-manual__done { color: var(--fx-ok); }

.fx-conn { display: flex; align-items: center; gap: 11px; border: 1px solid var(--fx-line); background: var(--fx-card); padding: 11px 13px; }
.fx-conn__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--fx-idle); }
.fx-conn.is-on .fx-conn__dot { background: var(--fx-ok); box-shadow: 0 0 0 3px rgba(74,222,128,.15); }
.fx-conn__txt { flex: 1; min-width: 0; font-family: var(--font-mono, monospace); font-size: 11px; color: var(--fx-mut); line-height: 1.4; }
.fx-conn__txt b { color: var(--fx-text); }
.fx-conn__btn { flex: none; font-size: 10px; padding: 6px 11px; }

.fx-adv { border: 1px solid var(--fx-line-soft); }
.fx-adv__sum { cursor: pointer; font-family: var(--font-mono, monospace); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--fx-text); padding: 11px 13px; list-style: none; user-select: none; }
.fx-adv__sum::-webkit-details-marker { display: none; }
.fx-adv__sum::before { content: "▸ "; color: var(--fx-mut); }
.fx-adv[open] .fx-adv__sum::before { content: "▾ "; }
.fx-adv__sum span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--fx-mut); }
.fx-adv__body { padding: 4px 13px 14px; display: flex; flex-direction: column; gap: 16px; border-top: 1px solid var(--fx-line-soft); }

.fx-acct-actions { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--fx-line-soft); }
.fx-acct-actions__msg { flex: 1; min-width: 0; font-family: var(--font-mono, monospace); font-size: 10.5px; color: var(--fx-mut); }
.fx-acct-actions__msg.is-ok { color: var(--fx-ok); }
.fx-acct-actions__msg.is-warn { color: var(--fx-accent); }
.fx-acct-del { color: var(--fx-mut); }
.fx-acct-del:hover { color: var(--fx-accent); border-color: var(--fx-accent); }

@media (max-width: 720px) {
  .fx-modal__body { flex-direction: column; }
  .fx-acct-list { width: auto; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--fx-line-soft); }
  .fx-acct-item, .fx-acct-new { min-width: 152px; }
  .fx-grid2 { grid-template-columns: 1fr; }
}
