/* コスト画面と、家具の分類（造作家具 / FFE）表示 */
.cat-badge{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:4px;font-size:11px;font-weight:600;letter-spacing:0;white-space:nowrap}
.cat-built{background:#e6ece1;color:#294c38}
.cat-ffe{background:#f3e8ce;color:#826122}
.kind-tabs button small{opacity:.75;margin-left:2px}
.form-hint{font-size:12px;line-height:1.7;color:var(--muted);margin:8px 0 0}
.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.print-only{display:none}

.cost-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.cost-cards .panel{padding:18px 20px}
.cost-cards h2{margin:0 0 10px;font-size:13px;color:var(--muted);font-weight:600;display:flex;justify-content:space-between;gap:8px}
.cost-cards h2 small{font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cost-cards strong{display:block;font-size:24px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.cost-cards strong .cost-diff{font-size:24px}
.cost-cards p{margin:8px 0 0;font-size:12px;line-height:1.7;color:var(--muted)}
.cost-note{margin:16px 0 0;padding:12px 16px;border:1px solid #e5ce9a;border-radius:8px;background:#fbf6e8;color:#6d4f1c;font-size:13px;line-height:1.7}

.cost-diff{font-variant-numeric:tabular-nums;white-space:nowrap}
.cost-diff.over{color:#a3412d}
.cost-diff.under{color:#2f623a}
.cost-diff small{margin-left:6px;font-size:11px}

.cost-list{background:white;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.cost-head,.cost-section>summary,.cost-total{display:grid;grid-template-columns:minmax(0,1fr) 150px 150px 170px;gap:12px;align-items:center;padding:13px 20px}
.cost-head{font-size:12px;color:var(--muted);font-weight:600;border-bottom:1px solid var(--line);background:#fafbf7}
.cost-head small{margin-left:8px;font-weight:400}
.cost-section{border-bottom:1px solid var(--line)}
.cost-section>summary{cursor:pointer;list-style:none}
.cost-section>summary::-webkit-details-marker{display:none}
.cost-section>summary:hover{background:var(--light)}
.cost-section>summary .cost-name::before{content:'▸';display:inline-block;width:18px;color:var(--muted)}
.cost-section[open]>summary .cost-name::before{content:'▾'}
.cost-name{font-weight:600;min-width:0}
.cost-name small{display:inline-block;margin-left:10px;font-weight:400;font-size:12px;color:var(--muted)}
.cost-detail{padding:4px 20px 18px 38px;background:#fcfcf9}
.cost-detail .tablewrap{margin-bottom:12px}
.cost-detail button.primary{font-size:13px;padding:7px 12px}
.cost-table{width:100%;border-collapse:collapse}
.cost-table th.num{text-align:right}
.cost-table td small{display:block;color:var(--muted);font-size:12px}
.cost-table td small.unit{display:inline}
.cost-table tr[data-edit]{cursor:pointer}
.quote-input{width:120px;padding:6px 8px;border:1px solid var(--line);border-radius:4px;text-align:right;font-variant-numeric:tabular-nums}
.cost-total{border-bottom:1px solid var(--line);font-size:14px}
.cost-total .cost-name{font-weight:400}
.cost-total.subtotal{background:#fafbf7}
.cost-total.subtotal .cost-name,.cost-total.grand .cost-name{font-weight:700}
.cost-total.grand{border-bottom:0;background:#e6ece1;font-size:16px;font-weight:700}

#cost-settings{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 16px;padding:20px 23px 6px;align-items:end}
#cost-settings label{display:grid;gap:6px;font-size:12px;color:var(--muted)}
#cost-settings input{padding:9px 10px;border:1px solid var(--line);border-radius:4px;color:var(--ink);min-width:0;width:100%}
.cost-settings-panel .form-hint{padding:0 23px 18px}

@media (max-width:1100px){.cost-cards{grid-template-columns:repeat(2,minmax(0,1fr))}#cost-settings{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:720px){
 .cost-cards{gap:10px}.cost-cards .panel{padding:14px}.cost-cards strong,.cost-cards strong .cost-diff{font-size:19px}
 .cost-head{display:none}
 .cost-section>summary,.cost-total{grid-template-columns:1fr 1fr 1fr;gap:4px 8px;padding:12px 14px;font-size:13px}
 .cost-section>summary .cost-name,.cost-total .cost-name{grid-column:1/-1}
 .cost-section>summary .num:nth-child(2)::before,.cost-total .num:nth-child(2)::before{content:'概算 ';color:var(--muted);font-size:11px}
 .cost-section>summary .num:nth-child(3)::before,.cost-total .num:nth-child(3)::before{content:'見積 ';color:var(--muted);font-size:11px}
 .cost-detail{padding:4px 10px 14px}
 .cost-table{min-width:640px}
 #cost-settings{grid-template-columns:1fr;padding:14px}
}
@media print{
 .cost-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.cost-cards .panel{padding:8px 10px}.cost-cards strong,.cost-cards strong .cost-diff{font-size:14pt}
 .cost-settings-panel,.cost-note,.quote-input,.cost-detail button{display:none!important}
 .print-only{display:inline}
 .cost-section>summary{display:grid!important}
 .cost-section>summary .cost-name::before{content:''!important;width:0}
 .cost-head,.cost-section>summary,.cost-total{padding:5px 8px;font-size:9pt}
 .cost-detail{padding:0 8px 6px 16px;background:none}
 .cost-total,.cost-section>summary{break-inside:avoid}
 .cost-section>summary{break-after:avoid}
 .print-flow{column-count:var(--print-columns,1);column-gap:8mm;overflow:visible}
 .cost-head,.cost-section>summary,.cost-total{grid-template-columns:minmax(0,1fr) 84px 84px 104px;gap:6px}
 .cost-table td small{display:inline;margin-left:4px}
 .cost-table .issue-badge{padding:0 3px}
 .cost-diff small{display:none}
 .cat-badge{border:1px solid #999;background:none;color:#333}
}
.cost-note .cost-diff small{display:inline}
#cost-conflict{grid-column:1/-1;padding:12px 14px;border:1px solid #e3bdb3;border-radius:8px;background:#fdf3f0;color:#7a2f20;font-size:13px;line-height:1.7}#cost-conflict table{width:100%;margin:8px 0;border-collapse:collapse}#cost-conflict th,#cost-conflict td{text-align:left;padding:4px 8px;border-bottom:1px solid #ecd2cb;font-size:13px}#cost-conflict div{display:flex;gap:8px;flex-wrap:wrap}.quote-input.conflict{border-color:#a3412d;background:#fdf3f0}.broken-panel{border-color:#e5ce9a}.broken-panel .form-hint{padding:12px 23px 4px}
#cost-conflict{min-width:0;max-width:100%;overflow-wrap:anywhere}#cost-conflict table{table-layout:fixed}#cost-settings>*{min-width:0}
