:root {
    --ink: #172026;
    --muted: #61717d;
    --line: #dce6ed;
    --paper: #f3f7fa;
    --white: #ffffff;
    --teal: #0f8b7f;
    --teal-dark: #0b5f59;
    --mint: #dff8f2;
    --gold: #b7791f;
    --blue: #2563eb;
    --rose: #be123c;
    --shadow: 0 18px 45px rgba(23, 32, 38, 0.10);
    --soft-shadow: 0 10px 28px rgba(23, 32, 38, 0.07);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 139, 127, 0.16), transparent 34rem),
        linear-gradient(180deg, #fbfdfe 0%, var(--paper) 48%, #eef5f8 100%);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(16px, 4vw, 56px);
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(220, 230, 237, 0.9);
    backdrop-filter: blur(16px);
}

.brand {
    flex: 0 0 auto;
    display: grid;
    gap: 1px;
    color: var(--teal-dark);
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.1;
    text-decoration: none;
}

.brand small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: var(--teal-dark);
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.nav-menu a,
.nav-dropdown-toggle,
.pill-list a {
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.nav-menu a:hover,
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown-toggle:hover,
.pill-list a:hover,
.pill-list a.active {
    color: var(--teal-dark);
    background: var(--mint);
    border-color: #a7e7dc;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    min-width: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 8px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: grid;
    gap: 4px;
}

.nav-dropdown-menu a {
    display: block;
    border-radius: 8px;
    padding: 9px 10px;
    white-space: nowrap;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    display: grid;
    min-height: 360px;
    align-items: center;
    padding: 64px 0 42px;
}

.hero h1,
.page-title h1 {
    max-width: 900px;
    margin: 0;
    font-size: clamp(2.15rem, 5vw, 4.6rem);
    line-height: 1.03;
}

.hero p,
.page-title p {
    max-width: 700px;
    color: var(--muted);
    font-size: 1.1rem;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.section {
    padding: 28px 0 64px;
}

.section.compact {
    padding-top: 12px;
}

.seo-content {
    padding: 18px 0 54px;
}

.seo-content p {
    max-width: 920px;
    color: var(--muted);
}

.faq-list {
    display: grid;
    gap: 10px;
    max-width: 920px;
    margin-top: 22px;
}

.faq-list h2 {
    margin: 0 0 4px;
}

.faq-list details {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    padding: 14px 16px;
}

.faq-list summary {
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
}

.faq-list p {
    margin-bottom: 0;
}

.section-heading {
    margin-bottom: 18px;
}

.section h2,
.section-heading h2 {
    margin: 0;
    font-size: 1.9rem;
}

.calculator-category {
    margin-top: 28px;
}

.calculator-category > h3 {
    display: inline-flex;
    align-items: center;
    margin: 0 0 14px;
    border-radius: 999px;
    padding: 7px 13px;
    background: #e9f6f3;
    color: var(--teal-dark);
    font-size: 1rem;
    font-weight: 900;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.tool-card,
.panel,
.result-panel,
.help-grid article,
.invoice-preview,
.rate-finder-panel,
.rate-guide-table {
    border: 1px solid rgba(220, 230, 237, 0.95);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--soft-shadow);
}

.tool-card {
    position: relative;
    display: flex;
    min-height: 220px;
    flex-direction: column;
    overflow: hidden;
    padding: 24px;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tool-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--teal), var(--blue));
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: #a7e7dc;
    box-shadow: var(--shadow);
}

.tool-card h3 {
    margin: 0 0 10px;
    font-size: 1.15rem;
}

.tool-card p {
    margin: 0 0 20px;
    color: var(--muted);
}

.card-link {
    margin-top: auto;
    color: var(--teal-dark);
    font-weight: 900;
    text-decoration: none;
}

.invoice-card-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    border: 1px solid #9bded5;
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--teal-dark);
    background: #effdfa;
    font-size: 0.92rem;
    font-weight: 900;
    text-decoration: none;
}

.invoice-card-link:hover {
    background: var(--mint);
}

.page-title {
    padding: 46px 0 22px;
}

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 20px;
    align-items: start;
    padding: 16px 0 36px;
}

.panel,
.result-panel {
    padding: 26px;
}

.result-panel {
    position: sticky;
    top: 92px;
    border-top: 5px solid var(--teal);
}

.result-panel h2 {
    margin: 0 0 8px;
    color: var(--teal-dark);
    font-size: 1.65rem;
}

.result-panel p {
    color: var(--muted);
}

.calculator-form,
.invoice-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.calculator-form label,
.invoice-form label,
.rate-finder-panel label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 900;
}

.calculator-form span {
    font-size: 0.95rem;
}

.calculator-form input,
.calculator-form select,
.calculator-form textarea,
.invoice-form input,
.invoice-form select,
.rate-finder-panel select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd9e2;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fbfdfe;
    font: inherit;
}

.calculator-form input:focus,
.calculator-form select:focus,
.calculator-form textarea:focus,
.invoice-form input:focus,
.invoice-form select:focus,
.rate-finder-panel select:focus {
    outline: 3px solid rgba(15, 139, 127, 0.16);
    border-color: var(--teal);
}

.calculator-form textarea {
    resize: vertical;
}

.calculator-form .wide {
    grid-column: 1 / -1;
}

.contact-hidden {
    position: absolute;
    left: -9999px;
}

.input-row {
    display: flex;
    align-items: stretch;
}

.input-row input {
    border-radius: 8px 0 0 8px;
}

.input-row strong {
    display: grid;
    min-width: 54px;
    place-items: center;
    border: 1px solid #cbd9e2;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: #edf5f7;
    color: var(--muted);
}

.calculator-form button,
.secondary-button {
    min-height: 48px;
    border-radius: 8px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.calculator-form button {
    grid-column: 1 / -1;
    border: 0;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: white;
    box-shadow: 0 12px 24px rgba(15, 139, 127, 0.24);
}

.calculator-form button:hover {
    background: linear-gradient(135deg, #0c7f74, #084d48);
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--teal);
    background: var(--white);
    color: var(--teal-dark);
    text-decoration: none;
}

.secondary-button:hover {
    background: var(--mint);
}

.help-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--teal-dark);
    font-weight: 900;
    text-decoration: none;
}

.help-link:hover {
    text-decoration: underline;
}

.help-article,
.rate-guide-section,
.rate-finder-section,
.invoice-section {
    padding: 0 0 36px;
}

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

.help-grid article {
    padding: 24px;
}

.help-grid h3 {
    margin: 0 0 10px;
}

.help-grid p,
.help-grid li {
    color: var(--muted);
}

.help-grid ul,
.help-grid ol {
    margin: 10px 0 0;
    padding-left: 20px;
}

.rate-finder-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(270px, 0.9fr);
    gap: 18px;
    align-items: end;
    padding: 24px;
}

.rate-source-card {
    border-left: 4px solid var(--teal);
    padding-left: 16px;
}

.rate-source-card h3,
.rate-source-card p {
    margin: 0 0 8px;
}

.rate-guide-table {
    overflow-x: auto;
}

.rate-guide-table table,
.invoice-preview table {
    width: 100%;
    border-collapse: collapse;
}

.rate-guide-table th,
.rate-guide-table td,
.invoice-preview th,
.invoice-preview td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.rate-guide-table th,
.invoice-preview th {
    background: #f3faf8;
    color: var(--teal-dark);
}

.rate-guide-table tr:last-child td {
    border-bottom: 0;
}

.source-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.source-note a,
.table-link {
    color: var(--teal-dark);
    font-weight: 900;
}

.invoice-builder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: 20px;
    align-items: start;
    margin-top: 18px;
}

.invoice-builder[hidden] {
    display: none;
}

.invoice-form-panel h2 {
    margin: 0 0 16px;
}

.invoice-form {
    gap: 14px;
}

.invoice-form label.wide {
    grid-column: 1 / -1;
}

.print-button {
    margin-top: 18px;
}

.invoice-preview {
    padding: 24px;
}

.invoice-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.invoice-preview h2,
.invoice-preview p {
    margin: 0 0 8px;
}

.invoice-preview table {
    margin-top: 18px;
    font-size: 0.95rem;
}

.invoice-totals {
    width: min(290px, 100%);
    margin-left: auto;
    padding-top: 16px;
}

.invoice-totals p {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.invoice-totals .grand-total {
    border-top: 1px solid var(--line);
    padding-top: 10px;
    color: var(--teal-dark);
    font-size: 1.15rem;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site-footer {
    margin-top: 28px;
    padding: 30px 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

.footer-domains {
    margin: 8px 0 0;
    font-size: 0.95rem;
}

.footer-domains a {
    color: var(--teal-dark);
    font-weight: 900;
}

.mobile-dock {
    display: none;
}

.whatsapp-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #128c7e;
    color: white;
    box-shadow: 0 12px 28px rgba(18, 140, 126, 0.32);
    padding: 12px 18px;
    font-weight: 900;
    text-decoration: none;
}

.adsense-placeholder {
    display: grid;
    min-height: 96px;
    width: min(920px, 100%);
    place-items: center;
    gap: 4px;
    margin: 0 auto 22px;
    border: 1px dashed #9bb4c2;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--muted);
}

.adsense-placeholder span {
    color: var(--ink);
    font-weight: 900;
}

.adsense-placeholder small {
    font-size: 0.82rem;
}

.adsense-live {
    width: min(920px, 100%);
    margin: 0 auto 22px;
}

.self-ad-section {
    padding: 0 0 36px;
}

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

.self-ad-slot {
    min-height: 170px;
    overflow: hidden;
    border: 1px solid rgba(220, 230, 237, 0.95);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--soft-shadow);
}

.self-ad-wide {
    min-height: 150px;
    margin-top: 18px;
}

.self-ad-slot img,
.self-ad-slot video,
.self-ad-slot iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    border: 0;
    object-fit: cover;
}

.self-ad-empty {
    display: grid;
    min-height: inherit;
    place-items: center;
    gap: 4px;
    padding: 18px;
    border: 1px dashed #9bb4c2;
    color: var(--muted);
    text-align: center;
}

.self-ad-empty span {
    color: var(--ink);
    font-weight: 900;
}

.admin-message {
    margin-bottom: 18px;
    border: 1px solid #a7e7dc;
    border-radius: 8px;
    background: var(--mint);
    padding: 12px 14px;
    color: var(--teal-dark);
    font-weight: 900;
}

.admin-error {
    border-color: #fecdd3;
    background: #fff1f2;
    color: var(--rose);
}

.admin-note {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
}

.admin-logout {
    margin-bottom: 18px;
}

.admin-form {
    display: grid;
    gap: 22px;
    padding-bottom: 48px;
}

.admin-panel {
    display: grid;
    gap: 16px;
}

.admin-form label {
    display: grid;
    gap: 8px;
    font-weight: 900;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    border: 1px solid #cbd9e2;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fbfdfe;
    color: var(--ink);
    font: inherit;
}

.admin-toggle {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
}

.admin-toggle input {
    width: auto;
}

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

.admin-slot {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.admin-slot legend {
    color: var(--teal-dark);
    font-weight: 900;
}

.admin-save {
    width: fit-content;
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    color: white;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.admin-dashboard {
    display: grid;
    gap: 22px;
    margin-bottom: 28px;
}

.admin-chart-bars {
    display: grid;
    gap: 12px;
}

.admin-chart-row {
    display: grid;
    grid-template-columns: minmax(160px, 260px) 1fr 52px;
    gap: 10px;
    align-items: center;
}

.admin-chart-row span {
    overflow: hidden;
    color: var(--muted);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chart-row strong {
    display: block;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--teal), var(--blue));
}

.admin-chart-row em {
    color: var(--ink);
    font-style: normal;
    font-weight: 900;
}

.inline-admin-form {
    display: inline-grid;
    margin: 2px;
}

.inline-admin-form button {
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: var(--teal);
    color: white;
    padding: 7px 10px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    cursor: pointer;
}

.inline-admin-form .danger-button {
    background: var(--rose);
}

.save-panel,
.lead-section,
.budget-tool {
    margin: 0 0 28px;
}

.budget-inputs,
.budget-actions,
.budget-summary-grid,
.budget-chart-layout {
    display: grid;
    gap: 16px;
}

.budget-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.budget-inputs label {
    display: grid;
    gap: 8px;
    font-weight: 900;
}

.budget-inputs input,
.budget-tool table input,
.budget-tool table button {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd9e2;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
}

.budget-tool table button {
    background: #fff1f2;
    color: var(--rose);
    font-weight: 900;
    cursor: pointer;
}

.budget-actions {
    grid-template-columns: repeat(2, max-content);
    margin: 18px 0;
}

.budget-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 20px 0;
}

.budget-summary-grid article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    padding: 16px;
}

.budget-summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 900;
}

.budget-summary-grid strong {
    display: block;
    margin-top: 8px;
    color: var(--teal-dark);
    font-size: 1.2rem;
}

.budget-chart-layout {
    grid-template-columns: 340px 1fr;
    align-items: center;
}

.budget-bars {
    display: grid;
    gap: 12px;
}

.budget-bar {
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr 56px;
    gap: 10px;
    align-items: center;
}

.budget-bar span,
.budget-bar i {
    color: var(--muted);
    font-style: normal;
    font-weight: 900;
}

.budget-bar strong {
    display: block;
    height: 16px;
    border-radius: 999px;
}

@media (max-width: 820px) {
    .site-header,
    .calculator-layout,
    .invoice-builder {
        display: block;
    }

    .site-header {
        position: sticky;
        display: grid;
        grid-template-columns: 1fr auto;
    }

    body {
        padding-bottom: 78px;
    }

    main {
        width: min(100% - 24px, 1180px);
    }

    .brand small {
        display: none;
    }

    .nav-menu {
        display: none;
        grid-column: 1 / -1;
        justify-content: flex-start;
        margin-top: 12px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu.is-open {
        display: flex;
        flex-direction: column;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-toggle {
        width: 100%;
        text-align: left;
    }

    .nav-dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 6px;
    }

    .calculator-form,
    .invoice-form,
    .help-grid,
    .rate-finder-panel {
        grid-template-columns: 1fr;
    }

    .result-panel,
    .invoice-preview {
        position: static;
        margin-top: 18px;
    }

    .invoice-preview {
        overflow-x: auto;
    }

    .self-ad-grid,
    .admin-slot-grid,
    .budget-inputs,
    .budget-summary-grid,
    .budget-chart-layout {
        grid-template-columns: 1fr;
    }

    .budget-actions {
        grid-template-columns: 1fr;
    }

    .admin-chart-row {
        grid-template-columns: 1fr;
    }

    .budget-chart-layout canvas {
        width: 100%;
        max-width: 320px;
        height: auto;
        margin: 0 auto;
    }

    .mobile-dock {
        position: fixed;
        right: 10px;
        bottom: 10px;
        left: 10px;
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        border: 1px solid rgba(220, 230, 237, 0.95);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 12px 30px rgba(23, 32, 38, 0.18);
        padding: 8px;
        backdrop-filter: blur(14px);
    }

    .mobile-dock a {
        display: grid;
        min-height: 46px;
        place-items: center;
        border-radius: 8px;
        background: var(--mint);
        color: var(--teal-dark);
        font-size: 0.82rem;
        font-weight: 900;
        text-decoration: none;
    }

    .whatsapp-float {
        right: 14px;
        bottom: 78px;
        min-height: 42px;
        padding: 9px 14px;
        font-size: 0.86rem;
    }
}

@media print {
    body {
        background: white;
    }

    .site-header,
    .site-footer,
    .whatsapp-float,
    .mobile-dock,
    .page-title,
    .calculator-layout:not(.budget-printable),
    .rate-guide-section,
    .section,
    .secondary-button,
    .invoice-form-panel {
        display: none !important;
    }

    main {
        width: auto;
    }

    .invoice-section {
        padding: 0;
    }

    .invoice-builder {
        display: block;
        margin: 0;
    }

    .invoice-preview {
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}
