/* Natural-height UK and Singapore catalogues, sharing the Hong Kong board palette. */
.overseas-catalog .overseas-choose-row { display: flex; align-items: start; gap: 20px; }
.overseas-catalog .overseas-school-count { padding: 9px 3px 5px; color: #58758c; font-size: 12px; }
.overseas-catalog .catalog-tool-button, .overseas-catalog .catalog-dialog-close, .overseas-catalog .catalog-select-trigger { border-color: #3525cd; }
.ug-catalog.overseas-catalog .overseas-stage { position: relative; top: auto; left: auto; display: block; width: 100%; height: auto; min-height: 0; overflow: visible; transform: none; }
.ug-catalog.overseas-catalog .overseas-hero { flex-wrap: wrap; gap: clamp(12px, 1.5vw, 24px); }
.ug-catalog.overseas-catalog .catalog-school-number { flex: 0 0 auto; padding-right: 16px; font-size: clamp(34px, 3vw, 56px); }
.ug-catalog.overseas-catalog .catalog-school-logo { flex: 0 1 200px; min-width: 110px; height: 78px; }
.ug-catalog.overseas-catalog .catalog-school-logo .overseas-logo-fallback { font-size: 25px; }
.ug-catalog.overseas-catalog .catalog-school-identity { flex: 2 1 220px; }
.ug-catalog.overseas-catalog .catalog-school-identity h2 { font-size: clamp(23px, 2.1vw, 38px); }
.ug-catalog.overseas-catalog .catalog-school-english { font-size: clamp(11px, .9vw, 16px); }
.ug-catalog.overseas-catalog .catalog-hero-subject { flex: 1 1 160px; min-width: 150px; padding-left: 20px; }
.ug-catalog.overseas-catalog .catalog-hero-subject h2 { font-size: clamp(22px, 1.8vw, 32px); }
.ug-catalog.overseas-catalog .catalog-hero-year { flex: 0 0 auto; }
.overseas-catalog .overseas-note { margin-top: 10px; }
.overseas-catalog .overseas-results-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 22px 6px 12px; }
.overseas-catalog .overseas-results-header h2 { color: #0759b3; font-size: 20px; }
.overseas-catalog .overseas-results-header p { color: #57748c; font-size: 12px; }
.ug-catalog.overseas-catalog .overseas-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; align-items: start; gap: 12px; overflow: visible; }
.ug-catalog.overseas-catalog .catalog-group { height: auto; min-height: 0; }
.ug-catalog.overseas-catalog .catalog-group-header { min-height: 64px; flex: 0 0 auto; padding: 10px 14px; }
.ug-catalog.overseas-catalog .catalog-group-header h3 { font-size: 18px; }
.ug-catalog.overseas-catalog .catalog-group-body { flex: 0 0 auto; min-height: 0; padding: 2px 16px; overflow: visible; }
.ug-catalog.overseas-catalog .catalog-group.is-wide { grid-column: 1 / -1; }
.ug-catalog.overseas-catalog .catalog-group.is-wide .catalog-group-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; }
.ug-catalog.overseas-catalog .catalog-programme-title { font-size: 16px; }
.overseas-catalog .catalog-programme-english { font-size: 13px; }
.overseas-catalog .catalog-programme-meta-row { margin-top: 6px; color: #59758f; }
.overseas-catalog .overseas-empty { padding: 34px 12px; color: #56758e; text-align: center; }
.overseas-catalog .overseas-pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 20px 0; color: #45647e; font-size: 13px; }
.overseas-catalog .overseas-pagination button:disabled { cursor: not-allowed; }
.ug-catalog .overseas-dialog { width: min(720px, calc(100vw - 32px)); max-height: min(85vh, 900px); }
.overseas-dialog .catalog-dialog-body { overflow-wrap: anywhere; }
.overseas-dialog .catalog-dialog-content { display: block; }
.overseas-detail-notice { margin: 12px 0 20px; padding: 12px; border-radius: 8px; color: #6b5836; background: #fff7e5; font-size: 13px; line-height: 1.7; }
.overseas-detail-section { margin: 18px 0; padding-top: 14px; border-top: 1px solid #d7e6f3; }
.overseas-detail-section h3 { margin-bottom: 10px; color: #0759b3; font-size: 17px; }
.overseas-detail-section p { margin: 7px 0; color: #45647e; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.overseas-detail-section p strong { color: #164d7b; }
.overseas-evidence { margin: 12px 0; padding: 12px; border: 1px solid #d7e6f3; border-radius: 8px; background: #f8fcff; }
.overseas-evidence > strong { color: #164d7b; }
.overseas-evidence-hint { color: #6b5836 !important; }
.overseas-requirement-item { margin: 8px 0; padding: 4px 10px; border-left: 2px solid #9fc9e9; }
.overseas-source-link { display: inline-block; margin: 5px 15px 0 0; color: #0759b3; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1050px) { .ug-catalog.overseas-catalog .overseas-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ug-catalog.overseas-catalog .catalog-group.is-wide .catalog-group-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .overseas-catalog .overseas-choose-row { flex-direction: column; gap: 10px; }
  .ug-catalog.overseas-catalog .overseas-hero { display: grid; grid-template-columns: 38px 72px minmax(0, 1fr); gap: 12px; min-height: 0; padding: 16px 12px; }
  .ug-catalog.overseas-catalog .catalog-school-number { padding-right: 8px; font-size: 30px; letter-spacing: -2px; }
  .ug-catalog.overseas-catalog .catalog-school-logo { width: 72px; min-width: 0; height: 54px; }
  .ug-catalog.overseas-catalog .catalog-school-identity h2 { font-size: 20px; }
  .ug-catalog.overseas-catalog .catalog-hero-contact { grid-column: 1 / -1; justify-self: start; }
  .ug-catalog.overseas-catalog .catalog-hero-qr { flex-basis: 68px; width: 68px; height: 68px; }
  .ug-catalog.overseas-catalog .catalog-hero-subject { grid-column: 1 / 3; min-width: 0; padding: 10px 0 0; border-left: 0; border-top: 1px solid #ffffff40; }
  .ug-catalog.overseas-catalog .catalog-hero-year { grid-column: 3; align-self: end; }
  .ug-catalog.overseas-catalog .catalog-hero-year b { font-size: 25px; }
  .ug-catalog.overseas-catalog .overseas-board { grid-template-columns: 1fr; }
  .ug-catalog.overseas-catalog .catalog-group.is-wide .catalog-group-body { grid-template-columns: 1fr; }
}
.overseas-catalog .catalog-school-logo img.overseas-logo-loading { opacity: 0; }
@media (min-width: 761px) and (max-width: 1200px) {
  .ug-catalog.overseas-catalog .catalog-hero-year { display: none; }
  .ug-catalog.overseas-catalog .catalog-school-logo { flex-basis: 140px; }
  .ug-catalog.overseas-catalog .catalog-hero-subject { flex-basis: 120px; min-width: 120px; }
}
.overseas-catalog .overseas-school-controls { display: flex; align-items: center; flex: 1 1 760px; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.overseas-catalog .overseas-school-controls > .catalog-search-field { flex: 1 1 210px; min-height: 48px; }
.overseas-catalog .overseas-school-select-row { display: flex; align-items: center; flex: 1 1 260px; min-width: 240px; gap: 10px; }
.overseas-catalog .overseas-school-count { flex-basis: 100%; padding: 0 3px; }
@media (max-width: 760px) {
  .overseas-catalog .overseas-school-controls { width: 100%; }
  .overseas-catalog .overseas-school-controls > .catalog-search-field,
  .overseas-catalog .overseas-school-select-row { flex-basis: 100%; }
}
@media (max-width: 760px) { .overseas-catalog .catalog-discipline-field { flex: 1 1 auto; width: 100%; min-width: 0; } }

/* Desktop height follows the Hong Kong catalogue; the list scrolls without hiding programmes. */
@media (min-width: 761px) {
  .ug-catalog.overseas-catalog .overseas-stage { display: flex; flex-direction: column; aspect-ratio: 1.45 / 1; min-height: 0; }
  .ug-catalog.overseas-catalog .overseas-stage > :is(.overseas-hero, .overseas-note, .overseas-results-header, .overseas-pagination, .catalog-stage-footer) { flex: 0 0 auto; }
  .ug-catalog.overseas-catalog .overseas-board { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; align-content: start; }
}

/* Keep the compact six-column Hong Kong board on desktop without inventing subcategories. */
@media (min-width: 1000px) {
  .ug-catalog.overseas-catalog .overseas-hero { order: 0; flex-wrap: nowrap; gap: 8px; min-height: 66px; height: 66px; padding: 8px 12px; }
  .ug-catalog.overseas-catalog .catalog-school-number { flex: 0 0 49px; padding-right: 10px; font-size: 34px; line-height: 1; }
  .ug-catalog.overseas-catalog .catalog-school-logo { flex: 0 0 160px; width: 160px; min-width: 0; height: 44px; padding: 5px 8px; border-radius: 5px; }
  .ug-catalog.overseas-catalog .catalog-school-logo img { inset: 5px 8px; width: calc(100% - 16px); height: calc(100% - 10px); }
  .ug-catalog.overseas-catalog .catalog-school-logo .overseas-logo-fallback { font-size: 13px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
  .ug-catalog.overseas-catalog .catalog-school-identity { flex: 1 1 160px; min-width: 0; }
  .ug-catalog.overseas-catalog .catalog-school-identity h2 { font-size: 23px; line-height: 1.15; overflow-wrap: anywhere; }
  .ug-catalog.overseas-catalog .catalog-school-english { margin-top: 4px; font-size: 9px; line-height: 1.2; }
  .ug-catalog.overseas-catalog .catalog-hero-contact { gap: 5px; }
  .ug-catalog.overseas-catalog .catalog-hero-contact > span:not(.catalog-hero-qr) { font-size: 9px; }
  .ug-catalog.overseas-catalog .catalog-hero-contact > span:not(.catalog-hero-qr) .icon { width: 10px; height: 10px; }
  .ug-catalog.overseas-catalog .catalog-hero-qr { flex: 0 0 45px; width: 45px; height: 45px; padding: 2px; }
  .ug-catalog.overseas-catalog .catalog-hero-subject { flex: 0 1 145px; min-width: 95px; padding-left: 10px; }
  .ug-catalog.overseas-catalog .catalog-hero-kicker { font-size: 7px; line-height: 1.1; }
  .ug-catalog.overseas-catalog .catalog-hero-subject h2 { font-size: 18px; line-height: 1.15; }
  .ug-catalog.overseas-catalog .catalog-hero-subject > p:last-child:not(.catalog-hero-kicker) { font-size: 8px; }
  .ug-catalog.overseas-catalog .catalog-hero-year { display: block; flex: 0 0 58px; white-space: nowrap; }
  .ug-catalog.overseas-catalog .catalog-hero-year b { font-size: 21px; }
  .ug-catalog.overseas-catalog .catalog-hero-year span { font-size: 7px; }
  .ug-catalog.overseas-catalog .overseas-board { order: 1; grid-template-columns: repeat(var(--overseas-columns, 6), minmax(0, 1fr)); grid-auto-rows: minmax(100%, max-content); align-content: stretch; align-items: stretch; gap: 6px; margin-top: 6px; }
  .ug-catalog.overseas-catalog .catalog-group { height: 100%; min-height: 0; border-radius: 6px; }
  .ug-catalog.overseas-catalog .catalog-group-header { min-height: 50px; padding: 5px 6px; gap: 5px; }
  .ug-catalog.overseas-catalog .catalog-group-symbol { width: 24px; height: 24px; }
  .ug-catalog.overseas-catalog .catalog-group-symbol .icon { width: 16px; height: 16px; }
  .ug-catalog.overseas-catalog .catalog-group-header h3 { font-size: 12px; line-height: 1.25; }
  .ug-catalog.overseas-catalog .catalog-group-header p { margin-top: 3px; font-size: 6px; line-height: 1.2; }
  .ug-catalog.overseas-catalog .catalog-group-body { flex: 1 0 auto; min-height: 0; padding: 2px 7px; }
  .ug-catalog.overseas-catalog .catalog-programme { padding: 9px 0 9px 9px; }
  .ug-catalog.overseas-catalog .catalog-programme::before { top: 15px; width: 5px; height: 5px; }
  .ug-catalog.overseas-catalog .catalog-programme-title { font-size: 12px; line-height: 1.35; }
  .ug-catalog.overseas-catalog .catalog-programme-english { margin-top: 4px; font-size: 9px; line-height: 1.3; }
  .ug-catalog.overseas-catalog .catalog-programme-meta-row { margin-top: 5px; font-size: 8px; line-height: 1.3; }
  .ug-catalog.overseas-catalog .catalog-group-count { flex: 0 0 auto; padding: 3px 7px; font-size: 7px; }
  .overseas-catalog .overseas-results-header { order: 2; justify-content: flex-end; min-height: 0; margin: 2px 6px 0; }
  .overseas-catalog .overseas-results-header h2 { display: none; }
  .overseas-catalog .overseas-results-header p { font-size: 9px; line-height: 1.3; }
  .overseas-catalog .overseas-note { order: 3; min-height: 0; margin: 0 6px; padding: 2px 0; border: 0; background: transparent; }
  .overseas-catalog .overseas-note > span, .overseas-catalog .overseas-note > strong { display: none; }
  .overseas-catalog .overseas-note > p { font-size: 9px; line-height: 1.3; }
  .overseas-catalog .overseas-empty { order: 1; }
  .overseas-catalog .overseas-pagination { order: 4; margin: 3px 0; }
  .overseas-catalog .catalog-stage-footer { order: 5; padding-top: 1px; font-size: 8px; }
}
@media (min-width: 761px) and (max-width: 999px) {
  .ug-catalog.overseas-catalog .overseas-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ug-catalog.overseas-catalog .overseas-board:empty { display: none; }

.overseas-catalog .overseas-card-fact { margin: 3px 0 0; color: #526e88; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
@media (min-width: 1000px) { .ug-catalog.overseas-catalog .overseas-card-fact { font-size: 8px; line-height: 1.35; } }

/* Size columns to their contents inside the scrolling board. */
.ug-catalog.overseas-catalog .overseas-board { display: block; }
.ug-catalog.overseas-catalog .overseas-grid { display: grid; min-height: 100%; grid-template-columns: 1fr; align-items: stretch; gap: 12px; }
.ug-catalog.overseas-catalog .overseas-grid .catalog-group { height: auto; min-height: 0; }
@media (min-width: 761px) and (max-width: 999px) { .ug-catalog.overseas-catalog .overseas-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .ug-catalog.overseas-catalog .overseas-grid { grid-template-columns: repeat(var(--overseas-columns, 6), minmax(0, 1fr)); gap: 6px; } }

.overseas-catalog .overseas-region-label { flex: 0 0 auto; color: #0759b3; font-size: 15px; font-weight: 700; white-space: nowrap; }

/* The NUS guide distinguishes courses, internal majors, and double degrees. */
.overseas-catalog .overseas-guide-kind { margin-top: 4px; color: #1266a1; font-size: 12px; font-weight: 700; line-height: 1.35; }
.overseas-catalog .overseas-guide-description { margin-top: 3px; color: #526e88; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.overseas-dialog .overseas-guide-detail { margin: 12px 0; color: #45647e; font-size: 14px; line-height: 1.7; }
@media (min-width: 1000px) {
  .ug-catalog.overseas-catalog .overseas-guide-kind { font-size: 8px; line-height: 1.35; }
  .ug-catalog.overseas-catalog .overseas-guide-description { font-size: 8px; line-height: 1.4; }
}
