/* Parto Plugins: admin UI.
   Technical look: navy shell bar, square edges, a blueprint grid behind
   diagrams, wires and ports between systems. Parto brand: navy #162945 and the
   Plugins blue #6599C4; Roboto Slab (self-hosted in web/fonts, no font CDN)
   for the wordmark and page titles, system fonts for everything else. */
@font-face { font-family: "Roboto Slab"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/roboto-slab-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/roboto-slab-latin-700-normal.woff2") format("woff2"); }
:root {
  --navy: #162945; --brand: #6599C4; --slab: "Roboto Slab", Georgia, "Times New Roman", serif;
  --shell: #162945; --shell-2: #1f3658; --shell-fg: #cbd6e4; --shell-dim: #8a9cb6; --shell-line: #2c4669;
  --bg: #eceff3; --panel: #ffffff; --panel-2: #f6f8fa; --fg: #162130; --muted: #556274; --faint: #8b97a8; --line: #cfd6df; --line-2: #e2e7ed;
  --accent: #2e6a9f; --accent-fg: #ffffff; --accent-soft: #e6eff7;
  --wire: #6599C4; --wire-ext: #0f8b8d; --wire-dim: #9fb0c4;
  --ok: #1e7d32; --ok-bg: #e5f3e7; --warn: #b26200; --warn-bg: #fdf1e0; --err: #b3121c; --err-bg: #fbe7e8;
  --test: #6b4fc7; --test-bg: #eeeafb; --prod: #b54a00; --prod-bg: #fbeee4;
  --grid: rgba(22, 41, 69, .055);
  --radius: 2px; --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1522; --panel: #142033; --panel-2: #192840; --fg: #dde5ee; --muted: #9aa8b9; --faint: #6c7a8c; --line: #2a3b52; --line-2: #213148;
    --accent: #8db8dc; --accent-fg: #0b1a2e; --accent-soft: #1c3350;
    --wire: #6599C4; --wire-ext: #3cc4c6; --wire-dim: #3d4f66;
    --ok: #63c46f; --ok-bg: #16301b; --warn: #f0a33a; --warn-bg: #36260f; --err: #ff6b72; --err-bg: #3a1518;
    --test: #a993f5; --test-bg: #261f42; --prod: #f3995a; --prod-bg: #3a2414;
    --grid: rgba(101, 153, 196, .06);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 13.5px/1.45 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -.005em; font-family: var(--slab); }
h2 { font-size: 14px; margin: 0; font-weight: 600; }
h3 { font-size: 11px; margin: 18px 0 8px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grid-bg { background-color: var(--bg); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }

/* ------------------------------------------------------------ shell */
.top { display: flex; align-items: stretch; height: 46px; background: var(--shell); color: var(--shell-fg); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid #000; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-right: 1px solid var(--shell-line); color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.top nav { display: flex; }
.top nav a { display: flex; align-items: center; padding: 0 16px; color: var(--shell-fg); font-weight: 500; border-bottom: 2px solid transparent; font-size: 13px; }
.top nav a:hover { background: var(--shell-2); text-decoration: none; color: #fff; }
.top nav a.active { color: #fff; border-bottom-color: var(--wire); background: var(--shell-2); }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; padding: 0 14px; color: var(--shell-dim); font-size: 12px; font-family: var(--mono); }
.top .who button { color: var(--shell-fg); border-color: var(--shell-line); background: transparent; }
.top .who button:hover { background: var(--shell-2); }
.env-pill { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--shell-line); color: var(--shell-dim); }

.shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 46px); }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 10px 0; font-size: 13px; }
.side h3 { margin: 8px 14px 6px; }
.tree a { display: flex; align-items: center; gap: 8px; padding: 5px 14px; color: var(--fg); border-left: 2px solid transparent; }
.tree a:hover { background: var(--panel-2); text-decoration: none; }
.tree a.active { background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.tree .client svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.tree .env { padding-left: 34px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.tree .env::before { content: ""; width: 10px; height: 1px; background: var(--line); margin-left: -16px; margin-right: 4px; }
.led { width: 7px; height: 7px; flex: none; background: var(--faint); box-shadow: 0 0 0 2px var(--panel); }
.led.ok { background: var(--ok); } .led.warn { background: var(--warn); } .led.err { background: var(--err); } .led.off { background: var(--line); }
.main { padding: 18px 24px 60px; min-width: 0; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.crumb { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; font-weight: 600; }
.crumb a { color: var(--muted); }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .side { border-right: 0; border-bottom: 1px solid var(--line); } .main { padding: 14px; } .top { overflow-x: auto; } .top .who .email, .brand small { display: none; } }

/* ------------------------------------------------------------ panels */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -14px -16px 12px; padding: 9px 16px; border-bottom: 1px solid var(--line-2); background: var(--panel-2); flex-wrap: wrap; }
.card.flush .cardhead { margin: 0; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid > *, .split > *, .form > * { min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.spacer { flex: 1; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
/* the active tab's underline overlaps the border by 1px; without overflow-y: hidden Windows browsers show a vertical scrollbar */
.tabs a { padding: 8px 16px; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--fg); border-color: var(--accent); text-decoration: none; }
.tabs a:hover { text-decoration: none; color: var(--fg); background: var(--panel); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius); background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; font-family: var(--sans); }
.badge.test { background: var(--test-bg); color: var(--test); border-color: color-mix(in srgb, var(--test) 35%, transparent); }
.badge.production { background: var(--prod-bg); color: var(--prod); border-color: color-mix(in srgb, var(--prod) 35%, transparent); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.badge.err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.dot { width: 7px; height: 7px; display: inline-block; background: var(--faint); }
.dot.test { background: var(--test); } .dot.production { background: var(--prod); }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 7px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; }
table.t td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: var(--panel-2); }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.tablewrap { overflow-x: auto; }

.stat { display: flex; flex-direction: column; gap: 2px; border-left: 3px solid var(--accent); }
.stat b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.stat.err { border-left-color: var(--err); } .stat.ok { border-left-color: var(--ok); }

/* ------------------------------------------------------------ forms */
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); min-width: 0; text-transform: uppercase; letter-spacing: .05em; }
label.f.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; white-space: nowrap; }
input, select, textarea { font: inherit; font-size: 13px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; min-width: 0; width: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
textarea { font-family: var(--mono); font-size: 12px; min-height: 90px; resize: vertical; }
input.mono { font-family: var(--mono); font-size: 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form { display: grid; gap: 10px 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form .wide { grid-column: 1 / -1; }
.help { font-size: 11.5px; color: var(--faint); font-weight: 400; text-transform: none; letter-spacing: 0; }

button, .btn { font: inherit; font-weight: 600; font-size: 12.5px; border-radius: var(--radius); padding: 6px 12px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover, .btn:hover { background: var(--panel-2); text-decoration: none; border-color: var(--faint); }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.danger { color: var(--err); }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 4px 7px; }
button.ghost:hover { color: var(--fg); background: var(--panel-2); border-color: transparent; }
button:disabled { opacity: .5; cursor: default; }
button.small, .btn.small { padding: 3px 9px; font-size: 12px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1050px) { .split { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 60px; }
.trace { font-family: var(--mono); font-size: 11.5px; background: var(--shell); color: #b9c7d8; border-radius: var(--radius); padding: 10px 12px; max-height: 260px; overflow: auto; margin: 0; white-space: pre-wrap; }
.problems { background: var(--err-bg); color: var(--err); border-left: 3px solid var(--err); padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.notice { background: var(--accent-soft); color: var(--fg); border-left: 3px solid var(--accent); padding: 9px 14px; font-size: 13px; margin-bottom: 12px; }
.secret { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.secret:first-of-type { border-top: 0; }
.copy { display: flex; gap: 6px; align-items: center; }
.copy code { background: var(--panel-2); border: 1px solid var(--line-2); padding: 5px 8px; overflow-x: auto; white-space: nowrap; flex: 1; min-width: 0; display: block; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.maprow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.oplist { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.preview { background: var(--panel-2); border: 1px solid var(--line-2); padding: 12px; }
details > summary { cursor: pointer; font-weight: 600; }

/* ------------------------------------------------------------ login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 400px; }
.login .card { padding: 0; }
.login .head { background: var(--shell); color: #fff; padding: 18px 22px; display: flex; gap: 12px; align-items: center; }
.login .head .brandmark .logo { width: 40px; height: 40px; }
.login .head .wm { font-size: 25px; }
.login .head small { font-size: 10px; }
.login .body { padding: 20px 22px; }
.login h1 { margin-bottom: 6px; font-size: 16px; }
.login form { display: grid; gap: 12px; margin-top: 12px; }
.qr { background: #fff; padding: 10px; width: 200px; border: 1px solid var(--line); }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--shell); color: #fff; padding: 9px 16px; border-left: 3px solid var(--wire); font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; z-index: 30; }
#toast.show { opacity: 1; }
#toast.err { border-left-color: var(--err); }

/* ------------------------------------------------------------ landscape (overview) */
.landscape { position: relative; display: grid; grid-template-columns: minmax(170px, 1fr) 70px minmax(200px, 1.1fr) 70px minmax(170px, 1fr); align-items: center; padding: 18px; border: 1px solid var(--line); min-height: 160px; }
.landscape svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.lane { display: grid; gap: 10px; align-content: center; position: relative; z-index: 1; }
.lane-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-bottom: -2px; }
.sys { background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 8px 10px; position: relative; min-height: 46px; }
.sys .ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.sys .ico svg { width: 18px; height: 18px; }
.sys b { font-size: 12.5px; display: block; line-height: 1.25; }
.sys small { font-family: var(--mono); font-size: 10.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.sys .meta { margin-left: auto; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.sys.coupa .ico { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.sys.ext .ico { color: var(--wire-ext); border-color: color-mix(in srgb, var(--wire-ext) 40%, var(--line)); }
.sys.ui .ico { color: var(--test); }
.sys.off { opacity: .55; }
.hub { background: var(--shell); color: #fff; border: 1px solid #000; padding: 12px 14px; position: relative; z-index: 1; }
.hub .title { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-weight: 700; font-size: 12.5px; letter-spacing: .03em; border-bottom: 1px solid var(--shell-line); padding-bottom: 8px; margin-bottom: 8px; }
.hub .title svg { width: 20px; height: 20px; }
.hub ul { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.hub li { display: flex; gap: 6px; align-items: center; padding: 2px 0; color: var(--shell-fg); }
.hub li .sq { width: 6px; height: 6px; background: var(--wire); flex: none; }
.hub li.off .sq { background: var(--shell-line); }
.hub .foot { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--shell-line); font-family: var(--mono); font-size: 10.5px; color: var(--shell-dim); display: flex; justify-content: space-between; }
.port { position: absolute; width: 7px; height: 7px; background: var(--panel); border: 1.5px solid var(--wire); top: 50%; margin-top: -4px; }
.port.r { right: -4px; } .port.l { left: -4px; }
.hub .port { background: var(--shell); }
.port.ext { border-color: var(--wire-ext); }
@media (max-width: 980px) { .landscape { grid-template-columns: 1fr; gap: 14px; } .landscape svg.wires { display: none; } }

/* ------------------------------------------------------------ flow builder */
.builder { display: grid; grid-template-columns: 210px minmax(0, 1fr) 350px; border: 1px solid var(--line); background: var(--panel); min-height: calc(100vh - 210px); }
@media (max-width: 1200px) { .builder { grid-template-columns: 190px minmax(0, 1fr); } .builder .inspector { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 760px) { .builder { grid-template-columns: 1fr; } .palette { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; } }
.palette { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 210px); position: sticky; top: 46px; }
.palette h3 { margin: 12px 12px 6px; }
.palette .hint { font-size: 11px; color: var(--faint); padding: 8px 12px 0; }
.tool { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: grab; font-size: 12.5px; border-left: 3px solid transparent; user-select: none; }
.tool:hover { background: var(--panel-2); border-left-color: var(--accent); }
.tool:active { cursor: grabbing; }
.tool .gi { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); flex: none; }
.tool .gi svg { width: 14px; height: 14px; }
.canvas { padding: 22px 26px 40px; overflow: auto; position: relative; }
.flow { display: flex; flex-direction: column; align-items: stretch; max-width: 720px; }
.flow .wire { width: 2px; background: var(--wire); height: 14px; margin-left: 27px; }
.slot { margin-left: 18px; height: 34px; display: flex; align-items: center; gap: 8px; position: relative; }
.slot::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: var(--wire); }
.slot .plus { width: 20px; height: 20px; border: 1.5px solid var(--wire); background: var(--panel); color: var(--wire); display: grid; place-items: center; font-weight: 700; font-size: 13px; line-height: 1; z-index: 1; cursor: pointer; padding: 0; }
.slot .plus:hover { background: var(--wire); color: #fff; }
.slot .droptext { font-size: 11px; color: var(--accent); font-weight: 600; display: none; text-transform: uppercase; letter-spacing: .06em; }
.slot.over { height: 46px; }
.slot.over .plus { background: var(--wire); color: #fff; }
.slot.over .droptext { display: block; }
.slot.end::before { bottom: 50%; }
.nrow { display: flex; align-items: center; }
.node { display: flex; align-items: stretch; background: var(--panel); border: 1px solid var(--line); cursor: pointer; position: relative; min-height: 50px; flex: 0 1 380px; width: 380px; min-width: 0; }
.node:hover { border-color: var(--faint); }
.node.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.node.multi { box-shadow: 4px 4px 0 -1px var(--panel), 4px 4px 0 0 var(--line); }
.node.multi.sel { box-shadow: 0 0 0 1px var(--accent), 4px 4px 0 -1px var(--panel), 4px 4px 0 0 var(--accent); }
.node.dragging { opacity: .4; }
.node.bad { border-color: var(--err); }
.node .gutter { width: 56px; flex: none; display: grid; place-items: center; border-right: 1px solid var(--line-2); position: relative; }
.node .gutter svg { width: 20px; height: 20px; }
.node .gutter .num { position: absolute; top: 2px; left: 4px; font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.node .txt { padding: 7px 12px; min-width: 0; flex: 1; }
.node .txt .k { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.node .txt b { display: block; font-size: 13px; font-weight: 600; }
.node .txt .sum { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node .tags { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; align-items: flex-end; justify-content: center; }
.node .handle { width: 14px; flex: none; cursor: grab; display: grid; place-items: center; color: var(--faint); border-left: 1px solid var(--line-2); font-size: 10px; letter-spacing: -2px; }
.node.g-calc .gutter { color: #2e6a9f; } .node.g-data .gutter { color: #5b6878; } .node.g-ext .gutter { color: var(--wire-ext); }
.node.g-val .gutter { color: #b26200; } .node.g-dec .gutter { color: #6b4fc7; }
.node.terminal { cursor: default; background: var(--shell); color: #fff; border-color: #000; }
.node.terminal .gutter { border-right-color: var(--shell-line); color: var(--wire); }
.node.terminal .txt .k { color: var(--shell-dim); } .node.terminal .txt .sum { color: var(--shell-fg); }
.node.terminal.sel { box-shadow: 0 0 0 2px var(--accent); }
.xwire { width: 30px; height: 0; border-top: 2px dashed var(--wire-ext); flex: none; position: relative; }
.xwire::after { content: ""; position: absolute; right: -1px; top: -5px; border: 4px solid transparent; border-left: 6px solid var(--wire-ext); }
.xsys { border: 1px solid color-mix(in srgb, var(--wire-ext) 45%, var(--line)); background: var(--panel); padding: 6px 10px; display: flex; gap: 8px; align-items: center; font-size: 12px; width: 168px; flex: none; min-width: 0; }
.xsys svg { width: 16px; height: 16px; color: var(--wire-ext); flex: none; }
.xsys b { display: block; font-family: var(--mono); font-size: 11.5px; }
.xsys small { display: block; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xsys.tbl { border-style: dashed; border-color: var(--line); }
.xsys.tbl svg { color: var(--muted); }
.inspector { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.inspector .itabs { display: flex; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.inspector .itabs button { flex: 1; border: 0; border-right: 1px solid var(--line); background: transparent; padding: 9px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.inspector .itabs button:last-child { border-right: 0; }
.inspector .itabs button.on { background: var(--panel); color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.inspector .ibody { padding: 14px 16px; overflow-y: auto; }
.inspector .ihead { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.inspector .ihead svg { width: 20px; height: 20px; }
.builder-bar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-bottom: 0; background: var(--panel-2); flex-wrap: wrap; }

/* ------------------------------------------------------------ icons, brand, menus */
.i { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; vertical-align: middle; }
.i svg { width: 100%; height: 100%; display: block; }
.i.sm { width: 14px; height: 14px; } .i.teal { color: var(--wire-ext); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* Parto wordmark: "pa" regular + "rto" bold in the app colour, app name in spaced caps below */
.brandmark { display: flex; align-items: center; gap: 9px; }
.brandmark .logo { width: 30px; height: 30px; display: block; flex: none; }
.brandmark .logo svg { width: 100%; height: 100%; display: block; }
.brandmark .wm { display: block; font-family: var(--slab); font-size: 19px; line-height: 1; color: #fff; font-weight: 400; letter-spacing: -.01em; }
.brandmark .wm i { font-style: normal; font-weight: 700; color: var(--brand); }
.brandmark small { display: block; font-family: var(--slab); font-weight: 700; font-size: 8.5px; letter-spacing: .3em; color: #fff; text-transform: uppercase; margin-top: 2px; }
.tree .client .i { color: var(--muted); }
.tree a.env { display: flex; }
.tree a.env .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { border: 0; border-radius: 0; padding: 5px 14px; background: var(--panel); color: var(--muted); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.login .head .seg { border-color: var(--shell-line); }
.login .head .seg button { background: transparent; color: var(--shell-dim); padding: 3px 9px; font-size: 11.5px; }
.login .head .seg button.on { background: var(--shell-2); color: #fff; }
.login .head .seg button + button { border-left-color: var(--shell-line); }
.helpbtn { color: var(--shell-fg) !important; gap: 6px; }
.helpbtn .i { width: 17px; height: 17px; }
.helpbtn:hover { background: var(--shell-2) !important; color: #fff !important; }
.usermenu { position: relative; display: flex; align-items: center; }
.userbtn { background: transparent !important; border: 1px solid var(--shell-line) !important; color: var(--shell-fg) !important; padding: 3px 8px 3px 3px; gap: 8px; font-family: var(--sans); }
.userbtn:hover { background: var(--shell-2) !important; }
.avatar { width: 26px; height: 26px; display: grid; place-items: center; background: var(--wire); color: #fff; font-size: 11px; font-weight: 700; font-family: var(--mono); }
.menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); width: 290px; background: var(--panel); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.18); z-index: 40; font-family: var(--sans); font-size: 13.5px; }
.menu.open { display: block; }
.menu .msec { padding: 10px 14px; border-top: 1px solid var(--line-2); }
.menu .msec:first-child { border-top: 0; }
.menu .mlabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.menu .seg { display: flex; } .menu .seg button { flex: 1; }
.menu .mi { display: flex; width: 100%; border: 0; background: transparent; padding: 7px 4px; font-weight: 500; font-size: 13.5px; color: var(--fg); }
.menu .mi:hover { background: var(--panel-2); }
.menu .mi .spacer { flex: 1; }
kbd { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--line); background: var(--panel-2); padding: 0 5px; color: var(--muted); }
.modal-back { position: fixed; inset: 0; background: rgba(8, 16, 28, .5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); width: 100%; max-width: 480px; }
.modal .cardhead { margin: 0; }

.grid.six { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat.ext { border-left-color: var(--wire-ext); }
.form.one { grid-template-columns: 1fr; }
details > summary { list-style: none; }
details > summary::before { content: "▸ "; color: var(--muted); }
details[open] > summary::before { content: "▾ "; }
.env-card h3:first-of-type { margin-top: 4px; }

/* wires in the landscape */
.landscape svg.wires path { stroke-width: 2; }
.landscape svg.wires path.test { stroke: var(--test); }
.landscape svg.wires path.production { stroke: var(--prod); }
.landscape svg.wires path.ext { stroke: var(--wire-ext); stroke-dasharray: 6 4; }
.landscape svg.wires path.ui { stroke: var(--wire); stroke-dasharray: 2 3; }
.landscape svg.wires path.dim { stroke: var(--wire-dim); stroke-dasharray: 2 3; }
.landscape .lane > .sys { color: var(--fg); }
.landscape a.sys:hover { border-color: var(--accent); text-decoration: none; }
.landscape a.hub:hover { text-decoration: none; outline: 1px solid var(--wire); }
.hub .title .logo { width: 18px; height: 18px; display: block; }
.hub .title .logo svg { width: 100%; height: 100%; display: block; }
.hub li .dot { width: 6px; height: 6px; }
.sys .ico .i { width: 18px; height: 18px; }

/* chains (actions list, solutions) */
.chain { display: flex; align-items: center; margin: 4px 0 6px; flex-wrap: wrap; row-gap: 4px; }
.chain > * { position: relative; }
.chain > * + *::before { content: ""; width: 10px; height: 2px; background: var(--wire); display: inline-block; vertical-align: middle; margin: 0 0 0 0; position: absolute; left: -10px; top: 50%; margin-top: -1px; }
.chain > * + * { margin-left: 10px; }
.c-end { font-family: var(--mono); font-size: 10.5px; padding: 2px 6px; background: var(--shell); color: #fff; text-transform: none; }
.c-node { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); }
.c-node .i { width: 13px; height: 13px; }
.small-chain .c-node { width: 18px; height: 18px; } .small-chain .c-end { font-size: 10px; padding: 1px 5px; }
.g-calc { color: #2e6a9f; } .g-data { color: #5b6878; } .g-ext { color: var(--wire-ext); } .g-val { color: #b26200; } .g-dec { color: #6b4fc7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .g-calc { color: #8db8dc; } :root:not([data-theme="light"]) .g-data { color: #9aa8b9; } :root:not([data-theme="light"]) .g-val { color: #f0a33a; } :root:not([data-theme="light"]) .g-dec { color: #a993f5; } }

/* designer extras */
.tool .gi .i, .pick .gi .i, .ihead .gi .i { width: 14px; height: 14px; }
.node .gutter .i { width: 20px; height: 20px; }
.xsys .i { width: 16px; height: 16px; color: var(--wire-ext); }
.xsys.tbl .i { color: var(--muted); }
.xsys.missing { border-color: var(--err); } .xsys.missing small { color: var(--err); }
.xwire.tbl { border-top-color: var(--faint); } .xwire.tbl::after { border-left-color: var(--faint); }
.canvas-empty { margin-top: 18px; max-width: 460px; border: 1px dashed var(--line); padding: 12px 14px; color: var(--muted); font-size: 12.5px; background: var(--panel); }
.canvas.dragging-op .slot .plus { background: var(--accent-soft); }
.canvas.dragging-op .slot { height: 40px; }
.ihead .gi { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; flex: none; }
.pick { display: flex; width: 100%; text-align: left; align-items: flex-start; gap: 10px; border: 1px solid var(--line-2); margin-bottom: 4px; padding: 7px 9px; white-space: normal; font-weight: 400; }
.pick b { display: block; font-size: 12.5px; }
.pick small { display: block; color: var(--muted); font-size: 11.5px; }
.pick .gi { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); flex: none; }
.inspector .ibody .form.one { gap: 10px; }

/* ------------------------------------------------------------ help overlay */
.help-back { position: fixed; inset: 0; background: rgba(8, 16, 28, .55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 14px; }
.helpdlg { background: var(--panel); width: min(1220px, 100%); height: min(940px, calc(100vh - 28px)); overflow: hidden; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.helpdlg header { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.helpdlg .htitle b { display: block; font-size: 15px; }
.helpdlg .htitle small { color: var(--muted); font-size: 11.5px; }
.helpdlg .hsearch { flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); padding: 0 10px; }
.helpdlg .hsearch input { border: 0; outline: 0; padding: 8px 0; }
.helpdlg .hsearch .i { color: var(--muted); }
.helpdlg .hbody { flex: 1; display: grid; grid-template-columns: 270px 1fr; grid-template-rows: minmax(0, 1fr); min-height: 0; }
.help-nav { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 0 20px; background: var(--panel-2); }
.help-nav .hgroup { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 18px 5px; }
.help-nav a { display: flex; justify-content: space-between; padding: 5px 18px; color: var(--fg); border-left: 3px solid transparent; }
.help-nav a:hover { background: var(--panel); text-decoration: none; }
.help-nav a.on { background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }
.help-nav .here { color: var(--accent); font-weight: 700; }
.help-art { overflow-y: auto; padding: 22px 32px 60px; font-size: 14px; line-height: 1.6; }
.help-art h1 { font-size: 24px; margin-bottom: 4px; }
.help-art .lead { color: var(--muted); font-size: 15px; max-width: 760px; }
.help-art h2 { font-size: 18px; margin: 28px 0 8px; padding-top: 4px; }
.help-art h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.help-art p, .help-art ul, .help-art ol { max-width: 800px; }
.help-art li { margin: 3px 0; }
.help-art code { background: var(--panel-2); border: 1px solid var(--line-2); padding: 0 4px; }
.help-art .onpage { display: flex; flex-wrap: wrap; gap: 6px 16px; background: var(--panel-2); border: 1px solid var(--line-2); padding: 9px 14px; margin: 14px 0 6px; font-size: 13px; }
.help-art .onpage b { margin-right: 4px; }
.help-art figure { margin: 14px 0 18px; max-width: 900px; }
.help-art figure img { width: 100%; display: block; border: 1px solid var(--line); }
.help-art figure.noimg img { display: none; }
.help-art figure.noimg::before { content: "—"; color: var(--faint); }
.help-art figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.help-art .tip { border-left: 3px solid var(--wire-ext); background: var(--panel-2); padding: 8px 12px; max-width: 800px; margin: 10px 0; font-size: 13.5px; }
.help-art table.t { max-width: 900px; }
@media (max-width: 760px) { .helpdlg .hbody { grid-template-columns: 1fr; } .help-nav { display: none; } .help-art { padding: 16px; } }
.node[class*="g-"] { color: var(--fg); }
.node.g-calc .gutter, .tool .gi.g-calc { color: #2e6a9f; }
.top .who .menu button.mi { color: var(--fg); border: 0; }
.top .who .menu .seg button { color: var(--muted); border-color: var(--line); }
.top .who .menu .seg button.on { color: var(--fg); }
.canvas.dragging-op .slot.over .plus { background: var(--wire); color: #fff; }
.small-chain { flex-wrap: nowrap; }
table.t td:first-child .small-chain { min-width: 240px; }

/* ------------------------------------------------------------ apps (imported HTML apps) */
.ap-wire { display: flex; align-items: stretch; gap: 0; margin: 10px 0 4px; overflow-x: auto; padding: 10px; border: 1px solid var(--line-2); }
.ap-wire.grid-bg, .ap-wire { background-color: var(--panel-2); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }
.ap-node { position: relative; min-width: 150px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--wire-dim); font-size: 12.5px; }
.ap-node.ap-app { border-top-color: var(--wire); min-width: 170px; }
.ap-node.ap-out { border-top-color: var(--wire-ext); flex: 1; min-width: 220px; }
.ap-node.ap-coupa { border-top-color: var(--shell); }
.ap-node::before, .ap-node::after { content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -3px; background: var(--panel); border: 1.5px solid var(--wire); }
.ap-node::before { left: -5px; } .ap-node::after { right: -5px; }
.ap-node.ap-in::before, .ap-node.ap-coupa::after { display: none; }
.ap-k { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.ap-link { flex: 0 0 26px; align-self: center; height: 2px; background: var(--wire); }
.ap-node .row { gap: 4px; }
.ap-logo { height: 18px; max-width: 80px; object-fit: contain; background: #fff; border: 1px solid var(--line-2); }
.ap-logo.big { height: 34px; max-width: 160px; }
.ap-sw { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line); }
.ap-sub { border-left: 3px solid var(--accent); margin-top: 12px; }
.ap-try { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.ap-stage { height: 640px; border: 1px solid var(--line); background: #fff; }
.ap-stage .app-frame { width: 100%; height: 100%; border: 0; display: block; }
.ap-sent { max-height: 640px; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); padding: 10px; }
.ap-facts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 6px; font-size: 12.5px; }
.ap-findings { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.ap-findings li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-top: 1px solid var(--line-2); }
.ap-findings li .led { transform: translateY(-1px); }
.ap-steps { margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.ap-versions { margin-top: 10px; }
.ap-versions summary { cursor: pointer; color: var(--muted); }
@media (max-width: 1100px) { .ap-try { grid-template-columns: 1fr; } }
.help-art pre { max-width: 800px; background: var(--panel-2); border: 1px solid var(--line-2); padding: 10px 12px; overflow-x: auto; font-size: 12px; line-height: 1.5; }
.help-art pre code { background: none; border: 0; padding: 0; }

/* Test/Production pair when creating a client */
.envpair { border: 1px solid var(--line); background: var(--panel-2); padding: 10px 12px; }
.envpair-head, .envpair-row { display: grid; grid-template-columns: 140px 1fr 1fr 1.4fr; gap: 8px; align-items: center; }
.envpair-head { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.envpair-row + .envpair-row { margin-top: 6px; }
.envpair-row input:disabled { opacity: .5; }
@media (max-width: 860px) { .envpair-head { display: none; } .envpair-row { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ Coupa panel / iFrame builder */
.cb { margin-bottom: 8px; }
.cb-surfaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.cb-surface { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--wire-dim); text-align: left; font-size: 12px; cursor: pointer; color: var(--fg); }
.cb-surface:hover { border-color: var(--faint); }
.cb-surface.on { border-color: var(--accent); border-top-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.cb-surface:disabled { opacity: .45; cursor: not-allowed; }
.cb-surface .i svg { width: 18px; height: 18px; color: var(--wire); }
.help.warn { color: var(--warn); }
.cb-wire .ap-node { min-width: 0; flex: 1 1 0; overflow-wrap: anywhere; }
.cb-wire .ap-link { flex: 0 0 70px; position: relative; }
.cb-wire .ap-link small { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.cb-wire .ap-link.srv { background: repeating-linear-gradient(90deg, var(--wire-ext) 0 6px, transparent 6px 10px); }
.cb-wire .ap-link.back { flex-basis: 26px; }
.cb-designer { display: grid; grid-template-columns: 190px minmax(0, 1fr); border: 1px solid var(--line); margin-top: 10px; background: var(--panel); }
.cb-palette { border-right: 1px solid var(--line); padding: 8px 0; background: var(--panel-2); }
.cb-palette .ap-k { padding: 0 12px 4px; }
.cb-palette .hint { font-size: 11px; color: var(--faint); padding: 6px 12px 0; margin: 0; }
.cb-layout { padding: 0 10px 10px; background-color: var(--panel-2); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; min-height: 160px; }
.cb-phead { display: flex; gap: 6px; align-items: center; margin: 0 -10px; padding: 6px 10px; background: var(--shell); color: #fff; font-size: 12px; }
.cb-phead .muted { color: var(--shell-dim); }
.cb-drop { height: 8px; margin: 1px 0; }
.cb-drop.over { height: 30px; border: 1.5px dashed var(--wire); background: var(--accent-soft); }
.cb-block { display: flex; align-items: center; gap: 8px; padding: 5px 6px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--wire); font-size: 12.5px; cursor: grab; }
.cb-block.dragging { opacity: .4; }
.cb-block .handle { color: var(--faint); font-size: 10px; letter-spacing: -2px; }
.cb-block .gi { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line); flex: none; }
.cb-block .gi svg { width: 14px; height: 14px; }
.cb-bname { flex: 1; min-width: 110px; display: flex; flex-direction: column; }
.cb-bname small { color: var(--faint); font-size: 10.5px; }
.cb-block input, .cb-block select { width: 130px; flex: 0 1 130px; min-width: 70px; padding: 3px 6px; font-size: 12px; }
.cb-mockwrap { margin-bottom: 4px; }
.cb-mock { border: 1px solid #d5d9de; background: #fff; color: #333; font: 13px/1.45 Arial, Helvetica, sans-serif; max-width: 420px; }
.cb-mhead { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #f2f4f5; border-bottom: 1px solid #d5d9de; }
.cb-mbtn { border: 1px solid #c7ccd1; padding: 0 6px; background: #fff; font-size: 12px; }
.cb-mlaunch { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eee; }
.cb-mbody { padding: 8px 12px 12px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.cb-mbody > * { min-width: 0; }
.cb-mtext { overflow-x: auto; }
.cb-mtitle { font-weight: 700; font-size: 12.5px; margin-bottom: 3px; color: #222; }
.cb-mtext p { margin: 0 0 4px; }
.cb-mtext table { border-collapse: collapse; width: 100%; font-size: 12px; }
.cb-mtext th, .cb-mtext td { border-bottom: 1px solid #e3e6e9; padding: 3px 4px; text-align: left; vertical-align: top; }
.cb-mtext th { background: #f6f7f8; }
.cb-mfields { margin: 0; display: grid; gap: 2px; }
.cb-mfields div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted #e3e6e9; padding: 2px 0; }
.cb-mfields dt { color: #666; } .cb-mfields dd { margin: 0; font-weight: 600; text-align: right; }
.cb-mnum .big { font-size: 26px; font-weight: 700; color: #0d233a; }
.cb-mbars { display: flex; gap: 6px; align-items: flex-end; height: 140px; padding-top: 6px; overflow-x: auto; }
.cb-mbar { flex: 1 0 34px; display: flex; flex-direction: column; height: 100%; min-width: 34px; }
.cb-mbar .bars { flex: 1; display: flex; gap: 2px; align-items: flex-end; border-bottom: 1px solid #ccc; }
.cb-mbar .bars span { flex: 1; min-height: 1px; }
.cb-mbar small { font-size: 10px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.cb-mpie { width: 90px; height: 90px; border-radius: 50%; flex: none; }
.cb-setup { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 4px; }
.cb-steps { padding-left: 20px; margin: 6px 0 10px; font-size: 13px; }
.cb-steps li { margin: 0 0 10px; }
.cb-steps li > * + * { margin-top: 5px; }
.cb-steps .btn { display: inline-flex; }
.cb-pre { border: 1px solid var(--line); background: var(--panel-2); }
.cb-pre .row { padding: 4px 6px; border-bottom: 1px solid var(--line-2); }
.cb-pre pre { margin: 0; padding: 8px 10px; max-height: 260px; overflow: auto; font: 11.5px/1.45 var(--mono); }
.cb-setup .tip { border-left: 3px solid var(--wire-ext); background: var(--panel-2); padding: 8px 12px; font-size: 12.5px; }
.cb-setup .tip ul { margin: 4px 0 0; padding-left: 18px; }
.notice.warn { background: var(--warn-bg); border-left-color: var(--warn); }
@media (max-width: 760px) { .cb-designer { grid-template-columns: 1fr; } .cb-palette { border-right: 0; border-bottom: 1px solid var(--line); } }
/* action designer: how Coupa starts the action */
.coupa-start { margin-top: 16px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.coupa-start ol.steps { margin: 4px 0 10px 18px; padding: 0; }
.coupa-start ol.steps li { margin: 3px 0; }
.coupa-start .start-env { border: 1px solid var(--line-2); background: var(--panel-2); padding: 8px; margin: 8px 0; display: grid; gap: 4px; }
.coupa-start .start-env-head { margin-bottom: 2px; }
.coupa-start .start-panel { justify-self: start; margin-top: 4px; }
/* own panel descriptor (view "coupa") */
.notice.err { background: var(--err-bg, #fdecea); border-left-color: var(--err); }
.notice.ok { background: var(--ok-bg, #e8f5e9); border-left-color: var(--ok); }
.notice ul, .cb-check .tip ul { margin: 6px 0 0; padding-left: 18px; }
.cb-desc { width: 100%; font-size: 12px; line-height: 1.4; min-height: 220px; resize: vertical; white-space: pre; overflow: auto; margin: 6px 0 8px; }
.cb-own { padding-bottom: 10px; margin-top: 10px; border: 1px solid var(--line); }
.cb-wire .ap-node .mono { overflow-wrap: anywhere; }
/* environment chooser and delete */
.env-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.env-chip { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font-size: 13px; }
.env-chip:hover { border-color: var(--faint); text-decoration: none; }
.env-chip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.tree a.env.active { color: var(--fg); background: var(--accent-soft); }
.danger-zone > summary { color: var(--err); }
.danger-zone button.danger { background: var(--err); border-color: var(--err); color: #fff; }
.danger-zone button.danger:disabled { opacity: .45; cursor: not-allowed; }
.coupa-start .check-ok { border-left: 3px solid var(--ok, #2e7d32); background: var(--panel); padding: 6px 8px; margin-top: 4px; font-size: 12px; }
.json-warn { padding: 8px 12px; border-bottom: 1px solid var(--line-2); background: #fff4e5; color: #8a4b00; font-size: 13px; }
.coupa-start .start-panel { white-space: normal; text-align: left; max-width: 100%; }
.coupa-start .start-env { min-width: 0; }
.coupa-start .problems, .coupa-start .check-ok { overflow-wrap: anywhere; }
.coupa-start .start-env { grid-template-columns: minmax(0, 1fr); }
.coupa-start button.start-panel { white-space: normal; height: auto; line-height: 1.35; padding-top: 5px; padding-bottom: 5px; }

/* ---------------------------------------------------- setup check (setup.js) */
.setup-wiring { position: relative; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(120px, 1.2fr) minmax(200px, 1fr); padding: 16px; border: 1px solid var(--line); }
.setup-wiring svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.setup-wiring svg.wires path { stroke-width: 1.6; stroke: var(--wire); }
.setup-wiring svg.wires g.open path { stroke: var(--wire-dim); stroke-dasharray: 4 3; }
.setup-wiring svg.wires g.ok path { stroke: var(--ok); }
.setup-wiring svg.wires text { font-size: 10px; fill: var(--muted); font-family: var(--mono); }
.setup-wiring a.sys { color: var(--fg); }
.setup-wiring a.sys:hover { border-color: var(--accent); text-decoration: none; }
.setup-obj.s-error { border-left: 3px solid var(--err); }
.setup-obj.s-todo, .setup-obj.s-manual { border-left: 3px solid var(--line); }
.setup-obj.s-warning { border-left: 3px solid var(--warn); }
.setup-obj.s-done { border-left: 3px solid var(--ok); }
.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.setup-item:first-child { border-top: 0; }
.setup-item.picked { background: var(--accent-soft); }
.setup-item.s-done .setup-main > .row b { color: var(--muted); }
.setup-num { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--panel-2); }
.setup-item.s-done .setup-num { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.setup-item.s-error .setup-num { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.setup-main { min-width: 0; display: grid; gap: 4px; }
.setup-fix { font-size: 12.5px; border-left: 3px solid var(--warn); background: var(--warn-bg); padding: 5px 8px; }
.setup-fix.err { border-left-color: var(--err); background: var(--err-bg); }
.setup-actions { gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.setup-actions .check-ok, .setup-actions .problems { flex-basis: 100%; overflow-wrap: anywhere; font-size: 12px; margin: 4px 0 0; }
.setup-actions .check-ok { border-left: 3px solid var(--ok); background: var(--panel); padding: 6px 8px; }
.badge.where-coupa { background: var(--panel-2); }
.badge.where-coupafeed { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 860px) { .setup-wiring { grid-template-columns: 1fr; gap: 12px; } .setup-wiring > div:nth-child(3) { display: none; } .setup-wiring svg.wires { display: none; } }
table.t.diff tr.ok td:last-child { color: var(--ok); }
table.t.diff tr.bad td { background: var(--err-bg); }
table.t.diff tr.bad td:last-child { color: var(--err); }
.write-real { margin: 10px 0; padding: 8px 10px; border: 1px dashed var(--line); }
.write-real .check-ok { border-left: 3px solid var(--ok); background: var(--panel); padding: 6px 8px; margin: 6px 0; font-size: 12.5px; }
.diff-list { display: grid; gap: 4px; margin: 4px 0 8px; }
.diff-row { border: 1px solid var(--line); background: var(--panel); padding: 5px 8px; border-left: 3px solid var(--wire-dim); }
.diff-row.ok { border-left-color: var(--ok); }
.diff-row.bad { border-left-color: var(--err); background: var(--err-bg); }
.diff-row .diff-field { color: var(--muted); }
.diff-row.ok .diff-stored { color: var(--ok); }
.diff-row.bad .diff-stored { color: var(--err); }
.diff-note { color: var(--err); margin-top: 2px; }

/* ------------------------------------------------------------ library (section 16) */
.modal.wide { max-width: 680px; max-height: calc(100vh - 32px); overflow: auto; }
.lib-body { padding: 14px 16px; display: grid; gap: 10px; }
.lib-body h3 { margin: 6px 0 0; }
.lib-body .check-ok, .lib-body .problems, .lib-body .notice { margin: 0; overflow-wrap: anywhere; }
.lib-body .check-ok { border-left: 3px solid var(--ok); background: var(--panel); padding: 6px 8px; }
.lib-kv th { width: 34%; text-align: left; font-weight: 600; vertical-align: top; }
.lib-kv td { overflow-wrap: anywhere; }
.lib-kv .badge { margin: 0 4px 4px 0; }
.lib-tested { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.lib-tested.warn { color: var(--warn); }
.lib-url { display: grid; gap: 6px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 6px; }
.lib-url input { flex: 1; min-width: 0; font-size: 12px; }
.lib-todo { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.lib-card details { margin: 6px 0; }
@media (max-width: 600px) { .lib-kv th { width: 40%; } }
/* run log in plain language */
.run-list { display: grid; }
.run-row { padding: 9px 14px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.run-row:last-child { border-bottom: 0; }
.run-row.dead { border-left-color: var(--err); }
.run-row.retrying { border-left-color: var(--warn); }
.run-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.run-time { min-width: 130px; }
.run-sum { flex: 1; min-width: 200px; }
.run-explain { margin: 8px 0 2px 140px; padding: 8px 12px; background: var(--panel-2); border: 1px solid var(--line); display: grid; gap: 4px; }
.run-row.dead .run-explain { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.run-links { margin-top: 4px; gap: 6px; flex-wrap: wrap; }
.run-explain code { white-space: pre-wrap; word-break: break-all; }
@media (max-width: 720px) { .run-explain { margin-left: 0; } .run-time { min-width: 0; } }

/* guided setup (wizard) */
.wiz-steps { list-style: none; display: flex; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
.wiz-steps li { flex: 1; min-width: 140px; border-left: 1px solid var(--line); }
.wiz-steps li:first-child { border-left: 0; }
.wiz-steps button { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 0; background: transparent; padding: 9px 12px; color: var(--muted); font-weight: 600; text-align: left; }
.wiz-steps li.on button { background: var(--accent-soft); color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.wiz-steps li.done button { color: var(--fg); }
.wiz-n { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; background: var(--panel-2); flex: none; }
.wiz-steps li.on .wiz-n { background: var(--accent); color: #fff; border-color: var(--accent); }
.wiz-steps li.done .wiz-n { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.wiz-body { display: grid; gap: 12px; }
.wiz-title { margin: 0; }
.wiz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.wiz-card { display: grid; gap: 6px; align-content: start; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: left; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg); font-weight: 400; }
.wiz-card:hover { border-color: var(--accent); }
.wiz-card.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-soft); }
.wiz-ops { color: var(--muted); }
.wiz-blank { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wiz-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
tr.wiz-bad td { background: var(--err-bg); }
.wiz-card .row { flex-wrap: wrap; justify-content: space-between; }

/* AI assistant panel */
.ai-btn .i { color: #8ec5ff; }
.ai-panel { position: fixed; top: 46px; right: 0; bottom: 0; width: min(460px, 100vw); z-index: 55; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(8, 16, 28, .18); display: flex; flex-direction: column; }
.ai-panel > header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.ai-panel > header .i { color: var(--accent); }
.ai-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ai-mode { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 4px; }
.ai-modeinfo { padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.ai-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.ai-msg { display: grid; gap: 6px; max-width: 92%; }
.ai-msg.user { justify-self: end; }
.ai-msg.user .ai-text { background: var(--accent); color: #fff; padding: 7px 10px; white-space: pre-wrap; }
.ai-msg.assistant .ai-text { background: var(--panel-2); border: 1px solid var(--line); padding: 8px 11px; font-size: 13.5px; line-height: 1.5; }
.ai-msg .ai-text p { margin: 0 0 6px; }
.ai-msg .ai-text p:last-child { margin-bottom: 0; }
.ai-msg .ai-text ol, .ai-msg .ai-text ul { margin: 4px 0 6px; padding-left: 20px; }
.ai-msg.pending { color: var(--muted); font-size: 13px; }
.ai-used { font-size: 11.5px; color: var(--muted); }
.ai-prop { border: 1px solid var(--accent); border-left-width: 3px; background: var(--accent-soft); padding: 9px 11px; display: grid; gap: 6px; }
.ai-prop .row { gap: 6px; flex-wrap: wrap; }
.ai-hello { color: var(--muted); display: grid; gap: 8px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chips button { white-space: normal; text-align: left; }
.ai-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.ai-input textarea { flex: 1; resize: vertical; min-height: 54px; }
.ai-foot { padding: 0 12px 10px; font-size: 11px; color: var(--muted); }
.ai-off { padding: 16px; display: grid; gap: 10px; justify-items: start; }
.ai-steps { display: grid; gap: 8px; margin: 0 0 12px; padding-left: 18px; }
.ai-steps .copy { margin-top: 6px; }
.ai-steps .copy code { white-space: pre; max-height: 180px; overflow: auto; display: block; }
@media (max-width: 720px) { .helpbtn.ai-btn span { display: none; } }

/* ---------------------------------------------------------- partners */
.tree a.partner-head { margin-top: 10px; padding-top: 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 1px solid var(--line); }
.tree a.partner-head:first-child { margin-top: 0; border-top: 0; }
.tree a.partner-head .spacer { flex: 1; }
.badge.plan-basis { background: var(--panel-2); color: var(--muted); }
.badge.plan-support_bot { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.badge.plan-support_agent { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
table.t th.num { text-align: right; }
table.t td.c, table.t th.c { text-align: center; }
table.t td.right { text-align: right; white-space: nowrap; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel-2); }
table.plans td:first-child { max-width: 420px; }
.ok-mark { color: var(--ok); font-weight: 700; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.notice > .i { float: left; margin-right: 8px; color: var(--accent); }
.access-list { display: grid; gap: 4px; padding: 4px 0 4px 26px; }
.access-list.off { opacity: .45; pointer-events: none; }
.access-card input[type=radio], .access-card input[type=checkbox] { width: auto; flex: none; margin: 0; }
/* partner limits and assistant */
.access-row { gap: 8px; align-items: center; flex-wrap: nowrap; margin: 2px 0; }
.access-row input[type=radio], .access-row input[type=checkbox] { width: auto; flex: none; margin: 0; }
.usage-t th { width: 260px; }
.usebar { display: inline-block; width: 120px; height: 6px; background: var(--line); vertical-align: middle; margin-left: 8px; }
.usebar i { display: block; height: 100%; background: var(--ok); }
.usebar.near i { background: var(--warn); }
.usebar.full i { background: var(--err); }
.own-key { border-left: 3px solid var(--line); padding: 4px 0 4px 14px; margin: 8px 0 0 26px; }
