/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   名入れカスタマイズ追加スタイル — style_nameprint.css
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ガマット警告 UI
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.gamut-warning {
  display: none;            /* JS で show/hide */
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  font-size: 13px;
}
.gamut-warning.visible { display: block; }

.gamut-warn-body {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}
.gamut-icon { font-size: 15px; flex-shrink: 0; line-height: 1.4; }
.gamut-msg  { flex: 1; line-height: 1.5; color: #5d4037; min-width: 0; }
.gamut-detail-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #e65100;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  line-height: 1.4;
}
.gamut-detail-btn:hover { color: #bf360c; }

/* 詳細パネル（折りたたみ） */
.gamut-detail {
  display: none;
  margin-top: 10px;
}
.gamut-detail.open { display: block; }

.gamut-compare {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.gamut-swatch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #888;
}
.gamut-swatch {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,.12);
}
.gamut-arrow { font-size: 18px; color: #bbb; }
.gamut-delta {
  font-size: 11px;
  color: #e65100;
  font-weight: 600;
  align-self: center;
}

/* 印刷プレビュー トグル */
.gamut-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  cursor: pointer;
  user-select: none;
}
.gamut-toggle-input { display: none; }
.gamut-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: #ccc;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.gamut-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: left 0.2s;
}
.gamut-toggle-input:checked + .gamut-toggle-track {
  background: #e65100;
}
.gamut-toggle-input:checked + .gamut-toggle-track .gamut-toggle-thumb {
  left: 18px;
}
.gamut-toggle-label { font-size: 13px; color: #5d4037; font-weight: 600; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   固定保存バー
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.save-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border, #E5E5EA);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

#main-app {
  padding-top: 56px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   保存ボタン
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.save-btn:active { transform: scale(0.97); }
.save-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* 完了後バウンス */
@keyframes save-btn-bounce {
  0%   { transform: scale(1);    box-shadow: none; }
  15%  { transform: scale(1.06); box-shadow: 0 0 0 4px rgba(0,122,255,0.25); }
  35%  { transform: scale(0.97); box-shadow: none; }
  55%  { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(0,122,255,0.15); }
  75%  { transform: scale(0.99); box-shadow: none; }
  100% { transform: scale(1);    box-shadow: none; }
}
.save-btn.bounce {
  animation: save-btn-bounce 0.7s ease forwards;
}

/* ローディング切り替え */
.save-btn-loading { display: none; align-items: center; gap: 8px; }
.save-btn.loading .save-btn-label  { display: none; }
.save-btn.loading .save-btn-loading { display: flex; }

/* スピナー */
@keyframes np-spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: np-spin 0.75s linear infinite;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   機種選択ドロップダウン
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   機種セレクター（ブランド→機種）
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.model-selector-wrap {
  margin-bottom: 10px;
}

.ms-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted, #AEAEB2);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ブランドグリッド */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.brand-btn {
  padding: 13px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--border, rgba(0,0,0,0.08));
  background: var(--light, #F5F5F7);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #1C1C1E);
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.brand-btn:active {
  background: var(--text, #1C1C1E);
  color: #fff;
  border-color: var(--text, #1C1C1E);
}

/* 機種ステップ */
#ms-model-step {
  display: none;
}

@keyframes ms-slide-in {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
#ms-model-step.ms-active {
  display: block;
  animation: ms-slide-in 0.26s ease;
}

.ms-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ms-back-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue, #007AFF);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
}

.ms-brand-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #1C1C1E);
}

/* 機種リスト */
.model-list-wrap {
  position: relative;
}

.model-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 28px; /* フェードの分だけ余白 */
}
.model-list::-webkit-scrollbar { display: none; }

/* 下にまだある事を示すグラデーションフェード */
.model-list-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.95));
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
}
.model-list-fade::after {
  content: '';
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23AEAEB2' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.model-item-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border, rgba(0,0,0,0.08));
  background: var(--light, #F5F5F7);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1C1C1E);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  flex-shrink: 0;
}
.model-item-btn:active {
  background: var(--text, #1C1C1E);
  color: #fff;
  border-color: var(--text, #1C1C1E);
}

/* 機種選択済みチップ */
.model-selected-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 14px;
  background: var(--light, #F5F5F7);
  border-radius: 10px;
  border: 1.5px solid var(--border, rgba(0,0,0,0.08));
}
.model-selected-bar.visible {
  display: flex;
}
.model-selected-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1C1C1E);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-change-btn {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue, #007AFF);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
}

.model-select-dropdown {
  width: 100%;
  height: 42px;
  padding: 0 32px 0 14px;
  border: 1.5px solid var(--border, #E5E5EA);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1C1C1E);
  background: #fff;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23AEAEB2' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s;
}
.model-select-dropdown:focus { border-color: var(--blue, #007AFF); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   プレビューエリア
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.preview-inner {
  padding: 14px 16px 12px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   キャンバス 未選択プレースホルダー
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#canvas-stage { position: relative; }

.canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(242,242,247,0.92);
  border-radius: 12px;
  z-index: 10;
  pointer-events: none;
}
.canvas-placeholder p {
  font-size: 14px;
  font-weight: 600;
  color: #8E8E93;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   キャンバス ローディングバー
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.canvas-loader {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,0.06);
  border-radius: 0 0 4px 4px;
  display: none;
  z-index: 15;
  overflow: hidden;
}
.canvas-loader.active { display: block; }

@keyframes canvas-load-anim {
  0%   { left: -60%; width: 60%; }
  100% { left: 100%; width: 60%; }
}
.canvas-loader-bar {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--blue, #007AFF);
  animation: canvas-load-anim 1.2s ease-in-out infinite;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Fabric.js キャンバスステージ
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.canvas-stage {
  display : flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.canvas-wrap {
  transform-origin: top center;
  line-height: 0;
}

/* 元に戻すボタン */
.undo-btn {
  position     : absolute;
  bottom       : 12px;
  right        : 12px;
  width        : 36px;
  height       : 36px;
  border-radius: 50%;
  border       : none;
  background   : rgba(28,28,30,0.65);
  color        : #fff;
  font-size    : 16px;
  line-height  : 1;
  cursor       : pointer;
  display      : flex;
  align-items  : center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition   : opacity 0.15s, transform 0.1s;
  z-index      : 10;
}
.undo-btn:hover:not(:disabled) {
  background: rgba(28,28,30,0.85);
  transform : scale(1.08);
}
.undo-btn:disabled {
  opacity: 0.3;
  cursor : not-allowed;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ケース本体カラー行
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.case-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.case-color-row .ctrl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #8E8E93);
  white-space: nowrap;
  flex-shrink: 0;
}
.case-color-row .color-toggle {
  flex: 1;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ステップカード（共通）
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.step-card {
  margin-bottom: 10px;
  overflow: hidden;
}

.step-inner {
  padding: 20px 18px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   アコーディオン（PC用）
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.ac-header,
.pc-ac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 18px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 8px;
}

.ac-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.ac-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.ac-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.pc-ac-header.open .ac-chevron {
  transform: rotate(180deg);
}

/* PC: アコーディオン本体 */
.step-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   モバイル: ステップカルーセル
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.step-indicator {
  display: none;
  overflow-x: auto;
  padding: 10px 12px 6px;
  gap: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: space-around;
}
.step-indicator::-webkit-scrollbar { display: none; }

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 56px;
  padding: 4px 2px;
  border: none;
  background: none;
  cursor: pointer;
  flex: 1;
}

.step-dot-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border, #E5E5EA);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #8E8E93);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.step-dot.active .step-dot-num {
  background: var(--text, #1C1C1E);
  border-color: var(--text, #1C1C1E);
  color: #fff;
}

.step-dot.done .step-dot-num {
  background: #34C759;
  border-color: #34C759;
  color: #fff;
}

.step-dot-label {
  font-size: 10px;
  color: var(--muted, #8E8E93);
  white-space: nowrap;
  font-family: var(--font);
}

.step-dot.active .step-dot-label,
.step-dot.done .step-dot-label {
  color: var(--text, #1C1C1E);
  font-weight: 600;
}

/* ステップナビゲーション */
.step-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 16px;
  gap: 12px;
}

.step-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #8E8E93);
  font-family: var(--mono, monospace);
  min-width: 36px;
  text-align: center;
}

.step-nav-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #E5E5EA);
  background: var(--light, #F2F2F7);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1C1C1E);
  cursor: pointer;
  transition: opacity 0.15s;
}
.step-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.step-nav-next {
  background: var(--text, #1C1C1E);
  color: #fff;
  border-color: var(--text, #1C1C1E);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SV マップ（step-inner内での上書き）
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.step-inner .sv-map {
  border-radius: 10px;
  margin-top: 4px;
  aspect-ratio: 5 / 2; /* 元の2/1から80%の高さに */
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   共通行レイアウト
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.np-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.np-row:last-child { margin-bottom: 0; }
.np-row-slider { align-items: center; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   テキスト入力
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.np-text-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--light);
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.np-text-input:focus {
  border-color: var(--text);
  background: #fff;
}
.np-text-input::placeholder { color: var(--muted); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ビジュアルフォントグリッド
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.font-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.font-card {
  aspect-ratio: 3 / 2;
  border: 2px solid var(--border, #E5E5EA);
  border-radius: 12px;
  background: var(--light, #F2F2F7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  overflow: hidden;
}
.font-card:active { transform: scale(0.95); }
.font-card.selected {
  border-color: var(--blue, #007AFF);
  background: #EBF4FF;
}

.font-card-preview {
  font-size: 20px;
  color: var(--text, #1C1C1E);
  white-space: nowrap;
  pointer-events: none;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   グレー スライダー（サイズ用）
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.gray-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 14px;
  border-radius: 7px;
  outline: none;
  border: none;
  cursor: pointer;
  background: linear-gradient(to right, #aaa, #e0e0e0);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.12);
}
.gray-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 1px 6px rgba(0,0,0,0.28), 0 0 0 2px rgba(255,255,255,0.85);
  cursor: pointer;
  transition: transform 0.1s;
}
.gray-slider:active::-webkit-slider-thumb { transform: scale(1.18); }
.gray-slider::-moz-range-track {
  height: 14px;
  border-radius: 7px;
  border: none;
  background: linear-gradient(to right, #aaa, #e0e0e0);
}
.gray-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 1px 6px rgba(0,0,0,0.28);
  cursor: pointer;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   サイズバッジ
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.size-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--sub);
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   文字色 HSV ピッカー
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* SV マップ（文字色用） */
.tc-sv-map {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 2; /* 元の2/1から80%の高さに */
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: background;
}

.tc-sv-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.32), 0 2px 8px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: left, top;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   配置ボタン
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.align-btns {
  display: flex;
  gap: 8px;
  flex: 1;
}
.align-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--light);
  color: var(--sub);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.align-btn:active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.align-btn-danger {
  border-color: rgba(255,59,48,0.35);
  color: #FF3B30;
}
.align-btn-danger:active {
  background: #FF3B30;
  border-color: #FF3B30;
  color: #fff;
}
.text-layer-btns { gap: 8px; }
.text-layer-btns .align-btn { flex: 1; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PC 2カラムレイアウト
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.pc-layout {
  display: flex;
  flex-direction: column;
}

@media (min-width: 780px) {
  .app { max-width: 960px; }

  .pc-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
  }

  .pc-left {
    flex: 0 0 300px;
    position: sticky;
    top: 72px; /* save-bar height + margin */
  }

  .pc-right {
    flex: 1;
    min-width: 0;
  }

  /* PC: アコーディオンヘッダー表示 */
  .pc-ac-header { display: flex; }

  /* PC: ステップインジケーター・ナビ非表示 */
  .step-indicator { display: none !important; }
  .step-nav { display: none !important; }

  /* PC: 全ステップカード表示 */
  .step-card { display: block !important; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   モバイル専用スタイル
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 779px) {
  /* ステップインジケーター・ナビ表示 */
  .step-indicator { display: flex; }
  .step-nav { display: flex; }

  /* PCアコーディオンヘッダー非表示 */
  .pc-ac-header { display: none !important; }

  /* 非アクティブなカードは非表示 */
  .step-card { display: none; }
  .step-card.active { display: block; }

  /* モバイルではstep-bodyを常に展開 */
  .step-body {
    max-height: none !important;
    overflow: visible !important;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   共有URLモーダル
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.share-modal-inner {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.2);
}

.share-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.share-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.share-id-code {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: var(--light);
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.share-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.share-url-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sub);
  background: var(--light);
  outline: none;
}

.share-copy-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: none;
  background: var(--text);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.12s;
}
.share-copy-btn:active { opacity: 0.75; }

.share-copy-msg {
  font-size: 12px;
  color: #34C759;
  font-weight: 600;
  height: 18px;
  margin-bottom: 14px;
  visibility: hidden;
}
.share-copy-msg.visible { visibility: visible; }

.share-close-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: none;
  color: var(--sub);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.share-close-btn:active { background: var(--light); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   テキストレイヤーパネル
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* 常駐レイヤーパネルカード */
.layer-panel-card {
  margin-top: 8px;
}
.layer-panel-card-inner {
  padding: 12px 16px 14px;
}
.layer-panel-card .layer-panel-title {
  margin-bottom: 8px;
}

.layer-panel {
  margin-top: 12px;
}
.layer-panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted, #AEAEB2);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.layer-empty {
  font-size: 13px;
  color: var(--muted, #AEAEB2);
  text-align: center;
  padding: 14px 0;
}
.layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--light, #F5F5F7);
  border: 1.5px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.layer-item.active {
  border-color: #007AFF;
  background: #EAF2FF;
}
.layer-order-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border, rgba(0,0,0,0.10));
  border-radius: 6px;
  color: var(--sub, #636366);
  font-size: 10px;
  line-height: 1;
  padding: 5px 7px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.layer-order-btn:hover:not(:disabled) { background: rgba(0,122,255,0.08); color: #007AFF; }
.layer-order-btn:disabled { opacity: 0.3; cursor: default; }
.layer-label {
  flex: 1;
  font-size: 13px;
  font-family: var(--font);
  color: var(--fg, #1C1C1E);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layer-label-empty {
  color: var(--muted, #AEAEB2);
  font-style: italic;
}
.layer-del-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted, #AEAEB2);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.layer-del-btn:hover { background: rgba(255,59,48,0.1); color: #FF3B30; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   デザイン呼び出しフッター
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.recall-footer {
  background: var(--card, #fff);
  border-top: 1px solid var(--border, rgba(0,0,0,0.08));
  margin-top: 32px;
  padding: 24px 16px 40px;
}

.recall-inner {
  max-width: 440px;
  margin: 0 auto;
}

@media (min-width: 780px) {
  .recall-inner { max-width: 960px; }
}

.recall-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #1C1C1E);
  margin-bottom: 12px;
}

.recall-row {
  display: flex;
  gap: 8px;
}

.recall-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 10px;
  font-family: var(--mono, monospace);
  font-size: 13px;
  color: var(--text, #1C1C1E);
  background: var(--light, #F5F5F7);
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
.recall-input:focus {
  border-color: var(--text, #1C1C1E);
  background: #fff;
}
.recall-input::placeholder {
  color: var(--muted, #AEAEB2);
  font-family: var(--font);
}

.recall-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: none;
  background: var(--text, #1C1C1E);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.recall-btn:active { opacity: 0.75; }
.recall-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.recall-msg {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  min-height: 18px;
  color: #FF3B30;
}
.recall-msg.success { color: #34C759; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   エラートースト
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #FF3B30;
  color: #fff;
  padding: 13px 22px;
  border-radius: 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  text-align: center;
  white-space: pre-line;
}
.error-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   読み込みオーバーレイ
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.load-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  z-index: 9998;
}
.load-overlay.hidden { display: none; }

.load-overlay-spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(0,0,0,0.1);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: np-spin 0.75s linear infinite;
}

.load-overlay-text {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--sub);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   スタンプピッカー
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.stamp-picker {
  margin-top: 0;
}

/* カテゴリタブ */
.stamp-cat-tabs {
  display   : flex;
  flex-wrap : wrap;
  gap       : 6px;
  margin-bottom: 12px;
}
.stamp-cat-btn {
  padding      : 5px 13px;
  border       : 1.5px solid var(--cat-color, #6366f1);
  border-radius: 20px;
  background   : transparent;
  color        : var(--cat-color, #6366f1);
  font-size    : 12px;
  font-weight  : 600;
  cursor       : pointer;
  transition   : background 0.15s, color 0.15s;
  line-height  : 1.4;
}
.stamp-cat-btn.active,
.stamp-cat-btn:hover {
  background: var(--cat-color, #6366f1);
  color     : #fff;
}

/* スタンプグリッド（横スクロール） */
.stamp-scroll-wrap {
  container-type : inline-size;
  overflow-x     : auto;
  overflow-y     : hidden;
  margin-bottom  : 12px;
  padding-bottom : 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.stamp-scroll-wrap::-webkit-scrollbar {
  height: 4px;
}
.stamp-scroll-wrap::-webkit-scrollbar-thumb {
  background   : var(--border);
  border-radius: 2px;
}
.stamp-grid {
  display             : grid;
  grid-template-rows  : repeat(3, calc((100cqi - 8px * 3) / 4.5));
  grid-auto-flow      : column;
  grid-auto-columns   : calc((100cqi - 8px * 3) / 4.5);
  gap                 : 8px;
  width               : max-content;
}
.stamp-item {
  border        : 1.5px solid var(--border);
  border-radius : 10px;
  background    : #fafafa;
  cursor        : pointer;
  padding       : 8px;
  display       : flex;
  align-items   : center;
  justify-content: center;
  transition    : border-color 0.15s, background 0.15s;
}
.stamp-item:hover {
  border-color: var(--blue);
  background  : #f0f5ff;
}
.stamp-item img {
  width     : 100%;
  height    : 100%;
  object-fit: contain;
  pointer-events: none;
}
.stamp-empty,
.stamp-loading {
  font-size: 12px;
  color    : var(--muted);
  padding  : 8px 0;
}

/* スタンプ色行 */
.stamp-color-row {
  display    : flex;
  align-items: center;
  gap        : 10px;
  margin-top : 4px;
}
.stamp-color-chip-wrap {
  cursor   : pointer;
  display  : flex;
  align-items: center;
}
.stamp-color-input {
  position: absolute;
  opacity : 0;
  width   : 0;
  height  : 0;
  pointer-events: none;
}
.stamp-color-chip {
  display      : inline-block;
  width        : 26px;
  height       : 26px;
  border-radius: 8px;
  border       : 1.5px solid rgba(0,0,0,0.12);
  cursor       : pointer;
  flex-shrink  : 0;
}

/* レイヤーラベル: スタンプ */
.layer-label-stamp {
  font-size: 12px;
  color    : var(--blue);
}

/* 免責事項フッター */
.disclaimer-footer {
  background : #f4f4f8;
  border-top : 1px solid var(--border, rgba(0,0,0,0.08));
  padding    : 20px 16px 32px;
}
.disclaimer-list {
  max-width  : 440px;
  margin     : 0 auto;
  padding    : 0;
  list-style : none;
  display    : flex;
  flex-direction: column;
  gap        : 8px;
}
.disclaimer-list li {
  font-size  : 11px;
  line-height: 1.65;
  color      : #6c6c70;
  padding-left: 1em;
  text-indent : -1em;
}
.disclaimer-list li::before {
  content    : '■ ';
  color      : #aeaeb2;
}
@media (min-width: 780px) {
  .disclaimer-list { max-width: 960px; }
}
