/* 4ツール（ファンプロフィール・キャラ紹介・お品書き・痛バ）の画面操作。PCとタッチの両方に対応する。 */
[data-ep-tool]{--ep-nav-height:72px;--ep-control:#c93a22;overflow-wrap:anywhere}
[data-ep-tool] header{padding-top:14px;padding-bottom:10px}
[data-ep-tool] header h1,[data-ep-tool] .intro h1{font-size:clamp(24px,2.6vw,32px);line-height:1.4;margin:8px 0}
[data-ep-tool] header p,[data-ep-tool] .intro p{margin-top:8px;margin-bottom:8px}
[data-ep-tool] .intro{margin-bottom:12px}
[data-ep-tool] .ep-draft-bar{display:flex;align-items:center;flex-wrap:wrap;gap:2px 14px;margin-top:6px;padding:8px 14px}
[data-ep-tool] .ep-draft-details{margin:0}
[data-ep-tool] .ep-draft-details summary{min-height:44px;display:flex;align-items:center;text-decoration:underline;text-underline-offset:3px}
[data-ep-tool] .ep-draft-details[open]{flex-basis:100%}
[data-ep-tool] .ep-draft-hint{margin:8px 0}
[data-ep-tool] .tabs,[data-ep-tool] .mobile-actions,[data-ep-tool] .mobile-switch{display:none!important}
[data-ep-tool] button,[data-ep-tool] .file,[data-ep-tool] summary{min-height:44px}
[data-ep-tool] button{min-width:44px;white-space:normal}
[data-ep-tool] .file{display:inline-flex;align-items:center;justify-content:center}
[data-ep-tool] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]),[data-ep-tool] select,[data-ep-tool] textarea{font-size:16px;min-height:44px;max-width:100%}
[data-ep-tool] input[type="color"]{height:44px;min-width:60px}
[data-ep-tool] input[type="checkbox"]{width:20px;height:20px;flex:none}
[data-ep-tool] label:has(>input[type="checkbox"]){display:flex;gap:8px;align-items:center;min-height:44px;font-weight:500}
[data-ep-tool] :focus-visible{outline:3px solid #c93a22;outline-offset:3px}
[data-ep-tool] input,[data-ep-tool] select,[data-ep-tool] textarea,[data-ep-tool] summary{scroll-margin-top:100px;scroll-margin-bottom:100px}
.ep-workspace-nav{position:sticky;top:8px;z-index:20;display:flex;align-items:center;gap:8px 16px;max-width:1160px;margin:8px auto 0;padding:10px 16px;border:1px solid #e8e3dd;border-radius:12px;background:#fff;box-shadow:0 3px 14px #1f1d1b08;font:14px/1.5 system-ui,-apple-system,"Hiragino Sans",sans-serif}
.ep-workspace-title{margin-right:auto;font-size:14px}
.ep-workspace-nav button,.ep-mobile-bar button,.ep-panel-actions button{font:inherit;border-radius:9px;padding:10px 16px;border:1px solid #c93a22;background:white;color:#c93a22;cursor:pointer;margin:0;line-height:1.35}
.ep-workspace-nav .ep-save-image,.ep-mobile-bar .ep-save-image,.ep-panel-actions .ep-save-image{background:#c93a22;color:white;font-weight:700;min-width:140px}
/* 無効のボタンは4ツール共通。薄くせず、ベージュ寄りの灰の面に文字を読める濃さで置く（枠・影なし）。理由の文字は別に出る。 */
html body[data-ep-tool] button:disabled,[data-ep-tool] .ep-workspace-nav button:disabled,[data-ep-tool] .ep-mobile-bar button:disabled,[data-ep-tool] .ep-panel-actions button:disabled{opacity:1;background:#E6E0D7;color:#5f5852;border-color:transparent;box-shadow:none;cursor:not-allowed}
html[data-theme="dark"] body[data-ep-tool] button:disabled,html[data-theme="dark"] [data-ep-tool] .ep-mobile-bar button:disabled,html[data-theme="dark"] [data-ep-tool] .ep-panel-actions button:disabled{background:#2C2832;color:#B5AEA6}
/* 共有は保存の隣の副操作。主操作（画像を保存）より弱く、枠だけで見せる */
.ep-panel-actions .ep-share-image,.ep-mobile-bar .ep-share-image{min-width:88px}
/* 自動保存の状態文は、失敗したときだけ画面に残す。成功・復元はトーストで出る */
[data-ep-tool] .ep-draft-bar:not(.ep-draft-error) .ep-draft-status{display:none}
/* 空のときの案内は、プレビューの外に1行だけ */
.ep-empty-note{margin:10px 0 0;font-size:14px;color:#66615c}
.ep-empty-note[hidden]{display:none}
.ep-workspace-feedback{font-size:13px;line-height:1.5;color:#5b5651;margin:0;max-width:25ch}
.ep-workspace-feedback:empty{display:none}
.ep-panel-head{display:contents}
.ep-panel-actions{display:none}
.ep-workspace-nav .ep-fix-input,.ep-panel-actions .ep-fix-input{font-size:12px;padding:8px 10px}
.ep-view-tabs{display:none}
.ep-mobile-bar{display:none}
.ep-mini-preview{display:none}
[data-ep-tool] .ep-workspace-grid{align-items:start;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr)}
[data-ep-tool] [data-ep-panel]{min-width:0}
[data-ep-tool] .ep-preview-scroll{width:100%;max-height:calc(100dvh - 260px);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;border-radius:10px;background:#fff}
[data-ep-tool] .ep-preview-scroll canvas{display:block;width:100%;height:auto;max-width:100%}
@media(min-width:701px){
  [data-ep-tool] [data-ep-panel]{display:block!important}
  /* PCは操作バーを置かない。保存は完成イメージの見出し行へ移してある。入力は左40%、完成イメージは右60%で、入力を進めても右が見え続ける。 */
  .ep-workspace-nav{display:none}
  [data-ep-tool] [data-ep-panel="preview"]{position:sticky;top:16px;max-height:calc(100dvh - 32px);overflow:auto;scrollbar-gutter:auto}
  [data-ep-tool] .ep-panel-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;position:sticky;top:0;z-index:2;min-height:44px;margin:0 0 12px;background:inherit}
  [data-ep-tool] .ep-panel-head>h2,[data-ep-tool] .ep-panel-head>h3{margin:0;min-width:0}
  .ep-panel-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px 10px;margin-left:auto}
  .ep-panel-actions .ep-workspace-feedback{text-align:right;max-width:32ch}
  .ep-panel-actions button{min-height:44px}
  [data-ep-tool] .ep-preview-scroll{min-height:160px;max-height:calc(100dvh - 190px);scrollbar-gutter:auto}
  [data-ep-tool] .ep-workspace-grid{padding-top:14px;grid-template-columns:minmax(0,2fr) minmax(0,3fr)}
}
@media(max-width:899px) and (min-width:701px){
  [data-ep-tool] .ep-workspace-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}
}
@media(max-width:1100px) and (min-width:701px){
  [data-ep-tool] header,[data-ep-tool] main{padding-left:16px;padding-right:16px}
  [data-ep-tool] .ep-workspace-grid{gap:14px}
  [data-ep-tool] [data-ep-panel]{padding:16px}
  .ep-workspace-nav{margin-left:16px;margin-right:16px}
}
@media(max-width:700px){
  [data-ep-tool]{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  [data-ep-tool] header{padding:12px 16px 8px}
  [data-ep-tool] header h1,[data-ep-tool] .intro h1{font-size:24px}
  [data-ep-tool] header p,[data-ep-tool] .intro p{font-size:14px}
  [data-ep-tool] .ep-draft-bar{margin:6px 16px 8px;padding:5px 12px;gap:0 12px}
  [data-ep-tool] .ep-draft-status{font-size:12px}
  [data-ep-tool] .ep-workspace-grid{display:block;padding-top:12px;padding-bottom:12px}
  [data-ep-tool] .ep-workspace-grid>[data-ep-panel]{padding:16px}
  [data-ep-tool][data-ep-view="input"] [data-ep-panel="preview"],[data-ep-tool][data-ep-view="preview"] [data-ep-panel="input"]{display:none!important}
  [data-ep-tool][data-ep-view="input"] [data-ep-panel="input"],[data-ep-tool][data-ep-view="preview"] [data-ep-panel="preview"]{display:block!important}
  .ep-workspace-nav{top:0;margin:0 12px;padding:7px;gap:6px;border-radius:10px;flex-wrap:wrap}
  .ep-workspace-title{display:none}
  [data-ep-tool][data-ep-view="input"] .ep-mini-preview:not([hidden]){position:relative;display:flex;align-items:center;justify-content:center;width:100%;margin:0;padding:6px;border:1px solid #e8e3dd;border-radius:9px;background:#f6f3ef;cursor:zoom-in}
  .ep-mini-preview canvas{display:block;border-radius:6px;box-shadow:0 2px 8px #1f1d1b14}
  .ep-mini-hint{position:absolute;right:8px;bottom:8px;padding:3px 9px;border-radius:99px;background:#1f1d1bcc;color:#fff;font-size:11px;font-weight:700}
  .ep-view-tabs{display:flex;width:100%;gap:6px}
  .ep-view-tabs button{flex:1;min-width:0;border-color:#e8e3dd;color:#66615c;padding:10px 8px}
  .ep-view-tabs button[aria-pressed="true"]{background:#1f1d1b;border-color:#1f1d1b;color:white;font-weight:700}
  /* 保存できない理由と「未入力の項目へ」は入力欄の先頭に出し、下部バーは1行に保つ */
  .ep-bar-status{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 12px;padding:8px 12px;border:1px solid #e8e3dd;border-radius:10px;background:#faf7f3}
  .ep-bar-status[hidden]{display:none}
  .ep-bar-status .ep-workspace-feedback{flex:1;min-width:0;max-width:none;padding:0 2px}
  .ep-bar-status .ep-fix-input{flex:none;min-height:44px;padding:6px 12px;border:1px solid #c93a22;border-radius:8px;background:#fff;color:#c93a22;font-size:13px;font-weight:700}
  .ep-bar-buttons{display:flex;gap:8px}
  .ep-mobile-bar{position:fixed;bottom:0;left:0;right:0;z-index:30;display:flex;flex-direction:column;gap:0;padding:8px 10px calc(8px + env(safe-area-inset-bottom));border-top:1px solid #e8e3dd;background:#fff;box-shadow:0 -4px 20px #1f1d1b08;font:14px/1.35 system-ui,-apple-system,"Hiragino Sans",sans-serif}
  .ep-bar-buttons>button{flex:1;min-width:0;min-height:44px;padding:8px 10px;white-space:nowrap}
  .ep-mobile-bar .ep-save-image{min-width:0}
  .ep-bar-buttons>.ep-share-image{flex:0 0 auto;min-width:64px;padding:8px 12px}
  .ep-toast,.ep-undo-toast{bottom:calc(76px + env(safe-area-inset-bottom,0px));width:max-content}
  [data-ep-tool] .ep-preview-scroll{max-height:none;overflow:visible;scrollbar-gutter:auto}
  [data-ep-tool] [data-ep-panel="preview"]{position:static;max-height:none;overflow:visible}
  [data-ep-tool].ep-keyboard-open .ep-mobile-bar{display:none}
  [data-ep-tool] .item{min-width:0}
  [data-ep-tool] .item>span{min-width:0;overflow-wrap:anywhere}
}
/* 共有ダイアログ（ガチャ系の result-actions.css と同じ見た目） */
.ep-action-dialog{box-sizing:border-box;position:fixed;inset:0;width:min(320px,calc(100vw - 32px));max-height:80dvh;height:max-content;margin:auto;padding:16px;border:1px solid #ddd4ce;border-radius:18px;background:#fff;color:#292c32;box-shadow:0 20px 80px #211b1926}
.ep-action-dialog::backdrop{background:#211b1938}
.ep-action-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.ep-action-dialog .ep-action-heading h2{font:700 17px/1.5 system-ui,sans-serif;margin:0}
.ep-action-dialog .ep-icon-button{box-sizing:border-box;display:inline-grid;place-items:center;flex:none;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border:1px solid transparent;border-radius:10px;background:transparent;color:#554d49;cursor:pointer}
.ep-action-dialog .ep-icon-button svg{display:block;width:21px;height:21px;pointer-events:none}
.ep-share-choices{display:grid;gap:8px}
.ep-action-dialog .ep-share-choices button{min-height:48px;border:1px solid #e6ded8;border-radius:10px;background:#faf8f5;color:#332d29;font:600 15px/1.5 system-ui,sans-serif;padding:10px 14px;text-align:left;cursor:pointer}
.ep-action-dialog .ep-share-choices label{display:block;font:600 14px/1.6 system-ui,sans-serif}
.ep-action-dialog .ep-share-choices textarea{box-sizing:border-box;display:block;width:100%;margin-top:8px;padding:10px;font:400 16px/1.6 system-ui,sans-serif}
.ep-action-dialog :focus-visible{outline:3px solid #302b2d;outline-offset:2px}
/* 「新しく作る」の後に出す、元に戻せるトースト */
.ep-undo-toast{position:fixed;left:50%;bottom:32px;z-index:60;box-sizing:border-box;display:flex;align-items:center;gap:4px 12px;max-width:min(92vw,460px);padding:6px 6px 6px 16px;border-radius:12px;background:#1f1d1b;color:#fff;font:14px/1.6 system-ui,-apple-system,"Hiragino Sans",sans-serif;transform:translateX(-50%)}
.ep-undo-toast[hidden]{display:none}
@media(max-width:700px){.ep-undo-toast{bottom:calc(136px + env(safe-area-inset-bottom,0px));width:max-content}}
.ep-undo-toast button{flex:none;min-height:44px;min-width:44px;padding:0 14px;border:0;border-radius:9px;background:transparent;color:#fff;font:inherit;font-weight:700;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.ep-undo-toast button:focus-visible{outline:3px solid #fff;outline-offset:-3px}
@media print{
  .ep-workspace-nav,.ep-mobile-bar,.ep-panel-actions,.ep-undo-toast,.ep-action-dialog{display:none!important}
  [data-ep-tool]{padding:0}
  [data-ep-tool] [data-ep-panel="preview"]{display:block!important;position:static;max-height:none;overflow:visible}
  [data-ep-tool] [data-ep-panel="input"]{display:none!important}
  [data-ep-tool] .ep-preview-scroll{max-height:none;overflow:visible}
}
@media(prefers-reduced-motion:reduce){[data-ep-tool]{scroll-behavior:auto}}
