/* Lazy Cat Tools — Kitchen section (converter, charts, ingredient + amount pages).
   Uses the tokens from site.css. Bump ?v= on the <link> when this file changes. */

.kitchen-main {
  width: 100%;
  max-width: var(--tool-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  flex: 1;
}

.crumbs {
  font-size: 0.8rem;
  color: var(--stone);
  margin-bottom: 1rem;
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.crumbs li + li::before { content: '›'; margin-right: 0.35rem; color: var(--border); }
.crumbs a { color: var(--stone); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.kitchen-main h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

.answer {
  margin-top: 0.6rem;
  font-size: 1.075rem;
  line-height: 1.55;
  color: var(--ink);
  max-width: 62ch;
}
.answer strong { font-weight: 800; color: var(--accent); }

/* ── Converter ──────────────────────────────────────────────────────────── */

.converter {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 10px rgba(28, 28, 28, 0.06);
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.conv-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.conv-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }

.conv-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

.conv-field input,
.conv-field select {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.75rem;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.conv-field select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236B6A64' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}

.conv-field input:focus,
.conv-field select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px rgba(55, 48, 163, 0.14);
}

.conv-field input[aria-invalid="true"] { border-color: var(--highlight); }

.conv-error {
  font-size: 0.8rem;
  color: var(--highlight);
  font-weight: 600;
}

.conv-result {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  min-height: 92px;
}

.conv-result-main {
  font-size: clamp(1.9rem, 7vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.conv-result-sub {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}

.conv-note {
  font-size: 0.8rem;
  color: var(--stone);
  margin-top: -0.25rem;
}

/* ── Content ───────────────────────────────────────────────────────────── */

.k-section { margin-top: 2.5rem; }

.k-section h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
  scroll-margin-top: 1rem;
}

.k-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.4rem;
}

.prose p {
  color: #4A4944;
  font-size: 0.975rem;
  line-height: 1.7;
  max-width: 68ch;
  margin-bottom: 0.9rem;
}
.prose a, .k-section a { color: var(--accent); text-underline-offset: 2px; }

.source {
  font-size: 0.8rem;
  color: var(--stone);
  margin-top: 0.25rem;
}

/* ── Charts ────────────────────────────────────────────────────────────── */

.chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.chart {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chart caption {
  text-align: left;
  font-size: 0.85rem;
  color: var(--stone);
  padding-bottom: 0.5rem;
}

.chart th,
.chart td {
  padding: 0.6rem 0.9rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.chart th:first-child,
.chart td:first-child { text-align: left; }
.chart thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stone);
  background: var(--bg);
}
.chart tbody tr:last-child td,
.chart tbody tr:last-child th { border-bottom: 0; }
.chart tbody th { font-weight: 700; color: var(--ink); }
.chart td.num-main { font-weight: 700; color: var(--ink); }
.chart td { color: var(--stone); }
.chart tbody tr:target { background: var(--warm-bg); }
.chart tbody tr:target th { color: var(--warm-text); }
.chart a { color: var(--ink); text-decoration: none; font-weight: 700; }
.chart a:hover { color: var(--accent); text-decoration: underline; }

.approx { color: var(--stone); font-weight: 400; }

/* ── Link lists ────────────────────────────────────────────────────────── */

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.25rem 1.25rem;
  list-style: none;
}
.link-grid li { border-bottom: 1px solid var(--border); }
.link-grid a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.925rem;
  text-decoration: none;
}
.link-grid a span { color: var(--stone); font-weight: 400; font-variant-numeric: tabular-nums; }
.link-grid a:hover { color: var(--accent); }

.hub-group + .hub-group { margin-top: 1.5rem; }
.hub-group h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stone);
  margin-bottom: 0.25rem;
}

.tool-feature {
  display: block;
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-feature:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(55, 48, 163, 0.12); }
.tool-feature strong { display: block; font-size: 1.05rem; font-weight: 800; }
.tool-feature span { display: block; margin-top: 0.2rem; font-size: 0.9rem; color: var(--stone); }

/* ── FAQ (reuses .faq-inner details styling from site.css) ─────────────── */

.k-faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  background: var(--surface);
}
.k-faq summary {
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.k-faq summary::-webkit-details-marker { display: none; }
.k-faq summary::after { content: '+'; font-weight: 400; color: var(--stone); }
.k-faq details[open] summary::after { content: '−'; }
.k-faq details p {
  padding: 0.7rem 1rem 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.925rem;
  line-height: 1.7;
  color: #4A4944;
}
.k-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 420px) {
  .kitchen-main { padding: 1.25rem 1rem 2.5rem; }
  .converter { padding: 1rem; }
  .chart th, .chart td { padding: 0.55rem 0.65rem; }
}

/* ── Phase 3 tools: result rows, recipe box, controls ──────────────────── */

.result-rows {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.925rem;
  font-variant-numeric: tabular-nums;
}
.result-rows:empty { display: none; }
.result-rows dt { color: var(--stone); }
.result-rows dd { font-weight: 700; color: var(--ink); text-align: right; }

.conv-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.converter textarea {
  width: 100%;
  min-height: 190px;
  padding: 0.75rem;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.converter textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(55, 48, 163, 0.14);
}
.conv-field .hint { font-weight: 400; color: var(--stone); font-size: 0.8rem; }

.recipe-actions { display: flex; justify-content: flex-end; margin-top: 0.4rem; }

.btn-ghost {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.8rem;
  min-height: 40px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.btn-ghost:hover { border-color: var(--accent); background: var(--bg); }
.btn-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.scale-controls { border: 0; display: grid; gap: 0.75rem; min-width: 0; }
.scale-controls legend { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.5rem; }

.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg button,
.seg label {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.95rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.seg button[aria-pressed="true"],
.seg label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg button:focus-visible,
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-radio input { accent-color: #fff; margin: 0; }

.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.recipe-result { border-top: 1px solid var(--border); padding-top: 1rem; }
.recipe-result-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.recipe-result-head h2 { font-size: 1rem; font-weight: 800; margin-right: auto; }
.copy-status { font-size: 0.8rem; color: var(--stone); }
.recipe-empty { color: var(--stone); font-size: 0.925rem; }

.recipe-out { list-style: none; display: grid; gap: 0.15rem; }
.recipe-out li {
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.975rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.recipe-out li.r-converted span,
.recipe-out li.r-scaled span { font-weight: 600; }
.recipe-out li.r-unchanged { color: var(--stone); }
.recipe-out li.r-unmatched { background: var(--warm-bg); }
.recipe-out li small { display: block; font-size: 0.78rem; color: var(--warm-text); }

.tool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.tool-list .tool-feature { margin-top: 0; }

@media (max-width: 420px) {
  .conv-row-3 { grid-template-columns: 1fr 1fr; }
  .conv-row-3 .conv-field:first-child { grid-column: 1 / -1; }
}

/* ── Guides ────────────────────────────────────────────────────────────── */

.byline { margin-top: 0.5rem; font-size: 0.85rem; color: var(--stone); }
.byline a { color: var(--stone); text-underline-offset: 2px; }

.guide-body { margin-top: 1.75rem; }
.guide-body p { font-size: 1.025rem; line-height: 1.75; color: #3D3C38; }
.guide-body h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 2.25rem 0 0.6rem;
  scroll-margin-top: 1rem;
}
.guide-body h3 { font-size: 1.075rem; font-weight: 700; margin: 1.5rem 0 0.4rem; }
.guide-body ol,
.guide-body ul { margin: 0 0 1rem 1.25rem; max-width: 66ch; }
.guide-body li { font-size: 1.025rem; line-height: 1.7; color: #3D3C38; margin-bottom: 0.35rem; padding-left: 0.2rem; }
.guide-body li::marker { color: var(--accent); font-weight: 700; }
.guide-body .chart-wrap { margin: 0.5rem 0 1.25rem; }
.guide-body strong { color: var(--ink); }

/* ── Pan size converter ────────────────────────────────────────────────── */

.pan-set { border: 0; display: grid; gap: 0.6rem; min-width: 0; }
.pan-set + .pan-set { margin-top: 0.25rem; }
.pan-set legend { font-size: 0.85rem; font-weight: 700; color: var(--ink); margin-bottom: 0.5rem; }
.pan-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pan-note { margin-top: 0.6rem; font-size: 0.9rem; line-height: 1.55; color: var(--ink); max-width: 60ch; }
.pan-note:empty { display: none; }
.pan-scale { justify-self: start; text-decoration: none; }
.pan-scale[hidden] { display: none; }
[data-custom][hidden], [data-b][hidden] { display: none; }
