/* Instagram-style action bar at the end of each calculator: like, share, and Add on Google. */
.reactions-card { margin: 32px 0 0; padding: 0 0 8px; }
.reactions-card .wrap { max-width: var(--site-max-width, 1200px); margin: 0 auto; padding: 0 16px; }
.reactions-inner { border: 1px solid #dbe3ea; border-radius: 16px; background: #fff; padding: 16px 18px; }
.reactions-bar { display: flex; align-items: center; gap: 14px; }
.reaction-love, .reaction-share { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: #0f172a; font-size: 24px; cursor: pointer; }
.reaction-love:focus-visible, .reaction-share:focus-visible, .reactions-google:focus-visible { outline: 3px solid #bbf7d0; outline-offset: 2px; }
.reaction-love i.is-on { color: #ed4956; }
.reaction-share i { color: #0f172a; }
.reaction-love.pop i { animation: heart-pop .45s ease; }
.heart-float { position: absolute; left: 50%; top: 50%; color: #ed4956; font-size: 22px; pointer-events: none; transform: translate(-50%, -50%); animation: heart-rise .9s ease-out forwards; }
@keyframes heart-pop { 0% { transform: scale(1); } 30% { transform: scale(.78); } 60% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes heart-rise { 0% { transform: translate(-50%, -50%) scale(.5); opacity: 1; } 100% { transform: translate(-50%, -190%) scale(1.5); opacity: 0; } }
.reactions-google { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #0f172a; font-size: 14px; font-weight: 700; text-decoration: none; }
.reactions-google:hover { background: #f4f7fa; }
.reactions-google .fa-google { color: #4285F4; font-size: 15px; }
.reactions-likes { margin: 8px 0 0; font-size: 14px; font-weight: 700; color: #0f172a; }
html.dark .reactions-inner, html.dark .reactions-google { background: #141418; border-color: #2a2a33; color: #f4f4ef; }
html.dark .reaction-love, html.dark .reaction-share, html.dark .reaction-share i, html.dark .reactions-likes { color: #f4f4ef; }
html.dark .reactions-google:hover { background: #1d1d24; }
@media (prefers-reduced-motion: reduce) { .reaction-love.pop i, .heart-float { animation: none; } .heart-float { display: none; } }
@media (max-width: 560px) { .reactions-inner { padding: 14px; } .reactions-google { margin-left: auto; } }
/* A separate card, the same width and border as the author card above it. The selectors are specific because
   broader page rules reset borders on sections. */
html body #reactions .wrap { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
html body #reactions .reactions-inner { border: 1px solid #e2e8f0 !important; border-radius: 16px !important; background: #fff !important; box-shadow: none !important; padding: 16px 20px !important; margin: 0 !important; }
html.dark body #reactions .reactions-inner { border-color: #2a2a33 !important; background: #141418 !important; }
/* Add on Google: white button with the G logo, whatever the page's link colour rules say. */
html body #reactions .reactions-google { background: #fff !important; color: #0f172a !important; border: 1px solid #cbd5e1 !important; }
html body #reactions .reactions-google:hover { background: #f4f7fa !important; }
html.dark body #reactions .reactions-google { background: #fff !important; color: #0f172a !important; }

/* References: its own card, the same width, border and padding as the author card. The id beats the page reset in shell.css. */
html body #references.refs-card { border: 1px solid #e2e8f0 !important; border-radius: 16px !important; background: #fff !important; box-shadow: none !important; padding: 20px !important; margin: 0 0 16px !important; width: 100% !important; box-sizing: border-box !important; }
html.dark body #references.refs-card { border-color: #2a2a33 !important; background: #141418 !important; }

/* The References heading is uppercase, like the other section titles. */
html body #references #refsTitle { text-transform: uppercase !important; letter-spacing: .08em !important; font-size: 13px !important; font-weight: 800 !important; color: #078c49 !important; }
html.dark body #references #refsTitle { color: #7fe0a0 !important; }

/* Planner action row: a compact group of icon buttons, not a strip across the whole page. */
html body main .tool-actions .gp-actions { max-width: 420px !important; }
html body main .tool-actions:has(>.gp-actions) { max-width: 420px !important; }

/* Views next to the likes: a dot separator, and the same weight as the likes text. */
.reactions-likes .reactions-sep { margin: 0 8px; color: #64748b; }
.reactions-likes .reaction-views-count, .reactions-likes .reaction-views-word { font-weight: 700; }
html.dark .reactions-likes .reactions-sep { color: #9aa6b8; }

/* Helper buttons under "Not sure about a figure?": one style, with room around the text. */
html body #tcoHelpers .tco-helper-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; color: #0f172a; font-size: 15px; font-weight: 700; line-height: 1.2; cursor: pointer; }
html body #tcoHelpers .tco-helper-btn i { color: #078c49; }
html body #tcoHelpers .tco-helper-btn:hover { background: #eaf7ef; border-color: #078c49; }
html body #tcoHelpers .tco-helper-btn:focus-visible { outline: 3px solid #bbf7d0; outline-offset: 2px; }
html.dark body #tcoHelpers .tco-helper-btn { background: #141418; border-color: #2a2a33; color: #f4f4ef; }
html.dark body #tcoHelpers .tco-helper-btn i { color: #7fe0a0; }

/* Helper previews: the result and its working update as the figures are typed. */
html body #tcoHelpers .tco-preview { display: grid; gap: 4px; min-height: 48px; padding: 12px 14px; border: 1px dashed #bfe3cf; border-radius: 12px; background: #f6fbf8; color: #0f172a; }
html body #tcoHelpers .tco-preview-value { font-size: 20px; font-weight: 800; color: #078c49; }
html body #tcoHelpers .tco-preview-working { font-size: 14px; color: #475569; }
html body #tcoHelpers .tco-preview-hint { font-size: 14px; color: #64748b; align-self: center; }
html body #tcoHelpers .tco-helper-btn:disabled { opacity: .45; cursor: not-allowed; background: #fff; border-color: #cbd5e1; }
html body #tcoHelpers .tco-helper-btn:disabled:hover { background: #fff; border-color: #cbd5e1; }
html body #tcoHelpers input.tco-flash { animation: tco-flash 1.6s ease-out; }
@keyframes tco-flash { 0% { box-shadow: 0 0 0 4px #fde047; border-color: #facc15; } 100% { box-shadow: 0 0 0 0 transparent; } }
html.dark body #tcoHelpers .tco-preview { background: #141418; border-color: #2a4a3a; color: #f4f4ef; }
html.dark body #tcoHelpers .tco-preview-value { color: #7fe0a0; }
html.dark body #tcoHelpers .tco-preview-working { color: #aab4c3; }
@media (prefers-reduced-motion: reduce) { html body #tcoHelpers input.tco-flash { animation: none; } }

/* The calculator card: no coloured bar across the top. It has the same thin border as the other cards. */
html body main.calc-cat section#calculator { border-top: 1px solid #e2e8f0 !important; }
html body main.calc-cat section#calculator::before { display: none !important; content: none !important; }
html.dark body main.calc-cat section#calculator { border-top-color: #2a2a33 !important; }

/* The "Not sure about a figure?" helper is a card like the others on the page. */
html body main #tcoHelpers { border: 1px solid #e2e8f0 !important; border-radius: 16px !important; background: #fff !important; box-shadow: none !important; padding: 20px !important; margin-top: 16px !important; }
html.dark body main #tcoHelpers { border-color: #2a2a33 !important; background: #141418 !important; }

/* FAQ: black text and icons, no coloured questions or headings. */
html body #faq, html body #faq h2, html body #faq h2 i, html body #faq summary, html body #faq summary span, html body #faq summary i, html body #faq details p, html body #faq details a { color: #0f172a !important; }
html body #faq h2 i, html body #faq summary i { color: #0f172a !important; }
html.dark body #faq, html.dark body #faq h2, html.dark body #faq h2 i, html.dark body #faq summary, html.dark body #faq summary span, html.dark body #faq summary i, html.dark body #faq details p { color: #f4f4ef !important; }

/* The "Want to plan this with more detail?" card keeps its background; its title and text are black. */
html body .planner-card, html body .planner-card .planner-card-title, html body .planner-card .planner-card-text, html body main .planner-card h2, html body main .planner-card p { color: #000000 !important; }
html.dark body .planner-card, html.dark body .planner-card .planner-card-title, html.dark body .planner-card .planner-card-text, html.dark body main .planner-card h2, html.dark body main .planner-card p { color: #f4f4ef !important; }
html body main.calc-cat .planner-card .planner-card-title, html body main .planner-card #plannerLinkTitle, html body main.calc-cat .planner-card h2.planner-card-title { color: #000000 !important; }

/* The author's name is black in the byline and the author card, on every page. */
html body .byline-name, html body main .byline-name, html body .author-card-name a, html body main .author-card-name a, html body .author-card-name, html body .author-card a[href="/author/monica-tulips/"] { color: #000000 !important; }
html.dark body .byline-name, html.dark body main .byline-name, html.dark body .author-card-name a, html.dark body .author-card-name, html.dark body .author-card a[href="/author/monica-tulips/"] { color: #f4f4ef !important; }
html body main.calc-cat .byline-name, html body main.calc-cat .author-mini .author-card-name a, html body main.calc-cat .author-card-name a, html body main.calc-cat .author-mini .author-card-name a:hover, html body main.calc-cat .byline-name:hover { color: #000000 !important; }
html.dark body main.calc-cat .byline-name, html.dark body main.calc-cat .author-mini .author-card-name a, html.dark body main.calc-cat .author-card-name a { color: #f4f4ef !important; }

/* FAQ questions are black on every calculator page, whatever the category theme sets. */
html body main.calc-cat #faq details summary > span, html body main #faq details summary > span, html body #faq details summary > span, html body main.calc-cat #faq details summary, html body main.calc-cat #faq details p { color: #000000 !important; }
html.dark body main.calc-cat #faq details summary > span, html.dark body main #faq details summary > span, html.dark body #faq details summary > span, html.dark body main.calc-cat #faq details summary, html.dark body main.calc-cat #faq details p { color: #f4f4ef !important; }

/* Header: the Calculators dropdown lists every calculator by category. */
.nav details.nav-menu { position: relative; display: inline-block; }
.nav details.nav-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid #d7ddd8; box-shadow: 0 3px 0 #cfd6d0; color: #1d2b22; font-size: 13px; font-weight: 600; cursor: pointer; }
.nav details.nav-menu > summary::-webkit-details-marker { display: none; }
.nav details.nav-menu > summary:focus-visible { outline: 3px solid #bbf7d0; outline-offset: 2px; }
.nav-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: min(760px, 92vw); max-height: 70vh; overflow: auto; padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; background: #fff; border: 1px solid #dbe3ea; border-radius: 16px; box-shadow: 0 12px 30px rgba(15, 23, 42, .12); }
.nav-col .nav-col-title { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #078c49; }
.nav-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.nav-col a { display: block; padding: 4px 0; font-size: 14px; color: #000; text-decoration: none; }
.nav-col a:hover { color: #078c49; text-decoration: underline; }
html.dark .nav-panel { background: #141418; border-color: #2a2a33; }
html.dark .nav-col a { color: #f4f4ef; }
html.dark .nav details.nav-menu > summary { background: #141418; border-color: #2a2a33; color: #f4f4ef; box-shadow: none; }
/* The calculator links inside the dropdown are plain text links, not header pills. */
html body .site-header .nav .nav-panel a, html body .nav .nav-panel a { display: block !important; height: auto !important; min-height: 0 !important; padding: 4px 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; font-size: 14px !important; font-weight: 500 !important; line-height: 1.35 !important; color: #000 !important; white-space: normal !important; }
html body .site-header .nav .nav-panel a:hover, html body .nav .nav-panel a:hover { color: #078c49 !important; text-decoration: underline; }
html.dark body .site-header .nav .nav-panel a, html.dark body .nav .nav-panel a { color: #f4f4ef !important; }
html body .site-header .nav .nav-panel { overflow-x: hidden; }
/* Legal dropdown: a short list. */
.nav-panel-small { width: 220px; grid-template-columns: 1fr; padding: 10px; }
.nav-panel-small ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
/* Categories dropdown: one link per category, in a short list. */
.nav-panel-cats { width: 260px; grid-template-columns: 1fr; padding: 10px; }
.nav-panel-cats ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
/* Header: the menu wraps on small screens instead of running off the edge. */
.nav { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 760px) { .nav-panel { width: min(92vw, 360px); grid-template-columns: 1fr; } .nav-panel-cats, .nav-panel-small { width: min(92vw, 300px); } }
/* Phones: a Menu button opens the header menu as a full-width list. */
.nav-toggle { display: none; }
@media (max-width: 720px) {
  .site-header { position: relative; }
  .nav-toggle { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid #d7ddd8; border-radius: 999px; background: #fff; color: #1d2b22; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
  html body .site-header .nav { display: none !important; }
  html body .site-header.nav-open .nav { display: flex !important; position: absolute; top: 100%; left: 0; right: 0; z-index: 80; flex-direction: column; align-items: stretch; gap: 6px; margin: 0; padding: 12px 16px 16px; background: #fff; border-bottom: 1px solid #dbe3ea; box-shadow: 0 12px 24px rgba(15, 23, 42, .12); overflow: visible; }
  html body .site-header.nav-open .nav > a { height: 40px; display: flex; align-items: center; }
  html body .site-header.nav-open .nav-menu { width: 100%; }
  html body .site-header.nav-open .nav-menu > summary { width: 100%; height: 40px; justify-content: space-between; }
  html body .site-header.nav-open .nav-panel { position: static; width: 100%; max-height: none; box-shadow: none; border: 0; padding: 6px 0 0; grid-template-columns: 1fr; }
  html body .site-header.nav-open .nav-col a { font-size: 15px; padding: 6px 0; }
}
html.dark .nav-toggle { background: #141418; border-color: #2a2a33; color: #f4f4ef; }
@media (max-width: 720px) { html.dark body .site-header.nav-open .nav { background: #141418; border-color: #2a2a33; } }

/* Header menu: plain text links, no button or pill styling. Dropdowns and the phone menu keep working. */
html body .site-header .nav a, html body .site-header .nav .nav-menu > summary, html body .site-header .nav-toggle {
  display: inline-flex !important; align-items: center; gap: 6px; height: auto !important; min-height: 0 !important;
  padding: 6px 10px !important; margin: 0 !important; border: 0 !important; border-radius: 6px !important;
  background: none !important; box-shadow: none !important; color: #0f172a !important;
  font-size: 14px !important; font-weight: 600 !important; line-height: 1.3 !important; text-decoration: none;
  cursor: pointer;
}
html body .site-header .nav a:hover, html body .site-header .nav .nav-menu > summary:hover, html body .site-header .nav-toggle:hover { color: #078c49 !important; background: #f4f7f5 !important; }
html body .site-header .nav a:focus-visible, html body .site-header .nav .nav-menu > summary:focus-visible, html body .site-header .nav-toggle:focus-visible { outline: 2px solid #078c49; outline-offset: 2px; }
html.dark body .site-header .nav a, html.dark body .site-header .nav .nav-menu > summary, html.dark body .site-header .nav-toggle { color: #f4f4ef !important; }
html.dark body .site-header .nav a:hover, html.dark body .site-header .nav .nav-menu > summary:hover, html.dark body .site-header .nav-toggle:hover { color: #7fe0a0 !important; background: #1d1d24 !important; }
/* The Calculators, Categories and Legal dropdowns keep their panels. */
html body .site-header .nav .nav-menu > summary { list-style: none; }
html body .site-header .nav .nav-menu > summary::-webkit-details-marker { display: none; }
@media (max-width: 720px) {
  html body .site-header.nav-open .nav a, html body .site-header.nav-open .nav .nav-menu > summary { width: 100%; justify-content: space-between; padding: 10px 4px !important; border-bottom: 1px solid #eef2f5 !important; border-radius: 0 !important; font-size: 15px !important; }
  html body .site-header .nav-toggle { padding: 6px 10px !important; }
}
/* The Menu button only appears on phones. */
html body .site-header .nav-toggle { display: none !important; }
@media (max-width: 720px) { html body .site-header .nav-toggle { display: inline-flex !important; } }
/* Calculators dropdown: each category heading links to its category page. */
.nav-col .nav-col-title a { color: inherit; text-decoration: none; }
.nav-col .nav-col-title a:hover { text-decoration: underline; }
/* Desktop: more space between the logo and the menu. */
@media (min-width: 900px) { html body .site-header .nav { margin-left: 120px; } }
/* Header menu: a little bigger, and the large Calculators panel stays inside the window at every width. */
html body .site-header .nav a, html body .site-header .nav .nav-menu > summary { font-size: 16px !important; padding: 8px 12px !important; }
@media (min-width: 900px) {
  html body .site-header .nav { margin-left: clamp(24px, 6vw, 120px); }
  html body .site-header .nav .nav-menu.nav-menu-wide > .nav-panel { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); width: min(760px, 94vw); max-height: 75vh; }
}
@media (min-width: 721px) and (max-width: 899px) {
  html body .site-header .nav .nav-menu.nav-menu-wide > .nav-panel { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); width: min(760px, 94vw); max-height: 75vh; }
}
/* Calculators dropdown: a wide, square-cornered rectangle with more columns. */
@media (min-width: 721px) {
  html body .site-header .nav .nav-menu.nav-menu-wide > .nav-panel { width: min(1160px, 94vw); grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 28px; padding: 22px 26px; border-radius: 4px; max-height: 75vh; }
}
/* Phones: the header row must fit 390px without sideways scrolling. */
@media (max-width: 480px) {
  html body .site-header .bar { gap: 6px 8px; }
  html body .site-header .brand { font-size: 1rem; }
  html body .site-header .brand-pro { margin-left: 2px; }
}
/* Desktop: small dropdowns (Math Solver, Contact us, Legal) are fixed below the header so the row's scroll clipping cannot hide them. */
@media (min-width: 721px) {
  html body .site-header .nav .nav-menu:not(.nav-menu-wide) > .nav-panel { position: fixed; top: 84px; }
}
/* Calculators dropdown: category headings are highlighted bands so each group stands out. */
.nav-col .nav-col-title { margin: 0 0 8px; padding: 7px 10px; border-radius: 6px; background: #fde68a; font-size: 13px; font-weight: 800; letter-spacing: .06em; color: #713f12; }
html.dark .nav-col .nav-col-title { background: #3d3210; color: #fcd34d; }
.nav-col .nav-col-title a { color: inherit !important; }
/* Phones: the Menu button sits at the far left with a menu icon, the logo follows, and search and theme are pushed to the right. */
@media (max-width: 720px) {
  html body .site-header .nav-toggle { order: -1; display: inline-flex !important; align-items: center; gap: 7px; }
  html body .site-header .nav-toggle::before { content: ""; display: inline-block; width: 16px; height: 2px; border-radius: 2px; background: currentColor; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; }
  html body .site-header .bar > .brand { order: 0; }
  html body .site-header .bar > .search-toggle { margin-left: auto; }
  html body .site-header .nav { order: 10; }
}
@media (max-width: 420px) {
  html body .site-header .bar { gap: 6px; }
  html body .site-header .brand { font-size: .92rem; }
}
/* Phones: the Menu button shows only its icon. The label stays in the page for screen readers via aria-label. */
@media (max-width: 720px) { html body .site-header .nav-toggle > span { display: none; } }
/* Phones: a larger logo. The Menu button is icon-only, so there is room for a bigger mark and wordmark. */
@media (max-width: 720px) {
  html body .site-header .brand { font-size: 1.3rem; gap: 6px; }
  html body .site-header .brand .mark { width: 36px; height: 36px; }
  html body .site-header .brand-pro { font-size: 9px; padding: 2px 5px; }
}
@media (max-width: 420px) {
  html body .site-header .brand { font-size: 1.15rem; }
  html body .site-header .brand .mark { width: 32px; height: 32px; }
}

/* Keep it simple site-wide: green is kept for primary buttons and final answers only.
   Accent variables for links, tags, borders and card tints become neutral. */
:root { --ins-accent: #111827; --ins-accent-soft: #f8fafc; --ins-accent-border: #e5e7eb; --m-mint: #f1f5f9; --m-mint-2: #f8fafc; --m-mint-line: #e5e7eb; --m-green: #111827; --m-green-ink: #111827; --h-green: #111827; --h-green-soft: #f8fafc; --h-green-line: #e5e7eb; --h-green-hover: #374151; --hv-green: #111827; --nb-green: #111827; }
html.dark { --ins-accent: #e5e7eb; --ins-accent-soft: #1c1c22; --ins-accent-border: #2a2a33; --m-mint: #1c1c22; --m-mint-2: #1c1c22; --m-mint-line: #2a2a33; --m-green: #e5e7eb; --m-green-ink: #e5e7eb; --h-green: #e5e7eb; --h-green-soft: #1c1c22; --h-green-line: #2a2a33; --h-green-hover: #cbd5e1; --hv-green: #e5e7eb; --nb-green: #e5e7eb; }
/* Primary buttons and final answers keep the green. */
.ins-done, .sd-btn-green, .ask-btn, .planner-card-cta, .m-cta a, a.ask-btn, .nb-final-value, .ins-hero-value { background-color: #078c49; }
.ins-done, .sd-btn-green { color: #ffffff !important; }
.ins-hero-value { background: transparent; color: #078c49; }

/* Header menu: every top-level item (plain links and menus) has the same height, alignment, weight and no underline. */
html body .site-header .nav { align-items: center !important; }
html body .site-header .nav > a, html body .site-header .nav > details.nav-menu > summary { display: inline-flex !important; align-items: center !important; gap: 6px !important; height: 44px !important; min-height: 44px !important; padding: 0 12px !important; margin: 0 !important; border: 0 !important; border-bottom: 0 !important; border-radius: 8px !important; background: transparent !important; box-shadow: none !important; color: #111827 !important; font-size: 16px !important; font-weight: 600 !important; line-height: 1 !important; text-decoration: none !important; vertical-align: middle !important; }
html body .site-header .nav > details.nav-menu { display: inline-flex !important; align-items: center !important; }
html body .site-header .nav > a:hover, html body .site-header .nav > details.nav-menu > summary:hover { background: #f3f4f6 !important; color: #111827 !important; text-decoration: none !important; }
html.dark body .site-header .nav > a, html.dark body .site-header .nav > details.nav-menu > summary { color: #f1f5f9 !important; background: transparent !important; }
html.dark body .site-header .nav > a:hover, html.dark body .site-header .nav > details.nav-menu > summary:hover { background: #1c1c22 !important; }

/* No line under the menu items: the menus and their labels carry no border. */
html body .site-header .nav details.nav-menu, html body .site-header .nav details.nav-menu > summary, html body .site-header .nav > a { border: 0 !important; border-bottom: 0 !important; border-top: 0 !important; box-shadow: none !important; outline: none !important; }
html body .site-header .nav details.nav-menu { background: transparent !important; }

/* Every top-level menu item sits on the same line: no offset, no margin, centred vertically. */
html body .site-header .nav > a, html body .site-header .nav > details.nav-menu { position: relative !important; top: 0 !important; margin: 0 !important; align-self: center !important; transform: none !important; vertical-align: middle !important; }
html body .site-header .nav > details.nav-menu > summary { margin: 0 !important; }

/* phone header never wider than the screen */
@media (max-width: 480px) {
  html body .site-header .bar { gap: 8px !important; padding-left: 12px !important; padding-right: 12px !important; max-width: 100vw; }
  html body .site-header .icon-btn { flex: none; }
}
html body { overflow-x: clip; }

/* very narrow phones: logo shrinks so the four header controls fit */
@media (max-width: 430px) {
  html body .site-header .brand { font-size: 19px !important; gap: 6px !important; min-width: 0; }
  html body .site-header .brand .mark, html body .site-header .brand .mark img { width: 30px !important; height: 30px !important; }
  html body .site-header .brand-pro { display: none !important; }
  html body .site-header .bar { justify-content: space-between; }
}

/* phones: a small gap at the left and right edges of solved-question and solver pages */
@media (max-width: 760px) {
  html body main.m214, html body main.sv-main, html body .m214.m-qpage { padding-left: 16px !important; padding-right: 16px !important; box-sizing: border-box; }
}

/* One page width for the header and every page: content starts exactly under the logo and ends under the last header control. */
@media (min-width: 900px) {
  html body main.wrap, html body main.sidebar-page, html body main.max-w-3xl, html body main.calc-cat, html body main.qa-page,
  html body main.qs-page, html body main.sd, html body main.m214, html body main.sv-main, html body main.home-main, html body main.hh {
    width: calc(100% - 80px) !important; max-width: 1200px !important; margin-left: auto !important; margin-right: auto !important;
    padding-left: 0 !important; padding-right: 0 !important; box-sizing: border-box;
  }
  html body.pr-demo main .page-grid, html body.pr-demo main .page-main { max-width: none !important; }
  /* reading pages keep a comfortable line length, starting at the left edge of the page */
  html body main.max-w-3xl > *, html body main.qa-page > *, html body main.qs-page > * { max-width: 760px; }
  html body main.qa-page > .qa-list, html body main.qs-page > .qs-list { max-width: 820px; }
}

/* Calculators dropdown: all categories in four balanced columns, plain headings, as wide as the page. */
@media (min-width: 721px) {
  html body .site-header .nav .nav-menu.nav-menu-wide > .nav-panel {
    display: block !important; column-count: 3; column-gap: 36px; width: min(1200px, calc(100vw - 80px)); left: 50%; transform: translateX(-50%);
    top: 84px; max-height: calc(100vh - 110px); overflow: auto; padding: 24px 28px; border-radius: 14px;
  }
  html body .site-header .nav .nav-menu.nav-menu-wide > .nav-panel .nav-col { break-inside: avoid; margin: 0 0 22px; }
}
@media (min-width: 1000px) { html body .site-header .nav .nav-menu.nav-menu-wide > .nav-panel { column-count: 4; } }
html body .nav-col .nav-col-title { background: none !important; padding: 0 0 8px !important; margin: 0 0 8px !important; border-radius: 0 !important; border-bottom: 1px solid #e2e8f0; color: #172b24 !important; font-size: 12px; letter-spacing: .08em; }
html.dark body .nav-col .nav-col-title { background: none !important; color: #f1f5f9 !important; border-bottom-color: #2a2a33; }
html body .nav-col a:hover, html body .site-header .nav .nav-panel a:hover { color: #14532d !important; }
html.dark body .nav-col a:hover, html.dark body .site-header .nav .nav-panel a:hover { color: #86efac !important; }

/* Desktop: logo, menu, search and theme button share one row (the older two-row layout is kept below 1200px). */
@media (min-width: 1200px) {
  html body .site-header .bar.bar { flex-wrap: nowrap; align-items: center; }
  html body .site-header .bar .nav { order: 0 !important; flex: 0 1 auto !important; margin-left: clamp(24px, 4vw, 64px) !important; flex-wrap: nowrap; }
  html body .site-header .bar .search { margin-left: auto; }
}

/* Small dropdowns (Math Solver, Contact us, About us): same look as the Calculators menu. */
html body .site-header .nav .nav-menu:not(.nav-menu-wide) > .nav-panel {
  min-width: 230px; padding: 8px !important; border-radius: 14px; border: 1px solid #e2e8f0; box-shadow: 0 12px 30px rgba(15, 23, 42, .12); gap: 2px;
}
html body .site-header .nav .nav-menu:not(.nav-menu-wide) > .nav-panel a {
  display: block !important; padding: 9px 12px !important; border-radius: 8px; font-size: 15px !important; line-height: 1.3; color: #172b24 !important; text-decoration: none !important;
}
html body .site-header .nav .nav-menu:not(.nav-menu-wide) > .nav-panel a:hover, html body .site-header .nav .nav-menu:not(.nav-menu-wide) > .nav-panel a:focus-visible { background: #f1f5f3; color: #14532d !important; text-decoration: none !important; }
html.dark body .site-header .nav .nav-menu:not(.nav-menu-wide) > .nav-panel { border-color: #2a2a33; }
html.dark body .site-header .nav .nav-menu:not(.nav-menu-wide) > .nav-panel a { color: #f1f5f9 !important; }
html.dark body .site-header .nav .nav-menu:not(.nav-menu-wide) > .nav-panel a:hover { background: #1f2227; color: #86efac !important; }

/* Menu items: Home and every dropdown trigger share one size, one hover and one open state. */
html body .site-header .nav > a, html body .site-header .nav .nav-menu > summary {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px !important; border-radius: 10px; border: 0 !important; box-shadow: none !important;
  background: transparent !important; color: #172b24; font-size: 16px !important; font-weight: 600; transition: background .15s;
}
html body .site-header .nav > a:hover, html body .site-header .nav .nav-menu > summary:hover, html body .site-header .nav .nav-menu[open] > summary { background: #f1f5f3 !important; }
html body .site-header .nav > a[aria-current="page"], html body .site-header .nav > a.is-current { box-shadow: inset 0 -2px 0 #14532d !important; border-radius: 10px 10px 0 0; }
html.dark body .site-header .nav > a, html.dark body .site-header .nav .nav-menu > summary { color: #f1f5f9; }
html.dark body .site-header .nav > a:hover, html.dark body .site-header .nav .nav-menu > summary:hover, html.dark body .site-header .nav .nav-menu[open] > summary { background: #1f2227 !important; }

/* Solved-question page, side blocks: plain cards, one dark green action, simple link rows. */
html body .m214 .m-practice, html body .m214 .qp-card, html body .m214 .m-related, html body .m214 .m-calc-link {
  background: #fff !important; border: 1px solid #e2e8f0 !important; border-radius: 18px !important; box-shadow: none !important; padding: 20px !important;
}
html body .m214 .m-practice { display: grid; gap: 10px; }
html body .m214 .m-practice-icon { display: none !important; }
html body .m214 .m-practice .m-h2, html body .m214 .m-related .m-h2, html body .m214 .qp-aside-title {
  margin: 0 !important; font-size: 18px !important; font-weight: 700 !important; letter-spacing: -.01em !important; text-transform: none !important; color: #172b24 !important;
}
html body .m214 .m-practice-text { margin: 0; font-size: 15px; line-height: 1.55; color: #475569; }
html body .m214 a.m-cta { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 12px !important; background: #14532d !important; border: 0 !important; text-decoration: none; }
html body .m214 a.m-cta .m-cta-text { background: transparent !important; color: #fff !important; padding: 0 !important; font-size: 15px; font-weight: 700; text-align: center; }
html body .m214 .m-calc-link { padding: 12px !important; }
html body .m214 .m-related ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
html body .m214 .m-related li a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #172b24 !important; font-size: 15px; font-weight: 600; text-decoration: none !important; }
html body .m214 .m-related li a::after { content: "\203A"; color: #64756d; font-size: 18px; }
html body .m214 .m-related li a:hover { background: #f1f5f3; color: #14532d !important; }
html.dark body .m214 .m-practice, html.dark body .m214 .qp-card, html.dark body .m214 .m-related, html.dark body .m214 .m-calc-link { background: #141418 !important; border-color: #2a2a33 !important; }
html.dark body .m214 .m-practice .m-h2, html.dark body .m214 .m-related .m-h2, html.dark body .m214 .qp-aside-title { color: #f1f5f9 !important; }
html.dark body .m214 .m-practice-text { color: #cbd5e1; }
html.dark body .m214 .m-related li a { color: #f1f5f9 !important; }
html.dark body .m214 .m-related li a:hover { background: #1f2227; color: #86efac !important; }
html body .m214 .m-h2 { text-transform: none !important; letter-spacing: -.01em !important; font-size: 20px !important; font-weight: 700 !important; color: #172b24; }
html body .m214 .m-lib-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; }
html body .m214 .m-lib-all { font-size: 15px; font-weight: 700; color: #14532d !important; text-decoration: none; }
html body .m214 .m-calc-link { padding: 16px !important; }
html.dark body .m214 .m-h2 { color: #f1f5f9; }
html.dark body .m214 .m-lib-all { color: #86efac !important; }
/* The practice card always stacks: text first, then a full-width button (never squeezed beside the text). */
html body .m214 .m-practice { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
html body .m214 .m-practice .m-practice-body { flex: none !important; width: 100% !important; }
html body .m214 .m-practice a.m-cta, html body .m214 a.m-cta { flex: none !important; width: 100% !important; max-width: 100% !important; writing-mode: horizontal-tb !important; white-space: normal; box-sizing: border-box; }
html body .m214 a.m-cta .m-cta-text { writing-mode: horizontal-tb !important; word-break: normal; overflow-wrap: normal; }
