@font-face {
    font-family: "Tajawal";
    src: url("fonts/tajawal-300.ttf") format("truetype");
    font-style: normal;
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: "Tajawal";
    src: url("fonts/tajawal-400.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Tajawal";
    src: url("fonts/tajawal-500.ttf") format("truetype");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Tajawal";
    src: url("fonts/tajawal-700.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Tajawal";
    src: url("fonts/tajawal-800.ttf") format("truetype");
    font-style: normal;
    font-weight: 800;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
}

html {
    line-height: 1.5;
    font-family: "Tajawal", sans-serif;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
}

body {
    min-height: 100vh;
    background-color: #f8fafc;
    color: #0f172a;
    font-family: "Tajawal", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: inherit;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button {
    background: transparent;
}

img,
svg {
    display: block;
    max-width: 100%;
}

.bg-white { background-color: #fff; }
.bg-slate-50 { background-color: #f8fafc; }
.text-slate-900 { color: #0f172a; }
.font-sans { font-family: "Tajawal", sans-serif; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-slate-200 { border-color: #e2e8f0; }
.shadow-sm { box-shadow: 0 1px 3px rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-inline: auto; }
.px-4 { padding-inline: 1rem; }
.py-8 { padding-block: 2rem; }
.py-10 { padding-block: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.flex { display: flex; }
.h-16 { height: 4rem; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.flex-shrink-0 { flex-shrink: 0; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }
.text-blue-600 { color: #2563eb; }
.text-slate-500 { color: #64748b; }
.tracking-tight { letter-spacing: -.025em; }
.text-center { text-align: center; }
.transition-colors { transition: color .15s, background-color .15s, border-color .15s; }
.space-x-4 > :not(:last-child) { margin-inline-end: 1rem; }
[dir="rtl"] .rtl\:space-x-reverse > :not(:last-child) { margin-inline: 1rem 0; }
.hover\:text-blue-600:hover { color: #2563eb; }

.legacy-svg {
    width: 2.5rem;
    height: 2.5rem;
}

.legacy-svg-small {
    width: 1.75rem;
    height: 1.75rem;
}

.legacy-recent {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.recent-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    border: 2px solid #cbd5e1;
    border-radius: 1.25rem;
    background: #fff;
    color: #0f172a;
    font-weight: 800;
}

.text-button {
    margin-top: 1rem;
    padding: .5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background: #fff;
    color: #64748b;
    font-weight: 700;
    cursor: pointer;
}

.not-found {
    max-width: 42rem;
    margin: 0 auto;
    padding: 7rem 1.5rem;
    text-align: center;
}

.not-found span {
    display: block;
    margin-bottom: 1rem;
    color: #2563eb;
    font-size: clamp(4rem, 14vw, 8rem);
    font-weight: 800;
    line-height: 1;
}

.not-found h1 {
    margin-bottom: .75rem;
    font-size: 2rem;
    font-weight: 800;
}

.not-found p {
    margin-bottom: 2rem;
    color: #64748b;
    font-size: 1.05rem;
}

.primary-button {
    display: inline-flex;
    padding: .85rem 1.4rem;
    border-radius: .85rem;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
}

@media (min-width: 40rem) {
    .sm\:px-6 { padding-inline: 1.5rem; }
}

@media (min-width: 64rem) {
    .lg\:px-8 { padding-inline: 2rem; }
}

:root {
    --site-bg: #f8fafc;
    --site-surface: rgba(255, 255, 255, .86);
    --site-surface-solid: #fff;
    --site-border: #dbe3ef;
    --site-text: #0f172a;
    --site-muted: #64748b;
    --site-accent: #2563eb;
    --site-accent-soft: #eff6ff;
    --site-shadow: 0 12px 34px rgba(15, 23, 42, .08);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --site-bg: #020617;
    --site-surface: rgba(15, 23, 42, .88);
    --site-surface-solid: #0f172a;
    --site-border: #273449;
    --site-text: #f8fafc;
    --site-muted: #94a3b8;
    --site-accent: #60a5fa;
    --site-accent-soft: #172554;
    --site-shadow: 0 16px 42px rgba(0, 0, 0, .28);
    --color-slate-50: #020617;
    --color-slate-100: #0f172a;
    --color-slate-200: #334155;
    --color-slate-500: #94a3b8;
    --color-slate-900: #f8fafc;
    --color-white: #0f172a;
}

body {
    background: var(--site-bg);
    color: var(--site-text);
    transition: background-color .25s ease, color .25s ease;
}

html[data-theme="dark"] body {
    background-color: #020617 !important;
    color: #f8fafc !important;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    border-bottom: 1px solid var(--site-border);
    background: var(--site-surface);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .45), 0 8px 30px rgba(15, 23, 42, .05);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.site-header-inner {
    width: min(100% - 2rem, 76rem);
    min-height: 4.75rem;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    color: var(--site-text);
}

.site-brand-mark {
    width: 2.7rem;
    height: 2.7rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(37, 99, 235, .22);
    border-radius: .9rem;
    background: linear-gradient(145deg, #fff, #eaf2ff);
    color: #2563eb;
    box-shadow: 0 7px 18px rgba(37, 99, 235, .15);
}

.site-brand-mark svg {
    width: 1.65rem;
    height: 1.65rem;
}
.site-brand-mark img,.site-footer-logo-mark img{width:100%;height:100%;object-fit:contain;border-radius:inherit}
.language-menu{position:relative}.language-menu>summary{list-style:none;cursor:pointer}.language-menu>summary::-webkit-details-marker{display:none}.language-menu-list{position:absolute;top:calc(100% + .6rem);inset-inline-end:0;z-index:80;display:grid;min-width:11rem;padding:.45rem;border:1px solid #dbe3ef;border-radius:1rem;background:#fff;box-shadow:0 18px 45px rgba(15,23,42,.16)}.language-menu-list a{padding:.55rem .7rem;border-radius:.65rem;color:#334155;text-decoration:none;font-weight:700;text-align:start}.language-menu-list a:hover,.language-menu-list a.active{background:#eff6ff;color:#2563eb}html[data-theme="dark"] .language-menu-list{border-color:#273449;background:#0f172a}html[data-theme="dark"] .language-menu-list a{color:#cbd5e1}html[data-theme="dark"] .language-menu-list a:hover,html[data-theme="dark"] .language-menu-list a.active{background:#172554;color:#60a5fa}
[data-tool-i18n][data-i18n-pending="1"] .tool-card{opacity:0}[data-tool-i18n] .tool-card{transition:opacity .12s ease}

.site-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.site-brand-copy strong {
    color: var(--site-text);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.025em;
}

.site-brand-copy small {
    margin-top: .3rem;
    color: var(--site-muted);
    font-size: .72rem;
    font-weight: 600;
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.header-action {
    min-height: 2.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .48rem;
    padding: .55rem .8rem;
    border: 1px solid var(--site-border);
    border-radius: .85rem;
    background: var(--site-surface-solid);
    color: var(--site-muted);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
    transition: transform .18s ease, border-color .18s ease, color .18s ease, background-color .18s ease;
}

.header-action:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, .45);
    color: var(--site-accent);
}

.header-action:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 2px;
}

.header-action svg {
    width: 1.15rem;
    height: 1.15rem;
    stroke-width: 1.8;
}

.theme-action[data-current-theme="dark"] .theme-moon,
.theme-action:not([data-current-theme="dark"]) .theme-sun {
    display: none;
}

.site-footer {
    position: relative;
    z-index: 2;
    margin-top: 5rem;
    border-top: 1px solid var(--site-border);
    background: color-mix(in srgb, var(--site-surface-solid) 96%, var(--site-accent-soft));
    color: var(--site-muted);
    overflow: hidden;
}

.site-footer-accent {
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--site-accent), transparent);
    opacity: .55;
}

.site-footer-main {
    width: min(100% - 2rem, 76rem);
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.05fr;
    gap: clamp(2rem, 5vw, 5rem);
    padding-block: 4rem 3.25rem;
}

.site-footer-intro {
    max-width: 25rem;
}

.site-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: var(--site-accent);
    font-size: 1.35rem;
    font-weight: 800;
}

.site-footer-logo-mark {
    width: 2.65rem;
    height: 2.65rem;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--site-accent) 25%, var(--site-border));
    border-radius: .85rem;
    background: var(--site-accent-soft);
}

.site-footer-logo-mark svg {
    width: 1.55rem;
    height: 1.55rem;
}

.site-footer-intro p {
    margin-top: 1.15rem;
    color: var(--site-muted);
    font-size: .92rem;
    line-height: 1.9;
}

.site-footer-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.site-footer-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .68rem;
}

.site-footer-group h2 {
    margin-bottom: .35rem;
    color: var(--site-text);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.site-footer-group a {
    position: relative;
    color: var(--site-muted);
    font-size: .86rem;
    font-weight: 600;
    transition: color .18s ease, transform .18s ease;
}

.site-footer-group a:hover {
    color: var(--site-accent);
    transform: translateX(calc(var(--footer-direction, 1) * 3px));
}

[dir="rtl"] .site-footer-group a {
    --footer-direction: -1;
}

.site-footer-contact {
    align-self: start;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .8rem;
    padding: 1.1rem;
    border: 1px solid var(--site-border);
    border-radius: 1rem;
    background: var(--site-surface-solid);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.site-footer-contact:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--site-accent) 50%, var(--site-border));
    box-shadow: var(--site-shadow);
}

.site-footer-contact-icon {
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    border-radius: .8rem;
    background: var(--site-accent-soft);
    color: var(--site-accent);
}

.site-footer-contact small,
.site-footer-contact strong {
    display: block;
}

.site-footer-contact small {
    color: var(--site-muted);
    font-size: .72rem;
}

.site-footer-contact strong {
    margin-top: .2rem;
    color: var(--site-text);
    font-size: .86rem;
}

.site-footer-contact-arrow {
    color: var(--site-accent);
    font-size: 1.1rem;
}

.site-footer-bottom {
    border-top: 1px solid var(--site-border);
}

.site-footer-bottom > div {
    width: min(100% - 2rem, 76rem);
    min-height: 4.25rem;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: .76rem;
    font-weight: 600;
}

.site-footer-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.site-footer-status i {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.content-page {
    position: relative;
    width: min(100% - 2rem, 68rem);
    min-height: 60vh;
    margin-inline: auto;
    padding-block: clamp(3.5rem, 8vw, 6.5rem) 2rem;
}

.content-page-glow {
    position: absolute;
    z-index: -1;
    top: 0;
    inset-inline-end: 4%;
    width: 24rem;
    height: 17rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--site-accent) 12%, transparent);
    filter: blur(70px);
    pointer-events: none;
}

.content-hero {
    max-width: 47rem;
}

.content-breadcrumb {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 2.4rem;
    color: var(--site-muted);
    font-size: .78rem;
    font-weight: 700;
}

.content-breadcrumb a:hover {
    color: var(--site-accent);
}

.content-eyebrow {
    display: inline-flex;
    padding: .35rem .75rem;
    border: 1px solid color-mix(in srgb, var(--site-accent) 22%, var(--site-border));
    border-radius: 999px;
    background: var(--site-accent-soft);
    color: var(--site-accent);
    font-size: .76rem;
    font-weight: 800;
}

.content-hero h1 {
    margin-top: 1.15rem;
    color: var(--site-text);
    font-size: clamp(2.4rem, 7vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1.08;
}

.content-hero > p {
    max-width: 42rem;
    margin-top: 1.2rem;
    color: var(--site-muted);
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.9;
}

.content-sections {
    margin-top: clamp(3.5rem, 8vw, 6rem);
    border-top: 1px solid var(--site-border);
}

.content-section {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: 1.5rem;
    padding-block: 2.3rem;
    border-bottom: 1px solid var(--site-border);
}

.content-section-number {
    color: var(--site-accent);
    font-size: .78rem;
    font-weight: 800;
}

.content-section h2 {
    color: var(--site-text);
    font-size: 1.25rem;
    font-weight: 800;
}

.content-section p {
    max-width: 53rem;
    margin-top: .7rem;
    color: var(--site-muted);
    font-size: .95rem;
    line-height: 1.95;
}

.content-updated {
    margin-top: 1.35rem;
    color: var(--site-muted);
    font-size: .76rem;
    font-weight: 600;
}

.contact-layout {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: clamp(2rem, 6vw, 5rem);
    margin-top: clamp(3.5rem, 8vw, 6rem);
}

.contact-aside {
    padding-top: 1rem;
}

.contact-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    background: var(--site-accent-soft);
    color: var(--site-accent);
}

.contact-icon svg {
    width: 1.8rem;
    height: 1.8rem;
}

.contact-aside h2 {
    margin-top: 1.4rem;
    color: var(--site-text);
    font-size: 1.4rem;
    font-weight: 800;
}

.contact-aside > p {
    margin-top: .8rem;
    color: var(--site-muted);
    font-size: .92rem;
    line-height: 1.9;
}

.contact-note {
    margin-top: 2rem;
    padding-inline-start: 1rem;
    border-inline-start: 2px solid var(--site-accent);
}

.contact-note strong,
.contact-note span {
    display: block;
}

.contact-note strong {
    color: var(--site-text);
    font-size: .88rem;
}

.contact-note span {
    margin-top: .3rem;
    color: var(--site-muted);
    font-size: .78rem;
}

.contact-form-card {
    padding: clamp(1.3rem, 4vw, 2rem);
    border: 1px solid var(--site-border);
    border-radius: 1.25rem;
    background: var(--site-surface-solid);
    box-shadow: var(--site-shadow);
}

.contact-form,
.contact-form label {
    display: flex;
    flex-direction: column;
}

.contact-form {
    gap: 1.1rem;
}

.contact-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.contact-form label {
    gap: .45rem;
    color: var(--site-text);
    font-size: .8rem;
    font-weight: 800;
}

.contact-form :is(input, textarea) {
    width: 100%;
    border: 1px solid var(--site-border);
    border-radius: .75rem;
    background: var(--site-bg);
    color: var(--site-text);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.contact-form input {
    min-height: 3rem;
    padding-inline: .85rem;
}

.contact-form textarea {
    resize: vertical;
    min-height: 10rem;
    padding: .85rem;
}

.contact-form :is(input, textarea):focus {
    border-color: var(--site-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-accent) 15%, transparent);
}

.contact-form button {
    align-self: flex-start;
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding-inline: 1.25rem;
    border-radius: .75rem;
    background: var(--site-accent);
    color: #fff;
    font-size: .86rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.contact-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 20px color-mix(in srgb, var(--site-accent) 25%, transparent);
}

.contact-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
}

.contact-error,
.contact-success {
    padding: 1rem;
    border-radius: .85rem;
}

.contact-error {
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    font-size: .82rem;
    font-weight: 700;
}

.contact-success {
    min-height: 14rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #ecfdf5;
    color: #065f46;
}

.contact-success > span {
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-weight: 800;
}

.contact-success strong {
    font-size: 1rem;
}

.contact-success p {
    margin-top: .3rem;
    font-size: .82rem;
}

html[data-theme="dark"] .site-brand-mark {
    border-color: #315281;
    background: linear-gradient(145deg, #172554, #0f172a);
    color: #60a5fa;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}

html[data-theme="dark"] .site-header {
    box-shadow: 0 1px 0 rgba(148, 163, 184, .06), 0 12px 34px rgba(0, 0, 0, .24);
}

html[data-theme="dark"] .site-footer-contact {
    box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .contact-error {
    border-color: #7f1d1d;
    background: #450a0a;
    color: #fecaca;
}

html[data-theme="dark"] .contact-success {
    background: #052e2b;
    color: #a7f3d0;
}

html[data-theme="dark"] .contact-form button {
    background: #2563eb;
}

html[data-theme="dark"] .home-page::before {
    background: radial-gradient(ellipse 75% 48% at 50% 0%, #172554 0%, #0f172a 42%, #020617 76%) !important;
}

html[data-theme="dark"] .home-hero::after {
    background: linear-gradient(to bottom, transparent, #020617) !important;
}

html[data-theme="dark"] .tool-page::before,
html[data-theme="dark"] .category-page::before {
    background: radial-gradient(ellipse 72% 48% at 50% 0%, #172554, #020617 72%) !important;
}

html[data-theme="dark"] :is(.tool-card, .category-tool-card, .home-category-card, .recent-item, .back-link, .text-button, .stat-box, .result-box) {
    border-color: #334155 !important;
    background: #0f172a !important;
    color: #f8fafc !important;
    box-shadow: var(--site-shadow);
}

html[data-theme="dark"] .tool-card::before {
    opacity: .18 !important;
}

html[data-theme="dark"] .tool-card :is(input, textarea, select) {
    border-color: #334155 !important;
    background: #020617 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .tool-card :is(input, textarea)::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] :is(.upload-zone, .toolbar, .pages-container-wrapper, .card-inner, .option-card, .stat-card, .results-section, .result-section, .settings-panel, .options-panel, .info-panel, .file-card, .pdf-file-card) {
    border-color: #334155 !important;
    background: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] :is(.tool-title, .category-title, .category-tool-title, .home-category-title) {
    color: #f8fafc !important;
}

html[data-theme="dark"] :is(.tool-card label, .upload-content, .upload-title, .upload-subtitle, .feature-item) {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] :is(
    .calc-section, .formulas-section, .tool-section, .info-section,
    .formula-input-section, .common-formulas-section, .periodic-reference,
    .input-section, .examples-section, .fraction-input, .additional-tools,
    .equation-input, .graph-settings, .function-inputs, .graph-container,
    .analysis-tools, .common-functions, .calc-type-selector, .variables-section,
    .inputs-section, .matrix-section, .circuit-section, .materials-section,
    .ph-scale, .formula-card, .rule-card, .option-item, .formula-tips,
    .equation-tips, .periodic-table-mini, .feature-item, .price-info,
    .price-table, .price-chart, .price-calculator, .last-updated
) {
    border-color: #334155 !important;
    background: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] :is(.currency-btn, .chart-period) {
    border-color: #475569 !important;
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] :is(.price-value, .price-label, .price-currency) {
    color: #f8fafc !important;
}

html[data-theme="dark"] .price-up {
    color: #4ade80 !important;
}

html[data-theme="dark"] .breadcrumb-current {
    background: #1e293b !important;
    color: #fdba74 !important;
}

html[data-theme="dark"] :is(.home-hero-badge, .home-category-count) {
    border-color: #334155 !important;
    background: #1e293b !important;
    color: #bfdbfe !important;
}

html[data-theme="dark"] .home-hero-badge {
    color: #93c5fd !important;
}

html[data-theme="dark"] .home-tool-card {
    border-color: #334155 !important;
    background: #0f172a !important;
}

html[data-theme="dark"] .tool-card :is(h1, h2, h3, h4, h5, h6),
html[data-theme="dark"] :is(.rule-title, .price-table td) {
    color: #f8fafc !important;
}

html[data-theme="dark"] :is(.formula-title, .function-prefix) {
    color: #c4b5fd !important;
}

html[data-theme="dark"] :is(.formula-text, .rule-content, .price-info span, #last-updated) {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .legend-item {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .gold-prices-tool .price-table tbody tr {
    border-color: #334155 !important;
}

html[data-theme="dark"] .gold-prices-tool .price-table tbody tr:hover {
    background: #1e293b !important;
}

html[data-theme="dark"] :is(.gold-prices-tool .market-info, .gold-prices-tool .info-card) {
    border-color: #334155 !important;
    background: #0f172a !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] :is(.gold-prices-tool .info-label, .gold-prices-tool .info-value) {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] [style*="color:#0f172a"],
html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color:#1e293b"],
html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color: #334155"] {
    color: #f8fafc !important;
}

html[data-theme="dark"] [style*="color:#475569"],
html[data-theme="dark"] [style*="color: #475569"],
html[data-theme="dark"] [style*="color:#64748b"],
html[data-theme="dark"] [style*="color: #64748b"] {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"] {
    background: #0f172a !important;
}

html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f1f5f9"],
html[data-theme="dark"] [style*="background: #f1f5f9"] {
    background: #111827 !important;
}

@media (max-width: 640px) {
    .site-header-inner {
        width: min(100% - 1.25rem, 76rem);
        min-height: 4.25rem;
        gap: .7rem;
    }

    .site-brand {
        gap: .55rem;
    }

    .site-brand-mark {
        width: 2.35rem;
        height: 2.35rem;
        border-radius: .75rem;
    }

    .site-brand-mark svg {
        width: 1.42rem;
        height: 1.42rem;
    }

    .site-brand-copy strong {
        font-size: 1.08rem;
    }

    .site-brand-copy small,
    .theme-action [data-theme-label] {
        display: none;
    }

    .site-header-actions {
        gap: .42rem;
    }

    .header-action {
        min-height: 2.35rem;
        padding: .45rem .58rem;
        border-radius: .72rem;
        font-size: .74rem;
    }

    .theme-action {
        width: 2.35rem;
        padding-inline: 0;
    }

    .site-footer-main {
        grid-template-columns: 1fr;
        gap: 2.2rem;
        padding-block: 3rem 2.5rem;
    }

    .site-footer-intro {
        max-width: 31rem;
    }

    .site-footer-contact {
        width: 100%;
    }

    .site-footer-bottom > div {
        min-height: 5rem;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .content-section {
        grid-template-columns: 2.5rem minmax(0, 1fr);
        gap: .75rem;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-fields {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    body,
    .header-action {
        transition: none;
    }
}
