/* 실험실 공통 기반 (/a · /b) — 제품별 색은 각 css 의 :root 변수로 */
@font-face { font-family: "Pretendard"; src: url("/fonts/Pretendard-subset.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus, #5b8cff); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px calc(28px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 56px; }
.top .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; text-decoration: none; letter-spacing: -0.01em; }
.top .brand small { font-weight: 600; font-size: 12px; opacity: 0.6; }
.top .back { border: 0; background: none; padding: 8px 4px; min-height: 44px; font-weight: 700; opacity: 0.8; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 16px; border: 0; font-weight: 800; font-size: 17px; text-decoration: none; transition: transform 0.12s ease, filter 0.12s ease; user-select: none; }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: var(--on-accent, #fff); box-shadow: 0 8px 24px -10px var(--accent); }
.btn.soft { background: var(--soft); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.sm { min-height: 44px; font-size: 15px; padding: 0 14px; border-radius: 12px; }
.row { display: flex; gap: 8px; }
.row > .btn { flex: 1 1 0; min-width: 0; }

/* 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 700; }

/* 카드 */
.card { background: var(--card); border-radius: 22px; padding: 20px; box-shadow: var(--shadow, 0 10px 30px -18px rgba(0, 0, 0, 0.25)); }
.card + .card { margin-top: 12px; }
.card h3 { margin: 0 0 10px; font-size: 17px; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-weight: 800; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "⌄"; font-size: 18px; opacity: 0.6; transition: transform 0.2s; }
details.more[open] summary::after { transform: rotate(180deg); }
.src-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.src-list li + li { margin-top: 4px; }

/* 슬라이더 (input range) */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; touch-action: pan-y; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: var(--track, var(--line)); }
.range::-moz-range-track { height: 8px; border-radius: 8px; background: var(--track, var(--line)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--card); border: 3px solid var(--accent); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.4); }
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--card); border: 3px solid var(--accent); }

/* 토스트 */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: rgba(20, 20, 28, 0.92); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; max-width: calc(100% - 32px); text-align: center; opacity: 0; transition: opacity 0.2s, transform 0.2s; z-index: 50; pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 공유 버튼 줄 */
.share { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.share .btn { min-height: 60px; flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 4px; border-radius: 14px; background: var(--soft); color: var(--ink); font-weight: 800; }
.share .btn b { font-size: 20px; line-height: 1; }

/* 화면 밖 캡처용 */
.capture-host { position: fixed; left: -12000px; top: 0; width: 1080px; height: 1350px; overflow: hidden; pointer-events: none; }

.foot { margin-top: 28px; text-align: center; font-size: 13px; color: var(--muted); }
.foot a { color: inherit; }
.foot nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }

/* 서버가 넣는 검색용 본문 (앱이 그리기 전 잠깐 보임) */
.seo { padding-top: 24px; }
.seo h1 { font-size: 26px; line-height: 1.3; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
