/* ==========================================================================
   WARD Kit · K00 Cover, K02 Color & Tokens, K03 Typography, K07 Elements
   (kit/index.html)
   Everything here is built on tokens: the sidebar theme switch sets
   data-theme="ops|audit" on .kit-layout and the whole page recolors.
   ========================================================================== */

/* Layout & sidebar ---------------------------------------------------------- */

.kit-layout--themed {
  color: var(--w-text);
  transition: background 280ms;
}

.kit-layout--themed > .kit-nav {
  gap: 28px;
}

.kit-layout--themed .kit-nav__menu a {
  color: var(--w-text);
}

.kit-nav__group--theme {
  margin-bottom: 8px;
}

/* Theme switch: full-width two-up segmented control */
.theme-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: transparent;
}

.theme-switch .segmented__option {
  padding: 0;
}

/* Sections run edge to edge, so the main column itself has no padding */
/* Shared section text ------------------------------------------------------- */

.kit-heading {
  max-width: 18ch;
  line-height: 1.04;
}

.kit-heading--wide {
  max-width: 20ch;
}

.kit-heading__mono {
  font-family: var(--w-mono);
  font-weight: 400;
  letter-spacing: -.04em;
}

.kit-lead {
  margin-top: 20px;
  max-width: 62ch;
}

.kit-subhead {
  margin: 64px 0 20px;
  font: 500 13px var(--w-mono);
  letter-spacing: .06em;
  color: var(--w-text-2);
}

.kit-subhead--with-note {
  margin-bottom: 8px;
}

.kit-subhead--flush {
  margin-top: 0;
}

.kit-subhead--sm {
  margin-top: 56px;
}

.kit-subhead--controls {
  margin-top: 40px;
}

.kit-note {
  margin: 0 0 20px;
  font: 14px var(--w-sans);
  color: var(--w-text-2);
}

/* Two columns that stack on narrow screens */
.kit-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 48px;
  margin-top: 64px;
}

.kit-cols--wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

/* K00 · Cover & index -------------------------------------------------------- */

.cover {
  position: relative;
  padding-block: clamp(64px, 8vw, 128px);
  overflow: hidden;
}

/* Static hex/noise texture behind the headline */
.cover__noise {
  position: absolute;
  inset: 0;
  overflow: hidden;
  font: 11px/20px var(--w-mono);
  letter-spacing: 4px;
  white-space: pre;
  color: var(--w-text-3);
  opacity: .22;
  pointer-events: none;
}

.cover__inner {
  position: relative;
  max-width: 1100px;
}

.cover__eyebrow {
  margin-bottom: 24px;
}

.cover__title {
  font: 300 clamp(56px, 9vw, 140px)/.9 var(--w-sans);
  letter-spacing: -.045em;
}

.cover__lead {
  max-width: 58ch;
  margin-top: 32px;
  font: 400 18px/1.6 var(--w-sans);
  color: var(--w-text-2);
  text-wrap: pretty;
}

.cover__points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin-top: 48px;
  font: 13px/1.55 var(--w-sans);
  color: var(--w-text-2);
}

.cover__point-label {
  margin-bottom: 6px;
  font: 11px var(--w-mono);
  color: var(--w-text-3);
}

.cover__code {
  font-family: var(--w-mono);
  font-size: inherit;
  color: var(--w-text);
}

/* Index of all kit and demo pages */
.kit-index {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 1px;
  margin-top: 64px;
  background: var(--w-line);
  border: 1px solid var(--w-line);
}

.kit-index__card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 156px; /* 120px content + 2 × 18px padding */
  padding: 18px;
  background: var(--w-canvas);
  color: var(--w-text);
}

.kit-index__card:hover {
  background: var(--w-surface-1);
  color: var(--w-text);
}

.kit-index__meta {
  display: flex;
  justify-content: space-between;
  font: 11px var(--w-mono);
  color: var(--w-text-3);
}

.kit-index__status {
  color: var(--w-action);
}

.kit-index__name {
  margin-top: auto;
  font: 400 17px/1.25 var(--w-sans);
}

/* K02 · Token architecture ----------------------------------------------------- */

.token-arch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  font: 12px/1.7 var(--w-mono);
}

.token-arch__card {
  padding: 18px;
  border: 1px solid var(--w-line-2);
  border-radius: 4px;
}

.token-arch__label {
  margin-bottom: 10px;
  color: var(--w-text-3);
}

/* K02 · Primitive swatches ------------------------------------------------------ */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.swatch__chip {
  display: block;
  height: 66px; /* 64px + border */
  border: 1px solid var(--w-line);
  border-radius: 4px;
  background: var(--swatch);
}

.swatch__label {
  margin-top: 8px;
  font: 11px/1.4 var(--w-mono);
  color: var(--w-text-2);
}

.swatch__hex {
  color: var(--w-text-3);
}

/* K02 · Contrast table ------------------------------------------------------------ */

.contrast-wrap {
  overflow-x: auto;
  border: 1px solid var(--w-line-2);
  border-radius: 4px;
}

.contrast {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font: 13px var(--w-sans);
}

.contrast th,
.contrast td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--w-line);
  text-align: left;
  font: 12px var(--w-mono);
}

.contrast thead th {
  border-bottom-color: var(--w-line-2);
  font-size: 11px;
  color: var(--w-text-3);
}

.contrast .contrast__sample-cell {
  padding-block: 8px;
}

/* Fixed hex pair per theme, set per row via --bg / --fg */
.contrast__sample {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 2px;
  background: var(--bg);
  color: var(--fg);
  font: 500 13px var(--w-sans);
}

/* K02 · Severity & TLP scales ------------------------------------------------------ */

.scale-list {
  display: grid;
  gap: 8px;
}

.scale-list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--w-line);
  border-radius: 4px;
}

.scale-list__meta {
  font: 12px var(--w-mono);
  color: var(--w-text-3);
}

.scale-list__use {
  font: 12px var(--w-sans);
  color: var(--w-text-2);
  text-align: right;
}

.scale-list__note {
  margin-top: 12px;
  font: 12px/1.5 var(--w-sans);
  color: var(--w-text-3);
}

/* TLP 2.0 label: official color on black, in both themes */
.tlp {
  padding: 4px 8px;
  border-radius: 2px;
  background: #000;
  color: var(--tlp);
  font: 500 11px var(--w-mono);
}

/* K02 · Data viz palettes ---------------------------------------------------------- */

.palettes {
  display: grid;
  gap: 16px;
}

.palette {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
}

.palette--categorical {
  grid-template-columns: repeat(8, 1fr);
  height: 48px;
}

.palette > span {
  background: var(--c);
}

.palettes__caption {
  font: 12px var(--w-mono);
  color: var(--w-text-3);
}

/* K02 · Theming demo cards ------------------------------------------------------------ */

.theme-demos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

/* White-label example: overrides 8 semantic tokens only */
.theme-demo--partner {
  --w-canvas: #0C1112;
  --w-surface-1: #121A1B;
  --w-line: rgba(220, 235, 232, .1);
  --w-line-2: rgba(220, 235, 232, .18);
  --w-text: #E4EEEC;
  --w-text-2: #A2B3B0;
  --w-action: #3FD1B8;
  --w-on-action: #06100F;
}

.theme-demo__card {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--w-canvas);
  color: var(--w-text);
  border: 1px solid var(--w-line-2);
  border-radius: 8px;
}

.theme-demo__meta {
  display: flex;
  justify-content: space-between;
  font: 11px var(--w-mono);
  color: var(--w-text-3);
}

.theme-demo__status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-demo__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--w-ok);
}

.theme-demo__panel {
  padding: 16px;
  background: var(--w-surface-1);
  border: 1px solid var(--w-line);
  border-radius: 4px;
}

.theme-demo__title {
  margin-bottom: 4px;
  font: 500 16px var(--w-sans);
}

.theme-demo__text {
  font: 14px/1.5 var(--w-sans);
  color: var(--w-text-2);
}

.theme-demo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-demo__btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 4px;
  background: var(--w-action);
  color: var(--w-on-action);
  font: 500 14px var(--w-sans);
}

.theme-demo__hotline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px; /* 40px + border */
  padding: 0 12px;
  border: 1px solid var(--w-emergency-line);
  border-radius: 999px;
  background: var(--w-emergency-soft);
  font: 500 13px var(--w-sans);
}

.theme-demo__hotline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--w-emergency);
}

/* K03 · Type scale --------------------------------------------------------------------- */

.type-scale {
  margin-top: 56px;
  border-top: 1px solid var(--w-line-2);
}

.type-scale__row {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--w-line);
}

.type-scale__spec {
  font: 11px/1.6 var(--w-mono);
  color: var(--w-text-3);
}

.type-scale__token {
  color: var(--w-text);
}

.type-scale__sample {
  font-family: var(--w-sans);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.type-scale__sample--display-xl {
  font-size: clamp(48px, 7vw, 120px);
  font-weight: 300;
  line-height: .9;
  letter-spacing: -.045em;
}

.type-scale__sample--display {
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -.03em;
}

.type-scale__sample--heading-l {
  font-size: clamp(26px, 2.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.type-scale__sample--heading-m {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.type-scale__sample--body-l {
  font-size: 18px;
  line-height: 1.6;
}

.type-scale__sample--body {
  font-size: 16px;
  line-height: 1.6;
}

.type-scale__sample--label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.type-scale__sample--mono {
  font-family: var(--w-mono);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.type-scale__sample--mono-caption {
  font-family: var(--w-mono);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .08em;
}

/* K03 · Notation grid ------------------------------------------------------------------- */

.notation {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.notation__cell {
  padding: 20px;
}

.notation__key {
  margin-bottom: 10px;
  font: 11px var(--w-mono);
  color: var(--w-text-3);
}

.notation__value {
  font: 500 17px var(--w-mono);
  overflow-wrap: anywhere;
}

/* K07 · Density toggle -------------------------------------------------------------------
   data-density="calm|ops" on the K07 section (set by index.js) resizes buttons,
   fields and table rows. */

.density-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.density-switch {
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: transparent;
}

.density-switch .segmented__option {
  height: 32px;
  padding: 0 16px;
}

[data-density="ops"] .density-field {
  height: 36px;
}

/* K07 · Button specimens (variant × state) --------------------------------------------- */

.btn-matrix {
  overflow-x: auto;
  border: 1px solid var(--w-line-2);
  border-radius: 4px;
}

.btn-matrix__inner {
  min-width: 980px;
}

.btn-matrix__head,
.btn-matrix__row {
  display: grid;
  grid-template-columns: 120px repeat(6, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--w-line);
}

.btn-matrix__head {
  padding-block: 12px;
  border-bottom-color: var(--w-line-2);
  font: 11px var(--w-mono);
  color: var(--w-text-3);
}

.btn-matrix__row {
  align-items: center;
}

.btn-matrix__name {
  font: 12px var(--w-mono);
  color: var(--w-text-2);
}

/* Static specimen: states are forced with is-hover / is-focus / is-active /
   is-disabled / is-loading so every cell shows one state at rest. */
.spec-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--w-text);
  font: 500 15px var(--w-sans);
  white-space: nowrap;
}

[data-density="ops"] .spec-btn {
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.spec-btn--primary {
  background: var(--w-action);
  color: var(--w-on-action);
}

.spec-btn--primary.is-hover,
.spec-btn--primary.is-active {
  background: var(--w-action-hover);
}

.spec-btn--secondary {
  border-color: var(--w-line-2);
}

.spec-btn--secondary.is-hover,
.spec-btn--secondary.is-active,
.spec-btn--ghost.is-hover,
.spec-btn--ghost.is-active {
  background: var(--w-surface-2);
}

.spec-btn--tertiary {
  background: var(--w-surface-2);
}

.spec-btn--tertiary.is-hover,
.spec-btn--tertiary.is-active {
  background: var(--w-surface-3);
}

.spec-btn--link,
[data-density="ops"] .spec-btn--link {
  padding: 0;
  color: var(--w-action);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.spec-btn--link.is-hover,
.spec-btn--link.is-active {
  color: var(--w-action-hover);
}

.spec-btn--destructive {
  border-color: var(--w-emergency-line);
  color: var(--w-emergency-text);
}

.spec-btn--destructive.is-hover,
.spec-btn--destructive.is-active {
  background: var(--w-emergency-soft);
}

.spec-btn--emergency {
  background: var(--w-emergency);
  color: #fff;
}

.spec-btn--emergency.is-hover,
.spec-btn--emergency.is-active {
  background: #B0242A;
}

.spec-btn.is-focus {
  outline: 2px solid var(--w-focus);
  outline-offset: 3px;
}

.spec-btn.is-active {
  transform: scale(.97);
}

.spec-btn.is-disabled {
  opacity: .38;
  cursor: not-allowed;
}

.spec-btn.is-loading {
  opacity: .8;
}

/* Sizes S / M / L (independent of density) */
.btn-sizes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.btn-sizes__label {
  width: 120px;
  font: 12px var(--w-mono);
  color: var(--w-text-3);
}

.btn-sizes .spec-btn--s { height: 36px; padding: 0 12px; font-size: 14px; }
.btn-sizes .spec-btn--m { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-sizes .spec-btn--l { height: 52px; padding: 0 24px; font-size: 16px; }

/* K07 · Text input states --------------------------------------------------------------- */

.field-demos {
  display: grid;
  gap: 18px;
}

.field-demo {
  display: grid;
  gap: 6px;
}

.field-demo__label {
  font: 500 14px var(--w-sans);
  color: var(--w-text);
}

.field-demo__state {
  font: 11px var(--w-mono);
  color: var(--w-text-3);
}

.field-demo__box {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 14px;
  background: var(--w-surface-1);
  border: 1px solid var(--w-line-2);
  border-radius: 4px;
  color: var(--w-text);
  font: 400 16px var(--w-sans);
}

[data-density="ops"] .field-demo__box {
  height: 36px;
}

.field-demo__box--placeholder {
  color: var(--w-text-3);
}

.field-demo__box--focus {
  border-color: var(--w-action);
  outline: 2px solid var(--w-focus);
  outline-offset: 2px;
}

.field-demo__box--error {
  border-color: var(--w-emergency-text);
}

.field-demo__box--success {
  border-color: var(--w-ok);
}

.field-demo__box--disabled {
  background: var(--w-surface-2);
  opacity: .45;
}

.field-demo__hint {
  font: 13px var(--w-sans);
  color: var(--w-text-3);
}

.field-demo__hint--error {
  color: var(--w-emergency-text);
}

.field-demo__hint--ok {
  color: var(--w-ok);
}

/* K07 · Search with CVE detection ----------------------------------------------------------- */

.search-demo {
  display: grid;
  gap: 6px;
}

.search-demo__label {
  font: 500 14px var(--w-sans);
}

.search-demo__input {
  outline-offset: 2px;
}

.cve-hit {
  min-height: 36px;
  margin-top: 10px;
}

.cve-hit__chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--w-action-line);
  border-radius: 4px;
  background: var(--w-action-soft);
  font: 13px var(--w-mono);
}

/* K07 · Selection controls (state lives in aria-checked) ------------------------------------ */

.controls {
  display: grid;
  gap: 14px;
  font: 15px var(--w-sans);
}

.control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--w-text);
  font: inherit;
  text-align: left;
}

.radio-group {
  display: grid;
  gap: 4px;
}

/* Switch */
.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--w-surface-3);
  transition: background 180ms;
}

.switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--w-text-2);
  transition: transform 180ms cubic-bezier(.45, 0, .55, 1);
}

[aria-checked="true"] > .switch {
  background: var(--w-action);
}

[aria-checked="true"] > .switch .switch__knob {
  background: var(--w-on-action);
  transform: translateX(18px);
}

/* Checkbox */
.checkmark {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--w-text-3);
  border-radius: 2px;
  color: var(--w-on-action);
  font: 600 13px var(--w-sans);
}

[aria-checked="true"] > .checkmark {
  border-color: var(--w-action);
  background: var(--w-action);
}

[aria-checked="true"] > .checkmark::after {
  content: "\2713"; /* check mark */
}

/* Radio */
.radio {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--w-text-3);
  border-radius: 50%;
}

.radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

[aria-checked="true"] > .radio {
  border-color: var(--w-action);
}

[aria-checked="true"] > .radio::after {
  background: var(--w-action);
}

/* K07 · Security notation elements ------------------------------------------------------------ */

.element-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.element-cell {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 24px;
}

.element-cell--snug {
  gap: 10px;
}

.element-cell__label {
  font: 11px var(--w-mono);
  color: var(--w-text-3);
}

.element-cell__note {
  font: 12px var(--w-sans);
  color: var(--w-text-3);
}

.element-cell__meta {
  font: 12px var(--w-mono);
  color: var(--w-text-2);
}

/* Status lines */
.status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 13px var(--w-mono);
}

.status-line--muted {
  color: var(--w-text-2);
}

.status-line__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-line__dot--ok {
  background: var(--w-ok);
  box-shadow: 0 0 0 3px rgba(76, 195, 138, .2);
}

.status-line__dot--warn {
  background: var(--w-warn);
}

/* Outage uses a square, not a dot */
.status-line__dot--outage {
  border-radius: 0;
  background: var(--w-emergency);
}

/* Timestamp / CVE / host chips */
.notation-chip {
  padding: 5px 9px;
  border-radius: 2px;
  font: 13px var(--w-mono);
}

.notation-chip--time {
  border: 1px solid var(--w-action-line);
  color: var(--w-action);
  font-weight: 500;
}

.notation-chip--outline {
  border: 1px solid var(--w-line-2);
}

.notation-chip--fill {
  background: var(--w-surface-2);
}

/* Hash with copy button */
.hash-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 46px; /* 44px + border */
  padding: 0 6px 0 12px;
  border: 1px solid var(--w-line-2);
  border-radius: 4px;
  font: 13px var(--w-mono);
}

.hash-copy__btn {
  height: 32px;
  padding: 0 12px;
  background: var(--w-surface-2);
  border: 0;
  border-radius: 2px;
  color: var(--w-text);
  font: 12px var(--w-mono);
}

.hash-copy__btn:hover {
  background: var(--w-surface-3);
}

/* Redaction bar: .is-revealed on the button slides the bar away */
.redact {
  justify-self: start;
  padding: 0;
  background: none;
  border: 0;
  color: var(--w-text);
  font: 400 18px/1.4 var(--w-sans);
  text-align: left;
}

.redact__text {
  position: relative;
  display: inline-block;
}

.redact__bar {
  position: absolute;
  inset: 6% -2px;
  background: var(--w-redact);
  transform-origin: right;
  transition: transform 420ms var(--w-ease-out);
}

.redact.is-revealed .redact__bar {
  transform: scaleX(0);
}

/* Verification tick */
.verify-tick {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--w-action);
  border-radius: 50%;
  color: var(--w-action);
  font: 600 10px var(--w-sans);
}

/* Emergency lane specimen (shared .emergency-lane, shown outside the header) */
.element-cell .emergency-lane {
  justify-self: start;
  color: var(--w-text);
}

.element-cell .emergency-lane:hover {
  color: #fff;
}

.element-cell .emergency-lane__number {
  display: inline;
}

.cert-badges {
  gap: 6px;
}

/* Progress & keyboard hint */
.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--w-line-2);
}

.progress__bar {
  width: var(--value);
  height: 100%;
  border-radius: 2px;
  background: var(--w-action);
}

.kbd-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 12px var(--w-sans);
  color: var(--w-text-2);
}

.kbd {
  padding: 2px 7px;
  border: 1px solid var(--w-line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--w-text);
  font: 12px var(--w-mono);
}

/* K07 · Density log table ------------------------------------------------------------------ */

.log-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--w-line-2);
  border-radius: 4px;
  background: var(--w-surface-1);
}

.log-table__bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--w-line);
  font: 12px var(--w-mono);
  color: var(--w-text-2);
}

.log-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font: 13px var(--w-mono);
}

.log-table th,
.log-table td {
  padding: 0 16px;
  border-bottom: 1px solid var(--w-line);
  text-align: left;
}

.log-table th {
  height: 36px;
  font-size: 11px;
  font-weight: 400;
  color: var(--w-text-3);
}

.log-table tbody tr {
  height: 52px;
}

[data-density="ops"] .log-table tbody tr {
  height: 34px;
}

.log-table__detection {
  font-family: var(--w-sans);
}

.log-sev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sev);
}

.log-sev::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--sev);
  transform: rotate(45deg);
}

.log-sev--critical { --sev: var(--w-sev-critical); }
.log-sev--high     { --sev: var(--w-sev-high); }
.log-sev--medium   { --sev: var(--w-sev-medium); }
.log-sev--low      { --sev: var(--w-sev-low); }

/* K07 · More inputs & feedback ----------------------------------------------------------------- */

.select-demo {
  padding: 0 12px;
}

.datetime {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.datetime__input {
  padding: 0 10px;
  font: 15px var(--w-mono);
}

/* Slider */
.slider-demo {
  display: grid;
  gap: 10px;
}

.slider-demo__head {
  display: flex;
  justify-content: space-between;
  font: 500 14px var(--w-sans);
}

.slider-demo__value {
  font-family: var(--w-mono);
  color: var(--w-action);
}

.slider-demo__input {
  width: 100%;
}

/* Secure file upload: .is-done after the simulated scan */
.upload {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 18px;
  background: var(--w-surface-1);
  border: 1px dashed var(--w-line-2);
  border-radius: 4px;
  color: var(--w-text);
  font: 14px var(--w-sans);
  text-align: left;
}

.upload.is-done {
  border-color: var(--w-ok);
}

.upload__title {
  font: 500 14px var(--w-sans);
}

.upload__sub {
  font: 12px var(--w-mono);
  color: var(--w-text-2);
}

/* Filter chips & topic tags */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  min-height: 38px; /* 36px + border */
  padding: 0 12px;
  border: 1px solid var(--w-line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--w-text);
  font: 13px var(--w-sans);
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--w-action);
  background: var(--w-action-soft);
}

.topic-tag {
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--w-surface-2);
  font: 12px var(--w-mono);
}

/* Tooltip (CSS only) */
.tooltip {
  position: relative;
  justify-self: start;
}

.tooltip__trigger {
  padding: 0;
  background: none;
  border: 0;
  border-bottom: 1px dashed var(--w-text-3);
  color: var(--w-text);
  font: 15px var(--w-mono);
  cursor: help;
}

.tooltip__bubble {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 1;
  width: 246px; /* 220px content + padding + border */
  padding: 10px 12px;
  background: var(--w-surface-3);
  border: 1px solid var(--w-line-2);
  border-radius: 4px;
  color: var(--w-text);
  font: 12px/1.5 var(--w-sans);
  visibility: hidden;
}

.tooltip:hover .tooltip__bubble,
.tooltip__trigger:focus + .tooltip__bubble {
  visibility: visible;
}

/* Noise-to-signal loader */
.loader {
  font: 14px var(--w-mono);
  letter-spacing: .12em;
  color: var(--w-text-3);
  white-space: pre;
}

/* Skeleton & dividers */
.skeleton {
  display: grid;
  gap: 8px;
}

.skeleton__line {
  width: var(--w);
  height: 12px;
  border-radius: 2px;
  background: var(--w-surface-2);
}

.divider {
  height: 1px;
  margin: 6px 0;
  background: var(--w-line);
}

.time-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 11px var(--w-mono);
  color: var(--w-text-3);
}

.time-divider::before,
.time-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--w-line-2);
}

.kit-footnote {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--w-line);
  font: 12px var(--w-mono);
  color: var(--w-text-3);
}
