/* Styles are scoped to the catalogue; inherits the site's typography and colours. */
#ifmr-table { margin: 1.5rem 0; max-width: 100%; font-size: .92em; }
#ifmr-table * { box-sizing: border-box; }
#ifmr-table .ifmr-toolbar, #ifmr-table .ifmr-controls, #ifmr-table .ifmr-footer, #ifmr-table .ifmr-actions { display: flex; align-items: end; gap: .65rem; flex-wrap: wrap; }
#ifmr-table .ifmr-toolbar { justify-content: space-between; margin-bottom: .75rem; }
#ifmr-table .ifmr-search { flex: 1 1 15rem; }
#ifmr-table label { font-weight: normal; }
#ifmr-table .ifmr-search, #ifmr-table .ifmr-filter-grid > label { display: flex; flex-direction: column; gap: .3rem; }
#ifmr-table input:not([type=checkbox]), #ifmr-table select, #ifmr-table button { font: inherit; color: inherit; background: transparent; border: 1px solid #b8c4cc; border-radius: 4px; padding: .45rem .6rem; }
#ifmr-table button { cursor: pointer; }
#ifmr-table button:disabled { opacity: .45; cursor: default; }
#ifmr-table button:focus-visible, #ifmr-table input:focus-visible, #ifmr-table select:focus-visible, #ifmr-table summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
#ifmr-table input[aria-invalid=true] { border-color: #b3261e; }
#ifmr-table .ifmr-controls { align-items: start; }
#ifmr-table .ifmr-panel { border: 1px solid #b8c4cc; border-radius: 4px; padding: .5rem .75rem; flex: 1 1 12rem; min-width: 0; }
#ifmr-table .ifmr-panel[open] { flex-basis: 100%; }
#ifmr-table summary { cursor: pointer; font-weight: 600; }
#ifmr-table .ifmr-filter-grid, #ifmr-table .ifmr-column-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,12rem),1fr)); gap: .75rem; margin: .75rem 0; }
#ifmr-table .ifmr-range { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; gap: .35rem; }
#ifmr-table .ifmr-range legend { padding: 0; margin-bottom: .3rem; }
#ifmr-table .ifmr-range input { width: 50%; min-width: 0; }
#ifmr-table .ifmr-symbol-sub { font-size: .75em; line-height: 0; vertical-align: sub; }
#ifmr-table .ifmr-column-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .6rem 1rem; }
#ifmr-table .ifmr-check-label { display: flex; align-items: flex-start; gap: .45rem; min-width: 0; cursor: pointer; }
#ifmr-table .ifmr-check-label input { margin: .3em 0 0; flex: 0 0 auto; }
#ifmr-table .ifmr-check-label span { min-width: 0; overflow-wrap: break-word; }
#ifmr-table .ifmr-status { margin: .75rem 0 .45rem; }
#ifmr-table .ifmr-scroll { overflow-x: auto; border: 1px solid #b8c4cc; border-radius: 4px; }
#ifmr-table table { border-collapse: collapse; width: 100%; margin: 0; font: inherit; }
#ifmr-table th, #ifmr-table td { border: 0; border-bottom: 1px solid #dce3e8; text-align: left; white-space: nowrap; padding: .45rem .55rem; vertical-align: middle; }
#ifmr-table th { background: #edf2f5; color: #173b57; }
#ifmr-table th button { font-weight: 600; border: 0; border-radius: 0; padding: 0; text-align: left; white-space: nowrap; }
#ifmr-table tbody tr:nth-child(even) { background: #f7f9fa; }
#ifmr-table td.ifmr-number { font-variant-numeric: tabular-nums; }
#ifmr-table .ifmr-errors { display: inline-flex; flex-direction: column; justify-content: center; vertical-align: middle; font-size: .79em; line-height: 1.05; margin-left: .25em; }
#ifmr-table .ifmr-errors sup, #ifmr-table .ifmr-errors sub { position: static; font-size: 1em; line-height: inherit; vertical-align: baseline; }
#ifmr-table .ifmr-footer { justify-content: space-between; align-items: center; margin-top: .75rem; }
#ifmr-table .ifmr-actions { align-items: center; }
#ifmr-table .ifmr-note { font-size: .88em; margin: .65rem 0; opacity: .85; }

/* Match the existing wdifmr.org palette without changing global page styles. */
#ifmr-table button:not(:disabled):hover { background-color: #edf2f5; }
#ifmr-table .ifmr-download { background: #173b57; color: white; border-color: #173b57; }
#ifmr-table .ifmr-download:not(:disabled):hover { background-color: #005f91; }
#ifmr-table th button { color: #173b57; }
#ifmr-table tbody tr:last-child td { border-bottom: 0; }
#ifmr-table .ifmr-scroll:focus-visible { outline: 2px solid #005f91; outline-offset: 2px; }
#ifmr-table input[type=checkbox] { accent-color: #173b57; }
#ifmr-table .ifmr-note { color: #4f5f6b; opacity: 1; }
@media (max-width: 700px) {
  #ifmr-table .ifmr-toolbar > *, #ifmr-table .ifmr-controls > * { flex-basis: 100%; }
  #ifmr-table .ifmr-footer { gap: .9rem; }
}

/* Make the additional column controls discoverable without opening them by default. */
#ifmr-table .ifmr-column-panel { border-color: #7290a4; }
#ifmr-table .ifmr-column-panel > summary { color: #173b57; }

/* The optional IFMR figure is placed above the search and filter controls. */
#ifmr-table .ifmr-plot-block { margin: 0 0 1.15rem; }
#ifmr-table .ifmr-plot-toggle { background: #173b57; color: white; border-color: #173b57; font-weight: 600; }
#ifmr-table .ifmr-plot-toggle:hover { background: #005f91; }
#ifmr-table .ifmr-plot-panel {
  margin-top: .75rem;
  padding: .65rem 1rem;
  border: 1px solid #b8c4cc;
  border-radius: 4px;
  display: grid;
  grid-template-columns: minmax(0, 800px) minmax(0, 16rem);
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
}
#ifmr-table .ifmr-plot-panel[hidden] { display: none; }
#ifmr-table .ifmr-plot-view { width: 100%; min-width: 0; }
#ifmr-table .ifmr-plot-view svg { display: block; width: 100%; height: auto; }
#ifmr-table .ifmr-plot-sidebar { min-width: 0; align-self: center; padding-top: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .85rem; }
#ifmr-table .ifmr-plot-status { margin: 0; color: #4f5f6b; }
#ifmr-table .ifmr-plot-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
#ifmr-table .ifmr-plot-error { color: #b3261e; overflow-wrap: anywhere; }
#ifmr-table .ifmr-plot-error:empty { display: none; }
#ifmr-table .ifmr-plot-context { display: inline-flex; align-items: flex-start; gap: .4rem; cursor: pointer; }
#ifmr-table .ifmr-plot-context input { margin: .3em 0 0; flex: none; }
@media (max-width: 850px) {
  #ifmr-table .ifmr-plot-panel { grid-template-columns: minmax(0, 1fr); align-items: start; gap: .65rem; padding: .65rem .5rem; }
  #ifmr-table .ifmr-plot-sidebar { padding: 0 .25rem; gap: .55rem; }
}
