:root {
    --primary: #0b5ed7;
    --primary-dark: #0849aa;
    --secondary: #198754;
    --accent: #ffc107;
    --background: #f8f9fa;
    --card: #ffffff;
    --heading: #212529;
    --text: #6c757d;
    --border: #e5e7eb;
    --shadow: 0 18px 50px rgba(33, 37, 41, 0.08);
    --footer-bg: var(--card);
    --footer-text: var(--text);
    --footer-heading: var(--heading);
    --footer-border: var(--border);
    --radius: 12px;
    --container: 1180px;
}

[data-theme="dark"] {
    --primary: #5b9dff;
    --primary-dark: #8bbcff;
    --secondary: #3ddc8d;
    --accent: #ffc107;
    --background: #0f172a;
    --card: #111827;
    --heading: #f8fafc;
    --text: #cbd5e1;
    --border: #263244;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --footer-bg: var(--card);
    --footer-text: var(--text);
    --footer-heading: var(--heading);
    --footer-border: var(--border);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    width: 100%;
    margin: 0;
    overflow-x: hidden;
    font-family: Inter, Roboto, Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.7;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3 {
    margin: 0 0 14px;
    font-family: Poppins, Inter, sans-serif;
    color: var(--heading);
    line-height: 1.15;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 4.8rem);
}

h2 {
    font-size: clamp(1.65rem, 3vw, 2.6rem);
}

h3 {
    font-size: 1.12rem;
}

p {
    margin: 0 0 16px;
}

button,
input,
select {
    font: inherit;
}

.container {
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
}

.skip-link,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.skip-link:focus {
    width: auto;
    height: auto;
    clip: auto;
    z-index: 30;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--heading);
    color: white;
}

.icon {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
    background: rgba(17, 24, 39, 0.94);
}

.header-inner {
    min-height: 78px;
    max-height: 78px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.header-brand {
    order: 1;
    flex: 0 0 auto;
}

.site-nav {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
}

.header-search {
    order: 3;
    flex: 0 1 250px;
    min-width: 190px;
}

.mobile-nav-search {
    display: none;
}

.header-theme-toggle {
    order: 4;
    flex: 0 0 auto;
    margin-left: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--heading);
    white-space: nowrap;
}

.brand-mark {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #0b5ed7;
    color: white;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(11, 94, 215, 0.2);
}

.brand-mark::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
}

.brand-mark::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: #ffc107;
    transform: translateX(-50%);
}

.brand-mark span {
    position: relative;
    z-index: 1;
    font-family: Poppins, Inter, sans-serif;
    transform: translateY(-1px);
    letter-spacing: 0;
}

.header-brand .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1rem;
}

.header-brand .brand-mark::before {
    inset: 8px;
    border-radius: 8px;
}

.header-brand .brand-mark::after {
    bottom: 9px;
    width: 20px;
    height: 3px;
}

.brand small {
    color: var(--secondary);
    font-weight: 800;
}

.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.brand-logo {
    width: auto;
    height: 98px;
    max-width: 268px;
    object-fit: contain;
}

.site-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.site-nav a {
    flex: 0 0 auto;
    padding: 9px 8px;
    border-radius: 8px;
    color: #495057;
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.is-active {
    color: var(--primary);
    background: #eef5ff;
}

[data-theme="dark"] .site-nav a {
    color: var(--text);
}

[data-theme="dark"] .site-nav a:hover,
[data-theme="dark"] .site-nav a.is-active {
    color: #0b5ed7;
    background: #eef5ff;
}

.nav-toggle {
    order: 5;
    display: none;
}

.nav-toggle-bars {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 22px;
    height: 22px;
}

.nav-toggle-bars span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay {
    display: none;
}

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--heading);
    font-size: 1rem;
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.theme-toggle .icon,
.theme-toggle span {
    line-height: 1;
}

.header-search,
.hero-search,
.sidebar-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search {
    padding: 0;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    box-shadow: none;
}

.site-nav .mobile-nav-search {
    display: none;
}

[data-theme="dark"] .header-search,
[data-theme="dark"] .hero-search,
[data-theme="dark"] .newsletter-form,
[data-theme="dark"] .search-results {
    background: var(--card);
}

.header-search input,
.hero-search input,
.sidebar-search input,
.newsletter-form input,
.calculator-panel input,
.calculator-panel select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--heading);
    padding: 12px 14px;
    outline: none;
}

[data-theme="dark"] .header-search input,
[data-theme="dark"] .hero-search input,
[data-theme="dark"] .sidebar-search input,
[data-theme="dark"] .newsletter-form input,
[data-theme="dark"] .calculator-panel input,
[data-theme="dark"] .calculator-panel select {
    background: #0b1220;
    color: var(--heading);
}

.header-search input {
    min-height: 40px;
    padding: 8px 10px 8px 12px;
    border: 0;
    border-radius: 10px 0 0 10px;
}

.header-search input:focus {
    box-shadow: none;
}

.header-search input:focus,
.hero-search input:focus,
.sidebar-search input:focus,
.calculator-panel input:focus,
.calculator-panel select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(11, 94, 215, 0.12);
}

.header-search button,
.sidebar-search button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    color: white;
    background: var(--primary);
    box-shadow: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.header-search button:hover,
.sidebar-search button:hover {
    transform: none;
    background: var(--primary-dark);
    box-shadow: none;
}

.header-search .icon,
.sidebar-search .icon {
    width: 1.25em;
    height: 1.25em;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    max-height: 340px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    box-shadow: var(--shadow);
    z-index: 25;
}

.search-results.is-open {
    display: grid;
    gap: 6px;
}

.search-results a {
    padding: 10px;
    border-radius: 8px;
}

.search-results a:hover {
    background: #f1f5f9;
}

.search-results span {
    display: block;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero {
    position: relative;
    min-height: 680px;
    display: grid;
    align-items: center;
    overflow: hidden;
    background: #eaf4ff;
}

[data-theme="dark"] .hero,
[data-theme="dark"] .page-hero,
[data-theme="dark"] .article-hero {
    background: #0b1220;
}

.hero-media {
    position: absolute;
    inset: 0;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(248, 249, 250, 0.98) 0%, rgba(248, 249, 250, 0.92) 38%, rgba(248, 249, 250, 0.22) 72%);
}

[data-theme="dark"] .hero::after {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.92) 38%, rgba(15, 23, 42, 0.28) 72%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 92px 0 120px;
}

.hero-content > p:not(.eyebrow) {
    max-width: 650px;
    font-size: 1.18rem;
    color: #495057;
}

.eyebrow {
    margin-bottom: 12px;
    color: var(--secondary);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.hero-search {
    width: min(720px, 100%);
    margin: 34px 0 20px;
    padding: 8px;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow);
}

.hero-search input {
    border: 0;
    min-height: 54px;
}

.hero-search button,
.newsletter-form button,
.calculator-panel button,
.button-primary,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.button-secondary {
    border: 1px solid var(--border);
    background: white;
    color: var(--primary);
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-stats span {
    padding: 8px 12px;
    border: 1px solid rgba(11, 94, 215, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    color: #495057;
}

.hero-stats strong {
    color: var(--primary);
}

.section {
    padding: 82px 0;
}

.band {
    background: white;
}

[data-theme="dark"] .band,
[data-theme="dark"] .article-body,
[data-theme="dark"] details,
[data-theme="dark"] .readable,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .category-card,
[data-theme="dark"] .tool-card,
[data-theme="dark"] .content-card,
[data-theme="dark"] .insight-panel,
[data-theme="dark"] .calculator-panel,
[data-theme="dark"] .tool-notes,
[data-theme="dark"] .sidebar section {
    background: var(--card);
}

.section-heading {
    max-width: 720px;
    margin: 0 auto 34px;
    text-align: center;
}

.section-heading.align-left {
    margin-inline: 0;
    text-align: left;
}

.category-grid,
.tool-grid,
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.article-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-card,
.tool-card,
.content-card,
.insight-panel,
.calculator-panel,
.tool-notes,
.sidebar section,
.empty-state {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 8px 28px rgba(33, 37, 41, 0.04);
}

.category-card,
.card-link {
    display: grid;
    height: 100%;
    padding: 24px;
}

.category-card span,
.tool-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    border-radius: 10px;
    background: #eef5ff;
    color: var(--primary);
}

[data-theme="dark"] .category-card span,
[data-theme="dark"] .tool-icon,
[data-theme="dark"] .toc,
[data-theme="dark"] .calc-result {
    background: #172033;
}

.category-card:hover,
.tool-card:hover,
.content-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.category-card,
.tool-card,
.content-card {
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.pill {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 14px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eaf7ef;
    color: var(--secondary);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    color: var(--primary);
    font-weight: 800;
}

.two-column,
.split-lists,
.tool-page,
.content-layout {
    display: grid;
    align-items: start;
    gap: 30px;
}

.two-column {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.split-lists {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack-list {
    display: grid;
    gap: 14px;
}

.insight-panel,
.tool-notes {
    padding: 28px;
}

.insight-panel img {
    margin-bottom: 20px;
    border-radius: 10px;
    background: var(--background);
}

.check-list {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 18px 0 0;
    list-style: none;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
}

.check-list .icon {
    color: var(--secondary);
}

.newsletter {
    padding: 70px 0;
    background: linear-gradient(135deg, #eaf7ef 0%, #eef5ff 100%);
    color: #495057;
}

.newsletter h2,
.newsletter .eyebrow {
    color: var(--heading);
}

.newsletter-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: center;
    gap: 28px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow);
}

.newsletter-form input {
    min-width: 0;
}

.newsletter-form button {
    flex: 0 0 auto;
    font-size: 0.7rem;
    white-space: nowrap;
}

.faq-block {
    max-width: 860px;
}

details {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
}

summary {
    cursor: pointer;
    padding: 18px 20px;
    color: var(--heading);
    font-weight: 800;
}

details p {
    padding: 0 20px 18px;
}

.page-hero,
.article-hero {
    padding: 72px 0;
    background: linear-gradient(180deg, #eef6ff 0%, #f8f9fa 100%);
}

.page-hero.small h1,
.article-hero h1 {
    max-width: 900px;
}

.page-hero.small p,
.article-hero p {
    max-width: 760px;
    font-size: 1.08rem;
}

.content-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.article-body {
    min-width: 0;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
}

.featured-image {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    margin-bottom: 28px;
    border-radius: 10px;
    background: #eef5ff;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #495057;
    font-weight: 700;
}

.article-body h2 {
    margin-top: 34px;
    font-size: 1.55rem;
}

.article-body li {
    margin-bottom: 8px;
}

.toc {
    display: grid;
    gap: 8px;
    padding: 22px;
    border-radius: 10px;
    background: var(--background);
}

.toc h2 {
    font-size: 1.1rem;
}

.toc a {
    color: var(--primary);
    font-weight: 700;
}

.source-box {
    display: grid;
    gap: 6px;
    margin: 28px 0;
    padding: 18px;
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    background: #fff8df;
    color: #495057;
}

[data-theme="dark"] .source-box {
    background: #2a230c;
    color: var(--text);
}

.source-box a {
    color: var(--primary);
    font-weight: 800;
}

.sidebar {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 16px;
}

.sidebar section {
    padding: 20px;
}

.sidebar h2 {
    font-size: 1rem;
}

.sidebar a {
    display: block;
    padding: 8px 0;
    color: #495057;
    font-weight: 700;
}

.sidebar a:hover {
    color: var(--primary);
}

.ad-box {
    min-height: 220px;
    display: grid;
    place-items: center;
    text-align: center;
    background: repeating-linear-gradient(45deg, #f8f9fa, #f8f9fa 10px, #eef2f6 10px, #eef2f6 20px) !important;
}

[data-theme="dark"] .ad-box {
    background: repeating-linear-gradient(45deg, #111827, #111827 10px, #172033 10px, #172033 20px) !important;
}

.ad-box span {
    color: var(--heading);
    font-weight: 800;
}

.tool-page {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.calculator-panel {
    display: grid;
    gap: 18px;
    padding: 30px;
}

.calculator-panel label {
    display: grid;
    gap: 8px;
    color: var(--heading);
    font-weight: 800;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.calc-result {
    padding: 20px;
    border-radius: 10px;
    background: #eef5ff;
    color: var(--heading);
    font-weight: 800;
}

.fine-print {
    color: var(--text);
    font-size: 0.9rem;
}

.empty-state,
.readable {
    max-width: 860px;
    padding: 32px;
    background: white;
    border-radius: var(--radius);
}

.readable a {
    color: var(--primary);
    font-weight: 800;
}

.site-footer {
    padding: 56px 0 22px;
    background: var(--footer-bg);
    color: var(--footer-text);
    border-top: 1px solid var(--footer-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr 1.2fr;
    gap: 34px;
}

.footer-brand,
.site-footer h2 {
    color: var(--footer-heading);
}

.site-footer h2 {
    font-size: 1rem;
}

.site-footer a {
    display: block;
    margin-bottom: 8px;
}

.site-footer a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 42px;
    padding-top: 22px;
    border-top: 1px solid var(--footer-border);
    font-size: 0.9rem;
}

.admin-page {
    min-height: 100vh;
    background: #f6f8fb;
    color: #26313f;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-main {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 16px;
    border-right: 1px solid var(--border);
    background: #ffffff;
}

.admin-brand {
    display: block;
    margin-bottom: 20px;
    color: var(--heading);
    font-size: 1.05rem;
    font-weight: 750;
}

.admin-sidebar-nav {
    display: grid;
    gap: 8px;
}

.admin-sidebar-nav a {
    padding: 11px 12px;
    border-radius: 8px;
    color: #4c5a6a;
    font-size: 0.95rem;
    font-weight: 700;
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.is-active {
    background: #eef5ff;
    color: var(--primary);
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.admin-topbar h1,
.admin-card h1,
.admin-card h2 {
    margin-bottom: 6px;
    letter-spacing: 0;
}

.admin-topbar h1 {
    font-size: clamp(1.55rem, 2.2vw, 2rem);
}

.admin-card h2 {
    font-size: 1.35rem;
}

.admin-card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.admin-card {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 14px 36px rgba(17, 24, 39, 0.06);
}

.admin-auth {
    width: min(520px, 100%);
    margin: 72px auto;
}

.admin-notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(25, 135, 84, 0.28);
    border-radius: 10px;
    background: rgba(25, 135, 84, 0.08);
    color: var(--secondary);
    font-weight: 800;
}

.admin-tabs {
    display: none;
    z-index: 10;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
}

.admin-tabs a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 8px;
    background: #eef5ff;
    color: var(--primary);
    font-weight: 800;
}

.admin-tabs a.is-active {
    background: var(--primary);
    color: white;
}

.admin-section-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-section-head p,
.admin-help {
    color: #667085;
    font-size: 0.95rem;
}

.admin-new-button {
    flex: 0 0 auto;
    border-radius: 8px;
    padding: 10px 13px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 750;
}

.admin-stats,
.admin-summary-grid,
.admin-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.admin-stats a,
.admin-summary-grid div,
.admin-quick-grid a {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fbff;
}

.admin-quick-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 0;
}

.admin-quick-grid a:hover {
    border-color: rgba(13, 110, 253, 0.35);
    background: #eef5ff;
}

.admin-quick-grid strong {
    color: var(--heading);
    font-size: 1rem;
}

.admin-stats strong {
    color: var(--heading);
    font-size: 1.8rem;
}

.admin-stats span,
.admin-summary-grid span {
    color: var(--text);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.admin-form {
    display: grid;
    gap: 16px;
}

.admin-form label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-size: 0.92rem;
    font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 12px;
    background: white;
    color: var(--heading);
    font: inherit;
    line-height: 1.45;
}

.admin-form textarea {
    min-height: 96px;
    resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    border-color: rgba(13, 110, 253, 0.62);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
    outline: 0;
}

.admin-form button,
.admin-auth button {
    justify-self: start;
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--primary);
    color: white;
    font-weight: 750;
    cursor: pointer;
}

.admin-form-section {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    background: #ffffff;
}

.admin-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    gap: 10px;
    margin: 0 -22px -22px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-table {
    display: grid;
    gap: 10px;
}

.admin-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) 110px 110px;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.admin-check {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
}

.admin-check input {
    width: auto;
}

.admin-editor-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.admin-editor-layout.compact {
    grid-template-columns: 260px minmax(0, 1fr);
}

.admin-picker {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 8px;
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fbff;
}

.admin-picker a {
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #344054;
}

.admin-picker a:hover,
.admin-picker a.is-active {
    border-color: rgba(13, 110, 253, 0.3);
    background: #ffffff;
}

.admin-picker strong {
    font-size: 0.92rem;
    line-height: 1.35;
}

.admin-picker span {
    color: #667085;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.admin-editor {
    min-width: 0;
}

.admin-table-heading {
    margin: 8px 0 0;
}

.admin-delete-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.admin-delete-form button {
    border: 1px solid rgba(220, 53, 69, 0.35);
    border-radius: 8px;
    padding: 10px 14px;
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
    font-weight: 800;
    cursor: pointer;
}

[data-theme="dark"] .admin-form input,
[data-theme="dark"] .admin-form textarea,
[data-theme="dark"] .admin-form select {
    background: #0b1220;
}

[data-theme="dark"] .admin-stats a,
[data-theme="dark"] .admin-summary-grid div,
[data-theme="dark"] .admin-quick-grid a,
[data-theme="dark"] .admin-form-section,
[data-theme="dark"] .admin-picker,
[data-theme="dark"] .admin-row {
    background: #0b1220;
}

[data-theme="dark"] .admin-page,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .admin-sidebar,
[data-theme="dark"] .admin-picker a:hover,
[data-theme="dark"] .admin-picker a.is-active {
    background: var(--card);
}

[data-theme="dark"] .admin-actions {
    background: rgba(17, 24, 39, 0.94);
}

[data-theme="dark"] .admin-sidebar-nav a:hover,
[data-theme="dark"] .admin-sidebar-nav a.is-active {
    background: #172033;
}

[data-theme="dark"] .page-hero,
[data-theme="dark"] .article-hero {
    background: #0b1220;
}

[data-theme="dark"] .newsletter {
    background: linear-gradient(135deg, #10251f 0%, #0b1220 100%);
    color: var(--text);
}

[data-theme="dark"] .hero-content > p:not(.eyebrow),
[data-theme="dark"] .page-hero.small p,
[data-theme="dark"] .article-hero p,
[data-theme="dark"] .article-meta,
[data-theme="dark"] .check-list li,
[data-theme="dark"] .sidebar a,
[data-theme="dark"] .source-box,
[data-theme="dark"] .fine-print {
    color: var(--text);
}

[data-theme="dark"] .hero-stats span {
    border-color: var(--border);
    background: rgba(17, 24, 39, 0.78);
    color: var(--text);
}

[data-theme="dark"] .article-body,
[data-theme="dark"] .readable,
[data-theme="dark"] .empty-state,
[data-theme="dark"] details,
[data-theme="dark"] .category-card,
[data-theme="dark"] .tool-card,
[data-theme="dark"] .content-card,
[data-theme="dark"] .insight-panel,
[data-theme="dark"] .calculator-panel,
[data-theme="dark"] .tool-notes,
[data-theme="dark"] .sidebar section,
[data-theme="dark"] .featured-image {
    background: var(--card);
}

[data-theme="dark"] .toc,
[data-theme="dark"] .calc-result,
[data-theme="dark"] .insight-panel img {
    background: #172033;
}

@media (max-width: 1020px) {
    body.nav-open {
        overflow: hidden;
    }

    .header-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 10px;
    }

    .header-brand {
        order: initial;
        grid-column: 1;
    }

    .desktop-search {
        display: none;
    }

    .site-nav .mobile-nav-search {
        order: initial;
        display: flex;
        width: 100%;
        margin-top: 8px;
        min-width: 0;
    }

    .header-theme-toggle {
        order: initial;
        grid-column: 2;
        grid-row: 1;
    }

    .nav-toggle {
        order: initial;
        position: relative;
        z-index: 45;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: white;
        color: var(--heading);
        cursor: pointer;
    }

    [data-theme="dark"] .nav-toggle {
        background: var(--card);
    }

    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 40;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: min(340px, calc(100% - 22px));
        height: 100vh;
        padding: 86px 22px 24px;
        border-left: 1px solid var(--border);
        background: var(--card);
        box-shadow: -18px 0 48px rgba(15, 23, 42, 0.22);
        transform: translateX(100%);
        transition: transform 0.24s ease;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .site-nav.is-open {
        transform: translateX(0);
    }

    .site-nav a {
        display: block;
        width: 100%;
        padding: 12px 14px;
        font-size: 1rem;
    }

    .site-nav .search-results {
        top: calc(100% + 6px);
        z-index: 1;
    }

    .nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: block;
        border: 0;
        background: rgba(15, 23, 42, 0.46);
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease;
    }

    .nav-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .category-grid,
    .tool-grid,
    .article-grid,
    .article-grid.compact,
    .two-column,
    .split-lists,
    .content-layout,
    .tool-page,
    .newsletter-inner,
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-grid,
    .admin-stats,
    .admin-summary-grid,
    .admin-quick-grid,
    .admin-editor-layout,
    .admin-editor-layout.compact,
    .admin-row {
        grid-template-columns: 1fr;
    }

    .content-layout,
    .tool-page,
    .two-column {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-tabs {
        display: flex;
    }

    .admin-picker {
        position: static;
        display: flex;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .admin-picker a {
        min-width: 210px;
    }
}

@media (max-width: 700px) {
    .container {
        width: min(var(--container), calc(100% - 22px));
    }

    .header-inner {
        gap: 8px;
        min-height: 68px;
    }

    .brand-logo {
        height: 76px;
        max-width: 180px;
    }

    .mobile-nav-search input {
        padding-inline: 9px;
        font-size: 0.86rem;
    }

    .mobile-nav-search button,
    .theme-toggle {
        width: 38px;
        height: 38px;
    }

    .nav-toggle {
        width: 38px;
        height: 38px;
    }

    .admin-main {
        width: min(100% - 20px, 1220px);
        padding: 18px 0 28px;
    }

    .admin-card {
        padding: 16px;
        border-radius: 8px;
    }

    .admin-section-head,
    .admin-topbar {
        display: grid;
        gap: 10px;
    }

    .admin-new-button {
        justify-self: start;
    }

    .admin-tabs {
        margin-inline: -2px;
        padding: 8px;
    }

    .admin-form-section {
        padding: 13px;
    }

    .admin-actions {
        margin: 0 -16px -16px;
        padding: 12px 16px;
    }

    .admin-actions button,
    .admin-form button,
    .admin-auth button {
        width: 100%;
        justify-self: stretch;
    }

    .admin-picker {
        margin-inline: -4px;
        padding: 8px;
    }

    .admin-picker a {
        min-width: 180px;
    }

    .admin-row {
        gap: 12px;
    }

    .hero {
        min-height: min(640px, 100svh);
    }

    .hero-media img {
        width: 100%;
        min-width: 100%;
        object-position: 68% center;
    }

    .hero::after {
        background: rgba(248, 249, 250, 0.88);
    }

    .hero-content {
        padding: 74px 0 92px;
    }

    .hero-content h1 {
        font-size: 2.35rem;
        overflow-wrap: break-word;
    }

    .hero-content > p:not(.eyebrow) {
        font-size: 1rem;
    }

    .hero-search {
        display: grid;
        width: 100%;
    }

    .category-grid,
    .tool-grid,
    .article-grid,
    .article-grid.compact,
    .split-lists,
    .newsletter-inner,
    .field-row,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 58px 0;
    }

    .article-body,
    .calculator-panel,
    .tool-notes,
    .readable {
        padding: 22px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

}

/* Article Hero Title Formatting */
.article-hero h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    line-height: 1.3;
    font-weight: 300;
    max-width: 900px;
    margin-bottom: 18px;
    letter-spacing: -0.02em;
}

.article-hero p {
    font-size: 1.12rem;
    line-height: 1.7;
    max-width: 800px;
    color: var(--text);
}
