/* Options Profit Calculator Docs (docs.optionsprofitcalculator.com). Static site on Cloudflare Pages (scripts/build-docs.php).
   Colours follow the public site (lib/src/common/layout.css, content.css): the OPC logo, #003366 headings, #333399 links,
   the #343438 charcoal panel with #ffff88 headings, and black gloss buttons. */
:root {
  --heading: #003366; --link: #333399; --brand-red: #ff331f; --deep-red: #a50000; --page-blue: #06386a;
  --charcoal: #343438; --charcoal-2: #2a2a2e; --yellow: #ffff88;
  --ink: #1c2230; --muted: #596273; --faint: #8a91a3;
  --line: #e1e5ec; --soft: #f5f7fa; --soft-2: #eceff4; --blue-bg: #eaf0f8;
  --green: #1f8a4c; --green-bg: #e9f7ef; --red: #c4221a; --red-bg: #fdecea; --gold-ink: #7a5a00;
  --code-bg: var(--charcoal); --code-ink: #ececf1; --code-muted: #a3a3b0;
  --gloss: linear-gradient(180deg, #4c4c4c 0%, #595959 26%, #2c2c2c 50%, #000 51%, #2b2b2b 76%, #131313 100%);
  --sidebar-w: 260px; --toc-w: 220px; --header-h: 105px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0; background: #fff; color: var(--ink);
  font: 500 15.5px/1.65 Manrope, verdana, arial, sans-serif; letter-spacing: .01em; }
a { color: var(--link); text-decoration-color: rgba(51, 51, 153, .3); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #1f1f80; text-decoration-color: currentColor; }
img { max-width: 100%; }
code, kbd, pre { font-family: var(--mono); letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.d-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; background: #fff; }
.d-skip:focus { left: 8px; }

/* Full-width page */
.d-page { background: #fff; }

/* Header: a clean, pinned bar with the OPC logo. The green-to-red line underneath is the logo's own P/L colours. */
.d-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .9); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); }
.d-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; opacity: .85;
  background: linear-gradient(90deg, #12b83a 0%, #8fdc9c 30%, #ffffff 50%, #ff9a90 70%, #ff331f 100%); }
.d-header-row { display: flex; align-items: center; gap: 20px; height: 62px; padding: 0 24px; }
.d-logo { display: flex; align-items: center; gap: 10px; text-decoration: none !important; white-space: nowrap; }
.d-logo img { display: block; border-radius: 8px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .12); }
.d-logo-name { color: var(--heading); font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.d-logo-docs { padding-left: 10px; border-left: 1px solid #d5dae3; color: var(--muted); font-size: 16px; font-weight: 700; }
.d-logo:hover .d-logo-docs { color: var(--brand-red); }
.d-search-btn { display: flex; align-items: center; gap: 8px; flex: 0 1 380px; margin-left: 20px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--soft); color: var(--faint); font: inherit; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.d-search-btn:hover { border-color: #c5ccd8; background: #fff; color: var(--muted); }
.d-search-btn span { flex: 1; text-align: left; }
.d-search-btn kbd, .d-search-input kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--faint); font-size: 11px; }
.d-header-links { display: flex; align-items: center; gap: 22px; margin-left: auto; font-size: 14px; font-weight: 700; }
.d-header-links a { color: var(--ink); text-decoration: none; white-space: nowrap; }
.d-header-links a:hover { color: var(--heading); }
.d-tabs { display: flex; align-items: stretch; gap: 4px; height: 42px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
.d-tabs::-webkit-scrollbar { display: none; }
.d-tabs a { position: relative; display: flex; align-items: center; padding: 0 10px; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.d-tabs a:hover { color: var(--ink); }
.d-tabs a[aria-current] { color: var(--heading); }
.d-tabs a[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--brand-red); }
.d-menu-btn { display: none; width: 38px; height: 38px; margin-left: -6px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.d-menu-btn:hover { background: var(--soft-2); }
.d-menu-btn span, .d-menu-btn span::before, .d-menu-btn span::after { display: block; position: relative; width: 18px; height: 2px; margin: 0 auto; border-radius: 2px; background: var(--ink); content: ""; }
.d-menu-btn span::before { position: absolute; top: -6px; }
.d-menu-btn span::after { position: absolute; top: 6px; }

/* Buttons */
.d-btn { display: inline-block; padding: 8px 15px; border-radius: 8px; font-weight: 700; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.d-btn-primary, .d-header-links .d-btn-primary { border: 1px solid #111114; background: #18181c; color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.d-btn-primary:hover, .d-header-links .d-btn-primary:hover { background: #000; color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.d-btn-ghost { border: 1px solid #c5ccd8; background: #fff; color: var(--heading); }
.d-btn-ghost:hover { border-color: var(--heading); color: var(--heading); }
.d-btn-light { border: 1px solid #fff; background: #fff; color: var(--charcoal); }
.d-btn-light:hover { background: var(--yellow); color: var(--charcoal); }
.d-btn-lg { padding: 11px 20px; font-size: 15px; }

/* Three columns */
/* Text column next to its table of contents; on very wide screens the spare room goes to the right */
.d-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 850px) var(--toc-w) minmax(0, 1fr); }
.d-shell.d-no-sidebar { grid-template-columns: minmax(0, 1fr); }
.d-is-ref .d-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.d-sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 22px 12px 40px 16px; border-right: 1px solid var(--line); background: #fff; }
.d-nav-group { margin-bottom: 22px; }
.d-nav-group h2 { margin: 0 0 6px 10px; color: var(--deep-red); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.d-nav-group ul { margin: 0; padding: 0; list-style: none; }
.d-nav-group a { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; text-decoration: none; }
.d-nav-group a:hover { background: var(--soft-2); }
.d-nav-group a[aria-current] { background: var(--blue-bg); color: var(--heading); font-weight: 800; box-shadow: inset 3px 0 0 var(--heading); }
.d-nav-method { flex: none; width: 38px; padding: 0 !important; background: none !important; font: 700 10px/1 var(--mono); }
.d-nav-mobile-extra { display: none; }
.d-main { min-width: 0; padding: 30px 44px 0; }
.d-no-sidebar .d-main { max-width: 1180px; width: 100%; margin: 0 auto; }
.d-article { max-width: 760px; }
.d-is-ref .d-article, .d-no-sidebar .d-article { max-width: none; }
.d-toc { padding: 30px 18px 0 6px; }
.d-toc-inner { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
.d-toc h2 { margin: 0 0 8px; color: var(--faint); font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.d-toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.d-toc a { display: block; margin-left: -1px; padding: 4px 0 4px 12px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; line-height: 1.4; text-decoration: none; }
.d-toc a.d-sub { padding-left: 24px; }
.d-toc a:hover { color: var(--ink); }
.d-toc a.is-active { border-left-color: var(--brand-red); color: var(--heading); font-weight: 700; }
.d-toc:has(ul:empty) { visibility: hidden; }

/* Content */
.d-crumb { margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.d-crumb a { color: var(--muted); }
.d-article h1 { margin: 0 0 10px; color: var(--heading); font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -.015em; }
.d-article h2 { margin: 40px 0 10px; color: var(--heading); font-size: 22px; font-weight: 800; line-height: 1.3; }
.d-article h3 { margin: 28px 0 8px; color: var(--heading); font-size: 17px; font-weight: 800; }
.d-article h2 + h3 { margin-top: 12px; }
.d-article p, .d-article ul, .d-article ol { margin: 0 0 14px; }
.d-article li { margin-bottom: 6px; }
.d-article li > ul { margin: 6px 0 0; }
.d-article :not(pre) > code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--soft); color: #2a2f45; font-size: .86em; overflow-wrap: anywhere; }
.d-anchor { margin-left: 6px; color: var(--faint); font-weight: 400; opacity: 0; text-decoration: none !important; }
h2:hover .d-anchor, h3:hover .d-anchor { opacity: 1; }
.d-lede { color: var(--muted); font-size: 17px; line-height: 1.6; }
.d-article table { width: 100%; margin: 0 0 18px; border-collapse: collapse; font-size: 14px; }
.d-article th, .d-article td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.d-article th { background: var(--soft); color: var(--heading); font-weight: 800; }
.d-tablewrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 6px; }
.d-tablewrap table { margin: 0; }
.d-tablewrap tr:last-child td, .d-tablewrap tr:last-child th { border-bottom: 0; }
.d-steps { counter-reset: dstep; margin: 0 0 18px; padding: 0; list-style: none; }
.d-steps > li { position: relative; margin: 0 0 0 14px; padding: 0 0 18px 30px; border-left: 2px solid var(--line); }
.d-steps > li:last-child { border-left-color: transparent; }
.d-steps > li::before { counter-increment: dstep; content: counter(dstep); position: absolute; left: -15px; top: -2px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--charcoal); color: var(--yellow); font-size: 13px; font-weight: 800; line-height: 28px; text-align: center; }
.d-steps > li > strong:first-child { display: block; margin-bottom: 4px; color: var(--heading); font-size: 16px; }
.d-ui { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--soft); font-size: .9em; font-weight: 700; white-space: nowrap; }

/* Callouts */
.d-callout { margin: 0 0 18px; padding: 12px 16px; border: 1px solid; border-left-width: 4px; border-radius: 6px; font-size: 14.5px; }
.d-callout > strong:first-child { display: block; margin-bottom: 2px; font-size: 13px; letter-spacing: .02em; }
.d-callout p:last-child { margin-bottom: 0; }
.d-callout-note { border-color: #c5d3e8; background: var(--blue-bg); }
.d-callout-note > strong:first-child { color: var(--heading); }
.d-callout-tip { border-color: #bfe5cf; background: var(--green-bg); }
.d-callout-tip > strong:first-child { color: var(--green); }
.d-callout-warning { border-color: #f3c9c4; background: var(--red-bg); }
.d-callout-warning > strong:first-child { color: var(--deep-red); }

/* Cards */
.d-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 0 0 24px; }
.d-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .d-cards-3 { grid-template-columns: minmax(0, 1fr); } }
.d-card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none;
  transition: border-color .15s, box-shadow .15s; }
a.d-card:hover { border-color: #b9c0cc; box-shadow: 0 4px 16px rgba(0, 51, 102, .1); color: var(--ink); }
.d-card-icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-bottom: 6px; border-radius: 5px; background: var(--charcoal); color: var(--yellow); font-size: 16px; font-weight: 800; }
.d-card-title { color: var(--heading); font-weight: 800; }
a.d-card:hover .d-card-title { text-decoration: underline; }
.d-card-text { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Code blocks: the charcoal of the site's strategy panel */
.d-code { margin: 0 0 18px; border-radius: 5px; background: var(--code-bg); overflow: hidden; }
.d-code-bar { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px 0 14px; background: var(--charcoal-2); }
.d-code-title { color: var(--yellow); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-code-tabs { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.d-code-bar > .d-code-tabs:first-child { margin-left: -6px; }
.d-code-tabs button { padding: 5px 9px; border: 0; border-radius: 5px; background: transparent; color: var(--code-muted); font: 700 12px Manrope, sans-serif; white-space: nowrap; cursor: pointer; }
.d-code-tabs button:hover { color: #fff; }
.d-code-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .12); color: var(--yellow); }
.d-copy { margin-left: auto; padding: 4px 9px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 5px; background: transparent; color: var(--code-muted);
  font: 700 12px Manrope, sans-serif; cursor: pointer; }
.d-code-tabs + .d-copy { margin-left: 4px; }
.d-copy:hover { color: #fff; border-color: rgba(255, 255, 255, .4); }
.d-copy.is-done { color: #9be3b3; border-color: #9be3b3; }
.d-code pre { margin: 0; padding: 14px 16px; color: var(--code-ink); font-size: 13px; line-height: 1.6; overflow-x: auto; tab-size: 2; }
.d-code pre[hidden] { display: none; }
.d-code .t-s { color: #a8e6bb; }
.d-code .t-n { color: var(--yellow); }
.d-code .t-k { color: #a9c1ff; }
.d-code .t-c { color: #8d8d9c; font-style: italic; }
.d-code .t-p { color: #ffb3a8; }

/* API reference */
.d-ref { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 40px; align-items: start; }
.d-ref-code { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; }
.d-ref-code .d-code pre { max-height: 420px; }
.d-endpoint { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.d-endpoint code { padding: 0 !important; border: 0 !important; background: none !important; color: var(--heading) !important; font-size: 15px; font-weight: 600; }
.d-method { display: inline-block; padding: 3px 8px; border-radius: 4px; font: 800 12px/1.2 var(--mono); }
.d-method-get { background: var(--green-bg); color: var(--green); }
.d-method-post { background: var(--blue-bg); color: var(--link); }
.d-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px !important; padding: 0; list-style: none; }
.d-meta li { margin: 0; padding: 3px 10px; border-radius: 999px; background: var(--soft-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.d-fields { margin: 0 0 24px; border-top: 1px solid var(--line); }
.d-field { padding: 12px 0; border-bottom: 1px solid var(--line); }
.d-field dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.d-field dt code { padding: 0 !important; border: 0 !important; background: none !important; color: var(--heading) !important; font-size: 14px !important; font-weight: 600; }
.d-type { color: var(--faint); font: 12.5px var(--mono); }
.d-badge { padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.d-badge-req { background: var(--red-bg); color: var(--deep-red); }
.d-badge-opt { background: var(--soft-2); color: var(--faint); }
.d-field dd { margin: 0; color: var(--muted); font-size: 14.5px; }
.d-field dd ul { margin: 6px 0 0; padding-left: 18px; }
.d-field dd p { margin: 4px 0; }

/* Pager and footer */
.d-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; margin: 48px 0 0; }
.d-is-ref .d-pager { max-width: none; }
.d-pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; color: var(--heading); font-weight: 800; text-decoration: none; }
.d-pager a:hover { border-color: #b9c0cc; text-decoration: underline; }
.d-pager small { display: block; color: var(--faint); font-size: 12px; font-weight: 600; }
.d-pager-next { grid-column: 2; text-align: right; }
.d-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; max-width: 760px; margin: 56px 0 0; padding: 24px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.d-is-ref .d-footer, .d-no-sidebar .d-footer { max-width: none; }
.d-footer p { margin: 4px 0 0; }
.d-footer strong { color: var(--heading); }
.d-footer ul { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; }
.d-footer a { color: var(--link); }

/* Search */
.d-search { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(6, 56, 106, .6); }
.d-search[hidden] { display: none; }
.d-search-box { width: 100%; max-width: 620px; border: 1px solid #000; border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.d-search-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--faint); }
.d-search-input input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 17px; }
.d-search-results { max-height: 60vh; margin: 0; padding: 8px; overflow-y: auto; list-style: none; }
.d-search-results a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.d-search-results a small { display: block; color: var(--faint); font-size: 12px; }
.d-search-results a:hover, .d-search-results a.is-active { background: var(--blue-bg); }
.d-search-results a.is-active { color: var(--heading); }
.d-search-empty { padding: 18px 12px; color: var(--muted); }

/* Home */
.d-hero { padding: 52px 48px 48px; background: linear-gradient(180deg, var(--soft) 0%, #fff 100%); border-bottom: 1px solid var(--line); }
.d-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 660px); gap: 48px; align-items: center; max-width: 1310px; margin: 0 auto; }
.d-hero h1 { margin: 0 0 14px; color: var(--heading); font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.d-hero .d-lede { max-width: 560px; margin: 0 0 22px; font-size: 17.5px; }
.d-hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.d-hero-search { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 460px; padding: 11px 14px; border: 1px solid #c5ccd8; border-radius: 6px;
  background: #fff; color: var(--faint); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.d-hero-search:hover { border-color: var(--heading); }
.d-hero-search span { flex: 1; }
.d-hero-search kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.d-home-section { max-width: 1180px; margin: 0 auto 44px; }
.d-home-section > h2, .d-split h2 { margin: 0 0 6px; color: var(--heading); font-size: 22px; font-weight: 800; }
.d-home-section > p { margin: 0 0 18px; color: var(--muted); }
.d-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.d-linklist { margin: 0; padding: 0; list-style: none; }
.d-linklist li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.d-linklist a { font-weight: 800; }
.d-linklist span { display: block; color: var(--muted); font-size: 14px; }
/* The charcoal panel with yellow headings, as on the site's home page */
.d-band { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 22px 26px; border-radius: 5px; background: var(--charcoal); color: #eee; }
.d-band h2 { display: inline-block; margin: 0 0 8px; padding-bottom: 2px; border-bottom: 1px solid var(--yellow); color: var(--yellow) !important; font-size: 20px; font-weight: 800; }
.d-band p { margin: 0; }
.d-band a:not(.d-btn) { color: #fff; }
.d-is-home .d-main { max-width: none; padding: 0; }
.d-is-home .d-home-section, .d-is-home .d-footer { box-sizing: content-box; max-width: 1310px; margin-left: auto; margin-right: auto; padding-left: 48px; padding-right: 48px; }
.d-is-home .d-hero { margin: 0 0 44px; }
.d-is-home .d-footer { margin-top: 56px; }

/* Pricing */
.d-plans td.num, .d-plans th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-plans tbody tr.is-best td { background: #ffffd6; }
.d-plans tbody tr.is-best td:first-child { box-shadow: inset 4px 0 0 var(--brand-red); }
.d-plans td:first-child { color: var(--heading); font-weight: 800; white-space: nowrap; }
.d-choose { font-weight: 800; white-space: nowrap; }
.d-estimate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: end; margin: 0 0 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.d-estimate label { display: block; margin-bottom: 6px; color: var(--heading); font-size: 14px; font-weight: 800; }
.d-estimate input { width: 100%; padding: 9px 11px; border: 1px solid #b9c0cc; border-radius: 5px; font: inherit; font-size: 16px; }
.d-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.d-presets button { padding: 3px 10px; border: 1px solid #c5ccd8; border-radius: 999px; background: #fff; font: 700 12.5px Manrope, sans-serif; cursor: pointer; }
.d-presets button:hover { border-color: var(--heading); }
.d-estimate-out { padding: 12px 14px; border-radius: 5px; background: var(--charcoal); color: #ddd; font-size: 14px; }
.d-estimate-out strong { display: block; color: var(--yellow); font-size: 22px; }

/* Changelog */
.d-log { margin: 0; padding: 0; list-style: none; }
.d-log > li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 0 0 28px; }
.d-log time { color: var(--deep-red); font-size: 14px; font-weight: 800; }
.d-log h2 { margin: 0 0 8px !important; font-size: 19px !important; }
.d-tag { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; vertical-align: 2px; }
.d-tag-new { background: var(--green-bg); color: var(--green); }
.d-tag-changed { background: #fff6c2; color: var(--gold-ink); }
.d-tag-fixed { background: var(--blue-bg); color: var(--link); }

/* Narrower screens */
@media (max-width: 1240px) {
  .d-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .d-toc { display: none; }
  .d-ref { grid-template-columns: minmax(0, 1fr); }
  .d-ref-code { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 1020px) {
  .d-header-links a:not(.d-btn) { display: none; }
  .d-hero-inner, .d-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  /* Phone header: logo, search and menu on one row, section tabs below */
  :root { --header-h: 99px; }
  .d-header-row { gap: 8px; height: 56px; padding: 0 12px; }
  .d-menu-btn { display: block; }
  .d-logo img { width: 30px; height: 30px; }
  .d-logo-name { font-size: 15px; }
  .d-logo-docs { padding-left: 8px; font-size: 15px; }
  .d-search-btn { flex: none; width: 38px; height: 38px; justify-content: center; margin-left: auto; padding: 0; }
  .d-search-btn span, .d-search-btn kbd { display: none; }
  .d-header-links { display: none; }
  .d-tabs { padding: 0 6px; }
  .d-shell, .d-is-ref .d-shell { grid-template-columns: minmax(0, 1fr); }
  .d-sidebar { position: fixed; top: var(--header-h); left: 0; z-index: 25; width: min(320px, 86vw); height: calc(100vh - var(--header-h)); box-shadow: 8px 0 30px rgba(0, 0, 0, .25);
    transform: translateX(-105%); transition: transform .2s ease; }
  .d-nav-open .d-sidebar { transform: none; }
  .d-nav-mobile-extra { display: block; }
  .d-main { padding: 22px 16px 0; }
  .d-article h1 { font-size: 27px; }
  .d-hero { padding: 34px 16px 30px; }
  .d-hero h1 { font-size: 31px; }
  .d-is-home .d-home-section, .d-is-home .d-footer { padding-left: 16px; padding-right: 16px; }
  .d-band { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .d-estimate { grid-template-columns: minmax(0, 1fr); }
  .d-log > li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .d-steps > li { padding-left: 24px; }
}

@media (max-width: 400px) {
  .d-logo-docs { display: none; }
}
