:root {
    /* Warm Editorial Natural Palette (Gentler Streak / Apple Health / Oura inspired) */
    --bg-canvas: #F6F5F0;
    --bg-surface: #FFFFFF;
    --bg-subtle: #EFECE6;
    --bg-elevated: #FAF9F6;

    --border-soft: rgba(28, 32, 29, 0.07);
    --border-strong: rgba(28, 32, 29, 0.13);

    --text-main: #181C19;
    --text-secondary: #5C625E;
    --text-muted: #8E9590;

    /* Natural Botanical & Warm Accents */
    --accent-sage: #2A6F57;
    --accent-sage-light: #E6F2ED;
    --accent-sage-border: rgba(42, 111, 87, 0.22);

    /* Morning: Warm Terracotta / Apricot Sun */
    --morning-accent: #D96B38;
    --morning-soft: #FDF1EB;
    --morning-border: rgba(217, 107, 56, 0.22);

    /* Night: Calm Slate Indigo */
    --night-accent: #485696;
    --night-soft: #EEF0F8;
    --night-border: rgba(72, 86, 150, 0.22);

    /* BMI Semantic Tones */
    --status-under: #3B82F6;
    --status-normal: #2A6F57;
    --status-over: #D97706;
    --status-obese: #DC2626;

    /* Tactile Shadows & Springs */
    --shadow-card: 0 4px 20px rgba(24, 28, 25, 0.045), 0 1px 3px rgba(24, 28, 25, 0.03);
    --shadow-floating: 0 14px 34px rgba(24, 28, 25, 0.09), 0 2px 8px rgba(24, 28, 25, 0.05);

    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --smooth: cubic-bezier(0.22, 1, 0.36, 1);

    --safe-top: env(safe-area-inset-top, 14px);
    --safe-bottom: env(safe-area-inset-bottom, 18px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Tactile Spring Micro-interactions */
.spring-btn {
    cursor: pointer;
    transition: transform 0.26s var(--spring), background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.spring-btn:active {
    transform: scale(0.93);
}

.tactile-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
}

/* ==========================================
   AUTHENTICATION SCREEN
   ========================================== */
.auth-screen {
    height: 100dvh;
    width: 100%;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(24px, var(--safe-top)) 20px calc(28px + var(--safe-bottom));
}

.auth-container {
    width: 100%;
    max-width: 410px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-brand {
    text-align: center;
    padding: 0 8px;
}

.brand-logo-mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--accent-sage);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(42, 111, 87, 0.24);
}

.brand-pill {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent-sage);
    margin-bottom: 6px;
}

.auth-brand h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.7px;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: 8px;
}

.auth-brand p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.auth-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Segmented Pill Control */
.segmented-pill {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-subtle);
    padding: 4px;
    border-radius: 16px;
    border: none;
}

#chart-range-control {
    grid-template-columns: repeat(4, 1fr);
}

.segment-glider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / 2);
    background: var(--bg-surface);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.34s var(--spring);
    z-index: 1;
}

.seg-tab {
    position: relative;
    z-index: 2;
    border: none;
    background: none;
    padding: 9px 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.seg-tab.active {
    color: var(--text-main);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

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

.input-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    padding-left: 2px;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper input:focus {
    background: #fff;
    border-color: var(--accent-sage);
    box-shadow: 0 0 0 3px rgba(42, 111, 87, 0.12);
}

.auth-error {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--status-obese);
    background: #FEF2F2;
    border: 1px solid #FECACA;
    padding: 9px 12px;
    border-radius: 12px;
}

.btn-primary {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 16px;
    background: var(--accent-sage);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(42, 111, 87, 0.24);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-soft);
}

.btn-google {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.firebase-status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-sage);
}

/* ==========================================
   MAIN APP SHELL
   ========================================== */
.app-shell {
    max-width: 460px;
    height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding-top: max(12px, var(--safe-top));
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px 12px;
    flex-shrink: 0;
}

.greeting-eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 1px;
}

.top-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.7px;
    color: var(--text-main);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.days-logged-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-sage-light);
    border: 1px solid var(--accent-sage-border);
    color: var(--accent-sage);
    padding: 7px 12px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
}

.pill-icon {
    width: 15px;
    height: 15px;
}

.avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: inherit;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
}

/* Viewport & Tab Transitions */
.viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 18px calc(105px + var(--safe-bottom));
    -webkit-overflow-scrolling: touch;
}

.viewport::-webkit-scrollbar {
    display: none;
}

.tab-view {
    display: none;
    flex-direction: column;
    gap: 14px;
    animation: gentleIn 0.34s var(--spring);
}

.tab-view.active {
    display: flex;
}

@keyframes gentleIn {
    0% { opacity: 0; transform: translateY(10px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Date Bar */
.date-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 20px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--bg-elevated);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-label-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.date-tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.9px;
    color: var(--accent-sage);
    background: var(--accent-sage-light);
    padding: 2px 8px;
    border-radius: 99px;
    margin-bottom: 2px;
}

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

/* Morning & Night Cards */
.cards-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.weight-card {
    padding: 18px;
    transition: transform 0.35s var(--spring), border-color 0.25s ease;
}

.weight-card.morning-theme {
    background: linear-gradient(180deg, #FFFDFB 0%, #FFFFFF 100%);
    border-color: var(--morning-border);
}

.weight-card.night-theme {
    background: linear-gradient(180deg, #FBFBFF 0%, #FFFFFF 100%);
    border-color: var(--night-border);
}

.weight-card.saved-bounce {
    animation: cardBounce 0.5s var(--spring);
}

@keyframes cardBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.025); }
    100% { transform: scale(1); }
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.period-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.period-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.morning-icon-box {
    background: var(--morning-soft);
    color: var(--morning-accent);
}

.night-icon-box {
    background: var(--night-soft);
    color: var(--night-accent);
}

.period-info h3 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.period-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.saved-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--bg-subtle);
    color: var(--text-muted);
    transition: all 0.25s var(--spring);
}

.saved-badge.is-saved {
    background: var(--accent-sage-light);
    color: var(--accent-sage);
}

/* Tactile Weight Picker */
.weight-picker-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.step-circle {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.weight-readout {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 2px 14px;
    border-radius: 12px;
}

.weight-big-num {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1.4px;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
}

.weight-big-num.pop {
    animation: numSpring 0.25s var(--spring);
}

@keyframes numSpring {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.weight-unit {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.tap-hint {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 1px;
}

.card-actions {
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    gap: 8px;
}

.quick-step-btn {
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
}

.save-action-btn {
    height: 44px;
    border-radius: 14px;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.morning-save {
    background: var(--morning-accent);
    box-shadow: 0 6px 16px rgba(217, 107, 56, 0.25);
}

.night-save {
    background: var(--night-accent);
    box-shadow: 0 6px 16px rgba(72, 86, 150, 0.25);
}

.save-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Daily Summary Digest */
.daily-digest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.digest-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
}

.clickable-digest {
    padding: 4px;
    border-radius: 12px;
}

.digest-sep {
    width: 1px;
    height: 32px;
    background: var(--border-soft);
}

.digest-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.digest-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.digest-bmi-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mini-status-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

/* ==========================================
   TAB 2: PROGRESO & CHART
   ========================================== */
.filter-chips-row {
    display: flex;
    gap: 8px;
}

.filter-chip {
    flex: 1;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.filter-chip.active {
    border-color: var(--border-strong);
    background: var(--text-main);
    color: #fff;
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-morning { background: var(--morning-accent); }
.dot-night { background: var(--night-accent); }
.dot-bmi { background: var(--accent-sage); }

.chart-card {
    padding: 18px 16px 14px;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.eyebrow-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 3px;
}

.chart-selected-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

#chart-hover-val {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.chart-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
    background: var(--accent-sage-light);
    color: var(--accent-sage);
}

.chart-detail-box {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    line-height: 1.4;
}

.chart-canvas-container {
    position: relative;
    width: 100%;
    height: 225px;
}

#progress-chart {
    width: 100%;
    height: 100%;
    touch-action: pan-y;
}

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

.stat-box {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-number {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stat-caption {
    font-size: 11px;
    color: var(--text-muted);
}

.history-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.block-header h2 {
    font-size: 16px;
    font-weight: 800;
}

.subtle-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.history-list, .bmi-log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-radius: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    cursor: pointer;
}

.history-day-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.day-Index-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.history-day-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.history-day-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-pills {
    display: flex;
    gap: 6px;
}

.tag-pill {
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tag-pill.morning {
    background: var(--morning-soft);
    color: var(--morning-accent);
}

.tag-pill.night {
    background: var(--night-soft);
    color: var(--night-accent);
}

.empty-state-box {
    text-align: center;
    padding: 26px 16px;
    border-radius: 18px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-strong);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* ==========================================
   TAB 3: ALTURA E IMC
   ========================================== */
.section-card {
    padding: 18px;
}

.card-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-card h3 {
    font-size: 17px;
    font-weight: 800;
}

.height-pill-btn {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 14px;
    border: 1px solid var(--accent-sage-border);
    background: var(--accent-sage-light);
    color: var(--accent-sage);
    font-family: inherit;
}

#height-val-display {
    font-size: 24px;
    font-weight: 800;
}

.height-pill-btn small {
    font-size: 13px;
    font-weight: 700;
}

.edit-mini-icon {
    width: 13px;
    height: 13px;
    margin-left: 4px;
}

.slider-box {
    margin: 16px 0;
}

.natural-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 99px;
    background: var(--bg-subtle);
    outline: none;
}

.natural-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-sage);
    border: 4px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.2s var(--spring);
}

.natural-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.slider-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.height-fine-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.fine-btn {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--bg-elevated);
    color: var(--text-main);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fine-btn svg {
    width: 14px;
    height: 14px;
}

.fine-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.bmi-main-readout {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

#bmi-hero-val {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1px;
}

.bmi-status-tag {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--accent-sage-light);
    color: var(--accent-sage);
}

.weight-ref-chip {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    padding: 6px 10px;
    border-radius: 10px;
}

.bmi-bar-wrapper {
    margin: 16px 0;
}

.bmi-scale-track {
    position: relative;
    height: 12px;
    border-radius: 99px;
    display: flex;
    gap: 3px;
}

.scale-part {
    height: 100%;
}

.part-under { flex: 18; background: #93C5FD; border-radius: 99px 0 0 99px; }
.part-normal { flex: 32; background: #6EE7B7; }
.part-over { flex: 25; background: #FCD34D; }
.part-obese { flex: 25; background: #FCA5A5; border-radius: 0 99px 99px 0; }

.scale-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text-main);
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: left 0.45s var(--spring);
}

.scale-numbers {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.healthy-range-callout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.callout-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-sage);
    flex-shrink: 0;
}

/* ==========================================
   BOTTOM TAB BAR (Clean Floating Pill)
   ========================================== */
.bottom-tab-bar {
    position: fixed;
    bottom: max(12px, var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
    height: 64px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 5px;
    box-shadow: var(--shadow-floating);
    z-index: 90;
}

.tab-pill-bg {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc((100% - 10px) / 4);
    background: var(--accent-sage-light);
    border-radius: 26px;
    transition: transform 0.38s var(--spring);
    z-index: 1;
}

.nav-tab {
    position: relative;
    z-index: 2;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.nav-icon {
    width: 20px;
    height: 20px;
}

/* ==========================================
   MODALS & BOTTOM SHEETS
   ========================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(24, 28, 25, 0.38);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 200;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    width: 100%;
    max-width: 460px;
    background: var(--bg-surface);
    border-radius: 28px 28px 0 0;
    padding: 12px 20px calc(22px + var(--safe-bottom));
    transform: translateY(100%);
    transition: transform 0.38s var(--spring);
}

.modal-backdrop.open .bottom-sheet {
    transform: translateY(0);
}

.sheet-grabber {
    width: 40px;
    height: 5px;
    border-radius: 99px;
    background: var(--bg-subtle);
    margin: 0 auto 12px;
}

.sheet-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sheet-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.9px;
    color: var(--text-muted);
}

.icon-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-subtle);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-value-box {
    text-align: center;
    margin: 12px 0 16px;
}

#numpad-value {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1.2px;
}

.sheet-unit {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-left: 4px;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.key-btn {
    height: 52px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: var(--bg-elevated);
    color: var(--text-main);
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Profile Modal Details */
.profile-summary-box {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0 20px;
    padding: 14px;
    border-radius: 18px;
    background: var(--bg-elevated);
}

.profile-avatar-large {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-sage);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-summary-box h3 {
    font-size: 16px;
    font-weight: 800;
}

.profile-summary-box p {
    font-size: 13px;
    color: var(--text-secondary);
}

.cloud-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-sage);
    background: var(--accent-sage-light);
    padding: 2px 8px;
    border-radius: 6px;
}

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

.btn-secondary, .btn-outline-danger {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary {
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text-main);
}

.btn-outline-danger {
    border: 1px solid #FECACA;
    background: #FEF2F2;
    color: var(--status-obese);
}

/* Toast Notification */
.toast-pill {
    position: fixed;
    top: max(16px, var(--safe-top));
    left: 50%;
    transform: translate(-50%, -120px) scale(0.9);
    background: var(--text-main);
    color: #fff;
    padding: 11px 18px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-floating);
    z-index: 400;
    transition: transform 0.4s var(--spring);
    pointer-events: none;
}

.toast-pill.show {
    transform: translate(-50%, 0) scale(1);
}

.toast-icon {
    width: 17px;
    height: 17px;
    color: #6EE7B7;
}

/* ==========================================
   TAB 4: AJUSTES & THEME SELECTOR
   ========================================== */
.settings-subtext {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.theme-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.theme-option-card {
    border: 1.5px solid var(--border-strong);
    background: var(--bg-elevated);
    border-radius: 20px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    font-family: inherit;
    color: var(--text-main);
}

.theme-option-card.active {
    border-color: var(--accent-sage);
    background: var(--bg-surface);
    box-shadow: 0 6px 20px rgba(42, 111, 87, 0.14);
}

.theme-preview {
    position: relative;
    height: 82px;
    border-radius: 14px;
    overflow: hidden;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.preview-natural {
    background: #F4F2EC;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.prev-card {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.prev-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-s { background: #2A6F57; }
.dot-m { background: #D96B38; }

.prev-bar {
    height: 6px;
    width: 65%;
    border-radius: 99px;
    background: rgba(24, 28, 25, 0.16);
}

.prev-bar.short {
    width: 45%;
}

.preview-liquid {
    background: linear-gradient(135deg, #DBEAFE 0%, #E0E7FF 50%, #FCE7F3 100%);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.prev-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
}

.orb-a {
    width: 46px;
    height: 46px;
    background: #38BDF8;
    top: -6px;
    left: -6px;
    opacity: 0.65;
}

.orb-b {
    width: 50px;
    height: 50px;
    background: #818CF8;
    bottom: -10px;
    right: -6px;
    opacity: 0.65;
}

.prev-glass-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 12px 10px;
    box-shadow: 0 6px 16px rgba(31, 38, 135, 0.12), inset 0 1px 1px #fff;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.prev-spec {
    width: 40%;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.95);
}

.theme-option-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 2px;
}

.theme-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-title-row strong {
    font-size: 13px;
    font-weight: 800;
}

.theme-check-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-sage);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.25s var(--spring);
}

.theme-check-icon svg {
    width: 12px;
    height: 12px;
}

.theme-option-card.active .theme-check-icon {
    opacity: 1;
    transform: scale(1);
}

.theme-option-info span {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.settings-profile-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 0 18px;
    padding: 14px;
    border-radius: 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
}

.settings-profile-meta h3 {
    font-size: 16px;
    font-weight: 800;
}

.settings-profile-meta p {
    font-size: 13px;
    color: var(--text-secondary);
}

.settings-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================================
   iOS 26 / 27 LIQUID GLASS THEME (iPhone 14 Pro)
   ========================================== */
.liquid-ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
    overflow: hidden;
    background: linear-gradient(160deg, #E4EEFA 0%, #EDE9FE 48%, #FCE7F3 100%);
}

.liquid-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    animation: liquidDrift 16s infinite alternate ease-in-out;
}

.blob-sage {
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.55) 0%, transparent 70%);
    top: -80px;
    left: -70px;
}

.blob-sky {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.50) 0%, transparent 70%);
    bottom: 40px;
    right: -90px;
    animation-delay: -6s;
}

.blob-peach {
    width: 290px;
    height: 290px;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.38) 0%, transparent 70%);
    top: 36%;
    left: 18%;
    animation-delay: -11s;
}

@keyframes liquidDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(28px, 36px) scale(1.12); }
}

body[data-theme="liquid"] {
    --bg-canvas: #E8EFFA;
    --bg-surface: rgba(255, 255, 255, 0.46);
    --bg-subtle: rgba(255, 255, 255, 0.38);
    --bg-elevated: rgba(255, 255, 255, 0.52);
    --border-soft: rgba(255, 255, 255, 0.68);
    --border-strong: rgba(255, 255, 255, 0.88);
    --text-main: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
}

body[data-theme="liquid"] .liquid-ambient-bg {
    opacity: 1;
}

body[data-theme="liquid"] .app-shell,
body[data-theme="liquid"] .auth-screen {
    position: relative;
    z-index: 1;
}

/* Refractive Specular Liquid Glass Cards */
body[data-theme="liquid"] .tactile-card,
body[data-theme="liquid"] .weight-card.morning-theme,
body[data-theme="liquid"] .weight-card.night-theme,
body[data-theme="liquid"] .history-row {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.62) 0%,
        rgba(255, 255, 255, 0.32) 100%
    );
    backdrop-filter: blur(32px) saturate(210%);
    -webkit-backdrop-filter: blur(32px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 28px;
    box-shadow:
        0 16px 36px rgba(15, 23, 42, 0.08),
        inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
        inset 0 -1px 2px rgba(255, 255, 255, 0.35);
}

body[data-theme="liquid"] .weight-picker-box,
body[data-theme="liquid"] .settings-profile-row,
body[data-theme="liquid"] .healthy-range-callout,
body[data-theme="liquid"] .key-btn,
body[data-theme="liquid"] .step-circle,
body[data-theme="liquid"] .quick-step-btn,
body[data-theme="liquid"] .icon-btn,
body[data-theme="liquid"] .avatar-btn {
    background: rgba(255, 255, 255, 0.52);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow:
        0 6px 16px rgba(15, 23, 42, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 0.92);
}

/* iOS 26 Floating Liquid Capsule Tab Bar */
body[data-theme="liquid"] .bottom-tab-bar {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.65) 0%,
        rgba(255, 255, 255, 0.38) 100%
    );
    backdrop-filter: blur(36px) saturate(220%);
    -webkit-backdrop-filter: blur(36px) saturate(220%);
    border: 1px solid rgba(255, 255, 255, 0.88);
    box-shadow:
        0 20px 44px rgba(15, 23, 42, 0.14),
        inset 0 1.5px 1.5px rgba(255, 255, 255, 0.98);
}

body[data-theme="liquid"] .tab-pill-bg {
    background: rgba(255, 255, 255, 0.78);
    box-shadow:
        0 4px 14px rgba(15, 23, 42, 0.08),
        inset 0 1px 1px #ffffff;
}

body[data-theme="liquid"] .bottom-sheet {
    background: rgba(248, 250, 255, 0.78);
    backdrop-filter: blur(40px) saturate(210%);
    -webkit-backdrop-filter: blur(40px) saturate(210%);
    border-top: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.15), inset 0 1.5px 1px #ffffff;
}

