/* Taiwan locale overrides. Existing template structures and shared styles stay intact. */
html[data-market="tw"] body {
  direction: ltr;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  line-height: 1.75;
}
html[data-market="tw"] :is(.hero__copy, .hero-search, .hero-search input, .hero-popular-stocks, .hero-search-suggestions__item, .stock-card, .analysis-modal__dialog, .analysis-modal__link-list, .bc-disclosures, .bc-disclosure-card, .whatsapp-cta span, .page-disclaimer, .today-stock, .a-supported-card, .a-inline-analysis) {
  direction: ltr;
  text-align: left;
}
html[data-market="tw"] :is(.hero h1, .hero__copy h1, .section-heading h2, .a-reference__heading h2) {
  letter-spacing: .01em;
  line-height: 1.35;
}
html[data-market="tw"] :is(.hero__lead, .hero p) { line-height: 1.85; }
html[data-market="tw"] .hero-search { flex-direction: row-reverse; }
html[data-market="tw"] .hero-search input { min-width: 0; }
html[data-market="tw"] :is(.positive, .is-positive, .pos) { color: #cf3c46; }
html[data-market="tw"] :is(.negative, .is-negative, .neg) { color: #13834d; }
html[data-market="tw"] :is(.a-disclosure__list, .a-disclosure__details ul, .bc-disclosure-card ul, .bc-disclosures details ul, .analysis-modal__notes ul) { padding: 0 0 0 20px; }
html[data-market="tw"] .taiwan-source-links { margin: 8px 0; padding-inline-start: 20px; }
html[data-market="tw"] .taiwan-source-links a { color: #147844; text-decoration: underline; text-underline-offset: 3px; }
html[data-market="tw"] .analysis-modal__link-list small { display: block; color: var(--muted); margin-top: 4px; }
html[data-market="tw"] .analysis-modal__chart svg { width: 100%; height: auto; max-height: 220px; }
html[data-market="tw"] .analysis-modal__subtitle,
html[data-market="tw"] .analysis-modal__live-head time { overflow-wrap: anywhere; white-space: normal; }
html[data-market="tw"] [hidden] { display: none !important; }
@media (max-width: 540px) {
  html[data-market="tw"] .brand__text strong { font-size: 1rem; }
  html[data-market="tw"] .top-actions .btn { white-space: normal; text-align: center; }
  html[data-market="tw"] .analysis-modal__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

html[data-market="tw"] .hero__grid { grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); }
html[data-market="tw"] :is(.hero__copy, .hero__visual, .hero-search__wrap) { min-width: 0; max-width: 100%; }
html[data-market="tw"] .a-reference-dashboard__change.negative { color: #9ce1bc !important; }
@media (max-width: 1180px) {
  html[data-market="tw"] .hero__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  html[data-market="tw"] .hero-search { flex-direction: column-reverse; }
  html[data-market="tw"] .hero-search input { width: 100%; }
}

/* Page 2/3 featured-stock listing labels only. */
html[data-market="tw"]:is([data-template-id="page2"], [data-template-id="page3"]) #featured-stock-grid .stock-card__change {
  color: #000;
}
