.market-entry .food-collection-entry { background: #ffcf8b; margin: 4px 0 10px; color: #302a20; }
#foodTemplateActions { border-top: 1px solid #426b54; padding-top: 8px; margin-top: 12px; }
#foodTemplateActions[hidden] { display: none; }
.market-entry #selectFoodFront { background: #315747; color: #f3f8dc; border: 1px solid #6f9079; font-weight: 400; font-size: 11px; }
#foodTemplateDialog { width: min(1320px, calc(100vw - 28px)); max-height: calc(100vh - 28px); background: #f5f2e9; color: #23372e; overflow: hidden; border: 1px solid #c7cbbd; border-radius: 16px; }
.food-collection-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 26px 28px 22px; background: #163b2e; color: #fff8e9; }
.food-collection-eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 700; color: #d9f99d; }
.food-collection-header h2 { font-family: Georgia, serif; font-size: 33px; font-weight: 700; line-height: 1.2; margin: 6px 0; }
.food-collection-header p:last-child { font-size: 12px; color: #d8e6da; }
.food-close { background: #315547; border: 1px solid #648475; border-radius: 6px; padding: 8px 14px; font-size: 12px; }
.food-template-body { display: grid; grid-template-columns: minmax(0, 1fr) 370px; max-height: calc(100vh - 275px); min-height: 300px; }
.food-template-browse { padding: 22px; overflow-y: auto; }
.food-section-heading { display: flex; justify-content: space-between; gap: 10px; font-size: 9px; letter-spacing: 1px; font-weight: 700; color: #516257; margin-bottom: 15px; }
.food-section-heading span:last-child:not(:first-child) { font-weight: 400; letter-spacing: 0; }
#foodTemplateGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.food-template-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; text-align: left; background: #fffdf8; border: 2px solid transparent; border-radius: 10px; padding: 10px 10px 13px; box-shadow: 0 2px 8px #152e2112; transition: border-color .12s, transform .12s; }
.food-template-card:hover { transform: translateY(-2px); border-color: #93a783; }
.food-template-card[aria-pressed="true"] { border-color: #2e603c; background: #edf2e3; }
.food-template-card img { width: 100%; height: 180px; object-fit: contain; background: #eae7de; border-radius: 5px; padding: 8px; margin-bottom: 5px; }
.food-template-card strong { font-size: 13px; line-height: 1.4; }
.food-template-card span { font-size: 10px; color: #5b695d; line-height: 1.4; }
.food-template-detail { padding: 22px; border-left: 1px solid #dadccf; background: #fffdf7; overflow-y: auto; }
.food-template-detail h3 { font-size: 22px; font-weight: 700; font-family: Georgia, serif; margin-bottom: 6px; }
#foodTemplateDescription { font-size: 12px; line-height: 1.6; color: #536258; margin-bottom: 12px; }
.food-preview-stage { height: 275px; background: #e9e8dd; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 16px; }
#foodTemplatePreview { max-width: 100%; max-height: 100%; width: auto; height: auto; filter: drop-shadow(0 7px 8px #142d2420); }
#foodPreviewStatus { font-size: 10px; line-height: 1.5; color: #536258; min-height: 30px; padding: 7px 0; }
.food-template-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 22px; }
.food-template-detail label { display: block; font-size: 11px; font-weight: 700; line-height: 1.5; }
.food-template-detail label[hidden] { display: none; }
.food-template-detail select { width: 100%; display: block; padding: 9px 7px; font-size: 12px; color: #23372e; background: #fff; border: 1px solid #afbcae; border-radius: 5px; margin-top: 5px; }
#foodTerritoryLabel { margin-top: 12px; }
#foodMarketNote, #foodTemplateContents { font-size: 11px; line-height: 1.6; color: #536258; margin-top: 10px; }
#foodReadGuide { font-size: 11px; text-decoration: underline; text-underline-offset: 3px; color: #315f3b; margin-top: 8px; text-align: left; }
.food-collection-disclaimer { font-size: 11px; line-height: 1.7; margin: 22px 0 2px; color: #5b655a; }
.food-collection-footer { display: flex; justify-content: space-between; align-items: center; gap: 22px; border-top: 1px solid #cbd0c2; background: #eef0e5; padding: 16px 25px; }
.food-collection-footer p { font-size: 11px; line-height: 1.6; color: #536258; }
#foodTemplateError { color: #b42318; font-weight: 700; max-width: 780px; }
#useFoodTemplate { border-radius: 7px; font-size: 13px; font-weight: 700; background: #163b2e; color: #fff8e9; padding: 13px 22px; min-width: 190px; }
#useFoodTemplate:disabled { opacity: .45; cursor: not-allowed; }
#foodTemplateDialog button:focus-visible, #foodTemplateDialog select:focus-visible { outline: 3px solid #ce751e; outline-offset: 2px; }
@media (max-width: 1150px) {
  #foodTemplateGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .food-template-body { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 850px) {
  #foodTemplateDialog { overflow-y: auto; }
  .food-template-body { display: block; max-height: none; }
  .food-template-detail { border-left: none; border-top: 1px solid #dadccf; }
  .food-collection-footer { position: sticky; bottom: 0; flex-direction: column; align-items: stretch; gap: 8px; }
  .food-collection-header h2 { font-size: 27px; }
  .food-template-card img { height: 150px; }
}
@media (max-width: 480px) {
  #foodTemplateGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .food-template-browse, .food-template-detail { padding: 15px; }
}
