:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e6e8eb;
  --text: #202124;
  --muted: #80868b;
  --brand: #2ac1bc;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Apple SD Gothic Neo", "Pretendard", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.appbar { background: var(--brand); color: #fff; }
.appbar-inner { max-width: 640px; margin: 0 auto; padding: 14px 18px; display: flex; align-items: baseline; gap: 10px; }
.logo { font-weight: 700; font-size: 18px; }
.hint { font-size: 12px; opacity: .85; }

.tabs { max-width: 640px; margin: 0 auto; display: flex; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tab { flex: 0 0 auto; min-width: 84px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 12px; border: none; background: none; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab .tab-title { font-size: 14px; }
.tab .tab-sub { font-size: 10px; line-height: 1.2; opacity: 0.75; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab.active .tab-title { font-weight: 700; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
.view.hidden { display: none; }
.hidden { display: none; }

.view-desc { background: #eef9f8; border: 1px solid #cdeeec; border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 12px; }
.view-desc strong { color: var(--brand); }
.view-desc p { margin: 6px 0 0; color: #3c4043; line-height: 1.5; }
code { background: #eceff1; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.enum-list { margin: 10px 0 0; padding-left: 0; list-style: none; }
.enum-list li { font-size: 12.5px; color: #3c4043; padding: 4px 0; border-top: 1px dashed #cdeeec; line-height: 1.5; }
.enum-list li:first-child { border-top: none; }
.enum-list li code:first-child { background: var(--brand); color: #fff; font-weight: 600; }

/* 접었다 펴는 정답 영역 (실습 1 status 목록 / 실습 2 mock 응답) */
.mission { font-size: 14px; line-height: 1.6; margin: 8px 0 12px; padding: 12px 14px; background: #fff8e1; border-left: 4px solid #f5a623; border-radius: 8px; }
.mission .goal { display: block; font-weight: 700; margin-bottom: 4px; }
.answer { margin-top: 10px; }
.answer summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand); padding: 8px 12px; background: #eef9f8; border: 1px solid #cdeeec; border-radius: 8px; list-style: none; user-select: none; }
.answer.hint summary { color: #b06a00; background: #fff4e5; border-color: #ffd9a8; }
.answer.solution summary { color: #188038; background: #e6f4ea; border-color: #b7e1c5; }
.answer summary::-webkit-details-marker { display: none; }
.answer summary::before { content: '▸ '; }
.answer[open] summary::before { content: '▾ '; }

.mock-spec { margin: 14px 0; border-radius: 12px; }
.mock-spec pre { margin: 8px 0 0; background: #202124; color: #e8eaed; padding: 14px; border-radius: 10px; overflow: auto; font-size: 12px; line-height: 1.5; }
pre.code-snippet { margin: 8px 0; background: #202124; color: #e8eaed; padding: 14px; border-radius: 10px; overflow: auto; font-size: 12px; line-height: 1.5; }

/* 문제에 바로 노출되는 명세 블록 (실습1) */
.spec-given { margin: 12px 0; }
.spec-given .spec-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

/* Swagger 스타일 명세 카드 (실습1) */
.swagger { margin-top: 8px; border: 1px solid #cdeeec; border-radius: 10px; overflow: hidden; font-size: 13px; }
.swagger-op { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #e8f6f5; }
.swagger-op .method { font-size: 11px; font-weight: 700; color: #fff; padding: 3px 8px; border-radius: 5px; letter-spacing: .5px; }
.swagger-op .method.get { background: #2ac1bc; }
.swagger-path { font-family: ui-monospace, monospace; font-weight: 700; }
.swagger-resp { padding: 8px 12px; border-top: 1px solid #e6e8eb; color: var(--muted); font-size: 12px; }
.badge-200 { color: #188038; font-weight: 700; }
.schema-tree, .schema-tree ul { list-style: none; margin: 0; padding: 0; }
.schema-tree { padding: 6px 0 10px; }
.schema-tree ul { border-left: 2px solid #e6e8eb; margin-left: 16px; padding-left: 4px; }
.schema-node { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 5px 12px; font-family: ui-monospace, monospace; }
.schema-node .type { font-size: 11px; padding: 1px 7px; border-radius: 4px; font-weight: 600; }
.type.string { background: #e6f4ea; color: #188038; }
.type.integer, .type.boolean, .type.number { background: #e8f0fe; color: #1a73e8; }
.type.object, .type.array { background: #f1f3f4; color: #5f6368; }
.schema-ex { color: #80868b; font-size: 12px; }
.schema-note { font-family: -apple-system, sans-serif; font-size: 11px; color: #c5221f; background: #fce8e6; padding: 1px 7px; border-radius: 4px; }

.reload { width: 100%; padding: 12px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-size: 14px; cursor: pointer; margin-bottom: 14px; }
.reload:active { background: #f1f3f4; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.status-banner { color: #fff; border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 14px; }
.status-banner .emoji { font-size: 32px; }
.status-banner strong { font-size: 17px; }
.status-banner p { margin: 4px 0 0; font-size: 13px; opacity: .92; }

.progress { display: flex; justify-content: space-between; margin: 18px 4px 6px; }
.pstep { flex: 1; text-align: center; position: relative; }
.pstep .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #dadce0; }
.pstep.done .dot { background: var(--brand); }
.pstep em { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 4px; }
.pstep.done em { color: var(--text); font-weight: 600; }

.info-box { background: #f8f9fa; border-radius: 10px; padding: 12px; font-size: 13px; margin: 14px 0; line-height: 1.5; }
.info-box.danger { background: #fce8e6; color: #c5221f; }
.info-box.success { background: #e6f4ea; color: #188038; }

h3 { margin: 16px 0 2px; }
.muted { color: var(--muted); font-size: 12px; margin: 2px 0; }
.items { list-style: none; padding: 0; margin: 14px 0; border-top: 1px solid var(--line); }
.items li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.total { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; }
.total strong { font-size: 18px; color: var(--brand); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-of-type { border-bottom: none; }
.kv > span:last-child, .kv > strong, .kv > code { text-align: right; word-break: break-all; }

/* 실습 2: 상품 카드 (텍스트/UI 깨짐 테스트용) */
.product { display: flex; gap: 12px; align-items: flex-start; }
.product-thumb { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 12px; background: #fff4e5; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.product-body { flex: 1; min-width: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #fce8e6; color: #c5221f; font-weight: 600; }
.product-name { margin: 0 0 4px; font-size: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-summary { margin: 0 0 6px; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.product-price { display: flex; align-items: baseline; gap: 8px; }
.product-price strong { font-size: 18px; color: var(--brand); }
.price-original { font-size: 13px; color: var(--muted); text-decoration: line-through; }

/* 실습 1: 쿠폰 카드 (타입 불일치 디버깅) */
.coupon { display: flex; gap: 14px; align-items: center; border: 1px dashed var(--brand); border-radius: 12px; padding: 14px; }
.coupon-left { display: flex; flex-direction: column; align-items: center; padding-right: 14px; border-right: 1px dashed var(--line); flex: 0 0 auto; }
.coupon-amount { font-size: 22px; font-weight: 800; color: var(--brand); }
.coupon-min { font-size: 11px; color: var(--muted); }
/* 실습 9: 설문 폼 */
.survey-form { display: flex; flex-direction: column; gap: 14px; }
.survey-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #3c4043; }
.survey-form label small { font-weight: 400; color: var(--muted); }
.survey-form input, .survey-form textarea { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; width: 100%; box-sizing: border-box; }
.survey-form input:focus, .survey-form textarea:focus { outline: none; border-color: var(--brand); }
.survey-form .cta { margin: 4px 0 0; }
.form-errors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.form-errors li { font-size: 12px; color: #c5221f; background: #fce8e6; padding: 6px 10px; border-radius: 6px; }
.form-errors:empty { display: none; }

.coupon-body { flex: 1; min-width: 0; }
.code-boxes { display: flex; gap: 4px; margin: 8px 0; }
.code-box { width: 22px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; font-family: ui-monospace, monospace; font-size: 16px; font-weight: 700; background: #fff; }
.code-box.empty { background: repeating-linear-gradient(45deg, #fce8e6, #fce8e6 4px, #fff 4px, #fff 8px); border-color: #f5b5ad; }

.raw { margin-top: 16px; }
.raw summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.raw pre { background: #202124; color: #e8eaed; padding: 12px; border-radius: 8px; overflow: auto; font-size: 12px; }

.error { background: #fce8e6; color: #c5221f; border-radius: 10px; padding: 16px; text-align: center; line-height: 1.6; }

.reviews-summary { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.reviews-summary .big { font-size: 22px; font-weight: 700; }
.review { border-top: 1px solid var(--line); padding: 14px 0; }
.review-head { display: flex; justify-content: space-between; }
.review p { margin: 8px 0; font-size: 14px; line-height: 1.5; }
.tags span { display: inline-block; background: #f1f3f4; border-radius: 20px; padding: 3px 10px; font-size: 12px; margin-right: 6px; }

.cta { width: 100%; padding: 14px; border: none; border-radius: 10px; background: var(--brand); color: #fff; font-size: 15px; font-weight: 600; margin: 14px 0; cursor: pointer; }

/* 실습 4: 피드 아이템 */
.feed-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-thumb { width: 54px; height: 54px; border-radius: 10px; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feed-item strong { font-size: 15px; }

/* 실습 4: 스켈레톤 로딩뷰 */
.skeleton .skel-card { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.skel-thumb { width: 54px; height: 54px; border-radius: 10px; flex-shrink: 0; }
.skel-lines { flex: 1; }
.skel-line { height: 12px; border-radius: 6px; margin: 8px 0; }
.skel-line.w70 { width: 70%; }
.skel-line.w40 { width: 40%; }
.skel-thumb, .skel-line { background: linear-gradient(90deg, #eceff1 25%, #f6f7f8 50%, #eceff1 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* 로딩 (Network Conditions 실습 시 길게 노출됨) */
.loading { text-align: center; padding: 48px 0; color: var(--muted); }
.dots { display: inline-flex; gap: 6px; margin-bottom: 12px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); animation: bounce 1s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
