:root {
    --primary: #1F5132;         /* Deep Botanical Sage (9.3:1 contrast with white) */
    --primary-hover: #143822;   /* Heritage Yew Hedge (13.1:1 contrast with white) */
    --accent: #E8F0EA;          /* Soft Meadow Leaf Tint */
    --tan: #DFEAE2;             /* Muted Sage Surface */
    --caramel: #9AB5A3;         /* Garden Twine Border */
    --chestnut: #9C4221;        /* Kiln Terracotta Pot Accent (7.1:1 on white) */
    --dark: #18211B;            /* Rich Garden Loam Ink (16.4:1 contrast) */
    --light: #F7FAF8;           /* Morning Dew Base */
    --white: #FFFFFF;
    --gray: #425247;            /* High-Contrast Moss Slate (8.1:1 on white) */
    --border: #C9D8CE;          /* Clean Allotment Border */
    --error: #B91C1C;           /* High-Contrast Validation Red (6.47:1 on white) */
    --error-bg: #FEF2F2;
    --glow: 0 10px 25px -5px rgba(20, 56, 34, 0.14);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--dark);
    background-color: var(--light);
    background-image: radial-gradient(#D2E0D6 1px, transparent 1px);
    background-size: 24px 24px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow-x: hidden;
}
svg { max-width: 100%; height: auto; }
.cat-icon { width: 22px; height: 22px; vertical-align: -5px; margin-right: 7px; flex-shrink: 0; color: var(--chestnut); }
.hub-card h3 .cat-icon { width: 26px; height: 26px; vertical-align: -6px; margin-right: 8px; }
.hero-box h1 .cat-icon { width: 34px; height: 34px; vertical-align: -7px; margin-right: 10px; }
.dropdown-menu-box li a:hover .cat-icon { color: var(--white); }
a { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; transition: color 0.2s ease; }
a:hover, a:focus-visible { color: var(--primary-hover); }
.is-hidden { display: none !important; }

/* Centralized Logo & Reusable 2D Visual Bar Palette */
.logo-mark-solid { fill: var(--primary); }
.logo-mark-dashed { fill: none; stroke: var(--chestnut); stroke-width: 1.8; stroke-dasharray: 2.5, 2; }
.logo-word-dark { fill: var(--dark); }
.logo-word-accent { fill: var(--primary); }
.svg-bar-primary { fill: var(--primary); }
.svg-bar-secondary { fill: var(--chestnut); }
.svg-bar-track { fill: var(--accent); stroke: var(--caramel); stroke-width: 1.5; }
.svg-label-bold { fill: var(--dark); font-size: 11px; font-weight: 700; }
.svg-label-sub { fill: var(--gray); font-size: 10px; font-weight: 600; }

/* Navigation & Hero */
header { background: linear-gradient(90deg, #FFFFFF 0%, #F7FAF8 100%); border-bottom: 3px solid var(--primary); position: relative; z-index: 1000; height: 68px; box-shadow: 0 4px 16px rgba(20, 56, 34, 0.07); }
.nav-container { padding: 0 1rem; display: flex; justify-content: space-between; align-items: center; max-width: 1240px; margin: 0 auto; height: 100%; }
.logo-link { display: flex; align-items: center; text-decoration: none; height: 100%; color: var(--dark); }
.logo-link svg { height: 46px; width: auto; }
.hamburger { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 5px; padding: 0.5rem; }
.hamburger span { display: block; width: 24px; height: 3px; background: var(--dark); border-radius: 2px; }
.nav-menu { display: none; flex-direction: column; width: 100%; background: var(--white); position: absolute; top: 100%; left: 0; border-top: 1px solid var(--border); box-shadow: 0 12px 24px rgba(20, 56, 34, 0.12); list-style: none; z-index: 1001; }
.nav-menu.active { display: flex; }
.nav-menu li a { display: block; padding: 0.9rem 1.25rem; text-decoration: none; color: var(--dark); font-weight: 700; border-bottom: 1px solid var(--border); }
.nav-menu li a:hover { color: var(--primary-hover); background: var(--accent); }
.dropdown-trigger { position: relative; }
.dropdown-menu-box { display: none; background: var(--light); list-style: none; padding: 0.35rem 0; width: 100%; max-height: 55vh; overflow-y: auto; }
.dropdown-menu-box.active { display: block; }
.dropdown-menu-box li a { padding-left: 2rem; font-size: 0.92rem; font-weight: 600; color: var(--dark); border-bottom: 1px solid var(--border); }
.dropdown-menu-box li a:hover { color: var(--white); background: var(--primary); }
.breadcrumb-wrapper { border-bottom: 1px solid var(--border); padding: 0.65rem 0; font-size: 0.84rem; background: var(--white); }
.breadcrumb { display: flex; flex-wrap: wrap; list-style: none; max-width: 1240px; margin: 0 auto; padding: 0 1rem; }
.breadcrumb li { display: flex; align-items: center; color: var(--gray); font-weight: 500; }
.breadcrumb li + li:before { content: ">"; padding: 0 0.5rem; color: var(--chestnut); font-weight: 700; }
.breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 700; }
.content-wrapper { padding: 1.75rem 1rem; max-width: 1240px; margin: 0 auto; width: 100%; flex: 1; }
.hero-box { background: linear-gradient(135deg, #E8F0EA 0%, #F4ECE6 100%); color: var(--dark); padding: 2rem 1.5rem; border-radius: 16px; margin-bottom: 1.75rem; border: 1px solid var(--caramel); box-shadow: 0 8px 22px rgba(20, 56, 34, 0.06); }
.hero-box h1 { font-size: 1.75rem; margin-bottom: 0.55rem; color: var(--dark); font-weight: 800; line-height: 1.22; letter-spacing: -0.02em; }
.hero-box p { color: var(--gray); font-size: 1rem; font-weight: 500; max-width: 760px; }
.search-bar-frame { margin: -1.1rem auto 2.25rem; width: 100%; max-width: 680px; position: relative; z-index: 10; padding: 0 0.5rem; }
.search-input { width: 100%; padding: 0.95rem 1.4rem; border: 2px solid var(--primary); border-radius: 50px; font-size: 1rem; outline: none; background: var(--white); color: var(--dark); font-weight: 500; box-shadow: 0 8px 20px rgba(20, 56, 34, 0.08); }
.search-input:focus { border-color: var(--primary-hover); box-shadow: 0 0 0 4px rgba(31, 81, 50, 0.22); }
.no-results-msg { text-align: center; color: var(--gray); margin-top: 2rem; }
/* Category Grids & Workbench Cards */
.category-headline { font-size: 1.35rem; margin-bottom: 1.35rem; border-left: 5px solid var(--chestnut); padding-left: 0.85rem; color: var(--dark); font-weight: 800; }
.blog-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.35rem; margin-bottom: 2.25rem; }
.blog-grid-single { grid-template-columns: 1fr; }
.hub-card { background: var(--white); border-radius: 14px; padding: 1.5rem; border: 1px solid var(--border); border-top: 4px solid var(--chestnut); display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 4px 12px rgba(20, 56, 34, 0.04); transition: transform 0.2s ease, box-shadow 0.2s ease; min-width: 0; }
.hub-card:hover { transform: translateY(-4px); box-shadow: var(--glow); border-top-color: var(--primary-hover); }
.hub-card h2, .hub-card h3 { margin-bottom: 0.5rem; color: var(--dark); font-size: 1.2rem; font-weight: 700; }
.hub-card p { color: var(--gray); font-size: 0.94rem; margin-bottom: 1.35rem; }
.hub-card-centered { max-width: 600px; margin: 2rem auto; text-align: center; }
.card-meta-tag { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--chestnut); margin-bottom: 0.4rem; }
.az-list { list-style: none; padding-top: 0.5rem; }
.az-list li { margin-bottom: 0.5rem; }
.az-list a { color: var(--primary); font-weight: 700; text-decoration: none; }
.az-list a:hover { color: var(--primary-hover); text-decoration: underline; }
.az-cat-label { color: var(--gray); font-size: 0.85rem; }
.calc-btn { width: 100%; background: linear-gradient(135deg, #1F5132 0%, #2A6B43 100%); color: var(--white); padding: 0.75rem 1rem; border: none; border-radius: 8px; font-size: 0.98rem; font-weight: 700; cursor: pointer; display: inline-block; text-align: center; text-decoration: none; transition: background 0.2s ease, transform 0.15s ease; }
.calc-btn:hover { background: var(--primary-hover); color: var(--white); transform: translateY(-1px); }

/* Workbench & Telemetry Readouts */
.formula-badge { display: inline-block; background: var(--white); color: var(--dark); border: 1px solid var(--chestnut); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.88rem; padding: 0.25rem 0.85rem; border-radius: 50px; margin-bottom: 0.75rem; }
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.35rem; margin-bottom: 2rem; }
.workbench-left-stack, .workbench-right-stack { display: flex; flex-direction: column; gap: 1.35rem; min-width: 0; }
.sci-panel { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; min-width: 0; box-shadow: 0 4px 14px rgba(20, 56, 34, 0.04); }
.sci-panel-header { font-size: 1.02rem; font-weight: 800; color: var(--dark); border-bottom: 2px solid var(--accent); padding-bottom: 0.6rem; margin-bottom: 1.1rem; }
.sci-row { margin-bottom: 1rem; }
.sci-row label { display: block; font-size: 0.88rem; font-weight: 700; color: var(--dark); margin-bottom: 0.35rem; }
.sci-input-group { display: flex; flex-direction: column; border: 1.5px solid var(--caramel); border-radius: 8px; overflow: hidden; background: var(--light); }
.sci-input-group:focus-within { border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 3px rgba(31, 81, 50, 0.2); }
.sci-input-group.has-error { border-color: var(--error); background: var(--error-bg); }
.sci-input-group input { width: 100%; border: none; background: transparent; padding: 0.68rem 0.85rem; font-size: 1rem; color: var(--dark); font-weight: 700; outline: none; }
.sci-input-group select, .sci-unit-tag { border: none; border-top: 1px solid var(--border); background: var(--accent); color: var(--dark); font-weight: 700; font-size: 0.86rem; padding: 0.55rem 0.85rem; outline: none; }
.field-error { display: none; color: var(--error); font-size: 0.8rem; font-weight: 700; margin-top: 0.35rem; }
.field-error.active { display: block; }
.calc-error-msg { display: block; background: var(--error-bg); color: var(--error); border: 1px solid #FECACA; border-left: 4px solid var(--error); padding: 0.85rem 1rem; border-radius: 8px; font-weight: 700; }
.preset-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.preset-pill { background: var(--light); border: 1px solid var(--caramel); color: var(--dark); font-size: 0.78rem; font-weight: 700; padding: 0.28rem 0.6rem; border-radius: 6px; cursor: pointer; }
.preset-pill:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.sci-btn-row { display: flex; gap: 0.7rem; margin-top: 1.2rem; }
.sci-btn-reset { background: var(--tan); color: var(--dark); border: 1px solid var(--caramel); border-radius: 8px; padding: 0.75rem 1.1rem; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.sci-btn-reset:hover { background: var(--primary-hover); color: var(--white); }
.quick-key-card { background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--chestnut); border-radius: 10px; padding: 1.05rem 1.2rem; font-size: 0.87rem; color: var(--gray); }
.quick-key-card h2, .quick-key-card h3 { font-size: 0.94rem; color: var(--dark); margin-bottom: 0.45rem; font-weight: 800; }
.quick-key-card ul { list-style: none; line-height: 1.7; }
.primary-answer-box { background: linear-gradient(135deg, #E8F0EA 0%, #F4ECE6 100%); border: 1px solid var(--caramel); border-left: 5px solid var(--primary); border-radius: 10px; padding: 1.15rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.65rem; }
.primary-answer-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; color: var(--primary-hover); }
.primary-answer-val { font-size: 1.5rem; font-weight: 800; color: var(--dark); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.copy-btn { align-self: flex-start; background: var(--white); border: 1.5px solid var(--primary); color: var(--dark); font-size: 0.82rem; font-weight: 700; padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; }
.copy-btn:hover { background: var(--primary); color: var(--white); }
.unit-strip { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.55rem; margin-bottom: 1rem; }
.unit-strip-card { background: var(--light); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem; min-width: 0; }
.unit-strip-card span { display: block; font-size: 0.74rem; color: var(--gray); font-weight: 700; text-transform: uppercase; }
.unit-strip-card strong { display: block; font-size: 0.96rem; color: var(--dark); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.working-box { background: var(--light); color: var(--dark); border: 1px solid var(--caramel); border-radius: 8px; padding: 0.95rem 1.05rem; margin-bottom: 1rem; }
.working-box-title { font-weight: 800; color: var(--primary-hover); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.45rem; }
.working-step { font-family: inherit; font-variant-numeric: tabular-nums; font-size: 0.92rem; line-height: 1.65; color: var(--dark); font-weight: 500; }
.chart-box { border: 1px solid var(--border); border-radius: 10px; padding: 0.85rem; background: var(--white); text-align: center; }
.chart-box-title { font-size: 0.78rem; font-weight: 800; color: var(--gray); text-transform: uppercase; margin-bottom: 0.4rem; }
/* Worked Examples, Reference Tables & Articles */
.exam-box { background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--primary); border-radius: 10px; padding: 1.35rem; margin: 1.5rem 0; }
.exam-box-badge { display: inline-block; background: var(--tan); color: var(--dark); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; padding: 0.25rem 0.65rem; border-radius: 4px; margin-bottom: 0.65rem; }
.pitfall-box { background: var(--accent); border: 1px solid var(--caramel); border-left: 4px solid var(--chestnut); border-radius: 8px; padding: 1.05rem 1.2rem; margin: 1.35rem 0; font-size: 0.92rem; }
.ref-table-wrap { width: 100%; overflow-x: auto; margin: 1.35rem 0; border: 1px solid var(--border); border-radius: 10px; }
.ref-table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 0.9rem; text-align: left; }
.ref-table th { background: var(--tan); color: var(--dark); font-weight: 800; padding: 0.8rem 1rem; border-bottom: 2px solid var(--caramel); }
.ref-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--accent); }
.ref-table tr:nth-child(even) td { background: var(--light); }
.article-section-frame, .faq-section-frame { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; margin-top: 2rem; }
.article-section-frame h2, .faq-section-frame h2 { color: var(--dark); font-size: 1.4rem; margin-bottom: 0.9rem; border-bottom: 2px solid var(--accent); padding-bottom: 0.45rem; }
.article-section-frame h3 { font-size: 1.1rem; color: var(--primary-hover); margin: 1.25rem 0 0.45rem; font-weight: 700; }
.article-section-frame p, .faq-answer { color: var(--gray); font-size: 0.96rem; margin-bottom: 0.9rem; }
.faq-item { margin-bottom: 1.15rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--accent); }
.faq-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.faq-question { font-weight: 700; font-size: 1.02rem; color: var(--dark); margin-bottom: 0.3rem; }

/* UK Affiliate Product Cards */
.equipment-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; margin-top: 1rem; }
.equipment-card { background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--chestnut); border-radius: 10px; padding: 1.2rem; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.equipment-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; color: var(--dark); }
.equipment-card p { color: var(--gray); font-size: 0.88rem; margin-bottom: 1rem; }
.amazon-btn { display: block; width: 100%; background: var(--primary); color: var(--white); text-align: center; padding: 0.65rem; border-radius: 6px; font-weight: 700; text-decoration: none; font-size: 0.88rem; }
.amazon-btn:hover { background: var(--primary-hover); color: var(--white); }
.amazon-disclosure-panel { background: var(--light); border: 1px solid var(--border); border-left: 4px solid var(--chestnut); padding: 0.85rem; border-radius: 8px; font-size: 0.82rem; color: var(--gray); margin-bottom: 1rem; }

/* Cookie Banner & Footer */
.cookie-banner { position: fixed; bottom: 20px; right: 20px; left: 20px; max-width: 380px; margin-left: auto; background: var(--dark); color: var(--light); border: 1px solid var(--caramel); border-top: 4px solid var(--chestnut); padding: 1.4rem; border-radius: 12px; box-shadow: 0 12px 30px rgba(20, 56, 34, 0.35); z-index: 2000; display: none; }
.cookie-banner.active { display: block; }
.cookie-banner-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.45rem; color: var(--white); }
.cookie-banner-desc { font-size: 0.85rem; color: var(--accent); margin-bottom: 1rem; }
.cookie-banner-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }
.cookie-btn-reject, .cookie-btn-accept { padding: 0.5rem 0.95rem; font-size: 0.85rem; font-weight: 700; border-radius: 6px; cursor: pointer; }
.cookie-btn-reject { background: transparent; border: 1px solid var(--caramel); color: var(--light); }
.cookie-btn-accept { background: var(--primary); border: 1px solid var(--caramel); color: var(--white); }
footer { background: linear-gradient(180deg, #E8F0EA 0%, #DFEAE2 100%); color: var(--dark); padding: 2.75rem 1rem; text-align: center; font-size: 0.9rem; margin-top: auto; border-top: 3px solid var(--primary); }
.footer-links { display: flex; justify-content: center; gap: 1.35rem; margin-bottom: 1.35rem; list-style: none; flex-wrap: wrap; }
.footer-links a { color: var(--dark); text-decoration: none; font-weight: 700; }
.footer-links a:hover { color: var(--primary-hover); text-decoration: underline; }
.company-legal-details { color: var(--gray); line-height: 1.75; font-size: 0.85rem; }
.company-legal-details a { color: var(--dark); font-weight: 700; }

/* Desktop Layout */
@media (min-width: 768px) {
    header { height: 76px; }
    .nav-container, .breadcrumb { padding: 0 1.5rem; }
    .logo-link svg { height: 54px; }
    .hamburger { display: none; }
    .nav-menu { display: flex; flex-direction: row; position: static; width: auto; background: transparent; border: none; box-shadow: none; gap: 1.65rem; align-items: center; }
    .nav-menu li a { padding: 0; border: none; }
    .dropdown-menu-box { position: absolute; top: 100%; right: 0; width: max-content; min-width: 660px; max-width: 92vw; max-height: none; overflow: visible; background: var(--white); grid-template-columns: repeat(2, minmax(290px, 1fr)); gap: 0.5rem 1rem; padding: 1.25rem; border: 1px solid var(--caramel); border-radius: 12px; box-shadow: 0 16px 36px rgba(20, 56, 34, 0.14); }
    .dropdown-menu-box.active { display: grid; }
    .dropdown-menu-box li a { padding: 0.5rem 0.85rem; border-radius: 6px; border: none; white-space: nowrap; }
    .content-wrapper { padding: 2.5rem 1.5rem; }
    .hero-box { padding: 2.75rem 2.5rem; }
    .hero-box h1 { font-size: 2.4rem; }
    .blog-grid { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
    .blog-grid-single { grid-template-columns: 1fr; }
    .workbench-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr); gap: 1.85rem; align-items: start; }
    .workbench-right-stack { position: sticky; top: 1.5rem; }
    .sci-panel { padding: 1.6rem; }
    .sci-input-group { flex-direction: row; }
    .sci-input-group input { flex: 1; min-width: 0; }
    .sci-unit-tag { border-top: none; border-left: 1px solid var(--border); width: 225px; flex-shrink: 0; padding: 0 0.8rem; display: flex; align-items: center; }
    .sci-input-group select { border-top: none; border-left: none; width: 100%; flex: 1; padding: 0.68rem 0.85rem; cursor: pointer; }
    .sci-input-group input + select { border-left: 1px solid var(--border); width: 225px; flex: 0 0 225px; }
    .primary-answer-box { flex-direction: row; justify-content: space-between; align-items: center; }
    .primary-answer-val { font-size: 1.7rem; }
    .unit-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .equipment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
