/* Console-only additions on top of site.css. */
.session-bar { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.session-bar .pill { font-family: var(--mono); }

.login-panel { max-width: 480px; }
.error { margin: 0 0 12px; color: var(--bad); font-size: 13.5px; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 14px;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: #04121a; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.main-tabs { margin-bottom: 22px; }

.view { display: none; }
.view.is-active { display: block; }

.panel-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-bar h2 { margin: 0; font-size: 16px; }
.panel-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.panel-actions .btn, .panel-actions .toggle, .panel-actions .mini-select { white-space: nowrap; flex: none; }
.panel-actions input[type="text"] { width: 200px; padding: 6px 11px; font-size: 13px; }

details.panel > summary { cursor: pointer; list-style: none; font-size: 15px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "＋ "; color: var(--accent); }
details.panel[open] > summary::before { content: "－ "; }
details.panel[open] > summary { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.stat b { display: block; font-size: 26px; font-weight: 600; font-family: var(--mono); line-height: 1.25; }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.stat.ok b { color: var(--ok); }
.stat.bad b { color: var(--bad); }

.table-scroll { overflow-x: auto; }
.table td.mono, .table td .mono { font-family: var(--mono); font-size: 13px; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { margin-left: 6px; }
tr.is-selected { background: rgba(56, 225, 255, 0.07); }

/* audit detail: a short line in the row, the whole object under it */
.detail-cell { max-width: 460px; }
.detail-brief { word-break: break-all; }
.detail-toggle { margin-left: 8px; vertical-align: baseline; }
.detail-row td { padding-top: 0; border-bottom: 1px solid var(--line); }
.payload-row td { padding-top: 0; border-bottom: 1px solid var(--line); }
.payload-block { margin-top: 2px; }
.payload-label {
  display: block; margin-bottom: 6px;
  font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
}
.toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none;
}
.toggle input { accent-color: var(--accent); cursor: pointer; }
.mini-select {
  width: auto; padding: 4px 8px; font-size: 12.5px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-solid); color: var(--text);
}

/* small multiples: one field per chart, never two scales on one pair of axes */
.chart-panel { margin-bottom: 16px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.chart { position: relative; margin: 0; }
.chart figcaption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-bottom: 2px; font-family: var(--mono); font-size: 12.5px; color: var(--text);
}
.chart-meta { color: var(--muted); font-size: 11px; }
.chart svg { display: block; overflow: visible; }
.chart-tip {
  /* Below the caption, never over it, and clear of the line it describes. */
  position: absolute; top: 22px; z-index: 2; pointer-events: none;
  padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--panel-solid);
  font-family: var(--mono); font-size: 11.5px; color: var(--text); white-space: nowrap;
}
.detail-body {
  margin: 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(4, 12, 22, 0.55);
  font-size: 12.5px; line-height: 1.55;
  /* Long values wrap instead of widening the table; a very large object
     scrolls inside its own box rather than pushing the page down. */
  white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow: auto;
}

/* one-time credential callout */
.credential {
  margin-bottom: 20px; padding: 20px 22px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(56, 225, 255, 0.1), rgba(11, 24, 40, 0.75));
}
.credential h3 { margin: 0 0 6px; font-size: 16px; color: var(--accent); }
.credential .warn-line { margin: 0 0 14px; font-size: 13.5px; color: var(--warn); }
.key-box {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #050d18; margin-bottom: 16px;
}
.key-box code { flex: 1; overflow-x: auto; white-space: nowrap; color: var(--ok); background: none; padding: 0; }

.snippet-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.snippet-tabs .tab { padding: 5px 13px; font-size: 13px; }
.snippet { display: none; }
.snippet.is-active { display: block; }

.feed { list-style: none; margin: 0; padding: 0; max-height: 62vh; overflow-y: auto; font-family: var(--mono); font-size: 12.5px; }
.feed li { display: flex; gap: 12px; padding: 6px 8px; border-bottom: 1px solid rgba(56, 225, 255, 0.08); }
.feed li:first-child { animation: flash 0.9s ease-out; }
@keyframes flash { from { background: rgba(56, 225, 255, 0.18); } to { background: transparent; } }
.feed .t { color: var(--muted); }
.feed .d { color: var(--accent); min-width: 130px; }
.feed .topic { color: var(--violet); min-width: 150px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .p { flex: 1; color: #b9d6e6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .seq { color: var(--muted); }
.feed li.cmd .d { color: var(--violet); }
/* the opened payload: its own row, laid out as a block rather than a flex row */
.feed li.feed-detail { display: block; padding: 0 8px 10px; border-bottom: 1px solid rgba(56, 225, 255, 0.08); }
.feed .detail-toggle { flex: none; align-self: flex-start; }

.detail-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.detail-head h2 { margin: 0; font-size: 18px; font-family: var(--mono); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 20px; margin: 16px 0 22px; }
.kv div { font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; }
.kv dd { margin: 2px 0 0; font-family: var(--mono); font-size: 13.5px; word-break: break-all; }
.sub-head { margin: 24px 0 10px; font-size: 14px; color: var(--accent); }

/* each group carries its own spaces, since those are what make a username work */
.group-space { padding: 16px 0; border-top: 1px solid var(--line); }
.group-space:first-child { border-top: none; padding-top: 0; }
.group-space .detail-head h2 { font-size: 15px; }
.group-space-form { align-items: end; max-width: 420px; margin-top: 10px; }
