/* ============================================================================
   vault-mobile-projects.css
   ----------------------------------------------------------------------------
   Mobile status-filter bar for the Blueprints Vault (plans/index.html), driven
   by vault-mobile-filter.js. Gives the mobile vault the feel of the desktop
   Projects tab: a compact, horizontally-scrollable row of status chips with
   live counts, above the project/plan list.

   Theme-matched: uses the same --plans-* tokens as plans.css (both dark and the
   [data-theme="light"] overrides resolve automatically). Loaded AFTER plans.css.

   Scoped to phones (<= 720px) so the desktop vault is untouched.
   ========================================================================== */

/* ============================================================================
   /plans landing — amber/brown "kraft" theme → app BLUE theme
   ----------------------------------------------------------------------------
   The "Plans landing makeover" block in plans.css (~L46100) hardcodes a warm
   brown/amber palette (#0b0b09 bg, #11100d panels, rgba(255,177,95…) amber,
   #f28c28 orange) across the whole /plans page. It clashes with the rest of the
   blue app. This block remaps those exact surfaces to the app's blue tokens.
   Scoped entirely to body.plans-body.plans-landing-page and loaded AFTER
   plans.css so it wins. Workspace/session pages are untouched.

   Blue palette used: #4f8bff (accent), #7db9ff (hot), deep navy surfaces to
   match --plans-bg (#020617 / #040a19).
   ========================================================================== */
body.plans-body.plans-landing-page {
    --plans-accent: #4f8bff;
    --plans-accent-hot: #7db9ff;
    --t-accent: #4f8bff;
    --t-accent-hot: #7db9ff;
    background-color: #050a16 !important;
}

[data-theme="light"] body.plans-body.plans-landing-page {
    --plans-accent: #2563eb;
    --plans-accent-hot: #1d4ed8;
    --t-accent: #2563eb;
    --t-accent-hot: #1d4ed8;
}

/* Page background: navy gradient + blue glows (was brown-black + orange). */
body.plans-body.plans-landing-page .app-main {
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 16% 18%, rgba(79, 139, 255, 0.16), transparent 34%),
        radial-gradient(circle at 82% 28%, rgba(126, 250, 209, 0.12), transparent 36%),
        linear-gradient(135deg, #050a16 0%, #030712 48%, #060c1c 100%) !important;
    background-size: 44px 44px, 44px 44px, auto, auto, auto !important;
}
body.plans-body.plans-landing-page .app-header {
    background: linear-gradient(180deg, rgba(9, 13, 26, 0.98), rgba(5, 7, 16, 0.98)) !important;
}

/* Hero copy: amber eyebrow + cream heading + orange glow → blue/white. */
body.plans-body.plans-landing-page .plans-upload-eyebrow {
    color: #7db9ff;
}
body.plans-body.plans-landing-page .plans-upload-hero-copy h1 {
    color: #f6f9ff;
}
body.plans-body.plans-landing-page .plans-upload-lead {
    color: rgba(234, 241, 255, 0.72);
}
body.plans-body.plans-landing-page .plans-upload-lead strong {
    color: #7db9ff;
}
/* Kill the decorative glow + grid behind the hero text — just clean text. */
body.plans-body.plans-landing-page .plans-upload-hero-copy {
    background: none !important;
    border: 0 !important;
}
body.plans-body.plans-landing-page .plans-upload-hero-copy::after {
    display: none !important;
}
body.plans-body.plans-landing-page .plans-upload-proof-row span {
    border-color: rgba(79, 139, 255, 0.28);
    background: rgba(79, 139, 255, 0.1);
    color: rgba(234, 241, 255, 0.84);
}

/* Upload panel + dropzone: keep the light "paper" dropzone but swap amber
   accents to blue. */
body.plans-body.plans-landing-page .plans-upload-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
        #0a1120 !important;
}
/* Dropzone: KEEP the cream/paper look Kyle likes. Only swap the amber accents
   (border, hover border) to blue so it fits the blue theme. Cream bg + dark
   text left as-is from plans.css. */
body.plans-body.plans-landing-page .plans-upload-dropzone {
    border-color: rgba(79, 139, 255, 0.4) !important;
}
body.plans-body.plans-landing-page .plans-upload-dropzone:hover,
body.plans-body.plans-landing-page .plans-upload-dropzone.drag-over {
    border-color: #4f8bff !important;
}

/* ── Mobile: shorten + tighten the hero so it's compact ── */
@media (max-width: 720px) {
    body.plans-body.plans-landing-page .plans-upload-hero-copy h1 {
        font-size: clamp(1.5rem, 6vw, 1.9rem);
        line-height: 1.08;
    }
    body.plans-body.plans-landing-page .plans-upload-eyebrow {
        font-size: 0.64rem;
        margin-bottom: 0.4rem;
    }
    body.plans-body.plans-landing-page .plans-upload-lead {
        font-size: 0.86rem;
        line-height: 1.45;
        margin-top: 0.5rem;
    }
    body.plans-body.plans-landing-page .plans-upload-proof-row {
        gap: 0.35rem;
        margin-top: 0.7rem;
    }
    body.plans-body.plans-landing-page .plans-upload-proof-row span {
        font-size: 0.68rem;
        padding: 0.3rem 0.5rem;
        min-height: 28px;
    }
}
body.plans-body.plans-landing-page .plans-upload-icon::before,
body.plans-body.plans-landing-page .plans-upload-icon::after {
    background: #4f8bff;
    box-shadow: 0 0 18px rgba(79, 139, 255, 0.4);
}

/* Project select + create button: amber → blue borders on navy. */
body.plans-body.plans-landing-page .plans-project-select,
body.plans-body.plans-landing-page .plans-project-create-btn {
    border-color: rgba(79, 139, 255, 0.28);
    background-color: #0d1526;
}
body.plans-body.plans-landing-page .plans-project-create-btn:hover {
    border-color: #4f8bff;
    background-color: #12203a;
}
body.plans-body.plans-landing-page .plans-project-label-text,
body.plans-body.plans-landing-page .plans-no-plans-text,
body.plans-body.plans-landing-page .plans-card-title,
body.plans-body.plans-landing-page .plans-card-title-accent {
    color: #eaf1ff;
}

/* Warm cream text (#fff7e7) used across project selector / buttons / loader /
   hints reads brown — recolor to a cool off-white on the landing. */
body.plans-body.plans-landing-page .plans-project-select,
body.plans-body.plans-landing-page .plans-project-create-btn,
body.plans-body.plans-landing-page .plans-project-create-icon,
body.plans-body.plans-landing-page .plans-project-create-text,
body.plans-body.plans-landing-page .plans-btn-secondary {
    color: #eaf1ff !important;
}
body.plans-body.plans-landing-page .plans-loader-bytes,
body.plans-body.plans-landing-page .plans-loader-meta,
body.plans-body.plans-landing-page .plans-loader-elapsed,
body.plans-body.plans-landing-page .plans-loader-speed,
body.plans-body.plans-landing-page .plans-loader-eta,
body.plans-body.plans-landing-page .plans-loader-tip,
body.plans-body.plans-landing-page .plans-no-plans-hint {
    color: rgba(234, 241, 255, 0.62) !important;
}
/* Loader glows: orange → blue. */
body.plans-body.plans-landing-page .plans-loader-icon {
    box-shadow: 0 0 22px rgba(79, 139, 255, 0.55) !important;
}
body.plans-body.plans-landing-page .plans-loader-percent {
    text-shadow: 0 0 24px rgba(79, 139, 255, 0.34), 0 0 0 rgba(0,0,0,0) !important;
}
body.plans-body.plans-landing-page .plans-loader-progress-fill {
    box-shadow: 0 0 14px rgba(79, 139, 255, 0.55) !important;
}

/* "No plans" nudge. */
body.plans-body.plans-landing-page .plans-no-plans-nudge {
    border-color: rgba(79, 139, 255, 0.22);
    background: rgba(79, 139, 255, 0.08);
}

/* Blueprint Vault card: navy surface + blue border/glow (was #0b0b09 + amber). */
body.plans-body.plans-landing-page .plans-vault-card {
    border-color: rgba(79, 139, 255, 0.2);
    background:
        radial-gradient(circle at 50% 0%, rgba(79, 139, 255, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
        #060c1c !important;
}
body.plans-body.plans-landing-page #plans-vault .plans-card-header,
body.plans-body.plans-landing-page .plans-vault-card .plans-card-header {
    background:
        linear-gradient(90deg, rgba(79, 139, 255, 0.16), rgba(79, 139, 255, 0.03) 52%, transparent),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)) !important;
}
body.plans-body.plans-landing-page .plans-vault-empty {
    border-color: rgba(79, 139, 255, 0.24);
    background: rgba(79, 139, 255, 0.07);
    color: rgba(234, 241, 255, 0.7);
}
body.plans-body.plans-landing-page .plans-vault-icon-img--safe {
    filter: none;
}
/* Delete button: warm salmon → muted blue-grey. */
body.plans-body.plans-landing-page .plans-vault-delete,
body.plans-body.plans-landing-page .plans-vault-delete svg {
    color: rgba(148, 178, 230, 0.82);
}

/* Primary buttons + brand accent text: #f28c28 orange → app blue.
   plans.css L47010 sets these with the same 3-class specificity + !important,
   so bump ours with an extra :not() to guarantee the win. */
body.plans-body.plans-landing-page .plans-btn-primary:not(#_),
body.plans-body.plans-landing-page .plans-mobile-nav-actions .plans-btn-primary:not(#_),
body.plans-body.plans-landing-page .plans-modal-footer .plans-btn-primary:not(#_) {
    background: #4f8bff !important;
    border-color: #4f8bff !important;
    color: #ffffff !important;
    box-shadow: 0 12px 26px rgba(79, 139, 255, 0.28) !important;
}
body.plans-body.plans-landing-page .plans-btn-primary:not(#_):hover,
body.plans-body.plans-landing-page .plans-btn-primary:not(#_):focus-visible {
    background: #6ea3ff !important;
    border-color: #6ea3ff !important;
}
body.plans-body.plans-landing-page .brand-white:not(#_) {
    color: #7db9ff !important;
    border-color: transparent !important;
}
/* Footer brand text has an ID-scoped rule (#plans-vault .plans-card-footer
   .brand-white) — match that specificity. */
body.plans-body.plans-landing-page #plans-vault .plans-card-footer .brand-white {
    color: #7db9ff !important;
}

/* Loader ring + progress fill. */
body.plans-body.plans-landing-page .plans-loader-progress {
    border-color: rgba(79, 139, 255, 0.22);
}
body.plans-body.plans-landing-page .plans-loader-progress-fill {
    background: linear-gradient(90deg, #2f6ede, #4f8bff, #7db9ff) !important;
}
body.plans-body.plans-landing-page .plans-loader-icon {
    background: radial-gradient(circle, #dce9ff 0px, #b8d2ff 100%) !important;
}

/* Vault empty state + safe icon glow. */
body.plans-body.plans-landing-page .plans-vault-empty:not(#_) {
    border-color: rgba(79, 139, 255, 0.28) !important;
    background: linear-gradient(135deg, rgba(79, 139, 255, 0.1), rgba(255, 255, 255, 0.035)) !important;
}
body.plans-body.plans-landing-page .plans-vault-icon-img--safe:not(#_) {
    border-color: rgba(79, 139, 255, 0.22) !important;
    background: radial-gradient(circle at 50% 30%, rgba(79, 139, 255, 0.18), transparent) !important;
}
body.plans-body.plans-landing-page .plans-vault-delete:not(#_),
body.plans-body.plans-landing-page .plans-vault-delete:not(#_) svg {
    color: rgba(148, 178, 230, 0.82) !important;
}

/* Saved-plan cards ("plan chips") + thumbs: warm brown-black (#0c0c0a) + amber
   hover → neutral navy + blue hover. Matches plans.css #plans-vault specificity. */
body.plans-body.plans-landing-page #plans-vault .plans-vault-card-item {
    border-color: rgba(79, 139, 255, 0.16);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
        rgba(8, 13, 24, 0.9);
}
body.plans-body.plans-landing-page #plans-vault .plans-vault-card-item:hover,
body.plans-body.plans-landing-page #plans-vault .plans-vault-card-item:focus-visible {
    border-color: rgba(79, 139, 255, 0.5);
    background:
        linear-gradient(135deg, rgba(79, 139, 255, 0.12), rgba(255, 255, 255, 0.035)),
        rgba(11, 17, 30, 0.96);
}
body.plans-body.plans-landing-page #plans-vault .plans-vault-thumb {
    border-color: rgba(255, 255, 255, 0.14);
    background: linear-gradient(135deg, rgba(226, 236, 255, 0.08), rgba(226, 236, 255, 0.02));
}
/* Project group cards too. */
body.plans-body.plans-landing-page #plans-vault .plans-vault-project-group {
    border-color: rgba(79, 139, 255, 0.16);
    background: rgba(8, 13, 24, 0.6);
}
body.plans-body.plans-landing-page .plans-vault-safe-visual {
    border-color: rgba(79, 139, 255, 0.12);
    background:
        radial-gradient(circle at 50% 30%, rgba(79, 139, 255, 0.18), transparent 44%),
        linear-gradient(180deg, rgba(234, 241, 255, 0.035), transparent),
        linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)) !important;
}

/* The dropzone's hardcoded amber glow + hover border → blue to match. */
body.plans-body.plans-landing-page .plans-upload-dropzone::after {
    background: radial-gradient(circle, rgba(79, 139, 255, 0.18), transparent 70%);
}
body.plans-body.plans-landing-page .plans-upload-dropzone:hover,
body.plans-body.plans-landing-page .plans-upload-dropzone.drag-over {
    border-color: rgba(79, 139, 255, 0.7);
}

/* On a blue accent, active-state text must be white (not the dark-on-amber
   #1a1205 used elsewhere). Applies to the switcher, chips, and New Job button. */
body.plans-body.plans-landing-page .plans-view-switch-btn.is-active,
body.plans-body.plans-landing-page .vault-mfilter-chip.is-active,
body.plans-body.plans-landing-page .plans-projects-newjob:hover,
body.plans-body.plans-landing-page .plans-projects-newjob:focus-visible {
    color: #ffffff;
}
body.plans-body.plans-landing-page .vault-mfilter-chip.is-active .vault-mfilter-chip-count {
    background: rgba(255, 255, 255, 0.22);
}

/* ── Mobile view switcher (Upload | My Plans) on the /plans landing ──
   Desktop keeps the uploader + vault side by side, so the switch is hidden
   at >720px. On phones, the switch shows and toggles which section is visible
   via body.plans-view-upload / body.plans-view-plans (set by
   landing-view-switch.js). */
body.plans-body.plans-landing-page .plans-view-switch {
    display: none;
}

/* Switcher shows on phones AND tablets (iPad portrait is 768px) — anything
   below the desktop two-column layout. */
@media (max-width: 1024px) {
    body.plans-body.plans-landing-page .plans-view-switch {
        display: flex;
        gap: 0.35rem;
        padding: 0.3rem;
        margin: 0 0 0.9rem;
        border-radius: 999px;
        border: 1px solid var(--plans-border, rgba(255, 255, 255, 0.08));
        background: var(--plans-panel-alt, rgba(255, 255, 255, 0.04));
    }

    .plans-view-switch-btn {
        flex: 1 1 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.55rem 0.5rem;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--plans-muted, rgba(246, 247, 255, 0.64));
        font-family: inherit;
        font-size: 0.88rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .plans-view-switch-btn svg {
        flex-shrink: 0;
    }

    .plans-view-switch-btn.is-active {
        background: rgba(255, 255, 255, 0.1);
        color: var(--plans-text, #f6f7ff);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    }
    .plans-view-switch-btn.is-active svg {
        color: var(--plans-success, #7efad1);
    }

    /* Toggle which section shows. Default (no body flag) = upload view.
       Uses !important because #plans-hero carries a display:flex !important
       from .plans-hero-upload-card.plans-card. */
    body.plans-view-plans #plans-hero {
        display: none !important;
    }
    body.plans-view-upload #plans-vault {
        display: none !important;
    }
    /* Force single-column so the active view fills the width (overrides the
       desktop 2-col .plans-landing-grid that kicks in >720px). */
    body.plans-body.plans-landing-page .plans-landing-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    body.plans-view-plans #plans-vault {
        max-height: none;
        height: auto;
    }
}

/* ── Chip bar container ──
   On the landing page the bar is a mobile-only affordance; on the dedicated
   Projects page it shows at all widths. */
.vault-mfilter {
    display: none;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.1rem 0.1rem 0.65rem;
    margin: 0 0 0.85rem;
    border-bottom: 1px solid var(--plans-border, rgba(255, 255, 255, 0.08));
}

.plans-projects-page .vault-mfilter {
    display: flex;
}

/* Chip appearance — GLOBAL (not inside a media query) so desktop/tablet match
   mobile. This was the desktop breakage: chips showed but were unstyled. */
.vault-mfilter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--plans-border, rgba(255, 255, 255, 0.08));
    background: var(--plans-panel-alt, rgba(255, 255, 255, 0.04));
    color: var(--plans-muted, rgba(246, 247, 255, 0.64));
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    scroll-snap-align: start;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.vault-mfilter-chip:hover,
.vault-mfilter-chip:focus-visible {
    color: var(--plans-text, #f6f7ff);
    border-color: var(--plans-border-strong, rgba(255, 255, 255, 0.16));
}

.vault-mfilter-chip.is-active {
    background: var(--plans-accent, #ffc955);
    border-color: var(--plans-accent, #ffc955);
    color: #1a1205;
}

.vault-mfilter-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    font-size: 0.68rem;
    font-weight: 700;
}

.vault-mfilter-chip.is-active .vault-mfilter-chip-count {
    background: rgba(0, 0, 0, 0.16);
}

.vault-mfilter-empty {
    margin: 0.5rem 0 0;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--plans-muted, rgba(246, 247, 255, 0.64));
    font-size: 0.88rem;
}

/* ── Dedicated Projects page layout ──
   The shared .plans-landing-grid is a 2-column grid built for the uploader +
   vault side by side. The Projects page has a single card, so force one full-
   width column and let the card grow to content (drop the vault max-height
   clamp that's meant for the cramped landing layout). Works desktop + mobile. */
body.plans-projects-page .plans-landing-grid,
body.plans-body.plans-landing-page.plans-projects-page .plans-landing-grid {
    grid-template-columns: minmax(0, 1fr) !important;
}

body.plans-projects-page .plans-vault-card {
    max-height: none;
    height: auto;
}

/* Roomier grid of plan cards on wide screens. */
@media (min-width: 721px) {
    .plans-projects-page .plans-vault-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }
}

/* New Job button in the Projects page header. */
.plans-projects-newjob {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--plans-border-strong, rgba(255, 255, 255, 0.16));
    background: var(--plans-panel-alt, rgba(255, 255, 255, 0.04));
    color: var(--plans-text, #f6f7ff);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.plans-projects-newjob:hover,
.plans-projects-newjob:focus-visible {
    background: var(--plans-accent, #ffc955);
    border-color: var(--plans-accent, #ffc955);
    color: #1a1205;
}

.plans-projects-newjob svg {
    flex-shrink: 0;
}

/* On phones the bar scrolls horizontally instead of wrapping. */
@media (max-width: 720px) {
    .vault-mfilter {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }
    .vault-mfilter::-webkit-scrollbar {
        display: none;
    }
}

/* Light-mode: inactive count pill needs a darker tint on a light chip. */
[data-theme="light"] .vault-mfilter-chip-count {
    background: rgba(0, 0, 0, 0.08);
}
