      :root {
        --bg: #0D0E12;
        --bg2: #111218;
        --bg3: #1A1B21;
        --border: rgba(255,255,255,0.12);
        --accent: #7C4DFF;
        --accent2: #B388FF;
        --text: #FFFFFF;
        --text2: rgba(255,255,255,0.6);
        --success: #4CAF50;
        --warning: #FFB300;
        --radius: 10px;
        --primary: #7C4DFF;
        --primary-light: #B388FF;
        --primary-dark: #5E35B1;
        --secondary: #00E5FF;
        --secondary-dark: #00B8D4;
        --tertiary: #FF4081;
        --surface: #1A1B21;
        --surface-light: #252731;
        --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        --shadow: 0 8px 32px rgba(0,0,0,0.3);
      }
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      body {
        font-family: "Inter", system-ui, sans-serif;
        background: var(--bg);
        color: var(--text);
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow-y: auto; overflow-x: hidden;
      }
      .toolbar {
        background: rgba(17, 18, 24, 0.8);
        backdrop-filter: blur(20px);
        padding: 8px 16px;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        border-bottom: 1px solid var(--border);
        z-index: 50;
        flex-shrink: 0;
      }
      .brand {
        font-weight: 800;
        font-size: 16px;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin-right: 8px;
        letter-spacing: -0.02em;
      }
      .tool-group {
        display: flex;
        align-items: center;
        gap: 4px;
        background: var(--bg3);
        padding: 3px 6px;
        border-radius: var(--radius);
        border: 1px solid var(--border);
      }
      button {
        background: transparent;
        border: none;
        color: var(--text2);
        padding: 6px 12px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 12px;
        font-family: inherit;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        transition: 0.15s;
        white-space: nowrap;
      }
      button i {
        font-size: 13px;
      }
      button:hover {
        background: rgba(124,77,255,0.1);
        color: var(--text);
      }
      button.active {
        background: var(--accent);
        color: #fff;
      }
      button:disabled {
        opacity: 0.35;
        pointer-events: none;
      }
      .sep {
        width: 1px;
        height: 24px;
        background: var(--border);
        margin: 0 4px;
      }
      .find-replace-input {
        background: var(--bg);
        border: 1px solid var(--border);
        color: var(--text);
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        width: 100px;
        outline: none;
      }
      .find-replace-input:focus {
        border-color: var(--accent);
      }
      .page-nav {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .page-info {
        background: var(--bg3);
        padding: 4px 12px;
        border-radius: 16px;
        font-size: 11px;
        font-weight: 600;
        border: 1px solid var(--border);
      }
      .workspace {
        flex: 1 0 auto;
        display: flex;
        flex-direction: column;
        overflow: visible;
        position: relative;
      }
      .upload-screen:not(.hidden) + .canvas-wrap {
        display: none !important;
      }
      .canvas-wrap {
        flex: 1;
        min-height: 0;
        overflow: auto;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 20px;
        background: transparent;
      }
      .page-container {
        position: relative;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
        background: #fff;
        display: inline-block;
        line-height: 0;
      }
      #renderCanvas {
        display: block;
      }
      .text-selector {
        position: absolute;
        outline: 2px solid var(--accent);
        outline-offset: -2px;
        background: rgba(124, 92, 191, 0.12);
        cursor: pointer;
        z-index: 20;
        pointer-events: auto;
        transition: 0.15s;
      }
      .text-selector:hover {
        outline-color: var(--accent2);
        background: rgba(124, 92, 191, 0.25);
        box-shadow: 0 0 12px rgba(124, 92, 191, 0.25);
        z-index: 21;
      }
      .text-selector.modified {
        outline-color: var(--success);
        background: rgba(63, 185, 80, 0.15);
      }
      .text-selector.selected {
        outline-color: #fff;
        background: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 16px rgba(124, 92, 191, 0.5);
        z-index: 22;
      }
      .inline-editor {
        position: fixed;
        border: 2px solid var(--accent);
        outline: none;
        z-index: 100;
        display: none;
        padding: 4px 6px;
        resize: none;
        overflow-y: auto;
        background: transparent;
        border-radius: 4px;
        box-shadow: none;
        font-family: Arial, sans-serif;
        color: #000;
        line-height: 1;
        min-width: 80px;
        min-height: 24px;
        white-space: pre;
        overflow: visible;
      }
      .inline-editor:focus {
        border-color: var(--accent2);
        box-shadow:
          0 0 0 4px rgba(124, 92, 191, 0.3),
          0 8px 32px rgba(124, 92, 191, 0.5);
      }
      .format-toolbar {
        position: fixed;
        z-index: 110;
        display: none;
        background: var(--bg3);
        padding: 4px;
        border-radius: 6px;
        border: 1px solid var(--border);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        gap: 4px;
        align-items: center;
      }
      .format-toolbar button,
      .format-toolbar select,
      .format-toolbar input[type="color"] {
        padding: 4px 8px;
        border-radius: 4px;
        background: transparent;
        color: var(--text);
        border: none;
        cursor: pointer;
        font-size: 12px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        outline: none;
      }
      .format-toolbar select {
        padding: 4px;
        background: var(--bg2);
        border: 1px solid var(--border);
      }
      .format-toolbar input[type="color"] {
        padding: 0;
        width: 24px;
        height: 24px;
        border-radius: 4px;
        border: 1px solid var(--border);
        cursor: pointer;
      }
      .format-toolbar button:hover {
        background: rgba(255, 255, 255, 0.1);
      }
      .format-toolbar button.active {
        background: var(--accent);
        color: #fff;
      }
      .format-toolbar .sep {
        height: 16px;
        width: 1px;
        background: var(--border);
        margin: 0 4px;
      }
      .format-toolbar .drag-handle {
        cursor: grab;
        padding: 4px 8px;
        color: var(--text2);
        display: flex;
        align-items: center;
      }
      .format-toolbar .drag-handle:active {
        cursor: grabbing;
      }
      .debug-panel {
        position: absolute;
        bottom: 12px;
        left: 12px;
        background: var(--bg2);
        padding: 10px 14px;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        font-size: 10px;
        color: var(--text2);
        z-index: 15;
        max-width: 520px;
        max-height: 220px;
        overflow-y: auto;
        font-family: "Courier New", monospace;
      }
      .debug-panel .title {
        color: var(--accent2);
        font-weight: 600;
        margin-bottom: 4px;
        font-family: "Inter", sans-serif;
        font-size: 11px;
      }
      .debug-panel pre {
        white-space: pre-wrap;
        word-break: break-all;
        margin: 0;
        line-height: 1.3;
      }
      .upload-screen {
        width: 100%;
        flex: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        background: transparent;
        z-index: 10;
      }
      .upload-screen-inner {
        width: 100%;
        max-width: 1400px;
        padding: 4rem 2rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: auto;
      }
      .upload-screen.hidden {
        display: none;
      }
      /* ===== Tool Card ===== */
      .tool-card {
        max-width: 600px;
        width: 100%;
        margin: 0 auto;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 24px;
        padding: 32px;
        box-shadow: var(--shadow);
      }

      /* ===== Drop Zone ===== */
      .drop-zone {
        position: relative;
        border: 2px dashed var(--border);
        border-radius: 16px;
        padding: 48px 24px;
        text-align: center;
        cursor: pointer;
        transition: var(--transition);
      }

      .drop-zone:hover, .drop-zone.drag-over {
        border-color: var(--primary);
        background: rgba(124,77,255,0.05);
      }

      .drop-zone.drag-over .drop-icon {
        transform: scale(1.2);
        color: var(--primary);
      }

      .drop-icon {
        font-size: 48px;
        color: var(--text2);
        margin-bottom: 12px;
        transition: var(--transition);
        display: block;
      }

      .drop-zone h3 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 4px;
      }

      .drop-zone p {
        color: var(--text2);
        font-size: 0.9rem;
      }

      .drop-hint {
        display: block;
        margin-top: 12px;
        font-size: 0.75rem;
        color: var(--text2);
      }
      .status-bar {
        background: rgba(17, 18, 24, 0.8);
        backdrop-filter: blur(10px);
        padding: 4px 16px;
        font-size: 11px;
        flex-shrink: 0;
        display: flex;
        justify-content: space-between;
        color: var(--text2);
        border-top: 1px solid var(--border);
      }
      .status-dot {
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--success);
        margin-right: 5px;
      }
      .loading-overlay {
        position: absolute;
        inset: 0;
        z-index: 50;
        background: rgba(13, 17, 23, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 16px;
      }
      .loading-overlay.hidden {
        display: none;
      }
      .spinner {
        width: 36px;
        height: 36px;
        border: 3px solid var(--border);
        border-top-color: var(--accent2);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
      }
      @keyframes spin {
        to {
          transform: rotate(360deg);
        }
      }
      .toast {
        position: fixed;
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg3);
        color: var(--text);
        padding: 10px 24px;
        border-radius: 10px;
        font-size: 12px;
        border: 1px solid var(--border);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
        z-index: 200;
        max-width: 650px;
        text-align: center;
      }
      .toast.show {
        opacity: 1;
      }
      #fileInput {
        display: none;
      }
      /* ====== SHAPE FLOATING TOOLBAR ====== */
      .shape-floating-toolbar {
        position: fixed;
        z-index: 1000;
        background: var(--bg2);
        border: 1px solid var(--border);
        border-radius: 10px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.04);
        display: flex;
        align-items: center;
        padding: 3px;
        gap: 2px;
        backdrop-filter: blur(12px);
        animation: floatToolbarIn 0.18s ease-out;
      }
      @keyframes floatToolbarIn {
        from { opacity: 0; transform: translateY(6px); }
        to { opacity: 1; transform: translateY(0); }
      }
      .shape-floating-toolbar button {
        background: transparent;
        border: none;
        color: var(--text2);
        padding: 7px 10px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
        border-radius: 7px;
        font-size: 13px;
        transition: all 0.15s ease;
      }
      .shape-floating-toolbar button:hover {
        background: rgba(124, 92, 191, 0.15);
        color: var(--accent2);
      }
      .shape-floating-toolbar button.danger:hover {
        background: rgba(255, 85, 85, 0.15);
        color: #ff5555;
      }
      .shape-floating-toolbar .ft-sep {
        width: 1px;
        height: 20px;
        background: var(--border);
        margin: 0 2px;
        flex-shrink: 0;
      }
      /* ====== RESIZE HANDLES ====== */
      .resize-handle {
        position: absolute;
        width: 8px;
        height: 8px;
        background: #fff;
        border: 2px solid var(--accent);
        border-radius: 2px;
        z-index: 30;
        box-shadow: 0 1px 4px rgba(0,0,0,0.25);
      }
      .resize-handle.rh-tl { top: -4px; left: -4px; cursor: nwse-resize; }
      .resize-handle.rh-tr { top: -4px; right: -4px; cursor: nesw-resize; }
      .resize-handle.rh-bl { bottom: -4px; left: -4px; cursor: nesw-resize; }
      .resize-handle.rh-br { bottom: -4px; right: -4px; cursor: nwse-resize; }
      /* ====== SHAPE WRAPPER HOVER ====== */
      [data-is-shape="true"] {
        transition: filter 0.12s ease;
      }
      [data-is-shape="true"]:hover {
        filter: drop-shadow(0 0 6px rgba(124, 92, 191, 0.35));
      }
      /* ====== SHAPE DROPDOWN REDESIGN ====== */
      .shape-dropdown-panel {
        display: none;
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg2);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.03);
        z-index: 1000;
        min-width: 240px;
        margin-top: 8px;
        padding: 14px;
        animation: dropdownSlideIn 0.15s ease-out;
      }
      @keyframes dropdownSlideIn {
        from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
        to { opacity: 1; transform: translateX(-50%) translateY(0); }
      }
      .shape-dropdown-panel .sdp-section {
        margin-bottom: 12px;
      }
      .shape-dropdown-panel .sdp-section:last-child {
        margin-bottom: 0;
      }
      .shape-dropdown-panel .sdp-label {
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--text2);
        margin-bottom: 8px;
        display: block;
      }
      .shape-dropdown-panel .shape-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
      }
      .shape-dropdown-panel .shape-grid button {
        padding: 8px;
        border-radius: 8px;
        border: 1px solid transparent;
        background: var(--bg3);
        color: var(--text2);
        font-size: 14px;
        cursor: pointer;
        transition: all 0.15s ease;
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .shape-dropdown-panel .shape-grid button:hover {
        background: rgba(124, 92, 191, 0.15);
        border-color: var(--accent);
        color: var(--accent2);
      }
      .shape-dropdown-panel .shape-grid button.active {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
        box-shadow: 0 2px 8px rgba(124, 92, 191, 0.35);
      }
      .shape-dropdown-panel .sdp-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 12px;
        color: var(--text);
        gap: 8px;
      }
      .shape-dropdown-panel .sdp-row + .sdp-row {
        margin-top: 8px;
      }
      .shape-dropdown-panel .color-swatch {
        width: 28px;
        height: 28px;
        padding: 0;
        border: 2px solid var(--border);
        border-radius: 6px;
        cursor: pointer;
        transition: border-color 0.15s, box-shadow 0.15s;
      }
      .shape-dropdown-panel .color-swatch:hover {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(124, 92, 191, 0.2);
      }
      .shape-dropdown-panel input[type="range"] {
        accent-color: var(--accent);
        width: 100%;
        flex: 1;
      }
      .shape-dropdown-panel .sdp-thickness-display {
        font-family: 'Inter', monospace;
        font-size: 11px;
        font-weight: 600;
        min-width: 28px;
        text-align: right;
        color: var(--accent2);
      }
      .shape-dropdown-panel .sdp-delete-btn {
        width: 100%;
        padding: 8px;
        border-radius: 8px;
        border: 1px solid rgba(255, 85, 85, 0.25);
        background: rgba(255, 85, 85, 0.08);
        color: #ff5555;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.15s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
      }
      .shape-dropdown-panel .sdp-delete-btn:hover {
        background: rgba(255, 85, 85, 0.2);
        border-color: #ff5555;
      }
      .shape-dropdown-panel .sdp-checkbox-label {
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        color: var(--text2);
      }
      .shape-dropdown-panel .sdp-checkbox-label input[type="checkbox"] {
        accent-color: var(--accent);
      }
      /* ===== Background Animation ===== */
      .bg-animation {
        position: fixed;
        inset: 0;
        z-index: -1;
        overflow: hidden;
      }
      .bg-gradient {
        position: absolute;
        inset: 0;
        background:
          radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124,77,255,0.15), transparent),
          radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0,229,255,0.08), transparent),
          radial-gradient(ellipse 50% 30% at 10% 60%, rgba(255,64,129,0.06), transparent);
      }
      .bg-particles {
        position: absolute;
        inset: 0;
      }
      .particle {
        position: absolute;
        width: 2px;
        height: 2px;
        background: rgba(124,77,255,0.4);
        border-radius: 50%;
        animation: float linear infinite;
      }
      @keyframes float {
        0% { transform: translateY(100vh) scale(0); opacity: 0; }
        10% { opacity: 1; }
        90% { opacity: 1; }
        100% { transform: translateY(-10vh) scale(1); opacity: 0; }
      }
    
      /* ===== Navbar ===== */
      .navbar {
        padding: 16px 0;
        background: rgba(13,14,18,0.8);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        transition: all 0.3s ease;
        flex-shrink: 0;
      }
      .nav-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      .nav-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1.25rem;
        font-weight: 700;
        text-decoration: none;
        color: var(--text);
      }
      .logo-icon {
        font-size: 28px;
        color: var(--primary);
      }
      .logo-accent { color: var(--primary); }
      .nav-links {
        display: flex;
        gap: 8px;
      }
      .nav-link {
        padding: 8px 16px;
        border-radius: 6px;
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text2);
        transition: all 0.3s ease;
        text-decoration: none;
      }
      .nav-link:hover, .nav-link.active {
        color: var(--text);
        background: rgba(124,77,255,0.1);
      }
      .nav-toggle {
        display: none;
        color: var(--text);
        padding: 8px;
        background: transparent;
        border: none;
      }
      .mobile-menu {
        display: none;
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        background: rgba(13,14,18,0.95);
        backdrop-filter: blur(20px);
        padding: 16px 24px;
        border-bottom: 1px solid var(--border);
        z-index: 99;
        flex-direction: column;
        gap: 4px;
      }
      .mobile-menu.open { display: flex; }
      .mobile-link {
        padding: 12px 16px;
        border-radius: 6px;
        font-weight: 500;
        color: var(--text2);
        transition: all 0.3s ease;
        text-decoration: none;
      }
      .mobile-link:hover {
        color: var(--text);
        background: rgba(124,77,255,0.1);
      }

    .site-footer {
      --primary: #7c4dff;
      --secondary: #00e5ff;
      --text-primary: #f0f2ff;
      --text-secondary: #cbd5e1;
      --text-muted: #94a3b8;
      --border: rgba(124, 77, 255, 0.12);
      --font-display: 'Space Grotesk', sans-serif;
      --font-body: 'Inter', sans-serif;

      margin-top: 80px;
      border-top: 1px solid var(--border);
      background: rgba(5, 5, 8, 0.95);
      backdrop-filter: blur(20px);
      color: var(--text-primary);
      font-family: var(--font-body), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    }
    .site-footer .footer-grid {
      max-width: 1400px;
      margin: 0 auto;
      padding: 80px 32px 40px;
      display: grid;
      grid-template-columns: 2fr 1fr 1fr 1fr;
      gap: 48px;
    }
    .site-footer .footer-brand h3 {
      font-family: var(--font-display);
      font-size: 1.3rem;
      font-weight: 700;
      margin-bottom: 12px;
    }
    .site-footer .footer-brand p {
      color: var(--text-secondary);
      font-size: 0.9rem;
      line-height: 1.7;
      max-width: 300px;
    }
    .site-footer .footer-socials {
      display: flex;
      gap: 12px;
      margin-top: 24px;
    }
    .site-footer .social-link {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      display: grid;
      place-items: center;
      color: var(--text-secondary);
      text-decoration: none;
      transition: all 0.3s ease;
    }
    .site-footer .social-link:hover {
      border-color: var(--primary);
      color: var(--primary);
      transform: translateY(-3px);
      box-shadow: 0 10px 20px rgba(124, 77, 255, 0.2);
    }
    .site-footer .footer-col h3 {
      font-family: var(--font-display);
      font-size: 0.95rem;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      margin-bottom: 24px;
      color: #ffffff;
    }
    .site-footer .footer-links {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .site-footer .footer-links a {
      color: var(--text-secondary);
      text-decoration: none;
      font-size: 0.9rem;
      transition: all 0.3s ease;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .site-footer .footer-links a:hover {
      color: var(--primary);
      transform: translateX(4px);
    }
    .site-footer .footer-bottom {
      max-width: 1400px;
      margin: 0 auto;
      padding: 24px 32px;
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 16px;
    }
    .site-footer .footer-bottom p {
      color: var(--text-muted);
      font-size: 0.85rem;
      margin: 0;
    }
    .site-footer .footer-bottom-links {
      display: flex;
      gap: 24px;
    }
    .site-footer .footer-bottom-links a {
      color: var(--text-muted);
      text-decoration: none;
      font-size: 0.85rem;
      transition: color 0.3s ease;
    }
    .site-footer .footer-bottom-links a:hover {
      color: var(--text-primary);
    }
    @media (max-width: 768px) {
      .site-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 60px 20px 30px;
      }
      .site-footer .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding: 20px;
      }
    }

/* ====== MOBILE RESPONSIVE ====== */

/* --- Mobile Bottom Toolbar --- */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 18, 24, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 200;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}
.mobile-bottom-bar .mobile-bar-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mobile-bottom-bar .mobile-bar-row::-webkit-scrollbar {
  display: none;
}
.mobile-bottom-bar .mob-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 6px;
  border-radius: 12px;
  cursor: pointer;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  flex: 1 0 auto;
}
.mobile-bottom-bar .mob-btn i {
  font-size: 20px;
  color: var(--text);
  transition: transform 0.2s ease;
}
.mobile-bottom-bar .mob-btn.active {
  color: var(--accent);
  background: rgba(124, 77, 255, 0.15);
}
.mobile-bottom-bar .mob-btn.active i {
  color: var(--accent);
}
.mobile-bottom-bar .mob-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.05);
}

/* --- Mobile More Menu (slide-up) --- */
.mobile-more-menu {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 18, 24, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.6);
  z-index: 210;
  padding: 24px 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.mobile-more-menu.open {
  display: flex;
  flex-direction: column;
  transform: translateY(0);
}
.mobile-more-menu .more-handle {
  width: 48px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin: 0 auto 24px;
}
.mobile-more-menu .more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.mobile-more-menu .more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  padding: 16px 8px;
  cursor: pointer;
  min-height: 76px;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-more-menu .more-item i {
  font-size: 22px;
  color: var(--text);
  transition: transform 0.2s ease;
}
.mobile-more-menu .more-item.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124, 77, 255, 0.15);
  box-shadow: 0 4px 16px rgba(124, 77, 255, 0.25);
}
.mobile-more-menu .more-item.active i {
  color: var(--accent);
}
.mobile-more-menu .more-item:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}
.mobile-more-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 205;
}
.mobile-more-overlay.open {
  display: block;
}

/* --- Mobile Find/Replace Modal --- */
.mobile-find-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  z-index: 220;
  padding: 12px 16px;
  gap: 8px;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.mobile-find-modal.open {
  display: flex;
}
.mobile-find-modal .find-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mobile-find-modal .find-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  min-height: 44px;
}
.mobile-find-modal .find-row input:focus {
  border-color: var(--accent);
}
.mobile-find-modal .find-row button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
}

/* --- Tablet Breakpoint (≤1024px) --- */
@media (max-width: 1024px) {
  .toolbar button {
    font-size: 0; /* Hide text nodes */
  }
  .toolbar button i {
    font-size: 16px; /* Restore icon size */
  }
  .toolbar .tool-group {
    gap: 2px;
    padding: 3px 4px;
  }
  .toolbar .find-replace-input {
    width: 80px;
  }
  .toolbar .brand {
    font-size: 14px;
    margin-right: 4px;
  }
  .canvas-wrap {
    padding: 12px;
  }
  .format-toolbar {
    max-width: calc(100vw - 20px);
    flex-wrap: wrap;
  }
}

/* --- Mobile Breakpoint (≤768px) --- */
@media (max-width: 768px) {
  /* Hide desktop toolbar, show mobile */
  .toolbar {
    display: none !important;
  }
  .mobile-bottom-bar {
    display: block;
  }
  .status-bar {
    display: none !important;
  }
  
  /* Canvas adjustments */
  .canvas-wrap {
    padding: 8px;
    padding-bottom: 70px; /* space for bottom bar */
  }
  
  /* Format toolbar becomes bottom sheet */
  .format-toolbar {
    position: fixed !important;
    bottom: 60px !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 12px 12px 0 0;
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px;
    gap: 4px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  }
  .format-toolbar .drag-handle {
    display: none;
  }
  .format-toolbar button,
  .format-toolbar select,
  .format-toolbar input[type="color"] {
    min-width: 40px;
    min-height: 40px;
  }
  
  /* Inline editor adjustments for mobile keyboard */
  .inline-editor {
    min-width: 120px;
  }
  
  /* Shape dropdown becomes bottom sheet */
  .shape-dropdown-panel {
    position: fixed !important;
    bottom: 60px !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    transform: none !important;
    border-radius: 16px 16px 0 0;
    min-width: auto !important;
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  }
  
  /* Signature dropdown becomes bottom sheet */
  #sigDropdown {
    position: fixed !important;
    bottom: 60px !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    border-radius: 16px 16px 0 0 !important;
    min-width: auto !important;
    padding: 12px !important;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5) !important;
  }
  #sigDropdown button {
    padding: 14px 15px !important;
    font-size: 16px !important;
    min-height: 48px;
  }
  
  /* Shape floating toolbar */
  .shape-floating-toolbar {
    bottom: 68px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
  }
  
  /* Larger resize handles for touch */
  .resize-handle {
    width: 16px;
    height: 16px;
  }
  .resize-handle::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
  }
  .resize-handle.rh-tl { top: -8px; left: -8px; }
  .resize-handle.rh-tr { top: -8px; right: -8px; }
  .resize-handle.rh-bl { bottom: -8px; left: -8px; }
  .resize-handle.rh-br { bottom: -8px; right: -8px; }
  
  /* Responsive modals */
  #drawModal > div {
    width: calc(100vw - 32px) !important;
    max-width: 400px;
  }
  #sigCanvas {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2/1;
  }
  #typeModal > div {
    width: calc(100vw - 32px) !important;
    max-width: 450px;
  }
  
  /* Toast */
  .toast {
    max-width: 90vw;
    bottom: 80px;
  }
  
  /* Debug panel */
  .debug-panel {
    display: none !important;
  }
  
  /* Upload screen */
  .upload-screen {
    padding: 16px;
  }
  .upload-screen > div:nth-child(2) {
    font-size: 16px !important;
  }
  .upload-screen > div:nth-child(3) {
    font-size: 12px !important;
    max-width: 90vw !important;
  }
  
  /* Download screen */
  #downloadScreen {
    flex-direction: column !important;
    overflow-y: auto;
  }
  #downloadScreen > div:first-child {
    padding: 16px !important;
    min-height: 40vh;
    flex: none !important;
    height: 40vh;
  }
  #downloadScreen > div:last-child {
    width: 100% !important;
    padding: 20px 16px !important;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3) !important;
    flex: 1;
  }
  
  /* Navbar */
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  
  /* Workspace min-height */
  .workspace {
    min-height: calc(100vh - 60px) !important;
  }
  
  /* Body touch optimization */
  body {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* --- Small Mobile (≤480px) --- */
@media (max-width: 480px) {
  .canvas-wrap {
    padding: 4px;
    padding-bottom: 70px;
  }
  .mobile-more-menu .more-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .format-toolbar {
    padding: 6px;
  }
  .format-toolbar button,
  .format-toolbar select,
  .format-toolbar input[type="color"] {
    min-width: 36px;
    min-height: 36px;
    padding: 4px;
    font-size: 11px;
  }
  #typeSigGrid {
    grid-template-columns: 1fr !important;
  }
}

/* Modal Styles */

/* FAQ Styles */
.faq-section { padding: 5rem 0; background: transparent; flex-shrink: 0; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-icon { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  width: 48px; 
  height: 48px; 
  border-radius: 12px; 
  background: rgba(124, 77, 255, 0.1); 
  color: #7C4DFF; 
  margin-bottom: 16px; 
}
.section-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 12px; text-align: center; color: var(--text); }
.section-subtitle { font-size: 1.2rem; color: var(--text2); max-width: 500px; margin: 0 auto; text-align: center; }

.faq-list { max-width: 950px; margin: 0 auto; padding: 0 24px; }
.faq-item { border-bottom: 1px solid rgba(255,255,255,0.06); }
.faq-question { width: 100%; background: none; border: none; color: #f1f5f9; padding: 1.5rem 0; text-align: left; font-size: 1.15rem; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: color 0.3s; }
.faq-question:hover { color: #b794ff; }
.faq-question i { transition: transform 0.3s; color: #7C4DFF; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease; color: var(--text2); font-size: 1.05rem; line-height: 1.8; padding: 0 1.5rem; }
.faq-item.active .faq-answer { max-height: 600px; padding-bottom: 1.5rem; }
.faq-item.active .faq-question i { transform: rotate(180deg); }

@media (max-width: 768px) {
  .faq-answer { padding: 0 0.5rem; }
  .faq-item.active .faq-answer { padding-bottom: 1.5rem; }
}
        .manual-card:hover {
          transform: translateY(-4px);
          background: rgba(255,255,255,0.06) !important;
          border-color: rgba(255,255,255,0.15) !important;
        }

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.rainbow-text {
  background: linear-gradient(90deg, #ff595e, #ffca3a, #8ac926, #1982c4, #6a4c93);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
