@font-face {
    font-family: 'Dancing Script';
    src: url('dancing-script.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Caveat';
    src: url('caveat.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f6f8fb;
    color: #1a1a1a;
    overflow-x: hidden;
}

/* Rounder, more characterful display type for headings sitewide -- a system
   font stack (no new asset to vendor/host), gracefully falls back to bold
   system-ui on platforms without a rounded face available. */
h1, h2, .tool-tile-card h3 {
    font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
}

/* Dark Premium Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #0f172a;
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    gap: 12px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-container {
    background: #fff7ed;
    padding: 10px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
    flex-shrink: 0;
}

.site-logo-text {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
    line-height: 1.15;
}

.site-logo-text span {
    display: block;
    color: #38bdf8;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-top: 1px;
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.secure-tag {
    background: #14532d;
    color: #4ade80;
    padding: 7px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid #166534;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

.secure-tag svg {
    flex-shrink: 0;
}

.secure-tag-text {
    text-align: left;
    line-height: 1.3;
}

.secure-tag span {
    display: block;
    font-size: 0.62rem;
    color: #86efac;
    font-weight: 400;
    letter-spacing: 0.3px;
}

@media (max-width: 640px) {
    header {
        padding: 12px 16px;
        gap: 10px;
    }
    .logo-container {
        padding: 6px;
    }
    .logo-container svg {
        width: 32px;
        height: 32px;
    }
    .site-logo-text {
        font-size: 1.5rem;
    }
    .site-logo-text span {
        font-size: 0.72rem;
    }
    .secure-tag {
        padding: 5px 10px;
        font-size: 0.66rem;
        gap: 5px;
    }
    .secure-tag svg {
        width: 12px;
        height: 12px;
    }
    .secure-tag span {
        display: none;
    }
}

/* Sponsored Ads Header Box
   Currently OFF (no AdSense approval yet): min-height, background, and
   border are commented out so this div takes up zero space and renders
   nothing. Once AdSense is approved and real ad code is placed inside
   the .adsense-top-banner div, uncomment the four lines below to restore
   the placeholder box's sizing/appearance for the real ad unit. */
.adsense-top-banner {
    width: calc(100% - 40px);
    max-width: 1200px;
    /* min-height: 120px; */
    margin: 24px auto;
    /* background: #f1f5f9; */
    /* border: 2px dashed #cbd5e1; */
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
    contain: layout size style;
}

/* Main Core Container */
main.workspace-container {
    width: calc(100% - 40px);
    max-width: 1200px;
    margin: 0 auto 40px auto;
    padding: 10px 24px 30px 24px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 30px rgba(15, 23, 42, 0.04);
}

.section-container {
    margin-top: 40px;
}

/* Top-level format tabs (All / PDF / Image / Video / Audio / Calculators /
   Other) -- the primary, TinyWow-style entry point for browsing by file
   type, sitting above everything else including the search box. This is a
   different axis than the functional category pills below it (which group
   by what a tool DOES -- merge, compress, sign -- not by file format), so
   both stay: this row answers "what kind of file am I starting from",
   the pill row answers "what do I want to do to it". */
.format-tab-row {
    width: calc(100% - 40px);
    max-width: 1200px;
    margin: 0 auto 14px auto;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.format-tab {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.format-tab-icon { font-size: 1.15rem; line-height: 1; }
.format-tab:hover {
    border-color: var(--tab-color, #0f172a);
    transform: translateY(-1px);
}
.format-tab.active {
    background: var(--tab-color, #0f172a);
    border-color: var(--tab-color, #0f172a);
    color: #ffffff;
}
@media (max-width: 640px) {
    .format-tab {
        padding: 10px 14px;
        font-size: 0.82rem;
        border-radius: 12px;
    }
}
[data-theme="dark"] .format-tab {
    background: #1a2332;
    border-color: #2d3b52;
    color: #cbd5e1;
}
[data-theme="dark"] .format-tab.active {
    background: var(--tab-color, #0f172a);
    border-color: var(--tab-color, #0f172a);
    color: #ffffff;
}

/* Quick-access panel: search + category pills, sitting between the hero and
   the tool listing. Exists because on mobile the full listing runs to
   roughly 14,000px of scroll with no way to jump around it — this gives a
   one-tap or one-keystroke path to any tool without scrolling at all. */
.quick-access-panel {
    width: calc(100% - 40px);
    max-width: 1200px;
    margin: 0 auto 8px auto;
}

.quick-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 999px;
    padding: 13px 18px;
    margin-bottom: 14px;
    box-shadow: 4px 4px 0 #f97316;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.quick-search-box:focus-within {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #f97316;
}
.quick-search-icon { color: #94a3b8; flex-shrink: 0; }
.quick-search-input {
    border: none;
    outline: none;
    background: transparent;
    color: #1a1a1a;
    font-size: 0.98rem;
    width: 100%;
    font-family: inherit;
}
.quick-search-input::placeholder { color: #94a3b8; }
.quick-search-clear {
    display: none;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}
.quick-search-box.has-value .quick-search-clear { display: flex; }

.category-pill-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 8px;
    scrollbar-width: thin;
}
.category-pill {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-weight: 700;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}
.category-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pill-color, #f97316); flex-shrink: 0; }
.category-pill:hover { border-color: var(--pill-color, #cbd5e1); }
.category-pill.active {
    background: var(--pill-color, #f97316);
    border-color: var(--pill-color, #f97316);
    color: #ffffff;
}
.category-pill.active .dot { background: #ffffff; }

.browse-all-cta {
    display: flex;
    justify-content: center;
    margin: 8px 0 32px;
}
.browse-all-cta button {
    background: none;
    border: 2px dashed #cbd5e1;
    border-radius: 999px;
    padding: 12px 26px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.browse-all-cta button:hover {
    border-color: #f97316;
    color: #f97316;
    transform: translateY(-1px);
}
[data-theme="dark"] .browse-all-cta button {
    border-color: #2d3b52;
    color: #94a3b8;
}
[data-theme="dark"] .browse-all-cta button:hover {
    border-color: #fb923c;
    color: #fb923c;
}

.no-search-results {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 0.95rem;
}
.no-search-results.visible { display: block; }

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
    /* A thin colored bar identifying each category at a glance, so the pill
       you tapped and the section you land on visually match. */
    border-left: 4px solid var(--cat-color, transparent);
    padding-left: 14px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.tools-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Premium Bulk Component Tiles */
.tool-tile-card {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;

    content-visibility: auto;
    contain-intrinsic-size: auto 220px;
    will-change: transform, opacity;
    transform: translateZ(0);

    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.2s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 0.2s ease;
}

.tool-tile-card:hover {
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    border-color: #cbd5e1;
}

/* Privacy micro-badge on every homepage tool tile -- scoped to the homepage's
   own tool grid (not styles.css's global .tool-tile-card, which blog.php also
   reuses for post tiles, where "0 uploads" wouldn't mean anything). A single
   CSS rule rather than editing 60+ individual tile blocks, since the claim is
   uniformly true for every tool on this grid -- see the redesign study for
   why this needs to be visible at the point of choosing a tool, not just on
   a separate Transparency page. */
#toolsDirectoryGrid .tool-tile-card {
    position: relative;
}
/* Flows as the last item in the card's own flex column (below the
   description), NOT absolutely positioned -- the top-right corner is now
   claimed by the dog-ear fold below, so this needed to move rather than
   risk the two overlapping on cards with a longer description. */
#toolsDirectoryGrid .tool-tile-card::after {
    content: "🔒 0 uploads";
    display: inline-flex;
    align-self: flex-start;
    margin-top: 10px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #15803d;
    background: rgba(255, 255, 255, 0.92);
    padding: 3px 8px;
    border-radius: 999px;
    pointer-events: none;
}
@media (max-width: 640px) {
    #toolsDirectoryGrid .tool-tile-card::after {
        font-size: 0.58rem;
        padding: 2px 6px;
        margin-top: 6px;
    }
}

/* ---- Dog-ear fold + category-colored top stripe (homepage tool grid) ----
   The fold color is derived from each tile's EXISTING bg-* icon-wrapper
   class via :has(), so none of the 60+ individual tile blocks need editing
   -- the category color already lives in the markup, this just reads it. */
#toolsDirectoryGrid .tool-tile-card:has(.bg-blue)   { --c: #2563eb; }
#toolsDirectoryGrid .tool-tile-card:has(.bg-red)    { --c: #dc2626; }
#toolsDirectoryGrid .tool-tile-card:has(.bg-purple) { --c: #7c3aed; }
#toolsDirectoryGrid .tool-tile-card:has(.bg-green)  { --c: #16a34a; }
#toolsDirectoryGrid .tool-tile-card:has(.bg-orange) { --c: #ea580c; }
#toolsDirectoryGrid .tool-tile-card:has(.bg-cyan)   { --c: #0891b2; }
#toolsDirectoryGrid .tool-tile-card:has(.bg-amber)  { --c: #d97706; }
#toolsDirectoryGrid .tool-tile-card:has(.bg-pink)   { --c: #db2777; }

/* The tile carries a soft pastel wash of its category color -- derived from
   the same --c the bold version used, just mixed way down with white --
   rather than the full-saturation block, which read as too loud. Still a
   colored tile, not a white card, just toned down. */
#toolsDirectoryGrid .tool-tile-card {
    background: color-mix(in srgb, var(--c, #f97316) 14%, white);
    border: 1.5px solid color-mix(in srgb, var(--c, #f97316) 30%, white);
    overflow: hidden;
    color: #0f172a;
}
#toolsDirectoryGrid .tool-tile-card:hover {
    border-color: color-mix(in srgb, var(--c, #f97316) 55%, white);
    box-shadow: 0 14px 26px -10px color-mix(in srgb, var(--c, #f97316) 45%, transparent);
}
#toolsDirectoryGrid .tool-tile-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, transparent 50%, var(--c, #f97316) 50%);
    opacity: 0.55;
    box-shadow: -2px 2px 3px rgba(15, 23, 42, 0.1);
    pointer-events: none;
}

/* Icon and its optional "BULK BATCH" badge sit side by side in one row, so
   badge-having and badge-free cards line up identically below this point —
   previously the badge floated absolute in the corner, which looked
   inconsistent from card to card in the same grid row. */
.tool-icon-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bulk-badge {
    background: #fff1f2;
    color: #f43f5e;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    border: 1px solid #fecdd3;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
/* On the solid-color homepage tiles, a rose badge on a rose/red/etc. tile
   can disappear -- swap to a frosted white pill so it reads on every
   category color. */
#toolsDirectoryGrid .tool-tile-card .bulk-badge {
    background: rgba(255, 255, 255, 0.92);
    color: #e11d48;
    border-color: rgba(255, 255, 255, 0.6);
}

.tool-icon-wrapper {
    width: 64px;
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 18px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.tool-tile-card:hover .tool-icon-wrapper {
    transform: scale(1.06) rotate(-2deg);
}
.tool-icon-wrapper svg { width: 26px; height: 26px; }

/* Bold, saturated icon backgrounds with a soft matching glow -- the earlier
   near-white tints (#eff6ff etc.) read as flat/washed out next to the SVG's
   own fully-saturated stroke color. This is what actually gives the grid
   visual energy instead of a wall of identical pale-gray cards. */
.bg-blue   { background: #dbeafe; box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.35); }
.bg-purple { background: #ede9fe; box-shadow: 0 6px 16px -4px rgba(124, 58, 237, 0.35); }
.bg-orange { background: #ffedd5; box-shadow: 0 6px 16px -4px rgba(234, 88, 12, 0.35); }
.bg-green  { background: #dcfce7; box-shadow: 0 6px 16px -4px rgba(22, 163, 74, 0.35); }
.bg-red    { background: #fee2e2; box-shadow: 0 6px 16px -4px rgba(220, 38, 38, 0.35); }
.bg-cyan   { background: #cffafe; box-shadow: 0 6px 16px -4px rgba(8, 145, 178, 0.35); }
.bg-amber  { background: #fef3c7; box-shadow: 0 6px 16px -4px rgba(217, 119, 6, 0.35); }
.bg-pink   { background: #fce7f3; box-shadow: 0 6px 16px -4px rgba(219, 39, 119, 0.35); }

.tool-icon-wrapper svg {
    width: 28px;
    height: 28px;
    pointer-events: none;
}

/* Icon chip becomes a frosted-white circle on the solid-color tiles -- the
   per-category .bg-* pale tints above are for contexts still on a white
   card (e.g. blog.php); here the whole tile already carries that color, so
   the chip needs to be light instead, for the icon to read against it. */
#toolsDirectoryGrid .tool-tile-card .tool-icon-wrapper {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.tool-tile-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
    line-height: 1.3;
}

#toolsDirectoryGrid .tool-tile-card h3 { color: #0f172a; }

.tool-tile-card p {
    font-size: 0.92rem;
    color: #64748b;
    line-height: 1.45;
}

#toolsDirectoryGrid .tool-tile-card p { color: #475569; }

/* Dense 2-column grid on mobile, matching the approved design — the default
   auto-fill(minmax(300px,1fr)) grid above collapses to a single column
   below ~640px, which is exactly the "have to scroll a lot" problem this
   redesign exists to fix. Card padding, icon size, and type scale all shrink
   to fit two per row; the bulk-badge sits beside the icon in the same
   .tool-icon-row (wrapping onto its own line if a card is too narrow to fit
   both side by side), same as the desktop layout. */
@media (max-width: 640px) {
    .tools-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .tool-tile-card {
        padding: 12px;
        border-radius: 14px;
    }
    .tool-icon-row {
        gap: 6px;
        margin-bottom: 8px;
        flex-wrap: nowrap;
    }
    .tool-icon-wrapper {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        flex-shrink: 0;
    }
    .tool-icon-wrapper svg {
        width: 17px;
        height: 17px;
    }
    .tool-tile-card h3 {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    .tool-tile-card p {
        font-size: 0.72rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .bulk-badge {
        font-size: 0.52rem;
        padding: 3px 6px;
        letter-spacing: 0.1px;
    }
}

/* PREMIUM DYNAMIC CONFIGURATION OVERLAY MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    /* Mobile Safari has a long-standing bug where full-screen position:fixed
       elements (especially ones with backdrop-filter) vanish or stop
       repainting during scroll/momentum unless promoted to their own GPU
       compositing layer. This is the same fix already proven necessary for
       Tom (the removed mascot) -- every tool's modal uses this exact class,
       which is why the symptom showed up "on most tools" rather than one. */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
}

.modal-overlay.active .modal-window {
    transform: scale(1);
}

.modal-window h4 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #0f172a;
}

.modal-window p {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.format-select-dropdown {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

/* Metadata/privacy report rows -- shared by the Photo Metadata Remover and
   the cross-format Privacy Report modal. A row gets .exif-sensitive when the
   field is the kind of thing someone specifically wouldn't want tied to an
   ad profile (GPS location, author/company name) -- everything else (camera
   model, dates) is informational but not flagged as urgent. */
.exif-report-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.exif-report-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
}
.exif-report-row.exif-sensitive {
    background: #fef2f2;
    border-color: #fecaca;
}
.exif-report-label {
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}
.exif-report-row.exif-sensitive .exif-report-label {
    color: #b91c1c;
}
.exif-report-value {
    color: #1e293b;
    text-align: right;
    word-break: break-word;
}
.exif-report-clean {
    color: #16a34a;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    padding: 12px 0;
    margin: 0;
}

.format-select-dropdown:focus {
    border-color: #38bdf8;
}

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

.btn {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-convert {
    background: #f97316;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.btn-convert:hover {
    background: #ea580c;
}

#bulkFileEngineInput {
    display: none;
}

/* Loading Spinner Overlay Styling */
.processing-spinner-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    /* Same Mobile Safari fixed+backdrop-filter vanish-on-scroll bug as
       .modal-overlay above -- see that comment for the full explanation. */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.processing-spinner-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    border-top-color: #f97316;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.local-lock-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    font-size: 0.85rem;
    font-weight: 600;
    color: #86efac;
}

.lock-shackle {
    transform-origin: 12px 11px;
    transform: rotate(-25deg) translateY(-2px);
    opacity: 0.5;
}

.processing-spinner-overlay.active .lock-shackle {
    animation: lockShackleClose 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes lockShackleClose {
    0% { transform: rotate(-25deg) translateY(-2px); opacity: 0.5; }
    100% { transform: rotate(0deg) translateY(0); opacity: 1; }
}

/* Mega PDF Editor grid */
.mega-editor-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    min-height: 220px;
}
.mega-page-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 8px;
    cursor: grab;
    text-align: center;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.mega-page-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.mega-page-card.dragging {
    opacity: 0.35;
}
.mega-page-thumb {
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
    margin-bottom: 6px;
    background: #ffffff;
}
.mega-page-thumb img {
    width: 100%;
    display: block;
}
.mega-page-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}
.mega-page-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
}
.mega-page-actions button {
    flex: 1;
    padding: 5px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.85rem;
}
.mega-page-actions button:hover {
    background: #eef2f7;
}
.mega-page-actions button.delete-btn {
    border-color: #fecdd3;
    background: #fef2f2;
    color: #dc2626;
}
.mega-page-actions button.delete-btn:hover {
    background: #fee2e2;
}

/* ============================================
   Tier 2: Signature tabs, watermark controls, form filling
   ============================================ */
.sig-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
.sig-tab {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.88rem;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}
.sig-tab:hover {
    color: #475569;
}
.sig-tab.active {
    color: #f97316;
    border-bottom-color: #f97316;
}
.sig-label-small {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sig-color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1;
    cursor: pointer;
}
.sig-style-btn {
    flex: 1;
    padding: 14px 8px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    color: #0f172a;
    transition: all 0.15s ease;
}
.sig-style-btn.active {
    border-color: #f97316;
    background: #fff7ed;
}
.sig-preview-box {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 16px;
    color: #94a3b8;
    font-size: 0.85rem;
    text-align: center;
}
.sig-preview-box img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.wm-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
.wm-color-swatch {
    width: 42px;
    height: 34px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    padding: 0;
}
.wm-color-swatch.active {
    border-color: #f97316;
}
.wm-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.wm-slider-row input[type="range"] {
    flex: 1;
}
.wm-slider-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    min-width: 42px;
    text-align: right;
}
.wm-position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.wm-position-btn {
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}
.wm-position-btn.active {
    border-color: #f97316;
    background: #fff7ed;
    color: #ea580c;
}
/* Pages Per Sheet's N-up preset row — bigger tap targets than .wm-position-btn
   on purpose (min 48px tall), since this is the primary choice on a page this
   tool is explicitly meant to work well on a phone. */
.pps-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.pps-preset-btn {
    flex: 1;
    min-width: 56px;
    min-height: 48px;
    padding: 10px 6px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 800;
    color: #475569;
}
.pps-preset-btn.active {
    border-color: #f97316;
    background: #fff7ed;
    color: #ea580c;
}
.pps-preview-wrap {
    display: flex;
    justify-content: center;
    padding: 12px 0;
}
#pagesPerSheetPreviewCanvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 1px 6px rgba(0,0,0,0.15);
}
.wm-preview-box {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: repeating-conic-gradient(#f1f5f9 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
    height: 160px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}
.wm-preview-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 800;
    color: #64748b;
    white-space: nowrap;
    pointer-events: none;
}
.wm-preview-content img {
    max-width: 140px;
    max-height: 100px;
    display: block;
}

/* Financial calculator pages: a two-column input/result layout used by all
   six calculators (loan, debt payoff, compound interest, net worth, budget,
   paycheck) in place of the usual file-upload hero. */
.calc-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
    max-width: 1000px;
    margin: 32px auto 0;
    padding: 0 20px;
}
@media (max-width: 800px) {
    .calc-hero { grid-template-columns: 1fr; }
}
.calc-input-panel, .calc-result-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
}
.calc-input-panel h2, .calc-result-panel h2 {
    font-size: 1rem;
    margin: 0 0 16px;
    color: #1e293b;
}
.calc-input-row {
    margin-bottom: 16px;
}
.calc-input-row label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}
.calc-input-row input[type="number"],
.calc-input-row input[type="text"],
.calc-input-row select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 0.95rem;
    box-sizing: border-box;
}
.calc-result-headline {
    font-size: 2.1rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 14px;
}
.calc-result-unit {
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    margin-left: 4px;
}
.calc-result-headline.calc-positive { color: #16a34a; }
.calc-result-headline.calc-negative { color: #dc2626; }
.calc-result-subrow {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #475569;
}
.calc-result-subrow.calc-result-total {
    font-weight: 700;
    color: #1e293b;
}
.calc-result-placeholder {
    color: #94a3b8;
    font-size: 0.9rem;
}
.calc-result-note {
    margin-top: 14px;
    font-size: 0.85rem;
    color: #16a34a;
    font-weight: 700;
}
.calc-result-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 500px) {
    .calc-result-compare { grid-template-columns: 1fr; }
}
.calc-result-subcard {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
}
.calc-result-subcard h4 {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: #1e293b;
}
.calc-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 16px;
}
.calc-result-table th, .calc-result-table td {
    text-align: right;
    padding: 6px 8px;
    border-bottom: 1px solid #f1f5f9;
}
.calc-result-table th:first-child, .calc-result-table td:first-child {
    text-align: left;
}
.calc-result-table thead th {
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.calc-bar-chart {
    display: flex;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
}
.calc-bar-segment { height: 100%; }
.calc-bar-needs { background: #4f46e5; }
.calc-bar-wants { background: #818cf8; }
.calc-bar-savings { background: #c7d2fe; }
.calc-debt-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.8fr 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
@media (max-width: 600px) {
    .calc-debt-row { grid-template-columns: 1fr 1fr; }
}
.calc-debt-row input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}
.calc-debt-remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px 8px;
}
/* NPV's cash-flow rows: just a year label + one amount field, so this gets its
   own lighter 3-column grid rather than reusing .calc-debt-row's 5-column one
   (which is tuned for the debt calculator's 4 input fields + remove button). */
.calc-cashflow-row {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.calc-cashflow-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
}
.calc-cashflow-row input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}
.calc-add-row-btn {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    width: 100%;
    color: #475569;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 16px;
}

/* PDF Mail Merge: field <-> CSV-column mapping table and generation progress bar. */
.mail-merge-mapping-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
}
.mail-merge-field-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}
.mail-merge-mapping-row select {
    max-width: 180px;
}
.mail-merge-progress-bar-track {
    height: 10px;
    border-radius: 6px;
    background: #e2e8f0;
    overflow: hidden;
    margin: 10px 0;
}
.mail-merge-progress-bar-fill {
    height: 100%;
    background: #4f46e5;
    width: 0%;
    transition: width 0.2s ease;
}

/* Portal Prep-Suite: pass/fail checklist rows, adapting the tint pattern
   already established by .exif-report-row/.exif-sensitive. */
.prep-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
}
.prep-check-row.prep-pass {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.prep-check-row.prep-fail {
    background: #fef2f2;
    border-color: #fecaca;
}
.prep-check-icon {
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}
.prep-pass .prep-check-icon {
    color: #16a34a;
}
.prep-fail .prep-check-icon {
    color: #b91c1c;
}
.prep-check-label {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}
.prep-check-detail {
    font-size: 0.78rem;
    color: #64748b;
    text-align: right;
}

/* Auto-Redact PII scrubber reuses .prep-check-row wholesale, swapping the
   pass/fail icon slot for a checkbox. */
.prep-check-row input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-fields-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 2px;
}
.form-field-row label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}
.form-field-row .field-type-tag {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    margin-left: 6px;
}

/* ============================================
   QR Code Generator Studio
   ============================================ */
.qr-studio-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 40px 24px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 28px;
    align-items: start;
    text-align: left;
}
@media (max-width: 860px) {
    .qr-studio-layout {
        grid-template-columns: 1fr;
    }
}
.qr-studio-right {
    position: sticky;
    top: 20px;
}
.qr-type-category-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 14px 0 8px 0;
}
.qr-type-category-label:first-child {
    margin-top: 0;
}
.qr-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
    margin-bottom: 4px;
}
.qr-type-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
    text-align: center;
}
.qr-type-card:hover {
    border-color: #cbd5e1;
}
/* A subtle border/background swap alone is easy to miss on a small screen,
   especially since the QR preview sits below the fold on mobile and can't
   confirm the tap for you — the badge + shadow make selection unmistakable
   without needing to scroll down and check. */
.qr-type-card.active {
    border-color: #f97316;
    background: #fff7ed;
    color: #ea580c;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16), 0 6px 14px rgba(249, 115, 22, 0.22);
    transform: translateY(-1px);
}
.qr-type-card.active::after {
    content: "\2713";
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f97316;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.25);
}
.qr-type-icon {
    display: flex;
}
/* Every content-type icon — whether a line-art glyph or a social-network
   monogram — renders inside this same solid-color badge so the gallery reads
   as one consistent icon set instead of a mix of outline and filled styles. */
.qr-type-badge {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.qr-type-badge svg {
    width: 19px;
    height: 19px;
}
.qr-type-monogram-text {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: -0.2px;
}
.qr-content-form {
    margin: 16px 0 20px 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
}
.qr-style-panel {
    padding: 14px 2px 4px 2px;
}
.qr-theme-presets-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.qr-theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.qr-theme-swatch-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    display: block;
}
.qr-theme-swatch:hover .qr-theme-swatch-color {
    border-color: #f97316;
}
.qr-theme-swatch-label {
    font-size: 0.62rem;
    color: #64748b;
    font-weight: 700;
}
.qr-preview-box {
    display: flex;
    align-items: center;
    justify-content: center;
    /* .wm-preview-box (shared base) sets a fixed height:160px with overflow:hidden
       — min-height alone can't grow past that, so taller renders (a circle frame
       with a caption, for instance) would get clipped without this override. */
    height: auto;
    min-height: 280px;
    overflow: visible;
    padding: 20px;
}
.qr-scannability-meter {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    margin: 12px 0;
    padding: 0 10px;
}
.qr-export-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}
.qr-export-row .btn {
    flex: 1;
    min-width: 120px;
}
[data-theme="dark"] .qr-type-card {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .qr-content-form {
    background: #1a2332;
    border-color: #334155;
}
.form-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.redaction-page-container {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: auto;
    background: #f1f5f9;
    flex: 1;
    min-height: 300px;
    max-height: 55vh;
    touch-action: none;
    cursor: crosshair;
    text-align: center;
}
.redaction-page-container img {
    display: block;
    user-select: none;
    pointer-events: none;
}
.redaction-marks-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.redaction-mark-box {
    position: absolute;
    background: rgba(15, 23, 42, 0.75);
    border: 2px solid #0f172a;
    box-sizing: border-box;
}
.redaction-nav-btn {
    padding: 8px 16px;
}

/* Annotate & Markup PDF -- highlight/underline live-preview boxes reuse the same
   translucent-div-over-the-page-image approach as .redaction-mark-box, just with
   colors the user picks instead of a fixed opaque black. Ink strokes render on a
   separate SVG layer (see annotateInkOverlay in the modal markup), not here. */
.annotate-tool-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}
.annotate-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
}
.annotate-tool-btn span { font-size: 1.1rem; }
.annotate-tool-btn.active {
    background: #fff7ed;
    border-color: #f97316;
    color: #ea580c;
}
.annotate-highlight-mark {
    position: absolute;
    box-sizing: border-box;
    opacity: 0.45;
    pointer-events: none;
}
.annotate-underline-mark {
    position: absolute;
    box-sizing: border-box;
    opacity: 0.9;
    pointer-events: none;
    /* Rendered as a full box during dragging for a visible live target, but only
       the bottom sliver actually becomes the annotation on export -- matches how
       the real PDF underline appearance stream only draws a thin line, not a fill. */
    clip-path: polygon(0 85%, 100% 85%, 100% 100%, 0 100%);
}
.annotate-note-icon {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid rgba(15, 23, 42, 0.25);
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.annotate-note-input-box {
    position: absolute;
    z-index: 10;
    background: #fff;
    border: 2px solid #f97316;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    width: 200px;
}
.annotate-note-input-box textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
}

/* ============================================
   NEW: Individual Tool Landing Page Content
   (breadcrumb, hero, how-it-works, FAQ, related tools)
   ============================================ */

.breadcrumb-nav {
    max-width: 900px;
    margin: 20px auto 0 auto;
    padding: 0 24px;
    font-size: 0.85rem;
    color: #64748b;
}
.breadcrumb-nav a {
    color: #64748b;
    text-decoration: none;
}
.breadcrumb-nav a:hover {
    color: #f97316;
}

.tool-page-hero {
    max-width: 900px;
    margin: 16px auto 0 auto;
    padding: 0 24px;
    text-align: center;
}
.tool-page-hero h1 {
    font-size: 2.1rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
    line-height: 1.2;
}
.tool-intro {
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.6;
    max-width: 640px;
    margin: 0 auto 28px auto;
}

.tool-cta-button {
    display: inline-block;
    background: #f97316;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 16px 36px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
    transition: all 0.2s ease;
}
.tool-cta-button:hover {
    background: #ea580c;
    transform: translateY(-2px);
}
.tool-cta-subtext {
    display: block;
    margin-top: 14px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.how-it-works {
    max-width: 900px;
    margin: 56px auto 0 auto;
    padding: 0 24px;
}
.how-it-works h2,
.faq-section h2,
.related-tools h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 20px;
    text-align: center;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.step-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px;
}
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff7ed;
    color: #f97316;
    font-weight: 800;
    border-radius: 50%;
    margin-bottom: 12px;
}
.step-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}
.step-card p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

.faq-section {
    max-width: 800px;
    margin: 56px auto 0 auto;
    padding: 0 24px;
}
.faq-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 18px 0;
}
.faq-item h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}
.faq-item p {
    font-size: 0.92rem;
    color: #64748b;
    line-height: 1.6;
}

.related-tools {
    max-width: 900px;
    margin: 56px auto 60px auto;
    padding: 0 24px;
}
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.related-tool-link {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}
.related-tool-link:hover {
    border-color: #f97316;
    color: #f97316;
    transform: translateY(-2px);
}

/* ============================================
   Site footer navigation (Privacy / About / Contact)
   ============================================ */
.homepage-trust-strip {
    background: #0f172a;
    color: #cbd5e1;
    margin-top: 48px;
    padding: 44px 24px;
}
.homepage-trust-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.homepage-trust-inner h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 10px;
}
.homepage-trust-inner > p {
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto 26px;
    font-size: 0.95rem;
    line-height: 1.55;
}
.homepage-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    text-align: left;
}
.homepage-trust-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 18px;
}
.homepage-trust-card h3 {
    font-size: 0.92rem;
    color: #fb923c;
    margin-bottom: 6px;
}
.homepage-trust-card p {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}
@media (max-width: 680px) {
    .homepage-trust-grid { grid-template-columns: 1fr; }
}

.site-footer {
    max-width: 1200px;
    margin: 40px auto 0 auto;
    padding: 28px 24px 40px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #94a3b8;
}
.site-footer-links {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
.site-footer-links a {
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
}
.site-footer-links a:hover {
    color: #f97316;
}

/* ============================================
   Long-form content pages (Privacy Policy, About, Contact)
   ============================================ */
.policy-page {
    max-width: 760px;
    margin: 36px auto 0 auto;
    padding: 0 24px 40px 24px;
}
.policy-page h1 {
    font-size: 2.1rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.2;
}
.policy-updated {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 32px;
}
.policy-page h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 38px;
    margin-bottom: 14px;
}
.policy-page p {
    font-size: 1rem;
    color: #334155;
    line-height: 1.7;
    margin-bottom: 15px;
}
.policy-page ul {
    margin: 0 0 15px 22px;
    color: #334155;
    line-height: 1.7;
}
.policy-page li {
    margin-bottom: 7px;
}
.policy-page a {
    color: #ea580c;
    text-decoration: underline;
}
.policy-highlight-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 20px 24px;
    margin: 24px 0;
    font-size: 0.98rem;
    color: #14532d;
    line-height: 1.65;
}
.policy-highlight-box strong {
    color: #166534;
}
.credits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 20px 0 28px 0;
}
@media (max-width: 640px) {
    .credits-grid { grid-template-columns: 1fr; }
}
.credit-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
}
.credit-card h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
}
.credit-card p {
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.55;
    margin: 0 0 8px 0;
}
.credit-meta {
    font-size: 0.8rem !important;
    color: #64748b !important;
    margin: 0 !important;
}
.credit-meta a {
    color: #ea580c;
    text-decoration: underline;
}
.contact-email-button {
    display: inline-block;
    background: #f97316;
    color: #ffffff !important;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: 14px;
    text-decoration: none !important;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
    margin: 10px 0 8px 0;
}
.contact-email-button:hover {
    background: #ea580c;
}

/* ============================================
   Dark Mode Toggle Button
   ============================================ */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
}
.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ============================================
   Dark Mode Theme
   Applied whenever <html data-theme="dark">. Purely additive — none of the rules
   above this point are modified, so light mode is guaranteed unaffected.
   ============================================ */
[data-theme="dark"] body {
    background-color: #0b1220;
    color: #e2e8f0;
}
[data-theme="dark"] header {
    background: #060a14;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .logo-container {
    background: #1e293b;
}
[data-theme="dark"] .site-logo-text {
    color: #ffffff;
}
[data-theme="dark"] .secure-tag {
    background: #0f2e1a;
    border-color: #14532d;
}
[data-theme="dark"] .adsense-top-banner,
[data-theme="dark"] .adsense-footer-container {
    background: #111827;
    border-color: #1f2937;
    color: #94a3b8;
}
[data-theme="dark"] main.workspace-container {
    background: #111827;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .section-header {
    border-bottom-color: #1f2937;
}
[data-theme="dark"] .section-header h2 {
    color: #f1f5f9;
}
[data-theme="dark"] .quick-search-box {
    background: #1a2332;
    border-color: #2d3b52;
}
[data-theme="dark"] .quick-search-input { color: #e2e8f0; }
[data-theme="dark"] .quick-search-clear { background: #2d3b52; color: #94a3b8; }
[data-theme="dark"] .category-pill {
    background: #1a2332;
    border-color: #2d3b52;
    color: #cbd5e1;
}
[data-theme="dark"] .no-search-results { color: #94a3b8; }
[data-theme="dark"] .tool-tile-card {
    background: #1a2332;
    border-color: #2d3b52;
}
[data-theme="dark"] .tool-tile-card:hover {
    border-color: #475569;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] #toolsDirectoryGrid .tool-tile-card::before {
    opacity: 0.6;
    box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .tool-tile-card h3 {
    color: #f1f5f9;
}
[data-theme="dark"] .tool-tile-card p {
    color: #94a3b8;
}
[data-theme="dark"] .bg-blue   { background: #17233a; }
[data-theme="dark"] .bg-purple { background: #241c38; }
[data-theme="dark"] .bg-orange { background: #2b1f14; }
[data-theme="dark"] .bg-green  { background: #14261c; }
[data-theme="dark"] .bg-red    { background: #2a1717; }
[data-theme="dark"] .bg-cyan   { background: #10262a; }
[data-theme="dark"] .bg-amber  { background: #2a2109; }
[data-theme="dark"] .bg-pink   { background: #2a1520; }
[data-theme="dark"] .bulk-badge {
    background: #2a1720;
    border-color: #4c1d2e;
}
[data-theme="dark"] #toolsDirectoryGrid .tool-tile-card::after {
    color: #4ade80;
    background: #10261a;
}

[data-theme="dark"] .modal-window {
    background: #1a2332;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .modal-window h4 {
    color: #f1f5f9;
}
[data-theme="dark"] .modal-window p {
    color: #94a3b8;
}
[data-theme="dark"] .input-group label,
[data-theme="dark"] .sig-label-small {
    color: #cbd5e1;
}
[data-theme="dark"] .format-select-dropdown {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}
[data-theme="dark"] .exif-report-row {
    background: #0f172a;
    border-color: #334155;
}
[data-theme="dark"] .exif-report-row.exif-sensitive {
    background: #2a1520;
    border-color: #4c1d2e;
}
[data-theme="dark"] .exif-report-label {
    color: #cbd5e1;
}
[data-theme="dark"] .exif-report-row.exif-sensitive .exif-report-label {
    color: #f87171;
}
[data-theme="dark"] .exif-report-value {
    color: #e2e8f0;
}
[data-theme="dark"] .btn-cancel {
    background: #263349;
    color: #cbd5e1;
}
[data-theme="dark"] .btn-cancel:hover {
    background: #334155;
}
[data-theme="dark"] .annotate-tool-btn {
    background: #1a2332;
    border-color: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .annotate-tool-btn.active {
    background: rgba(249, 115, 22, 0.15);
    border-color: #f97316;
    color: #fb923c;
}
[data-theme="dark"] .annotate-note-input-box {
    background: #1e293b;
}
[data-theme="dark"] .annotate-note-input-box textarea {
    background: #1a2332;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .form-fields-list .field-type-tag {
    color: #64748b;
}

[data-theme="dark"] .sig-tabs,
[data-theme="dark"] .wm-tabs {
    border-bottom-color: #263349;
}
[data-theme="dark"] .sig-tab {
    color: #64748b;
}
[data-theme="dark"] .sig-tab:hover {
    color: #cbd5e1;
}
[data-theme="dark"] .sig-style-btn,
[data-theme="dark"] .sig-preview-box,
[data-theme="dark"] .wm-position-btn,
[data-theme="dark"] .pps-preset-btn {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .calc-input-panel,
[data-theme="dark"] .calc-result-panel {
    background: #0f172a;
    border-color: #263349;
}
[data-theme="dark"] .calc-input-panel h2,
[data-theme="dark"] .calc-result-panel h2,
[data-theme="dark"] .calc-result-headline,
[data-theme="dark"] .calc-result-subrow.calc-result-total,
[data-theme="dark"] .calc-result-subcard h4 {
    color: #e2e8f0;
}
[data-theme="dark"] .calc-input-row label {
    color: #94a3b8;
}
[data-theme="dark"] .calc-input-row input[type="number"],
[data-theme="dark"] .calc-input-row input[type="text"],
[data-theme="dark"] .calc-input-row select,
[data-theme="dark"] .calc-debt-row input,
[data-theme="dark"] .calc-cashflow-row input {
    background: #1a2332;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .calc-cashflow-label {
    color: #94a3b8;
}
[data-theme="dark"] .calc-result-subrow {
    border-top-color: #263349;
    color: #94a3b8;
}
[data-theme="dark"] .calc-result-subcard {
    background: #1a2332;
    border-color: #334155;
}
[data-theme="dark"] .calc-result-table th, [data-theme="dark"] .calc-result-table td {
    border-bottom-color: #263349;
}
[data-theme="dark"] .calc-add-row-btn {
    background: #1a2332;
    border-color: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .mail-merge-mapping-row {
    border-top-color: #263349;
}
[data-theme="dark"] .mail-merge-field-name {
    color: #e2e8f0;
}
[data-theme="dark"] .mail-merge-progress-bar-track {
    background: #263349;
}
[data-theme="dark"] .prep-check-row {
    background: #1a2332;
    border-color: #334155;
}
[data-theme="dark"] .prep-check-row.prep-pass {
    background: #052e1c;
    border-color: #14532d;
}
[data-theme="dark"] .prep-check-row.prep-fail {
    background: #2d0f0f;
    border-color: #7f1d1d;
}
[data-theme="dark"] .prep-check-label {
    color: #e2e8f0;
}
[data-theme="dark"] .prep-check-detail {
    color: #94a3b8;
}
[data-theme="dark"] .redaction-page-container {
    background: #0f172a;
    border-color: #334155;
}
[data-theme="dark"] .mega-page-card,
[data-theme="dark"] .mega-page-thumb {
    background: #0f172a;
    border-color: #334155;
}
[data-theme="dark"] .mega-page-label {
    color: #cbd5e1;
}
[data-theme="dark"] .mega-page-actions button {
    background: #1a2332;
    border-color: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .form-field-row label {
    color: #cbd5e1;
}

[data-theme="dark"] .breadcrumb-nav,
[data-theme="dark"] .breadcrumb-nav a {
    color: #64748b;
}
[data-theme="dark"] .tool-page-hero h1,
[data-theme="dark"] .how-it-works h2,
[data-theme="dark"] .faq-section h2,
[data-theme="dark"] .related-tools h2 {
    color: #f1f5f9;
}
[data-theme="dark"] .tool-intro {
    color: #94a3b8;
}
[data-theme="dark"] .step-card {
    background: #1a2332;
    border-color: #2d3b52;
}
[data-theme="dark"] .step-card h3 {
    color: #f1f5f9;
}
[data-theme="dark"] .step-card p {
    color: #94a3b8;
}
[data-theme="dark"] .faq-item {
    border-bottom-color: #263349;
}
[data-theme="dark"] .faq-item h3 {
    color: #f1f5f9;
}
[data-theme="dark"] .faq-item p {
    color: #94a3b8;
}
[data-theme="dark"] .related-tool-link {
    background: #1a2332;
    border-color: #2d3b52;
    color: #e2e8f0;
}
[data-theme="dark"] .related-tool-link:hover {
    border-color: #f97316;
    color: #f97316;
}
[data-theme="dark"] .site-footer {
    border-top-color: #1f2937;
    color: #64748b;
}
[data-theme="dark"] .site-footer-links a {
    color: #94a3b8;
}

[data-theme="dark"] .policy-page h1,
[data-theme="dark"] .policy-page h2 {
    color: #f1f5f9;
}
[data-theme="dark"] .policy-page p,
[data-theme="dark"] .policy-page ul {
    color: #cbd5e1;
}
[data-theme="dark"] .policy-highlight-box {
    background: #0f2e1a;
    border-color: #14532d;
    color: #86efac;
}
[data-theme="dark"] .policy-highlight-box strong {
    color: #4ade80;
}
[data-theme="dark"] .credit-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .credit-card h3 {
    color: #f1f5f9;
}
[data-theme="dark"] .credit-card p {
    color: #cbd5e1;
}
[data-theme="dark"] .credit-meta {
    color: #94a3b8 !important;
}

