/* ベース */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Zen Maru Gothic", "Quicksand", system-ui, -apple-system,
    BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f6f4f0;
  color: #333;
}

.page {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: #fdfbf8;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

/* ヘッダー */

.page-header {
  padding: 16px 20px 8px;
  border-bottom: 1px solid #e3dfd6;
}

.logo-text {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* モードタブ */

.mode-tabs {
  display: flex;
  padding: 8px 10px 0;
  gap: 8px;
}

.mode-tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  background: #e7e2d7;
  color: #666;
  cursor: pointer;
}

.mode-tab.active {
  background: #193f35;
  color: #fff;
}

/* メイン */

.main {
  padding: 12px 16px 20px;
}

.main-custom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 720px) {
  .main-custom {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr;
    gap: 16px;
  }

  /* PCのときもプレビューを左側に */
  .preview-section {
    order: 1;
  }
  .form-section {
    order: 2;
  }
}

.main-snapshot {
  display: block;
}

.hidden {
  display: none !important;
}

/* セクション共通 */

.section-title {
  font-size: 16px;
  margin: 10px 0 4px;
}

.form-section,
.preview-section {
  background: #fffdf8;
  border-radius: 18px;
  padding: 12px 14px 14px;
  border: 1px solid #e8e1d4;
}

/* セレクトなど */

.select-row {
  margin: 4px 0 10px;
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #d8d1c5;
  font-size: 15px;
  background: #faf7f2;
}

.category-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.category-btn {
  flex: 1;
  padding: 6px 4px;
  border-radius: 999px;
  border: 1px solid #cfc6b8;
  background: #f5f0e6;
  font-size: 12px;
  cursor: pointer;
}

.category-btn.active {
  background: #193f35;
  border-color: #193f35;
  color: #fff;
}

/* コントロール */

.control-group {
  margin: 8px 0;
}

.control-label {
  font-size: 12px;
  color: #777;
  display: block;
  margin-bottom: 4px;
}

input[type="range"] {
  width: 100%;
}

.flip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pill-btn {
  border-radius: 999px;
  border: 1px solid #cfc6b8;
  padding: 6px 12px;
  font-size: 12px;
  background: #f5f0e6;
  cursor: pointer;
}

/* プレビュー枠 */

.preview-frame {
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbf7f2 0%, #f0ebe4 100%);
  border: 1px solid #e5ddcf;
}

/* バッグプレビュー：バッグを大きめに見せる */

.bag-preview {
  position: relative;
  width: 100%;
  max-width: 320px;   /* ここでバッグの最大幅を調整 */
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bag-image {
  width: 92%;
  height: auto;
  display: block;
}

.applique-image {
  position: absolute;
  width: 100%;
  max-width: 120%;
  touch-action: none;
  cursor: grab;
  transform: translate(-50%, -50%);
  left: 60%;
  top: 55%;
}

/* 情報パネル */

.info-panel {
  margin-top: 8px;
  font-size: 13px;
}

.info-panel p {
  margin: 2px 0;
}

/* 名前横のアイコン */

.label-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  vertical-align: middle;
  margin: 0 4px 0 4px;
  border-radius: 6px;
  background: #f3eee5;
}

/* メモ・ヒント */

.note {
  margin-top: 8px;
  font-size: 11px;
  color: #888;
}

.hint {
  margin-top: 6px;
  font-size: 11px;
  color: #888;
}

/* ボタン */

.primary-btn {
  margin-top: 10px;
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 10px;
  font-size: 14px;
  background: #e0595d;
  color: #fff;
  cursor: pointer;
}

/* スクショモード */

.snapshot-header {
  text-align: center;
  margin-bottom: 4px;
}

.back-btn {
  border: none;
  background: none;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  margin-bottom: 4px;
}

.snapshot-title {
  margin: 4px 0 0;
  font-size: 18px;
}

.snapshot-sub {
  margin: 4px 0 8px;
  font-size: 13px;
  color: #777;
}

.snapshot-preview {
  background: #fffdf8;
  border-radius: 18px;
  padding: 12px 14px 20px;
  border: 1px solid #e8e1d4;
}

.snapshot-frame {
  padding: 10px;
  border-radius: 16px;
  background: #f6f1e9;
  border: 1px solid #e0d7c8;
}

.snapshot-bag {
  max-width: 380px;
}

.snapshot-info {
  margin-top: 10px;
  font-size: 13px;
}

.snapshot-note {
  font-size: 11px;
  color: #888;
}

/* 使い方 */

.snapshot-howto {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dotted #d9d0c4;
}

.snapshot-howto-title {
  margin: 0 0 4px;
  font-size: 14px;
}

.snapshot-howto-text {
  margin: 0;
  font-size: 12px;
  color: #666;
}

/* LINEボタン */

.line-button {
  display: block;
  margin-top: 16px;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 10px;
  font-size: 15px;
  background: #00b900;
  color: #fff;
  font-weight: 700;
}

/* スマホ微調整 */

@media (max-width: 480px) {
  .page-header {
    padding-top: 12px;
  }

  .bag-preview {
    max-width: 100%;
  }
}
/* 背景（黒くモヤッとさせる部分） */
.howto-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;            /* ← 最初は隠す */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* 表示時につけるクラス */
.howto-modal.show {
  display: flex;
}

/* 中身（画像が入るボックス） */
.howto-modal-content {
  background: #fffaf0;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;         /* ← 長い画像対応 */
  overflow-y: auto;
  border-radius: 16px;
  padding: 12px 12px 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* 画像サイズ調整 */
.howto-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* 閉じるボタン（×） */
.howto-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}
.base-button-center {
  display: block;
  width: 70%;
  margin: 24px auto 16px;
  padding: 12px 0;
  text-align: center;
  text-decoration: none;
  color: #193f35;               /* BASEっぽい緑 */
  border: 2px solid #193f35;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  background: #ffffff;
}
.howto-close-bottom {
  margin-top: 16px;
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  color: #193f35;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}




/* 写真で選べるカタログと、画面幅に合わせた配置 */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.search-row { margin:14px 0 8px; }
.search-row label { display:block; font-size:13px; margin-bottom:5px; }
.search-row input { width:100%; min-height:44px; padding:10px 12px; border:1px solid #d8d1c5; border-radius:12px; background:white; font:inherit; font-size:15px; }
.result-count { font-size:12px; color:#5b645e; margin:12px 0 8px; }
.applique-gallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.applique-card { min-width:0; padding:8px 4px; border:2px solid #e8e1d4; border-radius:12px; background:#fff; color:#333; font:inherit; cursor:pointer; }
.applique-card img { display:block; width:100%; height:78px; object-fit:contain; margin-bottom:6px; }
.applique-card span { display:block; font-size:11px; line-height:1.5; overflow-wrap:anywhere; }
.applique-card[aria-pressed="true"] { border-color:#193f35; background:#eaf4ec; box-shadow:0 0 0 1px #193f35; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline:3px solid #b65a33; outline-offset:3px; }
.category-btn { min-height:44px; }
.page-header { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.howto-button { flex-shrink:0; border:1px solid #cfc6b8; border-radius:20px; padding:8px 12px; background:#fffdf8; color:#193f35; cursor:pointer; }
.logo-text { font-size:clamp(15px,3.7vw,22px); }
.control-group { margin-top:20px; }
.main-snapshot { width:100%; max-width:540px; margin:0 auto; }
@media (min-width:720px) {
  .page { max-width:1120px; }
  .page-header { padding:24px 28px 16px; }
  .mode-tabs { padding:16px 28px 0; max-width:600px; width:100%; }
  .main-custom { padding:20px 28px 36px; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); align-items:start; gap:24px; }
  .preview-section { position:sticky; top:20px; }
  .bag-preview { max-width:440px; }
  .applique-card img { height:95px; }
  .applique-card span { font-size:12px; }
  .main-snapshot { padding-top:24px; }
}
@media (max-width:359px) {
  .applique-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .page-header { padding-left:12px; padding-right:12px; }
}

/* バッグを見ながら位置・大きさを調整 */
#bagPreview { touch-action: none; user-select: none; -webkit-user-select: none; }
#bagPreview img { -webkit-user-drag: none; user-select: none; }
.preview-controls { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #f5f3eb; }
.preview-controls .control-group { margin: 4px 0 8px; }
.preview-controls .control-label { color: #555; font-size: 13px; }
.preview-controls input[type="range"] { display: block; height: 30px; margin: 0; accent-color: #193f35; }
.preview-controls .pill-btn { min-height: 40px; min-width: 100px; color: #193f35; }
.preview-controls .hint { margin: 4px 0 0; color: #666; line-height: 1.6; }

.save-btn { width:100%; padding:11px 8px; margin-top:10px; border:1px solid #193f35; border-radius:20px; background:#eaf4ec; color:#193f35; font:inherit; font-size:14px; cursor:pointer; }
.save-status { font-size:12px; color:#193f35; margin:6px 0; }
.comparison { padding:16px; margin:0 16px 24px; border:1px solid #e8e1d4; border-radius:18px; background:#fffdf8; scroll-margin-top:16px; }
.compare-note { font-size:12px; line-height:1.7; color:#666; }
.saved-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; align-items:start; }
.saved-grid > .compare-note { grid-column:1 / -1; }
.saved-card { min-width:0; border:1px solid #d8d1c5; border-radius:12px; padding:8px 4px; background:#fff; }
.saved-card h3 { font-size:13px; margin:2px 0 6px; text-align:center; }
.saved-card p { font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
.saved-card button { width:100%; min-height:44px; border:1px solid #193f35; border-radius:10px; background:#eaf4ec; color:#193f35; font:inherit; font-size:11px; cursor:pointer; margin-top:6px; }
.saved-card .remove-saved { background:white; border-color:#ddd; color:#666; }
.saved-bag { max-width:100%; pointer-events:none; }
.mini-preview { display:flex; position:fixed; top:0; left:0; right:0; z-index:100; align-items:center; gap:12px; padding:8px 16px; background:rgba(253,251,248,.98); border-bottom:1px solid #d8d1c5; box-shadow:0 3px 12px #0001; }
.mini-bag { flex:0 0 112px; width:112px; margin:0; pointer-events:none; }
.mini-details { flex:1; min-width:0; }
.mini-details span { display:block; font-size:11px; line-height:1.5; }
.mini-details button { display:block; margin-top:5px; padding:5px 8px; border:1px solid #193f35; border-radius:10px; background:#eaf4ec; color:#193f35; font:inherit; font-size:11px; min-height:32px; }
.preview-section { scroll-margin-top:12px; }
@media(min-width:720px) {
 .comparison { margin:0 28px 28px; padding:20px; }
 .saved-card { padding:12px; }
 .saved-card p,.saved-card button { font-size:14px; }
 .mini-preview { display:none; }
}

#bagPreview .applique-image { will-change: transform; }


/* マキナツの深い緑。背景と選択カードの淡い緑はそのまま残す。 */
.section-title, .snapshot-title, .logo-text { color:#193f35; }
.primary-btn, .line-button { background:#193f35; color:#fff; }
.category-btn, .mode-tab, .back-btn { color:#193f35; }
.category-btn.active, .mode-tab.active { background:#193f35; border-color:#193f35; color:white; }
.applique-card[aria-pressed="true"] { border-color:#193f35; box-shadow:0 0 0 1px #193f35; }
.minne-button { display:block; margin-top:10px; padding:12px 10px; border:1px solid #193f35; border-radius:999px; color:#193f35; background:#fffdf8; text-decoration:none; text-align:center; font-size:14px; }
.howto-steps { padding-left:24px; font-size:14px; line-height:1.8; }
.howto-steps li { margin:10px 0; }

/* 相談前に、スクショする内容と価格の目安を一緒に確認できる。 */
.snapshot-summary { min-width:0; }
.snapshot-info p { margin:6px 0; line-height:1.5; }
.snapshot-price { margin-top:10px; padding:10px 12px; background:#eef2e9; border:1px solid #dce2d5; border-radius:12px; color:#193f35; }
.snapshot-price p { margin:3px 0; font-size:12px; line-height:1.5; }
.snapshot-price .snapshot-price-title { font-size:14px; }
.snapshot-price-title strong { font-size:20px; white-space:nowrap; }
.snapshot-price .snapshot-price-note { font-size:11px; color:#5b645e; }
.consultation-note { margin-top:14px; padding:12px; background:#f5f1e7; border-radius:12px; }
.consultation-note p { margin:4px 0; font-size:13px; line-height:1.7; color:#193f35; }
.consultation-note p:last-child { font-size:12px; color:#5b645e; }
@media(max-width:480px) {
 .main-snapshot { padding-top:8px; }
 .snapshot-header { margin-bottom:6px; }
 .snapshot-preview { padding:10px 12px 16px; }
 .snapshot-frame { padding:6px; }
 .snapshot-summary .snapshot-bag { max-width:340px; }
}

/* 作家用の本体価格登録画面 */
.price-setup-panel { margin:14px 0; padding:14px; background:#f3f1e7; border:2px solid #193f35; border-radius:14px; scroll-margin-top:20px; }
.price-setup-panel h3 { margin:0 0 8px; color:#193f35; font-size:16px; }
.price-setup-note { font-size:12px; color:#555; line-height:1.7; }
.price-setup-name { color:#193f35; font-weight:bold; font-size:16px; }
.price-setup-panel label { display:block; font-size:13px; line-height:1.6; margin:6px 0; }
#basePriceInput, #basePricesExport { box-sizing:border-box; width:100%; padding:10px; background:white; border:1px solid #bfcbbf; border-radius:9px; font-size:16px; }
.price-setup-panel button { width:100%; min-height:44px; padding:10px 8px; margin:6px 0; border:1px solid #193f35; border-radius:10px; color:#193f35; background:white; font:inherit; font-size:13px; cursor:pointer; }
.price-setup-panel button:disabled { opacity:.5; cursor:default; }
#registerBasePrice { color:white; background:#193f35; }
.price-quick-buttons { display:flex; gap:8px; }
#priceSetupStatus, #priceSetupProgress, #priceCopyStatus, #priceRegisteredValue { font-size:12px; line-height:1.7; }
.price-export, .price-review { margin-top:12px; padding-top:12px; border-top:1px solid #d3d7c9; }
.price-setup-panel summary { font-size:13px; line-height:1.8; cursor:pointer; }

/* オプションを選びながら、合計の目安を確認 */
.quote-preview { margin-top:12px; padding:10px 12px; border:1px solid #dce2d5; border-radius:12px; background:#eef2e9; }
.quote-preview p { margin:4px 0; font-size:12px; color:#193f35; line-height:1.6; }
.quote-total { color:#193f35; font-size:14px; line-height:1.7; }
.quote-total strong { font-size:22px; white-space:nowrap; }
.quote-total span { font-size:11px; }
.quote-preview .quote-options { font-size:11px; color:#5b645e; }
#openPriceOptions { margin:6px 0 0; min-height:40px; width:100%; padding:8px; border:1px solid #193f35; border-radius:10px; background:white; color:#193f35; font:inherit; font-size:13px; cursor:pointer; }
.price-options { margin-top:20px; padding:12px; border:1px solid #d8d1c5; background:#faf8f1; border-radius:14px; scroll-margin-top:180px; }
.price-options summary { cursor:pointer; font-size:15px; color:#193f35; font-weight:bold; min-height:30px; }
.price-options > label { display:block; margin:14px 0 6px; font-size:14px; color:#193f35; }
.price-options select { border-radius:12px; font-size:14px; }
.option-note, .option-intro { font-size:12px; line-height:1.7; color:#5b645e; }
.price-options > .option-check { display:flex; align-items:flex-start; gap:10px; margin:10px 0; padding:10px 8px; border:1px solid #dce2d5; border-radius:10px; background:white; cursor:pointer; line-height:1.6; }
.option-check input { flex-shrink:0; width:20px; height:20px; margin:1px 0 0; accent-color:#193f35; }
.option-benefit { font-size:12px; line-height:1.7; padding:10px; color:#193f35; background:#e1edde; border-radius:10px; }
.price-breakdown { margin:10px 0; border-top:1px solid #dce2d5; padding-top:6px; }
.price-breakdown > div { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:4px 0; font-size:12px; line-height:1.5; }
.price-breakdown dt { flex:1; }
.price-breakdown dd { margin:0; white-space:nowrap; }
.saved-card .saved-price { font-weight:bold; color:#193f35; }
.saved-card .saved-options { color:#5b645e; font-size:10px; }
.mini-price { display:block; font-size:12px; color:#193f35; margin:4px 0; line-height:1.5; }
@media(min-width:720px) { .saved-card .saved-options { font-size:12px; } }

.mini-actions { display:flex; flex-wrap:wrap; gap:5px; }
.mini-actions button { font-size:10px; padding:4px 6px; }

/* 撮影する範囲を、画像から料金まで赤枠で明示する。 */
.snapshot-summary { border:2px solid #c45443; border-radius:14px; padding:10px; }
.screenshot-guide { margin:0 0 10px; color:#a33e31; font-size:13px; font-weight:bold; line-height:1.6; }
.snapshot-howto-title { color:#a33e31; }
@media(max-width:480px) { .snapshot-summary { padding:8px; } }

/* 選択中の小さなプレビューから、その場で候補を保存する。 */
#miniSaveCombination { width:100%; background:#193f35; color:#fff; }
.mini-save-status { margin:5px 0 0; font-size:11px; line-height:1.5; color:#193f35; }
.mini-save-status:empty { display:none; }

/* スマホは、バッグのすぐ下から色を選べる流れにする。 */
@media(max-width:719px) {
  .preview-section > #saveCombination,
  .preview-section > #saveStatus,
  .preview-section > .info-panel,
  .preview-section > .quote-preview,
  .preview-section > #toSnapshot,
  .preview-section > .note { display:none; }
  #bagColorControl { margin-top:12px; }
  #bagColorControl select { font-size:16px; min-height:44px; }
  .price-options, .comparison {
    scroll-margin-top:calc(var(--mini-preview-height, 0px) + 12px);
  }
}

/* カテゴリーだけに、レトロなお道具箱の淡い色を添える。 */
.category-btn[data-category] {
  background:var(--category-color);
  color:#193f35;
  border:2px solid #cfc6b8;
}
.category-btn[data-category="恐竜"] { --category-color:#f4dcc5; }
.category-btn[data-category="海"] { --category-color:#d8e9eb; }
.category-btn[data-category="その他"] { --category-color:#f5eab9; }
.category-btn[data-category].active {
  border-color:#193f35;
  font-weight:700;
}
.category-btn[data-category].active::before {
  content:"";
  display:inline-block;
  width:5px;
  height:9px;
  margin-right:6px;
  border:solid currentColor;
  border-width:0 2px 2px 0;
  transform:translateY(-1px) rotate(45deg);
}
