/* Card consistency layer. Keep this after the original card/photo styles.
   The grid owns row height; every card can grow for real source information. */
.food-grid {
  align-items: start;
}
.food-grid > .food.food-compact,
.menu-photo-rail > .food.food-compact {
  align-self: start;
  min-width: 0;
  height: auto;
  max-height: none;
}
.food-grid > .food.food-compact {
  align-items: flex-start;
}
.food.food-compact .food-main {
  min-width: 0;
}
/* Two lines give short/long names the same starting rhythm. The complete name
   remains in the DOM and in the details button's accessible name. */
.food.food-compact .food-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  min-block-size: 2.7em; /* fallback for older browsers without lh */
  min-block-size: 2lh;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* Photo cards are image-led: a full-width square hero sits above the A footer.
   A square reads as roughly 60% of a typical card, but the footer may grow for
   source warnings or larger text. Do not force a percentage height or clip it. */
.food-grid > .food.food-compact:has(> .representative-food-photo),
.food-grid > .food.food-compact:has(> .sample-food-photo) {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  padding: 0;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.food.food-compact > .representative-food-photo,
.food.food-compact > .sample-food-photo {
  order: 0;
  width: 100%;
  height: auto;
  min-width: 0;
  aspect-ratio: 4 / 3;
  flex: 0 0 auto;
  align-self: stretch;
  margin: 0;
  border-radius: 15px 15px 0 0;
  overflow: hidden;
}
.food.food-compact > .representative-food-photo .representative-photo-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: inherit;
}
.food.food-compact > .representative-food-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.food-grid > .food.food-compact:has(> .representative-food-photo) .food-main,
.food-grid > .food.food-compact:has(> .sample-food-photo) .food-main {
  order: 1;
  width: 100%;
  flex: 1 0 auto;
  padding: 17px 15px;
}
.food-grid > .food.food-compact:has(> .representative-food-photo) .food-actions,
.food-grid > .food.food-compact:has(> .sample-food-photo) .food-actions {
  position: absolute;
  inset: 10px 10px auto auto;
  height: 44px;
  min-width: 44px;
}
/* A neutral favorite button stays readable over any image in either theme. */
.food-grid > .food.food-compact:has(> .representative-food-photo) .heart,
.food-grid > .food.food-compact:has(> .sample-food-photo) .heart {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d2d7d3;
  border-radius: 50%;
  background: #fff!important;
  color: #174c37;
  box-shadow: 0 1px 5px #0003;
}
/* Ratings, missing-source notes, serving text and allergens must remain whole.
   Their natural height also expands every sibling in the same grid row. */
.food.food-compact :is(.food-rating-line, .source-serving, .missing-note, .meta, .tag) {
  overflow-wrap: anywhere;
}
.food.food-compact .tags {
  min-width: 0;
  padding-right: 20px;
  overflow: visible;
}
.food.food-compact .tag {
  min-width: 0;
  white-space: normal;
}
/* Support surviving horizontal shelves without restoring the removed menu rail. */
.menu-photo-rail {
  align-items: stretch;
}
.menu-photo-rail > .food.food-compact {
  overflow: visible;
}
/* White cards have a softly neutral canvas and more saturated semantic accents.
   Dark mode retains its existing palette and uses the exact same geometry. */
:root:not([data-theme=dark]) {
  --canvas: #f5f6f5;
  --surface: #fff;
  --surface-soft: #edf0ee;
  --line: #d8e0da;
  --macro-protein: #0867bd;
  --macro-carbs: #9b4b00;
  --macro-fat: #833bb7;
}
:root:not([data-theme=dark]) .food.food-compact {
  background: #fff;
  border-color: #d8e0da;
  box-shadow: 0 2px 10px #193b2610;
}
/* Independent cards, not a full-width panel behind an incomplete grid row. */
:root .menu-section>.food-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding:0;background:transparent;box-shadow:none;border-radius:0;gap:16px}
:root .menu-section{width:min(100%,1120px);margin-inline:auto}
:root .menu-section>.food-grid>.food.food-compact,
:root .menu-section>.food-grid>.food.food-compact:focus-within{background:var(--surface);border-radius:16px}
:root .food-grid>.food.food-compact:not(:has(>.representative-food-photo)):not(:has(>.sample-food-photo)){padding:16px}
:root .food-grid>.food.food-compact:has(>.representative-food-photo) .heart,
:root .food-grid>.food.food-compact:has(>.sample-food-photo) .heart{border:0;border-radius:0;background:transparent!important;box-shadow:none;color:#174c37;filter:drop-shadow(0 0 2px #fff) drop-shadow(0 0 1px #fff)}

/* Preserve reviewed bowl/box context instead of cropping it into a texture. */
.food.food-compact > .representative-food-photo[data-photo-fit="contain"] img{object-fit:contain}

/* Photo-card save action belongs to the caption, never over the image. */
:root .food-grid>.food.food-compact:has(>.representative-food-photo),
:root .food-grid>.food.food-compact:has(>.sample-food-photo){display:grid;grid-template-columns:minmax(0,1fr) 52px;grid-template-rows:auto 1fr;align-items:start}
:root .food-grid>.food.food-compact> :is(.representative-food-photo,.sample-food-photo){grid-column:1/-1;grid-row:1}
:root .food-grid>.food.food-compact> :is(.representative-food-photo,.sample-food-photo){aspect-ratio:16/9;max-height:300px}
:root .food-grid>.food.food-compact>.representative-food-photo .representative-photo-image{aspect-ratio:16/9;max-height:300px}
:root .food-grid>.food.food-compact:has(>.representative-food-photo) .food-main,
:root .food-grid>.food.food-compact:has(>.sample-food-photo) .food-main{grid-column:1;grid-row:2;padding:14px 0 14px 15px}
:root .food-grid>.food.food-compact:has(>.representative-food-photo) .food-actions,
:root .food-grid>.food.food-compact:has(>.sample-food-photo) .food-actions{position:static;inset:auto;grid-column:2;grid-row:2;align-self:start;margin:7px 4px 0;min-width:44px;height:44px}
:root .food-grid>.food.food-compact:has(>.representative-food-photo) .heart,
:root .food-grid>.food.food-compact:has(>.sample-food-photo) .heart{filter:none;color:var(--text)}
:root .food-grid>.food.food-compact:has(>.representative-food-photo) .heart[aria-pressed=true],
:root .food-grid>.food.food-compact:has(>.sample-food-photo) .heart[aria-pressed=true]{color:var(--green)}

.food [data-rating-summary][hidden]{display:none}
.your-dining-hall{display:flex;align-items:center;gap:12px;max-width:640px;margin:0 0 20px;padding:0;border:0;border-radius:0;background:transparent;color:var(--text);box-shadow:none}
.your-hall-icon{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:var(--surface-soft);color:var(--coast-ocean,var(--green))}
.your-hall-icon svg{width:18px;height:18px;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.your-hall-copy{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.your-dining-hall .your-hall-label{font-size:11px;font-weight:650;letter-spacing:.035em;color:var(--muted)}
.your-dining-hall .your-hall-destination{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text);font-size:15px;font-weight:680;line-height:1.28;text-decoration:none}
.your-dining-hall .your-hall-destination:hover{color:var(--coast-ocean,var(--green))}
.your-dining-hall .your-hall-note{font-size:11px;line-height:1.3;color:var(--muted)}
.your-dining-hall .your-hall-change{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;min-height:44px;padding:0 8px;border:0;border-radius:22px;background:transparent;color:var(--coast-ocean,var(--green));font-size:12px;font-weight:650;text-decoration:none}
.your-dining-hall .your-hall-change:hover{background:var(--surface-soft)}
.your-dining-hall .your-hall-destination:focus-visible,.your-dining-hall .your-hall-change:focus-visible{outline:2px solid var(--coast-ocean,var(--green));outline-offset:2px;border-radius:5px}
.your-dining-hall.is-empty .your-hall-icon{background:transparent;border:1px solid var(--line)}
.your-dining-hall.is-empty .your-hall-destination{color:var(--muted);font-weight:560}
@media(max-width:600px){.your-dining-hall{gap:10px;margin-bottom:16px}.your-hall-icon{width:32px;height:32px}.your-dining-hall .your-hall-destination{font-size:14px}.your-dining-hall .your-hall-change{padding:0 6px}}

/* Discover hall selection and venue-only test ratings. */
.your-dining-hall{flex-wrap:wrap}
.your-hall-actions{display:flex;align-items:center;gap:2px;flex:none}
.your-dining-hall .your-hall-change,.your-dining-hall .your-hall-rate,.venue-rate-toggle{min-height:44px;padding:0 10px;border:0;border-radius:22px;background:transparent;color:var(--coast-ocean,var(--green));font:inherit;font-size:12px;font-weight:650;cursor:pointer}
.your-dining-hall .your-hall-change:hover,.your-dining-hall .your-hall-rate:hover,.venue-rate-toggle:hover{background:var(--surface-soft)}
.hall-picker{display:grid;grid-template-columns:minmax(150px,1fr) minmax(170px,1.2fr);align-items:center;gap:8px;width:100%;padding:10px 0 0 46px}
.hall-picker label{font-size:12px;font-weight:600;color:var(--muted)}
.hall-picker select{width:100%;min-height:44px;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text)}
.venue-rating-disclaimer{width:100%;margin:0 0 0 46px;color:var(--muted);font-size:10px;line-height:1.4}
.venue-rating{position:relative;z-index:1;padding:0 14px 12px}
.venue-rating-summary{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:40px;color:var(--muted);font-size:11px}
.venue-rating-editor{padding:9px 10px 11px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}
.venue-rating-editor[hidden],.hall-picker[hidden]{display:none}
.venue-rating-editor fieldset{margin:0;padding:0;border:0}
.venue-rating-editor legend{font-size:12px;font-weight:650}
.venue-stars{display:flex;gap:3px;margin:4px 0}
.venue-stars button{width:40px;height:40px;border:0;border-radius:8px;background:transparent;color:var(--coast-ocean,var(--green));font-size:25px;cursor:pointer}
.venue-stars button:hover,.venue-stars button[aria-pressed=true]{background:var(--surface);color:var(--coast-ocean,var(--green))}
.venue-rating-save,.venue-rating-cancel{min-height:40px;margin:4px 5px 0 0;padding:0 13px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);font:inherit;font-size:12px;font-weight:650;cursor:pointer}
.venue-rating-save{background:var(--coast-ocean,var(--green));color:#fff;border-color:transparent}
.venue-rating-save:disabled{background:var(--surface);color:var(--muted);border-color:var(--line)}
.venue-rating-note{margin:7px 0 0;color:var(--muted);font-size:10px;line-height:1.4}
.venue:has(.venue-rating){overflow:visible}
.your-dining-hall .venue-rating{width:100%;padding:8px 0 0 46px}
.your-dining-hall .venue-rating-disclaimer{padding-left:0}
@media(max-width:600px){.hall-picker{grid-template-columns:1fr;padding-left:42px}.venue-rating-disclaimer{margin-left:42px}.your-dining-hall .venue-rating{padding-left:42px}.venue-rating{padding:0 10px 10px}.venue-stars button{width:44px;height:44px}}
@media(min-width:850px){.venue-rating{padding:0 15px 13px}}
:where(.venue-rate-toggle,.your-hall-change,.your-hall-rate,.venue-stars button,.venue-rating-save,.venue-rating-cancel,.hall-picker select):focus-visible{outline:2px solid var(--coast-ocean,var(--green));outline-offset:2px}

.food-photo-contribution-note{max-width:560px;margin:0 0 14px;color:var(--muted);font-size:13px;line-height:1.5}

/* Menu photos use a compact two-column rhythm on larger screens. A narrow
   viewport returns to one column without enlarging the image beyond 16:9. */
@media(max-width:680px){:root .menu-section>.food-grid{grid-template-columns:minmax(0,1fr)}}
/* The sample atlas contains square tiles. Keep each tile square inside the
   wide card frame so the demo artwork and its label never stretch. */
.sample-food-photo{position:relative;display:block;aspect-ratio:16/9!important;max-height:300px!important;background-color:var(--surface-soft);background-image:none!important;border-radius:15px 15px 0 0!important}
.sample-food-photo::before{content:"";position:absolute;top:0;left:50%;height:100%;width:auto;aspect-ratio:1;max-width:100%;transform:translateX(-50%);background-image:url('preview-assets/sample-food-atlas-v1.png');background-size:200% 200%;background-position:inherit;background-repeat:no-repeat}
.sample-food-photo::after{content:"SAMPLE";position:absolute;left:9px;top:9px;padding:4px 7px;border-radius:5px;background:#101512d9;color:#fff;font-size:9px;line-height:1;font-weight:700;letter-spacing:.08em}
.sample-detail-display .sample-food-photo{aspect-ratio:1!important;max-height:none!important}
/* Keep the student view free of local-only test ratings. The explicit local
   acceptance harness adds .local-test-harness to the document root. */
.venue-rating-disclaimer{display:none}
:root:not(.local-test-harness) .venue-rating{display:none}
.local-test-harness .venue-rating-disclaimer{display:block}
/* Comfortable black and graphite surfaces in dark mode; the light palette
   keeps the same hierarchy and spacing. */
.your-dining-hall{max-width:760px;margin:8px 0 12px;padding:8px 0;border:0;border-radius:0;background:transparent;box-shadow:none;gap:10px}
.your-hall-icon{width:32px;height:32px;background:var(--surface-soft);color:var(--coast-ocean,var(--green))}
.your-dining-hall.is-empty .your-hall-copy{display:none}
.hall-picker{display:grid;grid-template-columns:auto minmax(180px,260px);align-items:center;gap:10px;width:auto;flex:0 1 auto;padding:0}
.hall-picker label{white-space:nowrap;font-size:12px;color:var(--muted)}
.hall-picker select{min-width:0;max-width:260px;min-height:40px;padding:7px 11px}
.your-dining-hall .your-hall-change,.your-dining-hall .your-hall-rate{color:var(--coast-ocean,var(--green))}
.local-test-banner{margin:0 0 12px;padding:8px 11px;border:1px solid var(--line);border-radius:9px;color:var(--muted);font-size:11px}
.food.food-compact .compact-nutrition .macro-strip,.food.food-compact .compact-nutrition .missing-note{display:none}
.food.food-compact .compact-nutrition{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.food.food-compact .food-calories{margin:4px 0;color:var(--muted);font-size:12px}
.food.food-compact .food-calories strong{font-size:13px;color:var(--text)}
.food.food-compact .source-serving{font-size:11px}
.discover-page>.discover-title{margin:4px 0 10px}
.discover-page>.discover-search-trigger{max-width:720px;min-height:46px;padding:0 15px}
.discover-page>.your-dining-hall{min-height:40px}
.discover-page .venue-types{margin:4px 0 0}
.discover-page .section-head{margin-top:15px}
.venue-grid{row-gap:20px}
@media(max-width:600px){.hall-picker{grid-template-columns:auto minmax(140px,220px);gap:7px}.hall-picker label{font-size:11px}.hall-picker select{font-size:12px}.your-dining-hall{margin:6px 0 9px}.food.food-compact .food-main{padding:11px 11px!important}.food.food-compact .food-title{font-size:15px}}
.date-control{display:block;min-width:0;position:relative}
.date-control .ds-root{min-width:176px}
.date-control .ds-trigger{min-height:44px;padding:7px 12px;border:0;border-radius:10px;background:var(--surface-soft);font-size:15px;font-weight:720;line-height:1.2;color:var(--text);box-shadow:none}
.date-control .ds-trigger:hover{background:var(--surface-soft);border:0}
.date-control .ds-arrow{width:6px;height:6px;flex-basis:6px;border-width:0 1.4px 1.4px 0;opacity:.72}
.date-control .ds-listbox{background:var(--surface);color:var(--text);border-color:var(--line)}
.date-control .ds-option[aria-selected=true]{background:var(--surface-soft);color:var(--text)}
@media(max-width:600px){.date-control .ds-root{min-width:0;width:100%}.storefront-tools .quick-filters{grid-template-columns:minmax(132px,1fr) minmax(110px,1fr) auto}}

/* Small usual-spot reminder for people browsing before setting a default. */
.spot-prompt{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;max-width:760px;margin:8px 0 12px;padding:9px 11px;border:1px solid var(--line);border-radius:11px;background:var(--surface-soft);color:var(--text)}
.spot-prompt-copy{display:grid;gap:2px;min-width:0}
.spot-prompt-copy strong{font-size:13px;line-height:1.3;font-weight:680}
.spot-prompt-copy small{font-size:11px;line-height:1.35;color:var(--muted)}
.spot-prompt-actions{display:flex;align-items:center;gap:2px}
.spot-prompt-choose{min-height:38px;padding:0 12px;border:0;border-radius:20px;background:var(--coast-ocean,var(--green));color:#fff;font-size:12px;font-weight:650}
.spot-prompt-dismiss{display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);font-size:19px;line-height:1}
.spot-prompt-dismiss:hover{background:var(--surface)}
.spot-prompt :where(button,select):focus-visible{outline:2px solid var(--coast-ocean,var(--green));outline-offset:2px}
.spot-prompt .hall-picker{grid-column:1/-1;grid-template-columns:auto minmax(0,1fr);width:100%;padding:4px 0 0}
.spot-prompt .hall-picker select{max-width:none;width:100%}
@media(max-width:600px){.spot-prompt{margin:6px 0 9px;padding:8px 9px;gap:6px}.spot-prompt-copy strong{font-size:12px}.spot-prompt-copy small{font-size:10px}.spot-prompt-choose{min-height:36px;padding:0 10px}.spot-prompt-dismiss{width:36px;height:36px}}

/* Compact menu details links remain separate from the large venue card target. */
.venue .venue-view{display:inline-flex;width:fit-content;align-items:center;gap:6px;min-height:40px;padding:6px 10px;margin:6px 0 2px;border-radius:8px;color:var(--green);font-weight:700;text-decoration:none}
.venue .venue-view:hover{text-decoration:underline;text-underline-offset:3px}
.venue .venue-view:focus-visible{outline:3px solid var(--focus,#7bb8ff);outline-offset:2px}
@media(max-width:680px){.venue .venue-view{min-height:44px;padding-inline:12px}}

/* Menu sections use a single, even list rhythm. Representative images stay
   visible as labeled thumbnails, while larger venue photos remain prominent. */
:root .menu-section>.food-grid{grid-template-columns:minmax(0,1fr)!important;gap:10px}
:root .menu-section>.food-grid>.food.food-compact:has(>.representative-food-photo),
:root .menu-section>.food-grid>.food.food-compact:has(>.sample-food-photo){display:grid;grid-template-columns:76px minmax(0,1fr) 44px;grid-template-rows:auto;align-items:center;gap:0 12px;padding:10px}
:root .menu-section>.food-grid>.food.food-compact>:is(.representative-food-photo,.sample-food-photo){grid-column:1;grid-row:1;width:76px;height:76px;min-height:76px;max-height:76px;aspect-ratio:1;border-radius:10px!important;overflow:hidden}
:root .menu-section>.food-grid>.food.food-compact>.representative-food-photo .representative-photo-image{width:76px;height:76px;min-height:76px;max-height:76px;aspect-ratio:1;border-radius:10px}
:root .menu-section>.food-grid>.food.food-compact>.representative-food-photo img{width:76px;height:76px;aspect-ratio:1;object-fit:cover}
:root .menu-section>.food-grid>.food.food-compact>.food-main{grid-column:2;grid-row:1;min-width:0;padding:0}
:root .menu-section>.food-grid>.food.food-compact>.food-actions{grid-column:3;grid-row:1;align-self:center;margin:0;min-width:44px;height:44px}
:root .menu-section>.food-grid>.food.food-compact>.food-actions .heart{width:44px;height:44px}
@media(max-width:420px){:root .menu-section>.food-grid>.food.food-compact:has(>.representative-food-photo),:root .menu-section>.food-grid>.food.food-compact:has(>.sample-food-photo){grid-template-columns:64px minmax(0,1fr) 40px;gap:0 9px;padding:9px}:root .menu-section>.food-grid>.food.food-compact>:is(.representative-food-photo,.sample-food-photo),:root .menu-section>.food-grid>.food.food-compact>.representative-food-photo .representative-photo-image,:root .menu-section>.food-grid>.food.food-compact>.representative-food-photo img{width:64px;height:64px;min-height:64px;max-height:64px;aspect-ratio:1}:root .menu-section>.food-grid>.food.food-compact>.food-actions{min-width:40px}:root .menu-section>.food-grid>.food.food-compact>.food-actions .heart{width:40px;height:40px}}

/* Keep text-only menu rows compact; photo-led cards retain their own frame. */
:root .menu-section>.food-grid>.food.food-compact:not(:has(>.representative-food-photo)):not(:has(>.sample-food-photo)){padding-block:12px}
:root .menu-section>.food-grid>.food.food-compact:not(:has(>.representative-food-photo)):not(:has(>.sample-food-photo)) .tags{margin-top:8px}
:root .menu-section>.food-grid>.food.food-compact.food-text-only{padding:12px 16px!important}
