/* Approved Family Hub shell. Existing views and dialogs retain their own layout. */
:root {
  --hub-bg: #F7FAF6;
  --hub-ink: #28543C;
  --hub-line: #DCE7DE;
  --hub-home: #418565;
  --hub-organiser: #D99A50;
  --hub-assistant: #9275BC;
  --hub-grocery: #4897A5;
  --hub-finance: #C07A88;
  --family-sidebar-width: 232px;
  --app-bg-solid: #F7FAF6;
  --app-bg: none;
  --surface: #FFFFFF;
  --surface-muted: #F7FAF6;
  --surface-frosted: #FFFFFFF5;
  --brand-green: #28543C;
  --brand-green-deep: #214B34;
  --brand-green-soft: #E5F2E8;
  --border: #DCE7DE;
}
body { background: var(--hub-bg); }
h1, h2, h3 { color: var(--hub-ink); }
.hub-icon { width: 23px; height: 23px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hub-icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.hub-skip-link { position: fixed; left: -9999px; top: 10px; z-index: 300; background: white; border: 2px solid var(--hub-ink); border-radius: 10px; padding: 12px; }
.hub-skip-link:focus { left: 12px; }
body.authenticated .app-shell { display: block !important; }
body.authenticated .sidebar {
  display: flex; position: fixed; top: 0; left: 0; width: var(--family-sidebar-width); height: 100dvh;
  padding: 28px 16px; gap: 18px; overflow-y: auto; border-right: 1px solid var(--hub-line);
  background: linear-gradient(150deg, #EFF6EF, #FFFFFF 65%); box-shadow: none;
}
body.authenticated .workspace {
  margin-left: var(--family-sidebar-width) !important; width: calc(100% - var(--family-sidebar-width));
  max-width: none; min-height: 100dvh; padding: 100px 30px 32px !important; overflow: visible;
}
body.authenticated .mobile-app-bar {
  display: flex !important; position: fixed; top: 0; left: var(--family-sidebar-width); right: 0; width: auto;
  min-height: 76px; padding: 14px 28px; gap: 14px; background: #FFFFFFF5 !important;
  background-image: none; border-bottom: 1px solid var(--hub-line); box-shadow: none;
}
body.authenticated .mobile-app-title { margin-right: auto; }
body.authenticated .mobile-app-title strong { color: var(--hub-ink); }
.family-header-eyebrow { display: none; }
.hub-assistant-entry { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--hub-line); background: white; background-image: none; box-shadow: none; color: #657C6B; border-radius: 28px; padding: 11px 18px; font-size: 13px; font-weight: 500; margin-right: auto; min-width: 230px; }
.hub-account-entry { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 9px; border: 1px solid var(--hub-line); border-radius: 50%; background: white; background-image: none; color: var(--hub-ink); box-shadow: none; }
.family-collapse-button { align-self: flex-end; width: 34px; height: 34px; display: grid; place-items: center; padding: 6px; border: 1px solid var(--hub-line); border-radius: 10px; background: white; background-image: none; color: var(--hub-ink); box-shadow: none; }
.family-primary-navigation, .family-secondary-navigation, .family-home-resources { display: grid; gap: 6px; }
.sidebar .brand h1 { font-size: 30px; letter-spacing: -1px; }
.sidebar .brand .eyebrow { font-size: 10px; letter-spacing: 1.2px; }
.sidebar .nav-item { display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 12px; white-space: nowrap; font-size: 13px; font-weight: 650; color: var(--hub-ink); border: 1px solid transparent; border-radius: 14px; background: transparent; background-image: none; box-shadow: none; text-align: left; }
.sidebar .nav-item .hub-icon { color: var(--section, var(--hub-home)); }
.sidebar .nav-item:hover { background: #EDF5ED; box-shadow: none; transform: none; }
.sidebar .nav-item.active { background: #E5F2E8; border-color: #D6E6D9; box-shadow: none; }
.family-secondary-navigation, .family-home-resources { padding-top: 14px; border-top: 1px solid var(--hub-line); }
.family-home-resources .nav-item, .family-secondary-navigation .nav-item { min-height: 42px; font-size: 12px; }
.family-home-resources-title { margin: 0 10px 3px; color: #758778; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
body.authenticated .sidebar-footer { margin-top: auto; font-size: 11px; }
body.authenticated .family-board-panel { display: none !important; }
body.authenticated .mobile-family-board { display: block !important; }
body.authenticated .view[hidden] { display: none !important; }
.family-home-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 18px; }
.family-home-tabs button { min-height: 38px; padding: 8px 13px; font-size: 12px; font-weight: 600; color: #617766; background: transparent; background-image: none; border: 1px solid transparent; box-shadow: none; border-radius: 10px; }
.family-home-tabs button[aria-current] { color: var(--hub-ink); background: #E5F2E8; }
.family-hub { max-width: 520px; margin: 0 auto 20px; text-align: center; }
.family-hub h2 { font-size: 28px; letter-spacing: -.7px; margin: 0 0 8px; }
.family-hub > p { color: #627968; font-size: 13px; margin: 0 0 10px; }
.family-hub-circle { display: block; position: relative; aspect-ratio: 1; width: 100%; max-width: 420px; margin: 0 auto; overflow: visible; filter: drop-shadow(0 10px 13px #28543C18); }
/* Native HTML links own navigation; SVG paths remain decorative hit areas. */
.family-hub-segment, .family-hub-centre { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.family-hub-segment { cursor: pointer; text-decoration: none; }
.family-hub-segment[hidden] { display: none; }
.family-hub-segment > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.family-hub-segment > svg > path { pointer-events: visiblePainted; stroke: #FFFFFF; stroke-width: 7; stroke-linejoin: round; }
.family-hub-segment:hover > svg > path { filter: brightness(1.08); }
.family-hub-segment:focus { outline: none; }
.family-hub-segment:focus-visible > svg > path { stroke: #173B29; stroke-width: 9; }
.family-hub-segment text { fill: #112A1B; font-size: 23px; font-weight: 750; font-family: inherit; }
.family-hub-segment .hub-icon { color: #173B29; }
.family-hub-name { fill: #214B36; font: 800 32px ui-sans-serif, system-ui, sans-serif; letter-spacing: -1px; }
.family-hub-tagline { fill: #476252; font: 18px ui-sans-serif, system-ui, sans-serif; }
#dashboardView > .warm-hello { margin-bottom: 16px; gap: 4px; }
#dashboardView > .warm-hello h2 { font-size: 22px; letter-spacing: -.4px; }
#dashboardView > .warm-hello .eyebrow { font-size: 10px; }
#dashboardView > .warm-hello #dashboardFamily { font-size: 12px; }
.daily-briefing-card, .dashboard-card, .mobile-family-board, .smart-shopping-panel, .money-chart-card, .money-summary-card { border-color: var(--hub-line); border-radius: 18px; background: #FFFFFF; background-image: none; box-shadow: 0 4px 18px #28543C06; }
.family-grocery-shortcuts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 0 0 20px; }
.family-grocery-shortcuts button { display: flex; align-items: flex-start; flex-direction: column; gap: 9px; padding: 18px; min-height: 112px; text-align: left; color: var(--hub-ink); background: white; background-image: none; box-shadow: 0 3px 15px #28543C04; border: 1px solid var(--hub-line); border-radius: 17px; font-size: 14px; font-weight: 700; }
.family-grocery-shortcuts .hub-icon { color: var(--hub-grocery); width: 28px; height: 28px; }
.family-grocery-shortcuts small { font-size: 12px; font-weight: 400; color: #687E6D; line-height: 1.6; }
.family-section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.family-section-heading > .hub-icon { width: 44px; height: 44px; color: var(--hub-assistant); padding: 8px; border-radius: 14px; background: #EEE8F6; }
.family-section-heading h2 { font-size: 26px; margin: 0 0 5px; }
.family-section-heading p { margin: 0; color: #687E6D; font-size: 13px; }
.family-bottom-nav { display: none; }
.family-refresh-board { border: 1px solid var(--hub-line); border-radius: 9px; padding: 7px 11px; min-height: 36px; background: white; background-image: none; box-shadow: none; color: var(--hub-ink); font-size: 12px; }
body.family-sidebar-collapsed { --family-sidebar-width: 80px; }
body.family-sidebar-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
body.family-sidebar-collapsed .sidebar .brand,
body.family-sidebar-collapsed .sidebar .nav-item span,
body.family-sidebar-collapsed .family-home-resources-title,
body.family-sidebar-collapsed .sidebar-footer { display: none; }
body.family-sidebar-collapsed .sidebar .nav-item { justify-content: center; padding: 12px; }
body.family-sidebar-collapsed .family-collapse-button { align-self: center; }
@media(min-width:901px) and (min-height:481px) {
  body.authenticated .mobile-menu-button, body.authenticated .mobile-menu-close { display: none !important; }
  body.authenticated .mobile-app-title { display: none; }
}
@media(max-width:900px), (max-height:480px) {
  body.authenticated .app-shell { padding-top: calc(78px + env(safe-area-inset-top)) !important; }
  body.authenticated .workspace { margin-left: 0 !important; width: 100% !important; padding: 14px 16px calc(100px + env(safe-area-inset-bottom)) !important; }
  body.authenticated .mobile-app-bar { left: 0; min-height: calc(78px + env(safe-area-inset-top)); padding: calc(11px + env(safe-area-inset-top)) 16px 11px !important; gap: 10px; }
  body.authenticated .mobile-app-title { display: block; }
  body.authenticated .mobile-app-title strong { font-size: 26px; letter-spacing: -.8px; }
  .family-header-eyebrow { display: block; margin: 0 0 3px; font-size: 9px; letter-spacing: 1px; font-weight: 700; color: #657C6B; text-transform: uppercase; }
  .hub-assistant-entry { display: none; }
  .hub-account-entry { width: 36px; height: 40px; padding: 7px; border: 0; background: transparent; }
  body.authenticated .sidebar { display: none !important; }
  body.authenticated.mobile-nav-open .sidebar { display: flex !important; top: 0; width: min(86vw, 340px) !important; max-height: 100dvh; height: 100dvh; padding: 24px 16px calc(94px + env(safe-area-inset-bottom)); overflow-y: auto; }
  body.authenticated.mobile-nav-open .mobile-menu-overlay { display: block !important; position: fixed; inset: 0; background: #173D2966; z-index: 80; }
  body.authenticated.mobile-nav-open .sidebar { z-index: 90; }
  .mobile-menu-close { display: inline-flex !important; }
  body.authenticated .mobile-menu-button { display: inline-flex !important; min-width: 36px; min-height: 40px; padding: 8px; border: 0; box-shadow: none; background: transparent; color: var(--hub-ink); }
  .family-collapse-button { display: none; }
  body.family-sidebar-collapsed .sidebar .brand { display: block; }
  body.family-sidebar-collapsed .sidebar .nav-item span { display: inline; }
  body.family-sidebar-collapsed .sidebar .nav-item { justify-content: flex-start; }
  body.family-sidebar-collapsed .family-home-resources-title, body.family-sidebar-collapsed .sidebar-footer { display: block; }
  body.mobile-nav-open .family-home-tabs { visibility: hidden; }
  .family-home-tabs { margin-bottom: 14px; gap: 3px; }
  .family-home-tabs button { font-size: 11px; min-height: 36px; padding: 7px 10px; }
  .family-hub h2 { font-size: 24px; margin-bottom: 7px; }
  .family-hub > p { font-size: 12px; line-height: 1.6; }
  .family-hub-circle { max-width: 400px; }
  .family-hub { margin-bottom: 14px; }
  #dashboardView > .warm-hello { margin-bottom: 14px; }
  #dashboardView > .warm-hello h2 { font-size: 18px; }
  body.authenticated .family-bottom-nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); position: fixed; bottom: 0; left: 0; right: 0; z-index: 70; padding: 8px max(7px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left)); border-top: 1px solid #D4E2D7; background: #EAF3EDF5; backdrop-filter: blur(14px); }
  .family-bottom-nav button { min-width: 0; min-height: 50px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 5px 2px; font-size: 10px; font-weight: 500; color: #5B7162; border: 1px solid transparent; border-radius: 12px; background: transparent; background-image: none; box-shadow: none; }
  .family-bottom-nav button.active { color: var(--hub-ink); background: #DCEADD; font-weight: 750; }
  .family-bottom-nav button.active .hub-icon { color: var(--section); }
  .family-grocery-shortcuts { grid-template-columns: 1fr; gap: 9px; }
  .family-grocery-shortcuts button { min-height: 68px; display: grid; grid-template-columns: 29px 1fr; gap: 3px 12px; padding: 14px; font-size: 13px; }
  .family-grocery-shortcuts .hub-icon { grid-row: span 2; }
  .family-grocery-shortcuts small { font-size: 11px; }
  .family-section-heading h2 { font-size: 24px; }
}
body:not(.authenticated) .family-bottom-nav, body:not(.authenticated) .family-home-tabs,
body .family-bottom-nav[hidden], body .family-home-tabs[hidden],
body.authenticated .mobile-app-bar[hidden], body .family-bottom-nav button[hidden], body .sidebar .nav-item[hidden] { display: none !important; }
.hub-icon:focus-visible, .family-home-tabs button:focus-visible, .family-bottom-nav button:focus-visible,
.family-collapse-button:focus-visible, .hub-assistant-entry:focus-visible, .hub-account-entry:focus-visible { outline: 3px solid #193B26; outline-offset: 3px; }
@media(prefers-reduced-motion:reduce) { .family-hub *, .family-primary-navigation *, .family-bottom-nav * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .family-bottom-nav, .family-home-tabs, .family-hub, .family-grocery-shortcuts { display: none !important; } body.authenticated .workspace { margin-left: 0 !important; width: 100% !important; padding: 0 !important; } }
body.authenticated .mobile-app-bar .notification-button { width: 44px; height: 44px; padding: 9px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid var(--hub-line); border-radius: 50%; background: white; background-image: none; box-shadow: none; color: var(--hub-ink); }
.family-hub-segment text { fill: #030805; }
.family-hub-segment .hub-icon { width: 38px; height: 38px; }
.family-collapse-button { width: 44px; height: 44px; }
@media(max-width:900px), (max-height:480px) {
  .family-home-tabs button { min-height: 44px; }
  body.authenticated .mobile-menu-button { min-width: 44px; min-height: 44px; }
  .hub-account-entry { width: 44px; height: 44px; }
  .family-home-resources .nav-item, .family-secondary-navigation .nav-item { min-height: 44px; }
}
.family-refresh-board { min-height: 44px; }
@media(max-width:900px), (max-height:480px) { body.authenticated .install-prompt { bottom: calc(90px + env(safe-area-inset-bottom)); } }
/* Keep the expanded mobile drawer and its guidance clear of the app header. */
body.authenticated .mobile-app-bar .notification-button { position: relative !important; inset: auto !important; margin: 0 !important; }
body.authenticated #dashboardView .dashboard-card { min-height: 0 !important; height: auto !important; padding: 18px !important; }
body.authenticated #dashboardView .mobile-family-board { min-height: 0 !important; padding: 18px; border: 1px solid var(--hub-line); border-radius: 18px; }
#dashboardView .dashboard-grid { align-items: start; }
#dashboardView .dashboard-icon { display: inline-grid; place-items: center; }
.family-hub-segment text { font-size: 21px; }
@media(max-width:900px), (max-height:480px) {
  body.authenticated #dashboardView > .warm-hello h2#greeting { font-size: 18px !important; line-height: 1.3; }
  body.authenticated.mobile-nav-open .mobile-app-bar { z-index: 80 !important; }
  body.authenticated.mobile-nav-open .mobile-menu-overlay { z-index: 10020 !important; }
  body.authenticated.mobile-nav-open .sidebar { z-index: 10030 !important; }
  body.mobile-nav-open .first-use-tooltip { top: auto !important; bottom: calc(88px + env(safe-area-inset-bottom)); left: 16px !important; max-width: min(310px, calc(100vw - 32px)); pointer-events: none; }
  body.mobile-nav-open .first-use-tooltip::before, body.mobile-nav-open .first-use-tooltip::after { display: none; }
  body.mobile-nav-open .first-use-tooltip-close { pointer-events: auto; }
}
.daily-briefing-card h3#dailyBriefingTitle { font-size: 20px !important; }
@media(max-width:900px), (max-height:480px) {
  body.authenticated .notification-panel { top: calc(86px + env(safe-area-inset-top)) !important; max-height: calc(100dvh - 178px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
