/* Telegram Dark Theme Variables */
:root {
    --tg-bg-color: #17212b;
    --tg-secondary-bg: #232e3c;
    --tg-text-color: #ffffff;
    --tg-hint-color: #708499;
    --tg-link-color: #62bcf6;
    --tg-button-color: #2ea6ff;
    --tg-button-text: #ffffff;
    --tg-destructive: #e75d54;
    --tg-divider: #2b3844;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    /* Remove 300ms delay */
    touch-action: manipulation;

    /* Prevent text selection on tap */
    -webkit-user-select: none;
    user-select: none;

    /* Prevent tap highlight */
    -webkit-tap-highlight-color: transparent;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

input, textarea {
    /* Allow text selection in inputs */
    -webkit-user-select: text;
    user-select: text;
}

html {
    height: 100vh;
    overflow: hidden;
    position: fixed;
    width: 100%;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

html::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

body {
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--tg-bg-color);
    color: var(--tg-text-color);
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

.container {
    max-width: 428px;
    width: 100%;
    height: 100vh;
    margin: 0 auto;
    background-color: var(--tg-bg-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5vh 5vw;
    box-sizing: border-box;
    overflow: hidden !important;
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    margin-bottom: 2vh;
    flex-shrink: 0;
}

.time {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-text-color);
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: clamp(5px, 1.5vw, 6px);
    font-size: clamp(13px, 3.5vw, 14px);
    font-weight: 500;
    color: var(--tg-hint-color);
    cursor: pointer;
    flex-shrink: 0;
    padding: clamp(4px, 1.2vw, 5px) clamp(8px, 2.5vw, 10px);
    transition: color 0.2s;
}

.language-selector:hover {
    color: var(--tg-text-color);
}

.flag {
    font-size: clamp(14px, 4vw, 16px);
}

.phone-mockup {
    position: relative;
    margin: 0 auto;
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.phone-image {
    max-width: 90%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    border-radius: 36px;
    overflow: hidden;
    position: relative;
}

.notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 30px;
    background-color: #000;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.app-content {
    padding: 40px 20px 20px;
    height: 100%;
    overflow: hidden;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.app-logo {
    font-size: 24px;
}

.app-name {
    font-size: 20px;
    font-weight: 700;
    color: #1B5E20;
}

.date-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 13px;
}

.date-tab {
    color: var(--tg-hint-color);
    cursor: pointer;
}

.date-tab.active {
    color: var(--tg-text-color);
    font-weight: 600;
}

.calories-section {
    background-color: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.calories-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--tg-text-color);
    margin-bottom: 5px;
}

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

.progress-ring {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 50px;
    height: 50px;
}

.macros-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.macro-mini-card {
    flex: 1;
    background-color: white;
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.macro-mini-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--tg-text-color);
}

.macro-mini-label {
    font-size: 9px;
    color: var(--tg-hint-color);
    margin-top: 3px;
}

.recent-section {
    font-size: 12px;
    font-weight: 600;
    color: var(--tg-text-color);
    margin-bottom: 10px;
}

.meal-mini-card {
    background-color: white;
    border-radius: 15px;
    padding: 10px;
    display: flex;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.meal-mini-image {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FFD54F 0%, #FF9800 100%);
}

.meal-mini-info {
    flex: 1;
}

.meal-mini-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--tg-text-color);
    margin-bottom: 3px;
}

.meal-mini-calories {
    font-size: 9px;
    color: var(--tg-hint-color);
    margin-bottom: 5px;
}

.meal-mini-macros {
    display: flex;
    gap: 8px;
    font-size: 8px;
    color: var(--tg-hint-color);
}

.app-bottom-nav {
    position: absolute;
    bottom: 10px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-mini-icon {
    font-size: 18px;
    opacity: 0.5;
}

.nav-mini-icon.active {
    opacity: 1;
    background-color: #000;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-section {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
    margin-top: 2vh;
}

.main-heading {
    font-size: clamp(24px, 6vw, 32px);
    font-weight: 700;
    color: var(--tg-text-color);
    text-align: center;
    line-height: 1.2;
    margin-bottom: 3vh;
}

.get-started-button {
    width: 100%;
    padding: clamp(14px, 3.5vh, 18px);
    background-color: var(--tg-hint-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 2vh;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.get-started-button:active {
    transform: scale(0.98);
}

.sign-in-link {
    text-align: center;
    font-size: clamp(12px, 3.5vw, 14px);
    color: var(--tg-hint-color);
    margin-bottom: 0;
}

.sign-in-link a {
    color: #2E7D32;
    text-decoration: none;
    font-weight: 600;
}

.home-indicator {
    width: 134px;
    height: 5px;
    background-color: #000;
    border-radius: 3px;
    margin: 0 auto;
}

/* Mini progress circles */
.mini-progress {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 30px;
    height: 30px;
}

.mini-progress-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #1a1a1a calc(var(--progress) * 1%),
        #f0f0f0 0
    );
}

.mini-progress-circle.protein {
    background: conic-gradient(
        #EF5350 calc(var(--progress) * 1%),
        #f0f0f0 0
    );
}

.mini-progress-circle.carbs {
    background: conic-gradient(
        #FF9800 calc(var(--progress) * 1%),
        #f0f0f0 0
    );
}

.mini-progress-circle.fats {
    background: conic-gradient(
        #42A5F5 calc(var(--progress) * 1%),
        #f0f0f0 0
    );
}

/* Responsive adjustments */
@media (max-width: 428px) {
    .container {
        padding: 3vh 6vw;
    }
}

@media (max-height: 600px) {
    .container {
        padding: 2vh 5vw;
    }

    .main-heading {
        margin-bottom: 2vh;
    }

    .get-started-button {
        margin-bottom: 1.5vh;
    }
}

@media (min-width: 429px) {
    .container {
        padding: 4vh 20px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .phone-mockup {
        flex: 0.6 1 auto;
    }

    .content-section {
        margin-top: 1vh;
    }

    .main-heading {
        font-size: clamp(20px, 5vw, 28px);
        margin-bottom: 1.5vh;
    }
}

/* Gender page styles */
.container.gender-page {
    justify-content: flex-start;
    padding: 0;
}

.header {
    padding: clamp(70px, 14vh, 95px) clamp(15px, 4vw, 20px) clamp(15px, 3vh, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 100%;
}

.back-button {
    width: clamp(35px, 9vw, 40px);
    height: clamp(35px, 9vw, 40px);
    border-radius: 50%;
    background-color: #f0f0f0;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: clamp(18px, 5vw, 20px);
    color: var(--tg-text-color);
    transition: background-color 0.2s, transform 0.2s;
}

.back-button:hover {
    background-color: #e8e8e8;
}

.back-button:active {
    background-color: #e0e0e0;
    transform: scale(0.95);
}

.progress-container {
    width: 100%;
    max-width: 100%;
    height: clamp(3px, 0.8vh, 4px);
    background-color: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 10%;
    background-color: #2ea6ff;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.content {
    padding: 0 clamp(15px, 4vw, 20px);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    padding-bottom: clamp(85px, 20vh, 110px);
}

h1 {
    font-size: clamp(18px, 4.5vw, 20px);
    font-weight: 700;
    margin-bottom: clamp(10px, 2.5vh, 15px);
    color: var(--tg-text-color);
}

.description {
    color: var(--tg-hint-color);
    font-size: clamp(14px, 3.5vw, 16px);
    margin-bottom: clamp(20px, 4vh, 40px);
    line-height: 1.4;
}

.options-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: clamp(10px, 2.5vh, 15px);
    margin-bottom: 0;
    flex: 1 1 auto;
}

.option-button {
    width: 100%;
    padding: clamp(14px, 3.5vh, 18px);
    border-radius: clamp(15px, 4vw, 20px);
    border: none;
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #f5f5f5;
    color: var(--tg-text-color);
}

.option-button.selected {
    background-color: var(--tg-hint-color);
    color: white;
}

.option-button:active {
    transform: scale(0.98);
}

.continue-button {
    position: fixed;
    bottom: clamp(20px, 5vh, 30px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - clamp(30px, 8vw, 40px));
    max-width: 388px;
    padding: clamp(14px, 3.5vh, 18px);
    background-color: var(--tg-button-color);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.continue-button:hover {
    background-color: #2890d6;
}

.continue-button:active {
    background-color: #2580c4;
    color: white;
    transform: translateX(-50%) scale(0.98);
}

.continue-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Responsive adjustments for gender page */
@media (max-height: 700px) {
    .description {
        margin-bottom: clamp(15px, 3vh, 25px);
    }

    .options-container {
        gap: clamp(8px, 2vh, 12px);
    }

    .option-button {
        padding: clamp(14px, 3vh, 18px);
    }

    .content {
        padding-bottom: clamp(70px, 15vh, 90px);
    }
}

@media (max-height: 600px) {
    h1 {
        font-size: clamp(16px, 4.2vw, 18px);
        margin-bottom: clamp(8px, 2vh, 12px);
    }

    .description {
        margin-bottom: clamp(12px, 2.5vh, 20px);
        font-size: clamp(13px, 3.2vw, 15px);
    }

    .options-container {
        gap: clamp(8px, 1.8vh, 10px);
    }

    .option-button {
        padding: clamp(12px, 2.5vh, 16px);
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    h1 {
        font-size: clamp(16px, 4vw, 18px);
        margin-bottom: clamp(6px, 1.2vh, 10px);
    }

    .description {
        margin-bottom: clamp(10px, 2vh, 15px);
        font-size: clamp(12px, 3vw, 14px);
    }

    .header {
        padding: clamp(65px, 13vh, 85px) clamp(15px, 4vw, 20px) clamp(10px, 2vh, 15px);
    }

    .content {
        padding-bottom: clamp(60px, 12vh, 80px);
    }
}

/* Workout page styles */
.option-card {
    width: 100%;
    padding: clamp(14px, 3.5vh, 18px) clamp(16px, 4vw, 20px);
    border-radius: clamp(15px, 4vw, 20px);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    gap: clamp(12px, 3vw, 15px);
    text-align: left;
}

.option-card.selected {
    background-color: var(--tg-hint-color);
    color: white;
}

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

.option-icon {
    font-size: clamp(20px, 5.5vw, 28px);
    width: clamp(30px, 8vw, 40px);
    height: clamp(30px, 8vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.option-content {
    flex: 1;
    min-width: 0;
}

.option-title {
    font-size: clamp(15px, 4.2vw, 18px);
    font-weight: 600;
    margin-bottom: clamp(2px, 0.5vh, 4px);
    color: var(--tg-text-color);
}

.option-card.selected .option-title {
    color: white;
}

.option-description {
    font-size: clamp(12px, 3.5vw, 14px);
    color: var(--tg-hint-color);
    line-height: 1.3;
}

.option-card.selected .option-description {
    color: var(--tg-hint-color);
}

/* Custom icons */
.icon-dot {
    width: clamp(10px, 2.5vw, 12px);
    height: clamp(10px, 2.5vw, 12px);
    background-color: #000;
    border-radius: 50%;
}

.option-card.selected .icon-dot {
    background-color: white;
}

.icon-three-dots {
    display: flex;
    gap: clamp(4px, 1vw, 5px);
    align-items: center;
}

.icon-three-dots .dot {
    width: clamp(6px, 1.5vw, 8px);
    height: clamp(6px, 1.5vw, 8px);
    background-color: #000;
    border-radius: 50%;
}

.option-card.selected .icon-three-dots .dot {
    background-color: white;
}

/* Responsive adjustments for workout/option cards */
@media (max-height: 700px) {
    .option-card {
        padding: clamp(12px, 3vh, 16px) clamp(14px, 3.5vw, 18px);
        gap: clamp(10px, 2.5vw, 12px);
    }

    .option-icon {
        font-size: clamp(18px, 5vw, 24px);
        width: clamp(28px, 7vw, 35px);
        height: clamp(28px, 7vw, 35px);
    }

    .option-title {
        font-size: clamp(14px, 3.8vw, 16px);
    }

    .option-description {
        font-size: clamp(11px, 3vw, 13px);
    }
}

@media (max-height: 600px) {
    .option-card {
        padding: clamp(10px, 2.5vh, 14px) clamp(12px, 3vw, 16px);
    }
}

@media (max-width: 360px) {
    .option-card {
        gap: clamp(8px, 2vw, 10px);
    }

    .option-title {
        font-size: clamp(13px, 3.6vw, 15px);
    }

    .option-description {
        font-size: clamp(11px, 3.2vw, 12px);
    }
}

/* Height & Weight page styles */
.pickers-container {
    display: flex;
    justify-content: space-around;
    gap: clamp(40px, 10vw, 60px);
    margin-bottom: clamp(30px, 8vh, 40px);
    flex: 1 1 auto;
    align-items: center;
}

.picker-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 160px;
}

.picker-label {
    font-size: clamp(18px, 4.5vw, 22px);
    font-weight: 600;
    margin-bottom: clamp(18px, 5vh, 25px);
    color: var(--tg-text-color);
}

.picker-wrapper {
    position: relative;
    width: 100%;
    height: clamp(150px, 35vh, 200px);
    overflow: hidden;
}

.picker {
    width: 100%;
    min-width: clamp(80px, 24vw, 110px);
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

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

.picker-item {
    height: clamp(32px, 8vh, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    font-size: clamp(10px, 2.5vw, 12px);
    color: #708499;
    transition: all 0.2s;
    position: relative;
}

.picker-item span {
    position: relative;
    z-index: 1;
}

.picker-item.selected {
    color: #ffffff;
    font-weight: 600;
    font-size: clamp(12px, 3.2vw, 14px);
}

.picker-highlight {
    position: absolute;
    top: 50%;
    left: clamp(20px, 5vw, 30px);
    right: clamp(20px, 5vw, 30px);
    transform: translateY(-50%);
    height: clamp(26px, 6.5vh, 32px);
    background-color: #2e3b49;
    border-radius: clamp(8px, 2vw, 10px);
    pointer-events: none;
    z-index: 0;
}

/* Fade effect for top and bottom */
.picker-wrapper::before,
.picker-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: clamp(40px, 10vh, 55px);
    pointer-events: none;
    z-index: 2;
}

.picker-wrapper::before {
    top: 0;
    background: linear-gradient(to bottom,
        rgba(23, 33, 43, 1) 0%,
        rgba(23, 33, 43, 0) 100%);
}

.picker-wrapper::after {
    bottom: 0;
    background: linear-gradient(to top,
        rgba(23, 33, 43, 1) 0%,
        rgba(23, 33, 43, 0) 100%);
}

/* Responsive adjustments for pickers */
@media (max-height: 700px) {
    .pickers-container {
        gap: clamp(35px, 9vw, 50px);
        margin-bottom: clamp(25px, 6vh, 35px);
    }

    .picker-label {
        font-size: clamp(17px, 4.2vw, 20px);
        margin-bottom: clamp(15px, 4vh, 20px);
    }

    .picker-wrapper {
        height: clamp(180px, 45vh, 230px);
    }

    .picker-item {
        height: clamp(36px, 9vh, 45px);
        font-size: clamp(10px, 2.8vw, 13px);
    }

    .picker-item.selected {
        font-size: clamp(12px, 3.5vw, 15px);
    }

    .picker-highlight {
        height: clamp(30px, 7.5vh, 38px);
    }

    .picker-wrapper::before,
    .picker-wrapper::after {
        height: clamp(50px, 13vh, 70px);
    }
}

@media (max-height: 600px) {
    .picker-wrapper {
        height: clamp(160px, 40vh, 200px);
    }

    .picker-label {
        font-size: clamp(16px, 4vw, 18px);
        margin-bottom: clamp(12px, 3vh, 16px);
    }

    .picker-item {
        height: clamp(32px, 8vh, 40px);
        font-size: clamp(9px, 2.8vw, 12px);
    }

    .picker-item.selected {
        font-size: clamp(11px, 3.2vw, 14px);
    }

    .picker-highlight {
        height: clamp(26px, 6.5vh, 32px);
    }

    .picker-wrapper::before,
    .picker-wrapper::after {
        height: clamp(45px, 11vh, 60px);
    }
}

@media (max-width: 360px) {
    .pickers-container {
        gap: clamp(30px, 8vw, 40px);
    }

    .picker-column {
        max-width: 130px;
    }

    .picker {
        min-width: clamp(90px, 25vw, 120px);
    }

    .picker-label {
        font-size: clamp(16px, 4.2vw, 19px);
    }
}

/* Date of Birth page styles */
.date-pickers-container {
    display: flex;
    justify-content: center;
    gap: clamp(15px, 4vw, 20px);
    margin-bottom: clamp(30px, 8vh, 40px);
    flex: 1 1 auto;
    align-items: center;
}

.picker.month {
    min-width: clamp(95px, 26vw, 110px);
}

.picker.day {
    min-width: clamp(50px, 14vw, 60px);
}

.picker.year {
    min-width: clamp(75px, 21vw, 90px);
}

/* Responsive adjustments for date pickers */
@media (max-height: 700px) {
    .date-pickers-container {
        gap: clamp(12px, 3.5vw, 18px);
    }
}

@media (max-height: 600px) {
    .date-pickers-container {
        gap: clamp(10px, 3vw, 15px);
    }
}

@media (max-width: 360px) {
    .date-pickers-container {
        gap: clamp(10px, 3vw, 15px);
    }

    .picker.month {
        min-width: clamp(85px, 24vw, 100px);
    }

    .picker.day {
        min-width: clamp(45px, 13vw, 55px);
    }

    .picker.year {
        min-width: clamp(68px, 19vw, 80px);
    }
}

/* Desired Weight page styles */
.weight-selector {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(80px, 20vh, 120px);
    min-height: 0;
}

.goal-label {
    font-size: clamp(11px, 2.8vw, 12px);
    color: var(--tg-hint-color);
    margin-bottom: clamp(12px, 3vh, 15px);
}

.weight-display {
    font-size: clamp(14px, 3.5vw, 16px);
    font-weight: 700;
    color: var(--tg-text-color);
    margin-bottom: clamp(30px, 7.5vh, 40px);
}

.ruler-container {
    width: 100%;
    position: relative;
    height: clamp(70px, 18vh, 80px);
    overflow: hidden;
}

.ruler-wrapper {
    position: relative;
    height: 100%;
    touch-action: pan-x;
    user-select: none;
}

.ruler {
    display: flex;
    align-items: flex-end;
    height: 100%;
    transition: transform 0.1s ease-out;
    will-change: transform;
    padding-bottom: clamp(8px, 2vh, 10px);
}

.ruler-mark {
    flex-shrink: 0;
    width: 2px;
    background-color: rgba(26, 26, 26, 0.3);
    margin: 0 3px;
    position: relative;
    z-index: 2;
}

.ruler-mark.small {
    height: clamp(16px, 4vh, 20px);
}

.ruler-mark.medium {
    height: clamp(24px, 6vh, 30px);
}

.ruler-mark.large {
    height: clamp(36px, 9vh, 45px);
    background-color: rgba(26, 26, 26, 0.5);
    width: 2.5px;
}

.ruler-center-indicator {
    position: absolute;
    bottom: clamp(8px, 2vh, 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: clamp(44px, 11vh, 55px);
    background-color: var(--tg-button-color);
    border-radius: 2px;
    z-index: 10;
}

.ruler-highlight {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 80%;
    background-color: rgba(224, 122, 95, 0.15);
    border-radius: clamp(10px, 2.5vw, 12px);
    z-index: 1;
    pointer-events: none;
    transition: transform 0.1s ease-out, width 0.1s ease-out;
}

/* Goal Encouragement page styles */
.main-message {
    font-size: clamp(28px, 7vw, 32px);
    font-weight: 700;
    color: var(--tg-text-color);
    line-height: 1.3;
    margin-bottom: clamp(25px, 6vh, 30px);
    max-width: clamp(300px, 85vw, 340px);
}

.highlight {
    color: #FF6B4A;
}

.sub-message {
    font-size: clamp(14px, 3.5vw, 15px);
    color: var(--tg-hint-color);
    line-height: 1.6;
    max-width: clamp(280px, 80vw, 300px);
}

/* Goal Speed page styles */
.speed-selector {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: clamp(80px, 20vh, 120px);
    min-height: 0;
}

.speed-label {
    font-size: clamp(13px, 3.3vw, 14px);
    color: var(--tg-hint-color);
    margin-bottom: clamp(12px, 3vh, 15px);
}

.speed-display {
    font-size: clamp(28px, 7vw, 34px);
    font-weight: 700;
    color: var(--tg-text-color);
    margin-bottom: clamp(45px, 11vh, 50px);
}

.slider-container {
    width: 100%;
    position: relative;
    padding: 0 clamp(15px, 4vw, 20px);
}

.animal-icons {
    display: flex;
    justify-content: space-between;
    margin-bottom: clamp(12px, 3vh, 15px);
    position: relative;
}

.animal-icon {
    width: clamp(40px, 10vw, 50px);
    height: clamp(40px, 10vw, 50px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.animal-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.animal-icon.active {
    transform: scale(1.1);
}

#turtle {
    width: clamp(35px, 8.75vw, 43px);
    height: clamp(35px, 8.75vw, 43px);
}

#rabbit {
    width: clamp(35px, 8.75vw, 43px);
    height: clamp(35px, 8.75vw, 43px);
}

#cheetah {
    width: clamp(45px, 11.25vw, 56px);
    height: clamp(45px, 11.25vw, 56px);
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: clamp(35px, 9vh, 40px);
    display: flex;
    align-items: center;
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
}

.slider-track-fill {
    position: absolute;
    height: 4px;
    background-color: #000;
    border-radius: 2px;
    transition: width 0.1s;
}

.slider {
    position: relative;
    width: 100%;
    height: 40px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    z-index: 10;
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
}

.slider:active {
    cursor: grabbing;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: clamp(22px, 5.5vw, 24px);
    height: clamp(22px, 5.5vw, 24px);
    background: #000;
    cursor: grab;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.slider:active::-webkit-slider-thumb {
    cursor: grabbing;
}

.slider::-moz-range-thumb {
    width: clamp(22px, 5.5vw, 24px);
    height: clamp(22px, 5.5vw, 24px);
    background: #000;
    cursor: grab;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.slider:active::-moz-range-thumb {
    cursor: grabbing;
}

.speed-labels {
    display: flex;
    justify-content: space-between;
    margin-top: clamp(8px, 2vh, 10px);
    font-size: clamp(13px, 3.3vw, 14px);
    color: var(--tg-hint-color);
}

.speed-label-item {
    width: clamp(45px, 11vw, 50px);
    text-align: center;
}

.recommended-badge {
    margin-top: clamp(25px, 6vh, 30px);
    padding: clamp(10px, 2.5vh, 12px) clamp(35px, 9vw, 40px);
    background-color: #f5f5f5;
    border-radius: clamp(20px, 5vw, 25px);
    font-size: clamp(14px, 3.5vw, 15px);
    color: var(--tg-hint-color);
    font-weight: 500;
}

/* Completion page styles */
.celebration-illustration {
    position: relative;
    width: clamp(220px, 55vw, 260px);
    height: clamp(220px, 55vw, 260px);
    margin-bottom: clamp(35px, 9vh, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gradient-circle {
    position: absolute;
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

.circle-outer {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(244, 143, 177, 0.3) 0%, rgba(225, 190, 231, 0.2) 50%, rgba(179, 229, 252, 0.3) 100%);
    animation-delay: 0s;
}

.circle-middle {
    width: 77%;
    height: 77%;
    background: linear-gradient(135deg, rgba(244, 143, 177, 0.4) 0%, rgba(225, 190, 231, 0.3) 50%, rgba(179, 229, 252, 0.4) 100%);
    animation-delay: 0.3s;
}

.circle-inner {
    width: 54%;
    height: 54%;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.hand-icon {
    position: relative;
    top: -10px;
    z-index: 10;
    width: clamp(150px, 37.5vw, 165px);
    height: clamp(150px, 37.5vw, 165px);
    animation: float 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.heart-icon {
    position: absolute;
    top: clamp(50px, 12.5vw, 65px);
    right: clamp(100px, 25vw, 115px);
    font-size: clamp(20px, 5vw, 24px);
    z-index: 11;
    animation: heartbeat-float 3s ease-in-out infinite;
}

@keyframes heartbeat-float {
    0%, 100% {
        transform: scale(1) translateY(0px);
    }
    25% {
        transform: scale(1.2) translateY(-5px);
    }
    50% {
        transform: scale(1) translateY(-10px);
    }
    75% {
        transform: scale(1.2) translateY(-5px);
    }
}

.dots {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #666;
    border-radius: 50%;
}

.dot:nth-child(1) { top: 30px; left: 50%; }
.dot:nth-child(2) { top: 60px; left: 30px; }
.dot:nth-child(3) { top: 60px; right: 30px; }
.dot:nth-child(4) { bottom: 60px; left: 30px; }
.dot:nth-child(5) { bottom: 60px; right: 30px; }
.dot:nth-child(6) { bottom: 30px; left: 50%; }
.dot:nth-child(7) { left: 30px; top: 50%; }
.dot:nth-child(8) { right: 30px; top: 50%; }

.completion-badge {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 8px);
    font-size: clamp(14px, 3.5vw, 16px);
    color: var(--tg-hint-color);
    margin-bottom: clamp(12px, 3vh, 15px);
}

.check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(22px, 5.5vw, 24px);
    height: clamp(22px, 5.5vw, 24px);
    background-color: #FF9800;
    border-radius: 50%;
    color: white;
    font-size: clamp(12px, 3vw, 14px);
    font-weight: bold;
}

.main-heading {
    font-size: clamp(30px, 7.5vw, 36px);
    font-weight: 700;
    color: var(--tg-text-color);
    line-height: 1.2;
    max-width: clamp(300px, 85vw, 340px);
}

.continue-button.generating {
    background-color: #FF9800;
    pointer-events: none;
}

.continue-button.generating::after {
    content: '';
    display: inline-block;
    width: clamp(14px, 3.5vw, 16px);
    height: clamp(14px, 3.5vw, 16px);
    margin-left: clamp(8px, 2vw, 10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Loading page styles */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(8px, 2vh, 10px) 0 clamp(35px, 9vh, 40px);
    font-size: clamp(14px, 3.5vw, 15px);
    font-weight: 600;
    color: var(--tg-text-color);
}

.percentage {
    font-size: clamp(80px, 20vw, 96px);
    font-weight: 700;
    color: var(--tg-text-color);
    margin-bottom: clamp(18px, 4.5vh, 20px);
    line-height: 1;
}

.main-message {
    font-size: clamp(24px, 6vw, 28px);
    font-weight: 600;
    color: var(--tg-text-color);
    line-height: 1.3;
    margin-bottom: clamp(50px, 12.5vh, 60px);
}

.progress-bar-container {
    width: 100%;
    max-width: clamp(280px, 75vw, 320px);
    margin-bottom: clamp(18px, 4.5vh, 20px);
}

.progress-bar-loading {
    width: 100%;
    height: clamp(7px, 1.75vw, 8px);
    background-color: var(--tg-secondary-bg);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #E07A5F;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-label {
    font-size: clamp(13px, 3.3vw, 14px);
    color: var(--tg-hint-color);
    margin-top: clamp(13px, 3.3vh, 15px);
}

.checklist-card {
    width: 100%;
    max-width: clamp(300px, 85vw, 340px);
    background-color: var(--tg-secondary-bg);
    border-radius: clamp(22px, 5.5vw, 25px);
    padding: clamp(26px, 6.5vw, 30px);
    margin-top: clamp(35px, 9vh, 40px);
    color: white;
}

.checklist-title {
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    margin-bottom: clamp(18px, 4.5vh, 20px);
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: clamp(13px, 3.3vh, 15px);
}

.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: clamp(14px, 3.5vw, 16px);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.checklist-item.checked {
    opacity: 1;
}

.item-text {
    display: flex;
    align-items: center;
    gap: clamp(7px, 1.75vw, 8px);
}

.bullet {
    width: 4px;
    height: 4px;
    background-color: white;
    border-radius: 50%;
}

.checkmark {
    width: clamp(22px, 5.5vw, 24px);
    height: clamp(22px, 5.5vw, 24px);
    border-radius: 50%;
    background-color: #E07A5F;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(12px, 3vw, 14px);
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.checklist-item.checked .checkmark {
    opacity: 1;
    transform: scale(1);
}

/* Plan Ready page styles */
.plan-ready-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(15px, 3vw, 20px);
    padding-top: clamp(100px, 16vh, 120px);
    padding-bottom: clamp(80px, 16vh, 100px);
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    justify-content: flex-start;
    box-sizing: border-box;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.check-icon {
    margin-top: clamp(0px, 0vh, 0px);
    margin-bottom: clamp(10px, 2vh, 15px);
}

.check-icon svg {
    width: clamp(55px, 14vw, 70px);
    height: clamp(55px, 14vw, 70px);
}

.plan-ready-title {
    font-size: clamp(19px, 4.75vw, 23px);
    font-weight: 700;
    color: var(--tg-text-color);
    line-height: 1.2;
    text-align: center;
    margin-bottom: clamp(14px, 2.8vh, 18px);
}

.goal-section {
    width: 100%;
    max-width: clamp(300px, 85vw, 340px);
    text-align: center;
    margin-bottom: clamp(14px, 2.8vh, 20px);
}

.goal-label {
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 500;
    color: var(--tg-hint-color);
    margin-bottom: clamp(4px, 1vh, 6px);
}

.goal-text {
    font-size: clamp(15px, 3.75vw, 17px);
    font-weight: 600;
    color: var(--tg-text-color);
}

.macros-title {
    font-size: clamp(13px, 3.25vw, 14px);
    font-weight: 500;
    color: var(--tg-hint-color);
    margin-bottom: clamp(10px, 2.2vh, 14px);
    text-align: center;
    width: 100%;
}

.macros-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 2vw, 10px);
    width: 100%;
    max-width: clamp(320px, 90vw, 360px);
    margin-bottom: clamp(10px, 2.2vh, 14px);
}

.macro-item {
    background-color: var(--tg-secondary-bg);
    border-radius: clamp(12px, 3vw, 14px);
    padding: clamp(8px, 2vw, 10px);
    display: flex;
    flex-direction: column;
    position: relative;
}

.macro-header {
    display: flex;
    align-items: center;
    gap: clamp(5px, 1.25vw, 6px);
    margin-bottom: clamp(5px, 1.2vh, 7px);
}

.macro-icon {
    width: clamp(13px, 3.25vw, 15px);
    height: clamp(13px, 3.25vw, 15px);
}

.macro-name {
    font-size: clamp(11px, 2.75vw, 13px);
    font-weight: 600;
    color: var(--tg-text-color);
}

.macro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.circular-progress {
    position: relative;
    width: clamp(90px, 22.5vw, 110px);
    height: clamp(90px, 22.5vw, 110px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-progress svg {
    width: 100%;
    height: 100%;
}

.macro-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(13px, 3.25vw, 15px);
    font-weight: 700;
    color: var(--tg-text-color);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

.edit-icon {
    position: absolute;
    bottom: clamp(6px, 1.5vw, 8px);
    right: clamp(6px, 1.5vw, 8px);
    width: clamp(20px, 5vw, 24px);
    height: clamp(20px, 5vw, 24px);
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: clamp(10px, 2.5vw, 12px);
}

.health-score-section {
    width: 100%;
    max-width: clamp(320px, 90vw, 360px);
    margin-top: clamp(8px, 1.8vh, 12px);
    padding: clamp(12px, 3vw, 16px);
    background-color: var(--tg-secondary-bg);
    border-radius: clamp(14px, 3.5vw, 18px);
}

.health-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(10px, 2.2vh, 14px);
}

.health-score-label {
    display: flex;
    align-items: center;
    gap: clamp(5px, 1.25vw, 7px);
    font-size: clamp(13px, 3.25vw, 15px);
    font-weight: 600;
    color: var(--tg-text-color);
}

.health-icon {
    width: clamp(17px, 4.25vw, 21px);
    height: clamp(17px, 4.25vw, 21px);
    object-fit: contain;
    margin-right: clamp(5px, 1.25vw, 7px);
}

.health-score-value {
    font-size: clamp(14px, 3.5vw, 16px);
    font-weight: 700;
    color: var(--tg-text-color);
}

.health-progress-bar {
    width: 100%;
    height: clamp(7px, 1.75vw, 9px);
    background-color: var(--tg-secondary-bg);
    border-radius: clamp(5px, 1.25vw, 6px);
    overflow: hidden;
    position: relative;
}

.health-progress-fill {
    height: 100%;
    background: #E07A5F;
    border-radius: clamp(5px, 1.25vw, 6px);
    transition: width 1s ease-in-out;
    width: 0%;
}

/* In-app browser warning banner */
.in-app-browser-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: clamp(12px, 3vw, 16px);
    text-align: center;
    font-size: clamp(13px, 3.25vw, 15px);
    font-weight: 600;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: none;
    line-height: 1.4;
}

.in-app-browser-banner.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.in-app-browser-banner a {
    color: white;
    text-decoration: underline;
    font-weight: 700;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* PWA Install Popup */
.install-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: flex-end;
    animation: fadeIn 0.3s ease;
}

.install-popup-overlay.show {
    display: flex;
}

.install-popup {
    background-color: #ffffff;
    border-radius: clamp(20px, 5vw, 24px) clamp(20px, 5vw, 24px) 0 0;
    padding: clamp(24px, 6vw, 30px);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.install-popup-header {
    display: flex;
    align-items: center;
    gap: clamp(12px, 3vw, 16px);
    margin-bottom: clamp(16px, 4vh, 20px);
}

.install-popup-icon {
    width: clamp(50px, 12.5vw, 60px);
    height: clamp(50px, 12.5vw, 60px);
    background-color: var(--tg-hint-color);
    border-radius: clamp(12px, 3vw, 14px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(24px, 6vw, 28px);
}

.install-popup-title {
    flex: 1;
}

.install-popup-title h3 {
    font-size: clamp(18px, 4.5vw, 22px);
    font-weight: 700;
    color: var(--tg-text-color);
    margin: 0 0 clamp(4px, 1vh, 6px) 0;
}

.install-popup-title p {
    font-size: clamp(13px, 3.25vw, 15px);
    color: var(--tg-hint-color);
    margin: 0;
}

.install-popup-close {
    background: none;
    border: none;
    font-size: clamp(24px, 6vw, 28px);
    color: var(--tg-hint-color);
    cursor: pointer;
    padding: 0;
    width: clamp(30px, 7.5vw, 36px);
    height: clamp(30px, 7.5vw, 36px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-popup-content {
    margin-bottom: clamp(20px, 5vh, 24px);
}

.install-popup-steps {
    background-color: #f8f8f8;
    border-radius: clamp(14px, 3.5vw, 16px);
    padding: clamp(14px, 3.5vw, 18px);
    margin-bottom: clamp(14px, 3.5vh, 18px);
}

.install-popup-step {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.5vw, 12px);
    padding: clamp(8px, 2vh, 10px) 0;
}

.install-popup-step:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
}

.install-popup-step-number {
    width: clamp(24px, 6vw, 28px);
    height: clamp(24px, 6vw, 28px);
    background-color: var(--tg-hint-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 600;
    flex-shrink: 0;
}

.install-popup-step-text {
    font-size: clamp(13px, 3.25vw, 15px);
    color: var(--tg-text-color);
    line-height: 1.4;
}

.install-popup-buttons {
    display: flex;
    gap: clamp(10px, 2.5vw, 12px);
}

.install-popup-button {
    flex: 1;
    padding: clamp(14px, 3.5vh, 16px);
    border: none;
    border-radius: clamp(25px, 6vw, 28px);
    font-size: clamp(15px, 3.75vw, 17px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.install-popup-button-primary {
    background-color: var(--tg-hint-color);
    color: white;
}

.install-popup-button-primary:active {
    background-color: #333;
    transform: scale(0.98);
}

.install-popup-button-secondary {
    background-color: #f0f0f0;
    color: var(--tg-hint-color);
}

.install-popup-button-secondary:active {
    background-color: #e0e0e0;
    transform: scale(0.98);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive adjustments for desired weight page */
@media (max-height: 700px) {
    .weight-selector {
        margin-bottom: clamp(70px, 17vh, 100px);
    }

    .weight-display {
        margin-bottom: clamp(30px, 7.5vh, 40px);
    }
}

@media (max-height: 600px) {
    .weight-selector {
        margin-bottom: clamp(60px, 15vh, 80px);
    }

    .goal-label {
        margin-bottom: clamp(10px, 2.5vh, 12px);
    }

    .weight-display {
        margin-bottom: clamp(25px, 6vh, 35px);
        font-size: clamp(36px, 9vw, 44px);
    }

    .ruler-container {
        height: clamp(60px, 15vh, 70px);
    }
}
