/* ============================================================
   KCALS — Main Stylesheet
   Palette: Clean White | Mint Green #2ECC71 | Dark Slate #2C3E50
   Font: Inter (Google Fonts)
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green:       #2ECC71;
    --green-dark:  #27AE60;
    --green-light: #EAFAF1;
    --slate:       #2C3E50;
    --slate-mid:   #5D6D7E;
    --slate-light: #BDC3C7;
    --white:       #FFFFFF;
    --bg:          #F7F9FC;
    --card-bg:     #FFFFFF;
    --border:      #E8EDF2;
    --red:         #E74C3C;
    --yellow:      #F1C40F;
    --blue:        #3498DB;
    --radius:      14px;
    --shadow:      0 2px 16px rgba(44,62,80,0.08);
    --shadow-hover:0 6px 28px rgba(44,62,80,0.14);
    --transition:  0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--slate);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.25; color: var(--slate); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p  { color: var(--slate-mid); }

.text-small  { font-size: 0.82rem; }
.text-muted  { color: var(--slate-light); }
.text-green  { color: var(--green-dark); }
.text-center { text-align: center; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }

/* ---------- Layout Helpers ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 520px; margin: 0 auto; padding: 0 1.25rem; }

.flex        { display: flex; }
.flex-wrap   { flex-wrap: wrap; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden { display: none !important; }

/* ---------- Navbar ---------- */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(44,62,80,0.06);
}

.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--green-dark);
    letter-spacing: -0.5px;
}

.navbar-brand span { color: var(--slate); }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.navbar-nav a {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--slate-mid);
    transition: background var(--transition), color var(--transition);
}
.navbar-nav a svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    vertical-align: middle;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    background: var(--green-light);
    color: var(--green-dark);
    text-decoration: none;
}

.navbar-nav a.btn-nav {
    background: var(--green);
    color: var(--white);
    font-weight: 600;
}

.navbar-nav a.btn-nav:hover { background: var(--green-dark); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary {
    background: var(--green);
    color: var(--white);
    box-shadow: 0 3px 12px rgba(46,204,113,0.3);
}
.btn-primary:hover { background: var(--green-dark); box-shadow: 0 5px 18px rgba(46,204,113,0.4); }

.btn-outline {
    background: transparent;
    color: var(--green-dark);
    border: 2px solid var(--green);
}
.btn-outline:hover { background: var(--green-light); }

.btn-secondary {
    background: var(--bg);
    color: var(--slate);
    border: 2px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
    background: var(--red);
    color: var(--white);
}
.btn-danger:hover { background: #c0392b; }

.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-hover); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title .icon-wrap {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--green-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--green-dark);
    flex-shrink: 0;
}

/* ---------- Stat Cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--slate);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value.green { color: var(--green-dark); }
.stat-card .stat-label { font-size: 0.75rem; color: var(--slate-mid); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- Zone Badge ---------- */
.zone-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.zone-badge.green  { background: #EAFAF1; color: #1E8449; }
.zone-badge.yellow { background: #FEF9E7; color: #B7950B; }
.zone-badge.red    { background: #FDEDEC; color: #922B21; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--slate);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46,204,113,0.15);
}

.form-control::placeholder { color: var(--slate-light); }

select.form-control { cursor: pointer; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.form-hint { font-size: 0.78rem; color: var(--slate-mid); margin-top: 0.3rem; }

/* Range slider */
.range-wrap { position: relative; }
.form-range {
    width: 100%;
    accent-color: var(--green);
    height: 6px;
    cursor: pointer;
}
.range-output {
    display: inline-block;
    font-weight: 700;
    color: var(--green-dark);
    font-size: 1.1rem;
    margin-left: 0.5rem;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success { background: #EAFAF1; border-color: var(--green);  color: #1E8449; }
.alert-error   { background: #FDEDEC; border-color: var(--red);    color: #922B21; }
.alert-warning { background: #FEF9E7; border-color: var(--yellow); color: #9A7D0A; }
.alert-info    { background: #EBF5FB; border-color: var(--blue);   color: #1F618D; }

/* ---------- Hero Section ---------- */
.hero {
    background: linear-gradient(135deg, #EAFAF1 0%, #F7F9FC 60%, #EBF5FB 100%);
    padding: 4.5rem 1.25rem 4rem;
    overflow: hidden;
}

.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 2.9rem;
    line-height: 1.13;
    margin-bottom: 1.1rem;
}

.hero-text p {
    font-size: 1.1rem;
    max-width: 460px;
    margin: 0 0 2rem;
    color: var(--slate-mid);
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-svg {
    width: 100%;
    max-width: 440px;
    height: auto;
    animation: heroFloat 5s ease-in-out infinite;
}

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

/* ---------- Stats Strip ---------- */
.stats-strip {
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stats-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 1.5rem 2.75rem;
    border-right: 1px solid var(--border);
    flex: 1;
    min-width: 120px;
}

.stat-item:last-child { border-right: none; }

.stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--green-dark);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--slate-mid);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* ---------- Feature Grid ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.feature-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--green-light);
    color: var(--green-dark);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card h3 { margin-bottom: 0.5rem; font-size: 1rem; }

/* ---------- Meal Plan Grid ---------- */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.day-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Hormetic Recharge Day highlight (v0.9.5) */
.recharge-day-card {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255,193,7,.25), var(--shadow);
}
.recharge-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: #ffc107;
    color: #4a2c00;
    font-size: .68rem;
    font-weight: 700;
    border-radius: 99px;
    padding: .15rem .55rem;
    letter-spacing: .02em;
    flex-shrink: 0;
}

.day-card-header {
    background: var(--green-light);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.day-card-title,
.day-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.day-card-title {
    flex-wrap: wrap;
}
.day-card-actions {
    flex-shrink: 0;
}
.day-name { font-weight: 700; color: var(--green-dark); font-size: 0.9rem; }
.day-date { font-size: 0.75rem; color: var(--slate-mid); }
.day-kcal { font-size: 0.8rem; font-weight: 700; color: var(--slate); }
.day-regenerate-form {
    margin: 0;
}
.day-regenerate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 26px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.18rem 0.5rem;
    white-space: nowrap;
}
.day-regenerate-btn:hover {
    border-color: var(--green);
    color: var(--green-dark);
}
.day-quality {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: #fbfdff;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
}
.day-quality span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: #f1f5f9;
}
.day-quality .day-quality-status {
    font-weight: 800;
}
.day-quality-easy .day-quality-status {
    background: #dcfce7;
    color: #166534;
}
.day-quality-balanced .day-quality-status {
    background: #dbeafe;
    color: #1d4ed8;
}
.day-quality-watch .day-quality-status {
    background: #fef3c7;
    color: #92400e;
}
.day-quality-heavy .day-quality-status {
    background: #fee2e2;
    color: #991b1b;
}

.plan-history {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.plan-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.plan-history-header h2 {
    margin: 0 0 0.15rem;
    color: var(--slate);
    font-size: 1rem;
}
.plan-history-header p {
    margin: 0;
    color: var(--slate-mid);
    font-size: 0.78rem;
}
.plan-history-header > span {
    flex-shrink: 0;
    color: var(--slate-mid);
    font-size: 0.72rem;
    font-weight: 800;
}
.plan-history-list {
    display: grid;
}
.plan-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}
.plan-history-item:last-child {
    border-bottom: 0;
}
.plan-history-item.is-current {
    background: #f0fdf4;
}
.plan-history-item.is-previewed {
    background: #eff6ff;
}
.plan-history-main {
    min-width: 0;
}
.plan-history-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    color: var(--slate);
    font-size: 0.86rem;
}
.plan-history-title span {
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.64rem;
    font-weight: 800;
    padding: 0.08rem 0.42rem;
}
.plan-history-title span.is-preview {
    background: #dbeafe;
    color: #1d4ed8;
}
.plan-history-meta,
.plan-history-quality {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
    color: var(--slate-mid);
    font-size: 0.72rem;
    font-weight: 700;
}
.plan-history-meta span {
    border-radius: 999px;
    background: #f1f5f9;
    padding: 0.08rem 0.42rem;
}
.plan-history-quality {
    color: var(--slate-light);
    font-weight: 600;
}
.plan-history-actions,
.plan-preview-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.plan-history-restore {
    flex-shrink: 0;
    margin: 0;
}
.plan-preview-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #93c5fd;
    border-radius: var(--radius);
    background: #eff6ff;
    color: #1e3a8a;
}
.plan-preview-banner strong {
    display: block;
    font-size: 0.92rem;
}
.plan-preview-banner span {
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 700;
}
.plan-preview-compare {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 0.85rem 1rem;
}
.plan-preview-compare-title {
    margin-bottom: 0.55rem;
    color: var(--slate);
    font-size: 0.86rem;
    font-weight: 800;
}
.plan-preview-compare-grid {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.plan-preview-compare-grid span {
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.16rem 0.5rem;
}
.plan-preview-compare-grid span.is-better {
    background: #dcfce7;
    color: #166534;
}
.plan-preview-compare-grid span.is-worse {
    background: #fee2e2;
    color: #991b1b;
}

.meal-list { padding: 0.75rem; }

.meal-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

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

.meal-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0; margin-top: 0.45rem;
}

.meal-dot.breakfast { background: #F39C12; }
.meal-dot.lunch     { background: var(--green); }
.meal-dot.dinner    { background: #3498DB; }
.meal-dot.snack     { background: #9B59B6; }

.meal-info { flex: 1; min-width: 0; overflow: hidden; }
.meal-type  { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--slate-mid); }
.meal-name  { font-size: 0.85rem; font-weight: 600; color: var(--slate); white-space: normal; word-break: break-word; overflow-wrap: break-word; }
.meal-macros-row { display: flex; gap: 0.35rem; flex-wrap: wrap; font-size: 0.68rem; color: var(--slate-light); margin-top: 0.2rem; }
.meal-ingredients { font-size: 0.68rem; color: var(--slate-mid); margin-top: 0.18rem; line-height: 1.5; }
.meal-ingredients .ing-sep { color: var(--border); margin: 0 0.15rem; }
.meal-ingredients .ing-item strong { color: var(--slate); font-weight: 600; }
.meal-kcal  { font-size: 0.75rem; font-weight: 700; color: var(--slate-mid); flex-shrink: 0; }
.meal-item-replaced {
    background: #f8fafc;
}
.meal-item-locked {
    background: #f7fee7;
}
.meal-replaced-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    padding: 0.06rem 0.35rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}
.meal-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    margin-left: 0.35rem;
    padding: 0.06rem 0.35rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}
.meal-replace {
    margin: 0;
}
.meal-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.45rem;
}
.meal-replace summary {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--green-dark);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    list-style: none;
}
.meal-replace summary::-webkit-details-marker {
    display: none;
}
.meal-replace-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.45rem;
}
.meal-replace-select {
    max-width: 190px;
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--slate);
    font-size: 0.78rem;
    padding: 0.35rem 0.5rem;
}
.meal-replace-ingredient {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--slate-mid);
    font-size: 0.72rem;
    font-weight: 700;
}
.meal-replace-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--slate-mid);
    font-size: 0.72rem;
    font-weight: 600;
}
.meal-replace-checkbox input {
    width: 14px;
    height: 14px;
}
.meal-replace-submit {
    min-height: 34px;
    padding: 0.35rem 0.65rem;
}
.meal-undo-form {
    margin: 0;
}
.meal-lock-form {
    margin: 0;
}
.meal-undo-btn,
.meal-lock-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 26px;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0;
}
.meal-lock-btn.is-locked {
    color: #166534;
}
.meal-undo-btn:hover,
.meal-lock-btn:hover {
    color: var(--green-dark);
}

/* ---------- Progress Chart ---------- */
.chart-wrap {
    position: relative;
    height: 220px;
    width: 100%;
}

/* ---------- Check-in Form ---------- */
.checkin-slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.checkin-slider-row label { flex: 0 0 140px; font-size: 0.85rem; }
.checkin-slider-row input[type=range] { flex: 1; }

/* ---------- Tips ---------- */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.tip-card {
    background: var(--green-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid #C8F7D8;
}

.tip-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.tip-text { font-size: 0.85rem; color: var(--slate); font-weight: 500; }

/* ---------- Auth Pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background: linear-gradient(135deg, #EAFAF1 0%, #F7F9FC 70%);
}

.auth-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(44,62,80,0.12);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
}

.auth-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--green-dark);
    text-align: center;
    margin-bottom: 0.25rem;
}

.auth-logo span { color: var(--slate); }
.auth-subtitle { text-align: center; color: var(--slate-mid); font-size: 0.9rem; margin-bottom: 2rem; }

.auth-divider {
    text-align: center;
    margin: 1.25rem 0;
    position: relative;
    color: var(--slate-light);
    font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 2rem);
    height: 1px;
    background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ---------- Dashboard Layout ---------- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

.sidebar {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem 0;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--slate-mid);
    transition: background var(--transition), color var(--transition);
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: var(--green-light);
    color: var(--green-dark);
    text-decoration: none;
}

.sidebar-nav li a .nav-icon { width: 18px; text-align: center; }

.sidebar-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--slate-light);
    padding: 0.75rem 1.5rem 0.25rem;
}

.dashboard-content { min-width: 0; }

/* ---------- Macros Bar ---------- */
.macro-bars { display: flex; flex-direction: column; gap: 0.5rem; }

.macro-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.macro-label { font-size: 0.78rem; font-weight: 600; color: var(--slate); min-width: 70px; }

.macro-bar-bg {
    flex: 1; height: 8px; border-radius: 4px;
    background: var(--border);
    overflow: hidden;
}

.macro-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.macro-bar-fill.protein { background: #E74C3C; }
.macro-bar-fill.carbs   { background: #F39C12; }
.macro-bar-fill.fat     { background: #9B59B6; }

.macro-val { font-size: 0.78rem; font-weight: 700; color: var(--slate); min-width: 50px; text-align: right; }

/* ---------- Progress Badges ---------- */
.progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.progress-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.82rem;
    color: var(--slate-light);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}
.footer-version {
    opacity: .55;
    font-size: .75rem;
    letter-spacing: .3px;
}

/* ---------- Section Padding ---------- */
.section { padding: 4rem 1.25rem; }
.section-sm { padding: 2rem 1.25rem; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; display: flex; flex-wrap: wrap; padding: 0.75rem; gap: 0.25rem; }
    .sidebar-nav { display: flex; flex-wrap: wrap; width: 100%; }
    .sidebar-nav li a { padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.8rem; }
    .sidebar-section-title { display: none; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr; }
    .plan-grid   { grid-template-columns: 1fr; }
    .day-card-header { align-items: flex-start; }
    .day-card-actions { flex-wrap: wrap; justify-content: flex-end; }
    .plan-history-header,
    .plan-history-item,
    .plan-preview-banner,
    .plan-preview-compare {
        align-items: flex-start;
        flex-direction: column;
    }
    .stat-grid   { grid-template-columns: repeat(2, 1fr); }
    .auth-card   { padding: 1.75rem 1.25rem; }
    /* Hero split → stack */
    .hero-inner  { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
    .hero-text p { margin-left: auto; margin-right: auto; }
    .hero-cta    { justify-content: center; }
    .hero-visual { order: -1; }
    .hero-svg    { max-width: 300px; }
    /* Stats strip */
    .stat-item   { padding: 1.25rem 1.5rem; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    .hero-text h1 { font-size: 2rem; }
    .hero { padding: 3rem 1rem 2.5rem; }
    .hero-svg { max-width: 260px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card .stat-value { font-size: 1.5rem; }
    .stat-item { padding: 1rem; border-right: none; border-bottom: 1px solid var(--border); }
    .stat-item:last-child { border-bottom: none; }
}

/* ---------- Language Switcher ---------- */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.75rem;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--slate-mid);
    border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.lang-btn:hover {
    background: var(--bg);
    border-color: var(--border);
    color: var(--slate);
    text-decoration: none;
}

.lang-btn.active {
    background: var(--green-light);
    border-color: var(--green);
    color: var(--green-dark);
}

@media (max-width: 600px) {
    .lang-switcher { margin-left: 0.25rem; }
    .lang-btn { padding: 0.2rem 0.3rem; font-size: 0.68rem; }
}

/* ---------- Disclaimer Modal ---------- */
.disclaimer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(44, 62, 80, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.disclaimer-overlay.visible {
    display: flex;
    animation: disclaimerFadeIn 0.35s ease forwards;
}

.disclaimer-overlay.hiding {
    animation: disclaimerFadeOut 0.35s ease forwards;
}

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

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

.disclaimer-modal {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(44, 62, 80, 0.22);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 520px;
    text-align: center;
    animation: disclaimerSlideUp 0.38s cubic-bezier(.22,.68,0,1.2) forwards;
}

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

.disclaimer-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #FEF9E7;
    border: 2px solid #F39C12;
    color: #F39C12;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.6rem;
}

.disclaimer-icon svg {
    width: 28px;
    height: 28px;
}

.disclaimer-modal h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--slate);
    margin-bottom: 1rem;
}

.disclaimer-modal p {
    font-size: 0.92rem;
    color: var(--slate-mid);
    line-height: 1.7;
    margin-bottom: 1.75rem;
    text-align: left;
}

.disclaimer-modal strong {
    color: var(--slate);
    font-weight: 700;
}

@media (max-width: 480px) {
    .disclaimer-modal { padding: 1.75rem 1.25rem; }
    .disclaimer-modal h2 { font-size: 1.1rem; }
}

/* ========== HOMEPAGE v2 (landing page) ========== */

/* Hero badge */
.hero-badge {
    display: inline-block;
    background: var(--green-light);
    color: var(--green-dark);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: .3rem .9rem;
    border-radius: 50px;
    margin-bottom: 1.1rem;
}

/* Trust badge line */
.lp-trust-badge {
    font-size: .78rem;
    color: var(--slate-mid);
    margin-top: .75rem;
}

/* Hero photo mosaic */
.hero-mosaic {
    position: relative;
    flex: 0 0 auto;
    width: 440px;
}
.mosaic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    border-radius: 20px;
    overflow: hidden;
}
.mosaic-tall img,
.mosaic-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mosaic-tall {
    height: 380px;
    border-radius: 16px;
    overflow: hidden;
}
.mosaic-col {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.mosaic-sm {
    height: 187px;
    border-radius: 16px;
    overflow: hidden;
}

/* Floating stat cards on mosaic */
.mosaic-float {
    position: absolute;
    background: #fff;
    border-radius: 14px;
    padding: .6rem .9rem;
    box-shadow: 0 6px 24px rgba(44,62,80,.14);
    display: flex;
    align-items: center;
    gap: .5rem;
    pointer-events: none;
}
.mosaic-float-tl { top: 18px; left: -18px; }
.mosaic-float-br { bottom: 22px; right: -14px; }
.mf-label { font-size: .68rem; color: var(--slate-mid); font-weight: 600; display: block; }
.mf-value { font-size: .95rem; font-weight: 800; color: var(--slate-dark); }
.mf-value.green { color: var(--green-dark); }

/* Two-column layout used for multiple sections */
.lp-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: center;
}
.lp-feat-reverse { direction: rtl; }
.lp-feat-reverse > * { direction: ltr; }

/* Section badge (pill label) */
.lp-section-badge {
    display: inline-block;
    background: var(--green-light);
    color: var(--green-dark);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: .25rem .8rem;
    border-radius: 50px;
    margin-bottom: .85rem;
}

/* Image wrapper */
.lp-img-wrap {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(44,62,80,.12);
}
.lp-img-wrap img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}
.lp-img-wrap:hover img { transform: scale(1.03); }

/* Text side */
.lp-text-side h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: .85rem;
}
.lp-text-side p {
    color: var(--slate-mid);
    line-height: 1.75;
    font-size: .95rem;
}

/* Nutrition facts strip */
.lp-nutrition-section { background: var(--green-light); }
.lp-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}
.lp-fact {
    background: #fff;
    border-radius: 14px;
    padding: 1rem .75rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(44,62,80,.06);
}
.lp-fact-num {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--green-dark);
    line-height: 1;
    margin-bottom: .3rem;
}
.lp-fact-lbl {
    font-size: .72rem;
    color: var(--slate-mid);
    line-height: 1.4;
}

/* Testimonials */
.lp-testi-section { background: #f8fbff; }
.lp-testi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.lp-testi-card {
    background: #fff;
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(44,62,80,.07);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: box-shadow .2s, transform .2s;
}
.lp-testi-card:hover { box-shadow: 0 8px 32px rgba(44,62,80,.12); transform: translateY(-3px); }
.lp-testi-featured {
    border: 2px solid var(--green);
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(46,204,113,.18);
}
.lp-testi-featured:hover { transform: translateY(-9px); }
.lp-testi-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--green-dark);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lp-testi-quote {
    font-size: .9rem;
    line-height: 1.65;
    color: var(--slate-dark);
    flex: 1;
}
.lp-testi-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem;
}
.lp-testi-role { font-size: .75rem; color: var(--slate-mid); margin-top: .15rem; }
.lp-result-badge {
    background: var(--green-light);
    color: var(--green-dark);
    font-size: .72rem;
    font-weight: 700;
    padding: .25rem .6rem;
    border-radius: 50px;
    white-space: nowrap;
}

/* CTA section */
.lp-cta-section {
    position: relative;
    padding: 7rem 1.25rem;
    overflow: hidden;
    background-image: url('https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=1600&q=80&fit=crop&auto=format');
    background-size: cover;
    background-position: center 30%;
    background-attachment: fixed;
}
/* Dark green overlay so text stays readable */
.lp-cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(23,107,60,0.88) 0%, rgba(10,50,28,0.82) 100%);
    z-index: 0;
}
.lp-cta-inner {
    position: relative;
    z-index: 1;
    color: #fff;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}
.lp-cta-inner h2 { color: #fff; }
.lp-cta-section::after { display: none; }

/* Responsive */
@media (max-width: 900px) {
    .hero-mosaic { width: 100%; max-width: 440px; }
    .lp-two-col { grid-template-columns: 1fr; gap: 2rem; }
    .lp-feat-reverse { direction: ltr; }
    .lp-testi-grid { grid-template-columns: 1fr; }
    .lp-testi-featured { transform: none; }
    .lp-facts { grid-template-columns: 1fr 1fr; }
    .mosaic-float-tl { left: 8px; }
    .mosaic-float-br { right: 8px; }
}
@media (max-width: 540px) {
    .hero-mosaic { display: none; }
    .lp-facts { grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
    .lp-fact-num { font-size: 1.1rem; }
}

/* ========== / HOMEPAGE v2 ========== */

/* ========== ACHIEVEMENTS ========== */

/* Hero strip */
.ach-hero {
    background: linear-gradient(135deg, var(--green-dark) 0%, #1a5c36 100%);
    padding: 2.5rem 1.25rem 2rem;
    color: #fff;
}
.ach-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.ach-hero-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 900;
    margin-bottom: .4rem;
    color: #fff;
}
.ach-hero-sub { color: rgba(255,255,255,.8); font-size: .95rem; }

.ach-progress-circle { width: 80px; height: 80px; flex-shrink: 0; }

/* Filter tabs */
.ach-filters {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    padding-bottom: .5rem;
}
.ach-filter-btn {
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--slate-dark);
    padding: .35rem .85rem;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
}
.ach-filter-btn:hover  { border-color: var(--green); color: var(--green-dark); }
.ach-filter-btn.active { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }

/* Badge grid */
.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

/* Badge card */
.ach-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    cursor: default;
}
.ach-card.earned {
    box-shadow: 0 4px 18px rgba(44,62,80,.09);
    border-color: var(--border);
}
.ach-card.earned:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(44,62,80,.13);
}
.ach-card.locked {
    background: #f5f7fa;
    opacity: .55;
    filter: grayscale(60%);
}

/* Tier border colors */
.ach-card.earned.tier-bronze   { border-color: #cd7f32; }
.ach-card.earned.tier-silver   { border-color: #a8a9ad; }
.ach-card.earned.tier-gold     { border-color: #ffd700; box-shadow: 0 4px 20px rgba(255,215,0,.25); }
.ach-card.earned.tier-platinum { border-color: #b9f2ff; box-shadow: 0 4px 24px rgba(100,220,255,.3); }

.ach-card-icon  { font-size: 2.2rem; line-height: 1; margin-bottom: .1rem; }
.ach-card-tier  { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-mid); }
.ach-card-title { font-size: .82rem; font-weight: 800; color: var(--slate-dark); line-height: 1.25; }
.ach-card-desc  { font-size: .72rem; color: var(--slate-mid); line-height: 1.4; }
.ach-card-earned { font-size: .68rem; color: var(--green-dark); font-weight: 600; margin-top: .25rem; }
.ach-card-locked-lbl {
    font-size: .68rem; color: var(--slate-mid);
    display: flex; align-items: center; gap: .2rem;
    margin-top: .25rem;
}

/* Tier badge glow for gold/platinum */
.tier-gold.earned    .ach-card-tier { color: #b8860b; }
.tier-platinum.earned .ach-card-tier { color: #5cb8ce; }
.tier-bronze.earned  .ach-card-tier { color: #a0522d; }
.tier-silver.earned  .ach-card-tier { color: #808080; }

/* Toast notifications */
#ach-toast-container {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    pointer-events: none;
}
.ach-toast {
    background: #fff;
    border-radius: 14px;
    padding: .75rem 1rem;
    box-shadow: 0 8px 32px rgba(44,62,80,.18);
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 260px;
    max-width: 340px;
    pointer-events: all;
    animation: toastIn .35s ease;
    border-left: 5px solid var(--green);
    transition: opacity .4s, transform .4s;
}
.ach-toast.fading { opacity: 0; transform: translateX(30px); }
.ach-toast-bronze   { border-left-color: #cd7f32; }
.ach-toast-silver   { border-left-color: #a8a9ad; }
.ach-toast-gold     { border-left-color: #ffd700; }
.ach-toast-platinum { border-left-color: #5cb8ce; }
.ach-toast-icon { font-size: 1.8rem; flex-shrink: 0; }
.ach-toast-body { flex: 1; font-size: .82rem; }
.ach-toast-body strong { display: block; font-size: .85rem; margin-bottom: .1rem; }
.ach-toast-close {
    background: none; border: none; font-size: 1.2rem;
    cursor: pointer; color: var(--slate-mid); padding: 0 .2rem; line-height: 1;
}
@keyframes toastIn {
    from { opacity:0; transform:translateX(30px); }
    to   { opacity:1; transform:translateX(0); }
}

@media (max-width: 600px) {
    .ach-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .ach-hero-inner { flex-direction: column; align-items: flex-start; }
}

/* ========== / ACHIEVEMENTS ========== */

/* ========== SMART INSIGHTS ========== */

/* Page wrapper */
.ins-page {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Hero strip */
.ins-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.ins-hero-text h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: .3rem;
    color: var(--slate-dark);
}
.ins-hero-text p {
    color: var(--slate-mid);
    font-size: .95rem;
    margin: 0;
}

/* Summary strip */
.ins-summary-strip {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.ins-sum-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .75rem 1.25rem;
    text-align: center;
    min-width: 90px;
}
.ins-sum-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--slate-dark);
    line-height: 1.1;
}
.ins-sum-val.green  { color: var(--green-dark); }
.ins-sum-val.yellow { color: #D68910; }
.ins-sum-val.red    { color: #C0392B; }
.ins-sum-lbl {
    font-size: .7rem;
    color: var(--slate-mid);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: .3rem;
}

/* Generic insight card */
.ins-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}
.ins-card-head {
    margin-bottom: 1.25rem;
}
.ins-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate-dark);
    display: flex;
    align-items: center;
    gap: .4rem;
}
.ins-card-sub {
    font-size: .8rem;
    color: var(--slate-mid);
    margin-top: .2rem;
}
.ins-empty {
    text-align: center;
    color: var(--slate-mid);
    padding: 2rem;
    margin: 0;
}

/* ---- Heatmap ---- */
.ins-heatmap-wrap {
    overflow-x: auto;
    padding-bottom: .5rem;
}
.ins-heatmap-grid {
    display: flex;
    gap: 3px;
    align-items: flex-start;
    min-width: max-content;
}
.ins-heatmap-days {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 0;
}
.ins-heatmap-days span {
    font-size: .65rem;
    color: var(--slate-mid);
    height: 11px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 4px;
    width: 16px;
}
.ins-heatmap-cols {
    display: flex;
    gap: 3px;
}
.ins-heatmap-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ins-heatmap-cell {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: #EBEDF0;
    cursor: default;
    flex-shrink: 0;
}
.ins-heatmap-cell.z-green  { background: #2ECC71; }
.ins-heatmap-cell.z-yellow { background: #F39C12; }
.ins-heatmap-cell.z-red    { background: #E74C3C; }
.ins-heatmap-cell.empty    { background: #EBEDF0; }
.ins-heatmap-cell.future   { background: transparent; }
.ins-heatmap-months {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 14px;
    gap: 3px;
    margin-top: .4rem;
    margin-left: 20px;
    font-size: .65rem;
    color: var(--slate-mid);
}
.ins-heatmap-legend {
    margin-top: .75rem;
    font-size: .75rem;
    color: var(--slate-mid);
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
}

/* ---- Chart toggles ---- */
.ins-chart-toggles {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.ins-toggle {
    padding: .3rem .85rem;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--off-white);
    font-size: .78rem;
    font-weight: 600;
    color: var(--slate-mid);
    cursor: pointer;
    transition: all .18s;
}
.ins-toggle.active {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* ---- Correlations grid ---- */
.ins-corr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.ins-corr-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: .88rem;
    line-height: 1.5;
}
.ins-corr-icon { font-size: 1.3rem; flex-shrink: 0; }
.ins-corr-body { color: var(--slate-dark); }
.ins-corr-green  { background: #F0FDF4; border-color: #A7F3D0; }
.ins-corr-yellow { background: #FEFCE8; border-color: #FDE68A; }
.ins-corr-red    { background: #FFF5F5; border-color: #FECACA; }
.ins-corr-blue   { background: #EFF6FF; border-color: #BFDBFE; }
.ins-corr-purple { background: #F5F3FF; border-color: #DDD6FE; }
.ins-corr-orange { background: #FFF7ED; border-color: #FED7AA; }

/* ---- History table ---- */
.ins-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.ins-table thead tr {
    border-bottom: 2px solid var(--border);
}
.ins-table th {
    padding: .6rem .75rem;
    text-align: left;
    color: var(--slate-mid);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}
.ins-table th:not(:first-child) { text-align: center; }
.ins-table tbody tr {
    border-bottom: 1px solid var(--border);
}
.ins-table tbody tr:hover { background: var(--off-white); }
.ins-table td {
    padding: .65rem .75rem;
    vertical-align: middle;
    text-align: center;
}
.ins-table td:first-child { text-align: left; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .ins-hero {
        flex-direction: column;
    }
    .ins-heatmap-cell { width: 9px; height: 9px; }
}
@media (max-width: 540px) {
    .ins-corr-grid { grid-template-columns: 1fr; }
    .ins-summary-strip { gap: .6rem; }
    .ins-sum-item { min-width: 70px; padding: .6rem .9rem; }
    .ins-sum-val { font-size: 1.1rem; }
}

/* ========== / SMART INSIGHTS ========== */

/* ---------- Print Styles ---------- */
.no-print { }
.print-only { display: none; }

@media print {
    @page { size: A4 landscape; margin: 1cm; }

    .navbar, footer, .no-print, .alert { display: none !important; height: 0 !important; overflow: hidden !important; margin: 0 !important; padding: 0 !important; }
    .plan-grid { display: none !important; }
    .print-only { display: block !important; }

    body { background: white; font-size: 9pt; color: #1a2332; min-height: 0 !important; }

    .print-header {
        font-size: 9pt;
        margin-bottom: 0.5cm;
        color: #555;
        border-bottom: 1.5pt solid #2ecc71;
        padding-bottom: 0.2cm;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

    .print-table th,
    .print-table td {
        border: 0.5pt solid #bbb;
        padding: 4pt 5pt;
        vertical-align: top;
    }

    .print-table thead th {
        background: #e8f8ee;
        font-size: 8pt;
        font-weight: 700;
        text-align: center;
        text-transform: uppercase;
        letter-spacing: 0.3pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pt-day-col   { width: 10%; }
    .pt-meal-col  { width: 19%; }
    .pt-total-col { width: 13%; }

    .pt-day-name {
        font-weight: 700;
        font-size: 9pt;
        color: #1a6e3c;
        vertical-align: middle;
        text-align: center;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pt-meal-cell { background: #fff; }

    .print-table tbody tr:nth-child(even) .pt-meal-cell,
    .print-table tbody tr:nth-child(even) td {
        background: #fafafa;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pt-food-name {
        font-size: 8.5pt;
        font-weight: 600;
        margin-bottom: 2pt;
        line-height: 1.3;
    }

    .pt-ingredients {
        font-size: 7pt;
        color: #444;
        margin-bottom: 2pt;
        line-height: 1.4;
    }

    .pt-macros {
        font-size: 7pt;
        color: #666;
        line-height: 1.4;
    }

    .pt-total {
        font-size: 8.5pt;
        font-weight: 700;
        text-align: center;
        color: #1a6e3c;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
