/* Navigation refinements; existing controls and routes remain the source of truth. */
body .app-header.app-sidebar.nav-enhanced{grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:'brand navigation controls';height:64px;min-height:64px;gap:clamp(12px,1.6vw,28px);padding:0 clamp(16px,2vw,32px);box-shadow:none}
body .nav-enhanced .sidebar-brand{gap:10px}body .nav-enhanced .brand-mark{width:34px;height:34px}body .nav-enhanced .brand-name{font-size:18px;font-weight:700}
body .nav-enhanced .sidebar-nav{height:100%;gap:clamp(1px,.5vw,8px);overflow:visible;justify-content:flex-start}
body .nav-enhanced .sidebar-nav-group:not([hidden]){height:100%;align-items:center;gap:2px}
body .nav-enhanced .sidebar-nav-item,body .nav-enhanced .sidebar-nav-item:hover,body .nav-enhanced .sidebar-nav-item.is-active,body .nav-enhanced .sidebar-nav-item.is-scholar-task-active{position:relative;height:100%;min-height:0;padding:0 clamp(5px,.55vw,10px);font-size:14px;font-weight:500;color:#39465c;background:transparent;border:0;border-radius:0;box-shadow:none;transform:none}
body .nav-enhanced .sidebar-nav-item .sidebar-nav-title{overflow:visible}
body .nav-enhanced .sidebar-nav-item:hover{color:#5156ba}
body .nav-enhanced .sidebar-nav-item:is(.is-active,.is-scholar-task-active),body.site-intro-active:not(.site-intro-about):not(.site-intro-phd):not(.site-intro-conference) .nav-enhanced #site-home-link,body.site-intro-active.site-intro-about .nav-enhanced #site-about-link{color:#5155bd;background:transparent;font-weight:650}
body .nav-enhanced .sidebar-nav-item:is(.is-active,.is-scholar-task-active)::after,body.site-intro-active:not(.site-intro-about):not(.site-intro-phd):not(.site-intro-conference) .nav-enhanced #site-home-link::after,body.site-intro-active.site-intro-about .nav-enhanced #site-about-link::after{content:'';position:absolute;bottom:0;left:10px;right:10px;height:2px;background:#5c5dd3;border-radius:2px}
body .nav-enhanced .sidebar-nav-item .sidebar-nav-title,body .nav-enhanced .sidebar-nav-item:hover .sidebar-nav-title{text-decoration:none}
body.site-intro-active .nav-enhanced #sidebar-search-home:not(#site-home-link),body.i4-conference-open .nav-enhanced .sidebar-nav-item.is-active:not(#sidebar-conference-center){color:#39465c;font-weight:500}
body.site-intro-active .nav-enhanced #sidebar-search-home::after,body.i4-conference-open .nav-enhanced .sidebar-nav-item.is-active:not(#sidebar-conference-center)::after{display:none}
body .nav-enhanced .sidebar-footer{display:flex;align-items:center;gap:12px}
body .nav-enhanced .sidebar-footer-controls.sidebar-footer-utility-row{display:flex;align-items:center;gap:2px}
body .nav-enhanced .header-language-control,body .nav-enhanced #ep-auth-entry{display:none!important}
.header-language-control,.nav-language{display:none!important}
.nav-icon-button{display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;padding:0;border:0;border-radius:8px;background:transparent;color:#526078;cursor:pointer;list-style:none}
.nav-icon-button::-webkit-details-marker{display:none}.nav-icon-button:hover{background:#f0f2f8}.nav-icon{display:block;width:20px;height:20px;background:currentColor;mask-position:center;mask-size:contain;mask-repeat:no-repeat}
.nav-icon-world{mask-image:url('/icons/tabler-world.svg')}.nav-icon-menu{mask-image:url('/icons/tabler-menu-2.svg')}.nav-icon-user{mask-image:url('/icons/tabler-user-circle.svg')}
.nav-language,.nav-user{position:relative}.nav-popover{position:absolute;top:calc(100% + 6px);right:0;z-index:220;min-width:160px;padding:6px;border:1px solid #dfe5ef;border-radius:10px;background:#fff;box-shadow:0 12px 28px #172b4d24}
.nav-popover button{display:flex;justify-content:space-between;gap:16px;width:100%;padding:10px 12px;border:0;border-radius:6px;background:transparent;color:#344257;font:inherit;font-size:13px;text-align:left;white-space:nowrap;cursor:pointer}.nav-popover button:hover,.nav-popover button:focus-visible{background:#f0f2fa}
.nav-user .nav-popover{min-width:132px;width:max-content;max-width:200px;padding:4px}
.nav-user .nav-popover button{justify-content:center;min-height:36px;gap:0;padding:8px 14px;text-align:center}
.nav-user .nav-popover a[data-account="admin"]{display:flex;align-items:center;justify-content:center;min-height:36px;padding:8px 14px;border-radius:6px;color:#344257;font-size:13px;white-space:nowrap;text-decoration:none}
.nav-user .nav-popover a[data-account="admin"][hidden]{display:none}
.nav-user .nav-popover a[data-account="admin"]:hover,.nav-user .nav-popover a[data-account="admin"]:focus-visible{background:#f0f2fa}
body .nav-enhanced .header-theme-control{position:relative;display:grid;place-items:center;width:40px;height:40px;min-width:40px;padding:0;margin:0;border:0;background:transparent;border-radius:8px;box-shadow:none;color:#526078}
body .nav-enhanced .header-theme-control:hover{background:#f0f2f8}
body .nav-enhanced .header-theme-control::before{content:'';width:20px;height:20px;background:currentColor;mask:url('/icons/tabler-sun.svg') center/contain no-repeat}
body.theme-dark .nav-enhanced .header-theme-control::before{mask-image:url('/icons/tabler-moon.svg')}
body .nav-enhanced .header-theme-swatch,body .nav-enhanced .header-theme-label{display:none}
body .nav-enhanced .header-theme-select{position:absolute;inset:0;width:100%;height:100%;min-width:0;opacity:0;cursor:pointer}
body .nav-enhanced #header-settings-button{border:0;background:transparent;box-shadow:none;width:40px;height:40px;padding:9px}body .nav-enhanced #header-settings-button:hover{background:#f0f2f8}
.nav-account{display:flex;align-items:center;gap:5px;padding-left:12px;border-left:1px solid #e4e8ef}.nav-account button.nav-login,.nav-account button.nav-register{height:38px;padding:0 12px;border:0;border-radius:7px;font:inherit;font-size:13px;font-weight:650;white-space:nowrap;cursor:pointer}.nav-login{background:transparent;color:#344257}.nav-login:hover{background:#f0f2f8}.nav-register{background:#5659d4;color:#fff}.nav-register:hover{background:#484bc1}.nav-account [hidden]{display:none!important}
.nav-mobile-toggle{display:none}.nav-enhanced :is(a,button,summary,select):focus-visible{outline:2px solid #6569da;outline-offset:2px}
body.theme-dark .nav-enhanced .sidebar-nav-item,body.theme-dark .nav-enhanced .sidebar-nav-item:hover{color:#d8dfec}
body.theme-dark .nav-enhanced .sidebar-nav-item:is(.is-active,.is-scholar-task-active),body.theme-dark.site-intro-active:not(.site-intro-about):not(.site-intro-phd):not(.site-intro-conference) .nav-enhanced #site-home-link,body.theme-dark.site-intro-active.site-intro-about .nav-enhanced #site-about-link{color:#b9bdff}
body.theme-dark .nav-enhanced .nav-icon-button,body.theme-dark .nav-enhanced .header-theme-control{color:#d8dfec}body.theme-dark .nav-enhanced :is(.nav-icon-button,.header-theme-control,#header-settings-button):hover{background:#30394a}
body.theme-dark .nav-enhanced .nav-popover{background:#222c3a;border-color:#465365}body.theme-dark .nav-enhanced .nav-popover button,body.theme-dark .nav-enhanced .nav-login{color:#e2e8f0}body.theme-dark .nav-enhanced .nav-popover button:hover,body.theme-dark .nav-enhanced .nav-login:hover{background:#344050}body.theme-dark .nav-account{border-color:#465365}
body.theme-dark .nav-enhanced .nav-popover a[data-account="admin"]{color:#e2e8f0}body.theme-dark .nav-enhanced .nav-popover a[data-account="admin"]:hover{background:#344050}
@media(max-width:1250px){body .app-header.app-sidebar.nav-enhanced{grid-template-columns:auto 1fr auto auto;grid-template-areas:'brand . controls navigation-toggle';gap:10px;padding:0 16px}body .nav-enhanced .nav-mobile-toggle{display:grid;grid-area:navigation-toggle}body .nav-enhanced .sidebar-nav{display:none;position:absolute;top:100%;right:12px;width:min(340px,calc(100vw - 24px));height:auto;max-height:calc(100vh - 76px);overflow:auto;padding:8px;border:1px solid #dfe5ef;border-radius:12px;background:#fff;box-shadow:0 12px 32px #172b4d24}body .nav-enhanced.nav-expanded .sidebar-nav{display:block}body .nav-enhanced .sidebar-nav-group:not([hidden]){display:block;height:auto}body .nav-enhanced .sidebar-nav-item,body .nav-enhanced .sidebar-nav-item:hover,body .nav-enhanced .sidebar-nav-item.is-active{width:100%;height:44px;padding:0 14px;border-radius:7px}body .nav-enhanced .sidebar-nav-item:is(.is-active,.is-scholar-task-active)::after,body.site-intro-active .nav-enhanced .sidebar-nav-item::after{display:none}body .nav-enhanced .sidebar-nav-item.is-active{background:#f1f2fc}body.theme-dark .nav-enhanced .sidebar-nav{background:#222c3a;border-color:#465365}body.theme-dark .nav-enhanced .sidebar-nav-item.is-active{background:#343a59}}
@media(max-width:480px){body .app-header.app-sidebar.nav-enhanced{padding:0 10px;gap:4px}body .nav-enhanced .brand-name{font-size:16px}body .nav-enhanced .sidebar-brand{gap:6px}.nav-icon-button,body .nav-enhanced .header-theme-control,body .nav-enhanced #header-settings-button{width:36px;height:40px;min-width:36px;flex-basis:36px}body .nav-enhanced .sidebar-footer{gap:4px}.nav-account{padding-left:5px;gap:0}.nav-account button.nav-login,.nav-account button.nav-register{padding:0 7px;font-size:12px}}

/* English labels need more horizontal room. */
@media(max-width:1850px){html[lang^="en"] body .app-header.app-sidebar.nav-enhanced{grid-template-columns:auto 1fr auto auto;grid-template-areas:'brand . controls navigation-toggle';gap:10px;padding:0 16px}html[lang^="en"] body .nav-enhanced .nav-mobile-toggle{display:grid;grid-area:navigation-toggle}html[lang^="en"] body .nav-enhanced .sidebar-nav{display:none;position:absolute;top:100%;right:12px;width:min(340px,calc(100vw - 24px));height:auto;max-height:calc(100vh - 76px);overflow:auto;padding:8px;border:1px solid #dfe5ef;border-radius:12px;background:#fff;box-shadow:0 12px 32px #172b4d24}html[lang^="en"] body .nav-enhanced.nav-expanded .sidebar-nav{display:block}html[lang^="en"] body .nav-enhanced .sidebar-nav-group:not([hidden]){display:block;height:auto}html[lang^="en"] body .nav-enhanced .sidebar-nav-item,html[lang^="en"] body .nav-enhanced .sidebar-nav-item:hover,html[lang^="en"] body .nav-enhanced .sidebar-nav-item.is-active{width:100%;height:44px;padding:0 14px;border-radius:7px}html[lang^="en"] body .nav-enhanced .sidebar-nav-item:is(.is-active,.is-scholar-task-active)::after,html[lang^="en"] body.site-intro-active .nav-enhanced .sidebar-nav-item::after{display:none}html[lang^="en"] body .nav-enhanced .sidebar-nav-item.is-active{background:#f1f2fc}html[lang^="en"] body.theme-dark .nav-enhanced .sidebar-nav{background:#222c3a;border-color:#465365}html[lang^="en"] body.theme-dark .nav-enhanced .sidebar-nav-item.is-active{background:#343a59}}

body.theme-dark .nav-enhanced .brand-name { color: #eef2fb; }
body.theme-dark .nav-enhanced #header-settings-button { color: #d8dfec; }
body .nav-enhanced #header-settings-button,body .nav-enhanced .header-theme-control{display:none!important}
body .nav-enhanced .nav-theme-toggle{order:2}
body .nav-enhanced .nav-theme-toggle .nav-icon{mask-image:url('/icons/tabler-moon.svg')}
body .nav-enhanced .nav-theme-toggle.is-dark .nav-icon{mask-image:url('/icons/tabler-sun.svg')}
body .nav-enhanced .nav-language { order: 1; }
body .nav-enhanced .header-theme-control { order: 2; }
body .nav-enhanced #header-settings-button { order: 3; }

/* Align the search card with the results and center the brand/navigation group. */
body .search-surface { padding-left: 0; padding-right: 0; border-left: 0; border-right: 0; }
body .app-header.app-sidebar.nav-enhanced { grid-template-columns: minmax(0,1fr) auto auto minmax(0,1fr); grid-template-areas: "spacer brand navigation controls"; column-gap: clamp(12px,1.6vw,28px); background: #f5f6fc; }
body .nav-enhanced .nav-balance-spacer { grid-area: spacer; min-width: 0; }
body .nav-enhanced .sidebar-nav { width: max-content; max-width: 100%; }
body .nav-enhanced .sidebar-footer { justify-self: end; min-width: 0; }
body.theme-dark .app-header.app-sidebar.nav-enhanced { background: #172231; }
@media(max-width:1250px) { body .app-header.app-sidebar.nav-enhanced { grid-template-columns: auto 1fr auto auto; grid-template-areas: "brand spacer controls navigation-toggle"; gap:10px; padding:0 16px; } body .nav-enhanced .sidebar-nav { width:min(340px,calc(100vw - 24px)); } }
@media(max-width:1850px) { html[lang^="en"] body .app-header.app-sidebar.nav-enhanced { grid-template-columns: auto 1fr auto auto; grid-template-areas: "brand spacer controls navigation-toggle"; gap:10px; padding:0 16px; } html[lang^="en"] body .nav-enhanced .sidebar-nav { width:min(340px,calc(100vw - 24px)); } }
@media(max-width:480px) { body .app-header.app-sidebar.nav-enhanced, html[lang^="en"] body .app-header.app-sidebar.nav-enhanced { padding:0 10px; gap:4px; } }

/* EatPaper brand mark supplied for the site and browser tab. */
body .brand-mark { background: url('/assets/eatpaper-logo.svg?v=1') center / contain no-repeat; font-size: 0; box-shadow: none; }

/* Keep the current-page marker on the PhD menu rather than Home. */
body.site-intro-phd .nav-enhanced #site-home-link { color:#39465c !important; font-weight:500 !important; background:transparent !important; }
body.site-intro-phd .nav-enhanced #site-home-link::after { display:none !important; }
body.theme-dark.site-intro-phd .nav-enhanced #site-home-link { color:#d8dfec !important; }

/* Give the longer English labels the available width on large screens. */
@media (min-width: 1851px) {
  html[lang^="en"] body .app-header.app-sidebar.nav-enhanced {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand navigation controls";
  }
  html[lang^="en"] body .nav-enhanced .nav-balance-spacer { display: none; }
  html[lang^="en"] body .nav-enhanced .sidebar-nav { justify-self: center; }
}
/* The replaced controls must never flash before navigation enhancement runs. */
#header-settings-button,.header-theme-control{display:none!important}
