﻿
/* =========================
   Tokens
   ========================= */

:root {
  --font-primary: "Noto Sans JP", "Inter", sans-serif;
  --report-font-scale: 1.03;
  --color-primary: #0852a0;
  --color-primary-soft: #5c7cbe;
  --color-primary-light: rgba(0, 82, 155, 0.08);
  --nav-hover-color: #0852a0;
  --nav-hover-bg: rgba(0, 82, 155, 0.08);
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #404040;
  --color-text-muted: #595959;
  --line-height-base: 1.7;
  --line-height-heading: 1.3;
  --letter-spacing-tight: -0.02em;
  --prose-font-size: clamp(0.98rem, 0.94rem + 0.16vw, 1.06rem);
  --prose-line-height: 1.9;
  --prose-max-width: 84ch;
  --prose-paragraph-gap: 0.95rem;
  --color-bg: #f8f9fa;
  --color-bg-primary: #f8f9fa;
  --color-surface: #ffffff;
  --color-border: #ced4da;
  --color-accent-green: #007040;
  --color-accent-green-light: rgba(0, 112, 64, 0.07);
  --color-accent-red: #c52a2a;
  --color-accent-red-light: rgba(197, 42, 42, 0.07);
  --bar-color-groups: #5470c6;
  --bar-color-brands: #3ba272;
  --bar-color-models: #5470c6;
  --bar-color-ev-models: #3ba272;
  --bar-color-origin-share: #0852a0;
  --bar-color-honda-country: #fac858;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
  --border-radius-lg: 0.5rem;
  --transition-fast: 0.25s ease-out;
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --color-bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #eef2f6 100%);
  --panel-bg: rgba(255, 255, 255, 0.95);
  --panel-blur: blur(8px);
  --header-z-index: 1000;
  --focus-ring: 0 0 0 3px rgba(0, 82, 155, 0.22);

  --chart-font-title: 16.5;
  --chart-font-label: 12.4;
  --chart-font-axis: 12.4;
  --chart-font-legend: 12.4;
  --chart-font-tooltip: 13.4;
  --chart-font-weight-title: 700;
  --chart-font-weight-label: 500;
  --chart-surface-bg: rgba(248, 250, 252, 0.55);
  --chart-border-color: #ced4da;
  --chart-axis-line-color: rgba(15, 23, 42, 0.2);
  --chart-axis-tick-color: rgba(15, 23, 42, 0.18);
  --chart-grid-line-color: rgba(15, 23, 42, 0.08);
  --chart-tooltip-bg: rgba(255, 255, 255, 0.96);
  --chart-tooltip-border: #dbe3ea;
  --chart-tooltip-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  --chart-crosshair-color: rgba(0, 82, 155, 0.22);
  --chart-area-color: rgba(0, 82, 155, 0.08);
  --chart-bar-radius: 6;
  --chart-line-width: 2.6;
  --chart-anim-duration: 420;
  --chart-anim-easing: cubicOut;
  --chart-container-min-height-wide: clamp(260px, 42vh, 460px);
  --chart-container-min-height-narrow: clamp(260px, 44vh, 360px);
}

html[data-dashboard-theme="honda"] {
  --color-primary: #b11226;
  --color-primary-soft: #cf4c5f;
  --color-primary-light: rgba(177, 18, 38, 0.07);
  --bar-color-groups: #5470c6;
  --bar-color-brands: #fc8452;
  --bar-color-models: #91cc75;
  --bar-color-ev-models: #3ba272;
  --bar-color-origin-share: #0852a0;
  --bar-color-honda-country: #0852a0;
  --focus-ring: 0 0 0 3px rgba(177, 18, 38, 0.22);
  --chart-crosshair-color: rgba(177, 18, 38, 0.22);
  --chart-area-color: rgba(177, 18, 38, 0.08);
}

/* =========================
   Base
   ========================= */

.symbol-unit {
  font-weight: 400;
  font-size: 0.9em;
  opacity: 0.85;
  display: inline;
}

.symbol-reset {
  font-weight: 400;
  font-family: var(--font-primary);
}

html {
  box-sizing: border-box;
  font-size: calc(16px * var(--report-font-scale));
  scroll-behavior: smooth;
  font-family: var(--font-primary);
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  display: flex;
  flex-direction: column;
  height: auto;
  overflow: auto;
  min-height: 100vh;
  font-family: var(--font-primary);
  font-weight: 400;
  background: var(--color-bg-gradient);
  color: var(--color-text-primary);
  margin: 0;
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings:
    "liga" 1,
    "kern" 1;
  text-rendering: optimizeLegibility;
}

/* =========================
   Layout
   ========================= */

header {
  width: 100%;
  height: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: none;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow-y: visible;
  padding: 1.5rem;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.9);
}

header h1 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-heading);
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0;
  position: relative;
}

.nav-indicator {
  position: absolute;
  left: 0;
  width: 4px;
  background: var(--color-primary);
  border-radius: 4px;
  transition: all var(--transition-smooth);
  box-shadow: 2px 0 4px rgba(37, 99, 235, 0.2);
  pointer-events: none;
}

nav button {
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  cursor: pointer;
  border-left: 4px solid transparent;
  color: var(--color-text-secondary);
  white-space: nowrap;
  border-radius: 0 8px 8px 0;
  position: relative;
  letter-spacing: 0.01em;
  text-align: left;
  outline: none;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

nav button:hover {
  background-color: var(--nav-hover-bg);
  color: var(--nav-hover-color);
  transform: translateX(2px);
}

nav button[data-market="honda"]:hover {
  background-color: rgba(177, 18, 38, 0.08);
  color: #b11226;
}

nav button.active {
  color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.05);
  font-weight: 700;
}

html[data-dashboard-theme="honda"] .nav-indicator {
  box-shadow: 2px 0 4px rgba(177, 18, 38, 0.2);
}

html[data-dashboard-theme="honda"] nav button.active {
  background-color: rgba(177, 18, 38, 0.08);
}

nav button:active {
  transform: scale(0.98) translateX(1px);
}

nav button:focus-visible,
.toggle-btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.tab-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: wrap;
}

.tab-btn-flag {
  flex: 0 0 auto;
  display: inline-block;
}

.tab-btn-flag-group {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  flex: 0 0 auto;
}

.tab-btn-flag--image {
  width: 1.15rem;
  height: 0.82rem;
  object-fit: cover;
  border-radius: 0.15rem;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

main {
  flex-grow: 1;
  height: auto;
  overflow-y: visible;
  padding: 1.5rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#main-content {
  position: relative;
}

#main-content.is-loading .container {
  opacity: 0.45;
  filter: saturate(0.9);
  pointer-events: none;
}

/* =========================
   Components
   ========================= */

.loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text-secondary);
  font-size: 0.86rem;
  box-shadow: var(--shadow-sm);
}

.loading-indicator[hidden] {
  display: none !important;
}

.loading-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 82, 155, 0.2);
  border-top-color: var(--color-primary);
  animation: loading-spin 0.9s linear infinite;
}

html[data-dashboard-theme="honda"] .loading-spinner {
  border-color: rgba(177, 18, 38, 0.2);
  border-top-color: var(--color-primary);
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.panel {
  padding: clamp(1rem, 2.2vw, 1.75rem);
  border-radius: var(--border-radius-lg);
  margin-bottom: 1.75rem;
  position: relative;
  background-color: var(--panel-bg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--panel-blur);
  transition:
    opacity 0.42s ease,
    transform 0.42s cubic-bezier(0.25, 0.8, 0.25, 1),
    box-shadow var(--transition-fast);
}

/* JSが有効なときだけ、最初は隠してスクロールで出す */
html.js .panel {
  opacity: 0;
  transform: translateY(20px);
  will-change: transform, opacity;
}

html.js .panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

.container>.panel:nth-of-type(2) {
  transition-delay: 0.1s;
}

.container>.panel:nth-of-type(3) {
  transition-delay: 0.15s;
}

.container>.panel:nth-of-type(4) {
  transition-delay: 0.2s;
}

.container>.panel:nth-of-type(5) {
  transition-delay: 0.25s;
}

.panel-title {
  position: relative;
  padding-left: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text-primary);
  flex-grow: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.1rem;
}

.panel-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1.25rem;
  background: var(--panel-title-accent, var(--color-primary));
  border-radius: 2px;
}

.panel-subtitle {
  font-size: clamp(0.88rem, 0.82rem + 0.28vw, 1rem);
  color: var(--color-text-secondary);
  margin: 0;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.panel-header > .panel-subtitle {
  padding: 0.34rem 0.62rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.5rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.75), rgba(241, 245, 249, 0.65));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.panel-content-grid {
  display: grid;
  /* Desktop-first: automatically fall back to 1 column when the panel gets narrow */
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 2rem);
  align-items: stretch;
  margin-top: 0.5rem;
}

.panel-content-grid > * {
  min-width: 0;
}

.panel-content-grid.panel-content-stack {
  grid-template-columns: 1fr;
}

.chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chart-surface-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--chart-border-color);
  padding: 10px;
  box-sizing: border-box;
  box-shadow: var(--shadow-md);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  min-height: var(--chart-container-min-height-wide);
}

[id^="chart-"] {
  box-shadow: none;
  padding-left: 6px;
  padding-right: 6px;
}

.chart-container > div,
.chart-container > canvas,
.chart-container > svg {
  max-width: 100%;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  min-width: 0;
  max-width: 100%;
}

.annual-growth-table-wrapper {
  margin-top: 0.75rem;
}

.key-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  padding: 1.25rem 1rem;
  border-radius: var(--border-radius-lg);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--color-border);
  background: linear-gradient(145deg, #ffffff, #f8faff);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric-card .label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

.metric-card .value {
  font-size: 1.75rem;
  line-height: 1.1;
  margin-bottom: 0.25rem;
  font-feature-settings: "tnum" 1;
  color: var(--color-primary);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.metric-card .sub-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.metric-card--top-model {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.1rem;
}

.metric-card__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.metric-card__brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 3.1rem;
  width: 3.1rem;
  height: 3.1rem;
}

.metric-card__brand-logo.brand-logo-inline {
  width: 100%;
  height: 100%;
  opacity: 1;
  transform: scale(var(--metric-card-brand-logo-scale, 1));
}

.metric-card__brand-logo.brand-logo-inline--standard {
  --metric-card-brand-logo-scale: 0.95;
}

.metric-card__brand-logo.brand-logo-inline--wide {
  --metric-card-brand-logo-scale: 1.04;
}

.metric-card__brand-logo.brand-logo-inline--badge {
  --metric-card-brand-logo-scale: 0.92;
}

.analysis-summary {
  color: var(--color-text-primary);
  border-left: 4px solid var(--color-primary);
  border-left-width: 4px;
  border-left-color: var(--color-primary);
  padding: clamp(0.85rem, 0.8rem + 0.3vw, 1.1rem) clamp(1rem, 0.8rem + 0.8vw, 1.45rem);
  margin: 1.05rem 0;
  background: linear-gradient(90deg, var(--color-primary-light), transparent 90%);
  border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
  font-weight: 400;
  text-align: left;
  font-size: var(--prose-font-size);
  line-height: var(--prose-line-height);
  letter-spacing: 0.005em;
}

.analysis-summary p {
  margin: 0;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.analysis-summary :is(strong, b) {
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.analysis-summary p + p {
  margin-top: var(--prose-paragraph-gap);
}

.analysis-summary.analysis-spotlight::before {
  content: "要点";
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

html[data-dashboard-theme="honda"] .analysis-summary.analysis-spotlight::before {
  background: rgba(177, 18, 38, 0.08);
}

#honda-dashboard .panel {
  --panel-title-accent: #b11226;
}

#honda-overview {
  background:
    radial-gradient(circle at top right, rgba(177, 18, 38, 0.1), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(250, 245, 246, 0.96));
}

#honda-dashboard .metric-card .value {
  color: #111111;
}

.honda-subsection-title {
  border-left-color: rgba(177, 18, 38, 0.42);
}

#honda-region-structure .table-container,
#honda-powertrain .table-container,
#honda-models .table-container {
  margin-top: 0;
}

#honda-region-structure .table-container > .table-wrapper,
#honda-powertrain .table-container > .table-wrapper,
#honda-models .table-container > .table-wrapper {
  box-shadow: var(--shadow-md);
}

.honda-table-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 2rem);
}

#honda-regional-model-tables {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.honda-mini-table-container {
  gap: 0.55rem;
}

@media (max-width: 1200px) {
  #honda-regional-model-tables {
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  }
}

.simple-table.honda-mini-table td,
.simple-table.honda-mini-table th {
  font-size: 0.76rem;
  padding: 0.34rem 0.28rem;
  vertical-align: middle;
}

.simple-table.honda-mini-table {
  min-width: 0;
  table-layout: fixed;
}

.simple-table.honda-mini-table th:first-child,
.simple-table.honda-mini-table td:first-child {
  width: 2.2rem;
  text-align: center;
  white-space: nowrap;
}

.simple-table.honda-mini-table th:nth-child(2),
.simple-table.honda-mini-table td:nth-child(2) {
  width: 34%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.simple-table.honda-mini-table th:nth-child(3),
.simple-table.honda-mini-table td:nth-child(3) {
  width: 24%;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.simple-table.honda-mini-table th:nth-child(4),
.simple-table.honda-mini-table td:nth-child(4) {
  width: 20%;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.simple-table.honda-mini-table th:nth-child(5),
.simple-table.honda-mini-table td:nth-child(5) {
  width: 18%;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.honda-table-grid .table-wrapper {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.honda-mini-table-container > .table-wrapper {
  box-shadow: var(--shadow-md);
}

#honda-model-yearly-tables {
  gap: clamp(0.9rem, 1.6vw, 1.2rem);
}

#honda-model-yearly-tables .simple-table.honda-mini-table th,
#honda-model-yearly-tables .simple-table.honda-mini-table td {
  font-size: 0.74rem;
  padding: 0.32rem 0.3rem;
}

#honda-model-yearly-tables .simple-table.honda-mini-table th:first-child,
#honda-model-yearly-tables .simple-table.honda-mini-table td:first-child {
  width: 7%;
}

#honda-model-yearly-tables .simple-table.honda-mini-table th:nth-child(2),
#honda-model-yearly-tables .simple-table.honda-mini-table td:nth-child(2) {
  width: 28%;
  line-height: 1.15;
}

#honda-model-yearly-tables .simple-table.honda-mini-table th:nth-child(3),
#honda-model-yearly-tables .simple-table.honda-mini-table td:nth-child(3) {
  width: 16%;
}

#honda-model-yearly-tables .simple-table.honda-mini-table th:nth-child(4),
#honda-model-yearly-tables .simple-table.honda-mini-table td:nth-child(4) {
  width: 16%;
}

#honda-model-yearly-tables .simple-table.honda-mini-table th:nth-child(5),
#honda-model-yearly-tables .simple-table.honda-mini-table td:nth-child(5) {
  width: 10%;
}

#honda-model-yearly-tables .simple-table.honda-mini-table th:nth-child(6),
#honda-model-yearly-tables .simple-table.honda-mini-table td:nth-child(6) {
  width: 11%;
  text-align: right;
}

#honda-model-yearly-tables .simple-table.honda-mini-table th:nth-child(7),
#honda-model-yearly-tables .simple-table.honda-mini-table td:nth-child(7) {
  width: 12%;
  text-align: center;
}

#honda-model-yearly-tables .simple-table.honda-mini-table thead th {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  line-height: 1.1;
  font-size: 0.7rem;
  letter-spacing: -0.01em;
}

#honda-model-yearly-tables .simple-table.honda-mini-table th:nth-child(n + 3),
#honda-model-yearly-tables .simple-table.honda-mini-table td:nth-child(n + 3) {
  letter-spacing: -0.01em;
}

#honda-model-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#honda-model-table th.col-rank,
#honda-model-table td.col-rank {
  min-width: 2.8rem;
  width: 2.8rem;
}

#honda-model-table th.col-sales,
#honda-model-table td.col-sales {
  min-width: 6.4rem;
  width: 6.4rem;
}

#honda-model-table th.col-yoy,
#honda-model-table td.col-yoy {
  min-width: 5.1rem;
  width: 5.1rem;
}

#honda-model-table th.col-rank-change,
#honda-model-table td.col-rank-change {
  min-width: 4.2rem;
  width: 4.2rem;
}

#honda-model-table th.col-name,
#honda-model-table td.col-name {
  width: auto;
  min-width: 0;
}

#honda-model-table td.col-sales .sub-value,
#honda-model-table td.col-yoy .sub-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.honda-implication-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.honda-implication-list li {
  position: relative;
  padding-left: 1rem;
  color: var(--color-text-primary);
}

.honda-implication-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: #b11226;
  box-shadow: 0 0 0 3px rgba(177, 18, 38, 0.12);
}

.honda-trend-positive {
  color: var(--color-accent-green);
}

.honda-trend-negative {
  color: var(--color-accent-red);
}

.chart-tooltip {
  display: inline-block;
  text-align: left;
  font-size: 12px;
  line-height: 1.35;
  min-width: 100px;
  color: var(--color-text-primary);
  letter-spacing: 0.01em;
}

.chart-tooltip--with-image {
  font-size: 14px;
  line-height: 1.5;
  width: 320px;
  max-width: min(320px, calc(100vw - 48px));
  min-width: 0;
}

.chart-tooltip__title {
  font-weight: 600;
  margin-bottom: 6px;
}

.chart-tooltip__title-wrap {
  margin-bottom: 6px;
}

.chart-tooltip__title-wrap--with-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.chart-tooltip__title-copy {
  min-width: 0;
}

.chart-tooltip__title-logo {
  flex: 0 0 1.6rem;
  width: 1.6rem;
  height: 1.6rem;
  object-fit: contain;
  object-position: center;
  border-radius: 0.3rem;
}

.chart-tooltip__subtitle {
  margin-top: 2px;
  font-size: 0.82em;
  color: var(--color-text-muted);
  line-height: 1.25;
}

.chart-tooltip--corporate {
  min-width: 280px;
}

.chart-tooltip__corporate-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.chart-tooltip__corporate-head .chart-tooltip__corporate-logo {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  min-width: 2.1rem;
  max-width: 2.1rem;
  max-height: 2.1rem;
  object-fit: contain;
  object-position: center;
  display: block;
  transform: none;
}

.chart-tooltip__corporate-head-copy {
  flex: 1;
  min-width: 0;
}

.chart-tooltip__corporate-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text-primary);
}

.chart-tooltip__corporate-rank {
  flex: 0 0 auto;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
}

.chart-tooltip--with-image .chart-tooltip__title {
  font-size: 16px;
  margin-bottom: 8px;
}

.chart-tooltip__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.chart-tooltip__value {
  text-align: right;
}

.chart-tooltip__section {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.chart-tooltip__section-label {
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.chart-tooltip__section--meta .chart-tooltip__row > span:first-child,
.chart-tooltip__section--ranking .chart-tooltip__row > span:first-child {
  flex: 0 0 5.5rem;
  color: var(--color-text-muted);
}

.chart-tooltip__section--meta .chart-tooltip__value {
  flex: 1;
  text-align: left;
  white-space: normal;
  line-height: 1.4;
}

.chart-tooltip__section--ranking .chart-tooltip__value {
  flex: 1;
  text-align: right;
}

.chart-tooltip__row--stacked {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.chart-tooltip__row--stacked > span:first-child {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text-muted);
}

.chart-tooltip__row--stacked .chart-tooltip__value {
  display: block;
  text-align: left;
  white-space: normal;
  line-height: 1.45;
  max-width: 24rem;
}

.chart-tooltip__image-wrap {
  margin: 10px 0 12px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.chart-tooltip__image {
  width: 100%;
  height: auto;
  object-fit: initial;
  object-position: initial;
  transform: none;
  filter: var(--tt-img-filter, saturate(1.03) contrast(1.03) brightness(1.02));
  display: block;
}

.chart-tooltip__source {
  margin-top: 8px;
  font-size: 12px;
}

.chart-tooltip__source a {
  color: var(--color-primary);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .chart-tooltip--with-image {
    width: 256px;
    max-width: min(256px, calc(100vw - 32px));
    font-size: 13px;
  }

  .chart-tooltip__image-wrap {
    width: 100%;
  }
}

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
    background: var(--color-surface);
    color: var(--color-text-primary);
  }
  
  th,
  td {
    padding: 0.3rem 0.425rem;
    font-size: 0.875rem;
    line-height: 1.3;
  }
  
  td.col-name,
  td.col-model-name,
  td.col-manufacturer-name {
    white-space: normal;
    word-break: break-word;
  }

  .flag-label-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    max-width: 100%;
  }

  .brand-logo-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    max-width: 100%;
  }

  .brand-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.55rem;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0.08rem;
    overflow: hidden;
  }

  .flag-inline {
    display: inline-block;
    flex: 0 0 1.35rem;
    width: 1.35rem;
    height: 0.94rem;
  }

  .flag-inline--image {
    object-fit: cover;
    border-radius: 0.15rem;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  }

  .brand-logo-inline {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    vertical-align: middle;
    image-rendering: -webkit-optimize-contrast;
    mix-blend-mode: normal;
    filter: none;
    opacity: 0.95;
    transform: scale(var(--brand-logo-scale, 0.94));
    transform-origin: center center;
  }

  .brand-logo-inline--standard {
    --brand-logo-scale: 0.94;
  }

  .brand-logo-inline--wide {
    --brand-logo-scale: 1;
  }

  .brand-logo-inline--badge {
    --brand-logo-scale: 0.88;
  }

  .flag-label-text {
    min-width: 0;
  }
  
  td.col-rank,
  td.col-sales,
  td.col-yoy,
  td.col-share,
  td.col-share-change,
  td.col-rank-change {
    white-space: nowrap;
  }
  
  td.cell-positive {
    background-color: var(--color-accent-green-light);
    color: var(--color-accent-green);
    font-weight: 700;
  }
  
  td.cell-negative {
    background-color: var(--color-accent-red-light);
    color: var(--color-accent-red);
    font-weight: 700;
  }
  
  thead th {
    background-color: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: none;
}

.th-label,
.th-sub-label {
  display: block;
}

.th-sub-label {
  margin-top: 0.1rem;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.15;
}

thead th.col-rank-change .th-sub-label,
thead th.col-share-change .th-sub-label {
  font-size: 0.75rem;
  color: inherit;
}

tbody tr {
  transition:
    background-color var(--transition-fast),
    box-shadow var(--transition-fast);
  border-bottom: 1px solid var(--color-border);
}

  tbody tr:hover {
    background-color: var(--color-primary-light);
    cursor: pointer;
    position: relative;
    z-index: 1;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
  }

  tbody td:first-child {
    position: relative;
    padding-left: calc(1rem + 6px);
    font-weight: 600;
  }
  
  tbody td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    height: 90%;
    width: 4px;
    background: var(--color-primary);
    transform: translateY(-50%) scaleY(0);
    transform-origin: center;
    transition: transform var(--transition-fast);
  }
  
  tbody tr:hover td:first-child::before,
  tbody tr.table-row-highlight td:first-child::before {
    transform: translateY(-50%) scaleY(1);
  }

  table td.col-sales,
  table td.col-yoy,
  table td.col-share {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
  }

  table td.col-rank,
  table td.col-rank-change,
  table td.col-share-change {
    text-align: center;
  }

  thead th.col-sales,
  thead th.col-yoy,
  thead th.col-share {
    text-align: right;
    white-space: nowrap;
  }

  thead th.col-sales,
  td.col-sales {
    min-width: 7rem;
  }

  thead th.col-yoy,
  td.col-yoy {
    min-width: 5.5rem;
  }

  thead th.col-share,
  td.col-share {
    min-width: 5rem;
  }

  thead th.col-share-change,
  td.col-share-change {
    min-width: 6.2rem;
  }

  thead th.col-rank,
  thead th.col-rank-change,
  thead th.col-share-change {
    text-align: center;
  }

  thead th.col-name,
  thead th.col-model-name,
  thead th.col-manufacturer-name {
    text-align: left;
  }

  th,
  td {
    line-height: 1.3;
  }


  td.align-left {
    text-align: left;
  }
  
  td.align-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
  }

  .col-rank {
    width: 7%;
  }

  th.col-rank,
  td.col-rank {
    white-space: nowrap;
  }

  th.col-rank {
    min-width: 3.5rem;
  }

  td.col-rank {
    text-align: center;
  }

  /* Cancel first-column decorative indent for rank cells */
  tbody td.col-rank:first-child {
    padding: 0.38rem 0.4rem;
  }

  tbody td.col-rank:first-child::before {
    display: none;
    content: none;
  }
  
  .col-name {
    width: 28%;
  }
  
  .col-model-name {
    width: 24%;
  }
  
  .col-manufacturer-name {
    width: 20%;
  }
  
  .col-sales {
    width: 17%;
  }
  
  .col-yoy {
    width: 17%;
  }
  
  .col-share {
    width: 15%;
  }
  
  .col-share-change {
    width: 16%;
  }
  
  .col-rank-change {
    width: 14%;
  }
  
  .main-value {
    font-size: 0.875rem;
    font-weight: 500;
    display: block;
    line-height: 1.22;
    font-feature-settings: "tnum" 1;
  }
  
.sub-value {
    font-size: 0.66rem;
    color: var(--color-text-muted);
    display: block;
    margin-top: 1px;
    font-weight: 400;
    line-height: 1.2;
  }

.model-name-main,
.model-name-sub {
  display: block;
}

.model-name-sub {
  color: var(--color-text-muted);
  line-height: 1.15;
}
  
  .positive {
    color: var(--color-accent-green);
    font-weight: bold;
  }
  
  .negative {
    color: var(--color-accent-red);
    font-weight: bold;
  }
  
  .rank-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1.3;
  }
  
  .rank-up {
    color: var(--color-accent-green);
  }
  
  .rank-down {
    color: var(--color-accent-red);
  }
  
  .rank-stay {
    color: var(--color-text-muted);
  }
  
  .rank-arrow {
    font-size: 1.3em;
    margin-right: 0.6rem;
    font-weight: bold;
    line-height: 1;
  }
  
  .panel-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    min-width: 0;
  }

  .panel-header > * {
    min-width: 0;
  }
  
.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
    flex-wrap: wrap;
  min-width: 0;
}

  
  .chart-toggle {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 999px;
    padding: 0.2rem;
    gap: 0.2rem;
    max-width: 100%;
    flex-wrap: wrap;
  }

  @media (max-width: 980px) {
    .chart-toggle {
      width: 100%;
    }

    .toggle-btn {
      flex: 1 1 140px;
      text-align: center;
      padding: 0.45rem 0.6rem;
    }

    #region-structure .panel-header-actions {
      width: 100%;
    }

    #region-structure-toggle {
      display: inline-flex;
      flex-wrap: nowrap;
      align-items: center;
    }

    #region-structure-toggle .toggle-btn {
      width: auto;
      min-width: 0;
      flex: 1 1 0;
      font-size: 0.8rem;
      letter-spacing: 0;
      padding: 0.45rem 0.45rem;
    }

  }
  
.toggle-btn {
  appearance: none;
  border: none;
  background: transparent;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-weight: 800;
    color: var(--color-text-secondary);
    cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
  white-space: nowrap;
  line-height: 1.2;
  outline: none;
}
  
  .toggle-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
  }
  
  .toggle-btn.is-active {
    background: var(--color-primary);
    color: var(--color-surface);
  }

.toggle-hidden {
  display: none !important;
}

  
  /* Tablet (>= 600px) */
  @media (min-width: 600px) {
    .key-metrics {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  /* Desktop (>= 1024px) */
  @media (min-width: 1024px) {
    body {
      flex-direction: row;
      height: 100vh;
      overflow: hidden;
    }
  
    header {
      width: clamp(260px, 22vw, 320px);
      height: 100vh;
      flex-shrink: 0;
      border-right: 1px solid var(--color-border);
      border-bottom: none;
      overflow-y: auto;
      padding: 2rem 1.5rem;
    }
  
    header h1 {
      font-size: 1.625rem;
      line-height: 1.3;
      margin-bottom: 2rem;
    }

    nav {
      flex-direction: column;
      gap: 0.5rem;
    }

    nav button {
      border-radius: 0 8px 8px 0;
      border: none;
      border-left: 4px solid transparent;
      text-align: left;
      background: transparent;
    }

    .nav-indicator {
      display: block;
    }
  
    main {
      flex-grow: 1;
      height: 100vh;
      overflow-y: auto;
      padding: clamp(1.75rem, 2.5vw, 3rem);
    }

  }
  
  /* Wide Desktop (>= 1400px) */
  @media (min-width: 1400px) {
    .key-metrics {
      grid-template-columns: repeat(4, 1fr);
    }
  }


  /* Mobile & Tablet Specific (< 1024px) */
  @media (max-width: 1023px) {
    header {
      width: 100%;
      height: auto;
      position: sticky;
      top: 0;
      z-index: 1000;
      padding: 0.75rem 0;
      background: rgba(255, 255, 255, 0.98);
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
      border-right: none;
      border-bottom: 1px solid var(--color-border);
      display: flex;
      flex-direction: column;
    }
  
    header h1 {
      padding: 0 1rem;
      font-size: 1.625rem;
      margin: 0 0 0.5rem 0;
    }
  
    nav {
      flex-direction: row;
      overflow-x: auto;
      padding: 0 1rem 0.25rem 1rem;
      gap: 0.5rem;
      scrollbar-width: none;
      mask-image: linear-gradient(to right, transparent, black 10px, black 95%, transparent);
      -webkit-mask-image: linear-gradient(to right, transparent, black 10px, black 95%, transparent);
    }
  
    nav::-webkit-scrollbar {
      display: none;
    }
  
    nav button {
      border-radius: 999px;
      border: 1px solid var(--color-border);
      padding: 0.5rem 1rem;
      background: #fff;
      font-size: 0.85rem;
      flex-shrink: 0;
      text-align: center;
      white-space: nowrap;
      border-left: 1px solid var(--color-border);
    }
  
    nav button.active {
      background: var(--color-primary);
      color: var(--color-surface);
      border-color: var(--color-primary);
      box-shadow: var(--shadow-sm);
    }
  
    .nav-indicator {
      display: none;
    }

    main {
      padding: 1rem;
      height: auto;
      overflow: visible;
    }

    .market-nav {
      scrollbar-width: thin;
      scrollbar-color: rgba(0, 82, 155, 0.45) transparent;
      -webkit-overflow-scrolling: touch;
      mask-image: none;
      -webkit-mask-image: none;
    }

    .market-nav::-webkit-scrollbar {
      display: block;
      height: 6px;
    }

    .market-nav::-webkit-scrollbar-thumb {
      background: rgba(0, 82, 155, 0.35);
      border-radius: 999px;
    }

    .nav-scroll-hint {
      display: block;
      margin: 0.35rem 1rem 0;
      font-size: 0.75rem;
      color: var(--color-text-muted);
      line-height: 1.25;
      letter-spacing: 0.01em;
    }

    .nav-scroll-hint[hidden] {
      display: none !important;
    }

    .analysis-summary {
      padding: 0.82rem 0.95rem;
      line-height: 1.82;
    }

    .analysis-summary.analysis-spotlight::before {
      margin-bottom: 0.38rem;
    }
  }


    /* Mobile Specific (< 768px) */
    @media (max-width: 767px) {
      /* Smart Table Card View for Mobile (monthly tab only) */
      #monthly_analysis table:not(.simple-table) {
        display: block;
        width: 100%;
      }

      #monthly_analysis table:not(.simple-table) thead {
        display: none;
      }

      #monthly_analysis table:not(.simple-table) tbody {
        display: block;
      }

      #monthly_analysis table:not(.simple-table) tr {
        display: block;
        background: #fff;
        border: 1px solid var(--color-border);
        border-radius: 8px;
        margin-bottom: 1rem;
        box-shadow: var(--shadow-sm);
        padding: 0;
        overflow: hidden;
      }

      /* PC表示用の「左端の青いバー」装飾をモバイルカード時には非表示にする */
      #monthly_analysis table:not(.simple-table) tbody td:first-child::before {
        display: none;
        content: none;
      }

      /* 共通セルスタイル: ラベルを絶対配置し、コンテンツを右寄せ縦積みに */
      #monthly_analysis table:not(.simple-table) td {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end;
        text-align: right;
        padding: 0.75rem 1rem 0.75rem clamp(6.5rem, 30vw, 9rem);
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.9375rem;
        min-height: 3.5rem;
        position: relative;
      }

      /* カード表示では列幅固定を無効化（長い名称が潰れるのを防ぐ） */
      #monthly_analysis table:not(.simple-table) td.col-rank,
      #monthly_analysis table:not(.simple-table) td.col-name,
      #monthly_analysis table:not(.simple-table) td.col-model-name,
      #monthly_analysis table:not(.simple-table) td.col-manufacturer-name,
      #monthly_analysis table:not(.simple-table) td.col-sales,
      #monthly_analysis table:not(.simple-table) td.col-yoy,
      #monthly_analysis table:not(.simple-table) td.col-share,
      #monthly_analysis table:not(.simple-table) td.col-share-change,
      #monthly_analysis table:not(.simple-table) td.col-rank-change {
        width: 100%;
        min-width: 0;
        max-width: 100%;
      }

      #monthly_analysis table:not(.simple-table) td.col-name,
      #monthly_analysis table:not(.simple-table) td.col-model-name,
      #monthly_analysis table:not(.simple-table) td.col-manufacturer-name {
        word-break: normal;
        overflow-wrap: break-word;
        white-space: normal;
      }

      #monthly_analysis table:not(.simple-table) td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--color-text-muted);
        font-size: 0.8rem;
        text-align: left;
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        width: clamp(5.5rem, 22vw, 7.5rem);
        white-space: normal;
        line-height: 1.3;
      }

      /* 1行目: 順位 */
      #monthly_analysis table:not(.simple-table) td.col-rank:first-child {
        background: #f8fafc;
        border-bottom: 1px solid var(--color-border);
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 0.5rem 1rem;
        min-height: auto;
        font-weight: 700;
        color: var(--color-text-primary);
        margin: 0;
        border-radius: 0;
      }

      /* 順位行の「順位」ラベルを非表示 */
      #monthly_analysis table:not(.simple-table) td.col-rank:first-child::before {
        content: none;
        display: none;
      }

      #monthly_analysis table:not(.simple-table) td.col-rank:first-child::after {
        content: "位";
        font-size: 0.8em;
        margin-left: 4px;
        font-weight: normal;
        color: var(--color-text-muted);
      }

      /* 2行目: モデル名/メーカー名（メインタイトル） */
      #monthly_analysis table:not(.simple-table) td.col-name,
      #monthly_analysis table:not(.simple-table) td.col-model-name {
        display: block;
        text-align: left;
        font-size: 1.25rem;
        font-weight: 800;
        background: #fff;
        padding: 1rem 1rem 0.5rem 1rem;
        border-bottom: none;
        min-height: auto;
      }

      #monthly_analysis table:not(.simple-table) td.col-name::before,
      #monthly_analysis table:not(.simple-table) td.col-model-name::before {
        display: none;
      }

      /* 値の表示調整 */
      #monthly_analysis table:not(.simple-table) .main-value {
        font-size: 1rem;
        font-weight: 700;
      }

      #monthly_analysis table:not(.simple-table) .sub-value {
        font-size: 0.75rem;
        color: var(--color-text-muted);
        margin-top: 0.25rem;
      }

      /* メーカー名セルなどのテキスト折り返し制御 */
      #monthly_analysis table:not(.simple-table) td.col-manufacturer-name {
        word-break: break-word;
      }
  
    }

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none;
    transition: none;
    scroll-behavior: auto;
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .panel {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.table-note {
  margin-top: 10px;
  color: var(--color-text-muted);
  font-size: 12px;
}

h1,
h2,
h3,
.panel-title {
  color: var(--color-text-primary);
  letter-spacing: var(--letter-spacing-tight);
}

.chart-table-pair .table-container {
  box-sizing: border-box;
  overflow: hidden;
}

.simple-table {
  width: 100%;
  min-width: 600px;
  table-layout: fixed;
}

.simple-table th,
.simple-table td {
  padding: 0.45rem 0.55rem;
}

@media (min-width: 900px) {
  .simple-table th,
  .simple-table td {
    font-size: 0.9rem;
  }

  .simple-table .col-name,
  .simple-table td.col-name,
  .simple-table th.col-name {
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
  }

  table {
    table-layout: fixed;
  }

  td.col-name,
  td.col-model-name,
  td.col-manufacturer-name {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  td.col-sales,
  td.col-yoy,
  td.col-share,
  td.col-share-change {
    white-space: nowrap;
  }
}

.insight-strip {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    margin: 0.75rem 0 1rem 0;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }
  
  .insight-headline {
    font-weight: 800;
    letter-spacing: var(--letter-spacing-tight);
    font-size: 1rem;
    color: var(--color-text-primary);
  }
  
  .insight-sub {
    margin-top: 0.25rem;
    font-size: 0.92rem;
    color: var(--color-text-muted);
  }
  
  @media (max-width: 980px) {
    .panel-content-grid {
      grid-template-columns: 1fr;
    }

    .chart-container {
      min-height: var(--chart-container-min-height-narrow);
    }

    #model-table th:nth-child(4),
    #model-table td:nth-child(4),
    #ev-model-table th:nth-child(4),
    #ev-model-table td:nth-child(4) {
      text-align: center !important;
    }

    #honda-model-table th:nth-child(3),
    #honda-model-table td:nth-child(3) {
      text-align: center !important;
    }
  }
  
  .kpi-title {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    font-weight: 700;
  }
  
  .kpi-unit {
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 0.25rem;
    color: var(--color-text-muted);
  }
  
  .kpi-meta {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
  }
  
  .kpi-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    font-size: 0.82rem;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text-secondary);
  }
  
  .kpi-pill.positive {
    border-color: rgba(0, 112, 64, 0.35);
    background: var(--color-accent-green-light);
    color: var(--color-accent-green);
    font-weight: 700;
  }
  
  .kpi-pill.negative {
    border-color: rgba(197, 42, 42, 0.35);
    background: var(--color-accent-red-light);
    color: var(--color-accent-red);
    font-weight: 700;
  }
  
  .region-structure-table th,
  .region-structure-table td {
    white-space: nowrap;
    font-size: 0.86rem;
  }
  
  .region-structure-table .sticky-col {
    position: sticky;
    left: 0;
    background: var(--color-surface);
    z-index: 2;
  }
  
  .region-structure-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  
  .region-structure-table thead th.sticky-col {
    z-index: 4;
  }
  
  
  .factor-title {
    font-weight: 900;
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text-primary);
  }
  
  .so-what-title {
    font-weight: 900;
    color: var(--color-text-primary);
    margin-bottom: 0.35rem;
  }
  
  .so-what-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--color-text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
  }
  
  .so-what-list li {
    margin: 0.25rem 0;
  }
  
  .detail-block {
    margin-top: 0.75rem;
    border: 1px dashed rgba(0, 0, 0, 0.18);
    border-radius: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.65);
  }
  
  .detail-block>summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--color-text-secondary);
    list-style: none;
  }
  
  .detail-block>summary::-webkit-details-marker {
    display: none;
  }
  
  .detail-block[open] {
    background: rgba(255, 255, 255, 0.9);
  }
  
  .detail-block .table-wrapper {
    margin-top: 0.75rem;
  }
  
  .kpi-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 10px 0 14px;
  }
  
  @media (min-width: 768px) {
    .kpi-strip {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  .kpi-card {
    border: 1px solid var(--color-border, #e5e7eb);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
  }
  
  .kpi-label {
    font-size: 12px;
    color: var(--color-text-muted, #64748b);
    margin-bottom: 6px;
    font-weight: 600;
  }
  
  .kpi-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
  }
  
  .kpi-sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-secondary, #334155);
  }

  /* Shared monthly-analysis page overrides */
  #monthly_analysis .kpi-strip {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
  }

  #monthly_analysis .overview-meta {
    margin-top: 0.75rem;
  }

  #monthly_analysis .overview-summary {
    margin-top: 0.25rem;
  }

  #monthly_analysis .overview-summary p {
    margin: 0 0 0.6rem;
  }

  #monthly_analysis .overview-summary p:last-child {
    margin-bottom: 0;
  }

  :is(#market-dashboard, #honda-dashboard, #monthly_analysis) .section-heading {
    margin-top: 1.4rem;
    margin-bottom: 0;
    padding-left: 0.55rem;
    border-left: 3px solid var(--color-primary-light);
    color: var(--color-text-primary);
    font-weight: 700;
  }

  :is(#market-dashboard, #honda-dashboard, #monthly_analysis) .panel-header + .section-heading {
    margin-top: 0.7rem;
  }

  :is(#market-dashboard, #honda-dashboard, #monthly_analysis) .section-heading + .panel-content-grid {
    margin-top: 0.9rem;
  }

  #monthly_analysis .analysis-spotlight {
    margin-top: 1rem;
    margin-bottom: 0;
  }

  @media (min-width: 981px) {
    #monthly_analysis .panel-content-grid {
      grid-template-columns: 1.25fr 1fr;
    }
  }

  /* Monthly analysis tables:
     rebalance share-table columns and relax nowrap to avoid large blank gaps/clipping */
  :is(#monthly_analysis, #honda-dashboard) :is(
    #region-table,
    #country-table,
    #vehicle-table,
    #segment-table,
    #honda-region-table,
    #honda-country-table
  ) {
    table-layout: fixed;
  }

:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) th:nth-child(1),
:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) td:nth-child(1) {
  width: 9%;
}


:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) th:nth-child(3),
:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) td:nth-child(3) {
  width: 25%;
}

:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) th:nth-child(4),
:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) td:nth-child(4),
:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) th:nth-child(5),
:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) td:nth-child(5) {
  width: 17%;
}

:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) th:nth-child(6),
:is(#monthly_analysis, #honda-dashboard) :is(
  #region-table,
  #country-table,
  #vehicle-table,
  #segment-table,
  #honda-region-table,
  #honda-country-table
) td:nth-child(6) {
  width: 18%;
}

#vehicle-table th:nth-child(2),
#vehicle-table td:nth-child(2),
#segment-table th:nth-child(2),
#segment-table td:nth-child(2) {
  width: 35%;
}

#vehicle-table th:nth-child(3),
#vehicle-table td:nth-child(3),
#segment-table th:nth-child(3),
#segment-table td:nth-child(3) {
  width: 14%;
}

#vehicle-table th:nth-child(4),
#vehicle-table td:nth-child(4),
#vehicle-table th:nth-child(5),
#vehicle-table td:nth-child(5),
#vehicle-table th:nth-child(6),
#vehicle-table td:nth-child(6),
#segment-table th:nth-child(4),
#segment-table td:nth-child(4),
#segment-table th:nth-child(5),
#segment-table td:nth-child(5),
#segment-table th:nth-child(6),
#segment-table td:nth-child(6) {
  width: 14.67%;
}

:is(#vehicle-table, #segment-table) td.col-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: normal;
  line-break: auto;
}

#honda-country-table th:nth-child(2),
#honda-country-table td:nth-child(2) {
  width: 24%;
}

#honda-region-table th:nth-child(2),
#honda-region-table td:nth-child(2) {
  width: 24%;
}

#honda-region-table td.col-name {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

#honda-country-table td.col-name {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

#honda-country-table .flag-label-wrap {
  white-space: nowrap;
}

  :is(#monthly_analysis, #honda-dashboard) td.col-sales,
  :is(#monthly_analysis, #honda-dashboard) td.col-yoy,
  :is(#monthly_analysis, #honda-dashboard) td.col-share,
  :is(#monthly_analysis, #honda-dashboard) td.col-share-change {
    white-space: normal;
  }

  :is(#monthly_analysis, #honda-dashboard) td.col-sales .main-value,
  :is(#monthly_analysis, #honda-dashboard) td.col-yoy .main-value,
  :is(#monthly_analysis, #honda-dashboard) td.col-share .main-value,
  :is(#monthly_analysis, #honda-dashboard) td.col-share-change .main-value {
    white-space: nowrap;
  }

  :is(#monthly_analysis, #honda-dashboard) td.col-sales .sub-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
  }

  :is(#monthly_analysis, #honda-dashboard) td.col-yoy .sub-value,
  :is(#monthly_analysis, #honda-dashboard) td.col-share .sub-value,
  :is(#monthly_analysis, #honda-dashboard) td.col-share-change .sub-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
  }

  /* Shared wide tables for monthly/report roots */
  #monthly_analysis :is(#annual-table, #annual-growth-table),
  #main-content :is(#annual-table, #annual-growth-table) {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  #monthly_analysis :is(#annual-table, #annual-growth-table) th,
  #monthly_analysis :is(#annual-table, #annual-growth-table) td,
  #main-content :is(#annual-table, #annual-growth-table) th,
  #main-content :is(#annual-table, #annual-growth-table) td {
    white-space: nowrap;
    word-break: keep-all;
  }

  #monthly_analysis :is(#annual-table, #annual-growth-table) thead th:first-child,
  #main-content :is(#annual-table, #annual-growth-table) thead th:first-child {
    min-width: 6.2rem;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--color-bg);
  }

  #monthly_analysis :is(#annual-table, #annual-growth-table) tbody td:first-child,
  #main-content :is(#annual-table, #annual-growth-table) tbody td:first-child {
    min-width: 6.2rem;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--color-surface);
  }

  #monthly_analysis #powertrain-table,
  #main-content #powertrain-table,
  #honda-dashboard #honda-powertrain-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  #monthly_analysis #powertrain-table th,
  #monthly_analysis #powertrain-table td,
  #main-content #powertrain-table th,
  #main-content #powertrain-table td,
  #honda-dashboard #honda-powertrain-table th,
  #honda-dashboard #honda-powertrain-table td {
    white-space: nowrap;
    word-break: keep-all;
  }

  #monthly_analysis #powertrain-table thead th,
  #main-content #powertrain-table thead th,
  #honda-dashboard #honda-powertrain-table thead th {
    text-align: center;
    min-width: 5.6rem;
  }

  #monthly_analysis #powertrain-table thead th:first-child,
  #main-content #powertrain-table thead th:first-child,
  #honda-dashboard #honda-powertrain-table thead th:first-child {
    min-width: 8.5rem;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--color-bg);
  }

  #monthly_analysis #powertrain-table tbody td,
  #main-content #powertrain-table tbody td,
  #honda-dashboard #honda-powertrain-table tbody td {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
  }

  #monthly_analysis #powertrain-table tbody td:first-child,
  #main-content #powertrain-table tbody td:first-child,
  #honda-dashboard #honda-powertrain-table tbody td:first-child {
    min-width: 8.5rem;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--color-surface);
    padding-left: 0.75rem;
  }

  #monthly_analysis #powertrain-table tbody td:first-child::before,
  #main-content #powertrain-table tbody td:first-child::before,
  #honda-dashboard #honda-powertrain-table tbody td:first-child::before {
    display: none;
  }

@media (min-width: 981px) {
  #monthly_analysis #powertrain-shift .panel-content-grid,
  #main-content #powertrain-shift .panel-content-grid,
  #powertrain-shift .panel-content-grid.powertrain-layout,
  #honda-powertrain .panel-content-grid.powertrain-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
    align-items: stretch;
  }
}

#honda-powertrain .powertrain-chart-stage {
  min-width: 0;
}

/* Typography / blocks */
.text-block {
  font-size: var(--prose-font-size);
  line-height: var(--prose-line-height);
  color: var(--color-text-secondary);
  max-width: var(--prose-max-width);
  overflow-wrap: anywhere;
}

.text-block p {
  margin: 0;
  text-wrap: pretty;
}

.text-block p + p {
  margin-top: var(--prose-paragraph-gap);
}

.text-block strong {
  color: var(--color-text-primary);
}

#overview .text-block {
  max-width: none;
}

#honda-overview .text-block,
#honda-text-block {
  max-width: none;
}

.stack-6 > * + * {
  margin-top: 1.5rem;
}

.panel-content-grid .table-container {
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: start;
}

.panel-content-grid .table-container > .table-wrapper {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}

#powertrain-shift .table-container > .table-wrapper,
#honda-powertrain .table-container > .table-wrapper {
  width: 100%;
  overflow-x: hidden;
  border-left: 1px solid var(--color-border);
  box-shadow: inset 1px 0 0 var(--color-border);
}

@media (max-width: 768px) {
  .panel {
    --panel-blur: blur(4px);
  }

  .chart-table-pair {
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  header {
    position: sticky;
    top: 0;
    z-index: var(--header-z-index);
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  }

  main {
    padding: 1rem;
  }

  .panel-content-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  table.simple-table thead,
  table.simple-table thead th {
    position: static;
    z-index: auto;
  }
}

/* Powertrain table: compact columns to avoid horizontal scrolling */
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

#powertrain-shift #powertrain-table[data-pt-mode="monthly_matrix"] {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"],
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"],
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) th,
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) td {
  white-space: normal;
  word-break: keep-all;
  font-size: 0.8rem;
  padding: 0.38rem 0.42rem;
  vertical-align: top;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) thead th {
  min-width: 0;
  text-align: center;
  line-height: 1.35;
  vertical-align: middle;
  height: 3.05rem;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) thead th:first-child,
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) tbody td:first-child {
  min-width: 0;
  width: 10ch;
  position: static;
  left: auto;
  z-index: auto;
  text-align: left;
  background: var(--color-surface);
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) thead th:first-child {
  background: var(--color-bg);
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) tbody td:first-child::before {
  display: none;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) tbody tr:hover,
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) tbody tr.table-row-highlight {
  background-color: var(--color-primary-light);
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) tbody tr:hover > td:not(.cell-positive):not(.cell-negative),
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) tbody tr.table-row-highlight > td:not(.cell-positive):not(.cell-negative) {
  background-color: var(--color-primary-light);
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) th:nth-child(1),
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) td:nth-child(1) {
  min-width: 0;
  width: 12%;
  text-align: center;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) th:nth-child(2),
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) td:nth-child(2) {
  min-width: 0;
  width: 28%;
  text-align: left;
  padding-left: 0.6rem;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) tbody td:nth-child(1),
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) tbody td:nth-child(2) {
  vertical-align: middle;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) th:nth-child(3),
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) td:nth-child(3),
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) th:nth-child(4),
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) td:nth-child(4) {
  min-width: 0;
  text-align: right;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) th:nth-child(5),
:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) td:nth-child(5) {
  min-width: 0;
  text-align: right;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) td .main-value {
  white-space: nowrap;
}

:is(#powertrain-shift #powertrain-table, #honda-powertrain #honda-powertrain-table) td .sub-value {
  white-space: nowrap;
  line-height: 1.15;
}

#powertrain-shift #powertrain-table[data-pt-mode="monthly_matrix"] th:nth-child(1),
#powertrain-shift #powertrain-table[data-pt-mode="monthly_matrix"] td:nth-child(1) {
  width: 12%;
  min-width: 0;
}

#powertrain-shift #powertrain-table[data-pt-mode="monthly_matrix"] th:nth-child(2),
#powertrain-shift #powertrain-table[data-pt-mode="monthly_matrix"] td:nth-child(2) {
  width: 30%;
  min-width: 0;
}

#powertrain-shift #powertrain-table[data-pt-mode="monthly_matrix"] th:nth-child(n + 3),
#powertrain-shift #powertrain-table[data-pt-mode="monthly_matrix"] td:nth-child(n + 3) {
  width: 29%;
  min-width: 0;
  text-align: right;
}

#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] td .sub-value,
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] td .sub-value,
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] td .sub-value {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] th,
#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] td,
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] th,
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] td,
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] th,
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] td {
  font-size: 0.82rem;
  padding: 0.42rem 0.48rem;
}

#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(1),
#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(1) {
  width: 10%;
  min-width: 0;
}

#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(2),
#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(2) {
  width: 24%;
  min-width: 0;
}

#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(3),
#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(3),
#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(4),
#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(4),
#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(5),
#powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(5) {
  width: 22%;
  min-width: 0;
}

#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(1),
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(1) {
  width: 10%;
  min-width: 0;
}

#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(2),
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(2) {
  width: 24%;
  min-width: 0;
}

#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(3),
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(3),
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(4),
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(4),
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] th:nth-child(5),
#honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] td:nth-child(5) {
  width: 22%;
  min-width: 0;
}

#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] th:nth-child(1),
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] td:nth-child(1) {
  width: 9%;
  min-width: 0;
}

#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] th:nth-child(2),
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] td:nth-child(2) {
  width: 21%;
  min-width: 0;
}

#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] th:nth-child(3),
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] td:nth-child(3),
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] th:nth-child(4),
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] td:nth-child(4),
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] th:nth-child(5),
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] td:nth-child(5),
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] th:nth-child(6),
#honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] td:nth-child(6) {
  width: 17.5%;
  min-width: 0;
  text-align: right;
}

@media (max-width: 900px) {
  #powertrain-shift #powertrain-table th,
  #powertrain-shift #powertrain-table td,
  #powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] th,
  #powertrain-shift #powertrain-table[data-pt-mode="yoy_compare"] td,
  #honda-powertrain #honda-powertrain-table th,
  #honda-powertrain #honda-powertrain-table td,
  #honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] th,
  #honda-powertrain #honda-powertrain-table[data-pt-mode="yoy_compare"] td,
  #honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] th,
  #honda-powertrain #honda-powertrain-table[data-pt-mode="gap_compare"] td {
    font-size: 0.76rem;
    padding: 0.34rem 0.32rem;
  }

  #powertrain-shift #powertrain-table td .sub-value,
  #honda-powertrain #honda-powertrain-table td .sub-value {
    font-size: 0.68rem;
  }
}

/* Scatter + table layouts: use flex sizing instead of grid */
#region-structure .panel-content-grid.country-scatter-layout,
#ranking-corporate #brand-position-grid {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: clamp(0.75rem, 1.6vw, 1.35rem);
}

#region-structure .panel-content-grid.country-scatter-layout > .chart-container,
#ranking-corporate #brand-position-grid > .chart-container {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

#region-structure .panel-content-grid.country-scatter-layout > .table-container,
#ranking-corporate #brand-position-grid > .table-container {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  align-self: stretch;
}

#region-structure .panel-content-grid.country-scatter-layout > .table-container > .table-wrapper,
#ranking-corporate #brand-position-grid > .table-container > .table-wrapper {
  flex: 1 1 auto;
}

#region-structure #country-table[data-mode="quadrant"] {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

#region-structure #country-table[data-mode="quadrant"] th,
#region-structure #country-table[data-mode="quadrant"] td {
  white-space: nowrap;
  word-break: keep-all;
}

#region-structure #country-table[data-mode="quadrant"] td.col-name {
  white-space: normal;
  word-break: break-word;
  min-width: 11rem;
}

/* Country quadrant table: lock alignment by column */
#country-table[data-mode="quadrant"] th:nth-child(1),
#country-table[data-mode="quadrant"] td:nth-child(1) {
  text-align: center;
}

#country-table[data-mode="quadrant"] th:nth-child(2),
#country-table[data-mode="quadrant"] td:nth-child(2),
#country-table[data-mode="quadrant"] th:nth-child(5),
#country-table[data-mode="quadrant"] td:nth-child(5),
#country-table[data-mode="quadrant"] th:nth-child(6),
#country-table[data-mode="quadrant"] td:nth-child(6) {
  text-align: left;
}

#country-table[data-mode="quadrant"] th:nth-child(3),
#country-table[data-mode="quadrant"] td:nth-child(3),
#country-table[data-mode="quadrant"] th:nth-child(4),
#country-table[data-mode="quadrant"] td:nth-child(4),
#country-table[data-mode="quadrant"] th:nth-child(7),
#country-table[data-mode="quadrant"] td:nth-child(7),
#country-table[data-mode="quadrant"] th:nth-child(8),
#country-table[data-mode="quadrant"] td:nth-child(8) {
  text-align: right;
}

#country-table[data-mode="quadrant"] th:nth-child(9),
#country-table[data-mode="quadrant"] td:nth-child(9) {
  text-align: center;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] thead th {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
  padding: 0.4rem 0.45rem;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] th,
#ranking-corporate #brand-position-table[data-mode="quadrant"] td {
  white-space: nowrap;
  word-break: keep-all;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] td.col-name {
  white-space: normal;
  overflow-wrap: anywhere;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] th:nth-child(1),
#ranking-corporate #brand-position-table[data-mode="quadrant"] td:nth-child(1) {
  width: 6%;
  text-align: center;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] th:nth-child(2),
#ranking-corporate #brand-position-table[data-mode="quadrant"] td:nth-child(2) {
  width: 28%;
  text-align: left;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] th:nth-child(3),
#ranking-corporate #brand-position-table[data-mode="quadrant"] td:nth-child(3) {
  width: 16%;
  text-align: right;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] th:nth-child(4),
#ranking-corporate #brand-position-table[data-mode="quadrant"] td:nth-child(4) {
  width: 13%;
  text-align: right;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] th:nth-child(5),
#ranking-corporate #brand-position-table[data-mode="quadrant"] td:nth-child(5) {
  width: 9%;
  text-align: right;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] th:nth-child(6),
#ranking-corporate #brand-position-table[data-mode="quadrant"] td:nth-child(6) {
  width: 12%;
  text-align: left;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] th:nth-child(7),
#ranking-corporate #brand-position-table[data-mode="quadrant"] td:nth-child(7) {
  width: 16%;
  text-align: left;
}

#ranking-corporate #brand-position-table[data-mode="quadrant"] td .sub-value {
  white-space: nowrap;
  line-height: 1.15;
}

/* Honda trend table */
#honda-trend {
  --honda-trend-region-col: 7.4rem;
  --honda-trend-month-cols: 25;
  --honda-trend-month-col: 5.15rem;
  --honda-trend-table-min-width: calc(
    var(--honda-trend-region-col) + var(--honda-trend-month-cols) * var(--honda-trend-month-col)
  );
}

#honda-trend .table-container > .table-wrapper {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  box-shadow:var(--table-shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.8) rgba(148, 163, 184, 0.16);
}

#honda-trend .table-container > .table-wrapper::-webkit-scrollbar {
  height: 8px;
}

#honda-trend .table-container > .table-wrapper::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.16);
  border-radius: var(--border-radius);
}

#honda-trend .table-container > .table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.72);
  border-radius: var(--border-radius);
}

#honda-trend .table-container > .table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.82);
}

#honda-trend #honda-trend-table {
  width: max(100%, var(--honda-trend-table-min-width));
  min-width: var(--honda-trend-table-min-width);
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

#honda-trend #honda-trend-table th,
#honda-trend #honda-trend-table td {
  min-width: 0;
  max-width: none;
  vertical-align: middle;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

#honda-trend #honda-trend-table thead th {
  position: static;
  overflow: visible;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  transform: none;
  text-align: center;
}

#honda-trend #honda-trend-table thead .honda-trend-table__corner,
#honda-trend #honda-trend-table tbody .honda-trend-table__row-header {
  min-width: var(--honda-trend-region-col);
}

#honda-trend #honda-trend-table thead .honda-trend-table__corner {
  padding: 0.8rem 0.7rem;
  color: var(--color-text-primary);
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
}

#honda-trend #honda-trend-table thead .honda-trend-table__year {
  padding: 0.44rem 0.2rem 0.36rem;
  background:
    linear-gradient(180deg, rgba(177, 18, 38, 0.1), rgba(177, 18, 38, 0.03));
  color: var(--color-text-primary);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
}

#honda-trend #honda-trend-table thead .honda-trend-table__month {
  min-width: var(--honda-trend-month-col);
  padding: 0.4rem 0.2rem 0.44rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 244, 245, 0.82));
  color: var(--color-text-primary);
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.1;
}

#honda-trend #honda-trend-table .honda-trend-table__month::before,
#honda-trend #honda-trend-table .honda-trend-table__month::after,
#honda-trend #honda-trend-table .honda-trend-table__year::before,
#honda-trend #honda-trend-table .honda-trend-table__year::after {
  content: none;
  display: none;
}

#honda-trend #honda-trend-table .honda-trend-table__month-label {
  display: block;
  white-space: nowrap;
}

#honda-trend #honda-trend-table .honda-trend-table__month-label {
  color: var(--color-text-primary);
  font-size: 0.7rem;
  font-weight: 500;
}

#honda-trend #honda-trend-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.86);
}

#honda-trend #honda-trend-table tbody tr:nth-child(even) td {
  background: rgba(250, 244, 245, 0.7);
}

#honda-trend #honda-trend-table tbody tr:hover td {
  background: rgba(177, 18, 38, 0.05);
}

#honda-trend #honda-trend-table tbody .honda-trend-table__row-header {
  padding: 0.54rem 0.65rem;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

#honda-trend #honda-trend-table tbody .honda-trend-table__value {
  min-width: var(--honda-trend-month-col);
  padding: 0.46rem 0.42rem;
  text-align: right;
  white-space: nowrap;
  font-size: 0.72rem;
  line-height: 1.15;
  font-weight: 500;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
}

#honda-trend #honda-trend-table .is-year-end {
  box-shadow: inset -2px 0 0 rgba(148, 163, 184, 0.28);
}

#honda-trend #honda-trend-table tr > :last-child {
  border-right: 0;
}

@media (max-width: 1200px) {
  #honda-trend {
    --honda-trend-region-col: 6.5rem;
    --honda-trend-month-col: 4.6rem;
  }

  #honda-trend #honda-trend-table tbody .honda-trend-table__row-header {
    padding: 0.46rem 0.46rem;
    font-size: 0.76rem;
  }

  #honda-trend #honda-trend-table tbody .honda-trend-table__value {
    padding: 0.4rem 0.3rem;
    font-size: 0.67rem;
  }
}

@media (min-width: 981px) {
  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) {
    table-layout: fixed;
  }

  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(th, td).col-name,
  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(th, td).col-model-name {
    width: 32%;
  }

  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(th, td).col-manufacturer-name {
    width: 24%;
  }

  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(td).col-name,
  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(td).col-model-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
  }

  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(td).col-manufacturer-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(th, td).col-sales {
    min-width: 6.4rem;
  }

  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(th, td).col-yoy {
    min-width: 6rem;
  }

  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(th, td).col-share,
  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(th, td).col-share-change {
    min-width: 5.8rem;
  }

  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(th, td).col-rank,
  .table-wrapper table:not(.simple-table):not(#honda-trend-table):not(.report-table--dense) :is(th, td).col-rank-change {
    min-width: 4.2rem;
  }

  .report-table--ranking {
    table-layout: fixed;
  }

  .report-table--ranking th:nth-child(1),
  .report-table--ranking td:nth-child(1) {
    width: 8%;
  }

  .report-table--ranking th:nth-child(2),
  .report-table--ranking td:nth-child(2) {
    width: 40%;
  }

  .report-table--ranking th:nth-child(3),
  .report-table--ranking td:nth-child(3) {
    width: 16%;
  }

  .report-table--ranking th:nth-child(4),
  .report-table--ranking td:nth-child(4),
  .report-table--ranking th:nth-child(5),
  .report-table--ranking td:nth-child(5),
  .report-table--ranking th:nth-child(6),
  .report-table--ranking td:nth-child(6) {
    width: 12%;
  }

  .report-table--ranking td:nth-child(2) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: break-word;
    word-break: keep-all;
    line-height: 1.2;
  }
}

@media (min-width: 981px) {
  :is(#product-structure, #ranking-corporate, #ranking-model) > .panel-content-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(0.85rem, 1.4vw, 1.2rem);
  }

  .report-table--dense {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .report-table--dense th,
  .report-table--dense td {
    padding: 0.38rem 0.4rem;
    font-size: 0.82rem;
  }

  .report-table--dense td .sub-value {
    font-size: 0.58rem;
    line-height: 1.08;
  }

  .report-table--share th:nth-child(1),
  .report-table--share td:nth-child(1) {
    width: 7%;
  }

  .report-table--share th:nth-child(2),
  .report-table--share td:nth-child(2) {
    width: 41%;
  }

  .report-table--share th:nth-child(3),
  .report-table--share td:nth-child(3) {
    width: 14%;
  }

  .report-table--share th:nth-child(4),
  .report-table--share td:nth-child(4),
  .report-table--share th:nth-child(5),
  .report-table--share td:nth-child(5),
  .report-table--share th:nth-child(6),
  .report-table--share td:nth-child(6) {
    width: 12.67%;
  }

  .report-table--share td:nth-child(2) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: normal;
    word-break: normal;
    line-break: auto;
    line-height: 1.15;
    font-size: 0.8rem;
    letter-spacing: -0.01em;
  }

  .report-table--ranking th:nth-child(1),
  .report-table--ranking td:nth-child(1) {
    width: 7%;
  }

  .report-table--ranking th:nth-child(2),
  .report-table--ranking td:nth-child(2) {
    width: 42%;
  }

  .report-table--ranking th:nth-child(3),
  .report-table--ranking td:nth-child(3) {
    width: 14%;
  }

  .report-table--ranking th:nth-child(4),
  .report-table--ranking td:nth-child(4),
  .report-table--ranking th:nth-child(5),
  .report-table--ranking td:nth-child(5),
  .report-table--ranking th:nth-child(6),
  .report-table--ranking td:nth-child(6) {
    width: 12.33%;
  }

  .report-table--ranking td:nth-child(2) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: normal;
    word-break: normal;
    line-break: auto;
    line-height: 1.15;
    font-size: 0.79rem;
    letter-spacing: -0.01em;
  }

  .report-table--model th:nth-child(1),
  .report-table--model td:nth-child(1) {
    width: 7%;
  }

  .report-table--model th:nth-child(2),
  .report-table--model td:nth-child(2) {
    width: 15%;
  }

  .report-table--model th:nth-child(3),
  .report-table--model td:nth-child(3) {
    width: 14%;
  }

  .report-table--model th:nth-child(4),
  .report-table--model td:nth-child(4) {
    width: 11%;
  }

  .report-table--model th:nth-child(5),
  .report-table--model td:nth-child(5) {
    width: 11%;
  }

  .report-table--model th:nth-child(6),
  .report-table--model td:nth-child(6) {
    width: 11%;
  }

  .report-table--model th:nth-child(7),
  .report-table--model td:nth-child(7) {
    width: 9%;
  }

  .report-table--model td:nth-child(2) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: normal;
    word-break: normal;
    line-break: auto;
    line-height: 1.15;
    font-size: 0.79rem;
    letter-spacing: -0.01em;
  }

  .report-table--model td:nth-child(3) {
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 0.78rem;
    line-height: 1.15;
  }

  .report-table--model th:nth-child(4),
  .report-table--model td:nth-child(4) {
    white-space: nowrap;
    text-align: center;
  }

  .report-table--model th:nth-child(5),
  .report-table--model td:nth-child(5) {
    text-align: right;
  }

  .report-table--model th:nth-child(6),
  .report-table--model td:nth-child(6),
  .report-table--model th:nth-child(7),
  .report-table--model td:nth-child(7) {
    text-align: center;
  }

  .report-table--model th:nth-child(7),
  .report-table--model td:nth-child(7) {
    min-width: 4.5rem;
  }

  .report-table--model td:nth-child(2) .model-name-main {
    display: inline;
    line-height: 1.12;
  }

  .report-table--model td:nth-child(2) .model-name-sub {
    display: inline-block;
    margin-left: 0.16rem;
    font-size: 0.62rem;
    line-height: 1.1;
    overflow-wrap: normal;
  }

  .report-table--with-brand-logos .brand-logo-label {
    gap: 0.3rem;
  }

  .report-table--with-brand-logos .brand-logo-mark {
    flex-basis: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0.06rem;
  }

  .report-table--with-brand-logos .brand-logo-inline {
    transform: scale(var(--brand-logo-scale, 0.92));
  }

  .report-table--with-brand-logos .brand-logo-inline--standard {
    --brand-logo-scale: 0.98;
  }

  .report-table--with-brand-logos .brand-logo-inline--wide {
    --brand-logo-scale: 0.98;
  }

  .report-table--with-brand-logos .brand-logo-inline--badge {
    --brand-logo-scale: 0.98;
  }

  #model-table th:nth-child(5),
  #model-table td:nth-child(5),
  #model-table th:nth-child(6),
  #model-table td:nth-child(6),
  #ev-model-table th:nth-child(5),
  #ev-model-table td:nth-child(5),
  #ev-model-table th:nth-child(6),
  #ev-model-table td:nth-child(6) {
    text-align: right !important;
  }

  #model-table th:nth-child(4),
  #ev-model-table th:nth-child(4) {
    text-align: center !important;
  }
}

