        /* ==========================================================
           PROFESSIONAL MINIMALIST A6 POSTER PRINT STUDIO
           Engineered for Black & White Laser Printers (No Banding, Zero Gradient Halftones)
           Dimensions: A6 (105mm x 148mm) | Pure High-Contrast Monochrome
           ========================================================== */

        :root {
            --poster-w: 105mm;
            --poster-h: 148mm;
            --black: #000000;
            --white: #ffffff;
            --gray-tint: #f5f5f5;
            --border-rule: #000000;
            --ui-bg: #1a1e22;
            --ui-card: #24292e;
            --ui-border: #3b434c;
            --ui-accent: #2ea44f;
            --ui-accent-hover: #2c974b;
            --ui-text: #f0f6fc;
            --ui-muted: #8b949e;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            -webkit-print-color-adjust: exact !important;
            print-color-adjust: exact !important;
        }

        body {
            background-color: var(--ui-bg);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            color: var(--ui-text);
            min-height: 100vh;
        }

        /* ==========================================================
           UI APP CONTAINER (SCREEN ONLY - HIDDEN IN PRINT)
           ========================================================== */
        .app-layout {
            display: flex;
            min-height: 100vh;
        }

        /* LEFT SIDEBAR: CUSTOMIZER CONTROLS */
        .sidebar {
            width: 440px;
            background: var(--ui-card);
            border-right: 1px solid var(--ui-border);
            padding: 24px 28px;
            overflow-y: auto;
            max-height: 100vh;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .brand-header {
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid var(--ui-border);
            padding-bottom: 16px;
        }

        .brand-header img {
            width: 42px;
            height: 42px;
            border-radius: 8px;
            background: #fff;
        }

        .brand-header-text h1 {
            font-size: 1.15rem;
            font-weight: 700;
            color: #ffffff;
            line-height: 1.2;
        }

        .brand-header-text p {
            font-size: 0.8rem;
            color: var(--ui-muted);
            margin-top: 2px;
        }

        .form-section {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .section-label {
            font-size: 0.82rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #58a6ff;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .input-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .input-group label {
            font-size: 0.82rem;
            color: #c9d1d9;
            font-weight: 600;
        }

        .input-group input,
        .input-group textarea,
        .input-group select {
            background: #0d1117;
            border: 1px solid var(--ui-border);
            color: #f0f6fc;
            padding: 9px 12px;
            border-radius: 6px;
            font-size: 0.88rem;
            font-family: inherit;
            transition: border-color 0.15s ease;
        }

        .input-group input:focus,
        .input-group textarea:focus {
            outline: none;
            border-color: #58a6ff;
            box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
        }

        .input-group textarea {
            resize: vertical;
            min-height: 75px;
            line-height: 1.4;
        }

        .char-counter {
            font-size: 0.72rem;
            color: var(--ui-muted);
            text-align: right;
        }

        /* URL PREFIX INPUT GROUP */
        .url-prefix-box {
            display: flex;
            align-items: stretch;
            background: #0d1117;
            border: 1px solid var(--ui-border);
            border-radius: 6px;
            overflow: hidden;
        }

        .url-prefix {
            background: #161b22;
            color: #8b949e;
            padding: 9px 10px;
            font-size: 0.78rem;
            font-family: monospace;
            border-right: 1px solid var(--ui-border);
            user-select: none;
            display: flex;
            align-items: center;
            white-space: nowrap;
        }

        .url-prefix-box input {
            border: none;
            background: transparent;
            border-radius: 0;
            flex: 1;
            padding: 9px 10px;
            font-family: monospace;
            font-size: 0.85rem;
            color: #58a6ff;
        }

        .url-prefix-box input:focus {
            box-shadow: none;
        }

        /* RADIO BUTTON TILES */
        .radio-tiles {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .radio-tile {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            background: #161b22;
            border: 1px solid var(--ui-border);
            padding: 10px 12px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .radio-tile:hover {
            border-color: #58a6ff;
        }

        .radio-tile input {
            margin-top: 3px;
            cursor: pointer;
        }

        .radio-tile-text .title {
            font-size: 0.84rem;
            font-weight: 600;
            color: #f0f6fc;
        }

        .radio-tile-text .desc {
            font-size: 0.74rem;
            color: var(--ui-muted);
            margin-top: 2px;
        }

        /* ACTION BUTTONS */
        .actions-section {
            margin-top: auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
            border-top: 1px solid var(--ui-border);
            padding-top: 18px;
        }

        .btn-print {
            background: var(--ui-accent);
            color: #ffffff;
            border: none;
            padding: 12px 20px;
            font-size: 1rem;
            font-weight: 700;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: background 0.15s ease;
        }

        .btn-print:hover {
            background: var(--ui-accent-hover);
        }

        .btn-secondary {
            background: #21262d;
            border: 1px solid var(--ui-border);
            color: #c9d1d9;
            padding: 8px 14px;
            font-size: 0.82rem;
            font-weight: 600;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.15s ease;
        }

        .btn-secondary:hover {
            background: #30363d;
            color: #fff;
        }

        .preset-buttons {
            display: flex;
            gap: 8px;
        }

        .preset-buttons button {
            flex: 1;
        }

        /* RIGHT PREVIEW STAGE */
        .preview-stage {
            flex: 1;
            padding: 30px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            overflow-y: auto;
            background: radial-gradient(#252a30 1px, transparent 1px);
            background-size: 20px 20px;
        }

        .preview-header-bar {
            width: var(--poster-w);
            max-width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            color: var(--ui-muted);
            font-size: 0.82rem;
        }

        .preview-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: #161b22;
            border: 1px solid var(--ui-border);
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.75rem;
            color: #58a6ff;
            font-weight: 600;
        }

        /* ==========================================================
           POSTER VIEWPORT (EXACT A6: 105mm x 148mm)
           ========================================================== */
        .poster-viewport {
            width: var(--poster-w);
            height: var(--poster-h);
            background: var(--white);
            color: var(--black);
            position: relative;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            user-select: none;
        }

        /* ---------------- MINIMALIST A6 POSTER INTERIOR ---------------- */
        .poster-sheet {
            width: 100%;
            height: 100%;
            background: #ffffff;
            position: relative;
            padding: 4.5mm;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        /* Safe Double Laser Borders */
        .border-outer {
            position: absolute;
            top: 4mm;
            left: 4mm;
            right: 4mm;
            bottom: 4mm;
            border: 1.2mm solid #000000;
            pointer-events: none;
        }

        .border-inner {
            position: absolute;
            top: 5.2mm;
            left: 5.2mm;
            right: 5.2mm;
            bottom: 5.2mm;
            border: 0.35mm solid #000000;
            pointer-events: none;
        }

        /* Minimalist Corner Rosettes/Crosshairs */
        .corner-mark {
            position: absolute;
            width: 2.2mm;
            height: 2.2mm;
            background: #000000;
            transform: rotate(45deg);
        }

        .cm-tl {
            top: 4.6mm;
            left: 4.6mm;
        }

        .cm-tr {
            top: 4.6mm;
            right: 4.6mm;
        }

        .cm-bl {
            bottom: 4.6mm;
            left: 4.6mm;
        }

        .cm-br {
            bottom: 4.6mm;
            right: 4.6mm;
        }

        /* POSTER INNER CONTENT FLOW */
        .poster-content {
            position: relative;
            z-index: 2;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 2.5mm 1.5mm;
            text-align: center;
        }

        /* 1. TOP HEADER: APP IDENTITY & DIRECT-TO-CONSUMER TRUST */
        .top-co-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 0.4mm solid #000000;
            padding-bottom: 1.4mm;
            margin-bottom: 1mm;
        }

        .co-logo-wrap {
            display: flex;
            align-items: center;
            gap: 2mm;
        }

        .co-logo {
            width: 9.5mm;
            height: 9.5mm;
            border-radius: 1.8mm;
            border: 0.35mm solid #000000;
            object-fit: cover;
        }

        .co-text {
            text-align: left;
        }

        .co-title {
            font-size: 7.2pt;
            font-weight: 900;
            letter-spacing: 0.4pt;
            color: #000000;
            line-height: 1.1;
            text-transform: uppercase;
            font-family: Arial, "Helvetica Neue", sans-serif;
        }

        .co-sub {
            font-size: 5pt;
            color: #222222;
            letter-spacing: 0.2pt;
            text-transform: uppercase;
            font-weight: 700;
            line-height: 1.2;
            margin-top: 0.3mm;
        }

        .co-badge {
            background: #000000;
            color: #ffffff;
            font-size: 4.8pt;
            font-weight: 800;
            letter-spacing: 0.4pt;
            padding: 0.8mm 2mm;
            border-radius: 1mm;
            text-transform: uppercase;
            white-space: nowrap;
        }

        /* 2. HERO FARM SECTION: PROMINENT FARM NAME & DESCRIPTION */
        .farm-hero-section {
            padding: 0.8mm 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.8mm;
        }

        .farm-eyebrow {
            font-size: 5.4pt;
            font-weight: 800;
            letter-spacing: 0.6pt;
            text-transform: uppercase;
            color: #000000;
        }

        .farm-name-display {
            font-size: 16pt;
            font-weight: 900;
            line-height: 1.08;
            letter-spacing: 0.2pt;
            color: #000000;
            text-transform: uppercase;
            font-family: Arial, "Helvetica Neue", sans-serif;
            max-width: 100%;
            word-wrap: break-word;
            padding: 0.4mm 0;
        }

        .farm-tagline-display {
            font-size: 7.2pt;
            font-family: Georgia, serif;
            font-style: italic;
            color: #333333;
            line-height: 1.2;
            max-width: 95%;
        }

        .farm-desc-box {
            border-top: 0.3mm solid #000000;
            border-bottom: 0.3mm solid #000000;
            padding: 1.2mm 2mm;
            margin-top: 0.6mm;
            width: 100%;
            background: #ffffff;
        }

        .farm-desc-display {
            font-size: 6.2pt;
            line-height: 1.35;
            color: #111111;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            text-align: center;
        }

        /* 3. HERO CALL TO ACTION & QR CODE ZONE */
        .qr-hero-card {
            border: 0.45mm solid #000000;
            position: relative;
            background: #ffffff;
            margin: 0.6mm 0;
            padding: 0 0 1.2mm;
        }

        /* Minimalist Corner Bracket Marks */
        .bk {
            position: absolute;
            width: 3.2mm;
            height: 3.2mm;
            border-color: #000000;
            border-style: solid;
        }

        .bk-tl {
            top: -0.8mm;
            left: -0.8mm;
            border-width: 0.55mm 0 0 0.55mm;
        }

        .bk-tr {
            top: -0.8mm;
            right: -0.8mm;
            border-width: 0.55mm 0.55mm 0 0;
        }

        .bk-bl {
            bottom: -0.8mm;
            left: -0.8mm;
            border-width: 0 0 0.55mm 0.55mm;
        }

        .bk-br {
            bottom: -0.8mm;
            right: -0.8mm;
            border-width: 0 0.55mm 0.55mm 0;
        }

        .qr-header-banner {
            background: #000000;
            color: #ffffff;
            font-size: 7pt;
            font-weight: 900;
            letter-spacing: 0.4pt;
            padding: 1mm 0;
            text-transform: uppercase;
        }

        .qr-subtext {
            font-size: 5.4pt;
            font-weight: 600;
            color: #222222;
            margin-top: 0.8mm;
        }

        .qr-code-stage {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0.8mm 0;
            min-height: 3cm;
            height: 3cm;
        }

        /* QR Canvas / Img container - Explicitly 3cm by 3cm on all pages */
        .qrcode-container,
        #qrcodeContainer,
        .sheet-4up-card .qrcode-container {
            width: 3cm !important;
            height: 3cm !important;
            min-width: 3cm !important;
            max-width: 3cm !important;
            min-height: 3cm !important;
            max-height: 3cm !important;
            border: 0.3mm solid #000000;
            padding: 0.5mm;
            background: #ffffff;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            box-sizing: border-box !important;
            overflow: hidden !important;
            margin: 0 auto !important;
        }

        .qrcode-container img,
        #qrcodeContainer img,
        .sheet-4up-card .qrcode-container img,
        .qr-code-stage img,
        .qr-img {
            width: 100% !important;
            height: 100% !important;
            max-width: 100% !important;
            max-height: 100% !important;
            object-fit: contain !important;
            display: block !important;
            margin: 0 auto !important;
            padding: 0 !important;
            box-sizing: border-box !important;
            image-rendering: pixelated;
        }

        .qrcode-container canvas,
        #qrcodeContainer canvas,
        .sheet-4up-card .qrcode-container canvas {
            width: 100% !important;
            height: 100% !important;
            max-width: 100% !important;
            max-height: 100% !important;
            object-fit: contain !important;
            box-sizing: border-box !important;
        }

        /* Blank Placeholder Frame (Option 3) - Explicitly 3cm by 3cm */
        .qr-blank-frame,
        #qrBlankFrame,
        .sheet-4up-card .qr-blank-frame {
            width: 3cm !important;
            height: 3cm !important;
            min-width: 3cm !important;
            max-width: 3cm !important;
            min-height: 3cm !important;
            max-height: 3cm !important;
            border: 0.45mm dashed #000000;
            background: #ffffff;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 1.5mm;
            text-align: center;
            box-sizing: border-box !important;
            overflow: hidden !important;
            margin: 0 auto !important;
        }

        .qr-blank-frame .ph-tag {
            font-size: 4.8pt;
            color: #555555;
            font-weight: 700;
        }

        .qr-blank-frame .ph-title {
            font-size: 6.5pt;
            font-weight: 900;
            line-height: 1.15;
            margin: 1mm 0;
            color: #000000;
            text-transform: uppercase;
        }

        .qr-blank-frame .ph-guide {
            font-size: 4.8pt;
            color: #444444;
        }

        .qr-direct-link {
            font-size: 6.2pt;
            font-weight: 800;
            font-family: monospace, -apple-system, sans-serif;
            color: #000000;
            letter-spacing: 0.2pt;
            word-break: break-all;
            padding: 0 2mm;
            margin-top: 0.4mm;
        }

        .qr-footer-hint {
            font-size: 4.8pt;
            font-weight: 800;
            letter-spacing: 0.3pt;
            color: #222222;
            text-transform: uppercase;
            margin-top: 0.6mm;
        }

        /* 4. THREE DIRECT CUSTOMER PILLARS */
        .direct-pillars {
            display: flex;
            justify-content: space-between;
            gap: 1.5mm;
            text-align: left;
            padding: 0.5mm 0;
        }

        .pillar-item {
            flex: 1;
            border: 0.3mm solid #000000;
            padding: 1.2mm 1.4mm;
            background: #ffffff;
        }

        .pillar-title {
            font-size: 5.2pt;
            font-weight: 900;
            color: #000000;
            text-transform: uppercase;
            letter-spacing: 0.2pt;
            display: flex;
            align-items: center;
            gap: 1mm;
        }

        .pillar-desc {
            font-size: 4.6pt;
            color: #333333;
            line-height: 1.2;
            margin-top: 0.6mm;
        }

        /* 5. FOOTER CALLOUT */
        .footer-banner {
            background: #000000;
            color: #ffffff;
            border-radius: 1mm;
            padding: 1.2mm 2mm;
            margin-top: 0.6mm;
        }

        .footer-banner-title {
            font-size: 6.4pt;
            font-weight: 900;
            letter-spacing: 0.3pt;
            text-transform: uppercase;
            line-height: 1.2;
        }

        .footer-banner-sub {
            font-size: 4.8pt;
            color: #e2e8f0;
            letter-spacing: 0.2pt;
            margin-top: 0.3mm;
        }

        .footer-baseline {
            font-size: 5.2pt;
            font-family: Georgia, serif;
            font-style: italic;
            color: #333333;
            margin-top: 0.5mm;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 2mm;
        }

        .footer-baseline strong {
            font-family: Arial, sans-serif;
            font-style: normal;
            font-weight: 800;
            color: #000000;
        }

        /* ==========================================================
           PRINT ENGINE RULES (@media print)
           Zero Banding, Pure Vector Typography, Exact A6 Output
           ========================================================== */
        @media print {
            html,
            body {
                background: #ffffff !important;
                margin: 0 !important;
                padding: 0 !important;
            }

            .app-layout {
                display: block !important;
            }

            .sidebar,
            .preview-header-bar {
                display: none !important;
            }

            .preview-stage {
                padding: 0 !important;
                background: none !important;
                display: block !important;
                margin: 0 !important;
            }

            /* --- 1. SINGLE POSTER PRINT MODE (Default) --- */
            body:not(.mode-4up-print) {
                width: 105mm !important;
                height: 148mm !important;
            }

            body:not(.mode-4up-print) .poster-viewport {
                box-shadow: none !important;
                width: 105mm !important;
                height: 148mm !important;
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                margin: 0 !important;
                display: block !important;
            }

            body:not(.mode-4up-print) .sheet-4up-container {
                display: none !important;
            }

            /* --- 2. 4-UP PRINT MODE: FILLS 100% OF STANDARD A4 / LETTER SHEET --- */
            body.mode-4up-print {
                width: 100% !important;
                height: 100% !important;
                max-width: 100vw !important;
                max-height: 100vh !important;
                overflow: hidden !important;
            }

            body.mode-4up-print .poster-viewport {
                display: none !important;
            }

            body.mode-4up-print .sheet-4up-container {
                display: grid !important;
                grid-template-columns: 50% 50% !important;
                grid-template-rows: 50% 50% !important;
                width: 100vw !important;
                height: 100vh !important;
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                right: 0 !important;
                bottom: 0 !important;
                margin: 0 !important;
                padding: 0 !important;
                box-sizing: border-box !important;
                box-shadow: none !important;
                page-break-after: avoid !important;
                break-after: avoid !important;
                page-break-inside: avoid !important;
                break-inside: avoid !important;
            }

            body.mode-4up-print .sheet-4up-card {
                width: 100% !important;
                height: 100% !important;
                position: relative !important;
                overflow: hidden !important;
                box-sizing: border-box !important;
                display: block !important;
            }

            body.mode-4up-print .sheet-4up-card .poster-sheet {
                width: 100% !important;
                height: 100% !important;
                padding: 4.5mm !important;
                box-sizing: border-box !important;
            }

            body.mode-4up-print .cut-guide-vert {
                position: absolute !important;
                left: 50% !important;
                top: 0 !important;
                bottom: 0 !important;
                border-left: 0.35mm dashed #444444 !important;
                z-index: 100 !important;
                display: block !important;
            }

            body.mode-4up-print .cut-guide-horiz {
                position: absolute !important;
                top: 50% !important;
                left: 0 !important;
                right: 0 !important;
                border-top: 0.35mm dashed #444444 !important;
                z-index: 100 !important;
                display: block !important;
            }

            body.mode-4up-print .cut-badge {
                display: none !important;
            }

            .poster-sheet {
                page-break-after: avoid !important;
                break-after: avoid !important;
            }
        }

        /* ==========================================================
           SCREEN PREVIEW STYLES FOR 4-UP SHEET
           (Shows the full A4/Letter sheet with 4 posters & cut lines in UI)
           ========================================================== */
        .sheet-4up-container {
            display: none;
        }

        body.mode-4up-print .poster-viewport {
            display: none !important;
        }

        body.mode-4up-print .sheet-4up-container {
            display: grid !important;
            grid-template-columns: 105mm 105mm;
            grid-template-rows: 148.5mm 148.5mm;
            width: 210mm;
            height: 297mm;
            background: #ffffff;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
            position: relative;
            margin: 0 auto;
            overflow: hidden;
            box-sizing: border-box;
            transform-origin: top center;
        }

        /* US Letter mode adjustment if selected */
        body.mode-4up-letter .sheet-4up-container {
            grid-template-columns: 107.95mm 107.95mm;
            grid-template-rows: 139.7mm 139.7mm;
            width: 215.9mm;
            height: 279.4mm;
        }

        .sheet-4up-card {
            width: 105mm;
            height: 148.5mm;
            position: relative;
            overflow: hidden;
            box-sizing: border-box;
            display: block;
        }

        body.mode-4up-letter .sheet-4up-card {
            width: 107.95mm;
            height: 139.7mm;
        }

        .sheet-4up-card .poster-sheet {
            width: 100%;
            height: 100%;
            padding: 4.5mm;
            box-sizing: border-box;
        }

        /* Screen Cut Guidelines */
        .cut-guide-vert {
            position: absolute;
            left: 50%;
            top: 0;
            bottom: 0;
            border-left: 0.35mm dashed #555555;
            z-index: 50;
            pointer-events: none;
        }

        .cut-guide-horiz {
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            border-top: 0.35mm dashed #555555;
            z-index: 50;
            pointer-events: none;
        }

        .cut-badge {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            background: #ffffff;
            border: 0.3mm solid #444444;
            padding: 0.6mm 1.6mm;
            font-size: 5pt;
            font-weight: 700;
            color: #333333;
            border-radius: 1mm;
            z-index: 60;
            font-family: monospace;
            letter-spacing: 0.3pt;
            pointer-events: none;
            white-space: nowrap;
        }

        /* Responsive zoom scaling on smaller laptop screens so full sheet is visible */
        @media screen and (max-height: 960px) {
            body.mode-4up-print .sheet-4up-container {
                transform: scale(0.85);
                margin-bottom: -160px;
            }
        }

        @media screen and (max-height: 800px) {
            body.mode-4up-print .sheet-4up-container {
                transform: scale(0.72);
                margin-bottom: -300px;
            }
        }