/* 반려견 도구(계산기·자가 진단·음식 검색) 공통 스타일 — pages.css의 색 토큰을 그대로 써서 다크 모드에 맞춥니다 */
.tool { margin: 18px 0 22px; padding: 18px; border: 2px solid var(--honey); border-radius: 16px; background: var(--bg); }
.tool-title { margin: 0 0 12px; font-size: 1.08rem; font-weight: 800; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 12px; }
.tool label, .tool .label { display: block; font-weight: 700; font-size: 0.93rem; margin-bottom: 4px; }
.tool input[type="number"], .tool input[type="search"], .tool select {
  width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; font-size: 1rem;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
.tool input:focus-visible, .tool select:focus-visible, .tool button:focus-visible, .tool .choice input:focus-visible + span {
  outline: 3px solid var(--honey); outline-offset: 2px;
}
.tool .hint { font-size: 0.85rem; color: var(--muted); margin: 4px 0 0; }
.tool fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.tool legend { padding: 0; font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }

/* 라디오 버튼을 큼직한 선택지로 */
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { position: relative; display: inline-block; margin: 0; font-weight: 400 !important; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-block; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; font-size: 0.93rem; line-height: 1.5; }
.choice input:checked + span { background: var(--honey); border-color: var(--honey-deep); color: #3b2a1c; font-weight: 700; }

/* 결과 영역 */
.tool-result { margin-top: 6px; padding: 14px 16px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.tool-result p:last-child, .tool-result ul:last-child, .tool-result ol:last-child { margin-bottom: 0; }
.result-big { font-size: 1.35rem; font-weight: 800; line-height: 1.4; margin: 0 0 6px; color: var(--link); }
.result-sub { color: var(--muted); font-size: 0.92rem; }
.result-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.result-row:last-of-type { border-bottom: 0; }
.result-row b { font-weight: 800; }
.stage-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--tag); font-weight: 700; font-size: 0.9rem; }
.tool-warn { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; border-left: 4px solid #c0392b; background: var(--tag); font-size: 0.93rem; }

/* 문제 행동 자가 진단 */
.quiz-q { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.quiz-q:last-of-type { border-bottom: 0; }
.rank-list { margin: 0 0 10px; padding-left: 1.4em; }
.rank-list li { margin-bottom: 8px; }

/* 음식 검색 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.chip { min-height: 38px; padding: 6px 12px; font: inherit; font-size: 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--honey); border-color: var(--honey-deep); color: #3b2a1c; font-weight: 700; }
.food-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.food-list li { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.food-list li[hidden] { display: none; }
.food-name { font-weight: 800; }
.lv { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; vertical-align: 1px; }
.lv-danger { background: #c0392b; color: #fff; }
.lv-caution { background: #e9a53a; color: #3b2a1c; }
.lv-ok { background: #3f8f5a; color: #fff; }
.food-list p { margin: 4px 0 0; font-size: 0.93rem; }
.food-count { font-size: 0.88rem; color: var(--muted); margin: 0 0 8px; }

.emergency { margin: 18px 0; padding: 14px 18px; border-radius: 14px; border: 2px solid #c0392b; background: var(--tag); }
.emergency .box-title { color: #c0392b; }
@media (prefers-color-scheme: dark) {
  .emergency .box-title { color: #ff8a7a; }
  .emergency, .tool-warn { border-color: #ff8a7a; }
}
.emergency p:last-child, .emergency ol:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  .tool { padding: 14px 12px; }
  .result-big { font-size: 1.2rem; }
}
