/* One public navigation measure. The visual circle/pill is always 28px;
   phones and coarse pointers retain a separate, unobstructed 44px hit area. */
:root {
 --public-nav-control-size:var(--entropic-control-height,28px);
 --public-nav-hit-size:var(--public-nav-control-size);
 --public-nav-icon-size:20px;
}
html body { --control-pill-height:var(--public-nav-control-size); }

html body .site-header #site-navigation { align-items:center; }
html body .site-header #site-navigation > .editor-shortcuts {
 align-items:center;gap:2px;margin-right:0;flex:0 0 auto;
}
html body .site-header #site-navigation :is(.editor-shortcut,.site-search-toggle,.theme-toggle) {
 position:relative;display:grid;place-items:center;flex:none;box-sizing:border-box;
 width:var(--public-nav-hit-size)!important;height:var(--public-nav-hit-size)!important;
 min-width:var(--public-nav-hit-size);min-height:var(--public-nav-hit-size);
 padding:calc((var(--public-nav-hit-size) - var(--public-nav-icon-size))/2)!important;
 margin-block:0!important;border:0;border-radius:50%!important;background-clip:border-box!important;
}
html body .site-header #site-navigation :is(.editor-shortcut,.site-search-toggle,.theme-toggle) svg {
 display:block;width:var(--public-nav-icon-size)!important;height:var(--public-nav-icon-size)!important;
 flex:none;scale:1!important;
}
html body .site-header #site-navigation .editor-shortcut-count {
 top:-4px;right:-4px;min-width:13px;height:13px;padding:0 3px;font-size:9px;
}

/* Collection navigation uses the page navigation's exact circle/pill size.
   Keep the search wrapper in normal flow so its expansion moves its peers. */
html body.page-projects #project-browser .browser-topline .browser-view-switch {
 display:flex;align-items:center;gap:4px;flex:0 0 auto;
}
html body.page-projects #project-browser .browser-topline .browser-view-switch button {
 position:relative;flex:none;box-sizing:border-box;
 width:var(--public-nav-hit-size)!important;height:var(--public-nav-hit-size)!important;
 min-width:var(--public-nav-hit-size);min-height:var(--public-nav-hit-size);
 padding:calc((var(--public-nav-hit-size) - var(--public-nav-icon-size))/2)!important;
 border:0;border-radius:50%!important;background-clip:border-box!important;
}
html body.page-projects #project-browser .browser-topline .browser-view-switch button svg {
 width:var(--public-nav-icon-size)!important;height:var(--public-nav-icon-size)!important;
 scale:1!important;
}
@media(min-width:901px) and (hover:hover) and (pointer:fine) {
 html body:not(.page-project-detail) .site-header #site-navigation > a {
  display:inline-flex!important;align-items:center;justify-content:center;box-sizing:border-box;
  height:var(--public-nav-control-size)!important;min-height:var(--public-nav-control-size)!important;
  padding-block:0!important;
 }
 html body.page-projects #project-browser .browser-topline .collection-scope {
  height:var(--public-nav-control-size)!important;padding:0!important;gap:0!important;
  box-sizing:border-box;border:0!important;border-radius:999px;
 }
 html body.page-projects #project-browser .browser-topline :is(.collection-scope button,.filter-layer>summary) {
  display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  height:var(--public-nav-control-size)!important;min-height:var(--public-nav-control-size)!important;
  padding-block:0!important;border-radius:999px!important;
 }
 html body.page-projects #project-browser .browser-topline .filter-layer>summary::after {
  top:50%;transform:translateY(-70%) rotate(45deg);
 }
}

/* Project chrome keeps its established stationary 44px slots and footer axes.
   Only the painted top action circles inherit the page-navigation measure. */
html body.page-project-detail .project-micro-actions :is(.project-god-mode,.project-editor) {
 isolation:isolate;background:transparent!important;
}
html body.page-project-detail .project-micro-actions :is(.project-god-mode,.project-editor)::before {
 content:'';position:absolute;z-index:-1;left:50%;top:50%;translate:-50% -50%;
 width:var(--public-nav-control-size);height:var(--public-nav-control-size);border-radius:50%;
 background:#ffffff24;opacity:0;pointer-events:none;transition:opacity .22s ease;
}
html body.page-project-detail .project-micro-actions :is(.project-god-mode,.project-editor):is(:hover,:focus-visible)::before { opacity:1; }
html body.page-project-detail :is(.project-micro-actions button,.story-reader__index)::before {
 width:var(--public-nav-control-size);height:var(--public-nav-control-size);
}
html body.page-project-detail .project-micro-actions :is(a,button) svg {
 width:18px;height:18px;scale:1!important;
}

@media(max-width:900px),(hover:none),(pointer:coarse) {
 :root { --public-nav-hit-size:var(--entropic-control-touch-height,44px); }
 /* Do not turn the enlarged hit area into another tall filled button. Search
    owns its reversible inline pill; the other icons paint a centered disc. */
 html body .site-header #site-navigation :is(.editor-shortcut,.theme-toggle),
 html body .mobile-menu :is(.editor-shortcut,.theme-toggle,.mobile-header-socials a),
 html body.page-projects #project-browser .browser-topline .browser-view-switch button:not(.collection-search-toggle) {
  isolation:isolate;background:transparent!important;
 }
 html body .site-header #site-navigation :is(.editor-shortcut,.theme-toggle)::before,
 html body .mobile-menu :is(.editor-shortcut,.theme-toggle,.mobile-header-socials a)::before,
 html body.page-projects #project-browser .browser-topline .browser-view-switch button:not(.collection-search-toggle)::before {
  content:'';display:block!important;position:absolute;z-index:-1;inset:auto!important;
  left:50%!important;top:50%!important;translate:-50% -50%;
  width:var(--public-nav-control-size);height:var(--public-nav-control-size);border-radius:50%;
  background:var(--public-nav-disc-fill,#ffffff18);opacity:0;pointer-events:none;
 }
 html body .site-header #site-navigation :is(.editor-shortcut,.theme-toggle):is(:hover,:focus-visible)::before,
 html body .mobile-menu :is(.editor-shortcut,.theme-toggle,.mobile-header-socials a):is(:hover,:active,:focus-visible)::before,
 html body.page-projects #project-browser .browser-topline .browser-view-switch button:not(.collection-search-toggle):is(:hover,:focus-visible)::before { opacity:1; }
 html body .mobile-menu-footer :is(.editor-shortcut,.theme-toggle,.mobile-header-socials a) {
  width:var(--public-nav-hit-size)!important;height:var(--public-nav-hit-size)!important;
  min-width:var(--public-nav-hit-size);min-height:var(--public-nav-hit-size);padding:12px!important;
 }
 html body .mobile-menu :is(.editor-shortcut,.theme-toggle,.mobile-header-socials a) svg {
  width:var(--public-nav-icon-size)!important;height:var(--public-nav-icon-size)!important;scale:1!important;
 }
 html body.page-projects #project-browser .browser-topline .browser-view-switch { gap:0; }
}
@media(prefers-reduced-motion:reduce) {
 html body.page-project-detail .project-micro-actions :is(.project-god-mode,.project-editor)::before { transition:none; }
}
