/* Shared primitives for the annual and abridged report components. */
.afi-detail-all {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
.afi-detail-buttons {
  display: flex;
  gap: 0.15rem;
  min-width: 0;
}
.afi-detail-buttons button {
  width: auto;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.75rem;
  color: var(--afi-text);
  background: var(--afi-surface);
  border: 1px solid var(--afi-border);
  border-radius: var(--afi-radius-md);
  cursor: pointer;
}
.afi-detail-buttons button[aria-pressed="true"] {
  background: var(--afi-info-bg);
  border-color: var(--afi-info-text);
  font-weight: bold;
}
.afi-row-detail {
  gap: 0;
  align-items: center;
}
.afi-row-detail button {
  min-width: 1rem;
  padding: 0.25rem 0.2rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--afi-muted);
}
.afi-row-detail button[aria-pressed="true"] {
  border: 0;
  background: none;
  color: var(--afi-info-text);
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}
.afi-detail-separator {
  color: var(--afi-muted);
  font-weight: normal;
}
.afi-detail-buttons button:focus-visible {
  outline: 2px solid var(--afi-info-text);
  outline-offset: 2px;
}
/* Contain the table whenever its actual content needs more width, not only
   below a viewport breakpoint. The page and surrounding controls do not scroll
   horizontally with the table. */
.afi-annual-report {
  max-width: 100%;
  overflow: auto;
  container-type: inline-size;
}
.afi-annual-report caption {
  position: sticky;
  left: 0;
  width: 100cqw;
}
.afi-statement-events > div {
  position: sticky;
  left: 0;
  width: calc(100cqw - 1rem);
  max-width: 100%;
  box-sizing: border-box;
}
/* Age, measure and three band columns fit at tablet widths. A 64rem floor
   forced unnecessary scrolling/clipping even when the visible values fit. */
.afi-annual-report .afi-annual-table { min-width:40rem; }
.afi-annual-report .afi-annual-table thead th:nth-child(2) { width:32%; }
.afi-statement-basis { display:block; font-size:0.78rem; font-weight:normal; color:var(--afi-muted); margin-top:0.3rem; }
.afi-annual-table tr[hidden] { display:none; }
.afi-annual-table tr[data-expanded="true"],.afi-annual-table tr[data-depth]:not([data-depth="0"]) {
  --afi-row-bg:color-mix(in srgb,var(--afi-surface),var(--afi-tree-tint) min(var(--afi-tree-max-shade),calc(var(--afi-tree-base) + var(--afi-indent) * var(--afi-tree-step))));
  background:var(--afi-row-bg);
}
.afi-age-inline { display:flex; align-items:center; gap:0.4rem; white-space:nowrap; }
.afi-age-inline .afi-row-detail button { margin:0; line-height:1.2; }
.afi-annual-year .afi-age-inline .afi-detail-buttons { margin:0; }
.afi-annual-year[data-detail="0"] .afi-age-column { vertical-align:top; }
.afi-annual-report .afi-annual-table th[scope="row"] { position:relative; padding-inline-start:calc(0.5rem + var(--afi-indent,0) * 0.85rem); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; }
.afi-annual-table tr[data-depth]:not([data-depth="0"]) th[scope="row"] { font-weight:normal; }
.afi-annual-table th[scope="row"]::before { content:''; position:absolute; inset:0 auto 0 0; width:calc(var(--afi-indent,0) * 0.85rem); background:repeating-linear-gradient(to right,transparent 0,transparent 0.8rem,var(--afi-line) 0.8rem,var(--afi-line) 0.85rem); pointer-events:none; }
.afi-budget-toggle { display:inline-block; width:auto; max-width:100%; box-sizing:border-box; margin:0; border:0; border-radius:0; background:transparent; padding:0; color:inherit; font:inherit; font-weight:600; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; vertical-align:top; cursor:pointer; }
.afi-budget-toggle::before { content:'▸'; display:inline-block; width:0.85em; }
.afi-budget-toggle[aria-expanded="true"]::before { content:'▾'; }
.afi-budget-toggle:focus-visible,.afi-balance-change:focus-visible { outline:2px solid var(--afi-blue); outline-offset:2px; }
.afi-budget-warning { color:var(--afi-error-text); }
.afi-balance-change { display:inline-block; margin-inline-start:0.4rem; color:var(--afi-muted); font-size:0.72rem; font-weight:normal; white-space:nowrap; cursor:help; }
.afi-change-positive { color:var(--afi-success-text); }
.afi-change-negative { color:var(--afi-error-text); }
.afi-change-tooltip { position:fixed; inset:auto; margin:0; width:16rem; box-sizing:border-box; padding:0.6rem; border:1px solid var(--afi-line); border-radius:var(--afi-radius-sm); background:var(--afi-surface); color:var(--afi-text); font-size:0.8rem; font-weight:normal; white-space:normal; text-align:left; max-width:calc(100vw - 1rem); max-height:calc(100vh - 1rem); overflow:auto; overflow-wrap:anywhere; }
@media(max-width:600px) {
  .afi-annual-report .afi-annual-table { min-width:32rem; }
  .afi-annual-report .afi-annual-table thead th:nth-child(2) { width:11rem; position:sticky; left:0; z-index:3; background:var(--afi-surface-muted); }
  .afi-annual-report .afi-annual-table th[scope="row"] { position:sticky; left:0; z-index:1; background:var(--afi-row-bg,var(--afi-surface)); }
  .afi-annual-report .afi-statement-balance th[scope="row"] { background:var(--afi-row-bg,var(--afi-surface-muted)); }
  .afi-mobile-age-content { position:sticky; left:0; width:11rem; }
}
.afi-annual-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.afi-annual-table caption {
  text-align: left;
  font-size: 1rem;
  font-weight: bold;
  padding: 1rem 0;
}
.afi-annual-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--afi-surface-muted);
}
.afi-annual-table th,
.afi-annual-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--afi-line);
  overflow-wrap: anywhere;
  vertical-align: top;
}
.afi-annual-table th {
  text-align: left;
}
.afi-annual-table td {
  text-align: right;
}
.afi-annual-table thead th:nth-child(n + 3) {
  text-align: right;
}
.afi-annual-table .afi-age-column {
  width: 8.75rem;
}
.afi-annual-table small {
  display: block;
  color: var(--afi-muted);
  font-size: 0.7rem;
  font-weight: normal;
  margin-top: 0.35rem;
}
.afi-age-signals {
  margin-top: 0.45rem;
  font-size: 0.7rem;
  line-height: 1.4;
  font-weight: normal;
}
.afi-age-signal {
  display: block;
  white-space: nowrap;
}
.afi-age-failure,
.afi-age-remedy {
  color: var(--afi-error-text);
}
.afi-age-failure {
  font-weight: bold;
}
.afi-age-quiet {
  color: var(--afi-muted);
}
.afi-age-column .afi-detail-buttons {
  margin-top: 0.5rem;
}
.afi-annual-year,
.afi-abridged-checkpoint {
  border-top: 2px solid var(--afi-border);
}
.afi-statement-balance {
  font-weight: bold;
  background: var(--afi-surface-muted);
}
.afi-statement-section {
  background: var(--afi-surface-muted);
  font-size: 0.8rem;
}
.afi-failed-percentile {
  color: var(--afi-error-text);
  background: var(--afi-error-bg);
}
.afi-event-planned {
  color: var(--afi-text);
}
.afi-event-adverse {
  color: var(--afi-error-text);
}
.afi-event-ended {
  opacity: 0.7;
}
.afi-annual-table .afi-statement-events {
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.5;
}
.afi-statement-events div + div {
  margin-top: 0.4rem;
}
.afi-annual-table .afi-band-event .afi-statement-events {
  text-align: right;
}
.afi-band-event th {
  font-style: italic;
  font-weight: 500;
  color: var(--afi-muted);
}
.afi-landmark-cell {
  white-space: nowrap;
}
.afi-full-amount {
  white-space: nowrap;
}
.afi-mobile-age,
.afi-mobile-amount {
  display: none;
}
@media (max-width: 900px) {
  .afi-full-amount {
    display: none;
  }
  .afi-mobile-amount {
    display: inline;
    white-space: nowrap;
  }
}
@media (max-width: 600px) {
  .afi-annual-table {
    font-size: 0.74rem;
  }
  .afi-annual-table th,
  .afi-annual-table td {
    padding: 0.5rem 0.2rem;
  }
  .afi-annual-table .afi-age-column {
    display: none;
  }
  .afi-annual-table thead th:nth-child(2) {
    width: 31%;
  }
  .afi-mobile-age {
    display: table-row;
    background: var(--afi-info-bg);
  }
  .afi-mobile-age th {
    padding: 0.75rem 0.3rem;
  }
  .afi-mobile-age .afi-detail-buttons {
    margin-top: 0.5rem;
  }
  .afi-mobile-age .afi-detail-buttons button {
    min-height: 2.75rem;
    min-width: 2rem;
  }
  .afi-detail-all .afi-detail-buttons {
    flex-wrap: wrap;
  }
  .afi-annual-table .afi-statement-events {
    font-size: 0.74rem;
  }
}

/* The same authoritative rows become vertical age/interval summaries.
   The explicit Table option retains the comparison layout and local scrolling. */
@media (max-width: 850px) {
  .afi-financial-report:not([data-layout="table"]) .afi-annual-report { overflow: visible; }
  .afi-financial-report:not([data-layout="table"]) .afi-annual-table {
    display: block;
    min-width: 0;
    width: 100%;
    font-size: .85rem;
  }
  .afi-financial-report:not([data-layout="table"]) .afi-annual-table caption {
    display: block;
    position: static;
    width: auto;
  }
  .afi-financial-report:not([data-layout="table"]) .afi-annual-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .afi-financial-report:not([data-layout="table"]) .afi-annual-table tbody {
    display: block;
    margin: .85rem 0;
    padding: .65rem;
    border: 1px solid var(--afi-line);
    border-radius: var(--afi-radius-box);
  }
  .afi-financial-report:not([data-layout="table"]) .afi-annual-table tbody > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .afi-financial-report:not([data-layout="table"]) .afi-annual-table .afi-age-column { display: none; }
  .afi-financial-report:not([data-layout="table"]) .afi-annual-table tbody th[scope="row"] {
    display: block;
    position: relative;
    width: auto;
    white-space: normal;
    padding-block: .6rem;
  }
  .afi-financial-report:not([data-layout="table"]) .afi-budget-toggle {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .afi-financial-report:not([data-layout="table"]) .afi-annual-table td[data-band] {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem;
    padding: .4rem .25rem;
    min-width: 0;
  }
  .afi-financial-report:not([data-layout="table"]) td[data-band]::before {
    content: attr(data-band);
    color: var(--afi-muted);
    text-align: left;
    font-size: .75rem;
    white-space: nowrap;
    flex: 1;
  }
  .afi-financial-report:not([data-layout="table"]) td[data-band] > .afi-balance-change { margin-inline-start: auto; }
  .afi-financial-report:not([data-layout="table"]) .afi-empty-statement-cell { display: none; }
  .afi-financial-report:not([data-layout="table"]) .afi-full-amount { display: inline; }
  .afi-financial-report:not([data-layout="table"]) .afi-mobile-amount { display: none; }
  .afi-financial-report:not([data-layout="table"]) .afi-mobile-age { display: grid; }
  .afi-financial-report:not([data-layout="table"]) .afi-mobile-age th { display: block; text-align: left; }
  .afi-financial-report:not([data-layout="table"]) .afi-mobile-age-content { position: static; width: auto; }
  .afi-financial-report:not([data-layout="table"]) .afi-mobile-age .afi-detail-buttons button { min-height: 2.75rem; min-width: 2rem; }
  .afi-financial-report:not([data-layout="table"]) .afi-statement-events { display: block; padding: .5rem 0; }
  .afi-financial-report:not([data-layout="table"]) .afi-statement-events > div { position: static; width: auto; }
}
