:root {
  --text: #171717;
  --sub: #6b6b6b;
  --line: #dedede;
  --bg: #fff;
  --soft: #f7f7f7;
  --accent: #245c43;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.55;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.wrap { width: min(720px, calc(100% - 32px)); margin: 0 auto; }

header { border-bottom: 1px solid var(--line); }
.topbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--sub);
}
.logo { color: var(--text); font-size: 18px; font-weight: 800; text-decoration: none; letter-spacing: -.04em; }

.intro { padding: 64px 0 54px; }
h1, h2, h3, p { margin-top: 0; }
.intro h1 {
  margin-bottom: 14px;
  font-size: clamp(36px, 8vw, 58px);
  line-height: 1.1;
  letter-spacing: -.055em;
}
.intro p { margin-bottom: 0; color: var(--sub); }

.tools { padding-bottom: 72px; }
h2 { margin-bottom: 14px; font-size: 20px; letter-spacing: -.03em; }
.tool-search { display: block; margin-bottom: 10px; }
.tool-search input {
  width: 100%;
  height: 44px;
  padding: 0 11px;
  border: 1px solid #bbb;
  border-radius: 0;
  outline: 0;
  background: #fff;
}
.tool-search input:focus { border-color: var(--text); }
.tool-list { border-top: 1px solid var(--line); }
.tool-row {
  min-height: 54px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-decoration: none;
}
a.tool-row:hover strong { text-decoration: underline; text-underline-offset: 3px; }
a.tool-row.active strong { text-decoration: underline; text-underline-offset: 3px; }
.tool-row span { color: var(--accent); font-size: 13px; }
.tool-row[hidden] { display: none; }
.tool-row.disabled { color: #999; }
.tool-row.disabled span { color: #aaa; }
.tool-search-empty { margin: 12px 4px 0; color: var(--sub); font-size: 13px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.calculator { padding: 56px 0 80px; border-top: 1px solid var(--line); }
.calculator[hidden] { display: none; }
.section-title { margin-bottom: 28px; }
.section-title h2 { margin-bottom: 5px; font-size: 28px; }
.section-title p { margin-bottom: 0; color: var(--sub); font-size: 14px; }

form { margin: 0; }
.servings {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
}
label > span, .ingredients-title { font-size: 13px; font-weight: 700; }
label > span { display: block; margin-bottom: 6px; }
.unit-input {
  height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid #bbb;
  background: #fff;
}
.unit-input:focus-within { border-color: var(--text); }
.unit-input input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 11px;
  border: 0;
  outline: 0;
  background: transparent;
}
.unit-input span { padding-right: 11px; color: var(--sub); white-space: nowrap; }
.to { padding-bottom: 12px; color: var(--sub); }

.ingredients-title {
  margin-top: 30px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.link-button, .copy {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}
.ingredient-list { border-top: 1px solid var(--line); }
.ingredient-row {
  display: grid;
  grid-template-columns: 1.6fr .7fr .7fr 34px;
  border-bottom: 1px solid var(--line);
}
.ingredient-row input {
  width: 100%;
  height: 46px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: transparent;
}
.ingredient-row input:focus { background: var(--soft); }
.remove-row {
  border: 0;
  background: transparent;
  color: #999;
  font-size: 20px;
}
.hint { margin: 8px 0 18px; color: var(--sub); font-size: 12px; }
.submit {
  width: 100%;
  height: 48px;
  border: 0;
  background: var(--text);
  color: #fff;
  font-weight: 800;
}
.submit:hover { background: #000; }
.submit:active { transform: translateY(1px); }

.result { margin-top: 28px; padding-top: 28px; border-top: 2px solid var(--text); }
.result h3 { margin-bottom: 12px; font-size: 18px; }
.result-item {
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.result-item strong { font-variant-numeric: tabular-nums; }
.result-actions { min-height: 42px; display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--accent); }

footer { border-top: 1px solid var(--line); color: var(--sub); font-size: 12px; }
footer .wrap { min-height: 64px; display: flex; align-items: center; }



.work-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.answer-text {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
  .topbar span { display: none; }
  .intro { padding: 48px 0 44px; }
  .tools { padding-bottom: 56px; }
  .calculator { padding: 44px 0 64px; }
  .ingredient-row { grid-template-columns: 1fr .65fr .65fr 32px; }
  .work-fields { grid-template-columns: 1fr; }
}
