/* ==========================================================
   오늘해봄 — base.css
   디자인 토큰 / 리셋 / 공통 컴포넌트
   (헤더 · 버튼 · 칩 · 카드 · 등급배지 · 점수링 · 광고 · 푸터)

   ※ 로또해봄과 같은 "해봄" 패밀리 디자인 시스템을 공유한다.
     ink/line/surface 스케일, 반경, 그림자, 버튼·칩·카드 규격은 동일하게 유지하고
     생활 카테고리 색과 판정 등급 색만 이 서비스 전용으로 추가한다.
   ========================================================== */

:root {
  /* ---- 브랜드: 해봄 패밀리 공통 (해 = 오렌지) ---- */
  --sun: #FF7A2F;
  --sun-deep: #C2410C;
  --sun-soft: #FFF1E6;
  --sun-line: #FFD2B5;

  /* ---- 생활 카테고리 색 (아이콘 타일·상세 헤더에만 사용) ----
     상태를 뜻하지 않는 "정체성" 색이다. 판정은 아래 등급 색이 담당한다. */
  --act-wash: #3D8BFF;  --act-wash-deep: #1F62D6;  --act-wash-soft: #EAF3FF;  --act-wash-line: #CBDFFF;
  --act-dry:  #FF5C8A;  --act-dry-deep:  #D93A6B;  --act-dry-soft:  #FFEEF3;  --act-dry-line:  #FFD2DF;
  --act-air:  #16B075;  --act-air-deep:  #0E8A5B;  --act-air-soft:  #E6F8F0;  --act-air-line:  #BEEBD8;
  --act-walk: #7B61FF;  --act-walk-deep: #5B41E0;  --act-walk-soft: #F1EEFF;  --act-walk-line: #DCD4FF;

  /* ---- 판정 등급 색 (점수링·배지·막대 전용) ----
     색만으로 구분하지 않는다. 항상 아이콘 + 상태 텍스트를 함께 쓴다. */
  --g-good: #16B075;    --g-good-deep: #0B7A50;    --g-good-soft: #E6F8F0;    --g-good-line: #BEEBD8;
  --g-ok: #3D8BFF;      --g-ok-deep: #1F62D6;      --g-ok-soft: #EAF3FF;      --g-ok-line: #CBDFFF;
  --g-caution: #F08C00; --g-caution-deep: #A85A04; --g-caution-soft: #FFF3DF; --g-caution-line: #FBDCA8;
  --g-bad: #E5484D;     --g-bad-deep: #BE2A2F;     --g-bad-soft: #FFEFEF;     --g-bad-line: #FFD2D2;
  --g-none: #7A8497;    --g-none-deep: #4A5366;    --g-none-soft: #F1F3F7;    --g-none-line: #E1E5EC;

  /* ---- 보조 색 ---- */
  --sky: #3D8BFF;
  --sky-soft: #EAF3FF;

  /* ---- 텍스트 · 표면 (다크모드 없음: 항상 밝게) ---- */
  --ink: #1D2433;
  --ink-2: #4A5366;
  --ink-3: #667085;
  --ink-4: #98A0B0;
  --line: #E8EBF1;
  --line-2: #F1F3F7;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;

  --r-sm: 10px; --r-md: 14px; --r-lg: 22px; --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(29, 36, 51, .05), 0 2px 8px rgba(29, 36, 51, .05);
  --shadow-2: 0 1px 2px rgba(29, 36, 51, .04), 0 14px 36px -12px rgba(29, 36, 51, .14);
  --shadow-sun: 0 12px 24px -10px rgba(232, 86, 26, .6);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --hdr-h: 60px;
  --nav-h: 48px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  color-scheme: light;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr-h) + var(--nav-h) + 12px);
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.01em;
  color: var(--ink);
  background: #fff;
  word-break: keep-all;
  overflow-wrap: anywhere;
  /* 표·칩 목록은 자신의 가로 스크롤 영역에서만 이동하고,
     닫힌 모바일 메뉴나 넓은 표가 문서 전체 폭을 늘리지 않게 한다. */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 3px solid rgba(61, 139, 255, .45); outline-offset: 2px; border-radius: 10px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 760px; }
.section { padding: 40px 0; position: relative; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sec-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--sun-deep); margin-bottom: 6px; }
.sec-title { font-size: 22px; font-weight: 800; line-height: 1.3; letter-spacing: -.035em; }
.sec-desc { font-size: 14.5px; color: var(--ink-2); margin-top: 6px; }
@media (min-width: 768px) {
  .wrap { padding: 0 24px; }
  .sec-title { font-size: 28px; }
  .sec-desc { font-size: 15px; }
}
@media (min-width: 1024px) { .section { padding: 60px 0; } }
.section.section-top { padding-top: 20px; }

/* ---------- icon ---------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }
.ico-xl { width: 28px; height: 28px; }
.icon-sprite { display: none; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.hdr.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -14px rgba(29, 36, 51, .25); }
.hdr-top { height: var(--hdr-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 20px; font-weight: 800; letter-spacing: -.05em; }
.logo svg { width: 32px; height: 32px; }
.logo b { color: var(--sun-deep); font-weight: 800; }
.hdr-actions { display: flex; align-items: center; gap: 6px; }

/* 헤더의 현재 지역 알약 */
.place-pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 46vw; height: 36px; padding: 0 12px;
  border-radius: 999px; background: var(--sun-soft); color: var(--sun-deep);
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
  transition: background .15s;
}
.place-pill:hover { background: #FFE6D3; }
.place-pill .txt { overflow: hidden; text-overflow: ellipsis; }
.place-pill .ico { width: 16px; height: 16px; }

.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-2); transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.menu-toggle { display: none; }

.subnav {
  height: var(--nav-h); display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 6px;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px;
  border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s;
}
.subnav a:hover { background: var(--surface-2); color: var(--ink); }
.subnav a.is-active { background: var(--sun-soft); color: var(--sun-deep); font-weight: 700; }

/* 모바일 전체 메뉴 */
.menu-dim, .menu-shell { display: none; }
@media (max-width: 767px) {
  /* 닫힌 서랍은 화면 밖(translateX)에 있다. position:fixed 라 body/html 의
     overflow 로는 잘리지 않고 문서 가로 폭을 늘려서 페이지가 좌우로 스크롤된다.
     그래서 뷰포트 크기의 고정 셸로 한 번 감싸 잘라낸다. */
  .menu-shell {
    position: fixed; inset: 0; z-index: 120; display: block;
    overflow: hidden; pointer-events: none;
  }
  :root { --nav-h: 0px; }
  .hdr { background: rgba(255, 255, 255, .96); }
  .subnav { display: none; }
  .menu-toggle { display: grid; }
  .menu-dim {
    position: fixed; inset: 0; z-index: 110; display: block;
    background: rgba(29, 36, 51, .28); opacity: 0; pointer-events: none;
    transition: opacity .24s ease;
  }
  .menu-dim.open { opacity: 1; pointer-events: auto; }
  .mobile-menu {
    position: absolute; top: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column; width: min(86vw, 340px);
    padding-bottom: env(safe-area-inset-bottom); background: #fff;
    pointer-events: auto;
    box-shadow: -18px 0 46px -20px rgba(29, 36, 51, .32);
    transform: translateX(104%); visibility: hidden;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .3s;
  }
  .mobile-menu.open { transform: none; visibility: visible; transition-delay: 0s; }
  body.menu-open { overflow: hidden; }
  .mobile-menu-head {
    min-height: 64px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px 0 20px; border-bottom: 1px solid var(--line);
  }
  .mobile-menu-head strong { font-size: 19px; font-weight: 800; letter-spacing: -.035em; }
  .mobile-menu-nav { min-height: 0; display: grid; gap: 4px; padding: 14px 12px; overflow-y: auto; }
  .mobile-menu-nav a {
    min-height: 48px; display: flex; align-items: center; gap: 10px;
    padding: 0 14px; border-radius: 14px; color: var(--ink-2); font-size: 15px; font-weight: 700;
  }
  .mobile-menu-nav a .ico { color: var(--ink-4); }
  .mobile-menu-nav a.is-active { background: var(--sun-soft); color: var(--sun-deep); }
  .mobile-menu-nav a.is-active .ico { color: var(--sun); }
  .mobile-menu-nav .grp {
    margin: 10px 0 2px; padding: 0 14px; font-size: 12px; font-weight: 800;
    letter-spacing: .02em; color: var(--ink-4);
  }
  .mobile-menu-util { display: grid; gap: 6px; margin-top: auto; padding: 14px 12px; border-top: 1px solid var(--line); }
  .mobile-menu-util a {
    min-height: 46px; display: flex; align-items: center; gap: 10px;
    padding: 0 14px; border-radius: 14px; color: var(--ink-2); font-size: 14px; font-weight: 700;
  }
  .mobile-menu-util a:hover { background: var(--surface-2); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 14px;
  font-size: 15px; font-weight: 700; white-space: nowrap;
  transition: transform .12s, box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: scale(.98); }
.btn-sun {
  color: #fff; text-shadow: 0 1px 1px rgba(150, 45, 0, .25);
  background: linear-gradient(135deg, #FF9B40 0%, #FF6D2C 55%, #F0541F 100%);
  box-shadow: var(--shadow-sun);
}
.btn-sun:hover { box-shadow: 0 16px 30px -10px rgba(232, 86, 26, .65); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: #EDF0F5; }
.btn-line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px #D5DAE3; }
.btn-sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-lg { height: 52px; border-radius: 16px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; }

.link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-size: 14px; font-weight: 700; color: var(--sky); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .ico { width: 16px; height: 16px; }

/* ---------- segmented / chips / tags ---------- */
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 13px; background: var(--surface-2); }
.seg button {
  height: 34px; padding: 0 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-3);
  transition: background .2s, color .2s, box-shadow .2s;
}
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] {
  background: #fff; color: var(--ink); font-weight: 700; box-shadow: var(--shadow-1);
}
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink-2); transition: all .15s;
}
.chip:hover { box-shadow: inset 0 0 0 1.5px #D5DAE3; }
.chip[aria-pressed="true"] { background: var(--sun-soft); color: var(--sun-deep); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--sun-line); }
.chip .ico { width: 17px; height: 17px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tag-sun { background: var(--sun-soft); color: var(--sun-deep); }
.tag-wash { background: var(--act-wash-soft); color: var(--act-wash-deep); }
.tag-dry { background: var(--act-dry-soft); color: var(--act-dry-deep); }
.tag-air { background: var(--act-air-soft); color: var(--act-air-deep); }
.tag-walk { background: var(--act-walk-soft); color: var(--act-walk-deep); }
.tag-mute { background: var(--surface-2); color: var(--ink-3); }

/* ---------- card ---------- */
.card { background: #fff; border: 1px solid rgba(232, 235, 241, .9); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.card-flat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
@media (min-width: 768px) { .card-pad { padding: 26px; } }

/* ==========================================================
   판정 공통 부품 — 등급 배지 · 점수 링 · 카테고리 타일
   ========================================================== */

/* 등급 배지: 색 + 아이콘 + 텍스트를 항상 함께 쓴다 */
.grade {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px;
  border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap;
}
.grade .ico { width: 15px; height: 15px; stroke-width: 2.4; }
.grade-good { background: var(--g-good-soft); color: var(--g-good-deep); }
.grade-ok { background: var(--g-ok-soft); color: var(--g-ok-deep); }
.grade-caution { background: var(--g-caution-soft); color: var(--g-caution-deep); }
.grade-bad { background: var(--g-bad-soft); color: var(--g-bad-deep); }
.grade-none { background: var(--g-none-soft); color: var(--g-none-deep); }

/* 점수 링 */
.score { --sz: 72px; --pct: 0; position: relative; width: var(--sz); height: var(--sz); flex: none; }
.score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score .trk { fill: none; stroke: var(--line-2); stroke-width: 7; }
.score .bar { fill: none; stroke: var(--sc); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
.score .val {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1;
}
.score .val b { font-size: 23px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.score .val span { margin-top: 2px; font-size: 10.5px; font-weight: 700; color: var(--ink-4); }
.score.is-good { --sc: var(--g-good); }
.score.is-ok { --sc: var(--g-ok); }
.score.is-caution { --sc: var(--g-caution); }
.score.is-bad { --sc: var(--g-bad); }
.score.is-none { --sc: var(--g-none-line); }
.score.is-none .val b { font-size: 17px; color: var(--ink-4); }

/* 카테고리 아이콘 타일 */
.act-tile {
  width: 40px; height: 40px; flex: none; border-radius: 13px;
  display: grid; place-items: center;
}
.act-tile .ico { width: 22px; height: 22px; stroke-width: 2.1; }
.act-wash .act-tile { background: var(--act-wash-soft); color: var(--act-wash-deep); }
.act-dry .act-tile { background: var(--act-dry-soft); color: var(--act-dry-deep); }
.act-air .act-tile { background: var(--act-air-soft); color: var(--act-air-deep); }
.act-walk .act-tile { background: var(--act-walk-soft); color: var(--act-walk-deep); }

/* ---------- 알림 배너 (데이터 지연 · 일부 누락 · 오류) ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.6; font-weight: 600;
}
.notice .ico { width: 18px; height: 18px; margin-top: 1px; }
.notice b { font-weight: 800; }
.notice-warn { background: var(--g-caution-soft); color: var(--g-caution-deep); border: 1px solid var(--g-caution-line); }
.notice-info { background: var(--sky-soft); color: var(--g-ok-deep); border: 1px solid var(--g-ok-line); }
.notice-bad { background: var(--g-bad-soft); color: var(--g-bad-deep); border: 1px solid var(--g-bad-line); }
.notice-mute { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.notice .act { margin-left: auto; flex: none; }

/* ---------- 스켈레톤 ---------- */
.sk {
  background: linear-gradient(90deg, #EEF1F6 25%, #F6F8FB 37%, #EEF1F6 63%);
  background-size: 400px 100%; border-radius: 8px;
  animation: shimmer 1.4s linear infinite;
}
.sk-line { height: 13px; }
.sk-circle { border-radius: 50%; }
/* 실제 본문 한 줄과 같은 높이를 차지하는 스켈레톤 행 */
.sk-row { display: flex; align-items: center; height: 21px; }

/* ---------- AdSense 자리 ----------
   승인된 광고 코드를 연결하기 전에는 방문자에게 목업 슬롯을 노출하지 않는다.
   시안 확인용으로 ?dev=1 일 때만 보인다. */
.ad {
  position: relative; max-width: 728px; min-height: 100px; margin: 0 auto;
  display: grid; place-items: center; text-align: center;
  border-radius: 14px; border: 1.5px dashed #D8DDE6;
  background: repeating-linear-gradient(45deg, #FAFBFD 0 10px, #F4F6F9 10px 20px);
  color: #A2AABA; font-size: 12px;
}
.ad::before { content: "광고"; position: absolute; top: 7px; left: 12px; font-size: 11px; font-weight: 700; color: #A9B1BF; }
.ad strong { display: block; font-size: 13px; font-weight: 700; color: #97A0B1; }
.ad-row { padding: 8px 0; }
@media (min-width: 768px) { .ad { min-height: 90px; } }
body:not(.ads-ready):not(.dev) .ad,
body:not(.ads-ready):not(.dev) .ad-row { display: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 12px 18px 12px 12px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 16px 40px -12px rgba(29, 36, 51, .3);
  font-size: 14px; font-weight: 600;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ok { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--g-good-soft); color: var(--g-good); }

/* ---------- 모달 (지역 선택) ---------- */
.modal-dim {
  position: fixed; inset: 0; z-index: 130; display: grid; align-items: end;
  background: rgba(29, 36, 51, .36); opacity: 0; pointer-events: none; transition: opacity .24s;
}
.modal-dim.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-height: 88vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 24px 24px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.modal-dim.open .modal { transform: none; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px 14px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.035em; }
.modal-sub { margin-top: 1px; font-size: 11.5px; color: var(--ink-4); }
.modal-body { min-height: 0; flex: 1; overflow-y: auto; padding: 16px; }
.modal-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
@media (min-width: 768px) {
  .modal-dim { place-items: center; }
  .modal { max-width: 520px; border-radius: 24px; transform: translateY(20px) scale(.98); }
  .modal-dim.open .modal { transform: none; }
}
body.modal-open { overflow: hidden; }

/* ---------- footer ---------- */
.ftr { background: var(--surface-2); border-top: 1px solid var(--line); padding: 36px 0 56px; font-size: 13px; color: var(--ink-3); }
.ftr .logo { font-size: 18px; color: var(--ink); }
.ftr-desc { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.ftr-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 20px 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ftr-links a { display: inline-flex; align-items: center; min-height: 34px; }
.ftr-links a:hover { color: var(--ink); }
.ftr-links a.em { color: var(--ink); font-weight: 800; }
.ftr-note { line-height: 1.75; }
.ftr-copy { margin-top: 18px; font-size: 12px; }
.ftr { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }

/* ---------- motion ---------- */
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 122, 47, .55); } 100% { box-shadow: 0 0 0 8px rgba(255, 122, 47, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14px); } }

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 맨 위로 ---------- */
.to-top {
  position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--ink-2); border: 1px solid var(--line);
  box-shadow: 0 10px 24px -10px rgba(29, 36, 51, .35);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity .25s, transform .25s, background .15s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--surface-2); }
.to-top .ico { transform: rotate(180deg); }
@media (min-width: 1024px) { .to-top { right: 28px; bottom: calc(28px + env(safe-area-inset-bottom)); width: 50px; height: 50px; } }

/* 본문 바로가기 (키보드 사용자) */
.skip {
  position: fixed; left: 50%; top: 10px; z-index: 200; transform: translate(-50%, -160%);
  padding: 10px 18px; border-radius: 12px; background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 700; transition: transform .2s;
}
.skip:focus { transform: translate(-50%, 0); }
main:focus { outline: none; }

/* ==========================================================
   시안 검토용 UI 상태 전환 패널 — ?dev=1 에서만 보인다.
   배포 시 dev-panel 관련 마크업/스크립트만 지우면 된다.
   ========================================================== */
.dev-fab {
  position: fixed; left: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 90;
  display: none; align-items: center; gap: 7px; height: 42px; padding: 0 15px;
  border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 700; box-shadow: 0 12px 28px -12px rgba(29, 36, 51, .6);
}
body.dev .dev-fab { display: inline-flex; }
.dev-panel {
  position: fixed; left: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 91;
  width: min(300px, calc(100vw - 32px)); max-height: 66vh; overflow-y: auto;
  padding: 14px; border-radius: 18px; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 20px 50px -16px rgba(29, 36, 51, .4);
  display: none;
}
.dev-panel.open { display: block; }
.dev-panel h3 { font-size: 13px; font-weight: 800; color: var(--ink-3); margin-bottom: 10px; }
.dev-panel ol { display: grid; gap: 4px; counter-reset: s; }
.dev-panel button {
  width: 100%; min-height: 40px; display: flex; align-items: center; gap: 9px;
  padding: 0 11px; border-radius: 11px; text-align: left;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background .15s;
}
.dev-panel button:hover { background: var(--surface-2); }
.dev-panel button[aria-pressed="true"] { background: var(--sun-soft); color: var(--sun-deep); font-weight: 800; }
.dev-panel button i {
  width: 20px; height: 20px; flex: none; border-radius: 6px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-4); font-size: 11px; font-weight: 800; font-style: normal;
}
.dev-panel button[aria-pressed="true"] i { background: #fff; color: var(--sun-deep); }
.dev-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 11.5px; line-height: 1.6; color: var(--ink-4); }
