/* =========================================================
   EBITDA Multiple Calculator – W3Speedup Tools
   ========================================================= */

:root {
    --calc-primary: #1e58b8;
    --calc-blue: #0b63ce;
    --calc-teal: #1a9fa8;
    --calc-teal-50: #f0f9f8;
    --calc-ink: #12233f;
    --calc-ink-2: #33415c;
    --calc-line: #dbe4f0;
    --calc-line-soft: #edf1f7;
    --calc-soft: #eef4fc;
    --calc-radius: 10px;
}

/* ---------- Inputs ---------- */
.input-main-div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 12px;
}

/* ---------- Chart ---------- */
canvas#MultipleEBITDA {
    display: block;
    box-sizing: border-box;
    width: 100% !important;        /* was fixed 824px – overflowed on mobile */
    max-width: 100%;
    height: 280px !important;
    max-height: 280px;
}

/* =========================================================
   Worked example (class-based)
   
             (Inputs / How it's calculated / Result)
             inputs table
                numbered steps
   
                  "What this means"
   ========================================================= */

/* Heading banner */
h2.calc-title {
    position: relative;
    margin: 30px 0 18px !important;
    padding: 10px 16px 10px 26px !important;
    background: linear-gradient(45deg, #035fdb, #1ba2b2) !important;
    border-radius: 6px;
    color: #fff !important;
    font-size: 28px !important;
    line-height: 36px !important;
    font-weight: 500 !important;
    text-transform: capitalize;
}
h2.calc-title::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    background: #fff;
    border-radius: 2px;
}

/* Sub-headings */
h3.calc-subtitle {
    margin: 28px 0 12px !important;
    font-size: 20px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    color: var(--calc-ink) !important;
}

/* Tables */
table.calc-table {
    width: 100%;
    margin: 0 0 8px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--calc-line);
    border-radius: var(--calc-radius);
    overflow: hidden;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}
table.calc-table thead { background: none; }
table.calc-table th {
    padding: 12px 16px;
    background: var(--calc-soft);
    color: var(--calc-ink);
    font-weight: 700;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--calc-line);
}
table.calc-table td {
    padding: 12px 16px;
    color: var(--calc-ink-2);
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--calc-line-soft);
}
table.calc-table tbody tr:last-child td { border-bottom: 0; }
table.calc-table :is(th, td):first-child { width: 55%; }
table.calc-table td:last-child {
    font-weight: 600;
    color: var(--calc-ink);
}

/* Result table – teal */
table.calc-table--result {
    background: var(--calc-teal-50);
    border-color: var(--calc-teal);
}
table.calc-table--result th {
    background: #dff3f2;
    border-bottom-color: #b9e3e1;
}
table.calc-table--result td { border-bottom-color: #cfeae8; }
table.calc-table--result td:last-child,
table.calc-table--result td:last-child strong {
    color: var(--calc-blue);
    font-size: 18px;
    font-weight: 700;
}

/* Numbered steps */
ol.calc-steps {
    counter-reset: step;
    margin: 0 0 8px !important;
    padding: 6px 18px !important;
    list-style: none !important;
    background: #f7f9fc;
    border: 1px solid var(--calc-line);
    border-radius: var(--calc-radius);
}
ol.calc-steps > li {
    counter-increment: step;
    position: relative;
    margin: 0 !important;
    padding: 12px 0 12px 42px !important;
    color: var(--calc-ink-2);
    line-height: 1.55;
    list-style: none !important;
    border-bottom: 1px solid #e6ebf3;
    overflow-wrap: anywhere;
}
ol.calc-steps > li:last-child { border-bottom: 0; }
ol.calc-steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 11px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--calc-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
}

/* "What this means" */
p.calc-note {
    margin: 16px 0 0 !important;
    padding: 14px 18px !important;
    background: var(--calc-soft);
    border-left: 4px solid var(--calc-blue);
    border-radius: 0 8px 8px 0;
    color: var(--calc-ink-2);
    line-height: 1.6;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 767px) {
    canvas#MultipleEBITDA { height: 240px !important; }
}

@media (max-width: 600px) {
    h2.calc-title { font-size: 22px !important; line-height: 30px !important; }
    h3.calc-subtitle { font-size: 18px !important; }
    table.calc-table { font-size: 14px; }
    table.calc-table :is(th, td) { padding: 10px 12px; }
    ol.calc-steps { padding: 4px 14px !important; }
}

@media (max-width: 575px) {
    .calculator-section.container { padding: 0 !important; }
}

@media (max-width: 480px) {
    .input-main-div { grid-template-columns: 1fr; }
}