/* Shared Stage 1 presentation, loaded last. Calculations and authored content remain unchanged. */
@media screen {
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
    --bg: #080808; --ink: #f2eee8; --ink2: #bcb0ab; --hair: #3b3736; --border: #8c8179;
    --accent: #e27b8d; --focus: #f9afc0; --critical: #ff7a4d;
    --sans: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --sub: #e0d4ca; --card: #0b0b0b; --card-hover: #171113; --edge-hover: #935466; --field: #141313; --field-edge: #8c8179;
    --rule: #bd5164; --chip-edge: #853c4c; --chip-hover: #40232c; --cta-from: #a53b50; --cta-to: #b8485d; --stat-edge: #6c5257; --art-panel: transparent;
    --overline: #d48a9a; color-scheme: dark;
  }
  :root[data-theme="light"] {
    --bg: #ffffff; --ink: #111111; --ink2: #555555; --hair: #e3e3e3; --border: #767676;
    --accent: #8c1d40; --focus: #8c1d40; --critical: #b83200;
    --sub: #333333; --card: #ffffff; --card-hover: #faf5f6; --edge-hover: #8c1d40; --field: #ffffff; --field-edge: #767676;
    --rule: #8c1d40; --chip-edge: #8c1d40; --chip-hover: #f6e9ed; --cta-from: #8c1d40; --cta-to: #a32a50; --stat-edge: #767676; --art-panel: #0b0b0b;
    --overline: #8c1d40; color-scheme: light;
  }
  .calc:not(.embed), .calc-paper, .strip {
    --bg: #ece2d5; --ink: #251f1d; --ink2: #5f544e; --hair: #d3c1ae; --border: #7c6d64;
    --accent: #7a2d42; --focus: #7a2d42; --critical: #9c2a00;
    --s-principal: #1f4fa8; --s-interest: #d9590f; --s-tax: #0e7d5c; --s-ins: #5e4300;
    --s-hoa: #287f99; --s-pmi: #777777; --s-balance: #4a3aa7;
    color-scheme: light; background: var(--bg); color: var(--ink);
  }
  .calc:not(.embed) { padding: 0 20px; border: 1px solid var(--hair); border-radius: 8px; }
}
body { font-size: 17px; line-height: 1.6; }
main { padding-top: 24px; padding-bottom: 48px; }
body[data-page-kind="home"] main { padding-top: 0; }
body[data-page-kind="tool"] h1 { margin-top: 18px; max-width: 25ch; }
body[data-page-kind="tool"] .below { margin-top: 36px; }
body[data-page-kind="text"] .text { max-width: 68ch; }
body[data-page-kind="text"] .text h1 { margin-block: 24px; }
.bar1 { flex-wrap: wrap; gap: 8px 12px; }
.bar1 .wm { flex-shrink: 0; }
.bar1 .search { min-width: 180px; }
.bar1 .theme-toggle { min-height: 44px; min-width: 44px; padding: 6px 10px; font-size: 14px; order: 4; }
.bar1 .theme-toggle[aria-pressed="true"] { border: 1px solid var(--border); border-radius: 4px; }
.bar1 .btn { font-size: 14px; }
.topnav.dsk { position: static; padding-inline: 24px; max-width: 1280px; margin-inline: auto; }
.topnav ul { flex-wrap: wrap; min-height: 44px; }
.topnav a, .topnav button, .topnav li:first-child a, .topnav li:first-child button { font-size: 16px; min-height: 44px; }
.footer-intro, .footer-links a { font-size: 15px; }
.footer-bottom { font-size: 13px; flex-wrap: wrap; }
.footer-grid > * { min-width: 0; }
.footer-links a { overflow-wrap: anywhere; }
.ad-placement { margin-block: 32px; padding-block: 16px; border-block: 1px solid var(--hair); display: flex; flex-wrap: wrap; gap: 12px; }
.ad-placement > span { color: var(--ink2); font: 14px var(--nums); }
@media (max-width: 719px) {
  .wrap { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .calc:not(.embed) { padding-inline: 0; }
  .calc:not(.embed) > .inputs, .calc:not(.embed) > .outputs > #result { padding-inline: 12px; }
  .bar1 .wm { font-size: 26px; }
  .bar1 .search { display: none; }
}
@media print {
  .theme-toggle, .ad-placement { display: none !important; }
  .calc, .calc-paper { --bg: #fff; --ink: #000; --ink2: #333; background: white; color: black; }
}

/* Keep the existing calculator/header desktop breakpoint, including tablet landscape. */
@media (min-width: 960px) {
  .bar1 #allBtn { display: inline-flex; }
  .bar1 #mMenu { display: none !important; }
}

/* Approved compact wordmark and shared interface additions. */
.wm, .footer-brand { font-family: var(--serif); font-weight: 600; letter-spacing: -.035em; text-decoration: none; }
.wm { font-size: 29px; }
.wm::after, .footer-brand::after { content: ''; display: inline-block; width: .18em; height: .18em; margin-left: .10em; border-radius: 50%; background: #a64d60; vertical-align: baseline; }
.wm::after { margin-bottom: 2px; }
.bar1 .langs { order: 3; }
.lang-unavailable { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 6px 14px; color: var(--ink2); font: 15px var(--nums); }
.lang-unavailable small { font-size: 11px; }
.langs ul { min-width: 250px; max-width: calc(100vw - 32px); }
.langs a[aria-current="true"]::after { content: '✓'; margin-left: auto; padding-left: 12px; }
.flangs { display: none; }
.ad-placement.cpscount-ad { display: block; border: 0; padding: 0; margin: 32px auto 48px; max-width: 970px; }
.ad-label { color: var(--ink2); font: 11px var(--nums); letter-spacing: .06em; margin-bottom: 8px; }
.ad-banner { display: block; width: 100%; max-width: 970px; aspect-ratio: 970 / 90; margin-inline: auto; line-height: 0; }
.ad-banner picture, .ad-banner img { display: block; width: 100%; height: 100%; }
.ad-banner img { object-fit: contain; }
@media(max-width:719px) { .ad-banner { max-width: 320px; aspect-ratio: 320 / 100; } }
@media(max-width:719px) { .bar1 { gap: 4px; } .bar1 .wm { font-size: 25px; } .bar1 .theme-toggle { font-size: 12px; padding-inline: 4px; } .langs > summary { padding-inline: 6px; font-size: 12px; } }

.footer-brand { font-size:29px; }

.wm span { border-bottom:0; padding-bottom:0; }

.cpscount-ad[hidden] { display: none !important; }

/* Text advertisements share the existing typography, accent and placement. */
.ad-banner.website-link { display:flex; align-items:center; justify-content:space-between; gap:24px; min-height:140px; height:auto; aspect-ratio:auto; padding:20px 24px; border:1px solid var(--line, #77505b); border-radius:4px; color:var(--ink, #f2f0ef); background:var(--bg, #080808); text-decoration:none; line-height:1.4; }
.website-link .ad-copy { display:grid; gap:5px; min-width:0; overflow-wrap:anywhere; }
.website-link .ad-domain { font:12px var(--nums, monospace); color:var(--ink2, #c7b8bd); }
.website-link .ad-title { font:500 25px/1.2 var(--serif, Georgia, serif); }
.website-link .ad-description { font:15px/1.5 var(--serif, Georgia, serif); }
.website-link .ad-cta { flex:none; padding:10px 16px; border:1px solid currentColor; border-radius:4px; color:var(--accent, #d697a9); font:14px/1.4 var(--nums, monospace); text-align:center; max-width:240px; overflow-wrap:anywhere; }
@media(max-width:719px) { .ad-banner.website-link { flex-direction:column; align-items:flex-start; gap:16px; min-height:220px; max-width:320px; padding:20px; } .website-link .ad-title { font-size:23px; } .website-link .ad-cta { align-self:flex-start; } }
