/*
 * Shared Admin table foundation.
 *
 * This stylesheet is intentionally loaded by adminStart() rather than emitted
 * from PHP. Route-specific table CSS remains in place until its corresponding
 * Gate 63 migration has proved an equivalent semantic component variant.
 */

.admin-table-surface {
  /* This is deliberately a complete table surface, rather than a styled
   * generic <section>. It must not inherit the legacy global section rule
   * emitted by includes/all.php. */
  /* The sticky region begins beneath the breadcrumb bar. Its real toolbar
   * band owns the space immediately above a table heading. */
  --admin-table-sticky-top: 138px;
  --admin-table-toolbar-height: 20px;
  margin: 0;
  padding: 24px;
  border: 1px solid #e4e4e9;
  background: #fff;
  overflow: visible;
  position: relative;
  z-index: 0;
  box-sizing: border-box;
}

/* The narrow Admin shell uses a 56px top bar and 62px breadcrumb bar. Keep
 * the shared toolbar and floating headings immediately below that shell. */
@media (max-width: 600px) {
  .admin-table-surface {
    --admin-table-sticky-top: 118px;
  }
}

.admin-table-surface--wide {
  /* A wide table may overflow inside its own horizontal viewport, but the
   * surface itself remains within the page content column.  Using a viewport
   * width here let it run through the right-side page padding on detail
   * routes. */
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Shared grouped activity timeline variant. The route provides event details;
 * this layer owns table geometry, controls, and the contained viewport. */
.admin-activity-table .activity-measure-cell {
  width: 38px;
  min-width: 38px;
  white-space: nowrap;
}

.admin-activity-table .activity-measure-icon,
.admin-activity-filter-picker-panel .activity-measure-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: #65708a;
  vertical-align: middle;
}

.admin-activity-table .activity-measure-icon svg,
.admin-activity-table .activity-measure-icon img,
.admin-activity-filter-picker-panel .activity-measure-icon svg,
.admin-activity-filter-picker-panel .activity-measure-icon img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.admin-activity-table .activity-measure-icon svg,
.admin-activity-filter-picker-panel .activity-measure-icon svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.admin-activity-table .activity-measure-icon svg .engagement-modal-fill,
.admin-activity-filter-picker-panel .activity-measure-icon svg .engagement-modal-fill { fill: currentColor; stroke: none; }
.admin-activity-table .activity-measure-icon svg .engagement-modal-lines,
.admin-activity-filter-picker-panel .activity-measure-icon svg .engagement-modal-lines { fill: none; stroke: #fff; }
.admin-activity-table .activity-measure-icon.is-modal,
.admin-activity-filter-picker-panel .activity-measure-icon.is-modal { color: rgb(237 172 197); }
.admin-activity-table .activity-measure-icon.is-reply,
.admin-activity-filter-picker-panel .activity-measure-icon.is-reply { color: #5e9dca; }
.admin-activity-table .activity-measure-icon.is-reply svg,
.admin-activity-filter-picker-panel .activity-measure-icon.is-reply svg { fill: currentColor; stroke: none; }
.admin-activity-table .activity-measure-icon.is-email svg,
.admin-activity-filter-picker-panel .activity-measure-icon.is-email svg { width: 14px; height: 14px; }
.admin-activity-table .activity-reading-details { background: #fafafa; }
.admin-activity-table .activity-reading-toggle { padding: 0; border: 0; background: transparent; color: #5b5d6b; cursor: pointer; font: inherit; text-decoration: underline; }
.admin-activity-table:not(.admin-operational-table--content-sized) { min-width: 900px; }
.admin-activity-table td:nth-child(2),
.admin-activity-table td:nth-child(3) { white-space: nowrap; }
.admin-activity-filter-controls { position: relative; }
.admin-activity-filter-picker { position: relative; display: inline-block; }
.admin-activity-filter-picker summary { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #cfc4be; border-radius: 4px; background: #fff; color: #252530; cursor: pointer; font: 400 14px/1.2 Helvetica,Arial,sans-serif; list-style: none; white-space: nowrap; }
.admin-activity-filter-picker summary::-webkit-details-marker { display: none; }
.admin-activity-filter-picker-panel { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; display: grid; min-width: 250px; max-width: min(420px, calc(100vw - 64px)); max-height: min(420px, calc(100vh - 180px)); overflow: auto; padding: 5px; border: 1px solid #cfc4be; border-radius: 4px; background: #fff; box-shadow: 0 6px 18px rgba(45,37,32,.13); }
.admin-activity-filter-picker-panel a { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 9px; color: #252530; font: 400 14px/1.2 Helvetica,Arial,sans-serif; text-decoration: none; white-space: nowrap; }
.admin-activity-filter-picker-panel a:hover,.admin-activity-filter-picker-panel a:focus,.admin-activity-filter-picker-panel a.is-active { background: #f3f1f0; color: #365f4a; outline: 0; }

.admin-activity-detail-modal th { width: 160px; color: #65708a; font-weight: 400; vertical-align: top; }
.admin-activity-detail-modal td { overflow-wrap: anywhere; }
.admin-activity-detail-modal .activity-detail-link { color: #365f4a; text-decoration: none; }
.admin-activity-detail-modal .activity-detail-actions { display: flex; align-items: center; gap: 12px; }
.admin-activity-detail-modal [data-open-activity-reader] { display: inline-flex; align-items: center; justify-content: center; padding: 11px 16px; border-radius: 5px; color: #fff; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; }
.admin-activity-detail-modal [data-open-activity-reader][hidden] { display: none; }

/* Compact delivery activity in email-status dialogs; unlike an operational
 * page table this stays inside the modal and needs no sticky or scroll layer. */
.email-delivery-activity-table { width: 100%; border-collapse: collapse; }
.email-delivery-activity-table th,.email-delivery-activity-table td { padding: 10px 8px; border-bottom: 1px solid #e4e4e9; text-align: left; vertical-align: middle; }
.email-delivery-activity-table th:first-child,.email-delivery-activity-table td:first-child { width: 120px; padding-left: 0; white-space: nowrap; }
.email-delivery-activity-table th:last-child,.email-delivery-activity-table td:last-child { padding-right: 0; }
.email-delivery-activity-table thead th { height: 39px; color: #65708a; font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.email-delivery-activity-table tbody tr:last-child td { border-bottom: 0; }
.email-delivery-activity-empty { color: #65708a; }
.notification-email-delivery-modal .modal-head h2 { font-size: 24px; }
.notification-email-click-count { appearance: none; margin: 0; padding: 0; border: 0; background: none; color: #252530; cursor: pointer; font: inherit; text-decoration: none; }
.notification-email-click-count:hover,
.notification-email-click-count:focus { color: #365f4a; outline: none; text-decoration: none; }

/* Shared operational bug-report variant. The route owns its filter values and
 * status actions; this file owns their table-adjacent presentation. */
.bug-reports-heading { padding-bottom: 10px; }
.bug-report-filter { position: relative; display: inline-block; }
.bug-report-filter-toggle { display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 6px 11px; border: 1px solid #bdc5d5; border-radius: 5px; background: #fff; color: #252530; cursor: pointer; font: 400 14px Helvetica,Arial,sans-serif; }
.bug-report-filter-toggle:hover,.bug-report-filter-toggle:focus { background: #fff; color: #252530; }
.bug-report-filter-count { margin-left: 10px; color: #65708a; }
.bug-report-filter-toggle svg { width: 14px; height: 14px; margin-left: 4px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bug-report-filter-menu { position: absolute; z-index: 10; top: calc(100% + 6px); right: 0; display: none; min-width: 100%; padding: 6px; border: 1px solid #bdc5d5; border-radius: 5px; background: #fff; box-shadow: 0 8px 20px #0002; }
.bug-report-filter.is-open .bug-report-filter-menu { display: block; }
.bug-report-filter-menu a { display: flex; justify-content: space-between; gap: 28px; padding: 9px 10px; color: #252530; font: 400 14px Helvetica,Arial,sans-serif; text-decoration: none; white-space: nowrap; }
.bug-report-filter-menu a span:last-child { color: #65708a; }
.bug-report-filter-menu a:hover,.bug-report-filter-menu a:focus { background: #f3f4f5; color: #252530; }
.bug-report-empty-state { margin-top: 32px; font-size: 18px; }
.bug-report-reader,.bug-report-destination { color: #252530; text-decoration: none; }
.bug-report-reader:hover,.bug-report-reader:focus,.bug-report-destination:hover,.bug-report-destination:focus { color: #365f4a; text-decoration: none; }
.bug-report-body { max-width: 440px; overflow-wrap: anywhere; white-space: pre-wrap; }
.bug-report-row { cursor: pointer; }
.bug-report-row:hover > td { background: #fafafa; }
.bug-report-detail { max-width: 860px; }
.bug-report-detail dl { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 12px 18px; margin: 0; }
.bug-report-detail dt { color: #65708a; }
.bug-report-detail dd { margin: 0; overflow-wrap: anywhere; }
.bug-report-detail-body { margin: 28px 0 0; padding-top: 24px; border-top: 1px solid #e4e4e9; line-height: 1.55; white-space: pre-wrap; }

@media (max-width: 860px) {
  .bug-report-body { max-width: 260px; }
  .bug-report-detail dl { grid-template-columns: 1fr; gap: 4px; }
  .bug-report-detail dd { margin-bottom: 12px; }
}

.admin-table-toolbar {
  position: sticky;
  top: var(--admin-table-sticky-top);
  z-index: 5;
  min-height: 20px;
  margin: 0 -24px 0 0;
  padding: 0 24px 20px 0;
  background: #fff;
  box-sizing: border-box;
}

/* A shared toolbar menu is an active control, so it must remain above a
 * selection-action bar that is temporarily sticky at the bottom of the same
 * surface.  The toolbar itself owns the stacking context; individual routes
 * do not need a menu-specific z-index exception. */
.admin-table-toolbar:has(details[open]) {
  z-index: 7;
}

.admin-table-toolbar--controls {
  padding-top: 10px;
  padding-bottom: 18px;
}

.admin-table-context-menu {
  position: relative;
  display: inline-block;
}

.admin-table-context-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #cfc4be;
  border-radius: 4px;
  background: #fff;
  color: #252530;
  cursor: pointer;
  font: 400 14px/1.2 Helvetica,Arial,sans-serif;
  list-style: none;
  white-space: nowrap;
}

.admin-table-context-menu summary::-webkit-details-marker { display: none; }
.admin-table-context-menu summary::marker { content: ''; }
.admin-table-context-menu-chevron { font-size: 16px; line-height: 1; }

.admin-table-context-menu-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  display: grid;
  min-width: 190px;
  padding: 5px;
  border: 1px solid #cfc4be;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(45,37,32,.13);
}

.admin-table-context-menu-panel a {
  display: block;
  padding: 8px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #252530;
  font: 400 14px/1.2 Helvetica,Arial,sans-serif;
  text-align: left;
  text-decoration: none;
}

.admin-table-context-menu-panel a:hover,
.admin-table-context-menu-panel a:focus { background: #f3f1f0; }

.admin-table-title {
  margin: 0 0 16px;
  color: #65708a;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}

/* A short, read-only summary has the same table vocabulary but no useful
 * sticky transition. It keeps the toolbar element in the markup so the
 * component shape remains uniform, while this shared static variant removes
 * it from the visual layout. */
.admin-table-summary {
  max-width: 1180px;
  margin-top: 32px;
}

.admin-table-summary-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.admin-table-summary-heading .admin-table-title {
  margin: 0;
}

.admin-table-summary-heading > a {
  color: #365f4a;
  font-weight: 600;
}

.admin-table-surface--static {
  margin: 0;
  padding: 24px;
}

.admin-table-surface--static > .admin-table-toolbar {
  display: none;
}

.admin-table-surface--static .admin-operational-table thead th {
  position: static;
}

/* The final breadcrumb is the current page, not a self-link. */
.admin-page-bar .breadcrumbs .admin-breadcrumb-current {
  display: inline-flex;
  align-items: center;
  color: var(--admin-muted);
  font-size: 18px;
  font-weight: 400;
}

/* The page bar belongs to the full workspace edge, not the padded main
 * content column. This also keeps its border continuous with the Admin rail. */
.admin-workspace main .admin-page-bar {
  margin-right: -32px !important;
  margin-left: -32px !important;
}

@media (max-width: 600px) {
  .admin-page-bar .breadcrumbs .admin-breadcrumb-current {
    font-size: 15px;
  }

  .admin-workspace main .admin-page-bar {
    margin-right: -16px !important;
    margin-left: -16px !important;
  }
}

.admin-section-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 26px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-section-tabs a {
  display: inline-flex;
  align-items: baseline;
  padding: 13px 22px;
  color: #252530;
  font-weight: 600;
  text-decoration: none;
}

.admin-section-tabs a:hover,
.admin-section-tabs a:focus {
  color: #365f4a;
  outline: none;
}

.admin-section-tabs .admin-tab-count {
  margin-left: 5px;
  color: #65708a;
  font-size: 14px;
  font-weight: 400;
}

.admin-section-tabs .is-active {
  position: relative;
  margin: 0 0 -1px;
  padding-top: 10px;
  border: 1px solid var(--admin-line);
  border-top: 3px solid #5c874c;
  background: transparent;
  color: #252530;
}

.admin-section-tabs .is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: #f6f6f6;
  content: "";
}

.admin-table-empty-state {
  padding-top: 18px;
}

/* Shared ordinary-table vocabulary. */
.admin-reader-link {
  color: #252530;
  text-decoration: none;
}

.admin-operational-table--circle-members a[href^="/readers/email-settings/"],
.admin-operational-table--notification-schedule a[href^="/reading-circles/members/"],
.admin-operational-table--notification-staged a[href^="/reading-circles/members/"],
.admin-operational-table--notification-sent a[href^="/reading-circles/members/"],
[data-automatic-delivery-outcomes] a[href^="/reading-circles/members/"] {
  color: #252530;
  text-decoration: none;
}

.admin-operational-table--circle-members .circle-member-email-schedule {
  white-space: nowrap;
}

.admin-reader-link:hover,
.admin-reader-link:focus {
  color: #365f4a;
  text-decoration: none;
}

.admin-operational-table--circle-members a[href^="/readers/email-settings/"]:hover,
.admin-operational-table--circle-members a[href^="/readers/email-settings/"]:focus,
.admin-operational-table--notification-schedule a[href^="/reading-circles/members/"]:hover,
.admin-operational-table--notification-schedule a[href^="/reading-circles/members/"]:focus,
.admin-operational-table--notification-staged a[href^="/reading-circles/members/"]:hover,
.admin-operational-table--notification-staged a[href^="/reading-circles/members/"]:focus,
.admin-operational-table--notification-sent a[href^="/reading-circles/members/"]:hover,
.admin-operational-table--notification-sent a[href^="/reading-circles/members/"]:focus,
[data-automatic-delivery-outcomes] a[href^="/reading-circles/members/"]:hover,
[data-automatic-delivery-outcomes] a[href^="/reading-circles/members/"]:focus {
  color: #365f4a;
  text-decoration: none;
}

.admin-table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: 1px solid #bdc5d5;
  border-radius: 5px;
  background: #fff;
  color: #252530;
  font: 600 14px/1.2 Helvetica,Arial,sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.admin-table-action:hover,
.admin-table-action:focus {
  background: #f3f4f5;
  color: #252530;
  outline: none;
  text-decoration: none;
}

.admin-table-action--primary {
  border-color: var(--admin-green);
  background: var(--admin-green);
  color: #fff;
}

.admin-table-action--primary:hover,
.admin-table-action--primary:focus {
  border-color: #507743;
  background: #507743;
  color: #fff;
}

.admin-table-actions {
  width: 170px;
  white-space: nowrap;
}

.admin-table-action-group {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
}

.admin-table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.admin-table-sort-link:hover,
.admin-table-sort-link:focus {
  color: #365f4a;
  outline: none;
  text-decoration: none;
}

.admin-table-sort-indicator {
  font-size: 14px;
  line-height: 1;
}

.admin-table-row--interactive {
  cursor: pointer;
}

.admin-table-row--interactive:hover > td,
.admin-table-row--interactive:focus > td {
  background: #fafafa;
}

.admin-email-modal {
  width: min(860px, 92vw);
}

.admin-email-modal .modal-head {
  padding: 24px 28px 16px;
}

.admin-email-modal .modal-head h2 {
  font-size: 24px;
}

.admin-email-modal .close {
  font-size: 32px;
}

.admin-email-modal .modal-body {
  padding: 8px 28px 26px;
}

.admin-email-modal .modal-actions {
  padding: 18px 28px;
  background: #edf2fb;
}

.admin-email-modal label {
  display: block;
  color: #252530;
  font-size: 13px;
  font-weight: 600;
}

.admin-email-modal label input,
.admin-email-modal label textarea {
  margin-top: 6px;
}

.admin-email-modal input[readonly],
.admin-email-modal textarea[readonly] {
  background: #f3f4f6;
  border-color: #d9dde4;
  color: #747b88;
  cursor: default;
}

.admin-email-modal textarea {
  min-height: 250px;
  resize: vertical;
  font: 400 16px/1.45 Helvetica,Arial,sans-serif;
}

.admin-table-split-action {
  position: relative;
  display: inline-flex;
  vertical-align: top;
}

.admin-table-split-action .admin-table-action {
  border-radius: 5px 0 0 5px;
}

.admin-table-action-toggle {
  min-width: 32px;
  padding: 6px 7px;
  border: 1px solid #bdc5d5;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  background: #fff;
  color: #252530;
  cursor: pointer;
  font: 600 14px/1.2 Helvetica,Arial,sans-serif;
}

.admin-table-action-toggle:hover,
.admin-table-action-toggle:focus,
.admin-table-split-action.is-open .admin-table-action-toggle {
  background: #f3f4f5;
  color: #252530;
  outline: none;
}

.admin-table-split-action.is-open .admin-table-action-menu {
  display: block;
}

.admin-table-action-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  right: 0;
  display: none;
  min-width: 136px;
  padding: 6px 14px;
  border: 1px solid #bdc5d5;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 5px 16px #0002;
}

.admin-table-action-menu button {
  display: block;
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #252530;
  cursor: pointer;
  font: 400 16px/1.2 Helvetica,Arial,sans-serif;
  text-align: left;
  white-space: nowrap;
}

.admin-table-action-menu button:hover,
.admin-table-action-menu button:focus {
  background: #f3f4f5;
  outline: none;
}

/* Compact counted status filters above an operational table. */
.admin-table-filter-picker { position: relative; display: inline-block; }
.admin-table-toolbar--controls .admin-table-filter-picker + .admin-table-filter-picker { margin-left: 10px; }
.admin-table-filter-picker summary { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #cfc4be; border-radius: 4px; background: #fff; color: #252530; cursor: pointer; font: 400 14px/1.2 Helvetica,Arial,sans-serif; list-style: none; white-space: nowrap; }
.admin-table-filter-picker summary::-webkit-details-marker { display: none; }
.admin-table-filter-picker-chevron { width: 14px; height: 14px; margin-left: 2px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; transition: transform .14s ease; }
.admin-table-filter-picker[open] .admin-table-filter-picker-chevron { transform: rotate(180deg); }
.admin-table-filter-picker summary:hover,.admin-table-filter-picker[open] summary { border-color: #aa9d97; }
.admin-table-filter-picker-panel { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; display: grid; min-width: 250px; width: max-content; max-width: min(420px,calc(100vw - 64px)); max-height: min(420px,calc(100vh - 180px)); overflow: auto; padding: 5px; border: 1px solid #cfc4be; border-radius: 4px; background: #fff; box-shadow: 0 6px 18px rgba(45,37,32,.13); }
.admin-table-filter-picker-panel a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; box-sizing: border-box; width: 100%; padding: 8px 9px; color: #252530; font: 400 14px/1.2 Helvetica,Arial,sans-serif; text-decoration: none; white-space: nowrap; }
.admin-table-filter-picker-panel a:hover,.admin-table-filter-picker-panel a:focus,.admin-table-filter-picker-panel a.is-active { background: #f3f1f0; color: #365f4a; outline: 0; }
.admin-table-filter-picker-count { color: #9b9693; font-size: 13px; text-align: right; }

.admin-table-scroll {
  overflow: visible;
}

/*
 * An ordinary table participates in normal document scrolling. Its headings
 * reach the Admin breadcrumb boundary before becoming sticky; the viewport is
 * deliberately not a second vertical scroll area.
 */
.admin-table-viewport {
  min-width: 0;
  max-width: 100%;
}

/*
 * Wide ordinary tables need two layers. An element with overflow-x:auto is a
 * sticky containing scroll mechanism, so putting a native sticky thead inside
 * it makes the heading leave with the page. The component keeps the heading in
 * normal page flow and gives only the rows a horizontal scroller; JavaScript
 * synchronises their horizontal position.
 */
.admin-horizontal-table {
  --admin-table-sticky-shadow-width: 8px;
  --admin-table-sticky-shadow-color: rgb(37 37 48 / .032);
  min-width: 0;
}

.admin-horizontal-table__header {
  position: sticky;
  top: calc(var(--admin-table-sticky-top) + var(--admin-table-toolbar-height));
  z-index: 2;
  background: #fff;
}

.admin-horizontal-table__header-clip {
  max-width: 100%;
  overflow-x: clip;
  overflow-y: visible;
}

.admin-horizontal-table__header-table {
  margin: 0;
  transform: translateX(var(--admin-horizontal-table-offset, 0px));
  transform-origin: left top;
}

.admin-horizontal-table__header-table thead th {
  position: static;
}

.admin-horizontal-table__body {
  max-width: 100%;
  overflow-x: auto;
  /* This component deliberately owns horizontal overflow only. A vertical
   * scroll owner here would make its sticky header attach to the table rather
   * than to the page breadcrumb boundary. */
  overflow-y: clip;
  overscroll-behavior-x: contain;
}

.admin-horizontal-table__body-table {
  margin: 0;
}

.admin-table-surface--horizontal .admin-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.admin-table-surface--horizontal .admin-operational-table thead th {
  position: static;
}

.admin-operational-table {
  /* Own the ordinary-table baseline. The old Admin shell still has generic
   * table/th/td rules; a shared operational table must remain correct when
   * those legacy selectors are eventually removed. */
  width: 100%;
  /* Separate borders give sticky header cells their own paint layer. With
   * collapsed borders, body cells can be painted above a page-sticky header
   * during the moment it meets the breadcrumb boundary. */
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  box-sizing: border-box;
}

.admin-operational-table--auto {
  table-layout: auto;
}

.admin-operational-table th,
.admin-operational-table td {
  box-sizing: border-box;
  padding: 10px;
  border-bottom: 1px solid #e4e4e9;
  text-align: left;
  /* Record values start together when a neighbouring cell wraps. */
  vertical-align: top;
}

.admin-operational-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Do not rely on the legacy global input[type=checkbox] reset. Selection
 * controls are part of the table component's column geometry. */
.admin-operational-table input[type="checkbox"],
.admin-matrix input[type="checkbox"] {
  display: inline;
  width: auto;
  margin: 0 7px 0 0;
  padding: 0;
  vertical-align: middle;
}

.admin-operational-table thead th {
  position: sticky;
  top: calc(var(--admin-table-sticky-top) + var(--admin-table-toolbar-height));
  z-index: 4;
  height: 39px;
  background: #fff;
  color: #65708a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.admin-operational-table .admin-table-column--action,
.admin-operational-table .admin-table-column--count,
.admin-operational-table .admin-table-column--status,
.admin-operational-table .admin-table-column--timestamp {
  width: 1%;
  white-space: nowrap;
}

.admin-operational-table .admin-table-column--identity {
  min-width: 180px;
}

.admin-operational-table col.admin-table-column--checkbox {
  width: 48px;
}

.admin-operational-table col.admin-table-column--reader {
  width: 220px;
}

.admin-operational-table col.admin-table-column--timestamp {
  /* Accommodates both a compact date value and the "Scheduled for" heading. */
  width: 152px;
}

.admin-operational-table col.admin-table-column--count {
  width: 72px;
}

.admin-operational-table col.admin-table-column--subject {
  width: 400px;
}

.admin-operational-table col.admin-table-column--status {
  width: 108px;
}

.admin-operational-table col.admin-table-column--timezone {
  width: 250px;
}

.admin-operational-table col.admin-table-column--action {
  width: 136px;
}

.admin-operational-table col.admin-table-column--action-group {
  /* "View email" plus its chevron, including the cell's horizontal padding. */
  width: 160px;
}

.admin-operational-table--wide {
  min-width: 960px;
}

.admin-operational-table--horizontal {
  /*
   * This is a genuine horizontal table: its semantic column tracks total
   * 1204px. Giving both the sticky heading table and the scrolling row table
   * that same concrete width prevents the browser from redistributing spare
   * space differently between the two independent tables.
   */
  width: 1204px;
  min-width: 1204px;
}

/*
 * Wide comparison / selection matrices
 *
 * A matrix owns both axes through this viewport.  Consumers opt in with the
 * semantic classes below; they provide metric cells and data, not another
 * sticky or horizontal-scroll implementation.
 */
.admin-matrix-surface {
  margin: 12px 0 18px;
  padding: 24px;
  border: 1px solid var(--admin-line);
  background: #fff;
  box-sizing: border-box;
}

.admin-matrix-toolbar {
  display: flex;
  align-items: flex-start;
  min-height: 38px;
  margin: 0 0 18px;
}

.admin-matrix-viewport {
  position: relative;
  max-width: 100%;
  max-height: min(640px, calc(100vh - 280px));
  overflow: auto;
  overscroll-behavior: contain;
}

.admin-matrix {
  --admin-table-sticky-shadow-width: 8px;
  --admin-table-sticky-shadow-color: rgb(37 37 48 / .032);
  --admin-matrix-select-width: 44px;
  --admin-matrix-reader-width: clamp(200px, 22vw, 320px);
  width: 100%;
  min-width: var(--admin-matrix-min-width, 760px);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  isolation: isolate;
  box-sizing: border-box;
}

.admin-matrix th,
.admin-matrix td {
  box-sizing: border-box;
  padding: 14px 6px;
  border-bottom: 1px solid #e4e4e9;
  background: #fff;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.admin-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  padding-top: 16px;
  padding-bottom: 8px;
  border-bottom-color: var(--admin-line);
  color: #65708a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.admin-matrix--select-reader th:first-child,
.admin-matrix--select-reader td:first-child {
  position: sticky;
  left: 0;
  z-index: 7;
  width: var(--admin-matrix-select-width);
  min-width: var(--admin-matrix-select-width);
  max-width: var(--admin-matrix-select-width);
}

.admin-matrix--select-reader th:nth-child(2),
.admin-matrix--select-reader td:nth-child(2) {
  position: sticky;
  left: var(--admin-matrix-select-width);
  z-index: 7;
  width: var(--admin-matrix-reader-width);
  min-width: var(--admin-matrix-reader-width);
  max-width: var(--admin-matrix-reader-width);
  padding-left: 16px;
  text-align: left;
}

.admin-matrix-viewport.is-admin-table-scrolled-x .admin-matrix--select-reader thead th:nth-child(2)::after {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 100%;
  /* One uninterrupted depth cue belongs to the matrix component, rather than
   * a shadow on every row. Keep it deliberately quieter than a divider. */
  width: var(--admin-table-sticky-shadow-width);
  height: 100vh;
  background: linear-gradient(90deg, var(--admin-table-sticky-shadow-color), transparent);
  content: "";
  pointer-events: none;
}

.admin-matrix--select-reader thead th:first-child,
.admin-matrix--select-reader thead th:nth-child(2) {
  z-index: 9;
}

.admin-matrix tbody tr:hover > td {
  background: #fafafa;
}

.admin-matrix tbody tr:focus-visible {
  outline: 2px solid #365f4a;
  outline-offset: -2px;
}

.admin-matrix tbody tr:focus-visible > td {
  background: #fafafa;
}

@media (max-width: 700px) {
  .admin-matrix-surface {
    padding: 18px;
  }

  .admin-matrix-viewport {
    max-height: min(620px, calc(100vh - 230px));
  }

  .admin-matrix {
    --admin-matrix-reader-width: min(260px, 62vw);
  }
}

/*
 * Ripple recipient matrix
 *
 * The route supplies only data attributes and these semantic variant classes.
 * The common matrix owns the viewport, sticky heading, frozen columns, and
 * sizing; these rules are limited to Ripple's picker, progress, and state
 * vocabulary.
 */
.admin-matrix--ripple {
  --admin-matrix-select-width: 36px;
}

.admin-matrix--ripple .ripple-select-column {
  width: var(--admin-matrix-select-width);
}

.admin-matrix--ripple .ripple-percentage-column {
  width: 72px;
}

.admin-matrix--ripple .ripple-last-column {
  width: 64px;
}

.admin-matrix--ripple .ripple-chapter-column {
  width: 42px;
}

.admin-matrix--ripple .ripple-status-column {
  width: 126px;
}

.admin-matrix--ripple th:nth-child(2),
.admin-matrix--ripple td:nth-child(2),
.admin-matrix--ripple thead th:last-child,
.admin-matrix--ripple tbody td:last-child {
  text-align: left;
}

.ripple-picker {
  position: relative;
  display: inline-block;
  margin: 0;
}

.ripple-picker[open] {
  z-index: 20;
}

.ripple-picker summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #cfc4be;
  border-radius: 4px;
  background: #fff;
  color: #252530;
  cursor: pointer;
  font: 400 14px/1.2 Helvetica,Arial,sans-serif;
  list-style: none;
  white-space: nowrap;
}

.ripple-picker summary::-webkit-details-marker {
  display: none;
}

.ripple-picker-chevron {
  width: 14px;
  height: 14px;
  margin-left: 2px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transition: transform .14s ease;
}

.ripple-picker[open] .ripple-picker-chevron {
  transform: rotate(180deg);
}

.ripple-picker summary:hover,
.ripple-picker[open] summary {
  border-color: #aa9d97;
}

.ripple-picker-panel {
  position: absolute;
  z-index: 21;
  top: calc(100% + 5px);
  left: 0;
  display: grid;
  min-width: 224px;
  width: max-content;
  padding: 5px;
  border: 1px solid #cfc4be;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(45,37,32,.13);
}

.ripple-picker-panel button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  background: transparent;
  color: #252530;
  cursor: pointer;
  font: 400 14px/1.2 Helvetica,Arial,sans-serif;
  text-align: left;
  white-space: nowrap;
}

.ripple-picker-panel button:hover,
.ripple-picker-panel button:focus,
.ripple-picker-panel button.is-active {
  background: #f3f1f0;
  outline: 0;
}

.ripple-picker-panel button.is-active {
  color: #365f4a;
}

.ripple-picker-count {
  color: #9b9693;
  font-size: 13px;
  text-align: right;
}

.ripple-reader-link:hover,
.ripple-reader-link:focus {
  color: #365f4a;
  text-decoration: none;
}

.ripple-reader-link {
  color: inherit;
  text-decoration: none;
}

.admin-matrix--ripple .ripple-chapter {
  background: #eef7fc;
}

.admin-matrix--ripple tbody tr:hover > td,
.admin-matrix--ripple tbody tr:focus-visible > td {
  background: #fafafa;
}

.admin-matrix--ripple tbody tr:hover .ripple-chapter,
.admin-matrix--ripple tbody tr:focus-visible .ripple-chapter {
  background: #e2f1fa;
}

.admin-matrix--ripple tbody tr:hover,
.admin-matrix--ripple tbody tr:focus-visible {
  --admin-table-sticky-cell-background: #fafafa;
}

/*
 * The leading selection and Reader cells are sticky. Give those layers the
 * same state background as the rest of their row; otherwise their opaque
 * base background can mask the row hover/focus cue while horizontal scrolling.
 */
.admin-matrix--select-reader tbody td:first-child,
.admin-matrix--select-reader tbody td:nth-child(2) {
  background: var(--admin-table-sticky-cell-background, #fff);
}

.admin-matrix--ripple tr.is-selected > td,
.admin-matrix--ripple tr.is-selected:hover > td {
  background: #eef6ee;
}

.admin-matrix--ripple tr.is-selected {
  --admin-table-sticky-cell-background: #eef6ee;
}

.admin-matrix--ripple tr.is-selected > .ripple-chapter,
.admin-matrix--ripple tr.is-selected:hover > .ripple-chapter {
  background: #e4f1e7;
}

.admin-matrix--ripple tr.is-selected:hover > td {
  background: #e4f1e7;
}

.admin-matrix--ripple tr.is-selected:hover {
  --admin-table-sticky-cell-background: #e4f1e7;
}

.admin-matrix--ripple tr.is-selected:hover > .ripple-chapter {
  background: #d8eadc;
}

.admin-matrix--ripple tbody tr {
  cursor: pointer;
}

.admin-matrix--ripple input:disabled {
  opacity: .45;
}

.ripple-dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1px solid #cfd4dc;
  border-radius: 50%;
  vertical-align: middle;
}

.ripple-dot.is-partial {
  border-color: #d6a62f;
  background: conic-gradient(#e5bd45 calc(var(--progress-ratio) * 1turn),#fff 0);
}

.ripple-dot.is-complete {
  border-color: #63804f;
  background: #63804f;
}

.ripple-disabled {
  color: #65708a;
  font-size: 13px;
}

.ripple-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 0;
  padding: 14px 16px;
  background: #f4f8fb;
}

/* Selection actions remain part of the table surface rather than a page-level
 * fixed control. A feature can opt in with the semantic surface modifier and
 * toggle this state only while it has a selection to act on. */
.admin-table-selection-bar {
  position: relative;
  z-index: 1;
}

.admin-table-surface--selection-actions.is-admin-table-selection-active .admin-table-selection-bar {
  position: sticky;
  bottom: 0;
  z-index: 6;
  box-shadow: 0 -8px 16px rgb(37 37 48 / 4%);
}

.ripple-selection p {
  margin: 0;
}

.ripple-selection-actions {
  display: flex;
  gap: 12px;
}

.ripple-confirm-modal {
  width: min(510px,92vw);
}

.ripple-confirm-modal .modal-head {
  padding: 24px 28px 16px;
}

.ripple-confirm-modal .modal-head h2 {
  font-size: 24px;
}

.ripple-confirm-modal .modal-body {
  padding: 8px 28px 26px;
}

.ripple-confirm-modal .modal-body p {
  margin: 0;
}

.ripple-confirm-modal .modal-actions {
  padding: 18px 28px;
  background: #edf2fb;
}

.ripple-tooltip {
  position: relative;
}

.ripple-tooltip::after {
  position: fixed;
  z-index: 100;
  top: var(--ripple-tooltip-top,0);
  left: var(--ripple-tooltip-left,0);
  display: none;
  max-width: min(220px,calc(100vw - 16px));
  padding: 6px 8px;
  border-radius: 3px;
  background: #302d2b;
  color: #fff;
  content: attr(data-ripple-tooltip);
  font: 400 12px/1.3 Helvetica,Arial,sans-serif;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  transform: translateX(-50%);
  white-space: normal;
  pointer-events: none;
}

.ripple-tooltip[data-ripple-tooltip-position="above"]::after {
  transform: translate(-50%,-100%);
}

.ripple-tooltip:hover::after,
.ripple-tooltip:focus-visible::after {
  display: block;
}

@media (max-width: 700px) {
  .ripple-selection {
    align-items: flex-start;
    flex-direction: column;
  }

  .ripple-selection-actions {
    width: 100%;
  }

  .ripple-selection-actions button {
    flex: 1;
  }
}
