/* COURIER Simulator */
.courier-simulator {
  background: #f0ede8;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  padding: 0 0 20px;
}
.courier-simulator * { box-sizing: border-box; }

/* ヘッダー */
.courier-simulator header {
  background: #111; color: #fff;
  text-align: center; padding: 10px 16px 7px; margin: 0;
}
.courier-simulator header h1 {
  font-size: 15px; letter-spacing: .25em; font-weight: 400; margin: 0;
}
.courier-simulator header p {
  font-size: 11px; color: #666; letter-spacing: .15em; margin-top: 1px;
}

/* アプリ全体：左＝コントロール、右＝プレビュー */
.courier-simulator .app {
  width: 100%; max-width: 520px; margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 8px 4px;
}

/* ━━━ 左：コントロールカラム ━━━ */
.courier-simulator .ctrl-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ━━━ 右：プレビューカラム ━━━ */
.courier-simulator .preview-col {
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* 前／後ろ タグ（SVGの上下） */
.courier-simulator .dir-tag-v {
  width: 100%;
  text-align: center;
  padding: 5px 4px;
  border-radius: 6px;
  background: #333; color: #fff;
  font-size: 10px; font-weight: 500;
  line-height: 1.2;
}
.courier-simulator .dir-tag-v small {
  display: block; font-size: 8px; color: #aaa; font-weight: 400; margin-top: 2px;
}

.courier-simulator .strap-wrap {
  width: 100%;
}
.courier-simulator .strap-wrap svg {
  width: 100%; height: auto; display: block;
}

/* 共通ラベル */
.courier-simulator .box-label {
  font-size: 10px; color: #888;
  letter-spacing: .08em; font-weight: 500; text-transform: uppercase;
}

/* ━━━ ゾーンボタン ━━━ */
.courier-simulator .courier-zones {
  display: flex; flex-direction: column; gap: 4px;
}
.courier-simulator .courier-zone-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px;
  border: 1.5px solid #ddd; border-radius: 7px;
  background: #fff; cursor: pointer;
  font-size: 11px; color: #444; font-weight: 400;
  text-align: left;
}
.courier-simulator .courier-zone-btn.active {
  border-color: #222; background: #222; color: #fff; font-weight: 500;
}
.courier-simulator .zone-dot {
  width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.15);
}

/* 前後分離トグル */
.courier-simulator .courier-split-toggle {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px;
  border: 1px dashed #bbb; border-radius: 6px;
  background: transparent; cursor: pointer;
  font-size: 10px; color: #888;
  margin-top: 2px;
}
.courier-simulator .courier-split-toggle.active {
  border-color: #555; color: #333; font-weight: 500;
}
.courier-simulator .toggle-icon {
  font-size: 13px; line-height: 1;
}

/* ━━━ 長さセレクター ━━━ */
.courier-simulator .courier-lengths {
  display: flex; flex-direction: column; gap: 3px;
}
.courier-simulator .length-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 6px 9px;
  border: 1.5px solid #ddd; border-radius: 7px;
  background: #fff; cursor: pointer; text-align: left;
  width: 100%;
}
.courier-simulator .length-btn.active {
  border-color: #222; background: #222;
}
.courier-simulator .length-btn.active .len-label { color: #fff; }
.courier-simulator .length-btn.active .len-desc  { color: #aaa; }
.courier-simulator .len-label {
  font-size: 11px; font-weight: 600; color: #333; margin-bottom: 1px;
}
.courier-simulator .len-desc {
  font-size: 9.5px; color: #888;
}
.courier-simulator .price-adj {
  color: #c44; font-weight: 600;
}
.courier-simulator .length-btn.active .price-adj { color: #f88; }

/* ━━━ カラーパレット ━━━ */
.courier-simulator .belt-note {
  font-size: 9.5px; color: #888;
  background: #fff7e6; border-radius: 5px; padding: 4px 6px; line-height: 1.4;
}
.courier-simulator .pal-box {
  background: #fff; border-radius: 7px; padding: 7px;
}
.courier-simulator .palette {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.courier-simulator .courier-swatch {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid rgba(0,0,0,.12);
  transition: transform .1s;
}
.courier-simulator .courier-swatch:hover { transform: scale(1.15); }
.courier-simulator .courier-swatch.selected {
  border: 2.5px solid #111;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111;
}

/* ━━━ サマリー ━━━ */
.courier-simulator .sum-box {
  background: #fff; border-radius: 7px; padding: 7px;
}
.courier-simulator .summary-row {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 0; font-size: 10.5px;
}
.courier-simulator .summary-label {
  color: #888; font-size: 9.5px; min-width: 0; flex: 1;
}
.courier-simulator .summary-dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12); flex-shrink: 0;
}
.courier-simulator .summary-name {
  color: #333; font-weight: 500; font-size: 10.5px;
}

/* ━━━ シェア・ボタンバー ━━━ */
.courier-simulator .share-area {
  display: flex; justify-content: center; padding: 6px 10px 0;
}
.courier-simulator .sbtn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; border: 1px solid #bbb; border-radius: 20px;
  background: #fff; color: #555; font-size: 11px; cursor: pointer;
}
.courier-simulator .bottom-bar {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px 0;
}
.courier-simulator .btn-reset {
  padding: 9px 10px; border: 1px solid #ccc; border-radius: 7px;
  background: #fff; color: #666; font-size: 11px; cursor: pointer; white-space: nowrap;
}
.courier-simulator .btn-undo {
  display: flex; align-items: center; gap: 3px;
  padding: 9px 10px; border: 1px solid #ccc; border-radius: 7px;
  background: #fff; color: #666; font-size: 11px; cursor: pointer; white-space: nowrap;
}
.courier-simulator .btn-undo:disabled { opacity: .4; cursor: default; }
.courier-simulator .btn-order {
  flex: 1; padding: 10px 10px; background: #111; color: #fff;
  border: none; border-radius: 7px; font-size: 11px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.courier-simulator .price-display {
  font-size: 10px; font-weight: 400; color: #aaa; margin-top: 2px;
}

/* ━━━ モーダル ━━━ */
.courier-simulator .modal {
  display: none; position: fixed; top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,.6); z-index: 9999; justify-content: center; align-items: center;
}
.courier-simulator .modal.show { display: flex; }
.courier-simulator .modal-content {
  background: #fff; border-radius: 12px; width: 90%; max-width: 380px;
  max-height: 90vh; overflow-y: auto; padding: 20px;
}
.courier-simulator .modal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.courier-simulator .modal-header h2 { font-size: 14px; font-weight: 600; margin: 0; }
.courier-simulator .modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer; color: #888;
}
.courier-simulator .modal-image { width: 60%; display: block; margin: 0 auto 12px; border-radius: 6px; }
.courier-simulator .modal-info  { font-size: 12px; color: #444; margin-bottom: 12px; }
.courier-simulator .modal-color-list { margin: 6px 0; }
.courier-simulator .modal-color-row {
  display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 11px;
}
.courier-simulator .modal-zone-label { color: #888; min-width: 90px; font-size: 10px; }
.courier-simulator .modal-color-dot {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12); flex-shrink: 0;
}
.courier-simulator .modal-buttons { display: flex; gap: 7px; }
.courier-simulator .modal-btn {
  flex: 1; padding: 10px; border-radius: 7px; font-size: 12px; cursor: pointer; border: none;
}
.courier-simulator .modal-btn-secondary { background: #f0f0f0; color: #555; }
.courier-simulator .modal-btn-primary   { background: #111; color: #fff; font-weight: 600; }

/* ━━━ ローディング ━━━ */
.courier-simulator .loading-overlay {
  display: none; position: fixed; top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,.5); z-index: 9999; justify-content: center; align-items: center;
}
.courier-simulator .loading-overlay.show { display: flex; }
.courier-simulator .loading-content {
  background: #fff; border-radius: 12px; padding: 24px 32px; text-align: center;
}
.courier-simulator .loading-spinner {
  width: 32px; height: 32px; border: 3px solid #eee; border-top-color: #333;
  border-radius: 50%; animation: cspin .8s linear infinite; margin: 0 auto 10px;
}
@keyframes cspin { to { transform: rotate(360deg); } }

/* ━━━ Toast ━━━ */
.courier-simulator .toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111; color: #fff; padding: 9px 18px;
  border-radius: 20px; font-size: 12px; opacity: 0;
  transition: all .3s; z-index: 10000; pointer-events: none;
}
.courier-simulator .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes c-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.courier-simulator .c-shake { animation: c-shake .45s ease; }
