        :root {
            --primary: #000000;
            --bg-app: #f5f5f7;
            --sidebar-w: 320px;
            --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }
        body { 
            font-family: 'Inter', sans-serif; 
            background: var(--bg-app); 
            color: #1d1d1f;
            overflow-x: hidden;
        }

        /* Sidebar Overlay */
        .sidebar-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 895;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }
        body.sidebar-open .sidebar-overlay {
            opacity: 1;
            visibility: visible;
        }

        .top-nav {
            position: fixed; top: 0; left: 0; right: 0; height: 72px;
            background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
            border-bottom: 1px solid #e5e5e7; display: flex; align-items: center; 
            justify-content: space-between; padding: 0 24px; z-index: 1000;
        }
        .nav-brand {
            display: flex; align-items: center; gap: 12px;
        }
        .brand-icon {
            background: var(--primary); color: #fff; padding: 8px; border-radius: 10px;
            transition: background-color 0.2s ease;
        }
        .brand-text {
            font-weight: 900; letter-spacing: -1px; font-size: 1.2rem;
        }

        .theme-strip {
            display: flex; gap: 8px; background: #f0f0f2; padding: 4px; border-radius: 12px;
        }
        .strip-item {
            padding: 8px 14px; border-radius: 8px; font-size: 0.75rem; font-weight: 700;
            cursor: pointer; transition: 0.2s; border: 1px solid transparent; color: #6e6e73;
        }
        .strip-item:hover { background: #fff; }
        .strip-item.active { background: #fff; color: #000; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-color: #e5e5e7; }

        .app-container { max-width: 1200px; margin: 0 auto; padding-top: 100px; padding-left: 16px; padding-right: 16px; }
        
        .hero-banner {
            text-align: center; margin-bottom: 40px; padding: 0 20px;
        }
        .hero-banner h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 4px; }
        .hero-banner .sub-headline { font-size: 1.1rem; color: #1d1d1f; font-weight: 600; margin-bottom: 8px; display: block; }
        .hero-banner .trust-line { color: #86868b; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; gap: 6px; }

        .main-canvas {
            display: flex; flex-direction: column; align-items: center;
            padding-bottom: 100px;
        }

        .ui-nudge {
            position: fixed;
            bottom: 100px;
            right: 100px;
            background: #ff6b35;
            color: white;
            padding: 12px 20px;
            border-radius: 40px;
            font-size: 0.85rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 10px 25px rgba(255,107,53,0.3);
            z-index: 1000;
            animation: fadeInUp 0.5s ease-out, fadeOut 0.5s ease-out 5s forwards;
            pointer-events: none;
        }
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes fadeOut {
            to { opacity: 0; visibility: hidden; }
        }

        .invoice-paper {
            background: white; 
            width: 100%; 
            max-width: 820px;
            padding: 50px 60px;
            box-shadow: 0 30px 60px rgba(0,0,0,0.08);
            display: flex; 
            flex-direction: column; 
            position: relative;
        }

        .invoice-header {
            display: flex; 
            justify-content: space-between; 
            align-items: flex-start; 
            margin-bottom: 40px;
        }
        .header-right {
            text-align: right;
        }
        .doc-type {
            color: var(--primary);
            transition: color 0.2s ease;
        }
        .invoice-number {
            font-family: 'JetBrains Mono'; font-weight: 700; margin-top: 8px; color: #86868b;
            font-size: 0.85rem;
        }
        .invoice-date {
            font-family: 'JetBrains Mono'; font-size: 0.75rem; margin-top: 6px; color: #86868b;
        }

        .branding-zone { 
            width: 100px; 
            height: 60px; 
            border: 2px dashed #d2d2d7; 
            border-radius: 8px; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            cursor: pointer;
            overflow: hidden;
            flex-shrink: 0;
        }
        .branding-zone.has-logo { 
            border: none; 
        }
        .branding-zone img { 
            max-width: 100%; 
            max-height: 100%; 
            width: auto;
            height: auto;
            object-fit: contain; 
        }
        .logo-placeholder { 
            display: flex; 
            align-items: center; 
            justify-content: center; 
        }
        .logo-placeholder svg { 
            width: 20px; 
            color: #d2d2d7; 
        }
        .logo-preview { 
            display: none; 
        }
        .has-logo .logo-preview {
            display: block;
        }
        .has-logo .logo-placeholder {
            display: none;
        }

        .addresses-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 40px;
        }
        .address-right {
            text-align: right;
        }
        .address-label {
            font-size: 0.6rem; font-weight: 800; text-transform: uppercase; color: var(--primary);
            display: block; margin-bottom: 6px;
            transition: color 0.2s ease;
        }
        .address-content {
            line-height: 1.5; font-size: 0.85rem;
        }

        .footer-row {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 30px;
            margin-top: 30px;
            padding-top: 30px;
            border-top: 1px solid #f0f0f2;
        }
        .terms-wrapper {
            flex: 1;
        }
        .terms-label {
            font-size: 0.6rem; font-weight: 800; text-transform: uppercase; color: var(--primary);
            display: block; margin-bottom: 6px;
            transition: color 0.2s ease;
        }
        .terms-content {
            font-size: 0.8rem; color: #6e6e73; line-height: 1.5;
        }
        .total-section {
            width: 260px;
        }
        .total-row {
            display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.85rem;
        }
        .subtotal-value {
            font-weight: 700;
        }
        .grand-total {
            font-size: 1.4rem;
            font-weight: 900;
            border-top: 3px solid var(--primary);
            margin-top: 6px;
            padding-top: 8px;
            color: var(--primary);
            transition: all 0.2s ease;
        }
        .watermark {
            text-align: center;
            font-size: 0.6rem;
            color: #d2d2d7;
            text-transform: uppercase;
            letter-spacing: 3px;
            font-weight: 700;
            cursor: pointer;
            margin-top: 30px;
            padding-top: 15px;
            transition: color 0.2s ease;
        }
        .watermark:hover { color: var(--primary); }

        .id-modern .doc-type { font-size: 2.5rem; font-weight: 800; letter-spacing: -2px; }
        .id-luxe { font-family: 'Playfair Display', serif; }
        .id-luxe .doc-type { font-size: 2rem; text-transform: uppercase; letter-spacing: 8px; border-bottom: 1px solid var(--primary); width: 100%; text-align: center; margin-bottom: 20px; }
        .id-brutal { font-family: 'JetBrains Mono', monospace; }
        .id-brutal .invoice-paper { border: 4px solid var(--primary); box-shadow: 8px 8px 0 var(--primary); }
        .id-brutal .doc-type { background: var(--primary); color: #fff; padding: 3px 10px; display: inline-block; font-size: 1.5rem; }
        .id-impact { font-family: 'Bebas Neue', sans-serif; }
        .id-impact .doc-type { font-size: 4rem; line-height: 0.8; }
        .id-swiss { font-family: 'Space Grotesk', sans-serif; }
        .id-swiss .doc-type { font-size: 3rem; font-weight: 300; border-left: 8px solid var(--primary); padding-left: 15px; }
        .id-midnight { background: #111; color: #eee; }
        .id-midnight td { border-bottom-color: #333; }
        .id-midnight .address-label, .id-midnight .terms-label, .id-midnight .doc-type, .id-midnight .grand-total { color: var(--primary); }
        .id-sepia { background: #fdfaf3; font-family: 'Cormorant Garamond', serif; color: #433422; }

        /* Table wrapper for horizontal scroll on mobile */
        .table-wrapper {
            overflow-x: auto;
            margin: 25px 0;
            width: 100%;
        }
        .items-table { 
            width: 100%; 
            min-width: 500px;
            border-collapse: collapse; 
        }
        .items-table th { 
            text-align: left; 
            padding: 8px 6px; 
            font-size: 0.65rem; 
            text-transform: uppercase; 
            color: #86868b; 
            border-bottom: 2px solid #f0f0f2; 
        }
        .items-table th.text-right { 
            text-align: right; 
            border-bottom-color: var(--primary);
        }
        .items-table th:first-child { 
            border-bottom-color: var(--primary); 
            transition: border-color 0.2s ease; 
        }
        .item-row td { 
            padding: 10px 6px; 
            border-bottom: 1px solid #f0f0f2; 
            position: relative; 
        }
        .item-row .text-right { 
            text-align: right; 
        }
        .item-row .line-total { 
            text-align: right; 
            font-weight: 700; 
        }
        
        .item-description-main { 
            font-weight: 700; 
            font-size: 0.85rem; 
        }
        .item-description-sub { 
            font-size: 0.7rem; 
            color: #86868b; 
            margin-top: 2px; 
        }
        
        .row-tools { 
            position: absolute; 
            left: -45px; 
            top: 10px; 
            display: flex; 
            gap: 4px; 
            opacity: 0; 
            transition: 0.2s; 
        }
        .item-row:hover .row-tools { opacity: 1; }
        .tool-btn { 
            background: #fff; 
            border: 1px solid #e5e5e7; 
            padding: 4px; 
            border-radius: 6px; 
            cursor: pointer; 
            display: flex; 
        }

        .btn-main { 
            background: var(--primary); color: #fff; border: none; padding: 10px 18px; border-radius: 10px;
            font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
            font-size: 0.8rem;
            transition: background-color 0.2s ease;
        }
        .btn-secondary { background: #3a3a3e; }
        .btn-add-invoice {
            background: transparent; color: #86868b; border: 1px dashed #d2d2d7; font-size: 0.7rem; padding: 6px;
            width: 100%; justify-content: center;
            transition: all 0.2s ease;
        }
        .btn-add-invoice:hover {
            border-color: var(--primary);
            color: var(--primary);
        }
        .sidebar {
            position: fixed; right: 0; top: 72px; width: var(--sidebar-w); height: calc(100vh - 72px);
            background: #fff; border-left: 1px solid #e5e5e7; padding: 28px; z-index: 900;
            transform: translateX(100%); transition: var(--transition); overflow-y: auto;
        }
        body.sidebar-open .sidebar { transform: translateX(0); }
        .panel-trigger {
            position: fixed; right: 24px; bottom: 24px; width: 52px; height: 52px;
            background: var(--primary); color: #fff; border-radius: 50%; border: none; cursor: pointer;
            display: flex; align-items: center; justify-content: center; z-index: 1100;
            box-shadow: 0 8px 20px rgba(0,0,0,0.15);
            transition: background-color 0.2s ease;
        }
        body.sidebar-open .panel-trigger { background: #ff3b30; transform: rotate(90deg); }

        .sidebar-title {
            margin-bottom: 24px; font-size: 0.85rem; text-transform: uppercase; color: #86868b; font-weight: 700;
        }
        .sidebar-label {
            font-size: 0.7rem; font-weight: 700; display: block; margin-bottom: 8px; color: #1d1d1f;
        }
        .currency-select, .color-input {
            width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #e5e5e7; font-family: monospace;
        }
        .color-picker-wrapper {
            display: flex; gap: 10px; align-items: center;
        }
        .color-preview {
            width: 44px; height: 44px; border-radius: 8px; border: 2px solid #e5e5e7; cursor: pointer;
        }
        .sidebar-option { margin-bottom: 24px; }
        .btn-outline-dark { background: #fff; color: var(--primary); border: 1px solid #e5e5e7; width: 100%; justify-content: center; transition: all 0.2s ease; }
        .btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; width: 100%; justify-content: center; }

        [contenteditable]:focus { background: rgba(0,0,0,0.02); outline: none; border-radius: 4px; }

        .seo-section { max-width: 820px; width: 100%; margin: 60px auto 40px; padding: 40px 32px; background: #fff; border-radius: 24px; box-shadow: 0 8px 30px rgba(0,0,0,0.04); color: #1d1d1f; line-height: 1.6; }
        .seo-section h2 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; }
        .seo-section h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; margin-top: 24px; }
        .seo-section p { margin-bottom: 16px; color: #3a3a3e; }
        .seo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 32px 0; }
        .seo-card { background: #fafafc; padding: 24px; border-radius: 20px; }
        .seo-card h3 { margin-top: 0; }
        .seo-card ul, .seo-card ol { padding-left: 20px; margin: 12px 0; }
        .seo-card li { margin: 8px 0; }
        .faq-item { margin-bottom: 24px; }
        .faq-item strong { color: #000; }
        .tools-footer { margin-top: 48px; padding-top: 32px; border-top: 1px solid #e9e9ef; text-align: center; }
        .tools-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 24px 0 20px; }
        .tool-link { background: #f0f0f2; padding: 10px 20px; border-radius: 40px; text-decoration: none; color: #1d1d1f; font-weight: 600; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; }
        .tool-link:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
        .keyword-pill { background: #f0f0f2; padding: 6px 14px; border-radius: 30px; font-size: 0.75rem; display: inline-block; margin: 0 6px 8px 0; font-weight: 500; color: #1d1d1f; }
        .keywords-container { margin: 32px 0 24px; text-align: center; }

        /* PDF capture mode - FORCE DESKTOP LAYOUT */
        .pdf-capture-active {
            background: white !important;
            padding: 0 !important;
            margin: 0 !important;
        }
        .pdf-capture-active .top-nav,
        .pdf-capture-active .sidebar,
        .pdf-capture-active .sidebar-overlay,
        .pdf-capture-active .panel-trigger,
        .pdf-capture-active .hero-banner,
        .pdf-capture-active .ui-nudge,
        .pdf-capture-active .btn-add-invoice,
        .pdf-capture-active .row-tools {
            display: none !important;
        }
        /* Keep SEO section visible in PDF */
        .pdf-capture-active .seo-section {
            display: block !important;
            max-width: 820px !important;
            width: 100% !important;
            margin: 40px auto !important;
            padding: 30px !important;
            background: #fff !important;
            box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important;
        }
        /* Make empty logo container INVISIBLE but still taking up space */
        .pdf-capture-active .branding-zone:not(.has-logo) {
            visibility: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
            display: flex !important;
            width: 100px !important;
            height: 60px !important;
        }
        .pdf-capture-active .invoice-paper {
            box-shadow: none !important;
            margin: 0 auto !important;
            padding: 0.4in !important;
            width: 100% !important;
            max-width: 100% !important;
            background: white !important;
            height: auto !important;
            min-height: auto !important;
        }
        /* Force desktop header layout */
        .pdf-capture-active .invoice-header {
            display: flex !important;
            flex-direction: row !important;
            justify-content: space-between !important;
            align-items: flex-start !important;
            margin-bottom: 40px !important;
        }
        .pdf-capture-active .branding-zone.has-logo {
            display: flex !important;
            visibility: visible !important;
            opacity: 1 !important;
        }
        .pdf-capture-active .header-right {
            text-align: right !important;
        }
        /* Force addresses to be side by side */
        .pdf-capture-active .addresses-grid {
            display: grid !important;
            grid-template-columns: 1fr 1fr !important;
            gap: 30px !important;
            margin-bottom: 40px !important;
        }
        .pdf-capture-active .address-right {
            text-align: right !important;
        }
        /* Force footer row side by side */
        .pdf-capture-active .footer-row {
            display: flex !important;
            flex-direction: row !important;
            justify-content: space-between !important;
            align-items: flex-start !important;
            gap: 30px !important;
        }
        .pdf-capture-active .total-section {
            width: 260px !important;
        }
        .pdf-capture-active .table-wrapper {
            overflow-x: visible !important;
        }
        .pdf-capture-active .items-table {
            min-width: auto !important;
            width: 100% !important;
        }
        .pdf-capture-active .id-midnight {
            background: #111 !important;
        }
        .pdf-capture-active .id-sepia {
            background: #fdfaf3 !important;
        }

        /* MOBILE RESPONSIVE STYLES - Only for screen viewing, NOT for PDF */
        @media (max-width: 768px) {
            .top-nav {
                flex-wrap: wrap;
                height: auto;
                padding: 12px 16px;
                gap: 12px;
            }
            .nav-brand {
                flex: 1;
            }
            .theme-strip {
                order: 1;
                flex-wrap: wrap;
                justify-content: center;
                width: 100%;
            }
            .strip-item {
                padding: 6px 10px;
                font-size: 0.65rem;
            }
            .top-nav .btn-main {
                padding: 6px 12px;
                font-size: 0.7rem;
            }
            .app-container {
                padding-top: 130px;
            }
            .hero-banner h1 {
                font-size: 1.6rem;
            }
            .hero-banner .sub-headline {
                font-size: 0.85rem;
            }
            .hero-banner .trust-line {
                font-size: 0.75rem;
            }
            .invoice-paper {
                padding: 20px 16px;
            }
            .invoice-header {
                flex-direction: column;
                gap: 16px;
                margin-bottom: 25px;
            }
            .header-right {
                text-align: left;
            }
            .doc-type {
                font-size: 1.8rem !important;
            }
            .addresses-grid {
                grid-template-columns: 1fr;
                gap: 20px;
                margin-bottom: 25px;
            }
            .address-right {
                text-align: left;
            }
            .footer-row {
                flex-direction: column;
                gap: 20px;
                margin-top: 20px;
                padding-top: 20px;
            }
            .total-section {
                width: 100%;
            }
            .grand-total {
                font-size: 1.2rem;
            }
            .row-tools {
                left: -35px;
                top: 8px;
            }
            .panel-trigger {
                right: 16px;
                bottom: 20px;
                width: 48px;
                height: 48px;
            }
            .ui-nudge {
                bottom: 90px;
                right: 20px;
                padding: 8px 14px;
                font-size: 0.7rem;
            }
            .sidebar {
                width: 280px;
                padding: 20px;
                top: auto;
                height: 100%;
            }
            .seo-section {
                padding: 20px 16px;
                margin: 40px auto 30px;
            }
            .seo-section h2 {
                font-size: 1.3rem;
            }
            .seo-section h3 {
                font-size: 1.1rem;
                margin-top: 16px;
            }
            .seo-grid {
                grid-template-columns: 1fr;
                gap: 16px;
                margin: 20px 0;
            }
            .seo-card {
                padding: 16px;
            }
            .tools-grid {
                gap: 10px;
            }
            .tool-link {
                padding: 6px 12px;
                font-size: 0.7rem;
            }
            .keywords-container {
                margin: 20px 0 16px;
            }
            .keyword-pill {
                padding: 4px 10px;
                font-size: 0.65rem;
            }
            .tools-footer h3 {
                font-size: 1rem !important;
            }
        }

        @media (min-width: 769px) and (max-width: 1024px) {
            .invoice-paper {
                padding: 35px 40px;
            }
        }

        @media print {
            .top-nav, .sidebar, .sidebar-overlay, .panel-trigger, .hero-banner, .ui-nudge, .btn-add-invoice, .row-tools {
                display: none !important;
            }
            .seo-section {
                display: block !important;
            }
            .branding-zone:not(.has-logo) {
                visibility: hidden !important;
                display: flex !important;
                width: 100px !important;
                height: 60px !important;
            }
            .invoice-header {
                display: flex !important;
                flex-direction: row !important;
                justify-content: space-between !important;
            }
            .header-right {
                text-align: right !important;
            }
            .addresses-grid {
                grid-template-columns: 1fr 1fr !important;
            }
            .address-right {
                text-align: right !important;
            }
            .footer-row {
                flex-direction: row !important;
            }
            .total-section {
                width: 260px !important;
            }
            .invoice-paper { box-shadow: none; padding: 0.4in; margin: 0; }
        }