/* =====================================================
   サイトメーカー：操作画面の見た目
   - ラタトスク本体（/assets/site.css の v4）の色・書体・線・ボタンをそのまま使う
   - 照柿（--kaki-deep）は「相談してみる」ボタン専用。作業のボタンは深緑
   - カードを並べすぎない。区切りは線と余白で作る
   ===================================================== */

.sm-top { padding-bottom: clamp(24px, 4vw, 40px); }
.sm-top .v4-lead { max-width: 44em; }
.sm-top .v4-note a { color: var(--green-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.sm-app { padding: 0 0 clamp(56px, 8vw, 96px); }
.sm-app-in { max-width: 1400px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }

/* ---------- 手順の表示 ---------- */
.sm-steps { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 4px 2px 18px; margin-bottom: 8px; scrollbar-width: thin; list-style: none; }
.sm-steps li { flex: 1 0 auto; min-width: 88px; position: relative; }
.sm-steps li:not(:last-child)::after { content: ""; position: absolute; top: 17px; left: calc(50% + 22px); right: calc(-50% + 22px); height: 2px; background: var(--line-2); }
.sm-steps li.is-done:not(:last-child)::after { background: var(--green); }
.sm-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%;
  padding: 0 4px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink-2);
}
.sm-step-n {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line-2); background: var(--paper); font-family: var(--font-num); font-weight: 700; font-size: 15px; color: var(--ink-2);
  transition: background .2s, border-color .2s, color .2s;
}
.sm-step-l { font-size: 12.5px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.sm-steps li.is-done .sm-step-n { border-color: var(--green); color: var(--green); }
.sm-steps li.is-current .sm-step-n { background: var(--green); border-color: var(--green); color: #fff; }
.sm-steps li.is-current .sm-step-l { color: var(--green-deep); }
.sm-step:hover .sm-step-n { border-color: var(--green); }
.sm-step:focus-visible { outline: 2px solid var(--kaki-deep); outline-offset: 2px; border-radius: 8px; }

/* ---------- 左：入力 ／ 右：プレビュー ---------- */
.sm-layout { display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); gap: 24px; align-items: start; }

.sm-panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: clamp(20px, 2.4vw, 28px); }
.sm-panel-n { font-family: var(--font-num); font-size: 13px; font-weight: 700; color: var(--green); letter-spacing: .08em; }
.sm-panel h2 { font-family: var(--font-head); font-weight: 900; font-size: clamp(21px, 2.2vw, 25px); line-height: 1.45; margin: 4px 0 8px; word-break: auto-phrase; }
.sm-panel-lead { font-size: 14.5px; color: var(--ink-2); line-height: 1.9; margin-bottom: 20px; }
.sm-panel h3 { font-size: 15.5px; font-weight: 700; margin: 28px 0 12px; }
.sm-panel h3:first-child { margin-top: 0; }

.sm-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.sm-nav .sm-btn { flex: 1; }

/* ---------- 入力欄（本体の相談フォームと同じ形） ---------- */
.sm-field { margin-bottom: 18px; }
.sm-field > label, .sm-field > .sm-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.sm-field .sm-req { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--green); border-radius: 4px; padding: 1px 6px; }
.sm-hint { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-2); line-height: 1.7; }
.sm-field input[type="text"], .sm-field input[type="url"], .sm-field input[type="tel"], .sm-field textarea, .sm-field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 16px; line-height: 1.7; background: var(--paper); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.sm-field textarea { min-height: 88px; resize: vertical; overflow: hidden; }
.sm-field input:focus, .sm-field textarea:focus, .sm-field select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(14, 90, 69, .14); background: var(--white); }
.sm-field .is-invalid { border-color: #B3261E; }
.sm-count { font-size: 12px; color: var(--ink-2); text-align: right; margin-top: 4px; font-family: var(--font-num); }
.sm-count.is-over { color: #B3261E; font-weight: 700; }
.sm-error { font-size: 13px; color: #B3261E; margin-top: 6px; line-height: 1.7; }
.sm-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 480px) { .sm-row { grid-template-columns: 1fr; } }

/* ---------- 開閉できるまとまり（文章の手順） ---------- */
.sm-group { border-top: 1px solid var(--line-2); }
.sm-group:last-of-type { border-bottom: 1px solid var(--line-2); }
.sm-group > summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 56px; padding: 14px 2px; font-weight: 700; font-size: 15.5px;
}
.sm-group > summary::-webkit-details-marker { display: none; }
.sm-group > summary::after {
  content: "+"; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2);
  display: grid; place-items: center; color: var(--ink-2); font-weight: 400; transition: transform .25s, background .25s, color .25s;
}
.sm-group[open] > summary::after { transform: rotate(45deg); background: var(--green); border-color: var(--green); color: #fff; }
.sm-group > summary:focus-visible { outline: 2px solid var(--kaki-deep); outline-offset: 2px; }
.sm-group-body { padding: 4px 0 20px; }
.sm-group-off { font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--paper-2); border-radius: 999px; padding: 1px 10px; margin-left: auto; }

/* ---------- 繰り返しの項目（メニュー・質問・スタッフ） ---------- */
.sm-items { list-style: none; counter-reset: item; }
.sm-item { counter-increment: item; padding: 18px 0; border-top: 1px dashed var(--line-2); }
.sm-item:first-child { border-top: 0; padding-top: 4px; }
.sm-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sm-item-head::before { content: counter(item); width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--green); color: var(--green); font-family: var(--font-num); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }
.sm-item-title { font-weight: 700; font-size: 14.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-mini { min-width: 44px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--white); font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.sm-mini:hover { border-color: var(--green); color: var(--green-deep); }
.sm-mini:disabled { opacity: .35; cursor: default; }
.sm-mini.is-danger:hover { border-color: #B3261E; color: #B3261E; }
.sm-mini:focus-visible { outline: 2px solid var(--kaki-deep); outline-offset: 2px; }
.sm-add { margin-top: 8px; }

/* ---------- ボタン（作業用は深緑。照柿は使わない） ---------- */
.sm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 26px;
  border: 0; border-radius: 999px; background: var(--green); color: #fff; font: inherit; font-size: 15.5px; font-weight: 700; line-height: 1.4;
  cursor: pointer; text-decoration: none; transition: transform .2s ease, background .2s;
}
.sm-btn:hover { background: var(--green-deep); transform: translateY(-1px); }
.sm-btn:disabled { background: var(--line-2); cursor: default; transform: none; }
.sm-btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px 24px;
  border: 2px solid var(--green); border-radius: 999px; background: var(--white); color: var(--green-deep);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .2s, color .2s;
}
.sm-btn-line:hover { background: var(--green); color: #fff; }
.sm-btn:focus-visible, .sm-btn-line:focus-visible, .sm-link:focus-visible { outline: 2px solid var(--kaki-deep); outline-offset: 3px; }
.sm-link { border: 0; background: none; padding: 8px 0; font: inherit; font-size: 14px; font-weight: 700; color: var(--green-deep); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.sm-link.is-quiet { color: var(--ink-2); font-weight: 400; }

/* ---------- 選ぶ（業種・デザイン・色・書体） ---------- */
.sm-choices { display: grid; gap: 10px; }
.sm-choice { position: relative; display: block; }
.sm-choice input { position: absolute; opacity: 0; pointer-events: none; }
.sm-choice-box {
  display: block; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.sm-choice-box strong { display: block; font-size: 16px; }
.sm-choice-box span { display: block; font-size: 13px; color: var(--ink-2); line-height: 1.75; margin-top: 2px; }
.sm-choice input:checked + .sm-choice-box { border: 2px solid var(--green); background: var(--green-wash); padding: 15.5px 17.5px; }
.sm-choice input:focus-visible + .sm-choice-box { outline: 2px solid var(--kaki-deep); outline-offset: 2px; }
.sm-choice input:disabled + .sm-choice-box { cursor: default; opacity: .6; background: var(--paper-2); }
.sm-soon { display: inline-block !important; font-size: 11.5px !important; font-weight: 700; color: var(--ink-2) !important; background: var(--white); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 8px; margin: 0 0 0 6px !important; vertical-align: 2px; }

.sm-design-thumb { position: relative; margin: -2px -4px 12px; height: 148px; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: var(--white); }
.sm-design-thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; }

.sm-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sm-swatch { position: relative; }
.sm-swatch input { position: absolute; opacity: 0; }
.sm-swatch span { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 6px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); font-size: 13.5px; cursor: pointer; }
.sm-swatch i { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.sm-swatch input:checked + span { border: 2px solid var(--green); background: var(--green-wash); font-weight: 700; }
.sm-swatch input:focus-visible + span { outline: 2px solid var(--kaki-deep); outline-offset: 2px; }

/* ---------- 写真 ---------- */
.sm-photo { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 0; border-top: 1px dashed var(--line-2); }
.sm-photo:first-of-type { border-top: 0; }
.sm-photo-img { width: 120px; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--paper-2) center / cover no-repeat; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--ink-2); text-align: center; line-height: 1.5; }
.sm-photo-name { font-weight: 700; font-size: 14.5px; }
.sm-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sm-upload { position: relative; overflow: hidden; }
.sm-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.sm-upload:focus-within { outline: 2px solid var(--kaki-deep); outline-offset: 2px; }
.sm-lib { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sm-lib button { width: 72px; aspect-ratio: 4 / 3; border-radius: 6px; border: 2px solid transparent; background: center / cover no-repeat; cursor: pointer; padding: 0; }
.sm-lib button[aria-pressed="true"] { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-wash); }
.sm-lib button:focus-visible { outline: 2px solid var(--kaki-deep); outline-offset: 2px; }
.sm-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.sm-gallery figure { margin: 0; }
.sm-gallery .sm-photo-img { width: 100%; aspect-ratio: 4 / 5; }
.sm-gallery input { width: 100%; margin-top: 6px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; background: var(--paper); }

/* ---------- 注意・確認 ---------- */
.sm-notice { padding: 14px 16px; border-radius: 10px; background: var(--paper-2); font-size: 13.5px; line-height: 1.85; color: var(--ink); margin: 0 0 18px; }
.sm-notice strong { color: var(--green-deep); }
.sm-notice.is-warn { background: #FBEFE6; }
.sm-notice.is-warn strong { color: var(--kaki-deep); }
.sm-checks { list-style: none; border-top: 1px solid var(--line-2); }
.sm-checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; line-height: 1.75; }
.sm-checks li::before { content: "!"; width: 22px; height: 22px; border-radius: 50%; background: var(--kaki-wash); color: var(--kaki-deep); font-weight: 700; font-size: 13px; display: grid; place-items: center; margin-top: 2px; }
.sm-checks li.is-ok::before { content: ""; background: var(--green-wash) var(--check) center / 14px no-repeat; }
.sm-checks .sm-link { padding: 0; font-size: 13px; white-space: nowrap; }

/* ---------- 右：プレビュー ---------- */
.sm-preview { position: sticky; top: 84px; display: flex; flex-direction: column; height: calc(100vh - 104px); min-height: 520px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sm-pv-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.sm-tabs { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.sm-tab { min-height: 36px; padding: 4px 16px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.sm-tab[aria-selected="true"] { background: var(--white); color: var(--green-deep); box-shadow: var(--shadow-sm); }
.sm-tab:focus-visible { outline: 2px solid var(--kaki-deep); outline-offset: 2px; }
.sm-saved { margin-left: auto; font-size: 12px; color: var(--ink-2); }
.sm-pv-close { display: none; }
.sm-stage { position: relative; flex: 1; overflow: hidden; }
.sm-stage iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; }
.sm-stage.is-sp { background: var(--paper-2); }
.sm-stage.is-sp iframe { border-radius: 18px; box-shadow: 0 0 0 8px var(--ink), 0 20px 40px -20px rgba(33,30,26,.5); }

.sm-pv-open { display: none; }

/* ---------- 完成 ---------- */
.sm-done-h { font-family: var(--font-head); font-weight: 900; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.45; margin: 4px 0 10px; }
.sm-done-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0 28px; }
.sm-done-actions .sm-btn-line { min-height: 46px; padding: 8px 10px; font-size: 13.5px; }
.sm-dl { padding: 22px 0; border-top: 1px solid var(--line-2); }
.sm-dl h3 { margin: 0 0 6px !important; font-size: 17px !important; }
.sm-dl p { font-size: 14px; color: var(--ink-2); line-height: 1.9; }
.sm-dl .sm-btn { width: 100%; margin-top: 14px; }
.sm-agree { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 14px; line-height: 1.7; cursor: pointer; }
.sm-agree input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex-shrink: 0; }
.sm-dl-files { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; font-family: var(--font-num); }
.sm-license { margin: 8px 0 0; }
.sm-license .v4-tag { padding: 44px 22px 26px; }
.sm-license .v4-plan-price { margin: 12px 0 14px; }
.sm-license .sm-btn { width: 100%; }
.sm-license-note { font-size: 13px; color: var(--ink-2); line-height: 1.85; margin-top: 12px; }
.sm-care { margin-top: 24px; padding: 20px; border: 2px solid var(--green); border-radius: 12px; background: var(--paper); }
.sm-care h3 { margin: 0 0 6px !important; }
.sm-care p { font-size: 14px; color: var(--ink-2); line-height: 1.9; }
.sm-care .v4-btn { width: 100%; margin-top: 14px; }

.sm-toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 20px); opacity: 0; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 700; transition: opacity .25s, transform .25s; pointer-events: none; }
.sm-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.sm-toast.is-error { background: #B3261E; color: #fff; }

/* ---------- 下の説明 ---------- */
.sm-about .v4-acc { margin: 0 auto; }

/* ---------- スマホ・タブレット：プレビューは全画面で開く ---------- */
@media (max-width: 1000px) {
  .sm-layout { grid-template-columns: 1fr; }
  .sm-preview { position: fixed; inset: 0; z-index: 150; height: auto; min-height: 0; border-radius: 0; border: 0; display: none; }
  .sm-preview.is-open { display: flex; }
  .sm-pv-close { display: inline-flex; min-height: 40px; padding: 4px 16px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--white); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
  .sm-saved { display: none; }
  .sm-pv-open {
    display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 120;
    align-items: center; gap: 8px; min-height: 52px; padding: 12px 22px; border: 0; border-radius: 999px;
    background: var(--green); color: #fff; font: inherit; font-weight: 700; font-size: 15px; box-shadow: 0 12px 28px -12px rgba(10,66,50,.7); cursor: pointer;
  }
  .sm-app { padding-bottom: 96px; }
}
@media (max-width: 560px) {
  .sm-done-actions { grid-template-columns: 1fr 1fr; }
  .sm-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-photo { grid-template-columns: 96px minmax(0, 1fr); }
  .sm-photo-img { width: 96px; }
}
