/* =========================================
   BLOCK (The Root)
   ========================================= */
.tcl {
  container-type: inline-size;
  container-name: tcl-main;
  padding: var(--spacing-04);
  font-family: var(--font-family), sans-serif;
  background-color: #ffffff;
  border-radius: var(--border-radius);
}

/* =========================================
   HEADER SECTION
   ========================================= */
.tcl__header {
  display: flex;
  position: sticky;
  top: 40px;
  z-index: 10;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-05, 1rem);
  background-color: #ffffff;
}

.tcl__title {
  font-size: var(--h3-font-size, 1.25rem);
  font-weight: var(--h3-font-weight, 600);
  line-height: var(--h3-line-height, 1.25);
  color: var(--text-main, rgb(22, 22, 22));
}

/* =========================================
   GRID LAYOUT
   ========================================= */
.tcl__grid-primary-headers {
  display: none;
}

.tcl__row {
  display: flex;
  flex-direction: column;
  padding-top: var(--spacing-03, 0.5rem);
  padding-bottom: var(--spacing-03, 0.5rem);
  border-bottom: 1px solid var(--gray-03, rgb(198, 198, 198));
}

.tcl__row:last-child {
  border-bottom: none;
}

/* =========================================
   GRID CELLS (Content)
   ========================================= */
.tcl__grid-field,
.tcl__grid-old-value,
.tcl__grid-new-value {
  display: flex;
  gap: var(--spacing-03, 0.5rem);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Field Column */
.tcl__grid-field {
  font-size: var(--data-display-one-font-size, 0.875rem);
  font-weight: var(--data-display-one-font-weight, 600);
  line-height: var(--data-display-one-line-height, 1.25);
  color: var(--text-main, rgb(22, 22, 22));
}

/* Value Columns */
.tcl__grid-old-value {
  padding-left: var(--spacing-02);
  border-left: 3px solid var(--error-color-light); /* Subtle red line */
  background-color: var(--error-color-hint);
  color: var(--gray-06);
}

.tcl__grid-new-value {
  padding-left: var(--spacing-02);
  border-left: 3px solid var(--success-color-light); /* Subtle green line */
  background-color: var(--success-color-hint);
}

/* Raw View */
.tcl__raw-view {
  overflow-x: auto;
}

.tcl__grid-mobile-label {
  flex-shrink: 0;
}

/* Matches --breakpoint-sm-min (600px) defined in App.css */
@container tcl-main (width > 600px) {
  /* =========================================
     GRID LAYOUT
     ========================================= */
  .tcl__grid-primary-headers,
  .tcl__row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .tcl__grid-primary-headers {
    padding-bottom: var(--spacing-02);
    font-size: var(--data-display-four-font-size);
    font-weight: var(--data-display-four-font-weight);
    line-height: var(--data-display-four-line-height);
    border-bottom: 1px solid var(--gray-04);
  }

  .tcl__row {
    border-bottom: none;
  }

  /* =========================================
     GRID CELLS (Content)
     ========================================= */
  .tcl__grid-old-value,
  .tcl__grid-new-value {
    border: none;
    background-color: transparent;
  }

  /* Field Column */
  .tcl__grid-field {
    font-weight: var(--body-font-weight);
  }

  .tcl__grid-mobile-label {
    display: none;
  }

  /* Value Columns */
  .tcl__grid-old-value {
    color: var(--gray-05);
  }
}
