@charset "UTF-8";

/* =========================================
 * Reset & Variables (Healthcare Soft UI)
 * ========================================= */

body {
  margin: 0; padding: 0;
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDGothic", "Rounded Mplus 1c", "Quicksand", sans-serif;
  background-color: #f2fbf7; /* Very light mint */
  color: #4a5568;
  line-height: 1.7;
}
:root {
  --primary: #2eb67d; /* Soft Green */
  --primary-dark: #208f6c;
  --secondary: #e6f7ef;
  --bg-main: #f2fbf7;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #4a5568;
  --text-muted: #a0aec0;
  --shadow: 0 10px 30px rgba(46,182,125,0.08);
}

/* =========================================
 * Header
 * ========================================= */
.app-header {
  background: #fff;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { font-size: 20px; font-weight: bold; color: var(--primary-dark); display: flex; align-items: baseline; gap: 10px; }
.logo span { font-size: 12px; color: var(--text-muted); font-weight: normal; }

/* =========================================
 * Layout
 * ========================================= */
.app {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* =========================================
 * Top Panel (Variant & Progress)
 * ========================================= */
.top-panel { margin-bottom: 30px; }

.variant { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.variant__btn { background: #fff; border: 2px solid var(--secondary); color: var(--text-muted); padding: 10px 20px; border-radius: 30px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.variant__btn.is-active { background: var(--secondary); border-color: var(--primary); color: var(--primary-dark); }

.progress { display: flex; justify-content: space-between; background: #fff; padding: 15px; border-radius: 20px; box-shadow: var(--shadow); }
.progress__step { flex: 1; text-align: center; font-size: 13px; color: var(--text-muted); font-weight: bold; position: relative; }
.progress__step::after { content: ''; position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); width: 0; height: 3px; background: var(--primary); transition: 0.3s; border-radius: 3px; }
.progress__step.is-active { color: var(--primary-dark); }
.progress__step.is-active::after { width: 50%; }

/* =========================================
 * Main Card Form
 * ========================================= */
.step { display: none; animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.step.is-active { display: block; }
@keyframes pop { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: none; } }

.card { background: var(--card-bg); border-radius: 24px; padding: 40px; box-shadow: var(--shadow); }
.step__title { font-size: 22px; color: var(--primary-dark); margin-bottom: 30px; text-align: center; }

/* Fields */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

.field label { font-size: 13px; font-weight: bold; color: var(--text); }
.field input, .field select, .field textarea {
  background: #f7fafc; border: 2px solid transparent; padding: 14px; border-radius: 12px; font-size: 15px; font-family: inherit; color: var(--text); transition: 0.3s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px var(--secondary); }

/* Buttons inside form */
.btn, .ai-btn, .photo__btn, .addrow, .edu-autocalc-btn {
  background: var(--secondary); border: none; color: var(--primary-dark); padding: 12px 20px; border-radius: 12px; cursor: pointer; font-weight: bold; transition: 0.2s; font-size: 14px; text-align: center;
}
.btn:hover, .ai-btn:hover, .addrow:hover { background: var(--primary); color: #fff; }

.subhead--toggle { color: var(--primary); font-weight: bold; text-align: center; margin-top: 20px; cursor: pointer; padding: 10px; border-radius: 12px; background: #fff; border: 2px dashed var(--secondary); }
.collapse { display: none; padding-top: 20px; }

/* Dynamic Rows */
.items { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.item { background: #f7fafc; padding: 25px; border-radius: 16px; position: relative; border: 2px solid transparent; }
.item:hover { border-color: var(--secondary); }
.item__del { position: absolute; top: 15px; right: 15px; background: #fff; border: none; color: #e53e3e; font-size: 12px; font-weight: bold; padding: 6px 12px; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Baito specific */

.days { display: flex; gap: 8px; justify-content: center; }
.day { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f7fafc; color: var(--text-muted); cursor: pointer; font-weight: bold; }
.day.is-on { background: var(--primary); color: #fff; }

/* Navigation */
.nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.nav__btns { display: flex; gap: 15px; width: 100%; justify-content: center; }
.btn--prev { background: #fff; border: 2px solid var(--border); color: var(--text-muted); border-radius: 30px; padding: 15px 30px; flex: 1; max-width: 200px; }
.btn--prev.is-hidden { display: none; }
.btn--next { background: var(--primary); color: #fff; border-radius: 30px; padding: 15px 30px; flex: 2; box-shadow: 0 4px 15px rgba(46,182,125,0.3); font-size: 16px; }
.btn--preview { background: var(--primary-dark); color: #fff; border-radius: 30px; padding: 15px 30px; flex: 2; font-size: 16px; }
.saved { display: none; color: var(--primary); position: absolute; top: 20px; right: 20px; background: #fff; padding: 5px 15px; border-radius: 20px; box-shadow: var(--shadow); font-size: 12px; font-weight: bold; }

/* Preview */
.preview-panel { margin-top: 60px; padding-top: 40px; border-top: 2px dashed var(--border); }
.paper { background: #fff; width: 100%; aspect-ratio: 1/1.414; border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); }
.data-clear__btn { background: none; border: none; color: #e53e3e; text-decoration: underline; cursor: pointer; }

/* Footer — グリーン帯（ロゴと同じ --primary-dark）。本番 footer.php の構成を踏襲。 */
.sfoot { background: var(--primary-dark); color: #fff; margin-top: 60px; padding: 36px 20px; }
.sfoot__wrap { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.sfoot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.sfoot__links a { color: #fff; text-decoration: none; font-size: 14px; font-weight: bold; opacity: 0.92; }
.sfoot__links a:hover { opacity: 1; text-decoration: underline; }
.sfoot__copy { font-size: 12px; color: rgba(255, 255, 255, 0.78); }

/* =========================================
 * Modals (JS required overrides)
 * ========================================= */

.authm, .pmodal, .modal, .edu-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.authm__backdrop, .pmodal__backdrop, .modal__backdrop { position: absolute; inset: 0; background: rgba(242,251,247,0.9); }
.authm__box, .pmodal__box, .modal__box, .edu-modal__box { background: #fff; border-radius: 24px; padding: 40px; width: 90%; max-width: 450px; box-shadow: 0 20px 50px rgba(0,0,0,0.1); position: relative; }
.authm__x, .pmodal__x, .modal__close, .edu-modal__x { position: absolute; top: 20px; right: 20px; background: #f7fafc; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }

#authSubmit { width: 100%; background: var(--primary); color: #fff; padding: 15px; border: none; border-radius: 12px; font-weight: bold; margin-top: 20px; cursor: pointer; font-size: 16px; }
#authMsg { color: #e53e3e; font-size: 13px; margin: 10px 0; }
#authMsg.is-ok { color: var(--primary-dark); }
.authbar a { color: var(--primary-dark); font-weight: bold; text-decoration: none; }

/* SEO Content */
.seo-content { margin-top: 40px; padding: 40px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.03); text-align: left; height: 320px; overflow-y: auto; }
.seo-content h2 { font-size: 22px; color: var(--primary); border-bottom: 2px solid #e6fffa; padding-bottom: 15px; margin-bottom: 25px; font-weight: bold; }
.seo-content h3 { font-size: 18px; color: var(--primary-dark); margin-top: 30px; margin-bottom: 15px; }
.seo-content p { color: var(--text); margin-bottom: 20px; line-height: 1.8; font-size: 15px; }
.seo-content dl { margin-top: 30px; padding-top: 20px; border-top: 2px dashed #e6fffa; }
.seo-content dt { font-weight: bold; margin-bottom: 8px; color: var(--primary); margin-top: 20px; }
.seo-content dd { margin-bottom: 20px; margin-left: 0; padding-left: 20px; border-left: 3px solid #b2f5ea; background: #f8ffff; padding: 15px; border-radius: 0 8px 8px 0; color: var(--text); line-height: 1.8; font-size: 15px; }

/* =========================================
 * §3 共通スイープ修正（01基準 → Healthcare Soft UIテーマへ翻案）
 * 構造・機能は共通、配色は04のトークン（--primary:#2eb67d / --secondary ミント / error:#e53e3e）に差替。
 * ソフト調＝角丸大・pill・box-shadow。すべてCSSのみ・インラインstyle不追加。
 * ========================================= */

/* §3-1 AI志望動機モーダル(#modal)はエンジンが .is-open で開く（hidden属性は外さない）。 */

/* §3-3 モーダル内ボタン — UA既定を解消。副＝ミント地、主＝グリーン塗り、破壊的＝赤枠。
 * ※.data-clear__btn / .item__del は04では既にテーマ化済のため対象外。 */
.pm-btn,
#pmCropRetry, #pmCropConfirm,
.modal__foot button,
.edu-modal__apply, .edu-modal__cancel,
#mpLogout {
  background: var(--secondary);
  border: none;
  color: var(--primary-dark);
  padding: 12px 22px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  font-family: inherit;
  transition: background-color .2s, color .2s;
}
.pm-btn:hover,
#pmCropRetry:hover,
.modal__foot button[data-close]:hover,
.edu-modal__cancel:hover,
#mpLogout:hover { background: var(--primary); color: #fff; }

/* 一次ボタン（グリーン塗り・白字）＝主要アクション。04の .btn--next / #authSubmit と同調。 */
.pm-btn--prim,
#pmCropConfirm,
#modalAction,
.edu-modal__apply {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pm-btn--prim:hover,
#pmCropConfirm:hover,
#modalAction:hover,
.edu-modal__apply:hover { background: var(--primary-dark); }

/* 破壊的アクション（退会）＝赤で明示 */
#mpDelete {
  background: #fff;
  border: 2px solid #e53e3e;
  color: #e53e3e;
  padding: 11px 22px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  font-family: inherit;
  transition: background-color .2s, color .2s;
}
#mpDelete:hover { background: #e53e3e; color: #fff; }

/* 汎用モーダルのヘッダー ×（閉じる）＝枠なしの控えめクローズ */
.modal__head button[data-close] {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.modal__head button[data-close]:hover { color: var(--primary-dark); }

/* §3-2 学歴自動計算モーダルの select/number 整形＋レイアウト整頓（04のフィールド体裁に合わせる） */
.edu-modal__box h3 { font-size: 18px; color: var(--primary-dark); margin-bottom: 18px; text-align: center; }
.edu-modal__box > label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--text); font-weight: bold; }

.edu-modal__box select,
.edu-modal__box input[type="number"] {
  background: #f7fafc;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
}

.edu-modal__box select:focus,
.edu-modal__box input[type="number"]:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--secondary);
}

.edu-sub-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--text); }

.edu-sub-row input[type="number"] { width: 76px; }
.edu-sub-hint { color: var(--text-muted); font-size: 12px; }

/* §3-9 「自動入力」ボタンが直下の学歴入力枠と密着していたので余白を確保 */
.edu-autocalc-btn { display: inline-block; margin-bottom: 20px; }

/* §3-8 削除ボタン（絶対配置pill）が入力欄に重なる → 上部帯を確保 */
.item { padding-top: 46px; }

/* §3-6 ヘッダーのログイン/新規登録リンク（本番は auth.js が状態で上書き） */
.authbar { display: flex; gap: 12px; align-items: center; }
.authbar__btn { background: var(--secondary); border: none; color: var(--primary-dark); padding: 7px 16px; border-radius: 20px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: bold; }
.authbar__btn:hover { background: var(--primary); color: #fff; }
/* 「新規登録」「ログイン」は文字を折らない（狭い画面で2〜3行に割れていた） */
.authbar a, .authbar__btn { white-space: nowrap; }

/* 狭い画面のヘッダー：1行に押し込むとロゴもボタンも文字が折れるため、
 * 説明文はロゴの下へ落とし、入りきらない場合は認証リンクを次の行（右寄せ）へ回す。
 * ※ .app-header / .logo / .authbar の定義より後に置くこと（先だと同詳細度で負ける）。 */
@media (max-width: 600px) {
  .app-header { flex-wrap: wrap; gap: 6px 12px; padding: 12px 16px; }
  .logo { font-size: 18px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .authbar { margin-left: auto; gap: 10px; }
}

/* §3-4/§3-5 認証モーダルの中身（本物文言・04の配色）＋作成/スキップ同幅 */
.authm__title { font-size: 20px; font-weight: bold; color: var(--primary-dark); text-align: center; margin: 0 0 6px; }
.authm__lead { font-size: 12.5px; color: var(--text-muted); text-align: center; margin: 0 0 20px; line-height: 1.7; }
.authm__box .field { margin-bottom: 14px; }
.authm__box .field label { display: block; font-size: 13px; font-weight: bold; color: var(--text); margin-bottom: 4px; }
.authm__consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.6; color: var(--text); margin: 6px 0 16px; }

.authm__consent a { color: var(--primary-dark); font-weight: bold; }
.authm__optin { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); margin: 10px 0 4px; cursor: pointer; }
.authm__optin-desc { font-size: 13px; color: var(--primary-dark); font-weight: bold; line-height: 1.6; text-align: center; margin: 2px 0 8px; }
.authm__note { font-size: 11px; color: var(--text-muted); line-height: 1.7; margin: 0 0 16px; }
.authm__forgot { text-align: right; font-size: 12px; margin: -6px 0 14px; }
.authm__forgot a { color: var(--primary-dark); font-weight: bold; text-decoration: none; }
.authm__forgot a:hover { text-decoration: underline; }
.authm__forgot-lead { font-size: 12px; color: var(--text-muted); line-height: 1.7; margin: 0 0 16px; }
.authm__switch { text-align: center; font-size: 12.5px; color: var(--text-muted); margin-top: 20px; line-height: 1.9; }
.authm__switch a { color: var(--primary-dark); font-weight: bold; text-decoration: none; }
.authm__switch a:hover { text-decoration: underline; }
/* 送信＝全幅の主ボタン／スキップ＝同じ全幅の副ボタンで余白を確保 */
.authm__skip { display: block; width: 100%; margin-top: 12px; background: #fff; border: 2px solid var(--border); color: var(--text-muted); padding: 14px; border-radius: 12px; font-size: 14px; font-weight: bold; cursor: pointer; font-family: inherit; }
.authm__skip:hover { border-color: var(--primary); color: var(--primary-dark); }

/* §3-10 プログレス完了ステップ ＝ グリーン（本テーマはグリーンがブランド色。保留グレー→完了グリーン→現在ダークグリーン）。
 * ※theme_sweep の looksGreen はこのテーマでは正常にtrue（緑=ブランド）。 */
.progress__step.is-done { color: var(--primary); }
.progress__step.is-done::after { width: 40%; background: var(--primary); opacity: 0.45; }

/* =========================================
 * 職務経歴書対応（履歴書⇄職務経歴書トグル）
 * data-doc（#app）× data-only で書類別UIをCSS切替（エンジン app.js v29 契約）
 * ========================================= */
[data-doc="resume"] [data-only="career"] { display: none !important; }
[data-doc="career"] [data-only="resume"] { display: none !important; }

/* 書類切替トグル（top-panel・やさしいグリーン） */
.doctoggle { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.doctoggle__label { font-size: 14px; font-weight: bold; color: #999; cursor: pointer; white-space: nowrap; transition: color .15s; }
.doctoggle__label.is-active { color: var(--primary-dark); }
.doctoggle__sw { width: 48px; height: 26px; border-radius: 999px; background: #fff; border: 2px solid var(--primary); position: relative; cursor: pointer; padding: 0; }
.doctoggle__knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); transition: transform .2s; }
[data-doc="career"] .doctoggle__knob { transform: translateX(22px); }

/* ステップ内リード文（やさしい説明） */
.step__lead { font-size: 13px; color: #789; text-align: center; margin: -20px 0 25px; line-height: 1.8; }

/* 文例ボタン（.ai-btn と同基調） */
.example-btn { background: #fff; border: 2px solid var(--primary); color: var(--primary-dark); padding: 10px 18px; border-radius: 999px; cursor: pointer; font-weight: bold; font-size: 13px; font-family: inherit; margin-top: 8px; transition: 0.2s; }
.example-btn:hover { background: var(--primary); color: #fff; }

/* 例文データ（#jobSamples）＝モーダルのデータ源。視覚的に非表示（SEOテキストとして残置） */
.seo-samples { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* 例文モーダル（エンジンは .is-open で開閉・hidden属性は使わない） */
.modal--ex { display: none; }
.modal--ex.is-open { display: flex !important; }
.modal--ex .modal__box { max-width: 560px; }
.modal--ex .modal__head { display: flex; justify-content: space-between; align-items: center; font-weight: bold; font-size: 17px; color: var(--primary-dark); margin-bottom: 14px; padding-right: 24px; }
.exsel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 10px; }
@media (max-width: 520px) { .exsel { grid-template-columns: 1fr; } }
.excard { display: grid; grid-template-columns: auto minmax(0,1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px; row-gap: 6px; }
.excard__arrow { grid-row: 1; border: 2px solid var(--secondary); background: #fff; color: var(--primary-dark); width: 36px; height: 72px; border-radius: 14px; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.excard__arrow:hover:not(:disabled) { border-color: var(--primary); }
.excard__arrow:disabled { opacity: .3; cursor: default; }
.excard__main { grid-column: 2; grid-row: 1; min-width: 0; }
.excard__label { font-size: 12px; font-weight: bold; color: var(--primary-dark); margin-bottom: 6px; min-height: 15px; }
.excard__text { background: #f6fbf8; border: 2px solid var(--secondary); border-radius: 14px; padding: 14px 16px; font-size: 13.5px; line-height: 1.9; color: #333; white-space: pre-wrap; word-break: break-word; height: 300px; overflow-y: auto; }
.excard__count { grid-column: 1 / -1; grid-row: 2; text-align: center; font-size: 12.5px; font-weight: bold; color: #999; }
.excard__empty { display: block; color: #999; font-size: 13px; text-align: center; padding: 52px 12px; }
.exconfirm { font-size: 12.5px; font-weight: bold; color: #e53e3e; margin-right: auto; align-self: center; line-height: 1.5; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal--ex .modal__foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
#exBtnApply { background: var(--primary); border-color: var(--primary); color: #fff; }
#exBtnApply:hover { background: var(--primary-dark); }
#exBtnOverwrite { border-color: #e53e3e; color: #e53e3e; }
#exBtnOverwrite:hover { background: #e53e3e; color: #fff; }

/* mpModal本物化: mpm__* (Rirekisy parity) */

.mpm__logout{background:none;border:0;color:var(--text-muted);text-decoration:underline;cursor:pointer;font-size:13px;font-family:inherit;}
.mpm__email{font-size:12.5px;color:var(--text-muted);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

.mpm__item{border:1px solid var(--border);border-radius:10px;padding:12px 14px;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;}

.mpm__type{display:inline-block;font-weight:700;font-size:11.5px;color:var(--primary);border:1px solid var(--primary);border-radius:999px;padding:1px 9px;margin-bottom:4px;}
.mpm__fmt{font-weight:700;color:var(--text);font-size:13.5px;}
.mpm__date{font-size:12px;color:var(--text-muted);margin-top:2px;}
.mpm__btn{display:inline-block;padding:8px 14px;border-radius:9px;font-size:13px;font-weight:700;text-decoration:none;cursor:pointer;font-family:inherit;border:1px solid var(--border);background:var(--card-bg);color:var(--text);transition:border-color .15s,filter .15s;}
.mpm__btn:hover{border-color:var(--primary);}
.mpm__btn--dl{background:var(--primary);color:#fff;border-color:var(--primary);}
.mpm__btn--edit{background:var(--primary);color:#fff;border-color:var(--primary);}
.mpm__btn--dl:hover{filter:brightness(1.03);}
.mpm__empty{font-size:13.5px;color:var(--text-muted);line-height:1.8;}
.mpm__empty a{color:var(--primary-dark);font-weight:700;}

.mpm__new{display:inline-block;font-size:13px;color:var(--primary-dark);font-weight:700;text-decoration:none;}

.mpm__foot{margin-top:20px;padding-top:14px;border-top:1px solid var(--border);text-align:right;}
.mpm__delete{background:none;border:0;color:var(--text-muted);font-size:12px;cursor:pointer;font-family:inherit;text-decoration:underline;padding:0;}
.mpm__delete:hover{color:#d05a5a;}
.mpm__delete:disabled{opacity:.6;cursor:default;}

/* =========================================
 * 証明写真モーダル（レイアウト）
 * 本体 rirekisy.jp と同一のクラス契約。囲み（.pm-choose/.pm-canvas-wrap/
 * .pm-actions/.pm-preview/.pm-compare）ごとに並びを決める。これが無いと
 * canvas と同じ行にボタンが流れ込み、「選び直す」が写真の右へ回り込む。
 * ========================================= */
.pm-sec[hidden] { display: none; }
.pmodal__box { max-height: calc(100vh - 36px); overflow-y: auto; }
.pmodal__title { font-size: 17px; font-weight: 800; color: var(--text); text-align: center; margin: 0 0 4px; }
.pmodal__lead { font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.7; margin: 0 0 16px; }

.pm-choose { display: flex; flex-direction: column; gap: 10px; }

.pm-canvas-wrap { display: flex; justify-content: center; margin: 4px 0 14px; }
#pmCanvas { width: 270px; height: 360px; max-width: 100%; touch-action: none; cursor: grab; }

.pm-actions { display: flex; gap: 10px; margin-top: 4px; }
.pm-actions .pm-btn { flex: 1; width: auto; }
.pm-actions--col { flex-direction: column; }
.pm-actions--col .pm-btn { width: 100%; }

.pm-preview { display: flex; justify-content: center; margin-bottom: 14px; }
.pm-preview img { width: 180px; height: 240px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); }

.pm-gender { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; font-size: 13px; color: var(--text); }
.pm-gender__label { font-weight: 700; font-size: 12px; color: var(--text-muted); }
.pm-gender label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

.pm-note { font-size: 11px; color: var(--text-muted); line-height: 1.7; margin: 12px 0 0; text-align: left; }

.pm-loading { text-align: center; padding: 30px 0; color: var(--text-muted); font-size: 13px; line-height: 1.8; }
.pm-spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 16px; animation: pmspin .9s linear infinite; }
@keyframes pmspin { to { transform: rotate(360deg); } }

.pm-compare { display: flex; gap: 12px; margin-bottom: 16px; }
.pm-compare .pm-pick { flex: 1; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; background: #fff; border: 2px solid var(--border); border-radius: 14px; cursor: pointer; font-family: inherit; }
.pm-compare .pm-pick img { width: 100%; max-width: none; aspect-ratio: 3/4; object-fit: cover; border-radius: 14px; display: block; }
.pm-compare .pm-pick span { font-size: 12.5px; font-weight: 700; color: var(--text); }
.pm-compare .pm-pick.is-active { border-color: var(--primary); }

.pm-btn--ai { background:var(--primary);color:#fff;border-color:var(--primary); }
.pm-btn--ghost { background: none; border: none; color: var(--text-muted); text-decoration: underline; font-size: 12.5px; padding: 6px; box-shadow: none; }

/* 狭い画面でも canvas(270x360) を縮めない。photo.js はドラッグ量を canvas の
 * 実ピクセルとして扱うため、CSSで縮小すると操作量と表示がずれ、3:4も崩れる。
 * そこでキャンバスではなくモーダル側の幅・余白で270pxを確保する。 */
@media (max-width: 460px) {
  .pmodal__box { width: calc(100% - 16px); padding-left: 14px; padding-right: 14px; }
}
