.livestock-nav, .livestock-actions, .livestock-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-block: .85rem;
}
.livestock-nav a, .livestock-actions button, .livestock-links a, [data-livestock-compost] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .52rem .76rem;
  border: 1px solid #546e5a;
  border-radius: .54rem;
  background: #24352a;
  color: #e1eadb;
  font: inherit;
  line-height: 1.25;
}
.livestock-actions :hover, .livestock-nav a:hover, .livestock-nav [aria-current="page"],
.livestock-links a:hover, [data-livestock-compost]:hover {
  border-color: #bad19a;
  background: #354b34;
}
.livestock-actions [hidden], .livestock-results [hidden] { display: none; }
.livestock-note, .livestock-scope { max-width: 78ch; color: #c4d0bf; margin: .6rem 0; }
.livestock-note { border-left: 3px solid #acc68a; padding-left: .8rem; }
.livestock-scope { color: #abbba8; margin-bottom: .95rem; font-size: .9rem; }
.livestock-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: .72rem;
  align-items: start;
}
.livestock-panel {
  min-width: 0;
  padding: clamp(.85rem, 2.7vw, 1.35rem);
  border-radius: .75rem;
  border: 1px solid #415343;
  background: #19241b;
}
.livestock-panel fieldset { border: 0; margin: 0 0 .95rem; padding: 0; min-width: 0; }
.livestock-panel legend { color: #e8ecd9; font-weight: 700; margin-bottom: .42rem; }
.livestock-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.livestock-fields label, .livestock-mode { display: grid; gap: .28rem; color: #d0ddca; font-size: .94rem; }
.livestock-panel :is(input,select) {
  background: #111a14;
  color: #eff4e5;
  border: 1px solid #56705a;
  border-radius: .46rem;
  padding: .43rem .6rem;
  min-height: 44px;
  width: 100%;
  min-width: 0;
  font: inherit;
}
.livestock-panel input[aria-invalid="true"] { border-color: #ee997f; }
.livestock-panel :is(a,button,input,select):focus-visible, .livestock-nav a:focus-visible {
  outline: 2px solid #edbd88;
  outline-offset: 2px;
}
.livestock-actions:last-child { margin-bottom: 0; }
.livestock-results { background: linear-gradient(135deg, #293c2a, #19251c 65%); }
.livestock-output-title { display: flex; align-items: center; gap: .65rem; min-height: 3.1rem; }
.livestock-output-title img { object-fit: contain; width: 52px; height: 52px; }
.livestock-output-title h2 { margin: 0; line-height: 1.12; font-size: 1.6rem; }
.livestock-results dl { display: grid; gap: .35rem; margin-block: .65rem .85rem; }
.livestock-results dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .56rem .6rem;
  border-radius: .45rem;
  background: #131e16;
}
.livestock-results dt { color: #d9e5d2; }
.livestock-results dd {
  margin: 0;
  text-align: end;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: #e0efb6;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.livestock-progress { height: .46rem; border-radius: 9px; overflow: hidden; background: #101811; margin-block: .8rem; }
.livestock-progress > span {
  display: block;
  width: var(--livestock-fill, 0%);
  height: 100%;
  background: linear-gradient(90deg, #669844, #d1ec8e);
  transition: width .3s ease;
}
.livestock-results p { color: #becdba; font-size: .9rem; margin: .45rem 0 0; }
.livestock-results [role="status"]:empty { display: none; }
.livestock-results [data-livestock-compost] { margin-top: .64rem; }
.livestock-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .53rem;
  margin-top: .72rem;
}
.livestock-items a { display: flex; align-items: center; gap: .5rem; padding: .56rem; border: 1px solid #415343; border-radius: .58rem; }
.livestock-items a:hover { border-color: #bad19a; }
.livestock-items img { flex: 0 0 auto; object-fit: contain; }
.livestock-items span { overflow-wrap: anywhere; }
.livestock-overview { margin-block: 1.15rem; }
.livestock-overview h2 { color: #e3ecdf; font-size: 1.5rem; margin: 0; }
.livestock-overview a { align-items: start; background: #1c291d; }
.livestock-overview p { color: #bdcdb7; font-size: .9rem; margin: .25rem 0 0; }
.ranch-gear { margin-block: 1.5rem 2.2rem; }
.ranch-gear a {
  background: radial-gradient(ellipse at 30% 30%, #334932, #1b271e 75%);
  padding: clamp(.65rem, 2vw, 1rem);
}
.ranch-gear img { max-width: 64px; }
.livestock-sources { color: #bbcdb9; margin: .85rem 0 1rem; }
.livestock-sources summary { cursor: pointer; }
.livestock-sources a { text-decoration: underline; }
@media (max-width: 760px) {
  .livestock-grid, .livestock-items { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .livestock-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .livestock-progress > span { transition: none; }
}
