/* chrome.css: tokens, base and the site chrome shared by every AB mockup page
   (mockup bar, header, "All calculators" panel, drawer, search results, breadcrumb, footer).
   Inlined unchanged into design/ab/*.html by the inject scripts. Tokens are those of section 1. */
:root {
  --bg: #ffffff; --ink: #111111; --ink2: #555555; --hair: #e3e3e3; --border: #767676;
  --accent: #8c1d40; --focus: #8c1d40; --critical: #b83200;
  --s-principal: #1f4fa8; --s-interest: #d9590f; --s-tax: #0e7d5c; --s-ins: #5e4300;
  --s-hoa: #3c96b4; --s-pmi: #858585; --s-balance: #4a3aa7;
  --serif: Georgia, "Times New Roman", Times, serif;
  --nums: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --small: 16px;
  color-scheme: light;
}
@media (min-width: 960px) { :root { --small: 15px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --ink: #e8e8e8; --ink2: #a6a6a6; --hair: #2b2b2b; --border: #8c8c8c;
    --accent: #f08aa6; --focus: #f08aa6; --critical: #ff7a4d;
    --s-principal: #4f8ff0; --s-interest: #f08a4f; --s-tax: #1f9e73; --s-ins: #f2cf5b;
    --s-hoa: #7fd3e8; --s-pmi: #a6a6a6; --s-balance: #a397f5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --ink: #e8e8e8; --ink2: #a6a6a6; --hair: #2b2b2b; --border: #8c8c8c;
  --accent: #f08aa6; --focus: #f08aa6; --critical: #ff7a4d;
  --s-principal: #4f8ff0; --s-interest: #f08a4f; --s-tax: #1f9e73; --s-ins: #f2cf5b;
  --s-hoa: #7fd3e8; --s-pmi: #a6a6a6; --s-balance: #a397f5;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--serif); }
@media (min-width: 960px) { body { font-size: 16px; } }
body.lock { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2 { text-wrap: balance; }
.nw { white-space: nowrap; }
/* A list row with a count: the count sits in its own right-aligned column, never alone on a new line. */
li.cl { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
li.cl > .count { flex: none; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
@media (min-width: 720px) { .wrap { padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); } }
.n { font-family: var(--nums); font-variant-numeric: tabular-nums lining-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -80px; background: var(--bg); padding: 10px 14px; z-index: 50; border: 1px solid var(--border); }
.skip:focus { top: 8px; }
.tag { display: inline-block; font: 600 11px/1 var(--nums); letter-spacing: .05em; text-transform: uppercase; color: var(--ink2); border: 1px solid var(--border); padding: 2px 4px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 0; cursor: pointer; font: 600 var(--small) var(--nums); }
.btn:hover { border-color: var(--ink); }
.ex { font: italic var(--small) var(--serif); color: var(--ink2); }
.count { font: var(--small) var(--nums); font-variant-numeric: tabular-nums lining-nums; color: var(--ink2); font-weight: 400; }

/* ---------- mockup bar (not part of the design) ---------- */
.mockbar { border-bottom: 1px dashed var(--border); font: 13px/1.4 var(--nums); color: var(--ink2); }
.mockbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-block: 4px; }
.mockbar strong { color: var(--ink); }
.mockbar [role="group"] { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mockbar button { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--border); padding: 3px 8px; min-height: 30px; cursor: pointer; }
.mockbar button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- header (scrolls away; never sticky) ---------- */
.site { position: relative; border-bottom: 1px solid var(--ink); padding-top: env(safe-area-inset-top); }
.bar1 { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; min-height: 64px; }
.bar1 > .wm, .bar1 > .btn, .bar1 > .langs, .bar1 > .hicon { flex-shrink: 0; }
.wm { display: inline-flex; align-items: flex-end; min-height: 44px; font: 400 28px/1 var(--serif); letter-spacing: .005em; color: var(--ink); text-decoration: none; margin-right: auto; }
.wm span { padding-bottom: 4px; border-bottom: 1px solid var(--ink); }   /* black in light, white in dark (owner, 2026-10-10) */
.wm:hover { color: var(--ink); }
.dsk { display: none; }
@media (min-width: 960px) { .dsk { display: block; } .mob { display: none !important; } }
/* Shared header search on every page; mobile opens the existing search dialog. */
.search { position: relative; flex: 1 1 240px; min-width: min(240px, 100%); max-width: 460px; }
.search input { width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 0; background: var(--bg); padding: 0 12px; font: 16px var(--nums); }
.search input:focus-visible { outline-offset: 0; }
/* Placeholder text in the secondary ink, not the browser's own grey (#757575). */
::placeholder { color: var(--ink2); opacity: 1; }
/* The /search/ page form: the same field as the other search boxes (tokens only, no browser greys in dark). */
.ssearch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ssearch input { flex: 1 1 220px; height: 44px; border: 1px solid var(--border); border-radius: 0; background: var(--bg); color: var(--ink); padding: 0 12px; font: 16px var(--nums); }
/* The clear (×) button of every search field: drawn in the ink colour (a mask filled with --ink), not the browser's own
   blue glyph (owner, 2026-10-11). Same size and place as the native one. */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-left: 8px; cursor: pointer; background-color: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 2l10 10M12 2 2 12' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 2l10 10M12 2 2 12' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}
.search .pop { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: -1px; }
/* The list may be wider than the field, so "name · department" fits on one line (owner, 2026-10-11): as wide as its
   longest row, at least the field, at most 640 px or the window. */
.search .pop { right: auto; width: max-content; min-width: 100%; max-width: min(640px, calc(100vw - 32px)); }
.search .results { max-height: 60vh; overflow: auto; }
.search .nores { margin: 0; padding: 4px 12px; background: var(--bg); border: 1px solid var(--border); }
.search .results:not([hidden]) + .nores { border-top: 0; }
@media (min-width: 960px) { .bar1:has(.search) .wm { margin-right: 0; } }
.topnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; border-top: 1px solid var(--hair); }
.topnav button { min-height: 44px; padding: 0 14px; background: transparent; border: 0; cursor: pointer; font-size: 16px; }
.topnav li:first-child button { padding-left: 0; }
/* a top-level item with one department is a link to it (command 10, point 1.6): the same box as the buttons */
.topnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-size: 16px; color: inherit; text-decoration: none; }
.topnav li:first-child a { padding-left: 0; }
.topnav a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--accent); }
.topnav a[aria-current="true"] { font-weight: 700; box-shadow: inset 0 -3px 0 var(--ink); }
.ptops a { display: flex; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 14px 0 0; align-items: center; font-size: 16px; color: inherit; text-decoration: none; }
.ptops a:hover { text-decoration: underline; }
.topnav button[aria-expanded="true"], .topnav button:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--accent); }

/* "All calculators" panel (desktop): three columns, at most 6 tools per group */
.panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--ink); max-height: 72vh; overflow: auto; }
.panel .wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.ptops { list-style: none; margin: 0; padding: 12px 0; border-right: 1px solid var(--hair); }
.ptops button { display: flex; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 14px 0 0; text-align: left; background: transparent; border: 0; cursor: pointer; font-size: 16px; }
.ptops button[aria-pressed="true"] { font-weight: 700; box-shadow: inset -3px 0 0 var(--accent); }
/* Current section of this page (department or tool page): weight plus a 3px bar, not colour alone. */
.topnav button[aria-current="true"] { font-weight: 700; box-shadow: inset 0 -3px 0 var(--ink); }
.pbody { padding: 12px 0 20px 24px; columns: 3 220px; column-gap: 28px; }
.dept { break-inside: avoid-column; margin-bottom: 18px; }
.dept h3 { font-size: 18px; border-bottom: 1px solid var(--hair); padding-bottom: 4px; margin-bottom: 6px; }
.dept h3 a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; } .dept h3 a:hover { text-decoration: underline; }
.grp { break-inside: avoid; margin-top: 8px; }
.grp h4 { font: 600 var(--small)/1.3 var(--nums); color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; }
.grp ul { list-style: none; margin: 2px 0 0; padding: 0; }
.grp a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; text-decoration: none; }   /* 44 x 44 tap targets (command 14 C10) */
.grp a:hover { text-decoration: underline; }
.grp a.more { color: var(--ink2); font: var(--small) var(--nums); }
.samplenote { font: var(--small) var(--nums); color: var(--ink2); padding: 8px 0 0 24px; }

/* drawer (mobile): full screen */
.drawer { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow: auto; overscroll-behavior: contain; padding-top: env(safe-area-inset-top); }
.dhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--ink); }
.dhead h2 { font-size: 22px; }
.dsearch { margin-top: 12px; position: relative; }
.dsearch input { width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 0; background: var(--bg); padding: 0 12px; font: 17px var(--nums); }
.acc { list-style: none; margin: 16px 0 24px; padding: 0; border-top: 1px solid var(--ink); }
.acc > li { border-bottom: 1px solid var(--hair); }
.acc button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; background: transparent; border: 0; text-align: left; font-size: 19px; cursor: pointer; padding: 0; }
.acc button .count { margin-left: auto; }
.acc button::after { content: "+"; width: 1em; text-align: center; font: 22px var(--nums); color: var(--accent); }
.acc button[aria-expanded="true"]::after { content: "\2212"; }
.acc button[aria-current="true"] { font-weight: 700; box-shadow: inset 3px 0 0 var(--ink); padding-left: 10px; }
.acc a.acc1 { display: flex; align-items: center; gap: 12px; min-height: 52px; font-size: 19px; color: inherit; text-decoration: none; }
.acc a.acc1 .count { margin-left: auto; }
.acc a.acc1::after { content: "\203A"; width: 1em; text-align: center; font: 22px var(--nums); color: var(--accent); }
.acc a.acc1[aria-current="true"] { font-weight: 700; box-shadow: inset 3px 0 0 var(--ink); padding-left: 10px; }
.acc2 { list-style: none; margin: 0 0 8px; padding: 0 0 0 14px; }
.acc2 > li { border-top: 1px solid var(--hair); }
.acc .acc2b { min-height: 48px; font-size: 17px; }
/* One bar per path (owner, 2026-10-13): an open top-level item is bold only; the bar marks the current department. */
.acc button.acc1[aria-current="true"]:not(.dept1) { box-shadow: none; padding-left: 0; }
.acc .more.dmore { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; color: var(--ink2); font: var(--small) var(--nums); text-decoration: none; }
.acc .more.dmore:hover { text-decoration: underline; }
.acc .dept { margin: 4px 0 16px; }
.acc .grp a { min-height: 44px; }

/* ---------- search results (combobox listbox) ---------- */
.results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); background: var(--bg); }
.results a { color: inherit; text-decoration: none; display: contents; }
.results li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 0 6px; padding: 10px 12px; min-height: 44px; cursor: pointer; border-top: 1px solid var(--hair); }
.results li:first-child { border-top: 0; }
.results li[aria-selected="true"] { outline: 3px solid var(--focus); outline-offset: -3px; }
.results .d { font: var(--small) var(--nums); color: var(--ink2); }
/* Phones: the department on its own muted line, without the dot; from 720 px on the same line after "· ". */
.results .d { flex-basis: 100%; }
.results .d .dot { display: none; }
@media (min-width: 720px) { .results .d { flex-basis: auto; } .results .d .dot { display: inline; } }
.nores { margin-top: 8px; font-size: 16px; }
.nores a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- breadcrumb ---------- */
.crumbs ol { list-style: none; margin: 10px 0 2px; padding: 0; display: flex; flex-wrap: wrap; font-size: var(--small); color: var(--ink2); }
.crumbs li { display: inline-flex; align-items: center; min-height: 44px; }
/* The separator ends each crumb, so a wrapped line never starts with a chevron. */
.crumbs li:not(:last-child)::after { content: "›"; padding-inline: 8px; }
/* Under 960 px one row: only the parent crumb, as "‹ Parent". The other crumbs stay for screen readers and the
   current one is the H1 just below (owner, 2026-10-13). */
@media (max-width: 959px) {
  .crumbs li:not(:nth-last-child(2)) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .crumbs li:nth-last-child(2)::after { content: none; }
  .crumbs li:nth-last-child(2)::before { content: "‹"; padding-inline-end: 8px; }
}
.crumbs a { color: var(--ink2); display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- footer: text sitemap ---------- */
.site-foot { margin-top: 48px; border-top: 1px solid var(--ink); padding-block: 18px max(28px, env(safe-area-inset-bottom)); font-size: 16px; }
.site-foot h2 { font-size: 18px; margin-bottom: 8px; }
.sitemap { columns: 2 260px; column-gap: 32px; margin: 0; padding: 0; list-style: none; }
.sitemap > li { break-inside: avoid; margin-bottom: 12px; }
.sitemap h3 { font-size: 16px; }
.sitemap ul { list-style: none; margin: 2px 0 0; padding: 0; }
.sitemap a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink2); }
.alllink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.legal { list-style: none; margin: 16px 0 6px; padding: 12px 0 0; border-top: 1px solid var(--hair); display: flex; flex-wrap: wrap; column-gap: 22px; }
.legal a { display: inline-flex; align-items: center; min-height: 44px; }
.fine { color: var(--ink2); font-size: var(--small); }

@media (prefers-reduced-motion: no-preference) {
  a, .btn { transition: color .15s ease, border-color .15s ease; }
}
@media print {
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
    --bg: #fff; --ink: #000; --ink2: #333; --hair: #bbb; --border: #555; --accent: #8c1d40;
    --s-principal: #1f4fa8; --s-interest: #d9590f; --s-tax: #0e7d5c; --s-ins: #5e4300; --s-hoa: #3c96b4; --s-pmi: #858585; --s-balance: #4a3aa7;
  }
  body { font-size: 11pt; }
  .mockbar, .skip, .bar1 .btn, .topnav, .panel, .drawer, [role="search"] { display: none !important; }
}

/* ---------- languages (command 10, part 3) ---------- */
/* The switcher: plain links in a <details>, so it works without JS. Shown only when the page exists in two or more
   published languages. Desktop: the current language's own name; phones: a globe and the language code. */
.langs { position: relative; }
.langs > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--border); cursor: pointer; list-style: none; font: 600 var(--small) var(--nums); }
.langs > summary::-webkit-details-marker { display: none; }
.langs[open] > summary { border-color: var(--ink); }
.langs ul { position: absolute; right: 0; top: 100%; z-index: 30; margin: 4px 0 0; padding: 4px 0; list-style: none; background: var(--bg); border: 1px solid var(--ink); min-width: 12em; }
.langs li a, .dlangs li a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; color: inherit; text-decoration: none; }
.langs li a:hover, .dlangs li a:hover { text-decoration: underline; }
.langs a[aria-current="true"], .dlangs a[aria-current="true"], .flangs a[aria-current="true"] { font-weight: 700; }
.dlangs { margin: 0 0 24px; }
.dlangs h2 { font-size: var(--small); margin: 0 0 4px; }
.dlangs ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.flangs { margin-top: 12px; }
/* The suggestion line: thin, closable, never a redirect. */
.langsuggest { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px; border-bottom: 1px solid var(--hair); font: var(--small)/1.4 var(--nums); }
.langsuggest p { margin: 0; }
/* Japanese (point 3.13): system fonts only, no web fonts and no external host; strict line breaking. Not tested on
   real devices yet. */
html:lang(ja) {
  --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "MS PMincho", serif;
  --nums: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
}
:lang(ja) { line-break: strict; word-break: normal; overflow-wrap: anywhere; }

/* section illustrations (command 15): decorative, sized by the page CSS; never printed */
picture.art { display: block; flex: none; }
picture.art img { display: block; height: auto; }
@media print { picture.art { display: none !important; } }

/* Header controls keep their text size and touch targets on narrow screens. */
@media (max-width: 600px) { .bar1 .langs > summary { padding-inline: 4px; } }
.drawer-all a { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 12px; }

/* Independent site destinations, outside calculator category navigation. */
.site .primary-nav{display:flex;flex-wrap:wrap;row-gap:0;column-gap:28px;border-top:1px solid var(--hair)}.primary-nav a{display:inline-flex;align-items:center;min-height:44px;color:inherit;text-decoration:none;font-size:16px}.primary-nav a:hover,.primary-nav a:focus-visible{ text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:5px}.primary-mobile{display:flex;flex-direction:column;margin-block:16px}.primary-mobile a{min-height:44px;display:flex;align-items:center;color:inherit;overflow-wrap:anywhere}
@media(max-width:959px){.primary-nav.dsk{display:none}}

/* Shared header: three navigation rows stay in normal flow on every page. */
.site { border-bottom: 0; --header-inline-eligible: 0; }
.bar1 { min-height: 64px; gap: 10px; }
.wm { font: 600 31px/1 var(--serif); letter-spacing: -.035em; }
.wm span { padding-bottom: 0; border-bottom: 0; }
.bar1 .btn { background: none; border: 0; font: 12px var(--serif); color: var(--accent); text-decoration: underline; text-underline-offset: 3px; padding: 0 4px; white-space: nowrap; }
.bar1 .btn:hover { color: var(--ink); }
.hicon, .bar1 #mMenu { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--ink); padding: 0; text-decoration: none; }
.hicon:hover, .bar1 #mMenu:hover { color: var(--accent); }
.hicon svg, #mMenu svg { width: 20px; height: 20px; }
.hicon { order: 2; }
#allBtn { order: 1; }
.topnav { display: none; }
@media (min-width: 1061px) {
  .topnav.dsk { display: block; position: static; max-width: 1280px; margin-inline: auto; padding-inline: 26px; }
  .topnav ul { justify-content: center; align-items: center; min-height: 44px; flex-wrap: wrap; gap: clamp(8px, 1vw, 18px); border-top: 0; }
  .topnav a, .topnav button, .topnav li:first-child a, .topnav li:first-child button { padding: 0 2px; font: 12px var(--serif); white-space: nowrap; color: var(--sub,var(--ink2)); }
  .topnav a:hover, .topnav button:hover { color: var(--accent); }
}
@media (max-width: 1060px) {
  .bar1 #allBtn { display: none; }
  .bar1 #mMenu { display: inline-grid !important; order: 3; }
}

.site .wrap { max-width:1280px; padding-inline:26px; }
.site { font:14px/1.55 var(--nums); }
.site .primary-nav a { font-size:16px; }
@media(max-width:1060px){.site .primary-nav.dsk,.site .search.dsk{display:none}.site #mSearch{display:inline-flex !important}}
@media(max-width:600px){.site .wrap{padding-inline:18px}.site .bar1{min-height:61px}.site .wm{font-size:27px}}
@media(max-width:360px){.site .wrap{padding-inline:13px}.site .bar1{gap:5px}}
.site #mMenu svg{fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* Language icons cannot inherit calculator icon dimensions. */
.site .langs .ico{width:20px;height:20px;flex:none}
@media(min-width:960px) and (max-width:1060px){.site .bar1 #mMenu{display:inline-grid !important}}
