/* 꼬리 줄임 - 공통 스타일 (폰트는 각 HTML의 <head>에서 <link>로 병렬 로딩함) */
:root {
  --orange: #FF6B35;
  --orange-dark: #E5541F;
  --orange-light: #FFF1EA;
  --bg: #FFFFFF;
  --bg-soft: #FAFAFA;
  --text: #262626;
  --text-sub: #595959;
  --line: #EDEDED;
  --done: #B3B3B3;
  --green: #2FAE66;
  --green-dark: #24904F;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: 18px;
  line-height: 1.7;
  word-break: keep-all;
}

h1, h2, .logo, .cat-card .txt strong {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

@media (min-width: 900px) {
  .wrap { max-width: 720px; }
}

/* 상단 헤더 */
.topbar {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.topbar .side {
  display: flex;
  gap: 8px;
}

.icon-btn {
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 20px;
  text-decoration: none;
}

.icon-btn:active { background: var(--orange-light); }

.logo {
  display: block;
  text-align: center;
  font-family: "Jua", "Pretendard", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.23;
  color: var(--orange-dark);
  text-decoration: none;
  white-space: nowrap;
}

.logo .brand-name {
  font-size: 22.7px;
  letter-spacing: 0.05em;
}

.logo .sub-line {
  color: var(--text-sub);
  font-weight: 500;
  font-size: 0.75em;
}

/* 메인 히어로 이미지 (제목 오버레이 포함) */
.hero-image {
  position: relative;
  margin: 20px 0 0;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
}

.hero-image-bg {
  position: absolute;
  inset: 0;
  background: #FFE8D6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image-placeholder {
  color: #C97B4A;
  font-size: 15px;
  padding: 0 24px;
  text-align: center;
}

/* 사진을 넣으면 밝기와 상관없이 글자가 항상 잘 보이도록 살짝 어둡게 깔아주는 층 */
.hero-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
}

.hero-image-text {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 0 20px;
}

.hero-image-title {
  margin: 0;
  color: #fff;
  font-weight: 800;
  font-size: 25px;
  line-height: 1.45;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.hero-image-title .accent {
  color: #FFD166;
}

.hero-image-sub {
  margin: 0;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-image-sub .accent {
  color: #FFD166;
}

.hero-image-desc {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-image-desc .accent2 {
  color: #FFD166;
  font-weight: 800;
}

/* 히어로 (현재 이미지 내부로 통합되어 사용되지 않지만 다른 페이지 재사용 대비 유지) */
.hero {
  text-align: center;
  padding: 22px 8px 8px;
}

.hero p.sub {
  font-size: 18px;
  color: var(--text-sub);
  margin: 0 0 28px;
}

.hero p.sub .accent {
  color: var(--orange-dark);
  font-weight: 800;
}

/* 카드 버튼 (카테고리 5개) */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 20px 0;
}

@media (min-width: 640px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  min-height: 48px;
  transition: transform .1s ease;
}

.cat-card:active { transform: scale(0.98); background: var(--orange-light); }

/* 한 항목이라도 체크리스트를 완료하면 카드가 오렌지 톤으로 바뀜 */
.cat-card.done {
  background: var(--orange-light);
  border-color: var(--orange);
}

.cat-card.done .emoji {
  border-color: var(--orange);
}

.cat-card .done-badge {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  margin-left: 4px;
}

.cat-card.done .done-badge { display: flex; }

.cat-card .emoji {
  font-size: 34px;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.cat-card .emoji img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cat-card .txt strong {
  display: block;
  font-size: 19px;
  margin-bottom: 4px;
}

.cat-card .txt span {
  font-size: 15px;
  color: var(--text-sub);
}

.cat-card .arrow {
  margin-left: auto;
  color: var(--orange);
  font-size: 22px;
}

/* 섹션 공통 */
section.page-intro {
  padding: 20px 0 6px;
}

section.page-intro h1 {
  font-size: 24px;
  margin: 6px 0 10px;
}

section.page-intro p {
  color: var(--text-sub);
  font-size: 17px;
}

/* 진행률 바 */
.progress-box {
  position: sticky;
  top: 65px;
  background: #fff;
  padding: 12px 0 14px;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.progress-box .label {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.progress-box .label b { color: var(--orange-dark); }

.progress-bar-track {
  height: 12px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--orange);
  border-radius: 999px;
  transition: width .25s ease;
}

/* 기종 선택 탭 */
.device-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  -webkit-overflow-scrolling: touch;
}

.device-tabs::-webkit-scrollbar { display: none; }

.device-tab {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--text-sub);
  font-size: 15.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.device-tab.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

/* 체크리스트를 다 채우면 탭이 초록색으로 바뀜 */
.device-tab.completed {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.device-tab.completed.active {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

/* 기기/앱 섹션 */
.device-section {
  margin: 30px 0;
  padding-top: 6px;
  border-top: 3px solid var(--orange-light);
}

.device-section[hidden] { display: none; }

.device-section h2 {
  font-size: 21px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 8px;
}

.device-section .device-desc {
  color: var(--text-sub);
  font-size: 16px;
  margin: 0 0 16px;
}

.note-box {
  background: var(--orange-light);
  border: 1px solid #FFD9C4;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15.5px;
  color: #8A3A16;
  margin: 12px 0;
}

.note-box.warn {
  background: #FFF5F5;
  border-color: #FFD3D3;
  color: #A13030;
}

/* 체크리스트 카드 */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.check-item input[type="checkbox"] {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  accent-color: var(--orange);
  margin-top: 2px;
}

.check-item label {
  flex: 1;
  font-size: 17.5px;
  cursor: pointer;
}

.check-item .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--orange);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
  margin-right: 8px;
}

.check-item.done label {
  text-decoration: line-through;
  color: var(--done);
}

.check-item.done { background: #fff; border-color: var(--line); }

/* 하단 이동 버튼 */
.pager {
  display: flex;
  gap: 12px;
  margin-top: 34px;
}

.pager a {
  flex: 1;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}

.pager a.primary {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.pager a:active { opacity: 0.85; }

.home-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--text-sub);
  font-size: 15px;
  text-decoration: none;
}

/* 광고 슬롯 */
.ad-slot {
  min-height: 90px;
  background: #F5F5F5;
  border: 1px dashed #DDD;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #BBB;
  font-size: 13px;
  margin: 26px 0;
}

/* 푸터 */
footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.8;
}

footer a { color: var(--orange-dark); text-decoration: underline; }
