* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --bg: #f6f7fb;
    --content-bg: #f6f7fb;
    --card-bg: #ffffff;
    --card-border: #e5e9f2;
    --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.07);
    --sidebar-bg: #ffffff;
    --sidebar-text: #475569;
    --sidebar-muted: #94a3b8;
    --sidebar-title: #0f172a;
    --sidebar-item-active-text: #4f46e5;
    --sidebar-hover: rgba(99, 102, 241, 0.08);
    --sidebar-active: rgba(99, 102, 241, 0.12);
    --sidebar-border: #e5e9f2;
    --sidebar-shadow: 4px 0 24px rgba(15, 23, 42, 0.06);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --dark: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --output-bg: #f8fafc;
    --footer-bg: #0f172a;
    --footer-text: #cbd5e1;
    --footer-link-bg: rgba(99, 102, 241, 0.15);
    --input-bg: #ffffff;
    --toolbar-bg: #ffffff;
    --hero-grad: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08), transparent 65%);
}

[data-theme="dark"] {
    --bg: #0b1120;
    --content-bg: #0b1120;
    --card-bg: #151d2e;
    --card-border: #2a3550;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --sidebar-bg: #070d1a;
    --sidebar-text: #94a3b8;
    --sidebar-muted: #475569;
    --sidebar-title: #f1f5f9;
    --sidebar-item-active-text: #c7d2fe;
    --sidebar-hover: rgba(99, 102, 241, 0.18);
    --sidebar-active: rgba(99, 102, 241, 0.28);
    --sidebar-border: rgba(148, 163, 184, 0.12);
    --sidebar-shadow: 3px 0 20px rgba(0, 0, 0, 0.35);
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --secondary: #a78bfa;
    --success: #34d399;
    --dark: #f1f5f9;
    --text: #cbd5e1;
    --muted: #94a3b8;
    --danger: #f87171;
    --warning: #fbbf24;
    --border: #2a3550;
    --output-bg: #0f172a;
    --footer-bg: #070d1a;
    --footer-text: #94a3b8;
    --footer-link-bg: rgba(129, 140, 248, 0.18);
    --input-bg: #0f172a;
    --toolbar-bg: #151d2e;
    --hero-grad: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.12), transparent 65%);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
    display: flex;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ── Mobile Menu Button + quick theme toggle ── */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 15px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
    z-index: 1000;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    margin-top: 0;
}

.mobile-theme-btn {
    display: none;
    position: fixed;
    top: 14px;
    right: 15px;
    background: var(--card-bg);
    color: var(--secondary);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
    z-index: 1000;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

/* ── Theme toggle switch (in sidebar header) ── */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-top: 14px;
}
.theme-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.theme-toggle .switch {
    position: relative;
    width: 46px;
    height: 26px;
    background: var(--border);
    border-radius: 999px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}
.theme-toggle .switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
}
.theme-toggle input:checked + .switch {
    background: var(--primary);
}
.theme-toggle input:checked + .switch::after {
    transform: translateX(20px);
}
.theme-toggle .theme-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

/* ── Sidebar ── */
.sidebar {
    width: 230px;
    background: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    padding: 14px 10px;
    box-shadow: var(--sidebar-shadow);
    z-index: 100;
    overflow-y: auto;
    transition: all 0.3s ease, background 0.3s ease;
}

.sidebar-header {
    padding: 0 8px 12px 12px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 8px;
}

.sidebar-header a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-header .sidebar-brand {
    color: var(--sidebar-title);
    font-size: 1.4rem;
    margin: 0;
    margin-left: 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-header img {
    display: block;
    width: 36px;
    height: 36px;
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid var(--sidebar-border);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.sidebar-header h1 i {
    margin-right: 10px;
}

.tool-list {
    list-style: none;
}

/* Sidebar group headers (Client / Server) */
.side-group {
    padding: 12px 12px 4px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
}

.tool-item {
    padding: 8px 12px;
    margin: 1px 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.86rem;
    text-decoration: none;
}

.tool-item:hover {
    background: var(--sidebar-hover);
    color: var(--primary-hover);
}

.tool-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-item-active-text);
    font-weight: 600;
}

.tool-item i {
    margin-right: 10px;
    font-size: 0.8rem;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Per-tool accent tiles — same colors as start page cards */
.tool-item[data-accent="indigo"] i { background: #6366f1; box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35); }
.tool-item[data-accent="emerald"] i { background: #10b981; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35); }
.tool-item[data-accent="sky"] i { background: #0ea5e9; box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35); }
.tool-item[data-accent="violet"] i { background: #8b5cf6; box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35); }
.tool-item[data-accent="amber"] i { background: #f59e0b; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35); }
.tool-item[data-accent="rose"] i { background: #f43f5e; box-shadow: 0 2px 8px rgba(244, 63, 94, 0.35); }
.tool-item[data-accent="cyan"] i { background: #06b6d4; box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35); }
.tool-item[data-accent="fuchsia"] i { background: #d946ef; box-shadow: 0 2px 8px rgba(217, 70, 239, 0.35); }

.tool-item:hover i,
.tool-item.active i {
    transform: scale(1.08);
}

.tool-item.active i,
.tool-item:hover i {
    color: #fff;
}

.tool-item .badge-soon {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    padding: 2px 7px;
    border-radius: 999px;
}

[data-theme="dark"] .tool-item .badge-soon {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* ── Skip link (a11y) ── */
.skip-link {
    position: absolute;
    top: -40px;
    left: 8px;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 8px; }

/* ── Main wrapper (content + footer column) ── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 240px;
    transition: margin-left 0.3s ease;
}

/* ── Main content ── */
.main-content {
    flex: 1;
    padding: 32px 40px 40px;
    display: flex;
    flex-direction: column;
}

.main-content > * {
    width: 100%;
}

/* Center tool cards in the middle of the window (vertical + horizontal) */
.main-content > .tool-container.active,
.main-content > .tool-card {
    margin: auto;
}

.tool-container {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tool-container.active {
    display: block;
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 28px 0 10px;
    margin-bottom: 10px;
    animation: fadeInDown 0.6s ease-out;
}

.hero h1 {
    font-size: 2.8rem;
    color: var(--dark);
    margin-bottom: 12px;
    letter-spacing: -1px;
    font-weight: 800;
}

.hero h1 i {
    color: var(--primary);
    margin-right: 8px;
}

.hero p {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

.main-content:has(.hero) {
    background: var(--hero-grad);
}

.search-bar {
    max-width: 480px;
    margin: 26px auto 0;
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.search-bar input {
    padding: 14px 18px 14px 44px;
    border-radius: 999px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

/* ── Tool cards (home grid) ── */
.tools-grid a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tools-grid .tool-card {
    margin-bottom: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    background: var(--card-bg);
    height: 100%;
}

.tools-grid .tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    border-color: var(--primary);
}

.tools-grid .tool-header {
    background: transparent;
    color: var(--dark);
    padding: 18px 20px 0;
    border-radius: 0;
    align-items: center;
}

.tools-grid .tool-header i {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    margin-right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.tools-grid .tool-header h2 {
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.3;
}

.tools-grid .tool-content {
    padding: 12px 20px 20px;
    flex: 1;
}

.tools-grid .tool-content p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.55;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--card-border);
}

.tool-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--output-bg);
    color: var(--muted);
}

.tool-tag.client { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.tool-tag.server { background: rgba(139, 92, 246, 0.12); color: var(--secondary); }

/* ── Tool page card ── */
.tool-card {
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    margin: 0 auto 30px;
    max-width: 50rem;
}

.tool-card:hover {
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.tool-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.tool-header i {
    font-size: 1.15rem;
}

.tool-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.tool-content {
    padding: 30px;
}

.form-group {
    margin-bottom: 22px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.92rem;
}

input, textarea, select {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.98rem;
    background: var(--input-bg);
    color: var(--text);
    transition: border 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

button {
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button i {
    margin-right: 10px;
}

/* .btn / .btn-sm / .reset-btn used by cron tool */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 12px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 0;
    transition: background 0.2s ease, transform 0.15s ease;
    background: var(--primary);
    color: #fff;
}

.btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-sm { padding: 8px 14px; font-size: 0.8rem; }

.btn-outline-light {
    background: transparent;
    color: var(--dark);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-outline-light:hover { background: var(--output-bg); }

.btn-danger { background-color: var(--danger); }
.btn-danger:hover { background-color: #dc2626; }

.reset-btn {
    background-color: var(--danger);
}
.reset-btn:hover { background-color: #dc2626; }

.position-absolute { position: absolute; }

.text-white { color: #fff; }
.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }

/* ── Output block ── */
.output {
    background: var(--output-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    min-height: 120px;
    overflow: auto;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.output pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.92rem;
    color: var(--text);
}

/* ── Password strength ── */
.strength-meter {
    height: 10px;
    background: var(--border);
    border-radius: 999px;
    margin-top: 12px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.3s ease, background 0.3s ease;
}

.password-strength {
    margin-top: 8px;
    font-size: 0.92rem;
    font-weight: 600;
}

/* ── QR code ── */
.qr-code {
    text-align: center;
    margin: 25px 0;
}

.qr-code img {
    max-width: 220px;
    border: 12px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    background: #fff;
}

/* ── Timezone ── */
.timezone-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.timezone-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    flex: 1;
    min-width: 180px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

.timezone-box:nth-child(1) { animation-delay: 0.1s; border-top: 4px solid #a78bfa; }
.timezone-box:nth-child(2) { animation-delay: 0.2s; border-top: 4px solid #f9a8d4; }
.timezone-box:nth-child(3) { animation-delay: 0.3s; border-top: 4px solid #fb923c; }
.timezone-box:nth-child(4) { animation-delay: 0.4s; border-top: 4px solid #38bdf8; }
.timezone-box:nth-child(5) { animation-delay: 0.5s; border-top: 4px solid #34d399; }
.timezone-box:nth-child(6) { animation-delay: 0.6s; border-top: 4px solid #a78bfa; }

.timezone-box h4 {
    margin-bottom: 12px;
    color: var(--dark);
    font-size: 1.05rem;
}

.timezone-box p {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark);
}

.timezone-box small {
    font-size: 0.9rem;
    color: var(--muted);
}

/* ── Image preview ── */
.image-preview {
    max-width: 100%;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 1px solid var(--card-border);
}

.image-preview img {
    width: 100%;
    display: block;
}

/* ── Download buttons ── */
.download-btn {
    background: var(--success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.download-btn:hover {
    background: #059669;
}

.download-section {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    box-shadow: var(--card-shadow);
}

.download-btn-main {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: auto;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.download-btn-main:hover {
    background: #059669;
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.3);
}

.download-btn-main i {
    font-size: 1.4rem;
}

/* ── Meme ── */
.meme-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.meme-controls input {
    flex: 1;
}

/* ── Cron tool helper layout ── */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.field-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.field-label {
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--dark);
}

.form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.table-responsive {
    overflow-x: auto;
}

.table-responsive td {
    margin: 10px;
    padding: 10px;
}

table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px; text-align: left; border-bottom: 1px solid var(--border); color: var(--text); }

/* ── Footer ── */
.footer {
    text-align: center;
    color: var(--footer-text);
    padding: 16px 20px;
    background: var(--footer-bg);
    border-top: 1px solid var(--sidebar-border);
    font-size: 0.85rem;
}

.footer a {
    text-decoration: none;
    color: var(--footer-text);
    font-weight: 600;
    transition: opacity 0.2s ease;
    opacity: 0.85;
}

.footer a:hover { opacity: 1; }

/* ── Main wrapper (content + footer column) ── */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ── Sidebar scrollbar ── */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 999px; }

/* ── Responsive ── */
@media (min-width: 1600px) {
    .tools-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1280px) and (max-width: 1599px) {
    .tools-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) and (max-width: 1279px) {
    .tools-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 600px) and (max-width: 899px) {
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .sidebar { width: 72px; padding: 12px 6px; }
    .main-wrapper { margin-left: 72px; }

    .sidebar-header { padding: 0 0 12px; text-align: center; }
    .sidebar-header a { justify-content: center; }
    .sidebar-header .sidebar-brand span { display: none; }
    .sidebar-header .sidebar-brand { margin-left: 0; }

    .theme-toggle { display: none; }

    .side-group { display: none; }
    .tool-item { justify-content: center; padding: 8px 0; }
    .tool-item span { display: none; }
    .tool-item i { margin-right: 0; width: 34px; height: 34px; font-size: 0.95rem; }
    .tool-item .badge-soon { display: none; }

    .main-content { padding: 24px 24px 32px; }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
    .mobile-theme-btn { display: flex; }

    .sidebar {
        width: 260px;
        padding: 14px 10px;
        left: -260px;
        z-index: 1000;
    }

    .sidebar.active { left: 0; }

    .sidebar-header { padding: 0 12px 12px 12px; text-align: left; }
    .sidebar-header a { justify-content: flex-start; }
    .sidebar-header .sidebar-brand span { display: inline; }
    .sidebar-header .sidebar-brand { margin-left: 10px; }

    .theme-toggle { display: inline-flex; }

    .side-group { display: block; }
    .tool-item { justify-content: flex-start; padding: 8px 12px; }
    .tool-item span { display: inline; }
    .tool-item i { margin-right: 10px; width: 28px; height: 28px; font-size: 0.8rem; }

    .main-wrapper { margin-left: 0; }
    .main-content { padding: 64px 16px 24px; }

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

    .tool-header { padding: 20px; }
    .tool-header h2 { font-size: 1.4rem; }
    .tool-content { padding: 20px; }

    .meme-controls { flex-direction: column; gap: 10px; }

    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.55);
        z-index: 999;
    }
    .overlay.active { display: block; }

    .footer { padding-top: 12px; padding-bottom: 12px; }
}

@media (max-width: 576px) {
    .timezone-container { flex-direction: column; }
    .timezone-box { min-width: 100%; }

    .col-md-4 { flex: 0 0 100%; max-width: 100%; }
}

/* ── Icon-only sidebar tooltips ── */
@media (max-width: 992px) {
    .tool-item { position: relative; }
    .tool-item:hover::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--dark);
        color: var(--bg);
        font-size: 0.78rem;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: 8px;
        white-space: nowrap;
        z-index: 1100;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
        pointer-events: none;
    }
}

/* ── Category filter chips (home) ── */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 22px 0 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    padding: 8px 18px;
    margin-top: 0;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: none;
}

.filter-chip:hover { border-color: var(--primary); color: var(--primary); }

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* ── Per-tool accent colors on home grid ── */
.tools-grid .tool-card[data-accent="indigo"] .tool-header i { background: #6366f1; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3); }
.tools-grid .tool-card[data-accent="emerald"] .tool-header i { background: #10b981; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3); }
.tools-grid .tool-card[data-accent="sky"] .tool-header i { background: #0ea5e9; box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3); }
.tools-grid .tool-card[data-accent="violet"] .tool-header i { background: #8b5cf6; box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3); }
.tools-grid .tool-card[data-accent="amber"] .tool-header i { background: #f59e0b; box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3); }
.tools-grid .tool-card[data-accent="rose"] .tool-header i { background: #f43f5e; box-shadow: 0 4px 10px rgba(244, 63, 94, 0.3); }
.tools-grid .tool-card[data-accent="cyan"] .tool-header i { background: #06b6d4; box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3); }
.tools-grid .tool-card[data-accent="fuchsia"] .tool-header i { background: #d946ef; box-shadow: 0 4px 10px rgba(217, 70, 239, 0.3); }

/* ── Hero trust line & badge ── */
.hero-trust {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 600;
}

.hero-trust i { font-size: 0.8rem; }

.hero-badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── Inline buttons (non-full-width actions) ── */
.btn-inline {
    width: auto;
    display: inline-flex;
    margin-top: 0;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* ── Copy feedback button state ── */
button.copied {
    background: var(--success) !important;
}

/* ── Inline validation / notice message ── */
.inline-msg {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.inline-msg.show { display: block; }
.inline-msg.info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* ── Related tools row (bottom of tool pages) ── */
.related-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.related-tools a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.related-tools a:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ── Breadcrumb back link ── */
.crumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.crumb:hover { color: var(--primary); }

/* ── Drag & drop zone ── */
.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 20px;
    margin-bottom: 22px;
    border: 2px dashed var(--border);
    border-radius: 14px;
    background: var(--output-bg);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.drop-zone i {
    font-size: 2rem;
    color: var(--primary);
    transition: transform 0.2s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.drop-zone.dragover i { transform: scale(1.15); }

.drop-zone.has-file {
    border-style: solid;
    border-color: var(--success);
    color: var(--success);
}

.drop-zone-label {
    font-size: 0.92rem;
    font-weight: 600;
    word-break: break-all;
}
