/* =================================================================
   1. CSS VARIABLES & RESET
   ================================================================= */
 
:root { 
    --primary-color: #5b8def;
    --secondary-color: #7d9ff5;
    --accent-color: #ff9966;
    --text-color: #1f2937;
    --light-text: #4b5563;
    --light-bg: #f7f8fb;
    --border-color: #e5e7eb;
    --success-color: #28a745; 
    --warning-color: #ffc107;
    --error-color: #dc3545;

    --primary-rgb: 91, 141, 239;
    --secondary-rgb: 125, 159, 245;
    --accent-rgb: 255, 153, 102;
    --success-rgb: 40, 167, 69;
    --warning-rgb: 255, 193, 7; 
    --error-rgb: 220, 53, 69;
    --purple-rgb: 168, 85, 247;
    --teal-rgb: 32, 201, 151;

    --gradient-indigo: #667eea;
    --gradient-indigo-rgb: 102, 126, 234;
    --gradient-violet: #764ba2;
    --gradient-violet-rgb: 118, 75, 162;

    --color-white: #fff;
    --color-black: #000;
    --neutral-900: #111827;
    --neutral-950: #0f172a;
    --neutral-950-rgb: 15, 23, 42;
    --neutral-950-90: rgba(var(--neutral-950-rgb), 0.9);
    --neutral-850: #1f2937;
    --neutral-800: #374151;
    --neutral-700: #4b5563;
    --neutral-650: #6b7280;
    --neutral-600: #9ca3af;
    --neutral-500: #cbd5e1;
    --neutral-400: #d1d5db;
    --neutral-350: #d6d9df;
    --neutral-300: #e5e7eb;
    --neutral-250: #eef2f7;
    --neutral-200: #f3f4f6;

    --editor-bg: #ffffff;
    --editor-toolbar-bg: #f3f4f6;
    --editor-panel-bg: #ffffff;
    --editor-border: #e5e7eb;
    --editor-divider: #e5e7eb;
    --editor-hover-bg: #f1f5f9;
    --editor-hover-border: #d1d5db;
    --editor-checker-dark: #e5e7eb;
    --editor-checker-light: #f3f4f6;

    --tool-border-strong: #d1d5db;
    --checker-gray: #9ca3af;
    --tool-surface-muted: #f1f5f9;
    --green-alt: #4caf50;
    --green-alt-hover: #45a049;

    --cursor-danger-rgb: 255, 0, 0;
    --cursor-danger-border: rgba(var(--cursor-danger-rgb), 0.9);
    --cursor-danger-fill: rgba(var(--cursor-danger-rgb), 0.15);
    --cursor-danger-fill-10: rgba(var(--cursor-danger-rgb), 0.1);
    --cursor-neutral-border: rgba(255, 255, 255, 0.9);
    --cursor-neutral-fill: var(--overlay-white-10);

    --overlay-black-10: rgba(0, 0, 0, 0.1);
    --overlay-black-20: rgba(0, 0, 0, 0.2);
    --overlay-black-30: rgba(0, 0, 0, 0.3);
    --overlay-black-40: rgba(0, 0, 0, 0.4);
    --overlay-black-50: rgba(0, 0, 0, 0.5);
    --overlay-black-60: rgba(0, 0, 0, 0.6);
    --overlay-black-70: rgba(0, 0, 0, 0.7);
    --overlay-black-75: rgba(0, 0, 0, 0.75);
    --overlay-black-80: rgba(0, 0, 0, 0.8);
    --overlay-black-85: rgba(0, 0, 0, 0.85);

    --overlay-white-10: rgba(255, 255, 255, 0.1);
    --overlay-white-20: rgba(255, 255, 255, 0.2);
    --overlay-white-30: rgba(255, 255, 255, 0.3);
    --overlay-white-50: rgba(255, 255, 255, 0.5);
    --overlay-white-80: rgba(255, 255, 255, 0.8);

    --glass-white-03: rgba(255, 255, 255, 0.03);
    --glass-white-04: rgba(255, 255, 255, 0.04);
    --glass-white-05: rgba(255, 255, 255, 0.05);
    --glass-white-06: rgba(255, 255, 255, 0.06);
    --glass-white-015: rgba(255, 255, 255, 0.015);

    --border-rgb: 229, 231, 235;
    --border-50: rgba(var(--border-rgb), 0.5);
    --border-80: rgba(var(--border-rgb), 0.8);

    --card-bg-rgb: 255, 255, 255;
    --card-60: rgba(var(--card-bg-rgb), 0.6);
    --card-80: rgba(var(--card-bg-rgb), 0.8);
    --card-90: rgba(var(--card-bg-rgb), 0.9);
    --card-95: rgba(var(--card-bg-rgb), 0.95);

    --dark-bg-rgb: 255, 255, 255;
    --dark-bg-60: rgba(var(--dark-bg-rgb), 0.6);

    --gradient-indigo-20: rgba(var(--gradient-indigo-rgb), 0.2);
    --gradient-violet-20: rgba(var(--gradient-violet-rgb), 0.2);
    --gradient-indigo-30: rgba(var(--gradient-indigo-rgb), 0.3);
    --gradient-violet-30: rgba(var(--gradient-violet-rgb), 0.3);

    --primary-06: rgba(var(--primary-rgb), 0.06);
    --primary-10: rgba(var(--primary-rgb), 0.10);
    --primary-12: rgba(var(--primary-rgb), 0.12);
    --primary-15: rgba(var(--primary-rgb), 0.15);
    --primary-20: rgba(var(--primary-rgb), 0.20);
    --primary-30: rgba(var(--primary-rgb), 0.30);
    --primary-40: rgba(var(--primary-rgb), 0.40);

    --success-15: rgba(var(--success-rgb), 0.15);
    --accent-15: rgba(var(--accent-rgb), 0.15);
    --purple-15: rgba(var(--purple-rgb), 0.15);
    --teal-15: rgba(var(--teal-rgb), 0.15);
    --error-15: rgba(var(--error-rgb), 0.15);

    --purple-color: rgb(var(--purple-rgb));
    --teal-color: rgb(var(--teal-rgb));

    --gray-action: #6c757d;
    --gray-action-hover: #5a6268;
    --container-width: 1200px;
    --header-height: 60px;
    --footer-height: 60px;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px var(--overlay-black-20);
    --transition: all 0.3s ease;
    --dark-bg: #ffffff;
    --card-bg: #ffffff;
    --card-hover-bg: #f6f7fb;
    --breadcrumb-nav: #64748b;
    --close-btn-color: #9d2636;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =================================================================
   2. TYPOGRAPHY
   ================================================================= */

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--dark-bg);
    min-height: 100vh;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    position: relative; 
    margin: 0;
}

body::before {
    content: '';
    position: fixed;
    inset: -18% -14%;
    background:
        radial-gradient(circle at 88% 8%, rgba(91, 141, 239, 0.14) 0, rgba(91, 141, 239, 0.14) 8%, transparent 24%),
        radial-gradient(circle at 78% 14%, rgba(255, 153, 102, 0.10) 0, rgba(255, 153, 102, 0.10) 6%, transparent 20%),
        radial-gradient(circle at 94% 24%, rgba(168, 85, 247, 0.08) 0, rgba(168, 85, 247, 0.08) 6%, transparent 18%),
        radial-gradient(circle at 72% 6%, rgba(32, 201, 151, 0.06) 0, rgba(32, 201, 151, 0.06) 5%, transparent 16%),
        linear-gradient(180deg, #fcfdff 0%, #f5f7fb 52%, #eef3f8 100%);
    filter: saturate(105%);
    pointer-events: none;
    z-index: -1; 
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(31, 41, 55, 0.03) 1px, transparent 1.2px),
        radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.42) 0, transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.64));
    background-size: 24px 24px, auto, auto;
    mix-blend-mode: soft-light;
    opacity: 0.4;
    pointer-events: none;
    z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    font-weight: 400;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* =================================================================
   3. LAYOUT & STRUCTURE
   ================================================================= */

.container { 
    max-width: var(--container-width);
    margin: 0 auto; 
    padding: 0 15px;
}

.container h1 {    font-size: clamp(1.5rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-color) 30%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

main {
    flex: 1;
    padding: 2rem 0;
}

/* Shared processing loader */
.processing-overlay {
    display: none;
}

.processing-overlay--inline {
    position: absolute;
    inset: 0;
    z-index: 10;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.processing-overlay--fixed {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.processing-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 180px;
    max-width: calc(100vw - 32px);
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.processing-loader::before {
    content: none;
}

.processing-loader__spinner {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    min-height: 16px;
}

.processing-loader__spinner span,
.loading-dots span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    animation: waiting-dot-bounce 0.9s ease-in-out infinite;
}

.processing-loader__spinner span:nth-child(2),
.loading-dots span:nth-child(2) {
    animation-delay: 0.12s;
}

.processing-loader__spinner span:nth-child(3),
.loading-dots span:nth-child(3) {
    animation-delay: 0.24s;
}

.processing-loader__text {
    margin: 0;
    color: rgba(255, 255, 255, 0.96);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.loading-inline {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.45rem;
}

.loading-inline__label {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
}

.loading-dots {
    display: inline-flex;
    align-items: flex-end;
    gap: 6px;
    min-height: 12px;
}

.loading-dots--inline span {
    width: 6px;
    height: 6px;
}

@keyframes waiting-dot-bounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}
 

/* =================================================================
   4. HEADER & NAVIGATION
   ================================================================= */

/* Breadcrumb Navigation */
.breadcrumb-nav { 
    padding: 0;
    margin: 0;
}

.breadcrumb {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 8px 15px;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    background: transparent;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: var(--breadcrumb-nav);
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 8px;
    color: var(--border-color);
}

.breadcrumb-item a {
    color: var(--breadcrumb-nav);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--breadcrumb-nav);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--breadcrumb-nav);
}

.justify-content-center {
    justify-content: center;
}

header {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px var(--overlay-black-20); 
    z-index: 100;
}

.header {
    display: flex;
    max-width: var(--container-width);
    margin: 0 auto; 
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 35px;
    width: auto;
}

.description-text {     
    text-align: center;
    color:var(--text-color);
    padding: 1.5rem 0;
}
/* Navigation improvements */
.main-navigation {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    min-width: 0;
    position: relative;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 101;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
    }

.nav-list {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.nav-item { 
    display: inline-block;
    margin-bottom: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.35rem;
    margin: .1rem .1rem;
    font-weight: 300;
    color: var(--text-color);
    border-radius: var(--border-radius);
    transition: none;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--primary-15);
    text-decoration: none;
}

.nav-link .nav-label {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.nav-link .nav-icon {
    font-size: 1.05rem;
    line-height: 1;
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.nav-link .nav-chevron {
    margin-left: 0.3rem;
    font-size: 1.1rem;
}

.nav-item.active .nav-link {
    color: var(--primary-color);
    background-color: var(--primary-20);
}
 
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(180deg, var(--color-white) 0%, var(--primary-06) 100%);
    color: var(--text-color);
    border: 1px solid var(--tool-border-strong);
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 1px 0 var(--overlay-white-80) inset, 0 8px 20px var(--overlay-black-10);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-appearance: none;
    appearance: none;
}

.action-btn:hover {
    background: linear-gradient(180deg, var(--color-white) 0%, var(--primary-12) 100%);
    color: var(--primary-color);
    border-color: var(--primary-40);
    box-shadow: 0 1px 0 var(--overlay-white-80) inset, 0 12px 24px var(--overlay-black-10);
    text-decoration: none;
}

.action-btn:active {
    background: linear-gradient(180deg, var(--primary-12) 0%, var(--primary-20) 100%);
    box-shadow: 0 1px 0 var(--overlay-white-80) inset, 0 5px 12px var(--overlay-black-10);
}

.action-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-20), 0 8px 20px var(--overlay-black-10);
}


.tool-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-group label {
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.tool-controls-box {
    position: relative; 
    background: var(--card-bg);
    border: 1px solid var(--border-80);
    border-radius: 18px;
    padding: 1.5rem; 
    backdrop-filter: blur(14px); 
}
 
.tool-controls-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.tool-controls-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--breadcrumb-nav);
}

.tool-controls-note {
    margin: 0;
    max-width: 30rem;
    font-size: 0.95rem;
    color: var(--light-text);
}

.tool-controls-box[data-tool-ready="false"] {
    display: none;
    background: linear-gradient(180deg, var(--card-95) 0%, rgba(var(--card-bg-rgb), 0.88) 100%);
}

.tool-controls-box[data-tool-ready="false"] .tool-controls-note {
    color: var(--primary-color);
}

.tool-controls-box[data-tool-ready="false"] button,
.tool-controls-box[data-tool-ready="false"] input,
.tool-controls-box[data-tool-ready="false"] select,
.tool-controls-box[data-tool-ready="false"] textarea {
    opacity: 0.58;
    cursor: not-allowed;
}

.tool-controls-box[data-tool-ready="false"] button:disabled,
.tool-controls-box[data-tool-ready="false"] input:disabled,
.tool-controls-box[data-tool-ready="false"] select:disabled,
.tool-controls-box[data-tool-ready="false"] textarea:disabled {
    box-shadow: none;
}

/* ─── Header Search ─── */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: .75rem;
}
.header-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-color);
    border-radius: 50%;
    transition: background .2s, color .2s;
}
.header-search-toggle:hover {
    background: var(--primary-15);
    color: var(--primary-color);
}
.header-search-field {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 4px 16px var(--overlay-black-10);
    z-index: 110;
}
.header-search.open .header-search-field {
    display: flex;
}
.header-search.open .header-search-toggle {
    display: none;
}
.header-search-icon {
    position: absolute;
    left: .65rem;
    font-size: 18px;
    color: var(--light-text);
    pointer-events: none;
}
.header-search-input {
    width: 100%;
    padding: .5rem .75rem .5rem 2.4rem;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 16px;
    outline: none;
}
.header-search-input::placeholder {
    color: var(--light-text);
}
/* Dropdown results */
.header-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 320px;
    max-height: 380px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 28px var(--overlay-black-20);
    z-index: 120;
    padding: .35rem 0;
}
.header-search-dropdown.visible {
    display: block;
}
.header-search-dropdown .hs-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .85rem;
    text-decoration: none;
    color: var(--text-color);
    transition: background .15s;
}
.header-search-dropdown .hs-item:hover,
.header-search-dropdown .hs-item.hs-active {
    background: var(--primary-15);
}
.header-search-dropdown .hs-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-15);
    color: var(--primary-color);
    flex-shrink: 0;
}
.header-search-dropdown .hs-item-icon .material-symbols-rounded {
    font-size: 18px;
}
.header-search-dropdown .hs-item-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}
.header-search-dropdown .hs-empty {
    padding: 1rem;
    text-align: center;
    color: var(--light-text);
    font-size: 13px;
}

/* ─── Mobile: full input always visible ─── */
@media screen and (max-width: 900px) {
    .header-search {
        flex: 1;
        min-width: 0;
        margin-left: .5rem;
        margin-right: .5rem;
    }
    .header-search-toggle {
        display: none;
    }
    .header-search-field {
        position: relative;
        display: flex;
        right: auto;
        top: auto;
        transform: none;
        z-index: auto;
        width: 100%;
        box-shadow: none;
    }
    .header-search-dropdown {
        left: 0;
        right: auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
}


/* Tablet layout - centered logo with menu below */
@media screen and (min-width: 901px) and (max-width: 1000px) {
    .header {
        flex-direction: column;
        height: auto;
        padding: 1rem 15px;
        gap: 1rem;
    }

    .header-search {
        margin-left: 0;
        margin-right: 0;
    }
    
    .logo {
        justify-content: center;
        width: 100%;
    }
    
    .main-navigation {
        width: 100%;
        justify-content: center;
    }
    
    .nav-list {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        white-space: normal;
    }
    
    .nav-link {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .nav-link .nav-icon {
        font-size: 1rem;
    }

    .nav-link .nav-chevron {
        font-size: 1rem;
    }
}

/* Responsive improvements */
@media screen and (max-width: 900px) {
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-navigation {
        justify-content: flex-end;
    }
    
    .nav-list {
        position: fixed;
        top: var(--header-height);
        right: 0;
        display: none;
        width: min(280px, 80vw);
        max-width: none;
        height: calc(100vh - var(--header-height));
        height: calc(100dvh - var(--header-height));
        background: var(--card-bg);
        flex-direction: column;
        padding: 0;
        box-shadow: -2px 0 10px var(--overlay-black-20);
        border-left: 1px solid var(--border-50);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        white-space: normal;
        z-index: 100; 
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-item {
        flex: none;
        max-width: none;
        width: 100%;
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        justify-content: flex-start;
        margin: 0;
        border-radius: 0;
        width: 100%;
        transition: none;
    }
    
    .nav-link .nav-icon {
        font-size: 1.2rem;
    }

    .nav-link .nav-chevron {
        font-size: 1.1rem;
    }
    
    .nav-item.active .nav-link {
        background: linear-gradient(90deg, var(--primary-30) 0%, transparent 100%);
        border-left: 4px solid var(--primary-color);
        padding-left: calc(1.5rem - 4px);
    }

    .tool-group {
        justify-content: center;
        flex-wrap: wrap;
    }

    .tool-controls-box {
        padding: 1rem;
    }

    .tool-controls-heading {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .header {
        padding: 0 0.75rem;
    }
    
    .logo img {
        height: 32px;
    }
}

/* For very small screens */
@media screen and (max-width: 480px) {
    .nav-list {
        width: 100%;
        max-width: 100vw; 
    }
    
    .logo img {
        height: 28px;
    }
    
    .mobile-menu-toggle {
        width: 28px;
        height: 28px;
    }
    
    .mobile-menu-toggle span {
        height: 2.5px;
    }
}

/* =================================================================
   5. BUTTONS
   ================================================================= */

.btn,
.upload-btn,
#file-input + label {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: none;
}

.btn {
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before,
.upload-btn::before,
#file-input + label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before,
.upload-btn:hover::before,
#file-input + label:hover::before {
    left: 100%;
}

.btn-primary,
.upload-btn,
#file-input + label {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 15px rgba(74, 111, 220, 0.25);
}

.btn-primary:hover,
.upload-btn:hover,
#file-input + label:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(74, 111, 220, 0.4);
}

.btn-primary:active,
.upload-btn:active,
#file-input + label:active {
    transition: all 0.1s;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 10px 24px rgba(74, 111, 220, 0.32);
}

.btn-primary:hover {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 14px 30px rgba(74, 111, 220, 0.4);
}

.btn-primary:active {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 8px 18px rgba(74, 111, 220, 0.3);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-30), 0 10px 24px rgba(74, 111, 220, 0.32);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.25);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
    color: white;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-outline,
.btn-outline-primary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 111, 220, 0.15);
}

.btn-outline:hover,
.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(74, 111, 220, 0.3);
    border-color: var(--secondary-color);
}

.btn-outline:active,
.btn-outline-primary:active {
    transition: all 0.1s;
}

.btn-outline-secondary {
    background-color: transparent;
    border: 2px solid #6c757d;
    color: #6c757d;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.15);
}

.btn-outline-secondary:hover {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
    border-color: #5a6268;
}

.btn i,
.upload-btn i,
#file-input + label i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    border-radius: 12px;
}

/* Keep a standalone download action visually separate from the settings above it. */
.tool-controls-box > .btn-primary.btn-lg,
.tool-controls-box .tool-group > .btn-primary.btn-lg:only-child,
.tool-controls-box > .text-center > .btn-primary.btn-lg:first-child {
    margin-top: 0.75rem;
}

/* Download buttons in an explicit action row remain aligned with adjacent actions. */
.btn-row > .btn-primary.btn-lg {
    margin-top: 0;
}

/* Upload Buttons */
.upload-btn,
#file-input + label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    transition: var(--transition);
    min-width: 172px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 10px 24px rgba(74, 111, 220, 0.32);
}

.upload-btn:hover,
#file-input + label:hover {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 14px 30px rgba(74, 111, 220, 0.4);
}

.upload-btn:active,
#file-input + label:active {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 8px 18px rgba(74, 111, 220, 0.3);
}

.upload-btn:focus-visible,
#file-input + label:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-30), 0 10px 24px rgba(74, 111, 220, 0.32);
}

.upload-btn-lg {
    padding: 1.05rem 2.1rem;
    font-size: 1rem;
    min-width: 196px;
    border-radius: 14px;
}

.upload-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-width: 120px;
    border-radius: 8px;
}

/* =================================================================
   6. FORMS & INPUTS
   ================================================================= */

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, select, textarea { 
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--card-hover-bg);
    box-shadow: 0 0 0 3px var(--primary-30);
}

/* =================================================================
   7. CARDS & CONTENT BOXES
   ================================================================= */

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--overlay-black-20);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 8px 30px var(--overlay-black-30);
    border-color: var(--primary-40);
}

.card-title {
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--light-text);
}

.privacy-highlight {
    background: linear-gradient(135deg, #3d4d8a 0%, #4a2d61 100%);  
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(91, 141, 239, 0.3);
}

.privacy-highlight h3 { 
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.2rem; 
}

.privacy-highlight p { 
    margin-bottom: 0;
    line-height: 1.6;
}

.tool-content {
    background: transparent;
    padding: 0; 
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-content h2 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    text-align: center;
}

.tool-content h3 {
    color:var(--text-color); 
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tool-content ul,
.tool-content ol { 
    margin-bottom: 20px;
}

.tool-content li {
    margin-bottom: 8px;
    line-height: 1.6;
    color:var(--text-color);
}

.tool-content p {
    line-height: 1.6;
    color:var(--text-color);
    margin: 15px 0;
}

/* =================================================================
   8. LISTS
   ================================================================= */

ul, ol {
    padding-left: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

ul li, ol li {
    margin-bottom: 0.5rem;
}

ul {
    list-style-type: disc;
}

ul ul {
    list-style-type: circle;
    margin-top: 0.5rem;
}

ul ul ul {
    list-style-type: square;
}

/* =================================================================
   8.4 ERROR PAGES (404 / 410)
   ================================================================= */

.error-page {
    max-width: 920px;
    margin: 0 auto;
    padding: clamp(1rem, 2vw, 2rem) 0;
}

.error-card {
    position: relative;
    padding: clamp(1.3rem, 2.8vw, 2.3rem);
    border-radius: 22px;
    border: 1px solid var(--border-80);
    background: linear-gradient(180deg, var(--card-bg) 0%, var(--light-bg) 100%);
    box-shadow: 0 20px 44px var(--overlay-black-10);
    text-align: center;
    overflow: hidden;
}

.error-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 15%, var(--primary-15) 0%, transparent 48%);
    pointer-events: none;
}

.error-code,
.error-title,
.error-lead,
.error-primary-action,
.error-secondary-actions,
.error-popular-tools {
    position: relative;
    z-index: 1;
}

.error-code {
    margin: 0 0 0.6rem;
    font-size: clamp(3.2rem, 9vw, 4.8rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.03em;
    color: var(--error-color);
}

.error-title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.55rem, 4.6vw, 2.25rem);
    line-height: 1.2;
    color: var(--text-color);
    background: none;
    -webkit-text-fill-color: currentColor;
}

.error-lead {
    max-width: 640px;
    margin: 0 auto 1.25rem;
    color: var(--light-text);
    font-size: 1rem;
    line-height: 1.7;
}

.error-primary-action {
    margin-bottom: 0.8rem;
}

.error-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 1.6rem;
}

.error-secondary-link {
    font-size: 0.9rem;
}

.error-popular-tools {
    border-top: 1px solid var(--border-color);
    padding-top: 1.2rem;
}

.error-popular-title {
    margin: 0 0 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

.error-popular-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.error-popular-link {
    display: block;
    padding: 0.6rem 0.7rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 18px var(--overlay-black-10);
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.error-popular-link:hover,
.error-popular-link:focus-visible {
    color: var(--primary-color);
    border-color: var(--primary-40);
    text-decoration: none;
    box-shadow: 0 12px 24px var(--overlay-black-10);
}

.error-popular-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .error-popular-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .error-card {
        border-radius: 16px;
        padding: 1.1rem 0.95rem;
    }

    .error-secondary-actions {
        gap: 0.5rem;
    }

    .error-secondary-link {
        width: 100%;
    }

    .error-popular-grid {
        grid-template-columns: 1fr;
    }
}

ol {
    list-style-type: decimal;
}

ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.5rem;
}

ol ol ol {
    list-style-type: lower-roman;
}

.feature-list {
    list-style: none;
    padding-left: 1.5rem;
}

.feature-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

/* =================================================================
   LEGAL PAGES (TERMS, PRIVACY, COOKIE)
   ================================================================= */

.legal-page {
    max-width: 860px;
}

.legal-page .tool-content {
    margin: 0;
    padding: 0;
}

.legal-page h1,
.legal-page .container h1 {
    font-size: clamp(1.7rem, 3.6vw, 2.2rem);
    line-height: 1.3;
    margin: 0 0 1rem;
    text-align: left;
    color: var(--text-color);
    background: none;
    -webkit-text-fill-color: initial;
}

.legal-page .lead {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--light-text);
    margin-bottom: 1.25rem;
}

.legal-page h3,
.legal-page .tool-content h3 {
    font-size: 1.25rem;
    text-align: left;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-page h2,
.legal-page .tool-content h2 {
    font-size: 1.45rem;
    text-align: left;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0;
    color: var(--text-color);
}

.legal-page h4 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--neutral-800);
}

.legal-page p,
.legal-page li,
.legal-page .tool-content p,
.legal-page .tool-content li {
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--light-text);
}

.legal-page ul,
.legal-page ol {
    margin-bottom: 1.1rem;
}

.legal-page .alert,
.legal-page .card,
.legal-page .table-responsive {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: none;
}

.legal-page .alert {
    padding: 1rem 1.1rem;
    margin: 1rem 0 1.2rem;
}

.legal-page .alert h5,
.legal-page .alert h6 {
    margin-bottom: 0.4rem;
}

.legal-page .card {
    padding: 0;
    margin-bottom: 1rem;
}

.legal-page .card:hover {
    border-color: rgba(125, 159, 245, 0.2);
}

.legal-page .card-header {
    background: var(--primary-12) !important;
    color: var(--text-color) !important;
    border-bottom: 1px solid var(--primary-20);
    padding: 0.8rem 1rem;
}

.legal-page .card-body {
    padding: 1rem;
}

.legal-page .table {
    margin-bottom: 0;
    width: 100%;
}

.legal-page .table th,
.legal-page .table td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0.6rem;
    vertical-align: top;
}

.legal-page .table th {
    color: var(--text-color);
    font-weight: 600;
}

.legal-page .text-muted {
    color: var(--neutral-700) !important;
}

@media (max-width: 768px) {
    .legal-page .row {
        margin-left: 0;
        margin-right: 0;
    }

    .legal-page .card,
    .legal-page .alert,
    .legal-page .table-responsive {
        border-radius: 8px;
    }

    .legal-page h3,
    .legal-page .tool-content h3 {
        margin-top: 1.5rem;
    }
}

.feature-list li:before {
    content: "✓";
    color: var(--success-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.arrow-list {
    list-style: none;
    padding-left: 1.5rem;
}

.arrow-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.arrow-list li:before {
    content: "→";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.unstyled-list {
    list-style: none;
    padding-left: 0;
}

.inline-list {
    padding-left: 0;
    list-style: none;
}

.inline-list li {
    display: inline-block;
    margin-right: 1rem;
}

/* =================================================================
   8.5 CONTENT SECTIONS - REUSABLE COMPONENTS
   ================================================================= */

/* Section Spacing */
.content-section {
    margin-bottom: 1.5rem;
}

.tool-content > .content-section {
    margin: 0;
    padding: 1.5rem 0;
}

.tool-content > .content-section + .content-section {
    padding-top: 2rem; 
}

.tool-content > .content-section:last-child {
    padding-bottom: 0;
}

/* Section Titles */
.section-title { 
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0;
    text-align: center;
}

.section-subtitle { 
    font-weight: 800;
    color: var(--text-color);
    background: none;
    -webkit-text-fill-color: currentColor;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    letter-spacing: 0.01em;
    text-align: center;
}

.content-section:first-child .section-subtitle {
    margin-top: 0;
}
 
.section-intro {
    font-size: 1.1rem;
    color:var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.tool-content-intro-wrap {
    max-width: 980px;
    margin: 0 auto 0.5rem;
    padding: 1.25rem 0;
}

.tool-content-intro-wrap--split {
    max-width: 1100px;
    padding: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.tool-content-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: clamp(1rem, 3vw, 2rem);
    align-items: center;
}

.tool-content-intro__copy {
    min-width: 0;
}

.tool-content-intro__copy > :first-child {
    margin-top: 0;
}

.tool-content-intro__copy > :last-child {
    margin-bottom: 0;
}

.tool-content-intro__media {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tool-content-intro__image {
    display: block;
    width: min(100%, 460px);
    max-height: 340px;
    object-fit: cover;
    box-shadow: 0 14px 34px var(--overlay-black-10);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.feature-item { 
    border-radius: 14px;
    padding: 1.1rem 1rem;
    text-align: center; 
}

.feature-icon-wrapper {
    position: relative;
    width: 54px;
    height: 54px; 
    margin: 0 auto 0.7rem; 
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
} 

.feature-icon-wrapper::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 22% 20%, rgba(39, 199, 255, 0.26) 0%, transparent 52%),
        radial-gradient(circle at 78% 82%, rgba(107, 92, 255, 0.20) 0%, transparent 56%),
        linear-gradient(135deg, rgba(39, 199, 255, 0.12) 0%, rgba(91, 141, 239, 0.08) 52%, rgba(107, 92, 255, 0.12) 100%);
    box-shadow: inset 0 0 0 1px rgba(91, 141, 239, 0.08);
}
 
.feature-icon {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    color: transparent;
    background: linear-gradient(135deg, #27c7ff 0%, var(--primary-color) 45%, #6b5cff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 6px 12px rgba(91, 141, 239, 0.18));
    text-shadow: none;
}

.feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}

.feature-description {
    font-size: 0.9rem;
    color: var(--light-text);
    line-height: 1.5;
    margin-bottom: 0;
}

/* Info Box */
.info-box { 
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.info-box p {
    color:var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.info-box p:last-child {
    margin-bottom: 0; 
}

.related-tools-section {
    margin-top: 1.5rem;
}

.related-tools-intro {
    color: var(--light-text);
    margin: -0.4rem auto 0;
    max-width: 720px;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.related-tool-card {
    display: grid;
    background-color: var(--card-bg);
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    padding: 1rem 1.05rem;
    border-radius: 18px; 
    text-decoration: none;
    box-shadow: 0 8px 20px var(--overlay-black-10);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.related-tool-card:hover {
    box-shadow: 0 12px 28px var(--overlay-black-10);
    color: var(--text-color);
    text-decoration: none;
}

.related-tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-12);
    color: var(--primary-color);
    font-size: 1.2rem;
}

.related-tool-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.related-tool-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
}

.related-tool-description {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--light-text);
}

/* Responsive Adjustments for Content Sections */
@media screen and (max-width: 768px) {
    .tool-content-intro {
        grid-template-columns: 1fr;
    }

    .tool-content-intro__image {
        width: 100%;
        max-width: 460px;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.98rem;
        margin-top: 0.15rem;
        margin-bottom: 0.85rem;
    }

    .content-section:first-child .section-subtitle {
        margin-top: 0;
    }
    
    .section-intro {
        font-size: 1rem;
    }
    
    .feature-item {
        padding: 0;
    }

    .feature-icon-wrapper {
        width: 48px;
        height: 48px;
        margin-bottom: 0.55rem;
    }

    .feature-icon {
        font-size: 1.35rem;
    }

    .feature-title {
        font-size: 0.95rem;
        margin-bottom: 0.35rem;
    }

    .feature-description {
        font-size: 0.86rem;
    }
     
     
    .tool-content > .content-section {
        padding: 1.25rem 0;
    }

    .tool-content > .content-section + .content-section {
        padding-top: 1.5rem;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* =================================================================
   9. FOOTER
   ================================================================= */

footer {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    box-shadow: none;
}

/* Legacy footer nav styles for backward compatibility */
footer nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

footer nav ul li a {
    color: var(--light-text);
    font-size: 0.9rem;
}

 
.footer-bottom {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    text-align: left;
    color: var(--light-text);
    font-size: 0.85rem;
}

.footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 0.85rem;
}

.footer-brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    text-align: left;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.footer-logo img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

p.footer-brand-copy {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--light-text);
    max-width: 48ch;
}

.footer-nav-wrap {
    text-align: left;
    flex: 0 0 auto;
}

.footer-bottom-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.25rem;
}

.footer-bottom-nav li {
    display: block;
}

.footer-bottom-nav a {
    color: var(--light-text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.footer-addon-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid rgba(66, 133, 244, 0.45);
    border-radius: 999px;
    padding: 0.38rem 0.85rem;
    background: linear-gradient(180deg, rgba(66, 133, 244, 0.2), rgba(66, 133, 244, 0.08));
    color: #f8fbff;
    font-size: 0.83rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    box-shadow: 0 6px 14px var(--overlay-black-10);
}

.footer-addon-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.footer-brand-addon {
    grid-column: 2;
    justify-self: start;
    margin-top: 0.15rem;
}

.footer-bottom-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.footer-bottom-nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-addon-link:hover {
    border-color: rgba(66, 133, 244, 0.7);
    background: linear-gradient(180deg, rgba(66, 133, 244, 0.28), rgba(66, 133, 244, 0.14));
    color: #ffffff;
    box-shadow: 0 9px 20px var(--overlay-black-20);
}

.footer-bottom-nav a:hover::after {
    width: 100%;
}

.footer-bottom p {
    margin: 0.9rem 0 0;
    padding-top: 0.9rem; 
    text-align: center;
}
.rounded {
    border-radius: var(--border-radius);
}
.img-fluid {
    max-width: 100%;
    height: auto;
}
@media screen and (max-width: 768px) {
    .footer-bottom {
        padding-left: 0;
        padding-right: 0;
        text-align: center;
    }

    .footer-main {
        flex-direction: column;
        align-items: center;
        gap: 0.85rem;
    }

    .footer-brand {
        grid-template-columns: 1fr;
        gap: 0.65rem;
        justify-items: center;
        align-items: center;
        text-align: center;
    }

    p.footer-brand-copy {
        max-width: 32ch;
        text-align: center;
    }

    .footer-nav-wrap {
        text-align: center;
        width: 100%;
    }
    
    .footer-bottom-nav {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.55rem;
        font-size: 0.8rem;
    }
    
    .footer-bottom-nav a {
        font-size: 0.8rem;
    }

    .footer-addon-link {
        padding: 0.34rem 0.74rem;
        font-size: 0.8rem;
    }

    .footer-addon-icon {
        width: 15px;
        height: 15px;
    }

    .footer-brand-addon {
        grid-column: 1;
        justify-self: center;
        margin-top: 0;
    }
}
/* =================================================================
   16. RESPONSIVE DESIGN
   ================================================================= */

/* Typography Responsive */
@media screen and (max-width: 768px) {
    h1 { 
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
        padding: 0.5rem 0;
    }
    h2 { 
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
        padding: 0.4rem 0;
    }
    h3 { 
        font-size: 1.35rem;
        line-height: 1.4;
        margin-bottom: 0.65rem;
        padding: 0.3rem 0;
    }
    h4 { 
        font-size: 1.25rem;
        line-height: 1.4;
        margin-bottom: 0.6rem;
    }
    h5 { 
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
}

@media screen and (max-width: 480px) {
    h1 { 
        font-size: 1.5rem;
        line-height: 1.35;
        margin-bottom: 0.65rem;
        padding: 0.4rem 0;
    }
    h2 { 
        font-size: 1.35rem;
        line-height: 1.35;
        margin-bottom: 0.6rem;
        padding: 0.3rem 0;
    }
    h3 { 
        font-size: 1.2rem;
        line-height: 1.4;
        margin-bottom: 0.55rem;
        padding: 0.25rem 0;
    }
    h4 { 
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    h5 { 
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }
}









/* Responsive Design */
@media screen and (max-width: 768px) {
 
    
    .main-navigation {
        width: auto;
        margin-top: 0;
        right: auto;
        position: relative;
    }
    
    main { 
        padding: 1rem 0;
    }
    
    .card {
        padding: 1rem;
    }
    
    .footer-bottom-nav {
        row-gap: 0.55rem;
    }
}

/* =================================================================
   PAGE-SPECIFIC STYLES
   ================================================================= */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

/* Cookie Policy Banner */
#cookie-policy {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 1000;
    align-items: center;
    text-align: center;
}

.cf-turnstile {
    margin: 1.5rem 0;
}
 
/* Responsive adjustments for file upload buttons */
@media (max-width: 768px) {
    .upload-btn,
    #file-input + label {
        padding: 0.7rem 1.2rem;
        font-size: 0.8rem;
        min-width: 140px;
    }
    
    .upload-btn-lg {
        padding: 0.9rem 1.5rem;
        font-size: 0.9rem;
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .upload-btn,
    #file-input + label {
        width: 100%;
        max-width: 300px;
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        min-width: auto;
    }
}

/* =================================================================
   17. SIMPLE TOOL INTERFACE
   Shared finishing layer: calm surfaces, clear primary actions, and
   comfortable touch targets across every editor.
   ================================================================= */
:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --primary-rgb: 37, 99, 235;
    --text-color: #172033;
    --light-text: #5f6b7d;
    --light-bg: #f8fafc;
    --border-color: #dce3ed;
    --tool-border-strong: #cbd5e1;
    --border-radius: 10px;
    --box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

body {
    background: #f8fafc;
}

body::before {
    inset: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 38rem, #f8fafc 100%);
    filter: none;
}

body::after {
    display: none;
}

main {
    padding: clamp(1.25rem, 3vw, 2.5rem) 0;
}

.container {
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-left: max(1rem, env(safe-area-inset-left));
}

.container h1 {
    max-width: 900px;
    margin-right: auto;
    margin-left: auto;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--text-color);
    text-align: center;
}

header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
}

.nav-link {
    font-weight: 600;
}

.action-btn,
.btn,
.upload-btn,
#file-input + label {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 650;
    box-shadow: none;
}

.action-btn {
    padding: 0.62rem 0.9rem;
    background: #ffffff;
    border-color: var(--tool-border-strong);
}

.action-btn:hover {
    background: #eff6ff;
    border-color: var(--primary-color);
    box-shadow: none;
}

.btn-primary,
.upload-btn,
#file-input + label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: none;
}

.btn-primary:hover,
.upload-btn:hover,
#file-input + label:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: none;
}

.btn-outline,
.btn-outline-primary {
    border-width: 1px;
    box-shadow: none;
}

.tool-controls-box,
.card {
    border-radius: 14px;
    border-color: var(--border-color);
    box-shadow: var(--box-shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.card:hover {
    border-color: var(--border-color);
    box-shadow: var(--box-shadow);
}

.tool-controls-box {
    padding: clamp(1rem, 2vw, 1.25rem);
}

.tool-controls-title {
    color: var(--text-color);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

input,
select,
textarea,
.form-control-compact {
    min-height: 44px;
    border-radius: 10px;
}

.upload-area {
    background: transparent;
}

.upload-drop-content {
    min-height: 300px;
    padding: clamp(1.5rem, 5vw, 2.5rem) 1.25rem;
    border: 2px dashed #b8c7dc;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--box-shadow);
}

.upload-drop-content:hover,
.upload-area.dragover .upload-drop-content,
.upload-drop-content.dragover {
    border-color: var(--primary-color);
    background: #f8fbff;
    box-shadow: 0 0 0 4px var(--primary-10);
}

.upload-drop-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #dbeafe;
    color: var(--primary-color);
}

.upload-drop-icon i {
    font-size: 28px;
}

.upload-drop-title {
    font-size: 1.05rem;
    color: var(--text-color);
}

.upload-drop-or,
.upload-drop-formats {
    color: var(--light-text);
}

.upload-drop-formats {
    display: block;
    margin: 0;
    font-size: 0.85rem;
}

.upload-benefit-badges {
    margin-top: 0.75rem;
}

.upload-benefit-badges > span {
    color: var(--light-text);
    font-weight: 600;
}

@media (max-width: 768px) {
    main {
        padding: 1rem 0 1.5rem;
    }

    .upload-drop-content {
        min-height: 260px;
        border-radius: 14px;
    }

    .tool-controls-box,
    .card {
        border-radius: 12px;
    }
}

/* =================================================================
   ANIMATIONS
   ================================================================= */

@keyframes spinner {
    to { }
}

@keyframes pulse {
    from { box-shadow: 0 10px 30px var(--overlay-black-20); }
    to { box-shadow: 0 15px 40px var(--overlay-black-30); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.spin {
    animation: spinner 1s linear infinite;
    display: inline-block;
}

/* =================================================================
   TOOL-SPECIFIC STYLES
   ================================================================= */

/* Convert Page */
.image-preview {
    position: relative;
}

.drag-text {
    color: var(--neutral-500);
    font-size: 13px;
    margin-top: 15px;
} 
.overlay-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 10;
    font-weight: bold;
    padding: 12px 20px;
    box-shadow: 0 4px 8px var(--overlay-black-20);
    transition: all 0.3s ease;
}

.overlay-btn:hover {
    box-shadow: 0 6px 12px var(--overlay-black-30);
}

.popular-conversions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .5rem;
}

/* =================================================================
   SPECIAL COMPONENTS
   ================================================================= */

/* Instructions List */
.instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: instruction-counter;
}

.instructions-list li {
    position: relative;
    padding: 0.72rem 0.85rem 0.72rem 3.1rem;
    margin-bottom: 0.5rem;
    counter-increment: instruction-counter; 
    color: var(--text-color);
    line-height: 1.5;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
 
.instructions-list li::before {
    content: counter(instruction-counter);
    position: absolute;
    left: 0.7rem;
    top:  0.7rem;
    width: 1.65rem;
    height: 1.65rem; 
    color: #ffffff;
    border-radius: 999px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.74rem;
    border: 1px solid var(--primary-color);
}

@media screen and (max-width: 768px) {
    .instructions-list li {
        padding: 0.62rem 0.72rem 0.62rem 2.75rem;
        margin-bottom: 0.45rem;
        font-size: 0.92rem;
    }

    .instructions-list li::before {
        left: 0.62rem;
        width: 1.45rem;
        height: 1.45rem;
        font-size: 0.68rem;
    }
}

/* =================================================================
   15. UTILITIES
   ================================================================= */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 2.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; } 

/* =================================================================
   10. UPLOAD & DRAG-DROP STYLES
   ================================================================= */

.upload-area { 
    text-align: center; 
    cursor: pointer;
} 
.upload-area input[type="file"] {
    display: none !important;
}

/* --- Drag & Drop Upload Zone --- */
.upload-drop-content {
    border: 1px dashed rgba(0, 44, 65, 0.687);
    border-radius: 16px;
    padding: 3.5rem 2rem;  
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-drop-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.14) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

 
.upload-drop-content:hover::before {
    opacity: 1;
}

/* Drag-over active state */
.upload-area.dragover .upload-drop-content,
.upload-drop-content.dragover {
    border-color: rgba(125, 211, 252, 0.92);
    border-style: solid;
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.98) 0%, rgba(30, 64, 175, 0.48) 100%);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.26), inset 0 0 30px rgba(56, 189, 248, 0.1);
}

.upload-area.dragover .upload-drop-icon,
.upload-drop-content.dragover .upload-drop-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--color-white);
}

.upload-area.dragover .upload-drop-title,
.upload-drop-content.dragover .upload-drop-title {
    color: var(--primary-color);
}

.upload-drop-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: var(--primary-12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s ease;
}

.upload-drop-icon i {
    font-size: 2.2rem;
    color: var(--primary-color);
    transition: color 0.35s ease;
}

.upload-drop-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.upload-drop-or {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    letter-spacing: 1px;
    font-weight: 500;
}

.upload-drop-formats {
    color: var(--light-text);
    font-size: 0.85rem;
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.upload-sample-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1rem;
}

.upload-sample-label {
    color: var(--light-text);
    font-size: 0.82rem;
    line-height: 1.4;
}

.upload-sample-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    font-size: 0.88rem;
}

.upload-sample-trigger i {
    font-size: 1rem;
}

.upload-sample-trigger.is-loading,
.upload-sample-trigger:disabled {
    opacity: 0.65;
    cursor: wait;
}

.upload-sample-trigger.is-loading {
    pointer-events: none;
}

.upload-benefit-badges {
    margin: 1rem 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem 1.2rem;
}

.upload-benefit-badges > span {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem; 
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.upload-benefit-badges .material-symbols-rounded {
    font-size: 18px;
    color: #7dd3fc;
    flex-shrink: 0;
}

/* Drag and drop overlay — body-level (used by some JS files) */
body.drag-active {
    background: var(--dark-bg);
}

body.drag-active::before {
    content: "Drop your image here";
    position: fixed;
    top: 50%;
    left: 50%;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    color: var(--text-color);
    padding: 24px 48px;
    border-radius: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 12px 40px var(--primary-30), 0 0 80px var(--primary-10);
    animation: dropPulse 1.5s infinite alternate;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes dropPulse {
    from {
        box-shadow: 0 12px 40px var(--primary-30), 0 0 80px var(--primary-10);
    }
    to {
        box-shadow: 0 16px 50px var(--primary-45), 0 0 100px var(--primary-15);
    }
}

.section-hidden { display: none !important; }
.section-visible { display: block !important; }

/* Responsive adjustments for upload drop zone */
@media (max-width: 768px) {
    .upload-drop-content {
        padding: 1.5rem 0 1.5rem 0;
    }
    
    .upload-drop-icon {
        width: 64px;
        height: 64px;
    }

    .upload-drop-icon i {
        font-size: 1.75rem;
    }
    
    .upload-drop-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
 
    .upload-drop-icon {
        width: 56px;
        height: 56px;
    }

    .upload-drop-icon i {
        font-size: 1.5rem;
    }
    
    .upload-drop-title {
        font-size: 1rem;
    }

    .upload-benefit-badges {
        flex-wrap: nowrap;
        gap: 0.45rem;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .upload-benefit-badges::-webkit-scrollbar {
        display: none;
    }

    .upload-benefit-badges > span {
        flex: 0 0 auto;
        font-size: 0.76rem;
    }
}


.preview-container {
    background: repeating-conic-gradient(var(--editor-checker-light) 0% 25%, var(--editor-checker-dark) 0% 50%) 50% / 20px 20px;
    border: 1px solid var(--border-color); 
    display: flex;
    justify-content: center;
    align-items: center;  
    min-width: 200px; 
    cursor: pointer;
    transition: border-color 0.3s;
    position: relative;
}

.preview-container.drag-over {
    border-color: #5b8def;
    background: repeating-conic-gradient(rgba(91, 141, 239, 0.2) 0% 25%, rgba(91, 141, 239, 0.1) 0% 50%) 50% / 20px 20px;
}

.preview-container canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    box-shadow: 0 2px 8px var(--overlay-black-10);
    object-fit: contain;
}


/* =================================================================
   16. RESPONSIVE DESIGN
   ================================================================= */

/* Tablet & Below (max-width: 992px) */
@media (max-width: 992px) {
    .popular-conversions {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        gap: .4rem;
    }
}

/* =================================================================
   GLOBAL LOADER ANIMATION
   ================================================================= */

.btn-loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--overlay-white-30);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes btn-spin {
    0% { }
    100% { }
}

/* =================================================================
   CLOSE CROP BUTTON
   ================================================================= */

.btn-close {
    position: relative;
    display: block;
    margin: -40px 2px 5px auto;
    width: 40px;
    height: 40px;
    background: var(--close-btn-color);
    border: 2px solid var(--overlay-white-30);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.btn-close:hover {
    background: rgba(200, 35, 51, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .btn-close {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-bottom: 5px;
    }
}

/* =================================================================
   POLYGON CROP MODE
   ================================================================= */

.polygon-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: auto;
}

.polygon-controls {
    animation: fadeIn 0.3s ease-in-out;
}

.polygon-controls p {
    font-size: 0.95rem;
}

#polygon-finish:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        }
    to {
        opacity: 1;
        }
}

/* =================================================================
   FAQ SECTION
   ================================================================= */

.faq-container { 
    margin: 0 auto;
    display: grid;
    gap: 0.6rem;
}

.faq-item { 
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: var(--card-bg); 
}

.faq-question {
    width: 100%;
    padding: 0.95rem 1.1rem;
    background: var(--card-bg);
    border: none;
    color: var(--text-color);
    font-size: 0.98rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.faq-question:hover {
    background: #f8fbff;
}

.faq-question:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.faq-question i {
    font-size: 0.92rem;
    color: var(--light-text);
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    opacity: 0.75;
}

.faq-item.active .faq-question i { 
    color: var(--primary-color);
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.1rem;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 1.1rem 0.95rem;
}

.faq-answer p {
    margin: 0;
    color: var(--light-text);
    line-height: 1.55;
    font-size: 0.9rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* FAQ Responsive */
@media screen and (max-width: 768px) {
    .faq-question {
        padding: 0.78rem 0.95rem;
        font-size: 0.92rem;
    }
    
    .faq-answer {
        padding: 0 0.95rem;
    }
    
    .faq-item.active .faq-answer {
        padding: 0 0.95rem 0.8rem;
    }
    
    .faq-answer p {
        font-size: 0.85rem;
    }
}

/* =================================================================
   NAVIGATION DROPDOWN STYLES
   ================================================================= */

/* Dropdown Container */
.nav-item.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0;
}

.dropdown-toggle .nav-chevron {
    font-size: 0.75rem;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    display: none;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-50);
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--overlay-black-20);
    padding: 8px 0;
    margin-top: 0;
    z-index: 1000;
    list-style: none;
}

.nav-item.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem; 
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: var(--primary-15);
    color: var(--primary-color); 
}

.dropdown-divider {
    height: 1px;
    background: var(--border-50);
    margin: 8px 0;
}

/* Mobile Dropdown Behavior */
@media screen and (max-width: 900px) {
    .dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        background: var(--card-bg);
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        padding: 0;
        max-height: none;
        overflow: visible;
        transition: none;
    }

    .nav-item.dropdown:hover .dropdown-menu {
        display: none;
    }
    
    .nav-item.dropdown.active .dropdown-menu {
        display: block;
    }

    .nav-item.dropdown.active:hover .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a { 
        padding: 10px 20px 10px 40px;
        font-size: 0.85rem;
    }
    
    .dropdown-menu a:hover {
        padding-left: 40px;
    }
    
    .nav-item.dropdown .nav-link {
        justify-content: space-between;
    }
    
    .dropdown-toggle .nav-chevron {
        margin-left: auto;
        transition: none;
    }
}

/* =================================================================
   HOMEPAGE (hp- namespace)
   ================================================================= */



/* --- Section helpers --- */
.hp-section-title {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    margin-bottom: .5rem;
}
.hp-section-sub {
    text-align: center;
    color: var(--light-text);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

/* --- Popular Tools Grid --- */ 
.hp-tools-controls {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hp-search-bar {
    display: flex;
    justify-content: center;
}

.hp-search-field {
    width: min(100%, 620px);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--card-bg);
    box-shadow: 0 8px 20px var(--overlay-black-10);
}

.hp-search-field .material-symbols-rounded {
    font-size: 20px;
    color: var(--light-text);
    flex-shrink: 0;
}

.hp-search-field input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.96rem;
    line-height: 1.4;
}

.hp-search-field input:focus {
    outline: none;
}

.hp-search-field input::placeholder {
    color: var(--light-text);
}
/* Filter buttons */
.hp-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-top: 25px;
}
.hp-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    justify-content: center;
    padding: .48rem .95rem;
    border: 1px solid var(--tool-border-strong);
    border-radius: 12px;
    font-size: .83rem;
    font-weight: 600;
    color: var(--text-color);
    background: linear-gradient(180deg, var(--color-white) 0%, var(--primary-06) 100%);
    cursor: pointer;
    box-shadow: 0 1px 0 var(--overlay-white-80) inset, 0 8px 20px var(--overlay-black-10);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-appearance: none;
    appearance: none;
}
.hp-filter-btn:hover {
    background: linear-gradient(180deg, var(--color-white) 0%, var(--primary-12) 100%);
    border-color: var(--primary-40);
    color: var(--primary-color);
    box-shadow: 0 1px 0 var(--overlay-white-80) inset, 0 12px 24px var(--overlay-black-10);
}
.hp-filter-btn:active {
    background: linear-gradient(180deg, var(--primary-12) 0%, var(--primary-20) 100%);
    box-shadow: 0 1px 0 var(--overlay-white-80) inset, 0 5px 12px var(--overlay-black-10);
}
.hp-filter-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-20), 0 8px 20px var(--overlay-black-10);
}
.hp-filter-btn.active {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 10px 22px var(--primary-30);
}
.hp-filter-btn.active:hover {
    color: #fff;
    border-color: var(--primary-color);
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}
.hp-filter-btn .material-symbols-rounded {
    font-size: 16px;
}
.hp-tools {
    margin-top: 2rem;
}
.hp-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .55rem;
}
.hp-tool-card { 
    border-radius: 12px;
    background-color: var(--card-bg);
    padding: 0.5rem;
    box-shadow: 0 8px 20px var(--overlay-black-10);
    text-decoration: none;
    color: var(--text-color);
    transition: all .25s cubic-bezier(.4,0,.2,1);
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    column-gap: .65rem;
    row-gap: .15rem;
    align-items: start;
}
.hp-tool-card .hp-tool-icon {
    grid-row: 1 / 3;
    align-self: center;
}
.hp-tool-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(91,141,239,.15);
    background: var(--card-hover-bg);
    text-decoration: none;
    color: var(--text-color);
}
.hp-tool-card h3 {
    font-size: .88rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.hp-tool-card p {
    font-size: .78rem;
    color: var(--light-text);
    margin: 0;
    line-height: 1.4;
}
.hp-tools-empty {
    margin: 1rem 0 0;
    text-align: center;
    color: var(--light-text);
    font-size: .92rem;
}
.hp-tool-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hp-tool-icon .material-symbols-rounded {
    font-size: 22px;
}
.hp-tool-icon--blue   { background: rgba(91,141,239,.15); }
.hp-tool-icon--blue .material-symbols-rounded   { color: var(--primary-color); }
.hp-tool-icon--green  { background: var(--success-15); }
.hp-tool-icon--green .material-symbols-rounded  { color: var(--success-color); }
.hp-tool-icon--orange { background: var(--accent-15); }
.hp-tool-icon--orange .material-symbols-rounded { color: var(--accent-color); }
.hp-tool-icon--purple { background: var(--purple-15); }
.hp-tool-icon--purple .material-symbols-rounded { color: var(--purple-color); }
.hp-tool-icon--teal   { background: var(--teal-15); }
.hp-tool-icon--teal .material-symbols-rounded   { color: var(--teal-color); }
.hp-tool-icon--red    { background: var(--error-15); }
.hp-tool-icon--red .material-symbols-rounded    { color: var(--error-color); }

/* --- All Tools Showcase --- */
.hp-showcase {
    padding: 4rem 0;
    background: var(--glass-white-015);
}
.hp-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}
.hp-showcase-group h3 {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--primary-color);
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.hp-showcase-group h3 i {
    font-size: 1.1rem;
}
.hp-showcase-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.hp-showcase-group ul a {
    color: var(--light-text);
    text-decoration: none;
    font-size: .9rem;
    transition: color .2s, padding-left .2s;
    display: block;
    padding: .25rem 0;
}
.hp-showcase-group ul a:hover {
    color: #fff;
    padding-left: .5rem;
}

/* Conversion chips */
.hp-conversions {
    margin-top: 3rem;
    text-align: center;
}
.hp-conversions h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 1rem;
}
.hp-conversions-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: center;
}
.hp-conv-chip {
    display: inline-block;
    padding: .5rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    background: var(--card-bg);
    box-shadow: 0 6px 16px var(--overlay-black-10);
    transition: all .25s;
}
.hp-conv-chip:hover {
    border-color: var(--primary-color);
    color: #fff;
    background: rgba(91,141,239,.12);
    text-decoration: none;
    }



/* --- Recent Used Tools Bubbles --- */
.recent-tools-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.recent-tools-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--light-text, #64748b);
    white-space: nowrap;
}
.recent-tools-bubbles {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.recent-tool-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--primary-color, #0d6efd);
    background: rgba(13, 110, 253, .08);
    border: 1px solid rgba(13, 110, 253, .2);
    border-radius: 100px;
    text-decoration: none;
    transition: all .2s ease;
    white-space: nowrap;
}
.recent-tool-bubble:hover,
.recent-tool-bubble:focus {
    background: var(--primary-color, #0d6efd);
    color: #fff;
    text-decoration: none;
    }
.recent-tool-bubble i {
    font-size: .7rem;
}
.recent-tools-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(100, 116, 139, .12);
    color: #64748b;
    font-size: .85rem;
    line-height: 1;
    cursor: pointer;
    transition: all .2s ease;
    padding: 0;
    margin-left: 2px;
    flex-shrink: 0;
}
.recent-tools-clear:hover {
    background: #ef4444;
    color: #fff;
}

/* --- Tool Search Autocomplete --- */


/* --- Homepage Responsive --- */
@media (max-width: 768px) {
    .hp-search-field {
        width: 100%;
        padding: 0.8rem 0.9rem;
    }

    .hp-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}
@media (max-width: 480px) {
    .hp-showcase-grid {
        grid-template-columns: 1fr;
    }
    .hp-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hp-filter-bar {
        gap: .4rem; 
         margin-top: 5px;
    }
    .hp-filter-btn {
        padding: .42rem .72rem;
        border-radius: 10px;
        font-size: .79rem;
    }
}