/* ============================================================
   FREEONLINETOOL.LK — GLOBAL DESIGN SYSTEM
   Developed by Pencil Codes
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --transition: 0.25s ease;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.15);
    --primary: #4f8ef7;
    --primary-hover: #2563eb;
    --primary-glow: rgba(79,142,247,0.2);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --nav-h: 66px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg:           #0d1117;
    --bg2:          #161b22;
    --bg3:          #21262d;
    --border:       #30363d;
    --border2:      #21262d;
    --text:         #e6edf3;
    --text-muted:   #94a3b8;
    --text-faint:   #94a3b8;
    --card-bg:      rgba(22,27,34,0.85);
    --nav-bg:       rgba(13,17,23,0.92);
    --input-bg:     #0d1117;
    --badge-bg:     rgba(79,142,247,0.12);
    --hero-grad: radial-gradient(ellipse at top right, rgba(79,142,247,0.12) 0%, transparent 60%),
                 radial-gradient(ellipse at bottom left, rgba(34,197,94,0.06) 0%, transparent 60%);
}

/* Light Theme */
[data-theme="light"] {
    --bg:           #f3f6fb;
    --bg2:          #ffffff;
    --bg3:          #eaeff7;
    --border:       #d0d7e3;
    --border2:      #e4e9f2;
    --text:         #1a202c;
    --text-muted:   #475569;
    --text-faint:   #64748b;
    --card-bg:      rgba(255,255,255,0.95);
    --nav-bg:       rgba(255,255,255,0.95);
    --input-bg:     #f3f6fb;
    --badge-bg:     rgba(79,142,247,0.1);
    --hero-grad: radial-gradient(ellipse at top right, rgba(79,142,247,0.08) 0%, transparent 60%),
                 radial-gradient(ellipse at bottom left, rgba(34,197,94,0.04) 0%, transparent 60%);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
    background-image: var(--hero-grad);
    background-attachment: fixed;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── Utility ───────────────────────────────────────────────── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background var(--transition), border-color var(--transition);
}
.nav-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text) !important;
    white-space: nowrap;
    letter-spacing: -0.3px;
}
.logo .logo-dot { color: var(--primary); }
.logo .logo-tld { color: var(--text-muted); font-weight: 600; font-size: 0.95rem; }
.logo svg { width: 28px; height: 28px; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}
.nav-menu a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.nav-menu a:hover, .nav-menu a.active {
    color: var(--text);
    background: var(--bg3);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: var(--bg3);
    border: 1px solid var(--border);
    font-size: 1.1rem;
    transition: all var(--transition);
}
.btn-icon:hover { color: var(--text); border-color: var(--primary); }

.hamburger { display: none; }

/* Mobile Nav */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: fixed;
        top: var(--nav-h);
        left: 0; right: 0;
        background: var(--nav-bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.5rem;
        gap: 0.25rem;
        backdrop-filter: blur(16px);
        max-height: calc(100vh - var(--nav-h));
        overflow-y: auto;
    }
    .nav-menu.open { display: flex; }
    .nav-menu > a, .nav-drop-trigger { padding: 0.75rem 1rem; font-size: 1rem; }
    .hamburger { display: flex; }
    .nav-drop-panel { position: static !important; box-shadow: none !important; border: none !important; background: var(--bg3); border-radius: var(--radius-sm); padding: 0.35rem 0; margin-top: 0.2rem; display: none; }
    .nav-dropdown.open .nav-drop-panel { display: block; }
}

/* ── Nav Dropdowns ─────────────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-drop-trigger {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.nav-drop-trigger:hover { color: var(--text); background: var(--bg3); }
.nav-drop-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 210px;
    padding: 0.4rem 0;
    z-index: 200;
}
.nav-drop-panel a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted) !important;
    transition: all var(--transition);
    border-radius: 0;
}
.nav-drop-panel a:hover { background: var(--bg3); color: var(--primary) !important; }
.nav-dropdown:hover .nav-drop-panel { display: block; }

/* ── Badge new ─────────────────────────────────────────────── */
.badge-new {
    background: rgba(34,197,94,0.12);
    color: #22c55e;
}
.badge-new::before { content: '✦ NEW '; font-size: .6rem; }

/* ── Hero Section ──────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 5rem 1.5rem 3rem;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--badge-bg);
    color: var(--primary);
    border: 1px solid rgba(79,142,247,0.25);
    padding: 0.35rem 0.9rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: 0.3px;
}
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
}
.hero h1 span { color: var(--primary); }
.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto 2rem;
}
.hero-search {
    display: flex;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.4rem 0.4rem 0.4rem 1.25rem;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.hero-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.hero-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text);
}
.hero-search input::placeholder { color: var(--text-muted); }
.hero-search button {
    background: var(--primary);
    color: #fff;
    border-radius: 99px;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background var(--transition), transform 0.1s;
}
.hero-search button:hover { background: var(--primary-hover); }

/* ── Section ───────────────────────────────────────────────── */
.section { padding: 3rem 0; }
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.section-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}
.section-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--badge-bg);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ── Tool Cards Grid ───────────────────────────────────────── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.1rem;
}
.tool-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.25rem;
    text-decoration: none !important;
    color: var(--text) !important;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}
.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}
.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 32px rgba(79,142,247,0.12);
}
.tool-card:hover::before { opacity: 1; }
.tool-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.35rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}
.tool-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.tool-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    flex: 1;
    line-height: 1.5;
}
.tool-card .badge {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    background: var(--badge-bg);
    color: var(--primary);
    letter-spacing: 0.3px;
}
/* Category color variants */
.icon-finance { background: rgba(34,197,94,0.1); color: #22c55e; }
.icon-utility { background: rgba(79,142,247,0.1); color: #4f8ef7; }
.icon-dev     { background: rgba(168,85,247,0.1); color: #a855f7; }
.icon-health  { background: rgba(249,115,22,0.1); color: #f97316; }

/* ── Ad Slot ───────────────────────────────────────────────── */
.ad-slot {
    background: var(--bg2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.78rem;
    margin: 1.5rem 0;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Tool Page Layout ──────────────────────────────────────── */
.tool-page { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-faint); }

.tool-header { margin-bottom: 1.75rem; }
.tool-header .tool-icon-lg {
    width: 52px; height: 52px;
    border-radius: 14px;
    font-size: 1.6rem;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}
.tool-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    letter-spacing: -0.3px;
}
.tool-header p { color: var(--text-muted); max-width: 540px; }

/* ── Panel ─────────────────────────────────────────────────── */
.panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
}
.panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

/* ── FAQ Accordion ─────────────────────────────────────────── */
.faq-item {
    border-bottom: 1px solid var(--border2);
    padding: 1rem 0;
}
.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.faq-q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text);
    transition: color 0.2s;
    user-select: none;
}
.faq-q:hover { color: var(--primary); }
.faq-toggle { transition: transform 0.3s ease; color: var(--text-muted); }
.faq-item.open .faq-toggle { transform: rotate(180deg); }
.faq-a {
    display: none;
    padding-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}
.faq-item.open .faq-a { display: block; animation: fadeUp 0.35s ease both; }

/* ── Form Elements ─────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

input[type="text"], input[type="number"], input[type="url"],
input[type="email"], input[type="tel"], input[type="date"],
input[type="datetime-local"], select, textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
textarea { resize: vertical; min-height: 90px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%238b949e' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 1.1rem; padding-right: 2.2rem; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.checkbox-row input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.checkbox-row label { font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    font-family: var(--font);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 16px var(--primary-glow); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { padding: 0.85rem 1.8rem; font-size: 1rem; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }
.btn-group { display: flex; gap: 0.65rem; flex-wrap: wrap; }

/* ── Result Box ────────────────────────────────────────────── */
.result-box {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    font-size: 0.95rem;
    color: var(--text);
    min-height: 48px;
}
.result-highlight {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border2);
    font-size: 0.9rem;
}
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--text-muted); }
.result-row .value { font-weight: 600; }

/* ── Code Block ────────────────────────────────────────────── */
.code-block {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text);
    min-height: 120px;
    max-height: 400px;
    overflow-y: auto;
    resize: vertical;
    outline: none;
    line-height: 1.55;
}
.code-block:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* ── Related Tools ─────────────────────────────────────────── */
.related-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}
.related-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    transition: border-color 0.2s, transform 0.2s;
    color: var(--text) !important;
}
.related-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.related-card .ri { font-size: 1.1rem; }
.related-card span { font-size: 0.85rem; font-weight: 600; }

/* ── Cookie Banner ─────────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 560px;
    width: calc(100% - 2.5rem);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    font-size: 0.88rem;
}
.cookie-banner p { flex: 1; color: var(--text-muted); }
.cookie-banner a { color: var(--primary); }
.cookie-banner .btn-group { flex-shrink: 0; }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2.5rem;
}
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 560px) { .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; } }

.footer-brand .logo { margin-bottom: 0.75rem; font-size: 1.05rem; }
.footer-brand p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.footer-brand .dev-credit {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
}
.footer-brand .dev-credit a { color: var(--primary); font-weight: 600; }

.footer-col h4,
.footer-col h3,
.footer-col .footer-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-faint);
    margin-bottom: 0.9rem;
}
.footer-col a {
    display: block;
    font-size: 0.87rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: color var(--transition);
}
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-faint);
    flex-wrap: wrap;
}
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--primary); }

/* ── Legal Page ────────────────────────────────────────────── */
.legal-page { max-width: 780px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }
.legal-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.legal-date { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; }
.legal-page h2 { font-size: 1.15rem; font-weight: 700; margin: 2rem 0 0.5rem; color: var(--text); }
.legal-page p { color: var(--text-muted); margin-bottom: 0.85rem; line-height: 1.75; font-size: 0.95rem; }
.legal-page ul { padding-left: 1.5rem; margin-bottom: 0.85rem; }
.legal-page ul li { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.4rem; line-height: 1.6; }

/* ── Homepage Tool Count Stats ─────────────────────────────── */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem 1.5rem 0;
    flex-wrap: wrap;
}
.stat { text-align: center; }
.stat .num { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat .label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ── Trending Converter Pills ──────────────────────────────── */
.trending-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}
.pill-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 99px;
    background: var(--bg2);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
}
.pill-link:hover {
    border-color: var(--primary);
    background: var(--badge-bg);
    color: var(--primary);
    transform: translateY(-1px);
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.45s ease both; }

/* ── Touch Targets & Accessibility Defaults ───────────────── */
.btn {
    min-height: 44px;
    box-sizing: border-box;
}
.btn-icon {
    min-width: 40px;
    min-height: 40px;
    box-sizing: border-box;
}

/* ── Responsive Tables & Code Blocks ───────────────────────── */
.table-responsive,
.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}
table {
    max-width: 100%;
}
.code-block, pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Responsive (Tablet & Mobile <= 768px) ─────────────────── */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
    .hero {
        padding: 3rem 1rem 2rem;
    }
    .hero h1 {
        font-size: clamp(1.85rem, 6vw, 2.5rem);
    }
    .tool-page {
        padding: 1.25rem 1rem 3rem;
        width: 100%;
        max-width: 100%;
    }
    .panel {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-sm);
    }
    .stats-bar {
        gap: 1.75rem;
    }
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    .btn-group .btn {
        width: 100%;
        justify-content: center;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    input[type="text"], input[type="number"], input[type="url"],
    input[type="email"], input[type="tel"], input[type="date"],
    input[type="datetime-local"], select, textarea {
        font-size: 16px !important;
        min-height: 44px;
    }
    .btn-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    .nav-drop-panel a {
        padding: 0.7rem 1.25rem !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        font-size: 0.92rem !important;
    }
    .pass-checker, .pass-generator,
    .calc-inputs, .calc-results,
    .converter-inputs, .converter-preview,
    .scanner-inputs, .scanner-results {
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* ── Responsive (Small Phones <= 480px) ────────────────────── */
@media (max-width: 480px) {
    .hero {
        padding: 2.25rem 0.85rem 1.5rem;
    }
    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    .hero p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    .hero-search {
        width: 100%;
        padding: 0.35rem 0.35rem 0.35rem 1rem;
    }
    .hero-search button {
        padding: 0.55rem 0.9rem;
        font-size: 0.85rem;
    }
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .related-tools {
        grid-template-columns: 1fr;
    }
    .tool-header h1 {
        font-size: 1.4rem;
        line-height: 1.25;
    }
    .tool-header p {
        font-size: 0.88rem;
    }
    .result-highlight {
        font-size: 1.45rem;
        word-break: break-word;
    }
    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    .result-row .value {
        align-self: flex-start;
    }
    .stats-bar {
        gap: 1.25rem;
    }
    .stat .num {
        font-size: 1.45rem;
    }
    .pill-link {
        font-size: 0.8rem;
        padding: 0.45rem 0.8rem;
        min-height: 38px;
    }
    .cookie-banner {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        width: auto;
        transform: none;
        flex-direction: column;
        text-align: center;
        padding: 1rem 0.85rem;
        gap: 0.75rem;
    }
    .cookie-banner .btn-group {
        width: 100%;
        flex-direction: row;
        gap: 0.5rem;
    }
    .cookie-banner .btn {
        flex: 1;
        min-height: 44px;
        padding: 0.6rem 0.75rem;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        padding: 2.25rem 1rem 1.5rem;
    }
    .footer-col a {
        padding: 0.3rem 0;
        min-height: 36px;
        display: flex;
        align-items: center;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem;
    }
}
