/* 작은 화면에서 각 구획의 내용이 자연스럽게 차지하는 크기를 유지한다. */
@media (max-width: 360px) {
  #goalsStickySubnav {
    flex-wrap: wrap !important;
    overflow: visible !important;
    white-space: normal !important;
  }
  #goalsStickySubnav > .goals-subtab-chip,
  #goalsMoreTabs .goals-subtab-chip {
    flex: 0 0 auto;
    min-width: 44px !important;
    min-height: 44px !important;
    white-space: nowrap;
  }
  #goalsMoreTabs {
    max-width: 100%;
  }
  #goalsHeadlineSentence,
  #recHeadlineSentence {
    min-width: 0;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere;
    text-overflow: clip !important;
  }
  #goalsHeadlineSentence {
    margin-top: var(--header-height, 52px) !important;
  }
  #sPeerRadarCard .s-radar-head {
    flex-wrap: wrap;
  }
  #sPeerRadarCard .s-radar-title {
    min-width: 0;
    flex-wrap: wrap;
  }
  #quickCheckinChips {
    min-width: 0;
    flex-wrap: wrap;
    overflow: visible;
  }
  #captureCardBox #quickCheckinChips .cunning-chips-wrap {
    flex-wrap: wrap;
    overflow: visible;
  }
  #captureCardBox #quickCheckinChips .btn-quick-chip {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #recQuickDockBar {
    flex-wrap: wrap;
    overflow-x: visible !important;
  }
  #recQuickDockBar > button {
    flex: 0 0 auto;
    max-width: 100%;
  }
  #commFeedCatBar,
  #screen-comm .feed-filter-bar:has([data-feedcat]) {
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
  }
  #commFeedCatBar > *,
  #screen-comm .feed-filter-bar > [data-feedcat] {
    flex: 0 0 auto;
  }
  #settingsAdvancedSection summary,
  #setGroupDataSummary {
    flex-wrap: wrap;
  }
  #settingsAdvancedSection summary > :first-child,
  #setGroupDataSummary > :first-child {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
  }
  #settingsAdvancedSection summary > :first-child > div,
  #setGroupDataSummary > :first-child > div {
    min-width: 0;
  }
  #settingsAdvancedSection summary > :first-child > div > span:last-child,
  #setGroupDataSummary > :first-child > div > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  #settingsAdvancedSection summary > :last-child,
  #setGroupDataSummary > :last-child {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}


/* ── C178 홈 정돈 (체크인 하나에 집중 · 글자 크기 4종 · 겹침 0 · 더보기 접기) ── */
#screen-home {
  --home-fs-20: max(12px, calc(20px * var(--app-font-scale, 1)));
  --home-fs-16: max(12px, calc(16px * var(--app-font-scale, 1)));
  --home-fs-14: max(12px, calc(14px * var(--app-font-scale, 1)));
  --home-fs-12: max(12px, calc(12.5px * var(--app-font-scale, 1)));
  --home-gap: 8px;
  --home-gap-sm: 6px;
  --home-gap-xs: 4px;
  --home-pad: 12px 14px;
  --home-row-pad: 10px 12px;
  --home-btn-pad: 0 12px;
  --home-touch: 44px;
  --home-mt: 10px;
  --home-mt-sm: 4px;
}

#appShell:has(#screen-home.active) > .topbar {
  display: none;
}

#screen-home #sanctuaryAvatarBadge,
#screen-home .home-head-row,
#screen-home #homeHeadlineSentence,
#screen-home #levelBadgeRow,
#screen-home #homeGrassSummaryCard,
#screen-home #quickCheckinChips,
#screen-home #captureCardBox #quickCheckinChips,
#screen-home #smartRecommendChips,
#screen-home #captureCardBox #smartRecommendChips,
#screen-home #dimensionAccordion,
#screen-home #captureCardBox #dimensionAccordion,
#screen-home .offline-banner,
#screen-home .first-checkin-tutorial-banner {
  display: none;
}

#screen-home .first-checkin-tutorial-banner {
  margin-bottom: var(--home-mt);
  background: var(--brand-soft);
  border: var(--card-border);
  border-radius: var(--radius);
  padding: var(--home-pad);
  position: relative;
}
#screen-home .first-checkin-tutorial-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--home-gap); }
#screen-home .first-checkin-tutorial-left { display: flex; align-items: center; gap: var(--home-gap); }
#screen-home .first-checkin-tutorial-emoji { font-size: var(--home-fs-20); }
#screen-home .first-checkin-tutorial-title { font-size: var(--home-fs-14); font-weight: 800; color: var(--brand); }
#screen-home .first-checkin-tutorial-desc { font-size: var(--home-fs-12); color: var(--ink-soft); line-height: 1.4; }
#screen-home .first-checkin-tutorial-close { background: none; border: 0; color: var(--ink-faint); cursor: pointer; padding: 0; }
#screen-home .hero-avatar-exp-gain { font-size: var(--home-fs-12); }

#screen-home .sanctuary-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--home-mt-sm);
}

#screen-home #homeHeroAvatarCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--home-gap-sm);
  margin: 0 0 var(--home-mt);
  padding: var(--home-pad);
}

#screen-home #homeHeroAvatarBubble {
  font-size: var(--home-fs-14);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.4;
}

#screen-home .hero-avatar-meta {
  font-size: var(--home-fs-12);
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.4;
}

#screen-home .home-today-goals-card {
  margin: var(--home-mt) 0;
  padding: var(--home-pad);
  border-radius: var(--radius);
  border: var(--card-border);
  background: var(--card);
}

#screen-home .home-today-goals-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--home-gap);
}

#screen-home .home-today-goals-title { font-size: var(--home-fs-20); font-weight: 800; color: var(--ink); line-height: 1.3; } #screen-home .home-today-goals-head-btn { display: inline-flex; align-items: center; gap: var(--home-gap-sm); padding: 0; border: 0; background: none; cursor: pointer; } #screen-home .home-today-goals-title-ignore {
  font-size: var(--home-fs-20);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

#screen-home .home-today-goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--home-gap);
  margin-top: var(--home-gap);
  padding: var(--home-row-pad);
  border-radius: var(--radius-sm);
  border: var(--card-border);
  background: var(--bg);
}

#screen-home .home-today-goal-info {
  min-width: 0;
  flex: 1;
}

#screen-home .home-today-goal-name {
  font-size: var(--home-fs-16);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

#screen-home .home-today-goal-sub {
  font-size: var(--home-fs-12);
  color: var(--ink-soft);
  margin-top: var(--home-mt-sm);
  line-height: 1.4;
}

#screen-home .home-today-goal-check,
#screen-home #btnHomeEmptyAddGoal, #screen-home #homeAddGoal {
  min-height: var(--home-touch);
  padding: var(--home-btn-pad);
  font-size: var(--home-fs-14);
  font-weight: 700;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

#screen-home .compass-fold {
  margin: var(--home-mt) 0;
  border-radius: var(--radius);
  border: var(--card-border);
  background: var(--card);
}

#screen-home .compass-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--home-touch);
  padding: var(--home-row-pad);
  font-size: var(--home-fs-14);
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
}

#screen-home .compass-fold > summary::-webkit-details-marker {
  display: none;
}

#screen-home .compass-fold-arrow {
  font-size: var(--home-fs-12);
  color: var(--ink-faint);
}

#screen-home .compass-fold:not([open]) .compass-fold-body {
  display: none;
}

#screen-home .compass-fold-body {
  padding: 0 var(--space-3) var(--space-3);
  border-top: var(--card-border);
}

#screen-home .home-compass-label,
#screen-home .home-actions .btn {
  font-size: var(--home-fs-14);
}

#screen-home .home-compass-sub,
#screen-home .home-compass-ico {
  font-size: var(--home-fs-12);
}

/* 동반자 레이스 위젯 및 콜드스타트 온보딩 카드 (#crewPacingWidget · #userCrewColdStartBox) */
#screen-home .crew-pacing-widget,
#homeSheetPanelCrew .crew-pacing-widget {
  margin: var(--home-mt) 0;
  padding: var(--home-pad);
  border-radius: var(--radius);
  background: var(--card);
  border: var(--card-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

#screen-home .crew-head,
#homeSheetPanelCrew .crew-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--home-gap-sm);
}

#screen-home .crew-head-l,
#homeSheetPanelCrew .crew-head-l {
  display: flex;
  align-items: center;
  gap: var(--home-gap);
}

#screen-home .crew-badge,
#homeSheetPanelCrew .crew-badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--brand);
  font-size: var(--home-fs-12);
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

#screen-home .crew-headline-row,
#homeSheetPanelCrew .crew-headline-row {
  font-size: var(--home-fs-14);
  font-weight: 600;
  color: var(--ink);
  margin: var(--home-gap-xs) 0;
}

#screen-home .crew-track,
#homeSheetPanelCrew .crew-track {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: var(--home-gap-sm) 0 var(--home-gap);
}

#screen-home .crew-fill,
#homeSheetPanelCrew .crew-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #10B981, #06B6D4);
  border-radius: 999px;
  transition: width 0.4s ease;
}

#screen-home .crew-foot,
#homeSheetPanelCrew .crew-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--home-fs-12);
  color: var(--ink-soft);
  flex-wrap: wrap;
  gap: var(--home-gap);
}

#screen-home .crew-foot-actions,
#homeSheetPanelCrew .crew-foot-actions {
  display: flex;
  gap: var(--home-gap);
}

/* 콜드스타트 상자는 기본 display:none (JS가 활성화 시 style.display='flex'로 켬) */
#screen-home #userCrewColdStartBox,
#homeSheetPanelCrew #userCrewColdStartBox,
.crew-coldstart-box {
  display: none;
  margin-top: var(--home-mt);
  padding: var(--home-row-pad);
  background: rgba(16, 185, 129, 0.05);
  border: 1px dashed rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: space-between;
  gap: var(--home-gap);
}

.crew-coldstart-left {
  display: flex;
  align-items: center;
  gap: var(--home-gap);
  font-size: var(--home-fs-12);
  color: var(--ink-soft);
  line-height: 1.4;
}

.crew-coldstart-icon {
  font-size: var(--home-fs-16);
  flex-shrink: 0;
}

.crew-coldstart-btn {
  flex-shrink: 0;
  background: var(--brand);
  color: #ffffff;
  font-size: var(--home-fs-12);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: none;
  min-height: 34px;
  cursor: pointer;
}

/* 평가 배너 (#homeEvalBanner · C090 의견 보내기) */
#screen-home #homeEvalBanner,
#homeSheetPanelQuest #homeEvalBanner,
.home-eval-banner-box {
  margin-top: 18px;
  margin-bottom: 14px;
}

.home-eval-banner-inner {
  background: var(--card2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--home-pad);
  display: flex;
  flex-direction: column;
  gap: var(--home-gap);
}

.home-eval-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--home-gap);
}

.home-eval-banner-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--home-gap);
}

.home-eval-banner-icon {
  font-size: var(--home-fs-20);
}

.home-eval-banner-title {
  font-weight: 700;
  font-size: var(--home-fs-16);
  color: var(--ink);
}

#btnOpenEvalModal {
  font-size: var(--home-fs-12);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.home-eval-banner-sub {
  margin: 0;
  font-size: var(--home-fs-12);
  line-height: 1.45;
}

.home-eval-banner-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--rule);
  padding-top: var(--home-gap);
  font-size: var(--home-fs-12);
  color: var(--ink-faint);
}

/* hidden 속성이 적용된 요약 알약 및 퀘스트 상자 숨김 보장 */
#screen-home #todayGlancePill[hidden],
#screen-home #dailyQuestBarWrap[hidden],
#homeSheetPanelQuest #todayGlancePill[hidden],
#homeSheetPanelQuest #dailyQuestBarWrap[hidden],
.today-glance-pill[hidden],
.daily-quest-bar-wrap[hidden] {
  display: none;
}

