/* PlateMetrics — local static scaffold, no CDN */
:root {
  --paper: #f3efe6;
  --paper-2: #faf7f1;
  --ink: #1c1916;
  --muted: #5e5852;
  --rule: #cfc6b8;
  --rule-strong: #1c1916;
  --accent: #9c2f16;
  --accent-soft: #f0d9d2;
  --organic: #2a5a45;
  --organic-soft: #dce8e2;
  --warn: #8a1f0f;
  --warn-bg: #8a1f0f;
  --warn-fg: #faf4ee;
  --flag: #7a4a00;
  --flag-bg: #f6e6c8;
  --shadow: 0 1px 0 rgba(28, 25, 22, 0.06);
  --sans: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", Times, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

.banner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.55rem 1.25rem 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
}

.site-header {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0.5rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.45rem;
  display: inline-block;
}

.lede {
  margin: 0.7rem 0 0;
  max-width: 40rem;
  color: var(--muted);
}

.toolbar {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rule);
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
}

.tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.tab-disabled,
.tab:disabled {
  color: var(--muted);
  cursor: not-allowed;
  font-weight: 500;
  opacity: 0.85;
}

.soon {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: center;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
}

.check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--organic);
}

.store-picker-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
  font-weight: 600;
}

.select-label { color: var(--ink); }

.store-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.store-option {
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  min-height: 40px;
  cursor: pointer;
}

.store-option[aria-checked="true"] {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #fbf3f0;
}

.store-option:disabled,
.store-option.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  background: #eeebe4;
  border-style: dashed;
  opacity: 0.95;
}

.store-option:disabled[aria-checked="true"],
.store-option.is-disabled[aria-checked="true"] {
  box-shadow: none;
  border-color: var(--rule);
  color: var(--muted);
}

.snapshot {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.panel {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2.5rem;
}

.estimate-note, .status {
  color: var(--muted);
  font-size: 0.95rem;
}

.status { margin: 0.4rem 0 1rem; }

.chart-figure {
  margin: 0 0 1.25rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 0.7rem 0.7rem 0.4rem;
}

.chart-figure figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0.3rem 0.4rem;
}

.chart { width: 100%; height: min(22rem, 58vw); min-height: 14rem; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart text { font-family: var(--sans); fill: var(--muted); }
.chart .axis-label { font-size: 11px; }
.chart .tick { font-size: 10px; }
.chart .iso { stroke: #d5cfc4; stroke-dasharray: 3 4; fill: none; }
.chart .iso-label { font-size: 9px; fill: #8a847c; }
.chart .dot { stroke: #fff; stroke-width: 1; }
.chart .dot-label { font-size: 10px; fill: var(--ink); }

.table-wrap {
  overflow-x: auto;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  min-width: 48rem;
}

thead th {
  text-align: left;
  font-weight: 650;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
  padding: 0;
  white-space: nowrap;
  background: var(--paper-2);
  position: sticky;
  top: 0;
}

thead th button {
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0.7rem 0.75rem;
  width: 100%;
  text-align: inherit;
  cursor: pointer;
  min-height: 44px;
}

thead th.num button { text-align: right; }

thead th button:hover { color: var(--ink); }

th[aria-sort="ascending"] button::after,
th[aria-sort="descending"] button::after {
  content: " ▴";
  color: var(--accent);
  font-size: 0.85em;
}

th[aria-sort="descending"] button::after { content: " ▾"; }

tbody td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 0; }

tbody tr:hover td { background: #f3eee4; }

td.num, th.num { text-align: right; }

.meal-name {
  font-weight: 650;
  color: var(--ink);
}

.ingredients {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}

.flag {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.05rem 0.4rem;
  background: var(--flag-bg);
  color: var(--flag);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 2px;
}

.row-incomplete { opacity: 0.92; }

.est-suffix {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 0.15rem;
}

.empty {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px dashed var(--rule);
  color: var(--muted);
  text-align: center;
}

.site-footer {
  max-width: 72rem;
  margin: 0 auto 2rem;
  padding: 1.25rem 1.25rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer h2 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.site-footer p { margin: 0 0 0.7rem; max-width: 52rem; }

@media (max-width: 640px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { flex-direction: column; align-items: flex-start; }
  .store-option { width: auto; }
  h1 { display: block; }
}

.sub-note {
  font-weight: 500;
  color: var(--flag);
}

.chart-wrap { position: relative; }
.chart-tooltip {
  position: absolute;
  display: none;
  z-index: 2;
  max-width: 16rem;
  padding: 0.35rem 0.5rem;
  background: #1c1916;
  color: #faf7f1;
  font-size: 0.78rem;
  line-height: 1.35;
  border-radius: 4px;
  pointer-events: none;
  transform: translate(-50%, -120%);
}
.chart-tooltip.is-on { display: block; }
.chart .dot:focus { outline: 2px solid #1c1916; outline-offset: 2px; }

.empty {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--rule);
  color: var(--ink);
  text-align: left;
  background: var(--paper-2);
  font-size: 1rem;
}
