/*
 * v4/app.css — 道具（tool）の見た目だけ。角丸なし・影なし。
 * --ao（主ボタン・タイマー残り・的中温度の数字・つまみの縁の強調だけ）。
 * --paper --ink --ink2 --mist --rule --ao --ao2 は係Aのページ側にもある想定。
 * ここでも同じ既定値を持たせ、tests/demo.html 単体でも見た目が壊れないようにする。
 */
:root {
  --paper: #FBF9F4;
  --ink: #1C1B19;
  --ink2: #4A4744;
  --mist: #8E8A84;
  --rule: #DAD5CC;
  --ao: #22415F;
  --ao2: #172E44;
}

.tool {
  background: var(--paper);
  color: var(--ink2);
}

.tool .num,
.tool-body .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.tool-body {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: 1.5rem 0;
  border-top: 3px solid var(--ink);
}

.tool-h {
  margin: 0 0 .3rem;
  font-weight: 700;
  color: var(--ink);
}

.tool-hint {
  margin: 0 0 .6rem;
  color: var(--mist);
  font-size: .9rem;
}

.tool-remembered-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}
.tool-remembered-row[hidden] { display: none; }
.tool-remembered {
  margin: 0;
  color: var(--ink2);
  font-size: .95rem;
}

/* --- 人数 --- */
.tool-servings {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tool-stepper {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.tool-stepper:disabled { color: var(--mist); border-color: var(--rule); cursor: default; }
.tool-servings-label { min-width: 8ch; text-align: center; font-size: 1.1rem; }

/* --- 材料・買い物リスト --- */
.tool-ing { list-style: none; margin: 0; padding: 0; }
.tool-ing-item { border-bottom: 1px solid var(--rule); }
.tool-ing-item:last-child { border-bottom: none; }
.tool-ing-label {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 44px;
  padding: .4rem 0;
  cursor: pointer;
}
.tool-ing-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
  flex: none;
}
.tool-ing-name { flex: 1; }
.tool-ing-amt { white-space: nowrap; }
.tool-ing-item.checked .tool-ing-name { color: var(--mist); text-decoration: line-through; }

.tool-shop-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
  margin-top: .6rem;
}
.tool-link {
  background: none;
  border: none;
  padding: .6rem 0;
  min-height: 44px;
  color: var(--ink2);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.tool-us-toggle[hidden] { display: none; }
.tool-copied { color: var(--ao); }
.tool-copied[hidden] { display: none; }

/* --- 主ボタン --- */
.btn-ao {
  background: var(--ao);
  color: var(--paper);
  border: none;
  min-height: 48px;
  padding: 0 1.6rem;
  font-size: 1rem;
  cursor: pointer;
}
.btn-ao:hover { background: var(--ao2); }
.btn-ao:disabled { background: var(--mist); cursor: default; }

.tool-start { align-self: flex-start; }

/* --- 一手ずつ --- */
.tool-steps { display: flex; flex-direction: column; gap: 1rem; }
.tool-steps[hidden] { display: none; }
.tool-step-count { margin: 0; color: var(--mist); }
.tool-step-title { margin: 0; color: var(--ink); }
.tool-step-text { margin: 0; }

.tool-temp-box {
  display: flex;
  align-items: baseline;
  gap: .6rem;
}
.tool-temp-box[hidden] { display: none; }
.tool-temp-val {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  color: var(--ink);
}

.tool-timer { display: flex; flex-direction: column; gap: .5rem; }
.tool-timer[hidden] { display: none; }
.tool-timer-time {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  color: var(--ao);
  margin: 0;
}
.tool-timer-done { color: var(--ao); margin: 0; }
.tool-timer-done[hidden] { display: none; }

.tool-step-nav { display: flex; justify-content: space-between; gap: 1rem; }

.tool-finished { color: var(--ink); font-size: 1.1rem; }
.tool-finished[hidden] { display: none; }

/* --- スライダー --- */
.ink-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  margin: 0;
}
.ink-range::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--ink);
}
.ink-range::-moz-range-track {
  height: 1px;
  background: var(--ink);
}
.ink-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18.4px;
  height: 18.4px;
  border-radius: 0;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  margin-top: -9.2px;
  cursor: pointer;
}
.ink-range::-moz-range-thumb {
  width: 18.4px;
  height: 18.4px;
  border-radius: 0;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  cursor: pointer;
}
/* 的中温度ちょうどの間だけ、つまみの縁を強調する */
.ink-range.hit::-webkit-slider-thumb { border-color: var(--ao); border-width: 2px; }
.ink-range.hit::-moz-range-thumb { border-color: var(--ao); border-width: 2px; }

.ticks {
  position: relative;
  height: 1.4rem;
  margin-top: -.6rem;
}
.ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--mist);
  font-size: .8rem;
  white-space: nowrap;
}
.ticks span.edge { color: var(--ink2); }

/* --- 比率（ratio） --- */
.tool-ratio-row { display: flex; flex-direction: column; gap: .3rem; }
.tool-ratio-label { margin: 0; color: var(--mist); font-size: .9rem; }
.tool-ratio-value { margin: 0; line-height: 1.05; }
.tool-ratio-amt { font-size: clamp(2.6rem, 7vw, 4.5rem); color: var(--ink); }
.tool-ratio-value em, .tool-ratio-amt + em, .tool-ratio-row em { font-size: 1rem; font-style: normal; color: var(--mist); margin-left: .2rem; }

.tool-ratio-outs {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.4rem;
  margin: 0;
}
.tool-ratio-outs > div { display: flex; flex-direction: column; gap: .2rem; }
.tool-ratio-outs dt { color: var(--mist); font-size: .9rem; }
.tool-ratio-outs dd {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--ink);
}
.tool-ratio-outs dd em { font-size: 1rem; font-style: normal; color: var(--mist); margin-left: .2rem; }

.tool-kaeshi, .tool-dilute, .tool-tentsuyu, .tool-stage {
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-dilute-item { display: flex; flex-direction: column; gap: .3rem; }
.tool-dilute-label { margin: 0; }
.tool-dilute-out { margin: .2rem 0 0; font-size: 1.3rem; color: var(--ink); }

.tool-tentsuyu-ratio { font-size: 1.6rem; color: var(--ink); margin: 0; }
.tool-tentsuyu-labels { margin: 0; color: var(--mist); font-size: .9rem; }

.tool-stage-val { display: flex; align-items: baseline; gap: .3rem; margin: 0; }
.tool-stage-val b {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  color: var(--ink);
}
.tool-stage-val em { font-size: 1rem; font-style: normal; color: var(--mist); }
.tool-stage-val.hit b { color: var(--ao); }
.tool-stage-line { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .tool * { transition: none !important; animation: none !important; }
}
