﻿/* XLConnect Partner Portal look & feel: brand green #2A794D (OIDC-matched), Inter,
   solid green header bar, #f8fafc body, white cards with subtle borders. */
:root {
  /* tints share the primary's sage hue (was emerald mint, which clashed with the header) */
  --primary: #2A794D; --primary-dark: #236841; --tint: #ebf2ee; --subtle: #d3e4da;
  --header-bg: #2A794D;
  --ink: #1e293b; --muted: #64748b; --faint: #94a3b8; --line: #e5e7eb;
  --radius: 8px; --radius-sm: 6px;
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-semi: var(--font);
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 var(--font); color: var(--ink); background: #f8fafc; -webkit-font-smoothing: antialiased; }
header { display: flex; align-items: center; gap: 1.2rem; height: 52px; padding: 0 1.25rem; background: var(--header-bg); }
header .brand { font-weight: 600; font-size: 16px; color: #fff; display: flex; align-items: center; gap: .75rem; }
header .brand img { height: 24px; }
header .brand .brand-sub { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.75); letter-spacing: .02em; border-left: 1px solid rgba(255,255,255,.25); padding-left: .75rem; }
header nav a { color: rgba(255,255,255,.85); margin-right: 1.1rem; text-decoration: none; font-size: 14px; font-weight: 500; }
header nav a:hover { color: #fff; }
header a.nav-right { color: rgba(255,255,255,.85); text-decoration: none; font-size: 14px; font-weight: 500; }
header a.nav-right:hover { color: #fff; }
main { padding: 1.4rem; max-width: 1600px; margin: 0 auto; }
main.wide { max-width: none; }
h1 { font-weight: 700; font-size: 22px; }
h2 { font-weight: 600; font-size: 16px; margin-top: 2rem; }
h3 { font-weight: 600; font-size: 14px; margin: .8rem 0 .4rem; }
h4 { font-size: 13px; font-weight: 600; margin: 1rem 0 .3rem; }
.muted { color: var(--muted); font-weight: normal; }
.spacer { flex: 1; }
button { padding: .38rem .85rem; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary); color: #fff; cursor: pointer; font-family: var(--font); font-size: 13px; font-weight: 500; }
button:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
button:disabled { opacity: .5; cursor: default; }
button.small { padding: .2rem .6rem; font-size: 12px; background: #fff; color: var(--primary); }
button.small:hover { background: var(--tint); }
a.btn-sm { display: inline-block; padding: .2rem .6rem; font-size: 12px; background: #fff; color: var(--primary); border: 1px solid var(--primary); border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; white-space: nowrap; }
a.btn-sm:hover { background: var(--tint); }
code { background: var(--tint); padding: 0 5px; border-radius: 4px; font-size: 12px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: .9rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card-head { display: flex; align-items: center; gap: .8rem; }
.chips { margin-top: .5rem; }
.chip { display: inline-block; padding: 2px 12px; border-radius: 20px; background: var(--tint); margin-right: .4rem; font-size: 12px; }
.chip-synced { background: #d9f0dd; } .chip-discovered { background: #fdf3d0; }
.chip-planned { background: var(--tint); } .chip-skipped { background: #eef0f2; }
.chip-err { background: #fde8e8; }

/* dashboard: KPI cards — the pipeline at a glance */
.kpis { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 1.4rem; }
.kpi { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: .55rem .9rem;
       background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
       text-decoration: none; color: var(--ink); }
.kpi b { font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: #667; }
.kpi:hover { border-color: var(--primary); }
.kpi.sel { outline: 2px solid var(--primary); }
.kpi-zero b, .kpi-zero span { opacity: .35; }
.kpi-err b { color: #b42318; }

/* dashboard: connections stats table */
.conn-stats { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.conn-stats th.num, .conn-stats td.num { text-align: right; font-variant-numeric: tabular-nums; }
.conn-stats td.num a { text-decoration: none; }
.conn-stats td.num a:hover { text-decoration: underline; }
.conn-stats .err-link { color: #b42318; font-weight: 600; }
.conn-stats tfoot td { border-top: 2px solid var(--line); font-weight: 600; }
.conn-stats .sync-from { font-size: 12px; padding: 0 2px; border: 1px solid var(--line); border-radius: 4px; }
.conn-stats .row-actions { text-align: right; white-space: nowrap; }

/* write protection: production banner + arming */
.prod-banner { background: #b42318; color: #fff; font-weight: 600; font-size: 13px;
               padding: .45rem .9rem; border-radius: 6px; margin-bottom: .7rem; letter-spacing: .02em; }
.prod-banner.rehearsal { background: #b45309; }
.mode-hint { margin: .5rem 0 0; padding: .4rem .7rem; background: #f2f5f3; border-radius: 6px;
             font-size: 12.5px; color: #445; }
.arm-box { margin-top: .6rem; padding: .5rem .7rem; border: 1px solid #f1c4c0; background: #fff7f6;
           border-radius: 6px; font-size: 13px; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.arm-box.armed { border-color: #b42318; background: #fde8e8; }
.arm-box input { font-size: 12.5px; }
button.danger { border-color: #b42318; color: #b42318; }

/* editor: expense list scope (status + from date) */
.exp-filters { display: flex; align-items: center; gap: .3rem; margin-bottom: .4rem; flex-wrap: wrap; }
.exp-filters button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.exp-filters input[type=date] { font-size: 12px; padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; margin-left: auto; }

/* editor: value analysis + pop-out value editor */
.an-row > summary { cursor: pointer; padding: 2px 0; list-style: none; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-row > summary::-webkit-details-marker { display: none; }
.an-row > summary:hover { background: #f2f5f3; }
.an-vals { margin: .2rem 0 .5rem 1rem; font-size: 12px; }
.an-vals code { overflow-wrap: anywhere; }
.an-vals .an-copy { margin-top: .3rem; }
#srcDialog { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; }
#srcDialog h3 { margin: 0 0 .5rem; font-size: 14px; }
.src-dlg-text { resize: both; min-width: 480px; min-height: 200px; font-size: 12.5px; }
.row-btns { white-space: nowrap; }
.row-btns .pop { color: #789; }

/* editor: CodeMirror instances (script + trace) */
.cm-editor { border-radius: 6px; }
.cm-inherited .cm-content { background: #f6f7f9; color: #667; }

/* trace pop-out: same panel, promoted to a near-fullscreen overlay */
#traceMax { float: right; padding: 0 8px; }
.trace-box.pop { position: fixed; inset: 4vh 6vw; z-index: 80; background: #fff;
                 border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem;
                 box-shadow: 0 12px 40px rgba(15, 40, 30, .25); overflow: hidden; }
.trace-box.pop > summary { font-size: 14px; }
/* explicit height (not flex): <details> wraps its content in ::details-content in
   modern Chrome, so flex sizing never reaches the editor. A bounded height makes
   CM's own scroller (both axes) engage instead of the wheel hitting the page. */
.trace-box.pop .cm-editor { height: calc(92vh - 90px); max-height: none !important; margin-top: .5rem; }
.trace-box.pop .cm-scroller { overflow: auto; overscroll-behavior: contain; }

/* editor: executed-statements trace under the script pane */
.trace-box { margin-top: .5rem; }
.trace-box > summary { cursor: pointer; font-size: 13px; color: #556; }
.trace-box pre { margin-top: .4rem; max-height: 320px; overflow: auto; font-size: 12px;
                 white-space: pre-wrap; word-break: break-word; }

/* editor: parked-flow banner — visible without scrolling */
.flow-banner { background: #fef2f2; border: 1px solid #dc2626; color: #991b1b; border-radius: var(--radius-sm);
               padding: .45rem .8rem; margin: 0 0 .6rem; font-size: 13px; }
.flow-banner a { color: #991b1b; font-weight: 600; }

/* editor: collapsible sections inside a call-sheet row */
.cr-sec { margin: .3rem 0; }
.cr-sec > summary { cursor: pointer; font-size: 12px; color: #556; }
.cr-sec[open] > summary { color: #334; font-weight: 600; }

/* editor: target-pane accordion — thin uniform headers: Registers / Variables / DTO / Stages */
.acc { margin: .45rem 0; }
.acc > summary { display: flex; align-items: center; gap: .5rem; cursor: pointer;
                 font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #667;
                 background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .28rem .6rem; }
.acc > summary::before { content: '▸'; font-size: 10px; }
.acc[open] > summary::before { content: '▾'; }
.acc > summary .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
/* open state: near-neutral background, the green lives in a slim accent bar instead of
   tinting the whole header — quieter than a color block, still unmistakable */
.acc[open] > summary { background: #f6f8f7; color: #334; box-shadow: inset 3px 0 0 var(--primary); }
.acc > :not(summary) { margin-top: .4rem; }
.reg-kinds { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0; }
.reg-kinds button.on { background: var(--tint); border-color: var(--primary); }
#regSearch { width: 100%; margin-bottom: .4rem; padding: .25rem .5rem; font-size: 12px;
             border: 1px solid var(--line); border-radius: var(--radius-sm); }
.reg-scroll { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.reg-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.reg-table td { padding: .2rem .5rem; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.reg-table td:first-child { width: 36%; }
.reg-table tr { cursor: copy; }
.reg-table tr:hover { background: var(--tint); }
.reg-table tr.copied { background: var(--subtle); }

/* editor: variables-after-run — long JSON values wrap instead of pushing the
   scope column off-pane; the scope badge always stays visible on the right */
#varsOut { table-layout: fixed; width: 100%; }
#varsOut td:first-child { width: 32%; }
#varsOut td:last-child { width: 86px; text-align: right; }
#varsOut code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* editor: sync-state panel in the target pane */
.sync-state { margin: .3rem 0 .6rem; padding: .5rem .7rem; background: #fff;
              border: 1px solid var(--line); border-left: 3px solid #cbd5e1; border-radius: var(--radius);
              font-size: 13px; }
.sync-state.ok { border-left-color: var(--primary); }
.sync-state.bad { border-left-color: #b42318; background: #fff7f6; }
.sync-state .hint { margin-top: .3rem; }
.step-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-bottom: .35rem; }
.sc { padding: 1px 7px; border-radius: 10px; font-size: 11.5px; white-space: nowrap; }
.sc.done { background: #d9f0dd; color: #14532d; }
.sc.fail { background: #b42318; color: #fff; font-weight: 600; }
.sc.todo { color: #99a; }
.sc-arrow { color: #bbc; font-size: 10px; }
.sc-refs { font-size: 13px; }
.err-full { margin: .35rem 0 0; padding: .4rem .5rem; background: #fff; border: 1px solid #f1c4c0;
            border-radius: 6px; font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
.err-body { margin-top: .4rem; border: 1px solid #f1c4c0; background: #fff; max-height: 240px; overflow: auto; }

/* call sheet: every outbound POST, grouped by stream */
.call-group { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .8rem; }
.cg-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border-bottom: 1px solid var(--line); }
.cg-state { padding: 1px 10px; border-radius: 10px; font-size: 12px; }
.cg-done { background: #d9f0dd; color: #14532d; }
.cg-stuck { background: #fde8e8; color: #b42318; }
.cg-pending { background: #eef0f2; color: #556; }
.call-row { border-bottom: 1px solid var(--line); }
.call-row:last-child { border-bottom: none; }
.call-row > summary { display: flex; align-items: center; gap: .6rem; padding: .35rem .8rem;
                      cursor: pointer; list-style: none; font-size: 13px; }
.call-row > summary::-webkit-details-marker { display: none; }
.call-row.cr-fail > summary { background: #fff7f6; }
.call-row.cr-todo > summary { color: #99a; }
.cr-mark { width: 14px; text-align: center; }
.cr-fail .cr-mark { color: #b42318; font-weight: 700; }
.cr-done .cr-mark { color: var(--primary); }
.cr-label { width: 74px; }
.cr-path { flex: 1; font-family: ui-monospace, monospace; font-size: 12px; color: #667;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-at { font-size: 12px; color: #99a; }
.cr-status { padding: 0 8px; border-radius: 8px; font-size: 12px; background: #d9f0dd; color: #14532d; }
.cr-status.bad { background: #fde8e8; color: #b42318; }
.cr-attempts { font-size: 11px; color: #b42318; }
.cr-body { padding: .4rem .8rem .6rem 2rem; }
.cr-err { font-size: 12.5px; color: #b42318; margin-bottom: .3rem; white-space: pre-wrap; word-break: break-word; }
.cr-edit { width: 100%; font-size: 12px; }
.cr-actions { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; }
.ss-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; font-size: 13px; }
.cr-label-w { flex: 1; }
.sync-state .call-row { border: none; border-top: 1px solid var(--line); margin: 0 -.7rem; }
.sync-state .call-row > summary { padding: .3rem .7rem; }
.sync-state .cr-body { padding: .3rem .7rem .5rem 1.6rem; }
.show-all { color: var(--primary); cursor: pointer; font-size: 13px; }
.flt-clear { color: #b45309; cursor: pointer; font-size: 13px; background: #fef7ec; }
.an-flt { padding: 0 8px; font-size: 11px; }

table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: top; }
th { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
td.detail { max-width: 640px; overflow-wrap: anywhere; color: #a33; }

/* toolbar selects double as the page's context heading — size them like one */
.toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.toolbar > label { display: flex; flex-direction: column; gap: .15rem; font-size: 11px; font-weight: 600;
                   text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.toolbar > label select, .toolbar > label .partner-name {
    font-family: var(--font); font-size: 19px; font-weight: 600; color: var(--ink);
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .3rem 2rem .3rem .6rem; margin: 0; min-width: 240px; }
.toolbar > label select:hover { border-color: var(--primary); }
.toolbar > label .partner-name { border-color: transparent; padding-left: 0; }
.editor { display: grid; grid-template-columns: var(--c1, minmax(280px, 1fr)) 6px var(--c2, 1.3fr) 6px minmax(300px, 1.2fr); align-items: start; }
.split { cursor: col-resize; align-self: stretch; background: transparent; border-left: 2px solid var(--line); margin: 0 2px; }
.split:hover { border-color: var(--primary); }
.pane { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem; min-height: 300px; overflow: hidden; }
table.vars { margin-bottom: .3rem; }
table.vars td { padding: .12rem .3rem; border-bottom: none; }
table.vars input { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: .2rem .45rem; font-size: 13px; }
table.vars input.val { font-family: Consolas, monospace; }
table.vars input:disabled { background: #f7f9fa; color: #99a; border-color: #eef; }
table.vars td:first-child { width: 45%; }
table.vars td.arrow { width: 20px; color: var(--muted); text-align: center; padding: .12rem 0; }
table.vars td:last-child { width: 30px; }
table.vars input.src { font-family: Consolas, monospace; }
/* ---- modal dialogs ---- */
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(600px, 94vw);
         color: var(--ink); font: 14px/1.6 var(--font); box-shadow: 0 12px 34px rgba(15,23,42,.18); }
dialog::backdrop { background: rgba(15,23,42,.45); }
.modal-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.2rem;
              border-bottom: 1px solid #f1f5f9; font-size: 15px; font-weight: 600; }
.modal-head .muted { font-size: 13px; }
.modal-body { padding: 1rem 1.2rem; max-height: 70vh; overflow-y: auto; }
.modal-body .form-grid { margin-top: 0; }
.modal-foot { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.2rem;
              border-top: 1px solid #f1f5f9; background: #fafbfc; }
.modal-foot .spacer { flex: 1; }
button.ghost { background: #fff; color: var(--muted); border-color: var(--line); }
button.ghost:hover { background: #f1f5f9; color: var(--ink); border-color: var(--line); }

.card.inactive { opacity: .55; }
.card.slim summary { cursor: pointer; color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .9rem; margin-top: .6rem; }
.form-grid label { font-size: 13px; display: flex; flex-direction: column; gap: .15rem; }
.form-grid label.check { flex-direction: row; align-items: center; gap: .4rem; }
.form-grid input:not([type=checkbox]), .form-grid select { border: 1px solid var(--line); border-radius: 6px; padding: .3rem .5rem; font-size: 13px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: .6rem; margin-top: .3rem; }
.section-head { display: flex; align-items: baseline; gap: .8rem; }
.section-head h2 { margin-bottom: .5rem; }
.conn-table { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
              box-shadow: 0 1px 2px rgba(0,0,0,.04); overflow: hidden; margin-bottom: 1.6rem; }
.conn-table th:last-child, .conn-table td:last-child { text-align: right; white-space: nowrap; }
.conn-table tbody tr:hover { background: #f8fafc; }
.conn-table tr.inactive td { opacity: .55; }
.conn-table .row-actions { justify-content: flex-end; }
.btn-link { display: inline-block; padding: .2rem .6rem; border: 1px solid var(--primary); border-radius: var(--radius-sm);
            color: var(--primary); text-decoration: none; font-size: 12px; font-weight: 500; }
.btn-link:hover { background: var(--tint); }
dialog .test-result { margin: 0 1.2rem 1rem; }

.app-line { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; font-size: 13px;
            border-bottom: 1px solid #f1f5f9; }
.with-btn { display: flex; gap: .4rem; }
.with-btn input { flex: 1; min-width: 0; }
.lookup-result { margin-top: .6rem; }
.form-row { display: flex; gap: .6rem; margin-top: .5rem; }
.form-row input, .form-row select { border: 1px solid var(--line); border-radius: 6px; padding: .3rem .5rem; }
button.danger { border-color: #c66; color: #a33; }
.admin-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.4rem; align-items: start; }
.admin-menu { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.admin-menu a { display: block; padding: .5rem 1.1rem; border-left: 3px solid transparent; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-menu a:hover { background: #f8fafc; color: var(--ink); }
.admin-menu a.sel { background: var(--tint); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.admin-menu-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: .9rem 1.1rem .3rem; border-top: 1px solid #f1f5f9; margin-top: .5rem; }
.admin-menu-add { display: flex; padding: .55rem 1rem .3rem; }
.admin-menu-add button { flex: 1; }
.admin-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.4rem; min-height: 320px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.admin-panel h2 { margin-top: .2rem; }
.partner-name { font-size: 15px; margin-left: .3rem; }
table.grants { margin: .4rem 0 .2rem; }
table.grants td, table.grants th { padding: .25rem .5rem; }
table.grants input[type=text], table.grants input:not([type]) { border: 1px solid var(--line); border-radius: 6px; padding: .2rem .45rem; font-size: 13px; width: 220px; }
.slim-row { margin-bottom: .8rem; }
.inline-name { border: 1px solid transparent; border-radius: 6px; padding: .2rem .4rem; font-size: 13px; width: 240px; background: transparent; }
.inline-name:hover, .inline-name:focus { border-color: var(--line); background: #fff; }
.row-actions { display: flex; gap: .4rem; }
.test-result { font-size: 12px; margin: .4rem 0; padding: .3rem .6rem; border-radius: 6px; }
.test-result.ok { background: #d9f0dd; } .test-result.fail { background: #fdecea; overflow-wrap: anywhere; }
.pane-head { display: flex; align-items: baseline; gap: .6rem; border-bottom: 1px solid var(--line); padding-bottom: .4rem; margin-bottom: .6rem; }
.pane-head h3 { flex: 1; margin: .8rem 0 .4rem; }
.pane-title { margin: 0; font-size: 16px; }
.pane-head .spacer { flex: 1; }
.badge-mapping { background: #d8f0f5; }
.list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; margin-bottom: .6rem; }
.list .row { padding: .28rem .5rem; cursor: pointer; border-bottom: 1px solid #f3f5f6; font-size: 13px; }
.list .row:hover { background: #f8fafc; } .list .row.sel { background: var(--subtle); }
.json { background: #f7f9fa; border: 1px solid var(--line); border-radius: 6px; padding: .5rem; font-size: 12px; max-height: 420px; overflow: auto; white-space: pre; font-family: Consolas, monospace; }
textarea { width: 100%; font: 12px/1.5 Consolas, monospace; border: 1px solid var(--line); border-radius: 6px; padding: .5rem; white-space: pre; overflow-x: auto; }
textarea.code { min-height: 280px; }
.inherited { color: #99a; background: #f7f9fa; }
textarea.inherited { color: #99a; }
.badge { font-size: 11px; padding: 1px 10px; border-radius: 10px; background: #eef0f2; color: var(--muted); }
.badge-prod { background: #fee2e2; color: #991b1b; font-weight: 600; }
.badge-sandbox { background: #e0e7ff; color: #3730a3; font-weight: 600; }
button.live-btn { background: #dc2626; border-color: #dc2626; color: #fff; }
button.live-btn:hover { background: #b91c1c; border-color: #b91c1c; }
.badge-platform { background: #e8e3f9; } .badge-customer { background: #fbe8d8; }
.badge-none { background: #f1f5f9; color: #64748b; }
.badge-connection { background: var(--tint); } .badge-script { background: #f9d8e8; }
.badge-target { background: #d9f0dd; }
.origin-payhawk { background: #fdf3d0; } .origin-visma { background: #fbe0d8; }
.origin-config { background: #e8e3f9; } .origin-transient { background: #eef0f2; }
.origin-platform { background: #f7c8c8; }
.hint { font-size: 12px; color: var(--muted); }
.kv { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: 13px; margin: .4rem 0; }
/* minmax(0,…): children with wide content (pre, tables) scroll inside their column
   instead of blowing the grid past the viewport */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.cr-body pre { white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.chip.sel { outline: 2px solid var(--primary); }
a.chip { text-decoration: none; color: var(--ink); }
tr.row-fail td { background: #fdf5f4; }
.detail-msg { font-size: 12px; margin-top: .3rem; overflow-wrap: anywhere; }
.error { background: #fdecea; border: 1px solid #f0b5ae; border-radius: 6px; padding: .5rem .8rem; margin-bottom: .6rem; }
.warn { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; border-radius: var(--radius-sm);
        padding: .5rem .8rem; margin-bottom: .6rem; font-size: 13px; }
.warn .hint { color: #92400e; opacity: .85; margin-top: .3rem; }

/* routing + required-slot status, above the binding tables */
.route-row { display: flex; align-items: center; gap: .7rem; padding: .1rem 0 .5rem; }
.route-row label { display: flex; align-items: center; gap: .5rem; font-size: 11px; font-weight: 600;
                   text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.route-row select { font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--ink);
                    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .25rem .5rem; min-width: 180px; }
.route-bad { color: #b91c1c; }
.req-status { font-size: 12px; padding: .35rem .6rem; border-radius: var(--radius-sm); margin-bottom: .5rem; }
.req-status.ok { background: var(--tint); color: var(--primary-dark); }
.req-status.bad { background: #fef3c7; color: #92400e; }
.req-status summary { list-style: none; cursor: default; margin: 0; font-size: 12px; }
/* structured variable values: array-of-objects and plain-object tables inside the Variables pane */
.lines-table { margin: 0; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.lines-table th, .lines-table td { font-size: 12px; padding: .25rem .5rem; overflow-wrap: break-word; }
.lines-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv-table { margin: 0; width: 100%; }
.kv-table td { font-size: 12px; padding: .15rem .5rem; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.kv-table td:first-child { width: 45%; color: #556; }
.raw-btn { margin-left: .35rem; padding: 0 .3rem; font-size: 10px; background: #fff; color: var(--muted);
           border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-family: var(--mono, monospace); }
.raw-btn.on, .raw-btn:hover { color: var(--primary); border-color: var(--primary); }
.var-raw { margin: 0; max-height: 300px; overflow: auto; font-size: 11px; }
details summary { cursor: pointer; font-size: 13px; margin: .3rem 0; }

header .ctx { display: flex; gap: .5rem; }
header .ctx select { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius-sm); padding: .3rem .7rem; font-family: var(--font); font-size: 13px; font-weight: 500; }
header .ctx select option, header .ctx select optgroup { color: var(--ink); background: #fff; }
header .ctx .user { border-left: none; }
header .user { font-size: 13px; color: rgba(255,255,255,.85); font-weight: 500; }
header form { margin: 0; }
header button.small { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); color: #fff; }
header button.small:hover { background: rgba(255,255,255,.25); }

/* ---- public landing page ---- */
main.landing { max-width: none; padding: 0; }
.lp-hero { text-align: center; padding: 5rem 1.5rem 3.5rem; background: linear-gradient(180deg, var(--tint) 0%, #fff 100%); }
.lp-badge { font-size: 13px; padding: 3px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); color: var(--primary-dark); }
.lp-hero h1 { font-size: 42px; line-height: 1.2; margin: 1.2rem 0 .8rem; }
.lp-sub { max-width: 640px; margin: 0 auto 1.6rem; font-size: 17px; color: var(--muted); }
.lp-cta { display: flex; gap: .8rem; justify-content: center; margin-bottom: 2rem; }
.lp-btn { display: inline-block; padding: .6rem 1.8rem; border: 1px solid var(--primary); border-radius: 24px; text-decoration: none; color: var(--primary); background: #fff; font-size: 15px; }
.lp-btn:hover { background: var(--tint); }
.lp-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.lp-btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.lp-btn-invert { background: #fff; color: var(--primary); border-color: #fff; }
.lp-btn-ghost { color: #fff; border-color: #fff; background: transparent; } .lp-btn-ghost:hover { background: rgba(255,255,255,.12); }
.lp-flow { font-size: 15px; } .lp-flow .chip { font-size: 14px; padding: 4px 16px; background: #fff; border: 1px solid var(--line); }
/* brand logo strip. The PNGs have white backgrounds and very different internal padding:
   multiply-blend hides the white on the tinted hero, per-logo heights equalize the
   VISUAL wordmark size (payhawk/visma canvases are mostly whitespace) */
.lp-logos { display: flex; justify-content: center; align-items: center; gap: 1.2rem; margin: 2rem 0 .8rem; }
.lp-logos img { mix-blend-mode: multiply; }
.lp-logo-ph { height: 64px; }
.lp-logo-xl { height: 32px; }
.lp-logo-vn { height: 72px; }
.lp-arrow { color: var(--primary); margin: 0 .3rem; }
.lp-section { max-width: 1000px; margin: 0 auto; padding: 3rem 1.5rem; }
/* auto side margins: inside full-width .lp-alt sections the heading box itself must
   center (the .lp-alt > * auto-margin rule loses specificity to this one) */
.lp-section h2 { font-size: 26px; margin: 0 auto .6rem; text-align: center; }
.lp-alt { max-width: none; background: #f7f9fa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lp-alt > * { max-width: 1000px; margin-left: auto; margin-right: auto; }
.lp-lead { color: var(--muted); max-width: 700px; margin: 0 auto 1.4rem; text-align: center; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.lp-grid .card { margin: 0; } .lp-grid h3 { margin-top: .4rem; }
.lp-step { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 600; }
.lp-calc { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; padding: 1.4rem 1.6rem; }
.lp-calc-inputs { display: flex; gap: 1.4rem; }
.lp-calc-inputs label { display: flex; flex-direction: column; gap: .3rem; font-size: 14px; }
.lp-calc-inputs select { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .8rem; font-size: 16px; min-width: 90px; }
.lp-calc-result { flex: 1; min-width: 220px; }
.lp-price { font-size: 38px; font-weight: 600; color: var(--primary-dark); }
.lp-per { font-size: 16px; font-weight: 400; color: var(--muted); margin-left: .3rem; }
#faq details { max-width: 700px; border-bottom: 1px solid var(--line); padding: .5rem 0; }
#faq summary { font-size: 15px; font-weight: 600; }
#faq p { color: var(--muted); margin: .5rem 0 .3rem; }
.lp-band { text-align: center; background: var(--primary); color: #fff; padding: 3.4rem 1.5rem; margin-top: 2rem; }
.lp-band h2 { color: #fff; margin-top: 0; }
.lp-footer { text-align: center; font-size: 13px; color: var(--muted); padding: 1.6rem; }
.lp-footer a { color: var(--primary); }

/* legal pages: prose column, comfortable reading measure */
.legal { max-width: 760px; margin: 0 auto; padding: 1rem 1.4rem 2rem; }
.legal h1 { font-size: 28px; margin-bottom: .2rem; }
.legal h2 { font-size: 17px; margin-top: 2.2rem; }
.legal h3 { font-size: 14px; margin-top: 1.4rem; }
.legal p, .legal li { font-size: 14.5px; line-height: 1.75; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .4rem; }
.legal table { margin: .8rem 0; }
.legal code { font-size: 12.5px; background: #fef3c7; color: #92400e; }
.legal-meta { color: var(--muted); margin-top: 0; }
.legal-draft { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e;
               border-radius: var(--radius-sm); padding: .7rem 1rem; font-size: 13px; }
.legal-draft code { background: #fde68a; }

.login-box { max-width: 380px; margin: 10vh auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 2.4rem 2.2rem; text-align: center; box-shadow: 0 2px 14px rgba(33,37,41,.06); }
.login-box img.logo { width: 150px; margin-bottom: 1.2rem; }
.login-box h1 { font-size: 22px; margin: 0 0 1.4rem; }
.btn-provider { display: block; margin: .7rem 0; padding: .65rem; border: 1px solid var(--primary); border-radius: 20px; text-decoration: none; color: #fff; background: var(--primary); font-family: var(--font); }
.btn-provider:hover { background: var(--primary-dark); }
.btn-provider.dev { background: #fff; color: var(--muted); border: 1px dashed var(--line); }
.login-box .byline { margin-top: 1.4rem; font-size: 12px; color: var(--muted); }
.login-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; border-radius: 8px;
               padding: .5rem .8rem; font-size: 13px; margin: 0 0 1rem; }
.login-error .hint { display: block; font-size: 11px; color: #b91c1c; }

