/* ==========================================================================
   EzPepGuides — shared site layer (nav, footer, landing grid, stack builder)
   Restyled to the Meta-commerce design system (see DESIGN.md):
   stark white canvas, Optimistic VF type, pill (100px) buttons/chips/badges,
   flat cards with hairline borders, black marketing CTA + cobalt commerce CTA.
   Styles ONLY the site chrome and the two hub pages; individual guide pages
   keep their own inline <style> / assets/guide.css.
   ========================================================================== */

:root {
    /* Surface & ink */
    --canvas: #ffffff;
    --surface-soft: #f1f4f7;
    --ink-deep: #0a1317;
    --ink: #1c1e21;
    --charcoal: #444950;
    --steel: #5d6c7b;
    --stone: #8595a4;
    --hairline: #ced0d4;
    --hairline-soft: #dee3e9;
    --disabled: #bcc0c4;

    /* Brand & semantic */
    --cobalt: #0064e0;
    --cobalt-deep: #0457cb;
    --fb-blue: #1876f2;
    --meta-link: #385898;
    --oculus-purple: #a121ce;
    --success: #31a24c;
    --attention: #f2a918;
    --critical: #e41e3f;

    /* Radii */
    --r-sm: 4px;
    --r-lg: 8px;
    --r-xl: 16px;
    --r-xxl: 24px;
    --r-xxxl: 32px;
    --r-full: 100px;

    --nav-height: 64px;
    --font: "Optimistic VF", Montserrat, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---- Chrome host: let injected nav/footer sit flush & full-width -------- */
/* Guide pages set body padding; site.js adds this class so the nav and footer
   span edge-to-edge. The guide card keeps its breathing room below. */
body.pg-has-chrome { padding: 0 !important; margin: 0 !important; }
body.pg-has-chrome > .container { margin: 28px auto !important; }
@media (max-width: 940px) {
    body.pg-has-chrome > .container { margin: 20px 12px !important; }
}

/* ==========================================================================
   Top navigation — Meta-style sticky white bar
   ========================================================================== */
.pg-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline-soft);
    color: var(--ink);
    font-family: var(--font);
}

.pg-nav__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    min-height: var(--nav-height);
}

.pg-nav__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--ink-deep);
    text-decoration: none;
    margin-right: 12px;
}
.pg-nav__brand .pg-nav__logo { font-size: 22px; }

.pg-nav__links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Pill-tab links */
.pg-nav__link {
    display: inline-flex;
    align-items: center;
    background: var(--canvas);
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.14px;
    line-height: 1.43;
    padding: 8px 16px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-full);
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pg-nav__link:hover,
.pg-nav__link:focus { background: var(--surface-soft); }

.pg-nav__link--active {
    background: var(--ink-deep);
    color: var(--canvas);
    border-color: var(--ink-deep);
}
.pg-nav__link--active:hover { background: var(--ink-deep); }

/* Cobalt commerce CTA (the one cobalt element in the nav) */
.pg-nav__link--cta {
    background: var(--cobalt);
    color: var(--canvas);
    border-color: var(--cobalt);
}
.pg-nav__link--cta:hover,
.pg-nav__link--cta:focus { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.pg-nav__link--cta:active { background: var(--cobalt-deep); }

/* Guides mega-dropdown */
.pg-dropdown { position: relative; }

.pg-dropdown__toggle {
    cursor: pointer;
    font: inherit;
}

.pg-dropdown__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(680px, 90vw);
    max-height: 70vh;
    overflow-y: auto;
    background: var(--canvas);
    color: var(--ink);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--r-xl);
    box-shadow: rgba(20, 22, 26, 0.3) 0 1px 4px 0;
    padding: 20px;
    display: none;
}
.pg-dropdown--open .pg-dropdown__panel { display: block; }

.pg-dropdown__search {
    width: 100%;
    height: 40px;
    padding: 0 20px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    background: var(--surface-soft);
    border: 1px solid transparent;
    border-radius: var(--r-full);
    margin-bottom: 16px;
    outline: none;
    box-sizing: border-box;
}
.pg-dropdown__search::placeholder { color: var(--steel); }
.pg-dropdown__search:focus { border-color: var(--fb-blue); background: var(--canvas); }

.pg-dropdown__groups {
    columns: 2;
    column-gap: 24px;
}
@media (max-width: 560px) { .pg-dropdown__groups { columns: 1; } }

.pg-dropdown__group { break-inside: avoid; margin-bottom: 16px; }

.pg-dropdown__group-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--steel);
    font-weight: 700;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--hairline-soft);
}

.pg-dropdown__item {
    display: block;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: -0.14px;
    padding: 6px 8px;
    border-radius: var(--r-lg);
}
.pg-dropdown__item:hover { background: var(--surface-soft); color: var(--cobalt-deep); }

.pg-dropdown__empty { color: var(--steel); font-size: 14px; padding: 8px; }

/* Mobile hamburger */
.pg-nav__toggle {
    display: none;
    margin-left: auto;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--r-full);
    color: var(--ink-deep);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 8px 12px;
}

@media (max-width: 768px) {
    .pg-nav__toggle { display: block; }
    .pg-nav__links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        background: var(--canvas);
        padding: 16px;
        border-bottom: 1px solid var(--hairline-soft);
        box-shadow: rgba(20, 22, 26, 0.3) 0 1px 4px 0;
    }
    .pg-nav--open .pg-nav__links { display: flex; }
    .pg-nav__link { justify-content: center; padding: 12px 16px; }
    .pg-dropdown__panel { position: static; width: 100%; max-height: none; box-shadow: none; margin-top: 8px; }
    .pg-dropdown__groups { columns: 1; }
}

/* ==========================================================================
   Footer / global disclaimer — white footer-region
   ========================================================================== */
.pg-footer {
    background: var(--canvas);
    color: var(--steel);
    font-family: var(--font);
    margin-top: 64px;
    border-top: 1px solid var(--hairline-soft);
}

.pg-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 32px;
    text-align: center;
}

.pg-footer__disclaimer {
    font-size: 14px;
    line-height: 1.43;
    letter-spacing: -0.14px;
    color: var(--steel);
    max-width: 760px;
    margin: 0 auto;
}
.pg-footer__disclaimer strong { color: var(--ink-deep); }

.pg-footer__links {
    margin-top: 20px;
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}
.pg-footer__links a {
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.14px;
}
.pg-footer__links a:hover { text-decoration: underline; }

.pg-footer__copy { margin-top: 16px; font-size: 12px; line-height: 1.33; color: var(--stone); }

/* ==========================================================================
   Landing page (index.html)
   ========================================================================== */
.pg-page {
    font-family: var(--font);
    background: var(--canvas);
    color: var(--ink);
    min-height: 100vh;
    margin: 0;
}

/* Marketing hero band — white canvas, hero-display type, dual CTA */
.pg-hero {
    background: var(--canvas);
    color: var(--ink-deep);
    text-align: center;
    padding: 80px 24px 64px;
    max-width: 900px;
    margin: 0 auto;
}
.pg-hero h1 {
    font-size: 64px;
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -1px;
    margin: 0 0 20px;
    color: var(--ink-deep);
}
.pg-hero p {
    font-size: 18px;
    line-height: 1.44;
    color: var(--steel);
    max-width: 620px;
    margin: 0 auto;
}
.pg-hero__actions { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.pg-hero__btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.14px;
    line-height: 1.43;
    padding: 14px 30px;
    border-radius: var(--r-full);
    border: 2px solid var(--ink-deep);
    background: var(--ink-deep);
    color: var(--canvas);
    transition: background 0.15s ease, color 0.15s ease;
}
.pg-hero__btn:hover { background: var(--charcoal); border-color: var(--charcoal); }
.pg-hero__btn--ghost {
    background: transparent;
    color: var(--ink-deep);
    border: 2px solid var(--ink-deep);
}
.pg-hero__btn--ghost:hover { background: var(--surface-soft); color: var(--ink-deep); }

/* Dark ink promo strip — visual anchor */
.pg-promo {
    max-width: 1280px;
    margin: 8px auto 0;
    padding: 0 24px;
    box-sizing: border-box;
}
.pg-promo__card {
    background: var(--ink-deep);
    color: var(--canvas);
    border-radius: var(--r-xxxl);
    padding: 40px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.pg-promo__text { max-width: 640px; }
.pg-promo__card h2 { font-size: 28px; font-weight: 500; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.4px; }
.pg-promo__card p { font-size: 16px; line-height: 1.5; letter-spacing: -0.16px; color: rgba(255, 255, 255, 0.78); margin: 0; }
.pg-promo__btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.14px;
    padding: 14px 30px;
    border-radius: var(--r-full);
    background: var(--cobalt);
    color: var(--canvas);
    white-space: nowrap;
    transition: background 0.15s ease;
}
.pg-promo__btn:hover { background: var(--cobalt-deep); }

.pg-container { max-width: 1280px; margin: 0 auto; padding: 64px 24px; }

.pg-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.pg-search {
    flex: 1;
    min-width: 240px;
    height: 44px;
    padding: 0 20px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    background: var(--surface-soft);
    border: 1px solid transparent;
    border-radius: var(--r-full);
    outline: none;
    box-sizing: border-box;
}
.pg-search::placeholder { color: var(--steel); }
.pg-search:focus { border-color: var(--fb-blue); background: var(--canvas); }
.pg-count { font-size: 14px; color: var(--steel); font-weight: 700; letter-spacing: -0.14px; }

.pg-category { margin-bottom: 48px; }
.pg-category__title {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: var(--ink-deep);
    margin: 0 0 20px;
}

.pg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

/* Flat white product cards — 16px radius, hairline border, no shadow */
.pg-card {
    display: flex;
    flex-direction: column;
    background: var(--canvas);
    border-radius: var(--r-xl);
    padding: 20px;
    text-decoration: none;
    color: var(--ink);
    border: 1px solid var(--hairline-soft);
    transition: border-color 0.15s ease;
}
.pg-card:hover { border-color: var(--ink-deep); }
.pg-card__name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--ink-deep);
    margin-bottom: 12px;
    line-height: 1.25;
}
.pg-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; }

.pg-card__mini {
    color: var(--steel);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Optimal-time pill badge */
.pg-card__chip {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.33;
    padding: 4px 10px;
    border-radius: var(--r-full);
    color: #fff;
}

.pg-noresults { text-align: center; color: var(--steel); font-size: 16px; padding: 48px; }

/* ==========================================================================
   Stack builder (stack.html)
   ========================================================================== */
.pg-stack-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) { .pg-stack-layout { grid-template-columns: 1fr; } }

.pg-panel {
    background: var(--canvas);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--r-xl);
    padding: 24px;
}
.pg-panel__title {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.3px;
    color: var(--ink-deep);
    margin: 0 0 6px;
}
.pg-panel__hint { font-size: 14px; color: var(--steel); margin: 0 0 20px; line-height: 1.43; letter-spacing: -0.14px; }

.pg-picker { position: sticky; top: calc(var(--nav-height) + 16px); }
.pg-picker__search {
    width: 100%;
    height: 40px;
    padding: 0 20px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    background: var(--surface-soft);
    border: 1px solid transparent;
    border-radius: var(--r-full);
    margin-bottom: 16px;
    outline: none;
    box-sizing: border-box;
}
.pg-picker__search::placeholder { color: var(--steel); }
.pg-picker__search:focus { border-color: var(--fb-blue); background: var(--canvas); }

.pg-picker__list { max-height: 60vh; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.pg-picker__group-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--steel);
    font-weight: 700;
    margin: 18px 0 8px;
}

/* radio-option style rows */
.pg-picker__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(10, 19, 23, 0.12);
    border-radius: var(--r-lg);
    cursor: pointer;
    font-size: 14px;
    letter-spacing: -0.14px;
    color: var(--ink);
    background: var(--canvas);
    transition: border-color 0.12s ease, border-width 0.12s ease;
}
.pg-picker__item:hover { border-color: var(--steel); }
.pg-picker__item:has(input:checked) {
    border: 2px solid var(--cobalt);
    padding: 11px;
}
.pg-picker__item input { width: 18px; height: 18px; accent-color: var(--cobalt); cursor: pointer; flex: none; }
.pg-picker__item-time { margin-left: auto; font-size: 12px; color: var(--steel); white-space: nowrap; }

.pg-selected-empty { color: var(--steel); font-size: 14px; padding: 20px 0; text-align: center; }

.pg-schedule__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

/* Buttons — pill only */
.pg-btn {
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.14px;
    line-height: 1.43;
    padding: 14px 28px;
    border-radius: var(--r-full);
    background: var(--cobalt);
    color: var(--canvas);
    transition: background 0.15s ease;
}
.pg-btn:hover { background: var(--cobalt-deep); }
.pg-btn:active { background: var(--cobalt-deep); }
.pg-btn--ghost {
    background: transparent;
    color: var(--ink-deep);
    border: 2px solid rgba(10, 19, 23, 0.12);
    padding: 10px 22px;
}
.pg-btn--ghost:hover { background: var(--surface-soft); }

/* Weekly calendar grid */
.pg-week {
    display: grid;
    grid-template-columns: 96px repeat(7, 1fr);
    gap: 8px;
    min-width: 760px;
}
.pg-week__scroll { overflow-x: auto; padding-bottom: 8px; }
.pg-week__corner { }
.pg-week__day {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.14px;
    color: var(--ink-deep);
    padding: 10px 4px;
    background: var(--surface-soft);
    border-radius: var(--r-lg);
}
.pg-week__slot-label {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.33;
    color: var(--steel);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    padding-right: 8px;
}
.pg-week__cell {
    min-height: 60px;
    background: var(--canvas);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--r-lg);
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.pg-week__cell.pg-drop-hover { border: 2px solid var(--cobalt); background: rgba(0, 100, 224, 0.06); padding: 4px; }

/* Dose chips — pill badges colored by category */
.pg-dose {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.33;
    color: #fff;
    background: var(--cobalt);
    border-radius: var(--r-full);
    padding: 5px 10px;
    cursor: grab;
}
.pg-dose:active { cursor: grabbing; }

/* Category → color mapping (8 distinct, DESIGN.md palette only) */
.pg-dose--gh        { background: var(--cobalt); }         /* Growth Hormone */
.pg-dose--metabolic { background: var(--success); }        /* Metabolic / Weight */
.pg-dose--healing   { background: var(--fb-blue); }        /* Healing / Recovery */
.pg-dose--cognitive { background: var(--oculus-purple); }  /* Cognitive / Nootropic */
.pg-dose--longevity { background: var(--meta-link); }      /* Longevity / Anti-Aging */
.pg-dose--immune    { background: var(--critical); }       /* Immune / Thymic */
.pg-dose--sexual    { background: var(--attention); color: var(--ink-deep); } /* Sexual / Hormonal */
.pg-dose--cosmetic  { background: var(--ink-deep); }       /* Cosmetic / Skin */

.pg-dose__x {
    margin-left: auto;
    cursor: pointer;
    font-weight: 700;
    opacity: 0.8;
    padding: 0 2px;
}
.pg-dose__x:hover { opacity: 1; }

/* Legend as pill chips */
.pg-legend { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 24px; }
.pg-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.1px;
    color: var(--ink);
    background: var(--surface-soft);
    border-radius: var(--r-full);
    padding: 4px 12px 4px 8px;
}
.pg-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.pg-empty-week { text-align: center; color: var(--steel); font-size: 15px; padding: 48px 20px; }

/* ---- View Toggle ------------------------------------------------ */
.pg-view-toggle {
    display: flex;
    background: var(--surface-soft);
    border-radius: var(--r-full);
    padding: 3px;
}
.pg-view-toggle__btn {
    font-size: 13px;
    padding: 6px 18px;
    border-radius: var(--r-full);
    transition: background 0.15s, color 0.15s;
}
.pg-view-toggle__btn--active {
    background: var(--canvas);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-weight: 700;
}

/* ---- Yearly Calendar -------------------------------------------- */
.pg-year__nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.pg-year__nav-btn { font-size: 13px; padding: 6px 16px; }
.pg-year__nav-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-deep);
    text-align: center;
    flex: 1;
}
.pg-year__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.pg-year__month {
    background: var(--canvas);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--r-xl);
    padding: 16px;
}
.pg-year__month-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-deep);
    margin-bottom: 12px;
    text-align: center;
}
.pg-year__table {
    width: 100%;
    border-collapse: collapse;
}
.pg-year__table th {
    font-size: 11px;
    font-weight: 700;
    color: var(--steel);
    text-align: center;
    padding: 4px 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.pg-year__day {
    text-align: center;
    vertical-align: top;
    padding: 4px 2px;
    min-height: 44px;
    border-radius: var(--r-lg);
    transition: background 0.15s;
}
.pg-year__day:hover { background: var(--surface-soft); }
.pg-year__day--weekend .pg-year__day-num { color: var(--stone); }
.pg-year__day--today {
    background: rgba(0, 100, 224, 0.08);
}
.pg-year__day--today .pg-year__day-num {
    color: var(--cobalt);
    font-weight: 700;
    background: rgba(0, 100, 224, 0.12);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pg-year__day--empty { background: transparent; }
.pg-year__day-num {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 3px;
}
.pg-year__dots {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
}
.pg-year__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}

/* Responsive hero */
@media (max-width: 768px) {
    .pg-hero { padding: 48px 20px 40px; }
    .pg-hero h1 { font-size: 36px; letter-spacing: -0.6px; }
    .pg-hero p { font-size: 16px; }
    .pg-container { padding: 40px 20px; }
    .pg-promo { padding: 0 20px; }
    .pg-promo__card { padding: 32px 28px; }
}
@media (max-width: 480px) {
    .pg-hero h1 { font-size: 28px; }
}
