[data-component="card"] {
  --card-pad-y: 10px;
  --card-pad-r: 12px;
  --card-pad-l: 10px;

  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--card-pad-y) var(--card-pad-r) var(--card-pad-y) var(--card-pad-l);

  /* text-14-regular */
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  font-style: normal;
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-large);
  letter-spacing: var(--letter-spacing-normal);
  color: var(--v2-text-text-base);

  --card-gap: 8px;
  --card-icon: 16px;
  --card-indent: 0px;
  --card-line-pad: 8px;

  --card-accent: var(--v2-icon-icon-base);

  &:has([data-slot="card-title"]) {
    gap: 8px;
  }

  &:has([data-slot="card-title-icon"]) {
    --card-indent: calc(var(--card-icon) + var(--card-gap));
  }

  &::before {
    content: "";
    position: absolute;
    left: 0;
    top: var(--card-line-pad);
    bottom: var(--card-line-pad);
    width: 2px;
    border-radius: 2px;
    background-color: var(--card-accent);
  }

  :where([data-card="title"], [data-slot="card-title"]) {
    color: var(--v2-text-text-base);
    font-weight: var(--font-weight-medium);
  }

  :where([data-slot="card-title"]) {
    display: flex;
    align-items: center;
    gap: var(--card-gap);
  }

  :where([data-slot="card-title"]) [data-component="icon"] {
    color: var(--card-accent);
  }

  :where([data-slot="card-title-icon"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--card-icon);
    height: var(--card-icon);
    flex: 0 0 auto;
  }

  :where([data-slot="card-title-icon"][data-placeholder]) [data-component="icon"] {
    color: var(--v2-text-text-faint);
  }

  :where([data-slot="card-title-icon"])
    [data-slot="icon-svg"]
    :is(path, line, polyline, polygon, rect, circle, ellipse)[stroke] {
    stroke-width: 1.5px !important;
  }

  :where([data-card="description"], [data-slot="card-description"]) {
    color: var(--v2-text-text-muted);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  :where([data-card="actions"], [data-slot="card-actions"]) {
    padding-left: var(--card-indent);
  }
}

body:not([data-new-layout]) [data-component="card"] {
  color: var(--text-strong);
  --card-accent: var(--icon-active);

  :where([data-card="title"], [data-slot="card-title"]) {
    color: var(--text-strong);
  }

  :where([data-slot="card-title-icon"][data-placeholder]) [data-component="icon"] {
    color: var(--text-weak);
  }

  :where([data-card="description"], [data-slot="card-description"]) {
    color: var(--text-base);
  }

  &[data-variant="error"] {
    --card-accent: var(--icon-critical-base) !important;
  }
}
