/* 設定の部品：タブ、スイッチ、見て選べるボタン（色見本・配置の図・書体見本） */

/* ---- タブ（星空 / 文字 / デザイン） ---- */
.settings-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 14px;
  background: var(--color-input-bg);
}

.settings-tab {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  min-height: 60px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.settings-tab:hover {
  color: var(--color-text);
}

.settings-tab[aria-selected="true"] {
  /* どのタブを開いているかが一目でわかるよう、地の色との差をはっきり付ける */
  background: #22305c;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 14px rgba(0, 0, 0, 0.35);
  color: var(--color-text);
}

.tab-icon {
  color: var(--color-accent);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.2;
}

/* ---- スイッチ（チェックボックスをオン・オフのつまみに見せる） ---- */
.check {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(31, 42, 74, 0.6);
  font-size: 0.95rem;
  cursor: pointer;
}

.check:last-of-type {
  border-bottom: none;
}

.check small {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.check input[type="checkbox"] {
  flex: none;
  position: relative;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: #2a3354;
  appearance: none;
  cursor: pointer;
  transition: background 0.18s;
}

.check input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s;
}

.check input[type="checkbox"]:checked {
  background: var(--color-accent);
}

.check input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.check:has(input:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- 見て選べるボタン ---- */
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

/* 選択肢が少ない並びは1行に収め、折り返しで1つだけ次の行に落ちないようにする */
.chips-swatch {
  grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
  gap: 6px;
}

.chips-swatch .chip {
  padding: 10px 2px 8px;
  font-size: 0.72rem;
  letter-spacing: -0.02em;
}

.chips-layout,
#poster-paper + .chips {
  grid-template-columns: repeat(4, 1fr);
}

.chips-font,
.chips-dot {
  grid-template-columns: repeat(2, 1fr);
}

.chip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 8px;
  background: var(--color-input-bg);
  border: 1px solid var(--color-panel-border);
  border-radius: var(--radius-control);
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.chip:hover:not(:disabled) {
  border-color: #3a4a78;
  color: var(--color-text);
}

.chip[aria-checked="true"] {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.chips-text .chip,
.chips-dot .chip,
.chips-stroke .chip {
  flex-direction: row;
}

/* 配色の見本：紙の色の上に星空の円と文字の線 */
.chip-swatch {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 58px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.chip-swatch-sky {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.chip-swatch-ink {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

/* 配置の見本：用紙の中の円（星空）と線（文字） */
.chip-layout {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 52px;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.chip-layout::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.chip-layout::after {
  content: "";
  width: 18px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.chip-layout-top,
.chip-layout-bottom {
  flex-direction: column;
}

.chip-layout-bottom,
.chip-layout-right {
  flex-direction: column-reverse;
}

.chip-layout-left,
.chip-layout-right {
  width: 58px;
  height: 40px;
  flex-direction: row;
}

.chip-layout-right {
  flex-direction: row-reverse;
}

.chip-layout-left::after,
.chip-layout-right::after {
  width: 14px;
}

.chip-font {
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1.2;
}

.chip-dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.chip-stroke {
  flex: none;
  width: 22px;
  border-radius: 2px;
  background: currentColor;
}

.chip:disabled {
  opacity: 0.4;
}
