/* Source: app/css/base/tokens.css */
:root {
    --bg-color: #ffffff;
    --text-color: #222222;
    --hint-color: #8e8e93;
    --button-color: #2481cc;
    --button-text: #ffffff;
    --secondary-bg: #f4f4f5;
    --page-bg: #ffffff;
    --surface-modal: #ffffff;
    --surface-header: #f8fafc;
    --surface-card: #eef1f5;
    --surface-card-solid: #f4f4f5;
    --surface-input: #ffffff;
    --surface-border: rgba(33, 37, 41, 0.10);
    --surface-strong-border: rgba(33, 37, 41, 0.16);
    --surface-shadow: rgba(18, 25, 38, 0.14);
    --danger-color: #ff3b30;
    --app-screen-top-offset: 68px;
    --tg-safe-area-top: 0px;
    --tg-content-safe-area-top: 0px;
}

:root[data-app-theme="light"],
:root[data-app-effective-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #222222;
    --hint-color: #8e8e93;
    --button-color: #2481cc;
    --button-text: #ffffff;
    --secondary-bg: #f4f4f5;
    --page-bg: #ffffff;
    --surface-modal: #ffffff;
    --surface-header: #f8fafc;
    --surface-card: #eef1f5;
    --surface-card-solid: #f4f4f5;
    --surface-input: #ffffff;
    --surface-border: rgba(33, 37, 41, 0.10);
    --surface-strong-border: rgba(33, 37, 41, 0.16);
    --surface-shadow: rgba(18, 25, 38, 0.14);
}

:root[data-app-theme="dark"],
:root[data-app-effective-theme="dark"] {
    --bg-color: #0f1115;
    --text-color: #f5f5f7;
    --hint-color: #a0a3aa;
    --button-color: #4aa3ff;
    --button-text: #ffffff;
    --secondary-bg: #1c1f26;
    --page-bg: #0a0c10;
    --surface-modal: #151922;
    --surface-header: #1b2029;
    --surface-card: #202631;
    --surface-card-solid: #202631;
    --surface-input: #10141a;
    --surface-border: rgba(255, 255, 255, 0.09);
    --surface-strong-border: rgba(255, 255, 255, 0.14);
    --surface-shadow: rgba(0, 0, 0, 0.46);
}

/* Source: app/css/base/reset.css */
* {
    box-sizing: border-box;
}

html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition:
        background-color 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease,
        color 0.28s ease,
        fill 0.28s ease,
        stroke 0.28s ease;
}

body.app-body {
    background-color: var(--page-bg);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

body.app-body.sheet-open {
    overflow: hidden;
}

body.app-body.register-transitioning {
    overflow: hidden;
}

/* Source: app/css/base/layout.css */
.screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    padding-top: calc(20px + var(--tg-safe-area-top));
    padding-bottom: calc(104px + env(safe-area-inset-bottom)); /* Место для таббара */
}

/* Source: app/css/base/utilities.css */
.hidden { display: none !important; }

/* Source: app/css/screens/loading.css */
.app-loading-screen {
    align-items: center;
    justify-content: center;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.app-loading-content {
    max-width: 320px;
    text-align: center;
    width: 100%;
}

.app-loading-spinner {
    animation: appLoadingSpin 0.8s linear infinite;
    border: 3px solid var(--surface-border);
    border-top-color: var(--button-color);
    border-radius: 999px;
    height: 42px;
    margin: 0 auto 20px;
    width: 42px;
}

.app-loading-content h1 {
    font-size: 24px;
    margin: 0 0 10px;
}

.app-loading-content p {
    color: var(--hint-color);
    line-height: 1.5;
    margin: 0 0 24px;
}

@keyframes appLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Source: app/css/screens/welcome.css */
/* Экран приветствия */
#screen-welcome {
    --welcome-accent: #6dbb35;
    --welcome-accent-soft: #d6f78a;
    --welcome-calm: #e3f7a7;
    --welcome-page: #f7faef;
    --welcome-card: #ffffff;
    --welcome-text: #171717;
    --welcome-hint: #777a70;
    background: var(--welcome-page);
    color: var(--welcome-text);
    min-height: var(--tg-viewport-height, 100dvh);
    overflow: hidden;
    padding: calc(18px + var(--tg-safe-area-top)) 20px max(24px, env(safe-area-inset-bottom));
    position: relative;
}

#screen-welcome::before,
#screen-welcome::after {
    border-radius: 999px;
    content: '';
    pointer-events: none;
    position: absolute;
}

#screen-welcome::before {
    background: var(--welcome-calm);
    height: 280px;
    left: 50%;
    top: calc(var(--tg-safe-area-top) - 150px);
    transform: translateX(-50%);
    width: 280px;
}

#screen-welcome::after {
    background: color-mix(in srgb, var(--welcome-accent-soft) 38%, transparent);
    bottom: -110px;
    height: 230px;
    right: -100px;
    width: 230px;
}

.welcome-content {
    align-items: center;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    margin: auto;
    max-width: 400px;
    min-height: calc(var(--tg-viewport-height, 100dvh) - var(--tg-safe-area-top) - env(safe-area-inset-bottom) - 42px);
    position: relative;
    text-align: center;
    width: 100%;
    z-index: 1;
}

.welcome-logo {
    animation: welcomeLogoArrive 1.15s .08s cubic-bezier(.16, 1, .3, 1) both;
    background: var(--welcome-card);
    border: 1px solid rgba(17, 17, 17, .08);
    border-radius: 30px;
    height: 126px;
    margin-bottom: 28px;
    overflow: hidden;
    padding: 9px;
    width: 126px;
}

.welcome-logo img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.welcome-copy {
    animation: welcomeCopyReveal .72s 1.02s cubic-bezier(.16, 1, .3, 1) both;
    max-width: 340px;
}

.welcome-kicker {
    background: var(--welcome-accent-soft);
    border-radius: 999px;
    color: #315d18;
    display: inline-flex;
    font-size: 11px;
    font-weight: 760;
    letter-spacing: .04em;
    line-height: 1;
    margin-bottom: 13px;
    padding: 8px 11px;
    text-transform: uppercase;
}

.welcome-content h1 {
    color: var(--welcome-text);
    font-size: clamp(32px, 9vw, 42px);
    font-weight: 780;
    letter-spacing: -.045em;
    line-height: .98;
    margin: 0;
}

.welcome-description {
    color: var(--welcome-hint);
    font-size: 15px;
    line-height: 1.45;
    margin: 16px auto 0;
    max-width: 320px;
}

.welcome-facts {
    display: grid;
    gap: 7px;
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    width: min(100%, 340px);
}

.welcome-facts li {
    align-items: center;
    animation: welcomeFactReveal .56s cubic-bezier(.16, 1, .3, 1) both;
    background: var(--welcome-card);
    border: 1px solid rgba(17, 17, 17, .07);
    border-radius: 15px;
    color: var(--welcome-text);
    display: flex;
    font-size: 13px;
    font-weight: 680;
    gap: 10px;
    min-height: 44px;
    padding: 7px 10px;
    text-align: left;
}

.welcome-facts li:nth-child(1) {
    animation-delay: 1.28s;
}

.welcome-facts li:nth-child(2) {
    animation-delay: 1.39s;
}

.welcome-facts li:nth-child(3) {
    animation-delay: 1.5s;
}

.welcome-fact-icon {
    align-items: center;
    background: var(--welcome-calm);
    border-radius: 10px;
    color: var(--welcome-accent);
    display: inline-flex;
    flex: 0 0 auto;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.welcome-fact-icon svg {
    height: 18px;
    width: 18px;
}

#screen-welcome .welcome-cta {
    align-items: center;
    animation: welcomeCtaReveal .64s 1.78s cubic-bezier(.16, 1, .3, 1) both;
    background: var(--welcome-accent);
    border: 0;
    border-radius: 18px;
    box-shadow: none;
    color: #ffffff;
    display: flex;
    font: inherit;
    font-size: 16px;
    font-weight: 760;
    gap: 12px;
    justify-content: space-between;
    margin-top: 24px;
    min-height: 56px;
    padding: 0 18px 0 21px;
    text-shadow: none;
    transition: background-color .2s ease, transform .2s ease;
    width: min(100%, 340px);
}

#screen-welcome .welcome-cta::before,
#screen-welcome .welcome-cta::after {
    display: none;
}

.welcome-cta-arrow {
    align-items: center;
    background: rgba(255, 255, 255, .2);
    border-radius: 11px;
    display: inline-flex;
    font-size: 20px;
    height: 36px;
    justify-content: center;
    line-height: 1;
    width: 36px;
}

#screen-welcome .welcome-cta:active {
    transform: scale(.985);
}

#screen-welcome.register-swipe-out,
#screen-register.register-swipe-in {
    inset: 0;
    position: fixed;
    width: 100%;
    z-index: 30;
}

#screen-register.register-swipe-in {
    z-index: 31;
}

#screen-welcome.register-swipe-out {
    animation: registerSwipeOut .52s cubic-bezier(.32, .72, 0, 1) forwards;
}

#screen-register.register-swipe-in {
    animation: registerSwipeIn .58s cubic-bezier(.32, .72, 0, 1) forwards;
}

#screen-register.register-swipe-in .register-content {
    animation: registerFormReveal .64s .12s cubic-bezier(.16, 1, .3, 1) both;
}

:root[data-app-effective-theme="dark"] #screen-welcome{
    --welcome-accent: #8fd35a;
    --welcome-accent-soft: #24351d;
    --welcome-calm: #182018;
    --welcome-page: #0b100c;
    --welcome-card: #10150e;
    --welcome-text: #f6f3e8;
    --welcome-hint: #b5b8aa;
}

:root[data-app-effective-theme="dark"] .welcome-logo{
    border-color: rgba(167, 214, 109, .16);
}

:root[data-app-effective-theme="dark"] .welcome-facts li{
    border-color: rgba(167, 214, 109, .12);
}

:root[data-app-effective-theme="dark"] .welcome-logo img{
    filter: invert(1);
}

:root[data-app-effective-theme="dark"] .welcome-kicker{
    color: #b9e69a;
}

:root[data-app-effective-theme="dark"] #screen-welcome .welcome-cta{
    color: #10150e;
}

:root[data-app-effective-theme="dark"] .welcome-cta-arrow{
    background: rgba(16, 21, 14, .14);
}

@keyframes welcomeLogoArrive {
    0% {
        opacity: 0;
        transform: translateY(-38vh) scale(.76);
    }

    24% {
        opacity: 1;
    }

    72% {
        transform: translateY(8px) scale(1.025);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes welcomeCopyReveal {
    from {
        filter: blur(7px);
        opacity: 0;
        transform: translateY(-28px) scale(.96);
    }

    to {
        filter: blur(0);
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes welcomeCtaReveal {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes welcomeFactReveal {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes registerSwipeOut {
    from {
        filter: blur(0);
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        filter: blur(3px);
        opacity: 0;
        transform: translateX(-32%) scale(.96);
    }
}

@keyframes registerSwipeIn {
    from {
        opacity: .4;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes registerFormReveal {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-height: 620px) {
    .welcome-logo {
        border-radius: 24px;
        height: 104px;
        margin-bottom: 20px;
        width: 104px;
    }

    .welcome-content h1 {
        font-size: 31px;
    }

    .welcome-description {
        font-size: 14px;
        margin-top: 12px;
    }

    .welcome-facts {
        gap: 5px;
        margin-top: 16px;
    }

    .welcome-facts li {
        min-height: 39px;
        padding: 5px 8px;
    }

    .welcome-fact-icon {
        height: 27px;
        width: 27px;
    }

    #screen-welcome .welcome-cta {
        margin-top: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-logo,
    .welcome-copy,
    .welcome-facts li,
    #screen-welcome .welcome-cta,
    #screen-welcome.register-swipe-out,
    #screen-register.register-swipe-in,
    #screen-register.register-swipe-in .register-content,
    .register-step.is-step-entering-forward,
    .register-step.is-step-leaving-forward,
    .register-step.is-step-entering-back,
    .register-step.is-step-leaving-back {
        animation: none;
    }
}

/* Source: app/css/features/register/core.css */
/* Экран регистрации */
#screen-register {
    justify-content: flex-start;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-top: calc(max(var(--tg-safe-area-top), var(--tg-content-safe-area-top)) + clamp(52px, 7vh, 68px));
}

.register-content {
    max-width: 400px;
    width: 100%;
    margin: 0 auto auto;
}

.register-stepper {
    align-items: end;
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 18px;
    min-height: 58px;
    padding-top: 12px;
}

.register-stepper-item {
    align-items: center;
    background: var(--secondary-bg);
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--hint-color);
    display: flex;
    justify-content: center;
    min-height: 32px;
    padding: 6px 4px;
    position: relative;
    text-align: center;
    transition:
        background 0.24s ease,
        border-color 0.24s ease,
        box-shadow 0.24s ease,
        color 0.24s ease,
        min-height 0.24s ease,
        transform 0.24s ease;
}

.register-stepper-item span {
    align-items: center;
    background: var(--bg-color);
    border: 2px solid var(--secondary-bg);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    height: 20px;
    justify-content: center;
    left: 50%;
    position: absolute;
    top: -10px;
    transform: translateX(-50%);
    transition:
        background 0.24s ease,
        border-color 0.24s ease,
        color 0.24s ease,
        transform 0.24s ease;
    width: 20px;
}

.register-stepper-item strong {
    display: block;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.register-stepper-item.active {
    background: var(--button-color);
    border-color: var(--button-color);
    box-shadow: 0 10px 20px color-mix(in srgb, var(--button-color) 26%, transparent);
    color: var(--button-text);
    min-height: 44px;
    transform: scale(1.02);
    z-index: 2;
}

.register-stepper-item.active span {
    background: var(--button-color);
    border-color: var(--bg-color);
    color: var(--button-text);
    transform: translateX(-50%) scale(1.06);
}

.register-stepper-item.completed {
    background: color-mix(in srgb, var(--button-color) 10%, var(--secondary-bg));
    border-color: color-mix(in srgb, var(--button-color) 32%, transparent);
    color: var(--button-color);
}

.register-stepper-item.completed span {
    background: var(--button-color);
    border-color: var(--bg-color);
    color: var(--button-text);
}

.register-steps {
    overflow: hidden;
    position: relative;
}

.register-content header {
    margin-bottom: 30px;
    text-align: center;
}

.register-content header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.register-content header p {
    font-size: 14px;
    color: var(--hint-color);
    margin: 0;
}

.form {
    width: 100%;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--hint-color);
    background: var(--secondary-bg);
    color: var(--text-color);
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--button-color);
}

#register-step-1 .form {
    display: grid;
    gap: 12px;
}

#register-step-1 .form-group {
    background: var(--secondary-bg);
    border: 1px solid color-mix(in srgb, var(--hint-color) 18%, transparent);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
    margin-bottom: 0;
    padding: 10px 12px;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

#register-step-1 .form-group:focus-within {
    background: color-mix(in srgb, var(--button-color) 7%, var(--secondary-bg));
    border-color: var(--button-color);
    box-shadow:
        0 10px 22px color-mix(in srgb, var(--button-color) 12%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.34);
    transform: translateY(-1px);
}

#register-step-1 .form-group label {
    color: var(--hint-color);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
}

#register-step-1 .form-group input,
#register-step-1 .form-group select {
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    min-height: 30px;
    padding: 0;
}

#register-step-1 .form-group select option {
    font-size: 15px;
    font-weight: 500;
}

.register-gender-control {
    --gender-glass: #bbbbbc;
    --gender-light: #fff;
    --gender-dark: #000;
    --gender-reflex-dark: 1;
    --gender-reflex-light: 1;
    --gender-gap: 4px;
    background: var(--secondary-bg);
    border: 1px solid color-mix(in srgb, var(--hint-color) 16%, transparent);
    border-radius: 999px;
    display: grid;
    gap: var(--gender-gap);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 6px;
    padding: 4px;
    position: relative;
    transition:
        background-color 400ms cubic-bezier(1, 0, 0.4, 1),
        border-color 400ms cubic-bezier(1, 0, 0.4, 1),
        box-shadow 400ms cubic-bezier(1, 0, 0.4, 1);
}

.register-gender-indicator {
    background: var(--button-color);
    border-radius: 999px;
    bottom: 4px;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--button-color) 22%, transparent);
    left: 4px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 4px;
    transform: translateX(calc(var(--active-gender-index, 0) * (100% + var(--gender-gap))));
    transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
    width: calc((100% - 12px) / 2);
    z-index: 0;
}

.register-gender-control[data-active-gender] .register-gender-indicator {
    opacity: 1;
}

.register-gender-control button {
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: color-mix(in srgb, var(--text-color) 78%, var(--hint-color));
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    min-height: 42px;
    padding: 0 10px;
    position: relative;
    transition: color 0.2s ease, opacity 0.2s ease;
    z-index: 1;
}

.register-gender-control button.active {
    color: var(--button-text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}

#register-step-1 .form-group input:focus,
#register-step-1 .form-group select:focus {
    border-color: transparent;
    outline: none;
}

#register-step-1 .form-group input::placeholder {
    color: color-mix(in srgb, var(--hint-color) 58%, transparent);
    font-weight: 500;
}

.register-button-shell {
    border-radius: 100vmax;
    margin-top: 8px;
    overflow: hidden;
    width: 100%;
}

.register-button-shell .main-button {
    display: block;
    margin-top: 0;
}

#screen-register .main-button,
#screen-register .back-button {
    border: none;
    border-radius: 100vmax;
    clip-path: inset(0 round 100vmax);
    isolation: isolate;
    overflow: hidden;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#screen-register .main-button:not(:disabled) {
    background-color: color-mix(in srgb, var(--button-color) 86%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        inset 0 -10px 18px color-mix(in srgb, var(--button-color) 18%, transparent),
        inset 0 0 18px color-mix(in srgb, #ffffff 10%, transparent);
}

#screen-register .back-button {
    background-color: color-mix(in srgb, var(--secondary-bg) 82%, transparent);
    box-shadow:
        0 10px 22px color-mix(in srgb, var(--text-color) 8%, transparent),
        0 0 18px color-mix(in srgb, var(--button-color) 7%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

#screen-register .main-button::before,
#screen-register .main-button::after,
#screen-register .back-button::before,
#screen-register .back-button::after {
    border-radius: inherit;
    content: '';
    inset: 0;
    pointer-events: none;
    position: absolute;
}

#screen-register .main-button::before,
#screen-register .back-button::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 48%);
    z-index: -1;
}

#screen-register .main-button::after,
#screen-register .back-button::after {
    animation: welcomeCtaShine 3.2s ease-in-out infinite;
    background: linear-gradient(105deg, transparent 0%, transparent 36%, rgba(255, 255, 255, 0.4) 48%, transparent 60%, transparent 100%);
    background-position: 120% center;
    background-size: 220% 100%;
    box-shadow:
        inset 2px 2px 1px 0 rgba(255, 255, 255, 0.42),
        inset -1px -1px 1px 1px rgba(255, 255, 255, 0.3),
        inset 0 0 0 1px color-mix(in srgb, var(--button-text) 9%, transparent);
    z-index: 0;
}

#screen-register .main-button:disabled::before,
#screen-register .main-button:disabled::after {
    display: none;
}

.register-button-label {
    position: relative;
    z-index: 1;
}

#screen-register .main-button:active,
#screen-register .back-button:active {
    opacity: 1;
    transform: translateY(1px) scale(0.99);
}

/* Source: app/css/features/register/steps.css */
/* Шаги регистрации */
.register-step {
    width: 100%;
}

.register-step.is-step-leaving {
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}

.register-step.is-step-entering {
    position: relative;
    z-index: 2;
}

.register-step.is-step-entering-forward {
    animation: registerStepEnterForward 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.register-step.is-step-leaving-forward {
    animation: registerStepLeaveForward 0.24s ease both;
}

.register-step.is-step-entering-back {
    animation: registerStepEnterBack 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.register-step.is-step-leaving-back {
    animation: registerStepLeaveBack 0.24s ease both;
}

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

@keyframes registerStepEnterForward {
    from {
        opacity: 0;
        transform: translateX(34px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes registerStepLeaveForward {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-22px);
    }
}

@keyframes registerStepEnterBack {
    from {
        opacity: 0;
        transform: translateX(-34px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes registerStepLeaveBack {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(22px);
    }
}

/* Группа опций (активность, цель) */
.option-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.option-card {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.option-card:hover {
    border-color: var(--hint-color);
}

.option-card:has(input:checked) {
    border-color: var(--button-color);
    background: rgba(36, 129, 204, 0.1);
}

.option-card input[type="radio"] {
    display: none;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.option-desc {
    font-size: 12px;
    line-height: 1.35;
    color: var(--hint-color);
}

/* Группа кнопок */
.button-group {
    align-items: stretch;
    display: flex;
    gap: 12px;
}

.button-group .back-button {
    flex: 1 1 0;
    background: var(--secondary-bg);
    color: var(--text-color);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    min-height: 52px;
    padding: 16px;
    cursor: pointer;
}

.button-group .main-button {
    flex: 1 1 0;
    margin-top: 0;
    min-height: 52px;
    padding: 16px;
}

#register-step-3 .button-group .back-button {
    flex: 0 0 86px;
    min-height: 58px;
    padding: 14px 12px;
}

#btn-save {
    flex: 1 1 auto;
    font-size: 17px;
    font-weight: 800;
    min-height: 62px;
    padding: 18px 16px;
}

/* Source: app/css/features/register/form.css */
/* New production registration visual */
#screen-register {
    --register-accent: #6dbb35;
    --register-card: #ffffff;
    --register-card-soft: #f8faf1;
    --register-hint: #777a70;
    --register-page: #f7faef;
    --register-step-idle: #eceee9;
    --register-text: #171717;
    background: var(--register-page);
    color: var(--register-text);
    padding-left: 18px;
    padding-right: 18px;
    padding-top: calc(72px + max(env(safe-area-inset-top), var(--tg-safe-area-top), var(--tg-content-safe-area-top)));
}

#screen-register .register-content {
    max-width: 430px;
}

#screen-register .register-stepper {
    align-items: end;
    gap: 9px;
    margin-bottom: 18px;
    min-height: 60px;
    padding: 0;
}

#screen-register .register-stepper-item {
    background: var(--register-step-idle);
    border: 0;
    border-radius: 16px;
    color: var(--register-hint);
    display: grid;
    gap: 4px;
    justify-items: center;
    min-height: 42px;
    padding: 14px 5px 5px;
    transform: none;
    transition:
        background-color .34s ease,
        color .34s ease,
        min-height .38s cubic-bezier(.16, 1, .3, 1),
        transform .38s cubic-bezier(.16, 1, .3, 1);
}

#screen-register .register-stepper-item::after {
    display: none;
}

#screen-register .register-stepper-item > .register-step-marker {
    background: var(--register-card);
    border: 2px solid color-mix(in srgb, var(--register-hint) 20%, var(--register-card));
    border-radius: 50%;
    box-shadow: none;
    color: var(--register-hint);
    display: grid;
    font-size: 12px;
    height: 26px;
    left: 50%;
    place-items: center;
    position: absolute;
    top: 0;
    transform: translate(-50%, -50%);
    transition:
        background-color .34s ease,
        border-color .34s ease,
        color .34s ease,
        transform .38s cubic-bezier(.16, 1, .3, 1);
    width: 26px;
}

#screen-register .register-step-marker i {
    font-style: normal;
    grid-area: 1 / 1;
    line-height: 1;
    transition: opacity .22s ease, transform .3s cubic-bezier(.16, 1, .3, 1);
}

#screen-register .register-step-check {
    opacity: 0;
    transform: rotate(-28deg) scale(.45);
}

#screen-register .register-stepper-item strong {
    font-size: 10px;
    font-weight: 700;
}

#screen-register .register-stepper-item.active {
    background: var(--register-accent);
    box-shadow: none;
    color: #ffffff;
    min-height: 50px;
    transform: translateY(-6px);
    z-index: 2;
}

#screen-register .register-stepper-item.active > .register-step-marker {
    background: var(--register-card);
    border-color: var(--register-accent);
    color: var(--register-accent);
    transform: translate(-50%, -50%) scale(1.04);
}

#screen-register .register-stepper-item.completed > .register-step-marker {
    background: var(--register-accent);
    border-color: var(--register-card);
    color: #ffffff;
}

#screen-register .register-stepper-item.completed {
    background: var(--register-step-idle);
    color: var(--register-hint);
}

#screen-register .register-stepper-item.completed .register-step-number {
    opacity: 0;
    transform: rotate(28deg) scale(.45);
}

#screen-register .register-stepper-item.completed .register-step-check {
    opacity: 1;
    transform: rotate(0) scale(1);
}

#screen-register .register-step {
    background: var(--register-card);
    border-radius: 30px;
    padding: 22px 18px 18px;
}

#screen-register .register-content header {
    margin-bottom: 22px;
    text-align: left;
}

#screen-register .register-content header h1 {
    color: var(--register-text);
    font-size: 25px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 7px;
}

#screen-register .register-content header p {
    color: var(--register-hint);
    font-size: 13px;
}

#screen-register #register-step-1 .form-group {
    background: var(--register-card-soft);
    border: 1px solid transparent;
    border-radius: 18px;
    box-shadow: none;
    padding: 11px 14px;
}

#screen-register #register-step-1 .form-group:focus-within {
    background: var(--register-card-soft);
    border-color: color-mix(in srgb, var(--register-accent) 55%, transparent);
    box-shadow: none;
    transform: none;
}

#screen-register #register-step-1 .form-group label {
    color: var(--register-hint);
}

#screen-register .register-gender-control {
    background: var(--register-card);
    border: 1px solid color-mix(in srgb, var(--register-text) 8%, transparent);
    box-shadow: none;
}

#screen-register .register-gender-indicator {
    background: var(--register-accent);
    box-shadow: none;
}

#screen-register .register-gender-control button.active {
    color: #ffffff;
    text-shadow: none;
}

#screen-register .option-group {
    gap: 9px;
}

#screen-register .option-card {
    background: var(--register-card-soft);
    border: 1px solid transparent;
    border-radius: 18px;
    padding: 14px;
}

#screen-register .option-card:hover {
    border-color: transparent;
}

#screen-register .option-card:has(input:checked) {
    background: color-mix(in srgb, var(--register-accent) 12%, var(--register-card-soft));
    border-color: var(--register-accent);
}

#screen-register .option-title {
    color: var(--register-text);
    font-size: 15px;
    font-weight: 750;
}

#screen-register .option-desc {
    color: var(--register-hint);
}

#screen-register .main-button,
#screen-register .back-button {
    border-radius: 18px;
    box-shadow: none;
    clip-path: none;
    text-shadow: none;
}

#screen-register .main-button:not(:disabled) {
    background: var(--register-accent);
    box-shadow: none;
    color: #ffffff;
}

#screen-register .back-button {
    background: var(--register-card-soft);
    box-shadow: none;
    color: var(--register-text);
}

#screen-register .main-button::before,
#screen-register .main-button::after,
#screen-register .back-button::before,
#screen-register .back-button::after {
    display: none;
}

#screen-register .main-button:disabled {
    background: color-mix(in srgb, var(--register-text) 10%, var(--register-card-soft));
    color: color-mix(in srgb, var(--register-hint) 78%, transparent);
}

:root[data-app-effective-theme="dark"] #screen-register {
    --register-accent: #8fd35a;
    --register-card: #121812;
    --register-card-soft: #182018;
    --register-hint: #b5b8aa;
    --register-page: #0b100c;
    --register-step-idle: #20241f;
    --register-text: #f6f3e8;
}

:root[data-app-effective-theme="dark"] #screen-register .register-stepper-item.completed > .register-step-marker,
:root[data-app-effective-theme="dark"] #screen-register .main-button:not(:disabled) {
    color: #10150e;
}

:root[data-app-effective-theme="dark"] #screen-register .register-stepper-item.active {
    color: #10150e;
}

@media (max-width: 360px) {
    #screen-register {
        padding-left: 12px;
        padding-right: 12px;
        padding-top: calc(62px + max(env(safe-area-inset-top), var(--tg-safe-area-top), var(--tg-content-safe-area-top)));
    }

    #screen-register .register-step {
        border-radius: 24px;
        padding: 18px 14px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #screen-register .register-stepper-item,
    #screen-register .register-stepper-item > .register-step-marker,
    #screen-register .register-step-marker i {
        transition: none;
    }
}

#screen-register #register-step-1 .form-group.has-error {
    border-color: var(--danger-color);
}

#screen-register #register-step-1 .form-group.has-error:focus-within {
    border-color: var(--danger-color);
}

#screen-register .register-gender-control.has-error {
    border-color: var(--danger-color);
}

.register-field-error,
.register-step-error {
    color: var(--danger-color);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.3;
    margin: 6px 0 0;
    text-align: left;
}

.register-step-error {
    margin: 8px 2px 0;
}

/* Source: app/css/features/register/success.css */
/* Итог регистрации */
#screen-register-success {
    --success-accent: #6dbb35;
    --success-accent-soft: #d6f78a;
    --success-card: #ffffff;
    --success-card-soft: #f8faf1;
    --success-hint: #777a70;
    --success-page: #f7faef;
    --success-text: #171717;
    background: var(--success-page);
    color: var(--success-text);
    justify-content: center;
    min-height: var(--tg-viewport-height, 100dvh);
    padding: calc(24px + max(var(--tg-safe-area-top), var(--tg-content-safe-area-top))) 18px max(24px, env(safe-area-inset-bottom));
}

.register-success-content {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin: auto;
    max-width: 400px;
    text-align: center;
    width: 100%;
}

.register-success-mark {
    align-items: center;
    animation: registerSuccessMark .58s cubic-bezier(.16, 1, .3, 1) both;
    background: var(--success-accent-soft);
    border-radius: 24px;
    color: var(--success-accent);
    display: flex;
    height: 72px;
    justify-content: center;
    margin-bottom: 20px;
    width: 72px;
}

.register-success-mark svg {
    height: 38px;
    width: 38px;
}

.register-success-header {
    animation: registerSuccessReveal .56s .16s cubic-bezier(.16, 1, .3, 1) both;
}

.register-success-header > span {
    color: var(--success-accent);
    font-size: 11px;
    font-weight: 780;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.register-success-header h1 {
    color: var(--success-text);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.05;
    margin: 7px 0 10px;
}

.register-success-header p {
    color: var(--success-hint);
    font-size: 14px;
    line-height: 1.4;
    margin: 0 auto;
    max-width: 330px;
}

.register-success-plan {
    animation: registerSuccessReveal .62s .3s cubic-bezier(.16, 1, .3, 1) both;
    background: var(--success-card);
    border-radius: 26px;
    margin-top: 24px;
    padding: 18px;
    text-align: left;
    width: 100%;
}

.register-success-calories {
    align-items: end;
    display: flex;
    justify-content: space-between;
}

.register-success-calories > span {
    color: var(--success-hint);
    font-size: 12px;
    font-weight: 650;
}

.register-success-calories > strong {
    color: var(--success-text);
    font-size: 14px;
    font-weight: 720;
}

.register-success-calories b {
    font-size: 29px;
    font-weight: 820;
    letter-spacing: -.04em;
}

.register-success-macros {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 15px;
}

.register-success-macros div {
    background: var(--success-card-soft);
    border-radius: 15px;
    padding: 10px 8px;
    text-align: center;
}

.register-success-macros strong,
.register-success-macros span {
    display: block;
}

.register-success-macros strong {
    color: var(--success-text);
    font-size: 18px;
    line-height: 1;
}

.register-success-macros span {
    color: var(--success-hint);
    font-size: 10px;
    margin-top: 5px;
}

.register-success-details {
    border-top: 1px solid color-mix(in srgb, var(--success-text) 8%, transparent);
    display: grid;
    gap: 9px;
    margin: 15px 0 0;
    padding-top: 14px;
}

.register-success-details div {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.register-success-details dt {
    color: var(--success-hint);
    font-size: 12px;
}

.register-success-details dd {
    color: var(--success-text);
    font-size: 12px;
    font-weight: 700;
    margin: 0;
    text-align: right;
}

#screen-register-success .register-success-button {
    align-items: center;
    animation: registerSuccessReveal .58s .46s cubic-bezier(.16, 1, .3, 1) both;
    background: var(--success-accent);
    border: 0;
    border-radius: 18px;
    box-shadow: none;
    color: #ffffff;
    display: flex;
    font-size: 15px;
    font-weight: 760;
    justify-content: space-between;
    margin-top: 18px;
    min-height: 56px;
    padding: 0 18px 0 20px;
}

#screen-register-success .register-success-button span {
    font-size: 20px;
}

:root[data-app-effective-theme="dark"] #screen-register-success {
    --success-accent: #8fd35a;
    --success-accent-soft: #24351d;
    --success-card: #121812;
    --success-card-soft: #182018;
    --success-hint: #b5b8aa;
    --success-page: #0b100c;
    --success-text: #f6f3e8;
}

:root[data-app-effective-theme="dark"] #screen-register-success .register-success-button {
    color: #10150e;
}

@keyframes registerSuccessMark {
    from {
        opacity: 0;
        transform: scale(.55) rotate(-12deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-height: 650px) {
    .register-success-mark {
        height: 58px;
        margin-bottom: 14px;
        width: 58px;
    }

    .register-success-header h1 {
        font-size: 26px;
    }

    .register-success-plan {
        margin-top: 17px;
        padding: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .register-success-mark,
    .register-success-header,
    .register-success-plan,
    #screen-register-success .register-success-button {
        animation: none;
    }
}

/* Source: app/css/screens/home.css */
.main-content {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.home-greeting {
    color: var(--text-color);
    font-size: 22px;
    line-height: 1.2;
    margin-bottom: 16px;
}

.home-greeting-text,
.home-greeting-name {
    display: inline;
}

.home-greeting-name {
    font-weight: 800;
}

/* Current main screen */

#screen-main {
    --home-page: #f7faef;
    --home-card: #ffffff;
    --home-card-soft: #f8faf1;
    --home-text: #171717;
    --home-hint: #777a70;
    --home-green: #6dbb35;
    --home-black: #111111;
    --home-lime: #d6f78a;
    --home-calm: #e3f7a7;
    --home-border: rgba(17, 17, 17, .08);
    --home-protein: #e8fbc6;
    --home-fat: #ffe8cc;
    --home-carb: #dff1f7;
    --home-protein-color: #6dbb35;
    --home-fat-color: #f39a2e;
    --home-carb-color: #4aa3d8;
    background: var(--home-page);
    color: var(--home-text);
    padding: 20px 18px;
    padding-top: calc(var(--app-screen-top-offset) + max(env(safe-area-inset-top), var(--tg-safe-area-top), var(--tg-content-safe-area-top)));
    padding-bottom: calc(124px + env(safe-area-inset-bottom));
}

:root[data-app-effective-theme="dark"] #screen-main {
    --home-page: #0b100c;
    --home-card: #121812;
    --home-card-soft: #182018;
    --home-text: #f6f3e8;
    --home-hint: #b5b8aa;
    --home-green: #8fd35a;
    --home-black: #10150e;
    --home-lime: #24351d;
    --home-calm: #24351d;
    --home-border: rgba(167, 214, 109, .16);
    --home-protein: #121812;
    --home-fat: #121812;
    --home-carb: #121812;
    --home-protein-color: #8fd35a;
    --home-fat-color: #e38b29;
    --home-carb-color: #6fb2df;
}

#screen-main .main-content {
    max-width: 430px;
}

#screen-main .home-header {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 14px;
}

#screen-main .home-greeting {
    color: var(--home-text);
    flex: 1 1 auto;
    font-size: 22px;
    line-height: 1.2;
    margin: 0;
    min-width: 0;
}

#screen-main .profile-button {
    align-items: center;
    appearance: none;
    background: var(--home-card);
    border: 0;
    border-radius: 999px;
    color: var(--home-text);
    cursor: pointer;
    display: grid;
    flex: 0 0 auto;
    height: 40px;
    padding: 0;
    place-items: center;
    width: 40px;
}

#screen-main .profile-button svg {
    height: 24px;
    width: 24px;
}

#screen-main .progress-card {
    background: var(--home-card);
    border: 0;
    border-radius: 32px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    isolation: auto;
    margin: 0;
    min-height: 218px;
    overflow: hidden;
    padding: 17px 18px 15px;
    position: relative;
}

#screen-main .daily-nutrition-card::before,
#screen-main .daily-nutrition-card::after{
    background: transparent;
    box-shadow: none;
    content: none;
    display: none;
    filter: none;
    opacity: 0;
}

#screen-main .home-progress-feedback {
    align-items: center;
    background: var(--home-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: absolute;
    text-align: center;
    z-index: 2;
}

#screen-main .daily-nutrition-card[data-state="ready"] .home-progress-feedback {
    display: none;
}

#screen-main .home-progress-feedback p {
    color: var(--home-hint);
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    max-width: 290px;
}

#screen-main .home-progress-spinner {
    animation: home-progress-spin .8s linear infinite;
    border: 3px solid var(--home-border);
    border-radius: 50%;
    border-top-color: var(--home-green);
    height: 28px;
    width: 28px;
}

#screen-main .daily-nutrition-card[data-state="error"] .home-progress-spinner {
    display: none;
}

#screen-main .home-progress-retry {
    appearance: none;
    background: var(--home-green);
    border: 0;
    border-radius: 12px;
    color: var(--home-black);
    cursor: pointer;
    font: inherit;
    font-weight: 750;
    min-height: 40px;
    padding: 8px 18px;
}

@keyframes home-progress-spin {
    to {
        transform: rotate(360deg);
    }
}

#screen-main .progress-header {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 6px;
}

#screen-main .daily-summary-title {
    min-width: 0;
}

#screen-main .progress-header h1 {
    color: var(--home-text);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.08;
    margin: 0;
}

#screen-main .summary-body-params {
    color: var(--home-hint);
    font-size: clamp(12px, 3.2vw, 14px);
    line-height: 1.25;
    margin: 5px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#screen-main .completion-chip {
    align-items: center;
    background: var(--home-lime);
    border-radius: 13px;
    color: var(--home-text);
    display: flex;
    flex: 0 0 auto;
    justify-content: center;
    min-height: 34px;
    min-width: 58px;
    padding: 6px 10px;
}

#screen-main .completion-chip strong {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

#screen-main .daily-calories-panel {
    align-items: flex-end;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 12px;
}

#screen-main .calorie-gauge-block {
    --day-progress: 0;
    flex: 1 1 286px;
    min-width: 0;
    position: relative;
    text-align: center;
}

#screen-main .calorie-gauge {
    display: block;
    height: auto;
    width: 100%;
}

#screen-main .calorie-gauge-track,
#screen-main .calorie-gauge-progress {
    fill: none;
    stroke-linecap: round;
    stroke-width: 13;
}

#screen-main .calorie-gauge-track {
    stroke: var(--home-border);
}

#screen-main .calorie-gauge-progress {
    stroke: var(--home-green);
    stroke-dasharray: var(--day-progress) 100;
}

#screen-main .calorie-consumed {
    bottom: 13px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
}

#screen-main .calorie-consumed strong {
    color: var(--home-text);
    display: block;
    font-size: 25px;
    font-weight: 750;
    line-height: 1.05;
}

#screen-main .calorie-consumed span {
    color: var(--home-hint);
    font-size: 12px;
}

#screen-main .calorie-balance {
    display: grid;
    flex: 0 0 82px;
    gap: 7px;
    padding-bottom: 10px;
    text-align: left;
}

#screen-main .calorie-target strong,
#screen-main .calorie-left strong {
    color: var(--home-text);
    display: block;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.05;
    white-space: nowrap;
}

#screen-main .calorie-target strong span:last-child,
#screen-main .calorie-left strong span:last-child {
    color: var(--home-hint);
    font-size: 10px;
    font-weight: 500;
    margin-left: 3px;
}

#screen-main .calorie-target > span,
#screen-main .calorie-left > span {
    color: var(--home-hint);
    font-size: 11px;
}

#screen-main .calorie-left strong {
    color: var(--home-green);
}

#screen-main .calorie-balance-line {
    background: var(--home-border);
    border-radius: 999px;
    height: 1px;
}

#screen-main .macro-cards {
    align-items: start;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

#screen-main .macro-card {
    --macro-color: var(--home-protein-color);
    background: var(--home-protein);
    border: 0;
    border-radius: 22px;
    box-shadow: 0 16px 28px -24px rgba(48, 109, 41, .14);
    min-width: 0;
    padding: 10px 7px 12px;
    position: relative;
}

#screen-main .macro-card-fats {
    --macro-color: var(--home-fat-color);
    background: var(--home-fat);
}

#screen-main .macro-card-carbs {
    --macro-color: var(--home-carb-color);
    background: var(--home-carb);
}

#screen-main .macro-card-head {
    align-items: center;
    display: flex;
    gap: 5px;
    min-width: 0;
}

#screen-main .macro-card-head > div {
    flex: 1 1 auto;
    min-width: 0;
}

#screen-main .macro-icon {
    background: rgba(255, 255, 255, .58);
    border: 1px solid color-mix(in srgb, var(--macro-color) 10%, transparent);
    border-radius: 11px;
    color: var(--macro-color);
    display: grid;
    flex: 0 0 auto;
    height: 28px;
    place-items: center;
    width: 28px;
}

:root[data-app-effective-theme="dark"] #screen-main .macro-icon {
    background: rgba(255, 255, 255, .08);
}

#screen-main .macro-icon svg {
    height: 16px;
    width: 16px;
}

#screen-main .macro-card h2 {
    color: var(--home-text);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#screen-main .macro-card-head p {
    align-items: baseline;
    color: var(--home-hint);
    display: flex;
    flex-wrap: nowrap;
    font-size: 10px;
    gap: 2px;
    line-height: 1.15;
    margin: 0;
    overflow: visible;
    white-space: nowrap;
}

#screen-main .macro-card-head p strong {
    color: var(--home-text);
    flex: 0 1 auto;
    font-weight: 650;
    min-width: 0;
}

#screen-main .macro-card.is-over-goal .macro-bar span {
    width: 100%;
}

#screen-main .macro-bar {
    background: var(--home-border);
    border-radius: 999px;
    height: 7px;
    margin: 9px auto 0;
    overflow: hidden;
    width: calc(100% - 12px);
}

#screen-main .macro-bar span {
    background: var(--macro-color);
    border-radius: inherit;
    display: block;
    height: 100%;
    width: min(var(--macro-progress), 100%);
}

#screen-main .macro-warning {
    color: var(--macro-color) !important;
    font-size: 9px !important;
    font-weight: 650;
    line-height: 1;
    margin: 3px 0 -4px !important;
    text-align: center;
}

#screen-main .ai-recommendation-card {
    align-items: center;
    background: var(--home-calm);
    border-radius: 22px;
    display: flex;
    gap: 9px;
    margin-top: 12px;
    padding: 10px 12px;
}

#screen-main .ai-recommendation-card[role="button"] {
    cursor: pointer;
}

#screen-main .ai-recommendation-card:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--home-green) 65%, transparent);
    outline-offset: 3px;
}

#screen-main .ai-recommendation-card[data-insight-state="loading"] {
    opacity: 0.72;
}

#screen-main .ai-recommendation-card[data-insight-state="error"] {
    background: var(--home-fat);
}

#screen-main .ai-recommendation-icon {
    background: var(--home-black);
    border-radius: 999px;
    color: #fff;
    display: grid;
    flex: 0 0 auto;
    height: 30px;
    place-items: center;
    width: 30px;
}

:root[data-app-effective-theme="dark"] #screen-main .ai-recommendation-icon {
    background: var(--home-green);
    color: var(--home-black);
}

#screen-main .ai-recommendation-icon svg {
    height: 17px;
    width: 17px;
}

#screen-main .ai-recommendation-content {
    flex: 1 1 auto;
    min-width: 0;
}

#screen-main .ai-recommendation-content h2 {
    color: var(--home-text);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.1;
    margin: 0 0 4px;
}

#screen-main .ai-recommendation-content p {
    color: var(--home-hint);
    font-size: 11px;
    line-height: 1.25;
    margin: 0;
}

#screen-main .ai-recommendation-arrow {
    align-items: center;
    color: var(--home-text);
    display: flex;
    flex: 0 0 auto;
    height: 24px;
    justify-content: center;
    width: 24px;
}

#screen-main .ai-recommendation-arrow svg {
    display: block;
    height: 18px;
    transform: rotate(-90deg);
    width: 18px;
}

#screen-main .meals-section {
    margin-top: 14px;
}

#screen-main .meals-section-title {
    color: var(--home-text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 9px;
}

#screen-main .meal-accordion {
    --meal-accordion-easing: cubic-bezier(.22, 1, .36, 1);
    display: grid;
    gap: 6px;
}

#screen-main .home-meals-loading,
#screen-main .home-meals-error {
    color: var(--home-hint);
    font-size: 12px;
    margin: 0;
    padding: 16px;
    text-align: center;
}

#screen-main .meal-item {
    background: var(--home-card);
    border-radius: 20px;
    overflow: hidden;
}

#screen-main .meal-item.is-current {
    background: var(--home-calm);
    border-radius: 24px;
}

#screen-main .meal-header {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: grid;
    gap: 8px;
    grid-template-columns: 26px minmax(0, 1fr) auto 22px;
    min-height: 34px;
    padding: 4px 9px;
    text-align: left;
    width: 100%;
}

#screen-main .meal-icon {
    background: var(--home-card-soft);
    border-radius: 999px;
    color: var(--home-green);
    display: grid;
    height: 26px;
    place-items: center;
    width: 26px;
}

#screen-main .meal-icon svg {
    height: 15px;
    width: 15px;
}

#screen-main .meal-item.is-current .meal-icon {
    background: var(--home-black);
    color: #fff;
}

:root[data-app-effective-theme="dark"] #screen-main .meal-item.is-current .meal-icon {
    background: var(--home-green);
    color: var(--home-black);
}

#screen-main .meal-title {
    align-content: center;
    display: grid;
    gap: 3px;
    min-width: 0;
}

#screen-main .meal-title strong {
    color: var(--home-text);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.15;
}

#screen-main .meal-title small,
#screen-main .meal-calories {
    color: var(--home-hint);
    font-size: 10px;
    line-height: 1.15;
}

#screen-main .meal-calories {
    align-items: baseline;
    display: flex;
    gap: 2px;
    justify-content: flex-end;
    white-space: nowrap;
}

#screen-main .meal-calories strong {
    color: var(--home-text);
    font-size: 12px;
}

#screen-main .meal-chevron {
    color: var(--home-green);
    display: grid;
    height: 22px;
    place-items: center;
    width: 22px;
}

#screen-main .meal-chevron svg {
    height: 16px;
    transition: transform .36s var(--meal-accordion-easing);
    width: 16px;
}

#screen-main .meal-item.is-expanded .meal-chevron svg {
    transform: rotate(180deg);
}

#screen-main .meal-item.is-current .meal-header {
    grid-template-columns: 36px minmax(0, 1fr) auto 28px;
    min-height: 56px;
    padding: 9px 11px;
}

#screen-main .meal-item.is-current .meal-icon {
    height: 36px;
    width: 36px;
}

#screen-main .meal-item.is-current .meal-icon svg {
    height: 21px;
    width: 21px;
}

#screen-main .meal-item.is-current .meal-title strong {
    font-size: 15px;
}

#screen-main .meal-item.is-current .meal-calories strong {
    font-size: 16px;
}

#screen-main .meal-panel {
    display: grid;
    gap: 6px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 8px;
    transform-origin: top center;
    transform: translateY(-6px);
    transition: max-height .46s var(--meal-accordion-easing), opacity .28s ease, transform .4s var(--meal-accordion-easing);
    will-change: max-height, opacity, transform;
}

#screen-main .meal-item.is-expanded .meal-panel {
    opacity: 1;
    padding-bottom: 10px;
    transform: translateY(0);
}

#screen-main .home-meal-swipe-row {
    --swipe-radius: 14px;
    width: 100%;
}

#screen-main .home-meal-card-wrapper {
    background: var(--home-card);
}

#screen-main .home-meal-swipe-card {
    border-radius: inherit;
}

#screen-main .home-meal-swipe-row.is-swiping .home-meal-card-wrapper,
#screen-main .home-meal-swipe-row.is-open .home-meal-card-wrapper,
#screen-main .home-meal-swipe-row.is-closing .home-meal-card-wrapper {
    background: var(--home-card);
    box-shadow: 0 0 0 1px var(--home-card);
}

#screen-main .meal-food-card {
    align-items: center;
    background: var(--home-card);
    border: 1px solid var(--home-border);
    border-radius: 14px;
    color: inherit;
    display: grid;
    gap: 8px;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    min-width: 0;
    padding: 7px 9px 7px 7px;
    text-align: left;
    width: 100%;
}

#screen-main .meal-food-thumb {
    background: linear-gradient(135deg, var(--home-card-soft), var(--home-lime));
    border-radius: 12px;
    display: grid;
    height: 48px;
    overflow: hidden;
    place-items: center;
    width: 48px;
}

#screen-main .meal-food-thumb svg {
    color: var(--home-green);
    height: 24px;
    width: 24px;
}

#screen-main .meal-food-thumb img {
    border-radius: inherit;
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

#screen-main .meal-food-info {
    min-width: 0;
}

#screen-main .meal-food-info strong {
    color: var(--home-text);
    display: block;
    font-size: 13px;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#screen-main .meal-food-info small {
    color: var(--home-hint);
    display: block;
    font-size: 10px;
    line-height: 1.3;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#screen-main .meal-food-calories {
    color: var(--home-hint);
    font-size: 11px;
    white-space: nowrap;
}

#screen-main .meal-food-calories strong {
    color: var(--home-text);
    font-size: 15px;
}

#screen-main .meal-panel-empty {
    background: transparent;
    border: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 8px;
    transform-origin: top center;
    transform: translateY(-6px);
    transition: max-height .46s var(--meal-accordion-easing), opacity .28s ease, transform .4s var(--meal-accordion-easing);
    will-change: max-height, opacity, transform;
}

#screen-main .meal-item.is-expanded .meal-panel-empty {
    opacity: 1;
    padding-bottom: 10px;
    transform: translateY(0);
}

#screen-main .meal-panel-empty p {
    background: var(--home-card);
    border: 1px solid var(--home-border);
    border-radius: 12px;
    box-shadow: 0 8px 14px -13px rgba(0, 0, 0, .12);
    color: var(--home-hint);
    font-size: 11px;
    line-height: 1.3;
    margin: 0;
    padding: 8px 10px;
}

:root[data-app-effective-theme="dark"] #screen-main .meal-panel-empty p {
    background: var(--home-card-soft);
    box-shadow: none;
}

@media (max-width: 380px) {
    #screen-main {
        padding-left: 14px;
        padding-right: 14px;
    }

    #screen-main .progress-card {
        padding: 16px 15px 14px;
    }

    #screen-main .daily-calories-panel {
        gap: 8px;
    }

    #screen-main .calorie-balance {
        flex-basis: 74px;
    }

    #screen-main .macro-cards {
        gap: 8px;
    }

    #screen-main .macro-card {
        border-radius: 14px;
        padding: 8px 6px 10px;
    }

    #screen-main .macro-icon {
        height: 26px;
        width: 26px;
    }

    #screen-main .macro-card h2 {
        font-size: 10px;
    }

    #screen-main .macro-card-head p {
        font-size: clamp(8px, 2.35vw, 9px);
    }
}

/* Source: app/css/components/cards.css */
/* Карточка прогресса */
.progress-card {
    background: var(--secondary-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.progress-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.progress-percentage {
    font-size: 24px;
    font-weight: 700;
    color: var(--button-color);
}

.progress-bar {
    height: 12px;
    background: var(--bg-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--button-color), #5bc0de);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.progress-consumed,
.progress-goal {
    text-align: center;
}

.progress-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.progress-label {
    font-size: 12px;
    color: var(--hint-color);
}

.progress-divider {
    font-size: 20px;
    color: var(--hint-color);
}

.daily-nutrition-card {
    --daily-card-bg: var(--secondary-bg);
    --daily-card-border: color-mix(in srgb, var(--text-color) 8%, transparent);
    --daily-card-shadow: color-mix(in srgb, var(--text-color) 12%, transparent);
    background: var(--daily-card-bg);
    background-clip: padding-box;
    border: 1px solid transparent;
    box-shadow: none;
    isolation: isolate;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.daily-nutrition-card > * {
    position: relative;
    z-index: 1;
}

.daily-nutrition-card::before,
.daily-nutrition-card::after {
    border-radius: inherit;
    content: '';
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.daily-nutrition-card::before {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 58%);
    opacity: 0;
    z-index: 0;
}

.daily-nutrition-card::after {
    background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--button-color) 8%, transparent));
    opacity: 0;
    z-index: 0;
}

.daily-nutrition-card .summary-body-params {
    margin: 5px 0 0;
    text-align: left;
}

.macro-progress-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.macro-progress-row {
    display: grid;
    gap: 6px;
}

.macro-progress-header {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.macro-progress-header span {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
}

.macro-progress-header strong {
    color: var(--hint-color);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.macro-progress-bar {
    background: var(--bg-color);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.macro-progress-fill {
    border-radius: inherit;
    height: 100%;
    transition: width 0.3s ease;
}

.macro-progress-fill.proteins {
    background: #34c759;
}

.macro-progress-fill.fats {
    background: #ff9500;
}

.macro-progress-fill.carbs {
    background: #4aa3ff;
}

/* Карточка сводки */
.summary-card {
    background: var(--secondary-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-align: center;
}

.summary-goal {
    align-items: baseline;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.summary-goal-value {
    color: var(--button-color);
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.summary-goal-label {
    color: var(--hint-color);
    font-size: 14px;
    font-weight: 500;
}

.summary-body-params {
    color: var(--hint-color);
    font-size: 13px;
    line-height: 1.4;
    margin: 12px 0 0;
    text-align: center;
}

/* Source: app/css/features/summary/dashboard.css */
/* Current summary screen */

.summary-page-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.summary-page-header h1 {
    color: var(--text-color);
    font-size: 22px;
    font-weight: 750;
    line-height: 1.16;
    margin: 0 0 6px;
}

.summary-page-header p {
    color: var(--hint-color);
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
    max-width: 300px;
}

.summary-progress-card,
.summary-mini-card,
.summary-streak-card,
.summary-goal-card,
.summary-ai-card {
    border-radius: 24px;
    min-width: 0;
}

.summary-progress-card {
    background: var(--soft-accent-bg);
    color: var(--black);
    padding: 16px;
}

.summary-card-head {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.summary-card-head span {
    font-size: 18px;
    font-weight: 750;
    line-height: 1.2;
}

.summary-card-head strong {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

.summary-progress-bar {
    background: rgba(17, 17, 17, 0.12);
    border-radius: 999px;
    height: 10px;
    margin: 15px 0 10px;
    overflow: hidden;
}

.summary-progress-bar span {
    background: var(--black);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.summary-progress-card p,
.summary-progress-card small {
    display: block;
    line-height: 1.25;
    margin: 0;
}

.summary-progress-card p {
    font-size: 14px;
    font-weight: 550;
}

.summary-progress-card small {
    color: rgba(17, 17, 17, 0.66);
    font-size: 12px;
    margin-top: 3px;
}

.summary-mini-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.summary-mini-card {
    padding: 12px;
}

.summary-mini-card.is-disabled {
    cursor: default;
}

.summary-mini-card.is-disabled strong,
.summary-mini-card.is-disabled p,
.summary-mini-card.is-disabled small {
    color: var(--hint-color);
}

.summary-mini-nutrition {
    background: var(--fat-bg);
}

.summary-mini-ai {
    background: var(--carb-bg);
}

.summary-mini-card span,
.summary-mini-card p,
.summary-mini-card small {
    display: block;
}

.summary-mini-card span {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.summary-mini-card strong {
    color: var(--text-color);
    display: block;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.1;
}

.summary-mini-card p {
    color: var(--text-color);
    font-size: 12px;
    line-height: 1.25;
    margin: 4px 0 0;
}

.summary-mini-card small {
    color: var(--hint-color);
    font-size: 11px;
    margin-top: 4px;
}

.summary-streak-card,
.summary-goal-card,
.summary-ai-card {
    background: var(--bg-color);
    margin-top: 10px;
    padding: 13px;
}

.summary-streak-card {
    align-items: center;
    cursor: default;
    display: grid;
    gap: 10px;
    grid-template-columns: 48px minmax(0, 1fr);
    transition: transform 160ms ease;
}

.summary-streak-card:active {
    transform: scale(0.99);
}

.summary-streak-card:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--button-color) 45%, transparent);
    outline-offset: 3px;
}

.summary-streak-visual {
    align-items: center;
    background: var(--card-soft);
    border-radius: 16px;
    color: var(--button-color);
    display: flex;
    height: 48px;
    justify-content: center;
    padding: 0;
}

.summary-streak-visual svg {
    display: block;
    height: 25px;
    width: 25px;
}

.streak-part {
    display: none;
}

.summary-streak-card[data-streak-stage="seed"] .streak-seed,
.summary-streak-card[data-streak-stage="sprout"] .streak-seed,
.summary-streak-card[data-streak-stage="sprout"] .streak-stem,
.summary-streak-card[data-streak-stage="leafy"] .streak-stem,
.summary-streak-card[data-streak-stage="leafy"] .streak-left-leaf,
.summary-streak-card[data-streak-stage="leafy"] .streak-right-leaf,
.summary-streak-card[data-streak-stage="plant"] .streak-stem,
.summary-streak-card[data-streak-stage="plant"] .streak-left-leaf,
.summary-streak-card[data-streak-stage="plant"] .streak-right-leaf,
.summary-streak-card[data-streak-stage="plant"] .streak-extra-left,
.summary-streak-card[data-streak-stage="large"] .streak-stem,
.summary-streak-card[data-streak-stage="large"] .streak-left-leaf,
.summary-streak-card[data-streak-stage="large"] .streak-right-leaf,
.summary-streak-card[data-streak-stage="large"] .streak-extra-left,
.summary-streak-card[data-streak-stage="large"] .streak-extra-right,
.summary-streak-card[data-streak-stage="tree"] .streak-trunk,
.summary-streak-card[data-streak-stage="tree"] .streak-crown {
    display: block;
}

.summary-streak-card[data-streak-stage="seed"] .summary-streak-visual svg {
    height: 18px;
    width: 18px;
}

.summary-streak-card[data-streak-stage="plant"] .summary-streak-visual svg,
.summary-streak-card[data-streak-stage="large"] .summary-streak-visual svg,
.summary-streak-card[data-streak-stage="tree"] .summary-streak-visual svg {
    height: 28px;
    width: 28px;
}

.summary-streak-card h2,
.summary-goal-card h2,
.summary-ai-card h2 {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.15;
    margin: 0 0 5px;
}

.summary-streak-card h2 {
    font-size: 13px;
    font-weight: 650;
    margin-bottom: 4px;
}

.summary-streak-card strong {
    color: var(--text-color);
    display: block;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.1;
    margin-bottom: 4px;
}

.summary-streak-card p,
.summary-goal-card p,
.summary-ai-card p {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
}

.summary-ai-card {
    padding: 14px 13px;
}

.summary-ai-title {
    align-items: center;
    display: flex;
    gap: 9px;
    margin-bottom: 10px;
}

.summary-ai-title h2 {
    margin: 0;
}

.summary-ai-icon {
    background: var(--black);
    border-radius: 999px;
    color: #ffffff;
    display: grid;
    flex: 0 0 auto;
    height: 28px;
    place-items: center;
    width: 28px;
}

.summary-ai-icon svg {
    display: block;
    height: 15px;
    width: 15px;
}

.summary-ai-card p + p {
    margin-top: 8px;
}

.summary-macro-balance {
    display: grid;
    gap: 4px;
    margin-top: 8px;
}

.summary-macro-balance p {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.2;
    margin: 0;
}

.summary-macro-balance strong {
    color: var(--text-color);
    font-size: inherit;
    font-weight: 700;
}

.summary-ai-card[data-insight-state="loading"] {
    opacity: 0.72;
}

.summary-ai-card[data-insight-state="error"] {
    background: var(--fat-bg);
}

.summary-ai-retry {
    appearance: none;
    background: var(--button-color);
    border: 0;
    border-radius: 12px;
    color: var(--button-text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    margin-top: 12px;
    padding: 9px 13px;
}

.summary-ai-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.summary-ai-tags span {
    background: var(--card-soft);
    border-radius: 999px;
    color: var(--text-color);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 6px 8px;
}

.hidden {
    display: none !important;
}

/* Source: app/css/features/summary/screen.css */
/* Production summary screen */
#screen-summary {
    --black: #111111;
    --button-color: #6dbb35;
    --button-text: #ffffff;
    --calm-accent-bg: #e3f7a7;
    --card-border: rgba(17, 17, 17, 0.08);
    --card-soft: #f8faf1;
    --carb-bg: #dff1f7;
    --fat-bg: #ffe8cc;
    --soft-accent-bg: #d6f78a;
    background: #f7faef;
    color: #171717;
    padding: 20px 18px;
    padding-top: calc(var(--app-screen-top-offset) + max(env(safe-area-inset-top), var(--tg-safe-area-top), var(--tg-content-safe-area-top)));
    padding-bottom: calc(124px + env(safe-area-inset-bottom));
}

#screen-summary .summary-content {
    margin: 0 auto;
    max-width: 430px;
    width: 100%;
}

#screen-summary .profile-button {
    appearance: none;
    align-items: center;
    background: #ffffff;
    border: 0;
    border-radius: 999px;
    color: var(--text-color);
    cursor: pointer;
    display: grid;
    flex: 0 0 auto;
    height: 40px;
    padding: 0;
    place-items: center;
    width: 40px;
}

#screen-summary .profile-button svg {
    display: block;
    height: 24px;
    width: 24px;
}

#screen-summary .summary-progress-card.is-loading {
    opacity: 0.7;
}

#screen-summary .summary-progress-card.is-error {
    background: #ffe8cc;
}

#screen-summary .summary-progress-bar span {
    transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-app-effective-theme="dark"] #screen-summary {
    --black: #10150e;
    --button-color: #8fd35a;
    --button-text: #10150e;
    --calm-accent-bg: #24351d;
    --card-border: rgba(167, 214, 109, 0.16);
    --card-soft: #182018;
    --carb-bg: #121812;
    --fat-bg: #121812;
    --soft-accent-bg: #182018;
    background: #0b100c;
    color: #f6f3e8;
}

:root[data-app-effective-theme="dark"] #screen-summary .profile-button,
:root[data-app-effective-theme="dark"] #screen-summary .summary-streak-card,
:root[data-app-effective-theme="dark"] #screen-summary .summary-ai-card,
:root[data-app-effective-theme="dark"] #screen-summary .summary-mini-nutrition,
:root[data-app-effective-theme="dark"] #screen-summary .summary-mini-ai {
    background: #121812;
}

:root[data-app-effective-theme="dark"] #screen-summary .summary-progress-card {
    background: var(--calm-accent-bg);
    color: var(--text-color);
}

:root[data-app-effective-theme="dark"] #screen-summary .summary-progress-bar {
    background: var(--surface-border);
}

:root[data-app-effective-theme="dark"] #screen-summary .summary-progress-bar span {
    background: var(--button-color);
}

:root[data-app-effective-theme="dark"] #screen-summary .summary-progress-card small {
    color: var(--hint-color);
}

:root[data-app-effective-theme="dark"] #screen-summary .summary-ai-icon {
    background: var(--button-color);
    color: var(--button-text);
}

@media (max-width: 360px) {
    #screen-summary {
        padding-left: 12px;
        padding-right: 12px;
    }

    #screen-summary .summary-progress-card,
    #screen-summary .summary-mini-card,
    #screen-summary .summary-streak-card,
    #screen-summary .summary-ai-card {
        border-radius: 20px;
    }
}

/* Source: app/css/features/history/list.css */
/* Секция истории */
.history-section {
    margin-top: 30px;
}

.history-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.history-empty {
    text-align: center;
    color: var(--hint-color);
    font-size: 14px;
    padding: 20px;
}

.history-day-group {
    margin-bottom: 18px;
}

.history-day-group:last-child {
    margin-bottom: 0;
}

.history-day-header {
    color: var(--hint-color);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px 2px;
}

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

.swipe-row,
.history-swipe-row {
    --swipe-radius: 14px;
    --swipe-delete-width: 132px;
    --swipe-card-solid-bg: var(--surface-card-solid);
    background: transparent;
    border-radius: var(--swipe-radius);
    isolation: isolate;
    overflow: hidden;
    position: relative;
}

.history-swipe-row.is-horizontal-dragging {
    user-select: none;
}

.delete-action,
.history-delete-action {
    align-items: center;
    background: linear-gradient(135deg, #ff453a, #d92d2d);
    border: 0;
    border-radius: calc(var(--swipe-radius) + 1px);
    bottom: -1px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    justify-content: flex-end;
    left: -1px;
    letter-spacing: 0;
    opacity: 0;
    padding: 0 18px 0 calc(100% - var(--swipe-delete-width));
    pointer-events: none;
    position: absolute;
    right: -1px;
    text-align: right;
    top: -1px;
    transition: opacity 0.14s ease;
    z-index: 1;
}

.swipe-row.is-swiping .delete-action,
.swipe-row.is-open .delete-action,
.history-swipe-row.swiping .history-delete-action,
.history-swipe-row.open .history-delete-action {
    opacity: 1;
}

.swipe-row.is-open .delete-action,
.history-swipe-row.open .history-delete-action {
    pointer-events: auto;
}

.swipe-row.is-deleting .delete-action {
    cursor: wait;
    opacity: 0.78;
}

.delete-action:disabled {
    cursor: wait;
}

.meal-card-wrapper,
.history-card-wrapper {
    border-radius: inherit;
    overflow: hidden;
    position: relative;
    touch-action: pan-y;
    transform: translate3d(0, 0, 0);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
    z-index: 2;
}

.swipe-row.is-swiping .meal-card-wrapper,
.swipe-row.is-open .meal-card-wrapper,
.swipe-row.is-closing .meal-card-wrapper {
    background: var(--swipe-card-solid-bg);
    box-shadow: 0 0 0 1px var(--swipe-card-solid-bg);
}

.swipe-row.is-horizontal-dragging .meal-card-wrapper {
    transition: none;
}

.swipe-row.is-closing .meal-card-wrapper {
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.meal-card,
.history-item {
    background: var(--secondary-bg);
    border-radius: inherit;
    box-shadow: 0 0 0 1px var(--secondary-bg);
    cursor: pointer;
    display: block;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.history-card-main {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 69px minmax(0, 1fr) auto;
    min-width: 0;
    overflow: hidden;
    padding: 14px;
}

.history-thumbnail {
    align-items: center;
    background: #2c2c2e;
    width: 69px;
    height: 69px;
    border-radius: 10px;
    display: grid;
    justify-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.history-thumbnail img,
.history-thumbnail-placeholder {
    width: 100%;
    height: 100%;
}

.history-thumbnail img {
    background: var(--secondary-bg);
    object-fit: cover;
}

.history-thumbnail-placeholder {
    align-items: center;
    color: #fff;
    display: flex;
    justify-content: center;
}

.history-thumbnail-placeholder svg {
    display: block;
    height: 30px;
    width: 30px;
}

.history-info {
    min-width: 0;
    overflow: hidden;
}

.history-date {
    font-size: 13px;
    color: var(--hint-color);
    margin-bottom: 4px;
}

.history-description {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-macros {
    color: var(--hint-color);
    font-size: 13px;
    line-height: 1.35;
    margin-top: 4px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-calories {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    margin-left: auto;
    min-width: 58px;
    text-align: right;
}

.calories-value {
    display: block;
    font-size: 21px;
    font-weight: 700;
    color: var(--button-color);
}

.calories-label {
    font-size: 12px;
    color: var(--hint-color);
}

.history-expand-indicator {
    color: var(--button-color);
    display: block;
    height: 24px;
    line-height: 0;
    margin-top: 4px;
    transition: transform 0.22s ease;
    width: 24px;
}

.history-expand-indicator svg {
    display: block;
    height: 100%;
    width: 100%;
}

.history-swipe-row.detail-open .history-expand-indicator {
    transform: rotate(90deg);
}

.history-accordion {
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: height 0.36s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease;
    will-change: height, opacity;
}

.history-swipe-row.detail-open .history-accordion {
    opacity: 1;
}

.history-accordion-inner {
    min-height: 0;
    overflow: hidden;
}

.history-detail-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin: 0 12px 12px;
    opacity: 0;
    padding: 12px;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-swipe-row.detail-open .history-detail-content {
    opacity: 1;
    transform: translateY(0);
}

.history-detail-totals {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 10px;
}

.history-detail-totals div {
    background: var(--secondary-bg);
    border-radius: 10px;
    padding: 9px 5px;
    text-align: center;
}

.history-detail-totals strong,
.history-detail-totals span {
    display: block;
}

.history-detail-totals strong {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1;
}

.history-detail-totals span {
    color: var(--hint-color);
    font-size: 10px;
    margin-top: 4px;
}

.history-detail-loading,
.history-detail-empty {
    color: var(--hint-color);
    font-size: 13px;
    margin: 0;
    padding: 8px 0;
    text-align: center;
}

.history-detail-product {
    align-items: center;
    background: var(--secondary-bg);
    border-radius: 10px;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto;
    margin-top: 8px;
    padding: 10px;
}

.history-detail-product strong,
.history-detail-product small {
    display: block;
}

.history-detail-product strong {
    font-size: 14px;
    line-height: 1.25;
}

.history-detail-product small {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 4px;
}

.history-detail-product span {
    color: var(--button-color);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.meal-card,
.history-item {
    --history-card-bg: var(--secondary-bg);
    --history-card-solid-bg: var(--surface-card-solid);
    --history-card-border: color-mix(in srgb, var(--text-color) 8%, transparent);
    --history-card-shadow: color-mix(in srgb, var(--text-color) 12%, transparent);
    background: var(--history-card-bg);
    background-clip: border-box;
    border: 1px solid var(--history-card-border);
    box-shadow: none;
    isolation: isolate;
    overflow: hidden;
}

.swipe-row.is-swiping .meal-card,
.swipe-row.is-open .meal-card,
.swipe-row.is-closing .meal-card {
    background: var(--history-card-solid-bg);
    border-color: var(--swipe-card-solid-bg);
    box-shadow: 0 0 0 1px var(--swipe-card-solid-bg);
}

.meal-card::before,
.meal-card::after,
.history-item::before,
.history-item::after {
    border-radius: inherit;
    content: '';
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.meal-card::before,
.history-item::before {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 58%);
    opacity: 0;
    z-index: 0;
}

.meal-card::after,
.history-item::after {
    background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--button-color) 8%, transparent));
    opacity: 0;
    z-index: 0;
}

.meal-card > *,
.history-item > * {
    position: relative;
    z-index: 1;
}

.history-detail-content {
    background: var(--bg-color);
    border-color: color-mix(in srgb, var(--text-color) 8%, transparent);
}

.history-detail-totals div,
.history-detail-product {
    background: var(--secondary-bg);
    border: 1px solid color-mix(in srgb, var(--text-color) 7%, transparent);
}

.history-thumbnail,
.history-thumbnail img {
    background: color-mix(in srgb, var(--secondary-bg) 82%, var(--bg-color));
}

.history-thumbnail {
    border: 1px solid color-mix(in srgb, var(--text-color) 8%, transparent);
}

.history-thumbnail-placeholder {
    background: color-mix(in srgb, var(--secondary-bg) 72%, var(--text-color) 10%);
    color: var(--button-color);
}

:root[data-app-effective-theme="dark"] .history-thumbnail-placeholder{
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 46%),
        #090c11;
}

/* Source: app/css/features/history/calendar.css */
/* Current history screen */

body.sheet-open {
    overflow: hidden;
}

.history-page-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.history-page-header h1 {
    color: var(--text-color);
    font-size: 22px;
    font-weight: 750;
    line-height: 1.16;
    margin: 0 0 6px;
}

.history-page-header p {
    color: var(--hint-color);
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
}

.history-calendar-card {
    background: var(--secondary-bg);
    border-radius: 26px;
    padding: 14px;
}

.history-month-nav {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 34px 1fr 34px;
}

.history-month-nav p {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-month-button {
    -webkit-appearance: none;
    appearance: none;
    align-items: center;
    background: var(--card-soft);
    border: 0;
    border-radius: 12px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    font-size: 25px;
    height: 34px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 3px;
    width: 34px;
}

.history-calendar-weekdays,
.history-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.history-calendar-weekdays {
    color: var(--hint-color);
    font-size: 11px;
    font-weight: 650;
    margin: 13px 0 8px;
    text-align: center;
}

.history-calendar-grid {
    --history-layout-easing: cubic-bezier(.22, 1, .36, 1);
    gap: 8px 6px;
    transform-origin: top center;
    transition: opacity 180ms ease, transform 220ms ease;
}

.history-calendar-grid.is-layout-transitioning {
    overflow: hidden;
    transition: height 480ms var(--history-layout-easing), opacity 240ms ease, transform 420ms var(--history-layout-easing);
    will-change: height;
}

.history-calendar-grid.is-week-mode {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.history-calendar-grid.is-calendar-entering {
    animation: historyCalendarEnter 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes historyCalendarEnter {
    from {
        opacity: 0.3;
        transform: translateY(-6px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.history-calendar-day {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--text-color);
    cursor: pointer;
    display: grid;
    justify-items: center;
    min-height: 42px;
    min-width: 0;
    padding: 0;
    text-align: center;
}

.history-calendar-day-empty-slot {
    cursor: default;
}

.history-calendar-ring {
    --ring-color: #c7c7cc;
    --ring-track-color: rgba(17, 17, 17, 0.08);
    --ring-dot-shadow: rgba(0, 0, 0, 0.22);
    --ring-dot-top: 9.0909%;
    --ring-size: 40px;
    --ring-thickness: 6px;
    border-radius: 50%;
    display: grid;
    height: var(--ring-size);
    margin: 0 auto;
    max-width: 100%;
    place-items: center;
    position: relative;
    transition: background 160ms ease, transform 160ms ease;
    width: var(--ring-size);
}

.history-calendar-day.is-selected .history-calendar-ring {
    background: transparent;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--button-color) 24%, transparent);
    transform: scale(1.03);
}

.history-calendar-day.is-selected .history-calendar-day-number {
    color: var(--black);
    font-weight: 800;
}

.history-calendar-day-number {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 700;
    position: relative;
    z-index: 4;
}

.history-ring-svg {
    display: block;
    height: 100%;
    inset: 0;
    pointer-events: none;
    position: absolute;
    width: 100%;
    z-index: 1;
}

.history-ring-track,
.history-ring-progress {
    fill: none;
    transform: rotate(-90deg);
    transform-box: fill-box;
    transform-origin: 50% 50%;
    vector-effect: non-scaling-stroke;
}

.history-ring-track {
    stroke: var(--ring-track-color);
    stroke-width: var(--ring-thickness);
}

.history-ring-progress {
    filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--ring-color) 30%, transparent));
    stroke: var(--ring-color);
    stroke-dasharray: 100 100;
    stroke-dashoffset: 100;
    stroke-linecap: round;
    stroke-width: var(--ring-thickness);
    transition: stroke-dashoffset 0.72s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: inherit;
}

.history-ring-dot {
    height: 100%;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transform: rotate(0deg);
    transition: transform 0.72s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
    transition-delay: inherit;
    width: 100%;
    z-index: 3;
}

.history-ring-dot::after {
    background: transparent;
    border-radius: 50%;
    box-shadow: 2px 0 3px var(--ring-dot-shadow);
    content: "";
    height: var(--ring-thickness);
    left: 50%;
    position: absolute;
    top: calc(var(--ring-dot-top) - var(--ring-thickness) / 2);
    transform: translateX(-50%);
    width: var(--ring-thickness);
}

.history-progress-ring.is-ring-animated.has-over .history-ring-dot {
    opacity: 1;
}

.day-empty .history-calendar-ring,
.history-day-ring.day-empty {
    --ring-color: #c7c7cc;
    --ring-track-color: rgba(17, 17, 17, 0.08);
}

.day-low .history-calendar-ring,
.history-day-ring.day-low {
    --ring-color: #4AA3D8;
    --ring-track-color: rgba(74, 163, 216, 0.18);
}

.day-warning .history-calendar-ring,
.history-day-ring.day-warning {
    --ring-color: #F4C542;
    --ring-track-color: rgba(244, 197, 66, 0.2);
}

.day-good .history-calendar-ring,
.history-day-ring.day-good {
    --ring-color: var(--button-color);
    --ring-track-color: color-mix(in srgb, var(--button-color) 18%, transparent);
}

.day-over .history-calendar-ring,
.history-day-ring.day-over {
    --ring-color: #F39A2E;
    --ring-track-color: rgba(243, 154, 46, 0.2);
}

.day-danger .history-calendar-ring,
.history-day-ring.day-danger {
    --ring-color: #E95D4F;
    --ring-track-color: rgba(233, 93, 79, 0.2);
}

.history-day-detail {
    background: var(--secondary-bg);
    border-radius: 26px;
    margin-top: 10px;
    padding: 14px;
}

.history-day-content {
    text-align: center;
}

.history-day-date {
    color: var(--hint-color);
    font-size: 13px;
    font-weight: 650;
    margin: 0 0 14px;
}

.history-day-overview {
    align-items: center;
    display: grid;
    gap: 15px;
    grid-template-columns: minmax(0, 1fr) 106px;
}

.history-day-ring {
    --ring-color: #c7c7cc;
    --ring-track-color: rgba(17, 17, 17, 0.08);
    --ring-dot-shadow: rgba(0, 0, 0, 0.24);
    --ring-dot-top: 6.8182%;
    --ring-size: 132px;
    --ring-thickness: 17px;
    border-radius: 50%;
    display: grid;
    height: var(--ring-size);
    margin: 0 auto;
    place-items: center;
    position: relative;
    width: var(--ring-size);
}

.history-day-ring-inner {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    z-index: 4;
}

.history-day-ring-inner strong {
    color: var(--text-color);
    font-size: 29px;
    font-weight: 750;
    line-height: 1;
}

.history-day-ring-inner small {
    color: var(--hint-color);
    font-size: 12px;
}

.history-day-calories {
    display: grid;
    gap: 9px;
    text-align: left;
}

.history-day-calories strong {
    color: var(--text-color);
    display: block;
    font-size: 20px;
    font-weight: 750;
    line-height: 1;
}

.history-day-calories span {
    color: var(--hint-color);
    display: block;
    font-size: 11px;
    margin-top: 4px;
}

.history-day-calories i {
    background: var(--surface-border);
    border-radius: 999px;
    display: block;
    height: 1px;
    width: 100%;
}

.history-day-expand {
    -webkit-appearance: none;
    appearance: none;
    align-items: center;
    background: var(--card-soft);
    border: 0;
    border-radius: 999px;
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 650;
    gap: 7px;
    justify-content: center;
    line-height: 1;
    margin-top: 14px;
    min-height: 36px;
    padding: 0 16px;
    width: auto;
}

.history-day-expand-icon {
    color: var(--button-color);
    display: block;
    height: 16px;
    transform: rotate(0deg);
    transform-box: fill-box;
    transform-origin: 50% 50%;
    transition: transform 360ms cubic-bezier(.22, 1, .36, 1);
    width: 16px;
}

.history-day-expand[aria-expanded="true"] .history-day-expand-icon {
    transform: rotate(180deg);
}

.history-day-expanded {
    max-height: 0;
    margin-top: 14px;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    transition:
        max-height 480ms cubic-bezier(.22, 1, .36, 1),
        opacity 280ms ease,
        transform 420ms cubic-bezier(.22, 1, .36, 1);
    will-change: max-height, opacity, transform;
}

.history-day-detail.is-expanded .history-day-expanded {
    opacity: 1;
    transform: translateY(0);
}

.history-day-macros {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.history-day-macros div,
.history-day-empty {
    background: var(--secondary-bg);
    border-radius: 16px;
}

.history-day-macros div {
    padding: 10px 6px;
}

.history-day-macros strong,
.history-day-macros span {
    display: block;
}

.history-day-macros strong {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1;
}

.history-day-macros span {
    color: var(--hint-color);
    font-size: 11px;
    margin-top: 4px;
}

.history-day-meals {
    text-align: left;
}

.history-day-meals h2 {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 750;
    margin: 0 0 10px;
}

.history-meal-slot {
    margin-top: 10px;
}

.history-meal-slot:first-child {
    margin-top: 0;
}

.history-meal-slot h3 {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 6px;
}

.history-meal-slot.is-empty {
    align-items: center;
    background: transparent;
    display: flex;
    justify-content: space-between;
    min-height: 28px;
}

.history-meal-slot.is-empty h3 {
    color: color-mix(in srgb, var(--text-color) 72%, transparent);
    font-size: 12px;
    font-weight: 600;
    margin: 0;
}

.history-meal-slot.is-empty p {
    color: var(--hint-color);
    font-size: 11px;
    margin: 0;
}

.history-day-empty {
    color: var(--hint-color);
    font-size: 13px;
    margin: 0;
    padding: 16px;
    text-align: center;
}

.history-day-meal {
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: 0 8px 14px -13px rgba(0, 0, 0, 0.12);
    display: grid;
    gap: 10px;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    margin-bottom: 8px;
    min-width: 0;
    padding: 7px 9px 7px 7px;
}

.history-day-meal-thumb {
    border-radius: 12px;
    display: block;
    height: 48px;
    overflow: hidden;
    width: 48px;
}

.history-food-generic {
    background:
        radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--button-color) 62%, #ffffff) 0 18%, transparent 19%),
        linear-gradient(135deg, var(--card-soft), var(--bg-color));
}

.history-day-meal-info {
    min-width: 0;
}

.history-day-meal-time,
.history-day-meal strong,
.history-day-meal small {
    display: block;
}

.history-day-meal-time {
    color: var(--hint-color);
    font-size: 12px;
    margin: 4px 0 2px;
}

.history-day-meal strong {
    color: var(--text-color);
    display: block;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.12;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-day-meal small {
    color: var(--hint-color);
    display: block;
    font-size: 10px;
    line-height: 1.18;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-day-meal-calories {
    color: var(--hint-color);
    font-size: 11px;
    white-space: nowrap;
}

.history-day-meal-calories strong {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 800;
}

.history-day-detail.is-empty .history-day-ring,
.history-day-detail.is-empty .history-day-calories,
.history-day-detail.is-empty .history-day-overview,
.history-day-detail.is-empty .history-day-expand,
.history-day-detail.is-empty .history-day-macros,
.history-day-detail.is-empty .history-day-meals h2 {
    display: none;
}

.history-day-detail.is-empty .history-day-expanded {
    max-height: 260px;
    margin-top: 0;
    opacity: 1;
    transform: translateY(0);
}

.history-empty-day {
    align-items: center;
    background: transparent;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    min-height: 168px;
    padding: 14px 18px 0;
    text-align: center;
}

.history-empty-day strong {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.22;
}

.history-empty-day p {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.35;
    margin: 7px 0 10px;
}

.history-add-pointer {
    color: var(--button-color);
    display: block;
    height: 82px;
    margin: auto auto -10px;
    opacity: 0.62;
    transform: translateX(-12px) rotate(-45deg);
    transform-origin: 50% 62%;
    width: 70px;
}

.history-add-pointer-line,
.history-add-pointer-head {
    stroke-dasharray: 180;
    stroke-dashoffset: 180;
}

.history-add-pointer-line {
    animation: historyPointerDraw 1.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.history-add-pointer-head {
    animation: historyPointerDraw 0.18s ease-out 0.28s forwards;
}

.history-empty-day.is-pointer-drawn .history-add-pointer-line,
.history-empty-day.is-pointer-drawn .history-add-pointer-head {
    animation: none;
    stroke-dashoffset: 0;
}

.history-day-detail.is-empty .history-add-pointer {
    animation: historyPointerFloat 1.8s ease-in-out 1.5s infinite;
}

@keyframes historyPointerDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes historyPointerFloat {
    0%,
    100% {
        transform: translate(-12px, 0) rotate(-45deg);
    }

    50% {
        transform: translate(-12px, 6px) rotate(-45deg);
    }
}

/* Source: app/css/features/history/screen.css */
/* Production history screen */
#screen-history {
    --black: #151713;
    --button-color: #6dbb35;
    --card-border: rgba(17, 17, 17, 0.07);
    --card-soft: #f4f8ec;
    background: #f7faef;
    color: var(--text-color);
    padding: 20px 18px;
    padding-top: calc(var(--app-screen-top-offset) + max(env(safe-area-inset-top), var(--tg-safe-area-top), var(--tg-content-safe-area-top)));
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

#screen-history .history-content {
    margin: 0 auto;
    max-width: 430px;
    width: 100%;
}

#screen-history .history-calendar-card,
#screen-history .history-day-detail {
    background: #ffffff;
}

#screen-history .profile-button {
    appearance: none;
    align-items: center;
    background: #ffffff;
    border: 0;
    border-radius: 999px;
    color: var(--text-color);
    cursor: pointer;
    display: grid;
    flex: 0 0 auto;
    height: 40px;
    padding: 0;
    place-items: center;
    width: 40px;
}

#screen-history .profile-button svg {
    display: block;
    height: 24px;
    width: 24px;
}

#screen-history .history-month-button:disabled {
    cursor: wait;
    opacity: 0.48;
}

#screen-history .history-calendar-day:focus-visible,
#screen-history .history-month-button:focus-visible,
#screen-history .history-day-expand:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--button-color) 52%, transparent);
    outline-offset: 2px;
}

#screen-history .history-day-expanded {
    max-height: 0;
}

#screen-history .history-day-meal-thumb img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

#screen-history .history-day-detail.is-empty .history-day-expanded {
    max-height: 260px;
}

#screen-history .history-calendar-error {
    color: var(--hint-color);
    font-size: 13px;
    grid-column: 1 / -1;
    padding: 28px 8px;
    text-align: center;
}

#screen-history .history-calendar-error button {
    appearance: none;
    background: var(--button-color);
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    display: block;
    font: inherit;
    font-weight: 700;
    margin: 12px auto 0;
    min-height: 38px;
    padding: 0 18px;
}

:root[data-app-effective-theme="dark"] #screen-history {
    --black: #f5f5f1;
    --button-color: #8fd35a;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-soft: #1a2419;
    background: #0b100c;
}

:root[data-app-effective-theme="dark"] #screen-history .history-calendar-card,
:root[data-app-effective-theme="dark"] #screen-history .history-day-detail,
:root[data-app-effective-theme="dark"] #screen-history .profile-button {
    background: #121812;
}

:root[data-app-effective-theme="dark"] #screen-history .history-month-button,
:root[data-app-effective-theme="dark"] #screen-history .history-day-macros div,
:root[data-app-effective-theme="dark"] #screen-history .history-day-empty,
:root[data-app-effective-theme="dark"] #screen-history .history-day-meal {
    background: var(--card-soft);
}

:root[data-app-effective-theme="dark"] #screen-history .history-day-meal {
    box-shadow: none;
}

:root[data-app-effective-theme="dark"] #screen-history .history-food-generic {
    background:
        radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--button-color) 54%, transparent) 0 18%, transparent 19%),
        linear-gradient(135deg, var(--card-soft), #121812);
}

:root[data-app-effective-theme="dark"] #screen-history .day-empty .history-calendar-ring,
:root[data-app-effective-theme="dark"] #screen-history .history-day-ring.day-empty {
    --ring-track-color: var(--surface-border);
}

@media (max-width: 360px) {
    #screen-history {
        padding-left: 12px;
        padding-right: 12px;
    }

    #screen-history .history-calendar-card,
    #screen-history .history-day-detail {
        border-radius: 22px;
        padding: 12px;
    }

    #screen-history .history-calendar-grid {
        gap: 7px 3px;
    }

    #screen-history .history-calendar-ring {
        --ring-size: 37px;
    }

    #screen-history .history-day-overview {
        gap: 10px;
        grid-template-columns: minmax(0, 1fr) 94px;
    }

    #screen-history .history-day-ring {
        --ring-size: 122px;
    }
}

/* Source: app/css/features/history/details.css */
/* Meal detail dialog */
.meal-detail-sheet {
    inset: 0;
    position: fixed;
    z-index: 130;
}

.meal-detail-overlay {
    background: rgba(0, 0, 0, 0.45);
    inset: 0;
    position: absolute;
}

.meal-detail-panel {
    background: var(--bg-color);
    border-radius: 22px 22px 0 0;
    bottom: 0;
    left: 50%;
    max-height: 88vh;
    max-width: 430px;
    overflow-y: auto;
    padding: 18px 18px max(22px, env(safe-area-inset-bottom));
    position: absolute;
    transform: translateX(-50%);
    width: 100%;
}

.meal-detail-close {
    align-items: center;
    background: var(--secondary-bg);
    border: 0;
    border-radius: 50%;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    font-size: 24px;
    height: 36px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 3px;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 36px;
}

.meal-detail-content {
    padding-top: 8px;
}

.meal-detail-time {
    color: var(--hint-color);
    font-size: 13px;
    font-weight: 600;
    margin: 0 44px 8px 0;
}

.meal-detail-content h2 {
    font-size: 22px;
    line-height: 1.18;
    margin: 0 44px 16px 0;
}

.meal-detail-total {
    align-items: baseline;
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.meal-detail-total strong {
    color: var(--button-color);
    font-size: 34px;
    line-height: 1;
}

.meal-detail-total span {
    color: var(--hint-color);
    font-size: 14px;
}

.meal-detail-macros {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 20px;
}

.meal-detail-macros div {
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
}

.meal-detail-macros strong,
.meal-detail-macros span {
    display: block;
}

.meal-detail-macros strong {
    font-size: 16px;
    line-height: 1;
}

.meal-detail-macros span {
    color: var(--hint-color);
    font-size: 10px;
    margin-top: 4px;
}

.meal-detail-products h3 {
    font-size: 16px;
    margin: 0 0 10px;
}

.meal-detail-empty {
    background: var(--secondary-bg);
    border-radius: 12px;
    color: var(--hint-color);
    margin: 0;
    padding: 16px;
    text-align: center;
}

.meal-detail-product {
    align-items: center;
    background: var(--secondary-bg);
    border-radius: 12px;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto;
    margin-bottom: 8px;
    padding: 12px;
}

.meal-detail-product strong,
.meal-detail-product small {
    display: block;
}

.meal-detail-product strong {
    font-size: 14px;
    line-height: 1.25;
}

.meal-detail-product small {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 4px;
}

.meal-detail-product span {
    color: var(--button-color);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

/* Source: app/css/components/buttons.css */
/* Кнопки */
.main-button, .scan-button {
    background-color: var(--button-color);
    color: var(--button-text);
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.main-button:active, .scan-button:active {
    opacity: 0.8;
}

.main-button:disabled,
.scan-button:disabled {
    background-color: #c7c7cc;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.92);
    cursor: default;
    opacity: 1;
}

.main-button:disabled:active,
.scan-button:disabled:active {
    opacity: 1;
}

.scan-button {
    background-color: var(--button-color);
    margin-top: 0;
}

.delete-button {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    margin-top: 30px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.delete-button:active {
    opacity: 0.8;
}

/* Source: app/css/components/tabbar.css */
/* Таббар */
.tab-bar {
    --tab-glass: #bbbbbc;
    --tab-light: #fff;
    --tab-dark: #000;
    --tab-reflex-dark: 1;
    --tab-reflex-light: 1;
    --tab-gap: 6px;
    -webkit-tap-highlight-color: transparent;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: var(--bg-color);
    border-top: 1px solid var(--secondary-bg);
    display: flex;
    gap: var(--tab-gap);
    justify-content: space-around;
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    transition:
        background-color 400ms cubic-bezier(1, 0, 0.4, 1),
        border-color 400ms cubic-bezier(1, 0, 0.4, 1),
        box-shadow 400ms cubic-bezier(1, 0, 0.4, 1),
        bottom 400ms cubic-bezier(1, 0, 0.4, 1),
        width 400ms cubic-bezier(1, 0, 0.4, 1);
    z-index: 50;
}

.tab-bar * {
    -webkit-tap-highlight-color: transparent;
}

.tab-indicator {
    background: color-mix(in srgb, var(--button-color) 12%, transparent);
    border-radius: 20px;
    bottom: max(8px, env(safe-area-inset-bottom));
    box-shadow: none;
    left: 8px;
    pointer-events: none;
    position: absolute;
    top: 8px;
    transform: translateX(calc(var(--active-tab-index, 0) * (100% + var(--tab-gap))));
    transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
    width: calc((100% - 16px - (var(--tab-gap) * 2)) / 3);
    z-index: 0;
}

.tab-item {
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 20px;
    box-shadow: none;
    min-width: 0;
    margin: 0;
    outline: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--hint-color);
    position: relative;
    touch-action: manipulation;
    transition: color 0.2s ease, opacity 0.2s ease;
    user-select: none;
    z-index: 1;
}

.tab-item.active {
    color: var(--button-color);
}

.tab-item:hover,
.tab-item:active,
.tab-item:focus,
.tab-item:focus-visible {
    background: transparent;
    border: none;
    box-shadow: none;
    outline: none;
    transform: none;
}

.tab-icon {
    display: block;
    height: 24px;
    margin-bottom: 4px;
    color: currentColor;
    transition: color 0.2s ease, opacity 0.2s ease;
    width: 24px;
}

.tab-item.active .tab-icon {
    color: var(--button-color);
}

.tab-icon svg {
    display: block;
    filter: none;
    height: 100%;
    width: 100%;
}

.tab-label {
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Current application tabbar */

.tab-bar {
    --tab-gap: 6px;
    --tab-center-gap: 76px;
    align-items: stretch;
    backdrop-filter: blur(18px);
    background: color-mix(in srgb, var(--bg-color) 88%, transparent);
    border: 1px solid var(--surface-border);
    border-radius: 34px;
    bottom: max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 14px 40px rgba(0, 0, 0, .08);
    display: flex;
    gap: var(--tab-gap);
    left: 50%;
    max-width: 430px;
    padding: 8px;
    position: fixed;
    transform: translateX(-50%);
    width: calc(100% - 24px);
}

.tab-bar .tab-indicator {
    background: color-mix(in srgb, #b8ed4a 42%, var(--bg-color));
    border-radius: 26px;
    bottom: 8px;
    left: 8px;
    top: 8px;
    transform: translateX(0);
    width: calc((100% - 16px - (var(--tab-gap) * 2) - var(--tab-center-gap)) / 4);
}

.tab-bar[style*="--active-tab-index: 1"] .tab-indicator {
    transform: translateX(calc(100% + var(--tab-gap)));
}

.tab-bar[style*="--active-tab-index: 2"] .tab-indicator {
    transform: translateX(calc((100% + var(--tab-gap)) * 2 + var(--tab-center-gap) - var(--tab-gap)));
}

.tab-bar[style*="--active-tab-index: 3"] .tab-indicator {
    transform: translateX(calc((100% + var(--tab-gap)) * 3 + var(--tab-center-gap) - var(--tab-gap)));
}

.tab-bar .tab-item {
    color: var(--hint-color);
    padding: 8px 12px;
}

.tab-bar .tab-item:nth-of-type(3) {
    margin-left: calc(var(--tab-center-gap) - var(--tab-gap));
}

.tab-bar .tab-item.active {
    color: var(--text-color);
}

.tab-bar .tab-item.active .tab-icon {
    color: #69c52f;
}

:root[data-app-effective-theme="dark"] .tab-bar .tab-item.active .tab-icon {
    color: #8fd35a;
}

.tab-bar .tab-item-disabled {
    cursor: default;
}

.add-food-fab {
    align-items: center;
    appearance: none;
    background: #111;
    border: 4px solid var(--bg-color);
    border-radius: 999px;
    bottom: calc(34px + env(safe-area-inset-bottom));
    color: #fff;
    cursor: pointer;
    display: grid;
    height: 62px;
    left: 50%;
    padding: 0;
    place-items: center;
    position: fixed;
    transform: translateX(-50%);
    width: 62px;
    z-index: 70;
}

:root[data-app-effective-theme="dark"] .add-food-fab {
    background: #8fd35a;
    color: #10150e;
}

.add-food-fab span {
    color: inherit;
    font-size: 0;
    height: 26px;
    position: relative;
    width: 26px;
}

.add-food-fab span::before,
.add-food-fab span::after {
    background: currentColor;
    border-radius: 999px;
    content: "";
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

.add-food-fab span::before {
    height: 3px;
    width: 26px;
}

.add-food-fab span::after {
    height: 26px;
    width: 3px;
}

.add-food-fab.hidden {
    display: none;
}

/* Source: app/css/features/profile/settings.css */
/* Экран настроек */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.settings-header {
    margin-bottom: 2px;
    text-align: left;
}

.settings-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px;
}

.settings-header p,
.settings-section-header p,
.settings-control-hint,
.settings-danger-details p {
    color: var(--hint-color);
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
}

.settings-section {
    background: var(--secondary-bg);
    border-radius: 14px;
    padding: 14px;
}

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

.settings-section-header h2 {
    font-size: 17px;
    line-height: 1.2;
    margin: 0 0 4px;
}

.settings-link-button {
    background: var(--bg-color);
    border: 0;
    border-radius: 999px;
    color: var(--button-color);
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    min-height: 32px;
    padding: 0 12px;
}

.settings-profile-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-metric {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 11px 12px;
}

.settings-metric span {
    color: var(--hint-color);
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.settings-metric strong {
    color: var(--text-color);
    display: block;
    font-size: 16px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-list {
    background: var(--bg-color);
    border-radius: 13px;
    overflow: hidden;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--bg-color);
}

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

.settings-label {
    font-size: 15px;
    font-weight: 650;
    color: var(--text-color);
}

.settings-value {
    font-size: 15px;
    color: var(--hint-color);
    font-weight: 650;
    text-align: right;
}

.settings-value-strong {
    color: var(--button-color);
}

.settings-edit-button {
    margin-top: 16px;
    width: 100%;
}

.settings-control-row {
    align-items: stretch;
    display: grid;
    gap: 12px;
}

.settings-control-row-inline {
    align-items: center;
    grid-template-columns: 1fr auto;
}

.settings-control-row .settings-label,
.settings-control-hint {
    display: block;
}

.settings-control-row .settings-label {
    margin-bottom: 3px;
}

.theme-switcher {
    --switcher-glass: #bbbbbc;
    --switcher-light: #fff;
    --switcher-dark: #000;
    --switcher-content: var(--text-color);
    --glass-reflex-dark: 1;
    --glass-reflex-light: 1;
    --switcher-saturation: 150%;
    --theme-gap: 8px;
    align-items: center;
    background: var(--secondary-bg);
    border: 1px solid color-mix(in srgb, var(--hint-color) 16%, transparent);
    border-radius: 999px;
    box-shadow: none;
    box-sizing: border-box;
    display: grid;
    gap: var(--theme-gap);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: 58px;
    justify-self: stretch;
    margin: 0 auto;
    max-width: none;
    padding: 7px 9px;
    position: relative;
    transition:
        background-color 400ms cubic-bezier(1, 0, 0.4, 1),
        border-color 400ms cubic-bezier(1, 0, 0.4, 1),
        box-shadow 400ms cubic-bezier(1, 0, 0.4, 1);
    width: 100%;
}

.theme-switcher__legend,
.theme-switcher__input {
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(100%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.theme-switcher__option {
    --c: color-mix(in srgb, var(--switcher-content) 72%, var(--hint-color));
    align-items: center;
    border-radius: 999px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    height: 100%;
    justify-content: center;
    min-width: 0;
    padding: 0 12px;
    position: relative;
    transition: color 160ms ease;
    z-index: 1;
}

.theme-switcher__option:hover {
    --c: var(--button-color);
}

.theme-switcher__option.active {
    --c: var(--button-text);
    cursor: default;
}

.theme-switcher__icon {
    display: block;
    height: 26px;
    transition: opacity 0.2s ease;
    width: 26px;
}

.theme-switcher__indicator {
    background: var(--button-color);
    border-radius: 999px;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--button-color) 24%, transparent);
    display: block;
    height: calc(100% - 10px);
    left: 5px;
    position: absolute;
    top: 5px;
    transform: translateX(calc(var(--active-theme-index, 0) * (100% + var(--theme-gap))));
    transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
    width: calc((100% - 26px) / 3);
    z-index: 0;
}

.settings-switch {
    cursor: pointer;
    display: block;
    height: 32px;
    position: relative;
    width: 54px;
}

.settings-switch input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.settings-switch span {
    background: color-mix(in srgb, var(--hint-color) 28%, var(--bg-color));
    border-radius: 999px;
    display: block;
    height: 100%;
    position: relative;
    transition: background 0.22s ease;
    width: 100%;
}

.settings-switch span::after {
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    content: '';
    height: 26px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    width: 26px;
}

.settings-switch input:checked + span {
    background: var(--button-color);
}

.settings-switch input:checked + span::after {
    transform: translateX(22px);
}

.settings-switch input:focus-visible + span {
    outline: 2px solid var(--button-color);
    outline-offset: 3px;
}

.settings-danger-details {
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--danger-color) 18%, transparent);
    border-radius: 14px;
    padding: 12px 14px;
}

.settings-danger-details summary {
    color: var(--hint-color);
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
}

.settings-danger-details p {
    margin-top: 10px;
}

.settings-danger-button {
    background: color-mix(in srgb, var(--danger-color) 12%, var(--secondary-bg));
    border: 0;
    border-radius: 12px;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    margin-top: 12px;
    min-height: 44px;
    width: 100%;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid.two {
    grid-template-columns: 1fr 1fr;
}

.settings-form-label {
    display: block;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 8px;
}

.compact-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compact-options label {
    align-items: center;
    background: var(--bg-color);
    border-radius: 12px;
    color: var(--text-color);
    display: flex;
    font-size: 15px;
    font-weight: 500;
    gap: 12px;
    min-height: 52px;
    padding: 14px;
}

.compact-options input {
    flex-shrink: 0;
    margin: 0;
}

/* Source: app/css/features/profile/profile.css */
/* Current profile screen */

.profile-page-header {
    margin-bottom: 14px;
}

.profile-page-header h1 {
    color: var(--text-color);
    font-size: 22px;
    font-weight: 750;
    line-height: 1.16;
    margin: 0;
}

.profile-user-card,
.profile-card {
    background: var(--secondary-bg);
    border-radius: 24px;
    margin-top: 10px;
    min-width: 0;
    padding: 14px;
}

.profile-user-card {
    display: block;
    margin-top: 0;
}

.profile-user-title {
    align-items: center;
    display: grid;
    gap: 11px;
    grid-template-columns: 50px minmax(0, 1fr);
    min-width: 0;
}

.profile-avatar {
    align-items: center;
    background: var(--black);
    border-radius: 17px;
    color: #ffffff;
    display: flex;
    font-size: 20px;
    font-weight: 750;
    height: 50px;
    justify-content: center;
    line-height: 1;
    width: 50px;
}

.profile-user-card h2,
.profile-card h2 {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.15;
    margin: 0;
}

.profile-user-card h2 {
    font-size: 17px;
    margin-bottom: 4px;
}

.profile-user-card p,
.profile-card p,
.profile-card small,
.profile-trainer-card span {
    color: var(--hint-color);
    display: block;
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
}

.profile-card-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.profile-card-action {
    -webkit-appearance: none;
    appearance: none;
    background: var(--card-soft);
    border: 0;
    border-radius: 999px;
    color: var(--button-color);
    cursor: pointer;
    flex: 0 0 auto;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    padding: 9px 11px;
}

.profile-card-head a {
    color: var(--button-color);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
}

.profile-card-head a::after {
    content: " >";
}

.profile-goal-card {
    background: var(--secondary-bg);
    padding: 12px 14px 13px;
}

.profile-goal-card h2,
.profile-goal-card strong,
.profile-goal-card p,
.profile-goal-card small,
.profile-goal-card .profile-card-head a,
.profile-goal-stack span {
    color: var(--text-color);
}

.profile-goal-header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 9px;
}

.profile-goal-header h2 {
    font-size: 14px;
    font-weight: 730;
    line-height: 1.2;
    margin: 0;
}

.profile-goal-stack {
    display: grid;
    gap: 2px;
}

.profile-goal-stack span {
    color: var(--hint-color);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
}

.profile-goal-stack strong {
    font-size: 19px;
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1.05;
    margin-bottom: 5px;
}

.profile-card > strong {
    color: var(--text-color);
    display: block;
    font-size: 17px;
    font-weight: 750;
    line-height: 1.15;
    margin-bottom: 5px;
}

.profile-goal-card p {
    font-size: 13px;
    font-weight: 720;
    line-height: 1.2;
    margin: 0;
}

.profile-goal-card small {
    color: var(--hint-color);
    margin-top: 5px;
}

.profile-goal-bottom {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 8px;
}

.profile-goal-action {
    background: var(--card-soft);
    color: var(--button-color);
    padding: 7px 9px;
}

.profile-data-list {
    display: grid;
    gap: 9px;
    margin: 0;
}

.profile-data-list div {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-width: 0;
}

.profile-data-list dt {
    color: var(--hint-color);
    font-size: 12px;
}

.profile-data-list dd {
    color: var(--text-color);
    font-size: 12px;
    font-weight: 650;
    margin: 0;
    text-align: right;
}

.profile-user-data {
    border-top: 1px solid color-mix(in srgb, var(--text-color) 8%, transparent);
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
}

.profile-trainer-card p {
    margin-bottom: 12px;
}

.profile-trainer-card span {
    color: var(--text-color);
    font-weight: 650;
}

.profile-ai-card {
    background: var(--soft-accent-bg);
    padding: 10px;
}

.profile-ai-card h2 {
    font-size: 15px;
    margin-bottom: 10px;
}

.profile-ai-summary-card {
    background: color-mix(in srgb, var(--secondary-bg) 82%, transparent);
    border-radius: 20px;
    padding: 12px;
}

.profile-section-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.profile-section-head h2 {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 730;
    line-height: 1.15;
    margin: 0;
}

.profile-section-head span {
    background: color-mix(in srgb, var(--button-color) 12%, transparent);
    border-radius: 999px;
    color: var(--button-color);
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 7px 9px;
}

.profile-ai-summary-card > p {
    margin-bottom: 12px;
}

.profile-ai-card > strong {
    color: var(--text-color);
    display: block;
    font-size: 22px;
    font-weight: 760;
    line-height: 1;
    margin-bottom: 5px;
}

.profile-ai-limit-list {
    display: grid;
    gap: 7px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-ai-limit-list li {
    align-items: center;
    background: var(--secondary-bg);
    border-radius: 15px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-width: 0;
    padding: 9px 10px;
}

.profile-ai-limit-list span {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.25;
    min-width: 0;
}

.profile-ai-limit-list strong {
    color: var(--text-color);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 720;
    line-height: 1;
    margin: 0;
}

.profile-ai-card[data-state="loading"] .profile-ai-summary-card {
    opacity: .72;
}

.profile-ai-card[data-state="error"] .profile-ai-summary-card {
    background: var(--fat-bg);
}

.profile-ai-retry {
    appearance: none;
    background: var(--button-color);
    border: 0;
    border-radius: 12px;
    color: var(--button-text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    margin-top: 10px;
    padding: 9px 12px;
}

.profile-ai-limits {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 10px;
}

.profile-ai-limits div {
    background: var(--secondary-bg);
    border-radius: 17px;
    min-width: 0;
    padding: 10px;
}

.profile-ai-limits span {
    color: var(--hint-color);
    display: block;
    font-size: 11px;
    line-height: 1.25;
}

.profile-wide-action {
    -webkit-appearance: none;
    appearance: none;
    background: var(--button-color);
    border: 0;
    border-radius: 16px;
    color: var(--button-text);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 12px;
    width: 100%;
}

.profile-wide-action:disabled {
    background: var(--secondary-bg);
    color: var(--hint-color);
    cursor: default;
}

.profile-account-card {
    margin-bottom: 8px;
}

.profile-account-card h2 {
    margin-bottom: 10px;
}

.profile-account-card button {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    color: #D94B3D;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
    padding: 0;
}

.profile-settings-card {
    margin-bottom: 8px;
}

.profile-settings-toggle {
    -webkit-appearance: none;
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 14px;
    justify-content: space-between;
    padding: 0;
    text-align: left;
    width: 100%;
}

.profile-settings-toggle strong {
    color: var(--text-color);
    display: block;
    font-size: 15px;
    font-weight: 720;
    line-height: 1.15;
    margin-bottom: 4px;
}

.profile-settings-toggle small {
    color: color-mix(in srgb, var(--hint-color) 76%, transparent);
    display: block;
    font-size: 11px;
    line-height: 1.35;
}

.profile-settings-chevron {
    color: var(--hint-color);
    flex: 0 0 auto;
    height: 22px;
    transition: transform .22s ease, color .22s ease;
    width: 22px;
}

.profile-settings-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-5px);
    transition: max-height .32s ease, opacity .2s ease, transform .24s ease, margin-top .24s ease;
}

.profile-settings-card.is-open .profile-settings-panel {
    margin-top: 14px;
    max-height: 760px;
    opacity: 1;
    transform: translateY(0);
}

.profile-settings-card.is-open .profile-settings-chevron {
    color: var(--button-color);
    transform: rotate(180deg);
}

.profile-settings-section {
    border-top: 1px solid color-mix(in srgb, var(--text-color) 8%, transparent);
    margin-top: 12px;
    padding-top: 12px;
}

.profile-settings-section:first-child {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.profile-settings-section h3 {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 9px;
}

.profile-settings-section p {
    margin-bottom: 9px;
}

.profile-setting-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 38px;
}

.profile-setting-row + .profile-setting-row {
    margin-top: 7px;
}

.profile-setting-row > span:first-child {
    color: var(--text-color);
    font-size: 12px;
    line-height: 1.25;
    min-width: 0;
}

.profile-setting-row.is-disabled {
    cursor: default;
    opacity: 0.68;
}

.profile-setting-soon {
    color: var(--hint-color);
    display: inline;
    font-size: 10px;
    font-weight: 650;
    margin-left: 4px;
}

.profile-select {
    -webkit-appearance: none;
    appearance: none;
    background: var(--secondary-bg);
    border: 0;
    border-radius: 999px;
    color: var(--text-color);
    cursor: pointer;
    flex: 0 0 auto;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    min-width: 92px;
    padding: 9px 26px 9px 11px;
    text-align: right;
}

.profile-select:disabled {
    color: var(--hint-color);
    cursor: default;
}

.profile-switch-input {
    height: 1px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 1px;
}

.profile-switch {
    background: color-mix(in srgb, var(--hint-color) 24%, transparent);
    border-radius: 999px;
    flex: 0 0 auto;
    height: 24px;
    position: relative;
    transition: background .2s ease;
    width: 42px;
}

.profile-switch::after {
    background: var(--secondary-bg);
    border-radius: 50%;
    content: "";
    height: 18px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform .2s ease;
    width: 18px;
}

.profile-switch-input:checked + .profile-switch {
    background: var(--button-color);
}

.profile-switch-input:checked + .profile-switch::after {
    transform: translateX(18px);
}

.profile-switch-input:disabled + .profile-switch {
    opacity: 0.7;
}

.profile-account-section button {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    color: #D94B3D;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    padding: 0;
}

/* Source: app/css/features/profile/screen.css */
/* Production profile screen */
#screen-settings {
    --black: #111111;
    --button-color: #6dbb35;
    --button-text: #ffffff;
    --calm-accent-bg: #e3f7a7;
    --card-soft: #f8faf1;
    --soft-accent-bg: #d6f78a;
    background: #f7faef;
    color: #171717;
    padding: 20px 18px;
    padding-top: calc(var(--app-screen-top-offset) + max(env(safe-area-inset-top), var(--tg-safe-area-top), var(--tg-content-safe-area-top)));
    padding-bottom: calc(124px + env(safe-area-inset-bottom));
}

#screen-settings .profile-content {
    margin: 0 auto;
    max-width: 430px;
    width: 100%;
}

#screen-settings .profile-user-card,
#screen-settings .profile-card {
    background: #ffffff;
}

#screen-settings .profile-goal-card {
    background: #ffffff;
}

#screen-settings .profile-ai-card {
    background: var(--soft-accent-bg);
}

#screen-settings .profile-settings-panel {
    max-height: 0;
}

#screen-settings .profile-settings-card.is-open .profile-settings-panel {
    max-height: none;
}

:root[data-app-effective-theme="dark"] #screen-settings {
    --black: #10150e;
    --button-color: #8fd35a;
    --button-text: #10150e;
    --calm-accent-bg: #24351d;
    --card-soft: #182018;
    --soft-accent-bg: #24351d;
    background: #0b100c;
    color: #f6f3e8;
}

:root[data-app-effective-theme="dark"] #screen-settings .profile-user-card,
:root[data-app-effective-theme="dark"] #screen-settings .profile-card,
:root[data-app-effective-theme="dark"] #screen-settings .profile-goal-card {
    background: #121812;
}

:root[data-app-effective-theme="dark"] #screen-settings .profile-avatar {
    background: var(--button-color);
    color: var(--button-text);
}

:root[data-app-effective-theme="dark"] #screen-settings .profile-ai-card {
    background: var(--calm-accent-bg);
}

:root[data-app-effective-theme="dark"] #screen-settings .profile-card-action,
:root[data-app-effective-theme="dark"] #screen-settings .profile-ai-limit-list li,
:root[data-app-effective-theme="dark"] #screen-settings .profile-ai-summary-card,
:root[data-app-effective-theme="dark"] #screen-settings .profile-select {
    background: #182018;
}

:root[data-app-effective-theme="dark"] #screen-settings .profile-goal-action {
    background: color-mix(in srgb, var(--text-color) 8%, transparent);
    color: var(--text-color);
}

:root[data-app-effective-theme="dark"] #screen-settings .profile-switch::after {
    background: #121812;
}

@media (max-width: 360px) {
    #screen-settings {
        padding-left: 12px;
        padding-right: 12px;
    }

    #screen-settings .profile-user-card,
    #screen-settings .profile-card {
        border-radius: 20px;
    }
}

/* Source: app/css/screens/profile-edit.css */
/* Экран редактирования профиля */
.profile-edit-content {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    max-width: 400px;
    min-height: 100%;
    width: 100%;
}

.profile-edit-header {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 44px 1fr;
    margin-bottom: 16px;
}

.profile-edit-header h1 {
    font-size: 24px;
    line-height: 1.15;
    margin: 0;
}

.profile-edit-header p {
    color: var(--hint-color);
    font-size: 14px;
    margin: 4px 0 0;
}

.icon-button {
    align-items: center;
    background: var(--secondary-bg);
    border: 0;
    border-radius: 12px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    font-size: 34px;
    height: 44px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 4px;
    width: 44px;
}

.profile-edit-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-form-card,
.profile-form-section {
    background: var(--secondary-bg);
    border-radius: 14px;
    padding: 14px;
}

.profile-section-heading {
    margin-bottom: 12px;
}

.profile-section-heading h2 {
    font-size: 17px;
    line-height: 1.2;
    margin: 0 0 4px;
}

.profile-section-heading p {
    color: var(--hint-color);
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
}

.profile-form-card {
    display: grid;
    gap: 10px;
}

.profile-form-card .form-group {
    background: var(--bg-color);
    border: 1px solid color-mix(in srgb, var(--hint-color) 14%, transparent);
    border-radius: 12px;
    margin-bottom: 0;
    padding: 10px 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.profile-form-card .form-group:focus-within {
    border-color: var(--button-color);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--button-color) 10%, transparent);
    transform: translateY(-1px);
}

.profile-form-card .form-group label {
    color: var(--hint-color);
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 3px;
}

.profile-form-card .form-group input,
.profile-form-card .form-group select {
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    min-height: 30px;
    padding: 0;
}

.profile-form-card .form-group input:focus,
.profile-form-card .form-group select:focus {
    border-color: transparent;
    outline: none;
}

.profile-form-card .form-group + .form-group {
    margin-top: 0;
}

.profile-form-section .compact-options {
    gap: 7px;
}

.profile-form-section .compact-options label {
    border: 1px solid transparent;
    min-height: 44px;
    padding: 12px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.profile-form-section .compact-options input {
    display: none;
}

.profile-form-section .compact-options label:has(input:checked) {
    background: color-mix(in srgb, var(--button-color) 12%, var(--bg-color));
    border-color: var(--button-color);
    color: var(--button-color);
}

.profile-edit-form .main-button {
    border-radius: 15px;
    font-weight: 800;
    margin-top: 0;
    min-height: 56px;
}

/* Адаптив для больших экранов */
@media (min-width: 768px) {
    .screen {
        padding: 40px;
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }

    #screen-main,
    #screen-summary,
    #screen-settings,
    #screen-profile-edit {
        padding-top: 64px;
    }
    
    .welcome-content h1 {
        font-size: 32px;
    }
    
    .welcome-description {
        font-size: 18px;
    }
}

/* Split profile editors */
#screen-profile-edit,
#screen-goal-edit {
    --editor-accent: #6dbb35;
    --editor-card: #ffffff;
    --editor-soft: #f8faf1;
    --editor-hint: #777a70;
    --editor-page: #f7faef;
    --editor-text: #171717;
    background: var(--editor-page);
    color: var(--editor-text);
    padding: 20px 18px 36px;
    padding-top: calc(var(--app-screen-top-offset) + max(env(safe-area-inset-top), var(--tg-safe-area-top), var(--tg-content-safe-area-top)));
}

#screen-profile-edit .profile-edit-content,
#screen-goal-edit .profile-edit-content {
    max-width: 430px;
}

#screen-profile-edit .profile-edit-header,
#screen-goal-edit .profile-edit-header {
    align-items: center;
    gap: 12px;
    grid-template-columns: 42px minmax(0, 1fr);
    margin-bottom: 16px;
}

#screen-profile-edit .profile-edit-header h1,
#screen-goal-edit .profile-edit-header h1 {
    color: var(--editor-text);
    font-size: 22px;
    font-weight: 800;
}

#screen-profile-edit .profile-edit-header p,
#screen-goal-edit .profile-edit-header p {
    color: var(--editor-hint);
    font-size: 12px;
}

.profile-edit-back {
    appearance: none;
    align-items: center;
    background: var(--editor-card);
    border: 0;
    border-radius: 14px;
    color: var(--editor-text);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 30px;
    height: 42px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 3px;
    width: 42px;
}

#screen-profile-edit .profile-edit-form,
#screen-goal-edit .profile-edit-form {
    gap: 10px;
}

#screen-profile-edit .profile-form-card,
#screen-goal-edit .profile-form-card {
    background: var(--editor-card);
    border-radius: 26px;
    gap: 12px;
    padding: 16px;
}

#screen-profile-edit .profile-section-heading,
#screen-goal-edit .profile-section-heading {
    margin-bottom: 2px;
}

#screen-profile-edit .profile-section-heading h2,
#screen-goal-edit .profile-section-heading h2 {
    color: var(--editor-text);
    font-size: 16px;
    font-weight: 780;
}

#screen-profile-edit .profile-section-heading p,
#screen-goal-edit .profile-section-heading p {
    color: var(--editor-hint);
    font-size: 12px;
}

.profile-fields-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-edit-field {
    background: var(--editor-soft);
    border: 1px solid transparent;
    border-radius: 18px;
    display: block;
    min-width: 0;
    padding: 11px 13px;
}

.profile-edit-field:focus-within {
    border-color: color-mix(in srgb, var(--editor-accent) 58%, transparent);
}

.profile-edit-field > span:first-child {
    color: var(--editor-hint);
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-edit-input-wrap {
    align-items: baseline;
    display: flex;
    gap: 5px;
}

.profile-edit-input-wrap input,
.profile-edit-input-wrap select {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--editor-text);
    font: inherit;
    font-size: 17px;
    font-weight: 750;
    min-height: 28px;
    min-width: 0;
    outline: 0;
    padding: 0;
    width: 100%;
}

.profile-edit-input-wrap small {
    color: var(--editor-hint);
    font-size: 11px;
}

.profile-edit-select-wrap {
    position: relative;
}

.profile-edit-select-wrap::after {
    color: var(--editor-accent);
    content: "⌄";
    font-size: 16px;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 3px;
}

.profile-activity-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.profile-activity-options label {
    cursor: pointer;
    flex: 1 1 calc(50% - 7px);
    min-width: 120px;
}

.profile-activity-options input,
.profile-goal-options input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.profile-activity-options span {
    background: var(--editor-soft);
    border: 1px solid transparent;
    border-radius: 15px;
    color: var(--editor-text);
    display: block;
    font-size: 12px;
    font-weight: 700;
    padding: 11px 10px;
    text-align: center;
}

.profile-activity-options input:checked + span {
    background: color-mix(in srgb, var(--editor-accent) 13%, var(--editor-soft));
    border-color: var(--editor-accent);
    color: var(--editor-accent);
}

.profile-goal-options {
    display: grid;
    gap: 8px;
}

.profile-goal-options label {
    align-items: center;
    background: var(--editor-soft);
    border: 1px solid transparent;
    border-radius: 18px;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 22px;
    padding: 14px;
}

.profile-goal-options label:has(input:checked) {
    background: color-mix(in srgb, var(--editor-accent) 12%, var(--editor-soft));
    border-color: var(--editor-accent);
}

.profile-goal-options strong,
.profile-goal-options small {
    display: block;
}

.profile-goal-options strong {
    color: var(--editor-text);
    font-size: 14px;
    margin-bottom: 4px;
}

.profile-goal-options small {
    color: var(--editor-hint);
    font-size: 11px;
}

.profile-goal-options i {
    border: 2px solid color-mix(in srgb, var(--editor-hint) 40%, transparent);
    border-radius: 50%;
    height: 20px;
    position: relative;
    width: 20px;
}

.profile-goal-options label:has(input:checked) i {
    border-color: var(--editor-accent);
}

.profile-goal-options label:has(input:checked) i::after {
    background: var(--editor-accent);
    border-radius: 50%;
    content: "";
    inset: 3px;
    position: absolute;
}

.profile-edit-save {
    appearance: none;
    background: var(--editor-accent);
    border: 0;
    border-radius: 18px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    min-height: 54px;
    padding: 14px 18px;
    width: 100%;
}

.profile-edit-save:disabled {
    cursor: wait;
    opacity: .62;
}

:root[data-app-effective-theme="dark"] #screen-profile-edit,
:root[data-app-effective-theme="dark"] #screen-goal-edit {
    --editor-accent: #8fd35a;
    --editor-card: #121812;
    --editor-soft: #182018;
    --editor-hint: #b5b8aa;
    --editor-page: #0b100c;
    --editor-text: #f6f3e8;
}

:root[data-app-effective-theme="dark"] .profile-edit-save {
    color: #10150e;
}

@media (max-width: 360px) {
    #screen-profile-edit,
    #screen-goal-edit {
        padding-left: 12px;
        padding-right: 12px;
        padding-top: calc(var(--app-screen-top-offset) + max(env(safe-area-inset-top), var(--tg-safe-area-top), var(--tg-content-safe-area-top)));
    }

    .profile-fields-grid {
        grid-template-columns: 1fr;
    }
}

/* Source: app/css/components/forms.css */
/* Метки полей */
.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.meal-name-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--hint-color);
    border-radius: 12px;
    background: var(--secondary-bg);
    color: var(--text-color);
    font-size: 16px;
    margin-bottom: 16px;
}

.meal-name-input:focus {
    outline: none;
    border-color: var(--button-color);
}

.draft-image-field {
    background: var(--secondary-bg);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 16px;
    padding: 12px;
}

.draft-image-field p {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.35;
    margin: 4px 0 0;
}

.draft-image-copy {
    min-width: 0;
}

.draft-image-icon-button {
    align-items: center;
    background: color-mix(in srgb, var(--button-color) 10%, var(--surface-input));
    border: 1px solid color-mix(in srgb, var(--button-color) 34%, var(--surface-border));
    border-radius: 50%;
    box-shadow: 0 8px 18px -16px color-mix(in srgb, var(--button-color) 44%, transparent);
    color: var(--button-color);
    cursor: pointer;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
    width: 40px;
}

.draft-image-icon-button svg {
    height: 21px;
    width: 21px;
}

.draft-image-icon-button:active {
    transform: scale(0.96);
}

.manual-photo-preview {
    aspect-ratio: 1;
    border-radius: 10px;
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    overflow: hidden;
    width: 40px;
}

.manual-photo-preview img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.draft-image-actions {
    display: grid;
    gap: 10px;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    margin-top: 2px;
}

.draft-image-actions .secondary-button,
.draft-image-actions .back-button {
    margin: 0;
}

.draft-image-actions.single-action {
    display: none;
}

.meal-name-display {
    display: block;
    font-size: 14px;
    color: var(--button-color);
    font-weight: 600;
    margin-top: 4px;
    text-align: center;
}

.sheet-header {
    margin-bottom: 20px;
    text-align: center;
}

.field-label {
    display: block;
    font-size: 12px;
    color: var(--hint-color);
    margin-bottom: 4px;
    margin-top: 8px;
}

.field-label:first-of-type {
    margin-top: 0;
}

.input-sublabel {
    display: block;
    font-size: 12px;
    color: var(--hint-color);
    margin-top: 4px;
}

/* Source: app/css/components/sheets.css */
/* ========== BottomSheet модалка ========== */

.add-food-button {
    background-color: var(--button-color);
    color: var(--button-text);
    border: none;
    padding: 16px 24px;
    border-radius: 20px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.add-food-button:active {
    opacity: 0.8;
}

/* BottomSheet контейнер */
.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.sheet-content {
    position: relative;
    background: var(--bg-color);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Заголовок */
.sheet-header {
    margin-bottom: 20px;
    text-align: center;
}

.sheet-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

/* Экран А: Ввод */
.sheet-input-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.sheet-input-wrapper textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    padding-right: 50px;
    border: 1px solid var(--hint-color);
    border-radius: 20px;
    background: var(--secondary-bg);
    color: var(--text-color);
    font-size: 16px;
    resize: none;
    font-family: inherit;
}

.sheet-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--button-color);
}

.sheet-input-wrapper textarea::placeholder {
    color: var(--hint-color);
}

.photo-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--secondary-bg);
    border: 1px solid var(--hint-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Фото превью */
.photo-preview {
    position: relative;
    margin-bottom: 16px;
    border-radius: 16px;
    overflow: hidden;
}

.photo-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

.remove-photo-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
}

/* Экран Б: Корзина */
.sheet-screen {
    animation: fadeIn 0.3s ease;
}

.sheet-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.sheet-actions .back-button {
    flex: 0 0 auto;
    padding: 16px 24px;
    background: var(--secondary-bg);
    color: var(--text-color);
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.sheet-actions .main-button {
    flex: 1;
    margin-top: 0;
}

.secondary-button {
    background: var(--secondary-bg);
    color: var(--text-color);
    border: none;
    padding: 14px 24px;
    border-radius: 20px;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
}

/* Карточка продукта */
.product-card {
    background: var(--secondary-bg);
    border-radius: 20px;
    padding: 16px;
    padding-bottom: 50px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.product-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.product-row.inline {
    display: flex;
    gap: 8px;
}

.name-wrap {
    flex: 1;
    min-width: 0;
}

.weight-wrap {
    width: 80px;
    flex-shrink: 0;
}

.product-name {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hint-color);
    border-radius: 12px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
}

.product-weight {
    width: 100%;
    padding: 10px 8px;
    border: 1px solid var(--hint-color);
    border-radius: 12px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    text-align: center;
}

.weight-input-wrap {
    width: 80px;
    flex-shrink: 0;
}

.weight-wrap {
    width: 80px;
    flex-shrink: 0;
}

.weight-label {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hint-color);
    font-size: 12px;
    pointer-events: none;
}

.product-row {
    position: relative;
}

.processing-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--hint-color);
    border-radius: 12px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 12px;
}

.kbju-toggle {
    background: none;
    border: none;
    color: var(--button-color);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
}

.kbju-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.kbju-field-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kbju-label {
    font-size: 10px;
    color: var(--hint-color);
    margin-top: 2px;
}

.kbju-field {
    width: 100%;
    padding: 8px 4px;
    border: 1px solid var(--hint-color);
    border-radius: 12px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 13px;
    text-align: center;
    text-align: center;
}

.kbju-field::placeholder {
    color: var(--hint-color);
}

.product-delete {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--danger-color);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    line-height: 1;
}

/* Source: app/css/features/meal-draft/core.css */
/* ========== Unified meal entry refinements ========== */

.meal-action {
    border-radius: 100vmax;
    margin: 8px 0 18px;
    overflow: hidden;
}

.add-food-button {
    display: flex;
    align-items: center;
    border-radius: 100vmax;
    clip-path: inset(0 round 100vmax);
    gap: 12px;
    isolation: isolate;
    overflow: hidden;
    position: relative;
    text-align: left;
    padding: 14px 16px;
    margin-top: 0;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.add-food-button::before,
.add-food-button::after {
    border-radius: inherit;
    content: '';
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.add-food-button::before {
    z-index: -1;
}

.add-food-button::after {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -8px 14px color-mix(in srgb, var(--button-color) 12%, transparent);
    z-index: 0;
}

.add-food-button > * {
    position: relative;
    z-index: 1;
}

.add-food-button strong,
.add-food-button small {
    display: block;
}

.add-food-button small {
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
}

.action-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    font-size: 24px;
    line-height: 1;
    flex: 0 0 auto;
}

.sheet-header p {
    margin: 6px 0 0;
    color: var(--hint-color);
    font-size: 13px;
    line-height: 1.35;
}

.entry-methods {
    display: grid;
    gap: 10px;
}

.entry-method {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    background: var(--secondary-bg);
    color: var(--text-color);
    border-radius: 14px;
    padding: 14px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.entry-method:active {
    border-color: var(--button-color);
}

.entry-method strong,
.entry-method small {
    display: block;
}

.entry-method small {
    color: var(--hint-color);
    font-size: 12px;
    margin-top: 2px;
}

.method-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--button-color);
    flex: 0 0 auto;
    font-size: 20px;
}

.method-icon svg {
    display: block;
    height: 24px;
    width: 24px;
}

.draft-photo-preview {
    overflow: hidden;
    border-radius: 14px;
    background: var(--secondary-bg);
    aspect-ratio: 4 / 3;
    margin-bottom: 12px;
    position: relative;
}

.draft-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.draft-photo-preview.is-processing img {
    filter: blur(2px);
    opacity: 0.62;
    transform: scale(1.02);
}

.photo-processing-overlay {
    align-items: center;
    background: color-mix(in srgb, var(--bg-color) 34%, transparent);
    display: none;
    inset: 0;
    justify-content: center;
    position: absolute;
    z-index: 2;
}

.draft-photo-preview.is-processing .photo-processing-overlay {
    display: flex;
}

.photo-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    min-height: 114px;
    position: relative;
}

.photo-actions .main-button,
.photo-actions .secondary-button {
    margin-top: 0;
    width: 100%;
}

.photo-actions #btn-analyze-photo,
.photo-actions #btn-change-photo {
    transition:
        border-radius 0.22s ease,
        opacity 0.18s ease,
        transform 0.22s ease;
}

.photo-actions #btn-analyze-photo {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 50px;
}

.photo-analyze-loader {
    align-items: center;
    background: color-mix(in srgb, var(--button-color) 78%, #101828 22%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    display: inline-flex;
    height: 92px;
    justify-content: center;
    overflow: visible;
    position: relative;
    width: 92px;
}

.photo-analyze-text {
    display: inline-block;
}

.photo-actions #btn-analyze-photo.is-loading .photo-analyze-text {
    animation: shine 1.5s infinite linear;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.52), #ffffff, rgba(255, 255, 255, 0.52));
    background-clip: text;
    background-size: 200%;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.photo-analyze-loader-inner {
    height: 72px;
    position: relative;
    width: 72px;
}

.photo-analyze-loader-line-wrap {
    animation: photoAnalyzeSpin 2000ms cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
    box-sizing: border-box;
    height: 72px;
    left: 0;
    overflow: visible;
    position: absolute;
    top: 0;
    transform-origin: 50% 50%;
    width: 72px;
}

.photo-analyze-loader-line {
    border: 3px solid transparent;
    border-radius: 100%;
    box-sizing: border-box;
    left: 0;
    margin: 0 auto;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.photo-analyze-loader-line-wrap:nth-child(1) {
    animation-delay: -50ms;
}

.photo-analyze-loader-line-wrap:nth-child(2) {
    animation-delay: -100ms;
}

.photo-analyze-loader-line-wrap:nth-child(3) {
    animation-delay: -150ms;
}

.photo-analyze-loader-line-wrap:nth-child(4) {
    animation-delay: -200ms;
}

.photo-analyze-loader-line-wrap:nth-child(5) {
    animation-delay: -250ms;
}

.photo-analyze-loader-line-wrap:nth-child(1) .photo-analyze-loader-line {
    border-left-color: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(255, 255, 255, 0.95);
    height: 64px;
    width: 64px;
}

.photo-analyze-loader-line-wrap:nth-child(2) .photo-analyze-loader-line {
    border-left-color: rgba(255, 255, 255, 0.78);
    border-top-color: rgba(255, 255, 255, 0.78);
    height: 54px;
    width: 54px;
}

.photo-analyze-loader-line-wrap:nth-child(3) .photo-analyze-loader-line {
    border-left-color: rgba(255, 255, 255, 0.6);
    border-top-color: rgba(255, 255, 255, 0.6);
    height: 44px;
    width: 44px;
}

.photo-analyze-loader-line-wrap:nth-child(4) .photo-analyze-loader-line {
    border-left-color: rgba(255, 255, 255, 0.44);
    border-top-color: rgba(255, 255, 255, 0.44);
    height: 34px;
    width: 34px;
}

.photo-analyze-loader-line-wrap:nth-child(5) .photo-analyze-loader-line {
    border-left-color: rgba(255, 255, 255, 0.32);
    border-top-color: rgba(255, 255, 255, 0.32);
    height: 24px;
    width: 24px;
}

@keyframes photoAnalyzeSpin {
    0%,
    15% {
        transform: rotate(0);
    }

    100% {
        transform: rotate(360deg);
    }
}

.photo-actions #btn-change-photo {
    transition: opacity 0.18s ease, transform 0.22s ease;
}

.photo-actions.is-analyzing #btn-analyze-photo {
    border-radius: 20px;
    min-height: 68px;
    transform: translateY(33px);
}

.photo-actions.is-analyzing #btn-change-photo {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-33px) scale(0.98);
}

.editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.draft-total {
    min-width: 76px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--secondary-bg);
    text-align: center;
}

.draft-total strong,
.draft-total span {
    display: block;
}

.draft-total strong {
    color: var(--button-color);
    font-size: 20px;
    line-height: 1;
}

.draft-total span {
    color: var(--hint-color);
    font-size: 11px;
    margin-top: 2px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 10px;
}

.editor-toolbar-hint {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.35;
    margin: 4px 0 0;
}

.editor-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin: -2px 0 10px;
}

.icon-text-button {
    border: none;
    background: transparent;
    color: var(--button-color);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 0;
    cursor: pointer;
}

.icon-text-button:disabled {
    color: var(--hint-color);
    cursor: default;
    opacity: 0.8;
}

.product-add-block {
    margin: 10px 0 14px;
}

.add-product-button {
    align-items: center;
    background: var(--secondary-bg);
    border: 1px dashed rgba(36, 129, 204, 0.45);
    border-radius: 12px;
    color: var(--button-color);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    justify-content: center;
    min-height: 46px;
    padding: 12px;
    width: 100%;
}

.add-product-button:disabled {
    border-color: var(--border-color);
    color: var(--hint-color);
    cursor: default;
    opacity: 0.85;
}

.product-card {
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: none;
    overflow: hidden;
}

.product-card-loading {
    border: 1px dashed rgba(36, 129, 204, 0.45);
    background:
        linear-gradient(90deg, rgba(36, 129, 204, 0.08), transparent 45%, rgba(36, 129, 204, 0.08)),
        var(--secondary-bg);
}

.shimmer-text {
    background: linear-gradient(90deg, var(--hint-color), var(--button-color), var(--hint-color));
    background-clip: text;
    background-size: 200%;
    color: transparent;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    -webkit-background-clip: text;
    animation: shine 1.5s infinite linear;
}

@keyframes shine {
    from {
        background-position: 200% center;
    }

    to {
        background-position: -200% center;
    }
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.product-card .product-delete {
    position: static;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--danger-color) 16%, transparent);
    color: var(--danger-color);
    flex: 0 0 auto;
}

.scan-loading-badge {
    align-items: center;
    background: rgba(36, 129, 204, 0.12);
    border-radius: 999px;
    color: var(--button-color);
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    height: 24px;
    justify-content: center;
    letter-spacing: 0.02em;
    padding: 0 9px;
}

.scan-loading-content {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 32px 1fr;
    min-height: 58px;
}

.scan-loading-content strong,
.scan-loading-content p {
    display: block;
}

.scan-loading-content strong {
    font-size: 15px;
    line-height: 1.2;
}

.scan-loading-content p {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.35;
    margin: 4px 0 0;
}

.scan-loading-spinner {
    border: 3px solid rgba(36, 129, 204, 0.16);
    border-radius: 50%;
    border-top-color: var(--button-color);
    height: 28px;
    width: 28px;
    animation: scanLoadingSpin 0.8s linear infinite;
}

@keyframes scanLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

.nutrition-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 10px;
}

.kbju-autofill {
    display: grid;
    gap: 5px;
    margin: 2px 0 12px;
}

.kbju-autofill-button {
    align-items: center;
    align-self: start;
    background: color-mix(in srgb, var(--button-color) 10%, var(--surface-input));
    border: 1px solid color-mix(in srgb, var(--button-color) 35%, var(--surface-border));
    border-radius: 999px;
    box-shadow: 0 8px 18px -14px color-mix(in srgb, var(--button-color) 45%, transparent);
    color: var(--button-color);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    gap: 7px;
    min-height: 38px;
    padding: 0 14px;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        opacity 0.18s ease,
        transform 0.18s ease;
}

.kbju-autofill-button:active:not(:disabled) {
    transform: scale(0.98);
}

.kbju-autofill-button:disabled {
    cursor: default;
    opacity: 0.52;
    transform: none;
}

.product-card-kbju-loading .kbju-autofill-button {
    opacity: 0.76;
}

.product-card-kbju-loading {
    border: 1px solid color-mix(in srgb, var(--button-color) 38%, var(--surface-border));
    box-shadow:
        0 12px 32px -24px color-mix(in srgb, var(--button-color) 42%, transparent),
        inset 0 0 0 1px color-mix(in srgb, var(--button-color) 16%, transparent);
    cursor: progress;
    isolation: isolate;
    outline: 1px solid color-mix(in srgb, var(--button-color) 18%, transparent);
    outline-offset: -2px;
}

.product-card-kbju-loading > * {
    filter: blur(3.5px);
    opacity: 0.42;
}

.product-card-kbju-loading::before,
.product-card-kbju-loading::after {
    position: absolute;
}

.product-card-kbju-loading::before {
    background: color-mix(in srgb, var(--bg-color) 70%, transparent);
    border-radius: inherit;
    content: '';
    inset: 2px;
    pointer-events: auto;
    z-index: 6;
}

.product-card-kbju-loading::after {
    align-items: center;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--button-color) 58%, var(--text-color)),
        var(--text-color),
        color-mix(in srgb, var(--button-color) 72%, #ffffff),
        color-mix(in srgb, var(--button-color) 58%, var(--text-color))
    );
    background-clip: text;
    background-size: 220% auto;
    color: transparent;
    content: 'AI заполняет КБЖУ';
    display: inline-flex;
    font-size: 23px;
    font-weight: 900;
    justify-content: center;
    left: 50%;
    line-height: 1.15;
    max-width: calc(100% - 32px);
    pointer-events: none;
    text-align: center;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    z-index: 7;
    -webkit-background-clip: text;
    animation: shine 1.45s infinite linear;
}

.kbju-autofill-icon {
    flex: 0 0 auto;
    height: 17px;
    width: 17px;
}

.kbju-autofill-helper {
    color: var(--hint-color);
    font-size: 11px;
    line-height: 1.35;
    margin: 0;
}

.product-calories {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hint-color);
    border-radius: 12px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
}

.nutrition-row .kbju-toggle {
    align-items: center;
    align-self: end;
    background: color-mix(in srgb, var(--button-color) 10%, var(--bg-color));
    border: 1px solid color-mix(in srgb, var(--button-color) 36%, var(--surface-border));
    color: var(--button-color);
    display: inline-flex;
    gap: 5px;
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    margin: 0;
    box-shadow: 0 8px 18px -16px color-mix(in srgb, var(--button-color) 45%, transparent);
    cursor: pointer;
    font-weight: 800;
    white-space: nowrap;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.nutrition-row .kbju-toggle:active {
    transform: scale(0.98);
}

.product-card.kbju-open .kbju-toggle {
    background: color-mix(in srgb, var(--button-color) 18%, var(--bg-color));
    border-color: var(--button-color);
    color: var(--button-color);
}

.kbju-panel {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 10px;
    margin-bottom: 0;
}

/* Source: app/css/components/surfaces.css */
/* ========== Surface hierarchy for forms and modals ========== */
.register-content,
.sheet-content,
.meal-detail-panel {
    background: var(--surface-modal);
    border: 1px solid var(--surface-border);
    box-shadow: 0 18px 42px -28px var(--surface-shadow);
}

.register-content {
    border-radius: 24px;
    padding: 16px;
}

.sheet-content,
.meal-detail-panel {
    border-bottom: 0;
    box-shadow: 0 -18px 44px -28px var(--surface-shadow);
}

.register-content header,
.profile-edit-header,
.sheet-header {
    background: var(--surface-header);
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    padding: 14px;
}

.meal-detail-panel,
.sheet-content,
.register-content,
.register-content header,
.profile-edit-header,
.sheet-header,
.profile-form-card {
    overflow: hidden;
    position: relative;
}

.sheet-content,
.meal-detail-panel {
    overflow-x: hidden;
    overflow-y: auto;
}

.meal-detail-panel::before,
.sheet-content::before,
.register-content::before,
.register-content header::before,
.profile-edit-header::before,
.sheet-header::before,
.profile-form-card::before {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.20), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 58%);
    border-radius: inherit;
    content: '';
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    z-index: 0;
}

.meal-detail-panel > *,
.sheet-content > *,
.register-content > *,
.register-content header > *,
.profile-edit-header > *,
.sheet-header > *,
.profile-form-card > * {
    position: relative;
    z-index: 1;
}

.profile-form-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    box-shadow: 0 12px 28px -24px var(--surface-shadow);
}

.meal-detail-close,
#register-step-1 .form-group,
.profile-form-card .form-group,
.meal-detail-macros div,
.meal-detail-empty,
.meal-detail-product {
    background: var(--surface-input);
    border: 1px solid var(--surface-border);
}

.form-group input,
.form-group select {
    background: var(--surface-input);
    border-color: var(--surface-strong-border);
}

#register-step-1 .form-group input,
#register-step-1 .form-group select,
.profile-form-card .form-group input,
.profile-form-card .form-group select {
    background: transparent;
    border-color: transparent;
}

.product-name,
.product-weight,
.processing-select,
.kbju-field,
.product-calories {
    background: var(--bg-color);
    border-color: var(--hint-color);
}

@supports not (color: color-mix(in srgb, red 10%, transparent)) {
    .product-card .product-delete {
        background: rgba(255, 59, 48, 0.14);
    }
}

/* Source: app/css/features/meal-draft/photo.css */
/* Current meal draft */

.meal-draft-page {
    min-height: 100vh;
    min-height: var(--tg-viewport-height);
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.meal-photo-hero {
    background: var(--soft-accent-bg);
    min-height: 310px;
    padding: calc(16px + max(env(safe-area-inset-top), var(--tg-safe-area-top), var(--tg-content-safe-area-top))) 18px 38px;
    position: relative;
}

.meal-main-product-hero {
    min-height: 354px;
    overflow: hidden;
}

.meal-draft-topbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto 22px;
    max-width: 430px;
    position: relative;
    z-index: 2;
}

.meal-draft-icon-button {
    -webkit-appearance: none;
    align-items: center;
    appearance: none;
    background: rgba(255, 255, 255, .72);
    border: 0;
    border-radius: 999px;
    color: var(--black);
    cursor: pointer;
    display: flex;
    height: 38px;
    justify-content: center;
    padding: 0;
    width: 38px;
}

.meal-draft-icon-button svg {
    height: 22px;
    width: 22px;
}

.meal-draft-icon-button.is-active {
    background: var(--black);
    color: #ffffff;
}

.meal-main-product-visual {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 430px;
    min-height: 235px;
}

.meal-photo-upload-input {
    height: 1px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 1px;
}

.meal-photo-upload {
    align-items: center;
    background: rgba(255, 255, 255, .46);
    border: 1px dashed rgba(17, 17, 17, .16);
    border-radius: 30px;
    color: var(--black);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 214px;
    padding: 24px;
    text-align: center;
    width: min(100%, 340px);
}

.meal-photo-upload-icon {
    align-items: center;
    background: var(--black);
    border-radius: 999px;
    color: #ffffff;
    display: flex;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.meal-photo-upload-icon svg {
    height: 28px;
    width: 28px;
}

.meal-photo-upload strong {
    font-size: 18px;
    font-weight: 760;
    line-height: 1.15;
}

.meal-photo-upload small {
    color: color-mix(in srgb, var(--black) 58%, transparent);
    font-size: 13px;
    line-height: 1.35;
    max-width: 245px;
}

.meal-dish-photo {
    height: 250px;
    position: relative;
    width: min(100%, 340px);
}

.meal-dish-plate {
    background:
        radial-gradient(circle at 50% 52%, #f8faf1 0 53%, #e6eadf 54% 58%, #ffffff 59% 100%);
    border-radius: 50%;
    box-shadow: 0 18px 34px rgba(40, 70, 20, .16);
    display: block;
    height: 238px;
    left: 50%;
    position: absolute;
    top: 6px;
    transform: translateX(-50%);
    width: 238px;
}

.meal-dish-salad {
    background:
        radial-gradient(circle at 24% 35%, #79b94a 0 9%, transparent 10%),
        radial-gradient(circle at 72% 28%, #8bc75c 0 12%, transparent 13%),
        radial-gradient(circle at 36% 70%, #6cab3d 0 12%, transparent 13%),
        radial-gradient(circle at 68% 72%, #7fb74f 0 11%, transparent 12%),
        #bfdc75;
    border-radius: 50%;
    height: 178px;
    left: 30px;
    position: absolute;
    top: 30px;
    width: 178px;
}

.meal-dish-chicken {
    background: linear-gradient(135deg, #f5b06a, #fff4dc 62%, #d27d38);
    border-radius: 999px;
    box-shadow:
        inset 10px 0 0 rgba(86, 48, 20, .12),
        inset -8px 0 0 rgba(86, 48, 20, .1);
    height: 34px;
    position: absolute;
    width: 92px;
}

.meal-dish-chicken::before,
.meal-dish-chicken::after {
    background: rgba(35, 22, 14, .72);
    border-radius: 999px;
    content: "";
    height: 3px;
    position: absolute;
    top: 11px;
    transform: rotate(19deg);
    width: 74px;
}

.meal-dish-chicken::after {
    top: 22px;
}

.chicken-a {
    left: 73px;
    top: 82px;
    transform: rotate(25deg);
}

.chicken-b {
    left: 80px;
    top: 124px;
    transform: rotate(-13deg);
}

.meal-dish-tomato {
    background: radial-gradient(circle at 40% 35%, #ffb548 0 12%, #f2552b 13% 100%);
    border-radius: 50%;
    height: 36px;
    position: absolute;
    width: 36px;
}

.tomato-a {
    left: 46px;
    top: 64px;
}

.tomato-b {
    right: 44px;
    top: 58px;
}

.meal-dish-leaf {
    background: linear-gradient(135deg, #66a638, #b4d96e);
    border-radius: 100% 0 100% 0;
    height: 92px;
    opacity: .92;
    position: absolute;
    width: 54px;
}

.leaf-left {
    left: 2px;
    top: 84px;
    transform: rotate(-72deg);
}

.leaf-right {
    bottom: 4px;
    right: 0;
    transform: rotate(31deg);
}

.meal-photo-empty,
.meal-photo-preview {
    margin: 0 auto;
    max-width: 430px;
}

.meal-main-product-hero.has-photo {
    background: var(--black);
}

.meal-main-product-hero.has-photo .meal-photo-preview {
    inset: 0;
    margin: 0;
    max-width: none;
    position: absolute;
    z-index: 0;
}

.meal-photo-empty {
    align-items: center;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.meal-photo-icon {
    align-items: center;
    background: var(--black);
    border-radius: 24px;
    color: #ffffff;
    display: flex;
    height: 64px;
    justify-content: center;
    margin-bottom: 14px;
    width: 64px;
}

.meal-photo-icon svg {
    height: 32px;
    width: 32px;
}

.meal-photo-empty h1 {
    color: var(--black);
    font-size: 22px;
    font-weight: 760;
    line-height: 1.14;
    margin: 0 0 7px;
}

.meal-photo-empty p {
    color: color-mix(in srgb, var(--black) 62%, transparent);
    font-size: 13px;
    line-height: 1.36;
    margin: 0;
    max-width: 280px;
}

.meal-photo-empty-actions,
.meal-photo-preview-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.meal-photo-action,
.meal-photo-preview-actions button {
    -webkit-appearance: none;
    appearance: none;
    background: var(--black);
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 12px 14px;
}

.meal-photo-action.secondary,
.meal-photo-preview-actions button:last-child {
    background: rgba(255, 255, 255, .72);
    color: var(--black);
}

#draft-remove-photo-button {
    background: #F3D9D5;
    color: #A83F36;
}

.meal-photo-card {
    align-items: flex-end;
    aspect-ratio: 1.45;
    background: var(--card-soft);
    border-radius: 28px;
    color: var(--text-color);
    display: flex;
    font-size: 13px;
    font-weight: 720;
    justify-content: flex-start;
    overflow: hidden;
    padding: 16px;
    position: relative;
}

.meal-photo-card img {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

.meal-photo-card span {
    background: rgba(255, 255, 255, .78);
    border-radius: 999px;
    color: var(--black);
    padding: 8px 12px;
    position: relative;
    z-index: 1;
}

.meal-main-product-hero.has-photo .meal-photo-card {
    aspect-ratio: auto;
    border-radius: 0;
    height: 100%;
    padding: 0;
    width: 100%;
}

.meal-main-product-hero.has-photo .meal-photo-card::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, .22), transparent 34%, rgba(0, 0, 0, .18));
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.meal-main-product-hero.has-photo .meal-photo-card span,
.meal-main-product-hero.has-photo .meal-photo-dots {
    display: none;
}

.meal-main-product-hero.has-photo .meal-photo-preview-actions {
    bottom: 44px;
    justify-content: center;
    left: 18px;
    margin: 0;
    position: absolute;
    right: 18px;
    z-index: 2;
}

.meal-photo-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}

.meal-photo-dots span {
    background: rgba(17, 17, 17, .18);
    border-radius: 999px;
    height: 6px;
    width: 6px;
}

.meal-photo-dots .active {
    background: var(--black);
    width: 18px;
}

.meal-photo-preview-actions {
    justify-content: center;
    margin-top: 12px;
}

/* Source: app/css/features/meal-draft/main-product.css */
.meal-draft-card {
    background: var(--secondary-bg);
    border-radius: 30px 30px 0 0;
    margin: -24px auto 0;
    max-width: 430px;
    min-height: 420px;
    padding: 18px;
    position: relative;
    z-index: 2;
}

.meal-draft-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.meal-draft-header p {
    color: var(--hint-color);
    font-size: 12px;
    line-height: 1.2;
    margin: 0 0 3px;
}

.meal-draft-header h2 {
    color: var(--text-color);
    font-size: 21px;
    font-weight: 760;
    line-height: 1.1;
    margin: 0;
}

.meal-draft-header strong {
    color: var(--text-color);
    flex: 0 0 auto;
    font-size: 18px;
    font-weight: 760;
    line-height: 1.1;
}

.draft-nutrition-summary {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 5px;
}

.draft-kbju-caption {
    color: var(--hint-color);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    margin: 8px 0 0;
}

.draft-main-product-form .draft-kbju-caption {
    margin-top: 2px;
}

.draft-nutrition-summary div {
    background: var(--card-soft);
    border-radius: 16px;
    min-width: 0;
    padding: 9px 7px;
    text-align: center;
}

.draft-nutrition-summary strong {
    color: var(--text-color);
    display: block;
    font-size: 14px;
    font-weight: 760;
    line-height: 1.05;
}

.draft-nutrition-summary span {
    color: var(--hint-color);
    display: block;
    font-size: 10px;
    line-height: 1.2;
    margin-top: 4px;
}

.draft-main-product-form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.draft-main-form-grid,
.draft-main-kbju-grid {
    display: grid;
    gap: 8px;
}

.draft-main-form-grid {
    grid-template-columns: 1fr;
}

.draft-main-portion-row {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.draft-main-weight-field {
    min-width: 0;
}

.draft-main-portions > span {
    color: var(--hint-color);
    display: block;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    margin-bottom: 5px;
}

.draft-portion-stepper {
    align-items: center;
    background: var(--card-soft);
    border-radius: 16px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    min-height: 44px;
    overflow: hidden;
}

.draft-portion-stepper button {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--button-color);
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    height: 44px;
    padding: 0;
}

.draft-portion-stepper output {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 760;
    text-align: center;
}

.draft-main-kbju-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.draft-main-field.wide {
    grid-column: 1 / -1;
}

.draft-main-field span {
    color: var(--hint-color);
    display: block;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    margin-bottom: 5px;
}

.draft-main-field input {
    -webkit-appearance: none;
    appearance: none;
    background: var(--card-soft);
    border: 0;
    border-radius: 16px;
    color: var(--text-color);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    min-height: 44px;
    padding: 11px 12px;
    width: 100%;
}

.draft-main-form-grid .draft-main-field:not(.wide) input,
.draft-main-kbju-grid input {
    text-align: center;
}

.draft-main-autofill {
    -webkit-appearance: none;
    appearance: none;
    background: color-mix(in srgb, var(--button-color) 12%, var(--secondary-bg));
    border: 0;
    border-radius: 18px;
    color: var(--button-color);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 760;
    line-height: 1.2;
    animation: draft-main-ai-enter .28s ease both;
    margin: 0 0 8px;
    min-height: 44px;
    padding: 12px;
    width: 100%;
}

.draft-main-autofill[hidden] {
    display: none;
}

@keyframes draft-main-ai-enter {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.draft-add-row {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 52px;
    margin-top: 12px;
}

.draft-form-row,
.draft-link-row {
    align-items: center;
    background: var(--card-soft);
    border-radius: 18px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 8px;
    min-height: 46px;
    padding: 12px;
}

.draft-form-row span,
.draft-link-row span {
    color: var(--hint-color);
    font-size: 12px;
    font-weight: 650;
}

.draft-form-row select {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--text-color);
    font: inherit;
    font-size: 13px;
    font-weight: 720;
    text-align: right;
}

.draft-link-row {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    width: 100%;
}

.draft-link-row strong {
    color: var(--button-color);
    font-size: 13px;
    font-weight: 720;
}

.draft-products-section {
    margin-top: 16px;
}

.draft-section-title {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 9px;
}

.draft-section-title h3 {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 740;
    line-height: 1.2;
    margin: 0;
}

.draft-section-title span {
    color: var(--hint-color);
    font-size: 12px;
    font-weight: 650;
}

.draft-products-list {
    display: grid;
    gap: 8px;
}

.draft-add-product-choice {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.draft-add-product-toggle {
    -webkit-appearance: none;
    appearance: none;
    align-items: center;
    background: var(--card-soft);
    border: 0;
    border-radius: 20px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 11px;
    justify-content: space-between;
    min-height: 58px;
    padding: 13px 14px;
    text-align: left;
    width: 100%;
}

.draft-add-product-toggle:disabled {
    cursor: default;
    opacity: .62;
}

.draft-add-product-icon {
    align-items: center;
    background: color-mix(in srgb, var(--button-color) 14%, var(--secondary-bg));
    border-radius: 14px;
    color: var(--button-color);
    display: flex;
    flex: 0 0 36px;
    font-size: 24px;
    font-weight: 450;
    height: 36px;
    justify-content: center;
    line-height: 1;
    width: 36px;
}

.draft-add-product-toggle:disabled .draft-add-product-icon {
    background: var(--secondary-bg);
    color: var(--hint-color);
}

.draft-add-product-copy {
    display: block;
    min-width: 0;
}

.draft-add-product-copy strong {
    color: var(--text-color);
    display: block;
    font-size: 14px;
    font-weight: 760;
    line-height: 1.15;
}

.draft-add-product-copy small {
    color: var(--hint-color);
    display: block;
    font-size: 11px;
    line-height: 1.25;
    margin-top: 4px;
}

/* Source: app/css/features/meal-draft/product-editor.css */
.meal-draft-card .product-card {
    background: var(--card-soft);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.meal-draft-card .product-card + .product-card {
    margin-top: 0;
}

.meal-draft-card .product-card-header {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto 30px;
}

.meal-draft-card .input-label,
.meal-draft-card .field-label {
    color: var(--hint-color);
    display: block;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    margin: 0 0 5px;
}

.draft-product-card-total {
    color: var(--text-color);
    font-size: 12px;
    font-weight: 740;
    line-height: 1;
    white-space: nowrap;
}

.meal-draft-card .product-delete {
    -webkit-appearance: none;
    align-items: center;
    appearance: none;
    background: color-mix(in srgb, #D94B3D 10%, transparent);
    border: 0;
    border-radius: 10px;
    color: #D94B3D;
    cursor: pointer;
    display: none;
    height: 32px;
    justify-content: center;
    line-height: 1;
    padding: 7px;
    width: 32px;
}

.draft-product-card.is-open .product-delete {
    display: flex;
}

.meal-draft-card .product-delete svg {
    display: block;
    height: 18px;
    width: 18px;
}

.meal-draft-card .product-row {
    align-items: flex-start;
    display: flex;
    gap: 8px;
}

.meal-draft-card .name-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.meal-draft-card .weight-wrap {
    width: 100%;
}

.draft-product-base-row {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.draft-kbju-toggle-wrap {
    min-width: 88px;
}

.meal-draft-page input[type="number"] {
    -moz-appearance: textfield;
}

.meal-draft-page input[type="number"]::-webkit-inner-spin-button,
.meal-draft-page input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.meal-draft-card .product-name,
.meal-draft-card .product-weight,
.meal-draft-card .processing-select,
.meal-draft-card .product-calories,
.meal-draft-card .kbju-field {
    -webkit-appearance: none;
    appearance: none;
    background: var(--secondary-bg);
    border: 0;
    border-radius: 14px;
    color: var(--text-color);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    min-height: 40px;
    padding: 10px 11px;
    width: 100%;
}

.meal-draft-card .product-weight,
.meal-draft-card .kbju-field {
    text-align: left;
}

.meal-draft-card .processing-select {
    background: transparent;
    color: var(--text-color);
    margin: 0;
    min-height: 0;
    padding: 0 22px 0 8px;
    text-align: right;
    width: min(190px, 58%);
}

.draft-processing-row {
    align-items: center;
    background: var(--secondary-bg);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    min-height: 42px;
    padding: 10px 11px;
    position: relative;
}

.draft-processing-row::after {
    border-right: 1.5px solid var(--hint-color);
    border-top: 1.5px solid var(--hint-color);
    content: "";
    height: 7px;
    pointer-events: none;
    position: absolute;
    right: 12px;
    transform: rotate(45deg);
    width: 7px;
}

.draft-processing-row > span {
    color: var(--text-color);
    font-size: 12px;
    font-weight: 650;
}

.meal-draft-card .kbju-autofill {
    display: block;
}

.meal-draft-card .kbju-autofill-button {
    -webkit-appearance: none;
    align-items: center;
    appearance: none;
    background: var(--secondary-bg);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 12px;
    font-weight: 680;
    gap: 7px;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    width: 100%;
}

.meal-draft-card .kbju-autofill-button:disabled {
    cursor: default;
    opacity: .48;
}

.meal-draft-card .kbju-autofill-button[hidden] {
    display: none;
}

.meal-draft-card .kbju-autofill-icon {
    flex: 0 0 auto;
    height: 16px;
    width: 16px;
}

.meal-draft-card .kbju-toggle {
    -webkit-appearance: none;
    align-items: center;
    appearance: none;
    background: var(--secondary-bg);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    color: var(--hint-color);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    gap: 5px;
    justify-content: center;
    justify-self: start;
    min-height: 40px;
    padding: 0 10px;
    white-space: nowrap;
    width: 100%;
}

.meal-draft-card .product-card.kbju-open .kbju-toggle {
    background: var(--secondary-bg);
    color: var(--hint-color);
}

.meal-draft-card .kbju-panel {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meal-draft-card .kbju-panel.hidden {
    display: none;
}

.meal-draft-card .kbju-field-wrap {
    align-items: stretch;
    display: flex;
    flex-direction: column;
}

.meal-draft-card .kbju-label {
    color: var(--hint-color);
    font-size: 10px;
    line-height: 1;
    margin: 0 0 5px;
}

.draft-product-card {
    background: var(--card-soft);
    border-radius: 20px;
    overflow: hidden;
}

.draft-product-head {
    align-items: center;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-right: 8px;
}

.draft-product-summary {
    -webkit-appearance: none;
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 10px;
    grid-template-columns: 42px minmax(0, 1fr) auto 20px;
    padding: 10px;
    text-align: left;
    width: 100%;
}

.draft-product-thumb {
    align-items: center;
    background: var(--secondary-bg);
    border-radius: 15px;
    color: var(--button-color);
    display: flex;
    font-size: 16px;
    font-weight: 760;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.draft-product-thumb img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.draft-product-main {
    min-width: 0;
}

.draft-product-main strong {
    color: var(--text-color);
    display: block;
    font-size: 14px;
    font-weight: 740;
    line-height: 1.15;
    margin-bottom: 4px;
}

.draft-product-calories {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 740;
    white-space: nowrap;
}

.draft-product-chevron {
    color: var(--hint-color);
    height: 20px;
    transition: transform .22s ease;
    width: 20px;
}

.draft-product-card.is-open .draft-product-chevron {
    display: none;
}

.draft-product-card.is-open .draft-product-summary {
    grid-template-columns: 42px minmax(0, 1fr) auto;
}

.draft-product-editor {
    display: grid;
    gap: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 10px;
    transform: translateY(-4px);
    transition: max-height .28s ease, opacity .18s ease, padding .24s ease, transform .22s ease;
}

.draft-product-card.is-open .draft-product-editor {
    max-height: 620px;
    opacity: 1;
    padding: 2px 12px 12px;
    transform: translateY(0);
}

.draft-product-editor-actions {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.draft-product-editor-actions button,
.draft-product-actions button,
.draft-bottom-actions button {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.draft-product-editor-actions button {
    background: var(--secondary-bg);
    border-radius: 14px;
    color: var(--button-color);
    font-size: 12px;
    font-weight: 700;
    padding: 11px 9px;
}

.draft-product-editor-actions .danger {
    color: #D94B3D;
}

.draft-product-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    margin-top: 10px;
}

.draft-secondary-action,
.draft-primary-action {
    border-radius: 16px;
    font-size: 13px;
    font-weight: 720;
    line-height: 1;
    min-height: 44px;
    padding: 12px;
}

.draft-secondary-action {
    background: var(--card-soft);
    color: var(--button-color);
}

.draft-secondary-action:disabled {
    color: var(--hint-color);
    opacity: .55;
}

.draft-primary-action {
    background: var(--button-color);
    color: var(--button-text);
}

.draft-bottom-actions {
    background: color-mix(in srgb, var(--page-bg) 78%, transparent);
    bottom: 0;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 64px;
    left: 50%;
    max-width: 430px;
    padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
    position: fixed;
    transform: translateX(-50%);
    width: 100%;
    z-index: 80;
}

/* Source: app/css/features/meal-draft/actions.css */
.draft-meal-picker {
    align-items: center;
    background: var(--button-color);
    border-radius: 18px;
    color: var(--button-text);
    display: flex;
    height: 52px;
    justify-content: center;
    position: relative;
    width: 52px;
}

.draft-meal-picker label {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.draft-meal-picker select {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 18px;
    color: transparent;
    cursor: pointer;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
    z-index: 2;
}

.draft-other-meal-chevron {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    height: 7px;
    pointer-events: none;
    transform: translateY(-2px) rotate(45deg);
    width: 7px;
}

.draft-cancel-button,
.draft-save-button {
    border-radius: 18px;
    font-size: 14px;
    font-weight: 740;
    line-height: 1;
    min-height: 52px;
    padding: 14px;
}

.draft-cancel-button {
    background: var(--secondary-bg);
    color: var(--text-color);
}

.draft-save-button {
    -webkit-appearance: none;
    appearance: none;
    background: var(--strong-accent);
    border: 0;
    color: var(--button-text);
    width: 100%;
}

.draft-save-button:disabled {
    background: var(--card-soft);
    color: var(--hint-color);
}

/* Source: app/css/features/meal-draft/shell.css */
/* Production full-screen draft shell */
#bottom-sheet.bottom-sheet {
    --black: #111111;
    --button-color: #69c52f;
    --card-soft: #f8faf1;
    --soft-accent-bg: #d6f78a;
    --strong-accent: #111111;
    background: var(--bg-color);
    display: block;
    overflow: hidden;
}

#bottom-sheet .sheet-overlay {
    display: none;
}

#bottom-sheet .sheet-content {
    animation: mealDraftEnter .24s ease;
    background: var(--bg-color);
    border-radius: 0;
    height: 100vh;
    height: var(--tg-viewport-height);
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
}

#bottom-sheet #sheet-screen-editor {
    animation: none;
    min-height: 100%;
}

#bottom-sheet .meal-draft-card {
    background: #ffffff;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

#bottom-sheet .meal-photo-preview {
    height: 100%;
}

#bottom-sheet .meal-photo-card {
    height: 100%;
}

#bottom-sheet .photo-processing-overlay {
    z-index: 3;
}

#bottom-sheet .meal-draft-topbar {
    pointer-events: none;
}

:root.is-telegram-webapp #bottom-sheet .meal-draft-topbar {
    display: none;
}

:root.is-telegram-webapp #bottom-sheet .meal-main-product-hero {
    min-height: 320px;
}

#bottom-sheet .meal-draft-topbar button {
    pointer-events: auto;
}

#bottom-sheet .meal-photo-upload {
    font: inherit;
}

#bottom-sheet .meal-draft-card .product-card {
    background: var(--card-soft);
    border: 0;
    box-shadow: none;
    isolation: auto;
    margin: 0;
    padding: 14px;
}

#bottom-sheet .meal-draft-card .product-card::before,
#bottom-sheet .meal-draft-card .product-card::after{
    background: transparent;
    border: 0;
    box-shadow: none;
    content: none;
    display: none;
}

#bottom-sheet .meal-draft-card .draft-main-product-form {
    background: transparent;
    border-radius: 0;
    display: grid;
    gap: 10px;
    padding: 6px 0 8px;
}

#bottom-sheet .draft-main-product-heading {
    min-width: 0;
}

#bottom-sheet .draft-main-product-heading h2 {
    color: var(--text-color);
    display: block;
    font-size: 21px;
    font-weight: 760;
    line-height: 1.1;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#bottom-sheet .draft-main-product-heading p {
    color: var(--hint-color);
    display: block;
    font-size: 12px;
    line-height: 1.2;
    margin: 3px 0 0;
}

#bottom-sheet .draft-main-total {
    color: var(--text-color);
    flex: 0 0 auto;
    font-size: 18px;
    font-weight: 760;
    line-height: 1.1;
    white-space: nowrap;
}

#bottom-sheet .draft-main-total span {
    color: inherit;
    font: inherit;
    margin-top: 3px;
}

#bottom-sheet .draft-main-product-form .product-card-header {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 2px;
}

#bottom-sheet .draft-main-product-form > .kbju-autofill {
    margin: 0;
}

#bottom-sheet .draft-main-product-form > .kbju-autofill .draft-main-autofill {
    appearance: none;
    background: color-mix(in srgb, var(--button-color) 12%, var(--secondary-bg));
    border: 0;
    border-radius: 18px;
    box-shadow: none;
    color: var(--button-color);
    font-size: 13px;
    font-weight: 760;
    margin: 0;
    min-height: 44px;
    padding: 12px;
    width: 100%;
}

#bottom-sheet .draft-main-product-form > .draft-nutrition-summary {
    margin-top: 0;
}

#bottom-sheet .draft-main-product-form > .draft-main-kbju-grid {
    margin-top: 0;
}

#bottom-sheet .meal-draft-card .product-row.inline {
    margin-bottom: 10px;
}

#bottom-sheet .meal-draft-card .draft-product-card {
    background: var(--card-soft);
    border: 0;
    border-radius: 28px;
    box-shadow: none;
    display: grid;
    gap: 10px;
    overflow: visible;
}

#bottom-sheet .meal-draft-card .draft-product-card > .product-card-header {
    order: 0;
}

#bottom-sheet .meal-draft-card .draft-product-card > .name-wrap {
    order: 1;
}

#bottom-sheet .meal-draft-card .draft-product-card > .kbju-autofill {
    order: 2;
}

#bottom-sheet .meal-draft-card .draft-product-card > .draft-product-base-row {
    order: 3;
}

#bottom-sheet .meal-draft-card .draft-product-card > .kbju-panel {
    order: 4;
}

#bottom-sheet .meal-draft-card .draft-product-card > .draft-processing-row {
    order: 5;
}

#bottom-sheet .meal-draft-card .draft-product-card .product-card-header {
    gap: 10px;
    grid-template-columns: 52px minmax(0, 1fr) auto 40px;
    margin-bottom: 0;
}

#bottom-sheet .meal-draft-card .draft-product-card .product-delete {
    display: flex;
    height: 40px;
    width: 40px;
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-processing-row {
    background: var(--secondary-bg);
}

#bottom-sheet .meal-draft-card .draft-processing-row .processing-select{
    background: transparent;
    box-shadow: none;
}

#bottom-sheet .draft-product-thumb {
    background: var(--secondary-bg);
    border-radius: 18px;
    color: var(--button-color);
    display: grid;
    font-size: 20px;
    font-weight: 760;
    height: 52px;
    overflow: hidden;
    place-items: center;
    width: 52px;
}

#bottom-sheet .draft-product-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

#bottom-sheet .draft-product-name-summary {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 760;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#bottom-sheet .meal-draft-card .name-wrap {
    min-width: 0;
}

#bottom-sheet .meal-draft-card .weight-wrap {
    flex: 0 0 92px;
    width: 92px;
}

#bottom-sheet .meal-draft-card .draft-main-portions {
    margin-bottom: 0;
}

#bottom-sheet .meal-draft-card .draft-portion-stepper {
    max-width: 180px;
}

#bottom-sheet .meal-draft-card .field-label {
    margin-bottom: 5px;
}

#bottom-sheet .meal-draft-card .product-name,
#bottom-sheet .meal-draft-card .product-weight,
#bottom-sheet .meal-draft-card .processing-select,
#bottom-sheet .meal-draft-card .product-calories,
#bottom-sheet .meal-draft-card .kbju-field {
    background: var(--card-soft);
    border: 0;
    border-radius: 16px;
    box-shadow: none;
    min-height: 44px;
    outline: none;
}

#bottom-sheet .meal-draft-card .kbju-autofill-button {
    background: var(--secondary-bg);
    border: 1px solid color-mix(in srgb, var(--button-color) 20%, var(--surface-border));
    box-shadow: none;
    min-height: 46px;
}

#bottom-sheet .meal-draft-card .kbju-autofill-helper {
    color: var(--hint-color);
    font-size: 11px;
    line-height: 1.3;
    margin: 5px 0 0;
}

#bottom-sheet .meal-draft-card .kbju-autofill-button[hidden],
#bottom-sheet .meal-draft-card .kbju-autofill-helper[hidden] {
    display: none;
}

#bottom-sheet .meal-draft-card input:focus,
#bottom-sheet .meal-draft-card select:focus,
#bottom-sheet .meal-draft-card button:focus {
    outline: none;
}

#bottom-sheet .meal-draft-card input:focus-visible,
#bottom-sheet .meal-draft-card select:focus-visible,
#bottom-sheet .meal-draft-card button:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--button-color) 32%, transparent);
}

#bottom-sheet .draft-main-autofill {
    margin-top: 10px;
}

#bottom-sheet .meal-photo-preview-actions button {
    appearance: none;
    background: var(--black);
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 12px 14px;
}

#bottom-sheet #btn-remove-main-photo {
    background: #f3d9d5;
    color: #a83f36;
}

:root[data-app-effective-theme="dark"] #bottom-sheet #btn-remove-main-photo {
    background: #4a2522;
    color: #f3a19a;
}

/* Source: app/css/features/meal-draft/products.css */
/* Additional product cards */
#bottom-sheet .meal-draft-card .draft-product-card{
    background: #f8faf1;
    border: 0;
    border-radius: 28px;
    box-shadow: none;
    filter: none;
    gap: 9px;
    outline: 0;
    padding: 13px;
}

#bottom-sheet .meal-draft-card .draft-product-card::before,
#bottom-sheet .meal-draft-card .draft-product-card::after {
    content: none;
    display: none;
}

#bottom-sheet .meal-draft-card .draft-product-card.product-card-kbju-loading {
    box-shadow: none;
    outline: 0;
}

#bottom-sheet .meal-draft-card .draft-product-card.product-card-kbju-loading > * {
    filter: none;
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-product-loading-overlay {
    align-items: center;
    background: color-mix(in srgb, #f8faf1 90%, transparent);
    display: none;
    flex-direction: column;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: absolute;
    text-align: center;
    z-index: 20;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

#bottom-sheet .meal-draft-card .draft-product-card.product-card-kbju-loading > *:not(.draft-product-loading-overlay) {
    filter: blur(1.5px);
    opacity: .32;
    pointer-events: none;
}

#bottom-sheet .meal-draft-card .draft-product-card.product-card-kbju-loading .draft-product-loading-overlay {
    display: flex;
}

#bottom-sheet .draft-product-loading-spinner {
    animation: draftProductLoadingSpin .8s linear infinite;
    border: 3px solid color-mix(in srgb, var(--button-color) 20%, transparent);
    border-radius: 999px;
    border-top-color: var(--button-color);
    height: 34px;
    margin-bottom: 10px;
    width: 34px;
}

#bottom-sheet .draft-product-loading-label {
    animation: draftProductLoadingShine 1.35s linear infinite;
    background: linear-gradient(90deg, var(--hint-color), var(--button-color), var(--text-color), var(--button-color), var(--hint-color));
    background-clip: text;
    background-size: 240% auto;
    color: transparent;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    -webkit-background-clip: text;
}

#bottom-sheet .draft-product-loading-overlay small {
    color: var(--hint-color);
    font-size: 11px;
    line-height: 1.25;
    margin-top: 5px;
}

@keyframes draftProductLoadingSpin {
    to { transform: rotate(360deg); }
}

@keyframes draftProductLoadingShine {
    from { background-position: 200% center; }
    to { background-position: -40% center; }
}

@media (prefers-reduced-motion: reduce) {
    #bottom-sheet .draft-product-loading-spinner,
    #bottom-sheet .draft-product-loading-label {
        animation: none;
    }
}

#bottom-sheet .meal-draft-card .draft-product-card .product-name,
#bottom-sheet .meal-draft-card .draft-product-card .product-weight,
#bottom-sheet .meal-draft-card .draft-product-card .product-calories,
#bottom-sheet .meal-draft-card .draft-product-card .kbju-field{
    background: #ffffff;
    border: 0;
    border-radius: 16px;
    box-shadow: none;
    min-height: 42px;
    padding: 9px 11px;
}

#bottom-sheet .meal-draft-card .draft-product-card .product-name {
    min-height: 46px;
}

#bottom-sheet .meal-draft-card .draft-product-card .kbju-autofill-button {
    background: #ffffff;
    border: 1px solid rgba(17, 17, 17, .10);
    border-radius: 16px;
    box-shadow: none;
    color: var(--text-color);
    min-height: 42px;
}

#bottom-sheet .meal-draft-card .draft-product-card .kbju-toggle {
    background: #ffffff;
    border: 1px solid rgba(17, 17, 17, .10);
    border-radius: 16px;
    box-shadow: none;
    height: 42px;
    min-height: 42px;
    padding: 0 8px;
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-processing-row {
    background: #ffffff;
    border-radius: 16px;
    min-height: 44px;
    padding: 8px 12px;
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-processing-row > span {
    font-size: 12px;
    font-weight: 700;
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-processing-row .processing-select {
    font-size: 12px;
    font-weight: 700;
    max-width: 55%;
    min-height: 0;
    padding: 0 22px 0 6px;
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-processing-row::after {
    right: 12px;
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-product-base-row {
    align-items: start;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(92px, .82fr);
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-product-base-row > div,
#bottom-sheet .meal-draft-card .draft-product-card .draft-kbju-toggle-wrap {
    display: grid;
    grid-template-rows: 16px 42px;
    min-width: 0;
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-product-base-row .field-label {
    align-self: start;
    line-height: 11px;
    margin: 0;
}

#bottom-sheet .meal-draft-card .draft-product-card .draft-kbju-toggle-wrap {
    min-width: 0;
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-product-card{
    background: #121c12;
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-product-card .draft-product-loading-overlay {
    background: color-mix(in srgb, #121c12 92%, transparent);
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-product-card .product-name,
:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-product-card .product-weight,
:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-product-card .product-calories,
:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-product-card .kbju-field,
:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-product-card .kbju-autofill-button,
:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-product-card .kbju-toggle,
:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-product-card .draft-processing-row {
    background: #182418;
    border-color: rgba(255, 255, 255, .08);
}

#bottom-sheet .draft-scan-more-row .draft-main-autofill {
    margin-bottom: 0;
    width: 100%;
}

#bottom-sheet .draft-save-button {
    background: var(--button-color);
    color: var(--button-text);
    margin: 0;
}

#bottom-sheet .draft-save-button:disabled {
    background: var(--card-soft);
    color: var(--hint-color);
}

#bottom-sheet .draft-save-button.is-analyzing {
    color: transparent;
    overflow: hidden;
    position: relative;
}

#bottom-sheet .draft-save-button.is-analyzing::after {
    animation: draftSaveAnalyzingShine 1.25s linear infinite;
    background: linear-gradient(90deg, var(--hint-color), var(--button-color), var(--text-color), var(--button-color), var(--hint-color));
    background-clip: text;
    background-size: 240% auto;
    color: transparent;
    content: 'Идет анализ...';
    display: grid;
    font-size: inherit;
    font-weight: inherit;
    inset: 0;
    line-height: inherit;
    padding: 0;
    place-items: center;
    position: absolute;
    -webkit-background-clip: text;
}

@keyframes draftSaveAnalyzingShine {
    from { background-position: 200% center; }
    to { background-position: -40% center; }
}

#bottom-sheet .draft-add-row {
    margin-top: 14px;
}

#bottom-sheet .draft-meal-picker {
    flex: 0 0 52px;
}

#bottom-sheet .draft-meal-picker:focus-within {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--button-color) 32%, transparent);
}

#bottom-sheet .draft-products-list {
    gap: 10px;
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-photo-hero {
    background: #16270f;
}

:root[data-app-effective-theme="dark"] #bottom-sheet.bottom-sheet {
    --black: #10150e;
    --card-soft: #182018;
    --soft-accent-bg: #182018;
    --strong-accent: #8fd35a;
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card {
    background: #080c08;
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-icon-button,
:root[data-app-effective-theme="dark"] #bottom-sheet .meal-photo-upload {
    background: rgba(43, 45, 43, .9);
    color: var(--text-color);
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-photo-upload small {
    color: var(--hint-color);
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .product-card,
:root[data-app-effective-theme="dark"] #bottom-sheet .draft-add-product-toggle {
    background: #121c12;
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-main-product-form {
    background: transparent;
}

/* Source: app/css/features/meal-draft/ai-states.css */
/* Main product AI states */
#bottom-sheet .meal-photo-preview img {
    transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}

#bottom-sheet .meal-photo-preview.is-processing img {
    filter: blur(9px);
    opacity: .58;
    transform: scale(1.04);
}

#bottom-sheet .meal-photo-preview.is-processing .photo-processing-overlay {
    align-items: center;
    background: transparent;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#bottom-sheet .photo-processing-overlay > strong {
    font-size: 14px;
    font-weight: 750;
    letter-spacing: .01em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}

#bottom-sheet .ai-photo-scan-animation {
    display: block;
    height: 82px;
    margin: 18px 0 8px;
    position: relative;
    width: 116px;
}

#bottom-sheet .ai-photo-scan-orbit {
    animation: aiPhotoMagnifierOrbit 2s linear infinite;
    display: block;
    height: 44px;
    left: 36px;
    position: absolute;
    top: 19px;
    transform-origin: 50% 50%;
    visibility: visible;
    width: 44px;
    z-index: 2;
}

#bottom-sheet .ai-photo-scan-magnifier {
    animation: aiPhotoMagnifierCounterRotate 2s linear infinite;
    color: #ffffff;
    display: block;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .65));
    height: 100%;
    opacity: 1;
    overflow: visible;
    transform: translateX(11px) rotate(-12deg);
    transform-origin: 50% 50%;
    width: 100%;
}

#bottom-sheet .ai-photo-scan-star {
    animation: aiPhotoStarPulse 1.35s ease-in-out infinite;
    color: #ffffff;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
    height: 17px;
    opacity: 0;
    position: absolute;
    width: 17px;
    z-index: 3;
}

#bottom-sheet .ai-photo-scan-star.star-one {
    left: 4px;
    top: 15px;
}

#bottom-sheet .ai-photo-scan-star.star-two {
    animation-delay: -.45s;
    right: 4px;
    top: 10px;
}

#bottom-sheet .ai-photo-scan-star.star-three {
    animation-delay: -.9s;
    bottom: 2px;
    left: 20px;
}

#bottom-sheet .meal-draft-card .draft-main-product-form.main-product-scan-loading > * {
    opacity: .42;
    pointer-events: none;
    transition: opacity .18s ease;
}

#bottom-sheet .meal-draft-card .draft-main-product-form .draft-main-product-loading-overlay {
    align-items: center;
    background: color-mix(in srgb, #ffffff 90%, transparent);
    display: none;
    flex-direction: column;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: absolute;
    text-align: center;
    z-index: 20;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

#bottom-sheet .meal-draft-card .draft-main-product-form.product-card-kbju-loading[data-loading-mode="nutrition"] > *:not(.draft-main-product-loading-overlay) {
    filter: blur(3px);
    opacity: .3;
    pointer-events: none;
}

#bottom-sheet .meal-draft-card .draft-main-product-form.product-card-kbju-loading[data-loading-mode="nutrition"] .draft-main-product-loading-overlay {
    display: flex;
    filter: none;
    opacity: 1;
}

#bottom-sheet .draft-main-product-loading-spinner {
    animation: draftProductLoadingSpin .8s linear infinite;
    border: 3px solid color-mix(in srgb, var(--button-color) 20%, transparent);
    border-radius: 999px;
    border-top-color: var(--button-color);
    height: 36px;
    margin-bottom: 11px;
    width: 36px;
}

#bottom-sheet .draft-main-product-loading-overlay strong {
    color: var(--text-color);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
}

#bottom-sheet .draft-main-product-loading-overlay small {
    color: var(--hint-color);
    font-size: 11px;
    line-height: 1.3;
    margin-top: 5px;
}

:root[data-app-effective-theme="dark"] #bottom-sheet .meal-draft-card .draft-main-product-form .draft-main-product-loading-overlay {
    background: color-mix(in srgb, #0b100c 91%, transparent);
}

@keyframes aiPhotoMagnifierOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes aiPhotoMagnifierCounterRotate {
    from { transform: translateX(11px) rotate(-12deg); }
    to { transform: translateX(11px) rotate(-372deg); }
}

@keyframes aiPhotoStarPulse {
    0%, 28%, 100% { opacity: 0; }
    45%, 68% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    #bottom-sheet .ai-photo-scan-orbit,
    #bottom-sheet .ai-photo-scan-magnifier,
    #bottom-sheet .ai-photo-scan-star,
    #bottom-sheet .draft-main-product-loading-spinner {
        animation: none;
    }

    #bottom-sheet .ai-photo-scan-star {
        opacity: .75;
    }

    #bottom-sheet .draft-save-button.is-analyzing::after {
        animation: none;
    }
}

@keyframes mealDraftEnter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

