/* PEPTODAY mobile-first application shell. Desktop layout remains unchanged. */
.blood-pressure-entry-fields {
  grid-column:1/-1;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  gap:9px;
  align-items:end;
}
.blood-pressure-entry-fields > span {
  display:grid;
  place-items:center;
  height:42px;
  color:#6d8396;
  font-size:20px;
}
.mobile-nav-logo,
.mobile-current-page,
.mobile-profile-button,
.phone-bottom-nav,
.mobile-more-backdrop,
.mobile-more-sheet { display:none !important; }

@media (max-width:700px) {
  html { background:#eef6fb; }
  body { overscroll-behavior-y:none; }
  .app-shell {
    min-width:0;
    padding-bottom:calc(82px + env(safe-area-inset-bottom, 0px));
  }
  .app-shell .workspace {
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
    padding:calc(6px + env(safe-area-inset-top, 0px)) 10px calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Phone header: brand mark, current page, account. */
  .main-app-nav {
    top:calc(5px + env(safe-area-inset-top, 0px));
    grid-template-columns:38px minmax(0,1fr) 38px !important;
    gap:8px !important;
    min-height:50px;
    margin:0 0 12px !important;
    padding:5px 7px !important;
    border-radius:15px !important;
  }
  .main-app-nav > nav,
  .settings-icon-button,
  .desktop-profile-link,
  .desktop-nav-logo { display:none !important; }
  .main-nav-logo { display:grid; place-items:center; width:38px !important; height:38px; }
  .mobile-nav-logo { display:block !important; width:34px !important; height:34px !important; object-fit:contain; }
  .mobile-current-page {
    display:block !important;
    overflow:hidden;
    color:#173f67;
    font-size:14px !important;
    font-weight:850;
    line-height:1;
    text-align:center;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .main-nav-tools { gap:0; }
  .mobile-profile-button { display:grid !important; width:34px; height:34px; font:800 10px/1 inherit; }

  /* Familiar phone tab bar with safe-area spacing. */
  .phone-bottom-nav {
    position:fixed;
    z-index:90;
    left:8px;
    right:8px;
    bottom:calc(7px + env(safe-area-inset-bottom, 0px));
    display:grid !important;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:2px;
    min-height:64px;
    padding:5px;
    border:1px solid rgba(255,255,255,.82);
    border-radius:19px;
    background:rgba(248,252,255,.91);
    box-shadow:0 13px 36px rgba(27,65,101,.18),inset 0 1px rgba(255,255,255,.94);
    backdrop-filter:blur(24px) saturate(145%);
    -webkit-backdrop-filter:blur(24px) saturate(145%);
  }
  .phone-bottom-nav button {
    display:grid;
    place-content:center;
    gap:3px;
    min-width:0;
    min-height:52px;
    padding:3px 2px;
    border:0;
    border-radius:14px;
    color:#668097;
    background:transparent;
    cursor:pointer;
  }
  .phone-bottom-nav button > span { font-size:19px !important; font-weight:750; line-height:1; }
  .phone-bottom-nav button > small { overflow:hidden; font-size:8px !important; font-weight:800; text-overflow:ellipsis; white-space:nowrap; }
  .phone-bottom-nav button.active { color:#0d66b1; background:linear-gradient(145deg,rgba(226,242,253,.94),rgba(237,249,251,.9)); }

  /* More sheet keeps secondary destinations out of the primary tab bar. */
  .mobile-more-backdrop {
    position:fixed;
    z-index:91;
    inset:0;
    display:block !important;
    border:0;
    background:rgba(25,48,67,.28);
    backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);
  }
  .mobile-more-sheet {
    position:fixed;
    z-index:92;
    left:10px;
    right:10px;
    bottom:calc(80px + env(safe-area-inset-bottom, 0px));
    display:block !important;
    padding:13px;
    border:1px solid rgba(255,255,255,.82);
    border-radius:20px;
    background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(235,246,252,.94));
    box-shadow:0 24px 62px rgba(25,57,84,.24),inset 0 1px #fff;
    backdrop-filter:blur(26px) saturate(145%);
    -webkit-backdrop-filter:blur(26px) saturate(145%);
  }
  .mobile-more-sheet > header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:2px 2px 11px; border-bottom:1px solid rgba(75,116,148,.13); }
  .mobile-more-sheet > header > div { display:grid; grid-template-columns:34px minmax(0,1fr); gap:9px; align-items:center; min-width:0; }
  .mobile-more-sheet > header > div > span { display:grid; place-items:center; width:34px; height:34px; color:#fff; background:linear-gradient(145deg,#1d537f,#133b62); border-radius:50%; font-size:10px !important; font-weight:850; }
  .mobile-more-sheet > header strong,.mobile-more-sheet > header small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .mobile-more-sheet > header strong { color:#173f67; font-size:11px; }
  .mobile-more-sheet > header small { margin-top:2px; color:#6d8396; font-size:8px !important; }
  .mobile-more-sheet > header button { width:34px; height:34px; border:0; border-radius:50%; color:#5f7689; background:rgba(234,243,249,.86); font-size:19px; }
  .mobile-more-sheet > nav { display:grid; gap:5px; padding:9px 0; }
  .mobile-more-sheet > nav button { display:grid; grid-template-columns:34px minmax(0,1fr) auto; gap:9px; align-items:center; min-height:52px; padding:7px 9px; border:0; border-radius:13px; color:#294f6b; background:rgba(255,255,255,.58); text-align:left; }
  .mobile-more-sheet > nav button.active { background:#e5f2fb; }
  .mobile-more-sheet > nav button > span { display:grid; place-items:center; width:32px; height:32px; color:#176cae; background:#edf7fd; border-radius:10px; font-size:16px !important; }
  .mobile-more-sheet > nav button strong,.mobile-more-sheet > nav button small { display:block; }
  .mobile-more-sheet > nav button strong { font-size:11px; }
  .mobile-more-sheet > nav button small { margin-top:2px; color:#718697; font-size:8px !important; }
  .mobile-more-sheet > nav button b { color:#7b91a2; font-size:17px; }
  .mobile-more-sheet > a { display:block; padding:9px; color:#9a514a; border-top:1px solid rgba(75,116,148,.13); font-size:10px; font-weight:800; text-align:center; text-decoration:none; }

  /* Compact page headings keep their main action visible. */
  .page-header {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center !important;
    gap:8px !important;
    margin-bottom:13px !important;
  }
  .page-header > div:first-child { min-width:0; }
  .page-header .eyebrow { display:none; }
  .page-header h1 { margin:0 !important; font-size:22px !important; line-height:1.05; }
  .page-header p { max-width:100%; margin-top:4px !important; font-size:9px !important; line-height:1.35 !important; }
  .page-header .top-actions { display:flex !important; min-width:0; gap:5px; justify-content:flex-end; }
  .page-header .top-actions .primary-button { display:inline-flex !important; align-items:center; justify-content:center; }
  .page-header .top-actions > button,
  .page-header .inventory-header-actions > button { min-height:40px; padding:8px 10px !important; font-size:9px !important; white-space:nowrap; }
  .page-header .inventory-header-actions { display:flex; justify-content:flex-end; gap:5px; }
  .page-header .inventory-header-actions .primary-button { order:-1; }
  .page-header .inventory-header-actions .secondary-button { display:none; }
  .section-heading { align-items:center; gap:8px; margin-bottom:9px !important; }
  .section-heading h2 { margin-bottom:2px; font-size:15px !important; }
  .section-heading p { font-size:8px !important; }

  /* Dashboard: short summaries, no empty exercise dates. */
  .dashboard-three-column { gap:9px !important; }
  .dashboard-dose-link { min-height:52px; margin-bottom:5px; padding:5px 8px; }
  .dashboard-dose-date { width:36px; height:40px; }
  .dashboard-exercise-column { padding:10px !important; border-radius:14px; }
  .dashboard-exercise-column > header { margin-bottom:0 !important; }
  .dashboard-exercise-column > header h2 { font-size:14px; }
  .dashboard-exercise-column > header button { min-height:38px; padding:7px 9px !important; }
  .dashboard-exercise-list { margin-top:8px; }
  .exercise-day:not(:has(article)),
  .dashboard-exercise-list:not(:has(article)) { display:none !important; }
  .exercise-day { min-height:40px; padding:5px; }
  .dashboard-health-card { padding:10px !important; }
  .dashboard-weight-line svg { height:88px !important; }
  .right-column > .dashboard-mini-calendar { min-height:218px; padding:10px !important; }
  .dashboard-mini-calendar > header { margin-bottom:6px; }

  /* Inventory stays side-by-side inside each short, one-column tile. */
  .unified-inventory-grid { grid-template-columns:1fr !important; gap:8px !important; margin:8px 0 16px !important; }
  .unified-inventory-tile,.unified-water-tile { width:100% !important; border-radius:15px !important; }
  .unified-inventory-tile > header { padding:7px 9px 6px !important; }
  .unified-inventory-tile > header h2 { margin-bottom:0 !important; font-size:14px !important; }
  .coverage-pill { margin-top:2px; padding:3px 5px; font-size:6px !important; }
  .unified-tile-body,.unified-water-tile { grid-template-columns:1fr 1fr !important; }
  .unified-tile-body > section,.unified-water-tile > section { min-width:0; padding:6px !important; gap:2px !important; }
  .unified-tile-body > section + section,.unified-water-tile > section + section { border-top:0 !important; border-left:1px solid rgba(61,122,158,.16) !important; }
  .unified-tile-body .vial-amount-graphic,.unified-water-tile .vial-amount-graphic { height:58px !important; margin:-39px 0 !important; transform:scale(.35) !important; }
  .unified-tile-body strong,.unified-water-tile strong { font-size:9px !important; }
  .unified-tile-body small,.unified-water-tile small { font-size:7px !important; line-height:1.25 !important; }
  .tile-empty { min-height:58px !important; gap:2px; }
  .tile-empty span { font-size:16px !important; }
  .inventory-vial-actions { margin-top:3px; gap:3px !important; }
  .inventory-vial-actions button,.stored-half .primary-button,.unified-water-tile section > button { min-height:36px !important; padding:6px !important; font-size:8px !important; }
  .water-unified-section { margin-top:4px; }
  .water-unified-section .section-heading > button { min-height:38px; padding:7px 9px; font-size:8px; }
  .compact-water-row { padding:7px 0 !important; }
  .diluent-note { margin:8px 1px; font-size:7px !important; line-height:1.4 !important; }

  /* Other high-use phone surfaces. */
  .today-calendar-layout { display:grid !important; grid-template-columns:1fr !important; gap:10px !important; }
  .today-calendar-layout > .schedule-search-panel { order:-1; }
  .month-nav { padding:11px !important; }
  .month-weekdays { padding:8px 6px 4px !important; }
  .month-grid { gap:2px !important; padding:3px 6px 7px !important; }
  .month-grid > button { min-height:48px !important; padding:5px !important; }
  .day-detail-card { padding:11px !important; }
  .protocol-card-large { padding:11px !important; border-radius:14px !important; }
  .protocol-card-large > header { grid-template-columns:34px minmax(0,1fr) !important; gap:8px !important; }
  .protocol-card-actions { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:5px; }
  .protocol-card-actions button { min-height:36px; }
  .protocol-stats { grid-template-columns:1fr 1fr !important; gap:5px !important; margin-top:10px !important; }
  .protocol-stats > div { padding:7px !important; }
  .phase-timeline-row { gap:5px !important; padding:8px 4px !important; }
  .symptom-log-card { padding:11px !important; }
  .evidence-library-layout > .library-list { height:min(62dvh,560px) !important; margin-bottom:9px !important; }
  .evidence-library-layout:has(> .library-detail) > .library-list { display:none !important; }
  .evidence-library-layout > .library-detail { margin-bottom:calc(78px + env(safe-area-inset-bottom, 0px)); }
  .evidence-product-header,.evidence-content,.practical-peptide-summary { padding-left:12px !important; padding-right:12px !important; }
  .modal-backdrop { align-items:end; padding:8px; overflow:hidden; }
  .modal { width:100%; max-height:calc(100dvh - 16px - env(safe-area-inset-top, 0px)); overscroll-behavior:contain; padding:16px 13px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius:19px 19px 12px 12px; }
  .modal input,.modal select,.modal textarea,.autocomplete input { font-size:16px !important; }
  .form-grid { grid-template-columns:1fr; gap:10px; }
  .form-grid > * { grid-column:1 !important; }
}

@media (max-width:420px) {
  .page-header p { display:none; }
  .page-header h1 { font-size:20px !important; }
  .page-header .top-actions > button,.page-header .inventory-header-actions > button { padding-inline:9px !important; }
  .protocol-shelf-tabs { width:100%; }
  .protocol-shelf-tabs button { flex:1; justify-content:center; }
}
