/* Keep fixed navigation outside page stacking contexts. */
.app { z-index:auto; }
.main { position:relative; z-index:1; }
.topbar-identity { min-width:0; flex:1; }
.topbar-page { margin:0; color:var(--text); font:750 1rem/1.15 var(--font); }
.drawer-close { display:none; }
.dashboard-tabs[hidden],.dashboard-panel[hidden] { display:none !important; }
.dashboard-panel { min-width:0; }
.dashboard-tabs { display:none; }
@media(max-width:768px) {
  :root { --mobile-head:68px; --mobile-foot:62px; }
  .signed-in .main { min-height:100dvh; overflow-x:clip; overflow-y:visible; padding:calc(var(--mobile-head) + env(safe-area-inset-top) + .65rem) .8rem calc(var(--mobile-foot) + env(safe-area-inset-bottom) + 1rem); }
  .topbar { z-index:900; height:calc(var(--mobile-head) + env(safe-area-inset-top)); padding:env(safe-area-inset-top) max(.7rem, env(safe-area-inset-right)) 0 max(.7rem, env(safe-area-inset-left)); align-items:center; gap:.65rem; box-shadow:0 2px 14px #00000012; }
  .topbar-identity { display:flex; flex-direction:column; gap:.25rem; align-items:flex-start; }
  .topbar-page { font-size:1.04rem; overflow-wrap:anywhere; }
  .topbar-logo { gap:.35rem; min-width:0; }
  .topbar-logo img { width:18px; height:18px; }
  .topbar-logo span { color:var(--gold); -webkit-text-fill-color:currentColor; font-size:.68rem; font-weight:750; letter-spacing:.09em; }
  .topbar .hamburger,.topbar-new { flex:none; width:44px; height:44px; min-height:44px; }
  .main .page-intro { display:none; }
  .page-header-title-only { display:none; }
  .main .page-header { border:0; margin:0 0 .65rem; padding:0; }
  .bottom-nav { z-index:950; height:calc(var(--mobile-foot) + env(safe-area-inset-bottom)); padding:.25rem max(.3rem, env(safe-area-inset-right)) calc(.25rem + env(safe-area-inset-bottom)) max(.3rem, env(safe-area-inset-left)); isolation:isolate; }
  .bottom-nav a { min-width:0; min-height:48px; font-size:clamp(.63rem,2.4vw,.75rem); }
  .sidebar { z-index:1100; top:0; bottom:auto; height:100dvh; max-height:100dvh; width:min(300px, calc(100vw - 44px)); overflow-y:auto; overscroll-behavior:contain; padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom); }
  .sidebar .sb-header { position:relative; padding-top:3.5rem; flex-shrink:0; }
  .sidebar .sb-nav { flex:1 0 auto; overflow:visible; }
  .sidebar .sb-footer { flex-shrink:0; }
  .drawer-close { display:grid; place-items:center; position:absolute; top:.4rem; right:.6rem; width:44px; height:44px; border:1px solid var(--border2); background:var(--s2); color:var(--text); border-radius:var(--rs); font:inherit; cursor:pointer; }
  .sidebar-overlay { z-index:1050; }
  .modal-bd { z-index:1300; }
  .dashboard-mobile .dashboard-tabs { position:sticky; top:calc(var(--mobile-head) + env(safe-area-inset-top)); z-index:5; box-shadow:0 4px 12px #00000014; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.4rem; margin:0 0 .85rem; padding:.4rem; border:1px solid var(--border); border-radius:var(--rs); background:var(--s1); }
  .dashboard-tabs button { display:flex; align-items:center; justify-content:center; min-height:42px; min-width:0; padding:.4rem .2rem; border:1px solid var(--border); border-radius:var(--rs); background:var(--s2); color:var(--text2); font:650 .78rem/1.2 var(--font); cursor:pointer; }
  .dashboard-tabs button[aria-selected="true"] { border-color:var(--gold); background:var(--gold-dim); color:var(--gold); box-shadow:inset 0 -3px var(--gold); }
  .dashboard-tabs button:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
  .dashboard-mobile .dashboard-focus { display:contents; }
  .dashboard-mobile .dashboard-section > .section-summary { display:none; }
  .dashboard-mobile .dashboard-section { margin:0; }
  .dashboard-mobile .section-body { margin-top:0; }
  .dashboard-mobile .stats-body { padding-top:0; }
  .dashboard-mobile .dashboard-panel:focus-visible { outline:2px solid var(--gold); outline-offset:3px; }
  [data-theme="dark"] .topbar { border-bottom:2px solid var(--gold); background:linear-gradient(110deg,var(--s1),#1c2131); }
  [data-theme="pixel"] .topbar { border-bottom:3px solid var(--gold); background:linear-gradient(110deg,var(--s1),var(--s2)); }
  [data-theme="seahawks"] .topbar { border-bottom:4px solid #69be28; background:#002244; }
  [data-theme="seahawks"] .topbar-page { color:#fff; }
  [data-theme="seahawks"] .topbar-logo span { color:#a0e363; }
  [data-theme="seahawks"] .topbar .hamburger { border-color:#89bcdd; background:#143653; }
  [data-theme="seahawks"] .topbar .hamburger span { background:#fff; }
  [data-theme="seahawks"] .topbar-new { background:#69be28; color:#07141f; }
  [data-theme="cyberpunk"] .topbar { background:#fcee0a; border-bottom:4px solid #37ecd9; }
  [data-theme="cyberpunk"] .topbar-page { color:#0d0d0f; text-transform:uppercase; font-style:italic; font-weight:900; }
  [data-theme="cyberpunk"] .topbar-logo span { color:#0d0d0f; }
  [data-theme="cyberpunk"] .topbar .hamburger,[data-theme="cyberpunk"] .topbar-new { border-color:#0d0d0f; border-radius:0; background:#0d0d0f; color:#fcee0a; }
  [data-theme="lcars"] .topbar { background:#000; border-left:10px solid #d88cad; border-bottom:6px solid #b7a1e4; border-bottom-left-radius:28px; }
  [data-theme="lcars"] .topbar-page { color:#ffb06a; text-transform:uppercase; letter-spacing:.07em; }
  [data-theme="lcars"] .topbar-logo span { color:#b7a1e4; }
  [data-theme="lcars"] .topbar .hamburger,[data-theme="lcars"] .topbar-new { background:#ffb06a; color:#090709; border-radius:24px; }
  [data-theme="lcars"] .topbar .hamburger span { background:#090709; }
  [data-theme="imperial"] .topbar { background:linear-gradient(110deg,#111c26,#060a0e); border-top:2px solid #d3dce3; border-bottom:3px solid #f04752; }
  [data-theme="imperial"] .topbar-page { text-transform:uppercase; letter-spacing:.12em; color:#e9eef3; }
  [data-theme="pipboy"] .topbar { background:repeating-linear-gradient(0deg,#6bff8907 0 1px,transparent 1px 4px),#071b11; border:3px solid #64634e; border-top:0; border-radius:0 0 15px 15px; }
  [data-theme="pipboy"] .topbar-page { color:#6bff89; text-transform:uppercase; text-shadow:0 0 9px #6bff8940; }
  [data-theme="pipboy"] .dashboard-tabs { border-color:#64634e; }
}

@media(prefers-reduced-motion:reduce) { .sidebar,.dashboard-tabs button { transition:none; } }

/* Shared section selection on desktop and mobile. */
.dashboard-exclusive .dashboard-tabs { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:.5rem; margin-bottom:1rem; padding:.5rem; background:var(--s1); border:1px solid var(--border); border-radius:var(--rs); }
.dashboard-exclusive .dashboard-tabs button { min-height:44px; padding:.5rem; border:1px solid var(--border2); border-radius:var(--rs); color:var(--text2); background:var(--s2); font:650 .85rem/1.25 var(--font); cursor:pointer; }
.dashboard-exclusive .dashboard-tabs button[aria-selected="true"] { color:var(--gold); border-color:var(--gold); background:var(--gold-dim); box-shadow:inset 0 -3px var(--gold); }
.dashboard-exclusive .dashboard-focus { display:contents; }
.dashboard-exclusive .dashboard-section > .section-summary { display:none; }
.dashboard-exclusive .dashboard-section { margin:0; }
.dashboard-exclusive .section-body { margin-top:0; }
.deadline-badge { display:inline-block; margin-left:.25rem; color:var(--orange); font-weight:800; white-space:nowrap; }
.deadline-group-title { font-size:1rem; margin:1rem 0 .3rem; }
.deadline-overdue { border-left:3px solid var(--red); padding-left:.7rem; }
.deadline-state { max-width:15rem; text-align:right; }
@media(max-width:768px) { .dashboard-exclusive .dashboard-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); gap:.4rem; padding:.4rem; } .dashboard-exclusive .dashboard-tabs button { font-size:.78rem; padding:.4rem .2rem; } }

.entry-type-filters { display:flex; flex-wrap:wrap; gap:.45rem; margin-bottom:.4rem; }
.entry-type-filters form { margin:0; flex:1; min-width:0; }
.entry-type-button { width:100%; min-height:44px; padding:.5rem .7rem; border:1px solid var(--border2); border-radius:var(--rs); background:var(--s1); color:var(--text2); font:650 .85rem/1.25 var(--font); cursor:pointer; }
.entry-type-button[aria-pressed="true"] { background:var(--gold-dim); border-color:var(--gold); color:var(--gold); box-shadow:inset 0 -3px var(--gold); }
.entry-filter-note { font-size:.75rem; color:var(--text2); margin-bottom:.8rem; }
.entry-search { margin-bottom:1rem; border:1px solid var(--border); border-radius:var(--rs); background:var(--s1); }
.entry-search > summary { cursor:pointer; padding:.7rem .85rem; min-height:44px; color:var(--text2); font-weight:650; font-size:.87rem; }
.entry-search .entry-filters { margin-bottom:0; border:0; }
.mobile-new { display:none; }
.desktop-new { display:flex; justify-content:center; align-items:center; gap:.45rem; }
@media(max-width:768px) {
  .desktop-new,.desktop-create-label { display:none; }
  .bottom-nav { grid-template-columns:1fr 1fr 60px 1fr 1fr; }
  .bottom-nav .mobile-new { display:grid; place-items:center; position:relative; top:-16px; align-self:center; justify-self:center; width:56px; height:56px; border:4px solid var(--s1); border-radius:50%; background:var(--gold); color:var(--on-accent); box-shadow:0 4px 14px #00000030; cursor:pointer; }
  .bottom-nav .mobile-new .pf-icon { width:26px; height:26px; }
  .signed-in .main { padding-bottom:calc(var(--mobile-foot) + env(safe-area-inset-bottom) + 1.8rem); }
  .entry-type-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.4rem; }
}

.sb-brand-copy { min-width:0; }
.sb-brand-copy .sb-version { margin:0; padding:0; text-align:left; font-family:var(--font); font-size:.7rem; letter-spacing:.02em; line-height:1.5; }
.sb-user-actions { display:grid; grid-template-columns:1fr 1fr; gap:.4rem; margin-top:.8rem; }
.sb-user-actions form { margin:0; min-width:0; }
.sb-user-actions .sb-user-action { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.25rem; width:100%; min-width:0; min-height:54px; padding:.35rem .15rem; margin:0; border:1px solid var(--border2); border-radius:var(--rs); background:var(--s2); color:var(--text2); font:600 .7rem/1.3 var(--font); text-decoration:none; cursor:pointer; letter-spacing:normal; }
.sb-user-actions .sb-user-action .pf-icon { width:18px; height:18px; }
.sb-user-actions .sb-user-action.active { border-color:var(--gold); color:var(--gold); background:var(--gold-dim); }
.sb-notification-form { margin:0; }
.sb-notification-form .nav-item { width:calc(100% - 1rem); border:0; background:transparent; color:var(--text2); text-align:left; font-family:var(--font); font-size:.8rem; padding-inline:.65rem; }
.sb-notification-form .nav-item:hover { background:var(--gold-dim); color:var(--gold); }
.settings-jump { display:flex; flex-wrap:wrap; gap:.4rem; margin:0 0 1.2rem; }
.settings-jump a { min-height:44px; display:flex; align-items:center; padding:.45rem .75rem; color:var(--text2); background:var(--s1); border:1px solid var(--border2); border-radius:var(--rs); font-size:.8rem; }
.settings-section { margin-top:1.5rem; }
.settings-section h2 { font-size:1rem; margin-bottom:.4rem; }
.settings-section .theme-options { margin-top:1rem; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.settings-anchor,#settings-design,#settings-notifications,#settings-danger,#transfer-title { scroll-margin-top:1.5rem; }
.pin-change-actions { display:flex; justify-content:flex-end; gap:.5rem; margin-top:1rem; }
#form-change-pin { display:grid; gap:.8rem; }
#form-change-pin [hidden] { display:none !important; }
@media(max-width:768px) {
  .settings-anchor,#settings-design,#settings-notifications,#settings-danger,#transfer-title { scroll-margin-top:calc(var(--mobile-head) + env(safe-area-inset-top) + 1rem); }
  .settings-section .theme-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .settings-jump { gap:.35rem; margin-bottom:.8rem; }
  .settings-jump a { font-size:.76rem; padding:.35rem .6rem; }
}

.notification-intro { margin-bottom:1rem; }
.notification-device-panel { margin-top:1rem; border:1px solid var(--border); border-radius:var(--rs); padding:1rem; background:var(--s2); }
.notification-device-panel h3 { font-size:.9rem; margin-bottom:.3rem; }
.notification-device-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem; margin-top:.7rem; }
.notification-device-actions .btn { justify-content:center; text-align:center; }
@media(max-width:480px) { .notification-device-actions { grid-template-columns:1fr; } }

.settings-panel[hidden] { display:none !important; }
.settings-tabs { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:.45rem; padding:.5rem; margin-bottom:1rem; border:1px solid var(--border); border-radius:var(--rs); background:var(--s1); }
.settings-tabs button { min-width:0; min-height:44px; padding:.5rem .3rem; background:var(--s2); color:var(--text2); border:1px solid var(--border2); border-radius:var(--rs); font:650 .84rem/1.3 var(--font); cursor:pointer; overflow-wrap:anywhere; }
.settings-tabs button[aria-selected="true"] { background:var(--gold-dim); border-color:var(--gold); color:var(--gold); box-shadow:inset 0 -3px var(--gold); }
.settings-panel { margin-top:0; }
.settings-add { margin-left:auto; }
.new-category-form { display:grid; gap:1rem; }
.sb-notification-form .notification-switch { display:flex; flex-direction:column; align-items:flex-start; gap:.45rem; }
.notification-switch-label { display:flex; align-items:center; gap:.4rem; }
.notification-switch-label .pf-icon { width:18px; height:18px; }
.notification-switch-track { display:block; width:40px; height:24px; padding:3px; border:1px solid var(--border2); border-radius:16px; background:var(--s2); }
.notification-switch-track > span { display:block; width:16px; height:16px; border-radius:50%; background:var(--text2); }
.notification-switch[aria-checked="true"] .notification-switch-track { background:var(--gold); border-color:var(--gold); }
.notification-switch[aria-checked="true"] .notification-switch-track > span { background:var(--on-accent); transform:translateX(16px); }
.notification-switch:disabled { opacity:.6; cursor:wait; }
.notification-toggle-hint { font-size:.73rem; line-height:1.5; padding:.4rem 1rem; color:var(--text2); }
.notification-toggle-hint a { color:var(--gold); text-decoration:underline; }
@media(max-width:768px) { .settings-tabs { position:sticky; top:calc(var(--mobile-head) + env(safe-area-inset-top)); z-index:5; grid-template-columns:repeat(2,minmax(0,1fr)); } .settings-tabs button { font-size:.78rem; } }

.settings-panel > .sec-lbl:first-child { margin-top:0 !important; }
@media(min-width:769px) and (max-width:1100px) { .settings-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); } }

/* Brand treatment stays decorative; section headings and metadata stay neutral. */
:root { --brand-start:#f2e5be; --brand-mid:#e7c367; --brand-end:#76c5e6; --brand-shadow:#c9a84c30; }
[data-theme="light"] { --brand-start:#192b40; --brand-mid:#3158ac; --brand-end:#276a9d; --brand-shadow:#3158ac25; }
[data-theme="pixel"] { --brand-start:#5b21b6; --brand-mid:#175da2; --brand-end:#7332a5; --brand-shadow:#5b21b630; }
[data-theme="seahawks"] { --brand-start:#002244; --brand-mid:#397414; --brand-end:#164b79; --brand-shadow:#00224430; }
[data-theme="cyberpunk"] { --brand-start:#fcee0a; --brand-mid:#37ecd9; --brand-end:#ff91bb; --brand-shadow:#37ecd935; }
[data-theme="lcars"] { --brand-start:#ffb06a; --brand-mid:#d88cad; --brand-end:#b7a1e4; --brand-shadow:#d88cad35; }
[data-theme="imperial"] { --brand-start:#e9eef3; --brand-mid:#ff929c; --brand-end:#c8e1ed; --brand-shadow:#f0475230; }
[data-theme="pipboy"] { --brand-start:#b8ffc9; --brand-mid:#6bff89; --brand-end:#a5e17b; --brand-shadow:#6bff8935; }
.app-wordmark { display:inline-block; background:linear-gradient(120deg,var(--brand-start),var(--brand-mid) 55%,var(--brand-end)); background-clip:text; -webkit-background-clip:text; -webkit-text-fill-color:transparent; color:var(--brand-mid); text-shadow:0 2px 8px var(--brand-shadow); font-family:var(--font); font-weight:850; letter-spacing:.015em; white-space:nowrap; }
.header-separator { background:none; color:var(--header-ink,var(--text2)); -webkit-text-fill-color:currentColor; text-shadow:none; font-weight:400; font-style:normal; }
.app-page-heading { display:flex; align-items:baseline; flex-wrap:wrap; gap:.55rem; }
.app-page-heading .page-section { color:var(--text); -webkit-text-fill-color:currentColor; text-shadow:none; font:650 .85em/1.3 var(--font); letter-spacing:normal; text-transform:none; }
.sb-header .sb-user { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.35rem; align-items:center; }
.sb-user-info { min-width:0; }
.sb-user-info .sb-name,.sb-user-info .sb-uname { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb-user .sb-user-actions { display:flex; gap:.25rem; margin:0; }
.sb-user .sb-user-action { width:44px; height:44px; min-height:44px; padding:0; }
.sb-header .sb-notification-form { margin-top:.65rem; }
.sb-notification-form .notification-switch { width:100%; margin:0; padding:.35rem 0; display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:.3rem; font-size:.74rem; }
.notification-switch-label { min-width:0; }
.notification-switch-track { flex:none; }
.sb-header .notification-toggle-hint { padding:.4rem 0 0; }
.account-type { display:block; font-weight:750; color:var(--text2); }
.account-iban { display:block; margin-top:.2rem; font-family:var(--fm); overflow-wrap:anywhere; }
.account-link { display:block; margin-top:.3rem; }
.li-right.account-row-side { display:flex; flex-direction:column; align-items:flex-end; gap:.4rem; max-width:none; flex-shrink:0; }
.account-entry-count { display:block; text-align:right; font-size:.75rem; color:var(--text2); white-space:nowrap; }
.account-row-actions { display:flex; gap:.35rem; }
.account-row-actions .btn { display:grid; place-items:center; width:44px; min-height:44px; padding:0; }
.category-icon { color:var(--text2); }
@media(max-width:768px) {
  :root { --mobile-head:60px; }
  .topbar .topbar-identity { display:flex; flex-direction:row; flex-wrap:nowrap; align-items:baseline; gap:.4rem; min-width:0; }
  .topbar .app-wordmark { font-size:clamp(.72rem,3vw,.9rem); }
  .topbar .topbar-page { margin:0; color:var(--header-ink,var(--text)); -webkit-text-fill-color:currentColor; text-shadow:none; font:600 clamp(.78rem,3vw,.94rem)/1.3 var(--font); text-transform:none; letter-spacing:normal; white-space:nowrap; }
  .topbar .header-separator { font-size:.9rem; }
  [data-theme="cyberpunk"] .topbar { --brand-start:#151521; --brand-mid:#42206b; --brand-end:#144255; --brand-shadow:#15152125; --header-ink:#151521; }
  [data-theme="seahawks"] .topbar { --brand-start:#d9f5bd; --brand-mid:#a0e363; --brand-end:#d4edfa; --brand-shadow:#a0e36330; --header-ink:#fff; }
}

/* Region containers are not controls; focus indicators remain on tabs and fields. */
.settings-panel:focus { outline:none; }
.li-right.account-row-side { flex-direction:row; align-items:center; gap:.6rem; }
.account-entry-count { font-weight:650; }

.account-type { overflow-wrap:anywhere; }
