/* SIEM feeds (Organisation): the table's queue meter and the dialog with what the SIEM
   receives beside the form. Redwood tokens only (web/DESIGN.md 2 and 24). */

/* ── The table ──────────────────────────────────────────────────────────── */
.ds-siem-where { overflow-wrap: anywhere; }
.ds-siem-health { gap: var(--rw-space-1x); min-width: 9rem; }
.ds-siem-health .ds-state { white-space: nowrap; }
.ds-siem-error { color: var(--rw-text-secondary); font-size: var(--rw-body-xs-size); line-height: var(--rw-body-xs-lh); max-width: 28em; }

/* The queue against its limit: a hairline meter, then what waits and what was dropped. The
   fill is the hue of magnitude; it takes a status colour only when the queue nears its limit
   (warning) or dropped events in the last day (danger). */
.ds-siem-queue { display: grid; gap: var(--rw-space-1x); min-width: 10rem; max-width: 16rem; }
.ds-siem-meter { position: relative; height: 4px; border-radius: 2px; background: var(--rw-bg-muted); overflow: hidden; }
.ds-siem-meter > span {
  position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--ds-fill, 0%); min-width: 0;
  border-radius: inherit; background: var(--rw-brand-110); transition: width 600ms cubic-bezier(.2, .7, .2, 1);
}
.ds-siem-queue-warning .ds-siem-meter > span { background: var(--rw-text-warning); }
.ds-siem-queue-danger .ds-siem-meter > span { background: var(--rw-text-danger); }
.ds-siem-waiting { font-size: var(--rw-body-sm-size); color: var(--rw-text-secondary); }
.ds-siem-queue-warning .ds-siem-waiting { color: var(--rw-text-warning); }
.ds-siem-dropped { font-size: var(--rw-body-sm-size); color: var(--rw-text-danger); font-weight: 600; }

/* ── The dialog ─────────────────────────────────────────────────────────── */
dialog.ds-siem-dialog { width: min(76rem, calc(100vw - 2 * var(--rw-space-4x))); }
.ds-siem-now {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--rw-space-6x); align-items: start;
  margin-block-end: var(--rw-space-4x); padding: var(--rw-space-3x) var(--rw-space-4x); border-radius: var(--rw-radius-md); background: var(--rw-bg-muted);
}
.ds-siem-now .ds-siem-meter { background: var(--rw-bg-content); }

/* The form, and beside it what the SIEM receives: on a wide screen the preview stays in view
   while the form scrolls; below 64rem it follows the form. */
.ds-siem-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); gap: var(--rw-space-8x); align-items: start; }
.ds-siem-form { min-width: 0; }
.ds-siem-preview {
  position: sticky; inset-block-start: 0;
  display: grid; gap: var(--rw-space-2x); min-width: 0;
  padding-inline-start: var(--rw-space-6x); border-inline-start: 1px solid var(--rw-divider);
}
.ds-siem-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--rw-space-2x); }
.ds-siem-preview-head > h3 { margin: 0; font-size: var(--rw-body-md-size); line-height: var(--rw-body-md-lh); font-weight: 800; }
.ds-siem-preview-label { margin: 0; font-size: var(--rw-body-sm-size); }
.ds-siem-preview-text {
  margin: 0; max-height: min(34rem, 62vh); overflow: auto; padding: var(--rw-space-3x);
  border-radius: var(--rw-radius-md); background: var(--rw-bg-muted); color: var(--rw-text-primary);
  font-family: var(--font-oracle-mono, ui-monospace, monospace); font-size: var(--rw-body-xs-size); line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}
.ds-siem-preview-text:focus-visible { outline: 2px solid var(--rw-focus-ring); outline-offset: 2px; }
.ds-siem-preview .rw-help { margin: 0; }

.ds-siem-address { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: var(--rw-space-4x); }
.ds-siem-certs { display: grid; gap: var(--rw-space-3x); margin: 0; padding: var(--rw-space-4x); border: 1px solid var(--rw-divider); border-radius: var(--rw-radius-lg); }
.ds-siem-certs > legend { padding-inline: var(--rw-space-1x); }
.ds-siem-certs > .rw-help { margin: 0; }
.ds-siem-file { display: grid; gap: var(--rw-space-1x); }
.ds-siem-file-kind { font-size: var(--rw-body-sm-size); color: var(--rw-text-secondary); }
.ds-siem-onfile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--rw-space-2x); min-height: 2.25rem; }
.ds-siem-onfile > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--rw-space-2x); }
.ds-siem-onfile-cert { align-items: start; }
.ds-siem-secret { display: grid; gap: var(--rw-space-1x); justify-items: start; }
.ds-siem-secret > .rw-field { width: 100%; }
.ds-siem-severity { display: grid; gap: var(--rw-space-2x); justify-items: start; }
.ds-siem-air { align-self: end; }
.ds-siem-backlog { display: flex; align-items: center; gap: var(--rw-space-2x); max-width: 16rem; }

@media (max-width: 63.99rem) {
  .ds-siem-layout { grid-template-columns: minmax(0, 1fr); gap: var(--rw-space-6x); }
  .ds-siem-preview { position: static; padding-inline-start: 0; padding-block-start: var(--rw-space-4x); border-inline-start: 0; border-block-start: 1px solid var(--rw-divider); }
  .ds-siem-preview-text { max-height: 24rem; }
}
/* On a phone the table has two columns: the queue folds into the feed's cell. */
.ds-siem-feed-queue { display: none; }
@media (max-width: 47.99rem) {
  .ds-siem-feed-queue { display: block; margin-block-start: var(--rw-space-2x); }
  .ds-siem-health { min-width: 0; }
}
@media (max-width: 40rem) {
  .ds-siem-address, .ds-siem-now { grid-template-columns: minmax(0, 1fr); }
  .ds-siem-now { gap: var(--rw-space-3x); }
  .ds-siem-queue { min-width: 7rem; }
}
@media (prefers-reduced-motion: reduce) { .ds-siem-meter > span { transition: none; } }
