/*
Theme Name: Getsize
Theme URI: https://getsize.com/
Author: Getsize
Author URI: https://getsize.com/
Description: Lightweight, SEO-focused WordPress theme for online calculators and measurement tools.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: getsize
Tags: one-column, two-columns, custom-logo, custom-menu, featured-images, full-width-template, sticky-post, threaded-comments, translation-ready
*/

:root {
    --gs-header-height: 70px;
    --gs-primary: #2563eb;
    --gs-secondary: #0ea5e9;
    --gs-accent: #22c55e;
    --gs-bg: #f8fafc;
    --gs-surface: #ffffff;
    --gs-text: #0f172a;
    --gs-text-soft: #475569;
    --gs-border: #e2e8f0;
    --gs-result-bg: #ecfdf5;
    --gs-footer-bg: #0f172a;
    --gs-footer-text: #cbd5f5;
    --gs-radius: 12px;
    --gs-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    --gs-shadow-soft: 0 4px 14px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--gs-text);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-family: Inter, Poppins, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
}

a {
    color: var(--gs-primary);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 0.75rem;
    line-height: 1.25;
    font-family: Inter, Poppins, "Segoe UI", sans-serif;
    color: var(--gs-text);
}

h1 {
    font-size: clamp(2rem, 4vw, 36px);
}

h2 {
    font-size: clamp(1.6rem, 3vw, 28px);
}

h3 {
    font-size: clamp(1.2rem, 2.4vw, 22px);
}

p,
ul,
ol {
    margin: 0 0 1rem;
    color: var(--gs-text-soft);
}

.site-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.container,
.gs-container {
    width: calc(100% - 2rem);
    max-width: 1160px;
    margin: 0 auto;
}

/* Guard against plugin/page-level `.container` overrides on specific pages. */
.site-wrap .site-header .gs-container,
.site-wrap main .gs-container,
.site-wrap .site-footer .gs-container,
.site-header .header-inner {
    width: calc(100% - 2rem) !important;
    max-width: 1160px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    z-index: 999;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: #fff;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    height: var(--gs-header-height);
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--gs-border);
    backdrop-filter: saturate(180%) blur(8px);
}

.site-header.is-scrolled {
    box-shadow: var(--gs-shadow-soft);
}

.header-inner {
    height: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.site-branding a {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gs-text);
    letter-spacing: -0.02em;
}

.primary-nav {
    justify-self: center;
    min-width: 0;
}

.primary-nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.primary-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 0.5rem;
    color: var(--gs-text);
    font-weight: 600;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn,
.menu-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--gs-border);
    border-radius: 10px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.menu-toggle {
    display: none;
}

.menu-toggle {
    position: relative;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle__bar {
    width: 18px;
    height: 2px;
    background: var(--gs-text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-active .menu-toggle__bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.is-active .menu-toggle__bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .menu-toggle__bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.search-panel {
    position: absolute;
    top: 100%;
    right: 1rem;
    width: min(540px, calc(100% - 2rem));
    background: #fff;
    border: 1px solid var(--gs-border);
    border-radius: 12px;
    box-shadow: var(--gs-shadow);
    padding: 0.75rem;
    display: none;
}

.search-panel.is-open {
    display: block;
}

.search-form {
    position: relative;
}

.search-form input[type="search"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--gs-border);
    border-radius: 10px;
    padding: 0 1rem;
    font-size: 1rem;
}

.autocomplete-results {
    margin-top: 0.5rem;
    border: 1px solid var(--gs-border);
    border-radius: 10px;
    background: #fff;
    max-height: 280px;
    overflow: auto;
    display: none;
}

.autocomplete-results.is-open {
    display: block;
}

.autocomplete-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gs-text);
    border-bottom: 1px solid var(--gs-border);
}

.autocomplete-item:last-child {
    border-bottom: 0;
}

.mobile-drawer {
    position: fixed;
    top: var(--gs-header-height);
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: calc(100dvh - var(--gs-header-height));
    background: #fff;
    border-top: 1px solid var(--gs-border);
    transform: translateX(100vw);
    transition: transform 0.2s ease;
    z-index: 45;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
}

.mobile-drawer.is-open {
    transform: translateX(0);
}

.mobile-drawer-backdrop {
    position: fixed;
    top: var(--gs-header-height);
    left: 0;
    width: 100vw;
    height: calc(100dvh - var(--gs-header-height));
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 44;
    display: none;
}

.mobile-drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-drawer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-drawer a {
    display: block;
    padding: 0.75rem 0;
    font-weight: 600;
    color: var(--gs-text);
    word-break: break-word;
}

main {
    flex: 1;
    padding: 1.5rem 0 3rem;
}

.hero {
    background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 40%), #fff;
    border: 1px solid var(--gs-border);
    border-radius: 18px;
    box-shadow: var(--gs-shadow-soft);
    padding: clamp(1.2rem, 2.4vw, 2.5rem);
}

.hero p {
    font-size: 1.05rem;
    max-width: 70ch;
}

.card-grid {
    margin-top: 1.25rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    box-shadow: var(--gs-shadow-soft);
    padding: 1rem;
}

.card h3 {
    margin-bottom: 0.4rem;
}

.section {
    margin-top: 2rem;
}

.list-clean {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.breadcrumb {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--gs-text-soft);
    font-size: 0.95rem;
}

.breadcrumb li::after {
    content: "/";
    margin-left: 0.5rem;
}

.breadcrumb li:last-child::after {
    content: "";
}

.calc-shell {
    display: grid;
    gap: 1.2rem;
}

/* Calculator pages: prevent any nested control/content from forcing horizontal overflow. */
body.page-template-template-calculator .site-main,
body.page-template-template-calculator .calc-shell,
body.page-template-template-calculator .calc-shell > section,
body.page-template-template-calculator .gs-calculator,
body.page-template-template-calculator .gs-calc-formula,
body.page-template-template-calculator .gs-calc-extra,
body.page-template-template-calculator .table-of-contents,
body.page-template-template-calculator .calculator-content {
    min-width: 0;
    max-width: 100%;
}

body.page-template-template-calculator .calculator-content,
body.page-template-template-calculator .table-of-contents,
body.page-template-template-calculator .gs-field-help,
body.page-template-template-calculator .gs-extra-card,
body.page-template-template-calculator .result-box [data-calc-result] {
    overflow-wrap: anywhere;
}

body.page-template-template-calculator .gs-unit-switch,
body.page-template-template-calculator .gs-unit-switch select {
    width: 100%;
    min-width: 0;
}

.calc-form,
.result-box,
.content-box,
.faq-box,
.related-box,
.blog-card {
    background: #fff;
    border: 1px solid var(--gs-border);
    border-radius: 12px;
    box-shadow: var(--gs-shadow-soft);
    padding: 1rem;
}

.calc-form {
    position: relative;
    overflow: hidden;
}

.calc-form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gs-primary), var(--gs-secondary));
}

.calc-form h2,
.calculator-content h2 {
    letter-spacing: -0.01em;
}

.calc-form .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-top: 0.5rem;
}

.gs-calculator {
    border: 1px solid var(--gs-border);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 1rem;
}

.gs-calc-description {
    margin-bottom: 0.75rem;
    color: var(--gs-text-soft);
}

.gs-calc-formula {
    margin: 0 0 0.8rem;
    font-size: 0.95rem;
    color: var(--gs-text);
}

.gs-unit-switch {
    display: inline-grid;
    gap: 0.3rem;
    margin: 0 0 0.75rem;
}

.gs-unit-switch label {
    font-size: 0.9rem;
    color: var(--gs-text-soft);
}

.gs-unit-switch select {
    min-width: 170px;
}

.gs-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}

.gs-field {
    display: grid;
    gap: 0.35rem;
}

.gs-field-help {
    display: block;
    font-size: 0.82rem;
    color: var(--gs-text-soft);
    line-height: 1.35;
}

.gs-field-guide {
    margin-top: 0.75rem;
    border: 1px solid var(--gs-border);
    border-radius: 10px;
    background: #fff;
    padding: 0.55rem 0.75rem;
}

.gs-field-guide summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--gs-text);
}

.gs-field-guide ul {
    margin-top: 0.55rem;
}

.gs-field-guide li {
    color: var(--gs-text-soft);
    line-height: 1.45;
}

.gs-inline-result {
    margin-top: 0.85rem;
}

.gs-inline-result h3 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.gs-inline-result [data-calc-result] {
    white-space: pre-line;
}

.gs-calc-extra {
    margin-top: 0.8rem;
}

.gs-calc-extra-grid {
    display: grid;
    gap: 0.75rem;
}

.gs-extra-card {
    border: 1px solid var(--gs-border);
    border-radius: 10px;
    background: #fff;
    padding: 0.75rem;
}

.gs-extra-card h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.gs-extra-card p {
    margin: 0 0 0.35rem;
}

.gs-extra-note {
    font-size: 0.86rem;
    color: var(--gs-text-soft);
}

.gs-responsive-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gs-responsive-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.gs-responsive-table th,
.gs-responsive-table td {
    border: 1px solid var(--gs-border);
    padding: 0.4rem 0.5rem;
    text-align: left;
    white-space: nowrap;
    font-size: 0.92rem;
}

.gs-mini-chart {
    display: grid;
    gap: 0.55rem;
}

.gs-mini-chart-row {
    display: grid;
    gap: 0.25rem;
}

.gs-mini-chart-title {
    font-weight: 700;
    color: var(--gs-text);
}

.gs-mini-chart-bars {
    position: relative;
    border: 1px solid var(--gs-border);
    border-radius: 8px;
    background: #f8fbff;
    padding: 0.2rem;
    min-height: 16px;
}

.gs-mini-bar {
    height: 10px;
    border-radius: 6px;
}

.gs-mini-bar.avg {
    background: #93c5fd;
}

.gs-mini-bar.entered {
    margin-top: 2px;
    background: #2563eb;
}

.gs-mini-chart-meta {
    font-size: 0.84rem;
    color: var(--gs-text-soft);
}

.gs-aff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.7rem;
}

.gs-aff-card {
    border: 1px solid var(--gs-border);
    border-radius: 10px;
    background: #fff;
    padding: 0.7rem;
}

.gs-aff-thumb {
    width: 100%;
    aspect-ratio: 5 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gs-border);
    background: #f8fbff;
    display: block;
    margin-bottom: 0.55rem;
}

.gs-aff-card h5 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}

.gs-aff-card .btn-alt {
    display: inline-flex;
    margin-top: 0.5rem;
}

.calc-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--gs-text);
}

.calc-form input,
.calc-form select,
.calc-form textarea {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--gs-border);
    padding: 0.65rem 0.8rem;
    font-size: 1rem;
    background: #f8fbff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
    .gs-responsive-table tr.is-current td {
        background: color-mix(in srgb, var(--gs-primary, #0a84ff) 10%, #ffffff);
        font-weight: 600;
    }

.calc-form input:focus,
.calc-form select:focus,
.calc-form textarea:focus {
    outline: 0;
    border-color: var(--gs-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
    background: #fff;
}

.btn,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    padding: 0 1rem;
    background: var(--gs-primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    filter: brightness(1.05);
}

.result-box {
    background: var(--gs-result-bg);
    border-color: #bbf7d0;
}

.calculator-content {
    border-radius: 14px;
    padding: 1.2rem;
}

.calculator-content > *:last-child {
    margin-bottom: 0;
}

.calculator-content h2 {
    margin-top: 1.1rem;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--gs-border);
}

.calculator-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.calculator-content h3 {
    margin-top: 0.9rem;
    font-size: 1.05rem;
}

.calculator-content ul,
.calculator-content ol {
    padding-left: 1.2rem;
}

.calculator-content li {
    margin-bottom: 0.35rem;
}

.calculator-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    -webkit-overflow-scrolling: touch;
}

.calculator-content th,
.calculator-content td {
    white-space: nowrap;
}

.gs-bra-guide {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 28%);
    border: 1px solid var(--gs-border);
    border-radius: 14px;
    padding: 1rem;
}

.gs-bra-breadcrumb {
    color: var(--gs-text-soft);
    font-size: 0.9rem;
    margin: 0 0 0.4rem;
}

.gs-bra-lead {
    max-width: 78ch;
    color: var(--gs-text-soft);
}

.gs-bra-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 0.9rem 0;
}

.gs-bra-card {
    border: 1px solid var(--gs-border);
    border-radius: 12px;
    background: #fff;
    padding: 0.9rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    margin: 0.9rem 0;
}

.gs-bra-card h3 {
    margin-top: 0;
}

.gs-bra-card h4 {
    margin: 0.75rem 0 0.35rem;
}

.gs-bra-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gs-bra-table {
    width: 100%;
    min-width: 520px;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--gs-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.gs-bra-table.compact {
    min-width: 420px;
}

.gs-bra-table th,
.gs-bra-table td {
    padding: 0.62rem 0.65rem;
    border-bottom: 1px solid var(--gs-border);
    text-align: left;
    white-space: nowrap;
    font-size: 0.92rem;
}

.gs-bra-table thead th {
    background: #eef4ff;
    color: #0f172a;
    font-weight: 700;
}

.gs-bra-table.striped tbody tr:nth-child(2n) td {
    background: #f9fbff;
}

.gs-bra-table tbody tr:last-child td {
    border-bottom: 0;
}

.gs-bra-note {
    color: var(--gs-text-soft);
    font-size: 0.92rem;
}

.gs-bra-measure-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.gs-bra-kicker {
    margin: 0;
    color: var(--gs-text-soft);
    font-size: 0.82rem;
}

.gs-bra-metric {
    margin: 0.2rem 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0b4fd6;
}

.gs-bra-list {
    margin: 0.8rem 0 0;
    padding-left: 1.1rem;
}

.gs-bra-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.gs-bra-chip {
    border: 1px solid #c7d2fe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 999px;
    padding: 0.22rem 0.58rem;
    font-size: 0.84rem;
}

.gs-bra-chart {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.gs-bra-bar {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 0.55rem;
}

.gs-bra-bar .label {
    font-size: 0.85rem;
    color: var(--gs-text-soft);
}

.gs-bra-bar i {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #1d4ed8);
}

.result-actions {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-actions .btn-alt {
    background: #fff;
    color: var(--gs-text);
    border: 1px solid var(--gs-border);
}

.table-of-contents {
    border: 1px solid var(--gs-border);
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
}

.site-footer {
    margin-top: 2rem;
    background: var(--gs-footer-bg);
    color: var(--gs-footer-text);
}

.footer-top {
    padding: 2rem 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.footer-col h3 {
    color: #fff;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col li {
    margin-bottom: 0.45rem;
}

.footer-col a {
    color: var(--gs-footer-text);
}

.footer-bottom {
    border-top: 1px solid rgba(203, 213, 245, 0.22);
    padding: 0.9rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.footer-bottom ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.8rem;
    min-width: 0;
}

.sticky-calc-bar {
    display: none;
}

html.menu-open,
body.menu-open {
    overflow: hidden;
}

.screen-reader-text {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
}

@media (max-width: 960px) {
    :root {
        --gs-header-height: 64px;
    }

    .site-header {
        height: var(--gs-header-height);
    }

    .primary-nav {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.6rem;
    }

    .site-branding {
        min-width: 0;
    }

    .site-branding img {
        max-height: 34px;
        width: auto;
    }

    .site-branding a {
        font-size: 1.2rem;
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .header-actions {
        justify-self: end;
    }

    .search-panel {
        right: 0;
        width: 100%;
        max-width: none;
    }

    .mobile-drawer {
        top: var(--gs-header-height);
        height: calc(100dvh - var(--gs-header-height));
        padding-bottom: 5rem;
    }

    .gs-fields {
        grid-template-columns: 1fr;
    }

    .result-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-actions .btn-alt,
    .result-actions .btn {
        width: 100%;
    }

    .footer-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-bottom ul {
        flex-wrap: wrap;
        gap: 0.5rem 0.8rem;
    }
}

@media (max-width: 1100px) {
    .site-wrap {
        padding-top: var(--gs-header-height);
    }

    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        backdrop-filter: none;
        z-index: 60;
    }

    .site-header .primary-nav {
        display: none !important;
        width: 0;
        min-width: 0;
        max-width: 0;
        overflow: hidden;
        visibility: hidden;
        pointer-events: none;
    }

    .header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.6rem;
    }

    .site-branding {
        min-width: 0;
    }

    .site-header .menu-toggle {
        display: inline-flex !important;
    }

    .site-header .mobile-drawer {
        display: block !important;
        position: fixed !important;
        inset: var(--gs-header-height) 0 0 0 !important;
        width: auto !important;
        max-width: none !important;
        height: calc(100dvh - var(--gs-header-height)) !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateX(100%) !important;
    }

    .site-header .mobile-drawer.is-open {
        transform: translateX(0) !important;
    }

    .site-header .mobile-drawer-backdrop {
        display: block;
        position: fixed !important;
        inset: var(--gs-header-height) 0 0 0 !important;
        width: auto !important;
        height: calc(100dvh - var(--gs-header-height)) !important;
        left: 0 !important;
        right: 0 !important;
    }

    .site-header .mobile-drawer .menu {
        display: block;
    }
}

@media (min-width: 1101px) {
    .site-wrap {
        padding-top: 0;
    }

    .site-header .menu-toggle,
    .site-header .mobile-drawer,
    .site-header .mobile-drawer-backdrop {
        display: none;
    }

    .site-header .primary-nav {
        display: block;
        visibility: visible;
        pointer-events: auto;
        width: auto;
        max-width: none;
        overflow: visible;
    }
}

@media (max-width: 680px) {
    :root {
        --gs-header-height: 60px;
    }

    .site-wrap .site-header .gs-container,
    .site-wrap main .gs-container,
    .site-wrap .site-footer .gs-container,
    .site-header .header-inner {
        width: calc(100% - 1rem) !important;
    }

    .site-header {
        height: var(--gs-header-height);
    }

    .mobile-drawer {
        top: var(--gs-header-height);
        height: calc(100dvh - var(--gs-header-height));
    }

    .mobile-drawer-backdrop {
        top: var(--gs-header-height);
        height: calc(100dvh - var(--gs-header-height));
    }

    .icon-btn,
    .menu-toggle {
        width: 38px;
        height: 38px;
    }

    .search-form input[type="search"] {
        min-height: 44px;
    }

    .gs-calculator,
    .calc-form,
    .result-box,
    .content-box,
    .faq-box,
    .related-box {
        padding: 0.85rem;
    }

    .result-actions {
        grid-template-columns: 1fr;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }

    .sticky-calc-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        background: #fff;
        border-top: 1px solid var(--gs-border);
        padding: 0.6rem 0.6rem calc(0.6rem + env(safe-area-inset-bottom));
        display: block;
    }

    main {
        padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
    }

    .sticky-calc-bar .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem 0 2.4rem;
    }

    .header-inner {
        gap: 0.45rem;
    }

    .header-actions {
        gap: 0.35rem;
    }

    .search-panel {
        padding: 0.6rem;
    }

    .autocomplete-item {
        padding: 0.65rem 0.8rem;
    }

    .hero {
        padding: 1rem;
        border-radius: 14px;
    }

    .hero p {
        font-size: 0.98rem;
    }

    .section {
        margin-top: 1.4rem;
    }

    .breadcrumb {
        font-size: 0.88rem;
        gap: 0.35rem;
    }

    .breadcrumb li::after {
        margin-left: 0.35rem;
    }

    .calc-form,
    .result-box,
    .content-box,
    .faq-box,
    .related-box,
    .blog-card,
    .table-of-contents {
        border-radius: 10px;
    }

    .calc-form input,
    .calc-form select,
    .calc-form textarea,
    .btn,
    button,
    input[type="submit"] {
        min-height: 44px;
    }

    .result-actions {
        gap: 0.45rem;
    }

    .footer-top {
        padding: 1.5rem 0;
        gap: 0.85rem;
    }

    .footer-bottom {
        padding: 0.8rem 0;
        font-size: 0.9rem;
    }

    .footer-bottom ul {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem 0.75rem;
    }
}

@media (max-width: 360px) {
    :root {
        --gs-header-height: 56px;
    }

    .site-wrap .site-header .gs-container,
    .site-wrap main .gs-container,
    .site-wrap .site-footer .gs-container,
    .site-header .header-inner {
        width: calc(100% - 0.75rem) !important;
    }

    .site-header {
        height: var(--gs-header-height);
    }

    .mobile-drawer {
        top: var(--gs-header-height);
        height: calc(100dvh - var(--gs-header-height));
    }

    .mobile-drawer-backdrop {
        top: var(--gs-header-height);
        height: calc(100dvh - var(--gs-header-height));
    }

    .icon-btn,
    .menu-toggle {
        width: 36px;
        height: 36px;
    }

    .site-branding a {
        font-size: 1.08rem;
    }

    .card,
    .hero,
    .gs-calculator,
    .calc-form,
    .result-box,
    .content-box,
    .faq-box,
    .related-box {
        padding: 0.75rem;
    }
}

@media (max-height: 820px) and (orientation: landscape) {
    :root {
        --gs-header-height: 56px;
    }

    .site-header {
        height: var(--gs-header-height);
    }

    .mobile-drawer {
        top: var(--gs-header-height);
        height: calc(100dvh - var(--gs-header-height));
        padding-top: 0.65rem;
        padding-bottom: 1rem;
    }

    .mobile-drawer-backdrop {
        top: var(--gs-header-height);
        height: calc(100dvh - var(--gs-header-height));
    }

    .mobile-drawer a {
        padding: 0.55rem 0;
    }

    .search-panel {
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }

    .search-form input[type="search"] {
        min-height: 42px;
    }

    .autocomplete-results {
        max-height: min(42vh, 200px);
    }

    .hero,
    .card,
    .calc-form,
    .result-box,
    .content-box,
    .faq-box,
    .related-box {
        padding: 0.8rem;
    }

    .section {
        margin-top: 1.2rem;
    }
}
