body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f5f5f5;
}

.calc-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #111;
    margin: 0 0 6px 0;
}

.calc-subtitle {
    font-size: 0.9rem;
    color: #888;
    margin: 0 0 24px 0;
}

.section {
    flex: 1;
    padding: 32px 24px;
}

.section-heading {
    font-size: 1.2em;
    font-weight: 700;
    color: #111;
    margin: 0 0 16px 0;
}

.section-heading .fa-heart-pulse {
    color: #d82222;
    font-size: 1em;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 24px;
    height: 80px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e8e8e8;
}

.site-title {
    font-family: "Kaushan Script", cursive;
    font-size: 2.8rem;
    color: #1a73e8;
    margin: 0;
    letter-spacing: -1px;
}

.site-header a {
    text-decoration: none;
}

#top-menu {
    flex: 1;
    display: flex;
    align-items: center;
}

#top-menu ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 50px;
}

#top-menu .main-menu {
    flex: 1;
    justify-content: center;
    gap: 24px;
}

#top-menu ul li {
    flex: none;
    text-align: center;
}

#top-menu ul li a {
    text-decoration: none;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 8px;

}

#top-menu ul li a i {
    font-size: 1.2rem;
    color: #1a73e8;
}

#top-menu ul li a:hover {
    background: #f4f4f4;
    color: #111;
}

#top-menu ul li a:hover i {
    color: #111;
}

.short-text {
    display: none;
}

@media (max-width: 600px) {
    .site-header {
        padding: 0 12px;
        height: auto;
        padding: 10px 20px;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .site-title {
        font-size: 2rem;
    }

    #top-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 10px;
    }

    #top-menu ul {
        gap: 40px;
    }

    .full-text {
        display: none;
    }

    .short-text {
        display: inline;
    }

    #top-menu ul li a {
        font-size: 0.75rem;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 10px;
        border-radius: 8px;
    }

    .header-app-store-badge img {
        height: 36px;
    }
}

#top-menu ul li.active-menu a {
    color: #1a73e8;
    font-weight: bold;
}

#top-menu ul li.active-menu a i {
    color: #1a73e8;
}

.input-box {
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    background: #fff;
}

.input-box label {
    display: block;
    font-size: 0.82em;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.input-box input, .input-box select {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1em;
    color: #111;
    box-sizing: border-box
}

.input-box input[type="radio"] {
    width: auto;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.input-grid .input-box {
    margin-bottom: 0;

}

.input-box-inner {
    display: flex;
    align-items: center;
    gap: 6px;
}

input::placeholder,
textarea::placeholder {
    font-size: 0.9em;
    color: #aaa;
    white-space: nowrap;
    flex-shrink: 0;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 2px;
}

.input-box .radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95em;
    color: #111;
    cursor: pointer;
}

@media (max-width: 640px) {
    #diabetes-box,
    #kidney-box {
        box-sizing: border-box;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
}

#unit-switcher {
    list-style: none;
    padding: 3px;
    margin-bottom: 24px;
    display: inline-flex;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    background: #ebebeb;
}

#unit-switcher li {
    display: inline-block;
    margin-right: 0;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 0.85em;
    font-weight: 500;
    color: #777;
    transition: background 0.15s, color 0.15s;
}

#unit-switcher li.active-unit {
    font-weight: 600;
    background: #b4cbe7;
    color: #105aba;
}

.active-offset {
    display: block;
}

#calorie-calculator {
    max-width: 1100px;
}

.slidecontainer {
    width: 100%;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #d3d3d3;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.slider::-moz-range-progress {
    background: #1a73e8;
    height: 6px;
    border-radius: 3px;
}

.slider::-moz-range-track {
    background: #d3d3d3;
    height: 6px;
    border-radius: 3px;
}

/* Macro mode switcher */
#mac-mode-selector {
    list-style: none;
    padding: 3px;
    margin: 20px 0;
    display: inline-flex;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    background: #ebebeb;
}

#mac-mode-selector li {    
    margin-right: 0;
    cursor: pointer;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    color: #777;
    font-size: 0.85em;
    font-weight: 500;
}

#mac-mode-selector li.active-macro {
    font-weight: 600;
    background: #111;
    color: #fff;
}

.results-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #ebebeb;
}

.result-heading {
    font-size: 1.2em; 
    font-weight: 700;
    color: #111;
    margin: 0 0 16px 0;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.result-card {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    padding: 14px 16px; 
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    gap: 4px
}

.result-label {
    font-size: 0.9em;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111;
}

.result-sub {
    font-size: 0.8em; 
    color: #888;
}

.result-label .fa-fire{
    color: #e8571a;
    font-size: 2em;
}

.result-heading .fa-bullseye {
    color: #733fdc;
    font-size: 1em;
}

.result-label .fa-weight-scale{
    color: #1a73e8;
    font-size: 2em;
}

.macro-section {
    margin-top: 4px;
}

.macro-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 14px 0;
}

.macro-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.macro-card {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    display: flex;
    align-items: center;
    gap: 12px;
}

.macro-card-label{
    font-size: 0.9em;
    font-weight: 700;
    color: #333;
    min-width: 60px;
}

.macro-card-value {
    font-size: 1em;
    font-weight: 700;
    color: #111;
}

.macro-card-range {
    font-size: 0.78em; 
    color: #888;
    margin-left: auto;
}

@media (max-width: 480px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
    .macro-card {
        flex-wrap: wrap;
    }
    .macro-card-range {
        margin-left: 0;
        width: 100%;
    }
}

/* Slider section */
#macro-slider-selection {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
}

.slider-hint {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #555;
}

.slider-row {
    margin-bottom: 10px;
}

.slider-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9em;
}

/* Macro results table */
.macro-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.macro-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
}

.macro-label {
    background-color: #f5f5f5;
    font-weight: 500;
    width: 35%;
}

.macro-value {
    background-color: #e8f5e9;
    text-align: right;
}

.macro-value strong {
    display: block;
}

.macro-range {
    font-size: 0.82em;
    color: #777;
}

@media (max-width: 480px) {
    .macro-table td {
        padding: 6px 8px;
        font-size: 0.9em;
    }

    .macro-label {
        width: 40%;
    }
}

.split-grid {
     display: grid;
     grid-template-columns: repeat(7, 1fr);
     gap: 6px;
     margin-top: 14px;
}

 .split-cell {
     border: 1px solid #ddd;
     border-radius: 8px;
     padding: 20px 8px;
     text-align: center;
     min-height: 80px;
     display: flex;
     flex-direction: column;
     justify-content: center;
     gap: 6px;
}

 .split-day {
     font-size: 0.75em;
     color: #666;
     font-weight: 500;
     margin-bottom: 0;
}

 .split-label {
     font-weight: 700;
     font-size: 0.85em;
}

 .split-workout { background-color: #b9e5bdca; }
 .split-rest    { background-color: #f5f5f5; color: #828080; }

 @media (max-width: 480px) {

    .split-grid {
        grid-template-columns: 1fr;
    }

    .split-cell {
        padding: 10px 8px;
        min-height: auto;
    }

    .workout-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .workout-control-group {
        width: 100%;
    }

    .workout-control-group label {
        width: 100%;
    }
    .workout-control-group select {
        width: 100%
    }
    #generate-split {
        width: 100%;
    }

    #download-schedule {
        width: 60%;
        font-size: 0.45em;
    }
}

.workout-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.workout-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.workout-control-group label {
    font-size: 0.8em;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workout-control-group select {
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    padding: 10px 12px;
    font-size: 0.9em;
    background: #fff;
    outline: none;
    cursor: pointer;
}

.custom-split-body {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.custom-split-label {
    font-size: 0.8em;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
}

.custom-days-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    flex: 1;
}

#custom-tip-box {
    flex: 1;
    background: #e8f0fe;
    border-radius: 12px;
    padding: 24px 28px;
    align-self: flex-start;
}

#custom-tip-box ul {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8em;
    color: #444;
}

.tip-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.8em;
    color: #111;
    margin-bottom: 12px;
}

.tip-box-header i {
    color: #1a73e8;
    font-size: 1em;
}



.custom-day-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.custom-day-row label {
    font-size: 0.8em;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 90px;
    flex-shrink: 0;
}

.custom-day-row select {
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    padding: 10px 12px;
    font-size: 0.9em;
    background: #fff;
    outline: none;
    cursor: pointer;
    flex: 0.5
    
}

#custom-split-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 20px;
}

#generate-split {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    align-self: flex-end;
}

#generate-split:hover {
    background: #1558b0;
}

#download-schedule {
    background: #1a73e8;
    color: #fff;
    cursor: pointer;
    border: none;
    padding: 8px 8px;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 500;
    transition: background 0.15s;
    white-space: nowrap;
    align-self: flex-end;
}

#download-schedule:hover {
    background: #1558b0;
}

#download-button p {
    font-size: 0.70em;
    color: #888;
    font-weight: 200;
}

@media (max-width: 480px){
    .custom-split-body {
        flex-direction: column;
    }

    .custom-day-row select {
        flex: 1;
    }

    #custom-tip-box {
        width: 100%;
        box-sizing: border-box;
    }

    #custom-split-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #custom-split-footer #generate-split {
        width: 100%;
    }
}

/* Footer Styling */
.footer {
    width: 100%;
    margin-top: auto;
    padding: 40px 0;
    border-top: 1px solid #eee;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer p {
    margin: 0;
    color: #888;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}


.button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

#calculate-button {
    flex: 1;
    background-color: #1a73e8;
    color: #fff;
    border: none;
    padding: 14px 0;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

#calculate-button:hover {
    background: #1558b0;
}

#reset-button {
    cursor: pointer;
    flex: 1;
    background: #fff;
    color: #333;
    border: 1.5px solid #d0d0d0;
    padding: 14px 0;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.15s;
}

#reset-button:hover {
    background: #f0f0f0;
}

/* Results placeholder (shown before Calculate is pressed) */
#results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 40px;
    gap: 16px;
}

#food-results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 40px;
    gap: 16px;
}

#food-results-placeholder .fa-apple-whole {
    font-size: 5rem;
    color: #d0d4dc;
}

#results-placeholder .fa-heart-pulse {
    font-size: 5rem;
    color: #d0d4dc;
}

.placeholder-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #aaa;
    margin: 0;
    text-align: center;
}

.placeholder-sub {
    font-size: 0.9rem;
    color: #bbb;
    margin: 0;
    text-align: center;
}

/* Two-column page layout */
.calc-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.calc-results-col {
    flex: 1;
    min-width: 0;
}

.calc-form-col {
    flex: 1;
    min-width: 0;
}

/* Icons inside result label */
.result-label i {
    font-size: 0.9em;
    margin-right: 3px;
    color: #555;
}

@media (max-width: 768px) {
    .calc-layout {
        flex-direction: column;
        align-items: stretch;
    }
}

.hidden {
    display: none;
}

/*Recommended plan card that shows inside the calculator div/tab*/
#recommended-plan-card {
    margin-top: 28px;
}

.plan-card {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-left: 4px solid #1a73e8;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.plan-card-header {
    display: flex;
    align-items: center;
    gap: 10px; 
    margin-bottom: 14px;
}

.plan-card-header i {
    color: #1a73e8;
    font-size: 1rem;
}

.plan-card-header h3 {
    font-size: 1rem; 
    font-weight: 700;
    color: #111;
    margin: 0;
}

.plan-split-name {
    font-size: 1rem;
    font-weight: 800;
    color: #111; 
    margin-bottom: 6px;
}

.plan-meta {
    font-size: 0.5em;
    color: #888;
    margin-bottom: 12px;
}

.plan-rationale {
    font-size: 0.9em;
    color: #555;
    margin: 0 0 18px 0;

}


#view-workout-btn {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border: 8px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

#view-workout-btn:hover {
    background: #1558b0;
}

/*Style for the workout tab*/
#exercise-details-section {
    margin-top: 8px;
}

.exercise-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 14px 0;
}

.exercise-day-block {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.exercise-day-header {
    font-size: 0.8em;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}

.exercise-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.exercise-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #111;
}

.exercise-volume {
    font-size: 0.8em;
    color: #888;
    white-space: nowrap;
}

/*Food nutrition*/
#nutrition-search-btn {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 4px;
}

#nutrition-search-btn:hover{
    background: #1558b0;
}

.collapsible {
  background: #fff;
  color: #111;
  cursor: pointer;
  padding: 18px 20px;
  width: 100%;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  text-align: left;
  outline: none;
  font-size: 0.95em;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  transition: background 0.15s, border-color 0.15s;
  margin-top: 8px;
}

.collapsible.active, .collapsible:hover {
  background-color: #f0f0f0;
  border-color: #d0d0d0;
  color: #1a73e8;
}

.collapsible:after {
  content: '\002B';
  color: #888;
  font-weight: bold;
  float: right;
  margin-left: 5px;
}

.active:after {
  content: "\2212";
  color: #1a73e8;
}

.content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
  background-color: transparent;
}

.content .food-data {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 16px 18px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
}
/*Portion selector*/
.content label {
    font-size: 0.8em;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.portion-select {
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.9em;
    background: #fff;
    outline: none;
    cursor: pointer;
    margin-left: 6px;
    color: #111;
}

#result-nutrients i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
    color: #555;
}

/* Icon colors for each macro */
 #result-nutrients .fa-drumstick-bite { color: #dd7041; }
 #result-nutrients .fa-bread-slice    { color: #d0a020; }
 #result-nutrients .fa-cheese         { color: #1f67e2; }
 #result-nutrients .fa-fire           { color: #e8571a;}

#result-nutrients ul {
    list-style-type: none;
    padding: 0;
    margin: 14px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#result-nutrients ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    padding: 10px 14px;
    background: #f9f9f9;
    border: 1px solid #ebebeb;
    border-radius: 8px;
}

#result-nutrients ul li span {
    margin-left: auto;
    font-size: 1em;
    font-weight: 700;
    color: #111;
}


.custom-serving-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.9em;
    color: #555;
}

.custom-serving-input {
    width: 70px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.9em;
    background: #fff;
    color: #111;
    outline: none;
    /* hide browser number spinners */
    -moz-appearance: textfield;
}

.custom-serving-input::-webkit-outer-spin-button,
.custom-serving-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-serving-input:focus {
    border-color: #1a73e8;
}

/*Chat bot button*/
#chat-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 70px;
    height: 65px;
    border-radius: 8px;
    background: #1a73e8;
    color: #fff;
    font-size: 22px;
    border: none;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s;
}

#chat-toggle-btn.btn-hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

#chat-window {
    position: fixed;
    bottom: 95px;
    right: 24px;
    width: 40%;
    height: 70vh;
    max-width: calc(100vh - 120px);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transform-origin: bottom right;
    opacity: 0;
    transform: scale(0.05);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(to bottom, #1a73e8 0%, #1a73e8 18%, #e8f0fe 38%, #fff 54%);
}

#chat-window.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

#chat-header {
    font-family: "Kaushan Script", cursive;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
    padding: 20px 20px 70px;
    background: transparent;
    color: #fff;
    border-radius: 40px 40px 0 0;
    
}

@media (max-width: 480px) {
    #chat-window { width: calc(100vw - 48px); }
}

#chat-close-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}

#chat-message {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
}

.chat-bubble.user {
    background: #1a73e8;
    color: #fff;
    align-self: flex-end;
}

.chat-bubble.ai {
    background: rgba(255, 255, 255, 0.82);
    color: #111;
    align-self: flex-start;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e0e0e0;
}

#chat-input {
    flex: 1; 
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

#chat-input:focus {
    border-color: #1a73e8;
}

#chat-send-btn {
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 15px;
}

.chat-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    margin: 4px 0;
}

.chat-table th,
.chat-table td {
    border: 1px solid #d0d0d0;
    padding: 6px 10px;
    text-align: left;
}

.chat-table thead th {
    background: #1a73e8;
    color: #fff;
    font-weight: 600;
}

.chat-table tbody tr:nth-child(even) {
    background: #f5f7ff;
}

/* Barcode Scanner */
#barcode-scan-btn {
    background: #1e8f4e;
    color: #fff;
    border: none;
    padding: 10px 10px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    height: 41px;
}

#barcode-scan-btn:hover {
    background: #157a3e;
}

.scanner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.scanner-overlay.hidden {
    display: none;
}

.scanner-modal {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    width: min(420px, calc(100vw - 40px));
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    display: flex;
    align-items: center;
    gap: 8px;
}

#scanner-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #888;
    transition: color 0.15s;
    padding: 4px;
}

#scanner-close-btn:hover {
    color: #111;
}

.scanner-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scanner-corners {
    position: absolute;
    inset: 20px;
    pointer-events: none;
    box-shadow:
        inset 20px  20px 0 -17px #fff,
        inset -20px 20px 0 -17px #fff,
        inset 20px -20px 0 -17px #fff,
        inset -20px -20px 0 -17px #fff;
    border-radius: 4px;
}

.scanner-line {
    position: absolute;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(to right, transparent, #1e8f4e, transparent);
    top: 20px;
    animation: scanline 2s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0%   { top: 20px; opacity: 1; }
    90%  { top: calc(100% - 22px); opacity: 1; }
    100% { top: calc(100% - 22px); opacity: 0; }
}

.scanner-status {
    text-align: center;
    font-size: 0.88em;
    color: #666;
    margin: 0;
}

@media (max-width: 480px) {
    .scanner-modal {
        border-radius: 12px;
        padding: 14px;
    }
    #barcode-scan-btn {
        padding: 10px 14px;
        font-size: 0.82em;
    }
}

/* Custom serving size input */
.custom-serving-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.9em;
    color: #555;
}

.custom-serving-input {
    width: 70px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.9em;
    background: #fff;
    color: #111;
    outline: none;
    -moz-appearance: textfield;
}

.custom-serving-input::-webkit-outer-spin-button,
.custom-serving-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-serving-input:focus {
    border-color: #1a73e8;
}


/* Legal - Terms and Conditions / Privacy Policy */
.legal-doc {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    color: #222;
    line-height: 1.6;
}

.legal-doc h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 8px;
}

.legal-doc h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
    margin-top: 20px;
    margin-bottom: 6px;
}

.legal-doc h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111;
    margin-top: 32px;
    margin-bottom: 8px;
}

.legal-doc p {
    margin: 12px 0;
}

.legal-doc ul {
    margin: 12px 0;
    padding-left: 24px;
}

.legal-doc li {
    margin: 6px 0;
}

.legal-doc hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 32px 0;
}

.legal-doc .table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 12px 0;
}

.legal-doc table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    margin: 0;
}

.legal-doc th,
.legal-doc td {
    text-align: left;
    padding: 8px 12px;
    border: 1px solid #ddd;
    font-size: 0.95em;
}

.legal-doc th {
    background: #f0f0f0;
}

.legal-doc code {
    background: #eee;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.9em;
    word-break: break-word;
}

@media (max-width: 600px) {
    .legal-doc {
        padding: 24px 16px 56px;
        line-height: 1.55;
    }

    .legal-doc h1 {
        font-size: 1.5rem;
    }

    .legal-doc h2 {
        font-size: 1.05rem;
        margin-top: 26px;
    }

    .legal-doc h3 {
        font-size: 0.95rem;
    }

    .legal-doc ul {
        padding-left: 20px;
    }
}

@media (max-width: 480px) {
    .legal-doc th,
    .legal-doc td {
        padding: 6px 8px;
        font-size: 0.85em;
    }
}


/* ============ About Page ============ */

.about-badge,
.about-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eaf1fd;
    color: #1a73e8;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 18px;
}

.about-accent {
    color: #1a73e8;
}

.about-store-badge {
    display: inline-flex;
}

.about-store-badge img {
    height: 48px;
    width: auto;
    display: block;
}

.header-app-store-badge {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-app-store-badge img {
    height: 40px;
    width: auto;
    display: block;
}

.about-section-head {
    max-width: 640px;
    margin: 0 auto 48px;
    text-align: center;
}

.about-section-head h2 {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111;
    margin: 0 0 14px;
}

.about-section-head p {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Hero */
.about-hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 56px 24px 64px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.about-hero h1 {
    font-size: 3rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111;
    margin: 0 0 20px;
}

.about-hero-sub {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
    max-width: 460px;
    margin: 0 0 32px;
}

.about-hero-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.about-hero-note {
    font-size: 0.85rem;
    color: #888;
}

.about-hero-image img,
.about-showcase-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Stat bar */
.about-stats {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

.about-stats-inner {
    background: #f5f5f5;
    border-radius: 20px;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.about-stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: #1a73e8;
}

.about-stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

/* Feature grid */
.about-features {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 80px;
}

.about-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.about-feature-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 26px;
}

.about-feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #eaf1fd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.about-feature-icon i {
    font-size: 20px;
    color: #1a73e8;
}

.about-feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.about-feature-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    color: #666;
}

/* Showcase sections (workouts / analytics) */
.about-showcase {
    padding: 20px 0 90px;
}

.about-showcase--muted {
    background: #f5f5f5;
    padding: 90px 0;
}

.about-showcase-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}

.about-showcase h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #111;
    margin: 0 0 18px;
}

.about-showcase-text p {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    max-width: 460px;
    margin: 0 0 26px;
}

.about-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.about-checklist li {
    position: relative;
    padding-left: 32px;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
}

.about-checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #1a73e8;
}

/* Testimonials */
.about-testimonials {
    max-width: 1200px;
    margin: 0 auto;
    padding: 90px 24px;
}

.about-testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.about-testimonial-card {
    background: #f5f5f5;
    border-radius: 18px;
    padding: 28px;
}

.about-testimonial-quote {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #222;
    margin-bottom: 20px;
}

.about-testimonial-person {
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-testimonial-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dce9fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a73e8;
    flex-shrink: 0;
}

.about-testimonial-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111;
}

.about-testimonial-role {
    font-size: 0.78rem;
    color: #888;
}

/* Closing CTA */
.about-cta-wrap {
    max-width: 1200px;
    margin: 0 auto 90px;
    padding: 0 24px;
}

.about-cta {
    background: #1a73e8;
    border-radius: 24px;
    padding: 64px;
    text-align: center;
}

.about-cta h2 {
    font-size: 2.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
}

.about-cta p {
    font-size: 1rem;
    color: #eaf1fd;
    margin: 0 0 30px;
}

/* About footer (Terms / Privacy links live here) */
.about-footer {
    border-top: 1px solid #eee;
    background-color: #fff;
}

.about-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.about-footer-brand {
    font-size: 1rem;
    font-weight: 800;
    color: #111;
}

.about-footer-links {
    display: flex;
    gap: 28px;
    font-size: 0.9rem;
}

.about-footer-links a {
    color: #666;
    text-decoration: none;
}

.about-footer-links a:hover {
    color: #1a73e8;
}

.about-footer-copy {
    font-size: 0.8rem;
    color: #888;
}

@media (max-width: 900px) {
    .about-hero {
        grid-template-columns: 1fr;
        padding: 40px 24px 48px;
    }

    .about-stats-inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-showcase-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-testimonial-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .about-hero h1 {
        font-size: 2.1rem;
    }

    .about-section-head h2,
    .about-showcase h2 {
        font-size: 1.6rem;
    }

    .about-stats-inner {
        grid-template-columns: repeat(2, 1fr);
        padding: 24px 16px;
    }

    .about-features {
        padding: 20px 20px 56px;
    }

    .about-showcase {
        padding: 10px 0 56px;
    }

    .about-showcase--muted {
        padding: 56px 0;
    }

    .about-testimonials {
        padding: 56px 20px;
    }

    .about-cta {
        padding: 40px 24px;
    }

    .about-cta h2 {
        font-size: 1.6rem;
    }

    .about-footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
