:root {
  --accent: #0e5c4a;
  --text: #222;
  --muted: #666;
  --line: #e0e0e0;
  --bg: #fff;
  --bg-soft: #f6f6f4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  font-size: 16px;
}

.inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); }

/* ヘッダー (スクロール時も画面上部に固定) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.site-header .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}
.brand {
  display: block;
  line-height: 0;
}
.brand img {
  height: 24px;
  width: auto;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.9rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.buy-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 4px;
  white-space: nowrap;
}
.buy-button:hover { opacity: 0.85; }
.lang-switch {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 10px;
  white-space: nowrap;
}
.lang-switch:hover { color: var(--accent); border-color: var(--accent); }

/* 本文 */
main { padding: 40px 20px 64px; }
main h1 { font-size: 1.5rem; margin-bottom: 24px; }
main h2 {
  font-size: 1.15rem;
  margin: 40px 0 12px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
}
main h3 { font-size: 1rem; margin: 24px 0 8px; }
main h4 { font-size: 0.95rem; margin: 16px 0 4px; }
main p, main ul, main ol, main dl, main table { margin-bottom: 16px; }
main ul, main ol { padding-left: 1.4em; }

main table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
main th, main td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}
main th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }

.note { color: var(--muted); font-size: 0.9rem; }

/* 画像 */
main img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
main figure { margin: 0 0 24px; }
main figure img { display: block; }

/* TGS バナー */
.tgs-banner {
  display: block;
  margin-bottom: 24px;
}
.tgs-banner img { display: block; width: 100%; }
.tgs-banner-label {
  display: block;
  text-align: center;
  font-weight: 600;
  margin-bottom: 8px;
}
main figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* 動画などの埋め込み */
main iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 6px;
  margin-bottom: 16px;
}

/* ボタン */
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600;
}
.button:hover { opacity: 0.85; }

/* タブ */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 32px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 8px 18px;
  margin-bottom: -1px;
  cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected='true'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
/* タブの見出しはタブ名と重複するので、JS が有効なときだけ隠す */
.tabs:not([hidden]) ~ .tabpanel > h2:first-child { display: none; }

/* ページ下部のタブ (線を上側に) */
.tabs-bottom {
  margin: 48px 0 0;
  border-bottom: none;
  border-top: 1px solid var(--line);
}
.tabs-bottom button {
  border-bottom: none;
  border-top: 3px solid transparent;
  margin: -1px 0 0;
}
.tabs-bottom button[aria-selected='true'] { border-top-color: var(--accent); }

/* ページ内目次 */
.toc {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 14px 20px;
  margin: 0 0 40px;
  background: var(--bg-soft);
  border-radius: 6px;
  font-size: 0.9rem;
}
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* これからやること */
/* 段階（まず進めること / そのあと）。最初の段階だけアクセントの縦罫で強調し、
   2 つ目以降は罫なし。左端は padding で揃える（19px = 3px の罫 + 16px） */
.plan-stage {
  padding-left: 19px;
  margin-bottom: 28px;
}
.plan-stage.is-first {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}
.plan-stage-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.plan-stage.is-first .plan-stage-label { color: var(--accent); }

.plan-table { margin-bottom: 20px; }
.plan-table th {
  width: 7em;
  white-space: normal;   /* 英語の長い区分名（Under consideration）を折り返す */
  vertical-align: top;   /* 内容が複数行でも見出しは上端にそろえる */
}
.plan-table td { line-height: 1.9; }

/* リリースノート */
.releases { margin-top: 20px; }
.release {
  border-top: 1px solid var(--line);
  padding: 20px 0 4px;
}
.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 8px;
}
.release-version { font-weight: 700; font-size: 1.05rem; }
.release-head time {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.release ul { margin-bottom: 8px; }
.release li { line-height: 1.7; }
.release p { margin-bottom: 8px; }
.releases-older > .release:first-of-type { border-top: none; }
.releases-older summary {
  cursor: pointer;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.9rem;
}
.releases-older[open] summary { border-bottom: 1px solid var(--line); }

/* 開発の歴史 */
.history { list-style: none; padding: 0; margin: 24px 0 0; }
.history li {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 20px;
  padding: 0 0 28px 0;
}
.history-when {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  padding-top: 2px;
}
/* 年月とタイトルの間に縦線を通して、年表であることを示す */
.history-body {
  border-left: 2px solid var(--line);
  padding: 0 0 0 20px;
  position: relative;
}
.history-body::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.history-body h4 { margin: 0 0 4px; font-size: 1rem; }
.history-body p { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; }
.history-body img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: 6px;
}
@media (max-width: 560px) {
  .history li { grid-template-columns: 1fr; gap: 6px; }
  .history-when { text-align: left; }
}

/* スタッフ */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 28px 16px;
  margin: 24px 0;
}
.staff { text-align: center; }
.staff img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}
.staff-name { font-weight: 600; margin-top: 8px; }
.staff-role {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}
.staff-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.staff-link {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  opacity: 0.5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10.5 13.5a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1'/%3E%3Cpath d='M13.5 10.5a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1'/%3E%3C/svg%3E")
    center / 16px 16px no-repeat;
}
.staff-link:hover, .staff-link:focus-visible { opacity: 1; }
/* リンク先は読み上げ用にだけ持たせ、画面上はアイコンだけを見せる */
.staff-link span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* トップページ */
.hero { margin-bottom: 48px; }
.hero h1 { font-size: 1.8rem; line-height: 1.4; margin-bottom: 12px; }
.hero p { color: var(--muted); }
.hero-visual {
  position: relative;
  margin-bottom: 24px;
}
.hero-img {
  display: block;
  width: 100%;
  border-radius: 8px;
}
.hero-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(64%, 480px);
  height: auto;
  filter:
    drop-shadow(2px 0 0 #fff)
    drop-shadow(-2px 0 0 #fff)
    drop-shadow(0 2px 0 #fff)
    drop-shadow(0 -2px 0 #fff)
    drop-shadow(0 0 3px rgba(255, 255, 255, 0.95))
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.7));
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.card h3 { margin-top: 0; }
.card-img {
  display: block;
  max-width: 320px;
  margin-bottom: 12px;
}
.card .tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0 8px;
  margin-left: 8px;
  vertical-align: middle;
}

/* 車両一覧 */
.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.car-grid figure { margin: 0; }

/* 製品ロゴ (タブ選択時は見出しが隠れるので、この画像が製品名になる) */
.product-logo {
  display: block;
  width: auto;
  max-width: min(100%, 420px);
  height: auto;
  border-radius: 0;
  margin: 8px auto 24px;
}

/* 製品のリード文と購入ボタン */
.product-lead,
.product-cta { text-align: center; }
.product-lead { margin-top: 20px; }
.product-cta { margin-bottom: 40px; }

/* 路線図 (縦長) の横に車両などを並べる */
.route-layout {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 8px 36px;
  align-items: start;
  margin-bottom: 24px;
}
.route-layout .route-map { margin: 0; position: sticky; top: 90px; }
.route-layout .route-map img { width: 100%; height: auto; }
.route-side > :last-child { margin-bottom: 0; }
@media (max-width: 760px) {
  .route-layout { grid-template-columns: 1fr; gap: 24px; }
  /* 狭い画面では地図を先に読ませず、説明と車両を上に出す */
  .route-layout .route-map { order: 2; position: static; }
  .route-side { order: 1; }
}

/* ニュース */
.news-list { list-style: none; padding: 0; }
.news-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.news-list time { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.category {
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  white-space: nowrap;
}
.article-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* 稼働状況 */
.status-list { list-style: none; padding: 0; }
.status-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.status-badge {
  font-size: 0.8rem;
  border-radius: 4px;
  padding: 1px 10px;
  white-space: nowrap;
  color: #fff;
  background: var(--muted);
}
.status-badge[data-status="operational"] { background: #2e7d32; }
.status-badge[data-status="degraded"] { background: #b26a00; }
.status-badge[data-status="down"] { background: #c62828; }

/* フッター */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 32px;
  font-size: 0.85rem;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-bottom: 12px;
}
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.copyright { color: var(--muted); }

/* スマホ表示 */
@media (max-width: 640px) {
  body { font-size: 15px; }
  main { padding: 24px 20px 48px; }
  main h1 { font-size: 1.3rem; }
  .hero h1 { font-size: 1.4rem; }
  .site-header .inner { flex-direction: row; flex-wrap: wrap; gap: 8px 16px; }
  .site-nav { gap: 2px 12px; width: 100%; order: 3; }
  .card { padding: 16px; }
  .card-img { max-width: 100%; }
  /* 幅の広い表は横スクロール */
  main table {
    display: block;
    overflow-x: auto;
  }
  main th { min-width: 7em; }

  /* これからやること: 区分を上・内容を下に縦積みし、横幅をすべて内容に使う */
  .plan-table, .plan-table tr, .plan-table th, .plan-table td {
    display: block;
    width: auto;
    min-width: 0;
  }
  .plan-table th { border-bottom: none; }
  .plan-table td { border-top: none; margin-bottom: 12px; }

  /* 狭い画面では字下げを詰めて、内容に幅を回す */
  .plan-stage { padding-left: 12px; }
  .plan-stage.is-first { padding-left: 9px; }
}
