@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;700;900&display=swap");

/* Responsive component contract. Loaded after Bootstrap and legacy overrides. */
:root {
  --tm-gutter: 1rem;
  --tm-section-y: 2.5rem;
  --tm-header-offset: 4.5rem;
}
@media (min-width: 768px) {
  :root { --tm-gutter: 1.5rem; --tm-section-y: 3rem; }
}
@media (min-width: 1200px) {
  :root { --tm-gutter: 2rem; --tm-section-y: 4rem; --tm-header-offset: 5rem; }
}

body { font-size: 1rem; line-height: 1.8; }
.container-fluid.contents-article { padding: 0; }
.contents-article { font-size: 1rem; line-height: 1.8; }
/* Use the article column width for prose, including ad copy and section introductions. */
.contents-article p { max-width: none; line-height: 1.8; margin-bottom: 1rem; }
.contents-article p:empty { display: none; }
.tm-article-header { padding-top: clamp(1.5rem, 3vw, 3rem); }
.tm-article-title { font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.4; }
.tm-article-lead, .tm-article-lead p { max-width: none; }
.tm-article-kicker { font-size: .8125rem; letter-spacing: .08em; }
.tm-article-details { margin-top: .5rem; font-size: .9375rem; }
.tm-article-details > summary { padding: .625rem 0; cursor: pointer; color: var(--tm-navy); font-weight: 500; }
.tm-article-details[open] > summary { margin-bottom: .5rem; }
.tm-kpis { margin-top: 1.5rem; gap: 0 1.5rem; }
.tm-kpi-label, .tm-sidebar-label { font-size: .75rem; letter-spacing: .12em; }
.tm-kpi-value { line-height: 1.2; }
.tm-kpi-value-sm { font-size: 1.125rem; line-height: 1.5; }
.tm-kpi-value { overflow-wrap: normal; }
.tm-kpi:last-child .tm-kpi-value { overflow-wrap: anywhere; }
.tm-meta-bar { font-size: .8125rem; }
.tm-meta-bar .breadcrumb { margin-bottom: 0; }
.tm-section { padding-top: var(--tm-section-y); }
.tm-section-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: baseline; }
.index-section-head { gap: .75rem; align-items: baseline; }
.index-section-num, .tm-section-num { flex-shrink: 0; letter-spacing: .08em; font-size: .75rem; }
.contents-article h2, .index-section h2 { font-size: clamp(1.25rem, 2vw, 1.625rem) !important; line-height: 1.5; }
.contents-article h3, .index-section h3 { font-size: clamp(1.125rem, 1.6vw, 1.375rem) !important; line-height: 1.55; }
.contents-article h4 { font-size: 1.0625rem !important; line-height: 1.6; }
.tm-blocks > h2:not(:first-child) { margin-top: var(--tm-section-y); }
.tm-blocks > h3 { margin-top: 2rem; }
.contents-article [id] { scroll-margin-top: calc(var(--tm-header-offset) + 1rem); }

/* Navigation stays reachable even on short landscape screens. */
#hdl .site-navbar { padding: .5rem 0; min-height: var(--tm-header-offset); max-height: 100dvh; overflow-y: auto; }
#hdl .site-brand { padding: 0; }
#hdl .site-brand-logo { height: auto; width: 200px; object-fit: contain; }
#hdl .site-navbar-toggler { min-width: 44px; min-height: 44px; }
#hdl .site-nav-link { min-height: 44px; display: flex; align-items: center; margin-right: .5rem; padding: .5rem; }
#hdl .site-nav-search { padding: 0; }
#hdl .header-search-group { flex-wrap: nowrap; }
#hdl .header-search-group :is(.form-select, .form-control, .btn) { min-height: 44px; }
#hdl .header-search-group .form-control { min-width: 0; }
#hdl .header-search-group .btn { min-width: 44px; }
#hdl .header-search-group:focus-within { outline: 2px solid var(--tm-navy); outline-offset: 2px; }
@media (max-width: 1199.98px) {
  #hdl .navbar-collapse { flex-basis: 100%; padding-top: .75rem; }
  #hdl .site-nav-link { border-bottom: 1px solid var(--tm-divider); margin: 0; font-size: .9375rem; }
  #hdl .site-nav-search { padding: .75rem 0 .25rem; }
  #hdl .header-search, #hdl .header-search-group { width: 100%; max-width: none; }
  #hdl .header-search-group .form-control, #hdl .header-search-group .form-select { font-size: 1rem; }
  #hdl .header-search-group .form-select { max-width: 8rem; }
}
@media (min-width: 1200px) {
  #hdl .site-brand-logo { width: 224px; }
}
.tm-article-sidebar { align-self: stretch; min-height: 0; padding: 1.5rem 1rem; }
.tm-sidebar-sticky { max-height: calc(100dvh - var(--tm-header-offset) - 2rem); overflow-y: auto; overscroll-behavior: contain; gap: 1rem; padding: .25rem; }
.tm-side-toc .btn-toggle, .tm-side-toc a { font-size: .875rem; line-height: 1.6; min-height: 44px; padding: .625rem .5rem; }
.tm-side-toc .side-toc-link { min-height: 0; padding: 0 !important; border: 0; }
.tm-side-toc .btn-toggle-nav a { width: calc(100% - .75rem) !important; margin-left: .75rem; }
.tm-side-toc summary.btn-toggle::after { content: '+'; margin-left: auto; padding-left: .5rem; }
.tm-side-toc details[open] > summary.btn-toggle::after { content: '−'; }
.tm-toc-mobile > summary { min-height: 48px; padding: .75rem; }
.tm-toc-mobile { background: var(--tm-surface-muted); }
.tm-toc-mobile .toc { padding: 0 .75rem; }
.tm-toc-mobile .toc a { min-height: 44px; font-size: .9375rem; }

/* Search first: compact stats on phones, spacious copy on wide screens. */
.index-hero-copy p { max-width: 38em; font-size: 1rem; line-height: 1.8; }
.index-stat-label { color: #c3c7e2; font-size: .75rem; letter-spacing: .1em; }
.index-hero-kicker { font-size: .75rem; letter-spacing: .14em; }
.index-search-panel { margin-top: 2rem; background: #fff; }
.index-search-cat span { min-height: 48px; font-size: .875rem; padding: .75rem 1rem; }
.index-search-cat input:focus-visible + span { outline: 3px solid #7b9ad0; outline-offset: -3px; }
.index-search-input:focus-visible { outline: 2px solid var(--tm-navy); outline-offset: -3px; }
.index-search-popular { padding: .75rem 1rem; }
.index-popular-chip { min-height: 44px; display: inline-flex; align-items: center; font-size: .8125rem; }
.index-popular-label { font-size: .75rem; letter-spacing: .1em; }
.index-entry-card { padding: 1.5rem; }
.index-entry-meta { font-size: .875rem; line-height: 1.65; }
.index-entry-title { line-height: 1.5; }
.index-entry-kicker { font-size: .75rem; }
.index-area-wrap, .index-class-wrap, .index-rank-wrap { overflow: visible; }
.index-area-wrap dl.row { margin: 0; }
.index-area-wrap dt { padding: .75rem 0 !important; border-top: 1px solid var(--tm-divider); }
.index-area-wrap dd { font-size: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin: 0; padding: .375rem 0 !important; border-top: 1px solid var(--tm-divider); }
.index-area-wrap dd a { font-size: 1rem; display: inline-flex; align-items: center; min-height: 44px; padding: .375rem .5rem; }
.index-class-wrap.row, .index-rank-wrap.row { display: grid; margin: 0; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.index-class-wrap.row > [class*='col-'], .index-rank-wrap.row > [class*='col-'] { width: auto; min-width: 0; padding: 0 !important; margin: 0 !important; }
.index-class-wrap .card-header { white-space: normal; overflow: visible; text-overflow: clip; font-size: 1rem; line-height: 1.6; padding: 1rem !important; }
.index-class-wrap .card-body { padding: 0 1rem .5rem; }
.index-class-wrap .card-body p { font-size: .875rem; line-height: 1.75; }
.index-class-wrap .card-footer { padding: .25rem 1rem .5rem !important; }
.index-class-wrap .card-footer a { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; }
.index-class-wrap .card:focus-within { outline: 2px solid var(--tm-navy); outline-offset: 2px; }
.index-rank-wrap.row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.index-rank-wrap .line-heading { margin-top: 0; padding-top: 1rem; }
.index-poster h2 { font-size: clamp(1.625rem, 3vw, 2.625rem) !important; line-height: 1.5; }

/* Readable data, keeping numeric comparisons as tables. */
.contents-article .table, .index-redesign .table, .tm-shell .table { font-size: .9375rem; line-height: 1.65; }
.contents-article .table small, .index-redesign .table small { font-size: .8125rem; }
.contents-article .table :is(td, th).text-condensed { line-height: 1.7; }
.contents-article .table > thead > tr > *, .index-redesign .table > thead > tr > * { font-size: .8125rem; letter-spacing: .02em; }
.contents-article .table > :not(caption) > * > *, .index-redesign .table > :not(caption) > * > * { padding: .75rem; }
.contents-article .table td:not(:first-child) { font-family: var(--tm-font-body); }
.contents-article .table td:is(.text-end, .w-25), .index-redesign .table td.text-end { font-family: var(--tm-font-numeric); white-space: nowrap; }
.pagination { flex-wrap: wrap; gap: .25rem; }
.pagination .page-link { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

/* Preserve image proportions; contain trademark artwork without cropping. */
.contents-article .supervisor-avatar-img { width: 72px; height: 72px; object-fit: cover; }
.supervisor-box { font-size: .9375rem; }
.supervisor-box .title { font-size: .8125rem; letter-spacing: 0; }
.supervisor-box .description, .supervisor-box .comment-body { line-height: 1.8; }
.contents-article .imgh, .tm-shell .imgh { width: auto; height: auto; max-height: 180px; object-fit: contain; margin: .75rem auto; }
.tm-banner { max-width: 760px; margin: 1.5rem auto; }
.tm-banner img { object-fit: contain; }
.tm-banner.mobile-break { max-width: 360px; }
.tm-sidebar-ad img { margin-top: .75rem; }
.banner-caption { font-size: .8125rem; line-height: 1.65; margin-top: .75rem; }
.tm-promo-section p { font-size: .9375rem; }
.tm-about-block > .row { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin: 0; }
.tm-about-block > .row > [class*='col-'] { width: 100%; padding: 0; margin: 0 !important; }
.tm-about-block .tbox { border: 1px solid var(--tm-divider); padding: 1.5rem; }
.tm-about-block .box-title { position: static; display: block; padding: 0; margin: 0 0 .75rem; font-size: 1.125rem; line-height: 1.5; }
.tm-about-block .ratio { max-width: 640px; margin-inline: auto; }
.sf_footer .blog-sidebar ul.category li a { height: auto; min-height: 44px; line-height: 1.6; padding: .625rem 0; font-size: .9375rem; }

@media (max-width: 1199.98px) and (min-width: 992px) {
  .index-class-wrap.row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .index-class-wrap.row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-hero-stats { flex-direction: row; gap: 1rem; }
  .index-stat { flex: 1; min-width: 0; flex-direction: column; gap: .5rem; border-bottom: 1px solid #ffffff38; }
  .index-stat-value { font-size: clamp(1rem, 2.7vw, 1.5rem); white-space: nowrap; }
}
@media (max-width: 767.98px) {
  body { font-size: 1rem !important; line-height: 1.8 !important; }
  .index-hero { padding-top: 2rem; }
  .index-hero-copy h1 { font-size: clamp(1.75rem, 8vw, 2.5rem); line-height: 1.3; }
  .index-hero-grid { gap: 1.5rem; }
  .index-hero-stats { gap: .75rem; }
  .index-stat-label { font-size: .625rem; letter-spacing: .06em; }
  .index-search-panel { margin-top: 1.5rem; }
  .index-search-submit { min-height: 48px; padding: .75rem; }
  .index-entry-grid { grid-template-columns: 1fr; }
  .index-entry-card { min-height: 0; padding: 1.25rem; }
  .index-rank-wrap.row { grid-template-columns: 1fr; }
  .tm-kpis { gap: 0 1rem; }
  .tm-kpi-value-sm { font-size: 1rem; }
  .tm-section-head { grid-template-columns: 1fr; gap: .375rem; }
  .tm-meta-right { justify-content: space-between; }
  .tm-about-block .tbox { padding: 1rem; }
}
@media (max-width: 575.98px) {
  .index-class-wrap.row { grid-template-columns: 1fr; }
  .index-area-wrap dt { padding-bottom: .25rem !important; }
  .index-area-wrap dd { border-top: 0; padding-bottom: 1rem !important; }
  .contents-article .supervisor-avatar-img { width: 64px; height: 64px; }
  .tm-banner.mobile-hide { display: none; }
  .tm-banner.mobile-break { display: block; }
  .contents-article .t-vertical thead { display: none; }
  .contents-article .t-vertical tr { border: 0; border-bottom: 1px solid var(--tm-divider); }
  .contents-article .t-vertical td { display: block; width: 100% !important; text-align: left !important; border: 0; padding: .75rem 1rem; }
  .contents-article .t-vertical td:first-child { background: var(--tm-surface-muted); padding-bottom: .5rem; }
  .contents-article .t-vertical td:last-child { padding-bottom: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Narrow screens must not use the grid item's intrinsic text width. */
.index-hero-grid > * { min-width: 0; }
.contents-article :is(h1, h2, h3), .tm-side-toc .side-toc-link { overflow-wrap: break-word; line-break: strict; }
@media (max-width: 991.98px) { .index-hero-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 359.98px) { .index-stat-value { font-size: .875rem; } }

/* Shared record/static shells and trust panels use the same spacing contract. */
.container.tm-shell, .container-lg.tm-shell { padding-inline: var(--tm-gutter); }
.tm-shell > .row { max-width: none; }
.serviceinfo-panel { gap: 1rem; padding: 1rem; align-items: flex-start; font-size: .875rem; line-height: 1.7 !important; }
.serviceinfo-panel > a:has(.serviceinfo-img) { flex: 0 0 64px; }
.serviceinfo-panel .serviceinfo-img { flex: 0 0 64px; width: 64px; height: 64px !important; padding: 0; margin: 0; object-fit: contain; }
@media (min-width: 576px) and (max-width: 991.98px) {
  .serviceinfo-panel { flex-direction: column; gap: .75rem; }
}

/* Article overview: source table + CSS bars, no charting library. */
.tm-trends { margin: 1.5rem 0 2rem; }
.tm-trends-controls { display: flex; justify-content: flex-end; margin-bottom: 1.25rem; }
.tm-trends-controls button { min-height: 44px; min-width: 64px; padding: .5rem .875rem; border: 1px solid var(--tm-divider); background: white; color: var(--tm-navy); font-weight: 700; }
.tm-trends-controls button + button { border-left: 0; }
.tm-trends-controls button[aria-pressed="true"] { background: var(--tm-navy); color: white; }
.tm-trends-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.tm-trends .tm-trends-table { max-width: none; margin: 0; min-width: 0; }
.tm-trend-chart { min-width: 0; margin: 0; padding-top: 2rem; }
.tm-trend-plot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(.5rem, 1.2vw, 1rem); padding: 0; margin: 0; list-style: none; }
.tm-trend-column { min-width: 0; }
.tm-trend-track { height: 190px; display: flex; align-items: flex-end; border-bottom: 2px solid var(--tm-text); background: repeating-linear-gradient(to top, transparent 0, transparent 46px, var(--tm-divider-soft) 47px, transparent 48px); }
.tm-trend-bar { width: 100%; position: relative; background: var(--tm-navy); }
.tm-trend-value { position: absolute; bottom: calc(100% + .375rem); left: 50%; transform: translateX(-50%); font-family: var(--tm-font-numeric); font-size: .8125rem; font-weight: 700; white-space: nowrap; color: var(--tm-navy); }
.tm-trend-year { display: block; padding-top: .5rem; font-size: .75rem; font-family: var(--tm-font-numeric); text-align: center; }
.tm-trend-column.is-latest .tm-trend-bar { background: #7b9ad0; }
.tm-trend-column.is-latest .tm-trend-year { font-weight: 800; }
.tm-trend-chart figcaption { margin-top: 1rem; color: var(--tm-muted); font-size: .8125rem; line-height: 1.6; }
.tm-trends-grid[data-view="chart"], .tm-trends-grid[data-view="table"] { grid-template-columns: minmax(0, 1fr); }
.tm-trends-grid[data-view="chart"] .tm-trend-chart { max-width: 640px; width: 100%; margin-inline: auto; }
.tm-trends-grid [hidden] { display: none !important; }

/* Generated Bootstrap columns need an actual grid parent. */
.tm-abstract-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.tm-abstract-grid > [class*="col-"] { width: auto; min-width: 0; padding: 0 !important; }
.tm-abstract-grid .card { border-radius: 0; border-color: var(--tm-divider); }
.tm-abstract-grid .card-header { white-space: normal; overflow: visible; padding: 1rem !important; line-height: 1.6; }
.tm-abstract-grid .card-body { padding: 1rem !important; }
.tm-abstract-grid .card-body p { margin-bottom: 0; font-size: .9375rem; }
.tm-abstract-grid .card-body ul { margin-bottom: 1rem; }
.tm-abstract-grid .card-footer { padding: .25rem 1rem !important; }
.tm-abstract-grid .card-footer a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 992px) {
  .tm-trends-grid, .tm-abstract-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-article-layout { grid-template-columns: minmax(0, 1fr) 336px; }
}

/* Short attribution at the start; comments stay beside the relevant section. */
.tm-supervisor-wrap { margin-top: 1.5rem; }
.tm-supervisor-wrap .tm-supervisor-byline { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 1rem; padding: 1.25rem 0; margin: 0; border: 0; border-block: 1px solid var(--tm-divider); background: transparent; }
.tm-supervisor-wrap .tm-supervisor-byline .supervisor-avatar-img { width: 64px; height: 64px; }
.tm-supervisor-label { color: var(--tm-muted); font-size: .75rem; letter-spacing: .1em; margin: 0 0 .375rem !important; }
.tm-supervisor-info .name { margin: 0; line-height: 1.6; }
.tm-supervisor-role { display: block; font-size: .8125rem; font-weight: 400; color: var(--tm-muted); margin-top: .25rem; }
.tm-supervisor-info .description { margin: .375rem 0 0; font-size: .875rem; }
.tm-supervisor-profile { display: inline-flex; align-items: center; min-height: 44px; font-size: .8125rem; }
.contents-article .comment-box { padding: 1rem 1.25rem; background: transparent; border-left: 2px solid var(--tm-navy); }

/* Responsive article ads; one 300 × 250 rectangle in the sidebar. */
.tm-ad-rectangle { width: 300px; max-width: 100%; margin-inline: auto; }
.tm-ad-rectangle > a { display: block; width: 100%; aspect-ratio: 6 / 5; }
.tm-ad-rectangle img { width: 100%; height: auto; margin: 0; object-fit: contain; }
.tm-ad-rectangle .tm-sidebar-label { display: block; margin-bottom: .75rem; }
.tm-promo-section { margin: 1.25rem 0; padding: .75rem !important; }
.tm-promo-link { display: block; text-decoration: none; }
.tm-promo-link picture { display: block; width: 100%; max-width: none; margin: .5rem 0 0; }
.tm-promo-link img { display: block; width: 100%; height: auto; }
.tm-promo-cta { display: flex; justify-content: center; align-items: center; gap: .75rem; min-height: 48px; padding: .75rem; margin-top: .75rem; font-size: .9375rem; font-weight: 700; }
@media (max-width: 767.98px) {
  .tm-promo-link picture { max-width: none; }
  .tm-promo-link img { aspect-ratio: 6 / 5; object-fit: contain; }
}

.tm-sidebar-sticky { padding: 0; }
.contents-article .comment-box { width: 100%; }
.contents-article .comment-box .toppadding > .col-auto { display: none; }
.contents-article .comment-box .toppadding > .col { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin-bottom: .75rem; }
.contents-article .comment-box .comment-title, .contents-article .comment-box .comment-name { margin: 0; font-size: .875rem; font-weight: 600; color: var(--tm-navy); }

/* Match the plot bounds to the table header/body; labels stay below the baseline. */
@media (min-width: 992px) {
  .tm-trends-grid:not([data-view="chart"]):not([data-view="table"]) .tm-trend-chart { padding-top: var(--tm-trend-caption-height, 3rem); }
  .tm-trends-grid:not([data-view="chart"]):not([data-view="table"]) .tm-trend-track { box-sizing: border-box; height: var(--tm-trend-data-height, 280px); padding-top: 2rem; }
}
.tm-trends-table .table { margin-bottom: 0; }

/* Section headings are nested inside generated columns, not direct children. */
.tm-blocks h2.line-heading { margin-top: clamp(2.5rem, 4vw, 4rem); margin-bottom: 1.5rem; }
.tm-blocks h3.line-heading { margin-top: clamp(2rem, 3vw, 3rem); margin-bottom: 1.25rem; }

/* Decorative comparison bars retain the original two-column table and links. */
.table.tm-count-table { table-layout: fixed; }
.table.tm-count-table th:first-child, .table.tm-count-table td:first-child { width: 78% !important; text-align: left; }
.table.tm-count-table th:last-child, .table.tm-count-table td:last-child { width: 22% !important; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm-count-cell { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; align-items: center; }
.tm-count-label { min-width: 0; overflow-wrap: anywhere; }
.tm-count-track { display: block; height: .5rem; background: #edf0f5; }
.tm-count-bar { display: block; height: 100%; background: #9ebce9; }
.tm-count-table tr.is-maximum .tm-count-bar { background: var(--tm-navy); }
.tm-count-table tr.is-maximum td { background: #f6f8fc; }
@media (min-width: 992px) {
  .tm-count-cell { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.5rem; }
  .tm-count-track { height: .625rem; }
}

/* White surfaces for the homepage ranking headers and leading rows. */
.index-rank-wrap .table { background-color: #fff; }
.index-rank-wrap .tm-count-table tr.is-maximum td { background-color: #fff; }

@media (min-width: 768px) {
  .tm-promo-link picture { width: 80%; margin-inline: auto; }
}
