/* custom/styles.css */
:root {
    --bg: #ffffff;
    --card: #ffffff;
    --muted: #6b7280;
    --text: #111827;
    --line: #e5e7eb;
    --soft: #f9fafb;
    --brand: #d32f2f;
    --good: #166534;
    --goodBg: #ecfdf5;
    --shadow: 0 10px 25px rgba(0,0,0,.06);
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: transparent;
}

/* Base Container */
.calculator-container {
    color: var(--text);
    background: var(--bg);
    max-width: 920px;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Header */
.calc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: linear-gradient(180deg, #fff, #fafafa);
    border-bottom: 3px solid var(--brand);
}
.calc-title-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calc-title {
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--brand);
    margin: 0;
}
.calc-subtitle {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.35;
    margin: 0;
}
.calc-logo { width: 150px; flex: 0 0 auto; }

/* Body & Grid */
.calc-body { padding: 18px 22px 22px; background: var(--soft); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 14px;
}
.card-head {
    padding: 12px 14px;
    background: #111827;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .01em;
}
.card-body { padding: 12px 14px; }

/* Rows & Labels */
.row {
    display: grid;
    grid-template-columns: 1.3fr .9fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    align-items: start;
}
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.label { font-weight: 650; font-size: 14px; line-height: 1.25; }
.help { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.35; }
.bullets { margin: 6px 0 0 16px; padding: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }

/* Inputs & Values */
.value {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}
.money-input {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}
.prefix { color: var(--muted); font-weight: 700; font-size: 13px; }
input[type="number"], input.currency-input {
    width: 100%;
    max-width: 140px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    background: #fff;
    font-family: inherit;
}
input[type="number"]:focus, input.currency-input:focus {
    border-color: rgba(211,47,47,.55);
    box-shadow: 0 0 0 4px rgba(211,47,47,.12);
}
input[readonly] { background: #f3f4f6; color: #111827; }

/* Badges / Pills */
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 650;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    min-width: 100px;
}

/* Savings Box */
.savings-box {
    margin-top: 14px;
    background: var(--goodBg);
    border: 1px solid rgba(22,101,52,.18);
    border-radius: var(--radius);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.savings-line {
    font-size: 18px;
    line-height: 1.5;
    font-weight: 750;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}
.savings-line .good { color: var(--good); }
.savings-note { color: rgba(22,101,52,.85); font-size: 13px; line-height: 1.45; }

/* Tables (Benefits / Grid) */
.table-wrap { margin-top: 15px; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
th { background-color: #f3f4f6; font-weight: 800; color: #111827; }
td:not(:first-child), th:not(:first-child) { text-align: center; }
tr:last-child td { border-bottom: 0; }
.savings-positive {
    font-weight: 800;
    color: var(--good);
    background: var(--goodBg);
    border-radius: 10px;
    padding: 6px 10px;
    display: inline-block;
    font-variant-numeric: tabular-nums;
}
.mobile-note { display: none; font-size: 13px; font-style: italic; color: var(--muted); margin-bottom: 5px; }

/* List View */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.calc-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.calc-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); border-color: #bbb; }
.calc-card h3 { margin-top: 0; margin-bottom: 10px; color: var(--brand); font-size: 18px; }
.calc-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.calc-arrow { margin-top: 15px; font-weight: bold; color: #333; font-size: 14px; display: inline-block; }

/* Footer Refs */
.refs {
    margin-top: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 820px) {
    .grid { grid-template-columns: 1fr; }
    .calc-logo { width: 130px; }
}
@media (max-width: 600px) {
    .mobile-note { display: block; }
}