/* ShardsDiet 3.3.7 - mobile diet workflow + secure client report UI. */

/* Client report action/dialog (desktop + mobile). */
.sdClientReportAction{white-space:nowrap}
.sdClientReportMobileAction{width:100%;margin-top:10px}
.sdClientReportSelector{display:grid;gap:14px}
.sdClientReportIntro{margin:0;color:var(--muted);font-size:13px;line-height:1.5}
.sdClientReportChoices{display:grid;gap:9px}
.sdClientReportChoice{display:grid;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:11px;min-height:54px;padding:11px 13px;border:1px solid var(--stroke);border-radius:16px;background:#fbfefd;cursor:pointer;text-transform:none;letter-spacing:0;color:var(--text)}
.sdClientReportChoice:hover{border-color:#a9dcd3;background:#f6fffc}
.sdClientReportChoice input{width:20px;height:20px;min-height:20px;margin:0;accent-color:#00b98b}
.sdClientReportChoice span{display:grid;gap:3px}
.sdClientReportChoice b{font-size:13px}
.sdClientReportChoice small{color:var(--muted);font-size:10px;line-height:1.35}
.sdClientReportSelectAll{background:#f1fbff;border-color:#cae9f2}
.sdClientReportSelection{min-height:38px;padding:9px 11px;border-radius:13px;background:#f2f7f8;color:#4f6675;font-size:11px;font-weight:800;line-height:1.45}
.sdClientReportSelection strong{color:var(--text)}
.sdClientReportError{display:none;padding:9px 11px;border:1px solid #ffd0d5;border-radius:12px;background:#fff5f6;color:#a72a3a;font-size:11px;font-weight:800}
.sdClientReportError.show{display:block}
.sdClientReportButtons{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap}
.sdClientReportButtons .btn[disabled]{opacity:.45;cursor:not-allowed}

/* Favorite star: true geometric centering instead of relying on font baseline. */
.sdFavoriteFoodBtn{display:grid!important;place-items:center!important;padding:0!important;line-height:1!important;overflow:hidden}
.sdFavoriteFoodBtn svg{display:block;width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round;pointer-events:none}
.sdFavoriteFoodBtn.active svg{fill:currentColor}

@media (max-width:820px){
  html,body{max-width:100%;overflow-x:hidden}

  /* One-day-at-a-time builder navigation. */
  .sdMobileDayNavigator{position:sticky;top:calc(var(--mobile-header-space,76px) + 1px);z-index:36;margin:10px -14px 13px;padding:9px 14px 10px;background:linear-gradient(180deg,rgba(247,252,253,.99) 84%,rgba(247,252,253,.96));border-top:1px solid rgba(217,232,232,.75);border-bottom:1px solid rgba(217,232,232,.9);box-shadow:0 8px 22px rgba(18,32,51,.06);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
  .sdMobileDayTabs{display:flex;gap:7px;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;padding:1px 1px 4px;scrollbar-width:none;overscroll-behavior-x:contain;touch-action:pan-x;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
  .sdMobileDayTabs::-webkit-scrollbar{display:none}
  .sdMobileDayTab{position:relative;flex:0 0 auto;min-width:58px;height:44px;padding:5px 12px;border:1px solid #d8e6e7;border-radius:14px;background:#fff;color:#5b6f7d;font-size:11px;font-weight:950;letter-spacing:.025em;box-shadow:none;scroll-snap-align:center}
  .sdMobileDayTab.active{border-color:#0fae8d;background:#eafff8;color:#087a66;box-shadow:0 5px 15px rgba(0,185,139,.11)}
  .sdMobileDayTab .sdDayStateDot{position:absolute;top:6px;right:7px;width:6px;height:6px;border-radius:999px;border:1px solid currentColor;background:transparent;opacity:.75}
  .sdMobileDayTab[data-state="complete"] .sdDayStateDot{background:#5c7b75;border-color:#5c7b75}
  .sdMobileDayTab[data-state="outside"] .sdDayStateDot{background:#d69a38;border-color:#d69a38}
  .sdMobileDayTab[data-state="free"] .sdDayStateDot{background:#7392a4;border-color:#7392a4}
  .sdMobileDayTab[data-state="incomplete"] .sdDayStateDot{background:#fff;border-color:#9caeb7}
  .sdMobileDayStepper{display:grid;grid-template-columns:42px minmax(0,1fr) 42px;align-items:center;gap:8px;margin-top:7px}
  .sdMobileDayStepBtn{width:42px;height:38px;padding:0;border:1px solid #d8e6e7;border-radius:12px;background:#fff;color:#294456;font-size:21px;line-height:1;display:grid;place-items:center}
  .sdMobileDayStepBtn:disabled{opacity:.35}
  .sdMobileDayCurrent{text-align:center;min-width:0}
  .sdMobileDayCurrent b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--text)}
  .sdMobileDayCurrent small{display:block;margin-top:2px;color:var(--muted);font-size:8px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}
  .dietDay[hidden]{display:none!important}
  .builderGrid>.panel:first-child{overflow:visible!important}
  #summaryPanel.sdMobileSingleDayAnalysis{min-width:0!important;overflow:hidden}
  #summaryPanel.sdMobileSingleDayAnalysis .analysisPanelHeader{align-items:flex-start;gap:10px}
  #summaryPanel.sdMobileSingleDayAnalysis .analysisPanelHeader h3{font-size:14px;line-height:1.25}
  #summaryPanel.sdMobileSingleDayAnalysis .analysisAccordion>details{display:block}
  #summaryPanel.sdMobileSingleDayAnalysis .nutrientTable,.sdMobileSingleDayAnalysis table{max-width:100%;width:100%}

  /* Fast quantity editor. */
  .item .sdQuickQtyTrigger{width:76px;min-width:76px;min-height:43px;padding:5px 7px;border:1px solid #cfe2e1;border-radius:12px;background:#f7fcfb;color:#173347;display:grid;place-items:center;gap:0;line-height:1;box-shadow:none}
  .item .sdQuickQtyTrigger b{font-size:13px;line-height:1.1}
  .item .sdQuickQtyTrigger small{font-size:8px;color:#6b7d89;line-height:1}
  .sdQuickQtySheet{display:grid;gap:14px}
  .sdQuickQtyFood{padding:11px 12px;border:1px solid var(--stroke);border-radius:14px;background:#f8fbfc}
  .sdQuickQtyFood b{display:block;color:var(--text);font-size:13px}
  .sdQuickQtyFood small{display:block;margin-top:4px;color:var(--muted);font-size:9px;line-height:1.35}
  .sdQuickQtyGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
  .sdQuickQtyDelta{min-width:0;height:44px;padding:0 5px;border:1px solid #d5e5e5;border-radius:13px;background:#fff;color:#244354;font-size:12px;font-weight:950}
  .sdQuickQtyInputWrap{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px 11px;border:1px solid #bcded8;border-radius:15px;background:#fff;scroll-margin-bottom:130px}
  .sdQuickQtyInputWrap input{width:100%;min-width:0;height:46px;padding:8px 2px;border:0!important;box-shadow:none!important;background:transparent!important;text-align:center;font-size:20px!important;font-weight:950;color:var(--text);appearance:textfield;-moz-appearance:textfield}
  .sdQuickQtyInputWrap input::-webkit-inner-spin-button,.sdQuickQtyInputWrap input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
  .sdQuickQtyInputWrap span{font-size:13px;font-weight:900;color:#617684}
  .sdQuickQtyHint{margin:0;color:var(--muted);font-size:9px;line-height:1.4;text-align:center}
  .mobileBottomSheetCard .sdQuickQtySheet{padding-bottom:max(4px,env(safe-area-inset-bottom))}

  /* Client report bottom-sheet accessibility and safe-area spacing. */
  .mobileClientHeader .sdClientReportMobileAction{grid-column:1/-1}
  .sdClientReportSelector{padding-bottom:max(4px,env(safe-area-inset-bottom))}
  .sdClientReportChoice{min-height:58px}
  .sdClientReportButtons{display:grid;grid-template-columns:1fr 1fr;position:sticky;bottom:0;margin:3px -2px -3px;padding:10px 2px calc(4px + env(safe-area-inset-bottom));background:linear-gradient(180deg,rgba(255,255,255,.76),#fff 26%);z-index:2}
  .sdClientReportButtons .btn{width:100%;min-width:0}

  /* Mobile picker: keep the favorite action aligned inside its own rail. */
  .sdFoodPickerEntry{grid-template-columns:minmax(0,1fr) 48px!important;gap:7px!important;align-items:stretch!important}
  .sdFavoriteFoodBtn{width:48px!important;min-width:48px!important;height:auto!important;min-height:100%!important;align-self:stretch!important;border-radius:14px!important}
  .sdFavoriteFoodBtn svg{width:25px;height:25px}
}

@media (max-width:360px){
  .sdMobileDayNavigator{margin-left:-10px;margin-right:-10px;padding-left:10px;padding-right:10px}
  .sdMobileDayTab{min-width:52px;padding-left:9px;padding-right:9px;font-size:10px}
  .sdQuickQtyGrid{gap:5px}
  .sdQuickQtyDelta{font-size:11px}
  .item .sdQuickQtyTrigger{width:68px;min-width:68px}
}
