:root { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; color: #173b35; background: #f4f6f0; --ink: #173b35; --muted: #56685f; --accent: #147767; --line: #dce5dc; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { border: 1px solid var(--accent); border-radius: 9px; padding: 11px 16px; color: white; background: var(--accent); font-weight: 650; cursor: pointer; }
button:hover:not(:disabled) { filter: brightness(.94); }
button:disabled { cursor: not-allowed; opacity: .48; }
:focus-visible { outline: 3px solid #278c7d; outline-offset: 3px; }
input, select { width: 100%; min-width: 0; border: 1px solid #b5c9bc; border-radius: 9px; color: var(--ink); background: white; padding: 12px; }
label { display: block; font-size: .875rem; font-weight: 650; margin: 0 0 8px; }
h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -.035em; margin: 7px 0; }
h2 { font-size: 1.5rem; line-height: 1.3; letter-spacing: -.025em; margin: 9px 0; overflow-wrap: anywhere; }
h3 { font-size: 1rem; line-height: 1.45; margin: 0; }
p { line-height: 1.6; }
a { color: var(--accent); overflow-wrap: anywhere; }
.mono, code { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px max(24px, calc((100vw - 1392px) / 2)); background: #e4eee3; border-bottom: 1px solid #cfddcf; }
.hero-title { min-width: 0; }
.hero p { margin: 0; }
.hero-title p { color: #4d6658; font-size: .94rem; }
.eyebrow { color: #4b725e; font-size: .75rem; font-weight: 750; letter-spacing: .13em; }
.hero-status { flex-shrink: 0; max-width: 380px; text-align: right; }
.demo-badge { display: inline-block; padding: 7px 10px; border: 1px solid #b7d0bf; border-radius: 99px; background: #f5faf3; color: #126556; font-weight: 750; font-size: .6875rem; letter-spacing: .07em; }
.budget { margin: 10px 0 0; font-size: .8125rem; line-height: 1.5; }
.budget > div { display: flex; flex-direction: column; gap: 2px; }
#remaining { color: var(--muted); }
#cooldown { font-weight: 650; color: #805016; }
#cooldown:empty { display: none; }
.search-panel, .notice, .workspace, footer { max-width: 1392px; margin: 20px auto; }
.workspace, footer { max-width: 1440px; padding: 0 24px; }
.hint { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.notice { padding: 12px 18px; border: 1px solid #cee0d4; border-radius: 9px; background: white; font-size: .9375rem; line-height: 1.5; }
.notice.error { color: #933928; border-color: #e4c1b6; background: #fff4ec; }
.workspace { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: white; padding: 24px; box-shadow: 0 5px 20px #28402706; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 230px) auto; gap: 16px; align-items: end; }
.search-form .actions button { min-height: 46px; }
.food-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin-top: 18px; }
.food-filters .hint { grid-column: 1 / -1; margin: 0; }
.actions { display: flex; gap: 8px; }
.secondary { color: #126556; background: white; border-color: #b4cbbb; }
.full-width { width: 100%; }
.suggest-actions { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.suggest-actions button { flex-shrink: 0; font-size: .875rem; padding: 8px 12px; }
.suggest-actions .hint { margin: 0; }
.input-action { display: flex; gap: 8px; }
.input-action button { flex-shrink: 0; }
.advanced-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.advanced-section > summary { color: #126556; font-size: .875rem; }
.advanced-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 20px; margin-top: 16px; }
.examples { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding-bottom: 4px; }
.examples .hint { flex-basis: 100%; }
.text-button { font-size: .875rem; background: none; color: #126556; padding: 5px 0; border: 0; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.suggestions-section { margin-top: 16px; padding: 16px; border-radius: 9px; background: #f3f8f0; }
.suggestions-section .hint { margin: 8px 0 12px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion { padding: 8px 11px; color: #315d3d; border-color: #c4d9bd; background: white; font-size: .875rem; }
.section-title { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; margin: 20px 0 10px; }
.section-title .hint { margin: 0; }
.results-title { margin-top: 0; }
.results-title h2 { margin: 0; }
#search-context { margin: 0 0 16px; overflow-wrap: anywhere; }
#search-context:empty { margin: 0; }
.response-button { font-size: .8125rem; padding: 8px 12px; margin-bottom: 16px; }
.results { list-style: none; margin: 0 0 16px; padding: 0; }
.result { display: block; width: 100%; text-align: left; background: white; color: var(--ink); border-color: var(--line); padding: 16px; margin-bottom: 10px; font-weight: 400; }
.result:hover:not(:disabled) { border-color: #7ba797; filter: none; background: #f8faf5; }
.result.selected { border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); background: #f0f7ef; }
.result-name { font-weight: 650; font-size: 1rem; line-height: 1.4; margin-bottom: 9px; overflow-wrap: anywhere; }
.result-brand { color: var(--muted); font-size: .875rem; line-height: 1.5; margin: 0 0 10px; overflow-wrap: anywhere; }
.result .hint { margin: 10px 0 0; font-size: .8125rem; }
.results-note { padding-top: 14px; margin-bottom: 0; border-top: 1px solid var(--line); }
.badges { display: flex; flex-wrap: wrap; gap: 7px; }
.badge { font-size: .75rem; font-weight: 650; padding: 4px 8px; border-radius: 5px; color: #2a5939; background: #eaf4e6; }
.badge.off { color: #495965; background: #edf1f4; }
.badge.unknown { color: #8b4d19; background: #fff0de; }
.detail { min-height: 420px; }
.back-results { display: none; }
.empty-state { max-width: 580px; margin: auto; padding: 36px 10px; }
.empty-state h2 { font-size: clamp(1.7rem, 2.6vw, 2.1rem); margin-top: 16px; }
.empty-state p { color: var(--muted); }
#food-name { margin: 14px 0 8px; font-size: 1.75rem; }
#food-identity { font-size: .8125rem; margin: 0; }
.warnings { display: grid; gap: 8px; margin: 18px 0; }
.warnings:empty { display: none; }
.warning { border-left: 3px solid #c7a454; background: #fff8e8; color: #665121; padding: 12px 14px; border-radius: 4px; font-size: .875rem; line-height: 1.55; margin: 0; overflow-wrap: anywhere; }
.food-tabs { display: flex; gap: 6px; margin: 22px 0 18px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.food-tabs button { min-height: 44px; border: 1px solid transparent; padding: 9px 15px; color: var(--muted); background: transparent; font-size: .9375rem; }
.food-tabs button[aria-selected="true"] { color: #125e50; border-color: #c5d9cb; background: #ecf5ea; }
.food-tabs button:hover:not(:disabled) { filter: none; background: #f0f5ed; }
.tab-panel { min-width: 0; }
.tab-panel > .section-title:first-child { margin-top: 0; }
.metadata { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 12px 18px; font-size: .9375rem; line-height: 1.6; margin: 0; }
.metadata:empty { display: none; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.table-scroll { min-width: 0; width: 100%; max-width: 100%; overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { border-bottom: 1px solid #e4ece2; padding: 12px 10px; text-align: left; vertical-align: top; }
th { font-size: .8125rem; color: var(--muted); background: #f6f8f2; }
td:not(:first-child) { min-width: 85px; }
.provenance { max-width: 230px; }
.provenance summary { font-size: .8125rem; color: var(--muted); }
.raw { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.raw-context { overflow-wrap: anywhere; margin: 0; }
summary { cursor: pointer; font-weight: 600; line-height: 1.5; }
pre { font: .8125rem/1.6 ui-monospace, Consolas, monospace; background: #f2f5ee; border-radius: 7px; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 550px; }
footer { color: var(--muted); font-size: .875rem; line-height: 1.65; margin-bottom: 32px; }
footer strong { color: var(--ink); }
[hidden] { display: none !important; }
@media (max-width: 1439px) { .search-panel, .notice { margin-right: 24px; margin-left: 24px; } }
@media (max-width: 950px) {
  .hero { align-items: start; gap: 20px; }
  .hero-status { max-width: 280px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .workspace[data-view="results"] #detail-panel, .workspace[data-view="detail"] #catalogue-panel { display: none; }
  .back-results { display: inline-block; margin: 0 0 20px; }
  .detail { min-height: 0; }
  .search-form { grid-template-columns: minmax(0, 1fr) minmax(170px, 200px); }
  .search-field { grid-column: 1 / -1; }
  .actions button { width: 100%; }
  .advanced-content { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 580px) {
  .hero { display: block; padding: 20px 18px; }
  .hero-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; max-width: none; text-align: left; margin-top: 16px; }
  .demo-badge { font-size: .625rem; }
  .budget { flex-basis: 100%; margin: 0; }
  .budget > div { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
  .search-panel, .notice { margin: 16px 12px; }
  .workspace { padding: 0 12px; margin: 16px auto; }
  .panel { padding: 18px; }
  .search-form { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .search-field { grid-column: auto; }
  .suggest-actions { display: block; }
  .suggest-actions .hint { margin-top: 10px; }
  .input-action { flex-wrap: wrap; }
  .input-action input { flex-basis: 100%; }
  .input-action button { width: 100%; }
  .metadata { grid-template-columns: 95px minmax(0, 1fr); gap: 12px; font-size: .875rem; }
  .empty-state { padding: 20px 0; }
  .food-tabs { gap: 4px; }
  .food-tabs button { flex: 1; padding: 9px 7px; font-size: .875rem; }
  #food-name { font-size: 1.5rem; }
  footer { padding: 0 18px; }
}
