:root {
    /* Inherit Astra Global Colors with fallbacks */
    --bg-primary: var(--ast-global-color-0, #1e293b);
    --bg-accent: var(--ast-global-color-1, #f59e0b);
    --bg-accent-hover: var(--ast-global-color-0, #d97706);
    --bg-accent-light: rgba(var(--ast-global-color-1-rgb, 245, 158, 11), 0.15);
    --bg-text: var(--ast-global-color-2, #334155);
    --bg-text-light: var(--ast-global-color-3, #64748b);
    --bg-white: #ffffff;
    --bg-surface: var(--ast-global-color-5, #f8fafc);
    --bg-border: var(--ast-global-color-6, #e2e8f0);
    --bg-radius-lg: 16px;
    --bg-radius-md: 12px;
    --bg-radius-sm: 8px;
    --bg-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --bg-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --bg-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.brahma-guide-wrapper {
    font-family: inherit;
    max-width: 950px;
    margin: 2.5rem auto;
    background: var(--bg-white);
    border-radius: var(--bg-radius-lg);
    box-shadow: var(--bg-shadow-lg);
    overflow: hidden;
    color: var(--bg-text);
    border: 1px solid var(--bg-border);
    line-height: 1.6;
}

/* Header */
.bg-header {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f172a 100%);
    color: var(--bg-white);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

.bg-title {
    margin: 0 0 0.75rem 0;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    color: var(--bg-white) !important;
}

.bg-subtitle {
    margin: 0;
    font-size: 1.15rem;
    opacity: 0.85;
}

/* Global Layout / Master Control */
.bg-master-control {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 0 0 var(--bg-radius-lg) var(--bg-radius-lg);
}

.bg-section {
    padding: 1.5rem 2.5rem;
    animation: bgFadeIn 0.4s ease;
}

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

.bg-section-header h3 {
    color: var(--bg-primary);
    font-size: 1.7rem;
    margin-bottom: 0.5rem;
}

.bg-section-header p {
    color: var(--bg-text-light);
    margin: 0;
}

/* UI Elements */
.bg-badge {
    background: var(--bg-surface);
    color: var(--bg-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--bg-border);
}

.bg-stars {
    color: var(--bg-accent);
    letter-spacing: 2px;
}

.bg-list-styled {
    list-style: none;
    padding: 0;
}
.bg-list-styled li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--bg-border);
}
.bg-list-styled li:last-child {
    border-bottom: none;
}

/* Cards & Stats */
.bg-card {
    background: var(--bg-white);
    border: 1px solid var(--bg-border);
    border-radius: var(--bg-radius-md);
    padding: 2rem;
    box-shadow: var(--bg-shadow-sm);
}

.bg-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.bg-stat-box {
    background: var(--bg-surface);
    padding: 1.25rem 1rem;
    border-radius: var(--bg-radius-sm);
    border: 1px solid var(--bg-border);
    text-align: center;
}

.bg-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--bg-text-light);
    text-transform: uppercase;
    font-weight: 600;
}

.bg-stat-box strong {
    font-size: 1.3rem;
    color: var(--bg-primary);
    font-weight: 800;
}

/* Forms */


.bg-calc-form {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    background: var(--bg-surface);
}

.bg-form-group {
    flex: 1;
    min-width: 200px;
}

.bg-input {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--bg-border);
    border-radius: var(--bg-radius-sm);
    font-size: 1rem;
    box-sizing: border-box;
}

.bg-btn {
    background: var(--bg-accent);
    color: var(--bg-white);
    border: none;
    padding: 0.85rem 2rem;
    border-radius: var(--bg-radius-sm);
    font-weight: 600;
    cursor: pointer;
}

/* Tables */
.bg-table-responsive {
    overflow-x: auto;
    border-radius: var(--bg-radius-sm);
    -webkit-overflow-scrolling: touch;
}
.bg-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.bg-table th, .bg-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--bg-border);
}

.bg-table th {
    background: var(--bg-surface);
    color: var(--bg-primary);
}

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

/* Slider */
.bg-week-selector { margin: 2rem 0; text-align: center; }
.bg-week-selector input[type=range] { width: 100%; margin-bottom: 1.5rem; }

/* Mobile Enhancements */
@media (max-width: 768px) {
    .bg-header { padding: 2rem 1rem; }
    .bg-title { font-size: 1.6rem !important; }
    .bg-subtitle { font-size: 1rem; }
    
    .bg-section { padding: 1.25rem 1rem; }
    
    /* Stack stats on very small screens */
    .bg-stats-grid { 
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .bg-stat-box {
        padding: 1rem 0.5rem;
    }
    .bg-stat-label { font-size: 0.75rem; }
    .bg-stat-box strong { font-size: 1.15rem; }

    /* Force grids to 1 column on mobile */
    .bg-grid-2 {
        grid-template-columns: 1fr;
    }

    /* Forms */
    .bg-calc-form {
        flex-direction: column;
        align-items: stretch;
    }
    .bg-form-group {
        min-width: 100%;
        margin-bottom: 0.5rem;
    }
    .bg-form-group-btn { width: 100%; margin-top: 1rem; }
    .bg-btn { 
        width: 100%; 
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    /* Prevent iOS zoom on inputs */
    .bg-input, .bg-week-selector input[type=range] {
        font-size: 16px;
    }
    
    /* Bigger thumb for touch */
    .bg-week-selector input[type=range]::-webkit-slider-thumb {
        height: 28px;
        width: 28px;
        margin-top: -10px;
    }
}
