/* Final mobile surface. One scrolling content area, app navigation, no phone frame.
   Shared by Android Chrome, installed PWA and other small-screen browsers.
   The established desktop and independent watch layouts remain in their own files. */
@media (min-width:1024px) {
  [data-mobile-only] { display:none!important; }
}

@media (max-width:1023px) {
  html[data-experience=mother] { height:100%; color-scheme:light; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
  html[data-experience=mother] body {
    margin:0; min-width:0; height:100%; overflow:hidden;
    background:#fff8fb; font-size:16px; line-height:1.5;
  }
  html[data-experience=mother] body::before { display:none; }
  html[data-experience=mother] .shell {
    width:100%; max-width:none; height:100vh; height:100dvh;
    margin:0; padding:0; gap:0; display:flex; flex-direction:column;
    overflow:hidden; background:#fff8fb;
  }
  html[data-experience=mother] .topbar {
    display:flex; flex-wrap:nowrap; align-items:center; justify-content:space-between;
    flex:0 0 auto; min-height:72px; gap:12px; margin:0;
    padding:10px max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));
    padding-top:max(10px,env(safe-area-inset-top));
    border:0; border-bottom:1px solid #f1e4ec; border-radius:0;
    background:#ffffff; box-shadow:0 4px 20px -16px #76355433;
    backdrop-filter:none; -webkit-backdrop-filter:none; z-index:30;
  }
  html[data-experience=mother] .topbar .brand { min-width:0; gap:9px; text-decoration:none; }
  html[data-experience=mother] .topbar .brand img { width:36px; height:36px; border-radius:12px; }
  html[data-experience=mother] .topbar .brand-name { font-size:22px; letter-spacing:-.7px; white-space:nowrap; }
  html[data-experience=mother] .top-actions { flex-wrap:nowrap; flex:0 0 auto; gap:8px; margin:0; }
  html[data-experience=mother] .top-actions>.sync-return,
  html[data-experience=mother] .top-actions>[data-action=help],
  html[data-experience=mother] #app-install-strip:not([hidden]) { display:none!important; }
  html[data-experience=mother] .desktop-notification {
    position:relative; display:grid; place-items:center; width:48px; min-width:48px; height:48px;
    border:1px solid #efe4eb; border-radius:16px; background:#fff; color:#6b5870;
    padding:0; overflow:visible;
  }
  html[data-experience=mother] .desktop-notification>.icon { width:23px; height:23px; }
  html[data-experience=mother] .desktop-notification-count {
    position:absolute; right:-3px; top:-3px; display:grid; place-items:center;
    min-width:19px; min-height:19px; padding:1px 4px; border:2px solid #fff;
    border-radius:8px; background:#a7195d; color:#fff; font-size:11px; font-weight:800;
  }
  html[data-experience=mother] .desktop-account { position:relative; display:block; margin:0; padding:0; border:0; }
  html[data-experience=mother] .desktop-profile {
    display:grid; place-items:center; width:48px; height:48px; padding:0;
    border:1px solid #f2dbe7; border-radius:16px; background:#fff4f9;
  }
  html[data-experience=mother] .desktop-profile-avatar {
    display:grid; place-items:center; width:38px; height:38px; flex:0 0 38px;
    border-radius:12px; background:#fbe3ef; color:#9d2b65; font-size:16px; font-weight:800;
  }
  html[data-experience=mother] .desktop-profile>span:nth-child(2),
  html[data-experience=mother] .desktop-account-chevron { display:none; }
  html[data-experience=mother] .desktop-profile[aria-expanded=true] { border-color:#b14377; background:#ffe4f0; }
  html[data-experience=mother] .desktop-account-panel {
    position:absolute; top:calc(100% + 12px); right:0;
    width:min(320px,calc(100vw - 32px)); max-height:calc(100dvh - 100px - env(safe-area-inset-top));
    overflow-y:auto; overscroll-behavior:contain; padding:8px;
    border:1px solid #eddfE7; border-radius:22px; background:#fff;
    box-shadow:0 20px 55px -20px #47293855; z-index:45;
    animation:mobile-menu-enter .18s ease-out both;
  }
  html[data-experience=mother] .desktop-account-intro { display:flex; align-items:center; gap:12px; padding:12px 10px 18px; margin-bottom:6px; border-bottom:1px solid #f1e7ee; }
  html[data-experience=mother] .desktop-account-intro strong { display:block; color:#33263b; font-size:16px; }
  html[data-experience=mother] .desktop-account-intro small { display:block; margin-top:2px; color:#6e6072; font-size:13px; }
  html[data-experience=mother] .desktop-account-panel nav { display:flex; flex-direction:column; gap:3px; }
  html[data-experience=mother] .desktop-account-panel nav>button,
  html[data-experience=mother] .desktop-account-panel nav>a,
  html[data-experience=mother] .desktop-account-logout.header-icon {
    display:flex; align-items:center; justify-content:flex-start; gap:12px; width:100%;
    min-width:0; min-height:50px; height:auto; padding:12px; border:0; border-radius:13px;
    background:transparent; color:#594761; text-align:left; text-decoration:none; font-size:14px; font-weight:700;
  }
  html[data-experience=mother] .desktop-account-panel nav .icon { width:20px; height:20px; }
  html[data-experience=mother] .desktop-account-panel nav .icon:last-child { margin-left:auto; width:15px; }
  html[data-experience=mother] .desktop-logout-slot:not(:empty) { margin-top:6px; padding-top:6px; border-top:1px solid #f1e7ee; }
  html[data-experience=mother] .desktop-account-logout.header-icon { color:#ad3053; }
  html[data-experience=mother] .desktop-account-logout svg { width:20px; height:20px; }

  html[data-experience=mother] .workspace,
  html[data-experience=mother] body[data-mobile-panel=phone] .workspace {
    display:block; flex:1 1 auto; width:100%; max-width:none; min-height:0;
    margin:0; padding:0; gap:0; overflow:hidden;
  }
  html[data-experience=mother] .phone-column {
    display:flex; width:100%; max-width:680px; height:100%; min-height:0; min-width:0;
    margin:0 auto; padding:0!important; background:transparent; perspective:none;
  }
  html[data-experience=mother] .phone {
    display:flex; flex-direction:column; width:100%; max-width:none; height:100%; max-height:none;
    min-width:0; min-height:0; border:0; border-radius:0; margin:0; box-shadow:none; transform:none;
    overflow:hidden; background:#fff8fb;
  }
  html[data-experience=mother] .phone::before,
  html[data-experience=mother] .phone::after,
  html[data-experience=mother] .phone-scroll-track { display:none; }
  html[data-experience=mother] .phone .phone-content {
    flex:1 1 auto; min-height:0; min-width:0; width:100%;
    overflow-y:auto; overflow-x:hidden; overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch; scroll-behavior:auto;
    padding:22px max(16px,env(safe-area-inset-right)) 28px max(16px,env(safe-area-inset-left));
    background:linear-gradient(180deg,#fff8fb,#fffafd); font-size:16px;
  }
  html[data-experience=mother] .phone .phone-nav {
    flex:0 0 auto; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:3px;
    margin:0; padding:8px max(8px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    border:0; border-top:1px solid #f0dfe9; border-radius:24px 24px 0 0;
    background:#fff; box-shadow:0 -8px 24px -20px #76355455; backdrop-filter:none;
  }
  html[data-experience=mother] .phone-nav button {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    position:relative; min-width:0; min-height:58px; padding:7px 2px; gap:4px;
    border-radius:16px; color:#726375; font-size:12px; line-height:1.3; font-weight:700;
  }
  html[data-experience=mother] .phone-nav button.active { background:#fff0f7; color:#a7195d; }
  html[data-experience=mother] .phone-nav button.active::after { display:none; }
  html[data-experience=mother] .phone-nav .icon { width:23px; height:23px; }
  html[data-experience=mother] .phone-nav .count { right:calc(50% - 27px); top:2px; }
  html[data-experience=mother] .footer { display:none; }
  html[data-experience=mother] .network-status,
  html[data-experience=mother] .app-update-banner { flex-shrink:0; margin:0; padding:10px 16px; font-size:13px; border-radius:0; flex-wrap:wrap; }
  html[data-experience=mother] .app-update-banner .btn { min-height:44px; }

  html[data-experience=mother] .app-welcome { margin-bottom:20px; }
  html[data-experience=mother] .app-welcome h1 { font-size:27px; line-height:1.3; }
  html[data-experience=mother] .app-welcome p { font-size:14px; margin-bottom:5px; }
  html[data-experience=mother] .app-welcome>.round-avatar { display:none; }
  html[data-experience=mother] .home-clock { gap:12px; padding:16px; margin-bottom:20px; border-radius:22px; }
  html[data-experience=mother] .home-clock-digits { font-size:38px; }
  html[data-experience=mother] .home-clock-zone { font-size:12px; }
  html[data-experience=mother] .home-tour-link { min-height:48px; padding:10px 12px; font-size:13px; }
  html[data-experience=mother] .family-picker { gap:8px; padding:2px 1px 8px; margin-bottom:14px; overflow-x:auto; }
  html[data-experience=mother] .family-picker>button { flex-shrink:0; min-height:58px; border-radius:18px; }
  html[data-experience=mother] .family-picker .family-name { font-size:15px; }
  html[data-experience=mother] .family-picker small { font-size:12px; }
  html[data-experience=mother] .family-picker .add-family { min-width:48px; width:48px; padding:8px; }
  html[data-experience=mother] .care-card { padding:18px 18px 24px; border-radius:24px; }
  html[data-experience=mother] .care-top { align-items:flex-start; gap:8px; }
  html[data-experience=mother] .care-top>span:first-child { min-width:0; font-size:13px; }
  html[data-experience=mother] .care-demo { flex-shrink:0; font-size:10px!important; }
  html[data-experience=mother] .care-main { gap:12px; margin:18px 0; }
  html[data-experience=mother] .care-main>div { min-width:0; }
  html[data-experience=mother] .care-main h2 { font-size:26px; line-height:1.25; }
  html[data-experience=mother] .care-main p,
  html[data-experience=mother] .care-main>div>span { font-size:14px; }
  html[data-experience=mother] .care-mood { min-width:52px; min-height:52px; flex-shrink:0; }
  html[data-experience=mother] .care-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:-18px 8px 0; padding:0; border:0; }
  html[data-experience=mother] .care-metrics button { display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; min-width:0; min-height:106px; gap:8px; padding:12px 9px; border-radius:18px; }
  html[data-experience=mother] .care-metrics .icon { display:block; width:21px; height:21px; }
  html[data-experience=mother] .care-metrics b { font-size:20px; white-space:nowrap; }
  html[data-experience=mother] .care-metrics small { font-size:12px!important; line-height:1.4; }
  html[data-experience=mother] .app-sync-row { gap:8px; flex-wrap:wrap; margin:14px 0; }
  html[data-experience=mother] .app-sync-row>span { font-size:12px; }
  html[data-experience=mother] .app-sync-row button { min-height:48px; font-size:13px; padding:8px 10px; }
  html[data-experience=mother] .safety-demo-strip { display:grid; grid-template-columns:40px minmax(0,1fr); gap:8px 12px; padding:14px; border-radius:20px; }
  html[data-experience=mother] .safety-demo-strip .service-icon { width:40px; height:40px; }
  html[data-experience=mother] .safety-demo-strip strong { font-size:14px; }
  html[data-experience=mother] .safety-demo-strip small { font-size:13px; line-height:1.5; color:#745968; }
  html[data-experience=mother] .safety-demo-strip .text-btn { grid-column:2; justify-self:start; min-height:48px; font-size:14px; padding:8px 12px; background:#ffe8ee; border-radius:13px; }
  html[data-experience=mother] .section-heading { gap:10px; margin:24px 0 14px; }
  html[data-experience=mother] .section-heading h2 { font-size:19px; }
  html[data-experience=mother] .section-heading button { min-height:48px; font-size:13px; }
  html[data-experience=mother] .quick-services { grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px 6px; margin:0; padding:0 0 22px; border-bottom:1px solid #f0e4ec; }
  html[data-experience=mother] .quick-services>button { min-height:100px; min-width:0; padding:4px 0; gap:9px; font-size:13px; line-height:1.4; }
  html[data-experience=mother] .quick-services .service-icon { width:52px; height:52px; border-radius:18px; }
  html[data-experience=mother] .quick-services .service-icon .icon { width:25px; height:25px; }
  html[data-experience=mother] .next-routine { display:grid; grid-template-columns:60px 36px minmax(0,1fr) 48px; gap:8px; padding:14px 12px; border-radius:20px; }
  html[data-experience=mother] .next-routine>div { min-width:0; }
  html[data-experience=mother] .next-routine .routine-time { width:auto; min-width:0; padding-right:8px; }
  html[data-experience=mother] .next-routine .routine-symbol { display:grid; width:36px; height:40px; border-radius:12px; }
  html[data-experience=mother] .routine-time b { font-size:18px; }
  html[data-experience=mother] .routine-time span { font-size:12px; }
  html[data-experience=mother] .next-routine small,
  html[data-experience=mother] .next-routine p { font-size:12px; line-height:1.5; }
  html[data-experience=mother] .next-routine h3 { font-size:16px; line-height:1.4; }
  html[data-experience=mother] .next-routine .header-icon { width:48px; min-width:48px; height:48px; }
  html[data-experience=mother] .latest-note { align-items:flex-start; padding:16px; gap:12px; }
  html[data-experience=mother] .latest-note>div { min-width:0; }
  html[data-experience=mother] .latest-note strong { font-size:14px; line-height:1.5; }
  html[data-experience=mother] .latest-note small { font-size:12px; }
  html[data-experience=mother] .caregiver-card { min-height:88px; gap:12px; padding:16px; border-radius:20px; }
  html[data-experience=mother] .caregiver-card b { font-size:14px; }
  html[data-experience=mother] .caregiver-card small { font-size:13px; }

  html[data-experience=mother] .detail-toolbar { gap:12px; flex-wrap:wrap; font-size:16px; margin-bottom:16px; }
  html[data-experience=mother] .detail-toolbar button { min-height:48px; font-size:13px; }
  html[data-experience=mother] .child-header { min-width:0; gap:10px; margin-bottom:16px; }
  html[data-experience=mother] .child-header .back,
  html[data-experience=mother] .device-heading-row .back { min-width:48px; width:48px; height:48px; }
  html[data-experience=mother] .child-header h2 { font-size:20px; }
  html[data-experience=mother] .child-header small { font-size:12px; }
  html[data-experience=mother] .child-header select { min-height:48px; max-width:100%; font-size:16px; }
  html[data-experience=mother] .tabs { position:relative; display:flex; flex-wrap:nowrap; gap:8px; margin:0 0 18px; padding:0 0 8px; overflow-x:auto; scrollbar-width:none; }
  html[data-experience=mother] .tabs button { display:flex; align-items:center; justify-content:center; gap:7px; flex:0 0 auto; min-height:48px; min-width:0; padding:10px 14px; border:1px solid #eedee7; border-radius:15px; background:#fff; font-size:14px; white-space:nowrap; }
  html[data-experience=mother] .tabs button.active { background:#fff0f7; border-color:#c6558a; color:#a7195d; }
  html[data-experience=mother] .phone-content .btn,
  html[data-experience=mother] .account-actions button,
  html[data-experience=mother] .reminder button,
  html[data-experience=mother] .location-map-toolbar button,
  html[data-experience=mother] .period-switch button { min-height:48px; font-size:14px; }
  html[data-experience=mother] .phone-content input:not([type=range]):not([type=checkbox]),
  html[data-experience=mother] .phone-content select,
  html[data-experience=mother] .modal input:not([type=checkbox]),
  html[data-experience=mother] .modal select { min-height:48px; min-width:0; max-width:100%; font-size:16px; }
  html[data-experience=mother] .phone-content .source-note,
  html[data-experience=mother] .health-profile-card p,
  html[data-experience=mother] .automation-card>.source-note { font-size:13px; line-height:1.65; color:#706075; }
  html[data-experience=mother] .health-profile-grid small,
  html[data-experience=mother] .health-profile-grid b { font-size:14px; }
  html[data-experience=mother] .stat-grid,
  html[data-experience=mother] .overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  html[data-experience=mother] .stat { min-width:0; padding:16px; }
  html[data-experience=mother] .stat small,
  html[data-experience=mother] .overview-tile small { font-size:13px; }
  html[data-experience=mother] .location-map { height:clamp(280px,42dvh,440px); }
  html[data-experience=mother] .location-map .leaflet-bar a { width:48px; height:48px; line-height:48px; }
  html[data-experience=mother] .location-map-toolbar { flex-wrap:wrap; }
  html[data-experience=mother] .location-map-toolbar>span { font-size:13px; }
  html[data-experience=mother] .automation-window { flex-wrap:wrap; }
  html[data-experience=mother] .automation-window button { min-height:48px; }
  html[data-experience=mother] .automation-list>div small { font-size:12px; color:#706075; line-height:1.5; }

  html[data-experience=mother] .toast { bottom:calc(92px + env(safe-area-inset-bottom)); font-size:14px; max-width:calc(100vw - 32px); width:max-content; }
  html[data-experience=mother] .modal-backdrop { align-items:flex-end; padding:12px; }
  html[data-experience=mother] .modal { max-width:560px; max-height:calc(100dvh - 24px); padding:20px 20px max(20px,env(safe-area-inset-bottom)); border-radius:26px; overscroll-behavior:contain; }
  html[data-experience=mother] .modal .close { width:48px; height:48px; flex:0 0 48px; }
  html[data-experience=mother] .modal p,
  html[data-experience=mother] .help-step { font-size:14px; }
  html[data-experience=mother] .help-step small { font-size:13px; }
  html[data-experience=mother] .modal .btn { min-height:50px; font-size:15px; }

  /* Let the login document scroll normally when Android's keyboard is open. */
  .login-page { min-height:100dvh; height:auto; overflow-x:hidden; overflow-y:auto; background:#fff8fb; }
  .login-page .login-layout { width:min(100%,560px); padding:max(28px,env(safe-area-inset-top)) 20px max(24px,env(safe-area-inset-bottom)); }
  .login-page .login-card { padding:24px 20px; border-radius:26px; box-shadow:0 18px 50px -32px #7d245a55; }
  .login-page .login-heading h1 { font-size:34px; }
  .login-page .login-brand { font-size:26px; }
  .login-page #login-form input { height:56px; font-size:16px; scroll-margin-block:100px; }
  .login-page .login-submit { min-height:56px; }
  .login-page .login-demo button,
  .login-page .discovery-links a { min-height:48px; }
  .login-page .discovery-links a { display:inline-flex; align-items:center; justify-content:center; }
  @keyframes mobile-menu-enter { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
}

@media (max-width:399px) {
  html[data-experience=mother] .next-routine { grid-template-columns:60px minmax(0,1fr) 48px; }
  html[data-experience=mother] .next-routine .routine-symbol { display:none; }
  html[data-experience=mother] .care-main h2 { font-size:23px; }
  html[data-experience=mother] .home-tour-link { width:100%; justify-content:center; }
  .login-page .login-layout { padding-left:16px; padding-right:16px; }
  .login-page .login-card { padding:24px 16px; }
}
@media (min-width:600px) and (max-width:1023px) {
  html[data-experience=mother] .phone .phone-content { padding:28px 24px 32px; }
  html[data-experience=mother] .topbar { padding-left:24px; padding-right:24px; }
}
@media (max-height:500px) and (max-width:1023px) {
  html[data-experience=mother] .topbar { min-height:60px; padding-top:6px; padding-bottom:6px; }
  html[data-experience=mother] .phone-nav button { min-height:48px; }
  html[data-experience=mother] .phone .phone-nav { padding-top:4px; padding-bottom:max(4px,env(safe-area-inset-bottom)); }
}
@media (hover:none) and (max-width:1023px) {
  html[data-experience=mother] button:hover:not(:disabled),
  html[data-experience=mother] .quick-services>button:hover .service-icon { transform:none; filter:none; }
  html[data-experience=mother] button:active:not(:disabled) { transform:scale(.98); }
  html[data-experience=mother] .desktop-account-panel nav>button:active,
  html[data-experience=mother] .desktop-account-panel nav>a:active { background:#fff0f7; }
}
@media (prefers-reduced-motion:reduce) {
  html[data-experience=mother] .desktop-account-panel { animation:none; }
}
