:root {
    --primary: #2ECC71;
    --primary-dark: #27AE60;
    --primary-bg: rgba(46, 204, 113, 0.08);
    --bg-light: #F8F9FA;
    --bg-card: #FFFFFF;
    --text-main: #2C3E50;
    --text-light: #7F8C8D;
    --border: #E2E8F0;
    
    --error: #E74C3C;
    --warning: #F39C12;
    --info: #3498DB;
    
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-large: 0 10px 30px rgba(0, 0, 0, 0.1);
    
    --font: 'Outfit', sans-serif;
}

[data-theme="dark"] {
    --bg-light: #121212;
    --bg-card: #1E1E1E;
    --text-main: #F5F6FA;
    --text-light: #BDC3C7;
    --border: #2D3748;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font);
    user-select: none;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #E2E8F0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Web container layout split */
.web-container {
    display: flex;
    max-width: 1000px;
    width: 90%;
    height: 85vh;
    gap: 40px;
    align-items: center;
    justify-content: center;
}

.desktop-info {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .desktop-info {
        display: none;
    }
    .web-container {
        width: 100% !important;
        height: 100% !important;
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }
    .phone-mockup {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
    }
    .phone-screen {
        border-radius: 0 !important;
        height: 100% !important;
    }
}

.info-card {
    background: #FFFFFF;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-large);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 40px;
    color: var(--primary);
}

.info-card h1 {
    font-size: 32px;
    font-weight: 800;
    color: #2C3E50;
}

.tagline {
    font-size: 16px;
    color: var(--primary-dark);
    font-weight: 600;
}

.divider {
    height: 1px;
    background-color: var(--border);
    margin: 20px 0;
}

.info-desc {
    color: #4A5568;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.features-list {
    list-style: none;
    margin-bottom: 25px;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #2D3748;
    font-weight: 500;
}

.features-list span {
    color: var(--primary);
}

.app-badges {
    display: flex;
    gap: 12px;
}

.badge {
    background-color: #EDF2F7;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #4A5568;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Phone Mockup Frame */
.phone-mockup {
    width: 375px;
    height: 750px;
    background-color: #000000;
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border: 4px solid #4A5568;
    position: relative;
    overflow: hidden;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background-color: var(--bg-light);
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}


/* Screens System */
.screen {
    position: absolute;
    top: 36px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 5;
}

/* Splash Screen */
#screen-splash {
    justify-content: center;
    align-items: center;
    background-color: var(--bg-light);
}

.splash-logo {
    text-align: center;
    margin-bottom: 40px;
}

.plate-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    background-color: var(--primary-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0 auto 20px;
}

.plate-logo .leaf {
    font-size: 50px;
    color: var(--primary);
}

.plate-logo .letter {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    position: absolute;
}

#screen-splash h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

#screen-splash p {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(46, 204, 113, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

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

/* App Bar */
.app-bar {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-card);
    gap: 12px;
}

.app-bar h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.icon-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
}

.icon-btn:active {
    background-color: rgba(0,0,0,0.05);
}

/* Screen Content standard scroll */
.screen-content {
    flex: 1;
    padding: 24px;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

.screen-content.scrollable {
    overflow-y: auto;
    padding-bottom: 80px;
}

.screen-content::-webkit-scrollbar {
    width: 4px;
}
.screen-content::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 2px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
    margin-bottom: 24px;
}

/* Buttons */
.btn {
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    outline: none;
}

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

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

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline:active {
    background-color: var(--primary-bg);
}

.btn-link {
    background: transparent;
    color: var(--primary);
    text-decoration: underline;
    font-size: 13px;
    min-height: auto;
    margin-top: 10px;
}

.btn-google {
    background-color: #FFFFFF;
    border: 1px solid var(--border);
    color: #2C3E50;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form layouts */
.input-group {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 16px;
    height: 52px;
}

.input-icon {
    color: var(--primary);
    margin-right: 12px;
    font-size: 20px;
}

.input-group input {
    border: none;
    background: transparent;
    flex: 1;
    height: 100%;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
}

.forgot-pwd {
    text-align: right;
    margin-bottom: 24px;
}

.forgot-pwd a {
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.or-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.or-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    right: 0;
    height: 1px;
    background-color: var(--border);
}

.or-divider span {
    background-color: var(--bg-light);
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-light);
    position: relative;
    z-index: 2;
}

.footer-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 24px;
}

.footer-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.08);
    border: 1px solid rgba(243, 156, 18, 0.2);
    color: #F39C12;
}

.alert-info {
    background-color: rgba(52, 152, 219, 0.08);
    border: 1px solid rgba(52, 152, 219, 0.2);
    color: #3498DB;
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: #E74C3C;
}

.alert-success {
    background-color: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.2);
    color: var(--primary-dark);
}

/* Onboarding */
.onboarding-step {
    display: none;
    flex-direction: column;
    padding-bottom: 40px;
}

.onboarding-step.active {
    display: flex;
}

.progress-bar-container {
    height: 4px;
    background-color: #EDF2F7;
    width: 100%;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s;
}

.switch-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 6px;
}

.switch-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.switch-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    width: 100%;
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
}

.radio-group-row {
    display: flex;
    gap: 12px;
}

.radio-card {
    flex: 1;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    background-color: var(--bg-card);
    cursor: pointer;
}

.radio-card input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    margin: 0 !important;
    padding: 0 !important;
    align-self: center !important;
    flex-shrink: 0;
}

.radio-card span {
    line-height: 1 !important;
    align-self: center !important;
    display: inline-block;
}

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

.goal-card {
    background-color: var(--bg-card);
    border: 1.5px solid var(--border);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.goal-card input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    margin: 0;
}

.goal-info {
    display: flex;
    flex-direction: column;
}

.goal-info strong {
    font-size: 14px;
    color: var(--text-main);
}

.goal-info span {
    font-size: 11px;
    color: var(--text-light);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.filter-chip {
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    background-color: var(--bg-card);
}

.filter-chip input {
    display: none;
}

.filter-chip.selected, .filter-chip:has(input:checked) {
    border-color: var(--primary);
    background-color: var(--primary-bg);
    color: var(--primary-dark);
}

.preference-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pref-row {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.pref-row span {
    font-size: 13px;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
    color: var(--text-main);
}

.pref-options {
    display: flex;
    justify-content: space-between;
}

.pref-options label input {
    display: none;
}

.pref-options label span {
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    margin: 0;
}

.pref-options label input:checked + span {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-bg);
}

.medical-block {
    text-align: center;
    padding: 30px 10px;
}

.block-icon {
    font-size: 70px;
    color: var(--error);
    margin-bottom: 20px;
}

.action-buttons-onboarding {
    padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px)) 24px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
}

/* Dashboard */
.dashboard-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.dashboard-header p {
    font-size: 11px;
    color: var(--primary-dark);
    font-weight: 600;
}

.dash-tip {
    margin: 12px 20px;
    background-color: var(--primary-bg);
    border: 1px solid rgba(46, 204, 113, 0.2);
    color: var(--text-main);
}

.dash-tip p {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.progress-card h3 {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-main);
}

.calories-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 16px;
}

.cal-item {
    text-align: center;
}

.cal-item h4 {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-dark);
}

.cal-item span {
    font-size: 10px;
    color: var(--text-light);
}

.divider-y {
    width: 1px;
    height: 30px;
    background-color: var(--border);
}

.macros-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.macro-bar {
    width: 100%;
}

.macro-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-main);
}

.progress-track {
    height: 4px;
    background-color: #EDF2F7;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 2px;
}

.clickable-card {
    cursor: pointer;
}

.clickable-card:active {
    transform: scale(0.98);
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--primary-dark);
    margin-bottom: 6px;
    font-weight: 700;
}

.card-header-row .arrow {
    font-size: 12px;
    color: var(--text-light);
}

.clickable-card h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.time-label {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.time-label span {
    font-size: 13px;
}

.tracker-cards {
    margin-top: 10px;
}

.tracking-card {
    text-align: center;
    cursor: pointer;
}

.tracking-card:active {
    transform: scale(0.96);
}

.tracking-card span {
    font-size: 26px;
}

.icon-blue { color: var(--info); }
.icon-green { color: var(--primary); }
.icon-red { color: var(--error); }

.tracking-card h4 {
    font-size: 12px;
    color: var(--text-light);
    margin: 4px 0;
}

.tracking-card strong {
    font-size: 15px;
    color: var(--text-main);
    display: block;
}

.action-hint {
    font-size: 10px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-top: 4px;
    display: block;
}

/* Bottom Navigation Bar */
.bottom-nav {
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--border);
    background-color: var(--bg-card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    box-sizing: border-box;
}

.nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    cursor: pointer;
    width: 20%;
}

.nav-item span:first-child {
    font-size: 22px;
}

.nav-item span:last-child {
    font-size: 9px;
    font-weight: 700;
}

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

/* Day Plan / Week Plan */
.meal-card-day {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.meal-card-day.eaten-meal-card {
    border-color: var(--primary-light);
    opacity: 0.9;
    background-color: var(--bg-light);
}

.meal-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.meal-badge {
    background-color: var(--primary-bg);
    color: var(--primary-dark);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

.meal-time-tag {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.meal-time-tag span {
    font-size: 13px;
}

.meal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
}

.meal-macros-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 4px;
}

.meal-actions-row {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 8px;
}

.meal-action-btn {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.meal-action-btn.replace {
    color: var(--warning);
}

/* Week plan selector */
.week-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 10px 10px;
    gap: 4px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.day-chip {
    padding: 6px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    width: 100%;
    min-height: 44px;
}

.day-chip.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

/* Recipe details */
.recipe-hero {
    background-color: var(--primary);
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    color: #FFFFFF;
}

.recipe-hero span {
    font-size: 50px;
    color: rgba(255,255,255,0.4);
}

.recipe-hero h2 {
    font-size: 20px;
    font-weight: 800;
    margin-top: 10px;
}

.recipe-quick-info {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding: 0 10px;
}

.recipe-quick-info div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.recipe-quick-info span:first-child {
    color: var(--primary);
    font-size: 22px;
}

.recipe-quick-info span:last-child {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.ingredients-list, .steps-list {
    list-style: none;
    padding-left: 0;
}

.ingredients-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-main);
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.ingredients-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
}

.steps-list li {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-main);
    margin-bottom: 12px;
    padding-left: 8px;
}

/* Shopping list */
.shopping-header {
    background-color: var(--bg-card);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shopping-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.shopping-header .actions {
    display: flex;
    gap: 8px;
}

.shopping-range {
    display: flex;
    padding: 8px 20px;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.shopping-range span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.range-chips {
    display: flex;
    gap: 6px;
}

.range-chip {
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 10px;
    font-weight: 700;
    background-color: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
}

.range-chip.active {
    background-color: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.shopping-category-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-top: 16px;
    margin-bottom: 8px;
}

.shopping-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.shopping-item-card label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.shopping-item-card input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.shopping-item-card.checked label {
    text-decoration: lineThrough;
    color: var(--text-light);
}

.shopping-qty {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

/* Profile and Stats */
.profile-card {
    text-align: center;
    padding: 20px 0;
}

.profile-card .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #FFFFFF;
    font-size: 32px;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 12px;
}

.profile-card h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.account-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    background-color: #EDF2F7;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    margin-top: 4px;
}

.premium-promo-card {
    background-color: var(--primary-bg);
    border: 1.5px solid var(--primary);
    position: relative;
    cursor: pointer;
}

.premium-promo-card h4 {
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
}

.premium-promo-card p {
    font-size: 11px;
    color: var(--text-main);
    max-width: 85%;
}

.premium-promo-card .arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--primary);
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.menu-item:active {
    background-color: rgba(0,0,0,0.02);
}

.menu-item span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.menu-item .material-icons-round:last-child {
    font-size: 14px;
    color: var(--text-light);
}

.menu-item.logout {
    margin-top: 12px;
}

.menu-item.logout span {
    color: var(--error);
}

.menu-item.logout .material-icons-round {
    color: var(--error);
}

/* GDPR buttons config */
.text-red { color: var(--error) !important; }

/* Stats box */
.stat-box {
    text-align: center;
}

.stat-box span {
    font-size: 10px;
    color: var(--text-light);
    font-weight: 600;
}

.stat-box h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-top: 4px;
}

.chart-card {
    min-height: 240px;
}

.chart-desc {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.chart-mock {
    height: 120px;
    background-color: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    padding: 10px;
}

.chart-svg {
    width: 100%;
    height: 100%;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-light);
    margin-top: 8px;
}

/* Subscription star UI */
.sub-hero {
    text-align: center;
    padding: 20px 0;
}

.sub-star {
    font-size: 60px;
    color: var(--warning);
}

.sub-hero h2 {
    font-size: 22px;
    font-weight: 800;
    margin-top: 10px;
}

.sub-hero p {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.sub-features {
    list-style: none;
    margin: 20px 0;
}

.sub-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.sub-features span {
    color: var(--primary);
    font-size: 18px;
}

.sub-options {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.sub-option-card {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    position: relative;
}

.sub-option-card.popular {
    border-color: var(--primary);
    background-color: var(--primary-bg);
}

.badge-sub {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary);
    color: #FFFFFF;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 8px;
}

.sub-option-card span {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 700;
}

.sub-option-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 6px 0;
    color: var(--text-main);
}

.sub-option-card small {
    font-size: 9px;
    color: var(--primary-dark);
    font-weight: 800;
}

/* Modals */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    z-index: 99999 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-card {
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    box-shadow: var(--shadow-large);
    text-align: center;
}

.modal-card h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.modal-card p {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.modal-actions {
    display: flex;
}

.app-version-badge {
    background-color: var(--primary);
    color: #FFFFFF;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
    vertical-align: middle;
}

#screen-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-light);
    height: 100%;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 24px;
    width: 100%;
    height: 100%;
}

.intro-hero-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(46, 204, 113, 0.15);
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(46, 204, 113, 0.15);
}

.intro-content h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
}

.intro-content p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
    max-width: 280px;
    line-height: 1.5;
}

.intro-content .btn-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* Custom premium dialog & toast styles */
.dialog-card {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
    backdrop-filter: blur(15px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.25) !important;
    text-align: center;
    padding: 24px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 18px !important;
    width: 90% !important;
    max-width: 330px !important;
}

.dialog-icon {
    font-size: 44px;
    margin-bottom: 12px;
}

#dialog-title-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main) !important;
    margin: 0;
}

#dialog-text-val {
    color: var(--text-main) !important;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 12px;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1E293B !important;
    color: #FFFFFF !important;
    border: 1px solid #334155 !important;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.history-log-item {
    transition: background-color 0.2s;
}

.history-log-item:hover {
    background-color: var(--border) !important;
}

.history-log-item button:hover {
    opacity: 0.8;
}

/* Premium Pricing Cards & Upgrade Screen */
.pricing-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}
.upgrade-card-premium {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(46, 204, 113, 0.1) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.upgrade-card-premium::before {
    content: 'RECOMANDAT';
    position: absolute;
    top: 15px;
    right: -30px;
    background: #FFD700;
    color: #000;
    font-size: 8px;
    font-weight: 800;
    padding: 4px 30px;
    transform: rotate(45deg);
}
.price-tag {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    margin: 12px 0;
}
.price-tag span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

/* AI Coach Chat Screen */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 110px);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}
.chat-bubble.user {
    align-self: flex-end;
    background-color: var(--primary);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}
.chat-bubble.ai {
    align-self: flex-start;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}
.chat-input-area {
    display: flex;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    gap: 8px;
    align-items: center;
    box-sizing: border-box;
}
.chat-input-area input {
    flex: 1;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0 16px;
    background-color: var(--bg-light);
    color: var(--text-main);
    outline: none;
    font-size: 13px;
}

/* Allergen Scanner */
.scanner-viewport {
    width: 100%;
    height: 180px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background-color: #000;
    border: 2px dashed var(--primary);
    margin-bottom: 16px;
}
.scanner-laser {
    width: 100%;
    height: 3px;
    background: linear-gradient(to bottom, rgba(46, 204, 113, 0), rgba(46, 204, 113, 1), rgba(46, 204, 113, 0));
    position: absolute;
    top: 0;
    left: 0;
    animation: scanning 2s linear infinite;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.8);
}
@keyframes scanning {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}
.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0,0,0,0.4);
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
}

/* Print CSS */
@media print {
    body {
        background: #FFFFFF !important;
        color: #000000 !important;
    }
    .phone-mockup {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .phone-screen {
        height: auto !important;
        overflow: visible !important;
    }
    .bottom-nav, .btn, button, .shopping-range, .shopping-info-banner, .icon-btn, .dashboard-header {
        display: none !important;
    }
    .screen {
        display: none !important;
    }
    #screen-day-plan, #screen-shopping-list {
        display: block !important;
        page-break-after: always;
    }
}

/* Programmatic Device-specific Bottom Spacing Overrides */
body.device-ios-notch .bottom-nav {
    height: calc(64px + 24px) !important;
    padding-bottom: 24px !important;
}
body.device-ios-notch .chat-input-area {
    padding-bottom: 28px !important;
}
body.device-ios-notch .screen-content.scrollable {
    padding-bottom: 104px !important;
}
body.device-ios-notch .action-buttons-onboarding {
    padding-bottom: calc(16px + 24px) !important;
}

body.device-android .bottom-nav {
    height: calc(64px + 12px) !important;
    padding-bottom: 12px !important;
}
body.device-android .chat-input-area {
    padding-bottom: 18px !important;
}
body.device-android .screen-content.scrollable {
    padding-bottom: 92px !important;
}
body.device-android .action-buttons-onboarding {
    padding-bottom: calc(16px + 12px) !important;
}

/* Language Selector Styles */
.lang-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 44px;
    min-height: 44px;
}
.lang-btn.active, .lang-btn:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}
.lang-card {
    transition: all 0.2s ease;
}
.lang-card:hover, .lang-card.active {
    border-color: var(--primary) !important;
    background: rgba(46, 204, 113, 0.1) !important;
}

/* Missing Classes */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dynamic-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lang-selector-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.lang-selector-btn {
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    background: var(--bg-card);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-left-version {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10px;
    color: var(--text-light);
}

.adherence-badge-card {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.star-rating-item {
    display: inline-flex;
    cursor: pointer;
    color: var(--warning);
    font-size: 24px;
}

.shopping-info-banner {
    background-color: rgba(52, 152, 219, 0.1);
    padding: 12px;
    border-radius: 8px;
    color: #3498DB;
    font-size: 13px;
    margin-bottom: 12px;
}
