* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* Tokens centralizados em profarm-tokens.css */


        body {
            font-family: var(--pf-font-sans);
            background: var(--bg-gradient);
            color: var(--text-primary);
            line-height: 1.6;
            min-height: 100vh;
        }

        .header {
            background: var(--gradient-green);
            color: var(--pf-on-primary);
            padding: 2rem 1rem;
            box-shadow: var(--shadow-lg);
            position: relative;
            overflow: hidden;
        }

        .header::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -10%;
            width: 50%;
            height: 200%;
            background: rgba(255,255,255,0.05);
            transform: rotate(35deg);
        }

        .header::after {
            content: '';
            position: absolute;
            bottom: -50%;
            left: -10%;
            width: 40%;
            height: 150%;
            background: rgba(0,0,0,0.1);
            transform: rotate(-25deg);
        }

        .header-content {
            max-width: 1400px;
            margin: 0 auto;
            position: relative;
            z-index: 1;
        }

        .header h1 {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .header-icon {
            font-size: 3rem;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .header p {
            font-size: 1.1rem;
            opacity: 0.95;
            max-width: 800px;
        }

        .planting-status-bar {
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(10px);
            padding: 0.75rem;
            border-radius: 8px;
            margin-top: 1rem;
            display: flex;
            gap: 2rem;
            flex-wrap: wrap;
        }

        .status-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .status-indicator {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            animation: blink 2s infinite;
        }

        @keyframes blink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .indicator-active {
            background: var(--pf-primary-soft);
        }

        .indicator-warning {
            background: var(--pf-warning);
        }

        .indicator-error {
            background: var(--pf-danger);
        }

        .nav-tabs {
            background: var(--pf-surface);
            box-shadow: var(--shadow);
            position: sticky;
            top: 0;
            z-index: 100;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .nav-tabs-inner {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            padding: 0 1rem;
            min-width: max-content;
        }

        .nav-tab {
            padding: 1rem 1.5rem;
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 1rem;
            font-weight: 500;
            position: relative;
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .nav-tab:hover {
            color: var(--primary);
            background: rgba(46, 125, 50, 0.05);
        }

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

        .nav-tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--primary);
        }

        .container {
            max-width: 1400px;
            margin: 2rem auto;
            padding: 0 1rem;
        }

        .tab-content {
            display: none;
            animation: fadeIn 0.3s ease;
        }

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

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .category-header {
            background: var(--pf-surface);
            padding: 1.5rem;
            border-radius: 12px;
            margin-bottom: 2rem;
            box-shadow: var(--shadow);
            border-left: 4px solid var(--primary);
        }

        .category-header h2 {
            color: var(--primary);
            margin-bottom: 0.5rem;
            font-size: 1.8rem;
        }

        .category-header p {
            color: var(--text-secondary);
            font-size: 1.05rem;
        }

        .planting-monitor {
            background: var(--gradient-green);
            color: var(--pf-on-primary);
            padding: 1.5rem;
            border-radius: 12px;
            margin-bottom: 2rem;
            box-shadow: var(--shadow-lg);
        }

        .planting-monitor h3 {
            margin-bottom: 1rem;
            font-size: 1.3rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

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

        .monitor-metric {
            text-align: center;
            padding: 1rem;
            background: rgba(255,255,255,0.1);
            border-radius: 8px;
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
        }

        .monitor-metric:hover {
            background: rgba(255,255,255,0.15);
            transform: translateY(-2px);
        }

        .metric-value {
            font-size: 1.8rem;
            font-weight: bold;
            margin-bottom: 0.25rem;
        }

        .metric-label {
            font-size: 0.9rem;
            opacity: 0.9;
        }

        .calculators-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
            gap: 1.5rem;
            margin-bottom: 3rem;
        }

        .calculator-card {
            background: var(--pf-surface);
            border-radius: 12px;
            padding: 1.5rem;
            box-shadow: var(--shadow);
            transition: all 0.3s ease;
            border: 1px solid var(--border);
            position: relative;
            overflow: hidden;
        }

        .calculator-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--gradient-green);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .calculator-card:hover::before {
            opacity: 1;
        }

        .calculator-card:hover {
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
        }

        .calculator-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid var(--bg-light);
        }

        .calculator-icon {
            font-size: 2rem;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--gradient-green);
            color: var(--pf-on-primary);
            border-radius: 10px;
        }

        .calculator-title {
            flex: 1;
        }

        .calculator-title h3 {
            font-size: 1.2rem;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
        }

        .calculator-title p {
            font-size: 0.9rem;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        .input-group {
            margin-bottom: 1.25rem;
        }

        .input-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: var(--text-primary);
            font-size: 0.95rem;
        }

        .input-group small {
            display: block;
            color: var(--text-secondary);
            font-size: 0.85rem;
            margin-top: 0.25rem;
        }

        .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .input-group input,
        .input-group select,
        .input-group textarea {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.3s ease;
            background: var(--pf-surface);
        }

        .input-group textarea {
            resize: vertical;
            min-height: 100px;
        }

        .input-group input:focus,
        .input-group select:focus,
        .input-group textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
        }

        .input-unit {
            position: absolute;
            right: 1rem;
            color: var(--text-secondary);
            font-weight: 500;
            pointer-events: none;
        }

        .btn {
            width: 100%;
            padding: 0.875rem;
            background: var(--gradient-green);
            color: var(--pf-on-primary);
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn-secondary {
            background: var(--gradient-seed);
        }

        .btn-secondary:hover {
            box-shadow: 0 4px 12px rgba(93, 64, 55, 0.3);
        }

        .result-box {
            margin-top: 1.5rem;
            padding: 1.25rem;
            background: linear-gradient(135deg, var(--pf-bg), var(--pf-primary-tint));
            border-radius: 8px;
            border: 2px solid var(--primary-light);
            display: none;
        }

        .result-box.show {
            display: block;
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .result-title {
            font-weight: 600;
            color: var(--primary-dark);
            margin-bottom: 0.75rem;
            font-size: 1.1rem;
        }

        .result-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.5rem 0;
            border-bottom: 1px solid rgba(0,0,0,0.1);
        }

        .result-item:last-child {
            border-bottom: none;
        }

        .result-label {
            color: var(--text-secondary);
            font-size: 0.95rem;
        }

        .result-value {
            font-weight: 600;
            color: var(--primary-dark);
            font-size: 1.1rem;
        }

        .alert {
            padding: 1rem;
            border-radius: 8px;
            margin-top: 1rem;
            display: none;
        }

        .alert.show {
            display: block;
        }

        .alert-success {
            background: var(--pf-primary-tint);
            border: 1px solid var(--pf-primary-soft);
            color: var(--pf-primary);
        }

        .alert-warning {
            background: var(--pf-warning-tint);
            border: 1px solid var(--pf-warning);
            color: var(--pf-warning);
        }

        .alert-danger {
            background: var(--pf-danger-tint);
            border: 1px solid var(--pf-danger);
            color: var(--pf-danger);
        }

        .alert-info {
            background: var(--pf-info-tint);
            border: 1px solid var(--pf-info);
            color: var(--pf-info);
        }

        .tutorial-section {
            background: var(--pf-surface);
            border-radius: 12px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: var(--shadow);
        }

        .tutorial-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid var(--bg-light);
        }

        .tutorial-steps {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            margin-top: 1.5rem;
        }

        .tutorial-step {
            padding: 1.25rem;
            background: var(--bg-light);
            border-radius: 8px;
            border-left: 4px solid var(--primary);
            transition: all 0.3s ease;
        }

        .tutorial-step:hover {
            background: var(--pf-surface);
            box-shadow: var(--shadow);
            transform: translateX(4px);
        }

        .step-number {
            display: inline-block;
            width: 30px;
            height: 30px;
            background: var(--pf-primary-surface);
            color: var(--pf-on-primary);
            border-radius: 50%;
            text-align: center;
            line-height: 30px;
            font-weight: bold;
            margin-bottom: 0.5rem;
        }

        .progress-bar {
            width: 100%;
            height: 8px;
            background: var(--bg-light);
            border-radius: 4px;
            overflow: hidden;
            margin: 1rem 0;
        }

        .progress-fill {
            height: 100%;
            background: var(--gradient-green);
            transition: width 0.3s ease;
        }

        .info-box {
            background: var(--pf-primary-tint);
            border-left: 4px solid var(--primary);
            padding: 1rem;
            border-radius: 4px;
            margin: 1rem 0;
        }

        .info-box-title {
            font-weight: 600;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }

        .info-box-content {
            color: var(--pf-text-2);
            font-size: 0.85rem;
        }

        .diagnostic-table {
            width: 100%;
            margin-top: 1rem;
            border-collapse: collapse;
            background: var(--pf-surface);
            border-radius: 8px;
            overflow: hidden;
        }

        .diagnostic-table th {
            background: var(--pf-primary-surface);
            color: var(--pf-on-primary);
            padding: 0.75rem;
            text-align: left;
            font-weight: 500;
        }

        .diagnostic-table td {
            padding: 0.75rem;
            border-bottom: 1px solid var(--border);
        }

        .diagnostic-table tr:hover {
            background: var(--bg-light);
        }

        .tips-section {
            background: var(--pf-surface);
            border-radius: 12px;
            padding: 2rem;
            margin-top: 3rem;
            box-shadow: var(--shadow);
        }

        .tips-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid var(--bg-light);
        }

        .tips-header h2 {
            color: var(--primary);
            font-size: 1.6rem;
        }

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

        .tip-card {
            padding: 1.25rem;
            background: var(--bg-light);
            border-radius: 8px;
            border-left: 4px solid var(--secondary);
            transition: all 0.3s ease;
        }

        .tip-card:hover {
            background: var(--pf-surface);
            box-shadow: var(--shadow);
            transform: translateX(4px);
        }

        .tip-card h3 {
            color: var(--secondary);
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .tip-card p {
            color: var(--text-secondary);
            line-height: 1.6;
        }

        .footer {
            background: var(--pf-primary-surface);
            color: var(--pf-on-primary);
            text-align: center;
            padding: 2rem 1rem;
            margin-top: 4rem;
        }

        .footer p {
            margin-bottom: 0.5rem;
        }

        .checkbox-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            margin: 1rem 0;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .checkbox-item input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
        }

        .visual-demo {
            background: var(--pf-surface);
            border: 2px solid var(--primary);
            border-radius: 8px;
            padding: 1rem;
            margin: 1rem 0;
            position: relative;
            height: 200px;
        }

        .seed-row {
            display: flex;
            justify-content: space-around;
            align-items: center;
            height: 100%;
        }

        .seed-icon {
            width: 30px;
            height: 30px;
            background: var(--seed-brown);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--pf-on-primary);
            font-size: 0.8rem;
        }

        @media (max-width: 768px) {
            .header h1 {
                font-size: 1.8rem;
            }

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

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

            .nav-tabs-inner {
                padding: 0 0.5rem;
            }

            .nav-tab {
                padding: 1rem;
                font-size: 0.9rem;
            }

            .container {
                padding: 0 0.5rem;
            }

            .monitor-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .counter-demo {
            text-align: center;
            padding: 2rem;
            background: var(--bg-light);
            border-radius: 8px;
            margin: 1rem 0;
        }

        .counter-display {
            font-size: 3rem;
            font-weight: bold;
            color: var(--primary);
            margin: 1rem 0;
            font-family: var(--pf-font-mono);
        }

        .counter-btn {
            padding: 1rem 2rem;
            background: var(--pf-primary-surface);
            color: var(--pf-on-primary);
            border: none;
            border-radius: 8px;
            font-size: 1.2rem;
            cursor: pointer;
            margin: 0.5rem;
        }

        .counter-btn:hover {
            background: var(--pf-primary-surface);
        }

        .measurement-visual {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
            gap: 1rem;
            margin: 1rem 0;
        }

        .measurement-item {
            text-align: center;
            padding: 1rem;
            background: var(--pf-surface);
            border: 2px solid var(--primary);
            border-radius: 8px;
        }

        .measurement-value {
            font-size: 1.5rem;
            font-weight: bold;
            color: var(--primary);
        }

        .measurement-label {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-top: 0.5rem;
        }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media(max-width: 400px) { .row { grid-template-columns: 1fr; } }

/* ── BOTÃO DE VOLTAR (back-btn) ── */
.back-btn {
    display: inline-flex;
    align-items: center;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}
.back-btn:hover { color: var(--pf-on-primary); }

/* ── ALERT INLINE (geradas por JS) ── */
.ok, .alert.ok   { background:var(--pf-primary-tint); color:var(--pf-primary); border-radius:6px; padding:10px 12px; margin-top:10px; font-size:0.9rem; }
.warn, .alert.warn { background:var(--pf-warning-tint); color:var(--pf-warning); border-radius:6px; padding:10px 12px; margin-top:10px; font-size:0.9rem; }
.err, .alert.err  { background:var(--pf-danger-tint); color:var(--pf-danger); border-radius:6px; padding:10px 12px; margin-top:10px; font-size:0.9rem; }


/* ===================================================
   ALIASES DE COMPATIBILIDADE — Classes Legadas
   Garante que calculadoras migradas do design antigo
   renderizem corretamente com o Design System ProFarm
   =================================================== */

/* Header legado */
.header-section {
    display: none; /* Substituído por header.header via JS/migração */
}

/* Cabeçalho de card legado */
.calculator-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 14px 0;
    border-bottom: 2px solid rgba(0,0,0,0.07);
    margin-bottom: 14px;
}

/* Botões com variantes de cor legadas */
.btn.spreader,
.btn.planter,
.btn.automation,
.btn.precision,
.btn.harvester { background: var(--gradient-green); }

/* Section divider legado */
.section-divider {
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary);
}
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Alias de .results para .result-box (migração parcial) */
.results {
    background: var(--bg-secondary, var(--pf-surface-2));
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 14px;
    margin-top: 14px;
    display: none;
}
.results.show, .results:not(:empty) { display: block; }

/* calc-description -> agora é info-box, mas alias por segurança */
.calc-description {
    font-size: 0.88rem;
    color: var(--pf-text-2);
    margin-bottom: 14px;
    padding: 10px;
    background: var(--pf-surface-2);
    border-radius: 6px;
}

/* form-control legado -> idêntico ao input-group input */
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--pf-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--pf-surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,125,70,0.12);
}

/* unit-helper legado */
.unit-helper {
    font-size: 0.78rem;
    color: var(--pf-text-3);
    margin-top: 4px;
}

/* Alert box legado */
.alert-box {
    background: var(--pf-warning-tint);
    border-left: 4px solid var(--pf-warning);
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 14px;
    font-size: 0.9rem;
}
.alert-title {
    font-weight: 700;
    color: var(--pf-warning);
    margin-bottom: 4px;
}

/* Tutorial steps legados */
.tutorial-section { margin-bottom: 2rem; }
.tutorial-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.tutorial-btn {
    padding: 8px 16px;
    border: 2px solid var(--primary);
    border-radius: 20px;
    background: transparent;
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.tutorial-btn.active, .tutorial-btn:hover {
    background: var(--pf-primary-surface);
    color: var(--pf-on-primary);
}
.tutorial-step { display: none; }
.tutorial-step.active { display: block; }
.step-header { margin-bottom: 1rem; }
.step-title { color: var(--primary-dark); font-size: 1.1rem; margin: 0; }
.step-subtitle { color: var(--pf-text-2); font-size: 0.9rem; margin: 4px 0 0; }
.tutorial-content { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media(max-width: 768px) { .tutorial-content { grid-template-columns: 1fr; } }
.tutorial-visual { background: var(--pf-surface-2); border-radius: 12px; padding: 1.5rem; }
.tutorial-instructions { }
.instruction-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.instruction-item { display: flex; gap: 12px; align-items: flex-start; }
.instruction-number {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--pf-primary-surface); color: var(--pf-on-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.instruction-title { font-weight: 600; color: var(--primary-dark); margin-bottom: 2px; }
.instruction-text { font-size: 0.9rem; color: var(--pf-text-2); }

/* Tips section legado */
.tips-section { margin-top: 2rem; }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1rem; }
.tip-card {
    background: var(--pf-surface);
    border: 1px solid var(--pf-border);
    border-radius: 10px;
    padding: 1.2rem;
    transition: box-shadow 0.2s;
}
.tip-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.tip-card h3 { color: var(--primary-dark); margin: 0 0 8px; }
.tip-card p { color: var(--pf-text-2); font-size: 0.88rem; margin: 0; }
.tip-title { font-weight: 700; }

/* Footer — padronizado para todas as calculadoras */
.footer {
    background: var(--pf-surface);
    text-align: center;
    padding: 1.5rem 1rem 2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 3rem;
    border-top: 2px solid var(--border);
}
.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.footer a:hover { text-decoration: underline; }

/* ===================================================
   PRO FARM CALC DESIGN SYSTEM 2026
   Camada final de padronizacao visual para todas as
   calculadoras. Mantem a logica existente e neutraliza
   variacoes locais de cor, espacamento e diagramacao.
   =================================================== */

/* Tokens desta camada agora vêm de profarm-tokens.css (sem !important,
   para que o tema escuro possa sobrescrevê-los). */

html {
    background: var(--bg-light);
    scroll-padding-top: 76px;
}

body {
    font-family: var(--pf-font-sans) !important;
    background:
        radial-gradient(circle at top left, rgba(45, 155, 87, 0.10), transparent 34rem),
        linear-gradient(180deg, var(--pf-surface-2) 0%, var(--bg-light) 100%) !important;
    color: var(--text-primary) !important;
    font-size: 16px;
    letter-spacing: 0;
}

body > .header {
    background: var(--gradient-green) !important;
    color: var(--pf-on-primary);
    padding: clamp(1.25rem, 3vw, 2rem) 1rem 1.35rem !important;
    box-shadow: var(--shadow-lg);
}

body > .header::before,
body > .header::after {
    opacity: 0.75;
}

.header-content {
    max-width: 1200px !important;
}

.back-btn {
    width: max-content;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px;
    background: rgba(255,255,255,0.11);
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255,255,255,0.18);
    text-decoration: none;
}

.header h1 {
    max-width: 980px;
    margin-top: 0.35rem;
    font-size: clamp(1.55rem, 3.2vw, 2.45rem) !important;
    line-height: 1.12 !important;
    letter-spacing: 0;
}

.header-icon {
    width: clamp(2.7rem, 6vw, 3.25rem);
    height: clamp(2.7rem, 6vw, 3.25rem);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.16);
    font-size: clamp(1.45rem, 4vw, 1.9rem) !important;
    animation: none !important;
}

.header p {
    max-width: 820px;
    margin-top: 0.65rem;
    color: rgba(255,255,255,0.82);
    font-size: clamp(0.92rem, 1.6vw, 1.05rem) !important;
}

.planting-status-bar,
.soil-status-bar,
.status-bar {
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px !important;
    background: rgba(255,255,255,0.11) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.nav-tabs {
    top: 0;
    background: rgba(255,255,255,0.92) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 24px rgba(26,107,60,0.08) !important;
    backdrop-filter: blur(16px);
}

.nav-tabs-inner {
    max-width: 1200px !important;
    gap: 0.35rem;
    padding: 0.55rem 1rem !important;
}

.nav-tab,
.tutorial-btn,
.toggle-option,
.filter-chip {
    min-height: 42px;
    border-radius: 999px !important;
    border: 1px solid var(--border) !important;
    background: var(--surface-soft) !important;
    color: var(--text-secondary) !important;
    font-weight: 700 !important;
    letter-spacing: 0;
}

.nav-tab {
    padding: 0.68rem 1rem !important;
}

.nav-tab::after {
    display: none;
}

.nav-tab:hover,
.tutorial-btn:hover,
.nav-tab.active,
.tutorial-btn.active,
.toggle-option.active,
.filter-chip.active {
    background: var(--pf-primary-surface) !important;
    border-color: var(--pf-primary-surface) !important;
    color: var(--pf-on-primary) !important;
    box-shadow: 0 8px 22px rgba(26,107,60,0.18);
}

.container {
    max-width: 1200px !important;
    margin: clamp(1rem, 3vw, 2rem) auto !important;
    padding: 0 1rem 3rem !important;
}

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

.category-header,
.tutorial-section,
.tips-section,
.calculator-card,
.card,
.stat-card,
.soil-analysis-widget,
.planting-monitor,
.dashboard,
.prices-section,
.analysis-panel,
.content-card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow) !important;
}

.category-header {
    border-left: 0 !important;
    padding: clamp(1.1rem, 2vw, 1.5rem) !important;
}

.category-header h2,
.tutorial-section h2,
.tutorial-section h3,
.tutorial-section h4,
.tutorial-visual h4,
.tutorial-header h2,
.tutorial-header h3,
.tips-header h2,
.section-title,
.step-title,
.calculator-title h3,
.card h2,
.dashboard h2 {
    color: var(--primary-dark) !important;
    letter-spacing: 0;
}

.category-header p,
.calculator-title p,
.step-subtitle,
.tip-card p,
.info-box-content,
.instruction-text,
.unit-helper,
.calc-description,
small {
    color: var(--text-secondary) !important;
}

.calculators-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)) !important;
    gap: 1rem !important;
}

.calculator-card {
    padding: clamp(1rem, 2vw, 1.35rem) !important;
    overflow: hidden;
}

.calculator-card::before {
    opacity: 1 !important;
    height: 4px !important;
}

.calculator-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg) !important;
}

.calculator-header {
    gap: 0.85rem !important;
    padding-bottom: 0.85rem !important;
    margin-bottom: 1rem !important;
    border-bottom: 1px solid var(--border) !important;
}

.calculator-icon,
.title-icon,
.stat-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--pf-primary) 13%, var(--pf-surface)) !important;
    color: var(--primary-dark) !important;
    font-size: 1.35rem !important;
}

.calculator-title h3 {
    font-size: 1.04rem !important;
    line-height: 1.28;
}

.input-group {
    margin-bottom: 1rem !important;
}

.input-group label,
.form-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-primary) !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
}

.input-group input,
.input-group select,
.input-group textarea,
.form-control,
.form-input,
.form-select,
.filter-input {
    min-height: 46px;
    width: 100%;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface-soft) !important;
    color: var(--text-primary) !important;
    font: inherit;
    font-size: 1rem !important;
    box-shadow: none !important;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus,
.form-control:focus,
.form-input:focus,
.form-select:focus,
.filter-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(26,107,60,0.12) !important;
}

.row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.85rem !important;
}

.btn,
.counter-btn,
button.utility {
    min-height: 46px;
    border-radius: var(--radius-sm) !important;
    background: var(--pf-primary-surface) !important;
    color: var(--pf-on-primary) !important;
    font-weight: 800 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: 0 10px 24px rgba(26,107,60,0.16);
}

.btn:hover,
.counter-btn:hover {
    background: var(--pf-primary-surface) !important;
    transform: translateY(-1px);
}

.result-box,
.results {
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border)) !important;
    border-left: 4px solid var(--primary) !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, var(--pf-surface-2) 0%, var(--pf-primary-tint) 100%) !important;
    padding: 1rem !important;
}

.result-title,
.results-header {
    color: var(--primary-dark) !important;
    font-weight: 800 !important;
}

.result-item {
    gap: 0.75rem;
    border-bottom: 1px solid rgba(26,107,60,0.12) !important;
}

.result-label {
    color: var(--text-secondary) !important;
}

.result-value,
.stat-value,
.metric-value,
.soil-metric-value {
    color: var(--primary-dark) !important;
    font-weight: 800 !important;
}

.info-box,
.calc-description,
.alert-box {
    border: 1px solid var(--border) !important;
    border-left: 4px solid var(--primary) !important;
    border-radius: 12px !important;
    background: var(--surface-soft) !important;
}

.alert,
.ok,
.warn,
.err {
    border-radius: 12px !important;
    border-width: 1px !important;
}

.diagnostic-table,
table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.diagnostic-table th,
table th {
    background: var(--pf-primary-surface) !important;
    color: var(--pf-on-primary) !important;
    font-weight: 800 !important;
}

.diagnostic-table th,
.diagnostic-table td,
table th,
table td {
    padding: 0.72rem !important;
    border-bottom: 1px solid var(--border) !important;
}

.diagnostic-table tr:last-child td,
table tr:last-child td {
    border-bottom: 0 !important;
}

.tutorial-section,
.tips-section {
    padding: clamp(1rem, 2.5vw, 1.6rem) !important;
}

.tutorial-nav {
    padding: 0.25rem;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.tutorial-steps {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
}

.tutorial-steps .tutorial-step {
    display: block !important;
}

.tutorial-section > .tutorial-step:not(.active) {
    display: none;
}

.tutorial-section > .tutorial-step.active {
    display: block;
}

.tutorial-step,
.tip-card,
.monitor-metric,
.soil-metric,
.highlight-box,
.measurement-item {
    border-radius: 12px !important;
    background: var(--surface-soft) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
}

.step-number,
.instruction-number {
    background: var(--pf-primary-surface) !important;
}

.progress-bar {
    background: var(--pf-border) !important;
    border-radius: 999px !important;
}

.progress-fill {
    background: var(--primary) !important;
    border-radius: 999px !important;
}

.visual-demo,
.tutorial-visual,
.counter-demo,
.measurement-visual {
    border-color: var(--border) !important;
    background: var(--surface-soft) !important;
    border-radius: var(--radius) !important;
}

.planting-monitor,
.soil-analysis-widget {
    padding: clamp(1rem, 2vw, 1.35rem) !important;
}

.planting-monitor {
    background: var(--pf-primary-surface) !important;
    color: var(--pf-on-primary) !important;
}

.planting-monitor .monitor-metric {
    background: rgba(255,255,255,0.14) !important;
    border-color: rgba(255,255,255,0.22) !important;
}

.planting-monitor .metric-value,
.planting-monitor .metric-label,
.planting-monitor h3 {
    color: var(--pf-on-primary) !important;
}

.monitor-grid,
.soil-metrics,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 0.8rem;
}

.footer,
footer {
    max-width: 1200px;
    margin: 2rem auto 0 !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    background: var(--surface) !important;
    color: var(--text-secondary) !important;
    box-shadow: var(--shadow);
}

.tab-content > .header,
.tab-content .header.fade-in {
    padding: 0 !important;
    margin: 0 0 1rem !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

.tab-content > .header::before,
.tab-content > .header::after,
.tab-content .header.fade-in::before,
.tab-content .header.fade-in::after {
    display: none !important;
}

.header-card,
.dashboard,
.prices-section {
    padding: clamp(1rem, 2vw, 1.35rem) !important;
}

.main-title,
.subtitle {
    color: var(--primary-dark) !important;
    text-shadow: none !important;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 1rem;
}

.calculator-form,
.filters-bar,
.status-indicators {
    display: grid;
    gap: 0.8rem;
}

.filters-bar,
.status-indicators {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

ul,
ol {
    padding-left: 1.25rem;
}

li + li {
    margin-top: 0.25rem;
}

hr {
    border: 0 !important;
    border-top: 1px solid var(--border) !important;
}

.procalc-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.86rem;
}

.procalc-footer strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.procalc-report-tools {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.procalc-report-tools .btn {
    width: auto;
    min-width: 150px;
}

@media (max-width: 760px) {
    body > .header {
        padding-top: 1rem !important;
    }

    .header h1 {
        display: grid !important;
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 0.75rem !important;
    }

    .nav-tabs-inner {
        padding: 0.5rem !important;
    }

    .nav-tab {
        padding: 0.6rem 0.82rem !important;
        font-size: 0.88rem !important;
    }

    .container {
        padding-inline: 0.75rem !important;
    }

    .row {
        grid-template-columns: 1fr !important;
    }

    .calculator-card,
    .tutorial-section,
    .category-header {
        border-radius: 14px !important;
    }

    .result-item {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 0.2rem;
    }
}

/* ──────────────────────────────────────────────────────────────────────────
   UPGRADED & STANDARDIZED DESIGN SYSTEM: DARK MODE & COMPONENT OVERHAUL
   ────────────────────────────────────────────────────────────────────────── */

/* ── Dark Mode Style Normalizations ── */
html[data-theme="dark"] .calculator-card,
html[data-theme="dark"] .nav-tabs,
html[data-theme="dark"] .category-header,
html[data-theme="dark"] .tutorial-section,
html[data-theme="dark"] .diagnostic-table,
html[data-theme="dark"] .tips-section,
html[data-theme="dark"] .tip-card,
html[data-theme="dark"] .visual-demo,
html[data-theme="dark"] .input-group input,
html[data-theme="dark"] .input-group select,
html[data-theme="dark"] .input-group textarea {
    background: var(--surf) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}
html[data-theme="dark"] .input-group input:focus,
html[data-theme="dark"] .input-group select:focus,
html[data-theme="dark"] .input-group textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15) !important;
}
html[data-theme="dark"] .nav-tab {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .nav-tab:hover {
    color: var(--primary) !important;
    background: rgba(74, 222, 128, 0.06) !important;
}
html[data-theme="dark"] .nav-tab.active::after {
    background: var(--primary) !important;
}
html[data-theme="dark"] .diagnostic-table th {
    background: var(--pf-primary-surface) !important;
    color: var(--pf-on-primary) !important;
}
html[data-theme="dark"] .diagnostic-table td {
    border-bottom-color: var(--border) !important;
}
html[data-theme="dark"] .diagnostic-table tr:hover {
    background: var(--bg-light) !important;
}
html[data-theme="dark"] .tutorial-step {
    background: var(--bg-light) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .tutorial-step:hover {
    background: var(--surf) !important;
}
html[data-theme="dark"] .info-box {
    background: var(--bg-light) !important;
    border-left-color: var(--primary) !important;
}
html[data-theme="dark"] .info-box-content {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .result-box {
    background: var(--bg-light) !important;
    border-color: var(--primary) !important;
}
html[data-theme="dark"] .result-value {
    color: var(--primary) !important;
}
html[data-theme="dark"] .result-label {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .result-item {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] .result-title {
    color: var(--primary-light) !important;
}
html[data-theme="dark"] hr {
    border-top-color: var(--border) !important;
}
html[data-theme="dark"] .main-title,
html[data-theme="dark"] .subtitle {
    color: var(--primary-light) !important;
}
html[data-theme="dark"] footer,
html[data-theme="dark"] .footer {
    background: var(--surf) !important;
    border-color: var(--border) !important;
}
html[data-theme="dark"] .procalc-footer strong {
    color: var(--primary-light) !important;
}

/* ── Interactive Tutorial Navigation & Stepper ── */
.tutorial-nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.tutorial-btn {
    padding: 0.6rem 1.2rem;
    background: var(--surf2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
}
.tutorial-btn:hover {
    color: var(--primary);
    border-color: var(--primary-light);
    background: rgba(46, 125, 50, 0.05);
}
.tutorial-btn.active {
    color: var(--pf-on-primary);
    background: var(--gradient-green);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.2);
}
html[data-theme="dark"] .tutorial-btn.active {
    color: var(--bg-white);
    box-shadow: 0 4px 10px rgba(74, 222, 128, 0.2);
}
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2rem;
}
.progress-fill {
    height: 100%;
    background: var(--gradient-green);
    border-radius: 3px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Formatting Practical Tips & Examples (No More Loose Text) ── */
.practical-tip, .application-example {
    margin: 1.25rem 0 0.5rem;
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.practical-tip:hover, .application-example:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.practical-tip {
    background: var(--pf-warning-tint);
    border: 1px solid var(--pf-border);
    border-left: 5px solid var(--secondary);
    color: var(--pf-warning);
}
.application-example {
    background: var(--pf-info-tint);
    border: 1px solid var(--pf-border);
    border-left: 5px solid var(--info);
    color: var(--pf-info);
}
.practical-tip-title, .application-example-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.practical-tip-title {
    color: var(--secondary) !important;
}
.application-example-title {
    color: var(--info) !important;
}

/* ── Interactive Visual Diagrams for Tutorials ── */

/* Multimeter Widget */
.multimeter {
    background: linear-gradient(135deg, var(--pf-accent) 0%, var(--pf-warning) 100%) !important;
    border: 5px solid var(--pf-text) !important;
    border-radius: 16px;
    padding: 1.2rem;
    width: 240px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg), inset 0 2px 4px rgba(255,255,255,0.3);
}
.multimeter-display {
    background: var(--pf-primary-tint) !important;
    border: 3px solid var(--pf-primary-strong) !important;
    border-radius: 8px;
    font-family: var(--pf-font-mono);
    font-weight: bold;
    font-size: 1.8rem;
    color: var(--pf-primary-strong) !important;
    text-align: right;
    padding: 0.5rem 0.8rem;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
    margin-bottom: 1rem;
}
.multimeter-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}
.multimeter-btn {
    background: var(--pf-text-2) !important;
    border: 1px solid var(--pf-text) !important;
    border-radius: 6px;
    color: var(--pf-on-primary) !important;
    font-size: 0.72rem;
    font-weight: bold;
    padding: 0.5rem 0.2rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.5);
}
.multimeter-btn:hover {
    background: var(--pf-text-2) !important;
}
.multimeter-btn:active {
    transform: scale(0.95);
    background: var(--pf-text) !important;
}

/* CAN Bus Display */
.can-bus-display {
    background: var(--pf-diagram-screen) !important;
    border: 2px solid var(--pf-text) !important;
    border-radius: 8px;
    padding: 0.8rem;
    font-family: var(--pf-font-mono);
    font-size: 0.78rem;
    color: var(--pf-diagram-glow) !important;
    height: 150px;
    overflow-y: auto;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: left;
}
.can-message {
    animation: fadeTerminalIn 0.3s ease;
}
@keyframes fadeTerminalIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Electrical System Schema */
.electrical-system {
    position: relative;
    width: 100%;
    height: 220px;
    background: var(--pf-diagram-bg) !important;
    border-radius: 12px;
    border: 2px solid var(--pf-diagram-line) !important;
    overflow: hidden;
    margin-bottom: 1rem;
}
.battery, .alternator, .ecu, .sensor {
    position: absolute;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    color: var(--pf-on-primary) !important;
}
.battery {
    top: 20px;
    left: 20px;
    width: 60px;
    height: 40px;
    background: var(--pf-danger) !important;
    border: 2px solid var(--pf-danger) !important;
}
.alternator {
    top: 20px;
    right: 20px;
    width: 60px;
    height: 40px;
    background: var(--pf-info) !important;
    border: 2px solid var(--pf-info) !important;
}
.ecu {
    top: 100px;
    left: calc(50% - 35px);
    width: 70px;
    height: 50px;
    background: var(--pf-success) !important;
    border: 2px solid var(--pf-success) !important;
}
.sensor {
    width: 24px;
    height: 24px;
    background: var(--pf-accent-strong) !important;
    border: 2px solid var(--pf-warning) !important;
    border-radius: 50%;
}
.wire {
    position: absolute;
    height: 4px;
    background: var(--pf-diagram-wire) !important;
    z-index: 0;
}
.wire.animated {
    background: linear-gradient(90deg, var(--pf-diagram-wire) 0%, var(--pf-accent) 50%, var(--pf-diagram-wire) 100%) !important;
    background-size: 200% 100% !important;
    animation: flowPulse 2s linear infinite;
}
@keyframes flowPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Spreader Diagram */
.spreader-diagram {
    position: relative;
    width: 100%;
    height: 180px;
    background: var(--pf-diagram-line) !important;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hopper {
    position: absolute;
    top: 20px;
    width: 80px;
    height: 60px;
    background: var(--pf-diagram-light) !important;
    clip-path: polygon(0% 0%, 100% 0%, 80% 100%, 20% 100%);
    border-bottom: 4px solid var(--pf-diagram-wire) !important;
}
.spreader-body {
    position: absolute;
    top: 80px;
    width: 90px;
    height: 30px;
    background: var(--pf-diagram-metal) !important;
    border-radius: 4px;
    color: var(--pf-on-primary) !important;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.disc {
    position: absolute;
    width: 32px;
    height: 8px;
    background: var(--pf-accent-strong) !important;
    border-radius: 50%;
    animation: spinDisc 0.8s linear infinite;
}
@keyframes spinDisc {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}
.fertilizer-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--pf-diagram-tint) !important;
    border-radius: 50%;
    animation: scatterParticle 1.5s ease-out infinite;
}
@keyframes scatterParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--spread-x, 80px), var(--spread-y, 60px)) scale(0.5);
        opacity: 0;
    }
}

/* Planter Diagram */
.planter-diagram {
    position: relative;
    width: 100%;
    height: 180px;
    background: var(--pf-diagram-bg-deep) !important;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.planter-body {
    position: absolute;
    top: 30px;
    left: 40px;
    right: 40px;
    height: 25px;
    background: var(--pf-danger) !important;
    border-radius: 4px;
    border: 2px solid var(--pf-danger) !important;
}
.fertilizer-tube, .seed-tube {
    position: absolute;
    width: 6px;
    height: 80px;
    background: var(--pf-diagram-metal) !important;
    top: 55px;
}
.fertilizer-tube {
    background: var(--pf-info) !important;
}
.seed-tube {
    background: var(--pf-danger) !important;
    left: calc(50% - 3px);
}
.furrow {
    position: absolute;
    bottom: 20px;
    left: 10px;
    right: 10px;
    height: 15px;
    background: var(--pf-warning) !important;
    border-radius: 100px / 10px;
}

/* Tractor Diagram (Lastro) */
.tractor-diagram {
    position: relative;
    width: 100%;
    height: 160px;
    background: var(--pf-diagram-bg) !important;
    border-radius: 12px;
    border: 2px solid var(--pf-diagram-line) !important;
    margin-bottom: 1rem;
    overflow: hidden;
}
.tractor-body {
    position: absolute;
    top: 40px;
    left: calc(50% - 50px);
    width: 100px;
    height: 60px;
    background: var(--pf-success) !important;
    border-radius: 8px;
    color: var(--pf-on-primary) !important;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--pf-primary-strong) !important;
    z-index: 2;
}
.wheel {
    position: absolute;
    border-radius: 50%;
    background: var(--pf-diagram-bg-deep) !important;
    border: 6px dashed var(--pf-diagram-metal) !important;
    z-index: 3;
    animation: rotateWheel 3s linear infinite;
}
.front-wheel {
    bottom: 10px;
    left: 40px;
    width: 45px;
    height: 45px;
}
.rear-wheel {
    bottom: 5px;
    right: 40px;
    width: 65px;
    height: 65px;
}
@keyframes rotateWheel {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.weight-block {
    position: absolute;
    width: 25px;
    height: 30px;
    background: var(--pf-diagram-wire) !important;
    border: 2px solid var(--pf-diagram-metal) !important;
    border-radius: 4px;
    z-index: 4;
}
.front-weight {
    bottom: 15px;
    left: 10px;
}
.rear-weight {
    bottom: 15px;
    right: 10px;
}

/* Gauge Widget */
.gauge {
    width: 120px;
    height: 120px;
    background: var(--pf-diagram-tint) !important;
    border-radius: 50%;
    border: 5px solid var(--pf-diagram-metal) !important;
    margin: 0.5rem auto;
    position: relative;
    box-shadow: var(--shadow-lg), inset 0 2px 5px rgba(0,0,0,0.2);
}
.gauge-inner {
    width: 90px;
    height: 90px;
    background: var(--pf-diagram-bg) !important;
    border-radius: 50%;
    position: absolute;
    top: calc(50% - 45px);
    left: calc(50% - 45px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pf-danger) !important;
    font-family: var(--pf-font-mono);
    font-weight: bold;
    font-size: 1.3rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    border: 2px solid var(--pf-diagram-line) !important;
}
html[data-theme="dark"] .gauge {
    background: var(--pf-diagram-line) !important;
    border-color: var(--pf-diagram-bg) !important;
}

/* Control Panel Widget */
.control-panel {
    background: var(--pf-diagram-panel) !important;
    border: 4px solid var(--pf-diagram-panel-2) !important;
    border-radius: 12px;
    padding: 0.8rem;
    max-width: 250px;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.display-line {
    background: var(--pf-diagram-screen) !important;
    border-radius: 4px;
    color: var(--pf-warning) !important;
    font-family: var(--pf-font-mono);
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    text-shadow: 0 0 2px var(--pf-warning);
    text-align: left;
}

/* Distribution Pattern Chart */
.distribution-pattern {
    position: relative;
    width: 100%;
    height: 100px;
    background: var(--pf-diagram-plot) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 0.5rem;
    overflow: hidden;
}
html[data-theme="dark"] .distribution-pattern {
    background: var(--pf-diagram-screen-2) !important;
}
.pattern-bar {
    width: 12px;
    background: var(--gradient-green) !important;
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease;
}

/* Live Metrics Panel */
.harvest-monitor, .planting-monitor, .gps-status-widget {
    background: var(--gradient-green) !important;
    color: var(--pf-on-primary) !important;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.1) !important;
    text-align: left;
}
.harvest-monitor h3, .planting-monitor h3, .gps-status-widget h3 {
    margin-bottom: 1.25rem !important;
    font-family: var(--pf-font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--pf-on-primary) !important;
}
.monitor-grid, .gps-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
}
.monitor-metric, .gps-metric {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px;
    padding: 0.8rem 0.5rem;
    text-align: center;
    transition: all 0.2s ease;
}
.monitor-metric:hover, .gps-metric:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    transform: translateY(-2px);
}
.metric-value, .gps-metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--pf-on-primary) !important;
    margin-bottom: 0.2rem;
    letter-spacing: -0.5px;
}
.metric-label, .gps-metric-label {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600;
    text-transform: uppercase;
}

/* Flow Charts & LCD displays */
.harvest-flow, .loss-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}
.flow-item, .loss-type {
    background: var(--surf) !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    min-width: 90px;
    box-shadow: var(--shadow);
}
.flow-arrow {
    font-size: 1.5rem;
    color: var(--primary) !important;
    font-weight: bold;
}
.real-time-display {
    background: var(--pf-diagram-screen-2) !important;
    border: 2px solid var(--border) !important;
    border-radius: 8px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
}
.real-time-line {
    display: flex;
    justify-content: space-between;
    font-family: var(--pf-font-mono);
    font-size: 0.85rem;
    color: var(--pf-diagram-glow-2) !important;
}
.real-time-value {
    font-weight: bold;
    color: var(--pf-accent) !important;
}

.loss-icon {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}
.loss-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-dark) !important;
}
html[data-theme="dark"] .loss-value {
    color: var(--primary-light) !important;
}
.loss-label {
    font-size: 0.78rem;
    color: var(--text-secondary) !important;
}

/* Tools & Checklist Layout */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}
.tool-item {
    background: var(--surf) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px;
    padding: 0.6rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-secondary) !important;
}
.tool-icon {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}
.tool-name {
    font-weight: 700;
    color: var(--text-primary) !important;
}
.instruction-list {
    list-style: none;
    padding-left: 0;
}
.instruction-item {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    text-align: left;
}
.instruction-number {
    width: 26px;
    height: 26px;
    background: var(--gradient-green) !important;
    color: var(--pf-on-primary) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    flex-shrink: 0;
}
html[data-theme="dark"] .instruction-number {
    color: var(--bg-white) !important;
}
.instruction-text {
    font-size: 0.92rem;
    color: var(--text-primary) !important;
}
.instruction-title {
    font-weight: 700;
    color: var(--primary-dark) !important;
    margin-bottom: 0.15rem;
}
html[data-theme="dark"] .instruction-title {
    color: var(--primary-light) !important;
}

/* ==========================================================================
   COMPONENTES COMPARTILHADOS
   Estavam duplicados nos <style> de armazenagem, bovinos e custo-operacional.
   Centralizados aqui e tokenizados para funcionar nos dois temas.
   ========================================================================== */

.alert.ok,
.alert.warn,
.alert.err {
    padding: var(--pf-space-3) var(--pf-space-4);
    border-radius: var(--pf-radius-sm);
    margin-top: var(--pf-space-3);
    border-left: 4px solid;
    font-size: var(--pf-text-sm);
    line-height: var(--pf-leading);
}
.alert.ok   { background: var(--pf-success-tint); border-left-color: var(--pf-success); color: var(--pf-success); }
.alert.warn { background: var(--pf-warning-tint); border-left-color: var(--pf-warning); color: var(--pf-warning); }
.alert.err  { background: var(--pf-danger-tint);  border-left-color: var(--pf-danger);  color: var(--pf-danger); }

.ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--pf-text-sm);
    margin-top: var(--pf-space-3);
}
.ref-table th {
    background: var(--pf-primary-surface);
    color: var(--pf-on-primary);
    padding: var(--pf-space-2);
    text-align: left;
}
.ref-table td {
    padding: var(--pf-space-2);
    border-bottom: 1px solid var(--pf-border);
}
.ref-table tr:nth-child(even) td { background: var(--pf-surface-2); }

.highlight-box {
    background: var(--pf-primary-tint);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-sm);
    padding: var(--pf-space-3) var(--pf-space-4);
    margin-top: var(--pf-space-3);
}
.highlight-box .hl-label { font-size: var(--pf-text-sm); color: var(--pf-text-2); }
.highlight-box .hl-value { font-size: var(--pf-text-xl); font-weight: 800; color: var(--pf-primary-strong); }

.highlight-box.green    { background: var(--pf-success-tint); }
.highlight-box.green .hl-value { color: var(--pf-success); }
.highlight-box.red      { background: var(--pf-danger-tint); }
.highlight-box.red .hl-value   { color: var(--pf-danger); }
.highlight-box.warn-box { background: var(--pf-warning-tint); }
.highlight-box.warn-box .hl-value { color: var(--pf-warning); }
.highlight-box.neutral  { background: var(--pf-info-tint); }
.highlight-box.neutral .hl-value  { color: var(--pf-info); }

/* Laudo impresso — claro nos dois temas, por design */
.report-output {
    background: var(--pf-paper);
    color: var(--pf-on-paper);
    padding: var(--pf-space-5);
    border-radius: var(--pf-radius-sm);
    border: 1px dashed var(--pf-paper-border);
    font-family: var(--pf-font-mono);
    font-size: var(--pf-text-sm);
    line-height: 1.4;
    overflow-x: auto;
    margin-top: var(--pf-space-4);
}

/* ==========================================================================
   MOBILE & ACESSIBILIDADE
   Camada final: escrita para celular em uso de campo — dedo, sol e uma mão.
   ========================================================================== */

/* ── Nunca deixar a página rolar de lado ──────────────────────────────── */
html, body { max-width: 100%; overflow-x: hidden; overscroll-behavior-y: contain; }
body { -webkit-tap-highlight-color: transparent; }

/* ── Recortes de tela (notch / ilha dinâmica / barra de gestos) ───────── */
body > .header { padding-top: max(2rem, env(safe-area-inset-top)); }
body > .header,
.nav-tabs-inner,
.container,
.footer {
    padding-left:  max(var(--pf-space-4), env(safe-area-inset-left));
    padding-right: max(var(--pf-space-4), env(safe-area-inset-right));
}
.footer { padding-bottom: max(var(--pf-space-6), env(safe-area-inset-bottom)); }

/* ── Abas: rolagem horizontal com encaixe, sem barra visível ──────────── */
.nav-tabs {
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    top: env(safe-area-inset-top, 0);
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
    scroll-snap-align: start;
    min-height: var(--pf-touch);
    flex: 0 0 auto;
}
/* dica visual de que há mais abas à direita */
.nav-tabs-inner { position: relative; }

/* ── Alvo mínimo de toque (WCAG 2.5.8) ───────────────────────────────── */
.btn,
.back-btn,
.tutorial-btn,
button,
.input-group select,
[role="button"] {
    min-height: var(--pf-touch);
}
.input-group input,
.input-group select,
.input-group textarea {
    min-height: var(--pf-touch);
    font-size: max(16px, var(--pf-text-base)); /* abaixo de 16px o iOS dá zoom ao focar */
}

/* ── Foco visível por teclado (sem poluir o toque) ────────────────────── */
:focus-visible {
    outline: 2px solid var(--pf-primary);
    outline-offset: 2px;
    border-radius: var(--pf-radius-sm);
}
.input-group input:focus-visible,
.input-group select:focus-visible,
.input-group textarea:focus-visible {
    outline: none;
    border-color: var(--pf-primary);
    box-shadow: var(--pf-ring);
}

/* ── Telas estreitas ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .header h1 { font-size: var(--pf-text-2xl); line-height: var(--pf-leading-tight); }
    .header p  { font-size: var(--pf-text-sm); }
    .row { grid-template-columns: 1fr; }          /* um campo por linha */
    .calculator-card { padding: var(--pf-space-4); }
    .nav-tab { padding: var(--pf-space-3) var(--pf-space-4); font-size: var(--pf-text-sm); }
    .result-box .result-item {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: var(--pf-space-1);
    }
    .monitor-grid { grid-template-columns: 1fr 1fr; }
    /* tabelas largas rolam sozinhas em vez de estourar a página */
    table, .ref-table, .diagnostic-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ── Modo Campo: tudo maior para usar sob sol e com luva ──────────────── */
body.field-mode { font-size: 1.125rem; }
body.field-mode .input-group input,
body.field-mode .input-group select,
body.field-mode .input-group textarea,
body.field-mode .btn {
    min-height: 52px;
    font-size: 1.125rem;
}
body.field-mode .result-value { font-size: 1.35rem; font-weight: 800; }
body.field-mode .nav-tab { font-size: 1.05rem; }

/* ── Respeitar quem pediu menos animação ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Impressão: laudo limpo, sem cromo de navegação ──────────────────── */
@media print {
    .nav-tabs, .back-btn, .btn, .procalc-report-tools, .tutorial-section { display: none !important; }
    body { background: var(--pf-paper) !important; color: var(--pf-on-paper) !important; }
    .calculator-card { break-inside: avoid; border: 1px solid var(--pf-paper-border); box-shadow: none; }
    .tab-content { display: block !important; }
}

/* ── Ações da página (tema / modo campo) — injetadas por calc-base.js ──── */
.pf-page-actions {
    position: absolute;
    top: max(var(--pf-space-4), env(safe-area-inset-top));
    right: max(var(--pf-space-4), env(safe-area-inset-right));
    display: flex;
    gap: var(--pf-space-2);
    z-index: 2;
}
.pf-action-btn {
    width: var(--pf-touch);
    height: var(--pf-touch);
    min-height: var(--pf-touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--pf-radius-pill);
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .16);
    color: var(--pf-on-dark);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: var(--pf-transition);
}
.pf-action-btn:hover,
.pf-action-btn:focus-visible { background: rgba(255, 255, 255, .30); transform: translateY(-1px); }
.pf-action-btn:active { transform: scale(.94); }

/* o header precisa ser âncora de posicionamento e ter espaço para os botões */
body > .header { position: relative; }
body > .header .header-content { padding-right: calc(var(--pf-touch) * 2 + var(--pf-space-4)); }

@media (max-width: 480px) {
    body > .header .header-content { padding-right: calc(var(--pf-touch) * 2 + var(--pf-space-2)); }
}

/* ==========================================================================
   TABELAS DE REFERÊNCIA
   Cards que trazem valores consagrados (Kc da FAO-56, tolerâncias da Embrapa,
   faixas de PRNT) e não calculam nada. Tinham a mesma aparência de uma
   calculadora, então o usuário ficava procurando onde clicar.
   Aqui eles ganham cara de consulta: fundo neutro, faixa lateral e um selo.
   ========================================================================== */

.calculator-card.reference-card {
    background: var(--pf-surface-2);
    border: 1px solid var(--pf-border);
    border-left: 4px solid var(--pf-text-3);
    box-shadow: none;
}

.calculator-card.reference-card:hover {
    transform: none;                 /* não "convida ao clique" como a calculadora */
    box-shadow: var(--pf-shadow-sm);
}

/* selo "referência" no topo do card */
.calculator-card.reference-card > .calculator-header {
    position: relative;
    padding-right: 92px;
}

.calculator-card.reference-card > .calculator-header::after {
    content: '📖 referência';
    position: absolute;
    top: 0;
    right: 0;
    font-size: var(--pf-text-xs);
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--pf-text-2);
    background: var(--pf-surface-3);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-pill);
    padding: 3px 10px;
    white-space: nowrap;
}

/* o ícone perde o destaque de ação */
.calculator-card.reference-card .calculator-icon {
    background: var(--pf-surface-3);
    color: var(--pf-text-2);
    box-shadow: none;
}

.calculator-card.reference-card .calculator-title h3 {
    color: var(--pf-text);
}

@media (max-width: 480px) {
    .calculator-card.reference-card > .calculator-header { padding-right: 0; padding-top: 26px; }
    .calculator-card.reference-card > .calculator-header::after { top: -4px; }
}
