/* Header shared by the internal pages and the standalone tools. Same light bar as the home page. */
html:root body .coase-site-nav.nav {
  /* Tools redefine these token names for their own interface; the header keeps the site values. */
  --paper: #fff; --ink: #111; --accent: #b54c15; --rule: #e3e3e3; --text-3: #5c5c5c; 
  display: block;
  position: sticky;
  inset-block-start: 0;
  z-index: 1000;
  box-sizing: border-box;
  width: var(--site-viewport,100%);
  max-width: none;
  height: auto;
  margin: 0;
  margin-inline: calc((100% - var(--site-viewport,100%)) / 2);
  padding: 0;
  background: var(--paper);
  backdrop-filter: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font: 400 12px/1.35 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  overflow: visible;
}
.coase-site-nav.nav *, .coase-footer * { box-sizing: border-box; }
html:root body .coase-site-nav.nav .nav-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 72px;
  padding: 14px max(32px,env(safe-area-inset-right,0px),calc((100% - 1360px) / 2)) 14px max(32px,env(safe-area-inset-left,0px),calc((100% - 1360px) / 2));
  margin: 0;
}
html:root body .coase-site-nav.nav .brand {
  color: var(--ink);
  font: 500 17px/1 var(--sans);
  letter-spacing: .22em;
  text-decoration: none;
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
html:root body .coase-site-nav.nav .brand span { color: var(--accent); }
html:root body .coase-site-nav.nav #navigation {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0 28px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  position: static;
  width: auto;
  height: auto;
  max-height: none;
  overflow: visible;
}
html:root body .coase-site-nav.nav .nav-links { display: flex; flex-wrap: nowrap; gap: 0 clamp(12px,1.4vw,24px); align-items: center; }
html:root body .coase-site-nav.nav .nav-actions { display: flex; flex-wrap: nowrap; gap: 0 12px; align-items: center; }
html:root body .coase-site-nav.nav #navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 8px 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  white-space: nowrap;
  transition: color .2s, background .2s, border-color .2s;
}
html:root body .coase-site-nav.nav #navigation .nav-links a:hover { color: var(--text-3); }
html:root body .coase-site-nav.nav #navigation .nav-links a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--accent); }
html:root body .coase-site-nav.nav #navigation .btn { border: 1px solid var(--ink); padding: 14px 18px; letter-spacing: .1em; }
html:root body .coase-site-nav.nav #navigation .btn:hover { background: var(--ink); color: var(--paper); }
html:root body .coase-site-nav.nav #navigation .btn.solid { background: var(--ink); color: var(--paper); }
html:root body .coase-site-nav.nav #navigation .btn.solid:hover { background: var(--accent); border-color: var(--accent); }
html:root body .coase-site-nav.nav :is(a,button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html:root body .coase-site-nav.nav a::after { content: none; }
html:root body .coase-site-nav.nav .nav-toggle { display: none; }
/* Six links and two actions stay on one line on laptop widths. */
@media (min-width: 1241px) and (max-width: 1439px) {
  html:root body .coase-site-nav.nav { font-size: 11px; letter-spacing: .07em; }
  html:root body .coase-site-nav.nav .nav-inner { column-gap: 16px; }
  html:root body .coase-site-nav.nav #navigation { column-gap: 16px; }
  html:root body .coase-site-nav.nav .nav-links { column-gap: 12px; }
  html:root body .coase-site-nav.nav #navigation .btn { padding-inline: 13px; letter-spacing: .07em; }
}
/* Wide screens: the bar shares the 1360px content container; with the two-line items the links need the tighter spacing at every width from 1440px. */
@media (min-width: 1440px) {
  html:root body .coase-site-nav.nav { letter-spacing: .08em; }
  html:root body .coase-site-nav.nav .nav-links { column-gap: 14px; }
  html:root body .coase-site-nav.nav #navigation { column-gap: 14px; }
  html:root body .coase-site-nav.nav #navigation .btn { padding-inline: 13px; }
}
/* Tablet and phone: the links move into a panel opened by the Menu button. Without scripts they wrap under the brand. */
@media (max-width: 1240px) {
  html:root body .coase-site-nav.nav .nav-inner {
    flex-wrap: wrap;
    min-height: 64px;
    padding: 10px max(16px,env(safe-area-inset-right,0px)) 10px max(16px,env(safe-area-inset-left,0px));
  }
  html:root body .coase-site-nav.nav #navigation { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; }
  html:root body .coase-site-nav.nav :is(.nav-links,.nav-actions) { flex-wrap: wrap; }
  html:root body .coase-site-nav.nav.has-toggle .nav-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
  }
  html:root body .coase-site-nav.nav.has-toggle #navigation { display: none; }
  html:root body .coase-site-nav.nav.has-toggle.is-open #navigation {
    display: block;
    position: absolute;
    inset: 100% 0 auto 0;
    max-height: calc(100dvh - 64px);
    overflow: auto;
    padding: 8px max(16px,env(safe-area-inset-right,0px)) 24px max(16px,env(safe-area-inset-left,0px));
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
  }
  html:root body .coase-site-nav.nav.has-toggle .nav-links { display: block; }
  html:root body .coase-site-nav.nav.has-toggle #navigation .nav-links a { display: flex; min-height: 48px; border-bottom: 1px solid var(--rule); }
  html:root body .coase-site-nav.nav.has-toggle #navigation .nav-links a[aria-current="page"] { box-shadow: none; color: var(--accent); }
  html:root body .coase-site-nav.nav.has-toggle .nav-actions { gap: 12px; padding-top: 20px; }
}
.coase-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 20px max(32px,env(safe-area-inset-right,0px),calc((100% - 1360px) / 2)) 20px max(32px,env(safe-area-inset-left,0px),calc((100% - 1360px) / 2));
  border-top: 1px solid var(--rule);
  color: var(--text-3);
  font-size: 13px;
}
.coase-footer nav { display: flex; flex-wrap: wrap; gap: 12px; }
.coase-footer a { text-underline-offset: 3px; }
@media (max-width: 1240px) {
  .coase-footer { padding-inline: max(16px,env(safe-area-inset-left,0px)) max(16px,env(safe-area-inset-right,0px)); }
}
.coase-legal-links{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px 20px;font:400 13px/1.5 var(--sans);letter-spacing:normal;text-transform:none;position:relative;z-index:2}.coase-legal-links a{color:inherit!important;text-decoration:underline!important;text-underline-offset:4px;min-height:44px;display:inline-flex;align-items:center}.coase-legal-links a:focus-visible{outline:2px solid currentColor;outline-offset:4px}.coase-legal-footer,.work-footer{padding:18px max(32px,calc((100% - 1360px) / 2));background:var(--paper);color:var(--text-3);border-top:1px solid var(--rule)}.legal-page .privacy-copy{max-width:850px}.legal-page .privacy-copy h2{margin-top:38px}.legal-page .privacy-copy h3{margin-top:24px}.legal-page .privacy-copy p,.legal-page .privacy-copy li{line-height:1.75}.legal-page .privacy-copy code{overflow-wrap:anywhere;font-size:.9em}.legal-page .privacy-copy a{color:inherit;text-decoration:underline;text-underline-offset:3px}.legal-page .policy-index{display:flex;gap:20px;flex-wrap:wrap;margin:24px 0}.legal-page .privacy-copy ul{padding-left:22px}.legal-page .privacy-page-title h1{font-size:clamp(40px,7vw,84px)}@media(max-width:700px){footer:has(.coase-legal-links){flex-wrap:wrap;gap:12px}.coase-legal-links{width:100%}.legal-page .access-shell{box-sizing:border-box;width:100%;padding-inline:22px}}
.home-footer .coase-legal-links{flex:0 0 100%;justify-content:flex-start;box-sizing:border-box;padding-right:170px}
.work-footer{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px;font-size:13px;border-top:1px solid var(--rule)}.work-footer .coase-legal-links{margin-left:auto}
@media (max-width:1240px){.coase-legal-footer,.work-footer{padding-inline:16px}}

/* Nav links: title plus one-line descriptor. */
html:root body .coase-site-nav.nav #navigation .nav-links a { flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 8px 0; }
html:root body .coase-site-nav.nav #navigation .nav-links a .t { display: block; }
html:root body .coase-site-nav.nav #navigation .nav-links a .d { display: block; font-size: .92em; letter-spacing: .02em; text-transform: none; color: var(--text-3); line-height: 1.25; }
html:root body .coase-site-nav.nav #navigation .nav-links a:hover .d { color: var(--ink); }
html:root body .coase-site-nav.nav #navigation .nav-links a[aria-current="page"] .d { color: var(--ink); }
@media (max-width: 1240px) {
  html:root body .coase-site-nav.nav.has-toggle #navigation .nav-links a { display: flex; padding: 12px 0; }
}
@media (min-width: 1241px) and (max-width: 1299px) {
  html:root body .coase-site-nav.nav #navigation .nav-links a .d { display: none; }
}

/* Local navigation shared by the hub, Knowledge Layer, Engine Tools and Use Cases pages. */
.stack-nav { border-bottom: 1px solid var(--rule); background: var(--paper); font-family: var(--sans); }
.stack-nav-in { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; padding: 0 max(32px,calc((100% - 1360px) / 2)); }
.stack-nav-h { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-right: auto; padding: 14px 0; }
.stack-nav a { display: inline-flex; align-items: center; min-height: 46px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); text-decoration: none; box-shadow: none; }
.stack-nav a:hover { color: var(--ink); }
.stack-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.stack-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 820px) {
  .stack-nav-in { padding: 0 16px; gap: 0 20px; flex-wrap: nowrap; overflow-x: auto; }
  .stack-nav-h { display: none; }
  .stack-nav a { white-space: nowrap; }
}
