#results {
  position: relative;
}

.popover::backdrop {
  background: transparent;
}

table {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  table-layout: fixed;
}

table caption {
  /*font-size: 1.5em;*/
  margin: 0.5em 0 0.75em 0;
  text-align: left;
}

table tr:nth-child(2n) {
  background-color: rgb(250, 248, 241);
  padding: 0.35em;
}

table th,
table td {
  padding: 16px;
  word-break: break-word;
  font-size: 14px;
  height: auto;
  vertical-align: middle;
  line-height: 174%;
}

table th {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 16px;

  min-height: 36px;
  height: 36px;
  line-height: 178%;
}

table td a:hover {
  text-decoration: underline;
}

table th {
  letter-spacing: 0.1em;
  text-align: left;
  color: #fff;
  background-color: #262626;
}

/* Status filter tabs: single source of truth for the active/inactive look.
   The server render adds `status-tab-active` to the selected tab and
   homepage-actions toggles the same class after each swap, so first paint and
   post-swap state can't drift. Values mirror the former Tailwind utilities
   (evBlack #262626, shadow-sm). */
.status-tab-btn {
  background-color: transparent;
  color: #666666;
}

.status-tab-btn:hover {
  color: #262626;
}

.status-tab-active {
  background-color: #ffffff;
  color: #262626;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

.seller-report-modal .tooltip::before {
  font-size: 11px;
  letter-spacing: 0.44px;
  background-color: #666666;
  line-height: 178%;
}

@media screen and (max-width: 1024px) {
  #table-status-select-form {
    display: none;
  }

  table {
    border: none;
  }

  /* Higher specificity than the desktop #listings-table border above. */
  #listings-table {
    border: none;
  }

  table caption {
    font-size: 1.3em;
  }

  table thead {
    /* This code hides the headers on mobile. */
    border: none;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }

  table tr:hover {
    background: initial;
  }

  table td:hover {
    background: #f0f0f0;

    button:not(dialog button) {
      background: #d8d8d8;
    }
  }

  table tr:nth-child(2n) {
    background-color: rgb(250, 248, 241);
    padding: 0;
  }

  table tr {
    border-bottom: 2px solid #ddd;
    margin-bottom: 0.7em;
  }

  table td {
    display: block;
    font-size: 0.8em;
    text-align: right;
    border-bottom: 1px solid #f6f6f6;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }

  /* Override display for preview modal within flex td */
  table td > dialog[id^="sellerReportPreviewModal_"] {
    display: block;
    /* Counteract parent td's display: flex */
    height: auto;
    text-align: initial;
    /* Reset text-align potentially inherited from td */
  }

  table
    td
    div:not(form div, .popover, dialog[id^="sellerReportPreviewModal_"] div) {
    display: block;
    float: right;
    text-align: right;
  }

  /* Restore rule for other dialogs */
  table dialog:not([id^="sellerReportPreviewModal_"]) {
    /* seller report dialog */
    text-align: left;
    height: 100%;
  }

  table td::before {
    /*
        * aria-label has no advantage, it won't be read inside a table
        content: attr(aria-label);
        */
    content: attr(data-label);
    float: left;
    font-family: "EV Text Bold", sans-serif;
  }

  table td.hidden::before {
    display: none;
  }

  table td span:not(form span, dialog span) {
    display: none !important;
  }

  table td:last-child {
    border-bottom: 0;
  }
}

.property-image {
  max-width: 200px;
}

tbody tr {
  border-bottom: 1px solid #e5e5e5;
}

tbody tr:hover td {
  background-color: rgb(250, 250, 250);
  cursor: pointer;
}

#listingsTable tbody tr {
  border-bottom: 1px solid #eaeaea;
  /* Needed for absolute positioning of the popover */
  position: relative;
}

table
  td
  div:not(form div, .popover, [id^="seller-report-preview-container"], dialog) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------------------
   Listings table visual design (borders + colors)
   Scoped to #listings-table so the email/shoptv tables keep their own styling.
   --------------------------------------------------------------------------- */

/* White card wrapping the search bar, table, and pagination. */
.listings-card {
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.08);
  padding: 16px;
}

/* Default cell text is a soft near-black. Set on the table (not td) so a row's
   semantic `.text-evRed` (missing exposé) still cascades to its cells. The
   border outlines the grid (header + body); the <caption> search bar renders
   outside the table's border box, so it stays above the outline. */
#listings-table {
  color: #262626;
  border: 1px solid #e5e5e5;
  border-collapse: collapse;
}

/* Avoid doubling the outer border against the last row's divider. */
#listings-table tbody tr:last-child {
  border-bottom: none;
}

#listings-table td a {
  color: inherit;
}

/* The global `.tooltip` rule (for the header-search tip) forces
   `color:#fff !important; font-size:11px !important` onto the element itself,
   which would blank out and shrink the missing-exposé link text. Override both
   so the link keeps the row's red text at the normal size; the tooltip bubble
   still uses `.tooltip`'s grey/white styling via ::before. */
#listings-table tbody td .tooltip {
  color: inherit !important;
  font-size: inherit !important;
}

/* Light header: replaces the legacy dark bar with grey uppercase labels.
   Padding is 8px 16px at a fixed 36px height. */
#listings-table thead th {
  color: #808080;
  background-color: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  height: 36px;
  padding: 8px 16px;
  position: relative;
}

/* The header label span carries DaisyUI's `.label` (padding: .5rem .25rem plus
   a 1rem/1.5rem font), which inflated the row. Neutralize it so the label uses
   the header's own 11px/uppercase metrics and the row stays at 36px. */
#listings-table thead th .label {
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}

/* Short column dividers (were full-height white on the old dark header; now a
   grey line inset from the top/bottom of the header row). */
#listings-table thead th:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background-color: #e5e5e5;
}

/* Subtle zebra striping (nearly white) instead of the legacy cream. */
#listings-table tbody tr:nth-child(2n) {
  background-color: rgb(252, 252, 251);
}

#listings-table tbody tr {
  border-bottom: 1px solid #e5e5e5;
}

/* Data-row height: `height` on a table cell acts as a minimum, so rows are at
   least 56px and grow with wrapped content (e.g. two-line addresses) toward 80px. */
#listings-table tbody td {
  height: 56px;
}

#listings-table tbody tr:hover td {
  background-color: rgb(250, 250, 250);
}

/* Missing-exposé tooltip that follows the cursor. A CSS pseudo-element can only
   anchor to an element (never the pointer), so the bubble is a single
   position:fixed element (created once, appended to <body>) that homepage-actions
   moves to the cursor on mousemove over a row marked `data-row-tip`. Fixed +
   client coords means it tracks the pointer anywhere over the table. */
.listings-row-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  transform: translate(14px, 18px);
  padding: 4px 8px;
  border-radius: 4px;
  background-color: #666666;
  color: #fff;
  font-size: 11px;
  line-height: 178%;
  letter-spacing: 0.44px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.listings-row-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Pagination footer reads as the table's bottom row: it shares the table's 1px
   border on the left/right/bottom, and the table's own bottom edge becomes the
   divider line above it, so the footer looks enclosed by the grid. Scoped to
   `.listings-card` so the email/shoptv pagination (no card) is unaffected. */
.listings-card #pagination-container {
  border: 1px solid #e5e5e5;
  border-top: none;
}

/* ---------------------------------------------------------------------------
   ShopTV + Seller Reports tables reuse the listings visual design.
   These pages load this stylesheet (not email-table.css) and wrap their table
   in `.listings-card`, so the same light-header / near-white-zebra / bordered
   look applies. Rules mirror the `#listings-table` block above; they override
   the generic dark-header `table th` (higher id specificity) and the cream
   `table tr:nth-child(2n)` zebra.
   --------------------------------------------------------------------------- */
#shoptv-listings-table,
#email-subscriptions-table {
  color: #262626;
  border: 1px solid #e5e5e5;
  border-collapse: collapse;
}

#shoptv-listings-table tbody tr:last-child,
#email-subscriptions-table tbody tr:last-child {
  border-bottom: none;
}

#shoptv-listings-table td a,
#email-subscriptions-table td a {
  color: inherit;
}

#shoptv-listings-table thead th,
#email-subscriptions-table thead th {
  color: #808080;
  background-color: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  height: 36px;
  padding: 8px 16px;
  position: relative;
}

#shoptv-listings-table thead th .label,
#email-subscriptions-table thead th .label {
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}

#shoptv-listings-table thead th:not(:last-child)::after,
#email-subscriptions-table thead th:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background-color: #e5e5e5;
}

#shoptv-listings-table tbody tr:nth-child(2n),
#email-subscriptions-table tbody tr:nth-child(2n) {
  background-color: rgb(252, 252, 251);
}

#shoptv-listings-table tbody tr,
#email-subscriptions-table tbody tr {
  border-bottom: 1px solid #e5e5e5;
}

#shoptv-listings-table tbody td,
#email-subscriptions-table tbody td {
  height: 56px;
}

#shoptv-listings-table tbody tr:hover td,
#email-subscriptions-table tbody tr:hover td {
  background-color: rgb(250, 250, 250);
}
