/* 탭talk — Toss 스타일 디자인 시스템
   참고: Toss 모바일 앱 따라그리기(Figma Community, 무료)
   토큰: Toss Blue, Pretendard, 큰 볼드 숫자, 16~20px 라운드 카드, 넉넉한 여백 */
:root {
  --blue: #3182f6;
  --blue-dark: #1b64da;
  --blue-soft: #e8f3ff;
  --green: #00c73c;
  --orange: #ff8a3d;
  --red: #f04452;

  --gray900: #191f28;
  --gray700: #4e5968;
  --gray600: #6b7684;
  --gray500: #8b95a1;
  --gray300: #d1d6db;
  --gray200: #e5e8eb;
  --gray100: #f2f4f6;
  --bg: #f2f4f6;
  --white: #ffffff;

  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--gray900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 20px 40px;
  min-height: 100vh;
}

/* 모바일 퍼스트: 기본은 단일 컬럼(히어로 → 보조 카드 세로 스택) */
.layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.side-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 태블릿 이상: 메인(히어로)은 왼쪽 고정, 보조 카드는 오른쪽 */
@media (min-width: 900px) {
  .app {
    max-width: 980px;
    padding: 8px 28px 56px;
  }
  .layout {
    display: grid;
    grid-template-columns: minmax(340px, 400px) 1fr;
    align-items: start;
    gap: 20px;
  }
  .hero-card {
    position: sticky;
    top: 16px;
  }
}

/* 와이드: 보조 카드를 2열로 펼쳐 중앙 메인을 좌우에서 감싸는 배치 */
@media (min-width: 1240px) {
  .app {
    max-width: 1200px;
  }
  .layout {
    grid-template-columns: minmax(360px, 420px) 1fr;
  }
  .side-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
  }
  .side-col > .briefing-card {
    grid-column: 1 / -1;
  }
}

/* 헤더 */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
}
.brand-mark svg {
  width: 24px;
  height: 24px;
}

.tone-face {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.tone-face .mascot-svg {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

/* 집중 브리핑 신뢰도 텍스트 */
.summary-num.conf {
  font-size: 22px;
  color: var(--gray700);
}

.header-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ext-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--gray100);
  color: var(--gray500);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.ext-badge[data-on="true"] {
  background: #e6f9ee;
  color: #00a32f;
}

.ghost-pill {
  border: 0;
  background: var(--gray100);
  color: var(--gray600);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.ghost-pill:active {
  background: var(--gray200);
}

/* 히어로 카드 */
.hero-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  transition: background 0.4s ease;
}

.hero-card.is-focus {
  background: linear-gradient(180deg, #f5faff, #ffffff);
}

.hero-card.is-distract {
  background: linear-gradient(180deg, #fff6f0, #ffffff);
}

/* ---- 넛지 팝업 하단 버튼 ---- */
.nudge-tag-row {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.hero-card.is-distract .nudge-tag-row {
  display: flex;
}
.nudge-tag-btn {
  border: 1.5px solid var(--gray200, #e5e8eb);
  border-radius: 999px;
  background: #fff;
  color: var(--gray700, #4e5968);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.nudge-tag-btn:hover {
  background: var(--blue, #3182f6);
  border-color: var(--blue, #3182f6);
  color: #fff;
}
.nudge-tag-btn--wide {
  font-size: 11px;
  padding: 7px 12px;
}

/* 마스코트 탭이 (진행 링 중앙) */
.mascot {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 6px;
}
.mascot-svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  animation: mascotFloat 3.2s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-1.5deg); }
}
/* 몰입 중 숨쉬기 펄스 / 딴짓 중 흔들림 (마스코트에 직접) */
.hero-card.is-focus .mascot-svg {
  animation: mascotBreathe 2.6s ease-in-out infinite;
}
@keyframes mascotBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.04); }
}
.hero-card.is-distract .mascot-svg {
  animation: mascotWiggle 0.9s ease-in-out infinite;
}
@keyframes mascotWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-7deg); }
  75% { transform: rotate(7deg); }
}
/* 성공 축하 */
.mascot.celebrate .mascot-svg {
  animation: mascotJump 0.6s ease 2;
}
@keyframes mascotJump {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-18px) scale(1.06); }
  60% { transform: translateY(0) scale(0.97); }
}
.spark {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--orange);
  opacity: 0;
  pointer-events: none;
}
.spark-1 { top: 4px; left: 12px; background: #ffd23f; }
.spark-2 { top: 10px; right: 10px; background: var(--blue); }
.spark-3 { bottom: 22px; left: 6px; background: var(--green); }
.spark-4 { bottom: 14px; right: 8px; background: #ff6b76; }
.mascot.celebrate .spark {
  animation: sparkPop 0.85s ease forwards;
}
.mascot.celebrate .spark-2 { animation-delay: 0.08s; }
.mascot.celebrate .spark-3 { animation-delay: 0.16s; }
.mascot.celebrate .spark-4 { animation-delay: 0.24s; }
@keyframes sparkPop {
  0% { opacity: 0; transform: scale(0.4) translateY(0) rotate(0deg); }
  40% { opacity: 1; transform: scale(1.2) translateY(-14px) rotate(45deg); }
  100% { opacity: 0; transform: scale(0.6) translateY(-26px) rotate(120deg); }
}

/* 다른 탭에서도 띄우기 (PiP) 버튼 */
.pip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray600);
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
}
.pip-btn svg { width: 16px; height: 16px; }
.pip-btn:hover { color: var(--blue); background: var(--gray100); }
.pip-btn.is-on { color: var(--blue); background: var(--blue-soft); }

/* 카메라 집중 감지 */
.cam-btn.is-on { color: var(--green); background: rgba(0, 199, 60, 0.1); }
.cam-preview {
  margin: 12px auto 0;
  width: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cam-preview[hidden] { display: none; }
.cam-preview video {
  width: 168px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--gray900);
  transform: scaleX(-1); /* 거울 모드 */
  box-shadow: var(--shadow);
}
.cam-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray600);
}
.cam-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray300);
}
.cam-dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(0, 199, 60, 0.18); }
.cam-dot.warn { background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.2); }
.cam-dot.loading, .cam-dot.idle { background: var(--blue); }
/* 시선 이탈 시 캐릭터 반응 (탭은 안 바뀌어도 딴짓 감지) */
.hero-card.gaze-away .hero-ring { --ring: var(--orange); }
.hero-card.gaze-away .mascot-svg { animation: mascotWiggle 0.9s ease-in-out infinite; }

.hero-status-chip {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray600);
  background: var(--gray100);
  padding: 6px 14px;
  border-radius: 999px;
}

.hero-card.is-focus .hero-status-chip {
  color: var(--blue);
  background: var(--blue-soft);
}

.hero-card.is-distract .hero-status-chip {
  color: var(--orange);
  background: #ffeee2;
}

.hero-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  margin: 16px auto 10px;
  border-radius: 50%;
  background: var(--gray100);
  color: var(--gray500);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.hero-emoji svg {
  width: 46px;
  height: 46px;
  stroke-width: 1.9;
}
.hero-card.is-focus .hero-emoji {
  color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 8px 22px rgba(49, 130, 246, 0.22);
}
.hero-card.is-distract .hero-emoji {
  color: var(--orange);
  background: #fff1e6;
  box-shadow: 0 8px 22px rgba(255, 138, 61, 0.22);
}

/* 진행 링 (목표 25분 대비 실시간 채움) */
.hero-ring {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 16px auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--ring, var(--gray300)) calc(var(--p, 0) * 1%), var(--gray200) 0);
  transition: background 0.3s linear;
}
.hero-ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--white);
}
.hero-ring .mascot {
  position: relative;
  z-index: 1;
  width: 86px;
  height: 86px;
  margin: 0;
}
.hero-ring.is-active {
  --ring: var(--blue);
}
.hero-card.is-distract .hero-ring {
  --ring: var(--orange);
}
.hero-ring.pop {
  animation: ringPop 0.5s ease;
}
@keyframes ringPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.07); }
  100% { transform: scale(1); }
}

/* 5분마다 한 뼘씩 자라는 캐릭터 (레벨 숫자 대신 '성장' 연출) */
.mascot {
  transform: scale(var(--grow, 1));
  transform-origin: 50% 86%;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-ring .mascot {
  transform: scale(var(--grow, 1));
}
.mascot[data-grow="1"] .mascot-svg { filter: drop-shadow(0 0 4px rgba(49, 130, 246, 0.35)); }
.mascot[data-grow="2"] .mascot-svg { filter: drop-shadow(0 0 6px rgba(49, 130, 246, 0.45)); }
.mascot[data-grow="3"] .mascot-svg { filter: drop-shadow(0 0 8px rgba(0, 199, 60, 0.5)); }
.mascot[data-grow="4"] .mascot-svg { filter: drop-shadow(0 0 10px rgba(0, 199, 60, 0.6)); }
.mascot[data-grow="5"] .mascot-svg { filter: drop-shadow(0 0 13px rgba(255, 138, 61, 0.65)); }
.mascot[data-grow="6"] .mascot-svg { filter: drop-shadow(0 0 16px rgba(255, 178, 63, 0.8)); }
/* 4분·10분 업그레이드 — 성장 글로우보다 우선(뒤에 선언). 1단계 파란 글로우, 2단계 금빛 글로우 */
.mascot[data-upgrade="1"] .mascot-svg {
  filter: drop-shadow(0 0 10px rgba(49, 130, 246, 0.6));
}
.mascot[data-upgrade="2"] .mascot-svg {
  filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.7)) drop-shadow(0 0 16px rgba(255, 138, 61, 0.7));
  animation: mascotUpgrade 2.4s ease-in-out infinite;
}
@keyframes mascotUpgrade {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(1.5deg); }
}
/* 목표 달성 시 만개 연출 */
.mascot.bloom .mascot-svg {
  animation: mascotBloom 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255, 178, 63, 0.85));
}
@keyframes mascotBloom {
  0%, 100% { transform: translateY(0) scale(1.02); }
  50% { transform: translateY(-4px) scale(1.07); }
}

/* 목표 선택 */
.goal-row {
  max-width: 280px;
  margin: 12px auto 0;
  text-align: center;
}
.goal-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray600);
  margin-bottom: 6px;
}
.goal-chips {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.goal-chip {
  flex: 1;
  padding: 7px 0;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray200);
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray700);
  cursor: pointer;
  transition: all 0.15s ease;
}
.goal-chip:hover { border-color: var(--gray300); }
.goal-chip.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.goal-preview {
  display: block;
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray600);
}
.hero-card.is-focus .goal-chip {
  opacity: 0.55;
  pointer-events: none;
}

/* 세션 진행바 */
.session-progress {
  max-width: 260px;
  margin: 2px auto 0;
}
.session-track {
  height: 8px;
  border-radius: 999px;
  background: var(--gray200);
  overflow: hidden;
}
.session-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #5aa0ff);
  transition: width 0.5s ease;
}
.session-cap {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray600);
}

.hero-timer {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: var(--gray900);
}

.hero-message {
  margin: 10px auto 22px;
  font-size: 15px;
  color: var(--gray700);
  max-width: 320px;
  min-height: 44px;
}

.hero-actions {
  display: flex;
  gap: 10px;
}

/* 버튼 */
.btn {
  flex: 1;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:active {
  background: var(--blue-dark);
}

.btn-soft {
  background: var(--gray100);
  color: var(--gray700);
}

/* 일반 카드 */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.title-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 5px 12px;
  border-radius: 999px;
}

.head-tags {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brain-state {
  font-size: 13px;
  font-weight: 800;
  color: var(--gray900);
  background: linear-gradient(90deg, #fff3e6, #ffe8d4);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.brain-state[hidden] {
  display: none;
}

/* 내 집중 구조 공유 버튼 */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 11px 16px;
  width: 100%;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gray100);
  color: var(--gray700);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.share-btn:hover {
  background: var(--gray200);
}
.share-btn:active {
  transform: scale(0.98);
}
.share-btn[hidden] {
  display: none;
}
.share-btn i {
  width: 17px;
  height: 17px;
}

.muted-mini {
  font-size: 12px;
  color: var(--gray500);
}

/* 요약 숫자 */
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.summary-num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--gray900);
}

.summary-num small {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray500);
  margin-left: 2px;
}

.summary-num.orange {
  color: var(--orange);
}

.summary-num.blue {
  color: var(--blue);
}

.summary-label {
  font-size: 13px;
  color: var(--gray500);
  font-weight: 500;
}

.summary-divider {
  width: 1px;
  height: 36px;
  background: var(--gray200);
}

/* 진행 바 */
.progress-track {
  height: 10px;
  background: #ffe7d8;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 50%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-caption {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--gray600);
}

/* 사이트별 시간 카드 */
.domain-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.domain-list:empty { margin: 0; }
.domain-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.domain-ico { font-size: 18px; width: 22px; text-align: center; }
.domain-main { flex: 1; min-width: 0; }
.domain-host {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.domain-track {
  height: 6px;
  background: var(--gray200);
  border-radius: 999px;
  margin-top: 5px;
  overflow: hidden;
}
.domain-fill {
  height: 100%;
  background: linear-gradient(90deg, #5aa0ff, #3182f6);
  width: 0;
}
.domain-min { font-size: 13px; font-weight: 800; color: var(--gray700); }

/* 열린 탭 · 메모리 카드 */
.tab-health-card {
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
}
.mem-box,
.mem-box[data-level="light"],
.mem-box[data-level="medium"],
.mem-box[data-level="heavy"] {
  background: linear-gradient(180deg, #f8fafc, #f4f7fb);
  border: 1px solid #e3e9f0;
  border-radius: var(--radius-md);
  padding: 14px;
}
.mem-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.mem-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.mem-status-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.2px;
}
.mem-status-msg {
  font-size: 13px;
  line-height: 1.45;
  color: var(--gray600);
}
.mem-box .mem-status-title { color: var(--gray900); }
.mem-score {
  flex: 0 0 auto;
  min-width: 64px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.78);
  padding: 9px 10px;
  text-align: right;
  box-shadow: inset 0 0 0 1px rgba(25,31,40,0.05);
}
.mem-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--gray500);
}
.mem-val {
  display: block;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
}
.mem-box .mem-val { color: var(--blue-dark); }
.mem-track {
  height: 8px;
  border-radius: 999px;
  background: var(--gray200);
  overflow: hidden;
  margin-top: 13px;
}
.mem-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.mem-box .mem-fill { background: linear-gradient(90deg, var(--blue), #5aa0ff); }
.tab-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.tab-metrics span {
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.74);
  padding: 9px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--gray500);
}
.tab-metrics b {
  display: block;
  color: var(--gray900);
  font-size: 18px;
  line-height: 1.1;
}
.mem-caption {
  margin: 11px 0 0;
  font-size: 13px;
  color: var(--gray600);
  line-height: 1.45;
}
.tab-guide {
  margin-top: 10px;
  border: 1px solid #e3e9f0;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 13px;
}
.tab-guide-label {
  display: inline-flex;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
}
.tab-guide-copy {
  margin: 8px 0 0;
  color: var(--gray800);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 750;
}
.tab-guide-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tab-guide-sites span {
  border: 1px solid #e3e9f0;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--gray700);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}
.tab-detail {
  margin-top: 10px;
}
.tab-detail summary {
  cursor: pointer;
  color: var(--gray600);
  font-size: 13px;
  font-weight: 900;
  list-style-position: inside;
}
.sleep-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sleep-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: #f8f9fa;
  border: 1px solid #edf1f4;
  border-radius: var(--radius-sm);
  padding: 9px;
}
.sleep-item.lv3,
.sleep-item.lv4,
.sleep-item.lv5 { border-color: #d8e1eb; background: #f8f9fa; }
.sleep-fav {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.sleep-fav.ph {
  background: #eef1f4;
  color: var(--gray600);
}
.sleep-fav svg {
  width: 16px;
  height: 16px;
}
.sleep-main { min-width: 0; }
.sleep-msg {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--gray900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sleep-meta {
  font-size: 12px;
  color: var(--gray500);
}
.sleep-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.sleep-open,
.sleep-close {
  border: 0;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.sleep-open { background: var(--blue-soft); color: var(--blue); }
.sleep-close { background: var(--gray100); color: var(--gray700); }
.sleep-more {
  color: var(--gray500);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 2px 0 0;
}
.tab-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  vertical-align: 1px;
}
.tab-badge.live { background: #edf4ff; color: var(--blue-dark); }
.tab-badge.sleep { background: #eef1f4; color: var(--gray700); }
.tab-badge.heavy { background: #eef1f4; color: var(--gray900); }

/* AI 코치 */
.coach-card {
  background: linear-gradient(180deg, #f5faff, #ffffff);
  border: 1px solid var(--blue-soft);
}

.coach-headline {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray900);
}

.coach-advice {
  margin: 0;
  font-size: 14px;
  color: var(--gray700);
}

.coach-body.is-loading .coach-headline {
  color: var(--gray500);
}

/* 톤 선택 */
.tone-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tone-chip {
  border: 1.5px solid var(--gray200);
  background: var(--white);
  color: var(--gray700);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  transition: all 0.15s ease;
}

.tone-chip:active {
  transform: scale(0.98);
}

.tone-chip.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

/* 도우미 리스트 */
.helper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.helper-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.helper-row.is-active {
  background: var(--blue-soft);
}

.helper-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--gray100);
  color: var(--gray700);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
}
.helper-emoji svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}
.helper-row[data-helper="concierge"] .helper-emoji {
  background: #e8f3ff;
  color: #3182f6;
}
.helper-row[data-helper="noljima"] .helper-emoji {
  background: #ffeaec;
  color: #f04452;
}
.helper-row[data-helper="teacher"] .helper-emoji {
  background: #f1ecfe;
  color: #8b5cf6;
}
.helper-row[data-helper="alarm"] .helper-emoji {
  background: #fff1e6;
  color: #ff8a3d;
}
.helper-row[data-helper="pleader"] .helper-emoji {
  background: #ffe9f3;
  color: #f74aa0;
}

.helper-text {
  flex: 1;
}

.helper-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.helper-text small {
  font-size: 12px;
  color: var(--gray500);
}

.helper-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray500);
  background: var(--gray100);
  padding: 4px 10px;
  border-radius: 999px;
}

.helper-row.is-active .helper-time {
  color: var(--blue);
  background: #fff;
}

/* 푸터 */
.app-footer {
  text-align: center;
  padding: 12px 0 0;
}

.conn-state {
  font-size: 12px;
  color: var(--gray500);
}

.conn-state.online {
  color: var(--green);
}

.conn-state.offline {
  color: var(--gray500);
}

/* 복귀 바텀시트 */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.2s ease;
}

/* hidden 속성이 있을 때는 반드시 숨겨서 버튼 클릭을 막지 않도록 함 */
.sheet-backdrop[hidden] {
  display: none;
}

.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 12px 24px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--gray200);
  margin: 0 auto 18px;
}

.sheet-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin: 4px auto 10px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 8px 20px rgba(49, 130, 246, 0.18);
}
.sheet-emoji svg {
  width: 42px;
  height: 42px;
  stroke-width: 1.9;
}

/* 시작 안내 팝업 */
.sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray900);
  margin: 2px 0 16px;
}
.sheet-note {
  font-size: 13px;
  color: var(--gray600);
  margin: -6px 0 16px;
  line-height: 1.45;
}
.start-guide {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.start-guide li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--gray700);
  line-height: 1.45;
}
.start-guide li svg {
  width: 20px;
  height: 20px;
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 1px;
}
.start-guide strong {
  color: var(--gray900);
  font-weight: 700;
}

/* 토스트 */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--gray900);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sheet-message {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray900);
  margin: 14px 0 22px;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-actions .btn {
  width: 100%;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ============================================================
   탭 네비게이션 레이아웃 (홈 / 집중 / 사용량)
   ============================================================ */
.app.has-nav { max-width: 480px; padding-bottom: 88px; }

.tabs { display: block; }
.tab-panel { display: none; flex-direction: column; gap: 14px; }
.tab-panel.is-active { display: flex; animation: panelIn 0.24s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 하단 네비게이션 */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px; z-index: 100;
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--gray200);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: none; cursor: pointer; padding: 6px 4px;
  color: var(--gray500); font-size: 11px; font-weight: 700;
}
.nav-item i { width: 22px; height: 22px; }
.nav-item.is-active { color: var(--blue); }

/* 홈 히어로 */
.home-hero { text-align: center; padding: 18px 8px 6px; }
.home-mascot { width: 108px; height: 108px; margin: 0 auto 10px; }
.home-mascot .mascot-svg { width: 100%; height: 100%; object-fit: contain;
  animation: mascotFloat 3.2s ease-in-out infinite; }
.home-title { font-size: 22px; font-weight: 800; margin: 4px 0; color: var(--gray900); }
.home-sub { font-size: 14px; color: var(--gray600); line-height: 1.5; margin: 0 auto 14px; max-width: 340px; }
.home-start { width: 100%; }

/* 확장 CTA 카드 */
.cta-card { text-align: center; border: 1.5px solid var(--blue-soft); background: linear-gradient(180deg, #f5faff, #ffffff); }
.cta-badge { width: 46px; height: 46px; margin: 2px auto 8px; border-radius: 14px;
  background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.cta-badge i { width: 24px; height: 24px; }
.cta-title { font-size: 17px; font-weight: 800; margin: 2px 0 6px; color: var(--gray900); }
.cta-sub { font-size: 13px; color: var(--gray600); line-height: 1.55; margin: 0 0 12px; }
.cta-list { list-style: none; padding: 0; margin: 0 0 14px; text-align: left; display: flex; flex-direction: column; gap: 7px; }
.cta-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray700); font-weight: 600; }
.cta-list li i { width: 16px; height: 16px; color: var(--green); flex: 0 0 auto; }
.cta-download { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.cta-download i { width: 18px; height: 18px; }
.cta-note { font-size: 12px; color: var(--gray500); margin: 8px 0 0; }

/* 카메라 카드 + 잠금 */
.cam-card { position: relative; }
.cam-card .card-head { flex-wrap: wrap; gap: 8px; }
.cam-lock { position: absolute; inset: 0; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.cam-lock-inner { text-align: center; max-width: 300px; }
.cam-lock-inner i { width: 30px; height: 30px; color: var(--gray500); }
.cam-lock-inner p { font-size: 13px; color: var(--gray700); line-height: 1.5; margin: 8px 0 12px; }

/* 사용량 인트로 */
.usage-intro { padding: 12px 4px 2px; }
.usage-title { font-size: 20px; font-weight: 800; margin: 0 0 4px; color: var(--gray900); }
.usage-sub { font-size: 14px; color: var(--gray600); margin: 0; line-height: 1.5; }

/* 미션 완료 축하 영상 (캐릭터 이미지 위에 겹쳐 1회 재생) */
.mascot-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; z-index: 5; border-radius: 14px; background: transparent;
}
.mascot-video[hidden] { display: none; }
