/* Apps & runtimes — /panel/runtime/{service}. The panel is an IDE: activity
   bar, side bar (explorer / source control), editor tabs, a console dock and a
   status bar. Flat surfaces and hairlines; colour only from --hp-* tokens, so
   light and dark both follow the site. The console stays dark in both. */

.rt { --rt-act: 48px; --rt-side: 272px; --rt-tabs: 38px; --rt-status: 26px; --rt-term-bg: #0e0e0f; --rt-term-ink: #e6e3de;
    display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rt-mono, .rt code { font-family: var(--hp-mono); }
.rt code { font-size: .9em; padding: 1px 5px; border-radius: 4px; background: var(--hp-fill-2); }
.rt-muted { color: var(--hp-ink-3); }
.rt-small { font-size: 12px; }
.rt-g { flex: none; display: block; }
.rt-right { text-align: right; white-space: nowrap; }
.rt-add { color: var(--hp-ok); font: 500 12px var(--hp-mono); }
.rt-del { color: var(--hp-err); font: 500 12px var(--hp-mono); }

/* ---------------------------------------------------------------- hero */
.rt-hero.hp-hero { padding: 14px 18px; gap: 14px 20px; align-items: center; }
.rt-hero .hp-hero__ico { width: 46px; height: 46px; border-radius: 12px; }
.rt-hero .hp-title { font-size: 22px; }
.rt-hero .hp-hero__meta { margin-top: 8px; }
.rt-hero .hp-hero__actions { align-items: center; gap: 8px; }
.rt-power { display: inline-flex; gap: 6px; }

.rt-state { display: inline-flex; align-items: center; gap: 7px; font: 500 12px/1 var(--hp-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--hp-ink-2); }
.rt-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--hp-ink-3); }
.rt-state[data-tone=ok] i { background: var(--hp-ok); }
.rt-state[data-tone=warn] i { background: var(--hp-warn); }
.rt-state[data-tone=err] i { background: var(--hp-err); }
.rt-state--lg { padding: 0 10px; height: 30px; border: 1px solid var(--hp-line-2); border-radius: 8px; margin-right: 4px; }

.rt-banner { margin: 0; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--hp-warn) 45%, transparent); border-radius: 10px; color: var(--hp-ink-2); font-size: 13px; background: color-mix(in srgb, var(--hp-warn) 8%, transparent); }

/* ----------------------------------------------------------------- ide */
.rt-ide {
    position: relative; display: grid; grid-template-columns: var(--rt-act) auto minmax(0, 1fr);
    height: max(560px, calc(100dvh - 326px)); min-height: 0;
    border: 1px solid var(--hp-line-2); border-radius: 12px; overflow: hidden; background: var(--hp-bg);
}

.rt-act { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; background: var(--hp-surface); border-right: 1px solid var(--hp-line); }
.rt-act__btn { position: relative; display: grid; place-items: center; height: 42px; border: 0; background: none; color: var(--hp-ink-3); cursor: pointer; }
.rt-act__btn:hover { color: var(--hp-ink); }
.rt-act__btn.is-on { color: var(--hp-ink); }
.rt-act__btn.is-on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--hp-accent); }
.rt-act__label { display: none; }
.rt-act__badge { position: absolute; top: 9px; right: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--hp-accent); }

/* ---------------------------------------------------------------- side */
.rt-side { width: var(--rt-side); min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--hp-line); background: var(--hp-surface); overflow: hidden; }
.rt-side__pane { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.rt-side__head { display: flex; align-items: center; justify-content: space-between; height: var(--rt-tabs); padding: 0 8px 0 14px; flex: none;
    font: 500 10.5px/1 var(--hp-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--hp-ink-3); border-bottom: 1px solid var(--hp-line); }
.rt-side__tools { display: inline-flex; gap: 2px; align-items: center; }
.rt-side__tools button, .rt-dock__tools button, .rt-tabs__tool, .rt-icon-btn, .rt-deploy__acts button, .rt-tree__acts button, .rt-env__val button {
    display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--hp-ink-3); cursor: pointer; }
.rt-side__tools button:hover, .rt-dock__tools button:hover, .rt-tabs__tool:hover, .rt-icon-btn:hover, .rt-deploy__acts button:hover, .rt-tree__acts button:hover, .rt-env__val button:hover { background: var(--hp-fill-2); color: var(--hp-ink); }
.rt-side__tools button.is-on, .rt-dock__tools button.is-on { color: var(--hp-accent); }
.rt-side__tools button:disabled, .rt-icon-btn:disabled { opacity: .4; pointer-events: none; }
.rt-side__label { margin: 14px 14px 6px; font: 500 10.5px/1 var(--hp-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--hp-ink-3); }

/* tree */
.rt-tree { flex: 1; overflow: auto; padding: 4px 0 14px; scrollbar-width: thin; font-size: 13px; }
.rt-tree__root { margin: 4px 14px 4px; font: 500 11px var(--hp-mono); color: var(--hp-ink-3); }
.rt-tree__row { position: relative; display: flex; align-items: center; height: 26px; padding-left: calc(10px + var(--d, 0) * 14px); padding-right: 6px; cursor: pointer; color: var(--hp-ink-2); user-select: none; }
.rt-tree__row:hover { background: var(--hp-fill); color: var(--hp-ink); }
.rt-tree__row.is-sel { background: var(--hp-fill-2); color: var(--hp-ink); }
.rt-tree__row.is-open-tab .rt-tree__name { color: var(--hp-ink); font-weight: 500; }
.rt-tree__item { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.rt-tree__chev { display: grid; place-items: center; width: 14px; margin-left: -18px; color: var(--hp-ink-3); transition: transform .12s; }
.rt-tree__chev .rt-g { width: 12px; height: 12px; }
.rt-tree__chev.is-open { transform: rotate(90deg); }
.rt-tree__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-tree__size { font: 400 11px var(--hp-mono); color: var(--hp-ink-3); }
.rt-tree__acts { display: none; gap: 0; }
.rt-tree__acts button { width: 22px; height: 22px; }
.rt-tree__acts .rt-g { width: 13px; height: 13px; }
.rt-tree__row:hover .rt-tree__acts { display: inline-flex; }
.rt-tree__row:hover .rt-tree__size { display: none; }
.rt-tree__empty { margin: 10px 14px; color: var(--hp-ink-3); font-size: 12.5px; line-height: 1.5; list-style: none; }
.rt-tree__skel { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; list-style: none; }
.rt-tree__skel i { height: 12px; }
.rt-tree__skel i:nth-child(2n) { width: 70%; }

/* file-type marks: a small mono glyph, no colour noise */
.rt-fi { flex: none; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--hp-line-2); position: relative; }
.rt-fi[data-t=dir] { border-color: transparent; background: none; }
.rt-fi[data-t=dir]::before { content: ''; position: absolute; inset: 2px 0 1px; border: 1.4px solid var(--hp-ink-3); border-radius: 2px; }
.rt-fi[data-t=js], .rt-fi[data-t=py], .rt-fi[data-t=json], .rt-fi[data-t=env], .rt-fi[data-t=doc] { border-color: var(--hp-line-2); }
.rt-fi[data-t=js]::after, .rt-fi[data-t=py]::after, .rt-fi[data-t=json]::after, .rt-fi[data-t=env]::after { position: absolute; inset: 0; display: grid; place-items: center; font: 700 7px/1 var(--hp-mono); color: var(--hp-ink-2); }
.rt-fi[data-t=js]::after { content: 'JS'; }
.rt-fi[data-t=py]::after { content: 'PY'; }
.rt-fi[data-t=json]::after { content: '{}'; }
.rt-fi[data-t=env]::after { content: '$'; color: var(--hp-accent); }
.rt-fi[data-t=overview] { border-radius: 50%; border-color: var(--hp-accent); }
.rt-fi[data-t=deploy] { border-color: var(--hp-accent); background: var(--hp-accent-soft); }
.rt-fi[data-t=diff] { border-style: dashed; }

/* scm */
.rt-scm { flex: 1; overflow: auto; scrollbar-width: thin; padding-bottom: 14px; }
.rt-scm__connect { padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.rt-scm__lede { margin: 0; color: var(--hp-ink-2); font-size: 13px; line-height: 1.5; }
.rt-scm__repo { padding: 12px 14px; border-bottom: 1px solid var(--hp-line); display: flex; flex-direction: column; gap: 8px; }
.rt-scm__url { margin: 0; font-size: 12px; color: var(--hp-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-scm__branch { margin: 0; display: flex; align-items: center; gap: 6px; font: 500 12.5px var(--hp-mono); color: var(--hp-ink-2); }
.rt-scm__deploy { display: flex; align-items: center; gap: 10px; }
.rt-scm__deploy .hp-btn { flex: 1; }
.rt-switch { display: inline-flex; align-items: center; gap: 6px; font: 500 11px var(--hp-mono); color: var(--hp-ink-3); text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.rt-switch .hp-toggle { width: 30px; height: 18px; }
.rt-switch .hp-toggle::after { width: 12px; height: 12px; }
.rt-switch .hp-toggle:checked::after { transform: translateX(12px); }

.rt-chip { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--hp-line-2); font: 500 10.5px/1 var(--hp-mono); color: var(--hp-ink-2); white-space: nowrap; }
.rt-chip b { font-weight: 600; margin-left: 4px; color: var(--hp-ink); }
.rt-chip.is-live { border-color: color-mix(in srgb, var(--hp-ok) 50%, transparent); color: color-mix(in srgb, var(--hp-ok) 80%, var(--hp-ink)); }
.rt-chip.is-failed { border-color: color-mix(in srgb, var(--hp-err) 50%, transparent); color: color-mix(in srgb, var(--hp-err) 85%, var(--hp-ink)); }
.rt-chip.is-building, .rt-chip.is-queued, .rt-chip.is-pending, .rt-chip.is-dns { border-color: var(--hp-accent-line); color: var(--hp-accent); }
.rt-chip.is-superseded, .rt-chip.is-removing { color: var(--hp-ink-3); }

.rt-deploys, .rt-commits { list-style: none; margin: 0; padding: 0; }
.rt-deploy, .rt-commit { display: flex; align-items: flex-start; gap: 9px; padding: 7px 8px 7px 14px; cursor: pointer; }
.rt-deploy:hover, .rt-commit:hover { background: var(--hp-fill); }
.rt-deploy__dot { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; border: 1.5px solid var(--hp-ink-3); }
.rt-deploy.is-live .rt-deploy__dot { background: var(--hp-ok); border-color: var(--hp-ok); }
.rt-deploy.is-failed .rt-deploy__dot { border-color: var(--hp-err); background: var(--hp-err); }
.rt-deploy.is-building .rt-deploy__dot, .rt-deploy.is-queued .rt-deploy__dot { border-color: var(--hp-accent); animation: rt-blink 1s steps(2) infinite; }
.rt-deploy__main, .rt-commit__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rt-deploy__title, .rt-commit__msg { font-size: 12.5px; color: var(--hp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-deploy__title b { font: 600 12px var(--hp-mono); }
.rt-deploy small, .rt-commit small { font-size: 11.5px; color: var(--hp-ink-3); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.rt-deploy__acts { display: inline-flex; opacity: 0; }
.rt-deploy:hover .rt-deploy__acts, .rt-commit:hover .rt-deploy__acts { opacity: 1; }
.rt-deploy__acts .rt-g { width: 14px; height: 14px; }
.rt-commit__rail { flex: none; position: relative; width: 10px; align-self: stretch; }
.rt-commit__rail::before { content: ''; position: absolute; left: 4px; top: -8px; bottom: -8px; width: 1px; background: var(--hp-line-2); }
.rt-commit__rail i { position: absolute; left: 0; top: 4px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--hp-ink-3); background: var(--hp-surface); }
.rt-commit.is-live .rt-commit__rail i { border-color: var(--hp-ok); background: var(--hp-ok); }
.rt-commit:first-child .rt-commit__rail::before { top: 8px; }
.rt-commit:last-child .rt-commit__rail::before { bottom: auto; height: 10px; }

/* ---------------------------------------------------------------- main */
.rt-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.rt-tabs { display: flex; align-items: stretch; height: var(--rt-tabs); flex: none; background: var(--hp-surface); border-bottom: 1px solid var(--hp-line); overflow-x: auto; scrollbar-width: none; }
.rt-tab { position: relative; display: flex; align-items: center; gap: 7px; padding: 0 8px 0 12px; min-width: 0; max-width: 220px; border-right: 1px solid var(--hp-line); color: var(--hp-ink-3); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.rt-tab > span { overflow: hidden; text-overflow: ellipsis; }
.rt-tab:hover { color: var(--hp-ink); }
.rt-tab.is-on { background: var(--hp-bg); color: var(--hp-ink); }
.rt-tab.is-on::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--hp-accent); }
.rt-tab.is-on::before { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--hp-bg); }
.rt-tab.is-pinned { padding-right: 12px; }
.rt-tab__x { position: relative; display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 4px; background: none; color: inherit; cursor: pointer; opacity: 0; }
.rt-tab:hover .rt-tab__x, .rt-tab.is-on .rt-tab__x { opacity: 1; }
.rt-tab__x:hover { background: var(--hp-fill-2); }
.rt-tab__dirty { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--hp-ink-2); position: absolute; }
.rt-tab.is-dirty .rt-tab__x { opacity: 1; }
.rt-tab.is-dirty .rt-tab__dirty { display: block; }
.rt-tab.is-dirty .rt-tab__x .rt-g { visibility: hidden; }
.rt-tab.is-dirty .rt-tab__x:hover .rt-tab__dirty { display: none; }
.rt-tab.is-dirty .rt-tab__x:hover .rt-g { visibility: visible; }
.rt-tabs__sp { flex: 1; }
.rt-tabs__tool { align-self: center; margin-right: 4px; }

.rt-views { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--hp-bg); }
.rt-view { position: absolute; inset: 0; overflow: auto; scrollbar-width: thin; }

/* overview */
.rt-ov { padding: 16px; }
.rt-ov__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.rt-ov__metrics { grid-column: span 4; }
.rt-ov__status { grid-column: span 2; }
.rt-ov__deploy { grid-column: span 2; }
.rt-ov__health { grid-column: span 2; }
.rt-ov__plan { grid-column: span 2; }
.rt-panel { border: 1px solid var(--hp-line); border-radius: 10px; background: var(--hp-surface); padding: 14px 16px; min-width: 0; }
.rt-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rt-panel__head h2 { margin: 0; font: 600 13.5px/1.2 var(--hp-display); letter-spacing: -0.01em; }
.rt-panel__head .rt-muted { font-size: 11px; }
.rt-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--hp-line); border-radius: 8px; overflow: hidden; }
.rt-metric { padding: 12px 12px 0; border-right: 1px solid var(--hp-line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rt-metric:last-child { border-right: 0; }
.rt-metric__label { margin: 0; font: 500 10.5px/1 var(--hp-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--hp-ink-3); }
.rt-metric__val { margin: 4px 0 0; font: 600 20px/1.1 var(--hp-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-metric__val small { font-size: 12px; color: var(--hp-ink-3); margin-left: 2px; font-weight: 500; }
.rt-metric__foot { margin: 0; min-height: 16px; font-size: 11.5px; color: var(--hp-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-spark { display: block; width: calc(100% + 24px); margin: 8px -12px 0; height: 46px; }
.rt-spark .line { fill: none; stroke: var(--hp-accent); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.rt-spark .area { fill: var(--hp-accent-soft); }

.rt-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 13px; align-items: center; }
.rt-kv dt { color: var(--hp-ink-3); }
.rt-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.rt-kv dd .hp-meter { width: 100%; height: 4px; }
.rt-kv--wide { grid-template-columns: 140px minmax(0, 1fr); }
.rt-hint { margin: 12px 0 0; font-size: 12.5px; color: var(--hp-ink-3); line-height: 1.5; }
.rt-hint b { color: var(--hp-ink-2); }
.rt-copy { display: inline-block; max-width: 100%; padding: 2px 7px; border: 1px solid var(--hp-line-2); border-radius: 6px; background: var(--hp-fill); color: var(--hp-ink); font-size: 12px; cursor: copy; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-copy:hover { border-color: var(--hp-ink-3); }

.rt-empty { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; color: var(--hp-ink-2); font-size: 13px; }
.rt-empty p { margin: 0; line-height: 1.5; }
.rt-dcard { padding: 10px 12px; border: 1px solid var(--hp-line); border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.rt-dcard:hover { border-color: var(--hp-line-2); background: var(--hp-fill); }
.rt-dcard p { margin: 0; }
.rt-dcard__top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.rt-dcard__top b { font: 600 12px var(--hp-mono); }
.rt-dcard__msg { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-dcard__meta { font-size: 11.5px; color: var(--hp-ink-3); }
.rt-dcard__err { font-size: 12px; color: var(--hp-err); }

.rt-health__last { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.rt-health__last i { width: 8px; height: 8px; border-radius: 50%; background: var(--hp-ink-3); }
.rt-health__last[data-ok='1'] i { background: var(--hp-ok); }
.rt-health__last[data-ok='0'] i { background: var(--hp-err); }
.rt-health__bars { display: flex; gap: 2px; height: 22px; align-items: stretch; }
.rt-health__bars i { flex: 1; max-width: 8px; border-radius: 1px; background: var(--hp-fill-2); }
.rt-health__bars i.is-ok { background: color-mix(in srgb, var(--hp-ok) 70%, transparent); }
.rt-health__bars i.is-bad { background: var(--hp-err); }
.rt-health__form { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.rt-health__form .rt-field:not(.rt-field--grow) { width: 76px; }
.rt-plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.rt-plan > div { display: flex; flex-direction: column; gap: 5px; }
.rt-plan__v { margin: 0; font: 600 14px var(--hp-display); }
.rt-plan .hp-meter { height: 4px; }

.rt-note { margin: 0; padding: 10px 12px; border: 1px solid var(--hp-line-2); border-radius: 8px; font-size: 12.5px; color: var(--hp-ink-2); line-height: 1.5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rt-note--err { border-color: color-mix(in srgb, var(--hp-err) 40%, transparent); color: color-mix(in srgb, var(--hp-err) 80%, var(--hp-ink)); }
.rt-side .rt-note { margin: 8px 14px; }

/* file editor */
.rt-file { display: flex; flex-direction: column; overflow: hidden; }
.rt-file__bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 34px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--hp-line); }
.rt-crumb { font-size: 11.5px; color: var(--hp-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-file__acts { display: inline-flex; align-items: center; gap: 6px; }
.rt-file__acts .hp-btn--sm { height: 26px; }
.rt-file__acts kbd { margin-left: 4px; padding: 2px 4px; font-size: 10px; background: transparent; color: inherit; opacity: .6; border-color: currentColor; }
.rt-file__state { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.rt-file__state > i { height: 12px; }
.rt-file__state > i:nth-child(2) { width: 60%; }
.rt-editor { flex: 1; min-height: 0; }
.rt .CodeMirror { height: 100%; font: 400 13px/1.6 var(--hp-mono); background: var(--hp-bg); color: var(--hp-ink); }
.rt .CodeMirror-gutters { background: var(--hp-bg); border-right: 1px solid var(--hp-line); }
.rt .CodeMirror-linenumber { color: var(--hp-ink-3); padding: 0 10px 0 14px; font-size: 11.5px; }
.rt .CodeMirror-cursor { border-left: 2px solid var(--hp-accent); }
.rt .CodeMirror-activeline-background { background: var(--hp-fill); }
.rt .CodeMirror-selected, .rt .CodeMirror-focused .CodeMirror-selected { background: color-mix(in srgb, var(--hp-accent) 18%, transparent); }
.rt .CodeMirror-matchingbracket { color: var(--hp-accent) !important; text-decoration: underline; }
.rt .CodeMirror-dialog { background: var(--hp-surface); border-bottom: 1px solid var(--hp-line); color: var(--hp-ink); font: 13px var(--hp-font); padding: 6px 12px; }
.rt .CodeMirror-dialog input { background: var(--hp-bg); border: 1px solid var(--hp-line-2); color: var(--hp-ink); border-radius: 4px; padding: 2px 6px; font: 13px var(--hp-mono); }
.rt .cm-keyword, .rt .cm-def { color: var(--hp-ink); font-weight: 600; }
.rt .cm-string, .rt .cm-string-2 { color: color-mix(in srgb, var(--hp-ok) 70%, var(--hp-ink)); }
.rt .cm-number, .rt .cm-atom { color: color-mix(in srgb, var(--hp-accent) 85%, var(--hp-ink)); }
.rt .cm-comment, .rt .cm-meta { color: var(--hp-ink-3); font-style: italic; }
.rt .cm-variable-2, .rt .cm-variable-3, .rt .cm-type, .rt .cm-property, .rt .cm-attribute { color: color-mix(in srgb, var(--hp-info) 70%, var(--hp-ink)); }
.rt .cm-tag, .rt .cm-builtin, .rt .cm-qualifier { color: color-mix(in srgb, var(--hp-accent) 70%, var(--hp-ink)); }
.rt .cm-operator, .rt .cm-punctuation, .rt .cm-bracket { color: var(--hp-ink-2); }
.rt .cm-header { font-weight: 700; }
.rt .cm-positive { color: var(--hp-ok); }
.rt .cm-negative { color: var(--hp-err); }

/* diffs */
.rt-diff, .rt-diffv { overflow: auto; }
.rt-diff--inline { flex: 1; }
.rt-diffv__wrap { padding: 14px 16px 30px; }
.rt-diffv__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.rt-dfile { border: 1px solid var(--hp-line); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.rt-dfile summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--hp-surface); border-bottom: 1px solid var(--hp-line); cursor: pointer; font-size: 12.5px; list-style: none; }
.rt-dfile summary .rt-mono { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.rt-diff__table { width: 100%; border-collapse: collapse; font: 12px/1.55 var(--hp-mono); }
.rt-diff__table td { padding: 0 8px; white-space: pre; vertical-align: top; }
.rt-diff__n { width: 1%; text-align: right; color: var(--hp-ink-3); user-select: none; border-right: 1px solid var(--hp-line); }
.rt-diff__s { width: 1%; color: var(--hp-ink-3); user-select: none; }
.rt-diff__c { white-space: pre-wrap !important; word-break: break-all; }
.rt-diff__table tr.is-add { background: color-mix(in srgb, var(--hp-ok) 10%, transparent); }
.rt-diff__table tr.is-add .rt-diff__s { color: var(--hp-ok); }
.rt-diff__table tr.is-del { background: color-mix(in srgb, var(--hp-err) 9%, transparent); }
.rt-diff__table tr.is-del .rt-diff__s { color: var(--hp-err); }
.rt-diff__table tr.is-hunk td { background: var(--hp-fill-2); color: var(--hp-ink-3); padding: 3px 8px; }

/* deploy log */
.rt-dlog { display: flex; flex-direction: column; }
.rt-dlog__wrap { display: flex; flex-direction: column; height: 100%; }
.rt-dlog__head { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--hp-line); }
.rt-dlog__head p { margin: 0; }
.rt-dlog__title { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px !important; flex-wrap: wrap; }
.rt-dlog__acts { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rt-dlog__err { margin: 0; padding: 8px 16px; color: var(--hp-err); font-size: 12.5px; border-bottom: 1px solid var(--hp-line); }
.rt-log { flex: 1; margin: 0; padding: 12px 16px; overflow: auto; background: var(--rt-term-bg); color: var(--rt-term-ink); font: 12.5px/1.6 var(--hp-mono); white-space: pre-wrap; word-break: break-word; scrollbar-color: rgb(255 255 255 / .2) transparent; }
.rt-log--dock { height: 100%; }

/* ---------------------------------------------------------------- dock */
.rt-dock { position: relative; overflow: hidden; flex: none; height: var(--dock-h, 260px); display: flex; flex-direction: column; border-top: 1px solid var(--hp-line-2); background: var(--rt-term-bg); }
.rt-dock__grip { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: row-resize; z-index: 2; }
.rt-dock__bar { flex: none; display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 6px 0 4px; background: var(--hp-surface); border-bottom: 1px solid var(--hp-line); }
.rt-dock__tabs { display: flex; height: 100%; }
.rt-dock__tabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px; border: 0; background: none; color: var(--hp-ink-3); font: 500 10.5px/1 var(--hp-mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.rt-dock__tabs button.is-on { color: var(--hp-ink); }
.rt-dock__tabs button.is-on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 1px; background: var(--hp-ink); }
.rt-dock__live { width: 6px; height: 6px; border-radius: 50%; background: var(--hp-accent); animation: rt-blink 1s steps(2) infinite; }
.rt-dock__tools { display: inline-flex; align-items: center; gap: 2px; }
.rt-dock__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rt-dock__empty { margin: 0; padding: 14px 16px; color: rgb(230 227 222 / .5); font: 12.5px var(--hp-mono); }
.rt-term { position: relative; flex: 1; min-height: 0; padding: 6px 0 0 12px; overflow: hidden; }
.rt-term .xterm { height: 100%; }
.rt-term .xterm-viewport { background: var(--rt-term-bg) !important; scrollbar-color: rgb(255 255 255 / .2) transparent; }
.rt-stdin { flex: none; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-top: 1px solid rgb(255 255 255 / .08); }
.rt-stdin__p { font: 600 11.5px var(--hp-mono); color: var(--hp-accent); }
.rt-stdin input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--rt-term-ink); font: 12.5px var(--hp-mono); }
.rt-stdin input::placeholder { color: rgb(230 227 222 / .35); }

/* status bar */
.rt-status { flex: none; display: flex; align-items: center; gap: 2px; height: var(--rt-status); padding: 0 6px; background: var(--hp-surface); border-top: 1px solid var(--hp-line); font-size: 11.5px; color: var(--hp-ink-3); overflow: hidden; white-space: nowrap; }
.rt-status__item { display: inline-flex; align-items: center; gap: 5px; height: 100%; padding: 0 8px; border: 0; background: none; color: inherit; font: inherit; cursor: default; }
button.rt-status__item { cursor: pointer; }
button.rt-status__item:hover { color: var(--hp-ink); background: var(--hp-fill); }
.rt-status__state i { width: 7px; height: 7px; border-radius: 50%; background: var(--hp-ink-3); }
.rt-status__state[data-tone=ok] i { background: var(--hp-ok); }
.rt-status__state[data-tone=warn] i { background: var(--hp-warn); }
.rt-status__state[data-tone=err] i { background: var(--hp-err); }
.rt-status__sp { flex: 1; }

/* -------------------------------------------------------- settings docs */
.rt-form-view { padding: 22px 24px 90px; }
.rt-doc { max-width: 760px; }
.rt-doc--wide { max-width: 980px; }
.rt-doc__head { margin-bottom: 18px; }
.rt-doc__head--row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.rt-doc__head h2 { margin: 0; font: 600 18px/1.2 var(--hp-display); letter-spacing: -0.02em; }
.rt-doc__head p { margin: 6px 0 0; color: var(--hp-ink-2); font-size: 13.5px; line-height: 1.55; max-width: 68ch; }
.rt-doc__acts { display: flex; gap: 8px; flex: none; }
.rt-block { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--hp-line); }
.rt-block h3 { margin: 0 0 6px; font: 600 14px/1.2 var(--hp-display); }
.rt-block > p { margin: 0 0 12px; font-size: 13px; }
.rt-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.rt-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rt-field > span { font-size: 12.5px; font-weight: 500; color: var(--hp-ink-2); text-transform: capitalize; }
.rt-field small { color: var(--hp-ink-3); font-size: 11.5px; line-height: 1.45; }
.rt-field--wide { grid-column: 1 / -1; }
.rt-field--grow { flex: 1; }
.rt .hp-input { height: 34px; font-size: 13px; }
.rt-form__foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.rt-form__foot--sticky { position: sticky; bottom: -70px; margin: 22px -24px -70px; padding: 12px 24px; background: var(--hp-surface); border-top: 1px solid var(--hp-line); }
.rt-form__foot--sticky .rt-muted { margin-right: auto; font-size: 13px; }
.rt-row { display: flex; gap: 10px; margin-top: 6px; }
.rt-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--hp-ink-2); }
.rt-snippet { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--rt-term-bg); color: var(--rt-term-ink); font: 12.5px var(--hp-mono); overflow-x: auto; }

.rt-table { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid var(--hp-line); border-radius: 8px; overflow: hidden; }
.rt-table th { text-align: left; padding: 8px 12px; font: 500 10.5px/1 var(--hp-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--hp-ink-3); border-bottom: 1px solid var(--hp-line); background: var(--hp-surface); }
.rt-table td { padding: 8px 12px; border-bottom: 1px solid var(--hp-line); }
.rt-table tr:last-child td { border-bottom: 0; }
.rt-table .rt-right { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

/* env */
.rt-env { display: flex; flex-direction: column; }
.rt-env__tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rt-env__filter { max-width: 280px; }
.rt-env__head, .rt-env__row { display: grid; grid-template-columns: minmax(160px, 0.8fr) minmax(0, 2fr) 30px; gap: 8px; align-items: center; }
.rt-env__head { padding: 0 0 6px; font: 500 10.5px/1 var(--hp-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--hp-ink-3); border-bottom: 1px solid var(--hp-line); margin-bottom: 6px; }
.rt-env__row { padding: 3px 0; }
.rt-env__row.is-dup input:first-child { border-color: var(--hp-err); }
.rt-env__val { position: relative; display: flex; align-items: center; }
.rt-env__val .hp-input { padding-right: 60px; }
.rt-env__val button { position: absolute; right: 4px; }
.rt-env__val button:first-of-type:not(:last-of-type) { right: 30px; }
.rt-env__val button .rt-g { width: 14px; height: 14px; }
.rt-env__add { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 8px; padding: 6px 10px; border: 1px dashed var(--hp-line-2); border-radius: 8px; background: none; color: var(--hp-ink-2); font: 500 12.5px var(--hp-font); cursor: pointer; }
.rt-env__add:hover { color: var(--hp-ink); border-color: var(--hp-ink-3); }

/* runtime */
.rt-eggs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rt-egg { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--hp-line); border-radius: 8px; background: var(--hp-surface); color: var(--hp-ink); text-align: left; cursor: pointer; font: inherit; }
.rt-egg:hover { border-color: var(--hp-line-2); }
.rt-egg.is-on { border-color: var(--hp-accent); box-shadow: inset 0 0 0 1px var(--hp-accent); }
.rt-egg span { display: flex; flex-direction: column; min-width: 0; }
.rt-egg b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-egg small { font-size: 11.5px; color: var(--hp-ink-3); }
.rt-egg__ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--hp-line-2); font: 700 11px/1 var(--hp-mono); font-style: normal; color: var(--hp-ink-2); text-transform: none; }
.rt-egg.is-on .rt-egg__ico { color: var(--hp-accent); border-color: var(--hp-accent-line); }
.rt-versions { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-ver { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--hp-line-2); border-radius: 8px; cursor: pointer; font-size: 13px; }
.rt-ver input { display: none; }
.rt-ver small { color: var(--hp-ink-3); font-size: 11px; }
.rt-ver.is-on { border-color: var(--hp-accent); color: var(--hp-ink); box-shadow: inset 0 0 0 1px var(--hp-accent); }
.rt .rt-cmd { height: auto; font-size: 12.5px; line-height: 1.55; }

/* domains / jobs */
.rt-domain-add { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 8px; }
.rt-domains, .rt-jobs, .rt-steps { list-style: none; margin: 12px 0 0; padding: 0; }
.rt-domain, .rt-job { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--hp-line); border-radius: 8px; margin-bottom: 6px; background: var(--hp-surface); }
.rt-domain__main, .rt-job__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rt-domain__main a { font-size: 13px; color: var(--hp-ink); font-weight: 500; }
.rt-domain__main a:hover { color: var(--hp-accent); }
.rt-domain__main small, .rt-job__main small { font-size: 12px; color: var(--hp-ink-2); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rt-domain__acts { display: inline-flex; gap: 4px; align-items: center; }
.rt-job.is-off { opacity: .65; }
.rt-job__main b { font-size: 13.5px; }
.rt-jobform { padding: 16px; border: 1px solid var(--hp-line-2); border-radius: 10px; margin-bottom: 16px; background: var(--hp-surface); }
.rt-cron { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.rt-cron .rt-hint { grid-column: 1 / -1; margin-top: 2px; }
.rt-step { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rt-step .hp-input { width: auto; flex: 1; min-width: 0; }
.rt-step__n { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--hp-line-2); font: 600 11px var(--hp-mono); color: var(--hp-ink-3); }
.rt-step__off { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--hp-ink-3); }
.rt-step__off .hp-input { width: 64px; flex: none; }

/* --------------------------------------------------------- modal, toast */
.rt-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / .45); }
.rt-modal__box { width: min(480px, 100%); padding: 20px; border-radius: 12px; border: 1px solid var(--hp-line-2); background: var(--hp-bg-2); box-shadow: 0 20px 50px -20px rgb(0 0 0 / .5); }
.rt-modal__box h3 { margin: 0 0 6px; font: 600 16px var(--hp-display); }
.rt-modal__box p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.rt-modal__box textarea { margin-top: 12px; font-size: 12.5px; }
.rt-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 95; max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 10px; background: var(--hp-ink); color: var(--hp-bg); font-size: 13px; font-weight: 500; box-shadow: 0 12px 30px -12px rgb(0 0 0 / .5); }
.rt-toast.is-err { background: var(--hp-err); color: #fff; }

@keyframes rt-blink { 50% { opacity: .35; } }

/* -------------------------------------------------------------- narrow */
@media (max-width: 1200px) {
    .rt-ov__metrics { grid-column: span 6; }
    .rt-ov__status, .rt-ov__deploy, .rt-ov__health, .rt-ov__plan { grid-column: span 3; }
}
@media (max-width: 900px) {
    .rt-ide { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: max(560px, calc(100dvh - 210px)); }
    .rt-act { flex-direction: row; padding: 0 4px; border-right: 0; border-bottom: 1px solid var(--hp-line); overflow-x: auto; scrollbar-width: none; }
    .rt-act__btn { width: 44px; flex: none; }
    .rt-act__btn.is-on::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 2px; }
    .rt-side { position: absolute; z-index: 5; top: 43px; bottom: 0; left: 0; width: min(320px, 86%); box-shadow: 0 0 40px rgb(0 0 0 / .25); }
    .rt-main { grid-column: 1; }
    .rt-ov { padding: 12px; }
    .rt-ov__grid { grid-template-columns: minmax(0, 1fr); }
    .rt-ov__grid > * { grid-column: 1 / -1 !important; }
    .rt-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rt-metric:nth-child(2) { border-right: 0; }
    .rt-metric:nth-child(-n+2) { border-bottom: 1px solid var(--hp-line); }
    .rt-metric__val { font-size: 17px; }
    .rt-form-view { padding: 16px 14px 90px; }
    .rt-form { grid-template-columns: minmax(0, 1fr); }
    .rt-doc__head--row { flex-direction: column; }
    .rt-form__foot--sticky { margin: 22px -14px -70px; padding: 10px 14px; flex-wrap: wrap; }
    .rt-env__head { display: none; }
    .rt-env__row { grid-template-columns: minmax(0, 1fr) 30px; padding: 8px 0; border-bottom: 1px solid var(--hp-line); }
    .rt-env__row .rt-env__val { grid-column: 1; grid-row: 2; }
    .rt-env__row .rt-icon-btn { grid-row: 1; grid-column: 2; }
    .rt-domain-add { grid-template-columns: minmax(0, 1fr) 100px; }
    .rt-domain-add .hp-btn { grid-column: 1 / -1; }
    .rt-cron { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rt-kv--wide { grid-template-columns: 100px minmax(0, 1fr); }
    .rt-dlog__head { flex-direction: column; align-items: flex-start; }
    .rt-hide-sm { display: none !important; }
    .rt-hero .hp-hero__actions { justify-content: flex-start; flex-wrap: wrap; }
    .rt-table { display: block; overflow-x: auto; }
    .rt-domain, .rt-job { flex-wrap: wrap; }
}

/* ----------------------------------------------------- panel frame ------ */
/* The activity bar is the workbench rail now; side bar, editor and dock fill
   the frame body edge to edge. */
.hpf.rt .rt-ide { flex: 1; height: auto; min-height: 520px; border: 0; border-radius: 0; }
@media (min-width: 901px) { .hpf.rt .rt-ide { grid-template-columns: auto minmax(0, 1fr); min-height: 0; } }
@media (max-width: 900px) { .hpf.rt .rt-ide { grid-template-rows: minmax(0, 1fr); height: max(560px, calc(100dvh - 160px)); } .hpf.rt .rt-side { top: 0; } }
.hpf.rt .rt-banner { margin: 12px 16px; }
.hpf.rt .rt-state--lg { margin-right: 4px; }
.hpf-rail .hpf-g { display: contents; }
.hpf.rt .rt-doc, .hpf.rt .rt-doc--wide { max-width: none; }
.rt-ic { flex: none; width: 16px; height: 16px; display: block; }

/* Side bar closed: the editor takes the whole width. Before, it dropped into
   the side bar's `auto` track and left an empty column (Nov 18 2026). */
@media (min-width: 901px) {
    .hpf.rt:not(.has-side) .rt-ide { grid-template-columns: minmax(0, 1fr); }
    .hpf.rt.has-side .rt-ide { grid-template-columns: var(--rt-side) minmax(0, 1fr); }
}
.rt-egg__ico .hp-logo { width: 17px; height: 17px; }
.rt-egg:hover .rt-egg__ico { color: var(--hp-ink); }
