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

  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  /* kilocode_change start — preserve Kilo's bordered card surface */
  background-color: var(--surface-inset-base);
  border: 1px solid var(--border-weaker-base);
  transition: background-color 0.15s ease;
  padding: 6px 12px;
  overflow: clip;
  /* kilocode_change end */
  border-radius: var(--radius-md);

  /* 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));
  }

  :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);
  }

  /* kilocode_change start — preserve Kilo error and warning card variants */
  &[data-variant="error"] {
    background-color: var(--surface-critical-weak);
    border: 1px solid var(--border-critical-base);
    color: rgba(218, 51, 25, 0.6);

    /* text-12-regular */
    font-family: var(--font-family-sans);
    font-size: var(--font-size-small);
    font-style: normal;
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-large);
    letter-spacing: var(--letter-spacing-normal);

    &[data-component="icon"] {
      color: var(--icon-critical-active);
    }
  }

  &[data-variant="warning"] {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: color-mix(in oklab, var(--text-warning, #d97706) 85%, var(--text-base, #ccc));
    padding: 12px 14px;

    /* text-12-regular */
    font-family: var(--font-family-sans);
    font-size: var(--font-size-small);
    font-style: normal;
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-large);
    letter-spacing: var(--letter-spacing-normal);
  }
  /* kilocode_change end */
}

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;
  }
}
