
* {
    box-sizing: border-box;
}

.format-help {
    margin: 0 0 8px;
    color: #6b7280;
    font-size: 13px;
}



:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --background: #f8fafc;
    --white: #ffffff;
    --success: #15803d;
    --error: #dc2626;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--background);
    line-height: 1.6;
}

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}


/* =========================
   HEADER
========================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    color: var(--text);
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

    

nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
}

    nav a {
        color: #4b5563;
        text-decoration: none;
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
        transition: color 0.2s ease;
    }

        nav a:hover {
            color: var(--primary);
        }

        nav a.active {
            color: var(--primary);
        }


/* =========================
   HERO
========================= */

.hero {
    padding: 78px 0 45px;
    text-align: center;
    background: radial-gradient( circle at top, rgba(37, 99, 235, 0.08), transparent 45% );
}

    .hero h1 {
        margin: 0;
        font-size: clamp(38px, 6vw, 58px);
        line-height: 1.05;
        letter-spacing: -1.8px;
    }

    .hero p {
        max-width: 680px;
        margin: 20px auto 0;
        color: var(--muted);
        font-size: 17px;
    }


/* =========================
   TOOL SECTION
========================= */

.tool-section {
    padding: 30px 0 80px;
}

.tool-card {
    max-width: 1000px;
    margin: 0 auto;
    padding: 28px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.07);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.preview-area {
    min-height: 300px;
    margin-top: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
}

.button-row {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
}

@media (max-width: 700px) {

    .tool-card {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .preview-area {
        min-height: 230px;
    }

    .button-row {
        grid-column: auto;
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

.hero {
    padding: 45px 0 25px;
}

.tool-section {
    padding: 15px 0 50px;
}

/* =========================
   FORM
========================= */

.controls {
    display: grid;
    gap: 10px;
}

    .controls label {
        margin-top: 10px;
        color: #374151;
        font-size: 14px;
        font-weight: 700;
    }

    .controls input[type="text"],
    .controls select {
        width: 100%;
        padding: 14px 15px;
        border: 1px solid #d1d5db;
        border-radius: 10px;
        background: #ffffff;
        color: var(--text);
        font-size: 16px;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

        .controls input[type="text"]:focus,
        .controls select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
        }

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 5px;
}

    .control-grid > div {
        display: flex;
        flex-direction: column;
        gap: 7px;
    }

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.control-grid span {
    color: var(--muted);
    font-size: 13px;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin-top: 16px !important;
    cursor: pointer;
}

    .checkbox-row input {
        width: 17px;
        height: 17px;
        accent-color: var(--primary);
        cursor: pointer;
    }


/* =========================
   PREVIEW
========================= */

.preview-area {
    min-height: 270px;
    margin-top: 32px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
}

.preview-title {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.barcode-container {
    min-width: 250px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

#barcode {
    display: block;
    max-width: 100%;
    height: auto;
}

.error-message {
    min-height: 24px;
    margin: 15px 0 0;
    color: var(--error);
    font-size: 14px;
    text-align: center;
}


/* =========================
   BUTTONS
========================= */

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

    .btn:hover {
        background: #f3f4f6;
        border-color: #9ca3af;
        transform: translateY(-1px);
    }

    .btn.primary {
        border-color: var(--primary);
        background: var(--primary);
        color: #ffffff;
    }

        .btn.primary:hover {
            border-color: var(--primary-dark);
            background: var(--primary-dark);
        }


/* =========================
   INFO SECTION
========================= */

.info-section {
    padding: 75px 0;
    background: #ffffff;
    border-top: 1px solid var(--border);
}

    .info-section .container {
        max-width: 850px;
    }

    .info-section h2 {
        margin: 0 0 12px;
        padding-top: 28px;
        font-size: 27px;
        line-height: 1.25;
        letter-spacing: -0.5px;
    }

        .info-section h2:first-child {
            padding-top: 0;
        }

    .info-section p {
        color: #4b5563;
    }

    .info-section ol {
        padding-left: 22px;
        color: #4b5563;
    }

    .info-section li {
        margin-bottom: 8px;
    }


/* =========================
   FOOTER
========================= */

.site-footer {
    padding: 30px 0;
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
    font-size: 14px;
}

    .site-footer p {
        margin: 0;
    }


/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    .header-inner {
        min-height: 64px;
    }

    nav {
        display: none;
    }

    .hero {
        padding: 55px 0 30px;
    }

        .hero h1 {
            font-size: 40px;
        }

        .hero p {
            font-size: 16px;
        }

    .tool-card {
        padding: 22px;
        border-radius: 16px;
    }

    .control-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .preview-area {
        padding: 18px;
    }

    .barcode-container {
        max-width: 100%;
        overflow-x: auto;
    }

    .button-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .info-section {
        padding: 55px 0;
    }

    .reset-btn {
        color: #6b7280;
    }

        .reset-btn:hover {
            color: #111827;
        }

    .barcode-container {
        display: flex;
        align-items: center;
        justify-content: center;
        width: min(100%, 700px);
        min-height: 160px;
        padding: 25px;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        overflow-x: auto;
    }

    #barcode {
        max-width: 100%;
    }

    /* =========================
   RELATED TOOLS
========================= */

    .related-section {
        padding: 70px 0;
        background: #f8fafc;
    }

        .related-section h2,
        .faq-section h2 {
            margin: 0 0 30px;
            font-size: 30px;
            letter-spacing: -0.5px;
        }

    .related-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .related-card {
        display: block;
        padding: 25px;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        color: #111827;
        text-decoration: none;
        transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }

        .related-card:hover {
            transform: translateY(-3px);
            border-color: #bfdbfe;
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
        }

    .related-icon {
        width: 46px;
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 18px;
        border-radius: 10px;
        background: #eff6ff;
        color: #2563eb;
        font-size: 16px;
        font-weight: 800;
    }

    .related-card h3 {
        margin: 0 0 8px;
        font-size: 19px;
    }

    .related-card p {
        margin: 0 0 18px;
        color: #6b7280;
        font-size: 14px;
    }

    .related-card span {
        color: #2563eb;
        font-size: 14px;
        font-weight: 700;
    }


    /* =========================
   FAQ
========================= */

    .faq-section {
        padding: 75px 0;
        background: #ffffff;
    }

        .faq-section .container {
            max-width: 850px;
        }

    .faq-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

        .faq-list details {
            padding: 18px 20px;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            background: #ffffff;
        }

        .faq-list summary {
            cursor: pointer;
            color: #111827;
            font-size: 16px;
            font-weight: 700;
        }

        .faq-list p {
            margin: 14px 0 0;
            color: #6b7280;
            font-size: 15px;
        }


    /* =========================
   MOBILE
========================= */

    @media (max-width: 700px) {

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

        .related-section,
        .faq-section {
            padding: 55px 0;
        }
    }
}

/* =========================
   RELATED TOOLS
========================= */

.related-section {
    padding: 70px 0;
    background: #f8fafc;
}

    .related-section .container {
        max-width: 1000px;
    }

    .related-section h2 {
        margin: 0 0 30px;
        font-size: 30px;
        line-height: 1.2;
        color: #111827;
    }

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-card {
    display: block;
    padding: 25px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    color: #111827;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

    .related-card:hover {
        transform: translateY(-3px);
        border-color: #bfdbfe;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    }

.related-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 16px;
    font-weight: 800;
}

.related-card h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 19px;
}

.related-card p {
    margin: 0 0 18px;
    color: #6b7280;
    font-size: 14px;
}

.related-card span {
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
}


/* =========================
   FAQ
========================= */

.faq-section {
    padding: 75px 0;
    background: #ffffff;
}

    .faq-section .container {
        max-width: 850px;
    }

    .faq-section h2 {
        margin: 0 0 30px;
        color: #111827;
        font-size: 30px;
        line-height: 1.2;
    }

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .faq-list details {
        padding: 18px 20px;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
    }

    .faq-list summary {
        cursor: pointer;
        color: #111827;
        font-size: 16px;
        font-weight: 700;
    }

    .faq-list p {
        margin: 14px 0 0;
        color: #6b7280;
        font-size: 15px;
    }


/* =========================
   RELATED + FAQ MOBILE
========================= */

@media (max-width: 700px) {

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

    .related-section,
    .faq-section {
        padding: 55px 0;
    }
}

/* =========================
   HOMEPAGE TOOLS GRID
========================= */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

    .tools-grid .tool-card {
        display: block;
        margin: 0;
        max-width: none;
    }


/* =========================
   MOBILE HOMEPAGE TOOLS
========================= */

@media (max-width: 700px) {

    .tools-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================
   IMAGE COMPRESSOR
========================= */

.image-preview-container {
    width: 100%;
    max-width: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
}

    .image-preview-container img {
        display: block;
        max-width: 100%;
        max-height: 360px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

/* =========================
   IMAGE COMPRESSOR LAYOUT
========================= */

.compression-result {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 0;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .result-item span {
        color: #6b7280;
        font-size: 13px;
    }

    .result-item strong {
        color: #111827;
        font-size: 16px;
    }


/* =========================
   IMAGE PREVIEW
========================= */

.image-preview-container {
    width: 100%;
    max-width: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
}

    .image-preview-container img {
        display: block;
        max-width: 100%;
        max-height: 360px;
        width: auto;
        height: auto;
        object-fit: contain;
    }


/* =========================
   UPLOAD AREA
========================= */

.upload-area {
    padding: 25px;
    text-align: center;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    transition: border-color 0.2s ease, background 0.2s ease;
}

    .upload-area.drag-over {
        border-color: #2563eb;
        background: #eff6ff;
    }

.upload-icon {
    margin-bottom: 8px;
    color: #2563eb;
    font-size: 28px;
    font-weight: 700;
}

.upload-title {
    margin: 0;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
}

.upload-subtitle {
    margin: 5px 0;
    color: #6b7280;
    font-size: 13px;
}

.upload-hint {
    margin: 10px 0 0;
    color: #6b7280;
    font-size: 12px;
}


/* =========================
   FILE INFORMATION
========================= */

.file-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
    font-size: 14px;
}

    .file-info span {
        color: #6b7280;
    }

    .file-info strong {
        color: #111827;
    }


/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    .compression-result {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .image-preview-container {
        min-height: 200px;
    }
}

/* =========================
   COMPRESSION STATUS
========================= */

.compression-status {
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px 16px;
    border-radius: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    display: none;
}

/* ================================
   Word Counter
================================ */

.word-counter-card {
    grid-template-columns: 1.2fr 0.8fr;
}

    .word-counter-card textarea {
        width: 100%;
        min-height: 320px;
        padding: 14px 16px;
        box-sizing: border-box;
        resize: vertical;
        font-family: inherit;
        font-size: 15px;
        line-height: 1.6;
        color: var(--text);
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: 12px;
        outline: none;
        transition: border-color .2s ease, box-shadow .2s ease;
    }

        .word-counter-card textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
        }

        .word-counter-card textarea::placeholder {
            color: #9ca3af;
        }

.word-goal-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

    .word-goal-row label {
        margin: 0;
        white-space: nowrap;
    }

    .word-goal-row input {
        width: 140px;
        padding: 10px 12px;
        box-sizing: border-box;
        font-family: inherit;
        font-size: 14px;
        color: var(--text);
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: 10px;
        outline: none;
    }

        .word-goal-row input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
        }

.word-stats-area {
    min-height: 320px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-content: center;
    gap: 12px;
    padding: 20px;
}

.word-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-height: 92px;
    padding: 14px;
    box-sizing: border-box;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}

    .word-stat span {
        color: var(--muted);
        font-size: 12px;
        line-height: 1.4;
    }

    .word-stat strong {
        color: var(--text);
        font-size: 20px;
        line-height: 1.2;
    }

#goalStat {
    grid-column: 1 / -1;
}

#goalProgress {
    font-size: 17px;
}

#wordCounterButtons {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {

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

        .word-counter-card textarea {
            min-height: 240px;
        }

    .word-stats-area {
        grid-template-columns: 1fr 1fr;
        min-height: auto;
    }

    .word-stat {
        min-height: 85px;
    }

    .word-goal-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

        .word-goal-row input {
            width: 100%;
        }

    #wordCounterButtons {
        grid-column: auto;
    }
}

@media (max-width: 420px) {

    .word-stats-area {
        grid-template-columns: 1fr;
    }

    #goalStat {
        grid-column: auto;
    }
}

/* ================================
   JSON Formatter
================================ */

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

.json-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .json-panel textarea {
        width: 100%;
        min-height: 360px;
        padding: 14px 16px;
        box-sizing: border-box;
        resize: vertical;
        font-family: Consolas, "Courier New", monospace;
        font-size: 14px;
        line-height: 1.6;
        color: var(--text);
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: 12px;
        outline: none;
        tab-size: 2;
        transition: border-color .2s ease, box-shadow .2s ease;
    }

        .json-panel textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
        }

        .json-panel textarea::placeholder {
            color: #9ca3af;
        }

.json-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .json-options label {
        margin: 0;
        white-space: nowrap;
    }

    .json-options select {
        padding: 9px 12px;
        font-family: inherit;
        font-size: 14px;
        color: var(--text);
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: 10px;
        outline: none;
    }

        .json-options select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
        }

.json-button-row {
    grid-column: 1 / -1;
}

.json-status {
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    display: none;
}

    .json-status.success {
        display: block;
        color: #15803d;
        background: #f0fdf4;
        border: 1px solid #bbf7d0;
    }

    .json-status.error {
        display: block;
        color: #dc2626;
        background: #fef2f2;
        border: 1px solid #fecaca;
    }

    .json-status.info {
        display: block;
        color: #1d4ed8;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
    }

.json-info {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.json-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}

    .json-info-item span {
        color: var(--muted);
        font-size: 13px;
    }

    .json-info-item strong {
        color: var(--text);
        font-size: 16px;
    }

#jsonValidity.success {
    color: var(--success);
}

#jsonValidity.error {
    color: var(--error);
}


/* Mobile */

@media (max-width: 700px) {

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

    .json-panel textarea {
        min-height: 260px;
    }

    .json-button-row {
        grid-column: auto;
        flex-direction: column;
    }

        .json-button-row .btn {
            width: 100%;
        }

    .json-info {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .json-options {
        flex-direction: column;
        align-items: flex-start;
    }

        .json-options select {
            width: 100%;
        }
}

/* =========================
   CALORIE CALCULATOR - MATCH SHARED TOOL THEME
========================= */
        .calorie-card { max-width: 980px; margin: 0 auto; display: block !important; }
        .calorie-intro { max-width: 800px; margin: 0 auto 26px; text-align: center; }
        .calorie-intro h1 { margin: 0 0 12px; font-size: clamp(30px, 5vw, 44px); line-height: 1.15; letter-spacing: -1px; }
        .calorie-intro p { color: #64748b; margin: 0 auto; max-width: 720px; }
        .calorie-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
        .calorie-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
        .calorie-field label, .calorie-group-label { font-size: 14px; font-weight: 700; color: #374151; }
        .calorie-field input, .calorie-field select { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: #111827; font: inherit; }
        .calorie-field input:focus, .calorie-field select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
        .calorie-units, .calorie-sex { display: flex; gap: 8px; flex-wrap: wrap; }
        .calorie-units button, .calorie-sex button { flex: 1; border: 1px solid #cbd5e1; border-radius: 9px; padding: 11px 12px; background: #fff; cursor: pointer; font: inherit; font-weight: 700; color: #334155; }
        .calorie-units button.active, .calorie-sex button.active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
        .calorie-full { grid-column: 1 / -1; }
        .calorie-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
        .calorie-actions .btn { flex: 1; }
        .calorie-error { display: none; margin-top: 16px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; }
        .calorie-results { display: none; margin-top: 28px; border: 1px solid #bfdbfe; background: #f8fbff; border-radius: 16px; padding: 22px; }
        .calorie-results.show { display: block; }
        .calorie-results h2 { margin: 0 0 6px; font-size: 24px; }
        .calorie-result-subtitle { margin: 0 0 18px; color: #64748b; }
        .calorie-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
        .calorie-metric { background: #fff; border: 1px solid #dbeafe; border-radius: 12px; padding: 16px; }
        .calorie-metric span { display: block; color: #64748b; font-size: 13px; }
        .calorie-metric strong { display: block; margin-top: 5px; color: #1d4ed8; font-size: clamp(22px, 3vw, 30px); line-height: 1.2; }
        .calorie-metric small { display: block; margin-top: 5px; color: #64748b; }
        .calorie-guidance { margin: 16px 0 0; color: #475569; }
        .calorie-note { margin-top: 16px; padding: 13px 15px; border-radius: 10px; background: #fff; color: #64748b; font-size: 13px; }
        .calorie-info { max-width: 850px; margin: 42px auto 0; }
        .calorie-info h2 { margin: 28px 0 10px; font-size: 25px; }
        .calorie-info p, .calorie-info li { color: #4b5563; }
        .calorie-faq details { margin: 10px 0; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; padding: 15px 17px; }
        .calorie-faq summary { font-weight: 700; cursor: pointer; }
        .calorie-faq details p { margin-bottom: 0; }
        @media (max-width: 650px) {
            .calorie-form, .calorie-metrics { grid-template-columns: 1fr; }
            .calorie-full { grid-column: auto; }
            .calorie-card { padding: 20px; }
            .calorie-actions { flex-direction: column; }
        }


/* Calorie calculator shared design refinements */
.calorie-card { max-width: 1000px; }
.calorie-form-title { margin: 0 0 6px; color: var(--text); }
.calorie-adult-notice { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.calorie-intro h1 { color: var(--text); }
.calorie-results { border-color: #bfdbfe; background: #f8fbff; }
.calorie-metric strong { color: var(--primary); }
.calorie-units button:focus-visible, .calorie-sex button:focus-visible { outline: 3px solid rgba(37,99,235,.25); outline-offset: 2px; }
[dir="rtl"] .calorie-form, [dir="rtl"] .calorie-info { text-align: right; }
@media (max-width: 650px) { .calorie-card { padding: 20px; } }


/* Calorie calculator: match the rounded content cards used by the Invoice Generator */
.calorie-info.info-section {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 980px;
    margin: 28px auto 36px;
    padding: 26px;
    background: #fff;
    border: 1px solid var(--border, #dbe4ef);
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.045);
    color: var(--text, #0f172a);
}

.calorie-info.info-section h2 {
    margin: 0 0 14px;
    padding-top: 0;
    color: var(--text, #0f172a);
    font-size: clamp(21px, 2.2vw, 27px);
    line-height: 1.3;
    letter-spacing: -0.4px;
}

.calorie-info.info-section h2:not(:first-child) {
    margin-top: 28px;
}

.calorie-info.info-section p,
.calorie-info.info-section li {
    color: #475569;
    font-size: 15px;
    line-height: 1.7;
}

.calorie-info.info-section p { margin: 0 0 12px; }
.calorie-info.info-section ol,
.calorie-info.info-section ul { padding-left: 24px; }
.calorie-info.info-section li { margin-bottom: 8px; }
.calorie-info .calorie-faq { margin-top: 14px; }
.calorie-info .calorie-faq details {
    margin: 10px 0;
    padding: 15px 17px;
    background: #fff;
    border: 1px solid var(--border, #dbe4ef);
    border-radius: 10px;
}
.calorie-info .calorie-faq summary { font-weight: 700; cursor: pointer; }
.calorie-info .calorie-faq details p { margin: 10px 0 0; }

.calorie-card {
    box-sizing: border-box;
    max-width: 1000px;
    padding: 28px;
}
.calorie-form-title { font-size: 22px; line-height: 1.3; }
.calorie-actions .btn { min-height: 46px; }

@media (max-width: 700px) {
    .calorie-info.info-section {
        width: 100%;
        margin: 20px auto 28px;
        padding: 20px;
        border-radius: 14px;
    }
    .calorie-card { padding: 20px; }
}
