/* ============================================================
   MOBILE BUILDER REDESIGN — v1
   ============================================================
   Activated only at viewport <= 768px. On desktop everything
   below is dormant. Architecture:

   - Hides the existing top bar + 9-pill severity grid on mobile
   - Hides the "AI Banner" wall of three buttons (replaced by
     a single big AI Dictate hero + inline mic on textareas)
   - Hides optional blocks by default (Title, Tags/Repair,
     Recommendation, Bottom Line, Limitation)
   - Surfaces them via tap-to-expand chips with content previews
   - Adds a sticky bottom action bar with one big Save button
   - Adds a compact sticky top header (section name + card count)
   - Keyboard-aware: when an input is focused, the bottom bar
     hides so the input is never covered

   Visual language matches existing brand:
   Cormorant Garamond for serif accents, navy (#183e61) +
   gold (#c8a96e), white cards, subtle shadows.
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   Hide mobile-only elements on desktop
   ──────────────────────────────────────────────────────────── */
.mb-mobile-only { display: none !important; }

/* ============================================================
   MOBILE BREAKPOINT
   ============================================================ */
@media (max-width: 768px) {

    /* Reveal mobile-only shells */
    .mb-mobile-only { display: block !important; }
    .mb-mobile-only.mb-flex { display: flex !important; }
    .mb-mobile-only.mb-grid { display: grid !important; }

    /* ────────────────────────────────────────────────────────
       Hide the busy desktop top bar entirely on mobile.
       Our new mb-header replaces it.
       ──────────────────────────────────────────────────────── */
    body.on-builder #view-builder > .panel:first-child {
        display: none !important;
    }

    /* ────────────────────────────────────────────────────────
       Hide the 9-pill severity grid + hidden select wrapper.
       The new mb-severity block replaces it.
       ──────────────────────────────────────────────────────── */
    #view-builder #standard-inputs ~ * #pill-standard,
    #view-builder div[style*="grid-template-columns: repeat(3"]:has(.type-pill) {
        /* Safety net only — the real hiding is done by JS class */
    }
    body.on-builder .mb-hide-original-pills {
        display: none !important;
    }

    /* ────────────────────────────────────────────────────────
       Hide the AI Hero Banner (3 buttons: AI Dictate / Dictate
       / Polish) — replaced by single big AI Dictate hero
       elsewhere. Dictate + Polish move into inline textarea
       toolbar instead.
       ──────────────────────────────────────────────────────── */
    body.on-builder .mb-hide-ai-banner {
        display: none !important;
    }

    /* ────────────────────────────────────────────────────────
       Top container — no top padding (sticky header handles it)
       ──────────────────────────────────────────────────────── */
    body.on-builder #view-builder {
        padding-top: 0 !important;
    }
    body.on-builder #view-builder > .panel:nth-child(2) {
        padding: 0 !important;
        background: #f1f5f9 !important;
    }
    body.on-builder #view-builder > .panel:nth-child(2) > div {
        padding: 0 8px 96px 8px !important;
        /* leave room for sticky bottom bar */
    }

    /* ────────────────────────────────────────────────────────
       1) STICKY TOP HEADER
       Section name + card count + back button + templates
       ──────────────────────────────────────────────────────── */
    .mb-header {
        position: sticky;
        top: 0;
        z-index: 50;
        background: white;
        border-bottom: 1px solid #e2e8f0;
        padding: 10px 12px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        display: flex !important;
        align-items: center;
        gap: 10px;
        margin: 0 -8px 12px;
        box-shadow: 0 1px 3px rgba(15,23,42,0.04);
    }
    .mb-header-back {
        background: #f1f5f9;
        border: none;
        width: 38px;
        height: 38px;
        border-radius: 99px;
        color: #475569;
        font-size: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .mb-header-back:active { background: #e2e8f0; }
    .mb-header-info {
        flex: 1;
        min-width: 0;
        line-height: 1.2;
    }
    .mb-header-section {
        font-family: 'Cormorant Garamond', Georgia, serif;
        font-size: 19px;
        font-weight: 600;
        color: #183e61;
        letter-spacing: -0.01em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mb-header-meta {
        font-size: 11px;
        font-weight: 700;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-top: 1px;
    }
    .mb-header-meta strong {
        color: #c8a96e;
        font-weight: 800;
    }
    .mb-header-btn {
        background: #f1f5f9;
        border: none;
        height: 38px;
        padding: 0 12px;
        border-radius: 99px;
        color: #475569;
        font-size: 12px;
        font-weight: 800;
        cursor: pointer;
        flex-shrink: 0;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-family: inherit;
        -webkit-tap-highlight-color: transparent;
    }
    .mb-header-btn:active { background: #e2e8f0; }

    /* ────────────────────────────────────────────────────────
       2) SEVERITY SELECTOR — the primary decision
       ──────────────────────────────────────────────────────── */
    .mb-severity {
        background: white;
        border-radius: 12px;
        padding: 14px;
        margin-bottom: 10px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    }
    .mb-severity-label {
        font-size: 10px;
        font-weight: 800;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 10px;
    }
    .mb-severity-primary {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-bottom: 8px;
    }
    .mb-sev-btn {
        background: white;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        padding: 16px 6px;
        font-family: inherit;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        transition: all 0.15s;
        min-height: 70px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    .mb-sev-btn:active { transform: scale(0.97); }
    .mb-sev-dot {
        width: 18px;
        height: 18px;
        border-radius: 99px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    }
    .mb-sev-label {
        font-size: 11px;
        font-weight: 800;
        color: #475569;
        text-transform: uppercase;
        letter-spacing: 0.4px;
    }
    /* Active states (one per severity) */
    .mb-sev-btn.mb-sev-active-minor    { background: #eff6ff; border-color: #2563eb; }
    .mb-sev-btn.mb-sev-active-minor    .mb-sev-label { color: #1e40af; }
    .mb-sev-btn.mb-sev-active-major    { background: #fff7ed; border-color: #ea580c; }
    .mb-sev-btn.mb-sev-active-major    .mb-sev-label { color: #c2410c; }
    .mb-sev-btn.mb-sev-active-material { background: #fef2f2; border-color: #dc2626; }
    .mb-sev-btn.mb-sev-active-material .mb-sev-label { color: #991b1b; }
    .mb-sev-btn.mb-sev-active-observed { background: #f8fafc; border-color: #475569; }
    .mb-sev-btn.mb-sev-active-observed .mb-sev-label { color: #334155; }
    .mb-sev-btn.mb-sev-active-monitor  { background: #ecfeff; border-color: #0891b2; }
    .mb-sev-btn.mb-sev-active-monitor  .mb-sev-label { color: #155e75; }
    .mb-sev-btn.mb-sev-active-further_eval { background: #f5f3ff; border-color: #7c3aed; }
    .mb-sev-btn.mb-sev-active-further_eval .mb-sev-label { color: #5b21b6; }
    .mb-sev-btn.mb-sev-active-standard { background: #f0f9ff; border-color: #183e61; }
    .mb-sev-btn.mb-sev-active-standard .mb-sev-label { color: #183e61; }
    .mb-sev-btn.mb-sev-active-summary  { background: #f8fafc; border-color: #334155; }
    .mb-sev-btn.mb-sev-active-summary  .mb-sev-label { color: #1e293b; }
    .mb-sev-btn.mb-sev-active-equipment { background: #f0fdfa; border-color: #0f766e; }
    .mb-sev-btn.mb-sev-active-equipment .mb-sev-label { color: #115e59; }
    .mb-sev-btn.mb-sev-active-limitation { background: #f8fafc; border-color: #64748b; }
    .mb-sev-btn.mb-sev-active-limitation .mb-sev-label { color: #475569; }
    .mb-sev-btn.mb-sev-active-video    { background: #fff7ed; border-color: #9a3412; }
    .mb-sev-btn.mb-sev-active-video    .mb-sev-label { color: #7c2d12; }

    .mb-severity-other-toggle {
        background: none;
        border: none;
        width: 100%;
        padding: 8px;
        font-size: 11px;
        font-weight: 700;
        color: #64748b;
        cursor: pointer;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-family: inherit;
        -webkit-tap-highlight-color: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }
    .mb-severity-other-toggle:active { color: #183e61; }
    .mb-severity-other {
        display: none;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid #f1f5f9;
    }
    .mb-severity-other.mb-open {
        display: grid;
    }
    .mb-sev-other-btn {
        background: white;
        border: 2px solid #e2e8f0;
        border-radius: 10px;
        padding: 12px 4px;
        font-family: inherit;
        cursor: pointer;
        font-size: 10px;
        font-weight: 800;
        color: #475569;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        transition: all 0.15s;
        min-height: 56px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        -webkit-tap-highlight-color: transparent;
    }
    .mb-sev-other-btn-icon {
        font-size: 18px;
    }
    .mb-sev-other-btn:active { transform: scale(0.97); }

    /* ────────────────────────────────────────────────────────
       3) AI DICTATE HERO
       Single huge button — the primary input method
       ──────────────────────────────────────────────────────── */
    .mb-ai-hero {
        background: linear-gradient(135deg, #183e61 0%, #1e5080 100%);
        border-radius: 14px;
        padding: 4px;
        margin-bottom: 10px;
        box-shadow: 0 4px 14px rgba(24,62,97,0.22);
    }
    .mb-ai-hero-btn {
        width: 100%;
        background: transparent;
        border: none;
        padding: 18px 16px;
        color: white;
        font-family: inherit;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 14px;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    .mb-ai-hero-btn:active {
        background: rgba(255,255,255,0.06);
        border-radius: 10px;
    }
    .mb-ai-hero-icon {
        width: 48px;
        height: 48px;
        background: rgba(255,255,255,0.18);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        flex-shrink: 0;
    }
    .mb-ai-hero-text {
        flex: 1;
        min-width: 0;
    }
    .mb-ai-hero-title {
        font-size: 16px;
        font-weight: 800;
        margin-bottom: 2px;
        letter-spacing: -0.005em;
    }
    .mb-ai-hero-subtitle {
        font-size: 11px;
        color: rgba(255,255,255,0.7);
        font-weight: 600;
    }
    .mb-ai-hero-arrow {
        font-size: 22px;
        color: rgba(255,255,255,0.5);
        flex-shrink: 0;
    }

    /* Active dictating state */
    .mb-ai-hero.mb-listening {
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
        animation: mbPulse 1.4s ease-in-out infinite;
    }
    .mb-ai-hero.mb-listening .mb-ai-hero-icon {
        background: rgba(255,255,255,0.25);
    }
    @keyframes mbPulse {
        0%, 100% { box-shadow: 0 4px 14px rgba(220,38,38,0.3); }
        50%      { box-shadow: 0 4px 24px rgba(220,38,38,0.6); }
    }

    /* ────────────────────────────────────────────────────────
       4) COMPONENT ROW — single inline line, compact
       ──────────────────────────────────────────────────────── */
    body.on-builder #system-selectors {
        background: white;
        border-radius: 12px;
        padding: 12px 14px;
        margin-bottom: 10px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    }
    body.on-builder #system-selectors > div:first-of-type label,
    body.on-builder #material-container label,
    body.on-builder #category-container label {
        font-size: 10px !important;
        margin-bottom: 4px !important;
    }
    body.on-builder #system-selectors select,
    body.on-builder #category-container select {
        padding: 12px 12px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        border: 1.5px solid #e2e8f0 !important;
        background-color: #f8fafc !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 10px center !important;
        background-size: 20px !important;
        padding-right: 36px !important;
    }
    /* Hazard category hidden by default — opened via "Hazard Category" chip */
    body.on-builder #category-container {
        display: none !important;
    }
    body.on-builder #category-container.mb-revealed {
        display: block !important;
        margin-top: 10px !important;
    }

    /* ────────────────────────────────────────────────────────
       5) NARRATIVE — the focal field
       ──────────────────────────────────────────────────────── */
    body.on-builder #mob-block-narrative {
        background: white !important;
        border-radius: 12px !important;
        padding: 14px !important;
        margin-bottom: 10px !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
    }
    body.on-builder #mob-block-narrative > div:first-child label {
        font-size: 10px !important;
        font-weight: 800 !important;
        letter-spacing: 1px !important;
        color: #183e61 !important;
    }
    body.on-builder #narrative {
        min-height: 130px !important;
        font-size: 16px !important;   /* 16px stops iOS zoom on focus */
        line-height: 1.55 !important;
        padding: 14px !important;
        border-radius: 10px !important;
        border: 1.5px solid #e2e8f0 !important;
        background: #fafbfc !important;
    }
    body.on-builder #narrative:focus {
        background: white !important;
        border-color: #183e61 !important;
        box-shadow: 0 0 0 3px rgba(24,62,97,0.08) !important;
        outline: none !important;
    }
    /* Inline B / I / 🎙 / ✨ toolbar — tighten */
    body.on-builder #mob-block-narrative .btn-micro {
        min-width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
        padding: 0 !important;
    }

    /* ────────────────────────────────────────────────────────
       6) PHOTOS — moved up via CSS order
       ──────────────────────────────────────────────────────── */
    body.on-builder #standard-inputs {
        display: flex !important;
        flex-direction: column !important;
    }
    body.on-builder #standard-inputs > .mb-hide-ai-banner { order: 0; }
    body.on-builder #standard-inputs > #gen-standard-container { order: 1; }
    body.on-builder #standard-inputs > #quick-fields-container { order: 2; }
    body.on-builder #standard-inputs > #mob-block-narrative { order: 3; }
    body.on-builder #standard-inputs > #mob-block-photos { order: 4; }
    body.on-builder #standard-inputs > .mb-chip-strip { order: 5; }
    body.on-builder #standard-inputs > #mob-block-title-location { order: 6; }
    body.on-builder #standard-inputs > #defect-only-fields { order: 7; }
    body.on-builder #standard-inputs > #mob-block-recommendation { order: 8; }
    body.on-builder #standard-inputs > #mob-block-bottomline { order: 9; }
    body.on-builder #standard-inputs > #limitation-text { order: 10; }

    body.on-builder #mob-block-photos {
        background: white !important;
        border-radius: 12px !important;
        padding: 14px !important;
        margin-bottom: 10px !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
    }
    body.on-builder #mob-block-photos > label.checkbox-label {
        margin: 0 0 12px 0 !important;
        font-size: 10px !important;
        font-weight: 800 !important;
        letter-spacing: 1px !important;
        color: #183e61 !important;
        text-transform: uppercase !important;
    }

    /* ────────────────────────────────────────────────────────
       7) CHIP STRIP — toggles optional blocks
       ──────────────────────────────────────────────────────── */
    .mb-chip-strip {
        display: flex !important;
        flex-wrap: wrap;
        gap: 6px;
        background: white;
        padding: 12px 14px;
        border-radius: 12px;
        margin-bottom: 10px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    }
    .mb-chip-strip-label {
        width: 100%;
        font-size: 10px;
        font-weight: 800;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }
    .mb-chip {
        background: #f8fafc;
        border: 1.5px solid #e2e8f0;
        border-radius: 99px;
        padding: 9px 14px;
        font-family: inherit;
        font-size: 12px;
        font-weight: 700;
        color: #475569;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: all 0.15s;
        max-width: 100%;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    .mb-chip:active { transform: scale(0.97); }
    .mb-chip-icon {
        font-size: 13px;
        line-height: 1;
        font-weight: 800;
    }
    .mb-chip-text {
        max-width: 200px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Chip states */
    .mb-chip.mb-chip-open {
        background: #eff6ff;
        border-color: #2563eb;
        color: #1e40af;
    }
    .mb-chip.mb-chip-filled {
        background: linear-gradient(135deg, #f0fdf4, #dcfce3);
        border-color: #86efac;
        color: #166534;
    }
    .mb-chip.mb-chip-filled.mb-chip-open {
        background: linear-gradient(135deg, #ecfdf5, #d1fae5);
        border-color: #16a34a;
        color: #14532d;
    }

    /* ────────────────────────────────────────────────────────
       8) OPTIONAL BLOCKS — hidden by default, shown when chip
       activates them. The blocks already exist in DOM; we
       just toggle visibility via a class on the chip strip's
       parent.
       ──────────────────────────────────────────────────────── */
    body.on-builder #mob-block-title-location,
    body.on-builder #defect-only-fields,
    body.on-builder #mob-block-recommendation,
    body.on-builder #mob-block-bottomline,
    body.on-builder #limitation-text {
        display: none !important;
    }
    body.on-builder #mob-block-title-location.mb-revealed,
    body.on-builder #defect-only-fields.mb-revealed,
    body.on-builder #mob-block-recommendation.mb-revealed,
    body.on-builder #mob-block-bottomline.mb-revealed {
        display: block !important;
        animation: mbSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }
    body.on-builder #limitation-text.mb-revealed {
        display: block !important;
        animation: mbSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
        background: white !important;
        border-radius: 12px !important;
        padding: 14px !important;
        margin-bottom: 10px !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
        min-height: 80px !important;
        font-size: 14px !important;
    }
    @keyframes mbSlideDown {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* Slightly compact the revealed blocks */
    body.on-builder #mob-block-title-location.mb-revealed,
    body.on-builder #defect-only-fields.mb-revealed,
    body.on-builder #mob-block-recommendation.mb-revealed,
    body.on-builder #mob-block-bottomline.mb-revealed {
        padding: 14px !important;
    }

    /* 16px font on all inputs to stop iOS focus zoom */
    body.on-builder #title,
    body.on-builder #location,
    body.on-builder #recommendation,
    body.on-builder #bottom-line,
    body.on-builder #limitation-text,
    body.on-builder #rp-trade,
    body.on-builder #rp-cost,
    body.on-builder #tag-input {
        font-size: 16px !important;
    }

    /* ────────────────────────────────────────────────────────
       9) BOTTOM ACTION BAR
       Replaces the old #add-report-btn with a full action row.
       IMPORTANT: scoped to body.on-builder only — appended to
       <body> so it would otherwise leak onto dashboard/outline/
       report/etc. views.
       ──────────────────────────────────────────────────────── */
    body:not(.on-builder) #mb-action-bar,
    body:not(.on-builder) #mb-toast {
        display: none !important;
    }
    .mb-action-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1999 !important;
        display: flex !important;
        gap: 0;
        background: white;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.10);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .mb-action-bar.mb-action-hide {
        transform: translateY(110%);
    }
    .mb-action-btn {
        flex: 1;
        background: none;
        border: none;
        padding: 16px 8px;
        font-family: inherit;
        font-size: 13px;
        font-weight: 800;
        color: #475569;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        min-height: 60px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        border-right: 1px solid #f1f5f9;
    }
    .mb-action-btn:last-child { border-right: none; }
    .mb-action-btn:active { background: #f8fafc; }
    .mb-action-btn-icon { font-size: 16px; }
    .mb-action-btn-primary {
        background: linear-gradient(135deg, #16a34a, #15803d);
        color: white;
        flex: 1.4;
    }
    .mb-action-btn-primary:active {
        background: linear-gradient(135deg, #15803d, #166534);
    }

    /* Hide the OLD sticky save button completely — we replaced it */
    body.on-builder #add-report-btn,
    body.on-builder #reset-btn {
        display: none !important;
    }
    /* And hide the preview box + saved cards list on mobile — those live in the outline view */
    body.on-builder #view-builder > .panel:last-child > #preview-box,
    body.on-builder #view-builder > .panel:last-child > h4,
    body.on-builder #view-builder > .panel:last-child > #section-cards-output {
        display: none !important;
    }

    /* ────────────────────────────────────────────────────────
       10) SAVE FEEDBACK TOAST
       ──────────────────────────────────────────────────────── */
    .mb-toast {
        position: fixed;
        left: 50%;
        bottom: 90px;
        transform: translateX(-50%) translateY(20px);
        background: rgba(15,23,42,0.92);
        color: white;
        padding: 12px 22px;
        border-radius: 99px;
        font-size: 13px;
        font-weight: 700;
        z-index: 2500;
        opacity: 0;
        pointer-events: none;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.25);
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }
    .mb-toast.mb-toast-visible {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    /* ────────────────────────────────────────────────────────
       11) MICRO-IMPROVEMENTS to existing elements on mobile
       ──────────────────────────────────────────────────────── */

    /* Photo slot buttons — bigger, friendlier */
    body.on-builder #btn-upload-1,
    body.on-builder #btn-upload-2 {
        padding: 22px 8px !important;
        font-size: 13px !important;
        min-height: 70px !important;
        font-weight: 700 !important;
    }

    /* The Hazard Category should NOT show by default — we wrapped it in a chip */
    body.on-builder #standard-inputs #category-container {
        display: none !important;
    }
    body.on-builder #standard-inputs #category-container.mb-revealed {
        display: block !important;
    }

    /* Compact the "Tags + Repair Plan" sub-grid */
    body.on-builder #defect-only-fields .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Tighten gen-standard banner */
    body.on-builder #gen-standard-container {
        padding: 12px 14px !important;
        border-radius: 10px !important;
    }
    body.on-builder #gen-standard-container > div {
        gap: 8px !important;
    }
    body.on-builder #gen-standard-btn {
        padding: 11px 14px !important;
        font-size: 11px !important;
    }
}

/* ============================================================
   DARK MODE OVERRIDES (mobile only)
   ============================================================ */
@media (max-width: 768px) {
    body.dark-mode.on-builder .mb-header {
        background: #112236;
        border-color: #1e3048;
    }
    body.dark-mode.on-builder .mb-header-section { color: #e2e8f0; }
    body.dark-mode.on-builder .mb-header-meta    { color: #64748b; }
    body.dark-mode.on-builder .mb-header-back,
    body.dark-mode.on-builder .mb-header-btn {
        background: #1e3048;
        color: #94a3b8;
    }
    body.dark-mode.on-builder .mb-severity,
    body.dark-mode.on-builder .mb-chip-strip,
    body.dark-mode.on-builder #mob-block-narrative,
    body.dark-mode.on-builder #mob-block-photos {
        background: #112236 !important;
    }
    body.dark-mode.on-builder .mb-sev-btn,
    body.dark-mode.on-builder .mb-sev-other-btn {
        background: #0d1a2d;
        border-color: #1e3048;
    }
    body.dark-mode.on-builder .mb-sev-label {
        color: #94a3b8;
    }
    body.dark-mode.on-builder .mb-chip {
        background: #0d1a2d;
        border-color: #1e3048;
        color: #94a3b8;
    }
    body.dark-mode.on-builder .mb-action-bar {
        background: #112236;
        border-color: #1e3048;
    }
    body.dark-mode.on-builder .mb-action-btn {
        color: #94a3b8;
        border-right-color: #1e3048;
    }
    body.dark-mode.on-builder .mb-action-btn:active {
        background: #0d1a2d;
    }
}