/* American CIO display and accessibility controls. Default background: solid black.
   Only the requested global background, color-mode and font-size adjustments are affected. */
@media screen {
  html:not([data-ac-theme="light"]) {
    background: #000 !important;
    color-scheme: dark;
  }
  html:not([data-ac-theme="light"]) body {
    background: #000 !important;
  }
  html:not([data-ac-theme="light"]) body::before,
  html:not([data-ac-theme="light"]) body::after {
    background: none !important;
  }
  html:not([data-ac-theme="light"]) .ac-global-topbar,
  html:not([data-ac-theme="light"]) .ac-us-clockbar {
    background: #000 !important;
  }

  /* The light mode keeps the original typography, layout, and gold brand accents,
     while turning the established dark palette into a high-contrast light palette.
     Double inversion keeps all actual photos, logos, and product images unchanged. */
  html[data-ac-theme="light"] {
    background: #fff !important;
    color-scheme: light;
  }
  html[data-ac-theme="light"] body {
    background: #000 !important;
    filter: invert(1) hue-rotate(180deg);
  }
  html[data-ac-theme="light"] body img,
  html[data-ac-theme="light"] body picture,
  html[data-ac-theme="light"] body video,
  html[data-ac-theme="light"] body canvas,
  html[data-ac-theme="light"] body iframe {
    filter: invert(1) hue-rotate(180deg);
  }
  html[data-ac-theme="light"] body::before,
  html[data-ac-theme="light"] body::after {
    background: none !important;
  }
  html[data-ac-theme="light"] .ac-global-topbar,
  html[data-ac-theme="light"] .ac-us-clockbar {
    background: #000 !important;
  }
}

/* Deliberately scoped: does not change any existing menu links or site sections. */
.ac-global-topbar .ac-display-controls {
  width: 100%;
  order: 4;
  margin: 0;
  padding: 7px max(12px, calc((100vw - 1240px) / 2)) 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px 15px;
  background: #101010;
  border-top: 1px solid rgba(242,215,122,.18);
  color: #f7f2e8;
  font: 500 12px/1.3 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
.ac-global-topbar .ac-display-controls,
.ac-global-topbar .ac-display-controls * { box-sizing: border-box; }
.ac-global-topbar .ac-display-controls__group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 9px;
  min-width: 0;
}
.ac-global-topbar .ac-display-controls__label {
  color: #e2d8c5;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.ac-global-topbar .ac-display-controls__button {
  background: #22201c;
  color: #fff6d5;
  border: 1px solid rgba(242,215,122,.43);
  border-radius: 7px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}
.ac-global-topbar .ac-display-controls__button:hover,
.ac-global-topbar .ac-display-controls__button:focus-visible {
  background: #3c321f;
  border-color: #f2d77a;
}
.ac-global-topbar .ac-display-controls__button:focus-visible,
.ac-global-topbar .ac-display-controls__range:focus-visible {
  outline: 3px solid #f2d77a;
  outline-offset: 3px;
}
.ac-global-topbar .ac-display-controls__button:disabled {
  cursor: not-allowed;
  opacity: .5;
}
.ac-global-topbar .ac-display-controls__range {
  width: clamp(80px, 10vw, 144px);
  min-width: 70px;
  accent-color: #f2d77a;
  cursor: pointer;
  touch-action: pan-y;
}
.ac-global-topbar .ac-display-controls__percent {
  min-width: 38px;
  text-align: right;
  color: #f2d77a;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.ac-global-topbar .ac-display-controls__divider {
  width: 1px;
  height: 27px;
  background: rgba(242,215,122,.25);
}
@media (max-width: 700px) {
  .ac-global-topbar .ac-display-controls {
    justify-content: center;
    padding: 7px 9px 9px;
    gap: 7px 10px;
  }
  .ac-global-topbar .ac-display-controls__label { font-size: 11px; }
  .ac-global-topbar .ac-display-controls__button { padding: 6px 8px; }
  .ac-global-topbar .ac-display-controls__divider { display: none; }
}
@media (max-width: 370px) {
  .ac-global-topbar .ac-display-controls__group { gap: 5px; }
  .ac-global-topbar .ac-display-controls__range { width: 73px; min-width: 62px; }
}
@media print { .ac-global-topbar .ac-display-controls { display: none !important; } }

/* At enlarged text sizes, preserve a usable narrow-screen viewport instead
   of shrinking the whole page to accommodate long original menu/card text. */
@media (max-width: 700px) {
  html[data-ac-font-size]:not([data-ac-font-size="100"]) body {
    overflow-x: clip;
    overflow-wrap: anywhere;
  }
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .ac-display-controls {
    flex-direction: column;
    align-items: center;
  }
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .ac-display-controls__group {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
  }
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .ac-display-controls__label {
    white-space: normal;
  }
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .container,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) main,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) section,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) article,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .hero-card,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .hero-grid {
    min-width: 0;
    max-width: 100%;
  }
  html[data-ac-font-size]:not([data-ac-font-size="100"]) table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .popular-tag {
    max-width: calc(100vw - 42px);
    white-space: normal;
    text-align: center;
  }
}
@media (max-width: 700px) {
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .hero-grid,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .grid-2,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .grid-3,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .grid-4,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .metric-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .hero-grid > *,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .metric-row > *,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .grid-2 > *,
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .grid-3 > * {
    min-width: 0;
    max-width: 100%;
  }
}
@media (max-width: 700px) {
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .section-head {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html[data-ac-font-size]:not([data-ac-font-size="100"]) .section-head > * {
    min-width: 0;
    max-width: 100%;
  }
}
@media (max-width: 700px) {
  html[data-ac-font-size]:not([data-ac-font-size="100"]) {
    overflow-x: clip;
  }
}

/* V3.5: compact controls share the header row; no dedicated full-width tool strip. */
.ac-global-topbar .ac-global-nav .ac-display-controls {
  font-size: 11px; line-height: 1.2; min-height: 0;
  box-sizing: border-box;
}
.ac-global-topbar .ac-global-nav .ac-display-controls__group { gap: 6px; }
.ac-global-topbar .ac-global-nav .ac-display-controls__button {
  min-height: 30px; padding: 4px 8px; font-size: 11px;
}
.ac-global-topbar .ac-global-nav .ac-display-controls__label { font-size: 11px; }
.ac-global-topbar .ac-global-nav .ac-display-controls__range { width: 94px; min-width: 70px; }
.ac-global-topbar .ac-global-nav .ac-display-controls__percent { min-width: 32px; }
.ac-global-topbar .ac-global-nav .ac-display-controls__divider { height: 22px; }
@media (max-width: 700px) {
  .ac-global-topbar .ac-global-nav .ac-display-controls {
    flex-wrap: wrap; padding: 2px 0 !important; gap: 5px 8px;
  }
  .ac-global-topbar .ac-global-nav .ac-display-controls__range { width: 85px; }
}
