.reading-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-left: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(23, 32, 42, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #17202a;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(23, 32, 42, 0.08);
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.reading-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 100, 51, 0.34);
}

.reading-toggle:focus-visible {
  outline: 3px solid rgba(255, 100, 51, 0.28);
  outline-offset: 3px;
}

.reading-toggle-icon {
  border-radius: 8px;
  min-width: 25px;
  padding: 1px 5px;
  background: rgba(23, 32, 42, 0.08);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
}

.reading-toggle-text {
  white-space: nowrap;
}

html[data-theme="soft-light"] .reading-toggle {
  background: rgba(255, 250, 240, 0.86);
  color: #172431;
  border-color: rgba(35, 74, 69, 0.2);
  box-shadow: 0 8px 20px rgba(35, 74, 69, 0.12);
}

html[data-theme="soft-light"] .reading-toggle-icon {
  background: rgba(255, 100, 51, 0.14);
  color: #9f4427;
}

html[data-reading="large"] .reading-toggle {
  background: #ff7046;
  color: #fffaf4;
  border-color: rgba(255, 112, 70, 0.48);
}

html[data-reading="large"] .reading-toggle-icon {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

html[data-reading="large"] .subtitle,
html[data-reading="large"] .health-grid span,
html[data-reading="large"] .market-time-note,
html[data-reading="large"] .schedule-note,
html[data-reading="large"] .scope-note,
html[data-reading="large"] .market-bulletin-card p,
html[data-reading="large"] .steps p,
html[data-reading="large"] .demo-note,
html[data-reading="large"] .weight50-note,
html[data-reading="large"] .us-note {
  font-size: 18px;
  line-height: 1.85;
}

html[data-reading="large"] .subtitle {
  font-size: 19px;
}

html[data-reading="large"] .run-meta strong,
html[data-reading="large"] .health-grid strong,
html[data-reading="large"] .ready-badge,
html[data-reading="large"] .health-summary-toggle em,
html[data-reading="large"] .feature-card strong,
html[data-reading="large"] .signal-card strong,
html[data-reading="large"] .coverage strong,
html[data-reading="large"] .panel-head h2,
html[data-reading="large"] .regime-title>div span,
html[data-reading="large"] .market-total strong,
html[data-reading="large"] .weight50-head h2,
html[data-reading="large"] .us-head h2,
html[data-reading="large"] .etf-section h2 {
  font-size: calc(1em + 3px);
}

html[data-reading="large"] .eyebrow,
html[data-reading="large"] .health-grid small,
html[data-reading="large"] .run-meta span,
html[data-reading="large"] .result-kicker,
html[data-reading="large"] .regime-title small,
html[data-reading="large"] .signal-card small,
html[data-reading="large"] .coverage small,
html[data-reading="large"] .coverage span,
html[data-reading="large"] .weight50-head span,
html[data-reading="large"] .us-head span,
html[data-reading="large"] .us-time-strip small {
  font-size: calc(1em + 1px);
}

html[data-reading="large"] button,
html[data-reading="large"] .market-tabs button,
html[data-reading="large"] .industry-filter button,
html[data-reading="large"] .export,
html[data-reading="large"] .method-link,
html[data-reading="large"] .back-to-menu,
html[data-reading="large"] .regime-detail-view-tabs button,
html[data-reading="large"] .regime-control button,
html[data-reading="large"] .weight50-controls button,
html[data-reading="large"] .us-controls button,
html[data-reading="large"] .etf-filter button {
  min-height: 42px;
  font-size: calc(1em + 1px);
}

html[data-reading="large"] input,
html[data-reading="large"] .search,
html[data-reading="large"] .regime-search,
html[data-reading="large"] .etf-search {
  min-height: 44px;
  font-size: 15px;
}

html[data-reading="large"] th {
  height: 50px;
  font-size: 12px;
}

html[data-reading="large"] td {
  padding-top: 18px;
  padding-bottom: 18px;
  font-size: 16px;
  line-height: 1.65;
}

html[data-reading="large"] .stock-name strong,
html[data-reading="large"] .stock-name small,
html[data-reading="large"] .number,
html[data-reading="large"] .industry,
html[data-reading="large"] .signal-pill,
html[data-reading="large"] .trigger,
html[data-reading="large"] .tv-link {
  font-size: calc(1em + 1px);
}

html[data-reading="large"] .regime-name strong,
html[data-reading="large"] .regime-values b,
html[data-reading="large"] .regime-group-card b,
html[data-reading="large"] .regime-industry-card b,
html[data-reading="large"] .regime-stock-tile b,
html[data-reading="large"] .regime-stock-tile strong,
html[data-reading="large"] .weight-tile b,
html[data-reading="large"] .weight-tile strong,
html[data-reading="large"] .us-tile b,
html[data-reading="large"] .us-tile strong,
html[data-reading="large"] .etf-card strong {
  font-size: calc(1em + 2px);
}

html[data-reading="large"] .regime-name small,
html[data-reading="large"] .regime-values small,
html[data-reading="large"] .regime-stock-tile small,
html[data-reading="large"] .regime-stock-tile em,
html[data-reading="large"] .weight-tile small,
html[data-reading="large"] .weight-tile em,
html[data-reading="large"] .us-tile small,
html[data-reading="large"] .us-tile em,
html[data-reading="large"] .etf-card small {
  font-size: calc(1em + 1px);
  line-height: 1.55;
}

html[data-reading="large"] .regime-row {
  padding-top: 19px;
  padding-bottom: 19px;
}

html[data-reading="large"] .regime-stock-tile,
html[data-reading="large"] .weight-tile,
html[data-reading="large"] .us-tile,
html[data-reading="large"] .etf-card {
  line-height: 1.42;
}

html[data-reading="large"] .stock-feature {
  font-size: 11px;
}

html[data-reading="large"] .channel-cycle-pill,
html[data-reading="large"] .dual-verdict,
html[data-reading="large"] .regime-tile-channel,
html[data-reading="large"] .regime-dual-filter-body button {
  font-size: 11px;
}

html[data-reading="large"] .regime-stock-tile {
  min-height: 178px;
}

html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tiles,
html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tiles {
  grid-auto-rows: 118px;
}

html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile,
html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr auto;
  align-items: start;
  justify-content: stretch;
  gap: 4px 8px;
  padding: 12px;
  line-height: 1.25;
}

html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile-top,
html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile > span {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  min-width: 0;
}

html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile-top b,
html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 19px;
  line-height: 1.08;
  font-weight: 900;
}

html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile-top em,
html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.25;
}

html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile > small,
html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile > small {
  grid-column: 1 / -1;
  position: static;
  display: block;
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.25;
}

html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile > strong,
html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile > strong {
  grid-column: 1;
  grid-row: 4;
  align-self: end;
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
}

html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile > i,
html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile > i {
  grid-column: 2;
  grid-row: 4;
  position: static;
  align-self: end;
  justify-self: end;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .reading-toggle {
    min-height: 34px;
    padding-inline: 10px;
  }

  html[data-reading="large"] .subtitle,
  html[data-reading="large"] .market-time-note,
  html[data-reading="large"] .schedule-note,
  html[data-reading="large"] .scope-note,
  html[data-reading="large"] td {
    font-size: 16px;
  }

  html[data-reading="large"] .summary-row,
  html[data-reading="large"] .regime-markets,
  html[data-reading="large"] .weight-sectors,
  html[data-reading="large"] .us-sector-view {
    gap: 18px;
  }

  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tiles,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tiles {
    grid-auto-rows: 116px;
  }

  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile-top b,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile b {
    font-size: 18px;
  }
}

/* Tablet health summary: avoid CJK status text collapsing into vertical-looking columns. */
.health-summary-toggle,
.health-summary-toggle span,
.health-summary-toggle strong,
.health-summary-toggle em,
.ready-badge {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  word-break: keep-all;
}

.health-summary-toggle strong,
.health-summary-toggle em,
.ready-badge {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .health-section.health-collapsible .health-summary-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
  }

  .health-summary-toggle span {
    flex: 1 1 auto;
    min-width: 0;
  }

  .health-summary-toggle strong {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .health-summary-toggle em {
    flex: 0 0 auto;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 8px;
  }

  .reading-toggle {
    min-width: 44px;
    min-height: 34px;
    margin-left: 4px;
    padding: 6px 9px;
  }

  .reading-toggle-icon {
    min-width: 23px;
    padding-inline: 4px;
  }

  .reading-toggle-text {
    display: none;
  }

  html[data-reading="large"] .hero {
    padding-inline: 18px;
  }

  html[data-reading="large"] .health-summary-toggle {
    gap: 12px;
    padding: 16px;
  }

  html[data-reading="large"] .health-summary-toggle em,
  html[data-reading="large"] .subtitle,
  html[data-reading="large"] .market-bulletin-card p,
  html[data-reading="large"] td {
    font-size: 16px;
    line-height: 1.8;
  }

  html[data-reading="large"] button,
  html[data-reading="large"] .market-tabs button,
  html[data-reading="large"] .industry-filter button,
  html[data-reading="large"] .export {
    min-height: 44px;
  }

  html[data-reading="large"] .regime-stock-tile b,
  html[data-reading="large"] .regime-stock-tile strong,
  html[data-reading="large"] .weight-tile b,
  html[data-reading="large"] .weight-tile strong,
  html[data-reading="large"] .us-tile b,
  html[data-reading="large"] .us-tile strong {
    font-size: calc(1em + 1px);
  }

  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tiles,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tiles {
    grid-auto-rows: 112px;
  }

  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile {
    padding: 10px;
    gap: 3px 6px;
  }

  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile-top b,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile b {
    font-size: 16px;
    line-height: 1.1;
  }

  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile-top em,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile em,
  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile > small,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile > small {
    font-size: 11px;
  }

  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile > strong,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile > strong {
    font-size: 13px;
  }

  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tile > i,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tile > i {
    font-size: 10px;
  }
}

/* Large-text layout safety: enlarge containers before allowing labels to break. */
html[data-reading="large"] .etf-panel-head {
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  height: auto;
  min-height: 0;
}

html[data-reading="large"] .etf-controls {
  display: grid;
  grid-template-columns: max-content max-content minmax(220px, 1fr) max-content;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: none;
}

html[data-reading="large"] .etf-type,
html[data-reading="large"] .etf-management {
  display: flex;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

html[data-reading="large"] .etf-controls button,
html[data-reading="large"] .etf-categories button,
html[data-reading="large"] .etf-unavailable > summary,
html[data-reading="large"] .signal-pill,
html[data-reading="large"] th {
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: nowrap;
}

html[data-reading="large"] .etf-controls button,
html[data-reading="large"] .etf-export {
  height: auto;
  min-height: 46px;
  line-height: 1.25;
}

html[data-reading="large"] .etf-controls .search {
  min-width: 220px;
}

html[data-reading="large"] .etf-controls .search input {
  width: 100%;
}

html[data-reading="large"] .etf-table {
  min-width: 940px;
}

html[data-reading="large"] .etf-table th:first-child,
html[data-reading="large"] .etf-table td:first-child {
  min-width: 235px;
}

html[data-reading="large"] .weight-tiles {
  grid-auto-rows: 104px;
}

html[data-reading="large"] .us-tiles {
  grid-auto-rows: 100px;
}

html[data-reading="large"] .weight-tile,
html[data-reading="large"] .us-tile {
  min-height: 0;
}

html[data-reading="large"] .liquidity-cell {
  min-width: 148px;
  gap: 7px;
  font-size: 15px;
  line-height: 1.35;
}

html[data-reading="large"] .liquidity-cell span {
  gap: 7px;
}

html[data-reading="large"] .liquidity-cell span b {
  padding: 4px 5px;
  font-size: 12px;
}

html[data-reading="large"] .liquidity-cell span small {
  font-size: 12px;
}

html[data-reading="large"] .liquidity-alert {
  margin-top: 3px;
  padding: 5px 8px;
  font-size: 12px;
}

html[data-reading="large"] .liquidity-head {
  min-width: 154px;
}

html[data-reading="large"] .us-tile em,
html[data-reading="large"] .weight-tile-top b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  html[data-reading="large"] .etf-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  html[data-reading="large"] .etf-controls .search {
    grid-column: 1;
    min-width: 0;
  }

  html[data-reading="large"] .etf-export {
    grid-column: 2;
    width: 100%;
  }
}

@media (max-width: 620px) {
  html[data-reading="large"] .channel-panel .panel-head {
    padding-left: 14px;
    padding-right: 14px;
  }

  html[data-reading="large"] .channel-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  html[data-reading="large"] .channel-actions > .market-tabs {
    display: grid !important;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  html[data-reading="large"] .channel-actions > .market-tabs:not(.channel-tabs):not(.regime-tabs),
  html[data-reading="large"] .channel-actions > .regime-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html[data-reading="large"] .channel-actions > .channel-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-reading="large"] .channel-actions > .market-tabs button {
    min-width: 0 !important;
    padding: 9px 5px !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
  }

  html[data-reading="large"] .channel-actions > .channel-search {
    width: 100%;
    min-width: 0;
  }

  html[data-reading="large"] .etf-panel-head {
    gap: 14px;
  }

  html[data-reading="large"] .etf-controls {
    grid-template-columns: 1fr;
  }

  html[data-reading="large"] .etf-type,
  html[data-reading="large"] .etf-management,
  html[data-reading="large"] .etf-controls .search,
  html[data-reading="large"] .etf-export {
    grid-column: 1;
    width: 100%;
  }

  html[data-reading="large"] .etf-controls .search {
    min-height: 48px;
  }

  html[data-reading="large"] .etf-table {
    min-width: 900px;
  }

  html[data-reading="large"] .weight-tiles,
  html[data-reading="large"] .weight50-section[data-layout="equal"] .weight-tiles,
  html[data-reading="large"] .us-tiles,
  html[data-reading="large"] .us-core-section[data-sizing="equal"] .us-tiles {
    grid-auto-rows: 120px;
  }
}
