:root {
    --bg: #1C1C1C;
    --panel: #232323;
    --panel-soft: #262626;
    --panel-soft-2: #2A2A2A;
    --field: #202020;
    --line: #2A2A2A;
    --line-strong: #333333;
    --text: #F5F6F7;
    --muted: #6C6E73;
    --muted-dark: #4A4A4A;
    --muted-bright: #ABADB2;
    --blue: #78ACD2;
    --blue-bright: #91BEDD;
    --blue-deep: #13294C;
    --blue-deep-bright: #1E3A63;
    --red: #ef5350;
    --green: #33c07d;

    --shadow-sm: 0 2px 8px rgba(0,0,0,.28);
    --shadow-md: 0 12px 32px rgba(0,0,0,.38);
    --shadow-lg: 0 24px 64px rgba(0,0,0,.55);
    --ease: cubic-bezier(.2,.7,.3,1);

    --card-cut: 18px;
    --card-cut-sm: 10px;
}

@font-face {
    font-family: "Blueprint Roboto";
    src: url("/assets/Fonts/Roboto-Medium.ttf") format("truetype");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Blueprint Wide";
    src: url("/assets/Fonts/Garp Sans Wide.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Blueprint Stat";
    src: url("/assets/Fonts/WinnerSans-ExtendedBold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* { box-sizing: border-box; }
html { height: 100%; overflow: hidden; }
* { scrollbar-color: #343b43 transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border: 2px solid var(--bg); border-radius: 999px; background: #343b43; }
*::-webkit-scrollbar-thumb:hover { background: #4a525c; }

body {
    margin: 0;
    height: 100%;
    min-height: 100vh;
    overflow: hidden;
    color: var(--text);
    background: var(--bg);
    font-family: "Blueprint Roboto", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
/* .coach-app needs a definite height chain to size against. Standalone mode
   uses height:100vh (resolves against the viewport directly, no ancestor
   needed) but embedded mode (html.is-embedded .coach-app, below) switches to
   height:100% — which is only definite if every ancestor up to here has one
   too. Without this, .coach-app silently falls back to growing to fit all
   its content instead of being clipped to the iframe, breaking every
   internal overflow:auto scroll region on the page. */
main { height: 100%; }
h1, h2, h3 { font-family: "Blueprint Wide", "Blueprint Roboto", Arial, sans-serif; margin: 0; letter-spacing: 0; }
button, input, select, textarea { font: inherit; }
button {
    cursor: pointer;
    transition: background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease);
}
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--blue-bright);
    outline-offset: 2px;
}
.is-hidden { display: none !important; }
.app-body.view { display: none; }
.app-body.view.active { display: flex; }

/* ---------- icon system (mask-based, recolorable) ---------- */
.section-icon, .btn-icon, .cell-icon {
    display: inline-block;
    background: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    flex: 0 0 auto;
}
.section-icon {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(155deg, rgba(120,172,210,.22), rgba(120,172,210,.06));
    color: var(--blue-bright);
    padding: 8px;
    -webkit-mask-size: 55%;
    mask-size: 55%;
}
.section-heading { display: flex; align-items: center; gap: 12px; }
.btn-icon { width: 13px; height: 13px; margin-right: 7px; color: #fff; }
.icon-add { -webkit-mask-image: url("/assets/Icons/add-line.svg"); mask-image: url("/assets/Icons/add-line.svg"); }
.icon-download { -webkit-mask-image: url("/assets/Icons/download-svgrepo-com.svg"); mask-image: url("/assets/Icons/download-svgrepo-com.svg"); }
.icon-athletes { -webkit-mask-image: url("/assets/Icons/users-svgrepo-com.svg"); mask-image: url("/assets/Icons/users-svgrepo-com.svg"); }
.icon-restaurant { -webkit-mask-image: url("/assets/Icons/restaurant-line (1).svg"); mask-image: url("/assets/Icons/restaurant-line (1).svg"); }
.icon-target { -webkit-mask-image: url("/assets/Icons/icon-target.svg"); mask-image: url("/assets/Icons/icon-target.svg"); }
.icon-apps { -webkit-mask-image: url("/assets/Icons/apps-grid.svg"); mask-image: url("/assets/Icons/apps-grid.svg"); }
.icon-ingredients { -webkit-mask-image: url("/assets/Icons/Drum Stick.svg"); mask-image: url("/assets/Icons/Drum Stick.svg"); }
.icon-seasonings { -webkit-mask-image: url("/assets/Icons/flame-fill-svgrepo-com.svg"); mask-image: url("/assets/Icons/flame-fill-svgrepo-com.svg"); }
.icon-utensils { -webkit-mask-image: url("/assets/Icons/cube-svgrepo-com.svg"); mask-image: url("/assets/Icons/cube-svgrepo-com.svg"); }

/* ---------- login ---------- */
.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 15%, rgba(120,172,210,.16), transparent 42%),
        radial-gradient(circle at 82% 85%, rgba(167,139,250,.10), transparent 45%),
        linear-gradient(90deg, rgba(120,172,210,.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(120,172,210,.08) 1px, transparent 1px),
        var(--bg);
    background-size: auto, auto, 34px 34px, 34px 34px;
}
.login-panel {
    width: min(100%, 420px);
    display: grid;
    gap: 24px;
    justify-items: center;
    padding: 44px 36px;
    border: 1px solid var(--line-strong);
    clip-path: polygon(0 0, calc(100% - var(--card-cut)) 0, 100% var(--card-cut), 100% 100%, 0 100%);
    background: radial-gradient(circle at 50% 0%, rgba(120,172,210,.14), transparent 60%), rgba(28,28,28,.92);
    backdrop-filter: blur(6px);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}
.login-logo { width: min(60vw, 190px); filter: drop-shadow(0 8px 24px rgba(120,172,210,.22)); }
.login-form { width: 100%; display: grid; gap: 16px; }
.login-form .primary-btn { margin-top: 4px; box-shadow: 0 10px 28px rgba(120,172,210,.28); }
.login-form .link-btn { font-size: 12px; }

label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase; }
input, select, textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    color: var(--text);
    background: var(--field);
    outline: 0;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background-color .16s var(--ease);
}
input, select { height: 38px; padding: 0 12px; }
textarea { min-height: 88px; padding: 11px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted-dark); }
input:focus, select:focus, textarea:focus {
    border-color: rgba(120,172,210,.75);
    background: var(--panel-soft);
    box-shadow: 0 0 0 3px rgba(120,172,210,.14);
}
input:hover, select:hover { border-color: #383e45; }

/* ---------- shell / sidebar / header (matches Command's shell exactly) ---------- */
.coach-app {
    min-width: 1330px;
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(circle at 12% 0%, rgba(120,172,210,.05), transparent 32%),
        var(--bg);
}

.app-sidebar {
    width: 220px;
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    padding: 16px 10px 14px;
    background: rgba(35,35,35,.92);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    transition: width .18s var(--ease), flex-basis .18s var(--ease);
}
.app-sidebar.is-collapsed { width: 72px; flex-basis: 72px; }

.sidebar-top { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 4px 6px 28px; }
.sidebar-logo { width: 54px; height: 40px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 2px 8px rgba(120,172,210,.25)); }
.sidebar-wordmark { min-width: 0; font-family: "Blueprint Wide", "Blueprint Roboto", Arial, sans-serif; font-size: 24px; font-weight: 700; letter-spacing: .3px; color: #fff; white-space: nowrap; overflow: hidden; }
.app-sidebar.is-collapsed .sidebar-top { justify-content: center; }

.sidebar-collapse-btn {
    position: absolute; top: 16px; left: 208px; z-index: 10;
    width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--field);
    color: var(--muted-bright); display: flex; align-items: center; justify-content: center; font-size: 13px; padding: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    transition: left .18s var(--ease);
}
#app-sidebar.is-collapsed ~ .sidebar-collapse-btn { left: 60px; }
.sidebar-collapse-btn:hover { background: var(--panel-soft); color: #fff; }
.app-sidebar.is-collapsed .sidebar-wordmark { display: none; }

.dashboard-switcher-wrap { position: relative; }
.dashboard-switcher {
    width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 9px;
    background: var(--field); color: var(--muted-bright); display: flex; align-items: center; gap: 8px;
    padding: 0 10px; margin-bottom: 4px;
}
.dashboard-switcher:hover { background: var(--panel-soft); color: #fff; }
.dashboard-switcher .btn-icon { margin-right: 0; width: 14px; height: 14px; }
.dashboard-switcher-label { flex: 1; min-width: 0; text-align: left; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-switcher-chevron { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.app-sidebar.is-collapsed .dashboard-switcher { padding: 0; justify-content: center; }
.app-sidebar.is-collapsed .dashboard-switcher-label, .app-sidebar.is-collapsed .dashboard-switcher-chevron { display: none; }
.dashboard-switcher-menu {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
    background: var(--panel-soft); border: 1px solid var(--line-strong); border-radius: 9px;
    box-shadow: 0 10px 24px rgba(0,0,0,.35); padding: 5px; display: grid; gap: 2px;
}
.dashboard-switcher-item { border-radius: 6px; padding: 8px 10px; font-size: 12.5px; font-weight: 500; color: var(--muted-bright); display: flex; align-items: center; justify-content: space-between; gap: 8px; transition: background-color .12s var(--ease), color .12s var(--ease); }
.dashboard-switcher-item.is-current { color: var(--blue-bright); background: var(--blue-deep); }
.dashboard-switcher-item.is-disabled { color: var(--muted-dark); }
.dashboard-switcher-item:hover:not(.is-disabled):not(.is-current) { background: rgba(255,255,255,.05); color: #fff; cursor: pointer; }
.switcher-soon { font-size: 9px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted-dark); }

.sidebar-divider { height: 1px; margin: 6px 8px 10px; background: var(--line); flex: 0 0 auto; }

.tabs { display: flex; flex-direction: column; gap: 2px; }
.tab {
    width: 100%;
    height: 38px;
    min-width: 0;
    border: 0;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font-size: 14.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10px;
    text-align: left;
}
.tab:hover:not(.active) { color: var(--muted-bright); background: rgba(255,255,255,.03); }
.tab.active { color: var(--blue-bright); background: rgba(120,172,210,.14); box-shadow: inset 0 0 0 1px var(--blue-bright); }
.tab .btn-icon { margin-right: 10px; width: 17px; height: 17px; flex: 0 0 auto; }
.sidebar-nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar.is-collapsed .tab { justify-content: center; padding: 0; }
.app-sidebar.is-collapsed .tab .btn-icon { margin-right: 0; }
.app-sidebar.is-collapsed .sidebar-nav-label { display: none; }

.app-shell { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.app-header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 22px;
    background: rgba(35,35,35,.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
    z-index: 5;
}
.app-header-title { margin: 0 0 0 10px; color: #fff; font-size: 26px; font-weight: 700; letter-spacing: .3px; }
.app-views { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.top-actions { display: flex; align-items: center; gap: 10px; min-width: 230px; justify-content: flex-end; }

.account-menu-wrap { position: relative; }
.account-card {
    display: inline-flex; align-items: center; gap: 8px; max-width: 220px; height: 34px; padding: 0 10px 0 6px;
    border: 1px solid var(--line-strong); border-radius: 9px; background: var(--field); color: var(--muted-bright);
    cursor: pointer; transition: border-color .12s var(--ease), background-color .12s var(--ease), color .12s var(--ease);
}
.account-card:hover { border-color: var(--line-strong); background: var(--panel-soft); color: #fff; }
.account-avatar {
    flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
    background: var(--blue-deep); color: var(--blue-bright);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
}
.account-email { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 150px;
    background: var(--panel-soft); border: 1px solid var(--line-strong); border-radius: 9px;
    box-shadow: 0 10px 24px rgba(0,0,0,.35); padding: 5px; display: grid; gap: 2px;
}
.account-dropdown-item {
    border: 0; border-radius: 6px; background: transparent; color: var(--muted-bright);
    font-size: 12.5px; font-weight: 500; text-align: left; padding: 8px 10px; cursor: pointer;
}
.account-dropdown-item:hover { background: var(--red); color: #fff; }

.primary-btn, .ghost-btn, .mini-btn, .link-btn, .user-pill, .icon-btn, .nav-arrow, .danger-btn {
    border: 0;
    border-radius: 9px;
    color: #fff;
    font-weight: 600;
}
.primary-btn {
    background: linear-gradient(155deg, var(--blue-bright), var(--blue));
    min-height: 38px; padding: 0 16px;
    display: inline-flex; align-items: center;
    box-shadow: 0 6px 18px rgba(120,172,210,.22);
}
.primary-btn:hover { filter: brightness(1.08); box-shadow: 0 8px 22px rgba(120,172,210,.32); }
.primary-btn.compact { min-height: 34px; font-size: 13px; }
.ghost-btn, .user-pill, .icon-btn, .mini-btn, .nav-arrow {
    background: var(--field);
    border: 1px solid var(--line-strong);
    color: var(--muted-bright);
    display: inline-flex; align-items: center; justify-content: center;
}
.ghost-btn { min-height: 34px; padding: 0 13px; font-size: 13px; }
.ghost-btn:hover { border-color: var(--line-strong); background: var(--panel-soft); color: #fff; }
.ghost-btn.compact { min-height: 30px; padding: 0 11px; font-size: 12px; }
.mini-btn { height: 27px; padding: 0 10px; font-size: 11px; }
.mini-btn:hover { border-color: var(--line-strong); color: #fff; }
.nav-arrow { height: 30px; padding: 0 11px; font-size: 13px; }
.nav-arrow:hover { border-color: var(--line-strong); color: #fff; }
.nav-arrow:disabled { opacity: .35; cursor: not-allowed; }
.user-pill { max-width: 190px; height: 32px; padding: 0 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.icon-btn { width: 32px; height: 32px; font-size: 14px; }
.icon-btn:hover { border-color: var(--red); color: var(--red); }
.danger-btn { background: linear-gradient(155deg, #f16560, var(--red)); min-height: 34px; padding: 0 15px; box-shadow: 0 6px 16px rgba(239,83,80,.24); }
.danger-btn:hover { filter: brightness(1.08); }
.link-btn { justify-self: center; background: transparent; color: var(--blue-bright); font-weight: 500; }
.link-btn:hover { color: #fff; }
.status { min-height: 18px; margin: 0; color: var(--muted-bright); font-size: 12px; }

/* ---------- layout ---------- */
.app-body { flex: 1; min-height: 0; overflow: hidden; display: flex; }
.center-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}
.center-panel.full-width { flex: 1 1 100%; }
.eyebrow { margin: 0; color: var(--muted-dark); font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; }
.panel-search { margin: 10px 8px 0; width: calc(100% - 16px); height: 32px; font-size: 12px; }
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.section-bar h2 { font-size: 19px; }
.section-bar-actions { display: flex; align-items: center; gap: 8px; }
.count { color: var(--muted-dark); font-size: 11px; font-variant-numeric: tabular-nums; }
.empty-state { color: var(--muted-dark); font-size: 12px; padding: 16px; }
.empty-state.small { padding: 8px 12px; }
.tag-chip { font-size: 10px; padding: 4px 9px; border-radius: 999px; background: var(--blue-deep); color: var(--blue-bright); font-weight: 600; letter-spacing: .2px; }

/* ---------- modals ---------- */
.modal {
    position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
    background: rgba(6,6,7,.68); backdrop-filter: blur(3px); padding: 24px;
    animation: fade-in .16s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-card {
    width: min(100%, 520px); max-height: 88vh; overflow-y: auto;
    clip-path: polygon(0 0, calc(100% - var(--card-cut)) 0, 100% var(--card-cut), 100% 100%, 0 100%);
    border: 1px solid var(--line-strong); background: var(--panel-soft); box-shadow: var(--shadow-lg);
    animation: rise-in .18s var(--ease);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16.5px; }
.modal-form { display: grid; gap: 15px; padding: 21px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.modal-actions .status { margin-right: auto; }

/* ---------- nutrition: meal library ---------- */
.meal-grid { flex: 1; overflow-y: auto; padding: 20px 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-content: start; }
.meal-card {
    border: 1px solid var(--line-strong); background: var(--panel-soft);
    clip-path: polygon(0 0, calc(100% - var(--card-cut)) 0, 100% var(--card-cut), 100% 100%, 0 100%);
    overflow: hidden; display: grid; gap: 0; box-shadow: var(--shadow-sm);
    transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.meal-card:hover { transform: translateY(-2px); border-color: #404040; box-shadow: var(--shadow-md); }
.meal-card-image { width: 100%; aspect-ratio: 16 / 10; background: var(--field); overflow: hidden; }
.meal-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meal-card-image-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted-dark); font-size: 12px; }
.meal-card-body { padding: 14px 16px; display: grid; gap: 8px; }
.meal-card-body h3 { font-size: 15.5px; color: #fff; }
.meal-card-body .meta { font-size: 11.5px; color: var(--muted); }
.meal-card-body .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.meal-card-actions { display: flex; gap: 6px; margin-top: 4px; }

.meal-modal-card { width: min(100%, 640px); }
.meal-media-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.meal-media-field { display: grid; gap: 6px; }
.meal-media-preview { width: 100%; max-height: 160px; border-radius: 8px; background: var(--field); object-fit: cover; }

.ingredients-field { display: grid; gap: 8px; }
.ingredient-row { display: flex; align-items: center; gap: 8px; }
.ingredient-row .ingredient-text { flex: 1; }
.ingredient-optional { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ingredient-remove { background: transparent; border: 0; color: var(--muted-dark); font-size: 15px; padding: 0 4px; cursor: pointer; }
.ingredient-remove:hover { color: var(--red); }

.meal-type-field { display: grid; gap: 8px; }
.meal-type-checks { display: flex; flex-wrap: wrap; gap: 12px; }
.meal-type-checks label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted-bright); font-weight: 400; }

.meal-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.meal-detail-card { width: min(100%, 680px); }
.meal-detail-body { display: grid; gap: 18px; padding: 21px; overflow-y: auto; }
.meal-detail-image { width: 100%; max-height: 280px; border-radius: 10px; overflow: hidden; background: var(--field); }
.meal-detail-image img { width: 100%; height: 100%; max-height: 280px; object-fit: cover; display: block; }
.meal-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-bright); }
.meal-detail-meta .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.meal-detail-section h3 { font-size: 13px; color: #fff; margin-bottom: 8px; }
.meal-detail-ingredients { display: grid; gap: 6px; list-style: none; padding: 0; margin: 0; }
.meal-detail-ingredients li { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted-bright); padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--field); }
.meal-detail-ingredients li .ingredient-optional-tag { margin-left: auto; font-size: 10.5px; font-style: italic; color: var(--muted-dark); white-space: nowrap; }
.meal-detail-instructions { white-space: pre-wrap; font-size: 13px; line-height: 1.6; color: var(--muted-bright); margin: 0; }
.meal-detail-video video { width: 100%; max-height: 320px; border-radius: 10px; background: var(--field); }

/* ---------- meal library board (collapsible sections by meal type,
   Workshop's athlete-folder/athlete-board recipe — see Workshop/styles.css —
   applied to the fixed Breakfast/Lunch/Dinner/Snack/Dessert categories
   instead of coach-created folders; a meal with multiple mealTypes appears
   in each section it's tagged for.) ---------- */
.section-icon { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.library-page-bar { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.library-page-bar .eyebrow { flex: 1; min-width: 0; }
.library-page-bar .panel-search { margin: 0; width: 260px; flex: 0 0 auto; }

.meal-board { flex: 1; overflow-y: auto; padding: 20px 22px; display: grid; gap: 12px; align-content: start; }
.meal-folder header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 20px 16px;
    border: 1.5px solid var(--line-strong); border-left: 4px solid var(--folder-color, var(--line-strong));
    background: var(--panel-soft);
    clip-path: polygon(0 0, calc(100% - var(--card-cut-sm)) 0, 100% var(--card-cut-sm), 100% 100%, 0 100%);
    cursor: pointer; user-select: none; transition: border-color .16s var(--ease);
}
.meal-folder header:hover { border-color: var(--blue); }
.meal-folder header:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.meal-folder header .count { font-size: 12px; }
.meal-folder h3 { font-family: "Blueprint Wide", "Blueprint Roboto", Arial, sans-serif; font-size: 16px; color: #fff; letter-spacing: .3px; }
.meal-folder .folder-chevron { flex: 0 0 auto; width: 12px; color: var(--muted-bright); font-size: 13px; text-align: center; }
.meal-stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }

/* ---------- players data table (Command's Blueprint Players recipe —
   see Command/styles.css's "data table (TBL-01)" — translated onto Fuel's
   own token names) ---------- */
.data-table-wrap { flex: 1; overflow: auto; padding: 16px 22px; }
.data-table { width: 100%; border-collapse: collapse; background: transparent; border: 0; border-radius: 0; font-size: 13px; display: block; }
.data-table thead, .data-table tbody, .data-table tfoot { display: block; width: 100%; }
.data-table thead tr, .data-table tbody tr, .data-table tfoot tr { display: grid; grid-template-columns: minmax(0,2fr) 1fr 1fr; align-items: center; gap: 14px; }
.data-table thead tr { padding: 0 16px 8px; border-bottom: 1px solid var(--line-strong); margin-bottom: 8px; }
.data-table tbody tr {
    position: relative; z-index: 0;
    min-height: 52px; padding: 0 16px; margin-bottom: 7px; cursor: pointer;
}
.data-table tbody tr::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    border: 1px solid var(--line-strong); background: var(--panel-soft);
    clip-path: polygon(0 0, calc(100% - var(--card-cut-sm)) 0, 100% var(--card-cut-sm), 100% 100%, 0 100%);
    transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.data-table tbody tr:last-child { margin-bottom: 0; }
.data-table tbody tr:hover::before { border-color: var(--muted-dark); background: var(--panel-soft-2); }
.data-table th { text-align: left; padding: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); background: none; white-space: nowrap; }
.data-table td { padding: 12px 0; font-size: 13px; border-top: 0; color: var(--muted-bright); vertical-align: middle; min-width: 0; }
.data-table td strong { color: #fff; font-size: 13.5px; }
.data-table tfoot tr { padding: 8px 16px; grid-template-columns: 1fr; }
.data-table tfoot td { padding: 0; color: var(--muted-dark); font-size: 11.5px; border-top: 0; }
.table-cell-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table-cell-user .meta { font-size: 11.5px; color: var(--muted); }
.table-cell-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.athlete-detail-bar { gap: 20px; }

/* ---------- players / nutrition ---------- */
.row-actions { display: flex; align-items: center; gap: 8px; }
.avatar {
    width: 28px; height: 28px; border-radius: 999px; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(155deg, var(--blue-deep-bright), var(--blue-deep));
    box-shadow: inset 0 0 0 1px rgba(120,172,210,.25);
    color: var(--blue-bright); font-size: 11px; font-weight: 700; flex: 0 0 auto;
}
.avatar-photo { object-fit: cover; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }

.player-detail-scroll, .calculator-scroll { flex: 1; overflow-y: auto; padding: 20px 22px; }
.player-detail { display: grid; gap: 16px; max-width: 640px; }
.player-detail-head { display: flex; align-items: center; gap: 14px; }
.player-detail-head h2 { font-size: 20px; }

.nutrition-card {
    border: 1px solid var(--line-strong);
    clip-path: polygon(0 0, calc(100% - var(--card-cut-sm)) 0, 100% var(--card-cut-sm), 100% 100%, 0 100%);
    background: var(--panel-soft); padding: 18px 20px; display: grid; gap: 12px;
}
.nutrition-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nutrition-card-head h3 { font-size: 14px; color: #fff; display: flex; align-items: center; gap: 8px; }

.profile-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 12px; }
.profile-summary-value { display: block; margin-top: 3px; font-size: 15px; font-weight: 700; color: #fff; }

/* Sex/Age, Height ft/in, and Weight/Goal weight are short paired fields that
   stay grouped 2-up (.form-field-group); Activity level and Goal carry much
   longer option text ("Moderately active — Moderate exercise 3-5 days/week")
   that gets crushed in a narrow column, so they force their own full-width
   row (.form-field-wide) instead of competing for space in the same grid. */
.nutrition-form-grid { display: grid; gap: 18px 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.form-field-group { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field-wide { grid-column: 1 / -1; }

.target-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.target-tile { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--field); padding: 12px 14px; display: grid; gap: 3px; min-width: 0; overflow: hidden; }
.target-value { font-family: "Blueprint Stat", "Blueprint Wide", Arial, sans-serif; font-size: 22px; color: #fff; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 3px; }
.target-unit { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 0; }
.target-math { margin: 0; font-size: 11.5px; color: var(--muted); }
.target-disclaimer { margin: 0; font-size: 10.5px; font-style: italic; color: var(--muted-dark); line-height: 1.5; }

.calculator-card { margin-bottom: 16px; padding: 22px 24px; }
.calculator-card h3 { font-size: 15px; color: #fff; margin-bottom: 2px; }
.calculator-form { display: grid; gap: 20px; }

/* ---------- Blueprint Eats: status pills, filter chips, inventory tables ---------- */
.status-pill { font-size: 10px; padding: 4px 9px; border-radius: 999px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.status-pill.status-in-stock { background: rgba(51,192,125,.14); color: var(--green); }
.status-pill.status-low { background: rgba(255,183,77,.14); color: #ffb74d; }
.status-pill.status-out { background: rgba(239,83,80,.14); color: var(--red); }

.filter-chip-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 14px; flex: 0 0 auto; }
.filter-chip { height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--field); color: var(--muted-bright); font-size: 11.5px; font-weight: 600; }
.filter-chip:hover { border-color: var(--blue); color: #fff; }
.filter-chip.active { border-color: var(--blue); background: var(--blue-deep); color: var(--blue-bright); }

.data-table.cols-6 thead tr, .data-table.cols-6 tbody tr { grid-template-columns: minmax(0,1.6fr) 1fr 1.2fr 1fr 1fr 40px; }
.data-table.cols-5 thead tr, .data-table.cols-5 tbody tr { grid-template-columns: minmax(0,1.6fr) 1.2fr 1fr 1fr 40px; }
.data-table td .meta { color: var(--muted-dark); font-size: 12px; }

.qty-stepper { display: inline-flex; align-items: center; gap: 8px; }
.qty-step-btn { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--field); color: var(--muted-bright); font-size: 13px; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.qty-step-btn:hover { border-color: var(--blue); color: #fff; }
.qty-stepper-value { min-width: 34px; text-align: center; font-size: 13px; color: #fff; font-variant-numeric: tabular-nums; }
.qty-stepper-unit { margin-left: 3px; font-size: 10.5px; color: var(--muted); }

/* ---------- Blueprint Eats: meal editor (sectioned, collapsible cards) ---------- */
.meal-editor-scroll { flex: 1; overflow-y: auto; padding: 20px 22px 60px; display: grid; gap: 16px; max-width: 760px; }
.meal-editor-scroll > h2 { font-size: 20px; }
.editor-section { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-soft); overflow: hidden; }
.editor-section-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; user-select: none; }
.editor-section-head h3 { font-size: 14px; color: #fff; }
.editor-section-head .folder-chevron { width: 12px; color: var(--muted-bright); font-size: 13px; text-align: center; }
.editor-section-body { display: grid; gap: 14px; padding: 4px 18px 18px; }
.editor-section.is-collapsed .editor-section-body { display: none; }
.editor-section.is-collapsed .folder-chevron { transform: rotate(-90deg); }

.picker-search-wrap { position: relative; }
.picker-search-wrap .panel-search { margin: 0; width: 100%; }
.picker-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10; max-height: 220px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-soft-2); box-shadow: var(--shadow-md); padding: 4px; display: grid; gap: 2px; }
.picker-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; border-radius: 6px; background: transparent; color: var(--muted-bright); padding: 8px 10px; font-size: 12.5px; }
.picker-result:hover { background: rgba(120,172,210,.14); color: #fff; }
.picker-result .meta { font-size: 10.5px; color: var(--muted-dark); }

.picker-row { display: grid; grid-template-columns: minmax(0,1.4fr) 80px 90px 1fr auto auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.picker-row:last-child { border-bottom: 0; }
.picker-row-name { font-size: 12.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-row input { height: 32px; font-size: 12px; }
.picker-optional { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }

.utensil-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.utensil-check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); }
.utensil-check-row label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted-bright); font-weight: 400; text-transform: none; letter-spacing: 0; }

.step-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.step-row:last-child { border-bottom: 0; }
.step-number { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: var(--blue-deep); color: var(--blue-bright); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 6px; }
.step-text { flex: 1; min-height: 54px; font-size: 12.5px; }
.step-actions { display: flex; flex-direction: column; gap: 5px; }

/* ---------- Blueprint Eats: meal detail (servings, ready-to-make, cost) ---------- */
.meal-detail-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; max-width: 640px; }
.meal-detail-title-row h2 { font-size: 21px; }
.meal-detail-description { font-size: 13px; color: var(--muted-bright); line-height: 1.6; max-width: 640px; margin: 0 0 14px; }
.meal-detail-body { display: grid; gap: 18px; max-width: 640px; padding-bottom: 40px; }
.meal-detail-steps { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; counter-reset: step; }
.meal-detail-steps li { counter-increment: step; display: flex; gap: 10px; font-size: 13px; color: var(--muted-bright); line-height: 1.6; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--field); }
.meal-detail-steps li::before { content: counter(step); flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--blue-deep); color: var(--blue-bright); font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.servings-select-row { display: flex; align-items: center; gap: 12px; }
.servings-select { display: flex; gap: 6px; }
.servings-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--field); color: var(--muted-bright); font-size: 13px; font-weight: 700; }
.servings-btn:hover { border-color: var(--blue); color: #fff; }
.servings-btn.active { border-color: var(--blue); background: var(--blue-deep); color: var(--blue-bright); }

.ready-block { border-radius: 10px; padding: 14px 16px; border: 1px solid var(--line-strong); background: var(--field); display: grid; gap: 8px; }
.ready-block.is-ready { border-color: rgba(51,192,125,.4); background: rgba(51,192,125,.06); }
.ready-block.is-missing { border-color: rgba(239,83,80,.35); background: rgba(239,83,80,.05); }
.ready-badge { font-family: "Blueprint Wide", "Blueprint Roboto", Arial, sans-serif; font-size: 13px; letter-spacing: .4px; }
.ready-block.is-ready .ready-badge { color: var(--green); }
.ready-block.is-missing .ready-badge { color: var(--red); }
.ready-summary-row { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted-bright); }
.ready-details summary { cursor: pointer; font-size: 12px; color: var(--blue-bright); margin-top: 2px; }
.ready-group { margin-top: 10px; display: grid; gap: 5px; }
.ready-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-bright); }
.ready-item-ok span:first-child { color: var(--green); }
.ready-item-low span:first-child { color: #ffb74d; }
.ready-item-missing span:first-child { color: var(--red); }

.meal-card-image { position: relative; }
.meal-card-status { position: absolute; top: 8px; left: 8px; }

/* ---------- Embedded mode (loaded inside Command's shell iframe, see
   js/embed.js) — Command already renders a login screen and a sidebar/header
   once for every embedded app, so this page's own copies are redundant and
   hidden. ---------- */
html.is-embedded .login-screen,
html.is-embedded .app-sidebar,
html.is-embedded .sidebar-collapse-btn,
html.is-embedded .app-header {
    display: none !important;
}
html.is-embedded .coach-app { min-width: 0; height: 100%; }
html.is-embedded .app-shell { height: 100%; }

.embed-signin-notice {
    display: none; height: 100vh; align-items: center; justify-content: center;
    color: var(--muted); font-size: 13px; padding: 40px; text-align: center;
}
html.is-embedded .embed-signin-notice.is-visible { display: flex; }
