     :root {
         --bg-color: #f3f4f6;
         --toolbar-bg: rgba(255, 255, 255, 0.8);
         --primary: #6366f1;
         --primary-hover: #4f46e5;
         --text-main: #111827;
         --text-muted: #6b7280;
         --border: #e5e7eb;
         --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
         --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
         --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
     }

     * {
         box-sizing: border-box;
         margin: 0;
         padding: 0;
         font-family: 'Inter', -apple-system, sans-serif;
     }

     body {
         background-color: var(--bg-color);
         color: var(--text-main);
         height: 100vh;
         display: flex;
         flex-direction: column;
         overflow: hidden;
     }

     header {
         background: var(--toolbar-bg);
         backdrop-filter: blur(8px);
         height: 64px;
         display: flex;
         align-items: center;
         justify-content: space-between;
         padding: 0 24px;
         border-bottom: 1px solid var(--border);
         z-index: 100;
         position: relative;
     }

     .logo {
         font-weight: 800;
         font-size: 1.3rem;
         display: flex;
         align-items: center;
         gap: 12px;
         color: var(--text-main);
         min-width: 200px;
     }

     .logo img {
         height: 32px;
         width: 32px;
         object-fit: contain;
         border-radius: 6px;
     }

     .header-tools {
         position: absolute;
         left: 50%;
         transform: translateX(-50%);
         display: flex;
         align-items: center;
         gap: 6px;
         background: #f3f4f6;
         padding: 4px;
         border-radius: 14px;
         border: 1px solid var(--border);
     }

     .tool-btn {
         height: 36px;
         padding: 0 14px;
         border-radius: 10px;
         border: none;
         background: transparent;
         color: var(--text-muted);
         font-size: 0.95rem;
         font-weight: 600;
         display: flex;
         align-items: center;
         gap: 8px;
         cursor: pointer;
         transition: 0.2s;
     }

     .tool-btn:hover {
         background: #fff;
         color: var(--text-main);
     }

     .tool-btn.active {
         background: #fff;
         color: var(--primary);
         box-shadow: var(--shadow-sm);
     }

     .tool-divider {
         width: 1px;
         height: 20px;
         background: #d1d5db;
         margin: 0 4px;
     }

     .header-actions {
         display: flex;
         gap: 12px;
         align-items: center;
         min-width: 200px;
         justify-content: flex-end;
     }

     .btn {
         height: 38px;
         padding: 0 16px;
         border-radius: 10px;
         font-weight: 600;
         font-size: 0.9rem;
         display: flex;
         align-items: center;
         gap: 8px;
         cursor: pointer;
         transition: 0.2s;
         border: 1px solid var(--border);
         background: white;
     }

     .btn-primary {
         background: var(--primary);
         color: white;
         border: none;
         box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
     }

     .btn-primary:hover {
         background: var(--primary-hover);
     }

     .main-container {
         display: flex;
         flex: 1;
         overflow: hidden;
     }

     .page-sidebar {
         width: 260px;
         background: white;
         border-right: 1px solid var(--border);
         display: flex;
         flex-direction: column;
         padding: 24px 16px;
         gap: 20px;
         overflow-y: auto;
     }

     .sidebar-title {
         font-size: 0.7rem;
         font-weight: 800;
         color: #9ca3af;
         text-transform: uppercase;
         letter-spacing: 0.1em;
     }

     .page-thumb-container {
         display: flex;
         flex-direction: column;
         gap: 24px;
         align-items: center;
         width: 100%;
     }

     .page-thumb-wrapper {
         cursor: pointer;
         text-align: center;
         width: 100%;
         position: relative;
         padding: 10px;
         border-radius: 12px;
         transition: 0.2s;
     }

     .page-thumb-wrapper:hover {
         background: #f9fafb;
     }

     .page-thumb-wrapper.active {
         background: #f0f4ff;
     }

     .page-thumb {
         width: 100%;
         border: 1px solid var(--border);
         border-radius: 6px;
         background: #fff;
         transition: 0.2s;
         box-shadow: var(--shadow-sm);
     }

     .page-thumb-wrapper.active .page-thumb {
         border: 2px solid var(--primary);
         box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
     }

     .page-number {
         font-size: 0.75rem;
         font-weight: 700;
         margin-top: 10px;
         color: var(--text-muted);
     }

     .page-delete-btn {
         position: absolute;
         top: 0;
         right: 0;
         width: 24px;
         height: 24px;
         background: #ef4444;
         color: white;
         border-radius: 50%;
         display: none;
         align-items: center;
         justify-content: center;
         font-size: 0.8rem;
         border: 2px solid white;
     }

     .page-thumb-wrapper:hover .page-delete-btn {
         display: flex;
     }

     .append-pdf-btn {
         margin-top: auto;
         width: 100%;
         padding: 12px;
         border: 2px dashed var(--border);
         border-radius: 12px;
         color: var(--text-muted);
         font-weight: 600;
         cursor: pointer;
         display: flex;
         align-items: center;
         justify-content: center;
         gap: 8px;
         transition: 0.2s;
     }

     .append-pdf-btn:hover {
         background: #f9fafb;
         border-color: var(--primary);
         color: var(--primary);
     }

     .workspace {
         flex: 1;
         overflow: auto;
         display: flex;
         justify-content: center;
         padding: 60px;
         position: relative;
         background: #374151;
     }

     .canvas-wrapper {
         position: relative;
         background: white;
         box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
         border-radius: 4px;
     }

     .ctx-pill {
         position: absolute;
         display: none;
         background: white;
         padding: 8px;
         border-radius: 14px;
         box-shadow: var(--shadow-lg);
         border: 1px solid var(--border);
         z-index: 1000;
         align-items: center;
         gap: 12px;
     }

     .ctx-divider {
         width: 1px;
         height: 24px;
         background: var(--border);
     }

     .ctx-btn {
         width: 34px;
         height: 34px;
         border-radius: 10px;
         display: flex;
         align-items: center;
         justify-content: center;
         cursor: pointer;
         color: var(--text-main);
         transition: 0.1s;
     }

     .ctx-btn:hover {
         background: #f3f4f6;
     }

     .ctx-btn.danger {
         color: #ef4444;
     }

     .font-size-ctrl {
         display: flex;
         align-items: center;
         background: #f9fafb;
         border-radius: 10px;
         padding: 2px;
         border: 1px solid var(--border);
     }

     .font-size-ctrl button {
         border: none;
         background: transparent;
         width: 30px;
         height: 30px;
         cursor: pointer;
     }

     .font-size-ctrl span {
         font-size: 0.9rem;
         font-weight: 800;
         min-width: 36px;
         text-align: center;
     }

     .color-palette {
         display: flex;
         gap: 8px;
         padding: 0 4px;
     }

     .color-swatch {
         width: 22px;
         height: 22px;
         border-radius: 50%;
         cursor: pointer;
         border: 2px solid transparent;
     }

     .color-swatch.active {
         border-color: var(--primary);
         transform: scale(1.15);
         box-shadow: inset 0 0 0 2px white;
     }

     .thickness-ctrl {
         display: flex;
         gap: 8px;
         align-items: center;
         padding: 0 8px;
     }

     .thickness-dot {
         background: #9ca3af;
         border-radius: 50%;
         cursor: pointer;
         transition: 0.2s;
     }

     .thickness-dot:hover {
         background: var(--text-main);
     }

     .thickness-dot.active {
         background: var(--primary);
         transform: scale(1.2);
     }

     .zoom-controls {
         display: flex;
         align-items: center;
         gap: 4px;
         background: #f3f4f6;
         padding: 4px;
         border-radius: 12px;
         border: 1px solid var(--border);
     }

     .zoom-controls button {
         border: none;
         background: transparent;
         width: 32px;
         height: 32px;
         border-radius: 8px;
         cursor: pointer;
     }

     .zoom-controls span {
         font-size: 0.8rem;
         font-weight: 800;
         min-width: 45px;
         text-align: center;
     }

     .history-controls {
         display: flex;
         gap: 6px;
         margin-right: 8px;
     }

     .history-btn {
         width: 36px;
         height: 36px;
         border-radius: 10px;
         border: 1px solid var(--border);
         background: white;
         display: flex;
         align-items: center;
         justify-content: center;
         cursor: pointer;
     }

     .history-btn:disabled {
         opacity: 0.3;
         cursor: not-allowed;
     }

     /* Modal Redesign */
     .modal-overlay {
         position: fixed;
         top: 0;
         left: 0;
         right: 0;
         bottom: 0;
         background: rgba(0, 0, 0, 0.4);
         display: none;
         justify-content: center;
         align-items: center;
         z-index: 1000;
         backdrop-filter: blur(8px);
     }

     .modal {
         background: white;
         padding: 40px;
         border-radius: 32px;
         width: 600px;
         box-shadow: var(--shadow-lg);
         border: 1px solid var(--border);
     }

     .modal-header {
         display: flex;
         justify-content: space-between;
         align-items: center;
         margin-bottom: 24px;
     }

     .modal-title {
         font-size: 1.2rem;
         font-weight: 800;
         color: var(--text-main);
     }

     .sig-pad-container {
         border: 2px solid #f3f4f6;
         border-radius: 20px;
         background: #fcfcfc;
         margin-bottom: 24px;
         height: 260px;
         position: relative;
         overflow: hidden;
         box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
     }

     .sig-pad-container::after {
         content: "X ________________________________________________";
         position: absolute;
         bottom: 40px;
         left: 40px;
         right: 40px;
         color: #d1d5db;
         font-family: serif;
         font-size: 1.2rem;
         pointer-events: none;
         opacity: 0.5;
     }

     #sig-canvas {
         width: 100%;
         height: 100%;
         cursor: crosshair;
         touch-action: none;
         position: relative;
         z-index: 2;
     }

     .modal-footer {
         display: flex;
         justify-content: flex-end;
         gap: 12px;
     }

     .hidden-input {
         display: none;
     }

     .empty-state {
         position: absolute;
         top: 50%;
         left: 50%;
         transform: translate(-50%, -50%);
         text-align: center;
         color: #9ca3af;
         cursor: pointer;
         padding: 40px;
         border-radius: 24px;
         transition: 0.3s;
     }

     .empty-state:hover {
         background: rgba(255, 255, 255, 0.05);
         color: #fff;
     }

     .empty-state i {
         font-size: 100px;
         margin-bottom: 24px;
         opacity: 0.3;
     }

     .page-thumb-wrapper.dragging {
         opacity: 0.5;
         transform: scale(0.95);
     }

/* ---------- Landing Hero (refined) ---------- */
.landing-hero {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 3.5rem 2.5rem;
    max-width: 580px;
    width: 90%;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2rem;
    background: rgb(255, 255, 255);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99,102,241,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.04);
}

.landing-hero:hover {
    background: rgba(255,255,255,0.75);
    box-shadow: 0 16px 40px rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.2);
}

/* Logo + Title inline */
.hero-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.hero-logo {
    height: 42px;
    width: 42px;
    object-fit: contain;
    border-radius: 10px;
}

.hero-title h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    margin: 0;
}

/* Subtitle */
.hero-subtitle {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.8rem;
    font-size: 1rem;
    font-weight: 400;
}

.hero-subtitle strong {
    color: var(--primary);
    font-weight: 700;
}

/* Feature list – cleaner pill style */
.feature-list {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.feature-list span {
    background: rgba(99,102,241,0.06);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    border: 1px solid rgba(99,102,241,0.08);
}

.feature-list i {
    color: var(--success);
    font-size: 1rem;
}

/* Big icon */
.hero-icon {
    font-size: 4.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
    opacity: 0.75;
}

/* Small hint */
.hero-small {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.65;
    margin: 0;
}