/* =============================================================================
   Model Catalog Editor — reusable editor UI (ME-4.4)
   Self-contained, CSP-safe. System font stack (no web-font CDN). Carries forward
   the Playground catalog surface's visual language (tokens, badges, cards, wizard,
   probe rows, icon preview) while severing its shared-DOM IDs and CDN coupling.
   ============================================================================= */

/* ---- KLAG-aligned design tokens ---- */
:root {
    --bg: #f6f8fa;
    --surface: #ffffff;
    --surface-2: #f2f5f8;
    --surface-3: #edf1f4;
    --text: #17191d;
    --text-2: #59616b;
    --text-3: #8b96a1;
    --border: #dfe3e7;
    --border-strong: #cdd4db;
    --accent: #0673c9;
    --accent-hover: #045b9f;
    --accent-weak: #edf5fc;
    --accent-ring: rgba(6, 115, 201, 0.25);
    --success: #176c38;
    --success-weak: #e6f7eb;
    --danger: #9b321c;
    --danger-weak: #ffebe5;
    --amber: #765300;
    --amber-weak: #fff2c8;
    --neutral-weak: #f0f2f4;
    --shadow: 0 1px 2px rgba(23, 25, 29, 0.06), 0 5px 14px rgba(23, 25, 29, 0.05);
    --shadow-lg: 0 24px 70px rgba(23, 25, 29, 0.22);
    --radius: 11px;
    --radius-sm: 7px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Courier New', monospace;
    --header-h: 84px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.app-root { min-height: 100vh; display: flex; flex-direction: column; }

/* min-height:0 on nested flex so inner scroll areas work (project CSS guideline). */
.editor-shell { display: flex; flex-direction: column; min-height: 100vh; }
.editor-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 26px clamp(18px, 3vw, 44px) 44px; }
.zone { flex: 1 1 auto; min-height: 0; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 .6em; }
a { color: var(--accent); }
code, pre, textarea.code { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */
.btn {
    font: inherit;
    font-weight: 550;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .05s ease;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-probe {
    color: var(--accent); border-color: #a9d3ef; background: var(--accent-weak);
}
.btn-probe:hover { color: var(--accent-hover); border-color: var(--accent); background: #e2f1fb; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.btn-danger:hover { background: var(--danger-weak); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-link { border: none; background: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.btn-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); border-radius: 4px; }

.icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }

/* ---------- Inputs ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
input[type=text], input[type=url], input[type=number], input[type=date],
input[type=password], select, textarea {
    font: inherit;
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color .12s ease, box-shadow .12s ease;
}
input[readonly] {
    color: var(--text-2); background: var(--surface-2); cursor: default;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] {
    border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak);
}
textarea.code { min-height: 220px; resize: vertical; font-size: 12.5px; line-height: 1.55; white-space: pre; tab-size: 2; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

/* ---------- Badges & chips ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 650; line-height: 1;
    padding: 4px 9px; border-radius: 999px;
    background: var(--neutral-weak); color: var(--text-2);
    border: 1px solid transparent; white-space: nowrap;
}
.badge .glyph { font-size: 12px; }
.badge-valid { background: var(--success-weak); color: var(--success); }
.badge-invalid { background: var(--danger-weak); color: var(--danger); }
.badge-warn { background: var(--amber-weak); color: var(--amber); }
.badge-neutral { background: var(--neutral-weak); color: var(--text-2); }
.badge-editable { background: var(--accent-weak); color: var(--accent); }
.badge-readonly { background: var(--amber-weak); color: var(--amber); }
.badge-source { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }

.kv-chip { display: inline-flex; flex-direction: column; gap: 3px; }
.kv-chip .kv-label { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Session Header (Zone A) ---------- */
.session-header {
    position: sticky; top: 0; z-index: 30;
    display: grid; grid-template-columns: minmax(270px, auto) minmax(360px, 1fr) auto;
    align-items: center; gap: 24px;
    padding: 12px clamp(18px, 3vw, 44px); min-height: var(--header-h);
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.header-identity { display: flex; align-items: center; gap: 20px; min-width: 0; }
.session-header .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.session-header .brand-mark {
    width: 38px; height: 38px; object-fit: contain; flex: none;
    border: 1px solid var(--border); border-radius: 9px; background: #fff;
}
.session-header .brand-kicker,
.fact-label,
.eyebrow {
    display: block; color: var(--text-2); font-size: 10.5px; font-weight: 750;
    letter-spacing: .055em; text-transform: uppercase;
}
.session-header .brand strong { display: block; font-size: 15px; line-height: 1.25; }
.workspace-context {
    min-width: 0; padding-left: 20px; border-left: 1px solid var(--border);
}
.workspace-context strong {
    display: block; overflow: hidden; color: var(--text); text-overflow: ellipsis;
    white-space: nowrap; max-width: 240px;
}
.header-status { display: flex; align-items: center; justify-content: center; gap: 22px; min-width: 0; }
.session-facts { display: flex; align-items: center; gap: 18px; min-width: 0; }
.session-fact strong { display: block; font-size: 12.5px; white-space: nowrap; }
.read-only-text { color: var(--amber); }
.session-header .header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.validity-chip {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 7px 10px; border: 1px solid transparent; border-radius: var(--radius-sm);
    background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.validity-chip:hover { background: var(--surface-2); }
.validity-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.validity-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--success); }
.validity-chip.invalid .validity-dot { background: var(--danger); }
.validity-title, .validity-detail { display: block; white-space: nowrap; }
.validity-title { font-size: 12.5px; font-weight: 700; }
.validity-detail { color: var(--text-3); font-size: 10.5px; }
.probe-marker {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--accent);
    background: var(--accent-weak); padding: 5px 9px; border: 1px solid #cfe5f5;
    border-radius: var(--radius-sm); cursor: pointer;
}
.probe-marker.complete { color: var(--success); border-color: #b5e2c2; background: var(--success-weak); }
.probe-marker.failed { color: var(--danger); border-color: #efc4ba; background: var(--danger-weak); }
.probe-marker.stopped { color: var(--amber); border-color: #ead18a; background: var(--amber-weak); }
.probe-marker:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

/* ---------- Cards / panels ---------- */
.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 16px; }
.panel-body { padding: 18px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 0 0 10px; }

.overview-wrap { max-width: 1080px; margin: 0 auto; width: 100%; }
.overview-lead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.overview-lead h1 { font-size: 22px; }
.catalog-meta { font-size: 12.5px; color: var(--text-3); }

.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px; }
.kind-card {
    text-align: left; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; display: flex; flex-direction: column; gap: 10px;
    transition: border-color .12s ease, box-shadow .12s ease, transform .06s ease;
    font: inherit; color: inherit;
}
.kind-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.kind-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.kind-card .kind-name { font-size: 12.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-2); }
.kind-card .kind-count { font-size: 30px; font-weight: 700; line-height: 1; }
.kind-card .kind-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.kind-card .open-arrow { color: var(--text-3); font-size: 13px; }

.overview-actions { margin-top: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.empty-note {
    margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--border-strong);
    border-radius: var(--radius); color: var(--text-2); background: var(--surface-2);
}

/* ---------- Catalog container (G1) ---------- */
.catalog-shell { width: min(1420px, 100%); margin: 0 auto; }
.entity-nav {
    display: inline-grid; grid-template-columns: repeat(4, minmax(150px, 1fr));
    max-width: 900px; gap: 4px; padding: 5px; margin-bottom: 22px;
    border: 1px solid var(--border); border-radius: 13px; background: #eef0f2;
}
.entity-tab {
    min-height: 62px; padding: 9px 16px; border: 1px solid transparent;
    border-radius: 9px; background: transparent; color: var(--text-2);
    text-align: left; font: inherit; cursor: pointer;
}
.entity-tab:hover { color: var(--text); background: rgba(255, 255, 255, .58); }
.entity-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.entity-tab.active {
    color: var(--accent); background: var(--surface); border-color: #e3e6e8;
    box-shadow: var(--shadow);
}
.entity-tab-label { display: block; font-size: 14px; font-weight: 700; }
.entity-tab-count { display: block; margin-top: 3px; color: var(--text-3); font-size: 10.5px; }
.entity-tab.active .entity-tab-count { color: #467592; }
.catalog-workspace {
    min-height: 360px; overflow: hidden; background: var(--surface);
    border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow);
}
.catalog-workspace:focus { outline: none; }
.catalog-workspace:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow); }
.catalog-heading {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
    padding: 26px 28px 24px; border-bottom: 1px solid var(--border);
}
.catalog-heading h1 {
    margin: 3px 0 5px; color: var(--text); font-size: clamp(24px, 2.4vw, 32px);
    line-height: 1.2; letter-spacing: -.025em;
}
.catalog-description { max-width: 690px; margin: 0; color: var(--text-2); font-size: 14px; }
.catalog-heading-actions { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.catalog-state {
    min-height: 245px; display: flex; align-items: center; justify-content: center; gap: 14px;
    padding: 30px; color: var(--text-2); text-align: left;
}
.catalog-state strong { display: block; color: var(--text); font-size: 15px; }
.catalog-state p { margin: 3px 0 0; }
.catalog-state.error { justify-content: space-between; max-width: 700px; margin: 0 auto; color: var(--danger); }
.catalog-state.error strong { color: var(--danger); }
.catalog-state.empty { justify-content: space-between; max-width: 780px; margin: 0 auto; }
.catalog-state-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.compatibility-panel { padding: 0; }
.compatibility-head {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 17px 24px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.compatibility-head h2 { font-size: 14px; }
.compatibility-head p { margin: 2px 0 0; color: var(--text-2); font-size: 12px; }
.access-note {
    flex: none; color: var(--text-2); font-size: 11px; font-weight: 750;
    letter-spacing: .04em; text-transform: uppercase;
}
.entity-summary-list { display: flex; flex-direction: column; }
.entity-summary-row {
    display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto;
    align-items: center; gap: 16px; min-height: 76px; padding: 14px 24px;
    border-bottom: 1px solid var(--border);
}
.entity-summary-row:last-child { border-bottom: none; }
.entity-summary-icon {
    width: 34px; height: 34px; display: grid; place-items: center;
    color: var(--accent); background: var(--accent-weak); border: 1px solid #d5e8f7;
    border-radius: 8px; font-size: 12px; font-weight: 800;
}
.entity-summary-copy strong { display: block; }
.entity-summary-copy span { display: block; margin-top: 2px; color: var(--text-2); font-size: 12px; }
.entity-summary-count {
    min-width: 42px; color: var(--text); font-size: 24px; font-weight: 700; text-align: right;
}
.compatibility-note {
    margin: 0; padding: 13px 24px; color: var(--text-2); background: var(--surface-2);
    border-top: 1px solid var(--border); font-size: 12px;
}

/* ---------- Providers & Models read workspace (Task 6) ---------- */
.providers-models-body { min-width: 0; padding: 22px; }
.workspace-notice {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--border);
    border-radius: 9px; background: var(--surface-2); color: var(--text-2);
}
.workspace-notice strong { display: block; color: var(--text); }
.workspace-notice p { margin: 2px 0 0; font-size: 12.5px; }
.workspace-notice.info { color: #375668; border-color: #b9daec; background: #eef8fd; }
.workspace-notice.invalid { color: var(--danger); border-color: #efc4ba; background: var(--danger-weak); }
.workspace-notice.invalid strong { color: var(--danger); }
.workspace-notice.warning { color: var(--amber); border-color: #ead18a; background: var(--amber-weak); }
.workspace-notice.warning strong { color: var(--amber); }

.providers-models-loading { min-height: 330px; padding: 28px; }
.providers-models-loading-copy {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-bottom: 24px; color: var(--text-2);
}
.providers-models-loading-copy strong { display: block; color: var(--text); }
.providers-models-loading-copy p { margin: 2px 0 0; }
.provider-skeleton {
    max-width: 1080px; margin: 0 auto; overflow: hidden;
    border: 1px solid var(--border); border-radius: 10px;
}
.provider-skeleton-row {
    display: grid; grid-template-columns: 46px minmax(180px, 1fr) 140px 110px;
    align-items: center; gap: 16px; min-height: 72px; padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.provider-skeleton-row:last-child { border-bottom: 0; }
.skeleton-icon { width: 42px; height: 42px; }
.skeleton-copy { width: min(280px, 85%); height: 16px; }
.skeleton-chip { width: 90px; height: 24px; }

.providers-models-filters {
    display: grid;
    grid-template-columns: minmax(230px, 1.8fr) repeat(5, minmax(125px, 1fr)) auto;
    align-items: end; gap: 10px; margin-bottom: 14px; padding: 14px;
    border: 1px solid var(--border); border-radius: 10px; background: #fafbfc;
}
.providers-models-filters label {
    font-size: 10.5px; font-weight: 750; letter-spacing: .045em; text-transform: uppercase;
}
.providers-models-filters input[type="search"],
.providers-models-filters select {
    width: 100%; min-height: 40px; padding: 8px 10px; color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
    font: inherit;
}
.providers-models-filters input[type="search"]:focus,
.providers-models-filters select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.providers-models-filters select:disabled { color: var(--text-3); background: var(--surface-2); }
.filter-clear { min-height: 40px; justify-content: center; }
.providers-models-result-count {
    margin: 0 2px 12px; color: var(--text-2); font-size: 12.5px; font-weight: 650;
    text-align: right;
}
.filtered-empty, .nested-empty {
    padding: 36px 20px; color: var(--text-2); text-align: center;
}
.filtered-empty strong, .nested-empty strong { display: block; color: var(--text); }
.filtered-empty p, .nested-empty p { margin: 3px 0 14px; }

.relational-table-wrap, .model-table-wrap {
    width: 100%; min-width: 0; overflow-x: auto;
    border: 1px solid var(--border); border-radius: 10px;
}
.relational-table {
    width: 100%; min-width: 1210px; border-spacing: 0; border-collapse: separate;
    color: var(--text);
}
.provider-table { min-width: 1120px; table-layout: fixed; }
.provider-table > thead > tr > th:nth-child(1) { width: 245px; }
.provider-table > thead > tr > th:nth-child(2) { width: 130px; }
.provider-table > thead > tr > th:nth-child(3) { width: 160px; }
.provider-table > thead > tr > th:nth-child(4) { width: 65px; }
.provider-table > thead > tr > th:nth-child(5) { width: 95px; }
.provider-table > thead > tr > th:nth-child(6) { width: 105px; }
.provider-table > thead > tr > th:nth-child(7) { width: 135px; }
.provider-table > thead > tr > th:nth-child(8) { width: 180px; }
.relational-table th {
    padding: 11px 13px; color: var(--text-2); background: #f0f4f8;
    border-bottom: 1px solid var(--border); font-size: 10.5px; font-weight: 800;
    letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.relational-table td {
    padding: 13px; vertical-align: middle; border-bottom: 1px solid #e8ebee;
}
.relational-table > thead > tr > th:last-child,
.relational-table > tbody > tr:not(.provider-models-row) > td:last-child {
    position: sticky; right: 0; min-width: 150px;
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 14px -14px rgba(30, 45, 60, .7);
}
.relational-table > thead > tr > th:last-child {
    z-index: 3; background: #f0f4f8;
}
.relational-table > tbody > tr:not(.provider-models-row) > td:last-child {
    z-index: 2; background: var(--surface);
}
.provider-section:last-child > .provider-row:last-child td,
.provider-section:last-child > .provider-models-row:last-child td { border-bottom: 0; }
.provider-section.expanded > .provider-row td { background: var(--accent-weak); }
.provider-section.expanded > .provider-row > td:last-child { background: var(--accent-weak); }
.provider-row:hover td { background: #fbfcfd; }
.provider-row:hover > td:last-child,
.model-table tbody tr:hover > td:last-child { background: #fbfcfd; }
.provider-section.expanded > .provider-row:hover td { background: #e8f3fb; }
.provider-section.expanded > .provider-row:hover > td:last-child { background: #e8f3fb; }

.provider-identity, .model-identity {
    display: flex; align-items: center; gap: 10px; min-width: 215px;
}
.catalog-icon-frame {
    display: grid; place-items: center; flex: none; width: 42px; height: 42px; overflow: hidden;
    border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
}
.model-identity .catalog-icon-frame { width: 36px; height: 36px; border-radius: 8px; }
.catalog-icon { display: block; width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.icon-fallback {
    color: var(--accent); background: var(--accent-weak); font-size: 11px; font-weight: 800;
}
.identity-copy { min-width: 0; }
.primary-line { display: block; font-weight: 700; }
.record-id {
    display: block; max-width: 260px; margin-top: 2px; overflow: hidden;
    color: var(--text-2); font-family: var(--font-mono); font-size: 11.5px;
    text-overflow: ellipsis; white-space: nowrap;
}
.secondary-line, .muted-value {
    display: block; margin-top: 4px; color: var(--text-3); font-size: 11.5px;
}
.chip-stack { display: flex; align-items: flex-start; flex-direction: column; gap: 5px; }
.catalog-token, .lifecycle-chip, .cost-level, .capability-chip {
    display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px;
    border: 1px solid transparent; border-radius: 7px; font-size: 11.5px;
    font-weight: 700; line-height: 1.2; white-space: nowrap;
}
.catalog-token.neutral { color: #53616f; border-color: #d4dce4; background: #edf2f6; }
.catalog-token.hosting { color: #3d5e70; border-color: #b9daec; background: #eaf6fc; }
.catalog-token.dialect {
    color: #4437b5; border-color: #d1ccff; background: #efedff;
    font-family: var(--font-mono); font-size: 10.5px;
}
.model-count { font-size: 17px; }
.lifecycle-active { color: var(--success); border-color: #b5e2c2; background: var(--success-weak); }
.lifecycle-disabled, .lifecycle-removed, .lifecycle-unknown {
    color: #606873; border-color: #d4d9de; background: var(--neutral-weak);
}
.lifecycle-deprecated { color: var(--amber); border-color: #ead18a; background: var(--amber-weak); }
.lifecycle-probe-failed { color: var(--danger); border-color: #efc4ba; background: var(--danger-weak); }
.cost-lowest, .cost-low { color: var(--success); border-color: #b5e2c2; background: var(--success-weak); }
.cost-moderate { color: var(--amber); border-color: #efcc6e; background: var(--amber-weak); }
.cost-high, .cost-very_high, .cost-extreme {
    color: var(--danger); border-color: #ffb49e; background: var(--danger-weak);
}
.cost-unknown { color: var(--text-2); border-color: var(--border); background: var(--neutral-weak); }
.capability-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 180px; }
.capability-chip { color: var(--success); background: var(--success-weak); font-weight: 650; }
.capability-chip.support-unsupported {
    color: var(--text-2); border-color: var(--border); background: var(--neutral-weak);
}
.capability-chip.support-partial, .capability-chip.support-conditional,
.capability-chip.support-unknown {
    color: var(--amber); border-color: #ead18a; background: var(--amber-weak);
}
.capability-more { color: var(--text-2); font-size: 11px; white-space: nowrap; }

.provider-expand { width: 100%; min-width: 0; justify-content: flex-start; }
.provider-expand .expand-chevron { transition: transform .14s ease; }
.provider-expand .expand-chevron.expanded { transform: rotate(90deg); }
.provider-lifecycle { display: flex; align-items: flex-start; flex-direction: column; gap: 6px; }
.lifecycle-quick-action { min-width: 70px; justify-content: center; }
.lifecycle-explicit-note {
    color: var(--text-3); font-size: 10.5px; font-weight: 650; white-space: nowrap;
}
.provider-row-actions { display: flex; align-items: center; gap: 6px; }
.provider-models-row > td {
    width: 100%; max-width: 0; padding: 0; background: #f6f9fc;
}
.provider-models-panel { min-width: 0; padding: 16px 18px 20px; }
.provider-models-head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin-bottom: 11px;
}
.provider-models-head h2 { font-size: 14px; }
.provider-models-head p { margin: 2px 0 0; color: var(--text-2); font-size: 11.5px; }
.provider-models-head .btn { flex: none; }
.model-table-wrap { border-radius: 8px; background: var(--surface); }
.model-table { min-width: 1340px; }
.model-table tr:last-child td { border-bottom: 0; }
.model-table tbody tr:hover td { background: #fbfcfd; }
.model-row-actions { min-width: 230px; }

/* ---------- Deployments workspace ---------- */
.deployment-invalid-notice { margin: 18px 22px 0; }
.deployment-toolbar {
    display: flex; align-items: end; justify-content: space-between; gap: 20px;
    padding: 18px 22px 14px;
}
.deployment-search { width: min(620px, 100%); margin: 0; }
.deployment-search > span {
    display: block; margin-bottom: 5px; font-size: 10.5px; font-weight: 750;
    letter-spacing: .045em; text-transform: uppercase;
}
.deployment-search input {
    width: 100%; min-height: 40px; padding: 8px 10px; color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
    font: inherit;
}
.deployment-search input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.deployment-result-count {
    flex: none; padding-bottom: 10px; color: var(--text-2); font-size: 12px;
}
.deployment-table-wrap {
    width: calc(100% - 44px); margin: 0 22px 22px; overflow-x: auto;
    border: 1px solid var(--border); border-radius: 10px;
}
.deployment-table {
    width: 100%; min-width: 1360px; border-spacing: 0; border-collapse: separate;
    color: var(--text);
}
.deployment-table th {
    padding: 11px 13px; color: var(--text-2); background: #f0f4f8;
    border-bottom: 1px solid var(--border); font-size: 10.5px; font-weight: 800;
    letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.deployment-table td {
    max-width: 245px; padding: 13px; vertical-align: top; border-bottom: 1px solid #e8ebee;
}
.deployment-table tbody tr:last-child td { border-bottom: 0; }
.deployment-table tbody tr:hover td { background: #fbfcfd; }
.deployment-table th:last-child,
.deployment-table td:last-child {
    position: sticky; right: 0; min-width: 170px; border-left: 1px solid var(--border);
    background: var(--surface); box-shadow: -10px 0 14px -14px rgba(30, 45, 60, .7);
}
.deployment-table th:last-child { z-index: 3; background: #f0f4f8; }
.deployment-table td:last-child { z-index: 2; }
.deployment-table tbody tr:hover td:last-child { background: #fbfcfd; }
.deployment-identity { display: flex; align-items: flex-start; gap: 10px; min-width: 190px; }
.deployment-glyph {
    display: grid; place-items: center; flex: none; width: 34px; height: 34px;
    color: var(--accent); border: 1px solid #d5e8f7; border-radius: 8px;
    background: var(--accent-weak); font-size: 11px; font-weight: 800;
}
.deployment-identity strong,
.deployment-identity span,
.deployment-owner strong,
.deployment-owner code,
.deployment-owner span,
.deployment-cell-value,
.deployment-cell-detail { display: block; }
.deployment-identity strong { overflow-wrap: anywhere; font-size: 13px; }
.deployment-identity span { margin-top: 3px; color: var(--text-3); font-size: 10.5px; }
.deployment-owner strong { font-size: 12.5px; }
.deployment-owner code { margin-top: 3px; color: var(--text-2); font-size: 10.5px; }
.deployment-membership {
    width: fit-content; margin-top: 6px; padding: 2px 6px; border-radius: 5px;
    color: var(--success); background: var(--success-weak); font-size: 9.5px;
    font-weight: 750; white-space: nowrap;
}
.deployment-membership.invalid { color: var(--danger); background: var(--danger-weak); }
.deployment-source {
    display: inline-flex; margin-bottom: 6px; padding: 2px 6px;
    border: 1px solid var(--border); border-radius: 999px; color: var(--text-2);
    background: var(--neutral-weak); font-size: 9.5px; font-weight: 750;
    letter-spacing: .03em; text-transform: uppercase;
}
.deployment-source.override {
    color: var(--accent); border-color: #b9daec; background: var(--accent-weak);
}
.deployment-cell-value {
    max-width: 235px; overflow: hidden; font-size: 12px; text-overflow: ellipsis;
    white-space: nowrap;
}
.deployment-cell-detail {
    max-width: 235px; margin-top: 3px; overflow: hidden; color: var(--text-3);
    font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap;
}
.deployment-model-count { font-size: 22px; font-weight: 750; line-height: 1; }
.deployment-row-actions { display: flex; align-items: center; gap: 6px; }
.deployment-filter-empty { min-height: 300px; border-top: 1px solid var(--border); }
.deployment-loading { min-height: 370px; padding: 28px; }
.deployment-skeleton {
    overflow: hidden; border: 1px solid var(--border); border-radius: 10px;
}
.deployment-skeleton-row {
    display: grid; grid-template-columns: 1.2fr 1fr 1fr 150px;
    align-items: center; gap: 24px; min-height: 74px; padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.deployment-skeleton-row:last-child { border-bottom: 0; }
.deployment-skeleton-name { width: min(260px, 90%); height: 17px; }
.deployment-skeleton-value { width: min(190px, 85%); height: 14px; }
.deployment-skeleton-actions { width: 130px; height: 32px; justify-self: end; }

/* ---------- Selection profiles workspace ---------- */
.profile-default-card {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center; gap: 16px; margin: 18px 22px 0; padding: 17px 18px;
    border: 1px solid #b9daec; border-radius: 10px; background: #f2f9fd;
}
.profile-default-card.explicit {
    border-color: #b5e2c2; background: var(--success-weak);
}
.profile-default-card.compatibility {
    border-color: #ead18a; background: var(--amber-weak);
}
.profile-default-icon {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
    color: var(--accent); background: var(--surface); box-shadow: var(--shadow);
    font-size: 15px; font-weight: 850;
}
.profile-default-card.explicit .profile-default-icon { color: var(--success); }
.profile-default-card.compatibility .profile-default-icon { color: var(--amber); }
.profile-default-card h2 { overflow-wrap: anywhere; font-size: 17px; }
.profile-default-card p:last-child {
    margin: 3px 0 0; color: var(--text-2); font-size: 12px;
}
.profile-window-large {
    color: var(--text); font-size: 17px; font-weight: 750; white-space: nowrap;
}
.profile-zero-state { padding-bottom: 22px; }
.profile-zero-state .profile-default-card { margin-bottom: 18px; }
.profile-empty { margin: 0 22px; }
.profile-toolbar {
    display: flex; align-items: end; justify-content: space-between; gap: 20px;
    padding: 18px 22px 14px;
}
.profile-search { width: min(620px, 100%); margin: 0; }
.profile-search > span {
    display: block; margin-bottom: 5px; font-size: 10.5px; font-weight: 750;
    letter-spacing: .045em; text-transform: uppercase;
}
.profile-search input {
    width: 100%; min-height: 40px; padding: 8px 10px; color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
    font: inherit;
}
.profile-search input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.profile-result-count {
    flex: none; padding-bottom: 10px; color: var(--text-2); font-size: 12px;
}
.profile-table-wrap {
    width: calc(100% - 44px); margin: 0 22px 22px; overflow-x: auto;
    border: 1px solid var(--border); border-radius: 10px;
}
.profile-table {
    width: 100%; min-width: 940px; border-spacing: 0; border-collapse: separate;
    color: var(--text);
}
.profile-table th {
    padding: 11px 13px; color: var(--text-2); background: #f0f4f8;
    border-bottom: 1px solid var(--border); font-size: 10.5px; font-weight: 800;
    letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.profile-table td {
    padding: 13px; vertical-align: top; border-bottom: 1px solid #e8ebee;
}
.profile-table tbody tr:last-child td { border-bottom: 0; }
.profile-table tbody tr:hover td { background: #fbfcfd; }
.profile-table th:last-child,
.profile-table td:last-child {
    position: sticky; right: 0; min-width: 190px; border-left: 1px solid var(--border);
    background: var(--surface); box-shadow: -10px 0 14px -14px rgba(30, 45, 60, .7);
}
.profile-table th:last-child { z-index: 3; background: #f0f4f8; }
.profile-table td:last-child { z-index: 2; }
.profile-table tbody tr:hover td:last-child { background: #fbfcfd; }
.profile-identity { display: flex; align-items: flex-start; gap: 10px; min-width: 180px; }
.profile-glyph {
    display: grid; place-items: center; flex: none; width: 34px; height: 34px;
    color: var(--accent); border: 1px solid #d5e8f7; border-radius: 8px;
    background: var(--accent-weak); font-size: 12px; font-weight: 800;
}
.profile-glyph.default {
    color: var(--success); border-color: #b5e2c2; background: var(--success-weak);
}
.profile-identity strong,
.profile-identity span,
.profile-window-value,
.profile-cell-detail { display: block; }
.profile-identity strong { overflow-wrap: anywhere; font-size: 13px; }
.profile-identity span,
.profile-cell-detail { margin-top: 3px; color: var(--text-3); font-size: 10.5px; }
.profile-window-value { font-size: 13px; }
.profile-default-badge {
    display: inline-flex; padding: 3px 7px; border: 1px solid var(--border);
    border-radius: 999px; color: var(--text-2); background: var(--neutral-weak);
    font-size: 10.5px; font-weight: 750; white-space: nowrap;
}
.profile-default-badge.active {
    color: var(--success); border-color: #b5e2c2; background: var(--success-weak);
}
.profile-make-default { display: flex; margin-top: 7px; }
.profile-row-actions { display: flex; align-items: center; gap: 6px; }
.profile-filter-empty { min-height: 270px; border-top: 1px solid var(--border); }
.profile-loading { min-height: 340px; padding: 28px; }
.profile-skeleton {
    margin-top: 22px; overflow: hidden; border: 1px solid var(--border);
    border-radius: 10px;
}
.profile-skeleton-row {
    display: grid; grid-template-columns: 1.2fr 1fr 150px;
    align-items: center; gap: 24px; min-height: 70px; padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.profile-skeleton-row:last-child { border-bottom: 0; }
.profile-skeleton-name { width: min(260px, 90%); height: 17px; }
.profile-skeleton-window { width: min(180px, 80%); height: 14px; }
.profile-skeleton-actions { width: 130px; height: 32px; justify-self: end; }

/* ---------- Evidence probe ledger ---------- */
.evidence-toolbar {
    display: flex; align-items: end; justify-content: space-between; gap: 20px;
    padding: 16px 22px; border-bottom: 1px solid var(--border); background: #fafbfc;
}
.evidence-search { width: min(520px, 100%); margin: 0; }
.evidence-search > span {
    display: block; margin-bottom: 5px; font-size: 10.5px; font-weight: 750;
    letter-spacing: .045em; text-transform: uppercase;
}
.evidence-search input {
    width: 100%; min-height: 40px; padding: 8px 10px; color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
    font: inherit;
}
.evidence-search input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.evidence-result-count { flex: none; padding-bottom: 10px; color: var(--text-2); font-size: 12px; }
.evidence-workspace {
    display: grid; grid-template-columns: minmax(330px, .78fr) minmax(460px, 1.22fr);
    min-height: 470px;
}
.evidence-list-panel { min-width: 0; border-right: 1px solid var(--border); }
.evidence-detail-panel { min-width: 0; padding: 22px 24px 26px; background: #fcfdfe; }
.evidence-panel-heading {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.evidence-detail-panel > .evidence-panel-heading { padding: 0 0 18px; }
.evidence-panel-heading h2 { margin: 2px 0 4px; font-size: 17px; }
.evidence-panel-heading p { margin: 0; color: var(--text-2); font-size: 12px; }
.evidence-list {
    max-height: 560px; padding: 0; margin: 0; overflow-y: auto; list-style: none;
}
.evidence-list li { margin: 0; border-bottom: 1px solid var(--border); }
.evidence-list li:last-child { border-bottom: 0; }
.evidence-list-row {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start; gap: 12px; width: 100%; padding: 14px 18px;
    color: var(--text); border: 0; background: var(--surface); font: inherit;
    text-align: left; cursor: pointer;
}
.evidence-list-row:hover { background: var(--surface-2); }
.evidence-list-row.active {
    background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent);
}
.evidence-list-row:focus-visible {
    position: relative; z-index: 1; outline: none; box-shadow: inset 0 0 0 3px var(--accent-ring);
}
.evidence-list-copy { min-width: 0; }
.evidence-list-copy strong,
.evidence-list-copy span,
.evidence-list-copy code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-list-copy strong { font-size: 13px; }
.evidence-list-copy span { margin-top: 3px; color: var(--text-2); font-size: 12px; }
.evidence-list-copy code { margin-top: 5px; color: var(--text-3); font-size: 10.5px; }
.evidence-list-row time { color: var(--text-3); font-size: 10.5px; white-space: nowrap; }
.evidence-result {
    display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px;
    border: 1px solid var(--border); border-radius: 999px; color: var(--text-2);
    background: var(--neutral-weak); font-size: 10.5px; font-weight: 750; white-space: nowrap;
}
.evidence-result-accepted {
    color: var(--success); border-color: #b5e2c2; background: var(--success-weak);
}
.evidence-result-rejected {
    color: var(--danger); border-color: #efc4ba; background: var(--danger-weak);
}
.evidence-detail-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px; margin: 18px 0; padding: 1px; border: 1px solid var(--border);
    border-radius: 9px; overflow: hidden; background: var(--border);
}
.evidence-fact { min-width: 0; padding: 12px 14px; background: var(--surface); }
.evidence-fact dt {
    color: var(--text-3); font-size: 10px; font-weight: 750;
    letter-spacing: .045em; text-transform: uppercase;
}
.evidence-fact dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 12.5px; }
.evidence-fact code { color: var(--text); font-size: 11.5px; }
.evidence-readonly-note {
    padding: 14px 16px; border: 1px solid #b9daec; border-radius: 9px;
    color: #375668; background: #eef8fd;
}
.evidence-readonly-note strong { display: block; }
.evidence-readonly-note p { margin: 3px 0 0; font-size: 12px; }
.evidence-detail-empty { display: grid; place-items: center; color: var(--text-2); }
.evidence-filter-empty { min-height: 340px; }

.record-health {
    display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px;
    border: 1px solid transparent; border-radius: 7px; font-size: 11.5px;
    font-weight: 700; white-space: nowrap;
}
.record-health.ok { color: var(--success); background: var(--success-weak); }
.record-health.error { color: var(--danger); border-color: #efc4ba; background: var(--danger-weak); }
.record-health.warning { color: var(--amber); border-color: #ead18a; background: var(--amber-weak); }
.row-issue-details summary { cursor: pointer; list-style-position: inside; }
.row-issue-details[open] summary { margin-bottom: 6px; }
.row-issue-popover { display: flex; align-items: stretch; flex-direction: column; gap: 5px; min-width: 170px; }
.row-issue-button {
    display: flex; align-items: flex-start; gap: 6px; width: 100%; padding: 6px 7px;
    color: var(--text-2); border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); font: inherit; font-size: 11px; text-align: left; cursor: pointer;
}
.row-issue-button:hover { border-color: var(--accent); }
.row-issue-button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.row-issue-button.error { color: var(--danger); }
.row-issue-button.warning { color: var(--amber); }

.unmatched-models {
    margin-top: 18px; padding: 16px; border: 1px solid #efc4ba; border-radius: 10px;
    background: #fff9f7;
}
.unmatched-models-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    margin-bottom: 12px;
}
.unmatched-models-head h2 { margin: 2px 0 3px; font-size: 16px; color: var(--danger); }
.unmatched-models-head p { margin: 0; color: var(--text-2); font-size: 12px; }

/* ---------- Record browser (Zone C) ---------- */
.records-layout {
    display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 16px;
    min-height: 0; flex: 1 1 auto; align-items: start;
}
.records-col { min-width: 0; min-height: 0; }
.record-list { max-height: calc(100vh - var(--header-h) - 120px); overflow: auto; }
.record-list-item {
    width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
    display: flex; flex-direction: column; gap: 3px;
    padding: 10px 12px; border: none; border-bottom: 1px solid var(--border); background: transparent;
}
.record-list-item:hover { background: var(--surface-2); }
.record-list-item[aria-current="true"] { background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent); }
.record-list-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-ring); }
.record-list-item .rid { font-weight: 600; word-break: break-all; }
.record-list-item .rsub { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.record-list-item .issue-dot { color: var(--danger); font-weight: 700; }
.list-search { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.list-search input { padding: 7px 10px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--text-2); font-size: 13px; flex-wrap: wrap; }
.breadcrumb .btn-link { text-decoration: none; }

.editor-fields { display: flex; flex-direction: column; }
.disclosure { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.disclosure-toggle {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    font-weight: 650; color: var(--text); background: none; border: none; font: inherit; padding: 4px 0;
}
.disclosure-toggle .chev { transition: transform .15s ease; color: var(--text-3); }
.disclosure-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.raw-json-note { font-size: 12px; color: var(--text-3); margin: 6px 0 8px; }
.json-parse-error {
    margin-top: 8px; padding: 8px 11px; border-radius: var(--radius-sm);
    background: var(--danger-weak); color: var(--danger); font-size: 12.5px; font-weight: 600;
}
.record-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.record-actions .spacer { flex: 1 1 auto; }
.dirty-dot { color: var(--amber); font-size: 20px; line-height: 0; }

/* per-record validation rail */
.rail-issue {
    text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer;
    display: flex; gap: 9px; padding: 11px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px;
}
.rail-issue:hover { border-color: var(--accent); }
.rail-issue:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.rail-issue .sev { font-size: 15px; line-height: 1.2; flex: none; }
.rail-issue.error .sev { color: var(--danger); }
.rail-issue.warning .sev { color: var(--amber); }
.rail-issue .rail-body { min-width: 0; }
.rail-issue .rail-msg { font-weight: 600; }
.rail-issue .rail-loc { font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); margin-top: 3px; word-break: break-all; }
.rail-empty { color: var(--text-3); font-size: 13px; padding: 8px 2px; }

/* icon affordance */
.icon-affordance { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 6px 0 2px; }
.icon-preview {
    width: 64px; height: 64px; flex: none; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); display: grid; place-items: center; overflow: hidden;
}
.icon-preview img { max-width: 100%; max-height: 100%; }
.icon-preview .placeholder { color: var(--text-3); font-size: 11px; text-align: center; padding: 4px; }
.icon-meta { min-width: 0; }
.icon-meta .icon-ref { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); word-break: break-all; }
.icon-buttons { display: flex; gap: 8px; margin-top: 8px; }

/* highlighted field after issue navigation */
@keyframes field-flash {
    0% { box-shadow: 0 0 0 3px var(--accent-ring); }
    100% { box-shadow: 0 0 0 3px transparent; }
}
.field-highlight { animation: field-flash 1.6s ease-out; border-radius: var(--radius-sm); }
.field-highlight input, .field-highlight textarea, .field-highlight select { border-color: var(--accent); }

/* ---------- Validation panel (Zone E) ---------- */
.validation-wrap { max-width: 900px; margin: 0 auto; width: 100%; }
.issue-group-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.issue-group-title.errors { color: var(--danger); }
.issue-group-title.warnings { color: var(--amber); }
.issue-row {
    text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer;
    display: flex; gap: 12px; padding: 13px 15px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 9px;
}
.issue-row:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.issue-row:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.issue-row .sev { font-size: 17px; flex: none; line-height: 1.3; }
.issue-row.error .sev { color: var(--danger); }
.issue-row.warning .sev { color: var(--amber); }
.issue-row .issue-main { min-width: 0; flex: 1 1 auto; }
.issue-row .issue-code { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.issue-row .issue-msg { font-weight: 600; margin: 2px 0; }
.issue-row .issue-loc { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); word-break: break-all; }
.issue-row .issue-go { align-self: center; color: var(--text-3); }
.validation-empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.validation-empty .big { font-size: 44px; color: var(--success); }

/* ---------- Guided wizard (Zone D) ---------- */
.wizard-wrap { max-width: 860px; margin: 0 auto; width: 100%; }
.stepper { display: flex; align-items: center; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.step-chip { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--surface-3); color: var(--text-3); font-weight: 650; font-size: 12.5px; }
.step-chip .num { width: 20px; height: 20px; border-radius: 999px; background: var(--border-strong); color: var(--surface); display: grid; place-items: center; font-size: 11px; }
.step-chip.active { background: var(--accent-weak); color: var(--accent); }
.step-chip.active .num { background: var(--accent); color: #fff; }
.step-chip.done { color: var(--success); }
.step-chip.done .num { background: var(--success); color: #fff; }
.step-sep { color: var(--text-3); }

.radio-line { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; flex-wrap: wrap; }
.radio-opt { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; cursor: pointer; }
.radio-opt input { width: auto; }
.depth-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 4px; }
.depth-card {
    text-align: left; cursor: pointer; font: inherit; color: inherit;
    border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
    padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.depth-card:hover { border-color: var(--accent); }
.depth-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-weak); }
.depth-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.depth-card .d-name { font-weight: 700; }
.depth-card .d-desc { font-size: 12px; color: var(--text-3); }

.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 16px; margin-top: 6px; }
.cap-check { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; font-weight: 500; cursor: pointer; }
.cap-check input { width: auto; }

.cred-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: var(--surface-2); }
.cred-opt { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cred-scoped-note { font-size: 11.5px; color: var(--amber); font-weight: 600; }

.readiness {
    margin: 16px 0; padding: 12px 15px; border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 10px; font-weight: 600;
    background: var(--success-weak); color: var(--success);
    border: 1px solid color-mix(in srgb, var(--success) 25%, transparent);
}
.readiness.blocked { background: var(--amber-weak); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.readiness .req-list { font-weight: 500; color: inherit; }
.wizard-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.wizard-actions .spacer { flex: 1 1 auto; }

/* probe monitor */
.monitor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.monitor-head .spinner { color: var(--accent); }
.monitor-title { font-weight: 700; }
.monitor-progress { font-size: 13px; color: var(--text-2); }
.monitor-head .spacer { flex: 1 1 auto; }
.probe-status-chip {
    display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px;
    border: 1px solid #cfe5f5; border-radius: 999px; color: var(--accent);
    background: var(--accent-weak); font-size: 11px; font-weight: 750;
}
.probe-status-chip.complete {
    color: var(--success); border-color: #b5e2c2; background: var(--success-weak);
}
.probe-status-chip.failed {
    color: var(--danger); border-color: #efc4ba; background: var(--danger-weak);
}
.probe-status-chip.stopped {
    color: var(--amber); border-color: #ead18a; background: var(--amber-weak);
}
.cap-rows { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 12px 0; }
.cap-row {
    display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center;
    padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.cap-row:last-child { border-bottom: none; }
.cap-row .cap-glyph { font-size: 16px; text-align: center; }
.cap-row .cap-name { font-weight: 600; }
.cap-row .cap-reason { font-size: 12px; color: var(--text-3); }
.cap-row .cap-outcome { display: flex; align-items: center; gap: 7px; justify-self: end; font-weight: 650; font-size: 12.5px; }
.cap-row.state-accepted .cap-glyph, .cap-row.state-accepted .cap-outcome { color: var(--success); }
.cap-row.state-rejected .cap-glyph, .cap-row.state-rejected .cap-outcome { color: var(--danger); }
.cap-row.state-unreachable .cap-glyph, .cap-row.state-unreachable .cap-outcome { color: var(--amber); }
.cap-row.state-fixture_invalid .cap-glyph, .cap-row.state-fixture_invalid .cap-outcome { color: var(--amber); }
.cap-row.state-inconclusive .cap-glyph, .cap-row.state-inconclusive .cap-outcome { color: var(--text-2); }
.cap-row.state-running .cap-glyph, .cap-row.state-running .cap-outcome { color: var(--accent); }
.cap-row.state-pending .cap-glyph, .cap-row.state-pending .cap-outcome { color: var(--text-3); }
.promotable-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 6px; border-radius: 4px; background: var(--accent-weak); color: var(--accent); }

.terminal-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 13px 15px; border-radius: var(--radius-sm); margin: 12px 0;
    border: 1px solid var(--border);
}
.terminal-banner.complete { background: var(--success-weak); color: var(--success); }
.terminal-banner.failed { background: var(--danger-weak); color: var(--danger); }
.terminal-banner.stopped { background: var(--amber-weak); color: var(--amber); }
.terminal-banner-copy strong,
.terminal-banner-copy span { display: block; }
.terminal-banner-copy strong { font-size: 13.5px; }
.terminal-banner-copy span { margin-top: 2px; font-size: 12px; font-weight: 500; }
.probe-outcome-tally { display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.outcome-tally-item {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px;
    border: 1px solid currentColor; border-radius: 999px; background: rgba(255, 255, 255, .62);
    font-size: 10px; font-weight: 750; white-space: nowrap;
}
.outcome-tally-item.state-accepted { color: var(--success); }
.outcome-tally-item.state-rejected { color: var(--danger); }
.outcome-tally-item.state-unreachable,
.outcome-tally-item.state-fixture_invalid { color: var(--amber); }
.outcome-tally-item.state-inconclusive { color: var(--text-2); }
.outcome-tally-item.state-running { color: var(--accent); }
.outcome-tally-item.state-pending { color: var(--text-3); }
.summary-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin: 10px 0; }
.summary-block h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 8px; }
.summary-line { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.dryrun-note { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 14px 16px; color: var(--text-2); }
.applied-line { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--success); margin: 10px 0; }
.probe-apply-guard {
    display: flex; align-items: flex-start; flex-direction: column; gap: 2px;
    margin: 12px 0; padding: 12px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-2); background: var(--surface-2);
}
.probe-apply-guard strong { color: var(--text); font-size: 13px; }
.probe-apply-guard span { font-size: 12px; }
.probe-apply-guard.failed {
    color: var(--danger); border-color: #efc4ba; background: var(--danger-weak);
}
.probe-apply-guard.failed strong { color: var(--danger); }
.probe-apply-guard.stopped {
    color: var(--amber); border-color: #ead18a; background: var(--amber-weak);
}
.probe-apply-guard.stopped strong { color: var(--amber); }

/* ---------- Launcher ---------- */
.launcher-wrap { max-width: 720px; margin: 40px auto; width: 100%; padding: 0 20px; }
.launcher-hero { text-align: center; margin-bottom: 26px; }
.launcher-hero .mark {
    display: block; width: 54px; height: 54px; object-fit: contain;
    border: 1px solid var(--border); border-radius: 12px; margin: 0 auto 14px; background: #fff;
}
.launcher-hero h1 { font-size: 24px; }
.launcher-hero p { color: var(--text-2); margin-top: 6px; }
.yaml-source-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.yaml-source-tabs .btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.launcher-error { margin-top: 12px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--danger-weak); color: var(--danger); font-weight: 600; }

/* ---------- Recovery (§3.10) ---------- */
.recovery-wrap { max-width: 640px; margin: 80px auto; width: 100%; padding: 0 20px; }
.recovery-card { text-align: center; padding: 32px; }
.recovery-card .warn-mark { font-size: 42px; color: var(--amber); }
.recovery-card h1 { font-size: 21px; margin: 12px 0; }
.recovery-card p { color: var(--text-2); }

/* ---------- Dialog ---------- */
.dialog-backdrop {
    position: fixed; inset: 0; z-index: 100; background: rgba(10, 16, 24, 0.5);
    display: grid; place-items: center; padding: 20px;
    animation: fade-in .12s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); max-width: 460px; width: 100%; padding: 22px;
}
.dialog h2 { font-size: 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 9px; }
.dialog .dialog-icon { font-size: 20px; }
.dialog.danger .dialog-icon { color: var(--danger); }
.dialog.warn .dialog-icon { color: var(--amber); }
.dialog p { color: var(--text-2); }
.dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dialog pre.yaml-out {
    max-height: 320px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px; font-size: 12px; white-space: pre-wrap; word-break: break-word;
}

/* ---------- Lossless record dialog (Task 7) ---------- */
.record-dialog-backdrop {
    padding: 16px;
    background: rgba(10, 16, 24, .62);
}
.record-dialog {
    display: flex; flex-direction: column; min-height: 0;
    width: min(1040px, 100%); max-height: calc(100vh - 32px);
    overflow: hidden; background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: var(--shadow-lg);
}
.record-dialog-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
    padding: 21px 24px 17px; border-bottom: 1px solid var(--border);
}
.record-dialog-header h2 { margin: 2px 0 4px; font-size: 21px; }
.record-dialog-header p { max-width: 720px; margin: 0; color: var(--text-2); }
.record-dialog-close { flex: none; min-width: 38px; justify-content: center; padding: 9px; }
.record-editor-tabs {
    display: flex; align-items: center; gap: 4px; padding: 0 24px;
    border-bottom: 1px solid var(--border); background: #fafbfc;
}
.record-editor-tab {
    position: relative; padding: 13px 12px 11px; color: var(--text-2);
    border: 0; background: transparent; font: inherit; font-weight: 650; cursor: pointer;
}
.record-editor-tab::after {
    position: absolute; right: 10px; bottom: -1px; left: 10px; height: 2px;
    content: ''; background: transparent;
}
.record-editor-tab:hover { color: var(--text); }
.record-editor-tab.active { color: var(--accent); }
.record-editor-tab.active::after { background: var(--accent); }
.record-editor-tab:focus-visible {
    outline: none; border-radius: 6px; box-shadow: 0 0 0 3px var(--accent-ring);
}
.record-dialog-scroll {
    flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain;
    padding: 22px 24px 28px;
}
.record-dialog-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 14px 24px; border-top: 1px solid var(--border); background: #fafbfc;
}
.record-dialog-footer-copy { min-width: 0; color: var(--text-2); font-size: 12px; }
.record-dialog-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.invalid-save-copy { color: var(--danger); font-weight: 650; }
.record-sections { display: flex; flex-direction: column; gap: 18px; }
.record-section {
    padding: 18px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface);
}
.record-section-heading { margin-bottom: 16px; }
.record-section-heading h3 { font-size: 15px; }
.record-section-heading p {
    max-width: 760px; margin: 3px 0 0; color: var(--text-2); font-size: 12.5px;
}
.record-section-fields {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px;
}
.record-field { min-width: 0; }
.record-field label { margin-bottom: 6px; }
.record-field textarea:not(.code) { min-height: 82px; resize: vertical; }
.record-field-wide { grid-column: 1 / -1; }
.optional-object-field {
    padding: 14px; border: 1px solid var(--border); border-radius: 9px;
    background: #fafbfc;
}
.optional-object-heading {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
}
.optional-object-label { display: block; font-size: 12.5px; font-weight: 700; }
.optional-object-toggle {
    display: inline-flex; align-items: center; gap: 8px; flex: none; margin: 0;
    color: var(--text); cursor: pointer;
}
.optional-object-toggle input { width: auto; margin: 0; }
.optional-object-fields {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.optional-object-inherited {
    margin: 10px 0 0; padding: 10px 12px; color: var(--text-2);
    border: 1px dashed var(--border-strong); border-radius: 7px; background: var(--surface);
    font-size: 12px;
}
.required-mark { color: var(--danger); }
.record-field.has-error {
    padding: 10px; border: 1px solid #efc4ba; border-radius: 8px;
    background: #fff9f7;
}
.record-field-errors { margin-top: 7px; color: var(--danger); font-size: 11.5px; }
.record-field-errors p { margin: 3px 0 0; }
.record-derived-label {
    display: block; margin-bottom: 6px; font-size: 12px; font-weight: 650;
}
.record-derived-value {
    display: flex; align-items: center; min-height: 40px; padding: 9px 11px;
    color: var(--text); border: 1px solid #c8dded; border-radius: 8px;
    background: var(--accent-weak); font-weight: 750;
}
.record-derived-value.unavailable {
    color: var(--text-2); border-color: var(--border); background: var(--surface-2);
    font-weight: 600;
}
.boolean-field {
    display: flex; align-items: flex-start; gap: 10px; min-height: 56px; margin: 0;
    padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); background: #fafbfc; cursor: pointer;
}
.boolean-field:hover { border-color: var(--border-strong); }
.boolean-field input { width: auto; margin: 3px 0 0; flex: none; }
.boolean-field strong { display: block; color: var(--text); font-size: 12.5px; }
.boolean-help {
    display: block; margin-top: 2px; color: var(--text-3); font-size: 11.5px;
    font-weight: 450;
}
.record-field-label-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 5px;
}
.record-field-label-row label { margin: 0; }
.key-value-editor, .list-value-editor {
    display: flex; flex-direction: column; gap: 7px; margin-top: 10px;
}
.key-value-row {
    display: grid; grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr) auto;
    align-items: center; gap: 8px;
}
.list-value-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
}
.key-value-row .btn, .list-value-row .btn { padding: 9px; }
.record-empty-value { margin: 9px 0 0; color: var(--text-3); font-size: 12px; }
.complex-record-field > .record-field-label-row {
    padding-bottom: 7px; border-bottom: 1px solid var(--border);
}
.object-row-editor, .quality-axis-editor, .capability-claim-editor {
    display: flex; flex-direction: column; gap: 11px; margin-top: 11px;
}
.object-editor-row, .quality-axis-row, .capability-claim-row {
    position: relative; min-width: 0; margin: 0; padding: 15px;
    border: 1px solid var(--border); border-radius: 9px; background: #fafbfc;
}
.object-editor-row legend, .quality-axis-row legend, .capability-claim-row legend {
    max-width: calc(100% - 24px); padding: 0 6px; overflow: hidden;
    color: var(--text-2); font-size: 11.5px; font-weight: 750;
    text-overflow: ellipsis; white-space: nowrap;
}
.object-editor-fields {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.object-editor-field { min-width: 0; }
.object-editor-field label {
    display: block; margin-bottom: 5px; color: var(--text-2); font-size: 11px;
}
.object-row-remove { margin-top: 10px; }
.quality-axis-grid {
    display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px;
}
.capability-claim-grid {
    display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(2, minmax(150px, 1fr));
    gap: 10px;
}
.capability-evidence-editor, .capability-detail-editor {
    margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--border);
}
.capability-detail-editor > label {
    display: block; margin-bottom: 6px; font-size: 12px; font-weight: 650;
}
.capability-detail-json {
    min-height: 145px; max-height: 320px; resize: vertical; font-size: 11.5px;
}
.asset-record-field { min-width: 0; }
.asset-picker {
    display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: start; gap: 12px;
}
.asset-picker-preview {
    display: grid; place-items: center; width: 58px; height: 58px; overflow: hidden;
    color: var(--text-3); border: 1px solid var(--border); border-radius: 9px;
    background:
        linear-gradient(45deg, #f2f4f6 25%, transparent 25%) 0 0 / 12px 12px,
        linear-gradient(-45deg, #f2f4f6 25%, transparent 25%) 0 6px / 12px 12px,
        linear-gradient(45deg, transparent 75%, #f2f4f6 75%) 6px -6px / 12px 12px,
        linear-gradient(-45deg, transparent 75%, #f2f4f6 75%) -6px 0 / 12px 12px,
        #fff;
    font-size: 18px; font-weight: 750;
}
.asset-picker-preview img { display: block; width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.asset-picker-control { min-width: 0; }
.asset-upload { margin-top: 9px; }
.asset-upload .hint { margin-top: 5px; }
.asset-upload-error { margin: 6px 0 0; color: var(--danger); font-size: 11.5px; }
.record-json-panel { max-width: 900px; margin: 0 auto; }
.record-json-textarea { min-height: 440px; max-height: calc(100vh - 330px); }
.json-parse-error.is-empty { display: none; }
.record-save-feedback, .record-dialog-warning {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    margin: 14px 24px 0; padding: 12px 14px; border: 1px solid var(--border);
    border-radius: 9px;
}
.record-save-feedback strong, .record-dialog-warning strong { display: block; }
.record-save-feedback p, .record-dialog-warning p { margin: 2px 0 0; font-size: 12px; }
.record-save-feedback.invalid {
    display: block; color: var(--danger); border-color: #efc4ba; background: var(--danger-weak);
}
.record-save-feedback.error {
    display: block; color: var(--danger); border-color: #efc4ba; background: var(--danger-weak);
}
.record-dialog-warning { color: var(--amber); border-color: #ead18a; background: var(--amber-weak); }
.record-dialog-warning-actions { display: flex; align-items: center; gap: 7px; flex: none; }
.record-validation-summary {
    display: grid; gap: 5px; max-height: 170px; margin: 10px 0 0; padding-left: 19px;
    overflow: auto; color: var(--danger); font-size: 12px;
}
.record-validation-summary code { display: inline-block; margin-left: 7px; font-size: 10.5px; }
.delete-preflight-dialog { width: min(780px, 100%); }
.delete-preflight-body { padding-top: 18px; }
.delete-scope-callout {
    margin-bottom: 16px; padding: 13px 14px; color: var(--danger);
    border: 1px solid #efc4ba; border-radius: 9px; background: #fff9f7;
}
.delete-scope-callout strong { display: block; }
.delete-scope-callout p { margin: 3px 0 0; color: var(--text-2); font-size: 12.5px; }
.dependency-loading {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 250px; color: var(--text-2);
}
.dependency-loading strong { display: block; color: var(--text); }
.dependency-loading p { margin: 2px 0 0; }
.dependency-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dependency-group {
    min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 9px;
    background: #fafbfc;
}
.dependency-group-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 9px;
    margin-bottom: 9px;
}
.dependency-group-heading h3 { font-size: 13px; }
.dependency-group ul {
    display: flex; flex-direction: column; gap: 7px; max-height: 250px;
    margin: 0; padding: 0; overflow: auto; list-style: none;
}
.dependency-group li {
    min-width: 0; padding-bottom: 7px; border-bottom: 1px solid var(--border);
}
.dependency-group li:last-child { padding-bottom: 0; border-bottom: 0; }
.dependency-group li code {
    display: block; overflow: hidden; color: var(--text); font-size: 11px;
    text-overflow: ellipsis; white-space: nowrap;
}
.dependency-group li span { display: block; margin-top: 2px; color: var(--text-3); font-size: 10.5px; }
.dependency-group li .dependency-advisory { color: var(--amber); font-weight: 600; }
.dependency-repair { width: 100%; margin-top: 7px; justify-content: center; }

/* ---------- Toast ---------- */
.toast-region {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    background: var(--text); color: var(--surface);
    padding: 11px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    font-weight: 600; display: flex; align-items: center; gap: 9px; max-width: 480px;
    animation: toast-in .18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.warn { background: var(--amber); color: #14202c; }

/* ---------- Spinner ---------- */
.spinner {
    display: inline-block; width: 15px; height: 15px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent; vertical-align: -2px;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Discover: panel + neutral per-field verdict notes ---------- */
/* The panel expands in place at the top of record-dialog-scroll, above the first section. */
/* The Discover panel is step 1 of the Discover & Probe wizard. `.discover-step-slot` is the wizard
   field that holds it; the panel keeps its own tinted card so the run still reads as a distinct
   phase of the step rather than as more form. */
.discover-step-slot { margin-bottom: 16px; }
.discover-step-slot > .discover-panel { margin-bottom: 0; }
.discover-step-slot > label {
    display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 650;
}

/* Target and credential, restated on the Depth step — settled a step earlier, not re-asked. */
.wizard-target-summary .wizard-summary-line {
    margin: 0 0 4px; font-size: 13px;
}
.wizard-target-summary .wizard-summary-line strong { font-family: var(--font-mono); }
.wizard-target-summary .wizard-summary-line .hint { font-size: 12.5px; }

.discover-panel {
    margin-bottom: 18px; padding: 16px 18px 18px;
    border: 1px solid #c8dded; border-radius: 10px; background: var(--accent-weak);
    animation: discover-expand .16s ease;
}
@keyframes discover-expand { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.discover-panel-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
}
.discover-panel-head h3 { font-size: 15px; }
.discover-panel-head h3:focus-visible {
    outline: none; border-radius: 6px; box-shadow: 0 0 0 3px var(--accent-ring);
}
.discover-panel-close { flex: none; min-width: 32px; justify-content: center; padding: 6px; }
.discover-target {
    margin: 3px 0 0; color: var(--text-2); font-size: 12.5px; font-family: var(--font-mono);
}
.discover-body { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.discover-field { display: flex; flex-direction: column; }
.discover-field-label { margin-bottom: 6px; font-size: 12.5px; font-weight: 650; }
/* The widget renders an inline trigger; its option list is a fixed-position top-layer popover, so
   it is never clipped by record-dialog-scroll and needs no fixed-height wrapper here. */
.discover-picker krista-model-select { display: block; width: 100%; max-width: 460px; }
.discover-picker .hint { margin-top: 5px; }
.discover-overwrite {
    margin: 0; padding: 10px 12px; color: var(--amber); font-size: 12px; font-weight: 600;
    border: 1px solid #e8d59a; border-radius: 7px; background: var(--amber-weak);
}
.discover-empty { margin: 0; color: var(--text-2); }
.discover-loading { margin: 14px 0 0; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.discover-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.discover-error {
    margin: 0; padding: 10px 12px; color: var(--danger); font-size: 12.5px; font-weight: 600;
    border: 1px solid #efc4ba; border-radius: 7px; background: var(--danger-weak);
}
.discover-notice {
    margin: 0; padding: 10px 12px; color: var(--text-2); font-size: 12.5px;
    border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface);
}
.discover-status { margin: 0; }
.discover-status-line { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.discover-status .spinner { color: var(--accent); }
.discover-phase { margin: 6px 0 0; color: var(--text-2); font-size: 12px; }
.discover-phase-label { font-weight: 650; text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; }
.discover-summary-line { margin: 0; font-size: 14.5px; }
.discover-summary-line:focus-visible {
    outline: none; border-radius: 6px; box-shadow: 0 0 0 3px var(--accent-ring);
}
.discover-summary-sub { margin: 4px 0 0; color: var(--text-2); font-size: 12.5px; }
.discover-groups, .discover-group-verdicts { margin: 0; padding: 0; list-style: none; }
.discover-group-row, .discover-group-verdict {
    display: flex; align-items: baseline; gap: 12px; padding: 5px 0;
    border-top: 1px solid #c8dded; font-size: 12.5px;
}
.discover-group-name { flex: none; min-width: 92px; font-weight: 650; }
.discover-group-counts, .discover-group-verdict-text { color: var(--text-2); }

/* The neutral verdict note. Deliberately shares NOTHING with .record-field-errors: no danger
   token, no background fill, no alert semantics. FOUND is a solid accent rule; NOT FOUND and
   NOT LICENSED are dotted neutral rules. */
.record-field-note {
    margin: 7px 0 0; padding-left: 9px; color: var(--text-2); font-size: 11.5px;
    border-left: 2px solid transparent;
}
.record-field-note[data-verdict="found"] { border-left-style: solid; border-left-color: var(--accent); }
.record-field-note[data-verdict="not-found"] { border-left-style: dotted; border-left-color: var(--border-strong); }
.record-field-note[data-verdict="not-licensed"] { border-left-style: dotted; border-left-color: var(--border-strong); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .spinner { animation: none; border-right-color: currentColor; opacity: .6; }
    /* The panel appears without motion; the running spinner degrades to a static glyph beside the
       word "Discovering", which the status line already carries. */
    .discover-panel { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .providers-models-filters {
        grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr));
    }
    .filter-search { grid-column: span 2; }
}

@media (max-width: 900px) {
    .session-header {
        position: static; grid-template-columns: 1fr auto; gap: 14px;
        padding-top: 14px; padding-bottom: 14px;
    }
    .header-status { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
    .records-layout { grid-template-columns: 1fr; }
    .record-list { max-height: 240px; }
    .depth-cards { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
    .entity-nav { display: grid; max-width: none; overflow-x: auto; }
    .catalog-heading { flex-direction: column; }
    .catalog-heading-actions { padding-top: 0; }
    .providers-models-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-search { grid-column: 1 / -1; }
    .workspace-notice { align-items: flex-start; }
    .record-section-fields { grid-template-columns: 1fr; }
    .record-field-wide { grid-column: auto; }
    .quality-axis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .capability-claim-grid { grid-template-columns: 1fr; }
    .dependency-groups { grid-template-columns: 1fr; }
    .dependency-group ul { max-height: 160px; }
    .deployment-invalid-notice { align-items: flex-start; flex-direction: column; }
    .deployment-invalid-notice .btn { width: 100%; justify-content: center; }
    .profile-default-card { align-items: start; }
    .optional-object-fields { grid-template-columns: 1fr; }
    .evidence-workspace { grid-template-columns: 1fr; }
    .evidence-list-panel { border-right: 0; border-bottom: 1px solid var(--border); }
    .evidence-list { max-height: 340px; }
}

@media (max-width: 650px) {
    .editor-main { padding: 16px 12px 28px; }
    .session-header { display: flex; align-items: flex-start; flex-direction: column; }
    .header-identity { width: 100%; justify-content: space-between; }
    .workspace-context { margin-left: auto; }
    .header-status { width: 100%; align-items: flex-start; flex-direction: column; gap: 10px; }
    .session-facts { flex-wrap: wrap; gap: 10px 18px; }
    .session-header .header-actions { width: 100%; }
    .session-header .header-actions .btn { flex: 1 1 auto; justify-content: center; }
    .entity-nav {
        grid-template-columns: repeat(4, minmax(132px, 1fr));
        width: 100%; margin-bottom: 14px; border-radius: 10px;
    }
    .entity-tab { min-height: 58px; padding: 8px 12px; }
    .catalog-heading { padding: 20px; }
    .catalog-heading-actions { width: 100%; flex-wrap: wrap; }
    .catalog-heading-actions .btn { flex: 1 1 auto; justify-content: center; }
    .entity-summary-row {
        grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px;
    }
    .entity-summary-row .btn { grid-column: 2 / -1; justify-content: center; }
    .compatibility-head { align-items: flex-start; padding: 15px 16px; }
    .catalog-state.empty, .catalog-state.error { align-items: flex-start; flex-direction: column; }
    .providers-models-body { padding: 14px; }
    .providers-models-filters { grid-template-columns: 1fr; padding: 12px; }
    .filter-search { grid-column: auto; }
    .filter-clear { width: 100%; }
    .workspace-notice, .unmatched-models-head {
        align-items: flex-start; flex-direction: column;
    }
    .deployment-toolbar { align-items: stretch; flex-direction: column; gap: 8px; padding: 14px; }
    .deployment-result-count { padding: 0; }
    .deployment-table-wrap { width: calc(100% - 28px); margin: 0 14px 14px; }
    .deployment-loading { padding: 20px 14px; }
    .deployment-skeleton-row { grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; }
    .deployment-skeleton-row .deployment-skeleton-value { display: none; }
    .profile-default-card {
        grid-template-columns: auto minmax(0, 1fr); margin: 14px; padding: 15px;
    }
    .profile-window-large { grid-column: 2; }
    .profile-empty { margin: 0 14px; }
    .profile-toolbar { align-items: stretch; flex-direction: column; gap: 8px; padding: 14px; }
    .profile-result-count { padding: 0; }
    .profile-table-wrap { width: calc(100% - 28px); margin: 0 14px 14px; }
    .profile-loading { padding: 20px 14px; }
    .profile-skeleton-row { grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; }
    .profile-skeleton-row .profile-skeleton-window { display: none; }
    .optional-object-heading { flex-direction: column; gap: 10px; }
    .optional-object-toggle { align-items: flex-start; }
    .evidence-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
    .evidence-result-count { padding: 0; }
    .evidence-detail-panel { padding: 18px 16px 22px; }
    .evidence-detail-grid { grid-template-columns: 1fr; }
    .evidence-list-row { grid-template-columns: 1fr auto; }
    .evidence-list-row > .evidence-result { grid-column: 1 / -1; justify-self: start; }
    .terminal-banner { align-items: flex-start; flex-direction: column; }
    .probe-outcome-tally { justify-content: flex-start; }
    .workspace-notice .btn { width: 100%; justify-content: center; }
    .providers-models-result-count { text-align: left; }
    .provider-skeleton-row { grid-template-columns: 42px minmax(0, 1fr); }
    .provider-skeleton-row .skeleton-chip { display: none; }
    .record-dialog-backdrop { place-items: stretch; padding: 0; }
    .record-dialog {
        width: 100%; max-height: 100vh; border: 0; border-radius: 0;
    }
    .record-dialog-header { gap: 12px; padding: 17px 16px 14px; }
    .record-dialog-header h2 { font-size: 19px; }
    .record-editor-tabs { padding: 0 8px; }
    .record-editor-tab { flex: 1 1 50%; text-align: center; }
    .record-dialog-scroll { padding: 16px 12px 22px; }
    .record-dialog-footer {
        align-items: stretch; flex-direction: column; gap: 9px; padding: 11px 12px;
    }
    .record-dialog-actions { width: 100%; }
    .record-dialog-actions .btn { flex: 1 1 50%; justify-content: center; }
    .record-section { padding: 14px 12px; }
    .provider-models-head { align-items: flex-start; flex-direction: column; }
    .provider-models-head .btn { width: 100%; justify-content: center; }
    .key-value-row { grid-template-columns: minmax(0, 1fr) auto; }
    .key-value-row input:nth-child(2) { grid-column: 1; }
    .key-value-row .btn { grid-column: 2; grid-row: 1 / span 2; }
    .object-editor-fields, .quality-axis-grid { grid-template-columns: 1fr; }
    .object-editor-row, .quality-axis-row, .capability-claim-row { padding: 12px 10px; }
    .record-save-feedback, .record-dialog-warning {
        align-items: stretch; flex-direction: column; margin: 10px 12px 0;
    }
    .record-dialog-warning-actions { width: 100%; }
    .record-dialog-warning-actions .btn { flex: 1 1 50%; justify-content: center; }
    .record-json-textarea { min-height: 55vh; max-height: none; }
}

/* ---- Deprecation review (catalog-wide lifecycle sweep + review list) ---- */
/* Deliberately NOT accent-tinted like .discover-panel: Discover fills in a record you are already
   editing, whereas this reviews risk across the whole catalog. The amber edge carries that without
   shouting — the alarming colours are reserved for the two states that have earned them (a model
   the provider says is gone, and two sources that disagree). */
.deprecation-panel {
    margin-bottom: 18px; padding: 16px 18px 18px;
    border: 1px solid var(--border-strong); border-left: 4px solid var(--amber);
    border-radius: 10px; background: var(--surface);
    animation: discover-expand .16s ease;
}
.deprecation-panel-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
}
.deprecation-panel-head h2 { font-size: 16px; }
.deprecation-panel-head h2:focus-visible {
    outline: none; border-radius: 6px; box-shadow: 0 0 0 3px var(--accent-ring);
}
.deprecation-panel-close { flex: none; min-width: 32px; justify-content: center; padding: 6px; }

.deprecation-setup { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.deprecation-lede { margin: 0; color: var(--text-2); font-size: 13px; max-width: 68ch; }
.deprecation-field { display: flex; flex-direction: column; }
.deprecation-field-label { margin-bottom: 6px; font-size: 12.5px; font-weight: 650; }
.deprecation-field select, .deprecation-field input { max-width: 460px; }
.deprecation-toggle { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; }
.deprecation-toggle .hint { display: block; margin-top: 2px; }
.deprecation-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.deprecation-loading { margin: 14px 0 0; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.deprecation-empty { margin: 14px 0 0; color: var(--text-2); }
.deprecation-body { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }

.deprecation-status-line {
    margin: 0; display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 650;
}
.deprecation-status .spinner { color: var(--accent); }

.deprecation-error {
    padding: 11px 13px; border: 1px solid var(--danger); border-radius: var(--radius-sm);
    background: var(--danger-weak);
}
.deprecation-error strong { display: block; }
.deprecation-error p { margin: 4px 0 9px; }
.deprecation-notice {
    padding: 11px 13px; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); background: var(--surface-2);
}
.deprecation-notice.warn { border-color: var(--amber); background: var(--amber-weak); }
.deprecation-notice strong { display: block; }
.deprecation-notice p { margin: 4px 0 0; font-size: 12.5px; }

.deprecation-warnings { font-size: 12.5px; }
.deprecation-warnings summary { cursor: pointer; color: var(--text-2); font-weight: 650; }
.deprecation-warnings ul { margin: 7px 0 0; padding-left: 20px; color: var(--text-2); }
.deprecation-warnings li { margin-bottom: 3px; }

.deprecation-clean p { margin: 0 0 9px; }

/* The table owns its own horizontal scroll so the page body never does. */
.deprecation-table-wrap { overflow-x: auto; }
.deprecation-table {
    width: 100%; min-width: 940px; border-spacing: 0; border-collapse: separate; color: var(--text);
}
.deprecation-table th[scope="col"] {
    padding: 10px 12px; color: var(--text-2); background: var(--surface-2);
    border-bottom: 1px solid var(--border); font-size: 10.5px; font-weight: 800;
    letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.deprecation-table th[scope="row"] {
    padding: 12px; text-align: left; vertical-align: top; font-weight: 600;
    border-bottom: 1px solid #e8ebee;
}
.deprecation-table th[scope="row"] code { font-family: var(--font-mono); font-size: 12.5px; }
.deprecation-table td {
    padding: 12px; vertical-align: top; border-bottom: 1px solid #e8ebee; font-size: 12.5px;
}
.deprecation-provider { display: block; margin-top: 3px; color: var(--text-3); font-size: 11px; font-weight: 500; }
.deprecation-row.resolved { opacity: .62; }

/* Liveness. The three states that mean different things look different, and UNREACHABLE never
   borrows ABSENT's colour: "we could not ask" must not read as "the vendor said no". */
.deprecation-liveness { display: flex; flex-direction: column; gap: 3px; }
.deprecation-liveness-label { font-weight: 700; }
.deprecation-liveness-detail, .deprecation-unreachable-reason {
    color: var(--text-2); font-size: 11.5px;
}
.deprecation-row[data-liveness="ABSENT"] .deprecation-liveness-label { color: var(--danger); }
.deprecation-row[data-liveness="ALIVE"] .deprecation-liveness-label { color: var(--success); }
.deprecation-row[data-liveness="UNREACHABLE"] .deprecation-liveness-label { color: var(--text-2); }
.deprecation-row[data-liveness="UNREACHABLE"] .deprecation-unreachable-reason {
    margin-top: 2px; padding-left: 8px; border-left: 2px dotted var(--border-strong);
    font-family: var(--font-mono); font-size: 11px;
}
.deprecation-row[data-liveness="NOT_CHECKED"] .deprecation-liveness-label { color: var(--text-3); }

.deprecation-proposal { display: flex; flex-direction: column; gap: 3px; }
.deprecation-transition { font-weight: 700; }
.deprecation-note { color: var(--text-2); }
.deprecation-proposal .hint { margin-top: 2px; }

.deprecation-evidence { display: flex; flex-direction: column; gap: 3px; }
.deprecation-confidence { color: var(--text-2); }
.deprecation-row[data-confidence="HIGH"] .deprecation-confidence { color: var(--success); font-weight: 650; }
.deprecation-citation { color: var(--text-3); font-size: 11px; word-break: break-all; }
.deprecation-citation.none { font-style: italic; }
/* A conflict is not a weaker recommendation, so it does not look like one. */
.deprecation-conflict {
    padding: 6px 8px; border-left: 3px solid var(--amber); background: var(--amber-weak);
    border-radius: 4px; color: #4d3800; font-weight: 600;
}

.deprecation-row-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.deprecation-resolved { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; }
.deprecation-resolved.confirmed { color: var(--success); }
.deprecation-resolved.dismissed { color: var(--text-3); }

@media (max-width: 720px) {
    .deprecation-panel { padding: 13px 14px 15px; }
    .deprecation-actions { justify-content: flex-start; flex-wrap: wrap; }
}
