/* Fieldwork styles apply to site chrome. Printed documents keep their own type and paper. */
@media screen {
  .fw-header, .ci-home, body[data-tool] { --fw-forest:#174760; --fw-rust:#af432f; --fw-ink:#203e50; --fw-paper:#fffaf4; --fw-rule:#d4e0e5; }
  .fw-header, .fw-header * { box-sizing:border-box; }
  header.fw-header { position:relative; z-index:15; display:flex; flex-direction:row; align-items:center; justify-content:flex-start; gap:28px; min-height:68px; height:auto; max-width:none; margin:0; padding:10px max(24px,calc((100% - 1176px)/2)); background:#fffaf4; border:0; border-bottom:1px solid #d4e0e5; color:#203e50; }
  .fw-brand { display:inline-flex; flex:none; align-items:center; gap:7px; min-height:44px; color:#174760!important; text-decoration:none!important; font:750 25px/1 'Segoe UI',system-ui,sans-serif; letter-spacing:-1.5px; }
  .fw-brand img { width:34px; height:34px; }
  .fw-header .fw-links, .fw-menu nav { display:flex; align-items:center; gap:26px; width:auto; margin-left:auto; }
  .fw-header nav a, .fw-menu summary { display:inline-flex; align-items:center; min-height:44px; font:600 14px/1.2 'Segoe UI',system-ui,sans-serif; color:#203e50; text-decoration:none; white-space:nowrap; }
  .fw-header nav a:hover, .fw-menu summary:hover { color:#af432f; text-decoration:underline; text-underline-offset:5px; }
  .fw-header .fw-menu { position:relative; display:none; margin:0 0 0 auto; }
  .fw-menu summary { list-style:none; border:1px solid #d4e0e5; border-radius:5px; padding:0 12px; gap:9px; cursor:pointer; }
  .fw-menu summary::-webkit-details-marker {display:none;}
  .fw-menu summary::after {content:"";width:6px;height:6px;border-right:2px solid;border-bottom:2px solid;transform:translateY(-2px) rotate(45deg);}
  .fw-menu[open] summary::after {transform:translateY(2px) rotate(225deg);}
  .fw-menu nav { position:absolute; z-index:20; top:calc(100% + 5px); right:0; width:170px; padding:6px; display:grid; gap:0; background:#ffffff; border:1px solid #d4e0e5; border-radius:7px; box-shadow:0 8px 20px #283b2822; }
  .fw-menu nav a {padding:0 12px;}
  .fw-header #historyToggle { flex:none; width:auto; margin:0; }
  .top-header.fw-header {padding:8px 20px;}
  .top-header.fw-header .menu-toggle {order:-1; color:#174760;}
  .top-header.fw-header .active-tool-badge {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
  .sidebar-header .fw-brand {color:#fff!important;}
  .sidebar-header .fw-brand img {background:#fffaf4; padding:3px; border-radius:6px;}
  .ci-home { background:#fffaf4; color:#203e50; }
  .ci-home main {max-width:none; margin:0;padding:0;}
  .ci-home .ci-hero { background:#edf4f6; border-bottom:1px solid #d4e0e5; padding:0 24px; text-align:left; }
  .fw-hero-inner {max-width:1176px; margin:auto; display:grid; grid-template-columns:1.05fr 1fr; align-items:center; gap:30px; padding:35px 0 32px;}
  .ci-home .ci-hero h1 {font:600 clamp(43px,4.8vw,72px)/.97 Georgia,'Times New Roman',serif; letter-spacing:-.055em; color:#174760; margin:0;}
  .ci-hero h1 em {font-weight:400;}
  .fw-hero-inner p {font:400 16px/1.45 'Segoe UI',system-ui,sans-serif; color:#536976; margin:14px 0 18px;max-width:46ch;}
  .ci-home .ci-search {max-width:525px;margin:0;}
  .ci-home .ci-search input {height:52px;min-height:52px;padding:10px 12px 10px 47px;border-radius:6px;background:#ffffff;border:1px solid #d4e0e5;font-size:16px;}
  .ci-home .ci-search svg {width:20px;height:20px;left:16px;top:16px;color:#536976;}
  .fw-desk {width:100%;height:auto;display:block;}
  .fw-lanes {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; max-width:1224px; padding:22px 24px 0; margin:auto;}
  .fw-lane {display:flex;align-items:center;gap:14px;min-height:72px;padding:12px 16px;border:1px solid #d4e0e5;border-radius:6px;background:#ffffff;color:#174760;text-decoration:none;}
  .fw-lane:hover,.ci-home .ci-tool:hover {background:#e3eef2;border-color:#7797a7;}
  .fw-lane-icon {color:#e66d51;} .fw-lane strong,.fw-lane small {display:block;} .fw-lane strong {font:600 20px/1.2 Georgia,serif;} .fw-lane small {font-size:13px;color:#536976;margin-top:3px;}
  .fw-lane>svg,.ci-home .ci-tool>svg {margin-left:auto;width:16px;color:#e66d51;}
  .ci-home .ci-directory {display:block;max-width:1224px;margin:auto;padding:24px 24px 0;background:none;scroll-margin-top:16px;}
  .ci-home .ci-directory-title {margin:0 0 10px;justify-content:flex-start;align-items:baseline;}
  .ci-home .ci-directory-title h2 {font:600 30px/1.2 Georgia,serif;color:#174760;}
  .ci-home .ci-directory-title span {color:#536976;}
  .ci-home .ci-filters {display:flex;flex-wrap:wrap;gap:5px;border:0;margin:0 0 14px;padding:0;}
  .ci-home .ci-filters button {display:inline-flex;align-items:center;justify-content:center;gap:6px;color:#203e50;border:1px solid #d4e0e5;background:#ffffff;border-radius:5px;font-size:13px;min-height:44px;width:auto;white-space:nowrap;margin:0;padding:7px 12px;}
  .ci-home .ci-filters button svg {width:15px;height:15px;}
  .ci-home .ci-filters button[aria-pressed=true] {background:#174760;border-color:#174760;color:white;}
  .ci-home .ci-tool-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
  .ci-home .ci-tool {align-items:flex-start; gap:12px;min-height:90px;border:1px solid #d4e0e5;border-radius:6px;padding:15px;background:#ffffff;}
  .ci-home .ci-tool h3 {font-size:16px;margin:0 0 4px;color:#174760;}
  .ci-home .ci-tool p {font-size:13px;line-height:1.4;color:#536976;}
  .ci-home .ci-tool-icon {display:grid;place-items:center;flex:none;width:35px;height:35px;border-radius:7px;background:#e3eef2;color:#174760;}
  .ci-home .ci-tool-icon svg {width:21px;height:21px;}
  .ci-home .ci-tool>svg {width:14px;height:18px;}
  .ci-home .ci-review {color:#af432f;}
  .ci-home #clearDirectory {margin:14px 0;}
  .ci-footer {background:#edf4f6;}
  body[data-tool]:has(.ci-header.fw-header) {background:#fffaf4;color:#203e50;}
  body[data-tool] .ci-header.fw-header ~ main h1 {font-family:Georgia,serif;font-weight:600;letter-spacing:-.045em;color:#174760;}
  body[data-tool] .ci-header.fw-header ~ main .result {background:#edf4f6;border-color:#d4e0e5;}
  body[data-tool] .ci-header.fw-header ~ main .result h2 {font-family:Georgia,serif;}
  .fw-header :focus-visible, .ci-home :focus-visible {outline:3px solid #e66d51;outline-offset:3px;}
}
@media screen and (max-width:850px) {
  .fw-hero-inner {gap:0;grid-template-columns:1.15fr 1fr;}
  .ci-home .ci-tool-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .fw-lane {gap:8px;padding:10px;} .fw-lane small {font-size:12px;}
  .top-header.fw-header .fw-links {display:none;} .top-header.fw-header .fw-menu {display:block;}
}
@media screen and (max-width:650px) {
  header.fw-header {padding:5px 16px;min-height:58px;gap:10px;}
  .fw-brand {font-size:22px;gap:5px;} .fw-brand img {width:28px;height:28px;}
  .fw-header .fw-links {display:none;} .fw-header .fw-menu {display:block;}
  .fw-header .fw-menu nav a {display:flex;}
  .ci-home .ci-hero {padding:0 16px;} .fw-hero-inner {display:block;padding:25px 0 21px;}
  .ci-home .ci-hero h1 {font-size:43px;max-width:none;margin:0;}
  .fw-hero-inner p {font-size:15px;margin:10px 0 14px;}
  .fw-desk {display:none;}
  .fw-lanes {padding:14px 16px 0;grid-template-columns:1fr;gap:0;}
  .fw-lane {min-height:50px;border-radius:0;padding:9px 12px;} .fw-lane+.fw-lane {border-top:0;}
  .fw-lane:first-child {border-radius:6px 6px 0 0;} .fw-lane:last-child {border-radius:0 0 6px 6px;}
  .fw-lane small {display:none;} .fw-lane strong {font-size:18px;}
  .fw-lane-icon svg {width:19px;height:19px;}
  .ci-home .ci-directory {padding:18px 16px 0;}
  .ci-home .ci-filters {flex-wrap:nowrap;overflow-x:auto;padding:4px;margin:0 -4px 8px;}
  .ci-home .ci-filters button {flex:none;} .ci-home .ci-tool-grid {grid-template-columns:1fr;}
  .ci-home .ci-tool {padding:12px;min-height:70px;}
}
@media print { .fw-header,.ci-home .fw-lanes,.fw-menu {display:none!important;} }
@media screen and (min-width:651px) {
  .fw-hero-inner {padding-top:25px;padding-bottom:25px;}
  .fw-desk {max-height:238px;}
}
@media screen and (max-width:380px) {
  header.site-header.fw-header {gap:6px;padding:5px 10px;}
  .site-header.fw-header #historyToggle {font:600 12px/1.1 'Segoe UI',system-ui,sans-serif;padding:7px;min-height:44px;}
  .site-header.fw-header .fw-brand {font-size:20px;}
}

/* Screen-only controls for the calculator form and document settings. */
@media screen and (max-width: 650px) {
  body main :is(form, .workspace-tools, .document-settings, .workspace, #formatting) :is(
    select, textarea, input:not([type="checkbox"], [type="radio"], [type="color"], [type="file"], [type="range"], [readonly])
  ) { font-size: max(16px, 1rem) !important; }
  body main :is(form, .result, .workspace-tools) :is(button, summary) {
    min-height: 44px;
  }
  body main :is(form, .result) summary {
    align-content: center;
  }
}
@media screen and (max-width: 650px) {
  .ci-home .ci-filters { flex-wrap: wrap; overflow: visible; gap: 4px; }
}

/* Bundles offer another route into the same canonical tool library. */
.ci-home .ci-browse-layout {display:grid;grid-template-columns:225px minmax(0,1fr);gap:28px;max-width:1224px;margin:28px auto 0;padding:0 24px;align-items:start;}
.ci-home .ci-browse-layout .ci-directory {width:100%;padding:0;min-width:0;}
.ci-bundles {padding:20px 14px;border:1px solid #d4e0e5;background:#edf4f6;border-radius:8px;}
.ci-bundles h2 {font:600 21px Georgia,serif;color:#174760;margin:0 0 8px;}
.ci-bundles p {font-size:13px;line-height:1.5;color:#536976;margin:0 0 16px;}
.ci-bundles button {display:block;width:100%;text-align:left;padding:12px 10px;min-height:44px;border:1px solid transparent;border-radius:5px;background:transparent;color:#174760;font:600 14px 'Segoe UI',sans-serif;cursor:pointer;}
.ci-bundles button:hover {background:#e3eef2;}
.ci-bundles button[aria-pressed=true] {background:#174760;color:#fff;}
.ci-bundles .ci-bundle-footnote {margin:20px 10px 0;font-size:12px;}
#bundleDescription {color:#536976;margin:0 0 14px;line-height:1.5;}
#bundleSections {display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px;}
#bundleSections button {border:1px solid #d4e0e5;background:#ffffff;color:#174760;border-radius:20px;padding:9px 13px;min-height:44px;cursor:pointer;font:inherit;font-size:13px;}
#bundleSections button[aria-pressed=true] {background:#e3eef2;border-color:#536976;}
#bundleNote {font-size:13px;color:#685a3c;line-height:1.5;margin:0 0 16px;}
#bundleNote:empty {display:none;}
.ci-home [hidden] {display:none!important;}
@media screen and (min-width:851px) {.ci-home .ci-browse-layout .ci-tool-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media screen and (max-width:850px) {.ci-home .ci-browse-layout {grid-template-columns:185px minmax(0,1fr);gap:18px;}.ci-home .ci-browse-layout .ci-tool-grid {grid-template-columns:1fr;}}
@media screen and (max-width:650px) {
 .ci-home .ci-browse-layout {display:block;margin-top:18px;padding:0 16px;}
 .ci-bundles {margin-bottom:22px;padding:14px;display:flex;flex-wrap:wrap;gap:5px;}
 .ci-bundles h2,.ci-bundles>p {width:100%;}.ci-bundles>p {margin-bottom:6px;}
 .ci-bundles button {width:auto;border-color:#d4e0e5;padding:9px;font-size:13px;}
 .ci-bundles .ci-bundle-footnote {display:none;}
 .ci-home .ci-directory-title {flex-wrap:wrap;gap:8px;}
 .ci-home .ci-directory-title h2 {font-size:26px;}
}
@media print {.ci-bundles {display:none;}.ci-home .ci-browse-layout {display:block;}}

@media screen {
  .ci-home .ci-footer .ci-reference-links {display:flex;flex-wrap:wrap;gap:16px;align-items:center;}
  .ci-reference-links a {display:inline-flex;align-items:center;min-height:44px;}
}
@media screen and (max-width:650px) {
  .ci-home .ci-footer {flex-wrap:wrap;gap:12px;}
  .ci-home .ci-footer .ci-reference-links {flex-basis:100%;}
}
