
*{box-sizing:border-box}
body{margin:0;font-family:"Hiragino Sans","Yu Gothic UI",Meiryo,sans-serif;font-size:14px;line-height:1.6;color:#1f2430;background:#f4f5f8}
a{color:#3056c9;text-decoration:none}a:hover{text-decoration:underline}
header{background:#232a3b;color:#fff;padding:0 20px;display:flex;align-items:center;gap:18px;flex-wrap:wrap;min-height:48px}
header .brand{font-weight:700;margin-right:8px}
header a{color:#cfd6ea}header .sp{flex:1}
header form{margin:0}header button{background:none;border:0;color:#cfd6ea;cursor:pointer;font:inherit;padding:0}
main{max-width:1040px;margin:0 auto;padding:20px}
h1{font-size:20px;margin:4px 0 16px}h2{font-size:16px;margin:26px 0 10px;padding-bottom:4px;border-bottom:2px solid #dfe3ee}
.card{background:#fff;border:1px solid #e1e4ec;border-radius:8px;padding:16px;margin-bottom:14px}
table{width:100%;border-collapse:collapse;background:#fff;border:1px solid #e1e4ec;border-radius:8px}
th,td{text-align:left;padding:8px 10px;border-bottom:1px solid #eceef4;vertical-align:top}
th{background:#f0f2f8;font-weight:600;white-space:nowrap}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
label{display:block;font-weight:600;margin:12px 0 4px}
.hint{font-weight:400;color:#6a7286;font-size:12px;display:block}
input[type=text],input[type=password],input[type=number],select,textarea{width:100%;padding:7px 9px;border:1px solid #c5cad8;border-radius:6px;font:inherit;background:#fff}
textarea{min-height:110px;font-family:Consolas,"Yu Gothic UI",monospace;font-size:13px}
textarea.tall{min-height:320px}
input[type=number]{max-width:140px}
.row{display:flex;gap:16px;flex-wrap:wrap}.row>div{flex:1;min-width:150px}
.check{font-weight:400;display:flex;gap:6px;align-items:center;margin:8px 0}
button,.btn{background:#3056c9;color:#fff;border:0;border-radius:6px;padding:8px 16px;font:inherit;cursor:pointer;display:inline-block}
button.sub,.btn.sub{background:#e6e9f2;color:#1f2430}button.warn,.btn.warn{background:#c0392b;color:#fff}
.actions{margin-top:18px;display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.tag{display:inline-block;padding:1px 8px;border-radius:10px;font-size:12px;background:#e6e9f2}
.tag.on{background:#d9f2e3;color:#176b3a}.tag.off{background:#f5dede;color:#8e2a20}.tag.paid{background:#fff0c9;color:#7a5600}
.msg{padding:10px 14px;border-radius:6px;margin-bottom:14px;background:#e3efff;border:1px solid #b9d2f5}
.msg.err{background:#fde8e6;border-color:#f0b9b3}
.msg.warn{background:#fff6dc;border-color:#f0dc9a}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-bottom:14px}.tile{background:#fff;border:1px solid #e1e4ec;border-radius:8px;padding:10px 12px}.tile .tl{font-size:12px;color:#5d6578}.tile .tv{font-size:22px;font-weight:700;font-variant-numeric:tabular-nums}.tile .ts{font-size:12px;color:#5d6578}
.dash-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:12px;align-items:start}.dash-grid .card{margin:0}.dash-grid table{min-width:0}
ul.alerts{list-style:none;padding:0;margin:0}ul.alerts li{border-left:4px solid #e8cf7a;background:#fff6dc;padding:8px 12px;border-radius:6px;margin:6px 0}ul.alerts li.danger{border-color:#e08a80;background:#fde8e6}
details.draftbox,details.emoji{margin:6px 0 10px}details.draftbox>summary,details.emoji>summary{cursor:pointer;color:#2457c5}
.emoji-row{display:flex;flex-wrap:wrap;align-items:center;gap:2px;margin:4px 0}.emoji-row .hint{display:inline-block;width:7.5em;margin:0}
.emoji-btn{background:none;border:1px solid transparent;border-radius:6px;padding:2px 4px;font-size:20px;line-height:1.2;cursor:pointer;color:inherit}.emoji-btn:hover{background:#eef2fb;border-color:#d5dcec}
code{background:#eef0f6;padding:2px 6px;border-radius:4px;word-break:break-all}
/* 縦方向を逆順に並べると、開いたときに一番下（最新の会話）までスクロールされた状態になる。中身は1つの箱にまとめてあるので、表示順は変わらない */
.talk{background:#8fa7c9;border-radius:8px;padding:14px;max-height:62vh;overflow-y:auto;display:flex;flex-direction:column-reverse}
.b{display:flex;margin:8px 0}.b .in{max-width:76%}
.b .tx{padding:8px 12px;border-radius:14px;background:#fff;white-space:pre-wrap;word-break:break-word}
.b .mt{font-size:11px;color:#f3f6fb;margin:2px 4px}
.b.user{justify-content:flex-start}
.b.ai,.b.staff,.b.system{justify-content:flex-end}.b.ai .mt,.b.staff .mt,.b.system .mt{text-align:right}
.b.ai .tx{background:#9be27d}.b.staff .tx{background:#ffd98a}.b.system .tx{background:#dfe4ee;color:#444}
.b.noctx .tx{opacity:.75}
.b .tx.gone{background:#eef0f6;color:#6a7286;font-size:12px}
.imgdel{font-size:11px;color:#f3f6fb;margin:2px 4px}.imgdel summary{cursor:pointer}.imgdel button{font-size:12px;padding:3px 10px;margin-top:4px}
pre.prompt{white-space:pre-wrap;word-break:break-word;background:#f7f8fb;border:1px solid #eceef4;border-radius:6px;padding:10px 12px;margin:8px 0 0;font:13px/1.6 "Hiragino Sans","Yu Gothic UI",Meiryo,sans-serif}
details.card>summary{cursor:pointer}
.b.summary{justify-content:center}.b.summary .in{max-width:90%}.b.summary .tx{background:#fff7d6;color:#4a3f00;font-size:13px}
/* 売上・コストの集計 */
.cards{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:6px}.cards a.card{flex:1;min-width:170px;color:inherit;margin-bottom:0}
.cards a.card:hover{border-color:#3056c9;text-decoration:none}.big{font-size:22px;font-weight:700}
.tabs{display:flex;gap:6px;margin-bottom:6px}.tabs a{padding:5px 14px;border-radius:16px;background:#e6e9f2;color:#1f2430}
.tabs a.cur{background:#3056c9;color:#fff}
.crumbs{display:flex;flex-wrap:wrap;gap:4px;align-items:center}.crumbs .pn{margin-left:auto;display:flex;gap:14px}
.scroll{overflow-x:auto}.scroll table{min-width:640px}
th.grp{text-align:center}td.zero{color:#b5bac8}td.minus{color:#c0392b}
tr.sum td{font-weight:700;background:#f7f8fb}
/* 表記・規約のページ */
.legal h2{font-size:15px;margin:22px 0 6px;padding-bottom:2px;border-bottom:1px solid #dfe3ee}.legal h2:first-child{margin-top:0}
.legal p{margin:6px 0}.legal ul{margin:6px 0;padding-left:1.4em}
/* キャラクターの設定画面（2026-10-20）：左に目次、右に折りたたみのカード、下に固定の保存の帯 */
main:has(.settings){max-width:1240px;padding-bottom:90px}
.st-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}.st-title h1{margin:4px 0}
.st-links{margin-left:auto;display:flex;gap:14px;font-size:13px}
.st-grid{display:grid;grid-template-columns:230px minmax(0,1fr);gap:24px;align-items:start}
.st-side{position:sticky;top:12px;max-height:calc(100vh - 100px);overflow-y:auto;background:#fff;border:1px solid #e1e4ec;border-radius:8px;padding:10px 8px}
.st-grp{margin:2px 0 10px}
.st-gt{display:flex;align-items:center;gap:8px;color:#1f2430;font-weight:700;padding:6px 8px;border-radius:6px}
.st-gt:hover{background:#eef1f8;text-decoration:none}
.st-gt .no,.st-ghead .no{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#e6e9f2;font-size:11.5px;flex:none}
.st-grp.cur .st-gt{background:#e6ecfb;color:#23409b}.st-grp.cur .st-gt .no{background:#3056c9;color:#fff}
.st-side ul{list-style:none;margin:2px 0 0;padding:0 0 0 18px}
.st-side li a{display:flex;align-items:center;gap:6px;padding:3px 8px;border-radius:5px;color:#3a4256;font-size:13px}
.st-side li a:hover{background:#f0f2f8;text-decoration:none}
.dot{width:7px;height:7px;border-radius:50%;background:#c9ceda;flex:none;display:inline-block}.dot.on{background:#2e9a5a}.dot.warn{background:#d9a400}
.st-legend{border-top:1px solid #eceef4;margin-top:6px;padding:8px 8px 2px;font-size:11.5px;color:#6a7286;display:flex;gap:10px;flex-wrap:wrap}
.st-legend span{display:inline-flex;align-items:center;gap:4px}
.st-body{min-width:0}
.st-tools{display:flex;gap:8px;justify-content:flex-end;margin-bottom:8px}.st-tools[hidden]{display:none}.st-tools button{font-size:12.5px;padding:4px 12px}
.st-ghead{display:flex;align-items:baseline;gap:10px;margin:22px 0 10px;padding-bottom:4px;border-bottom:2px solid #dfe3ee;scroll-margin-top:12px;flex-wrap:wrap}
.st-ghead:first-of-type{margin-top:0}.st-ghead h2{font-size:16px;margin:0;padding:0;border:0}.st-ghead .no{background:#3056c9;color:#fff;align-self:center}
.st-ghead .hint{display:inline}
details.sec{background:#fff;border:1px solid #e1e4ec;border-radius:8px;margin-bottom:10px;scroll-margin-top:12px}
details.sec>summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:11px 14px}
details.sec>summary::-webkit-details-marker{display:none}
details.sec>summary:hover{background:#f7f8fb;border-radius:8px}
details.sec>summary .arrow{display:inline-block;width:16px;text-align:center;font-size:11px;color:#6a7286;transition:transform .15s}
details.sec[open]>summary .arrow{transform:rotate(90deg)}
details.sec>summary .t{font-weight:700;white-space:nowrap}
details.sec>summary .gist{color:#6a7286;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
details.sec>summary .gist.warn{color:#7a5600}
details.sec>summary .chg{display:none;font-size:11.5px;color:#7a5600;background:#fff0c9;border-radius:10px;padding:0 8px}
details.sec.changed>summary .chg{display:inline-block}
details.sec.off>summary .t{color:#7d8496}
details.sec[open]>summary{border-bottom:1px solid #eceef4;border-radius:8px 8px 0 0}
.sec-body{padding:4px 16px 16px}
details.gen-card{margin-bottom:18px;border-color:#b9c6ee}details.gen-card>summary .t{color:#23409b}
.savebar{position:fixed;left:0;right:0;bottom:0;background:#fff;border-top:1px solid #e1e4ec;box-shadow:0 -2px 10px rgba(30,40,70,.06);z-index:5}
.savebar .in{max-width:1240px;margin:0 auto;padding:10px 20px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.savebar .state{color:#6a7286;font-size:13px}.savebar.dirty .state{color:#7a5600;font-weight:700}.savebar .sp{flex:1}
@media (max-width:860px){
  .st-grid{grid-template-columns:minmax(0,1fr);gap:12px}
  .st-side{position:sticky;top:0;z-index:4;max-height:none;display:flex;gap:6px;overflow-x:auto;padding:8px;border-radius:0 0 8px 8px}
  .st-grp{margin:0;flex:none}.st-gt{white-space:nowrap;background:#f0f2f8;border-radius:16px;padding:4px 12px}
  .st-side ul,.st-legend{display:none}
  details.sec>summary{grid-template-columns:auto minmax(0,1fr) auto}
  details.sec>summary .gist{grid-column:2/-1;white-space:normal}
  .st-links{margin-left:0}
}
