.beerxml-pro-tabs {
    margin-top: 20px;
}

.beerxml-pro-tab-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    border-bottom: 1px solid #ccc;
}

.beerxml-pro-tab-nav li {
    display: inline-block;
    margin-bottom: -1px;
}

.beerxml-pro-tab-nav a {
    display: inline-block;
    padding: 10px 15px;
    text-decoration: none;
    color: #0073aa;
    border: 1px solid transparent;
    border-bottom: none;
}

.beerxml-pro-tab-nav a.active {
    color: #000;
    border-color: #ccc;
    border-bottom: 1px solid #fff;
    background: #fff;
}

.beerxml-pro-tab-content {
    display: none;
    padding: 15px;
    border: 1px solid #ccc;
    background: #fff;
}

.beerxml-pro-tab-content.active {
    display: block;
}

.beerxml-pro-tab-content input.error,
.beerxml-pro-tab-content textarea.error {
    border: 2px solid red;
    background-color: #ffe6e6;
}

.beerxml-pro-download {
    text-size-adjust: 16px;
}

.beerxml-pro-style {
    margin-top: 10px;
}

.fermentables-title {
    margin-top: 20px;
}

/*Estilo para Recipe Details*/
.beerxml-details {
    margin-bottom: 20px;
}

.beerxml-details {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-bottom: 40px;
}

.beerxml-details-list li {
    margin-bottom: 5px;
    font-size: 14px;
}

.beerxml-details-label {
    font-weight: bold;
    display: inline;
    /* Hace que el <h3> se comporte como un elemento en línea */
    margin: 0;
    margin-right: 5px;
}

/**/
.beerxml-recipe h3 {
    margin-top: 20px;
    font-size: 1.5em;
}

.beerxml-recipe ul {
    list-style-type: disc;
    margin-left: 20px;
}

.beerxml-recipe li {
    margin-bottom: 5px;
}

.dynamic-fields {
    display: none;
    /* Asegurar que los campos dinámicos estén ocultos por defecto */
}

.dynamic-fields[style*="block"] {
    display: block !important;
    /* Forzar la visibilidad cuando se establece display: block */
}

.beerxml-recipe-type {
    font-weight: 600;
}

/* Recipe Details */
.recipe-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 10px;
}

.details-entry {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.recipe-details-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 10px;
}

.recipe-details-field select,
.recipe-details-field input {
    margin-right: 10px;
}

.recipe-details-field select {
    width: 100px;
    /* Ajusta el ancho del select */
    margin-right: 0;
}

/* Recipe Details Desktop Grid */
@media (min-width: 768px) {
    .recipe-details ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0 40px;
        width: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .recipe-details li {
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        justify-content: space-between;
    }
}

/*Estilo para la tabla Profile Water*/
.beerxml-water-profile td,
.beerxml-water-profile th {
    text-align: center;
}

.beerxml-water-profile th {
    background-color: #f9f9f9;
    color: #777;
    text-transform: uppercase;
    font-size: 0.75em;
    letter-spacing: 1px;
    padding: 15px 10px;
    border: none;
}

/* Water Profile Table Responsive */
.wp-short {
    display: none;
}

@media (max-width: 600px) {
    .beerxml-water-profile th {
        font-size: 0.65em;
        padding: 6px 2px;
        letter-spacing: 0;
    }

    .beerxml-water-profile td {
        font-size: 0.8em;
        padding: 5px 2px;
    }

    .beerxml-water-profile table {
        table-layout: fixed;
        width: 100%;
    }

    .wp-full {
        display: none;
    }

    .wp-short {
        display: inline;
    }

    .beerxml-water-profile th small {
        display: none;
    }
}

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

.beerxml-table td {
    padding: 8px;
    border: 1px solid #dddddd71;
}

/*Estilo para lupulo */

.hop-entry {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;

}

.hop-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 10px;
}

.hop-field label {
    margin-bottom: 5px;
}

.hop-delete {
    margin-top: 32px;
}

.hop-entry select,
.hop-entry input {
    margin-right: 10px;
}

/*Estilo para Misc*/
.misc-entry {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.misc-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 10px;
}

.misc-field label {

    margin-bottom: 5px;
}

.misc-field input,
.misc-field select {
    margin-right: 5px;
}

.misc-delete {
    margin-top: 32px;
}

/*Estilo para etapas de Mash*/
.mash-step-entry {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.mash-step-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 10px;
}

.mash-step-field input,
.mash-step-field select {
    margin-right: 5px;
}

.mash-step-delete {
    margin-top: 32px;
}

/*Estilo para etapas de Fermentación*/
.fermentation-step-entry {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.fermentation-step-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 10px;
}

.fermentation-step-field input,
.fermentation-step-field select {
    margin-right: 5px;
}

.fermentation-step-delete {
    margin-top: 32px;
}

[data-theme='dark'] .beerxml-water-profile th {
    background-color: #fff;
    color: black;
}





/* Estilos para el popup de selección de ingredientes */
.beerxml-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.beerxml-popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.beerxml-popup-content h3 {
    margin-top: 0;
    font-size: 1.3em;
    color: #23282d;
}

.beerxml-popup-content h4 {
    margin: 15px 0 5px;
    font-size: 1.1em;
    color: #444;
}

.beerxml-ingredient-list {
    margin: 10px 0;
}

.beerxml-ingredient-list label {
    display: block;
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

.beerxml-ingredient-list input[type="checkbox"] {
    margin-right: 8px;
}

.beerxml-popup-actions {
    margin-top: 20px;
    text-align: right;
}

.beerxml-popup-actions .button {
    margin-left: 10px;
}

.beerxml-confirm-import {
    background: #0073aa !important;
    border-color: #0073aa !important;
    color: #fff !important;
}

.beerxml-confirm-import:hover {
    background: #005d87 !important;
    border-color: #005d87 !important;
}

.beerxml-cancel-import {
    background: #f1f1f1 !important;
    border-color: #ccc !important;
    color: #444 !important;
}

.beerxml-cancel-import:hover {
    background: #e5e5e5 !important;
    border-color: #bbb !important;
}

.beerxml-ingredient-exists {
    color: #d63638;
    font-style: italic;
}

.beerxml-section {
    margin-bottom: 20px;
}

.beerxml-section h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.beerxml-pro-water-profile-metabox {
    padding: 10px;
}

.beerxml-pro-water-profile-metabox select {
    max-width: 100%;
}

.beerxml-pro-quick-select-water {
    text-decoration: none;
    color: #0073aa;
}

.beerxml-pro-quick-select-water:hover {
    text-decoration: underline;
    color: #005177;
}

.beerxml-pro-water-profile-metabox table.widefat {
    margin-top: 10px;
    width: 100%;
}

.beerxml-pro-water-profile-metabox table.widefat th {
    width: 150px;
    font-weight: bold;
}

/* Responsividad */
@media (max-width: 600px) {
    .beerxml-popup-content {
        width: 95%;
        padding: 15px;
    }

    .beerxml-popup-content h3 {
        font-size: 1.2em;
    }

    .beerxml-popup-content h4 {
        font-size: 1em;
    }

    .beerxml-ingredient-list label {
        font-size: 13px;
    }

    .beerxml-popup-actions .button {
        display: inline-block;
        margin: 5px 5px 0 0;
    }
}

/* ===== ESTILOS PARA IMPORTACIÓN DE RECETAS ===== */

/* Import Recipe Button */
.import-recipe-actions {
    padding: 15px 0;
    border-top: 1px solid #ddd;
    margin-top: 20px;
}

#beerxml-import-recipe-btn {
    font-size: 14px;
    height: auto;
    padding: 8px 16px;
    min-height: 30px;
}

#beerxml-import-recipe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#import-recipe-status {
    margin-top: 10px;
}

#import-recipe-status p {
    margin: 0;
    font-weight: 500;
    padding: 5px 0;
}

/* Tab locking styles */
.beerxml-pro-tab-nav a.tab-locked {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f1f1f1 !important;
    color: #666 !important;
}

.beerxml-pro-tab-nav a.tab-locked:hover {
    background-color: #f1f1f1 !important;
    color: #666 !important;
}

.beerxml-pro-tab-nav a.tab-locked:focus {
    background-color: #f1f1f1 !important;
    color: #666 !important;
    box-shadow: none;
}

/* Import validation message */
.import-validation-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 3px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
}

.import-validation-message p {
    margin: 0;
    color: #856404;
}

/* Success/Error status messages */
#import-recipe-status span[style*="green"] {
    color: #155724 !important;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
}

#import-recipe-status span[style*="red"] {
    color: #721c24 !important;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
}

/* Responsive improvements */
@media (max-width: 782px) {
    .import-recipe-actions {
        padding: 10px 0;
    }

    #beerxml-import-recipe-btn {
        width: 100%;
        text-align: center;
    }

    .beerxml-pro-tab-nav a.tab-locked {
        font-size: 12px;
    }
}

/* Loading state */
#beerxml-import-recipe-btn.loading {
    position: relative;
}

#beerxml-import-recipe-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== WATER PROFILES SEPARATED ROWS LAYOUT ===== */

.beerxml-water-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.beerxml-water-card {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* To clip the header background corners */
    transition: all 0.2s ease;
}

.beerxml-water-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: #c3c4c7;
    transform: translateY(-2px);
}

.beerxml-water-card h4 {
    margin: 0;
    padding: 15px 20px;
    font-size: 1.1rem;
    color: #1d2327;
    font-weight: 700;
    background: #fff;
    border-bottom: 1px solid #f0f0f1;
}

/* Common Grid Layout for Rows */
.beerxml-water-labels,
.beerxml-water-values {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    padding: 10px 20px;
    align-items: center;
}

/* Header Row Styling */
.beerxml-water-labels {
    background: #f8f9fa;
    /* Gray header background */
    border-bottom: 1px solid #e0e0e0;
}

.beerxml-water-labels span {
    font-size: 0.75rem;
    color: #646970;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Values Row Styling */
.beerxml-water-values {
    background: #fff;
    padding-top: 15px;
    padding-bottom: 15px;
}

.beerxml-water-values span {
    font-size: 1rem;
    color: #2c3338;
    font-weight: 500;
}

/* Responsive: Scroll on very small screens to maintain table layout */
@media (max-width: 600px) {
    .beerxml-water-card {
        overflow-x: auto;
    }

    .beerxml-water-labels,
    .beerxml-water-values {
        min-width: 500px;
        /* Force scroll if too narrow */
    }
}

/* Form Styles */
.beerxml-add-water-form {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 40px;
}

.beerxml-add-water-form h3 {
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #1d2327;
}

.water-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.water-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9em;
}

.water-form-field input {
    width: 100%;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 6px 10px;
}

button.beerxml-submit-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}


button.beerxml-submit-btn:hover {
    background: #135e96;
}

/* ===== WATER CALCULATOR v4 (Unified Card) ===== */

.wc-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 700px;
    margin: 0 auto;
    font-size: 14px;
}

.wc-main-card {
    background: #fff;
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Sections */
.wc-section {
    padding: 20px 24px;
}

.wc-section-muted {
    background: #fafafa;
}

.wc-section-highlight {
    background: linear-gradient(135deg, #f7f9fc 0%, #fff 100%);

}

.wc-section-results {
    background: #f8f9fa;
}

.wc-section-title {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wc-section-title small {
    font-weight: 400;
    color: #999;
    font-size: 12px;
}

.wc-section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.wc-section-header-flex .wc-section-title {
    margin: 0;
}

/* Divider */
.wc-divider {
    height: 1px;
    background: #e5e5e7;
}

/* Form Row */
.wc-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.wc-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-input-sm {
    flex: 0 0 80px;
}

.wc-input-grow {
    flex: 1;
}

.wc-input-group label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Inputs */
.wc-app input[type="number"],
.wc-app select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wc-app input:focus,
.wc-app select:focus {
    outline: none;
    border-color: #6b7c93;
    box-shadow: 0 0 0 3px rgba(107, 124, 147, 0.12);
}

/* Ions Grid */
.wc-ions-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.wc-ions-grid>div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wc-ions-grid label {
    font-size: 10px;
    color: #555;
    text-align: center;
    font-weight: 600;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wc-ions-grid label small {
    font-weight: 400;
    color: #999;
    font-size: 9px;
}

.wc-ions-grid input {
    text-align: center;
    padding: 4px 2px;
    font-size: 12px;
    min-width: 0;
    width: 100%;
}

.wc-ions-muted input {
    background: #f5f5f5;
}

/* Salts Grid */
.wc-salts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.wc-salts-grid>div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-salts-grid label {
    font-size: 12px;
    color: #555;
}

.wc-salts-grid small {
    color: #999;
}

/* Buttons */
.wc-actions {
    display: flex;
    gap: 8px;
}

.wc-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.wc-btn-primary {
    background: #6b7c93;
    color: #fff;
}

.wc-btn-primary:hover {
    background: #556070;
}

.wc-btn-secondary {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.wc-btn-secondary:hover {
    background: #f5f5f5;
}

/* Results Table - Adaptive Layout */
.wc-results-table {
    display: flex;
    flex-direction: column;
}

/* Hide mobile table on desktop */
.wc-results-mobile {
    display: none;
}

/* Desktop: Transposed (ions as columns, metrics as rows) */
.wc-results-desktop .wc-results-header,
.wc-results-desktop .wc-results-row {
    display: grid;
    grid-template-columns: 70px repeat(6, 1fr);
    gap: 4px;
    padding: 8px 0;
    align-items: center;
    text-align: center;
}

.wc-results-desktop .wc-results-header {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    border-bottom: 2px solid #e5e5e7;
    padding-bottom: 10px;
    font-weight: 600;
}

.wc-results-desktop .wc-results-row {
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

/* Mobile: Original (ions as rows) */
.wc-results-mobile .wc-results-header,
.wc-results-mobile .wc-results-row {
    display: grid;
    grid-template-columns: 70px repeat(6, 1fr);
    gap: 4px;
    padding: 8px 0;
    align-items: center;
    text-align: center;
}

.wc-results-mobile .wc-results-header {
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
    border-bottom: 2px solid #e5e5e7;
    padding-bottom: 10px;
    font-weight: 600;
}

.wc-results-mobile .wc-results-row {
    font-size: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.wc-col-ion {
    font-weight: 500;
    color: #333;
    text-align: left;
    font-size: 11px;
}

.wc-col-metric {
    font-weight: 500;
    color: #555;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
}

.wc-row-total {
    background: #f8f9fa;
}

.wc-row-total .wc-col-total {
    font-weight: 700;
}

.wc-val-added {
    color: #34c759;
}

.wc-col-total {
    font-weight: 700;
    color: #1d1d1f;
}

.wc-val-dilution {
    color: #4387c9;
}

.wc-val-target {
    color: #6b7c93;
}

.wc-val-diff {
    font-weight: 600;
}

.wc-val-diff.diff-neutral {
    color: #34c759;
}

.wc-val-diff.diff-positive {
    color: #ff9500;
}

.wc-val-diff.diff-negative {
    color: #ff3b30;
}

/* Ratio Box */
.wc-ratio-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e7;
}

.wc-ratio-box .wc-ratio-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}

.wc-ratio-box .wc-ratio-value {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
}

.wc-ratio-box .wc-ratio-desc {
    font-size: 13px;
    color: #666;
    background: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid #e5e5e7;
}

/* Responsive */
@media (max-width: 600px) {
    .wc-section {
        padding: 16px;
    }

    .wc-form-row {
        flex-direction: column;
    }

    .wc-input-sm {
        flex: auto;
    }

    .wc-ions-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }

    .wc-ions-grid label {
        font-size: 9px;
    }

    .wc-ions-grid label small {
        display: none;
    }

    .wc-ions-grid input {
        padding: 3px 1px;
        font-size: 11px;
    }

    .wc-salts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .wc-results-transposed .wc-results-header,
    .wc-results-transposed .wc-results-row {
        grid-template-columns: 55px repeat(6, 1fr);
        gap: 2px;
        font-size: 10px;
        padding: 6px 0;
    }

    .wc-col-metric {
        font-size: 9px;
    }

    .wc-section-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .wc-ratio-box {
        flex-wrap: wrap;
    }
}

/* Hide old styles */
.wc-container,
.wc-row,
.wc-panel {
    display: none;
}

.wc-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #1d1d1f;
}

.wc-icon {
    font-size: 16px;
}

.wc-optional {
    margin-left: auto;
    font-size: 11px;
    font-weight: 400;
    color: #999;
    text-transform: uppercase;
}

.wc-header-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* Inline Fields */
.wc-inline-fields {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.wc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-field-sm {
    flex: 0 0 70px;
}

.wc-field-grow {
    flex: 1;
}

.wc-field label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wc-field input,
.wc-field select,
.wc-container select,
.wc-container input[type="number"] {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.15s;
}

.wc-container input:focus,
.wc-container select:focus {
    outline: none;
    border-color: #f5a623;
    box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.15);
}

/* Ions Row */
.wc-ions-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.wc-ions-row>div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-ions-row label {
    font-size: 11px;
    color: #888;
    text-align: center;
    font-weight: 500;
}

.wc-ions-row input {
    text-align: center;
    padding: 6px 4px;
}

/* Target Layout */
.wc-target-layout {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.wc-target-layout>.wc-field {
    flex: 0 0 200px;
}

.wc-target-layout .wc-ions-inline {
    flex: 1;
}

/* Salts Row */
.wc-salts-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.wc-salt {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-salt span {
    font-size: 11px;
    color: #666;
    text-align: center;
}

.wc-salt input {
    text-align: center;
    padding: 8px 4px;
}

/* Buttons */
.wc-btn {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.wc-btn-primary {
    background: #f5a623;
    color: #fff;
}

.wc-btn-primary:hover {
    background: #e09600;
}

.wc-btn-ghost {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.wc-btn-ghost:hover {
    background: #f5f5f5;
}

/* Results Panel */
.wc-results-panel {
    background: #fafbfc;
    border: 1px solid #e5e5e7;
    border-radius: 6px;
    padding: 16px;
    width: 100%;
}

.wc-results-header,
.wc-results-row {
    display: grid;
    grid-template-columns: 60px repeat(5, 1fr);
    gap: 8px;
    padding: 8px 0;
    align-items: center;
    text-align: center;
}

.wc-results-header {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e5e7;
    padding-bottom: 10px;
    margin-bottom: 4px;
}

.wc-results-row {
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.wc-res-ion {
    font-weight: 600;
    color: #333;
    text-align: left;
}

.wc-res-added {
    color: #34c759;
}

.wc-res-total {
    font-weight: 700;
    color: #1d1d1f;
    background: #fff;
    padding: 4px;
    border-radius: 4px;
}

.wc-res-target {
    color: #f5a623;
}

.wc-res-diff {
    font-weight: 600;
}

.wc-res-diff.diff-neutral {
    color: #34c759;
}

.wc-res-diff.diff-positive {
    color: #ff9500;
}

.wc-res-diff.diff-negative {
    color: #ff3b30;
}

/* Ratio Bar */
.wc-ratio-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e5e7;
}

.wc-ratio-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

.wc-ratio-value {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
}

.wc-ratio-desc {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-row-2col {
        grid-template-columns: 1fr;
    }

    .wc-target-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .wc-target-layout>.wc-field {
        flex: auto;
    }

    .wc-ions-row,
    .wc-salts-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .wc-results-header,
    .wc-results-row {
        grid-template-columns: 50px repeat(5, 1fr);
        font-size: 11px;
    }

    .wc-ratio-bar {
        flex-wrap: wrap;
    }
}

/* Keep old styles for backward compat */
.beerxml-water-calc-container {
    display: none;
    /* Deprecated, use wc-container */
}

.calc-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    padding: 30px;
    border: 1px solid #f0f0f1;
}

.calc-header {
    margin-bottom: 25px;
    border-bottom: 2px solid #f5f5f7;
    padding-bottom: 15px;
}

.calc-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
}

.step-num {
    background: #0071e3;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    margin-right: 12px;
    font-weight: 700;
}

/* Inputs Groups */
.calc-input-group {
    margin-bottom: 20px;
}

.calc-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

.beerxml-select,
.beerxml-input-lg {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background-color: #fff;
}

.beerxml-select:focus,
.beerxml-input-lg:focus,
.input-wrap input:focus,
.salt-item input:focus {
    border-color: #0071e3;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

/* Grids */
.water-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #fbfbfd;
    border-radius: 10px;
    margin-bottom: 20px;
}

.input-wrap {
    display: flex;
    flex-direction: column;
}

.input-wrap label {
    font-size: 0.8rem;
    color: #86868b;
    margin-bottom: 5px;
    font-weight: 600;
}

.input-wrap input {
    width: 100%;
    padding: 8px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    text-align: center;
}

.salts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.salt-item label {
    display: block;
    font-size: 0.9rem;
    color: #1d1d1f;
    margin-bottom: 5px;
    font-weight: 500;
}

.salt-item small {
    color: #86868b;
    display: block;
    font-size: 0.75rem;
}

.salt-item input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    margin-top: 5px;
}

/* Results Table */
.beerxml-water-results-table {
    display: flex;
    flex-direction: column;
}

.res-header,
.res-row {
    display: grid;
    grid-template-columns: 1fr 100px;
    /* Label | Total */
    padding: 12px 0;
    align-items: center;
}

.res-header {
    border-bottom: 2px solid #e5e5e5;
    font-weight: 700;
    color: #86868b;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.res-row {
    border-bottom: 1px solid #f5f5f7;
}

.res-label {
    font-weight: 500;
    color: #1d1d1f;
}

.res-val {
    font-weight: 700;
    text-align: right;
    color: #0071e3;
    font-size: 1.1rem;
}

.res-footer-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f5f5f7;
    text-align: center;
}

.res-ratio-box span {
    display: block;
    font-size: 0.85rem;
    color: #86868b;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.res-ratio-box strong {
    font-size: 2rem;
    color: #1d1d1f;
    display: block;
}

.res-ratio-box small {
    display: inline-block;
    background: #eaf4ff;
    color: #0071e3;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* ===== WATER CALCULATOR V2 - Additional Styles ===== */

/* Flex Row Layout */
.calc-row-flex {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.volume-inline {
    flex: 0 0 120px;
}

.flex-grow {
    flex: 1;
}

.beerxml-input-sm {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

/* Buttons */
.calc-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
}

.beerxml-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.beerxml-btn.primary {
    background: linear-gradient(135deg, #0071e3 0%, #0056b3 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.beerxml-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.4);
}

.beerxml-btn.secondary {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}

.beerxml-btn.secondary:hover {
    background: #e8e8ed;
}

/* Results Table V2 (6 columns) */
.beerxml-water-results-table-v2 {
    display: flex;
    flex-direction: column;
}

.res-header-v2,
.res-row-v2 {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr;
    padding: 12px 0;
    align-items: center;
    gap: 10px;
}

.res-header-v2 {
    border-bottom: 2px solid #e5e5e5;
    font-weight: 700;
    color: #86868b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.res-row-v2 {
    border-bottom: 1px solid #f5f5f7;
}

.res-row-v2 .res-val {
    text-align: center;
    font-size: 0.95rem;
}

.res-row-v2 .res-total {
    font-weight: 800;
    color: #1d1d1f;
    background: #f5f5f7;
    padding: 4px 8px;
    border-radius: 6px;
}

.res-row-v2 .res-target {
    color: #0071e3;
}

.res-row-v2 .res-added {
    color: #34c759;
}

/* Diff Color Coding */
.res-diff.diff-neutral {
    color: #34c759;
    font-weight: 700;
}

.res-diff.diff-positive {
    color: #ff9500;
}

.res-diff.diff-negative {
    color: #ff3b30;
}

/* Responsive for v2 table */
@media (max-width: 768px) {

    .res-header-v2,
    .res-row-v2 {
        grid-template-columns: 1.2fr repeat(5, 1fr);
        font-size: 0.8rem;
    }

    .calc-row-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .volume-inline {
        flex: auto;
    }

    .calc-actions {
        flex-direction: column;
    }
}

/* Water Profile Responsive Actions */
@media (max-width: 768px) {
    .wc-desktop-actions {
        display: none !important;
    }

    .wc-mobile-actions {
        display: flex !important;
    }
}