/*
#################################################################################
# Author      : Rodrigo Contreras (<mrdc.tech>)
# Copyright(c): 2026
# All Rights Reserved.
#
# This module is copyright property of the author mentioned above.
# You can`t redistribute it and/or modify it.
#
#################################################################################
*/

:root {

  --bg: #f6f5f7; --panel: #ffffff; --panel-2: #f3f1f4; --panel-3: #ebe8ed; --border: #e4e0e6; --border-strong: #d2ccd5;

  --text: #1e1a21; --text-2: #46404a; --muted: #6f6875;

  --brand: #714b67; --brand-fill: #714b67; --brand-fill-hover: #5e3d55; --on-brand: #ffffff;
  --brand-soft: #f3ebf1; --brand-line: #d9c3d3;

  --ok: #15803d; --ok-soft: #e7f5ec; --ok-line: #b5dfc3;
  --warn: #b45309; --warn-soft: #fdf3e1; --warn-line: #f0d39c;
  --bad: #c81e1e; --bad-soft: #fdecec; --bad-line: #f3bcbc; --bad-fill: #c81e1e;
  --info: #1d5fd1; --info-soft: #e9f0fd; --info-line: #bdd1f6;

  --code-bg: #f8f7f9; --term-bg: #1a161d; --term-text: #dcd7df; --term-border: #2c2630;
  --shadow-1: 0 1px 2px rgba(30, 20, 35, .05);
  --shadow-2: 0 1px 2px rgba(30, 20, 35, .05), 0 6px 18px rgba(30, 20, 35, .06);
  --shadow-3: 0 24px 64px rgba(20, 10, 25, .28);
  --radius: 12px; --radius-s: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --side-w: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121014; --panel: #1b181e; --panel-2: #231f27; --panel-3: #2c2731; --border: #302b35; --border-strong: #433c49;
    --text: #edeaef; --text-2: #cbc5cf; --muted: #a098a6;
    --brand: #cf9fc3; --brand-fill: #8a5c7f; --brand-fill-hover: #9c6a90; --on-brand: #ffffff;
    --brand-soft: #2d2230; --brand-line: #553d50;
    --ok: #4ade80; --ok-soft: #14291d; --ok-line: #1f4a31;
    --warn: #fbbf24; --warn-soft: #2e2413; --warn-line: #57441a;
    --bad: #f87171; --bad-soft: #321a1b; --bad-line: #5e2a2c; --bad-fill: #c53030;
    --info: #7fb0ff; --info-soft: #17233a; --info-line: #2a4170;
    --code-bg: #161318; --term-bg: #0e0c10; --term-text: #d6d1d9; --term-border: #2a252e;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 20px rgba(0, 0, 0, .25);
    --shadow-3: 0 24px 64px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
body { min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; margin: 0; }
h2 { font-size: 15.5px; line-height: 1.3; font-weight: 650; letter-spacing: -.005em; margin: 0 0 10px; }
h3 { font-size: 13.5px; font-weight: 650; margin: 0 0 8px; }
p { margin: 0; }
b { font-weight: 650; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); }

.muted { color: var(--muted); }
.center { text-align: center; padding: 40px 0; }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.err { color: var(--bad); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.grid2 > .card { margin: 0; }
.w-wide { min-width: min(280px, 100%); }
.w-200 { width: 200px; }
.mt-s { margin-top: 6px; }
.mt-l { margin-top: 30px; }
.grow { flex: 1 1 220px; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }


.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic.lg { width: 20px; height: 20px; }
.ic.xl { width: 26px; height: 26px; stroke-width: 1.6; }
.logo { width: 28px; height: 28px; flex: none; display: block; }
.logo.big { width: 44px; height: 44px; }


#topbar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 20; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 12px 12px; background: var(--panel); border-right: 1px solid var(--border); }
#topbar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; color: var(--text); }
#topbar .brand:hover { text-decoration: none; }
#topbar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 550; position: relative; }
.nav-item .ic { width: 18px; height: 18px; color: var(--muted); }
.nav-item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-item.active .ic { color: var(--brand); }
.nav-item .nav-short { display: none; }
.nav-item .count { margin-left: auto; }
.count { display: inline-block; min-width: 19px; padding: 0 6px; border-radius: 10px; background: var(--bad-fill); color: #fff;
  font-size: 11px; line-height: 19px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 2px; border-top: 1px solid var(--border); }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
  font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.side-user { min-width: 0; flex: 1; line-height: 1.25; }
.side-user b, .side-user span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user b { font-size: 13px; }
.side-user span { font-size: 11.5px; color: var(--muted); }

main { max-width: 1280px; margin: 0 auto; padding: 28px 32px 64px; }
#topbar:not([hidden]) ~ main { margin-left: var(--side-w); max-width: none; }
#topbar:not([hidden]) ~ main > * { max-width: 1240px; margin-left: auto; margin-right: auto; }


.page-head { display: flex; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .titles { flex: 1 1 260px; min-width: 0; }
.page-head .titles p { color: var(--muted); margin-top: 3px; max-width: 72ch; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.h-count { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--panel-3); border-radius: 10px; padding: 1px 8px; margin-left: 8px; vertical-align: 3px; letter-spacing: 0; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs .ic { width: 13px; height: 13px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 30px 0 12px; }
.section-title h2 { margin: 0; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }


.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 18px; min-width: 0; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 0; }
.card.link { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card.link:hover { border-color: var(--brand-line); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--muted); font-size: 12.5px; }

.client { margin-top: 26px; }
.client-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.client-head h2 { margin: 0; }
.client-head .ic { color: var(--muted); }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); gap: 14px; }
.inst-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px 19px; overflow: hidden; }
.inst-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--border-strong); transition: background .2s; }
.inst-card.st-ok::before { background: var(--ok); }
.inst-card.st-bad::before { background: var(--bad); }
.inst-card.st-warn::before { background: var(--warn); }
.inst-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 650; font-size: 15px; }
.inst-title .name { margin-right: auto; overflow-wrap: anywhere; }
.inst-meta { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.inst-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-height: 22px; margin-top: 2px; padding-top: 10px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.inst-status .state { font-weight: 650; }
.inst-status.ok .state { color: var(--ok); }
.inst-status.bad .state { color: var(--bad); }
.inst-status .why { color: var(--text-2); overflow-wrap: anywhere; flex-basis: 100%; }
.metrics { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; }
.metric { display: inline-flex; gap: 5px; align-items: baseline; padding: 2px 8px; border-radius: 6px; background: var(--panel-2); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.metric i { font-style: normal; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }


.summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.sum-tile { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; min-width: 132px; flex: 1 1 132px; max-width: 220px; }
.sum-tile b { font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.sum-tile span.lbl { color: var(--muted); font-size: 12.5px; }
.sum-tile.bad.on { border-color: var(--bad-line); background: var(--bad-soft); }
.sum-tile.bad.on b { color: var(--bad); }


.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.dot.info { background: var(--info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 22%, transparent); }
.dot.loading { animation: pulse 1.1s infinite ease-in-out; }
@keyframes pulse { 50% { opacity: .25; } }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; line-height: 18px; font-weight: 600;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; max-width: 100%; }
.badge.mono { font-size: 11.5px; border-radius: 6px; font-weight: 500; }
.badge.production { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; font-weight: 700; }
.badge.production::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.badge.staging { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; font-weight: 700; }
.badge.dev { background: var(--info-soft); color: var(--info); border-color: var(--info-line); text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; font-weight: 700; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge .ic { width: 12px; height: 12px; }
.badge button.link { padding: 0 0 0 2px; font-size: 14px; line-height: 1; color: var(--muted); }
.badge button.link:hover { color: var(--bad); text-decoration: none; }
.badge-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }


input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-s); padding: 6px 10px; min-width: 0; max-width: 100%;
  transition: border-color .12s, box-shadow .12s; }
input, select { min-height: 34px; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
input:disabled, select:disabled, textarea:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; accent-color: var(--brand-fill); flex: none; cursor: pointer; }
textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; resize: vertical; min-height: 130px; padding: 10px 12px; display: block; }
textarea.short { min-height: 78px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 550; color: var(--text-2); min-width: 0; }
label.field > input, label.field > select, label.field > textarea { color: var(--text); font-size: 14px; font-weight: 400; }
label.field > textarea { font-size: 12.5px; }
label.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13.5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 12px; align-items: end; }
.form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
.form-row > input:not([type=checkbox]), .form-row > select { flex: 1 1 170px; }
.searchbox { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 340px; }
.searchbox .ic { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.searchbox input { width: 100%; padding-left: 32px; }
.toolbar { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }

button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--panel); border-radius: var(--radius-s);
  padding: 6px 13px; min-height: 34px; cursor: pointer; font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
button:hover { background: var(--panel-2); border-color: color-mix(in srgb, var(--brand) 40%, var(--border-strong)); }
button:active { transform: translateY(.5px); }
button.primary { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); box-shadow: var(--shadow-1); }
button.primary:hover { background: var(--brand-fill-hover); border-color: var(--brand-fill-hover); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-soft); border-color: var(--bad-line); }
button.danger.solid { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
button.danger.solid:hover { background: color-mix(in srgb, var(--bad-fill) 86%, #000); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: none; background: none; padding: 0 4px; min-height: 0; color: var(--brand); box-shadow: none; font-weight: 550; }
button.link:hover { background: none; text-decoration: underline; }
button.link.danger { color: var(--bad); }
button.icon-btn { padding: 0; width: 34px; border-color: transparent; background: none; color: var(--muted); }
button.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: transparent; }
.chip { font-size: 12.5px; border-radius: 999px; padding: 5px 12px; min-height: 0; font-weight: 500; white-space: normal; text-align: left; background: var(--panel); }
.chip:hover { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }


.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 18px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; white-space: nowrap; border-radius: 8px 8px 0 0; }
.tabs a .ic { width: 15px; height: 15px; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--text); background: var(--panel-2); }
.tabs a.active:hover { color: var(--brand); }


table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .045em; background: var(--panel-2); white-space: nowrap; }
tr:last-child > td { border-bottom: none; }
tr:hover > td { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
tr.hl > td, td.hl, tr.hl:hover > td { background: var(--warn-soft); }
tr.hl > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
td .badge + .badge, td .badge { margin-left: 0; }
td > .badge:not(:first-child) { margin-left: 6px; }
td input, td select { min-height: 30px; padding: 3px 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.table-wrap.tall { max-height: 620px; overflow-y: auto; }
.table-wrap.tall th { position: sticky; top: 0; z-index: 1; }
.num { font-variant-numeric: tabular-nums; }


pre { margin: 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 11px 13px;
  font-family: var(--mono); font-size: 12px; line-height: 1.6; overflow: auto; max-height: 560px; white-space: pre-wrap; word-break: break-word; tab-size: 4; }
pre .warn { color: var(--warn); }
pre .dim { color: var(--muted); }
pre.log { background: var(--term-bg); color: var(--term-text); border-color: var(--term-border); max-height: min(640px, 68vh); }
pre.log .err { color: #ff8f8f; }
pre.log .warn { color: #f2c35b; }
pre.log .dim { color: #7f7787; }
code { font-family: var(--mono); font-size: 12px; background: var(--panel-3); padding: 1px 5px; border-radius: 5px; }
.out-meta { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.console { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.console textarea { border: none; border-radius: 0; background: var(--code-bg); min-height: 150px; box-shadow: none; }
.console textarea:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.console-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--border); }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, currentColor 16%, transparent); }


.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 10px; }
.kv > div { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; min-width: 0; }
.kv span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .045em; color: var(--muted); }
.kv b { display: block; font-size: 17px; line-height: 1.3; margin-top: 3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv > div.ok b { color: var(--ok); }
.kv > div.bad b { color: var(--bad); }
.kv.compact b { font-size: 13.5px; font-family: var(--mono); font-weight: 500; }
.kv-group { margin-top: 18px; }
.kv-group > h3 { display: flex; align-items: center; gap: 7px; color: var(--text-2); margin-bottom: 9px; }
.kv-group > h3 .ic { color: var(--muted); }

.hero { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; }
.hero .hero-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.hero b { display: block; font-size: 15px; }
.hero .txt { flex: 1 1 200px; min-width: 0; }
.hero.ok { border-color: var(--ok-line); background: var(--ok-soft); }
.hero.ok .hero-ic { background: var(--ok); color: var(--panel); }
.hero.bad { border-color: var(--bad-line); background: var(--bad-soft); }
.hero.bad .hero-ic { background: var(--bad); color: var(--panel); }


.steps { list-style: none; padding: 0; margin: 0; }
.steps li { border: 1px solid var(--border); border-radius: var(--radius-s); padding: 9px 12px; margin-bottom: 8px; background: var(--panel); }
.steps li details pre { margin-top: 8px; max-height: 260px; }
details > summary { cursor: pointer; user-select: none; }
details > summary.small { display: inline-block; padding: 2px 0; }
details > summary.small:hover { color: var(--text); }


.notice { border: 1px solid var(--warn-line); border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 10px 14px; border-radius: var(--radius-s); font-size: 13px; overflow-wrap: anywhere; }
.notice.bad { border-color: var(--bad-line); border-left-color: var(--bad); background: var(--bad-soft); }
.notice.ok { border-color: var(--ok-line); border-left-color: var(--ok); background: var(--ok-soft); }
.notice.info { border-color: var(--info-line); border-left-color: var(--info); background: var(--info-soft); }


.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 44px 20px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 60%, transparent); }
.empty .empty-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }
.empty b { color: var(--text); font-size: 15px; }
.empty p { max-width: 52ch; }
.empty.plain { border: none; background: none; }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 56px 0; color: var(--muted); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }


dialog { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text); padding: 22px; width: min(600px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: var(--shadow-3); }
dialog[open] { animation: pop .16s ease-out; }
dialog::backdrop { background: rgba(18, 12, 22, .55); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dlg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dlg-head h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.dlg-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.dlg-ic.danger { background: var(--bad-soft); color: var(--bad); }
dialog.danger { border-top: 3px solid var(--bad); }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.confirm-type { padding: 12px; border-radius: var(--radius-s); background: var(--bad-soft); border: 1px solid var(--bad-line); }
.confirm-type b { font-family: var(--mono); font-size: 12.5px; color: var(--bad); }


#toast { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
#toast div { display: flex; align-items: flex-start; gap: 9px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--ok);
  padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-2); max-width: min(420px, calc(100vw - 32px)); overflow-wrap: anywhere; animation: toast-in .18s ease-out; pointer-events: auto; }
#toast div .ic { color: var(--ok); margin-top: 2px; }
#toast div.bad { border-left-color: var(--bad); }
#toast div.bad .ic { color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }


.login { max-width: 380px; margin: 0 auto; padding-top: 10vh; }
.login-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 22px; }
.login-head p { color: var(--muted); }
.login .card { padding: 26px; box-shadow: var(--shadow-2); }
.login button.primary { width: 100%; min-height: 38px; }
.login-foot { text-align: center; margin-top: 16px; font-size: 12px; color: var(--muted); }


.inst-head { display: flex; align-items: flex-start; gap: 14px 18px; flex-wrap: wrap; padding: 18px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.inst-head.production { border-top: 3px solid var(--bad); }
.inst-head.staging { border-top: 3px solid var(--warn); }
.inst-head .titles { flex: 1 1 280px; min-width: 0; }
.inst-head .title-row { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.inst-head .sub { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.inst-head .sub span, .inst-head .sub a { display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.inst-head .sub .ic { width: 14px; height: 14px; }
.inst-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.prod-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--bad); font-weight: 550; }
.prod-note .ic { width: 14px; height: 14px; }


.appr { position: relative; padding-left: 21px; overflow: hidden; }
.appr::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--border-strong); }
.appr.pending::before { background: var(--warn); }
.appr-head { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.appr-head .what { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.appr-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); flex: none; }
.appr.done .appr-ic { background: var(--panel-2); color: var(--muted); }
.reason { padding: 8px 12px; border-radius: var(--radius-s); background: var(--panel-2); font-size: 13.5px; }
.reason .muted { font-size: 11px; text-transform: uppercase; letter-spacing: .045em; font-weight: 600; display: block; }


.rollout { padding: 0; overflow: hidden; }
.rollout > summary { list-style: none; display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 12px 16px; }
.rollout > summary::-webkit-details-marker { display: none; }
.rollout > summary .chev { color: var(--muted); transition: transform .15s; }
.rollout[open] > summary .chev { transform: rotate(90deg); }
.rollout > summary:hover { background: var(--panel-2); }
.rollout .msg-line { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rollout-body { padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.rollout-body > * + * { margin-top: 12px; }
.pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.stage { min-width: 0; padding-right: 14px; }
.stage:last-child { padding-right: 0; }
.stage-head { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.stage-head::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--border-strong); margin-right: -6px; }
.stage:last-child .stage-head::after { visibility: hidden; }
.stage-node { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--panel-3); color: var(--muted); font-size: 11px; font-weight: 700; border: 2px solid var(--border-strong); }
.stage-node .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.stage.ok .stage-node { background: var(--ok); border-color: var(--ok); color: var(--panel); }
.stage.ok .stage-head::after { background: var(--ok); }
.stage.bad .stage-node { background: var(--bad); border-color: var(--bad); color: var(--panel); }
.stage.info .stage-node { background: var(--info-soft); border-color: var(--info); color: var(--info); animation: pulse 1.4s infinite ease-in-out; }
.stage.warn .stage-node { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.stage.empty .stage-head { color: var(--muted); }
.stage-empty { margin-top: 10px; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--radius-s); }
.target { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 9px 11px; background: var(--panel); min-width: 0; }
.target.bad { border-color: var(--bad-line); }
.target.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.target .t-top { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.target .t-top a { font-weight: 600; overflow-wrap: anywhere; margin-right: auto; }
.target .t-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.target details { margin-top: 6px; }
.target details .stack { margin-top: 8px; }
.repo-head { display: flex; align-items: flex-start; gap: 10px 14px; flex-wrap: wrap; }
.repo-head .titles { flex: 1 1 260px; min-width: 0; }
.repo-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.repo-head .url { overflow-wrap: anywhere; }
.directives { display: flex; gap: 6px; flex-wrap: wrap; }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.flow .ic { width: 14px; height: 14px; }


.chat-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 16px; height: calc(100vh - 56px); height: calc(100dvh - 56px); margin-bottom: -36px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.chat-list select, .chat-list button.primary { width: 100%; }
.chat-list .manage { align-self: flex-start; font-size: 12.5px; display: inline-flex; gap: 5px; align-items: center; }
.chat-list .list-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .045em; color: var(--muted); margin: 10px 0 0 4px; }
.chat-items { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; flex: 1; margin: 0 -4px; padding: 0 4px; }
.chat-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-size: 13px; min-width: 0; flex: none; }
.chat-item .ic { color: var(--muted); width: 15px; height: 15px; }
.chat-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 550; }
.chat-item.active .ic { color: var(--brand); }
.chat-item:hover { background: var(--panel-2); text-decoration: none; }
.chat-item.active:hover { background: var(--brand-soft); }
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-head h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 8px; min-height: 0; }
.msg { max-width: min(82%, 760px); padding: 9px 14px; border-radius: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--brand-fill); color: var(--on-brand); white-space: pre-wrap; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg pre { margin: 8px 0; max-height: 320px; background: var(--panel); }
.msg code { background: color-mix(in srgb, var(--text) 9%, transparent); }
.tool-line { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 3px 10px 3px 8px; border-radius: 999px;
  background: var(--panel-2); max-width: 100%; overflow-wrap: anywhere; }
.tool-line .ic { width: 13px; height: 13px; }
.tool-line .mono { font-size: 11.5px; color: var(--text-2); }
.tool-line.err { color: var(--bad); background: var(--bad-soft); }
.tool-line.plain { background: none; padding-left: 2px; }
.approval-card { align-self: flex-start; width: min(82%, 640px); border: 1px solid var(--warn-line); border-left: 4px solid var(--warn); border-radius: var(--radius); padding: 12px 14px;
  background: var(--warn-soft); display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.approval-card .ac-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); }
.approval-card pre { background: var(--panel); max-height: 240px; }
.chat-foot { padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--border-strong); border-radius: 14px; padding: 6px 6px 6px 12px; background: var(--panel); transition: border-color .12s, box-shadow .12s; }
.chat-compose:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.chat-input { min-height: 40px; max-height: 180px; font-family: inherit; font-size: 14px; line-height: 1.5; border: none; padding: 8px 0; background: none; resize: none; }
.chat-input:focus, .chat-input:hover { box-shadow: none; border: none; }
.chat-compose button { border-radius: 10px; min-height: 36px; }
.chat-hint { font-size: 11.5px; color: var(--muted); text-align: center; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 30px 20px; color: var(--muted); }
.chat-empty h2 { color: var(--text); font-size: 19px; margin: 6px 0 0; }
.chat-empty p { max-width: 50ch; }
.agent-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-s); flex-wrap: wrap; }
.agent-row + .agent-row { margin-top: 8px; }
.agent-row .info { flex: 1 1 180px; min-width: 0; }
.agent-row .info .small { color: var(--muted); overflow-wrap: anywhere; }


.team-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); margin-top: 0 !important; }
.team-row:first-of-type { border-top: none; }
.team-row > b { min-width: 90px; }
.roles-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px; }
.roles-help > div { padding: 8px 10px; border-radius: var(--radius-s); background: var(--panel-2); font-size: 12.5px; color: var(--text-2); }
.roles-help b { display: block; font-family: var(--mono); font-size: 12px; color: var(--text); }
.profile { display: flex; align-items: center; gap: 14px; }
.profile .avatar { width: 46px; height: 46px; font-size: 16px; }
.profile h2 { margin: 0; }


@media (max-width: 860px) {
  #topbar { inset: auto 0 0 0; width: auto; flex-direction: row; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: none; border-top: 1px solid var(--border); gap: 0;
    box-shadow: 0 -4px 16px rgba(20, 10, 25, .06); }
  #topbar .brand, #topbar .side-foot { display: none; }
  #topbar nav { flex-direction: row; flex: 1; gap: 0; min-width: 0; }
  .nav-item { flex: 1 1 0; flex-direction: column; gap: 2px; padding: 6px 2px 5px; font-size: 10.5px; font-weight: 600; min-width: 0; text-align: center; }
  .nav-item .ic { width: 20px; height: 20px; }
  .nav-item .nav-label { display: none; }
  .nav-item .nav-short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-item.active { background: none; }
  .nav-item .count { position: absolute; top: 2px; left: calc(50% + 4px); margin: 0; min-width: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  #topbar:not([hidden]) ~ main { margin-left: 0; padding-bottom: 96px; }
  main { padding: 18px 16px 48px; }
  h1 { font-size: 20px; }
  #toast { left: 12px; right: 12px; bottom: 76px; align-items: stretch; }
  #toast div { max-width: none; }
  .searchbox { max-width: none; flex-basis: 100%; }
  .page-head .actions { width: 100%; }
  .inst-head { padding: 14px; }
  .inst-head .actions { width: 100%; }
  .inst-head .actions button { flex: 1 1 auto; }
  .card { padding: 14px; }
  .rollout { padding: 0; }
  .appr { padding-left: 18px; }
  .pipeline { grid-template-columns: 1fr; gap: 14px; }
  .stage { padding-right: 0; }
  .stage-head::after { visibility: hidden; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: auto; margin-bottom: 0; gap: 12px; }
  .chat-list .list-label { display: none; }
  .chat-items { flex-direction: row; overflow-x: auto; overflow-y: hidden; flex: none; padding-bottom: 4px; scrollbar-width: none; }
  .chat-items::-webkit-scrollbar { display: none; }
  .chat-item { max-width: 200px; border: 1px solid var(--border); background: var(--panel); }
  .chat-pane { height: calc(100dvh - 300px); min-height: 440px; }
  .msg { max-width: 92%; }
  .approval-card { width: 100%; }
  .w-200 { width: auto; flex: 1 1 160px; }
  .form-row > button { flex: 1 1 auto; }
  dialog { padding: 18px; }
  .dlg-foot button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}


a.card.link, a.card.link:hover { color: inherit; text-decoration: none; }
h3 > .ic { color: var(--muted); }
button.icon-btn.danger:hover { color: var(--bad); background: var(--bad-soft); }
select { padding-right: 26px; text-overflow: ellipsis; }
.msg-text > br:has(+ pre), .msg-text > pre + span:empty + br { display: none; }
@media (min-width: 861px) {
  .page-head .actions { flex-wrap: nowrap; }
  .page-head .actions .searchbox { flex: 0 0 300px; }
}
.agent-row .info .badge { margin-left: 6px; }
.tool-line { flex-wrap: wrap; border-radius: 13px; row-gap: 0; }

.proj-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
@media (max-width: 900px) { .proj-layout { grid-template-columns: minmax(0, 1fr); } }
.branches { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 4px 0; position: sticky; top: 16px; }
@media (max-width: 900px) { .branches { position: static; } }
.branch-group + .branch-group { border-top: 1px solid var(--border); }
.branch-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 6px; font-weight: 650; font-size: 13px; }
.branch-group-head .icon-btn { width: 26px; height: 26px; }
.branch-item { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 11px; color: var(--text-2); border-left: 3px solid transparent; }
.branch-item:hover { background: var(--panel-2); text-decoration: none; }
.branch-item.active { background: var(--brand-soft); border-left-color: var(--brand); color: var(--text); }
.branch-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-empty { padding: 2px 14px 12px; }
.env-main { min-width: 0; }
.build { border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--panel); }
.stack > .build + .build { margin-top: 8px; }
.build > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.build > summary::-webkit-details-marker { display: none; }
.build[open] > summary { border-bottom: 1px solid var(--border); }
.build .who { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; }
.build .msg { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 220px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.build-body { padding: 12px; }
.build-body > * + * { margin-top: 10px; }
.usage-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--panel);
  border-radius: var(--radius-s); padding: 7px 13px; color: var(--text); font-weight: 550; font-size: 13.5px; line-height: 1.2; text-decoration: none; white-space: nowrap; }
a.button:hover { background: var(--panel-2); text-decoration: none; border-color: color-mix(in srgb, var(--brand) 40%, var(--border-strong)); }
a.button.primary { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); box-shadow: var(--shadow-1); }
a.button.primary:hover { background: var(--brand-fill-hover); border-color: var(--brand-fill-hover); }
a.button .ic { width: 15px; height: 15px; }
.w-80 { width: 80px; }
.break { overflow-wrap: anywhere; }
.form-grid .full { grid-column: 1 / -1; }
