/* Brand bar */
.appbar { background: var(--color-bar); color: var(--color-text); border-bottom: 1px solid var(--color-border); }
.appbar-in { max-width: 960px; margin: 0 auto; padding: var(--space-8) var(--space-16); display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); min-height: 56px; }
.appbar-start { display: flex; align-items: center; gap: var(--space-12); }
.appbar-brand { display: flex; align-items: center; gap: var(--space-8); }
.appbar-logo { display: block; height: 40px; width: auto; max-width: 100%; object-fit: contain; }
.appbar-end { display: flex; align-items: center; gap: 12px; }
.appbar-sep { width: 1px; height: 24px; background: var(--color-border); }
.profile-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px; padding: 0; background: none; border: 0; color: var(--color-text); border-radius: 999px; }
.profile-btn:hover .avatar { box-shadow: 0 0 0 3px var(--color-border); }
.appbar-name { display: none; font-size: 14px; font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar :focus-visible { outline-color: var(--color-focus); box-shadow: none; }
.gear-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-inline-start: -10px; border-radius: 8px; background: transparent; border: 0; color: var(--color-text); }
.gear-btn:hover, .gear-btn[aria-expanded="true"] { background: var(--color-surface-2); }
.gear-btn .icon { width: 28px; height: 28px; }
/* the top bar stays put while the page scrolls, on every screen size */
.appbar { position: sticky; top: 0; z-index: 10; }
@media (min-width: 640px) { .appbar-in { padding-inline: var(--space-24); } .appbar-name { display: inline; } }
/* Avatar */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--color-surface-2); color: var(--accent-mint); overflow: hidden; flex: none; font-weight: 500; font-size: 16px; }
.profile-btn .avatar { box-shadow: 0 0 0 1px var(--color-input-border); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Settings menu */
.menu-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 15; min-width: 190px; padding: 6px; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: 10px; box-shadow: var(--shadow-card); }
.menu-item { white-space: nowrap; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-size: 14px; text-align: start; }
.menu-item:hover, .menu-item:focus-visible { background: var(--color-surface-2); }
.menu-item.danger { color: var(--color-error); }
/* Notifications bell */
/* No circle: the icon sits directly on the bar, so the gap to the divider equals the gap from the divider to the user name. The padding only widens the touch target, offset by negative margins. */
.bell-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 44px; margin-inline: -4px; border-radius: 8px; background: transparent; border: 0; color: var(--color-text); }
.bell-btn:hover, .bell-btn[aria-expanded="true"] { background: var(--color-surface-2); }
.bell-btn .icon { width: 24px; height: 24px; }
.bell-badge { position: absolute; top: 4px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent-gold); color: var(--color-on-primary); font-size: 11px; font-weight: 500; line-height: 18px; text-align: center; }

/* Wide screens: same width as the three-column goals page */
@media (min-width: 1024px) { .appbar-in { max-width: 1160px; } }

.menu-item.current { background: #2E4457; box-shadow: 0 4px 10px rgba(7, 17, 29, 0.4); font-weight: 600; }
.menu-item.current .icon { color: var(--aurora-1); }
.menu-item.current::after { content: ""; width: 16px; height: 16px; flex: none; background: var(--accent-mint-strong); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat; }
