/* Arabic text face, bundled with the page so it renders the same everywhere. */
@font-face {
    font-family: 'PlexArabic';
    src: url('./fonts/plex-arabic-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'PlexArabic';
    src: url('./fonts/plex-arabic-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'PlexArabic';
    src: url('./fonts/plex-arabic-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

html, body, #root { margin: 0; min-height: 100%; }
body { background: #0a090b; }

/* Brand palette taken from the Coach Hadeer logo: hot pink, black, white.
   Dark is the default; .ch-light switches the same page to the light palette. */
.ch-scope {
    --ds-teal: #ef0078;
    --ds-primary: #ef0078;
    --ds-page: #0a090b;
    --ds-background-1: #151318;
    --ds-background-2: #0a090b;
    --ds-background-3: #3a2b33;
    --ds-ink: #ffffff;
    --ds-foreground-1: #ffffff;
    --ds-foreground-2: #e7dce3;
    --ds-foreground-3: #c2b6be;
    --ds-foreground-4: rgba(255, 255, 255, .26);
    --ds-foreground-5: rgba(255, 255, 255, .08);
    --ds-hairline: rgba(255, 255, 255, .17);
    --ds-muted: #1c1920;
    --ds-raised: #1c1920;
    /* The kit bakes its aliases at :root, so restate them here for the dark palette. */
    --ds-ink-2: var(--ds-foreground-2);
    --ds-ink-3: var(--ds-foreground-3);
    --ds-ink-4: var(--ds-foreground-4);
    --ds-fg1: var(--ds-foreground-1);
    --ds-fg2: var(--ds-foreground-2);
    --ds-fg3: var(--ds-foreground-3);
    --ds-fg4: var(--ds-foreground-4);
    --ds-fg5: var(--ds-foreground-5);
    --ds-border: var(--ds-foreground-4);
    --ds-on-primary: #0a090b;
    --ds-danger: #ff3b30;
    --ds-success: #2fd45f;
    --ds-ring: 0 0 0 1px rgba(255, 255, 255, .06);
    --ds-shadow-control: 0 1px 2px rgba(0, 0, 0, .6);
    --file-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 30px 70px rgba(0, 0, 0, .55);
    --ds-font-display: 'PlexArabic', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --ds-font-text: 'PlexArabic', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    font-family: var(--ds-font-text);

    --ch-pink: #ef0078;
    --ch-pink-text: #ff6cb4;
    --ch-surface: rgba(255, 255, 255, .045);
    --ch-surface-line: rgba(255, 255, 255, .09);
    --ch-track: rgba(255, 255, 255, .1);
    --ch-plate: #ffe9f3;
    --ch-card-from: #ff3d9a;
    --ch-card-to: #ef0078;
    --ch-card-ink: #141013;
    --ch-card-muted: rgba(20, 16, 19, .72);
    --ch-card-track: rgba(20, 16, 19, .18);
    --ch-cold: #3d9bff;
    --ch-good: #2fd45f;
    --ch-warn: #ffa62b;
    --ch-hot: #ff3b30;

    background: #0a090b;
    min-height: 100vh;
}
.ch-scope.ch-light {
    --ds-page: #fdfcfb;
    --ds-background-1: #fff;
    --ds-background-2: #fdfcfb;
    --ds-background-3: #dacbc0;
    --ds-ink: #121214;
    --ds-foreground-1: #121214;
    --ds-foreground-2: rgba(18, 18, 20, .72);
    --ds-foreground-3: rgba(18, 18, 20, .52);
    --ds-foreground-4: rgba(18, 18, 20, .16);
    --ds-foreground-5: rgba(18, 18, 20, .05);
    --ds-hairline: #f0e0ea;
    --ds-muted: #fdf4f8;
    --ds-raised: #fdf4f8;
    --ds-on-primary: #fff;
    --ds-ring: 0 0 0 1px rgba(18, 18, 20, .05);
    --file-shadow: 0 1px 2px rgba(77, 53, 51, .05), 0 18px 40px rgba(120, 30, 70, .08);

    --ch-surface: #fff;
    --ch-surface-line: #f4e6ee;
    --ch-pink-text: #b8005c;
    --ch-track: #f3e2ea;
    --ch-plate: #ffe9f3;
    --ch-cold: #1f7ae0;
    --ch-good: #1aa848;
    --ch-warn: #d98400;
    --ch-hot: #e02b20;
    background: #fdfcfb;
}

/* Header row: logo plate + light/dark switch */
.ch-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ch-logo-wrap { display: flex; justify-content: center; }
.ch-logo-img { display: block; width: 100%; max-width: 190px; height: auto; }
.ch-logo-plate {
    background: var(--ch-plate);
    border-radius: 22px;
    padding: 10px 16px;
    max-width: 220px;
}
.ch-theme {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--ch-surface);
    box-shadow: inset 0 0 0 1px var(--ch-surface-line);
    flex: 0 0 auto;
}
.ch-theme button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ds-foreground-2);
    font: inherit;
    font-size: 12px;
    line-height: 18px;
    padding: 6px 10px;
    min-height: 32px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}
.ch-theme button.is-on { background: var(--ch-pink); color: #fff; font-weight: 600; }

/* Buttons follow the theme: the kit's unselected pill is white, which vanishes on black. */
.ch-scope .file-button { background: var(--ds-background-1); border-color: var(--ds-hairline); color: var(--ds-ink); }
.ch-scope .file-button[data-variant=ghost] { background: transparent; border-color: transparent; color: var(--ds-foreground-2); }
.ch-scope .file-button[aria-pressed=true] { background: var(--ds-teal); border-color: var(--ds-teal); color: #fff; }
.ch-scope .file-field { background: var(--ds-background-1); color: var(--ds-ink); }
.ch-scope .file-field::placeholder { color: var(--ds-foreground-3); }

/* Big number cards */
.ch-stat {
    background: linear-gradient(160deg, var(--ch-card-from), var(--ch-card-to));
    border-radius: 22px;
    padding: 20px 22px;
    color: var(--ch-card-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 10px 26px rgba(239, 0, 120, .18);
}
.ch-stat.is-hot { background: linear-gradient(160deg, #ff6a3d, #e0241a); color: #fff; }
.ch-stat-label { font-size: 12px; line-height: 18px; color: var(--ch-card-muted); }
.ch-stat.is-hot .ch-stat-label { color: rgba(255, 255, 255, .85); }
.ch-stat-value { font-family: var(--ds-font-display); font-size: 40px; line-height: 46px; color: inherit; }
.ch-stat-value small { font-family: var(--ds-font-text); font-size: 14px; opacity: .72; }
.ch-stat-note { font-size: 12px; line-height: 18px; color: var(--ch-card-muted); margin-top: 6px; }
.ch-stat.is-hot .ch-stat-note { color: rgba(255, 255, 255, .85); }
.ch-stat .ch-bar { background: var(--ch-card-track); }
.ch-stat .ch-bar > span { background: var(--ch-card-ink); }
.ch-stat.is-hot .ch-bar > span { background: #fff; }

/* Heat bars: blue when there is room, green in the healthy band,
   orange near the limit, red over it. */
.ch-bar { height: 8px; border-radius: 999px; background: var(--ch-track); overflow: hidden; margin-top: 6px; }
.ch-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ch-pink); transition: width .18s ease, background .18s ease; }
.ch-bar.heat-cold > span { background: var(--ch-cold); }
.ch-bar.heat-good > span { background: var(--ch-good); }
.ch-bar.heat-warn > span { background: var(--ch-warn); }
.ch-bar.heat-hot > span { background: var(--ch-hot); }

.ch-macros { display: flex; flex-direction: column; gap: 14px; }
.ch-macro-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.ch-macro-name { font-weight: 600; color: var(--ds-ink); }
.ch-macro-value { color: var(--ds-foreground-2); }
.ch-macro-value b { color: var(--ds-ink); }
.ch-macro.is-hot .ch-macro-value b { color: var(--ch-hot); }

.ch-heat-pill {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 17px;
    white-space: nowrap;
    vertical-align: middle;
    background: rgba(255, 255, 255, .08);
    color: var(--ds-foreground-2);
}
.ch-macro.heat-cold .ch-heat-pill { background: color-mix(in srgb, var(--ch-cold) 18%, transparent); color: var(--ch-cold); }
.ch-macro.heat-good .ch-heat-pill { background: color-mix(in srgb, var(--ch-good) 18%, transparent); color: var(--ch-good); }
.ch-macro.heat-warn .ch-heat-pill { background: color-mix(in srgb, var(--ch-warn) 20%, transparent); color: var(--ch-warn); }
.ch-macro.heat-hot .ch-heat-pill { background: color-mix(in srgb, var(--ch-hot) 20%, transparent); color: var(--ch-hot); }

.ch-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ch-fields .file-control { min-width: 0; }
.ch-fields .file-field { padding: 0 12px; text-align: center; font-variant-numeric: tabular-nums; }

.ch-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-quick-chip {
    appearance: none;
    border: 1px solid var(--ch-surface-line);
    background: var(--ch-surface);
    color: var(--ds-ink);
    font: inherit;
    font-size: 14px;
    line-height: 18px;
    padding: 7px 12px;
    min-height: 36px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}
.ch-quick-chip:active { background: var(--ch-pink); border-color: var(--ch-pink); color: #fff; }

/* Category chips: one row she can swipe through. */
.ch-cats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ch-cats::-webkit-scrollbar { display: none; }
.ch-cat-chip {
    appearance: none;
    flex: 0 0 auto;
    border: 1px solid var(--ch-surface-line);
    background: transparent;
    color: var(--ds-foreground-2);
    font: inherit;
    font-size: 13px;
    line-height: 18px;
    padding: 6px 12px;
    min-height: 34px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}
.ch-cat-chip.is-on { background: var(--ch-pink); border-color: var(--ch-pink); color: #fff; font-weight: 600; }

.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; line-height: 18px; color: var(--ds-foreground-2); }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ch-legend i { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }

/* Food rows */
.ch-list { display: flex; flex-direction: column; }
.ch-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ds-hairline); }
.ch-item:last-child { border-bottom: 0; }
.ch-item-main { flex: 1 1 auto; min-width: 0; }
.ch-item-name { font-size: 15px; font-weight: 600; color: var(--ds-ink); }
.ch-item-sub { font-size: 12px; line-height: 18px; color: var(--ds-foreground-2); }
.ch-item-kcal { flex: 0 0 auto; font-size: 14px; font-weight: 700; color: var(--ch-pink-text); white-space: nowrap; }
.ch-item-kcal small { font-size: 11px; font-weight: 400; color: var(--ds-foreground-2); white-space: nowrap; }
.ch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.file-nav { display: flex; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid var(--ds-hairline); }
.file-nav a { padding: 10px 0; color: var(--ds-foreground-2); text-decoration: none; }
.file-nav a { font-size: 15px; }
.file-nav a[aria-current="page"] { color: var(--ds-ink); font-weight: 600; box-shadow: inset 0 -3px 0 #ef0078; }
@media (max-width: 600px) { .file-nav a { display: inline-flex; align-items: center; min-height: 44px; } }

.ch-tag {
    display: inline-block;
    margin-inline-start: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ch-warn) 20%, transparent);
    color: var(--ch-warn);
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
}

/* ---------- page shell (standalone app, no host chrome) ---------- */
@font-face { font-family: 'PlexArabic'; src: url('./fonts/plex-arabic-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PlexArabic'; src: url('./fonts/plex-arabic-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'PlexArabic'; src: url('./fonts/plex-arabic-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

* { box-sizing: border-box; }
body { background: #0a090b; -webkit-text-size-adjust: 100%; }
.file-card {
    max-width: 640px;
    margin: 0 auto;
    padding: calc(18px + env(safe-area-inset-top)) 18px calc(40px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.file-header h1 { margin: 0; font-family: var(--ds-font-display); font-size: 30px; line-height: 38px; font-weight: 700; color: var(--ds-ink); letter-spacing: -.2px; }
.file-header p { margin: 8px 0 0; font-size: 14px; line-height: 22px; color: var(--ds-foreground-2); }

.file-nav { display: flex; gap: 18px; border-bottom: 1px solid var(--ds-hairline); padding-bottom: 0; }
.file-nav a { position: relative; padding: 8px 0 10px; font-size: 15px; font-weight: 600; color: var(--ds-foreground-2); text-decoration: none; }
.file-nav a.is-active { color: var(--ds-ink); }
.file-nav a.is-active::after { content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--ch-pink); }

.file-group { display: flex; flex-direction: column; gap: 12px; }
.file-group-label { font-size: 12px; line-height: 18px; font-weight: 600; color: var(--ch-pink-text); }
.file-group-heading { margin: 0; font-size: 19px; line-height: 26px; font-weight: 700; color: var(--ds-ink); }

.file-control { display: flex; flex-direction: column; gap: 6px; }
.file-control > label, .file-control-label { font-size: 12px; line-height: 18px; color: var(--ds-foreground-2); }
.file-field {
    appearance: none;
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--ds-hairline);
    background: var(--ds-background-1);
    color: var(--ds-ink);
    font: inherit;
    font-size: 15px;
}
.file-field:focus { outline: none; border-color: var(--ch-pink); box-shadow: 0 0 0 3px rgba(239, 0, 120, .22); }
.file-field::placeholder { color: var(--ds-foreground-3); }

.file-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.file-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--ds-hairline);
    background: var(--ds-background-1);
    color: var(--ds-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.file-button[data-variant=primary] { background: var(--ch-pink); border-color: var(--ch-pink); color: #fff; }
.file-button[data-variant=ghost] { background: transparent; border-color: transparent; color: var(--ds-foreground-2); font-weight: 500; }
.file-button[data-size=compact] { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.file-button[aria-pressed=true] { background: var(--ch-pink); border-color: var(--ch-pink); color: #fff; }

.file-callout { border-radius: 14px; padding: 12px 14px; background: var(--ch-surface); border: 1px solid var(--ch-surface-line); }
.file-callout-title { font-size: 13px; font-weight: 700; color: var(--ds-ink); margin-bottom: 4px; }
.file-callout-body { font-size: 13px; line-height: 20px; color: var(--ds-foreground-2); }
.file-paragraph { margin: 0; font-size: 14px; line-height: 22px; color: var(--ds-foreground-2); }
.file-closing { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--ds-hairline); font-size: 12px; line-height: 19px; color: var(--ds-foreground-3); }

/* ---------- quantity stepper ---------- */
.ch-step { display: inline-flex; align-items: center; gap: 0; flex: 0 0 auto; border: 1px solid var(--ch-surface-line); border-radius: 999px; overflow: hidden; background: var(--ch-surface); }
.ch-step button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ds-ink);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    width: 34px;
    height: 36px;
    cursor: pointer;
}
.ch-step button:disabled { opacity: .35; cursor: default; }
.ch-step input {
    appearance: textfield;
    -moz-appearance: textfield;
    width: 44px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--ds-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.ch-step input::-webkit-outer-spin-button, .ch-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ch-step.is-on { border-color: var(--ch-pink); background: rgba(239, 0, 120, .14); }
.ch-step .ch-step-unit { font-size: 11px; color: var(--ds-foreground-3); padding-inline-end: 8px; }
.ch-item-kcal.is-live { color: var(--ch-pink-text); }

.ch-boot{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:60vh;color:#f3d9e6;font-family:system-ui,-apple-system,"Segoe UI",Tahoma,sans-serif}
.ch-boot img{width:132px;height:auto}
