/* bidmio-css-layer-wrapped: app (shared stat tile; standalone so no bundle budget grows — loaded by stat_tile_css()) */
@layer vendor, app, overrides, utilities;
@layer app {
  /*
   * Stat tile (templates/components/stat_tile.html): one number with its
   * label, optional icon, hint, trend and tone; a whole tile can be one link.
   * Design tokens only, so light and dark follow the theme. A row of tiles
   * (.ds-stat-row) fills as many 13rem+ columns as fit, no breakpoints.
   * Doc: docs/components/STAT_TILE.md
   */
  .ds-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: var(--space-3);
  }
  .ds-stat-tile {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    min-height: var(--touch-target-min);
    padding: var(--space-4);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-lg);
    background: var(--color-surface);
    color: var(--color-text-primary);
    text-decoration: none;
  }
  a.ds-stat-tile {
    transition: var(--transition-colors);
  }
  a.ds-stat-tile:hover {
    border-color: var(--color-border-strong);
    background: var(--color-card-bg-hover);
  }
  .ds-stat-tile__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: var(--space-9);
    height: var(--space-9);
    border-radius: var(--border-radius-md);
    background: var(--color-surface-tertiary);
    color: var(--color-text-secondary);
  }
  .ds-stat-tile[data-tone="primary"] .ds-stat-tile__icon {
    background: var(--color-primary-bg);
    color: var(--color-primary-badge-text);
  }
  .ds-stat-tile[data-tone="success"] .ds-stat-tile__icon {
    background: var(--color-success-bg);
    color: var(--color-success-badge-text);
  }
  .ds-stat-tile[data-tone="warning"] .ds-stat-tile__icon {
    background: var(--color-warning-bg);
    color: var(--color-warning-badge-text);
  }
  .ds-stat-tile[data-tone="danger"] .ds-stat-tile__icon {
    background: var(--color-danger-bg);
    color: var(--color-danger-badge-text);
  }
  .ds-stat-tile__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-0-5);
    min-width: 0;
  }
  .ds-stat-tile__label {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
  }
  .ds-stat-tile__value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    overflow-wrap: break-word;
  }
  .ds-stat-tile__hint {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
  }
  .ds-stat-tile__trend {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
  }
  .ds-stat-tile__trend--good {
    color: var(--color-success-badge-text);
  }
  .ds-stat-tile__trend--flat {
    color: var(--color-text-secondary);
  }
  .ds-stat-tile__trend--bad {
    color: var(--color-danger-badge-text);
  }
  /* The value as its own link (the main count in a tile that also has a
     hint link): reads as the number, underlines on hover and focus. */
  .ds-stat-tile__value-link {
    color: inherit;
    text-decoration: none;
  }
  .ds-stat-tile__value-link:hover,
  .ds-stat-tile__value-link:focus-visible {
    text-decoration: underline;
  }
  /* A hint that is its own link (hint_href, only in a tile that is not one
     link): a padded inline target so it is easy to hit. */
  .ds-stat-tile__hint--link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-block-size: var(--space-6-fixed);
    padding-block: var(--space-1);
    color: var(--color-primary-badge-text);
    text-decoration: none;
  }
  .ds-stat-tile__hint--link:hover,
  .ds-stat-tile__hint--link:focus-visible {
    text-decoration: underline;
  }
  /* Sparkline (spark_id): fixed size at the end of the tile, drawn by the
     page's script. */
  .ds-stat-tile__spark {
    flex: none;
    align-self: center;
    width: 4rem;
    height: 2rem;
  }
  .ds-stat-tile__go {
    align-self: center;
    color: var(--color-text-muted);
  }

}
