.extraction-board {
  --extraction-board-well-width: 14rem;
  /* Faint enough not to wash out the reported/closed cell tints. */
  --bs-table-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.03);
}

/* The well name stays put while the month columns scroll. */
.extraction-board__well {
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: var(--bs-body-bg);
  min-width: var(--extraction-board-well-width);
}

.extraction-board > thead > tr > th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: var(--bs-body-bg);
}

.extraction-board > tbody > tr > td {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.extraction-board__well a {
  text-decoration: none;
}

.extraction-board__well a:hover,
.extraction-board__well a:focus-visible {
  text-decoration: underline;
}

/* A hatch rather than a flat fill: bg-light already means a locked month. */
.extraction-board,
.extraction-legend {
  --extraction-future-hatch: repeating-linear-gradient(
    -45deg,
    rgba(var(--bs-emphasis-color-rgb), 0.06) 0,
    rgba(var(--bs-emphasis-color-rgb), 0.06) 1px,
    transparent 1px,
    transparent 6px
  );
}

.extraction-board > tbody > tr > td.extraction-board__future {
  background-image: var(--extraction-future-hatch);
}

.extraction-board > :not(caption) > tr > .extraction-board__divider {
  border-right: 1px dashed var(--bs-brand-graphite);
}

.extraction-legend__future {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--bs-border-color);
  background-image: var(--extraction-future-hatch);
}

/* Drawn marks: icon-font glyphs are uneven at this size. */
.extraction-mark {
  display: inline-block;
  vertical-align: middle;
  border-radius: 50%;
}

.extraction-mark--reported {
  width: 0.625rem;
  height: 0.625rem;
  background-color: var(--bs-success);
}

.extraction-mark--open {
  width: 0.625rem;
  height: 0.625rem;
  border: 2px solid var(--bs-brand);
}

.extraction-mark--none {
  width: 0.625rem;
  height: 2px;
  border-radius: 0;
  background-color: var(--bs-brand-graphite);
}

.extraction-mark--closed {
  width: 0.25rem;
  height: 0.25rem;
  background-color: var(--bs-brand-graphite);
}

/* Lets .text-truncate ellipsize long file names inside the flex row. */
.sw-doc-list .text-truncate {
  min-width: 0;
}

.sw-doc-list .btn-close {
  font-size: 0.6rem;
}

/* Restores the card's rounded corner under the last flush item. */
.sw-doc-list.list-group-flush > .list-group-item:last-child {
  border-bottom-left-radius: var(--bs-border-radius);
  border-bottom-right-radius: var(--bs-border-radius);
}

.fancy-check__label__icon.sw-attach-check__icon {
  font-size: 1.125rem;
}

.fancy-check__label--icon-inline .fancy-check__label__icon.sw-attach-check__icon {
  margin-right: 0.75rem;
}

.fancy-check__label__icon.sw-attach-check__icon .fancy-check__label__icon__options {
  height: 1.125rem;
  width: 1.125rem;
}

.pumping-review-grid {
  display: grid;
  grid-template-columns: 1.75rem 1fr 1.5rem auto;
  gap: 1rem;
  align-items: center;
}

/* Well Breakdown rows, mobile-first: each row stacks and every cell states its own label,
   then from xl up the header shows and the cells line up in columns. The column minimums need
   about 45rem with every track, which the card only has from xl up once the side panel is open.
   The select and photos tracks only exist when the month has pending wells or photos, so each
   combination gets its own column list. The select track matches .pumping-review-grid's so row
   checkboxes line up under the card's. */
.pumping-well-grid {
  --pumping-well-cols: minmax(10rem, 1.5fr) minmax(7rem, 1fr) minmax(8rem, 1fr) minmax(9rem, 1.2fr);
}

.pumping-well-grid--photos {
  --pumping-well-cols: minmax(10rem, 1.5fr) minmax(7rem, 1fr) minmax(8rem, 1fr) minmax(9rem, 1.2fr) 4.5rem;
}

.pumping-well-grid--selectable {
  --pumping-well-cols: 1.75rem minmax(10rem, 1.5fr) minmax(7rem, 1fr) minmax(8rem, 1fr) minmax(9rem, 1.2fr);
}

.pumping-well-grid--selectable.pumping-well-grid--photos {
  --pumping-well-cols: 1.75rem minmax(10rem, 1.5fr) minmax(7rem, 1fr) minmax(8rem, 1fr) minmax(9rem, 1.2fr) 4.5rem;
}

.pumping-well-grid__head {
  display: none;
}

.pumping-well-grid__row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 0.625rem 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--bs-border-color-translucent);
}

/* first-of-type, not first-child: Alpine's x-for <template> is the wrapper's first child. */
.pumping-well-grid__row:first-of-type {
  border-top: 0;
}

.pumping-well-grid--selectable .pumping-well-grid__row {
  grid-template-columns: 1.75rem 1fr;
}

.pumping-well-grid--selectable .pumping-well-grid__cell {
  grid-column: 2;
}

.pumping-well-grid__cell[data-label] {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.75rem;
}

.pumping-well-grid__cell[data-label]::before {
  content: attr(data-label);
  flex: 0 0 100%;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

@media (min-width: 1200px) {
  .pumping-well-grid__head {
    display: grid;
    grid-template-columns: var(--pumping-well-cols);
    align-items: center;
    gap: 0.5rem 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bs-border-color);
  }

  .pumping-well-grid__row,
  .pumping-well-grid--selectable .pumping-well-grid__row {
    grid-template-columns: var(--pumping-well-cols);
    row-gap: 0.5rem;
  }

  .pumping-well-grid--selectable .pumping-well-grid__cell {
    grid-column: auto;
  }

  .pumping-well-grid__cell[data-label] {
    display: block;
  }

  .pumping-well-grid__cell[data-label]::before {
    content: none;
  }

  .pumping-well-grid__cell--end {
    text-align: right;
  }
}
