/* ==========================================================================
   EOS record — nested subnav, page shell, cards, tables and the list builders
   the record is configured from.

   The shell is the firm record's, at the same measurements (see firm_show.css):
   these are pages of one record with a nav down the left, and the two should
   read as the same kind of screen. The classes are the EOS record's own rather
   than borrowed, so a change to how a firm record's tabs look does not silently
   restyle a page about how the practice runs.
   ========================================================================== */

/* --- Shell layout -------------------------------------------------------- */
.eos-show {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
}

.eos-show__main {
  min-width: 0;
}

.eos-show__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.eos-show__heading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.eos-show__title {
  margin: 0;
  font-size: var(--font-size-xxlarge);
  font-weight: 600;
  color: var(--color-primary-dark);
}

/* The quarter the whole record is read against. Quiet — it is a fact about the
   page, not a control. */
.eos-show__cycle {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--tint-navy-06);
  color: var(--color-text-muted);
  font-size: var(--font-size-medium);
  font-family: var(--font-family-bold);
  font-weight: 600;
  white-space: nowrap;
}

.eos-show__header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.eos-show__body {
  min-width: 0;
}

/* --- Subnav -------------------------------------------------------------- */
.eos-subnav {
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-4));
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.eos-subnav__heading {
  margin: 0 0 var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-small);
  font-weight: 600;
  letter-spacing: var(--label-letter-spacing);
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.eos-subnav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eos-subnav__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--font-size-medium);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.eos-subnav__link:hover {
  background: var(--tint-navy-04);
  color: var(--color-primary-dark);
}

.eos-subnav__link:hover .eos-subnav__icon {
  color: var(--color-primary-dark);
}

.eos-subnav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--tint-navy-06);
  color: var(--color-text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.eos-subnav__icon .minor-icon {
  width: 16px;
  height: 16px;
}

.eos-subnav__label {
  min-width: 0;
}

.eos-subnav__link--active {
  background: var(--tint-green-16);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.eos-subnav__link--active .eos-subnav__icon {
  background: var(--color-primary-green);
  color: var(--color-white);
}

/* What is still open on the two lists the team works from. */
.eos-subnav__badge {
  margin-left: auto;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  background: var(--tint-navy-10);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
}

.eos-subnav__link--active .eos-subnav__badge {
  background: var(--color-white);
}

/* Settings is where the record is configured rather than another part of it to
   read, so it sits below a rule at the foot — as the firm record's sign-out
   does. */
.eos-subnav__footer {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

/* --- Body layouts -------------------------------------------------------- */
.eos-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

.eos-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.eos-dashboard__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

/* --- Card primitive ------------------------------------------------------ */
.eos-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.eos-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.eos-card__heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.eos-card__title {
  margin: 0;
  font-size: var(--font-size-xlarge);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.eos-card__subtitle,
.eos-card__blurb,
.eos-card__note,
.eos-card__empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-medium);
  line-height: 1.6;
}

.eos-card__note {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-yellow-100);
  color: var(--color-warning-dark);
}

.eos-card__meta {
  color: var(--color-text-faint);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
  white-space: nowrap;
}

.eos-card__header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.eos-card__actions {
  display: flex;
  gap: var(--space-2);
}

.eos-card__link {
  color: var(--color-text-muted);
  font-size: var(--font-size-medium);
  font-family: var(--font-family-bold);
  text-decoration: none;
  white-space: nowrap;
}

.eos-card__link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* --- V/TO ---------------------------------------------------------------- */
.eos-vto {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
  align-items: start;
}

.eos-vto__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

.eos-vto__label {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-small);
  font-weight: 600;
  letter-spacing: var(--label-letter-spacing);
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.eos-vto__sublabel {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--font-size-small);
  font-weight: 600;
  letter-spacing: var(--label-letter-spacing);
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.eos-vto__sublabel:first-of-type {
  margin-top: 0;
}

.eos-vto__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.eos-vto__text,
.eos-vto__empty {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-medium);
  line-height: 1.6;
}

.eos-vto__empty {
  color: var(--color-text-faint);
}

.eos-vto__pairs {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}

.eos-vto__pair {
  display: flex;
  gap: var(--space-2);
  font-size: var(--font-size-medium);
  line-height: 1.6;
}

.eos-vto__pair dt {
  flex-shrink: 0;
  font-family: var(--font-family-bold);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.eos-vto__pair dd {
  margin: 0;
  min-width: 0;
  color: var(--color-text);
}

/* The three horizons read the same way — they are the same statement at three
   distances, and only the date separates them. */
.eos-horizon {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
}

.eos-horizon__body {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-medium);
  line-height: 1.6;
}

.eos-horizon__date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--tint-navy-06);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
}

.eos-horizon__date-icon {
  display: inline-flex;
  color: var(--color-primary-green);
}

/* --- Record tables ------------------------------------------------------- */
.eos-records__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.eos-records__title {
  margin: 0;
  font-size: var(--font-size-large);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.eos-records__controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.eos-records .table-container {
  margin-bottom: 0;
}

.eos-records__link {
  color: var(--color-primary-dark);
  font-family: var(--font-family-bold);
  font-weight: 600;
  text-decoration: none;
}

.eos-records__link:hover {
  text-decoration: underline;
}

/* The Notes column on the issues and actions tables: how many updates the
   thread holds, and the way into it. A quiet chip rather than a button — it is
   a count first — that reads as a link on hover. */
.eos-records__notes {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--tint-navy-06);
  color: var(--color-primary-dark);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.eos-records__notes:hover {
  background: var(--color-primary-dark);
  color: var(--color-surface);
}

/* No thread yet: still the way in — that is where the first update is
   written — but nothing to draw the eye to. */
.eos-records__notes--empty {
  background: transparent;
  color: var(--color-text-faint);
}

/* A summary is a sentence rather than a value, so it is allowed to be the wide
   column and to wrap. */
.eos-records__summary {
  max-width: 480px;
  white-space: normal;
  color: var(--color-text-muted);
}

/* Current / Historic / All, above the goals table. Same control as the
   Active / Deleted switch below it (see .deletion-tabs in table.css), because
   they are the same kind of choice and sit one above the other. */
.eos-cycle-tabs {
  display: inline-flex;
  align-self: flex-start;
  flex: 0 0 auto;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  padding: 3px;
  background-color: var(--tint-navy-06);
  border-radius: var(--radius-md);
}

.eos-cycle-tabs__tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
  text-decoration: none;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.eos-cycle-tabs__tab:hover {
  color: var(--color-primary-dark);
}

.eos-cycle-tabs__tab--current {
  background-color: var(--color-surface);
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-sm), inset 0 -2px 0 var(--color-primary-green);
}

/* --- Progress bar -------------------------------------------------------- */
/* The number is spelled out beside the bar: the value is set by hand, so it is
   a figure somebody chose rather than a length to be estimated. */
.eos-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 140px;
}

.eos-progress__track {
  flex: 1 1 auto;
  height: 8px;
  min-width: 72px;
  border-radius: var(--radius-full);
  background: var(--tint-navy-10);
  overflow: hidden;
}

.eos-progress__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-primary-green);
}

.eos-progress__value {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
  font-variant-numeric: tabular-nums;
}

/* --- Dashboard tiles and mini lists -------------------------------------- */
.eos-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.eos-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.eos-stat:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.eos-stat__value {
  font-size: var(--font-size-xxxlarge);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-primary-dark);
}

.eos-stat__label {
  color: var(--color-text-muted);
  font-size: var(--font-size-medium);
}

.eos-stat__note {
  color: var(--color-text-faint);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
}

.eos-stat--danger .eos-stat__note {
  color: var(--color-danger);
}

.eos-mini-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eos-mini-list__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.eos-mini-list__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.eos-mini-list__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.eos-mini-list__title,
.eos-mini-list__title a {
  color: var(--color-primary-dark);
  font-size: var(--font-size-medium);
  font-weight: 600;
  text-decoration: none;
}

.eos-mini-list__title a:hover {
  text-decoration: underline;
}

.eos-mini-list__meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  white-space: nowrap;
}

.eos-mini-list__meta--danger {
  color: var(--color-danger);
  font-family: var(--font-family-bold);
}

/* --- Record details ------------------------------------------------------ */
.eos-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  margin: 0;
}

.eos-details__pair {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.eos-details__pair dt {
  font-size: var(--font-size-small);
  font-weight: 600;
  letter-spacing: var(--label-letter-spacing);
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.eos-details__pair dd {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-medium);
}

.eos-details__value--danger {
  color: var(--color-danger);
  font-family: var(--font-family-bold);
}

.eos-details__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* --- Meetings ------------------------------------------------------------ */
.eos-start-meeting {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* The custom select is `width: 100%` by default, which on a flex row of two
   controls takes the whole line and pushes the button under it. Here it is one
   of a pair, so it is given a width of its own and told not to grow. */
.eos-start-meeting__select {
  flex: 0 0 auto;
  width: 220px;
}

.eos-agenda {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.eos-agenda__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
}

.eos-agenda__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.eos-agenda__position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--tint-navy-10);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
}

.eos-agenda__heading {
  flex: 1 1 auto;
  min-width: 0;
}

.eos-agenda__title {
  margin: 0;
  font-size: var(--font-size-medium);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.eos-agenda__details {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  line-height: 1.6;
}

.eos-agenda__slot {
  flex-shrink: 0;
  color: var(--color-text-faint);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
}

/* --- Agenda cards on the settings page ----------------------------------- */
.eos-agenda-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.eos-agenda-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
}

.eos-agenda-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.eos-agenda-card__title {
  margin: 0;
  font-size: var(--font-size-large);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.eos-agenda-card__total {
  color: var(--color-text-faint);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
  white-space: nowrap;
}

.eos-agenda-card__blurb,
.eos-agenda-card__empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  line-height: 1.6;
}

.eos-agenda-card__empty {
  color: var(--color-text-faint);
}

.eos-agenda-card__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding-left: var(--space-5);
  color: var(--color-text);
  font-size: var(--font-size-medium);
}

.eos-agenda-card__item-slot {
  margin-left: var(--space-2);
  color: var(--color-text-faint);
  font-size: var(--font-size-small);
}

.eos-agenda-card__actions {
  margin-top: auto;
  padding-top: var(--space-2);
}

/* --- Forms and the list builders ----------------------------------------- */
.eos-form__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.eos-form__section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.eos-form__section-title {
  margin: 0;
  font-size: var(--font-size-medium);
  font-weight: 600;
  letter-spacing: var(--label-letter-spacing);
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.eos-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.eos-form__hint {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  line-height: 1.5;
}

.eos-form__field-error {
  margin: var(--space-1) 0 0;
  color: var(--color-danger);
  font-size: var(--font-size-small);
}

.eos-form__errors {
  padding: var(--space-4);
  border: 1px solid var(--tint-danger-16);
  border-radius: var(--radius-md);
  background: var(--tint-danger-10);
  color: var(--color-danger);
}

.eos-form__errors-title {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-medium);
  color: var(--color-danger);
}

.eos-form__errors ul {
  margin: 0;
  padding-left: var(--space-5);
  font-size: var(--font-size-medium);
}

.eos-builder {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.eos-builder--stacked {
  gap: var(--space-3);
}

.eos-builder__row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
}

.eos-builder__row--stacked {
  flex-direction: column;
  gap: var(--space-3);
}

.eos-builder__row--dragging {
  opacity: 0.5;
  border-color: var(--color-primary-green);
}

.eos-builder__row-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.eos-builder__row-label {
  flex: 1 1 auto;
  font-size: var(--font-size-small);
  font-weight: 600;
  letter-spacing: var(--label-letter-spacing);
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.eos-builder__row-fields {
  display: flex;
  gap: var(--space-3);
  width: 100%;
}

.eos-builder__field {
  flex: 1 1 auto;
  min-width: 0;
}

.eos-builder__field--narrow {
  flex: 0 0 110px;
}

.eos-builder__handle {
  flex-shrink: 0;
  margin-top: var(--space-1);
  padding: 0 var(--space-1);
  border: 0;
  background: none;
  color: var(--color-text-faint);
  font-size: var(--font-size-large);
  line-height: 1;
  cursor: grab;
}

.eos-builder__row--stacked .eos-builder__handle {
  margin-top: 0;
}

.eos-builder__handle:active {
  cursor: grabbing;
}

/* --- Empty states -------------------------------------------------------- */
.eos-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-10) var(--space-6);
  text-align: center;
}

.eos-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--tint-green-16);
  color: var(--color-primary-green);
}

.eos-empty__title {
  margin: 0;
  font-size: var(--font-size-large);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.eos-empty__blurb {
  margin: 0;
  max-width: 44ch;
  color: var(--color-text-muted);
  font-size: var(--font-size-medium);
  line-height: 1.6;
}

/* Every page of the EOS record fills the viewport rather than growing past it,
   the way a firm record's does: the breadcrumb, page header and subnav stay put
   and only the body scrolls.

   A record-table page hands that scroll on to the table, so its search and
   pagination stay put and only the rows move — which is what `fill` opts into
   (see eos/shared/_shell).

   Wide screens only: below 1024px the shell stacks into a single column with
   the subnav above the content, which has no room to pin anything. */
@media (min-width: 1025px) {
  turbo-frame#main_content:has(> .eos-show) {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .eos-show {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
    grid-template-rows: minmax(0, 1fr);
  }

  .eos-show__nav {
    min-height: 0;
  }

  /* Sticky is pointless once the page itself no longer scrolls: the panel takes
     the column's height and scrolls its own list. */
  .eos-subnav {
    position: static;
    display: flex;
    flex-direction: column;
    max-height: 100%;
  }

  .eos-subnav__list {
    min-height: 0;
    overflow-y: auto;
  }

  .eos-subnav__footer {
    flex: 0 0 auto;
  }

  .eos-show__main {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .eos-show__header {
    flex: 0 0 auto;
  }

  .eos-show__body {
    flex: 1 1 auto;
    min-height: 0;
    /* Only ever vertically: a card's shadow must not put a scrollbar under it. */
    overflow: hidden auto;
  }

  .eos-show--fill .eos-show__body,
  .eos-show--fill .eos-records {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  /* The frame, and the bulk-select form every one of these tables is wrapped in
     (see shared/_bulk_deletion_form) — which sits between the frame and the
     scroller exactly as it does on an index page (see .index-page in
     table.css). Both have to pass the height on. Left out, the form grows to
     the full height of the table and the shell's `overflow: hidden` clips it:
     no scrollbar, and the rows past the fold and the pagination under them out
     of reach. The :has() keeps a form with no table in it from claiming any. */
  .eos-show--fill .eos-records > turbo-frame,
  .eos-show--fill .eos-records form:has(.table-container) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .eos-show--fill .eos-records .table-container {
    flex: 1 1 auto;
    min-height: 180px;
  }

  .eos-show--fill .eos-records .table-pagination {
    flex: 0 0 auto;
  }
}

@media (max-width: 1024px) {
  .eos-show {
    grid-template-columns: minmax(0, 1fr);
  }

  .eos-subnav {
    position: static;
  }

  .eos-subnav__list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .eos-vto,
  .eos-dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .eos-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}
