/* ------------------------------
   基本レイアウト
------------------------------ */

body.page {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background-color: #f5f6fa;
  color: #333;
  line-height: 1.6;
}

.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.main__header {
  margin-bottom: 32px;
}

.main__title {
  font-size: 28px;
  margin: 0 0 8px;
  font-weight: 700;
}

.main__lead {
  margin: 0;
  color: #555;
}

.main__footer {
  margin-top: 48px;
  padding: 24px 20px;
  font-size: 13px;
  color: #555;
  line-height:1.5;
}

.main__footer p {
  margin: 0 0 12px;
}

.main__footer a {
  color: #2563eb;
  text-decoration: none;
}

.main__footer a:hover {
  text-decoration: underline;
}

/* 左＝40% 右＝60% レイアウト */
.main__body {
  display: grid;
  grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
  gap: 32px;
}

@media screen and (max-width: 960px) {
  .main__body {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------
   パネル
------------------------------ */

.main__panel {
  background-color: #fff;
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0px 1px 2px rgba(0,0,0,0.06);
}

.main__section-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
}

/* ------------------------------
   アコーディオン
------------------------------ */

.accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion__item {
  border: 1px solid #e2e2ee;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
}

/* ヘッダ部分にゆとりを持たせる */
.accordion__header {
  background-color: #f7f7fa;
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion__header:hover {
  background-color: #f0f0f6;
}

/* 見出しボタン（a11y対応） */
.accordion__header-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  padding: 14px 18px;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  gap: 12px;
  width: calc(100% - 100px);
}

.accordion__header-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.accordion__title-wrapper {
  flex: 1 1 auto;
}

.accordion__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.accordion__subtitle {
  margin: 0;
  font-size: 12px;
  color: #666;
}

.accordion__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 7px 0 0;
  width: 90px;
}

.accordion__tool-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  user-select: none;
}

.accordion__tool-toggle-input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.accordion__tool-toggle-text {
  font-size: 12px;
}

/* ▶アイコンのズレ補正 */
.accordion__toggle-icon {
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  transform-origin: center;
  transition: transform 0.2s ease;
}

/* 開閉時の向き変更 */
.accordion__item--open .accordion__toggle-icon {
  transform: rotate(90deg);
}

/* コンテンツ側にも余白をしっかり */
.accordion__content {
  display: none;
  padding: 12px 18px 16px;
  border-top: 1px solid #e2e2ee;
}

.accordion__item--open .accordion__content {
  display: block;
}

/* ------------------------------
   チェックボックス / ラベル
------------------------------ */

.snippet-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.snippet-list__item {
  margin-bottom: 6px;
}

/* labelで囲む。クリック範囲を広く */
.snippet-list__label-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.snippet-list__label-wrapper:hover {
  background-color: #f8fafc;
}

.snippet-list__checkbox {
  margin-top: 3px;
  width: 16px;
  height: 16px;
}

.snippet-list__label-text {
  font-size: 14px;
  color: #333;
}

.snippet-list__label-main {
  font-weight: 600;
}

.snippet-list__label-meta {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

/* ------------------------------
   生成コード（右カラム）
------------------------------ */

.code-panel__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.code-panel__button {
  padding: 6px 12px;
  background-color: #2563eb;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.code-panel__button:hover {
  background-color: #1e55c9;
}

.code-panel__button--secondary {
  background-color: #888;
}

.code-panel__button--secondary:hover {
  background-color: #666;
}

.code-panel__textarea {
  width: 100%;
  min-height: 420px;
  padding: 12px;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  box-sizing: border-box;
  background-color: #fdfdfd;
}

.code-panel__hint {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}

/* PC のとき右側コードパネルを追従させる */
@media screen and (min-width: 961px) {
  .main__panel--code {
    position: sticky;
    top: 16px; /* ヘッダーとの余白 */
    align-self: start; /* グリッドの高さ合わせを解除して追従を効かせる */
  }
}
