.sp-panel { padding: 1rem; margin-bottom: 1rem; }
#sf-section { scroll-margin-top: 80px; }
.sp-form { display: grid; gap: 1.25rem; }
.sp-form [hidden] { display: none; }
.sp-panel h2 { margin: 0 0 .5rem; }
.sp-panel h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.sp-intro { margin: 0 0 .75rem; }
.sp-notice { padding: .7rem .9rem; border-left: 3px solid #83919e; background: #83919e0c; margin: 0 0 1.5rem; }
.sp-group { min-width: 0; margin: 0; padding: 0 0 1.25rem; border: 0; border-bottom: 1px solid #83919e40; }
.sp-group legend { float: none; width: auto; margin: 0 0 .75rem; font-size: 1rem; font-weight: 600; }
.sp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .85rem 1rem; }
.sp-help { margin: .6rem 0 .8rem; font-size: .875rem; line-height: 1.6; opacity: .85; max-width: 85ch; }
.sp-group > .sp-help:last-child { margin-bottom: 0; }
.sp-details { padding: 1rem 0; border-top: 1px solid #83919e40; }
.sp-details summary { cursor: pointer; font-weight: 600; }
.sp-details[open] summary { margin-bottom: 1rem; }
.sp-rules { margin: 0; }
.sp-rules > div { display: grid; grid-template-columns: minmax(140px, 180px) minmax(0, 1fr); gap: .5rem 1.5rem; padding: .65rem 0; }
.sp-rules dt { font-weight: 600; }
.sp-rules dd { margin: 0; line-height: 1.6; max-width: 75ch; }
.sp-rules small { display: block; margin-top: .25rem; opacity: .8; }
.sp-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; padding: 0; margin: .75rem 0; }
.sp-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin: 1rem 0; }
.sp-metric { padding: .75rem; border: 1px solid #83919e40; border-radius: .25rem; }
.sp-metric dt { font-size: .875rem; font-weight: 400; }
.sp-metric dd { font-size: 1.1rem; font-weight: 600; margin: .35rem 0 0; }
#sp-status { margin: 1rem 0 0; }
.sp-form label { display: flex; flex-direction: column; gap: .35rem; }
.sp-form input, .sp-form select { min-width: 0; padding: .5rem; color: inherit; background: transparent; border: 1px solid #83919e; border-radius: .25rem; }
.sp-actions { display: flex; align-items: end; gap: .5rem; flex-wrap: wrap; }
#sp-grid { display: grid; gap: 4px; max-width: 560px; margin: 1rem auto; }
#sp-grid button { min-width: 0; padding: .45rem .15rem; min-height: 58px; border: 1px solid #83919e; background: transparent; color: inherit; border-radius: .3rem; font-size: .8rem; white-space: pre-line; }
#sp-grid button[data-use="Food"] { background: #d8eedc; color: #173a20; }
#sp-grid button[data-use="military"] { background: #d4e5f9; color: #173353; }
#sp-grid button[aria-pressed="true"] { border: 2px dashed #ad6128; }
#sp-grid button:focus-visible { outline: 3px solid #e69a33; }
#sp-warnings { padding-left: 1.25rem; max-width: 90ch; margin: 0; }
#sp-warnings li { margin-bottom: .65rem; line-height: 1.6; }
@media (max-width: 600px) {
  .sp-rules > div { grid-template-columns: 1fr; gap: .25rem; }
  #sp-grid button { font-size: .65rem; overflow-wrap: anywhere; white-space: pre-line; }
}
.sp-panel table { width: 100%; border-collapse: collapse; }
.sp-panel th, .sp-panel td { padding: .5rem; text-align: left; border-bottom: 1px solid #83919e55; white-space: nowrap; }
.sp-panel .ref-table-scroll { overflow-x: auto; }
.sp-panel .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
