/* =============================================================
   Nutrica — design system
   Mobile-first; Bootstrap 5 como base, identidade visual própria.
   ============================================================= */

:root {
    --md-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --md-bg: #f2f6f3;
    --md-surface: #ffffff;
    --md-text: #0f1f18;
    --md-muted: #6b7a73;
    --md-border: #e3eae6;

    --md-primary: #059669;
    --md-primary-dark: #047857;
    --md-primary-soft: #d1fae5;
    --md-lime: #d9f99d;

    --md-protein: #f43f5e;
    --md-carbs: #f59e0b;
    --md-fat: #8b5cf6;

    --md-gradient: linear-gradient(135deg, #065f46 0%, #047857 25%, #059669 55%, #10b981 80%, #34d399 100%);
    --md-radius: 22px;
    --md-shadow: 0 1px 2px rgba(15, 31, 24, .04), 0 10px 30px -12px rgba(15, 31, 24, .14);
    --md-shadow-lg: 0 18px 40px -18px rgba(4, 120, 87, .6);
    --md-ease: cubic-bezier(.22, 1, .36, 1);

    /* Bootstrap */
    --bs-body-font-family: var(--md-font);
    --bs-body-color: var(--md-text);
    --bs-body-bg: var(--md-bg);
    --bs-success: #059669;
    --bs-success-rgb: 5, 150, 105;
    --bs-link-color: #059669;
    --bs-link-color-rgb: 5, 150, 105;
    --bs-link-hover-color: #047857;
    --bs-link-hover-color-rgb: 4, 120, 87;
    --bs-border-radius: 14px;
}

body {
    font-family: var(--md-font);
    background: var(--md-bg);
    overflow-x: clip;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 560px;
    padding-left: 16px;
    padding-right: 16px;
}

.app-main {
    padding-top: .5rem;
    padding-bottom: 2rem;
}

.has-bottom-nav .app-main {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
}

.tabular {
    font-variant-numeric: tabular-nums;
}

/* ---------- Animações ---------- */
.reveal {
    animation: reveal .65s var(--md-ease) both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(16px); }
}

@keyframes ring-fill {
    from { stroke-dashoffset: var(--ring-circ); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pulse-ring {
    0% { transform: scale(.92); opacity: .9; }
    100% { transform: scale(1.3); opacity: 0; }
}

@keyframes shine {
    0% { transform: translateX(-120%) skewX(-20deg); }
    60%, 100% { transform: translateX(220%) skewX(-20deg); }
}

@keyframes scan {
    from { top: 6%; }
    to { top: 92%; }
}

@keyframes blink {
    50% { opacity: .25; }
}

@keyframes corners {
    50% { opacity: .45; transform: scale(.94); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- Topo ---------- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: 12px 0;
    background: rgba(242, 246, 243, .82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: background .3s, box-shadow .3s;
}

.app-topbar.is-scrolled {
    box-shadow: 0 8px 24px -16px rgba(15, 31, 24, .35);
}

.has-hero .app-topbar {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: #fff;
}

.has-hero .app-topbar.is-scrolled {
    background: rgba(4, 120, 87, .9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -.02em;
    color: inherit;
    text-decoration: none;
}

.brand:hover {
    color: inherit;
}

.brand .logo {
    filter: drop-shadow(0 4px 8px rgba(4, 120, 87, .35));
}

.avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--md-gradient);
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    box-shadow: var(--md-shadow);
    transition: transform .15s;
}

.avatar-btn:active {
    transform: scale(.94);
}

.has-hero .avatar-btn {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .55);
    backdrop-filter: blur(6px);
    box-shadow: none;
}

.app-dropdown {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 20px 50px -20px rgba(15, 31, 24, .4);
    padding: .4rem;
    min-width: 230px;
    margin-top: 8px !important;
}

.app-dropdown .dropdown-item {
    border-radius: 12px;
    padding: .6rem .75rem;
    display: flex;
    gap: .65rem;
    align-items: center;
    font-weight: 500;
}

.app-dropdown .dropdown-item:active {
    background: var(--md-primary-soft);
    color: var(--md-text);
}

/* ---------- Navegação inferior flutuante ---------- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1030;
    padding: 0 16px;
    pointer-events: none;
}

.bottom-nav-inner {
    pointer-events: auto;
    max-width: 400px;
    height: 68px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 26px;
    box-shadow: 0 16px 40px -14px rgba(15, 31, 24, .35);
}

.bn-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-size: .72rem;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: none;
    transition: color .2s;
}

.bn-link i {
    font-size: 1.35rem;
    transition: transform .2s var(--md-ease);
}

.bn-link:hover {
    color: var(--md-primary);
}

.bn-link.active {
    color: var(--md-primary);
}

.bn-link.active i {
    transform: translateY(-2px);
}

.bn-fab {
    position: relative;
    width: 62px;
    height: 62px;
    margin-top: -36px;
    border-radius: 21px;
    display: grid;
    place-items: center;
    font-size: 1.55rem;
    color: #fff;
    background: var(--md-gradient);
    box-shadow: 0 14px 26px -8px rgba(5, 150, 105, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
    transition: transform .2s var(--md-ease);
}

.bn-fab::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 25px;
    border: 2px solid rgba(16, 185, 129, .45);
    animation: pulse-ring 2.6s ease-out infinite;
}

.bn-fab:hover {
    color: #fff;
    transform: translateY(-2px);
}

.bn-fab:active {
    transform: scale(.93);
}

/* ---------- Toasts (mensagens flash) ---------- */
.toast-stack {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    pointer-events: none;
}

.app-toast {
    --t: var(--md-primary);
    pointer-events: auto;
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    background: #fff;
    border-radius: 16px;
    border-left: 4px solid var(--t);
    box-shadow: 0 18px 40px -14px rgba(15, 31, 24, .4);
    font-size: .9rem;
    font-weight: 500;
    animation: reveal .45s var(--md-ease) both;
    transition: opacity .3s, transform .3s;
}

.app-toast.is-leaving {
    opacity: 0;
    transform: translateY(-12px);
}

.app-toast > i {
    color: var(--t);
    font-size: 1.15rem;
    line-height: 1.2;
}

.app-toast-close {
    margin-left: auto;
    border: 0;
    background: none;
    color: var(--md-muted);
    padding: 0 4px;
    font-size: 1.1rem;
    line-height: 1;
}

.app-toast-success { --t: #059669; }
.app-toast-warning { --t: #d97706; }
.app-toast-danger  { --t: #e11d48; }
.app-toast-info    { --t: #0284c7; }

/* ---------- Superfícies ---------- */
.card-soft {
    background: var(--md-surface);
    border-radius: var(--md-radius);
    box-shadow: var(--md-shadow);
    border: 1px solid rgba(227, 234, 230, .7);
    padding: 1.15rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 1.6rem 4px .8rem;
}

.section-title h2 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -.01em;
    margin: 0;
}

.section-title small {
    color: var(--md-muted);
    font-weight: 600;
}

.page-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: .25rem 0 1.1rem;
}

.page-head h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0;
}

.page-head small {
    color: var(--md-muted);
    font-weight: 500;
}

.icon-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--md-text);
    box-shadow: var(--md-shadow);
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform .15s;
}

.icon-btn:hover {
    color: var(--md-primary);
}

.icon-btn:active {
    transform: scale(.93);
}

.footnote {
    text-align: center;
    color: var(--md-muted);
    font-size: .78rem;
    margin: 1.25rem 1rem 0;
}

/* ---------- Botões ---------- */
.btn-gradient {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .9rem 1.2rem;
    border: 0;
    border-radius: 16px;
    font-weight: 700;
    color: #fff;
    background: var(--md-gradient);
    box-shadow: var(--md-shadow-lg);
    transition: transform .15s, filter .15s, box-shadow .15s;
}

.btn-gradient:hover,
.btn-gradient:focus-visible {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.btn-gradient:active {
    color: #fff;
    transform: scale(.985);
}

.btn-gradient:disabled {
    color: #fff;
    opacity: .6;
    box-shadow: none;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    animation: shine 3.2s ease-in-out infinite;
}

.btn-soft-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem;
    border: 0;
    border-radius: 16px;
    font-weight: 600;
    color: #e11d48;
    background: #fff1f2;
    transition: background .15s;
}

.btn-soft-danger:hover {
    color: #be123c;
    background: #ffe4e6;
}

/* ---------- Formulários ---------- */
.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: #334155;
}

.form-control,
.form-select {
    border: 1.5px solid var(--md-border);
    border-radius: 14px;
    padding: .75rem .95rem;
    background-color: #fbfcfb;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.form-control:focus,
.form-select:focus {
    border-color: #34d399;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .15);
}

.form-floating > .form-control {
    height: 3.7rem;
    min-height: 3.7rem;
}

.form-floating > label {
    color: var(--md-muted);
}

.form-floating > label i {
    margin-right: .25rem;
}

.input-group-text {
    border: 1.5px solid var(--md-border);
    border-radius: 14px;
    background: #eef3f0;
    color: var(--md-muted);
    font-weight: 600;
}

.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-muted);
    pointer-events: none;
}

.input-icon > .form-control {
    padding-left: 2.7rem;
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--md-muted);
}

.password-toggle:hover {
    background: #eef3f0;
}

.form-alert {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    padding: 12px 14px;
    border: 1px solid #fecdd3;
    border-radius: 14px;
    background: #fff1f2;
    color: #9f1239;
    font-size: .88rem;
}

.form-alert > i {
    color: #e11d48;
    font-size: 1.05rem;
}

.form-section {
    margin-bottom: 1.6rem;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: .8rem;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--md-muted);
}

.form-section-title i {
    color: var(--md-primary);
    font-size: .95rem;
}

/* Chips de refeição */
.meal-breakfast { --meal-color: #d97706; --meal-soft: #fef3c7; }
.meal-lunch     { --meal-color: #059669; --meal-soft: #d1fae5; }
.meal-snack     { --meal-color: #db2777; --meal-soft: #fce7f3; }
.meal-dinner    { --meal-color: #4f46e5; --meal-soft: #e0e7ff; }

.meal-chips {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 1.1rem;
}

.meal-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 11px 4px 9px;
    border: 1.5px solid var(--md-border);
    border-radius: 16px;
    background: #fff;
    color: var(--md-muted);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s var(--md-ease);
}

.meal-chip i {
    font-size: 1.3rem;
    color: var(--meal-color);
}

.btn-check:checked + .meal-chip {
    border-color: var(--meal-color);
    background: var(--meal-soft);
    color: var(--md-text);
    transform: translateY(-2px);
    box-shadow: 0 10px 18px -12px var(--meal-color);
}

.btn-check:focus-visible + .meal-chip,
.btn-check:focus-visible + .option-card {
    outline: 3px solid rgba(16, 185, 129, .35);
    outline-offset: 2px;
}

/* Calorias e macros */
.kcal-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: .75rem;
    padding: 12px 18px;
    border: 1.5px solid #a7f3d0;
    border-radius: 18px;
    background: linear-gradient(135deg, #ecfdf5, #fff);
    cursor: text;
    transition: box-shadow .15s, border-color .15s;
}

.kcal-input:focus-within {
    border-color: #34d399;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .15);
}

.kcal-input > i {
    font-size: 1.5rem;
    color: #f97316;
}

.kcal-input input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--md-primary-dark);
}

.kcal-input span {
    font-weight: 700;
    color: var(--md-muted);
}

.macro-protein { --c: var(--md-protein); }
.macro-carbs   { --c: var(--md-carbs); }
.macro-fat     { --c: var(--md-fat); }

.macro-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 1.25rem;
}

.macro-input {
    margin: 0;
    padding: 9px 11px;
    border: 1.5px solid var(--md-border);
    border-top: 4px solid var(--c);
    border-radius: 16px;
    background: #fff;
    cursor: text;
    transition: box-shadow .15s;
}

.macro-input:focus-within {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent);
}

.macro-input > span:first-child {
    display: block;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--c);
}

.macro-input-row {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.macro-input input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 1.25rem;
    font-weight: 800;
}

.macro-input em {
    font-style: normal;
    font-weight: 700;
    color: var(--md-muted);
    font-size: .85rem;
}

/* Cards de opção (perfil) */
.option-grid {
    display: grid;
    gap: 10px;
}

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

.option-card {
    height: 100%;
    margin: 0;
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--md-border);
    border-radius: 18px;
    background: #fff;
    text-align: center;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s var(--md-ease);
}

.option-card > i {
    font-size: 1.5rem;
    color: #94a3b8;
    transition: color .18s;
}

.option-card small {
    font-weight: 500;
    color: var(--md-muted);
    font-size: .74rem;
    line-height: 1.3;
}

.btn-check:checked + .option-card {
    border-color: var(--md-primary);
    background: #ecfdf5;
    box-shadow: 0 12px 22px -16px rgba(5, 150, 105, .9);
}

.btn-check:checked + .option-card > i {
    color: var(--md-primary);
}

.option-card.option-row {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 14px;
    text-align: left;
}

.option-check {
    flex-shrink: 0;
    margin-left: auto;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    color: transparent;
    font-size: .9rem;
    transition: all .18s;
}

.btn-check:checked + .option-card .option-check {
    border-color: var(--md-primary);
    background: var(--md-primary);
    color: #fff;
}

.level-bars {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
}

.level-bars span {
    width: 5px;
    border-radius: 3px;
    background: #e2e8f0;
}

.level-bars span:nth-child(1) { height: 7px; }
.level-bars span:nth-child(2) { height: 11px; }
.level-bars span:nth-child(3) { height: 15px; }
.level-bars span:nth-child(4) { height: 19px; }
.level-bars span:nth-child(5) { height: 24px; }

.level-bars span.on {
    background: linear-gradient(180deg, #34d399, #059669);
}

/* ---------- Dashboard: hero ---------- */
.hero {
    position: relative;
    padding: .25rem 0 1.4rem;
    color: #fff;
}

.hero::before {
    content: '';
    position: absolute;
    z-index: -1;
    left: 50%;
    top: -140px;
    bottom: -70px;
    width: 100vw;
    transform: translateX(-50%);
    background:
        radial-gradient(circle at 85% 20%, rgba(217, 249, 157, .35) 0, transparent 38%),
        radial-gradient(circle at 10% 80%, rgba(52, 211, 153, .45) 0, transparent 40%),
        var(--md-gradient);
    border-radius: 0 0 40px 40px;
}

.hero::after {
    content: '';
    position: absolute;
    z-index: -1;
    top: 40px;
    right: -16px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 36px solid rgba(255, 255, 255, .05);
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hero-eyebrow {
    font-size: .9rem;
    opacity: .85;
    font-weight: 500;
}

.hero-title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
}

.date-pill {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.date-pill a,
.date-pill .is-disabled {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: background .15s;
}

.date-pill a:hover {
    background: rgba(255, 255, 255, .22);
}

.date-pill .is-disabled {
    opacity: .3;
}

.date-pill-label {
    padding: 0 4px;
    font-size: .84rem;
    font-weight: 700;
    white-space: nowrap;
}

.hero-link {
    display: inline-block;
    margin-top: 6px;
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    opacity: .9;
    text-decoration: none;
}

.hero-link:hover {
    color: #fff;
    opacity: 1;
}

.calorie-ring {
    position: relative;
    width: 214px;
    height: 214px;
    margin: 1rem auto 1.1rem;
}

.calorie-ring svg {
    overflow: visible;
    transform: rotate(-90deg);
}

.ring-track {
    stroke: rgba(255, 255, 255, .17);
}

.ring-value {
    stroke: url(#ringGradient);
    stroke-linecap: round;
    filter: drop-shadow(0 0 10px rgba(217, 249, 157, .55));
    animation: ring-fill 1.5s var(--md-ease) .25s both;
}

.calorie-ring.is-over .ring-value {
    stroke: #fda4af;
    filter: drop-shadow(0 0 10px rgba(253, 164, 175, .7));
}

.ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ring-icon {
    width: 34px;
    height: 34px;
    margin-bottom: 6px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fde68a;
}

.ring-number {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ring-caption {
    margin-top: 5px;
    font-size: .8rem;
    font-weight: 600;
    opacity: .85;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.hero-stat {
    padding: 10px 6px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 18px;
    background: rgba(255, 255, 255, .13);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hero-stat i {
    font-size: 1rem;
    opacity: .85;
}

.hero-stat strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.hero-stat small {
    font-size: .72rem;
    opacity: .85;
}

/* ---------- Dashboard: macros ---------- */
.macro-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 1.1rem .5rem;
    text-align: center;
}

.macro-item + .macro-item {
    border-left: 1px solid var(--md-border);
}

.mini-ring {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 0 auto 8px;
}

.mini-ring svg {
    transform: rotate(-90deg);
}

.mini-ring .track {
    stroke: #f1f5f9;
    stroke: color-mix(in srgb, var(--c) 13%, transparent);
}

.mini-ring .value {
    stroke: var(--c);
    stroke-linecap: round;
    animation: ring-fill 1.3s var(--md-ease) .45s both;
}

.mini-ring-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: .8rem;
    font-weight: 800;
    color: var(--c);
}

.macro-value {
    font-variant-numeric: tabular-nums;
}

.macro-value strong {
    font-size: 1.1rem;
    font-weight: 800;
}

.macro-value span {
    color: var(--md-muted);
    font-size: .8rem;
    font-weight: 600;
}

.macro-name {
    margin-top: 1px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--md-muted);
}

/* ---------- Dashboard: avisos e vazio ---------- */
.callout {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1rem;
    padding: 14px;
    border: 1px solid #a7f3d0;
    border-radius: 20px;
    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
    box-shadow: var(--md-shadow);
    color: var(--md-text);
    text-decoration: none;
}

.callout:hover {
    color: var(--md-text);
}

.callout-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--md-gradient);
    color: #fff;
    font-size: 1.2rem;
}

.callout strong {
    display: block;
}

.callout small {
    color: var(--md-muted);
}

.callout .bi-chevron-right {
    margin-left: auto;
    color: var(--md-primary);
}

.empty-state {
    text-align: center;
    padding: 1.5rem 1.25rem;
}

.empty-state h3 {
    margin: .75rem 0 .25rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.empty-state p {
    margin-bottom: 1rem;
    color: var(--md-muted);
    font-size: .9rem;
}

/* ---------- Dashboard: refeições ---------- */
.meal-card {
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid rgba(227, 234, 230, .7);
    border-radius: var(--md-radius);
    background: #fff;
    box-shadow: var(--md-shadow);
}

.meal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 16px;
}

.meal-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--meal-soft);
    color: var(--meal-color);
    font-size: 1.25rem;
}

.meal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.meal-header small {
    color: var(--md-muted);
    font-size: .8rem;
    font-weight: 500;
}

.meal-add {
    margin-left: auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--md-bg);
    color: var(--md-text);
    font-size: 1.1rem;
    text-decoration: none;
    transition: all .18s var(--md-ease);
}

.meal-add:hover {
    background: var(--meal-soft);
    color: var(--meal-color);
    transform: rotate(90deg);
}

.entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-top: 1px solid var(--md-border);
    color: inherit;
    text-decoration: none;
    transition: background .15s;
}

.entry:hover {
    color: inherit;
    background: #fafcfb;
}

.entry:active {
    background: var(--md-bg);
}

.entry-thumb {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: 15px;
    object-fit: cover;
    background: var(--meal-soft);
}

.entry-thumb-ph {
    display: grid;
    place-items: center;
    color: var(--meal-color);
    font-size: 1.25rem;
}

.entry-body {
    flex: 1;
    min-width: 0;
}

.entry-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: .95rem;
    font-weight: 700;
}

.entry-title .bi-stars {
    color: var(--md-primary);
    font-size: .8rem;
}

.entry-macros {
    display: flex;
    gap: 10px;
    margin-top: 3px;
    font-size: .76rem;
    font-weight: 600;
    color: var(--md-muted);
    font-variant-numeric: tabular-nums;
}

.entry-macros span::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-radius: 50%;
    background: var(--c);
    vertical-align: 1px;
}

.entry-kcal {
    text-align: right;
    line-height: 1.1;
}

.entry-kcal strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.entry-kcal small {
    color: var(--md-muted);
    font-size: .7rem;
    font-weight: 600;
}

/* ---------- Adicionar refeição ---------- */
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 1.1rem;
    padding: 4px;
    border-radius: 17px;
    background: #e4ebe7;
}

.segmented a {
    padding: .62rem;
    border-radius: 13px;
    text-align: center;
    font-size: .9rem;
    font-weight: 700;
    color: var(--md-muted);
    text-decoration: none;
    transition: all .2s var(--md-ease);
}

.segmented a:hover {
    color: var(--md-text);
}

.segmented a.active {
    background: #fff;
    color: var(--md-primary-dark);
    box-shadow: 0 3px 10px -2px rgba(15, 31, 24, .12);
}

.photo-drop {
    position: relative;
    display: block;
    min-height: 270px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    border: 2px dashed #a7e3c8;
    border-radius: 26px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.photo-drop:hover {
    border-color: #34d399;
    box-shadow: 0 16px 30px -22px rgba(5, 150, 105, .8);
}

.photo-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 1.5rem;
    text-align: center;
    background:
        radial-gradient(circle at 50% 36%, #dcfce7 0, transparent 45%),
        radial-gradient(circle at 50% 100%, #f0fdf4 0, #fff 70%);
}

.photo-empty svg {
    margin-bottom: 12px;
}

.photo-empty .frame-corners {
    transform-origin: center;
    animation: corners 2.4s ease-in-out infinite;
}

.photo-empty strong {
    font-size: 1.08rem;
    font-weight: 800;
}

.photo-empty span {
    color: var(--md-muted);
    font-size: .86rem;
}

.photo-drop.has-image {
    min-height: 0;
    border: 0;
    box-shadow: var(--md-shadow);
}

.photo-drop img {
    display: block;
    width: 100%;
    max-height: 390px;
    object-fit: cover;
}

.photo-change {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(15, 31, 24, .55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(180deg, rgba(4, 120, 87, .1), rgba(4, 78, 59, .55));
}

.scan-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .09) 1px, transparent 1px);
    background-size: 26px 26px;
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d9f99d, transparent);
    box-shadow: 0 0 20px 5px rgba(217, 249, 157, .65);
    animation: scan 1.8s ease-in-out infinite alternate;
}

.scan-status {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(6, 20, 14, .6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
}

.scan-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #d9f99d;
    box-shadow: 0 0 10px #d9f99d;
    animation: blink 1s infinite;
}

.tips {
    display: flex;
    gap: 8px;
    margin: -.25rem -16px 1.25rem;
    padding: 2px 16px 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.tip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--md-shadow);
    color: var(--md-muted);
    font-size: .76rem;
    font-weight: 600;
}

.tip i {
    color: var(--md-primary);
}

/* ---------- Editar refeição ---------- */
.meal-hero {
    position: relative;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 26px;
    box-shadow: var(--md-shadow);
}

.meal-hero img {
    display: block;
    width: 100%;
    height: 290px;
    object-fit: cover;
}

.meal-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    background: linear-gradient(180deg, rgba(6, 20, 14, 0) 35%, rgba(6, 20, 14, .85));
    color: #fff;
}

.meal-hero--plain {
    min-height: 170px;
    background:
        radial-gradient(circle at 90% 10%, rgba(217, 249, 157, .35), transparent 40%),
        var(--md-gradient);
}

.meal-hero--plain .meal-hero-overlay {
    position: relative;
    min-height: 170px;
    background: none;
}

.badge-ai {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: auto;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: .74rem;
    font-weight: 700;
}

.meal-hero h2 {
    margin: 0 0 2px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.meal-hero-kcal {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.meal-hero-kcal small {
    font-size: .9rem;
    font-weight: 600;
    opacity: .85;
}

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

.macro-pill {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 4px solid var(--c);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--md-shadow);
}

.macro-pill strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
}

.macro-pill small {
    color: var(--md-muted);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.food-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
}

.food-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #065f46;
    font-size: .8rem;
    font-weight: 600;
}

/* ---------- Perfil ---------- */
.goal-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
    padding: 22px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 100% 0%, rgba(217, 249, 157, .35), transparent 40%),
        var(--md-gradient);
    box-shadow: var(--md-shadow-lg);
    color: #fff;
}

.goal-card::after {
    content: '';
    position: absolute;
    right: -50px;
    bottom: -70px;
    width: 200px;
    height: 200px;
    border: 32px solid rgba(255, 255, 255, .06);
    border-radius: 50%;
}

.goal-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    font-weight: 700;
    opacity: .9;
}

.goal-kcal {
    margin: 6px 0 2px;
    font-size: 3.1rem;
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1;
}

.goal-kcal small {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    opacity: .85;
}

.goal-macros {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.goal-macro {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 16px;
    background: rgba(255, 255, 255, .13);
}

.goal-macro-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
}

.goal-macro-top em {
    font-style: normal;
    font-size: .72rem;
    font-weight: 700;
    opacity: .8;
}

.goal-macro strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
}

.goal-macro small {
    font-size: .72rem;
    opacity: .85;
}

.goal-macro-bar {
    height: 4px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, .2);
}

.goal-macro-bar span {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: #fff;
}

.goal-foot {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.goal-foot div {
    padding: 9px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .13);
    font-size: .76rem;
}

.goal-foot strong {
    display: block;
    font-size: .95rem;
}

/* ---------- Login / cadastro ---------- */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 15% 8%, rgba(52, 211, 153, .75) 0, transparent 42%),
        radial-gradient(circle at 95% 30%, rgba(163, 230, 53, .4) 0, transparent 35%),
        radial-gradient(circle at 50% 110%, rgba(16, 185, 129, .5) 0, transparent 50%),
        linear-gradient(165deg, #047857, #065f46 55%, #064e3b);
    background-attachment: fixed;
}

.auth-hero {
    padding: 1.25rem 0 1.25rem;
    text-align: center;
    color: #fff;
}

.auth-art {
    position: relative;
    width: 240px;
    margin: 0 auto;
}

.auth-art svg {
    width: 100%;
    height: auto;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .2));
}

.float-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .45);
    color: var(--md-text);
    font-size: .74rem;
    font-weight: 800;
    white-space: nowrap;
    animation: float 5s ease-in-out infinite;
}

.float-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c);
}

.chip-1 { top: 6%; left: -12%; animation-delay: -1s; }
.chip-2 { top: 40%; right: -16%; animation-delay: -2.5s; }
.chip-3 { bottom: 4%; left: -6%; animation-delay: -3.8s; }

.brand-lg {
    justify-content: center;
    margin-top: .9rem;
    font-size: 1.55rem;
    color: #fff;
}

.auth-tagline {
    max-width: 300px;
    margin: .35rem auto 0;
    font-size: .95rem;
    opacity: .88;
}

.auth-card {
    padding: 1.6rem 1.35rem;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .55);
}

.auth-card h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-card .lead-text {
    margin: .25rem 0 1.25rem;
    color: var(--md-muted);
    font-size: .9rem;
}

.auth-switch {
    margin: 1.25rem 0 0;
    text-align: center;
    color: rgba(255, 255, 255, .85);
    font-size: .92rem;
}

.auth-switch a {
    color: #fff;
    font-weight: 800;
    text-decoration-color: rgba(255, 255, 255, .5);
    text-underline-offset: 3px;
}

/* Logo sobre fundos verdes */
.brand-lg .logo,
.has-hero .app-topbar .logo {
    border-radius: 12px;
    box-shadow: 0 0 0 2.5px rgba(255, 255, 255, .4);
}

.goal-macro strong,
.goal-macro-top em {
    white-space: nowrap;
}

/* =============================================================
   Evolução / meta de peso
   ============================================================= */
:root {
    --md-series-actual: #059669;
    --md-series-plan: #6366f1;
    --md-safe: #059669;
    --md-warn: #d97706;
    --md-danger: #e11d48;
}

/* Planejador */
.planner-weights {
    display: flex;
    align-items: center;
    gap: 12px;
}

.planner-weights > div,
.planner-target {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--md-bg);
}

.planner-weights > .bi {
    color: var(--md-muted);
    font-size: 1.2rem;
}

.planner-weights small {
    display: block;
    color: var(--md-muted);
    font-size: .74rem;
    font-weight: 700;
}

.planner-weights strong {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.planner-weights em {
    font-style: normal;
    font-size: .9rem;
    font-weight: 700;
    color: var(--md-muted);
}

.planner-target {
    border: 1.5px solid #a7f3d0;
    background: linear-gradient(135deg, #ecfdf5, #fff);
    cursor: text;
    transition: box-shadow .15s, border-color .15s;
}

.planner-target:focus-within {
    border-color: #34d399;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .15);
}

.planner-target span {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.planner-target input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--md-primary-dark);
}

.planner-diff {
    margin-top: 10px;
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
    color: var(--md-muted);
}

.planner-range {
    height: 1.6rem;
}

.planner-range::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, #a7f3d0, #059669);
}

.planner-range::-moz-range-track {
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, #a7f3d0, #059669);
}

.planner-range::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
    margin-top: -9px;
    border: 4px solid #fff;
    background: var(--md-primary);
    box-shadow: 0 4px 12px rgba(5, 150, 105, .5);
}

.planner-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: 4px solid #fff;
    background: var(--md-primary);
    box-shadow: 0 4px 12px rgba(5, 150, 105, .5);
}

.plan-result {
    margin-top: 1rem;
    transition: opacity .2s;
}

.plan-result.is-loading {
    opacity: .55;
}

/* Selo de segurança (status: sempre ícone + texto) */
.safety {
    --s: var(--md-safe);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: #ecfdf5;
    background: color-mix(in srgb, var(--s) 9%, #fff);
    border: 1.5px solid color-mix(in srgb, var(--s) 35%, transparent);
}

.safety > .bi {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--s);
    color: #fff;
    font-size: 1.2rem;
}

.safety strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
}

.safety span {
    font-size: .88rem;
    color: #334155;
}

.safety-aggressive { --s: var(--md-warn); }
.safety-unsafe     { --s: var(--md-danger); }

.plan-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.plan-stat {
    padding: 12px 14px;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--md-shadow);
}

.plan-stat small {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    color: var(--md-muted);
}

.plan-stat strong {
    display: block;
    margin: 1px 0;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.plan-stat span {
    font-size: .74rem;
    color: var(--md-muted);
}

.plan-stat-accent {
    background: linear-gradient(135deg, #ecfdf5, #fff);
    border: 1.5px solid #a7f3d0;
}

.plan-stat-accent strong {
    color: var(--md-primary-dark);
}

.plan-stat-wide {
    grid-column: 1 / -1;
}

.issue-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.issue-list li {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    font-size: .85rem;
    box-shadow: var(--md-shadow);
}

.issue-list .bi {
    flex-shrink: 0;
}

.issue-unsafe .bi { color: var(--md-danger); }
.issue-aggressive .bi { color: var(--md-warn); }

.suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
    border: 1.5px dashed #6ee7b7;
}

.suggestion-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--md-gradient);
    color: #fff;
}

.suggestion > div > strong:first-child {
    display: block;
}

.suggestion span {
    font-size: .85rem;
}

.suggestion .btn {
    padding: .5rem .9rem;
    border-radius: 12px;
    box-shadow: none;
}

/* Gráfico */
.chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.chart-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.chart-legend {
    display: flex;
    gap: 12px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--md-muted);
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.key {
    display: inline-block;
    width: 16px;
    height: 0;
    border-top: 2px solid;
}

.key-actual { border-color: var(--md-series-actual); }
.key-plan   { border-top-style: dashed; border-color: var(--md-series-plan); }
.key-target { border-top-width: 1px; border-color: #94a3b8; }

.chart {
    position: relative;
    touch-action: pan-y;
}

.chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart-grid {
    stroke: #edf1ee;
    stroke-width: 1;
}

.chart-axis {
    fill: var(--md-muted);
    font-size: 9.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.chart-target {
    stroke: #94a3b8;
    stroke-width: 1;
}

.chart-target-label {
    fill: var(--md-muted);
    font-size: 9.5px;
    font-weight: 700;
}

.chart-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-line-plan {
    stroke: var(--md-series-plan);
    stroke-dasharray: 6 5;
}

.chart-line-actual {
    stroke: var(--md-series-actual);
}

.chart-dot {
    fill: var(--md-series-actual);
    stroke: #fff;
    stroke-width: 2;
}

.chart-end-label {
    fill: var(--md-text);
    font-size: 10.5px;
    font-weight: 800;
}

.chart-cross {
    stroke: #94a3b8;
    stroke-width: 1;
    pointer-events: none;
}

.chart-tip {
    position: absolute;
    top: 0;
    z-index: 2;
    min-width: 130px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px -10px rgba(15, 31, 24, .35);
    font-size: .76rem;
    pointer-events: none;
    transform: translateX(-50%);
}

.chart-tip-date {
    margin-bottom: 4px;
    color: var(--md-muted);
    font-weight: 600;
}

.chart-tip-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-tip-row strong {
    font-weight: 800;
}

.chart-tip-row span {
    color: var(--md-muted);
}

.milestones summary {
    margin-top: 12px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--md-primary-dark);
    cursor: pointer;
}

.card-soft.milestones summary {
    margin-top: 0;
}

.milestones ol {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.milestones li {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--md-border);
    font-size: .86rem;
    font-variant-numeric: tabular-nums;
}

.milestones li:last-child {
    border-bottom: 0;
}

.milestones li span {
    color: var(--md-muted);
}

/* Acompanhamento */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .3);
    font-size: .78rem;
    font-weight: 800;
}

.plan-progress {
    position: relative;
    z-index: 1;
    height: 10px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255, 255, 255, .2);
}

.plan-progress span {
    display: block;
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #fff, #d9f99d);
    animation: grow 1.2s var(--md-ease) both .3s;
    transform-origin: left;
}

@keyframes grow {
    from { transform: scaleX(0); }
}

.goal-foot-3 {
    grid-template-columns: repeat(3, 1fr);
}

.status-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: -.4rem 4px 1rem;
    font-size: .88rem;
    font-weight: 600;
    color: #334155;
}

.status-message .bi {
    color: var(--md-primary);
}

.status-message-warn .bi {
    color: var(--md-warn);
}

.weigh-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
}

.weigh-form .btn {
    width: 50px;
    padding: 0;
}

.weigh-table {
    width: 100%;
    margin-top: 14px;
    font-size: .86rem;
    font-variant-numeric: tabular-nums;
}

.weigh-table th {
    padding-bottom: 6px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--md-muted);
}

.weigh-table td {
    padding: 8px 0;
    border-top: 1px solid var(--md-border);
}

.weigh-table th:not(:first-child),
.weigh-table td:not(:first-child) {
    text-align: right;
}

.delta {
    font-weight: 700;
    color: var(--md-muted);
}

.delta .bi {
    font-size: .75rem;
}

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

.btn-light-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem;
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--md-shadow);
    font-weight: 600;
    color: var(--md-text);
}

.btn-light-soft:hover {
    color: var(--md-primary);
    background: #fff;
}

/* Card de meta no diário */
.plan-mini {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 1rem;
    padding: 14px 16px;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--md-shadow);
    color: var(--md-text);
    text-decoration: none;
}

.plan-mini:hover {
    color: var(--md-text);
}

.plan-mini-body {
    flex: 1;
    min-width: 0;
}

.plan-mini-body strong {
    display: block;
    font-size: .95rem;
}

.plan-mini-body small {
    color: var(--md-muted);
}

.plan-mini-bar {
    height: 6px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--md-primary-soft);
}

.plan-mini-bar span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--md-gradient);
}

/* ---------- Descrever refeição (IA por texto) ---------- */
.describe-input {
    min-height: 120px;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
}

.describe-examples {
    display: flex;
    gap: 8px;
    margin: 10px -1.15rem 0;
    padding: 2px 1.15rem 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.describe-examples::-webkit-scrollbar {
    display: none;
}

.describe-examples .tip {
    border: 0;
    cursor: pointer;
    transition: color .15s, transform .15s;
}

.describe-examples .tip:hover {
    color: var(--md-primary-dark);
}

.describe-examples .tip:active {
    transform: scale(.96);
}

.describe-hint {
    display: flex;
    gap: 8px;
    margin: .75rem 0 1.25rem;
    font-size: .82rem;
    color: var(--md-muted);
}

.describe-hint .bi {
    color: var(--md-primary);
}

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

/* ---------- App e lembretes ---------- */
.setting-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.setting-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.setting-head small {
    color: var(--md-muted);
    font-size: .8rem;
}

.setting-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--md-primary-soft);
    color: var(--md-primary-dark);
    font-size: 1.2rem;
}

.setting-ok {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--md-primary-dark);
}

.setting-note {
    display: flex;
    gap: 8px;
    margin: 0;
    font-size: .86rem;
    color: #475569;
}

.setting-note .bi {
    flex-shrink: 0;
    color: var(--md-primary);
}

.setting-feedback {
    margin: 12px 0 0;
    font-size: .85rem;
    font-weight: 600;
    color: var(--md-primary-dark);
}

.setting-feedback.is-error {
    color: var(--md-danger);
}

.install-steps {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.install-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: .9rem;
}

.install-steps .step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--md-gradient);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
}

.install-steps .bi {
    color: var(--md-primary);
}

.reminder-row {
    padding: 14px 0;
    border-top: 1px solid var(--md-border);
}

.reminder-row .form-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-left: 2.75em;
}

.reminder-row .form-switch .form-check-input {
    width: 2.4em;
    height: 1.3em;
    margin-top: 0;
}

.reminder-row .form-check-label {
    font-weight: 700;
}

.form-check-input:checked {
    background-color: var(--md-primary);
    border-color: var(--md-primary);
}

.reminder-when {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 8px;
}

.reminder-meal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
}

.reminder-meal .form-check {
    margin: 0;
}

.reminder-meal .form-check-label {
    font-weight: 500;
}

.reminder-meal .form-control {
    width: 120px;
    padding: .5rem .75rem;
}

/* Convite para instalar (diário) */
.install-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 36px 12px 12px;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--md-shadow);
}

.install-banner img {
    border-radius: 12px;
}

.install-banner strong {
    display: block;
    font-size: .92rem;
}

.install-banner small {
    display: block;
    color: var(--md-muted);
    font-size: .76rem;
    line-height: 1.3;
}

.install-banner .btn {
    padding: .45rem .8rem;
    border-radius: 12px;
    box-shadow: none;
}

.install-dismiss {
    position: absolute;
    top: 4px;
    right: 6px;
    border: 0;
    background: none;
    color: var(--md-muted);
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px;
}

/* App instalado: espaço para a barra de status do iPhone */
@media (display-mode: standalone) {
    .app-topbar {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
}

.quota-note {
    display: flex;
    gap: 8px;
    margin: -.25rem 4px 1rem;
    font-size: .84rem;
    font-weight: 600;
    color: var(--md-warn);
}

/* Recuperação de senha */
.auth-hero-compact {
    padding: 2.5rem 0 1.5rem;
}

.auth-done {
    text-align: center;
}

.auth-done-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    border-radius: 20px;
    background: var(--md-primary-soft);
    color: var(--md-primary-dark);
    font-size: 1.8rem;
}

.auth-done-icon-warn {
    background: #fef3c7;
    color: var(--md-warn);
}

/* =============================================================
   Cardápio
   ============================================================= */
.macro-fiber { --c: #0d9488; }

/* Barra inferior com 5 itens */
.bottom-nav-inner {
    max-width: 440px;
    padding: 0 6px;
}

.bn-link {
    font-size: .68rem;
}

.bn-fab {
    flex-shrink: 0;
}

/* Sugestões para agora */
.menu-now {
    padding: 16px 0 4px;
}

.menu-now-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}

.menu-now-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--meal-soft);
    color: var(--meal-color);
    font-size: 1.25rem;
}

.menu-now-head small {
    display: block;
    color: var(--md-muted);
    font-weight: 600;
    font-size: .8rem;
}

.menu-now-head strong {
    display: block;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.25;
}

.menu-now-note {
    margin: 10px 4px 0;
    font-size: .84rem;
    color: #475569;
}

.recipe-scroll {
    display: flex;
    gap: 12px;
    margin: 12px -16px 0;
    padding: 4px 16px 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
}

.recipe-scroll::-webkit-scrollbar {
    display: none;
}

/* Cartão de receita */
.recipe-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--md-shadow);
    border: 1px solid rgba(227, 234, 230, .7);
    color: var(--md-text);
    text-decoration: none;
    transition: transform .18s var(--md-ease), box-shadow .18s;
}

.recipe-card:hover {
    color: var(--md-text);
    transform: translateY(-2px);
    box-shadow: 0 16px 34px -18px rgba(15, 31, 24, .35);
}

.recipe-card-wide {
    flex: 0 0 84%;
    max-width: 330px;
    scroll-snap-align: start;
}

.recipe-card-top {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    height: 74px;
    padding: 12px;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .55), transparent 45%),
        linear-gradient(135deg, var(--meal-soft), color-mix(in srgb, var(--meal-color) 30%, var(--meal-soft)));
}

.recipe-card-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #fff;
    color: var(--meal-color);
    font-size: 1.2rem;
    box-shadow: 0 6px 14px -8px var(--meal-color);
}

.recipe-card-meta {
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    font-size: .72rem;
    font-weight: 700;
    color: #334155;
}

.recipe-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px 14px;
    flex: 1;
}

.recipe-card-title {
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.25;
}

.recipe-card-kcal {
    font-size: .8rem;
    color: var(--md-muted);
}

.recipe-card-kcal b {
    font-size: 1.1rem;
    color: var(--md-text);
}

.recipe-card-macros {
    display: flex;
    gap: 10px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--md-muted);
}

.recipe-card-macros span::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-radius: 50%;
    background: var(--c);
    vertical-align: 1px;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.recipe-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--md-bg);
    font-size: .68rem;
    font-weight: 700;
    color: #475569;
}

.recipe-reasons {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.recipe-reasons li {
    display: flex;
    gap: 6px;
    font-size: .78rem;
    color: #334155;
    line-height: 1.35;
    margin-top: 3px;
}

.recipe-reasons .bi {
    color: var(--md-primary);
    flex-shrink: 0;
}

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

.recipe-grid .recipe-card-top {
    height: 62px;
}

/* Dicas */
.tips-list {
    display: grid;
    gap: 10px;
}

.tip-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--md-shadow);
}

.tip-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--md-primary-soft);
    color: var(--md-primary-dark);
    font-size: 1.1rem;
}

.tip-card-why {
    display: inline-block;
    margin-bottom: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: .7rem;
    font-weight: 700;
}

.tip-card h3 {
    margin: 0 0 4px;
    font-size: .95rem;
    font-weight: 800;
}

.tip-card p {
    margin: 0;
    font-size: .85rem;
    color: #475569;
    line-height: 1.45;
}

.tip-card-ref {
    margin-top: 6px;
    font-size: .74rem;
    color: var(--md-muted);
}

.tip-card-ref summary {
    font-weight: 700;
    color: var(--md-primary-dark);
    cursor: pointer;
}

/* Busca e filtros */
.menu-search {
    margin-bottom: 10px;
}

.filter-chips {
    display: flex;
    gap: 6px;
    margin: 0 -16px 8px;
    padding: 2px 16px 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chips-tags {
    margin-bottom: 14px;
}

.filter-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1.5px solid var(--md-border);
    background: #fff;
    font-size: .8rem;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    transition: all .15s;
}

.filter-chip:hover {
    color: var(--md-primary-dark);
}

.filter-chip.active {
    border-color: var(--md-primary);
    background: var(--md-primary);
    color: #fff;
}

/* Página da receita */
.recipe-title {
    font-size: 1.25rem !important;
    line-height: 1.2;
}

.recipe-hero {
    padding: 18px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .6), transparent 40%),
        linear-gradient(135deg, var(--meal-soft), color-mix(in srgb, var(--meal-color) 28%, var(--meal-soft)));
    margin-bottom: 12px;
}

.recipe-hero p {
    margin: 0 0 14px;
    font-weight: 600;
    color: #1f2937;
}

.recipe-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.recipe-hero-stats div {
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .75);
    text-align: center;
}

.recipe-hero-stats strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
}

.recipe-hero-stats small {
    font-size: .72rem;
    color: #475569;
}

.recipe-hero .recipe-tag {
    background: rgba(255, 255, 255, .75);
}

.macro-pills-4 {
    grid-template-columns: repeat(4, 1fr);
}

.goal-fit h2,
.recipe-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 800;
}

.goal-fit h2 .bi,
.recipe-section-title .bi {
    color: var(--md-primary);
}

.goal-fit-row {
    --c: var(--md-primary);
    display: grid;
    grid-template-columns: 110px 1fr 44px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: .84rem;
}

.goal-fit-row strong {
    text-align: right;
}

.goal-fit-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 8px;
    background: #edf1ee;
}

.goal-fit-bar span {
    display: block;
    height: 100%;
    border-radius: 8px;
    background: var(--c);
}

.ingredient-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ingredient-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--md-border);
}

.ingredient-list li:last-child {
    border-bottom: 0;
}

.ingredient-list span {
    font-weight: 600;
    font-size: .9rem;
}

.ingredient-list small {
    display: block;
    font-weight: 500;
    color: var(--md-muted);
    font-size: .76rem;
}

.ingredient-list strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.recipe-note {
    margin: 10px 0 0;
    font-size: .78rem;
    color: var(--md-muted);
}

.step-list {
    counter-reset: step;
    margin: 0;
    padding: 0;
    list-style: none;
}

.step-list li {
    position: relative;
    padding: 0 0 14px 40px;
    font-size: .9rem;
    line-height: 1.5;
}

.step-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: -2px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--md-gradient);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
}

.recipe-tip {
    display: flex;
    gap: 8px;
    margin: 4px 0 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fffbeb;
    font-size: .84rem;
    color: #78350f;
}

.recipe-tip .bi {
    color: #d97706;
}

.portion-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 1.1rem;
}

.portion-option {
    margin: 0;
    padding: 10px 4px;
    border: 1.5px solid var(--md-border);
    border-radius: 16px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
}

.portion-option strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
}

.portion-option small {
    font-size: .7rem;
    color: var(--md-muted);
}

.btn-check:checked + .portion-option {
    border-color: var(--md-primary);
    background: #ecfdf5;
    box-shadow: 0 10px 18px -14px rgba(5, 150, 105, .9);
}

/* Ideia no diário */
.idea-mini {
    margin-top: .6rem;
}

.idea-mini .idea-icon {
    background: var(--meal-soft);
    color: var(--meal-color);
}

.idea-mini .plan-mini-body > small:first-child {
    display: block;
    font-weight: 700;
    color: var(--meal-color);
}

.recipe-card-macros {
    flex-wrap: wrap;
    row-gap: 2px;
}

.recipe-card-macros span {
    white-space: nowrap;
}

.recipe-grid .recipe-card-macros {
    gap: 2px 8px;
    font-size: .7rem;
}

.goal-fit-portion {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--md-primary-soft);
    color: var(--md-primary-dark);
    font-size: .74rem;
    font-weight: 700;
}

/* =============================================================
   Treinos
   ============================================================= */
.workout-week-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.workout-ring {
    width: 104px;
    height: 104px;
    margin: 0;
    flex-shrink: 0;
}

.workout-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.workout-ring-label strong {
    font-size: 1.3rem;
    font-weight: 800;
}

.workout-ring-label small {
    font-size: .7rem;
    opacity: .85;
}

.workout-week-min {
    margin: 4px 0 2px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1;
}

.workout-week-min small {
    font-size: .9rem;
    font-weight: 600;
    opacity: .85;
    letter-spacing: 0;
}

.workout-week-sub {
    font-size: .8rem;
    opacity: .88;
}

.workout-bars {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    height: 74px;
    margin-top: 16px;
}

.workout-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.workout-bar-fill {
    width: 100%;
    max-width: 22px;
    min-height: 4px;
    border-radius: 6px 6px 3px 3px;
    background: rgba(255, 255, 255, .85);
    transform-origin: bottom;
    animation: grow-y .9s var(--md-ease) both .3s;
}

.workout-bar.is-today .workout-bar-fill {
    background: #d9f99d;
}

.workout-bar small {
    font-size: .68rem;
    font-weight: 700;
    opacity: .8;
}

@keyframes grow-y {
    from { transform: scaleY(0); }
}

.workout-note {
    position: relative;
    z-index: 1;
    margin: 12px 0 0;
    font-size: .74rem;
    opacity: .85;
}

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

.strava-icon {
    background: #fff1e6;
    color: #fc4c02;
}

.btn-strava {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem;
    border: 0;
    border-radius: 16px;
    background: #fc4c02;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 24px -14px rgba(252, 76, 2, .9);
}

.btn-strava:hover {
    color: #fff;
    background: #e34402;
}

.workout-day-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 16px 8px;
}

.workout-day-head small {
    color: var(--md-muted);
    font-weight: 600;
}

.workout-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 16px;
    border-top: 1px solid var(--md-border);
}

.workout-item-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #fff1e6;
    color: #ea580c;
    font-size: 1.15rem;
}

.workout-item-body {
    flex: 1;
    min-width: 0;
}

.workout-item-body strong {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: .92rem;
}

.workout-item-body small {
    color: var(--md-muted);
    font-size: .76rem;
}

.workout-delete {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
}

.workout-delete:hover {
    background: #fff1f2;
    color: var(--md-danger);
}

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

.activity-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 10px 4px;
    border: 1.5px solid var(--md-border);
    border-radius: 16px;
    background: #fff;
    text-align: center;
    font-size: .74rem;
    font-weight: 700;
    line-height: 1.2;
    color: #475569;
    cursor: pointer;
    transition: all .15s;
}

.activity-option .bi {
    font-size: 1.3rem;
    color: #ea580c;
}

.btn-check:checked + .activity-option {
    border-color: #ea580c;
    background: #fff7ed;
    color: var(--md-text);
    box-shadow: 0 10px 18px -14px #ea580c;
}

.duration-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.1rem;
}

.workout-estimate {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fff7ed;
    color: #9a3412;
    font-size: .92rem;
}

.workout-estimate .bi {
    color: #ea580c;
    font-size: 1.2rem;
}

.workout-estimate strong {
    font-size: 1.15rem;
}

.workout-mini {
    margin-top: .6rem;
}

.workout-mini .workout-mini-icon {
    background: #fff1e6;
    color: #ea580c;
}

.workout-ring .value {
    stroke: #d9f99d;
    filter: drop-shadow(0 0 6px rgba(217, 249, 157, .6));
}

/* ---------- Descrever por voz ---------- */
.voice-box {
    margin-bottom: 4px;
}

.voice-start {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px dashed #6ee7b7;
    border-radius: 20px;
    background: linear-gradient(135deg, #ecfdf5, #fff);
    text-align: left;
    color: var(--md-text);
    transition: transform .15s, box-shadow .15s;
}

.voice-start:hover {
    box-shadow: 0 12px 24px -18px rgba(5, 150, 105, .9);
}

.voice-start:active {
    transform: scale(.98);
}

.voice-start:disabled {
    opacity: .55;
}

.voice-start strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
}

.voice-start small {
    color: var(--md-muted);
    font-size: .8rem;
}

.voice-mic {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--md-gradient);
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 10px 20px -8px rgba(5, 150, 105, .7);
}

.voice-recording,
.voice-sending {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 16px;
    border-radius: 20px;
    background: #fff1f2;
    text-align: center;
}

.voice-sending {
    background: #ecfdf5;
    color: var(--md-primary-dark);
}

.voice-sending small {
    color: var(--md-muted);
}

.voice-pulse {
    position: relative;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e11d48;
    color: #fff;
    font-size: 1.6rem;
}

.voice-pulse::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 3px solid rgba(225, 29, 72, .4);
    animation: pulse-ring 1.4s ease-out infinite;
}

.voice-meter {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 36px;
}

.voice-meter span {
    width: 5px;
    height: 100%;
    border-radius: 4px;
    background: #e11d48;
    opacity: .8;
    transform: scaleY(.12);
    transition: transform .08s linear;
}

.voice-timer {
    font-size: 1.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #9f1239;
}

.voice-hint {
    color: #9f1239;
    opacity: .8;
    font-size: .78rem;
}

.voice-error {
    margin: 10px 2px 0;
    font-size: .85rem;
    font-weight: 600;
    color: var(--md-danger);
}

.voice-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 10px;
    color: var(--md-muted);
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.voice-divider::before,
.voice-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--md-border);
}
