/* =============================================
   PDF Editor Pro — Stylesheet
   Matches index.html class names exactly.
   Inspired by pdfguru.com editor layout.
   ============================================= */

/* ── Design Tokens ────────────────────────── */
:root {
    --white:          #ffffff;
    --bg-light:       #f0f2f5;
    --bg-header:      #ffffff;
    --bg-toolbar:     #f8f9fb;
    --bg-sidebar:     #ffffff;
    --border:         #e5e7eb;
    --text-primary:   #111827;
    --text-secondary: #6b7280;
    --text-muted:     #9ca3af;
    --accent:         #006686;
    --primary:        #006686;
    --accent-hover:   #004d66;
    --accent-blue:    #006686;
    --active-bg:      #e6f0f3;
    --active-fg:      #006686;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg:      0 8px 24px rgba(0,0,0,0.15);
    --header-h:       56px;
    --toolbar-h:      50px;
    --sidebar-w:      56px;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 14px;
    overflow-x: hidden;
}
button {
    font-family: inherit; font-size: inherit;
    cursor: pointer; border: none; background: none;
    color: inherit;
}
a { color: inherit; text-decoration: none; }


/* ==============================================
   SCREEN SWITCHING
   ============================================== */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; }


/* ==============================================
   HOME SCREEN
   ============================================== */
#home-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #fff5f7 0%, #ffffff 50%, #f0f4ff 100%);
    transition: background 0.3s ease;
}
#home-screen.drag-over {
    background: #e5eeff;
    outline: 4px dashed var(--primary);
    outline-offset: -20px;
}

/* ── Home Nav ─────────────────────────── */
.home-nav {
    height: var(--header-h);
    padding: 0 32px;
    display: flex; align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.brand {
    display: flex; align-items: center; gap: 10px;
    user-select: none; font-size: 17px; font-weight: 600;
    color: var(--text-primary);
}
.brand b { color: var(--accent); }

.nav-links { display: flex; gap: 24px; }
.nav-link {
    color: var(--text-secondary); font-weight: 500; font-size: 14px;
    transition: color 0.15s;
}
.nav-link:hover { color: var(--text-primary); }

/* ── Hero ──────────────────────────────── */
.home-main {
    flex: 1; display: flex;
    align-items: center; justify-content: center;
    padding: 20px;
}

.hero-container { text-align: center; max-width: 680px; width: 100%; }

.hero-badge {
    display: inline-block;
    background: rgba(210,41,75,0.08); color: var(--accent);
    font-size: 13px; font-weight: 600;
    padding: 6px 14px; border-radius: 20px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 48px; font-weight: 800; line-height: 1.15;
    color: var(--text-primary); margin-bottom: 16px;
    letter-spacing: -1.5px;
}
.accent-text { color: var(--accent); }

.hero-desc {
    color: var(--text-secondary); font-size: 17px; line-height: 1.65;
    max-width: 520px; margin: 0 auto 40px;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

/* ── Upload Zone ───────────────────────── */
.upload-zone {
    position: relative;
    background: var(--white);
    border: 2px dashed #d1d5db;
    border-radius: 20px;
    padding: 40px 30px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.upload-zone:hover {
    border-color: var(--accent);
    background: #fff5f7;
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(210,41,75,0.1);
}
.upload-zone.ocr-zone:hover {
    border-color: #2d3748;
    background: #f7fafc;
    box-shadow: 0 12px 20px -5px rgba(45,55,72,0.1);
}

/* File input covers entire zone */
.upload-zone input[type="file"] {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
    display: block;
}

.upload-icon-wrap {
    width: 88px; height: 88px;
    background: rgba(210,41,75,0.06);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}

.upload-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.upload-sub { color: var(--text-secondary); font-size: 15px; margin-bottom: 4px; }
.upload-hint { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.fake-link { color: var(--accent); font-weight: 600; text-decoration: underline; }


/* ==============================================
   EDITOR SCREEN
   ============================================== */
#editor-screen { height: 100vh; }


/* ── App Header ────────────────────────── */
.app-header {
    height: var(--header-h);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    z-index: 100;
}

.hdr-left {
    display: flex; align-items: center; gap: 12px;
    min-width: 0;
}
.hdr-right {
    display: flex; align-items: center; gap: 6px;
}

.back-btn { cursor: pointer; }
.back-btn:hover { opacity: 0.85; }

.hdr-sep {
    width: 1px; height: 28px;
    background: var(--border);
}

.filename-pill {
    display: flex; align-items: center; gap: 6px;
    background: #f3f4f6; border: 1px solid var(--border);
    padding: 5px 12px; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    max-width: 220px; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis;
}
.filename-pill svg { color: var(--accent); flex-shrink: 0; }

.hdr-icon-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 7px;
    color: var(--text-secondary);
    font-weight: 500; font-size: 13px;
    transition: all 0.18s;
}
.hdr-icon-btn:hover {
    background: #f3f4f6; color: var(--text-primary);
}
.hdr-icon-btn span { display: inline; }

.hdr-vertical-sep {
    width: 1px; height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.edit-badge {
    background: var(--active-bg); color: var(--accent);
    padding: 4px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 700;
    display: none; /* JS toggles this */
}

.btn-done {
    display: flex; align-items: center; gap: 6px;
    background: var(--accent); color: #fff;
    padding: 8px 18px; border-radius: 7px;
    font-weight: 600; font-size: 14px;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(210,41,75,0.3);
}
.btn-done:hover { background: var(--accent-hover); }


/* ── Tools Toolbar ─────────────────────── */
.tools-toolbar {
    height: var(--toolbar-h);
    background: var(--bg-toolbar);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 14px; gap: 3px;
    overflow-x: auto;
    flex-shrink: 0;
}
.tools-toolbar::-webkit-scrollbar { height: 0; }

.tool-btn {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 4px 8px; border-radius: 6px;
    color: #006686; font-weight: 500;
    white-space: nowrap; font-size: 13px;
    transition: all 0.18s;
    min-width: 0;
}
.tool-btn:hover {
    background: #006686; color: #ffffff;
}
.tool-btn.active {
    background: rgba(0,102,134,0.08);
    color: #006686;
}
.tool-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

.t-sep {
    width: 1px; height: 26px;
    background: var(--border);
    margin: 0 5px;
    flex-shrink: 0;
}


/* ── Workspace ─────────────────────────── */
.workspace {
    flex: 1; display: flex;
    overflow: hidden; position: relative;
}


/* ── Left Sidebar ──────────────────────── */
.left-sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    align-items: center;
    padding: 10px 0; gap: 4px;
    flex-shrink: 0;
    overflow-y: auto;
}

.sb-icon {
    width: 44px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 8px; cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    font-size: 10px; font-weight: 500;
}
.sb-icon svg { flex-shrink: 0; }
.sb-icon span { line-height: 1; }
.sb-icon:hover { background: #f3f4f6; color: var(--text-primary); }
.sb-icon.active { background: var(--active-bg); color: var(--active-fg); }


/* ── Canvas Area ───────────────────────── */
.canvas-area {
    flex: 1;
    overflow: auto;
    background: #e2e6ea;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 24px 96px;
}

.canvas-area::-webkit-scrollbar { width: 8px; height: 8px; }
.canvas-area::-webkit-scrollbar-track { background: transparent; }
.canvas-area::-webkit-scrollbar-thumb { background: #c1c8d0; border-radius: 4px; }
.canvas-area::-webkit-scrollbar-thumb:hover { background: #a0aab5; }

.page-wrapper {
    position: relative;
    background: #fff;
    box-shadow: var(--shadow-lg);
    border-radius: 2px;
    flex-shrink: 0;
    max-width: 100%;
}

.pdf-page-shell{
    position:relative;
    display:block;
    margin:0 auto 24px;
}

.page-wrapper canvas { 
    display: block; 
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}


/* ── Text Overlay ──────────────────────── */
.text-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none; /* let clicks reach individual spans */
    z-index: 200; /* Ensure it is above draw-canvas */
}

.pdf-text {
    position: absolute;
    color: transparent;
    cursor: text;
    line-height: 1;
    white-space: pre;
    transform-origin: left bottom;
    pointer-events: all;
    border-radius: 2px;
    transition: background 0.1s;
}

.pdf-text:hover {
    outline: 2px solid rgba(37,99,235,0.5);
    background: rgba(37,99,235,0.06);
}

.pdf-text.edited {
    background: #ffffff;
    outline: none;
    z-index: 10;
}

/* Inline edit input */
.text-edit-input {
    position: absolute;
    z-index: 200;
    border: 2px solid var(--accent-blue);
    border-radius: 3px;
    background: #fff;
    color: #000;
    outline: none;
    padding: 1px 3px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    box-shadow: 0 2px 12px rgba(37,99,235,0.25);
    pointer-events: auto; /* Added to ensure clickability */
}


/* ── Floating Bottom Pill ──────────────── */
.floating-pill {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e2130;
    border-radius: 12px;
    padding: 8px 16px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 90;
    white-space: nowrap;
}

.pill-group { display: flex; align-items: center; gap: 6px; }
.pill-label { color: #7a8498; font-size: 13px; }
.pill-val { color: #e2e8f0; font-size: 13px; font-weight: 500; min-width: 38px; text-align: center; }
.pill-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.12); }

.pill-btn {
    color: #a0aab5; padding: 5px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.pill-btn:hover { color: #e2e8f0; background: rgba(255,255,255,0.1); }
.pill-pan { padding: 5px 8px; }


/* ── Loader ────────────────────────────── */
.loader-overlay {
    position: fixed; inset: 0;
    background: rgba(15,17,26,0.85);
    /* display controlled by JS: none / flex */
    align-items: center; justify-content: center;
    z-index: 9999;
}

.loader-card {
    background: var(--white); border-radius: 16px;
    padding: 40px 48px; text-align: center;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
}

.spinner {
    width: 44px; height: 44px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loader-msg { font-size: 15px; font-weight: 500; color: var(--text-secondary); }


/* ── Toast ─────────────────────────────── */
.toast {
    position: fixed; bottom: 80px;
    left: 50%; transform: translateX(-50%);
    background: #1e2130; color: #e2e8f0;
    padding: 10px 24px; border-radius: 8px;
    font-size: 14px; font-weight: 500;
    z-index: 9998;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.25s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Modal ──────────────────────────────── */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;z-index:10000;}
.modal-card{background:#fff;border-radius:12px;padding:0;width:520px;max-width:92vw;box-shadow:var(--shadow-lg);overflow:hidden;}
.modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid var(--border);}
.modal-header h3{font-size:16px;font-weight:600;}
.modal-close{font-size:22px;color:var(--text-muted);padding:4px 8px;border-radius:4px;}
.modal-close:hover{background:#f3f4f6;color:var(--text-primary);}
#sign-canvas{display:block;width:100%;background:#fafafa;cursor:crosshair;border-bottom:1px solid var(--border);}
.modal-footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px;}
.modal-btn-sec{padding:8px 16px;border-radius:6px;border:1px solid var(--border);color:var(--text-secondary);font-weight:500;}
.modal-btn-sec:hover{background:#f3f4f6;}
.modal-btn-pri{padding:8px 16px;border-radius:6px;background:var(--accent);color:#fff;font-weight:600;}
.modal-btn-pri:hover{background:var(--accent-hover);}

/* ── Drawing/Annotation layers ──────────── */
.draw-canvas{position:absolute;top:0;left:0;width:100%;height:100%;z-index:50;cursor:crosshair;}
.annotation-marker{position:absolute;z-index:60;cursor:pointer;}
.annotation-note{position:absolute;z-index:150;background:#fff9c4;border:1px solid #f9a825;border-radius:6px;padding:8px;width:200px;box-shadow:var(--shadow-md);font-size:13px;}
.annotation-note textarea{width:100%;border:none;background:transparent;resize:vertical;min-height:60px;font-family:inherit;font-size:13px;outline:none;}
.annotation-pin{width:24px;height:24px;background:#f9a825;border-radius:50% 50% 50% 0;transform:rotate(-45deg);cursor:pointer;z-index:60;position:absolute;}

/* Tool cursors */
#canvas-area.tool-eraser{cursor:cell;}
#canvas-area.tool-highlight{cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23eab308" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 11-6 6v3h9l3-3"/><path d="m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"/></svg>') 4 20, crosshair;}
#canvas-area.tool-draw{cursor:crosshair;}
#canvas-area.tool-add-text{cursor:text;}
#canvas-area.tool-image{cursor:copy;}
#canvas-area.tool-annotate{cursor:help;}
#canvas-area.tool-sign{cursor:crosshair;}
#canvas-area.tool-image-stamp{cursor:copy;}
#canvas-area.tool-digital-signature{cursor:crosshair;}
/* Removed cursor CSS to allow inline styles to drive cursor behavior */

/* Added text boxes */
.added-text-box{position:absolute;z-index:100;min-width:60px;padding:2px 4px;border:1px dashed transparent;background:transparent;outline:none;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#000;pointer-events:auto;}
#canvas-area.tool-add-text .added-text-box:not(.is-editing) { cursor: grab !important; }
#canvas-area.tool-add-text .added-text-box:active { cursor: grabbing !important; }
.added-text-box.stamp-box{border-style:solid;border-color:#b91c1c;background:rgba(254,242,242,0.95);color:#b91c1c;font-weight:700;padding:6px 10px;box-shadow:0 4px 14px rgba(185,28,28,0.12);}

/* Placed images */
.placed-image{position:absolute;z-index:250;cursor:move;border:2px solid transparent;max-width:300px;}
.placed-image:hover{border-color:var(--accent-blue);}

.text-format-toolbar {
    position: absolute;
    background: #1e2130;
    border-radius: 8px;
    display: flex;
    padding: 6px 8px;
    gap: 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    z-index: 1000;
    transform: translateY(-100%);
    margin-top: -10px;
    pointer-events: auto; /* Added to ensure clickability */
}
.fmt-btn {
    background: transparent;
    color: #a0aab5;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.fmt-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.fmt-btn.active { background: var(--accent); color: #fff; }

.text-format-toolbar {
    display: flex;
    align-items: center;
    background: #006686;
    min-height: 48px;
    padding: 6px 8px 6px 10px;
    border-radius: 14px;
    box-shadow: 0 16px 30px rgba(0, 102, 134, 0.28);
    position: fixed;
    transform: none;
    margin-top: 0;
    gap: 6px;
    z-index: 1000;
    pointer-events: auto;
}

.fmt-toolbar-inner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fmt-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ffffff;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 7px;
    transition: all 0.2s;
    padding: 0 6px;
    font-weight: 700;
}
.fmt-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.fmt-btn.active { color: #ffffff; background: rgba(255,255,255,0.22); }
.fmt-btn.fmt-action {
    min-width: 38px;
    height: 32px;
    background: rgba(255,255,255,0.12);
}
.fmt-btn.fmt-action:hover {
    background: rgba(255,255,255,0.22);
}
.fmt-btn.fmt-delete {
    color: #ffd5d5;
}

.editor-mode-title {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    max-width: min(32vw, 320px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.78rem, 1.1vw, 1rem);
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    padding: 6px 16px;
    border-radius: 8px;
    background: #006686;
    border: 1px solid rgba(255,255,255,0.15);
}

@media (max-width: 1180px) {
    .editor-mode-title {
        display: none;
    }
}

.fmt-combo-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 148px;
    background-color: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 6px;
    padding: 0 10px;
    height: 34px;
    color: #ffffff;
    gap: 8px;
}

.fmt-combo-btn:hover,
.fmt-size-trigger:hover {
    background-color: rgba(255,255,255,0.18);
}

.fmt-combo-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
}

.fmt-combo-arrow {
    font-size: 18px;
    line-height: 1;
}

.fmt-size-control {
    display: flex;
    align-items: center;
    width: 88px;
    background-color: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 6px;
    height: 34px;
}

.fmt-size-input {
    width: 100%;
    height: 100%;
    background-color: #1F7994 !important;
    color: #ffffff;
    border: none;
    text-align: center;
    padding: 0 6px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    -webkit-text-fill-color: #ffffff;
    appearance: textfield;
    -moz-appearance: textfield;
    border-radius: 5px 0 0 5px;
}
.fmt-size-input::-webkit-inner-spin-button,
.fmt-size-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fmt-size-trigger {
    width: 34px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border-left: 1px solid rgba(255,255,255,0.18);
    color: #ffffff;
    flex-shrink: 0;
    border-radius: 0 5px 5px 0;
}

.fmt-dropdown-panel {
    position: fixed;
    z-index: 1100;
    min-width: 148px;
    max-height: 240px;
    overflow-y: auto;
    background: #006686;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 18px 34px rgba(0, 102, 134, 0.28);
}

.fmt-dropdown-option {
    width: 100%;
    display: block;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.fmt-font-search-container {
    display: flex;
    align-items: center;
    background-color: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 6px;
    height: 34px;
    padding: 0 6px;
    gap: 4px;
    width: 180px;
}

.fmt-search-icon {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
}

.fmt-font-search-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 100%;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
}

.fmt-font-search-input::placeholder {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
}

.fmt-combo-arrow-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fmt-dropdown-heading {
    padding: 10px 10px 4px;
    font-size: 11px;
    font-weight: 800;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.fmt-dropdown-option:hover,
.fmt-dropdown-option.active {
    background: rgba(255,255,255,0.18);
}

.area-format-toolbar {
    display: flex;
    align-items: center;
    background: #006686;
    min-height: 48px;
    padding: 6px 10px;
    border-radius: 14px;
    box-shadow: 0 16px 30px rgba(0, 102, 134, 0.28);
    position: fixed;
    gap: 8px;
    z-index: 1000;
    pointer-events: auto;
}

.area-toolbar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.area-shape-trigger {
    min-width: 158px;
    height: 34px;
}

.area-shape-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
}

.area-arrow {
    font-size: 18px;
    line-height: 1;
}

.area-opacity-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 72px;
}

.area-mini-label {
    color: rgba(255,255,255,0.84);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.area-opacity-label {
    color: #ffffff;
}

.area-size-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.area-size-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 8px;
    padding: 4px 6px;
}

.area-dim-input {
    width: 52px;
    height: 26px;
    border: none;
    outline: none;
    appearance: textfield;
    -webkit-appearance: none;
    background: #1F7995 !important;
    background-color: #1F7995 !important;
    color: #ffffff;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    -moz-appearance: textfield;
}

.area-opacity-input {
    width: 72px;
}

.area-dim-input::-webkit-inner-spin-button,
.area-dim-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.area-lock-btn {
    min-width: 28px !important;
    width: 28px;
    height: 28px;
    padding: 0 !important;
}

.area-shape-panel {
    min-width: 210px !important;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.area-shape-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    background: rgba(255,255,255,0.06);
}

.area-shape-option:hover,
.area-shape-option.active {
    background: rgba(255,255,255,0.18);
}

.fmt-input-color {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.34);
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}
.fmt-sep {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.22);
    margin: 0 2px;
}
.fmt-input-color::-webkit-color-swatch-wrapper { padding: 0; }
.fmt-input-color::-webkit-color-swatch { border: none; }

.text-edit-input {
    border: 2px solid var(--primary) !important;
    border-radius: 2px;
    padding: 2px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.area-box-interactive {
    position: absolute;
    z-index: 140;
    cursor: move;
    border: 1px dashed rgba(0,102,134,0.45);
    pointer-events: auto;
    min-width: 4px;
    min-height: 4px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.area-box-interactive.selected {
    outline: 2px solid rgba(0,102,134,0.85);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0,102,134,0.14), inset 0 0 0 1px rgba(255,255,255,0.18);
}

.highlight-box-interactive {
    mix-blend-mode: multiply;
}

.edit-backdrop {
    background: rgba(0,0,0,0.01);
}

/* Draggable handle styling */
.added-text-box, .pdf-text {
    cursor: text;
}
.added-text-box {
    cursor: grab !important;
}
.added-text-box.dragging {
    cursor: grabbing !important;
}
body.is-dragging-text {
    user-select: none !important;
    -webkit-user-select: none !important;
}
#canvas-area.tool-add-text .added-text-box:not(.is-editing) {
    cursor: grab !important;
}
#canvas-area.tool-add-text .added-text-box:not(.is-editing):active {
    cursor: grabbing !important;
}
#canvas-area .added-text-box.is-editing {
    cursor: text;
}
.added-text-box.is-editing,
.added-text-box.selected,
.added-text-box.dragging {
    border-color: #38bdf8;
    background: rgba(255,255,255,0.9);
}
.pdf-text:hover {
    outline: 1px dashed #38bdf8;
}
.added-text-box.is-placeholder {
    color: #9ca3af !important;
    font-style: italic;
}
.added-text-box.selected {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}
.added-link-box.selected {
    border: 2px solid #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

/* Added link boxes */
.added-link-box {
    position: absolute;
    z-index: 100;
    cursor: pointer;
    border: 1px dashed var(--primary);
    background: rgba(0, 102, 134, 0.1);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Sidebar and thumbnail adjustments */
#sidebar-thumbnails::-webkit-scrollbar { width: 4px; }
#sidebar-thumbnails::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* ── Context Sub-Toolbar ──────────────── */
#context-toolbar {
    background: #006686;
    font-family: 'Inter', sans-serif;
}
#context-toolbar.hidden { display: none !important; }
#context-toolbar:not(.hidden) { display: flex !important; }

.canvas-area {
    padding: 24px 0 96px;
}

.ctx-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ffffff;
    height: 42px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    border-radius: 6px;
    transition: all 0.15s;
    gap: 4px;
    white-space: nowrap;
}
.ctx-btn:hover { background: rgba(255,255,255,0.1); color: #ffffff; }
.ctx-btn.active { color: #ffffff; background: rgba(255,255,255,0.2); }

.ctx-select {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    height: 42px;
}

.ctx-color {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.2);
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
}
.ctx-color::-webkit-color-swatch-wrapper { padding: 0; }
.ctx-color::-webkit-color-swatch { border: none; border-radius: 4px; }

.ctx-range {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    outline: none;
}
.ctx-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: 2px solid #006686;
}

.ctx-num {
    width: 60px;
    height: 42px;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    outline: none;
}

.ctx-separator {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    margin: 0 16px;
}

.ctx-label {
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Shape palette dropdown */
.ctx-shape-grid {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #00546f;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    z-index: 200;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.ctx-shape-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    transition: 0.15s;
}
.ctx-shape-btn:hover { background: rgba(255,255,255,0.1); color: #ffffff; }
.ctx-shape-btn.active { background: rgba(255,255,255,0.2); color: #ffffff; }

/* Brush type dropdown */
.ctx-brush-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #00546f;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 6px;
    z-index: 200;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    min-width: 160px;
}
.ctx-brush-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: 0.15s;
}
.ctx-brush-opt:hover { background: rgba(255,255,255,0.1); color: #ffffff; }
.ctx-brush-opt.active { background: rgba(255,255,255,0.2); color: #ffffff; }

/* More tools dropdown */
.more-tools-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    z-index: 200;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    min-width: 220px;
}
.more-tool-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: 0.15s;
}
.more-tool-item:hover { background: #f1f5f9; color: #0f172a; }
.more-tool-item .material-symbols-outlined { color: #64748b; font-size: 20px; }

/* Menu modals */
.menu-modal-card{width:min(920px,94vw);max-height:90vh;display:flex;flex-direction:column;}
.history-modal-card{width:min(760px,90vw);max-height:86vh;display:flex;flex-direction:column;}
.menu-modal-body{padding:18px 20px;display:grid;gap:14px;overflow:auto;flex:1;}
.menu-stack{display:grid;gap:14px;}
.menu-card-block{background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:14px;display:grid;gap:10px;}
.menu-block-title{font-size:14px;font-weight:700;color:#0f172a;}
.menu-field{display:grid;gap:6px;font-size:12px;font-weight:700;color:#475569;}
.menu-field input,.menu-field select{width:100%;border:1px solid #cbd5e1;border-radius:10px;padding:10px 12px;background:#fff;color:#0f172a;font:inherit;}
.menu-grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.menu-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.menu-link-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.menu-tool-link{display:flex;align-items:center;justify-content:center;min-height:42px;padding:10px 12px;color:#075985;background:#e8f6fb;border:1px solid #cce4ee;border-radius:12px;font-size:13px;font-weight:900;text-align:center;line-height:1.25;}
.menu-tool-link:hover{color:#ffffff;background:var(--primary);border-color:var(--primary);}
.menu-toggle-row{display:flex;gap:8px;flex-wrap:wrap;}
.menu-note{color:#64748b;font-size:12px;line-height:1.45;}
.menu-preview-box{min-height:80px;border:1px dashed #cbd5e1;border-radius:14px;background:#f8fafc;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:8px;}
.menu-preview-box img{max-width:100%;max-height:220px;display:block;}
.menu-file-input{width:100%;padding:12px;border:1px dashed #cbd5e1;border-radius:12px;background:#fff;}
.menu-btn-row{display:flex;gap:10px;flex-wrap:wrap;}
.modal-btn-sec.is-on{background:#e0f2fe;border-color:#7dd3fc;color:#0369a1;}
.modal-btn-pri.is-on{background:#0369a1;}
.modal-btn-danger{
    background:#fff1f2;
    color:#be123c;
    border:1px solid #fecdd3;
    padding:10px 14px;
    border-radius:10px;
    font-weight:800;
    transition:0.15s;
}
.modal-btn-danger:hover{background:#ffe4e6;}
.help-info-modal{
    width:min(480px,88vw);
    min-height:min(480px,88vw);
    border:1px solid rgba(0,102,134,0.18);
    background:linear-gradient(180deg,#ffffff 0%,#f8fcff 100%);
    box-shadow:0 20px 60px rgba(0,102,134,0.18);
}
.help-info-modal .modal-header{
    border-bottom:1px solid rgba(0,102,134,0.12);
    background:rgba(255,255,255,0.6);
}
.help-info-modal .modal-header h3{
    color:#0b4f63;
    font-size:18px;
    font-weight:800;
}
.find-replace-modal{
    width:min(640px,72vw);
    border:1px solid rgba(0,102,134,0.22);
    background:linear-gradient(180deg,#eef8fc 0%,#ffffff 62%,#f8fcff 100%);
    box-shadow:0 24px 62px rgba(0,102,134,0.18);
}
.find-replace-modal .modal-header{
    background:linear-gradient(90deg,rgba(0,102,134,0.14) 0%,rgba(0,163,196,0.08) 56%,rgba(210,41,75,0.08) 100%);
    border-bottom:1px solid rgba(0,102,134,0.16);
    cursor:move;
    user-select:none;
}
.find-replace-modal .modal-header h3{
    color:#0b4f63;
    font-size:20px;
    font-weight:800;
}
.find-replace-modal .menu-modal-body{
    padding:18px 20px 12px;
}
.find-replace-modal .menu-field{
    font-size:15px;
    font-weight:800;
    color:#0f4c5c;
}
.find-replace-modal .menu-field span{
    font-size:15px;
    font-weight:800;
    color:#0f4c5c;
}
.find-replace-modal .menu-field input{
    border-color:rgba(0,102,134,0.2);
    background:rgba(255,255,255,0.96);
    color:#0f172a;
    font-size:18px;
    font-weight:700;
    padding:14px 16px;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,0.65);
}
.find-replace-modal .menu-note{
    color:#355c6d;
    font-size:14px;
    line-height:1.5;
    font-weight:700;
}
.find-replace-modal .modal-footer{
    padding:8px 20px 16px;
}
.find-replace-modal .modal-btn-sec,
.find-replace-modal .modal-btn-pri{
    font-size:15px;
    font-weight:800;
    padding:12px 20px;
    border-radius:12px;
}
.find-replace-modal .modal-btn-sec{
    background:rgba(0,102,134,0.08);
    border-color:rgba(0,102,134,0.2);
    color:#0b5f79;
}
.find-replace-modal .modal-btn-sec:hover{
    background:rgba(0,102,134,0.14);
}
.find-replace-modal .modal-btn-pri{
    background:#006686;
    box-shadow:0 10px 24px rgba(0,102,134,0.22);
    color:#ffffff;
}
.find-replace-modal .modal-btn-pri:hover{
    background:#0a7b9f;
}
.find-replace-modal.is-draggable-modal{
    max-width:min(640px,72vw);
}
.help-info-modal .menu-modal-body{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}
.help-info-body{
    width:100%;
    min-height:300px;
    border-radius:22px;
    background:linear-gradient(135deg,#ffffff 0%,#fff5f7 100%);
    border:1px solid rgba(210,41,75,0.18);
    padding:24px 22px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    text-align:center;
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.9);
}
.help-info-title{
    color:var(--accent);
    font-size:28px;
    line-height:1.15;
    font-weight:900;
    letter-spacing:0.02em;
    margin-bottom:18px;
    text-transform:uppercase;
}
.help-info-text{
    color:#0f4c5c;
    font-size:20px;
    line-height:1.65;
    font-weight:700;
}
.help-info-modal .modal-footer{
    justify-content:center;
    padding:0 20px 22px;
}
.help-info-modal .modal-btn-pri{
    min-width:140px;
    background:#006686;
}
.help-info-modal .modal-btn-pri:hover{
    background:#00546f;
}

.preview-overlay{
    align-items:stretch;
    justify-content:stretch;
    background:rgba(15,23,42,0.14);
}
.preview-pages{
    position:relative;
    width:100%;
    height:100%;
    overflow:auto;
    padding:24px 16px 48px;
    background:#f8f9ff;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:24px;
}
.preview-pages .pdf-page-shell{
    box-shadow:0 12px 32px rgba(15,23,42,0.12);
}
.preview-download-btn{
    position:fixed;
    top:20px;
    right:20px;
    z-index:10001;
    background:#006686;
    color:#fff;
    font-weight:800;
    font-size:16px;
    padding:14px 30px;
    border-radius:10px;
    box-shadow:0 10px 24px rgba(0,102,134,0.22);
}
.preview-download-btn:hover{background:#00546f;}
.preview-back-btn{
    position:fixed;
    top:92px;
    right:20px;
    z-index:10001;
    background:#ffffff;
    color:#006686;
    font-weight:800;
    font-size:15px;
    padding:13px 28px;
    border-radius:10px;
    border:1px solid rgba(0,102,134,0.22);
    box-shadow:0 10px 24px rgba(15,23,42,0.1);
}
.preview-back-btn:hover{background:#f8fafc;}

.delete-page-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;max-height:60vh;overflow:auto;padding:4px 2px;}
.delete-page-card{position:relative;background:#fff;border:2px solid transparent;border-radius:14px;padding:10px;display:grid;gap:8px;text-align:left;cursor:pointer;transition:all 0.2s;box-shadow:0 4px 6px -1px rgba(0,0,0,0.05),0 2px 4px -1px rgba(0,0,0,0.03);}
.delete-page-card:hover{box-shadow:0 10px 20px rgba(0,102,134,0.15);border-color:var(--primary);transform:translateY(-2px);}
.delete-page-card canvas{width:100%;height:auto;display:block;border-radius:8px;border:1px solid #f1f5f9;box-shadow:0 2px 4px rgba(0,0,0,0.05);}
.delete-page-card span{font-size:14px;font-weight:700;color:var(--primary);text-align:center;}
.delete-page-x{position:absolute;top:10px;right:10px;background:#ef4444;color:#fff;border-radius:9999px;font-size:10px;font-weight:700;padding:4px 8px;text-transform:uppercase;letter-spacing:0.05em;}

.history-modal-body{padding:16px;overflow:auto;max-height:60vh;display:grid;gap:10px;background:#f8fafc;}
.history-row{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #e2e8f0;background:#fff;border-radius:12px;text-align:left;cursor:pointer;transition:0.15s;}
.history-row:hover{border-color:#7dd3fc;box-shadow:0 8px 18px rgba(15,23,42,0.06);}
.history-row.is-undone{opacity:0.65;}
.history-dot{width:10px;height:10px;border-radius:9999px;background:#006686;flex:none;}
.history-text{display:grid;gap:2px;flex:1;min-width:0;}
.history-text strong{font-size:13px;color:#0f172a;}
.history-text small{font-size:11px;color:#64748b;}
.history-chip{font-size:10px;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;color:#006686;background:#e0f2fe;padding:4px 8px;border-radius:9999px;flex:none;}
.history-empty{padding:20px;text-align:center;color:#64748b;font-size:13px;}

.find-match:not(.edited){background:rgba(250,204,21,0.28) !important;outline:2px solid rgba(234,179,8,0.35);border-radius:3px;}
.find-match.edited{}

/* Interactive eraser/highlight boxes */
.eraser-box-interactive, .highlight-box-interactive {
    z-index: 140;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.eraser-box-interactive:hover { border-color: #ef4444; }
.highlight-box-interactive:hover { border-color: #f59e0b; }
.eraser-box-interactive.selected, .highlight-box-interactive.selected {
    border-color: rgba(0,102,134,0.85);
}

#sign-modal {
    pointer-events: none;
}

#sign-modal .modal-card {
    pointer-events: auto;
}

/* ==============================================
   PHASE 1 FOUNDATION POLISH
   ============================================== */
.home-ad-wrap {
    margin: 42px auto 0;
    max-width: 980px;
}

.ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    color: #64748b;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.86), rgba(240,249,255,0.78)),
        repeating-linear-gradient(45deg, rgba(0,102,134,0.05) 0 10px, transparent 10px 20px);
    border: 1px dashed rgba(0,102,134,0.28);
    border-radius: 14px;
    text-align: center;
    user-select: none;
}

.ad-slot span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ad-slot strong {
    color: #006686;
    font-size: 13px;
}

.ad-slot-home {
    min-height: 96px;
}

.editor-ad-rail {
    padding: 18px;
}

.ad-slot-rail {
    position: sticky;
    top: 18px;
    min-height: 520px;
    width: 100%;
}

.editor-main {
    min-width: 0;
}

.editor-tools-row {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.editor-tools-row .tool-btn {
    min-width: 112px;
}

@media (max-width: 1100px) {
    .editor-ad-rail {
        display: none !important;
    }

    #canvas-area {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

@media (max-width: 760px) {
    #editor-screen {
        min-height: 100vh;
    }

    .editor-header-inner {
        height: auto !important;
        min-height: 64px;
        padding: 8px 12px !important;
        gap: 8px;
        flex-wrap: wrap;
    }

    .editor-header-left {
        gap: 8px !important;
        min-width: 0;
        flex: 1 1 auto;
    }

    .editor-brand-name {
        font-size: 18px !important;
        line-height: 1.05;
        max-width: 150px;
        display: inline-block;
        word-break: break-word;
    }

    .editor-header-actions {
        width: 100%;
        gap: 8px !important;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .editor-header-actions > .w-\[1px\] {
        display: none;
    }

    #btn-save {
        padding-left: 12px !important;
        padding-right: 12px !important;
        white-space: nowrap;
    }

    #btn-save span:last-child {
        display: none;
    }

    .editor-tools-row {
        height: 58px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .editor-tools-row .tool-btn {
        min-width: 76px;
        flex: 0 0 76px !important;
    }

    .editor-tools-row .tool-btn .material-symbols-outlined {
        font-size: 20px;
    }

    .editor-tools-row .tool-btn span:last-child {
        font-size: 9px !important;
        line-height: 1.05 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .editor-workspace {
        min-width: 0;
    }

    .editor-main {
        width: 100%;
        flex-basis: 100%;
    }

    #canvas-area {
        padding: 14px 10px 80px !important;
        text-align: center;
    }

    .page-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .home-content-wrap {
        padding-top: 5rem !important;
    }

    .custom-cursor {
        display: none;
    }

    .selection-overlay {
        width: 92% !important;
    }
}

/* ==============================================
   PHASE 2 HOME / SEO CONTENT
   ============================================== */
.home-section {
    margin-top: 76px;
    padding: 54px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 30px;
    box-shadow: 0 24px 70px rgba(15,23,42,0.08);
}

.home-section h2 {
    max-width: 820px;
    margin: 0 auto 16px;
    color: #0b1c30;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.05;
    letter-spacing: -0.04em;
    text-align: center;
    font-weight: 800;
}

.home-section h3 {
    color: #0b1c30;
    font-weight: 800;
}

.section-kicker {
    margin-bottom: 14px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
}

.section-intro {
    max-width: 760px;
    margin: 0 auto 32px;
    color: #475569;
    font-size: 17px;
    line-height: 1.75;
    text-align: center;
}

.section-intro.align-left {
    margin-left: 0;
    text-align: left;
}

.tool-grid,
.benefit-grid,
.compare-grid,
.faq-grid {
    display: grid;
    gap: 18px;
}

.tool-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    min-height: 158px;
    padding: 18px;
    border: 1px solid rgba(14,165,199,0.35);
    border-radius: 18px;
    background: linear-gradient(135deg, #006686, #0ea5c7);
    color: #e8fbff;
    will-change: transform, box-shadow;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease,
        color 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0,102,134,0.45);
    box-shadow:
        0 4px 8px rgba(0,102,134,0.15),
        0 12px 28px rgba(0,102,134,0.18),
        0 24px 48px rgba(15,23,42,0.10);
    background: linear-gradient(180deg, #ffffff 0%, #eef8ff 100%);
    color: #334155;
}

/* Featured card */
.tool-card.featured {
    background: linear-gradient(135deg, #006686, #0ea5c7);
    color: #e8fbff;
}

.tool-card.featured:hover {
    transform: translateY(-6px);
    border-color: rgba(0,102,134,0.45);
    box-shadow:
        0 4px 8px rgba(0,102,134,0.15),
        0 12px 28px rgba(0,102,134,0.18),
        0 24px 48px rgba(15,23,42,0.10);
    background: linear-gradient(180deg, #ffffff 0%, #eef8ff 100%);
    color: #334155;
}

/* Icon */
.tool-card span.material-symbols-outlined {
    display: inline-flex;
    width: 38px;
    height: 38px;
    margin-bottom: 12px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: rgba(255,255,255,0.16);
    border-radius: 13px;
    font-size: 23px;
    transition: color 0.3s ease, background 0.3s ease;
}

.tool-card:hover span.material-symbols-outlined,
.tool-card.featured:hover span.material-symbols-outlined {
    color: var(--primary);
    background: rgba(0,102,134,0.10);
}

.tool-card.featured span.material-symbols-outlined {
    color: #ffffff;
    background: rgba(255,255,255,0.16);
}

/* Heading */
.tool-card h3 {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.2;
    color: #ffffff;
    transition: color 0.3s ease;
}

.tool-card:hover h3,
.tool-card.featured:hover h3 {
    color: #0b1c30;
}

.tool-card p {
    font-size: 13px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.tool-card.featured h3 {
    color: #ffffff;
}

.tool-card p,
.compare-card p,
.benefit-grid span,
.steps-list span,
.site-footer p {
    color: inherit;
    line-height: 1.65;
}

.split-section {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 42px;
    align-items: center;
}

.split-section h2,
.split-section .section-kicker {
    margin-left: 0;
    text-align: left;
}

.steps-list {
    display: grid;
    gap: 16px;
}

.steps-list div,
.benefit-grid div,
.compare-card {
    padding: 24px;
    border: 1px solid #d8e6f4;
    border-radius: 22px;
    background: #ffffff;
}

.steps-list strong,
.benefit-grid strong {
    display: block;
    margin-bottom: 8px;
    color: #0b1c30;
    font-size: 17px;
}

.steps-list span,
.benefit-grid span {
    display: block;
    color: #475569;
}

.compare-grid,
.benefit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compare-card h3 {
    margin-bottom: 10px;
    font-size: 24px;
}

.compare-card a,
.text-link,
.privacy-section a {
    display: inline-flex;
    margin-top: 16px;
    color: var(--primary);
    font-weight: 800;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.pill-list span {
    padding: 12px 16px;
    color: #0b1c30;
    background: #eef7fb;
    border: 1px solid #cce4ee;
    border-radius: 999px;
    font-weight: 700;
}

.privacy-section {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: center;
    background: linear-gradient(135deg, #0b1c30, #006686);
    color: #e8fbff;
}

.privacy-section h2,
.privacy-section .section-kicker {
    margin-left: 0;
    color: #ffffff;
    text-align: left;
}

.privacy-section .section-kicker {
    color: #7bd1fa;
}

.privacy-section p {
    max-width: 820px;
    color: #d7edf7;
    font-size: 17px;
    line-height: 1.75;
}

.privacy-section a {
    padding: 13px 18px;
    color: #0b1c30;
    background: #ffffff;
    border-radius: 999px;
    white-space: nowrap;
}

.faq-grid {
    max-width: 900px;
    margin: 0 auto;
}

.faq-grid details {
    padding: 20px 22px;
    background: #ffffff;
    border: 1px solid #d8e6f4;
    border-radius: 18px;
}

.faq-grid summary {
    color: #0b1c30;
    font-weight: 800;
    cursor: pointer;
}

.faq-grid p {
    margin-top: 12px;
    color: #475569;
    line-height: 1.65;
}

.faq-section .text-link {
    justify-content: center;
}

.final-cta {
    text-align: center;
    background: radial-gradient(circle at top left, #b9e8fa, transparent 34%), linear-gradient(135deg, #ffffff, #eef7fb);
}

.final-cta p {
    max-width: 640px;
    margin: 0 auto 24px;
    color: #475569;
    font-size: 17px;
}

.final-cta a {
    display: inline-flex;
    padding: 15px 24px;
    color: #ffffff;
    background: var(--primary);
    border-radius: 999px;
    font-weight: 800;
}

.site-footer {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
    margin-top: 48px;
    padding: 32px 0 10px;
    color: #475569;
}

.site-footer strong {
    display: block;
    margin-bottom: 8px;
    color: #0b1c30;
    font-size: 20px;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px 22px;
}

.site-footer a {
    color: #334155;
    font-weight: 700;
}

.site-main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.9);
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(16px);
}

.site-main-header-fixed {
    position: fixed;
    left: 0;
    right: 0;
}

.site-main-nav {
    display: flex;
    max-width: 1280px;
    min-height: 68px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0b1c30;
    font-size:  28px;
    font-weight: 900;
    white-space: nowrap;
}

.site-brand-mark {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--primary);
    border-radius: 10px;
}

.site-nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #475569;
    font-size: 14px;
    font-weight: 800;
}

.site-nav-links > a,
.site-tools-menu > summary {
    color: #475569;
}

.site-nav-links > a:hover,
.site-tools-menu > summary:hover {
    color: var(--primary);
}

.site-tools-menu {
    position: relative;
}

.site-tools-menu > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    cursor: pointer;
    font-size: 15px;
}

.site-tools-menu > summary::-webkit-details-marker {
    display: none;
}

.site-tools-panel {
    position: fixed;
    top: 84px;
    left: 50%;
    z-index: 300;
    width: min(1180px, calc(100vw - 48px));
    max-height: min(74vh, 620px);
    overflow-y: auto;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(4, minmax(230px, 1fr));
    gap: 20px;
    padding: 26px;
    background: #ffffff;
    border: 1px solid #d8e6f4;
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(15,23,42,0.14);
}

.site-tools-group {
    display: grid;
    gap: 10px;
    align-content: start;
    min-width: 0;
}

.site-tools-group h3 {
    color: #0b1c30;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-tools-group a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    color: #334155;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.site-tools-group a:hover {
    color: var(--primary);
    background: #e8f6fb;
}

.site-tools-group .material-symbols-outlined {
    color: var(--primary);
    font-size: 26px;
}

.site-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-sign-in {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    color: #ffffff;
    background: var(--primary);
    border-radius: 999px;
    font-weight: 900;
    white-space: nowrap;
}

.site-language,
.site-language-menu > summary {
    display: inline-flex;
    min-width: 150px;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    color: #334155;
    background: #f8fbff;
    border: 1px solid #d8e6f4;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.site-language-menu {
    position: relative;
}

.site-language-menu > summary {
    min-width: 210px;
    list-style: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 900;
}

.site-language-menu > summary::-webkit-details-marker {
    display: none;
}

.site-language-menu .material-symbols-outlined,
.site-language .material-symbols-outlined {
    color: var(--primary);
    font-size: 22px;
}

.google-translate-hidden,
.site-language .goog-te-gadget {
    font-size: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.site-language select {
    max-width: 118px;
    color: #334155;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 12px;
    font-weight: 800;
}

.site-language-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 350;
    width: min(360px, calc(100vw - 32px));
    padding: 14px;
    background: #ffffff;
    border: 1px solid #d8e6f4;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(15,23,42,0.16);
}

.site-language-search {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 14px;
    color: #0b1c30;
    border: 1px solid #cce4ee;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    outline: none;
}

.site-language-list {
    display: grid;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
}

.site-language-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    color: #23364f;
    background: transparent;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 850;
    text-align: left;
}

.site-language-option:hover {
    color: var(--primary);
    background: #e8f6fb;
}

.site-language-code {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.upload-legal-note {
    max-width: 760px;
    margin-top: 12px;
    padding: 14px 16px;
    color: #0b1c30;
    background: #fff8d8;
    border: 1px solid #f2d36b;
    border-left: 5px solid #006686;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.65;
}

.site-footer {
    width: min(1560px, calc(100% - 40px));
    grid-template-columns: 1.1fr 3fr;
    margin: 54px auto 0;
    padding: 42px 34px;
    color: #d9ecf4;
    background: #006686;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -18px 55px rgba(0,102,134,0.20);
}

.site-footer strong,
.site-footer p,
.site-footer .upload-legal-note {
    color: #ffffff;
}

.site-footer .upload-legal-note {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.24);
    border-left-color: #ffffff;
}

.footer-brand-block {
    display: grid;
    gap: 12px;
    align-content: start;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 22px;
}

.footer-col {
    display: grid;
    gap: 9px;
    align-content: start;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-footer .footer-grid a {
    color: #d9ecf4;
    font-size: 13px;
    font-weight: 750;
}

.site-footer .footer-grid a:hover {
    color: #ffffff;
}

.home-tool-categories {
    display: grid;
    gap: 34px;
}

.home-tool-category {
    display: grid;
    gap: 16px;
}

.home-tool-category > h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    color: #0b1c30;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.home-tool-category > h3 .material-symbols-outlined {
    color: var(--primary);
    font-size: 28px;
}

.legal-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(6, 20, 35, 0.62);
    backdrop-filter: blur(10px);
}

.legal-modal-overlay.is-open {
    display: flex;
}

.legal-modal-card {
    width: min(720px, 94vw);
    padding: 30px;
    color: #0b1c30;
    background: radial-gradient(circle at top left, #dff7ff, transparent 32%), #ffffff;
    border: 1px solid #b7ddea;
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
}

.legal-modal-card h2 {
    margin: 0 0 12px;
    color: #006686;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1;
    letter-spacing: -0.05em;
}

.legal-modal-card p {
    margin: 0;
    padding: 18px;
    color: #0b1c30;
    background: #fff8d8;
    border: 1px solid #f2d36b;
    border-left: 6px solid #006686;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.65;
}

.legal-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.legal-modal-agree,
.legal-modal-cancel {
    min-width: 124px;
    padding: 13px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 900;
}

.legal-modal-agree {
    color: #ffffff;
    background: var(--primary);
    border: 1px solid var(--primary);
}

.legal-modal-cancel {
    color: #0b1c30;
    background: #e8f6fb;
    border: 1px solid #cce4ee;
}

.google-login-card {
    display: grid;
    gap: 18px;
    max-width: 560px;
}

.google-login-button {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(15,23,42,0.08);
}

.google-login-button span {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #4285f4;
    border-radius: 50%;
    font-weight: 900;
}

/* ==============================================
   STATIC SEO PAGES
   ============================================== */
.seo-page {
    min-height: 100vh;
    background: #f8f9ff;
    color: #0b1c30;
}

.seo-page-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255,255,255,0.86);
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(16px);
}

.seo-nav {
    display: flex;
    max-width: 1160px;
    height: 68px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.seo-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0b1c30;
    font-size: 20px;
    font-weight: 900;
}

.seo-brand-mark {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--primary);
    border-radius: 10px;
}

.seo-links {
    display: flex;
    align-items: center;
    gap: 22px;
    color: #475569;
    font-weight: 750;
}

.seo-links a:hover {
    color: var(--primary);
}

.seo-cta {
    padding: 10px 16px;
    color: #ffffff !important;
    background: var(--primary);
    border-radius: 999px;
}

.seo-hero,
.seo-content,
.seo-footer {
    max-width: 1160px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.seo-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 76px;
    padding-bottom: 42px;
    align-items: center;
}

.seo-breadcrumb {
    margin-bottom: 18px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.seo-hero h1 {
    max-width: 100%;
    margin-bottom: 20px;
    font-size: clamp(36px, 7vw, 64px);
    line-height: 0.98;
    letter-spacing: -0.055em;
    font-weight: 900;
}

.seo-hero p {
    max-width: 100%;
    color: #475569;
    font-size: 19px;
    line-height: 1.75;
}

.seo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.seo-actions a,
.seo-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 900;
}

.seo-action-primary {
    color: #ffffff;
    background: var(--primary);
}

.seo-action-secondary {
    color: var(--primary);
    background: #e8f6fb;
}

.seo-actions button {
    cursor: pointer;
}

.seo-upload-input {
    display: none;
}

.seo-upload-status {
    margin-top: 14px;
    color: #355c6d;
    font-size: 14px;
    font-weight: 700;
}

.seo-upload-status.is-error {
    color: #b91c1c;
}



.seo-content {
    display: grid;
    gap: 26px;
    padding-bottom: 54px;
}

.seo-block {
    padding: 34px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 26px;
}

.seo-block h2 {
    margin-bottom: 14px;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.12;
    letter-spacing: -0.035em;
    font-weight: 900;
}

.seo-block h3 {
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 900;
}

.seo-block p,
.seo-block li {
    color: #475569;
    font-size: 16px;
    line-height: 1.75;
}

.seo-block ul,
.seo-block ol {
    display: grid;
    gap: 10px;
    padding-left: 22px;
}

.seo-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.seo-card {
    padding: 22px;
    background: #ffffff;
    border: 1px solid #d8e6f4;
    border-radius: 20px;
}

.seo-ad {
    min-height: 118px;
}

.seo-related {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.seo-related a {
    padding: 11px 14px;
    color: var(--primary);
    background: #e8f6fb;
    border-radius: 999px;
    font-weight: 850;
}

.seo-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-top: 30px;
    padding-bottom: 34px;
    color: #475569;
    border-top: 1px solid #d8e6f4;
}

.seo-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
}

.seo-footer a {
    color: #334155;
    font-weight: 750;
}

.tool-runner {
    display: grid;
    gap: 18px;
    padding: 26px;
    background: #ffffff;
    border: 1px solid #d8e6f4;
    border-radius: 24px;
    box-shadow: 0 16px 42px rgba(15,23,42,0.08);
}

.seo-hero-copy {
    min-width: 0;
}

.tool-runner-hero {
    margin-top: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    gap: 12px;
}

.tool-top-actions {
    margin-top: 0;
}

.tool-page-ad-stack {
    display: grid;
    gap: 14px;
}

.tool-page-ad-stack .ad-slot {
    min-height: 116px;
}

.tool-file {
    width: 100%;
    padding: 18px;
    color: #334155;
    background: #f8fbff;
    border: 2px dashed #bdd7e6;
    border-radius: 18px;
    font-weight: 800;
}

.tool-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.tool-browse-button {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 15px 22px;
    color: #ffffff;
    background: var(--primary);
    border-radius: 999px;
    font-weight: 900;
    box-shadow: 0 14px 28px rgba(0,102,134,0.18);
}

.tool-file-meta {
    color: #355c6d;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.65;
}

.tool-runner-hero .tool-file-meta {
    margin-top: 2px;
}

.tool-field {
    display: grid;
    gap: 8px;
    color: #475569;
    font-weight: 850;
}

.tool-field input,
.tool-field select {
    width: 100%;
    padding: 13px 14px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    font: inherit;
}

.tool-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tool-action {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    color: #ffffff;
    background: var(--primary);
    border-radius: 999px;
    font-weight: 900;
    box-shadow: 0 14px 28px rgba(0,102,134,0.18);
}

.tool-runner-hero .tool-action {
    background: #e8f6fb;
    color: var(--primary);
    box-shadow: none;
    border: 1px solid #cce4ee;
}

.tool-runner-hero #tool-extra {
    display: grid;
    gap: 12px;
    max-width: 620px;
}

.tool-status:empty,
.tool-output:empty {
    display: none;
}

.tool-action:disabled {
    cursor: wait;
    opacity: 0.6;
}

.tool-status,
.tool-hint,
.tool-output {
    color: #475569;
    line-height: 1.65;
}

.tool-status {
    min-height: 24px;
    font-weight: 850;
}

.tool-status.is-error {
    color: #be123c;
}

.tool-output {
    padding: 14px 16px;
    background: #eef7fb;
    border: 1px solid #cce4ee;
    border-radius: 16px;
}

.tool-page-shell {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 200px;
    gap: 24px;
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 20px 32px;
    align-items: stretch;
}

.tool-page-main {
    min-width: 0;
}

.tool-side-rail {
    display: grid;
    grid-template-rows: repeat(4, minmax(220px, 1fr));
    gap: 18px;
    padding-top: 84px;
    align-self: stretch;
    min-height: 100%;
}

.tool-side-ad {
    min-height: 0;
    height: 100%;
}

.tool-footer-ad {
    justify-self: center;
    width: min(100%, 760px);
    min-height: 126px;
}

@media (max-width: 1200px) {
    .site-main-nav {
        flex-wrap: wrap;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .site-nav-links {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .site-tools-panel {
        top: 82px;
        left: 50%;
        width: min(1040px, calc(100vw - 32px));
        transform: translateX(-50%);
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .tool-grid,
    .seo-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-page-shell,
    .split-section,
    .privacy-section,
    .site-footer,
    .seo-hero {
        grid-template-columns: 1fr;
    }

    .tool-side-rail {
        display: none;
    }



    .seo-links {
        gap: 12px;
        font-size: 13px;
    }

    .site-tools-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .home-section {
        margin-top: 42px;
        padding: 28px 20px;
        border-radius: 22px;
    }

    .tool-grid,
    .benefit-grid,
    .compare-grid,
    .seo-card-grid,
    .menu-action-grid,
    .tool-grid-2 {
        grid-template-columns: 1fr;
    }

    .privacy-section a,
    .final-cta a {
        justify-content: center;
        width: 100%;
    }

    .site-footer,
    .site-footer nav,
    .seo-footer,
    .seo-footer nav {
        display: grid;
        justify-content: stretch;
        text-align: left;
    }

    .site-main-nav {
        align-items: stretch;
    }

    .site-nav-actions {
        width: 100%;
        justify-content: space-between;
    }

    .site-language {
        min-width: 0;
        flex: 1;
    }

    .site-tools-panel,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .menu-link-grid {
        grid-template-columns: 1fr;
    }

    .site-tools-panel {
        top: 118px;
        max-height: calc(100vh - 136px);
        padding: 18px;
        border-radius: 20px;
    }

    .site-language-menu > summary {
        width: 100%;
        justify-content: center;
    }

    .site-language-panel {
        left: 0;
        right: auto;
        width: 100%;
    }

    .legal-modal-card {
        padding: 22px;
    }

    .legal-modal-card p {
        font-size: 15px;
    }

    .seo-nav {
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
        flex-wrap: wrap;
    }

    .seo-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .seo-hero {
        padding-top: 42px;
    }

    .seo-block {
        padding: 24px;
    }
}

.find-replace-modal {
    overflow: visible !important;
}

/* User is Pro - Hide all Ads */
.user-is-pro .ad-slot,
.user-is-pro .editor-ad-rail,
.user-is-pro .tool-side-rail,
.user-is-pro .preview-side-rail,
.user-is-pro .home-ad-wrap {
    display: none !important;
}
.user-is-pro #canvas-area {
    padding-left: 24px !important;
    padding-right: 24px !important;
}
.user-is-pro .tool-page-shell {
    grid-template-columns: 1fr !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}
.user-is-pro .tool-page-main {
    max-width: 1000px !important;
    margin: 0 auto !important;
}