/* ============================================================
   OMNITOOLS HUB — SITE STYLES
   Theme: light by default, dark via <html class="dark-mode">.
   All colors come from the variables below; components never
   hard-code background or text colors, so dark mode "just works".
   ============================================================ */

/* ---------- 0. SITE FONT (Inter, self-hosted) ----------
   One variable font file covers every weight (100-900).
   - inter-latin.woff2     (~48 KB): English letters, digits, symbols — always used
   - inter-latin-ext.woff2 (~85 KB): extra letters such as ğ ş İ — the browser downloads it
     only when a page actually contains one of those letters
   font-display: swap -> text shows immediately in the fallback font, no blank text.
   "Inter Fallback" = Arial resized to Inter's measurements, so nothing jumps when Inter arrives. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Inter Fallback";
    src: local("Arial"), local("ArialMT");
    ascent-override: 90.44%;
    descent-override: 22.52%;
    line-gap-override: 0%;
    size-adjust: 107.12%;
}

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
    color-scheme: light;

    --bg-body: #ffffff;
    --bg-surface: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-code: #f1f5f9;

    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;

    --text-primary: #0f172a;
    --text-body: #334155;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-ring: rgba(37, 99, 235, 0.25);
    --on-primary: #ffffff;

    --badge-bg: #eff6ff;
    --badge-text: #1e40af;

    --success-bg: #dcfce7;
    --success-border: #bbf7d0;
    --success-text: #166534;
    --danger-bg: #fee2e2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;
    --danger: #b91c1c;
    --warning-bg: #fef3c7;
    --warning-border: #fde68a;
    --warning-text: #92400e;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;

    --font-main: "Inter", "Inter Fallback", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: Consolas, Monaco, "Courier New", monospace;
    --max-width: 100%;
    --header-height: 64px;
}

html.dark-mode {
    color-scheme: dark;

    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --bg-code: #0f172a;

    --border-color: #334155;
    --border-hover: #475569;

    --text-primary: #f8fafc;
    --text-body: #cbd5e1;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-ring: rgba(96, 165, 250, 0.35);

    --badge-bg: #1e3a8a;
    --badge-text: #bfdbfe;

    --success-bg: #14532d;
    --success-border: #166534;
    --success-text: #bbf7d0;
    --danger-bg: #450a0a;
    --danger-border: #7f1d1d;
    --danger-text: #fecaca;
    --danger: #f87171;
    --warning-bg: #451a03;
    --warning-border: #78350f;
    --warning-text: #fde68a;

    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2.5rem); }

/* Visually hidden but readable by screen readers */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.text-muted { color: var(--text-muted); }

/* Skip link (accessibility) */
.skip-link {
    position: absolute; top: -100px; left: 0; z-index: 10001;
    background: var(--primary); color: var(--on-primary);
    padding: 8px 16px; font-weight: 600;
    border-radius: 0 0 var(--radius-lg) 0;
    transition: top 0.2s ease-in-out;
}
.skip-link:focus { top: 0; }

/* Users who prefer less motion get no transitions */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- 3. HEADER ---------- */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); }
.logo { font-size: 1.2rem; font-weight: 700; color: var(--primary); letter-spacing: -0.01em; }
.logo img { display: block; height: 34px; width: auto; }
html.dark-mode .logo { color: var(--text-primary); }

.header-actions { display: flex; align-items: center; gap: 1.5rem; }

.nav-menu { display: flex; align-items: center; gap: 1.5rem; list-style: none; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }
.nav-menu li { white-space: nowrap; }
.nav-menu a:hover,
.nav-menu a[aria-current="page"] { color: var(--primary); }
.nav-menu .nav-highlight { font-weight: 700; color: var(--primary); }

.action-buttons { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
    background: transparent; border: 1px solid var(--border-color);
    border-radius: var(--radius); width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-primary); font-size: 1.1rem;
    transition: background-color 0.2s, border-color 0.2s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-surface); border-color: var(--border-hover); }
.hamburger-btn { display: none; }

/* ---------- 4. MOBILE DRAWER ---------- */
.mobile-drawer {
    position: fixed; top: 0; left: 0; z-index: 200;
    width: 260px; height: 100vh; height: 100dvh;
    background: var(--bg-card); border-right: 1px solid var(--border-color);
    padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem;
    transform: translateX(-100%); transition: transform 0.25s ease-in-out;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
}
.mobile-drawer.active { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.close-drawer-btn { background: transparent; border: none; font-size: 1.6rem; cursor: pointer; color: var(--text-secondary); line-height: 1; padding: 0 0.25rem; }
.mobile-drawer ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.mobile-drawer a { font-size: 0.95rem; font-weight: 500; color: var(--text-secondary); display: block; padding: 0.4rem 0; }
.mobile-drawer a:hover,
.mobile-drawer a[aria-current="page"] { color: var(--primary); }
.drawer-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); z-index: 150; display: none; }
.drawer-overlay.active { display: block; }
body.no-scroll { overflow: hidden; }

/* ---------- 5. HERO + SEARCH ---------- */
.hero {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 0 1rem;
    text-align: center;
}
.hero h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.3rem; letter-spacing: -0.02em; }
.hero p { font-size: 0.85rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 0.75rem; }

.search-wrapper { max-width: 500px; margin: 0 auto 0.75rem; position: relative; }
.search-input {
    width: 100%; padding: 0.5rem 0.9rem;
    border: 1px solid var(--border-color); border-radius: var(--radius);
    font-size: 0.9rem; background: var(--bg-input); color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }

.search-dropdown {
    position: absolute; top: calc(100% + 5px); left: 0; width: 100%; z-index: 100;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); box-shadow: var(--shadow-md);
    flex-direction: column; max-height: 300px; overflow-y: auto; text-align: left;
}
.search-dropdown:not([hidden]) { display: flex; }
.search-dropdown a {
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
    font-size: 0.9rem; color: var(--text-primary); transition: background-color 0.15s;
}
.search-dropdown a:last-child { border-bottom: none; }
.search-dropdown a:hover,
.search-dropdown a[aria-selected="true"] { background: var(--bg-surface); }
.search-dropdown a span { font-size: 0.75rem; color: var(--text-muted); background: var(--bg-surface); padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); white-space: nowrap; }
.search-empty { padding: 1rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.category-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.35rem; }
.pill-btn {
    background: var(--bg-input); border: 1px solid var(--border-color);
    padding: 0.25rem 0.65rem; border-radius: 16px;
    font-size: 0.75rem; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.pill-btn:hover,
.pill-btn.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ---------- 6. MAIN + TOOL CARDS ---------- */
.main-content { padding-top: 2rem; padding-bottom: 2rem; flex: 1; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-title { font-size: 1.2rem; font-weight: 700; }
.section-count { font-size: 0.825rem; color: var(--text-secondary); }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.tools-grid--compact { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tools-empty { grid-column: 1 / -1; text-align: center; padding: 2rem 1rem; color: var(--text-muted); }

.tool-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 1.25rem;
    display: flex; flex-direction: column; justify-content: space-between;
}
.tool-card[hidden] { display: none; }
.tool-card:hover { border-color: var(--border-hover); }
.tool-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
.tool-card h3 { font-size: 1rem; font-weight: 600; }
.category-badge { background: var(--badge-bg); color: var(--badge-text); font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.4rem; border-radius: var(--radius-sm); white-space: nowrap; }
.tool-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tool-card-footer { border-top: 1px solid var(--border-color); padding-top: 0.75rem; display: flex; align-items: center; justify-content: space-between; }
.tool-link { font-size: 0.85rem; font-weight: 600; color: var(--primary); }
.tool-link:hover { text-decoration: underline; }
.exec-type { font-size: 0.75rem; color: var(--text-muted); }

/* Smaller card variant (recently used tools) */
.tool-card--compact { padding: 1rem; }
.tool-card--compact h3 { font-size: 0.95rem; }
.tool-card--compact p { font-size: 0.8rem; margin-bottom: 0; }
.tool-card--compact .tool-card-footer { margin-top: 0.75rem; }
.tool-card--compact .tool-link { font-size: 0.8rem; }
.tool-card--compact .exec-type { font-size: 0.7rem; }

/* Home: about + recent tools */
.about-section { background: var(--bg-surface); border-top: 1px solid var(--border-color); padding: 2.5rem 0; }
.about-section .container { max-width: 780px; text-align: center; }
.about-section .section-title { margin-bottom: 0.75rem; }
.about-section p { font-size: 0.9rem; color: var(--text-secondary); }

.recent-section { padding-top: 2rem; padding-bottom: 2rem; }
.recent-section .section-title { font-size: 1.1rem; color: var(--text-secondary); }
.link-btn { background: none; border: none; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--primary); }
.link-btn:hover { text-decoration: underline; }
.link-btn--danger { color: var(--danger); }

/* ---------- 7. TOOL PAGE ---------- */
.tool-page { flex: 1; min-width: 0; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 2rem; }
.tool-page-header { margin-bottom: 1.75rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.tool-page-header .tool-category { display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--primary); background: var(--badge-bg); padding: 0.2rem 0.5rem; border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
.tool-page-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.4rem; }
.tool-page-header p { font-size: 0.9rem; color: var(--text-secondary); }
.tool-body { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.75rem; margin-bottom: 2rem; }

.tool-form label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.tool-form textarea,
.tool-form input[type="text"],
.tool-form input[type="number"],
.tool-form select { width: 100%; padding: 0.7rem 0.8rem; border: 1px solid var(--border-color); border-radius: var(--radius); font-size: 0.9rem; color: var(--text-primary); background: var(--bg-input); }
.tool-form textarea { min-height: 200px; resize: vertical; font-family: var(--font-mono); font-size: 0.85rem; }
.tool-form textarea:focus,
.tool-form input:focus,
.tool-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.tool-form .form-group { margin-bottom: 1rem; }

.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 1rem; border-radius: var(--radius);
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary);
}
.btn:hover { border-color: var(--border-hover); background: var(--bg-surface); }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.btn.is-done { color: var(--success-text); border-color: var(--success-border); background: var(--success-bg); }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* Form fields inside tools that set no colours of their own follow the theme.
   :where() has zero specificity, so any rule written by the tool still wins. */
:where(.tool-body) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea) {
    background-color: var(--bg-input); color: var(--text-primary); border-color: var(--border-color);
}
:where(.tool-body) ::placeholder { color: var(--text-muted); opacity: 1; }

/* Copy / download bar added by main.js above tool outputs */
.tool-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-bottom: 0.5rem; }

.tool-result { margin-top: 1.25rem; padding: 1rem; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius); font-size: 0.875rem; }
.tool-result.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.tool-result.error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.tool-result pre { font-family: var(--font-mono); font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; }
.tool-placeholder { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }
.tool-placeholder h2 { color: var(--text-primary); margin-bottom: 0.5rem; }

/* Tool page layout */
.tool-page h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.4rem; line-height: 1.25; }
a.tool-category:hover { text-decoration: underline; }
.tool-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tool-title-main { display: flex; align-items: flex-start; gap: 1rem; min-width: 0; }
.tool-icon {
    flex-shrink: 0; width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--badge-bg); color: var(--primary); font-size: 1.6rem; font-weight: 700;
}
.tool-page-header .tool-lead { font-size: 1rem; color: var(--text-secondary); max-width: 640px; }
.tool-actions-top { display: flex; flex-wrap: wrap; gap: 0.5rem; flex-shrink: 0; }
.tool-actions-top .btn { gap: 0.35rem; padding: 0.45rem 0.8rem; font-size: 0.8rem; border-radius: var(--radius-lg); }
.tool-meta .tool-category { margin: 0; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.related-grid .tool-card p { margin-bottom: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 7a. TOOL PAGE LAYOUT: left "All Tools" list + content ---------- */
.tool-layout { display: flex; align-items: flex-start; flex: 1; width: 100%; position: relative; }
.tool-sidebar {
    flex: 0 0 260px; width: 260px; position: sticky; top: var(--header-height);
    height: calc(100vh - var(--header-height)); border-right: 1px solid var(--border-color);
    background: var(--bg-body);
}
.tool-sidebar-inner { height: 100%; display: flex; flex-direction: column; padding: 1rem 0.75rem 0; }
.tool-sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 2rem; scrollbar-width: thin; }
.tool-sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; padding: 0 0.25rem; }
.tool-sidebar-title { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.tool-sidebar-close { display: none; width: 32px; height: 32px; font-size: 1.3rem; }
.tool-sidebar-search { padding: 0.45rem 0.7rem; font-size: 0.85rem; margin-bottom: 0.75rem; }
.sb-group { margin-bottom: 0.15rem; }
.sb-group[hidden] { display: none; }
.sb-group summary {
    list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
    padding: 0.45rem 0.5rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 600; color: var(--text-primary);
}
.sb-group summary::-webkit-details-marker { display: none; }
.sb-group summary::after { content: '›'; color: var(--text-muted); font-size: 1.1rem; line-height: 1; transition: transform 0.15s; }
.sb-group[open] summary::after { transform: rotate(90deg); }
.sb-group summary:hover { background: var(--bg-surface); }
.sb-group summary > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-count { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.sb-group ul { list-style: none; margin: 0.15rem 0 0.4rem 0.6rem; border-left: 1px solid var(--border-color); }
.sb-group li[hidden] { display: none; }
.sb-group a {
    display: block; padding: 0.3rem 0.6rem; font-size: 0.82rem; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 0 var(--radius) var(--radius) 0;
}
.sb-group a:hover { color: var(--primary); background: var(--bg-surface); }
.sb-group a[aria-current="page"] { color: var(--primary); font-weight: 600; background: var(--badge-bg); box-shadow: inset 2px 0 0 var(--primary); }

.tool-sidebar-toggle {
    position: fixed; top: calc(var(--header-height) + 12px); left: 240px; z-index: 40;
    width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md); cursor: pointer;
}
.tool-sidebar-toggle:hover { color: var(--primary); }
.tool-layout.sidebar-hidden .tool-sidebar { display: none; }
.tool-layout.sidebar-hidden .tool-sidebar-toggle { left: 12px; }
.tool-sidebar-fab, .tool-sidebar-overlay { display: none; }

@media (max-width: 1024px) {
    .tool-sidebar-toggle { display: none; }
    .tool-sidebar, .tool-layout.sidebar-hidden .tool-sidebar {
        display: block; position: fixed; top: 0; left: 0; z-index: 210; height: 100vh; height: 100dvh;
        width: 290px; max-width: 85vw; transform: translateX(-100%); transition: transform 0.25s ease-in-out;
    }
    .tool-layout.sidebar-open .tool-sidebar { transform: translateX(0); box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1); }
    .tool-sidebar-close { display: flex; }
    .tool-sidebar-fab {
        display: inline-flex; align-items: center; gap: 0.4rem; position: fixed; left: 16px; bottom: 20px; z-index: 190;
        padding: 0.65rem 1rem; min-height: 44px; border: none; border-radius: 999px; cursor: pointer;
        background: var(--primary); color: var(--on-primary); font-size: 0.8rem; font-weight: 600; box-shadow: var(--shadow-md);
    }
    .tool-sidebar-overlay:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, 0.4); }
}
@media (max-width: 640px) {
    .tool-title-row { flex-direction: column; }
    .tool-icon { width: 44px; height: 44px; font-size: 1.25rem; border-radius: 10px; }
}
.tool-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.75rem; font-size: 0.82rem; color: var(--text-muted); }
.tool-meta strong { color: var(--text-primary); }
.stars { color: #f59e0b; letter-spacing: 1px; margin-right: 0.25rem; }

.fav-btn.is-on { color: #ef4444; border-color: #fecaca; }
.fav-btn.is-on svg { fill: currentColor; }
html.dark-mode .fav-btn.is-on { border-color: #7f1d1d; }

.tool-section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border-color); }
.tool-section > h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-primary); }
.section-more { margin-top: 1rem; font-size: 0.9rem; font-weight: 600; }
.section-more a { color: var(--primary); }
.section-more a:hover { text-decoration: underline; }

/* Long-form tool article */
.tool-content {
    margin-top: 2rem; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 1.75rem;
}
.prose { font-size: 0.95rem; line-height: 1.75; color: var(--text-body); }
.prose h2 { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); margin: 1.75rem 0 0.75rem; }
.prose h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 1.4rem 0 0.6rem; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre { margin-bottom: 1rem; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin-bottom: 0.35rem; }
.prose a { color: var(--primary); text-decoration: underline; }
.prose code { background: var(--bg-code); padding: 0.1rem 0.35rem; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.88em; }
.prose pre { background: #0f172a; color: #f8fafc; padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border-color); padding: 0.5rem 0.75rem; text-align: left; }
.prose th { background: var(--bg-surface); color: var(--text-primary); }
.prose img { border-radius: var(--radius); }

/* Generic panel + helpers */
.panel { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; }
.pre-line { white-space: pre-line; font-size: 0.9rem; line-height: 1.7; color: var(--text-secondary); }
.pre-wrap { white-space: pre-wrap; font-size: 0.85rem; line-height: 1.7; color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.small { font-size: 0.82rem; }

/* Rating */
.rating-box { margin-bottom: 1rem; }
.rating-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.rating-box p { margin-top: 0.6rem; }
.star-group { display: flex; gap: 0.15rem; }
.star-btn { background: none; border: none; padding: 0 2px; font-size: 1.9rem; line-height: 1; cursor: pointer; color: var(--border-hover); transition: color 0.15s; }
.star-btn.is-on { color: #f59e0b; }

/* Forms on public pages */
.form-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.form-title { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 0.75rem; }
.input {
    width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border-color); border-radius: var(--radius);
    background: var(--bg-input); color: var(--text-primary);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
textarea.input { resize: vertical; }
.radio-row { display: flex; gap: 1.25rem; border: 0; }
.radio-row label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.alert-error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }

/* Comments */
.comment-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.comment-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.comment-replies { margin-top: 0.75rem; padding-left: 1rem; border-left: 2px solid var(--border-color); }
.comment-reply { margin-bottom: 0.6rem; }
.comment-reply .category-badge { margin-left: 0.3rem; }
.comment-reply p { margin-top: 0.2rem; }

/* Share buttons */
.share-list { display: flex; gap: 0.5rem; flex-wrap: wrap; list-style: none; }
.share-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%; color: #ffffff; font-weight: 700;
    transition: transform 0.2s;
}
.share-btn:hover { transform: scale(1.1); }
.share-x  { background: #0f172a; }
.share-fb { background: #1877f2; }
.share-in { background: #0a66c2; }
.share-wa { background: #128c4b; }
html.dark-mode .share-x { background: #000000; border: 1px solid var(--border-color); }

/* ---------- 7b. BREADCRUMB, CATEGORIES, FAQ ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.breadcrumb li + li::before { content: '/'; color: var(--border-hover); margin-right: 0.3rem; }
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text-primary); font-weight: 500; }

.page-hero { padding: 2rem 0 1.5rem; }
.page-hero .breadcrumb ol { justify-content: center; }
.page-hero h1 { font-size: 1.9rem; margin-bottom: 0.5rem; }
.page-hero p { font-size: 0.95rem; max-width: 680px; }

.home-section { margin-top: 3rem; }
.home-section > .section-title { margin-bottom: 1rem; }

.category-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.category-card {
    display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
    padding: 0.9rem 1rem; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); transition: border-color 0.15s;
}
.category-card:hover { border-color: var(--primary); }
.category-card-name { font-weight: 600; color: var(--text-primary); }
.category-card-count { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

.tool-card h3 a { color: var(--text-primary); }
.tool-card h3 a:hover { color: var(--primary); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-secondary); }
.empty-state p { margin-bottom: 1rem; }

.faq-list { display: flex; flex-direction: column; gap: 0.6rem; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); }
.faq-item summary {
    cursor: pointer; list-style: none; padding: 0.9rem 1.1rem; font-weight: 600; color: var(--text-primary);
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--text-muted); line-height: 1; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 1.1rem 1rem; font-size: 0.9rem; line-height: 1.7; color: var(--text-secondary); }

/* ---------- 8. NEWSLETTER ---------- */
.newsletter { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); padding: 3rem 0; margin-top: auto; color: #ffffff; }
.newsletter .container { max-width: 600px; text-align: center; }
.newsletter h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.newsletter p { color: #bfdbfe; font-size: 0.95rem; margin-bottom: 1.5rem; }
.newsletter-form { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; max-width: 500px; margin: 0 auto; }
.newsletter-form input {
    flex: 1; min-width: 240px; padding: 0.75rem 1rem;
    border: 1px solid #3b82f6; border-radius: var(--radius);
    font-size: 0.9rem; background: #ffffff; color: #0f172a;
}
.newsletter-form input:focus { outline: 2px solid #ffffff; outline-offset: 2px; }
.newsletter-form button {
    padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius);
    background: #ffffff; color: #1e3a8a; font-weight: 700; font-size: 0.9rem;
    cursor: pointer; white-space: nowrap; transition: background-color 0.2s;
}
.newsletter-form button:hover { background: #dbeafe; }
.newsletter-form button:disabled { opacity: 0.7; cursor: wait; }
.newsletter-form button:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.newsletter .newsletter-msg { margin: 1rem 0 0; font-size: 0.85rem; font-weight: 600; min-height: 1.3em; }
.newsletter-msg.is-success { color: #dcfce7; }
.newsletter-msg.is-error { color: #fecaca; }

/* ---------- 9. FOOTER ---------- */
.ad-slot { margin: 1.5rem auto; text-align: center; }
.site-footer { background: var(--bg-card); border-top: 1px solid var(--border-color); padding: 1.5rem 0; font-size: 0.825rem; color: var(--text-secondary); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; list-style: none; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }

/* ---------- 10. COOKIE BANNER ---------- */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
    background: var(--bg-card); border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05); padding: 1.5rem;
    align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.cookie-banner:not([hidden]) { display: flex; }
.cookie-text { flex: 1; min-width: 280px; font-size: 0.9rem; color: var(--text-body); line-height: 1.5; }
.cookie-text strong { display: block; color: var(--text-primary); font-size: 1rem; margin-bottom: 0.3rem; }
.cookie-text a { color: var(--primary); text-decoration: underline; }
.cookie-actions { display: flex; gap: 0.8rem; flex-shrink: 0; }

/* ---------- 11. PWA INSTALL BUTTON ---------- */
.pwa-install-btn {
    position: fixed; bottom: 20px; right: 20px; z-index: 9998;
    align-items: center; gap: 8px;
    padding: 10px 16px; border: none; border-radius: 30px;
    background: var(--primary); color: var(--on-primary);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.pwa-install-btn:not([hidden]) { display: flex; }
.pwa-install-btn:hover { background: var(--primary-hover); }

/* ---------- 12. NETWORK STATUS BAR ---------- */
.network-status {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 10000;
    padding: 10px; text-align: center; font-size: 0.9rem; font-weight: 600;
}
.network-status.offline { background: var(--danger-bg); color: var(--danger-text); border-top: 1px solid var(--danger-border); }
.network-status.online  { background: var(--success-bg); color: var(--success-text); border-top: 1px solid var(--success-border); }

/* ---------- 13. 404 + STATUS PAGES ---------- */
.notfound-box { max-width: 640px; margin: 1rem auto 0; text-align: center; }
.notfound-icon { font-size: 4rem; line-height: 1; margin-bottom: 0.75rem; }
.notfound-box h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.75rem; }
.notfound-code { display: block; font-size: 3rem; color: var(--primary); line-height: 1.1; }
.notfound-box > p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.notfound-box .search-row { margin: 0 auto 1.25rem; max-width: 480px; }

.status-card { max-width: 560px; margin: 1rem auto; padding: 2.5rem 2rem; text-align: center; }
.status-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.75rem; }
.status-card p { color: var(--text-secondary); line-height: 1.6; margin-bottom: 1.25rem; }

/* ---------- 14. FAVORITES PAGE ---------- */
.tool-card .remove-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--danger); padding: 0; opacity: 0.8; transition: opacity 0.2s, transform 0.2s; }
.tool-card .remove-btn:hover { opacity: 1; transform: scale(1.1); }

/* ---------- 15. BLOG LIST ---------- */
.blog-filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 2rem; }
.blog-filters a { padding: 0.4rem 1rem; border-radius: 20px; border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }
.blog-filters a:hover,
.blog-filters a.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.post-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.post-card:hover { border-color: var(--border-hover); }
.post-card-media { display: block; }
.post-card-img { width: 100%; height: 180px; object-fit: cover; background: var(--bg-surface); display: block; }
.post-card-img-placeholder { width: 100%; height: 180px; background: linear-gradient(135deg, var(--badge-bg), var(--bg-surface)); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.post-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.post-card-cat { display: inline-block; font-size: 0.7rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.post-card-cat:hover { text-decoration: underline; }
.post-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.3; }
.post-card-title a { color: var(--text-primary); }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; flex: 1; margin-bottom: 1rem; }
.post-card-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; padding-top: 0.75rem; border-top: 1px solid var(--border-color); }
.post-card-author { font-weight: 600; color: var(--text-secondary); }

/* ---------- 16. BLOG POST ---------- */
.article-wrap { width: 100%; max-width: 760px; margin: 2rem auto; padding: 0 1.25rem; }
.toc-container { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 0.9rem 1.2rem; margin-bottom: 2rem; }
.toc-container summary { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); cursor: pointer; user-select: none; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.toc-container summary::-webkit-details-marker { display: none; }
.toc-container summary::after { content: '▾'; margin-left: auto; color: var(--text-secondary); transition: transform 0.15s; font-size: 0.8rem; }
.toc-container[open] summary::after { transform: rotate(180deg); }
.toc-list { list-style: none; margin: 0.75rem 0 0; border-left: 2px solid var(--border-color); }
.toc-list a { display: block; padding: 0.35rem 0.75rem; font-size: 0.875rem; color: var(--text-secondary); border-left: 2px solid transparent; margin-left: -2px; line-height: 1.4; transition: color 0.15s, border-color 0.15s; }
.toc-list a:hover { color: var(--primary); border-left-color: var(--primary); }
.toc-list li.toc-level-3 a { padding-left: 1.5rem; font-size: 0.825rem; }
.article-cat-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--primary); background: var(--badge-bg); padding: 0.25rem 0.7rem; border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.article-title { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; color: var(--text-primary); }
.article-meta { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-secondary); padding: 1rem 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); margin-bottom: 2rem; }
.article-meta strong { color: var(--text-primary); }
.article-featured { width: 100%; height: auto; border-radius: var(--radius-lg); margin-bottom: 2rem; display: block; }
a.article-cat-badge:hover { text-decoration: underline; }
.article-content { font-size: 1rem; line-height: 1.8; color: var(--text-body); }
.article-content h2 { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin: 2rem 0 0.8rem; scroll-margin-top: 80px; }
.article-content h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); margin: 1.5rem 0 0.6rem; scroll-margin-top: 80px; }
.article-content p { margin-bottom: 1.2rem; }
.article-content ul, .article-content ol { margin-bottom: 1.2rem; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.4rem; }
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content a:hover { text-decoration: none; }
.article-content code { background: var(--bg-code); padding: 0.15rem 0.4rem; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.88em; color: #db2777; }
html.dark-mode .article-content code { color: #f9a8d4; }
.article-content pre { background: #0f172a; color: #f8fafc; padding: 1rem 1.2rem; border-radius: var(--radius-lg); overflow-x: auto; margin-bottom: 1.2rem; font-size: 0.85rem; line-height: 1.5; }
html.dark-mode .article-content pre { border: 1px solid var(--border-color); }
.article-content pre code { background: none; color: inherit; padding: 0; }
.article-content blockquote { border-left: 4px solid var(--primary); padding-left: 1rem; color: var(--text-secondary); font-style: italic; margin-bottom: 1.2rem; }
.article-content img { max-width: 100%; border-radius: var(--radius); margin: 1rem 0; }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 3rem 0 2rem; padding-top: 2rem; border-top: 1px solid var(--border-color); }
.article-nav a { display: block; padding: 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-lg); color: inherit; }
.article-nav a:hover { border-color: var(--primary); }
.article-nav-dir, .article-nav-title { display: block; }
.article-nav-dir { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.article-nav-title { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); line-height: 1.3; }
.article-nav .next { text-align: right; }

/* ---------- 17. CHANGELOG ---------- */
.cl-entry { position: relative; padding-left: 2rem; padding-bottom: 2rem; border-left: 2px solid var(--border-color); }
.cl-entry:last-child { border-left-color: transparent; padding-bottom: 0; }
.cl-entry::before { content: ''; position: absolute; left: -8px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg-body); box-shadow: 0 0 0 2px var(--primary); }
.cl-version { display: inline-block; background: var(--primary); color: var(--on-primary); font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: var(--radius-sm); margin-right: 0.5rem; }
.cl-date { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }
.cl-title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); margin: 0.5rem 0 0.75rem; }
.cl-items { list-style: none; }
.cl-items li { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; padding: 0.25rem 0; }
.cl-items li::before { content: '✓'; color: #16a34a; font-weight: 700; margin-right: 0.5rem; }

/* ---------- 18. HTML SITEMAP ---------- */
.sm-section { margin-bottom: 2.5rem; }
.sm-section h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--primary); color: var(--text-primary); }
.sm-section h3 { font-size: 0.95rem; font-weight: 700; margin: 1.25rem 0 0.5rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.sm-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.3rem; }
.sm-list a { display: block; padding: 0.35rem 0.5rem; font-size: 0.875rem; color: var(--primary); border-radius: var(--radius-sm); }
.sm-list a:hover { background: var(--bg-surface); text-decoration: underline; }
.sm-section h3 a { color: inherit; }
.sm-section h3 a:hover { color: var(--primary); text-decoration: underline; }

/* ---------- 19. CONTENT PAGES, FORMS, SEARCH ---------- */
.content-page { width: 100%; max-width: 800px; margin: 2rem auto; padding: 0 1.25rem; }
.content-page--narrow { max-width: 700px; }
.content-page--wide { max-width: 1000px; }
.content-page > h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.5rem; }
.page-lead { color: var(--text-secondary); margin-bottom: 1.5rem; }
.page-updated { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.page-back { text-align: center; margin-top: 2rem; }
.content-page .panel.prose { padding: 1.75rem; }
.text-center { text-align: center; }

.card-rank { color: #d97706; font-weight: 800; }
.tool-card p.card-note { font-size: 0.75rem; font-weight: 600; margin: -0.75rem 0 1rem; }
.card-note--muted { color: var(--text-muted); }
.card-note--success { color: #15803d; }
.card-note--warning { color: #c2410c; }
html.dark-mode .card-note--success { color: #4ade80; }
html.dark-mode .card-note--warning { color: #fb923c; }
html.dark-mode .card-rank { color: #fbbf24; }

.empty-state h2, .empty-state h3 { font-size: 1.2rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.empty-icon { font-size: 3rem; line-height: 1; margin-bottom: 0.75rem; }

.field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.input--short { max-width: 200px; }
.input--select { width: auto; min-width: 170px; padding: 0.45rem 0.75rem; font-size: 0.85rem; }
.captcha-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 1rem; }
.btn-block { width: 100%; justify-content: center; padding: 0.8rem; font-size: 1rem; }
.btn-danger { background: #dc2626; border-color: #dc2626; color: #ffffff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-group--center { justify-content: center; }

.search-page { max-width: 900px; margin: 0 auto 2rem; }
.search-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 1rem; overflow-wrap: anywhere; }
.search-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search-row .search-input { flex: 1; }
.filter-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filter-label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.chip-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { font-size: 0.75rem; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: 12px; background: var(--badge-bg); color: var(--badge-text); }
.chip--warning { background: #fef3c7; color: #92400e; }
html.dark-mode .chip--warning { background: #451a03; color: #fde68a; }
.result-count { color: var(--text-secondary); font-size: 0.9rem; }
.search-empty-box { max-width: 600px; margin: 0 auto; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination-gap { color: var(--text-muted); padding: 0 0.25rem; }

/* ---------- 20. RESPONSIVE ---------- */
@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .hamburger-btn { display: flex; }
    .header-actions { gap: 0; }
    .hero { padding: 0.85rem 0 0.75rem; }
    .hero h1 { font-size: 1.25rem; }
    .hero p { font-size: 0.8rem; margin-bottom: 0.6rem; }
    .search-input { padding: 0.45rem 0.8rem; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
    .tool-page-header h1, .tool-page h1 { font-size: 1.4rem; }
    .page-hero h1, .content-page > h1 { font-size: 1.4rem; }
    .tool-content { padding: 1.25rem; }
    .tool-body { padding: 1.25rem; }
}
@media (max-width: 640px) {
    .article-title { font-size: 1.5rem; }
    .article-nav { grid-template-columns: 1fr; }
    .article-nav .next { text-align: left; }
}
@media (max-width: 600px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .cookie-banner { padding: 1rem; gap: 1rem; }
    .cookie-actions { width: 100%; }
    .cookie-actions .btn { flex: 1; justify-content: center; }
}