/* 連携・API */

.api-docs-section {
  background-color: #f8fafc;
  padding: 40px 0 80px;
}

.api-docs-container {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .api-docs-container {
    grid-template-columns: 1fr;
  }
}

.api-sidebar {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 90px;
  width: 100%;
  box-sizing: border-box;
}

.api-sidebar__title {
  background: var(--blue, #0878bf);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.api-sidebar__nav {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  font-size: 0.85rem;
}

.api-sidebar__nav li {
  margin-bottom: 2px;
}

.api-sidebar__nav a,
.api-sidebar__nav .has-child > span {
  display: block;
  padding: 6px 12px;
  color: #334155;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.api-sidebar__nav li.active > a,
.api-sidebar__nav a:hover {
  background-color: #e0f2fe;
  color: var(--blue, #0878bf);
  font-weight: 700;
}

.api-sidebar__nav .has-child > span {
  font-weight: 700;
  color: #1e293b;
  margin-top: 6px;
}

.api-sidebar__nav ul {
  list-style: none;
  padding-left: 16px;
  margin: 2px 0 6px;
}

.api-sidebar__nav ul li a {
  font-size: 0.8rem;
  color: #64748b;
  padding: 4px 12px;
}

.api-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
  max-width: 100%;
}

.api-block {
  min-width: 0;
  max-width: 100%;

  scroll-margin-top: 110px;
}

.api-block h2 {
  font-size: 1.75rem;
  color: #0f172a;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  padding-bottom: 12px;
}

.api-block h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 4px;
  background-color: var(--blue, #0878bf);
  border-radius: 2px;
}

.api-block p {
  color: #334155;
  line-height: 1.6;
  margin-top: 12px;
}

.api-block .sub-note {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 4px;
}

.api-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.api-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  position: relative;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0;
}

.api-card h3 {
  font-size: 1.1rem;
  color: #0f172a;
  font-weight: 700;
  margin: 0 0 12px 0;
  padding-left: 12px;
  border-left: 4px solid var(--blue, #0878bf);
}

.api-card p {
  margin: 0;
  color: #475569;
}

.api-card .card-note {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 8px;
}

.api-card .section-sub {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.usage-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.usage-steps li {
  font-size: 0.9rem;
  color: #334155;
  margin-bottom: 6px;
  line-height: 1.5;
}

.spec-table-wrapper {
  background: #ffffff;
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  table-layout: auto;
}

.spec-table th {
  background-color: #dbeafe;
  color: #1e3a8a;
  font-weight: 700;
  padding: 12px 16px;
  border: none;
  text-align: left;
}

.spec-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  vertical-align: top;
  line-height: 1.6;
}

.spec-table tr:last-child td {
  border-bottom: none;
}

.spec-table td.col-highlight,
.spec-table tbody td:first-child:not([colspan]) {
  background-color: #114b7e !important;
  color: #ffffff !important;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
  white-space: nowrap;
  width: 1%;
}

.spec-table th:not(:last-child),
.spec-table td:not(:last-child):not([colspan]) {
  white-space: nowrap;
  width: 1%;
}

.spec-table th:last-child,
.spec-table td:last-child {
  width: auto;
  white-space: normal;
}

.spec-table td.col-highlight .table-note,
.spec-table tbody td:first-child:not([colspan]) .table-note {
  color: #e2e8f0 !important;
}

.spec-table td[colspan] {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  font-weight: 700;
  padding: 12px 16px;
  width: auto !important;
  white-space: normal !important;
}

.spec-table--compact th,
.spec-table--compact td {
  padding: 10px 14px;
}

.spec-table--compact td:first-child {
  font-weight: 600;
}

.spec-table-wrapper--bordered {
  margin-top: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
}

.is-striped {
  background-color: #f8fafc;
}

/* コード例内に埋め込まれる、classを持たない簡易フィールド一覧テーブル */
.api-field-table-wrapper {
  margin-top: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background-color: #fff;
}

.api-field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.api-field-table thead tr {
  background-color: #0284c7;
  color: #fff;
}

.api-field-table th {
  padding: 6px 10px;
  text-align: left;
}

.api-field-table th:first-child {
  width: 35%;
}

.api-field-table th:last-child {
  width: 65%;
}

.api-field-table td {
  padding: 6px 10px;
}

.api-field-table td:first-child {
  font-weight: 600;
}

/* 変更履歴テーブル */
.api-changelog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.6;
}

.api-changelog-table td {
  vertical-align: top;
}

.api-changelog-table td:first-child {
  width: 120px;
  padding: 16px 8px 16px 0;
  color: #334155;
  white-space: nowrap;
}

.api-changelog-table td:last-child {
  padding: 16px 0 16px 8px;
  color: #1e293b;
}

.api-changelog-wrapper {
  margin-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.api-indent {
  padding-left: 1rem;
}

.api-indent--top {
  padding-left: 1rem;
  margin-top: 4px;
}

.api-indent--muted {
  padding-left: 1rem;
  color: #475569;
}

.table-note {
  font-size: 0.85rem;
  color: #64748b;
}

.table-note--break {
  word-break: break-all;
}

.sub-note--note {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #334155;
}

.api-field-list {
  font-size: 0.85rem;
  color: #475569;
}

.api-mono-accent {
  font-family: monospace;
  color: #0284c7;
}

.api-note-text {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #475569;
}

.api-card--tight {
  margin-top: 12px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block !important;
  animation: apiTabFadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

@keyframes apiTabFadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.api-sidebar__nav li.active > a {
  font-weight: bold;
  color: #0284c7;
}

pre,
code,
.code-block,
.api-card .code-text {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  white-space: pre !important;
  word-break: normal !important;
  display: block;
}

p .code-text,
span.code-text {
  display: inline-block;
  white-space: nowrap !important;
}

/* ===== インラインstyle整理(バッチ1: テーブルセル以外) ===== */

/* コードサンプル内のJSONキー・値の強調表示 */
.api-json-token {
  color: #b91c1c;
}

/* 注意書き(赤字) */
.api-caution-text {
  color: #ef4444;
}

/* セクション見出し(h3) */
.api-section-heading {
  margin-top: 32px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.api-section-heading--underline {
  border-bottom: 2px solid #0284c7;
  padding-bottom: 8px;
}

.api-section-heading--sm {
  margin-top: 24px;
  font-size: 1.1rem;
}

/* サブ見出し(h4) */
.api-sub-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #0284c7;
  border-left: 4px solid #0284c7;
  padding-left: 8px;
  margin-bottom: 4px;
}

/* サンプルコードを囲むノート枠(.api-cardの派生) */
.api-card--example {
  margin-top: 12px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 16px;
}

.api-card--example.is-scrollable {
  overflow-x: auto;
}

.api-card-list--tight {
  margin-top: 16px;
}

/* コードブロック(.code-blockの派生) */
.code-block {
  margin: 0;
  font-family: monospace;
}

.code-block--lg {
  font-size: 0.9rem;
}

.code-block--sm {
  font-size: 0.85rem;
}

.code-block--muted {
  color: #334155;
}

.code-block--scroll {
  width: max-content;
  min-width: 100%;
}

/* 折りたたみ(<details>/<summary>) */
.api-details {
  cursor: pointer;
}

.api-summary {
  color: #0284c7;
  font-weight: 700;
  cursor: pointer;
}

.api-summary::marker {
  cursor: pointer;
}

.api-summary::-webkit-details-marker {
  cursor: pointer;
}

.api-summary--spaced {
  outline: none;
  margin-bottom: 12px;
}

/* テーブルの表示バリエーション(.spec-tableの派生) */
.spec-table--fixed {
  table-layout: fixed;
}

.spec-table--compact {
  table-layout: fixed;
  font-size: 0.9rem;
  background-color: #fff;
}

/* 汎用マージンユーティリティ */
.api-mt-16 {
  margin-top: 16px;
}

.api-mb-16 {
  margin-bottom: 16px;
}

.api-block {
  background-color: #ffffff !important;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .api-block {
    padding: 18px 16px !important;
    margin-bottom: 20px;
  }

  .api-block h2 {
    font-size: 1.3rem !important;
    line-height: 1.4 !important;
    background-color: transparent !important;
    position: relative;
    z-index: 2;
  }

  .api-block p,
  .api-block .sub-note {
    position: relative;
    z-index: 2;
    background-color: transparent;
  }
}
