/* ============================================================
   App shell: sidebar, brand lockup, nav, page frame, top bar and account menu.
   ============================================================ */

/* ===== Layout ===== */
.app{display:grid;grid-template-columns:240px 1fr;height:100vh}

.sidebar{
  background:var(--surface);
  border-right:1px solid var(--line);
  display:flex;flex-direction:column;
  padding:24px 16px;
  overflow-y:auto;
}
.brand{padding:0 10px 24px;display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.brand .brand-lockup{font-size:22px}
/* logo lockup — sized by font-size; the mark scales with it */
.brand-lockup{
  display:inline-flex;align-items:center;gap:.34em;
  font-family:var(--display);font-size:26px;font-weight:700;letter-spacing:-.03em;line-height:1;
  color:var(--logo-ink);
}
.brand-lockup svg{height:1.1em;width:auto;flex-shrink:0;display:block}
.brand-lockup .brand-name{padding-bottom:.06em}

.nav{display:flex;flex-direction:column;gap:4px}
.nav-item{
  display:flex;align-items:center;gap:12px;
  min-height:44px;padding:0 12px;border-radius:10px;
  color:var(--ink-soft);font-weight:500;font-size:var(--fs-base);
  text-align:left;width:100%;transition:all .12s;
}
.nav-item:hover{background:var(--surface-hover);color:var(--ink)}
.nav-item.active{background:var(--brand-bg);color:var(--ink);font-weight:600}
.nav-item.active .nav-icon{color:var(--ink)}
.nav-icon{width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;color:var(--ink-soft);transition:color .12s}
.nav-icon svg{width:18px;height:18px;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nav-item:hover .nav-icon{color:var(--ink)}

/* household identity under the nav (desktop) — it replaces the top bar there */
.sidebar-foot{margin-top:24px;padding:14px 0 0;border-top:1px solid var(--line);display:flex;align-items:center}
.hh-chip{
  flex:1;min-width:0;display:flex;align-items:center;gap:10px;
  padding:6px;border-radius:10px;text-align:left;cursor:pointer;transition:background .12s;
}
.hh-chip:hover{background:var(--surface-hover)}
.hh-text{min-width:0;display:flex;flex-direction:column;line-height:1.3}
.hh-name{font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hh-sub{font-size:12px;color:var(--ink-mute);white-space:nowrap}

.main{overflow-y:auto;background:var(--bg)}
.page{padding:32px 32px 80px;max-width:var(--page-max);margin:0 auto}
.page-head{
  display:flex;align-items:flex-end;justify-content:space-between;
  margin-bottom:24px;gap:16px;flex-wrap:wrap;
}
.page-title{
  font-size:26px;
  font-weight:700;letter-spacing:-.02em;line-height:1.2;
  color:var(--ink);
  display:flex;align-items:center;gap:10px;
}
.page-title em{font-style:normal;color:var(--brand)}
/* headings share the wordmark's typeface */
.page-title,.section-title,.welcome-greet,.modal-title,.auth-head{font-family:var(--display)}
.page-sub{color:var(--ink-mute);font-size:var(--fs-base);margin-top:4px}
.page-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

/* ===== Top bar: household identity ===== */
.topbar{
  position:sticky;top:0;z-index:20;
  display:flex;align-items:center;justify-content:flex-end;gap:10px;
  height:60px;
  /* line the controls up with the page content, which is capped at --page-max */
  padding:0 max(36px, calc((100% - var(--page-max)) / 2 + 36px));
  background:var(--bg);border-bottom:1px solid var(--line);
}
.topbar-icon{
  width:38px;height:38px;border-radius:50%;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;font-size:var(--fs-md);
  background:var(--surface);border:1px solid var(--line);cursor:pointer;color:var(--ink-soft);
  transition:background .12s,border-color .12s;
}
.topbar-icon:hover{background:var(--surface-hover);border-color:var(--line-strong)}
.account-chip{
  display:flex;align-items:center;gap:9px;
  padding:5px 12px 5px 5px;border-radius:var(--radius-pill);
  background:var(--surface);border:1px solid var(--line);cursor:pointer;
  transition:border-color .12s,box-shadow .12s;
}
.account-chip:hover{border-color:var(--brand-border);box-shadow:var(--shadow-xs)}
.account-name{font-size:var(--fs-sm);font-weight:600;color:var(--ink);max-width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account-chip .chev{color:var(--ink-mute);font-size:var(--fs-xs)}
.acct-photo{border-radius:50%;object-fit:cover;display:block;flex-shrink:0}
.acct-duo{display:inline-flex;align-items:center;flex-shrink:0}
.acct-duo > *{box-shadow:0 0 0 2px var(--surface);border-radius:50%}
.acct-duo > *:nth-child(2){margin-left:-9px}

.acct-menu{
  position:fixed;top:64px;right:24px;z-index:60;width:248px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);
  box-shadow:var(--shadow-lg);padding:8px;animation:menuIn .12s ease;
}
@keyframes menuIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.acct-menu-head{display:flex;align-items:center;gap:11px;padding:8px 8px 12px;border-bottom:1px solid var(--line-soft);margin-bottom:6px}
.am-name{font-size:var(--fs-base);font-weight:650;color:var(--ink)}
.am-sub{font-size:var(--fs-xs);color:var(--ink-mute);margin-top:1px}
.acct-menu-label{font-size:12px;color:var(--ink-mute);font-weight:600;padding:8px 8px 4px}
.acct-menu-item{display:flex;align-items:center;gap:9px;width:100%;text-align:left;padding:8px;border-radius:var(--radius-sm);font-size:var(--fs-sm);color:var(--ink-soft);cursor:pointer;background:none;border:none}
.acct-menu-item:hover{background:var(--surface-hover);color:var(--ink)}
.acct-menu-item.on{color:var(--brand);font-weight:600}
.acct-menu-sep{height:1px;background:var(--line-soft);margin:6px 0}

/* defaults for all sizes: the tab bar and top-bar logo only exist on phones */
@media (min-width:601px){ .topbar{display:none} }
.tabbar{display:none}
.topbar-brand{display:none}

.more-list{display:flex;flex-direction:column;gap:2px}
.more-list .nav-item{min-height:48px}
