body:has(.tip-hero) {
    margin: 0;
    color: #17252b;
}

body:has(.tip-hero) .container {
    width: min(1160px, calc(100% - 2rem));
    margin-inline: auto;
    padding-inline: 0;
}

body:has(.tip-hero) header.topbar-gradient {
    background: #ffffff;
    border-bottom: 1px solid #e4ece6;
}

body:has(.tip-hero) .custom-nav {
    padding-block: 0.75rem;
}

body:has(.tip-hero) .custom-nav > .container,
body:has(.tip-hero) .navbar-collapse,
body:has(.tip-hero) .navbar-nav {
    display: flex;
    align-items: center;
}

body:has(.tip-hero) .custom-nav > .container {
    justify-content: space-between;
    gap: 1rem;
}

body:has(.tip-hero) .navbar-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: #17252b;
    text-decoration: none;
}

body:has(.tip-hero) .navbar-toggler {
    display: none;
}

body:has(.tip-hero) .navbar-collapse {
    flex: 1 1 auto;
    justify-content: flex-end;
}

body:has(.tip-hero) .navbar-nav {
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

body:has(.tip-hero) .navbar-nav .nav-link {
    color: #33473d;
    text-decoration: none;
}

.tip-hero {
    padding-block: 1.5rem;
}

.tip-hero > .container > .row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    align-items: start;
    gap: 2rem;
    margin: 0;
}

.tip-hero .col-lg-8,
.tip-hero .col-lg-4,
.tip-tool-section .col-lg-5,
.tip-tool-section .col-lg-7 {
    width: auto;
    min-width: 0;
}

.tip-hero .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    color: #53645b;
    font-size: 0.9rem;
}

.tip-hero .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin-right: 0.45rem;
    color: #87968c;
}

.tip-hero .breadcrumb a {
    color: #216a49;
}

.tip-tool-section {
    padding-block: 1.5rem;
}

.tip-tool-section > .container > .row {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: stretch;
    gap: 1.25rem;
    margin: 0;
}

.tip-tool-panel,
.tip-result-panel {
    box-sizing: border-box;
}

.tip-tool-panel > .d-flex,
.tip-result-panel > .d-flex {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

#tipCalculatorForm {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

#tipCalculatorForm > .col-12 {
    grid-column: 1 / -1;
}

.tip-tool-panel > form > .col-md-6 {
    width: auto;
    min-width: 0;
    flex: initial;
}

.tip-tool-panel .form-label {
    display: block;
    margin-bottom: 0.4rem;
    color: #263a30;
}

.tip-tool-panel .input-group {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
}

.tip-tool-panel .input-group-text,
.tip-tool-panel .form-control,
.tip-tool-panel .form-select {
    box-sizing: border-box;
    min-height: 44px;
    border: 1px solid #cbd9cf;
    border-radius: 6px;
    background: #ffffff;
    color: #17252b;
    font: inherit;
}

.tip-tool-panel .input-group-text {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding-inline: 0.75rem;
    background: #f2f7f3;
}

.tip-tool-panel .input-group .form-control {
    flex: 1 1 0;
    width: 1%;
    min-width: 0;
    padding: 0.55rem 0.7rem;
}

.tip-tool-panel .input-group .input-group-text + .form-control {
    border-left: 0;
    border-radius: 0 6px 6px 0;
}

.tip-tool-panel > form > .col-md-6 > .form-control,
.tip-tool-panel .form-select {
    width: 100%;
    padding: 0.55rem 0.7rem;
}

.tip-tool-panel .form-text {
    margin-top: 0.35rem;
    color: #5c6b62;
    font-size: 0.88rem;
    line-height: 1.45;
}

.tip-tool-panel .invalid-feedback[hidden] {
    display: none !important;
}

.tip-tool-panel .invalid-feedback:not([hidden]) {
    display: block;
    margin-top: 0.3rem;
    color: #9b3929;
    font-size: 0.86rem;
}

.tip-tool-panel .form-control.is-invalid {
    border-color: #c34f3c;
}

.tip-tool-panel .col-12.d-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.4rem;
}

.tip-tool-panel .btn,
.tip-info-panel .btn,
.tip-cta-band .btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.55rem 0.9rem;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.tip-tool-panel .btn-success {
    background: #216a49;
    color: #ffffff;
}

.tip-tool-panel .btn-outline-secondary,
.tip-tool-panel .btn-outline-success,
.tip-info-panel .btn-outline-success {
    border-color: #91ad9c;
    background: #ffffff;
    color: #216a49;
}

.tip-tool-panel .btn-outline-success:hover,
.tip-info-panel .btn-outline-success:hover {
    background: #e9f4ed;
}

.tip-breakdown {
    width: 100%;
    border-collapse: collapse;
}

.tip-breakdown tr + tr {
    border-top: 1px solid #e7eee9;
}

.tip-breakdown th,
.tip-breakdown td {
    padding: 0.55rem 0;
}

.tip-hero ~ section:not(.tip-tool-section) {
    padding-block: 3rem;
}

.tip-hero ~ #how-to-use .row,
.tip-hero ~ #edge-cases .row,
.tip-hero ~ #related-calculators .row {
    display: grid;
    gap: 1rem;
    margin: 0;
}

.tip-hero ~ #how-to-use .row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tip-hero ~ #edge-cases .row,
.tip-hero ~ #related-calculators .row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tip-hero ~ #how-to-use .col-md-6,
.tip-hero ~ #how-to-use .col-xl-3,
.tip-hero ~ #edge-cases .col-md-6,
.tip-hero ~ #edge-cases .col-xl-4,
.tip-hero ~ #related-calculators .col-md-6,
.tip-hero ~ #related-calculators .col-lg-4 {
    width: auto;
    min-width: 0;
}

.tip-table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.tip-table-wrap th,
.tip-table-wrap td {
    padding: 0.75rem;
    border-bottom: 1px solid #e4ece6;
    text-align: left;
    vertical-align: top;
}

.tip-table-wrap thead {
    background: #edf5ef;
    color: #263a30;
}

.tip-table-wrap tbody tr:last-child th,
.tip-table-wrap tbody tr:last-child td {
    border-bottom: 0;
}

.tip-hero ~ #faq .accordion-item {
    margin-bottom: 0.6rem;
    overflow: hidden;
    border: 1px solid #dce8df;
    border-radius: 8px;
    background: #ffffff;
}

.tip-hero ~ #faq .accordion-button {
    width: 100%;
    padding: 0.95rem 1rem;
    border: 0;
    background: #ffffff;
    color: #263a30;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.tip-hero ~ #faq .accordion-body {
    padding: 0 1rem 1rem;
    color: #53645b;
    line-height: 1.6;
}

.tip-hero ~ #final-cta .row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    align-items: center;
    gap: 1.25rem;
    margin: 0;
}

body:has(.tip-hero) footer .row {
    margin-inline: 0;
}

@media (max-width: 991.98px) {
    .tip-hero > .container > .row,
    .tip-tool-section > .container > .row,
    .tip-hero ~ #final-cta .row {
        grid-template-columns: minmax(0, 1fr);
    }

    .tip-hero ~ #how-to-use .row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    body:has(.tip-hero) .container {
        width: calc(100% - 1.25rem);
    }

    body:has(.tip-hero) .custom-nav > .container {
        flex-wrap: wrap;
    }

    body:has(.tip-hero) .navbar-collapse {
        flex-basis: 100%;
        justify-content: flex-start;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    body:has(.tip-hero) .navbar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .tip-hero > .container > .row,
    .tip-tool-section > .container > .row {
        gap: 1rem;
    }

    .tip-hero ~ #edge-cases .row,
    .tip-hero ~ #related-calculators .row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    #tipCalculatorForm {
        grid-template-columns: minmax(0, 1fr);
    }

    #tipCalculatorForm > .col-12 {
        grid-column: auto;
    }

    .tip-hero ~ #how-to-use .row,
    .tip-hero ~ #edge-cases .row,
    .tip-hero ~ #related-calculators .row {
        grid-template-columns: minmax(0, 1fr);
    }

    .tip-hero ~ section:not(.tip-tool-section) {
        padding-block: 2rem;
    }

    .tip-table-wrap {
        overflow-x: auto;
    }

    #examples .tip-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    #examples .tip-table-wrap table {
        display: block;
    }

    #examples .tip-table-wrap thead {
        display: none;
    }

    #examples .tip-table-wrap tbody {
        display: grid;
        gap: 0.75rem;
    }

    #examples .tip-table-wrap tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 0.8rem;
        padding: 0.8rem;
        border: 1px solid #e0e9e2;
        border-radius: 8px;
        background: #ffffff;
    }

    #examples .tip-table-wrap tbody td {
        min-width: 0;
        padding: 0.35rem 0;
        border: 0;
        font-size: 0.9rem;
        overflow-wrap: anywhere;
    }

    #examples .tip-table-wrap tbody td::before {
        display: block;
        margin-bottom: 0.15rem;
        color: #607067;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    #examples .tip-table-wrap tbody td:nth-child(1)::before {
        content: "Subtotal";
    }

    #examples .tip-table-wrap tbody td:nth-child(2)::before {
        content: "Tax";
    }

    #examples .tip-table-wrap tbody td:nth-child(3)::before {
        content: "Tip choice";
    }

    #examples .tip-table-wrap tbody td:nth-child(4)::before {
        content: "People";
    }

    #examples .tip-table-wrap tbody td:nth-child(5) {
        grid-column: 1 / -1;
        border-top: 1px solid #e4ece6;
        font-weight: 700;
    }

    #examples .tip-table-wrap tbody td:nth-child(5)::before {
        content: "Estimated result";
    }

    #examples .tip-table-wrap tbody td:nth-child(6) {
        grid-column: 1 / -1;
    }

    #examples .tip-example-button {
        width: 100%;
    }

    .tip-hero h1 {
        font-size: 1.85rem;
    }
}
