/* 바벨계산소 공통 스타일
   색상은 IPF 원판 색(25kg 빨강, 20kg 파랑, 15kg 노랑, 10kg 초록, 5kg 흰색)에서 가져왔고
   각 계산기가 원판 색 하나씩을 맡습니다. */

:root {
  --bg: #F3F5F7;         /* 초크 가루 묻은 회백색 */
  --surface: #FFFFFF;
  --soft: #E8ECF1;
  --line: #D9DEE5;
  --ink: #172033;        /* 네이비 잉크 */
  --muted: #5B6475;
  --steel: #9AA3B2;      /* 바벨 봉 */

  --red: #D7263D;
  --blue: #1F4FD1;
  --yellow: #F2B705;
  --green: #17915A;
  --white-plate: #F7F7F4;

  --c: var(--blue);      /* 페이지별 원판 색 */

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --num: "Barlow Condensed", "Pretendard Variable", Pretendard, "Arial Narrow", sans-serif;

  --r-s: 8px;
  --r-m: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1420;
    --surface: #161F31;
    --soft: #1F2A40;
    --line: #2B3650;
    --ink: #E8ECF2;
    --muted: #9AA4B5;
    --steel: #6B7486;
    --blue: #7C96FF;
    --red: #FF5A6E;
    --green: #3CC486;
    --white-plate: #DCDDD8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--blue); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* 헤더 */
header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 60px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.02em;
}
.logo svg { width: 28px; height: 28px; flex: none; }
nav.tools { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
nav.tools::-webkit-scrollbar { display: none; }
nav.tools a {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 8px 12px; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
nav.tools a:hover { color: var(--ink); background: var(--soft); }
nav.tools a[aria-current="page"] { color: var(--ink); background: var(--soft); }
@media (max-width: 760px) {
  nav.tools { margin: 0 -20px; padding: 0 14px 10px; width: calc(100% + 40px); }
}

/* 원판 칩 (가운데 구멍 뚫린 원판 모양) */
.chip {
  --pc: var(--c);
  display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle, var(--surface) 0 2px, var(--pc) 2.5px);
}
.chip.lg { width: 30px; height: 30px; background: radial-gradient(circle, var(--surface) 0 5px, var(--pc) 5.5px); }
.chip.white { --pc: var(--white-plate); box-shadow: inset 0 0 0 1.5px var(--steel); }
.c-red { --c: var(--red); }
.c-blue { --c: var(--blue); }
.c-yellow { --c: var(--yellow); }
.c-green { --c: var(--green); }
.c-white { --c: var(--ink); }

/* 계산기 페이지 머리 */
.tool-head { max-width: 1080px; margin: 0 auto; padding: 36px 20px 24px; }
.tool-head h1 {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 8px; font-size: clamp(28px, 5vw, 40px); line-height: 1.2; font-weight: 800; letter-spacing: -0.03em;
}
.tool-head p { margin: 0; color: var(--muted); max-width: 58ch; font-size: 17px; }

/* 계산기 레이아웃 */
.calc {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 880px) {
  .calc { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .calc .result { position: sticky; top: 20px; }
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 24px; }
.result { border-top: 6px solid var(--c); min-height: 200px; }
.c-white .result { border-top-color: var(--steel); }

/* 입력 */
.field { display: grid; gap: 8px; margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .label, .field > legend { font-weight: 700; font-size: 15px; padding: 0; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.input { position: relative; }
.input input, select.select {
  width: 100%; min-height: 54px; padding: 0 56px 0 16px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
  font: inherit; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: none;
}
.input input::-webkit-outer-spin-button, .input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input .unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.input input:focus { outline: none; border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.c-yellow .input input:focus { border-color: #C99700; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 .field { margin-bottom: 20px; }

/* 세그먼트 버튼 */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 11px; }
.seg label { flex: 1; position: relative; min-width: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block; text-align: center; padding: 10px 6px; border-radius: 8px;
  font-weight: 700; font-size: 15px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(23, 32, 51, .14), 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 1px; }

/* 설명이 붙은 선택지 */
.choices { display: grid; gap: 8px; }
.choice {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface);
}
.choice input { margin: 4px 0 0; accent-color: var(--c); grid-row: span 2; width: 18px; height: 18px; }
.choice b { font-size: 15px; }
.choice small { color: var(--muted); font-size: 13px; }
.choice:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, var(--surface)); }

/* 결과 */
.result-label { margin: 0 0 4px; font-weight: 700; color: var(--muted); font-size: 15px; }
.big {
  font-family: var(--num); font-weight: 700; font-size: clamp(68px, 13vw, 104px);
  line-height: .95; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin: 0;
}
.big small { font-size: .32em; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.big-sub { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.result h2 { font-size: 17px; margin: 28px 0 10px; letter-spacing: -0.01em; }
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  margin-top: 22px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.stats > div { background: var(--surface); padding: 12px 14px; }
.stats b { display: block; font-family: var(--num); font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }
.error { color: var(--red); font-weight: 700; }

table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: 13px; color: var(--muted); font-weight: 600; }
table.data .num { text-align: right; font-family: var(--num); font-size: 21px; font-weight: 600; }
table.data th.num { font-family: inherit; font-size: 13px; }
table.data th, table.data td.num, table.data td.nw { white-space: nowrap; }
table.data td.sm { font-size: 14px; color: var(--muted); }
table.data tr.pick { cursor: pointer; }
table.data tr.pick:hover { background: var(--soft); }
table.data tr.pick[aria-selected="true"] { background: color-mix(in srgb, var(--c) 11%, transparent); }
table.data tr.pick[aria-selected="true"] td:first-child { box-shadow: inset 4px 0 0 var(--c); }
.scroll-x { overflow-x: auto; }

.note { margin: 16px 0 0; font-size: 14px; color: var(--muted); background: var(--soft); padding: 12px 14px; border-radius: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--steel); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* 바벨 그림 */
.barbell { margin: 4px 0 0; }
.barbell svg { display: block; width: 100%; height: auto; }
.barbell figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* 체지방 게이지 */
.gauge { position: relative; margin: 26px 0 8px; }
.gauge-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; }
.gauge-bar i { display: block; height: 100%; }
.gauge-marker { position: absolute; top: -8px; width: 4px; height: 30px; margin-left: -2px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface); }
.gauge-labels { display: flex; font-size: 12px; color: var(--muted); margin-top: 6px; }
.gauge-labels span { text-align: center; white-space: nowrap; }
.gauge-labels span.on { color: var(--ink); font-weight: 700; }
@media (max-width: 560px) { .gauge-labels span:not(.on) { visibility: hidden; } }

/* 탄단지 */
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.macro { border-top: 5px solid var(--mc); padding-top: 10px; }
.macro .label { font-weight: 700; font-size: 15px; }
.macro .g { font-family: var(--num); font-weight: 700; font-size: clamp(40px, 8vw, 58px); line-height: 1; font-variant-numeric: tabular-nums; }
.macro .g small { font-size: .4em; color: var(--muted); margin-left: 3px; }
.macro .sub { font-size: 13px; color: var(--muted); }
.macro-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; margin-top: 20px; }
.macro-bar i { display: block; height: 100%; }
.m-carb { --mc: var(--yellow); }
.m-pro { --mc: var(--blue); }
.m-fat { --mc: var(--green); }

/* 루틴 */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.week div { text-align: center; padding: 10px 0 8px; border-radius: 8px; background: var(--soft); color: var(--muted); font-weight: 700; font-size: 14px; line-height: 1.3; }
.week div small { display: block; font-size: 11px; font-weight: 600; }
.week div.on { background: var(--ink); color: var(--surface); }
.day { margin-top: 26px; }
.day h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; font-size: 19px; }
.day h3 .when { font-size: 14px; color: var(--muted); font-weight: 600; }
.day table.data td { font-size: 15px; }
.day table.data td.num { font-size: 18px; }
.day .role { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.day table.data th, .day table.data td.num, .day table.data td:last-child { white-space: nowrap; }
.day table.data th, .day table.data td { padding: 10px 6px; }

/* 광고 자리: 레이아웃 흔들림(CLS)을 막기 위해 높이를 미리 확보 */
.ad-slot { max-width: 1080px; margin: 36px auto; padding: 0 20px; }
.ad-slot .ad {
  min-height: 120px; display: grid; place-items: center;
  border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px;
}

/* 설명 글 */
article.guide { max-width: 720px; margin: 0 auto; padding: 8px 20px 24px; line-height: 1.8; }
article.guide h2 { font-size: 24px; line-height: 1.35; margin: 44px 0 12px; letter-spacing: -0.02em; }
article.guide h3 { font-size: 18px; margin: 28px 0 8px; }
article.guide p, article.guide li { font-size: 16.5px; }
article.guide .formula {
  display: block; margin: 12px 0; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; font-weight: 600;
}
article.guide table.data { margin: 12px 0; }
.faq { margin-top: 12px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; gap: 16px; padding: 16px 0;
  font-weight: 700; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; }

/* 다른 계산기 */
.related { max-width: 1080px; margin: 16px auto 0; padding: 0 20px; }
.related h2 { font-size: 18px; margin: 0 0 8px; }

.toollist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.toollist a {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 16px; align-items: center;
  padding: 18px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.toollist a:hover { background: var(--surface); }
.toollist .chip { grid-row: span 2; }
.toollist b { font-size: 18px; letter-spacing: -0.01em; }
.toollist span { color: var(--muted); font-size: 15px; }

/* 홈 */
.hero {
  max-width: 1080px; margin: 0 auto; padding: 48px 20px 24px;
  display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 880px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; padding-top: 72px; } }
.hero h1 { margin: 0 0 16px; font-size: clamp(34px, 6.4vw, 58px); line-height: 1.12; font-weight: 800; letter-spacing: -0.04em; }
.hero p { margin: 0; color: var(--muted); font-size: 18px; max-width: 40ch; }

.rack { position: relative; display: flex; align-items: center; padding: 16px 0 12px; }
.rack::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 12px; margin-top: -6px;
  background: linear-gradient(var(--soft), var(--steel)); border-radius: 6px;
}
.rack .sleeve-stop { position: relative; width: 16px; height: 64px; background: var(--steel); border-radius: 4px; margin-right: 6px; flex: none; }
.rack .collar { position: relative; width: 22px; height: 46px; background: var(--steel); border-radius: 4px; margin-left: 6px; flex: none; }
.rack .plate {
  position: relative; flex: none; margin-right: 4px;
  width: clamp(46px, 11vw, 70px); height: var(--h);
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; text-orientation: mixed;
  background: var(--pc); color: #fff; border-radius: 9px;
  font-weight: 800; font-size: clamp(14px, 3.2vw, 18px); letter-spacing: 0.02em; text-decoration: none;
  box-shadow: inset -6px 0 0 rgba(0, 0, 0, .12);
  transition: transform .18s ease;
}
.rack .plate:hover { transform: translateY(-6px); }
.rack .plate.p-red { --pc: var(--red); --h: clamp(190px, 44vw, 270px); }
.rack .plate.p-blue { --pc: var(--blue); --h: clamp(190px, 44vw, 270px); }
.rack .plate.p-yellow { --pc: var(--yellow); --h: clamp(164px, 38vw, 232px); color: #172033; }
.rack .plate.p-green { --pc: var(--green); --h: clamp(140px, 32vw, 196px); }
.rack .plate.p-white { --pc: var(--white-plate); --h: clamp(116px, 26vw, 156px); color: #172033; box-shadow: inset 0 0 0 1.5px var(--steel), inset -6px 0 0 rgba(0, 0, 0, .06); }
.rack-caption { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

.home-list { max-width: 1080px; margin: 24px auto 0; padding: 0 20px; }
.home-list h2, .about h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 12px; }
.about { max-width: 720px; margin: 48px auto 0; padding: 0 20px; line-height: 1.8; }

/* 문서 페이지 */
.doc { max-width: 720px; margin: 0 auto; padding: 36px 20px; line-height: 1.8; }
.doc h1 { font-size: 32px; letter-spacing: -0.03em; }
.doc h2 { font-size: 20px; margin-top: 32px; }

/* 푸터 */
footer.site { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
footer.site .inner { max-width: 1080px; margin: 0 auto; padding: 32px 20px; display: grid; gap: 14px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer.site a { color: var(--muted); }
footer.site p { margin: 0; max-width: 70ch; }

@media (max-width: 520px) {
  .panel { padding: 20px 18px; }
  .stats b { font-size: 24px; }
  .stats > div { padding: 10px; }
}

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

@media print {
  header.site, nav, footer.site, .ad-slot, .actions, article.guide, .related, .calc > form, .tool-head p { display: none !important; }
  body { background: #fff; color: #000; }
  .calc { display: block; }
  .panel { border: 0; padding: 0; }
  .day { break-inside: avoid; }
}

/* ================= 짐냥이 ================= */
:root { --wall: #E4E8EE; --rubber: #2A3140; }
@media (prefers-color-scheme: dark) { :root { --wall: #1B2436; --rubber: #0A0F18; } }

.btn:disabled { opacity: .55; cursor: default; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[aria-disabled="true"] { color: var(--muted); }
.link-btn { background: none; border: 0; padding: 4px; color: var(--blue); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* 홈 히어로: 20kg 원판 위에 앉은 짐냥이 */
.rack { margin-top: clamp(76px, 15vw, 104px); }
.rack .perch {
  position: absolute; bottom: calc(100% - 6px); left: 50%; transform: translateX(-50%);
  width: clamp(74px, 15vw, 104px); writing-mode: horizontal-tb; pointer-events: none;
}
.rack .perch svg { display: block; width: 100%; height: auto; }

/* 짐냥이 자리 */
.room { max-width: 1080px; margin: 56px auto 0; padding: 0 20px; }
.room-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.room-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.room-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 880px) { .room-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; } }
.room-stage, .np-stage {
  position: relative; overflow: hidden; cursor: pointer; isolation: isolate;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--wall);
}
.room-stage { padding: 76px 12px 0; }
.room-stage::before, .np-stage::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: -1;
  background: radial-gradient(circle, rgba(255, 255, 255, .09) 0 1px, transparent 1.6px) 0 0 / 8px 8px, var(--rubber);
}
.room-stage svg, .np-stage svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.bubble {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 2;
  margin: 0; padding: 8px 16px; max-width: calc(100% - 32px); width: max-content;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  font-weight: 700; font-size: 15px; text-align: center;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; margin-left: -6px;
  background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg);
}
.heart { position: absolute; z-index: 3; color: var(--red); font-size: 22px; pointer-events: none; animation: nyang-heart 1.1s ease-out forwards; }
@keyframes nyang-heart { from { transform: translateY(0) scale(.6); opacity: 1; } to { transform: translateY(-70px) scale(1.1); opacity: 0; } }

.room-side .stats { margin-top: 0; }
.grow { margin-top: 18px; }
.grow-top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.grow-top span { color: var(--muted); font-size: 14px; }
.grow-bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.grow-bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.paws { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.paws > div {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px;
  border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700;
}
.paws > div i { display: block; width: 18px; height: 18px; }
.paws svg { width: 18px; height: 18px; fill: currentColor; }
.paws > div.on { background: color-mix(in srgb, var(--red) 13%, var(--surface)); color: var(--red); }
.paws > div.today { box-shadow: inset 0 0 0 2px var(--ink); }
.room-side .actions { margin-top: 18px; }
.shop-h { font-size: 16px; margin: 24px 0 6px; }
.shop { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.shop li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.shop b { flex: 1; font-size: 15px; }
.shop .swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.room-hint { margin-top: 14px; max-width: 70ch; }

/* 고양이 움직임 */
.tail { transform-box: fill-box; transform-origin: 0% 100%; animation: nyang-tail 3.2s ease-in-out infinite; }
@keyframes nyang-tail { 50% { transform: rotate(-9deg); } }
.blink { transform-box: fill-box; transform-origin: center; animation: nyang-blink 5s infinite; }
@keyframes nyang-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.12); } }
.breathe { transform-box: fill-box; transform-origin: center bottom; animation: nyang-breathe 3.4s ease-in-out infinite; }
@keyframes nyang-breathe { 50% { transform: scaleY(1.045); } }
.zzz { animation: nyang-zzz 2.8s ease-in-out infinite; }
@keyframes nyang-zzz { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* 계산기 페이지의 떠 있는 버튼과 패널 */
.nyang-fab {
  position: fixed; z-index: 20; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 60px; height: 60px; padding: 5px; border-radius: 50%; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); box-shadow: 0 6px 20px rgba(23, 32, 51, .18);
}
.nyang-fab svg { display: block; width: 100%; height: 100%; }
.nyang-fab .badge { position: absolute; top: 1px; right: 1px; width: 15px; height: 15px; border-radius: 50%; background: var(--red); border: 2.5px solid var(--surface); }
.nyang-panel {
  position: fixed; z-index: 20; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  width: min(320px, calc(100vw - 32px)); padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 14px 36px rgba(23, 32, 51, .22);
}
.np-stage { padding: 10px 6px 0; }
.np-say { margin: 12px 0 2px; font-size: 15px; }
.np-meta { margin: 0; font-size: 13px; color: var(--muted); }
.nyang-panel .actions { margin-top: 12px; }
.nyang-panel .actions .btn { flex: 1; }

.nyang-toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 8px); max-width: calc(100vw - 32px); width: max-content;
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--surface);
  font-size: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.nyang-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 숨바꼭질: 입력 패널 뒤에서 빼꼼 */
.calc > form.peek-host { position: relative; margin-top: 30px; }
.peek {
  position: absolute; z-index: 1; top: -44px; width: 64px; height: 44px; padding: 0; overflow: hidden;
  background: none; border: 0; cursor: pointer;
}
.peek svg { display: block; width: 64px; height: 64px; animation: nyang-peek 2.6s ease-in-out infinite; }
.peek.gone svg { animation: none; transition: transform .4s ease-in; transform: translateY(46px); }
@keyframes nyang-peek { 0%, 100% { transform: translateY(8px); } 40%, 70% { transform: translateY(0); } }
.peek-right { right: 28px; }
.peek-left { left: 28px; }
.peek-paws {
  position: absolute; z-index: 2; top: -5px; width: 64px; height: 10px; pointer-events: none;
  background: radial-gradient(ellipse 8px 5px at 30% 50%, #F2A541 98%, transparent) , radial-gradient(ellipse 8px 5px at 70% 50%, #F2A541 98%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .tail, .blink, .breathe, .zzz, .peek svg { animation: none !important; }
}
@media print { .nyang-fab, .nyang-panel, .nyang-toast, .peek, .peek-paws { display: none !important; } }
@media (max-width: 520px) { .room-stage { padding-top: 64px; } }
