:root {
    --app-header-height: 64px;
    --app-footer-height: 52px;
    --app-sidebar-width: 260px;
    --app-bg: #f6f8fb;
    --app-panel: #ffffff;
    --app-border: rgba(15, 23, 42, 0.1);
    --app-muted: #64748b;
}

[data-bs-theme="dark"] {
    --app-bg: #111827;
    --app-panel: #182235;
    --app-border: rgba(226, 232, 240, 0.14);
    --app-muted: #a6b0c3;
}

body {
    min-height: 100vh;
    background: var(--app-bg);
}

.app-header,
.app-footer,
.app-sidebar,
.offcanvas {
    background: var(--app-panel);
}

.app-header {
    min-height: var(--app-header-height);
}

.btn-icon {
    --bs-btn-padding-x: 0;
    --bs-btn-padding-y: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border);
}

.app-shell {
    min-height: calc(100vh - var(--app-footer-height));
    padding-top: var(--app-header-height);
}

.app-sidebar {
    position: fixed;
    top: var(--app-header-height);
    bottom: var(--app-footer-height);
    left: 0;
    width: var(--app-sidebar-width);
    overflow-y: auto;
}

.app-sidebar .nav-link,
.offcanvas .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--bs-body-color);
    border-radius: 8px;
    padding: 0.75rem 0.875rem;
}

.app-sidebar .nav-link:hover,
.offcanvas .nav-link:hover {
    background: rgba(var(--bs-primary-rgb), 0.08);
}

.app-sidebar .nav-link.active,
.offcanvas .nav-link.active {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.12);
    font-weight: 600;
}

.app-main {
    padding: 2rem;
}

@media (min-width: 992px) {
    .app-main {
        margin-left: var(--app-sidebar-width);
    }
}

.page-container {
    max-width: 1240px;
    margin: 0 auto;
}

.page-loading {
    min-height: 420px;
    display: grid;
    place-items: center;
}

.tool-heading {
    margin-bottom: 2rem;
}

.tool-heading.text-center .lead-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.tool-form-section {
    margin-bottom: 2.5rem;
}

.tool-heading h1 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.1;
    margin: 0;
}

.eyebrow {
    color: var(--bs-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.panel {
    background: var(--app-panel);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] .panel {
    box-shadow: none;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.875rem;
}

.panel-header h2 {
    font-size: 1rem;
    margin: 0;
}

.char-count {
    color: var(--app-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

textarea.form-control {
    resize: vertical;
    min-height: 280px;
}

.options-grid {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(180px, 1fr);
    gap: 0.75rem 1rem;
    align-items: center;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.app-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: var(--app-footer-height);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    z-index: 1020;
}

.lead-subtitle {
    font-size: 1.1rem;
    max-width: 52ch;
    line-height: 1.6;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-muted);
    padding: 0.5rem 0.875rem 0.25rem;
    margin: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: var(--app-panel);
    border: 1px solid var(--app-border);
    border-radius: 10px;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    row-gap: 0.5rem;
    align-items: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.35);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-size: 1.2rem;
    grid-column: 1;
    grid-row: 1;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    grid-column: 2;
    grid-row: 1;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--app-muted);
    margin: 0;
    line-height: 1.55;
    grid-column: 1 / -1;
    grid-row: 2;
}

.tool-content {
    margin-bottom: 1.5rem;
}

.content-block-single {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.content-block {
    background: var(--app-panel);
    border: 1px solid var(--app-border);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
}

.content-block h1,
.content-block h2,
.content-block h3,
.content-block h4,
.content-block h5,
.content-block h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.35;
}
.content-block h2 { font-size: 2rem; }
.content-block h2 { font-size: 1.625rem; }
.content-block h3 { font-size: 1.325rem; }
.content-block h4 { font-size: 1.125rem; }
.content-block h5 { font-size: 1rem; }
.content-block h6 { font-size: 0.9rem; }

.section-bold-title {
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.section-bold-title strong {
    font-weight: 600;
}

.content-section + .content-section {
    margin-top: 3.2rem;
}

.content-block p {
    color: var(--bs-body-color);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.content-block p:last-child {
    margin-bottom: 0;
}

.content-list {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.7;
}

.content-list li {
    margin-bottom: 0.5rem;
}

.content-list li:last-child {
    margin-bottom: 0;
}

.content-section p {
    padding-left: 12px;
}
ul.content-list {
    padding-left: 32px;
}

.faq-item {
    padding-left: 12px;
}
.steps-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps-list li {
    counter-increment: step;
    padding: 0.2rem 0;
    border-bottom: none;
    line-height: 1.65;
    padding-left: 12px;
}

.steps-list li::before {
    content: counter(step) ". ";
    font-weight: 700;
    color: var(--bs-primary);
}

.steps-list li strong {
    font-weight: 600;
}

.steps-list li strong,
.steps-list li span {
    display: inline;
    color: var(--bs-body-color);
    font-size: inherit;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.faq-item p {
    margin-bottom: 0;
    color: var(--app-muted);
    line-height: 1.65;
}

.ad-wrap {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.ad-slot {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-align: center;
}

.ad-rectangle {
    max-width: 300px;
    margin-inline: auto;
}

.ad-banner {
    max-width: 728px;
    margin-inline: auto;
}

.header-nav-link {
    color: var(--app-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.header-nav-link:hover,
.header-nav-link.active {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.08);
}

.blog-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.blog-card {
    background: var(--app-panel);
    border: 1px solid var(--app-border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
}

.blog-card-meta,
.blog-meta {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-muted);
    margin: 0;
}

.blog-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}

.blog-card-excerpt {
    color: var(--app-muted);
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
}

.blog-heading {
    margin-bottom: 2rem;
}

.blog-page-view .blog-heading,
.blog-list-view .blog-heading {
    margin-bottom: 2rem;
}

.coming-soon-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    border: 1px dashed rgba(var(--bs-primary-rgb), 0.4);
    background: rgba(var(--bs-primary-rgb), 0.06);
    margin-top: 0.5rem;
}

.coming-soon-banner > .bi {
    font-size: 1.5rem;
    color: var(--bs-primary);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.coming-soon-banner strong {
    display: block;
    margin-bottom: 0.25rem;
}

.coming-soon-banner p {
    color: var(--app-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.static-page-view .static-heading {
    margin-bottom: 2rem;
}

.static-page-view .static-heading.text-center .lead-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.static-page-view h1 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.1;
    margin: 0;
}

.static-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.static-block {
    background: var(--app-panel);
    border: 1px solid var(--app-border);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
}

.static-block h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.875rem;
}

.static-block p {
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.static-block p:last-child {
    margin-bottom: 0;
}

.legal-intro {
    font-size: 1.05rem;
    color: var(--app-muted);
}

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

.contact-card {
    background: var(--app-panel);
    border: 1px solid var(--app-border);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
}

.contact-card > .bi {
    font-size: 1.75rem;
    color: var(--bs-primary);
    margin-bottom: 0.75rem;
}

.contact-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contact-card p {
    margin-bottom: 0.35rem;
}

.contact-form {
    margin-top: 1rem;
}

.footer-nav .footer-link {
    color: var(--app-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.footer-nav .footer-link:hover,
.footer-nav .footer-link.active {
    color: var(--bs-primary);
}

.footer-copy {
    font-size: 0.9rem;
}

.blog-back-link.text-center.mt-4 {
    margin-bottom: 33px;
}

@media (max-width: 991.98px) {
    :root {
        --app-header-height: 56px;
    }

    .app-sidebar {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
        padding: 1rem 0.875rem 1.5rem;
        width: 100%;
        max-width: 100%;
    }

    .page-container {
        max-width: 100%;
    }

    /* Hamburger menu button */
    .app-header [data-bs-target="#mobileSidebar"] {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        border-radius: 10px;
        border: 1px solid var(--app-border);
        background: var(--app-panel);
        color: var(--bs-body-color);
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    }

    .app-header [data-bs-target="#mobileSidebar"] .bi {
        font-size: 1.5rem;
        line-height: 1;
    }

    .app-header [data-bs-target="#mobileSidebar"]:hover,
    .app-header [data-bs-target="#mobileSidebar"]:focus {
        border-color: rgba(var(--bs-primary-rgb), 0.4);
        color: var(--bs-primary);
        background: rgba(var(--bs-primary-rgb), 0.06);
    }

  .app-header .navbar-brand {
        font-size: 1rem;
        max-width: calc(100vw - 180px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-header .navbar-brand .bi {
        font-size: 1.1rem;
    }

    .header-nav-link {
        font-size: 0.875rem;
        padding: 0.35rem 0.5rem;
    }

    /* Mobile sidebar popup */
    #mobileSidebar.offcanvas {
        width: min(300px, 88vw);
        border-right: 1px solid var(--app-border);
        box-shadow: 8px 0 32px rgba(15, 23, 42, 0.12);
    }

    [data-bs-theme="dark"] #mobileSidebar.offcanvas {
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
    }

    #mobileSidebar .offcanvas-header {
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--app-border);
    }

    #mobileSidebar .offcanvas-title {
        font-size: 1.05rem;
        font-weight: 600;
    }

    #mobileSidebar .offcanvas-body {
        padding: 0.75rem;
    }

    #mobileSidebar .nav-link {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        border-radius: 10px;
        margin-bottom: 0.15rem;
    }

    #mobileSidebar .nav-link .bi {
        font-size: 1.15rem;
        width: 1.35rem;
        text-align: center;
    }

    #mobileSidebar .nav-section-label {
        padding: 0.75rem 1rem 0.35rem;
    }

    .offcanvas-backdrop.show {
        opacity: 0.45;
    }

    /* Tool form: stack input/output panels */
    .tool-form-section > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .tool-form-section {
        margin-bottom: 1.5rem;
    }

    .tool-heading {
        margin-bottom: 1.25rem;
    }

    .tool-heading h1 {
        font-size: 1.65rem;
    }

    .lead-subtitle {
        font-size: 0.95rem;
        max-width: 100%;
    }

    textarea.form-control {
        min-height: 200px;
    }

    .panel {
        padding: 1rem;
        border-radius: 10px;
    }

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

    .actions-row .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .content-block,
    .static-block {
        padding: 1.15rem;
    }

    .content-block h2 {
        font-size: 1.25rem;
    }

    .content-section + .content-section {
        margin-top: 2rem;
    }

    .blog-card-grid {
        grid-template-columns: 1fr;
    }

    .blog-heading h1,
    .static-page-view h1 {
        font-size: 1.65rem;
    }

    .ad-wrap {
        margin: 1rem 0;
    }

    .app-footer {
        position: static;
        padding: 0.875rem 0;
        min-height: auto;
    }

    .app-shell {
        min-height: auto;
        padding-bottom: 0;
    }

    .footer-inner {
        flex-direction: column;
        align-items: center !important;
        text-align: center;
        gap: 0.75rem !important;
    }

    .footer-nav {
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .app-header .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .app-header .navbar-brand {
        max-width: calc(100vw - 150px);
    }

    .app-main {
        padding: 0.75rem 0.65rem 1.25rem;
    }

    .tool-heading h1 {
        font-size: 1.45rem;
    }

    .header-nav-link {
        display: none;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .char-count {
        font-size: 0.8rem;
    }
}

@media (max-width: 767.98px) {
    .app-main {
        padding: 1rem;
    }

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

    .content-block,
    .static-block {
        padding: 1.25rem;
    }

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