/* 漫画記事LPメーカー（app.css は診断LPメーカー・計測ナビと共通） */
:root { --c: #e8452c; --c-d: #c7361f; --c-l: #fdece8; }
.tag--ok { background: #e3f6ee; color: #0d7a5a; }
.tag--warn { background: #fff4d6; color: #8a5a00; }
.cardhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cardhead p { margin: 4px 0 0; max-width: 760px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; gap: 10px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.actions.sticky { position: sticky; bottom: 0; background: rgba(246,247,249,.94); padding: 10px 0; z-index: 5; }
.row2, .row3, .row4 { display: grid; gap: 12px; }
.row2 { grid-template-columns: 1fr 1fr; } .row3 { grid-template-columns: repeat(3, 1fr); } .row4 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 760px) { .row2, .row3, .row4 { grid-template-columns: 1fr; } }
.grow { flex: 1; }
.pre { white-space: pre-wrap; max-height: 360px; overflow: auto; background: #f7f8fa; padding: 12px; border-radius: 8px; font-size: .82rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; background: var(--sw); vertical-align: -3px; margin: 0 3px 0 6px; border: 1px solid rgba(0,0,0,.15); }
.card.danger { border-color: #f3d2d2; }
.card.is-ok { border-color: #bfe8d8; }
.dl { display: grid; grid-template-columns: 6em 1fr; gap: 4px 12px; font-size: .92rem; margin: 10px 0; }
.dl dt { color: var(--sub); }
.dl dd { margin: 0; }

/* 案件の一覧 */
.pj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.pj-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); text-decoration: none; transition: box-shadow .15s; }
.pj-card:hover { box-shadow: 0 6px 22px rgba(0,0,0,.08); }
.pj-card__thumb { aspect-ratio: 3/4; background: #f3f4f6; overflow: hidden; }
.pj-card__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pj-card__thumb img.is-style { opacity: .45; }
.pj-card__body { padding: 12px 14px; display: grid; gap: 2px; }

/* 絵柄の選択 */
.styles { border: 0; padding: 0; margin: 0; }
.styles legend { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.style-opt { position: relative; display: block !important; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; font-weight: normal !important; }
.style-opt input { position: absolute; opacity: 0; }
.style-opt img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.style-opt span { display: grid; padding: 6px 8px; font-size: .82rem; line-height: 1.4; }
.style-opt small { color: var(--sub); font-size: .72rem; }
.style-opt:has(input:checked) { border-color: var(--c); box-shadow: 0 0 0 3px var(--c-l); }

/* 手順のタブ */
.stepnav { display: flex; gap: 4px; margin: 0 0 16px; overflow-x: auto; padding-bottom: 4px; }
.stepnav a { display: flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 12px; border-radius: 10px; color: var(--sub); text-decoration: none; font-size: .88rem; font-weight: 700; background: #fff; border: 1px solid var(--line); }
.stepnav a i { font-style: normal; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #eef0f3; font-size: .75rem; }
.stepnav a.is-done i { background: var(--c-l); color: var(--c-d); }
.stepnav a.is-on { background: var(--c); color: #fff; border-color: var(--c); }
.stepnav a.is-on i { background: rgba(255,255,255,.25); color: #fff; }
.stepnav em { font-style: normal; }

/* AI を待っている間 */
.ai-status { position: sticky; top: 8px; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(0,0,0,.08); font-weight: 700; }
.ai-status.is-busy { border-color: #f6c7bd; }
.ai-status.is-ok { background: #e7f7f0; border-color: #bfe8d8; color: #0d6b4f; }
.ai-status.is-error { background: #fdecec; border-color: #f5c6c6; color: #9b2222; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--c-l); border-top-color: var(--c); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 表 */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.tbl th { font-size: .78rem; color: var(--sub); }
.tbl input, .tbl select { width: 100%; }
.tbl--story td:nth-child(3) { width: 60%; }
.tpl-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.tpl-list li { display: flex; gap: 10px; align-items: flex-start; }
.tpl-list img { width: 56px; border: 1px solid var(--line); border-radius: 4px; flex: none; }

/* 登場人物 */
.castrow { display: grid; grid-template-columns: 7em 9em 1fr 2fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.castrow--loc { grid-template-columns: 9em 1fr auto; }
@media (max-width: 900px) { .castrow, .castrow--loc { grid-template-columns: 1fr; } }

/* 台本 */
.page-card__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.tplmini { width: 34px; margin-left: auto; border: 1px solid var(--line); border-radius: 3px; }
.panel-row { display: grid; grid-template-columns: 5.5em 1fr; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.panel-row__no { font-weight: 700; font-size: .85rem; display: grid; }
.panel-row__no small { color: var(--sub); font-weight: normal; font-size: .72rem; }
.panel-row p { margin: 0 0 6px; }
.bubble-row { display: grid; grid-template-columns: 7em 7em 1fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.bubble-row .cnt.over { color: var(--err); font-weight: 700; }
@media (max-width: 760px) { .bubble-row { grid-template-columns: 1fr 1fr; } .bubble-row .bubble-text { grid-column: 1 / -1; } }

/* キャラ・ページ */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 14px; }
.char-card { display: grid; gap: 4px; align-content: start; }
.char-card img, .char-card .ph { width: 100%; aspect-ratio: 2/3; object-fit: contain; background: #f6f7f9; border: 1px solid var(--line); border-radius: 8px; }
.ph { display: grid; place-items: center; color: var(--sub); font-size: .85rem; background: #f6f7f9; border: 1px dashed var(--line); border-radius: 8px; aspect-ratio: 3/4; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.page-thumb img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; display: block; }
.page-thumb.is-old img { outline: 3px solid #f3dfa2; }
.page-thumb__foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* 文字の組み直し */
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.pager a { display: grid; place-items: center; min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; font-size: .85rem; background: #fff; }
.pager a.is-done { background: #e3f6ee; border-color: #bfe8d8; }
.pager a.is-on { background: var(--c); color: #fff; border-color: var(--c); }
.retype__tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.retype__main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .retype__main { grid-template-columns: 1fr; } }
.retype__stage { position: relative; max-width: 640px; }
.retype__stage canvas { width: 100%; height: auto; display: block; border: 1px solid var(--line); }
.retype__boxes { position: absolute; inset: 0; }
.rt-box { position: absolute; border: 2px solid rgba(232,69,44,.9); background: rgba(232,69,44,.06); border-radius: 40%; cursor: move; touch-action: none; }
.rt-box.is-manual { border-style: dashed; }
.rt-box span { position: absolute; top: -10px; left: -10px; background: var(--c); color: #fff; font-weight: 700; font-size: .72rem; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.rt-box i { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; background: #fff; border: 2px solid var(--c); border-radius: 3px; cursor: nwse-resize; touch-action: none; }
.retype__list { display: grid; gap: 10px; max-height: 80vh; overflow: auto; }
.rt-item { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.rt-item b { background: var(--c); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; }
.rt-item small { color: var(--sub); }
.rt-item textarea, .rt-item label, .rt-item button { grid-column: 1 / -1; }

/* 記事LP */
.art-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .art-layout { grid-template-columns: 1fr; } }
.art-side { position: sticky; top: 10px; }
.preview { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.art-block { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; display: grid; gap: 10px; }
.art-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.hdthumb { max-width: 260px; border-radius: 8px; border: 1px solid var(--line); }
.chip--btn small { font-size: .7rem; }
