/* ===== 設定(ここを変えると見た目が変わります) ===== */
:root {
  --bg-color: #ffffff;        /* 背景色 */
  --text-color: #222222;      /* 文字の色 */
  --muted-color: #666666;     /* 補足説明の文字の色(グレー) */
  --line-color: #d9d9d9;      /* 枠線の色 */
  --soft-color: #f5f5f5;      /* コードや見本の背景色(うすいグレー) */
  --accent-color: #2a6f97;    /* アクセント色(選んだボタンなど) */
  --accent-text: #ffffff;     /* アクセント色の上の文字色 */
  --result-width: 400px;      /* 右側「できあがり」の幅(パソコンで見るとき) */
}

/* ===== ここから下は変更不要 ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  /* 画面の説明文用のフォント(選んだフォントの見本には影響しません) */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

h1, h2, h3, p {
  margin: 0;
}

button,
input {
  font: inherit;
}

/* ----- ページ上部 ----- */
.site-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 16px;
}

.site-header h1 {
  font-size: 28px;
  line-height: 1.4;
}

/* タイトル: 小さな「サブ」と、大きな「メイン」の2段 */
.title-sub {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--accent-color);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 18px;
  font-weight: 700;
}

/* 文字の両脇の斜めの線(\ 文字 / のように見える) */
.title-sub::before,
.title-sub::after {
  content: "";
  width: 7px;                        /* 線2本ぶんの幅 */
  height: 1.3em;                     /* 線の長さ */
  border-left: 2px solid var(--accent-color);
  border-right: 2px solid var(--accent-color);
}

.title-sub::before {
  transform: rotate(-28deg);         /* 左側: \ の向き */
}

.title-sub::after {
  transform: rotate(28deg);          /* 右側: / の向き */
}

.title-main {
  display: block;
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 32px;
  font-weight: 700;
}

.lead {
  margin-top: 8px;
}

.note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted-color);
}

.sample-input {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted-color);
}

.sample-input input {
  display: block;
  width: 100%;
  max-width: 640px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line-color);
  border-radius: 4px;
  color: var(--text-color);
}

/* ----- 全体のレイアウト: 左(選ぶ)+ 右(結果) ----- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--result-width);
  gap: 32px;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 64px;
}

.step {
  margin-bottom: 48px;
}

h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--text-color);
  font-size: 20px;
  line-height: 1.4;
}

.step-no {
  display: inline-block;
  min-width: 26px;
  padding: 0 6px;
  background: var(--text-color);
  color: var(--bg-color);
  font-size: 15px;
  text-align: center;
}

.optional {
  font-size: 13px;
  font-weight: normal;
  color: var(--muted-color);
}

.hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted-color);
}

/* ----- 絞り込みボタン ----- */
.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.filter-label {
  width: 56px;
  font-size: 13px;
  color: var(--muted-color);
}

.chip,
.btn {
  padding: 5px 12px;
  border: 1px solid var(--line-color);
  border-radius: 4px;
  background: var(--bg-color);
  color: var(--text-color);
  cursor: pointer;
}

.chip:hover,
.btn:hover {
  border-color: var(--text-color);
}

.chip[aria-pressed="true"],
.btn[aria-pressed="true"],
.btn-main {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: var(--accent-text);
}

.count {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted-color);
}

.step-actions {
  margin-top: 8px;
}

/* ----- フォントのカード ----- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--line-color);
  border-radius: 4px;
}

.card.is-selected {
  border-color: var(--accent-color);
  outline: 2px solid var(--accent-color);
}

.card-name {
  font-size: 15px;
  font-weight: bold;
  line-height: 1.4;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.tag {
  padding: 0 6px;
  border: 1px solid var(--line-color);
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted-color);
}

.tag-ng {
  text-decoration: line-through;
  opacity: 0.5;
}

.card-sample {
  margin: 10px 0;
  padding: 8px;
  background: var(--soft-color);
  font-size: 20px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.card-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-color);
}

.card-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: #a05a00;
}

.card .btn {
  margin-top: auto;
}

.card-body {
  flex: 1;
  margin-bottom: 10px;
}

.empty {
  grid-column: 1 / -1;
  padding: 24px 0;
  color: var(--muted-color);
}

/* ----- 右側: できあがり ----- */
.result {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line-color);
  border-radius: 4px;
}

.result h2 {
  font-size: 18px;
}

.result h3 {
  margin-top: 20px;
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.5;
}

.result-empty {
  margin-top: 12px;
  color: var(--muted-color);
}

.selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--soft-color);
  border-radius: 4px;
  font-size: 13px;
}

.selected-item .clear {
  padding: 0 6px;
  border: none;
  background: none;
  color: var(--muted-color);
  cursor: pointer;
  font-size: 16px;
  line-height: 1.4;
}

.preview {
  padding: 12px;
  border: 1px solid var(--line-color);
  border-radius: 4px;
}

.preview-heading {
  font-size: 26px;
  line-height: 1.4;
}

.preview-body {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.8;
}

.code {
  margin: 4px 0 8px;
  padding: 10px;
  background: var(--soft-color);
  border-radius: 4px;
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code {
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

.os-item {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line-color);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
}

.os-item h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

.os-item .code {
  margin: 6px 0 0;
}

.os-small {
  color: var(--muted-color);
  font-size: 12px;
}

.btn-reset {
  display: block;
  margin-top: 24px;
}

/* ----- ページ下部のクレジット ----- */
.site-footer {
  padding: 0 20px 32px;
  font-size: 11px;
  text-align: center;
  color: var(--muted-color);
}

.site-footer a {
  color: inherit;
}

/* ----- スマホ・タブレット幅: 1列にして、「できあがり」を下に置く ----- */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .result {
    position: static;
    max-height: none;
  }
}
