/* プレビューの素材一覧専用。共通の外観は変更しません。 */
.sample-notice { padding: 14px 18px; margin-bottom: 20px; border-radius: 12px; background:#f5f0f8; color:#604b70; line-height:1.7; }
.sample-intro { color:#625c68; line-height:1.8; }
.sample-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin:24px 0; }
.sample-item { margin:0; padding:12px; border:1px solid #e9e0ed; border-radius:14px; background:#fff; }
.sample-placeholder { aspect-ratio:1; display:flex; align-items:center; justify-content:center; border-radius:10px; background:#f3f0f4; color:#827a86; font-size:0.95rem; }
.sample-item figcaption { margin-top:10px; color:#514557; font-weight:600; }
.sample-item small { display:block; color:#776d7b; margin-top:4px; }
.sample-custom { margin-top:28px; padding-top:20px; border-top:1px solid #eee7f1; }
.sample-options { display:flex; flex-wrap:wrap; gap:10px; margin:16px 0; }
.sample-options span { border:1px solid #e5d9e9; border-radius:20px; padding:7px 13px; color:#75667a; background:#fbf9fc; }
.sample-button { padding:12px 22px; border:0; border-radius:10px; color:#777; background:#e9e5eb; cursor:not-allowed; font:inherit; }
@media(max-width:650px) { .sample-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; } }

.sample-item img { display:block; width:100%; aspect-ratio:1; object-fit:contain; border-radius:10px; background:#fff; }
.sample-item .btn { display:inline-flex; margin-top:10px; text-decoration:none; font-size:.9rem; padding:10px 15px; }
.sample-terms { margin-top:28px; }

/* Gallery layout: preserve the card style while fitting every screen. */
.sample-grid { display:flex; flex-wrap:wrap; justify-content:center; }
.sample-grid > .sample-item { box-sizing:border-box; width:calc((100% - 40px) / 3); min-width:0; }
.sample-item img { height:auto; aspect-ratio:auto; }
.sample-item .btn { max-width:100%; box-sizing:border-box; justify-content:center; white-space:nowrap; }
@media(max-width:650px) {
  .sample-grid > .sample-item { width:calc((100% - 12px) / 2); padding:8px; }
  .sample-item .btn { font-size:clamp(10px, 2.9vw, 14px); padding:9px 5px; letter-spacing:0; }
}

/* Background editor; scoped to this tool. */
.chat-editor { margin: 20px 0 32px; padding: 22px; border: 1px solid #e9e0ed; border-radius: 16px; background: #fbf9fc; }
.chat-editor__layout { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 24px; align-items: start; }
.chat-editor__preview { position: relative; overflow: hidden; width: 100%; aspect-ratio: 9 / 16; max-height: 500px; border-radius: 14px; background: #eee8f2; }
#ce-canvas { display: block; width: 100%; height: 100%; object-fit: contain; touch-action: none; cursor: grab; }
#ce-canvas:focus-visible { outline: 3px solid #75608b; outline-offset: -3px; }
.chat-editor__messages { position: absolute; inset: 16% 8% auto; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; pointer-events: none; }
.chat-editor__bubble { padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.8); color: #34283b; font-size: .85rem; }
.chat-editor__messages--light .chat-editor__bubble { background: rgba(52,40,59,.75); color: #fff; }
.chat-editor__placeholder { position: absolute; inset: 45% 8% auto; text-align: center; color: #625c68; pointer-events: none; }
.chat-editor__preview:not(.chat-editor__has-image) .chat-editor__messages, .chat-editor__has-image .chat-editor__placeholder { display: none; }
.chat-editor__controls { display: grid; gap: 12px; min-width: 0; }
.chat-editor__field { display: grid; gap: 5px; min-width: 0; font-weight: 600; }
.chat-editor__field input, .chat-editor__field select { max-width: 100%; box-sizing: border-box; font: inherit; }
.chat-editor__field select { padding: 8px; border: 1px solid #d7c9df; border-radius: 8px; background: #fff; }
.chat-editor__check { display: flex; align-items: center; gap: 8px; }
.chat-editor__hint { margin: 0; font-size: .9rem; }
.chat-editor__controls button { justify-self: start; }
#ce-status:empty { display: none; }
@media(max-width:650px) { .chat-editor { padding: 14px; } .chat-editor__layout { grid-template-columns: 1fr; } .chat-editor__preview { max-width: 240px; margin: auto; } }
.chat-editor input[type="range"], .chat-editor input[type="checkbox"] { accent-color: #9478ae; }
.chat-editor input[type="file"]::file-selector-button { padding: 8px 12px; border: 1px solid #d7c9df; border-radius: 9px; background: #fff; color: #604b70; font: inherit; cursor: pointer; }
.chat-editor input[type="file"]::file-selector-button { margin-right: 8px; }
#ce-download:disabled { opacity: .48; cursor: not-allowed; }
@media(min-width: 651px) {
  .chat-editor__layout { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
  .chat-editor__preview { max-height: none; }
}
.sample-item .chat-gallery-edit { display: inline-flex; margin-top: 10px; max-width: 100%; box-sizing: border-box; justify-content: center; font-size: .9rem; padding: 10px 15px; }
@media(max-width:650px) { .sample-item .chat-gallery-edit { font-size: clamp(10px, 2.9vw, 14px); padding: 9px 5px; } }
