        :root {
            /* Darker blue for better contrast against white (WCAG AA) */
            --primary: #2563eb;
            --primary-hover: #1d4ed8;
            --bg: #f3f4f6;
            --surface: #ffffff;
            --text-main: #111827;
            /* Darker grey for better readability */
            --text-muted: #4b5563;
            --border: #e5e7eb;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
        }

        * {
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
            background-color: var(--bg);
            color: var(--text-main);
            margin: 0;
            padding-bottom: 40px;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
        }

        /* Drag & Drop Overlay */
        body.dragging::after {
            content: "Drop PDF here";
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(37, 99, 235, 0.9);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            font-weight: 700;
            color: white;
            backdrop-filter: blur(4px);
            pointer-events: none;
        }

        /* Top Bar */
        header {
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            padding: 8px 16px;
            width: 100%;
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 50;
            box-shadow: var(--shadow-sm);
            gap: 16px;
        }

        .header-left,
        .header-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .header-right {
            justify-content: flex-end;
        }

        .header-center {
            display: flex;
            justify-content: center;
        }

        .brand {
            font-weight: 600;
            font-size: 1.125rem;
            display: flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap;
        }

        .page-controls {
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--surface);
            border-radius: 6px;
            padding: 2px;
        }

        /* Modern Button */
        button,
        .file-label {
            background-color: var(--surface);
            border: 1px solid var(--border);
            color: var(--text-main);
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
        }

        /* --- Juicy Interactions --- */

        /* Global Transition */
        a,
        button,
        .file-label,
        input {
            transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .status-card {
            transition: box-shadow 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        /* Modern Button: Lift & Glow */
        button:hover,
        .file-label:hover {
            transform: translateY(-1px);
            border-color: var(--text-muted);
            background-color: #f9fafb;
        }

        button:active,
        .file-label:active {
            transform: translateY(0);
        }

        /* Primary Button: Juicy Pop */
        .file-label.primary,
        button.primary {
            background-color: var(--primary);
            color: white;
            border-color: transparent;
            box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.1);
            /* Colored shadow base */
        }

        .file-label.primary:hover,
        button.primary:hover {
            background-color: var(--primary-hover);
            box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4), 0 4px 6px -2px rgba(37, 99, 235, 0.2);
            /* Juicy lift shadow */
            transform: translateY(-2px);
        }

        .file-label.primary:active,
        button.primary:active {
            transform: translateY(0);
            box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
        }

        /* Subtle Button Style (Page Controls) */
        button.subtle {
            background: transparent;
            border-color: transparent;
            padding: 4px 8px;
            color: var(--text-muted);
        }

        button.subtle:hover {
            background: #f3f4f6;
            color: var(--text-main);
        }

        input[type="file"] {
            display: none;
        }

        /* Inputs */
        .zoom-group {
            display: flex;
            align-items: center;
            border: 1px solid var(--border);
            border-radius: 6px;
            overflow: hidden;
            background: var(--surface);
        }

        .zoom-group input {
            border: none;
            padding: 6px 8px;
            width: 50px;
            text-align: center;
            font-size: 0.875rem;
            outline: none;
            background: transparent;
        }

        /* Mobile Responsive */
        @media (max-width: 700px) {
            header {
                display: flex;
                flex-direction: column;
                align-items: stretch;
                padding: 12px;
                gap: 12px;
            }

            .header-left,
            .header-center,
            .header-right {
                justify-content: center;
                width: 100%;
            }

            .header-left {
                justify-content: space-between;
            }
        }

        /* Status Card Hover */
        /* Status Card Hover */
        /* Status Card Hover */
        .status-card:hover {
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            border-color: var(--primary);
        }

        .separator {
            border: none;
            border-top: 1px solid var(--border);
            margin: 48px 0;
            opacity: 0.6;
        }

        .metric {
            font-weight: 600;
            color: var(--primary);
        }

        .meta {
            color: var(--text-muted);
            font-size: 0.85rem;
            border-left: 1px solid var(--border);
            padding-left: 16px;
        }

        /* Canvas Area */
        #canvasWrap {
            margin-top: 24px;
            position: relative;
            box-shadow: var(--shadow-md);
            border-radius: 4px;
            /* subtle rounding for PDF page */
            overflow: hidden;
            background: white;
            /* page background */
        }

        canvas {
            display: block;
        }

        #overlay {
            position: absolute;
            left: 0;
            top: 0;
            cursor: crosshair;
            /* Default cursor for measuring */
        }

        /* Magnifier */
        #magnifier {
            display: none;
            position: absolute;
            width: 150px;
            height: 150px;
            border-radius: 50%;
            border: 3px solid white;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            overflow: hidden;
            z-index: 200;
            pointer-events: none;
            background: white;
        }

        /* --- Trust & Marketing --- */

        /* Trust Strip */
        .trust-strip {
            background: #f9fafb;
            border-bottom: 1px solid var(--border);
            width: 100%;
            text-align: center;
            padding: 4px 0;
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 500;
        }

        .trust-strip span {
            color: var(--text-main);
        }

        /* Header Icons */
        .icon-link,
        .icon-btn {
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 4px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: color 0.2s, background 0.2s;
        }

        .icon-link:hover,
        .icon-btn:hover {
            color: var(--text-main);
            background: #f3f4f6;
        }

        .a4-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            background: #f3f4f6;
            padding: 2px 6px;
            border-radius: 4px;
            white-space: nowrap;
            cursor: help;
        }

        /* Intro Panel (Empty State) */
        #intro-panel {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 64px 24px;
            color: var(--text-main);
            min-height: 400px;
            /* Placeholder height */
        }

        #intro-panel h1 {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 12px;
            letter-spacing: -0.02em;
        }

        #intro-panel p {
            color: var(--text-muted);
            margin-bottom: 32px;
            font-size: 1.125rem;
            max-width: 400px;
            line-height: 1.5;
        }

        .file-label.big {
            padding: 16px 40px;
            /* Slightly larger padding for "juiciness" */
            font-size: 1.25rem;
            margin-bottom: 48px;
            border-radius: 8px;
            /* Softer corners */
            font-weight: 600;
        }

        /* Hover is now handled by the global primary button styles above */

        .sub-links {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-muted);
            font-size: 0.875rem;
        }

        .link-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 0;
            font-size: inherit;
            text-decoration: none;
        }

        .link-btn:hover {
            color: var(--primary);
            text-decoration: underline;
        }

        /* Modal */
        dialog {
            padding: 0;
            border: none;
            border-radius: 12px;
            box-shadow: var(--shadow-md);
            background: transparent;
            max-width: 480px;
            width: 90%;
        }

        dialog::backdrop {
            background: rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(2px);
        }

        .modal-content {
            background: var(--surface);
            padding: 24px;
            border-radius: 12px;
        }

        .modal-content h2 {
            margin-top: 0;
            font-size: 1.5rem;
            margin-bottom: 16px;
        }

        .modal-content ul {
            padding-left: 20px;
            margin-bottom: 24px;
        }

        .modal-content li {
            margin-bottom: 8px;
            line-height: 1.5;
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            margin-top: 24px;
        }

        /* Utility */
        .hidden {
            display: none !important;
        }


        /* --- Tool-First Info Section (Minimal) --- */
        .tool-info {
            max-width: 800px;
            margin: 0 auto;
            padding: 40px 20px 80px;
            color: var(--text-main);
        }

        .info-header {
            text-align: center;
            margin-bottom: 40px;
        }

        .info-header h1 {
            font-size: 1.75rem;
            margin-bottom: 16px;
            color: var(--text-main);
            letter-spacing: -0.02em;
        }

        .info-header .desc {
            font-size: 1.1rem;
            color: var(--text-muted);
            line-height: 1.6;
            margin-bottom: 32px;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }

        .value-bullets {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 16px 24px;
            margin-bottom: 32px;
            font-size: 0.95rem;
            color: var(--text-main);
            font-weight: 500;
        }

        .value-bullets span {
            white-space: nowrap;
        }

        .mini-nav {
            display: flex;
            justify-content: center;
            gap: 24px;
            font-size: 0.9rem;
        }

        .mini-nav a,
        .mini-nav button {
            color: var(--text-muted);
            text-decoration: none;
            background: none;
            border: none;
            padding: 0;
            cursor: pointer;
            font-family: inherit;
            font-size: inherit;
        }

        .mini-nav a:hover,
        .mini-nav button:hover {
            color: var(--primary);
            text-decoration: none;
            background-color: rgba(37, 99, 235, 0.05);
            padding: 2px 6px;
            border-radius: 4px;
            /* No negative margin needed as these are inline-block/flex items usually */
        }

        .separator {
            border: none;
            border-top: 1px solid var(--border);
            margin: 48px 0;
            opacity: 0.6;
        }

        /* Guides List */
        .guides-list {
            max-width: 600px;
            margin: 0 auto;
        }

        .guides-list h2 {
            font-size: 1.25rem;
            margin-bottom: 12px;
            color: var(--text-main);
        }

        .guides-list p {
            color: var(--text-muted);
            margin-bottom: 24px;
            font-size: 0.95rem;
        }

        .guides-list ul {
            list-style: none;
            padding: 0;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 12px;
        }

        .guides-list li a {
            display: block;
            padding: 8px 0;
            color: var(--primary);
            text-decoration: none;
            font-weight: 500;
        }

        .guides-list li a:hover {
            text-decoration: underline;
        }

        /* Mini FAQ */
        .mini-faq {
            max-width: 700px;
            margin: 0 auto;
        }

        .mini-faq h2 {
            font-size: 1.25rem;
            margin-bottom: 24px;
            color: var(--text-main);
            text-align: center;
        }

        .faq-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 32px;
        }

        .faq-grid strong {
            display: block;
            margin-bottom: 8px;
            color: var(--text-main);
            font-weight: 600;
        }

        .faq-grid p {
            margin: 0;
            color: var(--text-muted);
            line-height: 1.5;
            font-size: 0.95rem;
        }

        /* Minimal Footer */
        .minimal-footer {
            text-align: center;
            padding: 40px 0;
            color: var(--text-muted);
            font-size: 0.85rem;
            border-top: 1px solid var(--border);
            background: var(--bg);
        }

        .minimal-footer a {
            color: inherit;
            text-decoration: underline;
        }

        @media (max-width: 600px) {
            .value-bullets {
                flex-direction: column;
                gap: 8px;
                align-items: center;
            }

            .mini-nav {
                flex-wrap: wrap;
                gap: 16px;
            }

            .info-header h1 {
                font-size: 1.5rem;
            }

            .section-hero h1 {
                font-size: 2rem;
            }
        }

        /* --- Landing Pages (Guides) --- */
        .marketing-content {
            max-width: 800px;
            margin: 0 auto;
            padding: 40px 20px;
            color: var(--text-main);
        }

        .marketing-content section {
            margin-bottom: 60px;
        }

        .marketing-content h2 {
            font-size: 1.5rem;
            margin-bottom: 24px;
            color: var(--text-main);
        }

        .marketing-content p {
            line-height: 1.6;
            margin-bottom: 16px;
            color: var(--text-muted);
        }

        .marketing-content ul,
        .marketing-content ol {
            margin-bottom: 24px;
            padding-left: 24px;
            color: var(--text-muted);
            line-height: 1.6;
        }

        .marketing-content li {
            margin-bottom: 8px;
        }

        /* Landing Page Hero */
        .section-hero {
            text-align: center;
            padding: 60px 0 40px;
        }

        .section-hero h1 {
            font-size: 2.5rem;
            line-height: 1.2;
            margin-bottom: 16px;
            color: var(--text-main);
        }

        .section-hero .subhead {
            font-size: 1.25rem;
            color: var(--text-muted);
            max-width: 600px;
            margin: 0 auto 32px;
        }

        /* FAQ on Landing Pages */
        .section-faq {
            background: var(--surface);
            padding: 40px;
            border-radius: 12px;
            border: 1px solid var(--border);
        }

        .section-faq h2 {
            text-align: center;
            margin-bottom: 32px;
        }

        .faq-item {
            margin-bottom: 24px;
        }

        .faq-item h3 {
            font-size: 1.1rem;
            margin: 0 0 8px;
            color: var(--text-main);
        }

        /* Footer on Landing Pages */
        .footer-links {
            max-width: 1000px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 40px;
            padding: 40px 20px;
            border-top: 1px solid var(--border);
        }

        .footer-links h4 {
            margin-top: 0;
            margin-bottom: 16px;
            color: var(--text-main);
        }

        .footer-links a {
            display: block;
            color: var(--text-muted);
            text-decoration: none;
            margin-bottom: 8px;
            font-size: 0.9rem;
        }

        .footer-links a:hover {
            color: var(--primary);
            text-decoration: none;
            background-color: rgba(37, 99, 235, 0.05);
            border-radius: 4px;
            padding: 2px 4px;
            margin: -2px -4px;
        }

        .copy {
            text-align: center;
            color: var(--text-muted);
            font-size: 0.875rem;
            padding: 20px;
            border-top: 1px solid var(--border);
        }