/* =====================================================================
   DOMINO — Agents workspace + modal system
   Loads after domino.css. Reuses .kpis, .seg, .tag, .btn--slate*.
   ===================================================================== */

/* intro row */
.ag-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.ag-intro__lede { font-size: 14.5px; color: var(--slate-500); line-height: 1.6; max-width: 560px; }
.ag-intro__lede b { color: var(--ink-800); font-weight: 600; }
.ag-intro--bare { justify-content: flex-end; margin-bottom: 18px; }

/* segmented tabs reuse .seg; add count */
.seg__btn .seg-n { font-size: 11px; font-weight: 700; opacity: 0.6; margin-left: 5px; }

.ag-section { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* agent grid */
.ag-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ag-add { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; min-height: 150px; padding: 20px; border: 1.5px dashed var(--slate-300); border-radius: var(--r-card); background: transparent; cursor: pointer; text-align: left; transition: all var(--duration-fast) var(--ease-out); }
.ag-add:hover { border-color: var(--ac); background: var(--ac-soft); }
.ag-add__ic { width: 36px; height: 36px; border-radius: 10px; background: var(--neutral-100); border: 1px solid var(--hairline); color: var(--ink-700); display: grid; place-items: center; }
.ag-add:hover .ag-add__ic { background: var(--surface); border-color: var(--ac-line); color: var(--ac-700); }
.ag-add__ic svg { width: 18px; height: 18px; }
.ag-add__t { font-size: 14px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; }
.ag-add__d { font-size: 12px; color: var(--slate-400); line-height: 1.4; }

.ag-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 13px; cursor: pointer;
  transition: border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}
.ag-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--slate-200); }
.ag-card__top { display: flex; align-items: flex-start; gap: 13px; }
.ag-card__icon {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px;
  background: var(--neutral-100); border: 1px solid var(--hairline); color: var(--ink-700);
  display: grid; place-items: center;
}
.ag-card__icon svg { width: 20px; height: 20px; }
.ag-card.is-live .ag-card__icon { background: var(--ac-soft); border-color: var(--ac-line); color: var(--ac-700); }
.ag-card__id { flex: 1; min-width: 0; }
.ag-card__name { font-size: 15px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; }
.ag-card__owner { font-size: 11.5px; color: var(--slate-400); margin-top: 2px; }
.ag-card__desc { font-size: 13px; color: var(--slate-500); line-height: 1.5; flex: 1; }

/* status toggle pill */
.statepill {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 10px 5px 8px; border-radius: var(--radius-pill); cursor: pointer; border: 1px solid transparent;
  transition: all var(--duration-fast) var(--ease-out);
}
.statepill .d { width: 6px; height: 6px; border-radius: 50%; }
.statepill--live { background: var(--ac-soft); color: var(--ac-700); }
.statepill--live .d { background: var(--ac); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ac) 22%, transparent); }
.statepill--paused { background: var(--neutral-100); color: var(--slate-500); }
.statepill--paused .d { background: var(--slate-300); }
.statepill:hover { filter: brightness(0.97); }

.ag-card__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.minichip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--slate-500);
  background: var(--neutral-50); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); padding: 3px 9px;
}
.minichip svg { width: 12px; height: 12px; color: var(--slate-400); }

.ag-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 13px; border-top: 1px solid var(--hairline-soft);
}
.ag-card__metric { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--slate-500); }
.ag-card__metric svg { width: 13px; height: 13px; color: var(--slate-400); }
.ag-card__metric b { color: var(--ink-800); font-weight: 600; }
.ag-card__succ { display: flex; align-items: center; gap: 8px; }
.succ-bar { width: 46px; height: 4px; border-radius: 2px; background: var(--neutral-100); overflow: hidden; }
.succ-bar i { display: block; height: 100%; background: var(--ac); border-radius: 2px; }
.succ-val { font-size: 12px; font-weight: 600; color: var(--ink-800); font-feature-settings: "tnum" 1; }

/* library card */
.ag-card--lib { cursor: default; }
.ag-card--lib:hover { transform: none; }
.ag-card--lib .ag-card__icon { background: var(--info-bg); border-color: transparent; color: var(--info); }
.ag-card__cat {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--slate-400);
}
.ag-card__usedby { font-size: 12px; color: var(--slate-400); display: flex; align-items: center; gap: 6px; }
.ag-card__usedby svg { width: 13px; height: 13px; }
.ag-deployed-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ac-700); }
.ag-deployed-flag svg { width: 14px; height: 14px; }

/* =====================================================================
   MODAL SYSTEM
   ===================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(6, 26, 46, 0.66); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 32px;
  animation: ov-in var(--duration-base) var(--ease-out);
}
@keyframes ov-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--r-card);
  box-shadow: var(--shadow-xl); width: 100%; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: md-in var(--duration-base) var(--ease-out);
}
@keyframes md-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal--sm { max-width: 460px; }
.modal--md { max-width: 620px; }
.modal--lg { max-width: 920px; }

.modal__head {
  flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px; border-bottom: 1px solid var(--hairline);
}
.modal__head-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.modal__icon {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px;
  background: var(--ac-soft); border: 1px solid var(--ac-line); color: var(--ac-700);
  display: grid; place-items: center;
}
.modal__icon svg { width: 23px; height: 23px; }
.modal__title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-900); line-height: 1.2; }
.modal__sub { font-size: 13px; color: var(--slate-500); margin-top: 4px; line-height: 1.5; }
.modal__close {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: var(--r-control);
  border: 1px solid var(--hairline); background: var(--surface); color: var(--slate-400);
  display: grid; place-items: center; cursor: pointer; transition: all var(--duration-fast) var(--ease-out);
}
.modal__close:hover { color: var(--ink-800); background: var(--neutral-50); border-color: var(--slate-300); }
.modal__close svg { width: 17px; height: 17px; }
.modal__body { flex: 1; overflow-y: auto; padding: 22px 24px; scrollbar-width: thin; scrollbar-color: var(--slate-200) transparent; }
.modal__body::-webkit-scrollbar { width: 8px; }
.modal__body::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 4px; }
.modal__foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 24px; border-top: 1px solid var(--hairline); background: var(--neutral-50);
}
.modal__foot-r { display: flex; gap: 10px; }

/* activity modal */
.act-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.act-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--hairline-soft); border: 1px solid var(--hairline); border-radius: var(--r-card); overflow: hidden; margin-bottom: 22px; }
.act-stat { background: var(--surface); padding: 14px 16px; }
.act-stat__l { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate-400); font-weight: 600; }
.act-stat__v { font-size: 22px; font-weight: var(--w-stat); color: var(--ink-900); letter-spacing: -0.02em; margin-top: 6px; font-feature-settings: "tnum" 1; }
.act-stat__v .u { font-size: 13px; color: var(--slate-400); }

.tl-h { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate-400); margin-bottom: 4px; }
.tl { position: relative; }
.tl-row { display: grid; grid-template-columns: 18px 1fr; gap: 14px; padding: 14px 0; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ac); margin-top: 3px; box-shadow: 0 0 0 1px var(--ac-line); }
.tl-dot--muted { background: var(--slate-300); box-shadow: 0 0 0 1px var(--slate-200); }
.tl-line { flex: 1; width: 2px; background: var(--hairline); margin-top: 4px; }
.tl-row:last-child .tl-line { display: none; }
.tl-time { font-size: 11.5px; color: var(--slate-400); }
.tl-title { font-size: 13.5px; font-weight: 600; color: var(--ink-900); margin-top: 2px; letter-spacing: -0.01em; }
.tl-detail { font-size: 12.5px; color: var(--slate-500); margin-top: 3px; line-height: 1.5; }
.tl-out { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }

/* form fields */
.field { margin-bottom: 18px; }
.field__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-800); margin-bottom: 8px; letter-spacing: -0.01em; }
.field__hint { font-size: 11.5px; color: var(--slate-400); font-weight: 400; margin-left: 6px; }
.input, .textarea, .select {
  width: 100%; font-family: var(--font-sans); font-size: 13.5px; color: var(--ink-900);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-control);
  padding: 11px 13px; outline: none; transition: border-color var(--duration-fast) var(--ease-out); box-sizing: border-box;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-soft); }
.textarea { resize: none; min-height: 76px; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E7886' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; cursor: pointer; }

.chip-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick__opt {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--slate-500);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-pill);
  padding: 8px 13px; cursor: pointer; transition: all var(--duration-fast) var(--ease-out);
}
.chip-pick__opt svg { width: 14px; height: 14px; }
.chip-pick__opt:hover { border-color: var(--slate-300); }
.chip-pick__opt.is-on { background: var(--ac-soft); border-color: var(--ac-line); color: var(--ac-700); }

/* start-from list (create modal left col) */
.create-cols { display: grid; grid-template-columns: 260px 1fr; gap: 0; }
.create-left { border-right: 1px solid var(--hairline); padding-right: 20px; }
.create-right { padding-left: 22px; }
.start-h { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate-400); margin: 4px 0 12px; }
.start-opt {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: var(--r-control);
  cursor: pointer; border: 1px solid transparent; transition: all var(--duration-fast) var(--ease-out); margin-bottom: 4px;
}
.start-opt:hover { background: var(--neutral-50); }
.start-opt.is-on { background: var(--ac-soft); border-color: var(--ac-line); }
.start-opt__ic { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 8px; background: var(--surface); border: 1px solid var(--hairline); color: var(--ink-700); display: grid; place-items: center; }
.start-opt.is-on .start-opt__ic { color: var(--ac-700); border-color: var(--ac-line); }
.start-opt__ic svg { width: 16px; height: 16px; }
.start-opt__t { font-size: 13px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; }
.start-opt__d { font-size: 11.5px; color: var(--slate-400); margin-top: 1px; line-height: 1.35; }

.opt-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.opt-card {
  border: 1px solid var(--hairline); border-radius: var(--r-control); padding: 11px 12px; cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out); background: var(--surface);
}
.opt-card:hover { border-color: var(--slate-300); }
.opt-card.is-on { border-color: var(--ac); background: var(--ac-soft); }
.opt-card__t { font-size: 12.5px; font-weight: 600; color: var(--ink-900); }
.opt-card__d { font-size: 11px; color: var(--slate-400); margin-top: 3px; line-height: 1.35; }

/* build / deploy progress */
.build { padding: 18px 6px 8px; }
.build__hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 22px 0 26px; }
.build__orb {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: var(--ac-soft); color: var(--ac-700); margin-bottom: 16px;
  animation: orb 1.6s var(--ease-in-out) infinite;
}
.build__orb svg { width: 30px; height: 30px; }
@keyframes orb { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 var(--ac-soft); } 50% { transform: scale(1.05); box-shadow: 0 0 0 10px transparent; } }
.build__title { font-size: 17px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; }
.build__sub { font-size: 13px; color: var(--slate-500); margin-top: 5px; }
.build__steps { display: flex; flex-direction: column; gap: 2px; max-width: 380px; margin: 0 auto; }
.build__step { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-control); font-size: 13.5px; color: var(--slate-400); transition: all var(--duration-base) var(--ease-out); }
.build__step.is-active { color: var(--ink-900); background: var(--neutral-50); font-weight: 600; }
.build__step.is-done { color: var(--ink-800); }
.build__sc { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; border: 2px solid var(--slate-200); display: grid; place-items: center; transition: all var(--duration-base) var(--ease-out); }
.build__step.is-done .build__sc { background: var(--ac); border-color: var(--ac); }
.build__step.is-done .build__sc svg { color: #fff; width: 12px; height: 12px; }
.build__step.is-active .build__sc { border-color: var(--ac); border-top-color: transparent; animation: spin 0.7s linear infinite; }

.build__done { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 0 18px; }
.build__check { width: 66px; height: 66px; border-radius: 50%; background: var(--ac-soft); color: var(--ac-700); display: grid; place-items: center; margin-bottom: 16px; animation: pop var(--duration-base) var(--ease-out); }
.build__check svg { width: 34px; height: 34px; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 1080px) {
  .ag-grid { grid-template-columns: repeat(2, 1fr); }
  .create-cols { grid-template-columns: 1fr; }
  .create-left { border-right: 0; border-bottom: 1px solid var(--hairline); padding-right: 0; padding-bottom: 16px; margin-bottom: 16px; }
  .create-right { padding-left: 0; }
}

/* ---- create: numbered sections ---- */
.tpl-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; }
.cre-sec { padding: 22px 0; border-top: 1px solid var(--hairline); }
.cre-sec:first-of-type { border-top: 0; padding-top: 6px; }
.cre-sec__h { display: flex; align-items: center; gap: 11px; }
.cre-num { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: var(--ink-800); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.cre-sec__t { font-size: 15px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; }
.cre-sec__d { font-size: 12.5px; color: var(--slate-400); margin: 6px 0 16px 35px; line-height: 1.5; }
.cre-sec__body { padding-left: 35px; }

/* output cards */
.out-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.out-card { display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--hairline); border-radius: var(--r-control); padding: 12px 13px; cursor: pointer; transition: all var(--duration-fast) var(--ease-out); background: var(--surface); }
.out-card:hover { border-color: var(--slate-300); }
.out-card.is-on { border-color: var(--ac); background: var(--ac-soft); }
.out-card__ic { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; background: var(--neutral-100); border: 1px solid var(--hairline); color: var(--ink-700); display: grid; place-items: center; }
.out-card__ic svg { width: 15px; height: 15px; }
.out-card.is-on .out-card__ic { background: var(--surface); border-color: var(--ac-line); color: var(--ac-700); }
.out-card__c { flex: 1; min-width: 0; }
.out-card__t { font-size: 13px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.out-card__d { font-size: 11.5px; color: var(--slate-400); margin-top: 3px; line-height: 1.4; }
.out-card__tick { width: 18px; height: 18px; flex: 0 0 auto; border-radius: 6px; border: 1.6px solid var(--slate-300); display: grid; place-items: center; color: #fff; }
.out-card.is-on .out-card__tick { background: var(--ac); border-color: var(--ac); }
.out-card .tag { font-size: 9px; padding: 3px 7px; }

/* guardrails */
.gr-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.gr-sg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--slate-500); background: var(--surface); border: 1px dashed var(--slate-300); border-radius: var(--radius-pill); padding: 7px 12px; cursor: pointer; transition: all var(--duration-fast) var(--ease-out); }
.gr-sg:hover { border-style: solid; border-color: var(--ink-700); color: var(--ink-800); }
.gr-sg svg { width: 12px; height: 12px; color: var(--slate-400); }
.gr-add { display: flex; gap: 9px; }
.gr-add .input { flex: 1; }
.gr-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.gr-item { display: flex; align-items: center; gap: 11px; padding: 11px 13px; background: var(--neutral-50); border: 1px solid var(--hairline); border-radius: var(--r-control); font-size: 13px; color: var(--ink-800); }
.gr-item__ic { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 7px; background: var(--danger-bg); color: var(--danger); display: grid; place-items: center; }
.gr-item__ic svg { width: 14px; height: 14px; }
.gr-item__t { flex: 1; font-weight: 500; }
.gr-item__x { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--slate-400); cursor: pointer; }
.gr-item__x:hover { background: var(--neutral-100); color: var(--ink-800); }
.gr-empty { font-size: 12.5px; color: var(--slate-400); padding: 4px 0; }

/* actionable KPI cells */
.kpi--action { cursor: pointer; transition: background var(--duration-fast) var(--ease-out); }
.kpi--action:hover { background: var(--neutral-50); }
.kpi__go { position: absolute; top: 20px; right: 20px; color: var(--slate-300); opacity: 0; transition: all var(--duration-fast) var(--ease-out); }
.kpi__go svg { width: 16px; height: 16px; }
.kpi--action:hover .kpi__go { opacity: 1; color: var(--ink-700); transform: translate(2px, -2px); }
.kpi__hint--review { color: var(--warning); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.kpi__hint--review .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }

/* approvals rows */
.appr-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; padding: 18px 0; border-top: 1px solid var(--hairline-soft); align-items: start; }
.appr-row:first-child { padding-top: 4px; border-top: 0; }
.appr-ic { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; background: var(--ac-soft); border: 1px solid var(--ac-line); color: var(--ac-700); display: grid; place-items: center; }
.appr-ic svg { width: 20px; height: 20px; }
.appr-agent { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate-400); }
.appr-title { font-size: 14px; font-weight: 600; color: var(--ink-900); margin-top: 3px; letter-spacing: -0.01em; }
.appr-detail { font-size: 12.5px; color: var(--slate-500); margin-top: 4px; line-height: 1.5; }
.appr-meta { margin-top: 10px; display: flex; gap: 7px; flex-wrap: wrap; }
.appr-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 116px; }

/* =====================================================================
   AGENT STUDIO — full-screen guided builder + test panel
   ===================================================================== */
.studio-overlay { position: fixed; inset: 0; z-index: 1200; background: rgba(6,26,46,0.55); backdrop-filter: blur(3px); display: grid; place-items: center; animation: ov-in var(--duration-base) var(--ease-out); }
.studio { width: 1240px; max-width: 95vw; height: 90vh; max-height: 880px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-card); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; overflow: hidden; }
.studio__head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 22px; border-bottom: 1px solid var(--hairline); background: var(--surface); }
.studio__head-id { display: flex; align-items: center; gap: 13px; }
.studio__head-actions { display: flex; gap: 9px; }

.studio__body { flex: 1; display: grid; grid-template-columns: 210px 1fr 360px; min-height: 0; }
.studio__rail { border-right: 1px solid var(--hairline); padding: 18px 12px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); }
.studio__step { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; background: transparent; border-radius: var(--r-control); cursor: pointer; text-align: left; transition: background var(--duration-fast) var(--ease-out); }
.studio__step:hover { background: var(--neutral-50); }
.studio__step.is-active { background: var(--ac-soft); }
.studio__step-dot { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--neutral-100); color: var(--slate-500); border: 1px solid var(--hairline); }
.studio__step.is-active .studio__step-dot { background: var(--ac); color: var(--ac-fg); border-color: transparent; }
.studio__step.is-done .studio__step-dot { background: var(--success); color: #fff; border-color: transparent; }
.studio__step-l { font-size: 13px; font-weight: 500; color: var(--slate-500); letter-spacing: -0.01em; }
.studio__step.is-active .studio__step-l { color: var(--ink-900); font-weight: 600; }
.studio__step.is-done .studio__step-l { color: var(--ink-700); }

.studio__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.studio__scroll { flex: 1; overflow-y: auto; padding: 26px 30px; scrollbar-width: thin; scrollbar-color: var(--slate-200) transparent; }
.studio__scroll::-webkit-scrollbar { width: 9px; }
.studio__scroll::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 5px; border: 2px solid var(--canvas); }
.studio__nav { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 30px; border-top: 1px solid var(--hairline); background: var(--surface); }
.st-step { max-width: 600px; }
.st-h { font-size: 19px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.02em; margin: 0 0 5px; }
.st-sub { font-size: 13.5px; color: var(--slate-500); line-height: 1.55; margin: 0 0 20px; }
.opt-cards--3 { grid-template-columns: repeat(3, 1fr); }
.st-review { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hairline-soft); border: 1px solid var(--hairline); border-radius: var(--r-card); overflow: hidden; }
.st-rev { background: var(--surface); padding: 12px 15px; display: flex; flex-direction: column; gap: 4px; }
.st-rev span { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate-400); font-weight: 600; }
.st-rev b { font-size: 13.5px; color: var(--ink-900); font-weight: 600; }

/* preview / test panel */
.studio__preview { border-left: 1px solid var(--hairline); background: var(--neutral-50); display: flex; flex-direction: column; min-height: 0; }
.studio__ptabs { flex: 0 0 auto; display: flex; gap: 2px; padding: 12px 14px 0; }
.studio__ptab { flex: 1; padding: 8px 10px; border: 0; background: transparent; border-radius: var(--r-control) var(--r-control) 0 0; font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; color: var(--slate-500); cursor: pointer; }
.studio__ptab.is-active { background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-xs); }
.studio__pbody { flex: 1; overflow-y: auto; padding: 16px; scrollbar-width: thin; }
.studio__pfoot { flex: 0 0 auto; padding: 12px 16px; border-top: 1px solid var(--hairline); }
.studio__pfoot .btn { width: 100%; }

.ap-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); padding: 15px; box-shadow: var(--shadow-xs); }
.ap-card__id { display: flex; gap: 11px; align-items: flex-start; padding-bottom: 13px; margin-bottom: 4px; border-bottom: 1px solid var(--hairline-soft); }
.ap-ic { width: 36px; height: 36px; flex: 0 0 auto; }
.ap-card__name { font-size: 14px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; }
.ap-card__role { font-size: 11.5px; color: var(--slate-400); margin-top: 2px; line-height: 1.4; }
.ap-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hairline-soft); font-size: 12.5px; }
.ap-row > span:first-child { color: var(--slate-400); flex: 0 0 auto; }
.ap-row b { color: var(--ink-900); font-weight: 600; text-align: right; }
.ap-chips { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.ap-muted { color: var(--slate-300); }

.ap-empty { text-align: center; padding: 36px 18px; display: flex; flex-direction: column; align-items: center; }
.ap-empty__ic { width: 46px; height: 46px; border-radius: 12px; background: var(--surface); border: 1px solid var(--hairline); color: var(--slate-400); display: grid; place-items: center; margin-bottom: 12px; }
.ap-empty__t { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.ap-empty__d { font-size: 12px; color: var(--slate-400); line-height: 1.5; margin-top: 5px; max-width: 240px; }

.ap-trace { font-size: 12.5px; }
.ap-trace__h { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-900); margin-bottom: 12px; }
.ap-trace__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.ap-trace__dot.is-run { background: var(--warning); animation: pulse-dot 1s infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.ap-tl { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-left: 2px solid var(--hairline); padding-left: 12px; margin-left: 4px; animation: tl-in var(--duration-base) var(--ease-out); }
@keyframes tl-in { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
.ap-tl__ic { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 6px; background: var(--neutral-100); color: var(--slate-500); display: grid; place-items: center; margin-top: -3px; }
.ap-tl--out .ap-tl__ic { background: var(--success-bg); color: var(--success); }
.ap-tl--wait .ap-tl__ic { background: var(--warning-bg); color: var(--warning); }
.ap-tl--done .ap-tl__ic { background: var(--ac-soft); color: var(--ac-700); }
.ap-tl__t { color: var(--ink-800); line-height: 1.45; padding-top: 1px; }

.studio__center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.build__orb { width: 64px; height: 64px; border-radius: 16px; background: var(--ac-soft); color: var(--ac-700); display: grid; place-items: center; margin-bottom: 18px; }
.build__orb svg { width: 30px; height: 30px; }
.bf { margin-top: 22px; display: flex; flex-direction: column; gap: 9px; text-align: left; min-width: 300px; }
.bf-row { display: flex; align-items: center; gap: 11px; opacity: 0.5; transition: opacity var(--duration-base); }
.bf-row.is-active, .bf-row.is-done { opacity: 1; }
.bf-dot { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; background: var(--neutral-100); color: var(--slate-500); border: 1px solid var(--hairline); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.bf-row.is-done .bf-dot { background: var(--success); color: #fff; border-color: transparent; }
.bf-row.is-active .bf-dot { background: var(--ac-soft); color: var(--ac-700); border-color: var(--ac-line); }
.bf-label { font-size: 13px; color: var(--ink-800); }

@media (max-width: 980px) {
  .studio__body { grid-template-columns: 1fr; }
  .studio__rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .studio__preview { display: none; }
}
