* { box-sizing: border-box; margin: 0; }
body { font-family: "Hiragino Sans", "Yu Gothic", sans-serif; background: #eef2f6; color: #222; font-size: 14px; }
header { display: flex; align-items: center; gap: 24px; background: #2f6db4; color: #fff; padding: 10px 20px; }
.brand { font-size: 18px; font-weight: 700; } .brand span { font-weight: 400; opacity: .85; font-size: 14px; }
nav { display: flex; gap: 6px; }
.tab { border: 0; background: rgba(255,255,255,.15); color: #fff; padding: 8px 16px; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 14px; }
.tab.active { background: #eef2f6; color: #2f6db4; font-weight: 700; }
.env { margin-left: auto; font-size: 12px; opacity: .8; }
.panel { display: none; padding: 16px; gap: 16px; }
.panel.active { display: flex; align-items: flex-start; }
.col { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 10px; }
.input-col { flex: 1; } .result-col { flex: 1.3; } .verify-col { flex: 1.1; }
h2 { font-size: 14px; color: #2f6db4; border-left: 4px solid #2f6db4; padding-left: 8px; }
textarea, input, select { width: 100%; padding: 10px; border: 1px solid #ccd5df; border-radius: 6px; font: inherit; }
button { cursor: pointer; font: inherit; }
.primary { background: #e8842f; color: #fff; border: 0; padding: 12px; border-radius: 6px; font-weight: 700; font-size: 15px; }
.primary:disabled { background: #ccc; cursor: default; }
.chip { background: #eef4fa; border: 1px solid #ccd5df; border-radius: 20px; padding: 5px 12px; font-size: 12px; margin: 2px; }
.samples { display: flex; flex-wrap: wrap; }
.perf { font-size: 12px; color: #666; min-height: 18px; }
.note { background: #f7f9fb; border-radius: 6px; padding: 10px; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.badge { display: block; padding: 6px 10px; border-radius: 5px; line-height: 1.5; }
.badge.ok { background: #e6f4ea; color: #1a6b34; }
.badge.warn { background: #fdf3e1; color: #9a6410; }
.badge.info { background: #e8f0fe; color: #24568e; }
.placeholder { color: #aab; padding: 14px; }
.drafts { display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.draft { border: 2px solid #dde5ee; border-radius: 8px; padding: 12px; cursor: pointer; }
.draft.selected { border-color: #e8842f; background: #fff9f2; }
.draft h3 { font-size: 13px; color: #555; margin-bottom: 6px; }
.draft .body { font-size: 15px; background: #f4f7fa; border-radius: 6px; padding: 10px; white-space: pre-wrap; }
.draft .desc { font-size: 12px; color: #777; margin-top: 6px; }
.draft .cnt { float: right; font-size: 12px; color: #888; }
.settings-box { font-size: 13px; background: #f4f7fa; border-radius: 6px; padding: 12px; }
.settings-box table td { padding: 3px 10px 3px 0; vertical-align: top; }
.settings-box td:first-child { color: #667; white-space: nowrap; }
.lint-box { display: flex; flex-direction: column; gap: 6px; }
.lint-item { display: flex; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: 13px; align-items: baseline; }
.lint-item.ok { background: #e6f4ea; } .lint-item.warn { background: #fdf3e1; } .lint-item.error { background: #fdecea; }
.lint-item b { min-width: 92px; }
.lint-verdict { font-weight: 700; padding: 10px; border-radius: 6px; text-align: center; }
.lint-verdict.ok { background: #1a6b34; color: #fff; } .lint-verdict.error { background: #c5321f; color: #fff; } .lint-verdict.warn { background: #d98d0b; color: #fff; }
.cms-head { background: #fff; border-radius: 8px; padding: 16px; width: 100%; display: flex; flex-direction: column; gap: 10px; }
#tab-cms.active, #tab-crm.active { flex-direction: column; }
.cms-actions { display: flex; gap: 8px; } .cms-actions input { flex: 1; } .cms-actions select { width: 110px; }
.cms-actions button { border: 1px solid #ccd5df; background: #fff; border-radius: 6px; padding: 8px 14px; }
.cms-actions .primary { border: 0; }
.tpl-list { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.tpl { background: #fff; border-radius: 8px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); position: relative; }
.tpl .body { background: #f4f7fa; border-radius: 6px; padding: 10px; font-size: 14px; margin: 8px 0; white-space: pre-wrap; }
.tpl .meta { font-size: 11px; color: #889; display: flex; gap: 8px; flex-wrap: wrap; }
.tpl .tag { background: #eef4fa; border-radius: 10px; padding: 2px 8px; }
.tpl h3 { font-size: 14px; padding-right: 90px; }
.tpl .ops { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.tpl .ops button { border: 1px solid #dde; background: #fff; border-radius: 4px; font-size: 11px; padding: 3px 7px; }
.tpl input[type=checkbox] { width: auto; position: absolute; bottom: 14px; right: 14px; transform: scale(1.3); }
.survey-out { background: #fff; border-radius: 6px; padding: 4px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; min-height: 200px; }
.survey-out h2q { display:block; font-weight:700; color:#2f6db4; margin-top:10px; }
@media (max-width: 1100px) { .panel.active { flex-direction: column; } .col { width: 100%; } }
.cms-actions .primary { background: #e8842f !important; color: #fff !important; border: 0 !important; }
/* 生成中UI */
.primary.loading { background: #c8ccd4 !important; color: #555 !important; cursor: wait; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #667; border-top-color: transparent; border-radius: 50%; margin-right: 8px; vertical-align: -2px; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.genwait { padding: 34px 16px; font-size: 17px; font-weight: 700; color: #e8842f; }
.dots { display: inline-block; width: 1.6em; text-align: left; color: #e8842f; font-weight: 700; }
/* ===== 顧客管理 / 単発作成 / 受信箱 ===== */
.nbadge { display: inline-block; background: #e8842f; color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; margin-left: 6px; font-weight: 700; }
.row { display: flex; gap: 8px; align-items: center; }
.row input, .row select { flex: 1; }
.row button { white-space: nowrap; border: 1px solid #ccd5df; background: #fff; border-radius: 6px; padding: 9px 14px; }
.row .primary { border: 0; }
.ai-btn { background: #5b4b9e !important; color: #fff !important; border: 0 !important; font-weight: 700; }
.cmp-count { font-size: 13px; color: #2f6db4; font-weight: 700; white-space: nowrap; }
.cmp-members { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; }
.cmp-members .mchip { background: #eef4fa; border-radius: 12px; padding: 3px 10px; font-size: 12px; }
.kind-cards { display: flex; flex-direction: column; gap: 8px; }
.kind-card { display: block; border: 2px solid #dde5ee; border-radius: 8px; padding: 10px 12px; cursor: pointer; font-size: 13px; }
.kind-card:has(input:checked) { border-color: #e8842f; background: #fff9f2; }
.kind-card input { display: none; }
.kind-card b { display: block; margin-bottom: 2px; }
.kind-card span { color: #667; font-size: 12px; }
.cmp-meta { font-size: 12px; color: #667; }
.cmp-meta .over { color: #c5321f; font-weight: 700; }
.tagbar { display: flex; flex-wrap: wrap; gap: 6px; }
.tagbar .tchip { background: #eef4fa; border: 1px solid #ccd5df; border-radius: 14px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.tagbar .tchip.on { background: #2f6db4; color: #fff; border-color: #2f6db4; }
.crm-lists { width: 100%; display: flex; flex-wrap: wrap; gap: 10px; }
.crm-lists .lcard { background: #fff; border-radius: 8px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); min-width: 230px; }
.lcard h3 { font-size: 14px; }
.lcard .meta { font-size: 12px; color: #778; margin: 4px 0 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.lcard .ops { display: flex; gap: 6px; }
.lcard .ops button { border: 1px solid #ccd5df; background: #fff; border-radius: 5px; font-size: 12px; padding: 4px 9px; }
.lcard .ops .use { background: #e8842f; color: #fff; border: 0; font-weight: 700; }
.crm-table { width: 100%; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.crm-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.crm-table th { text-align: left; background: #f2f6fa; color: #456; padding: 9px 12px; font-size: 12px; }
.crm-table td { padding: 9px 12px; border-top: 1px solid #eef2f6; }
.crm-table .tag { background: #eef4fa; border-radius: 10px; padding: 2px 8px; font-size: 11px; margin-right: 4px; }
.crm-table .rowops button { border: 1px solid #dde; background: #fff; border-radius: 4px; font-size: 11px; padding: 3px 7px; margin-left: 4px; }
.inbox { display: flex; flex-direction: column; gap: 8px; }
.inbox .rep { border: 2px solid #dde5ee; border-radius: 8px; padding: 10px 12px; cursor: pointer; font-size: 13px; }
.inbox .rep.unread { border-color: #e8842f; background: #fff7ee; box-shadow: 0 0 0 1px #e8842f33; }
.inbox .rep .head { display: flex; gap: 8px; align-items: baseline; }
.inbox .rep .head b { font-size: 14px; }
.inbox .rep.unread .head b::after { content: "未読"; background: #e8842f; color: #fff; font-size: 10px; border-radius: 8px; padding: 1px 7px; margin-left: 8px; vertical-align: 2px; }
.inbox .rep .when { color: #889; font-size: 12px; margin-left: auto; }
.inbox .rep .ans { display: none; margin-top: 8px; background: #f4f7fa; border-radius: 6px; padding: 8px 10px; }
.inbox .rep.open .ans { display: block; }
.inbox .rep .ans div { padding: 2px 0; }
