/* Shared navigation: compact rows, visible account actions, independent scrolling. */
#sidebar.sidebar {
  --menu-ink: #25273e;
  --menu-muted: #70778b;
  --menu-surface: #fff;
  --menu-soft: #f5f4f9;
  width: min(370px, calc(100vw - 16px));
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  overflow: hidden !important;
  background: var(--menu-surface) !important;
  box-shadow: 0 0 80px #15102c33 !important;
}
#sidebar[aria-hidden="true"] { visibility: hidden; }
#sidebar.open { visibility: visible; }
#sidebar .sidebar-header {
  flex: 0 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 18px 18px !important;
  margin: 0;
  gap: 15px;
  border-radius: 0 0 24px 24px;
  background: radial-gradient(ellipse at 0 0, #8b68c555, transparent 70%), linear-gradient(125deg, #30224d, #554078) !important;
}
#sidebar .sidebar-header::before { opacity: .12; }
#sidebar .sidebar-header-actions { flex-direction: row; }
#sidebar .sidebar-close { width: 36px; height: 36px; min-width: 36px; }
#sidebar .sidebar-theme-toggle { min-height: 36px; padding: 0 12px; font-size: 12px; box-shadow: none; }
#sidebar .sidebar-user { gap: 12px; margin: 0; padding: 0; color: #fff; text-decoration: none; }
#sidebar .sidebar-user-info { min-width: 0; flex: 1; text-align: start; }
#sidebar .sidebar-name { font-size: 16px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
#sidebar .sidebar-role { color: #e0d7f0; font-size: 12px; line-height: 1.6; }
#sidebar .sidebar-avatar { width: 48px; height: 48px; flex: 0 0 48px; border: 2px solid #ffffff70; border-radius: 16px !important; background: #ffffff15; color: #fff; box-shadow: none; }
#sidebar .sidebar-avatar img { border-radius: 13px; object-fit: cover; }
#sidebar .sidebar-user-arrow { color: #e0d7f0; font-size: 24px; transform: scaleX(-1); }
[dir="ltr"] #sidebar .sidebar-user-arrow { transform: none; }
#sidebar .sidebar-nav { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c9c4d7 transparent; padding: 12px 14px; gap: 2px; }
#sidebar .sidebar-section-label { color: var(--menu-muted); margin: 12px 10px 6px; font-size: 11px; line-height: 1.5; letter-spacing: 0; }
#sidebar .sidebar-section-label:first-child { margin-top: 0; }
#sidebar .sidebar-link { flex: 0 0 auto; min-height: 46px; width: 100%; margin: 0; padding: 6px 10px !important; gap: 10px; font-size: 14px !important; font-weight: 650 !important; color: var(--menu-ink) !important; box-shadow: none; }
#sidebar .sidebar-label { white-space: normal; line-height: 1.6; overflow: visible; text-overflow: clip; }
#sidebar .sidebar-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; background: var(--menu-soft); color: #78708c; }
#sidebar .sidebar-icon svg { width: 18px; height: 18px; }
#sidebar .sidebar-link:hover { transform: none; background: var(--menu-soft) !important; }
#sidebar .sidebar-link.active { background: #f1ecfa !important; border-color: #e3d9f4 !important; color: #644398 !important; box-shadow: none; }
#sidebar .sidebar-link.active .sidebar-icon { background: #70509d; box-shadow: none; }
#sidebar .sidebar-account-switch { margin: 2px 0 4px; border-color: #e4e1ec !important; background: var(--menu-soft) !important; }
#sidebar .sidebar-account-switch .sidebar-icon { color: #346f72; background: #e6f1ef; }
#sidebar .sidebar-language-value { margin-inline-start: auto; padding: 2px 7px; border: 1px solid #d9d4e4; border-radius: 6px; color: var(--menu-muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; }
#sidebar .sidebar-separator { display: none; }
#sidebar .sidebar-footer { flex: 0 0 auto; padding: 8px 14px max(10px, env(safe-area-inset-bottom)); gap: 2px; background: var(--menu-surface); border-top: 1px solid #e9e6ef; }
#sidebar .sidebar-footer .sidebar-link { min-height: 42px; }
#sidebar .sidebar-footer .sidebar-delete-account { color: #a53c51 !important; font-size: 12px !important; }
#sidebar .sidebar-footer .sidebar-link.sidebar-delete-account .sidebar-icon { background: #fff0f2; color: #ad4157; }
#sidebar :is(a, button):focus-visible { outline: 3px solid #aa84db; outline-offset: 2px; }
#sidebar .sidebar-user:focus-visible { outline-color: #fff; border-radius: 16px; }
#sidebar-overlay { background: #15122665; backdrop-filter: blur(5px); }
html[data-theme="dark"] #sidebar.sidebar { --menu-ink: #e7e6f0; --menu-muted: #afadc0; --menu-surface: #1b1926; --menu-soft: #282433; background: var(--menu-surface) !important; }
html[data-theme="dark"] #sidebar .sidebar-header { background: linear-gradient(125deg, #312440, #47345f) !important; }
html[data-theme="dark"] #sidebar .sidebar-footer { background: var(--menu-surface); border-color: #363141; }
html[data-theme="dark"] #sidebar .sidebar-link.active { background: #37294d !important; color: #e1c6ff !important; border-color: #55416c !important; }
html[data-theme="dark"] #sidebar .sidebar-icon { background: var(--menu-soft); color: #bdb3cd; }
html[data-theme="dark"] #sidebar .sidebar-account-switch { border-color: #41384d !important; }
html[data-theme="dark"] #sidebar .sidebar-footer .sidebar-delete-account { color: #f6a4b5 !important; }
html[data-theme="dark"] #sidebar .sidebar-footer .sidebar-link.sidebar-delete-account .sidebar-icon { background: #412735; color: #f6a4b5; }
.nw-delete-prompt .nw-delete-card { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.nw-delete-prompt :focus-visible { outline: 3px solid #a785d1; outline-offset: 3px; }
#footer-contact-modal .footer-contact-card { border-radius: 24px; max-height: calc(100dvh - 40px); overscroll-behavior: contain; }
#footer-contact-modal .footer-contact-close { border-radius: 12px; }
#footer-contact-modal :is(input,textarea) { border-radius: 12px; font-size: 14px; }
#footer-contact-modal :is(button,a,input,textarea):focus-visible { outline: 3px solid #ac8bd1; outline-offset: 3px; }
.nw-lang-switch .nw-lang-card { max-height: calc(100dvh - 24px); overflow-y: auto; }
@media (max-width: 540px) {
  #footer-contact-modal { padding: 12px; }
  #footer-contact-modal .footer-contact-card { width: 100%; max-height: calc(100dvh - 24px); border-radius: 20px; }
  #footer-contact-modal .footer-contact-hero { padding: 24px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { #sidebar, #sidebar * { transition: none !important; } }
@media (max-width: 360px) {
  #top-navbar .navbar-inner-global { gap: 8px; }
  #top-navbar #topbar-brand-wrap { position: relative !important; inset: auto !important; transform: none !important; flex: 0 0 48px; margin: 0 !important; }
}
