:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.12);
    --nav-bg: #fff;
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.4);
    --nav-bg: #1e293b;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

/* Hide number input spinners globally */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Common Navbar Styles if needed, or just theme variables */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    margin-left: 1rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(125, 125, 125, 0.1);
}

/* Dark mode specific overrides for common elements */
[data-theme="dark"] .tool-icon {
    background: #334155;
}

[data-theme="dark"] .tool-tag {
    background: #1e3a8a;
    color: #93c5fd;
}

.hidden {
    display: none !important;
}

/* Unified Navbar Styles */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 0 2rem;
    height: 60px;
    transition: background 0.3s, border-color 0.3s;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    color: inherit;
}

.navbar-logo img {
    height: 40px;
    object-fit: contain;
}

.navbar-brand {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-main);
    align-self: flex-end;
    margin-bottom: -2px;
    margin-left: 0.5rem;
    line-height: 1;
}

/* Mobile Responsive - Navbar */
@media (max-width: 480px) {
    .navbar {
        padding: 0 1rem;
        height: 50px;
    }

    .navbar-logo img {
        height: 30px;
    }

    .navbar-brand {
        font-size: 16px;
    }

    .theme-toggle {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
        margin-left: 0.5rem;
    }
}