/* Compact navigation, scoped to the shared header. */
.compact-header {
  --header-accent:#5d35bd;
  padding:0 24px;
  border-bottom:1px solid var(--line);
  background:rgba(255,255,255,.96);
  box-shadow:0 2px 14px rgba(29,25,50,.035);
}
.dark .compact-header {--header-accent:#d5c6ff;background:rgba(32,29,46,.97)}
.compact-header .header-inner {display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:24px;max-width:1200px;width:100%;margin:auto;min-height:64px;position:relative}
.compact-header .brand {min-width:0;max-width:190px;gap:9px;font-size:15px;letter-spacing:-.035em}
.compact-header .brand-mark {flex:none;width:32px;height:32px;border-radius:10px;background:linear-gradient(145deg,#7650d2,#b878c5);box-shadow:none;font-size:15px}
.compact-header .brand-text {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.compact-header .header-nav {display:flex;align-items:center;justify-content:center;gap:3px;min-width:0}
.compact-header .header-link {display:flex;align-items:center;gap:7px;padding:10px 11px;min-height:42px;border-radius:9px;color:var(--muted);font-size:13px;font-weight:600;line-height:1.35;text-decoration:none;white-space:nowrap;cursor:pointer;transition:background .15s,color .15s}
.compact-header .header-link:hover {background:var(--soft);color:var(--ink);text-decoration:none}
.compact-header .header-link.is-active {background:var(--soft);color:var(--header-accent)}
.compact-header .header-icon {width:18px;height:18px;flex:none;display:block}
.compact-header .header-tools {display:flex;gap:5px;align-items:center;justify-content:flex-end}
.compact-header .header-control {display:grid;place-items:center;min-width:40px;width:40px;height:40px;padding:0;border:1px solid transparent;background:transparent;color:var(--muted);border-radius:10px;cursor:pointer;list-style:none}
.compact-header .header-control:hover,.compact-header .header-dropdown[open]>.header-control {background:var(--soft);color:var(--header-accent)}
.compact-header .lang-button {font-size:11px;letter-spacing:.06em;font-weight:800}
.compact-header .header-account>summary {background:var(--soft);color:var(--header-accent)}
.compact-header .header-dropdown {position:relative}
.compact-header summary {list-style:none}
.compact-header summary::-webkit-details-marker {display:none}
.compact-header .header-management>summary>.header-icon:last-child {width:13px;height:13px;transition:transform .15s}
.compact-header .header-management[open]>summary>.header-icon:last-child {transform:rotate(180deg)}
.compact-header .header-popover {position:absolute;right:0;top:calc(100% + 10px);width:252px;max-width:calc(100vw - 24px);padding:7px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 36px rgba(20,15,40,.15);z-index:2}
.compact-header .header-popover .header-link {white-space:normal;min-height:44px}
.compact-header .header-identity {display:grid;gap:2px;padding:10px 11px 13px;margin-bottom:5px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.compact-header .header-identity strong {font-size:14px}
.compact-header .header-identity span {font-size:12px;color:var(--muted)}
.compact-header .header-signout {color:var(--red)}
.dark .compact-header .header-signout {color:#f4a3b6}
.compact-header :is(a,button,summary):focus-visible {outline:2px solid var(--header-accent);outline-offset:3px}
.compact-header .header-menu-toggle,.compact-header .header-menu-close-icon {display:none}
@media(max-width:1100px) {
  .compact-header {padding:0 16px}
  .compact-header .header-inner {grid-template-columns:minmax(0,1fr) auto;gap:0 12px;min-height:60px}
  .compact-header .brand {grid-column:1;grid-row:1;justify-self:start;max-width:100%}
  .compact-header .header-tools {grid-column:2;grid-row:1}
  .compact-header .header-nav {grid-column:1/-1;grid-row:2;display:flex;flex-direction:column;align-items:stretch;gap:3px;padding:10px 0;width:100%}
  .compact-header .header-nav>.header-link,.compact-header .header-management>summary {min-height:44px;padding:11px 13px}
  .compact-header.menu-enhanced .header-nav {display:none;position:absolute;top:calc(100% + 7px);left:0;right:0;padding:8px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 36px rgba(20,15,40,.15);max-height:calc(100vh - 86px);max-height:calc(100dvh - 86px);overflow-y:auto}
  .compact-header.menu-enhanced.menu-open .header-nav {display:flex}
  .compact-header.menu-enhanced .header-menu-toggle {display:grid}
  .compact-header.menu-open .header-menu-open-icon {display:none}
  .compact-header.menu-open .header-menu-close-icon {display:block}
  .compact-header .header-management .header-popover {position:static;max-width:none;width:auto;margin:3px 0 3px 13px;border:0;border-left:1px solid var(--line);border-radius:0;box-shadow:none;padding:0 0 0 5px}
  .compact-header .header-management>summary>.header-icon:last-child {margin-left:auto}
  .compact-header .header-account .header-popover {max-height:calc(100vh - 90px);overflow:auto}
}
@media(max-width:480px) {
  .compact-header {padding:0 12px}
  .compact-header .header-inner {min-height:58px;gap:0 8px}
  .compact-header .brand {font-size:13px;gap:7px}
  .compact-header .brand-mark {width:29px;height:29px;border-radius:9px;font-size:13px}
  .compact-header .header-tools {gap:2px}
  .compact-header .header-control {width:40px;min-width:40px;height:44px}
  .compact-header .header-account>summary {height:36px}
}
@media(max-width:350px) {
  .compact-header .brand {font-size:12px}
  .compact-header .brand-mark {width:26px;height:28px}
  .compact-header .header-tools {gap:0}
}
@media(prefers-reduced-motion:reduce) {
  .compact-header .header-link,.compact-header .header-management>summary>.header-icon:last-child {transition:none}
}
