/* Components: buttons, cards, badges, forms, tables, menus, dialogs, toasts, charts. */

.ico { flex: none; vertical-align: -0.15em; }
.spin { animation: spin 0.8s linear infinite; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg); color: var(--fg); font-size: 13px; font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background-color 120ms var(--ease), border-color 120ms var(--ease), transform 120ms var(--ease), opacity 120ms var(--ease);
}
.btn:hover:not(:disabled) { background: var(--muted); border-color: var(--border-strong); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 88%, var(--bg)); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: var(--muted); border-color: transparent; }
.btn.danger { color: var(--bad-fg); }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.danger.solid:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 88%, #000); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.icon { width: 32px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn .caret { opacity: 0.6; margin-right: -2px; }
.link { color: var(--fg); font-weight: 550; text-decoration: underline; text-decoration-color: var(--muted-2); text-underline-offset: 3px; transition: text-decoration-color 120ms var(--ease); }
.link:hover { text-decoration-color: var(--fg); }

/* ---- cards ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0; }
.card-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.card-desc { font-size: 12.5px; color: var(--muted-fg); margin-top: 2px; }
.card-body { padding: 14px 16px 16px; }
.card-body.flush { padding: 0; }
.card-head + .card-body.flush { margin-top: 14px; border-top: 1px solid var(--border); }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; color: var(--muted-fg); font-size: 12.5px; }
a.card, .card.link-card { transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease), transform 140ms var(--ease); }
a.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 1180px) { .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 16px; align-content: start; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---- stat cards ---- */
.stat { padding: 14px 16px; display: grid; gap: 6px; position: relative; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted-fg); font-size: 12.5px; font-weight: 500; }
.stat-icon { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--muted); color: var(--fg-2); }
.stat.tone-good .stat-icon { background: var(--good-soft); color: var(--good-fg); }
.stat.tone-warn .stat-icon { background: var(--warn-soft); color: var(--warn-fg); }
.stat.tone-bad .stat-icon { background: var(--bad-soft); color: var(--bad-fg); }
.stat.tone-info .stat-icon { background: var(--info-soft); color: var(--info-fg); }
.stat-value { font-size: 28px; line-height: 1.1; font-weight: 650; letter-spacing: -0.03em; display: flex; align-items: baseline; gap: 6px; }
.stat-value small { font-size: 14px; color: var(--muted-fg); font-weight: 500; letter-spacing: -0.01em; }
.stat-hint { font-size: 12.5px; color: var(--muted-fg); display: flex; align-items: center; gap: 6px; min-height: 18px; }

/* ---- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1;
  border: 1px solid var(--border); background: var(--muted); color: var(--fg-2); white-space: nowrap; vertical-align: middle;
}
.badge .dot, .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--idle); flex: none; display: inline-block; }
.badge.good { background: var(--good-soft); color: var(--good-fg); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.badge.good .dot { background: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn-fg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge.warn .dot { background: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad-fg); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.badge.bad .dot { background: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info-fg); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.badge.info .dot { background: var(--info); }
.badge.outline { background: transparent; }
.badge.pulse .dot { animation: pulse 1.4s ease-in-out infinite; }
.badge.sm { height: 18px; padding: 0 6px; font-size: 11px; }
@keyframes pulse { 50% { opacity: 0.3; transform: scale(0.8); } }

.kbd, kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; font-size: 11px; font-family: var(--font); color: var(--muted-fg); background: var(--bg); }
code.inline { background: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: 12px; }

/* ---- forms ---- */
.input, .select, .textarea {
  font: inherit; font-size: 13.5px; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--fg); max-width: 100%;
  box-shadow: var(--shadow-sm); transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-fg); opacity: 0.8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.select { appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.textarea { height: auto; padding: 8px 10px; width: 100%; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; resize: vertical; white-space: pre; overflow-x: auto; }
.input-icon { position: relative; display: inline-flex; align-items: center; }
.input-icon > svg { position: absolute; left: 10px; color: var(--muted-fg); pointer-events: none; }
.input-icon .input { padding-left: 32px; }
.field { display: grid; gap: 6px; align-content: start; }
.hint { font-size: 12.5px; color: var(--muted-fg); margin-top: 6px; }
.field .hint { margin-top: 0; }
.field > .label { font-size: 13px; font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--muted-fg); }
.field .err { font-size: 12.5px; color: var(--bad-fg); }
.field .input, .field .select { width: 100%; }
.form-error { color: var(--bad-fg); font-size: 13px; min-height: 1.2em; }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch-row input { accent-color: var(--accent); width: 15px; height: 15px; }

.segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--muted); border-radius: var(--radius); border: 1px solid var(--border); }
.segmented button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-fg); font-size: 12.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background-color 120ms var(--ease), color 120ms var(--ease); }
.segmented button:hover { color: var(--fg); }
.segmented button[aria-pressed="true"] { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); }
.segmented .n { font-size: 11.5px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); font-size: 12.5px; font-weight: 500; color: var(--fg-2); cursor: pointer; transition: background-color 120ms var(--ease), border-color 120ms var(--ease); }
.chip:hover { background: var(--muted); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: 0.7; }
.chip .n { color: var(--muted-fg); font-variant-numeric: tabular-nums; font-size: 11.5px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .grow { flex: 1 1 200px; }

/* ---- tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; color: var(--muted-fg); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color 120ms var(--ease); }
.tabs a:hover { color: var(--fg); }
.tabs a.active { color: var(--fg); border-bottom-color: var(--fg); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted-fg); padding: 0 14px; height: 38px; white-space: nowrap; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 55%, transparent); position: relative; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--fg); }
th .sort { display: inline-flex; margin-left: 4px; opacity: 0.35; vertical-align: -2px; }
th[aria-sort] .sort { opacity: 1; color: var(--fg); }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 100ms var(--ease); }
tbody tr:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); }
tbody tr.click { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.empty { text-align: center; color: var(--muted-fg); padding: 28px; }
tr.total td { font-weight: 600; background: var(--muted); }
.cell-main { font-weight: 550; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cell-sub { font-size: 12px; color: var(--muted-fg); }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }

/* ---- meters / rings / charts ---- */
.meter { --fill: var(--accent); height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--fill) 16%, transparent); overflow: hidden; position: relative; }
.meter > i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--fill); transition: width 500ms var(--ease); }
.meter.warn { --fill: var(--warn); }
.meter.bad { --fill: var(--bad); }
.meter.good { --fill: var(--good); }
.meter.lg { height: 8px; }
.meter-row { display: grid; gap: 5px; }
.meter-row .meter-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted-fg); }
.meter-row .meter-label b { color: var(--fg); font-weight: 550; font-variant-numeric: tabular-nums; }
.meter-multi { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--muted); }
.meter-multi i { display: block; height: 100%; flex: var(--v) 0 0; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted-fg); }
.legend a, .legend span.lg { display: inline-flex; align-items: center; gap: 6px; }
.legend a:hover { color: var(--fg); }
.legend b { color: var(--fg); font-weight: 550; font-variant-numeric: tabular-nums; }
.swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--sw, var(--idle)); flex: none; display: inline-block; }

.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .track { stroke: color-mix(in srgb, var(--fill, var(--accent)) 16%, transparent); }
.ring .val { stroke: var(--fill, var(--accent)); transition: stroke-dashoffset 600ms var(--ease); }
.ring.warn { --fill: var(--warn); }
.ring.bad { --fill: var(--bad); }
.ring.good { --fill: var(--good); }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring .ring-label b { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ring .ring-label small { font-size: 10.5px; color: var(--muted-fg); }

.spark { display: block; overflow: visible; }
.spark path.line { fill: none; stroke: var(--sw, var(--accent)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark path.area { fill: var(--sw, var(--accent)); opacity: 0.1; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--muted-fg); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--sw, var(--accent)); transition: opacity 120ms var(--ease); }
.chart .hit { fill: transparent; cursor: default; }
.chart .col.dim .bar { opacity: 0.45; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 120px; padding: 8px 10px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md); font-size: 12px; opacity: 0; transform: translateY(2px); transition: opacity 100ms var(--ease), transform 100ms var(--ease);
}
.tip.on { opacity: 1; transform: none; }
.tip b { display: block; font-weight: 600; margin-bottom: 2px; }
.tip .tip-row { display: flex; justify-content: space-between; gap: 14px; color: var(--muted-fg); }
.tip .tip-row strong { color: var(--fg); font-weight: 550; font-variant-numeric: tabular-nums; }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 160px) 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hbar .track { height: 14px; border-radius: 4px; background: transparent; position: relative; }
.hbar .track i { display: block; height: 100%; width: var(--w); background: var(--sw, var(--accent)); border-radius: 0 4px 4px 0; min-width: 2px; transition: width 500ms var(--ease); }
.hbar .val { color: var(--fg); font-variant-numeric: tabular-nums; font-weight: 550; min-width: 60px; text-align: right; }

/* ---- menus, palette, dialogs, toasts ---- */
.menu {
  position: fixed; z-index: 70; min-width: 200px; max-width: 280px; padding: 4px; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); animation: menu-in 120ms var(--ease) both; transform-origin: top right;
}
@keyframes menu-in { from { opacity: 0; transform: scale(0.97) translateY(-2px); } }
.menu button, .menu a { display: flex; align-items: center; gap: 9px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); font-size: 13.5px; cursor: pointer; text-align: left; }
.menu button:hover, .menu a:hover, .menu [data-active] { background: var(--muted); }
.menu button:disabled { opacity: 0.45; cursor: not-allowed; }
.menu .danger { color: var(--bad-fg); }
.menu .danger:hover { background: var(--bad-soft); }
.menu svg { color: var(--muted-fg); }
.menu .danger svg { color: inherit; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px -4px; }
.menu .menu-label { padding: 6px 8px 4px; font-size: 11.5px; color: var(--muted-fg); }

dialog { color: var(--fg); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--bg); box-shadow: var(--shadow-lg); width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; }
dialog.wide { width: min(720px, calc(100vw - 24px)); }
dialog[open] { animation: dialog-in 160ms var(--ease) both; }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); animation: fade 160ms var(--ease) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes fade { from { opacity: 0; } }
.dlg-head { padding: 18px 20px 0; }
.dlg-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
.dlg-head p { color: var(--muted-fg); font-size: 13px; margin-top: 4px; }
.dlg-body { padding: 14px 20px; display: grid; gap: 14px; }
.dlg-foot { padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 50%, transparent); }
.copyline { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); min-width: 0; }
.copyline code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; user-select: all; }

.cmdk { width: min(560px, calc(100vw - 24px)); margin-top: 12vh; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border-bottom: 1px solid var(--border); color: var(--muted-fg); }
.cmdk-input input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--fg); font: inherit; font-size: 14.5px; height: 100%; }
.cmdk-list { max-height: min(380px, 52vh); overflow: auto; padding: 6px; }
.cmdk-group { padding: 8px 8px 4px; font-size: 11.5px; color: var(--muted-fg); font-weight: 500; }
.cmdk-item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.cmdk-item[aria-selected="true"] { background: var(--muted); }
.cmdk-item .cmdk-sub { margin-left: auto; font-size: 12px; color: var(--muted-fg); }
.cmdk-item svg { color: var(--muted-fg); }
.cmdk-empty { padding: 28px; text-align: center; color: var(--muted-fg); }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-fg); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 90; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 13.5px; overflow-wrap: anywhere; animation: toast-in 200ms var(--ease) both; }
.toast.out { animation: toast-out 160ms var(--ease) both; }
.toast svg { margin-top: 1px; color: var(--muted-fg); }
.toast.ok svg { color: var(--good); }
.toast.error svg { color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px) scale(0.98); } }

/* ---- empty / skeleton / alerts ---- */
.empty-state { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 44px 20px; }
.empty-state .empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--muted); color: var(--muted-fg); border: 1px solid var(--border); margin-bottom: 6px; }
.empty-state h3 { font-size: 15px; font-weight: 600; }
.empty-state p { color: var(--muted-fg); max-width: 42ch; font-size: 13.5px; }
.empty-state .btn { margin-top: 10px; }
.skel { border-radius: 6px; background: linear-gradient(90deg, var(--muted) 30%, color-mix(in srgb, var(--muted-2) 70%, transparent) 50%, var(--muted) 70%) 100% 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card); }
.alert svg { margin-top: 2px; flex: none; }
.alert.bad { background: color-mix(in srgb, var(--bad) 6%, var(--card)); border-color: color-mix(in srgb, var(--bad) 30%, var(--border)); }
.alert.warn { background: color-mix(in srgb, var(--warn) 9%, var(--card)); border-color: color-mix(in srgb, var(--warn) 38%, var(--border)); }
.alert.good { background: color-mix(in srgb, var(--good) 6%, var(--card)); border-color: color-mix(in srgb, var(--good) 28%, var(--border)); }
.alert.bad > svg, .alert.bad strong, .alert.bad .alert-head svg { color: var(--bad-fg); }
.alert.warn > svg, .alert.warn strong, .alert.warn .alert-head svg { color: var(--warn-fg); }
.alert.good > svg, .alert.good strong { color: var(--good-fg); }
.alert .alert-body { flex: 1; min-width: 0; }
.alert strong { display: block; font-weight: 600; }
.alert .alert-sub { color: var(--fg-2); font-size: 13px; }

/* ---- key/value ---- */
.kv { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 10px 20px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted-fg); }
.kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---- json tree ---- */
.jt { font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.jt details { margin-left: 14px; }
.jt summary { cursor: pointer; list-style: none; margin-left: -14px; padding-left: 14px; position: relative; color: var(--muted-fg); }
.jt summary::-webkit-details-marker { display: none; }
.jt summary::before { content: ""; position: absolute; left: 2px; top: 0.55em; border: 4px solid transparent; border-left-color: var(--muted-fg); transition: transform 120ms var(--ease); transform-origin: 1px 50%; }
.jt details[open] > summary::before { transform: rotate(90deg); }
.jt .k { color: var(--accent-fg); }
.jt .s { color: var(--good-fg); }
.jt .n { color: var(--warn-fg); }
.jt .b { color: #a855f7; }
.jt .z { color: var(--muted-fg); }
.jt .leaf { margin-left: 14px; overflow-wrap: anywhere; }
