/* "How much to feed" (single product). Theme tokens only, so every palette carries it. */
.pf { margin-top: 6px; }
.pf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pf-for { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pf-for strong { color: var(--ink); }
.pf-label { display: block; margin-top: 20px; font-family: var(--mono); font-size: 11px; letter-spacing: .13em; color: var(--muted); text-transform: uppercase; }

/* Weight */
.pf-weight { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pf-step { width: 40px; height: 40px; border: 1px solid var(--rule); background: var(--white); color: var(--ink); font-size: 20px; font-weight: 700; cursor: pointer; flex: none; }
.pf-step:hover { border-color: var(--ink); }
.pf-num { display: flex; align-items: baseline; gap: 6px; }
.pf-num input { width: 84px; border: 0; background: transparent; font: 800 34px/1 var(--sans); letter-spacing: -.035em; color: var(--ink); text-align: right; padding: 0; -moz-appearance: textfield; }
.pf-num input::-webkit-inner-spin-button, .pf-num input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pf-num span { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: var(--muted); }

.pf-range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 10px 0 0; background: transparent; cursor: pointer; --pf-p: 50%; }
.pf-range::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(90deg, var(--blue) var(--pf-p), var(--rule) var(--pf-p)); }
.pf-range::-moz-range-track { height: 6px; background: var(--rule); }
.pf-range::-moz-range-progress { height: 6px; background: var(--blue); }
.pf-range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; background: var(--white); border: 3px solid var(--blue); border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .12s; }
.pf-range::-moz-range-thumb { width: 18px; height: 18px; background: var(--white); border: 3px solid var(--blue); border-radius: 50%; }
.pf-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.pf-range:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.pf-size { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.pf-size span { transition: color .15s; }
.pf-size span.is-on { color: var(--blue); font-weight: 600; }

/* Weight: just the slider, the number rides on the thumb. */
.pf-wslide { position: relative; padding-top: 30px; margin-top: 2px; }
.pf-wslide .pf-range { margin-top: 0; }
.pf-bubble { position: absolute; top: 0; transform: translateX(-50%); padding: 3px 7px; background: var(--ink); color: var(--white); font: 600 12.5px/1.2 var(--mono); letter-spacing: .02em; white-space: nowrap; pointer-events: none; }
.pf-bubble::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: var(--ink); }

/* Goal: one compact row. */
.pf-seg { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 8px; border: 1px solid var(--rule); }
.pf-seg button { height: 38px; border: 0; border-left: 1px solid var(--rule); background: var(--white); color: var(--ink); font: 600 13.5px var(--sans); cursor: pointer; }
.pf-seg button:first-child { border-left: 0; }
.pf-seg button:hover { background: var(--bg); }
.pf-seg button.is-on { background: var(--ink); color: var(--white); }
.pf-seg button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* Life stage dropdown: square like the rest of the theme, custom arrow. */
.pf-select { position: relative; margin-top: 8px; }
.pf-select select { -webkit-appearance: none; appearance: none; width: 100%; height: 46px; padding: 0 40px 0 14px; border: 1px solid var(--rule); border-radius: 0; background: var(--white); color: var(--ink); font: 600 15px var(--sans); cursor: pointer; }
.pf-select select:hover { border-color: var(--ink); }
.pf-select select:focus-visible { outline: 2px solid var(--blue); outline-offset: -1px; }
.pf-select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
label.pf-label { cursor: default; }

/* Chips */
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pf-chip { border: 1px solid var(--rule); background: var(--white); color: var(--ink); padding: 9px 13px; font: 600 13.5px/1.1 var(--sans); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.pf-chip:hover { border-color: var(--ink); }
.pf-chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--white); }
.pf-chip small { display: block; margin-top: 3px; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; opacity: .7; }
.pf-fixed-row[hidden], .pf-goal[hidden] { display: none; }
.pf-fixed-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; }
.pf-switch { position: relative; width: 42px; height: 24px; flex: none; }
.pf-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pf-switch span { position: absolute; inset: 0; background: var(--rule); border-radius: 12px; transition: background .15s; pointer-events: none; }
.pf-switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: var(--white); border-radius: 50%; transition: transform .15s; }
.pf-switch input:checked + span { background: var(--blue); }
.pf-switch input:checked + span::after { transform: translateX(18px); }
.pf-switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.pf-act { margin-top: 4px; }
.pf-act__label { font-weight: 700; font-size: 15px; margin-top: 2px; }
.pf-act__hint { font-size: 13px; color: var(--muted); }

/* Result */
.pf-result { margin-top: 24px; background: var(--blue); color: var(--on-blue); padding: 20px 22px; }
.pf-result .pd-kicker { color: var(--on-blue-soft, rgba(255,255,255,.75)); }
.pf-big { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.pf-big b { font: 800 52px/1 var(--sans); letter-spacing: -.04em; }
.pf-big span { font-family: var(--mono); font-size: 12px; letter-spacing: .13em; opacity: .85; }
.pf-bowl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; min-height: 30px; }
.pf-cup { position: relative; width: 26px; height: 30px; border: 2px solid currentColor; border-top-width: 0; border-radius: 0 0 9px 9px; overflow: hidden; opacity: .95; }
.pf-cup::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--pf-fill); background: currentColor; transition: height .25s ease; }
.pf-cup::after { content: ""; position: absolute; left: -2px; right: -2px; top: 0; border-top: 2px solid currentColor; }
.pf-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; opacity: .9; }
.pf-facts b { font-weight: 600; }
/* Cost a day: sits on the result panel, so it takes the panel's own text colour. */
.pf-cost { margin-top: 14px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); font-size: 15px; line-height: 1.4; }
.pf-cost[hidden] { display: none; }
.pf-cost b { font-weight: 700; }
.pf-cost small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; opacity: .85; }

/* Remember-your-dog prompt */
.pf-save { margin-top: 14px; border: 1px solid var(--rule); background: var(--white); padding: 14px 16px; animation: pf-in .25s ease; }
.pf-save[hidden] { display: none; }
.pf-save__q { font-weight: 700; font-size: 15px; }
.pf-save__form { display: flex; gap: 8px; margin-top: 10px; }
.pf-save__form input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--rule); padding: 0 12px; font: 500 15px var(--sans); background: var(--white); color: var(--ink); }
.pf-save__form input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.pf-save__form button, .pf-save__btn { height: 42px; padding: 0 16px; border: 0; background: var(--ink); color: var(--white); font: 700 14px var(--sans); cursor: pointer; }
.pf-save__btn { margin-top: 10px; }
.pf-save__form button:disabled { opacity: .5; cursor: default; }
.pf-save__fine { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
@keyframes pf-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pf-save { animation: none; } .pf-cup::before { transition: none; } }
@media (max-width: 720px) { .pf-big b { font-size: 44px; } .pf-chip { padding: 9px 11px; } }
.pf-bowl[hidden] { display: none; }

/* ─────────── Horizontal layout (full-width band under the nutrition table) ─────────── */
.pd-stack { display: grid; gap: 20px; }
.pf--wide .pf-head { align-items: flex-end; }
.pf-title { margin: 6px 0 0; font: 800 26px/1.1 var(--sans); letter-spacing: -.03em; color: var(--ink); }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 28px; margin-top: 22px; align-items: stretch; }

.pf-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 20px; align-content: start; }
.pf-ctl { min-width: 0; }
.pf-ctl--weight { grid-column: 1 / -1; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.pf--wide .pf-ctl > .pf-label:first-child { margin-top: 0; }
.pf-ticks { display: flex; justify-content: space-between; margin-top: 2px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--muted); }
.pf--wide .pf-fixed-row { font-size: 13.5px; }

/* Result: the accent panel with a faint grid, like the homepage hero. */
.pf--wide .pf-result {
  margin-top: 0; display: flex; flex-direction: column; padding: 26px 28px;
  background-color: var(--blue);
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 22px 22px;
}
.pf--wide .pf-big b { font-size: 72px; }
.pf--wide .pf-big span { font-size: 13px; }
.pf-plan { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid rgba(255,255,255,.28); }
.pf-plan li { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.16); }
.pf-plan span { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.pf-plan b { font-weight: 700; font-size: 16px; }
.pf--wide .pf-facts { margin-top: auto; padding-top: 16px; font-size: 12px; }

/* The "remember your dog" prompt as one line across the band. */
.pf--wide .pf-save:not([hidden]) { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-top: 20px; }
.pf--wide .pf-save__q { flex: 1 1 260px; }
.pf--wide .pf-save__form { margin-top: 0; flex: 1 1 340px; }
.pf--wide .pf-save__fine { flex-basis: 100%; margin-top: 0; }
.pf--wide .pf-save__btn { margin-top: 0; }

@media (max-width: 960px) {
  .pf-grid { grid-template-columns: 1fr; }
  .pf-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .pf-controls { grid-template-columns: 1fr; }
  .pf--wide .pf-big b { font-size: 56px; }
  .pf-title { font-size: 22px; }
}
/* The dry-matter table now runs full width above the calculator: nutrient names read from the left edge. */
.pd-stack .pd-dm th:first-child, .pd-stack .pd-dm td:first-child { text-align: left; }
