/* Rem-based text grows together; cards reflow instead of compressing words. */
html { font-size: 18px; }
html[data-text-size="standard"] { font-size: 16px; }
html[data-text-size="extra"] { font-size: 20px; }
body { line-height: 1.65; }
html[lang="zh-Hans"] { --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
html[lang="zh-Hans"] .eyebrow, html[lang="zh-Hans"] .rail-eyebrow, html[lang="zh-Hans"] .brand small { letter-spacing: .6px; }
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 28rem) auto; align-items: center; gap: 14px 20px; height: auto; min-height: 0; padding: 16px 32px; }
.breadcrumb { min-width: 0; overflow-wrap: anywhere; }
.top-right { margin-left: 0; }
.reading-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px 16px; min-width: 0; width: 100%; margin: 0; }
.reading-controls label { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 6px; color: #516077; font-size: .875rem; line-height: 1.5; }
.reading-controls select { background: white; border: 1px solid #c4cedb; border-radius: 6px; padding: 10px 28px 10px 12px; min-height: 48px; height: auto; width: 100%; min-width: 0; max-width: none; color: var(--ink); font-size: 1rem; line-height: 1.5; }
.language-control select { font-family: inherit; }
.ipo-reactions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; }
.reaction-heading { color: #52647b; font-size: .875rem; font-weight: 600; margin-right: auto; }
.reaction-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 12px; font-size: .9375rem; border: 1px solid #cdd6e0; border-radius: 7px; background: #fff; }
.reaction-button .reaction-arrow { width: 20px; height: 20px; stroke-width: 2.2; flex-shrink: 0; }
.reaction-button:hover { border-color: #927340; background: #faf6ef; }
.reaction-button[aria-pressed="true"] { color: #6a4f20; border: 2px solid #96753c; background: #f8eedb; padding: 7px 11px; }
.reaction-button[aria-pressed="true"]::after { content: '✓'; }
.reaction-button:disabled { opacity: .6; }
.reaction-button strong { font-variant-numeric: tabular-nums; }
.reaction-state { flex-basis: 100%; font-size: .8125rem; color: #66768b; }
.reaction-signin { font-size: .875rem; color: #735827; text-decoration: underline; text-underline-offset: 3px; }
.detail-body > .ipo-reactions { margin: 20px 0; padding: 20px 0; border-block: 1px solid var(--border); }
.community-note, .source-language-note { color: #66768b; font-size: .875rem; line-height: 1.7; }
.source-language-note { background: #f3f6f9; border-left: 3px solid #c4b084; padding: 12px 16px; }
html[lang^="en"] .source-language-note { display: none; }
[lang="en"].source-material { font-family: var(--font); }
.ipo-row, .company-cell > span, .research-summary, .analysis-summary { min-width: 0; }
.company-cell strong { overflow-wrap: anywhere; }
@media (min-width: 1021px) {
  .sidebar { width: 272px; padding-inline: 22px; }
  .workspace { margin-left: 272px; }
  .sidebar .brand > span:last-child { font-size: 1.5rem; }
  .sidebar .brand small { font-size: .75rem; line-height: 1.5; white-space: normal; }
  .sidebar .nav-item { font-size: 1rem; line-height: 1.5; }
}
/* Use the directory's available width, including text size and the side rail,
   to decide when eight columns can fit. Smaller containers use labelled cards. */
.primary-column, .directory-section { min-width: 0; }
.directory-section { container-name: ipo-directory; container-type: inline-size; }
.table-labels { display: none; }
.table-labels > span { min-width: 0; grid-area: auto; overflow-wrap: anywhere; }
.table-labels .listing-cell::before { display: none; content: none; }
.ipo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; padding: 22px; margin-bottom: 18px; }
.ipo-row > * { min-width: 0; }
.ipo-row .company-cell { grid-column: 1 / 3; grid-row: 1; padding: 0; }
.ipo-row .company-icon { flex-shrink: 0; }
.ipo-row .price-cell { position: static; grid-column: 3; grid-row: 1; text-align: right; white-space: normal; overflow-wrap: anywhere; }
.ipo-row .status-cell { grid-column: 1 / 3; grid-row: 2; border: 0; margin: 0; padding: 0; }
.status-pill { display: inline-block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; box-sizing: border-box; line-height: 1.5; vertical-align: top; }
.ipo-row .row-actions { position: static; grid-column: 3; grid-row: 2; justify-content: flex-end; gap: 4px; }
.ipo-row .close-cell { grid-column: 1; grid-row: 3; }
.ipo-row .ballot-cell { grid-column: 2; grid-row: 3; }
.ipo-row .listing-cell { display: block; grid-column: 3; grid-row: 3; }
.ipo-row .date-cell { white-space: normal; overflow-wrap: anywhere; align-self: start; }
.ipo-row .date-cell::before { display: block; font-size: .875rem; color: var(--muted); letter-spacing: 0; margin-bottom: 6px; min-height: 0; line-height: 1.6; }
.ipo-row .close-cell::before { content: 'Closes'; }
.ipo-row .ballot-cell::before { content: 'Balloting'; }
.ipo-row .listing-cell::before { content: 'Listing'; }
.ipo-row .date-cell small { display: block; margin-left: 0; }
.ipo-row .debut-cell { grid-column: 1 / -1; grid-row: 4; flex-direction: row; flex-wrap: wrap; gap: 8px 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.ipo-row .debut-cell::before { content: 'Day 1 trading'; font-size: .875rem; }
.ipo-row .debut-cell span { white-space: normal; overflow-wrap: anywhere; }
.ipo-row .research-summary, .ipo-row .analysis-summary { overflow-wrap: anywhere; }
.status-tabs { flex-wrap: wrap; gap: 8px 22px; }
.status-tabs button { white-space: normal; text-align: left; }
@container ipo-directory (min-width: 82rem) {
  .table-labels, .ipo-row { grid-template-columns: minmax(16rem, 1.6fr) minmax(6rem, .7fr) minmax(12rem, 1.2fr) repeat(3, minmax(7rem, .8fr)) minmax(9rem, 1fr) 5rem; gap: .8rem; padding-inline: 1.2rem; }
  .table-labels { display: grid; align-items: start; line-height: 1.6; }
  .ipo-row .company-cell, .ipo-row .price-cell, .ipo-row .status-cell, .ipo-row .date-cell, .ipo-row .debut-cell, .ipo-row .row-actions { grid-area: auto; }
  .ipo-row .price-cell { text-align: left; }
  .ipo-row .date-cell::before, .ipo-row .debut-cell::before { display: none; }
  .ipo-row .debut-cell { flex-direction: column; border: 0; padding: 0; gap: 4px; }
}
@media (max-width: 1800px) {
  .right-rail { display: none; }
  .content-grid { display: block; }
}
@media (max-width: 1400px) {
  .topbar { grid-template-columns: minmax(0, 1fr) minmax(20rem, 28rem); }
  .top-right { display: none; }
}
@media (max-width: 1200px) {
  .topbar { grid-template-columns: minmax(0, 1fr); }
  .reading-controls { max-width: 38rem; }
}
@media (max-width: 650px) {
  .sidebar { gap: 12px; }
  .sidebar .brand > span:last-child { font-size: 1.15rem; }
  .sidebar .brand { gap: 7px; }
  .sidebar nav { min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: thin; }
  .sidebar nav .nav-item { flex-shrink: 0; }
  .topbar { align-items: start; padding: 16px; gap: 14px; }
  .breadcrumb { font-size: .875rem; }
  .reading-controls { gap: 14px; }
  .workspace > main { padding-top: 28px; }
  .heading h1 { font-size: 2.1rem; }
  .heading p { max-width: none; }
  .ipo-row { padding: 18px 14px; gap: 16px 8px; }
  .company-cell strong { font-size: 1.0625rem; }
  .date-cell { font-size: .9375rem; }
  .date-cell::before { font-size: .8125rem; }
  .stat { padding: 14px 12px; }
  .stat > span { font-size: .9375rem; }
  .reaction-heading { flex-basis: 100%; }
  .reaction-button { flex: 1; }
  .detail-layout, .tier-fields { grid-template-columns: 1fr; }
  .detail-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-metrics > div:last-child { grid-column: 1 / -1; }
  .tier-table { font-size: .875rem; }
  .detail-header, .detail-body { padding-inline: 20px; }
}
@media (max-width: 600px) {
  .reading-controls { grid-template-columns: minmax(0, 1fr); }
}
html[lang="zh-Hans"] .ipo-row .close-cell::before { content: '截止认购'; }
html[lang="zh-Hans"] .ipo-row .ballot-cell::before { content: '抽签日期'; }
html[lang="zh-Hans"] .ipo-row .listing-cell::before { content: '上市日期'; }
html[lang="zh-Hans"] .ipo-row .debut-cell::before { content: '上市首日表现'; }
html[lang="ms-MY"] .ipo-row .close-cell::before { content: 'Tutup'; }
html[lang="ms-MY"] .ipo-row .ballot-cell::before { content: 'Pengundian'; }
html[lang="ms-MY"] .ipo-row .listing-cell::before { content: 'Penyenaraian'; }
html[lang="ms-MY"] .ipo-row .debut-cell::before { content: 'Dagangan hari pertama'; }
