/* src/public/css/calculator/car_cost.css … 自動車の維持費・乗り換え比較 */

.calc-box {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-top: 20px;
}


.ccs-section-title {
    margin: 26px 0 12px;
    font-size: 1.1rem;
    color: #1e3c72;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.calc-box > .ccs-section-title:first-child { margin-top: 0; }


.ccs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}


.input-group { margin-bottom: 16px; }

.input-group label,
.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #1e3c72;
    font-size: 0.92rem;
}

.input-group input[type="text"],
.input-group input[type="date"],
.input-group select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    background: #ffffff;
}


/* 数字欄＋単位 */
.ccs-unit-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ccs-unit-field input { flex: 1; min-width: 0; text-align: right; }

.ccs-unit-field span {
    flex: 0 0 auto;
    color: #475569;
    font-size: 0.9rem;
    white-space: nowrap;
}


.check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #334155;
    cursor: pointer;
}

.check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}


/* ボタン群 */
.btn-group {
    display: flex;
    gap: 15px;
    margin: 22px 0 8px;
}

.btn-calc {
    flex: 2;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #2a5298;
    color: white;
}

.btn-calc:hover { background-color: #1e3c72; }

.btn-clear-tool {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #e9ecef;
    color: #495057;
}

.btn-clear-tool:hover { background-color: #dee2e6; }


.ccs-message {
    margin: 0;
    min-height: 1.4em;
    font-size: 0.9rem;
    font-weight: bold;
    color: #b45309;
}

.ccs-total-val { font-size: 2.1rem; font-weight: bold; color: #2a5298; line-height: 1.25; }

.ccs-total-sub { font-size: 0.85rem; color: #475569; }


.ccs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ccs-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

.ccs-table th,
.ccs-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
}

.ccs-table thead th { background-color: #f1f5f9; color: #1e3c72; font-size: 0.85rem; white-space: nowrap; }

.ccs-table tbody th { color: #1e293b; font-weight: bold; }

.ccs-table .ccs-num { text-align: right; white-space: nowrap; }
@media (max-width: 768px) {

    .calc-box { padding: 20px; }

    .btn-group { gap: 10px; }

    .btn-calc,
.btn-clear-tool { padding: 12px; font-size: 0.95rem; }

    .ccs-total-val { font-size: 1.7rem; }

    .ccs-table { font-size: 0.85rem; }

    .ccs-table th,
.ccs-table td { padding: 8px 6px; }
}
@media (max-width: 480px) {

    .ccs-grid { grid-template-columns: 1fr; }
}


/* === 自動車の維持費比較だけの部品 === */
/* 💡 系列の色（カテゴリの3色）。ライト・ダークそれぞれ、背景色に対して色の見分けやすさを確認済み
      （色覚の違いでの見分け・明るさ・彩度。ライトの3色目はコントラストが3:1未満のため、線の端の名前と表を必ず出す） */
.ccs-chart-wrap,
.ccs-cars,
.ccs-totals,
.ccs-legend,
.ccs-tooltip {
    --ccs-series-1: #2a78d6;
    --ccs-series-2: #eb6834;
    --ccs-series-3: #1baf7a;
}

:root[data-theme="dark"] .ccs-chart-wrap,
:root[data-theme="dark"] .ccs-cars,
:root[data-theme="dark"] .ccs-totals,
:root[data-theme="dark"] .ccs-legend,
:root[data-theme="dark"] .ccs-tooltip {
    --ccs-series-1: #3987e5;
    --ccs-series-2: #d95926;
    --ccs-series-3: #199e70;
}

.ccs-note { margin: 4px 0 12px; font-size: 0.8rem; color: #64748b; line-height: 1.55; white-space: pre-line; }

.ccs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }


.ccs-cars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ccs-car {
    margin: 0;
    padding: 12px 14px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-width: 0;
}

.ccs-car.is-off { opacity: 0.55; }

.ccs-car-legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; }

.ccs-car .input-group { margin-bottom: 10px; }

.ccs-car .input-group label { font-size: 0.82rem; margin-bottom: 4px; }

.ccs-car .input-group input,
.ccs-car .input-group select { padding: 8px 10px; font-size: 0.95rem; }


.ccs-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }

.ccs-swatch-1 { background: var(--ccs-series-1); }

.ccs-swatch-2 { background: var(--ccs-series-2); }

.ccs-swatch-3 { background: var(--ccs-series-3); }


/* 合計のカード */
.ccs-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.ccs-total-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border-radius: 8px;
    background: #f1f3f5;
}

.ccs-total-head { display: flex; align-items: center; gap: 8px; }

.ccs-total-name { font-weight: bold; color: #1e293b; font-size: 0.92rem; overflow-wrap: anywhere; }

.ccs-total-val { font-size: 1.5rem; font-weight: bold; color: #1e293b; }

.ccs-total-sub { font-size: 0.82rem; color: #475569; }

.ccs-badge {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e0e7ff;
    color: #1e3c72;
    font-size: 0.75rem;
    font-weight: bold;
}

.ccs-compare { margin: 0 0 16px; font-size: 0.9rem; color: #1e293b; line-height: 1.7; white-space: pre-line; }


/* グラフ */
.ccs-chart-title,
.ccs-sub-title { margin: 18px 0 8px; font-size: 1rem; color: #1e3c72; }

.ccs-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 6px; font-size: 0.85rem; color: #334155; }

.ccs-legend-item { display: inline-flex; align-items: center; gap: 6px; }

.ccs-legend-key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; flex: 0 0 auto; }

.ccs-legend-key.ccs-swatch-1 { background: var(--ccs-series-1); }

.ccs-legend-key.ccs-swatch-2 { background: var(--ccs-series-2); }

.ccs-legend-key.ccs-swatch-3 { background: var(--ccs-series-3); }

.ccs-chart-wrap { position: relative; width: 100%; }

.ccs-chart { display: block; width: 100%; height: auto; overflow: visible; }


.ccs-gridline { stroke: #e9ecef; stroke-width: 1; }

.ccs-axis { stroke: #94a3b8; stroke-width: 1; }

.ccs-tick { fill: #64748b; font-size: 11px; }

.ccs-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

.ccs-stroke-1 { stroke: var(--ccs-series-1); }

.ccs-stroke-2 { stroke: var(--ccs-series-2); }

.ccs-stroke-3 { stroke: var(--ccs-series-3); }

.ccs-dot { stroke: #ffffff; stroke-width: 2; }

.ccs-fill-1 { fill: var(--ccs-series-1); }

.ccs-fill-2 { fill: var(--ccs-series-2); }

.ccs-fill-3 { fill: var(--ccs-series-3); }

.ccs-end-label { fill: #334155; font-size: 12px; font-weight: bold; }

.ccs-leader { stroke: #94a3b8; stroke-width: 1; }

.ccs-crosshair { stroke: #64748b; stroke-width: 1; pointer-events: none; }

.ccs-hit { fill: transparent; cursor: crosshair; }

.ccs-hit:focus { outline: none; }

.ccs-hit:focus-visible { stroke: #2a5298; stroke-width: 2; }

.ccs-tooltip {
    position: absolute;
    z-index: 2;
    min-width: 160px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    font-size: 0.82rem;
    color: #334155;
    pointer-events: none;
}

.ccs-tip-title { font-weight: bold; color: #1e3c72; margin-bottom: 4px; }

.ccs-tip-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }

.ccs-tip-row strong { color: #1e293b; }

.ccs-tip-name { color: #64748b; }


/* 表 */
.ccs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ccs-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

.ccs-table th,
.ccs-table td { padding: 9px 8px; border-bottom: 1px solid #e2e8f0; text-align: left; }

.ccs-table thead th { background-color: #f1f5f9; color: #1e3c72; font-size: 0.82rem; }

.ccs-table tbody th { color: #334155; font-weight: normal; min-width: 9em; }

.ccs-table .ccs-num { text-align: right; white-space: nowrap; }

.ccs-table td.ccs-num { color: #1e293b; }

.ccs-table .ccs-row-sub th,
.ccs-table .ccs-row-sub td { color: #64748b; font-size: 0.8rem; }

.ccs-table .ccs-row-total th,
.ccs-table .ccs-row-total td { font-weight: bold; color: #1e3c72; }

.ccs-yearly { margin-top: 14px; }

.ccs-yearly summary { cursor: pointer; font-weight: bold; color: #2a5298; padding: 6px 0; }
@media (max-width: 900px) {

    .ccs-cars { grid-template-columns: 1fr; }

    .ccs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {

    .ccs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .ccs-total-val { font-size: 1.3rem; }
}
