/*
 * Minimal shared shadow-root reset, prepended once to the bundled
 * `ds.css` every component links to (see `scripts/build-ds-css.mjs` in
 * src). The design-system skill requires a single global reset
 * (`global.css`), but that is light-DOM only and cannot reach into a
 * shadow root. This is the shadow-DOM equivalent: box-sizing plus a
 * token-driven focus ring.
 *
 * Focus-ring color on inverse surfaces is not handled with `:host-context`
 * here: `ds-section[data-surface="inverse"]` re-points the
 * `--elvaio-color-focus` custom property for its whole subtree, and every
 * component (light or shadow DOM) that reads that token for its focus ring
 * inherits the override automatically, because custom properties inherit
 * through shadow boundaries.
 */
:host {
  box-sizing: border-box;
}

:host *,
:host *::before,
:host *::after {
  box-sizing: border-box;
}

:host(:focus-visible) {
  outline: var(--elvaio-focus-width) solid var(--elvaio-color-focus);
  outline-offset: 2px;
  border-radius: var(--elvaio-radius-field);
}


:host {
  display: block;
}

.row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--elvaio-space-02);
  padding: var(--elvaio-space-04) var(--elvaio-space-05);
  border-bottom: 1px solid var(--elvaio-color-border-decorative);
  font-weight: var(--elvaio-font-weight-medium);
}

:host(:last-child) .row {
  border-bottom: 0;
}

.nr:empty,
.label:empty,
.value:empty {
  display: none;
}

.nr {
  font-family: var(--elvaio-font-mono);
  font-size: var(--elvaio-font-size-small);
  color: var(--elvaio-color-text-muted);
}

@media ((min-width: 48rem)) {
  .row {
    flex-direction: row;
    align-items: center;
    gap: var(--elvaio-space-05);
  }

  :host([variant='list']) .label {
    min-width: 6.75rem;
  }
}

/* Table variant: nr + badge on one row (mobile), value wraps full width
   below; nr + badge + value share one row from --tablet up. */
:host([variant='table']) .row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--elvaio-space-02) var(--elvaio-space-03);
  align-items: center;
}

:host([variant='table']) .value {
  grid-column: 1 / -1;
}

@media ((min-width: 48rem)) {
  :host([variant='table']) .row {
    grid-template-columns: 3.25rem 7.75rem 1fr;
    gap: var(--elvaio-space-04);
    padding: var(--elvaio-space-05) var(--elvaio-space-06);
  }

  :host([variant='table']) .value {
    grid-column: auto;
  }
}
