/* The Food Tracer — compact ingredient sheet layout. Page-specific structure and
   sizing; colors/type/spacing tokens and shared components come from broadsheet.css. */

.page { min-height: 100vh; padding: 16px 28px 28px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 20px; max-width: 980px; margin: 0 auto; }

.rail { border-top: 3px solid var(--color-text); border-bottom: 1px solid var(--color-text);
  padding: 4px 0; display: flex; flex-wrap: wrap; gap: 18px;
  font-size: 11px; letter-spacing: 0.04em; }

.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 24px; align-items: center; }
.hero-left { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.hero-id { display: flex; flex-direction: column; gap: 2px; }
.hero-right { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.props-grid { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 11.5px; }
.props-grid span:nth-child(odd) { color: var(--color-neutral-600); }

.bench { display: flex; flex-direction: column; gap: 14px; background: var(--color-surface);
  border: 1px solid var(--color-divider); border-top: 3px solid var(--color-text);
  border-radius: var(--radius-lg); padding: var(--space-4); }
.bench-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; white-space: nowrap; font-family: var(--font-body);
  font-size: 12px; padding: 3px 9px; border-radius: var(--radius-md); cursor: pointer;
  border: 1px solid var(--color-neutral-300); background: transparent; color: var(--color-text); }
.chip:hover { border-color: var(--color-accent); }
.chip.is-selected { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }

.amount-row { display: flex; gap: 10px; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.amount-row .label { font-size: 13px; color: var(--color-neutral-600); }
.amount-row .seg-opt { padding: 4px 10px; font-size: 13px; flex-direction: column; align-items: center;
  gap: 1px; line-height: 1.2; }
.seg-amt { font-size: 13px; }
.seg-opt.is-rec .seg-amt { font-weight: 600; }
.seg-yield { font-size: 9.5px; color: var(--color-neutral-600); }
.seg-opt:has(input:checked) .seg-yield { color: var(--color-bg); opacity: 0.85; }

.equation { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; }
.eq-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 4px 14px; }
.eq-term { display: inline-flex; align-items: flex-end; gap: 10px; }
.eq-plus { font-size: 18px; color: var(--color-neutral-500); }
.eq-term-body { display: flex; flex-direction: column; }
.eq-qty { font-size: 13px; color: var(--color-neutral-600); }
.eq-name { font-size: 19px; font-weight: 400; }
.eq-name.is-product { font-weight: 600; color: var(--color-accent-700); }
.eq-arrow { display: inline-flex; flex-direction: column; align-items: center; min-width: 72px; }
.eq-process { font-size: 13px; font-style: italic; }
.eq-glyph { font-size: 19px; line-height: 1; }
.eq-output { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 14px; }
.conditions-row { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px 16px;
  font-size: 13px; align-items: center; }
.conditions-row .label { color: var(--color-neutral-600); }
.note { margin: 2px 0 0; font-size: 13px; font-style: italic; line-height: 1.4;
  max-width: 460px; text-align: left; }

.ways-box { background: color-mix(in srgb, var(--color-accent-2) 7%, var(--color-bg));
  border: 1px solid var(--color-accent-2-200); border-radius: var(--radius-lg);
  padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.ways-box > h2 { text-align: center; }

.roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr));
  gap: 20px 18px; }
.role-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.role-col h3 { margin: 0; padding-bottom: 7px; font-size: 16.5px; font-weight: 600;
  color: var(--color-accent-2-700); border-bottom: 2px solid var(--color-accent-2-300); }
.role-desc { margin: 0 0 2px; font-size: 11.5px; color: var(--color-neutral-700); }
.role-row { display: flex; flex-wrap: nowrap; gap: 4px; align-items: baseline; text-align: left;
  width: 100%; font-family: var(--font-body); background: transparent; border: 0;
  padding: 2px 4px; margin: 0 -4px; border-radius: var(--radius-md); cursor: pointer;
  font-size: 11.5px; color: var(--color-text); overflow: hidden; }
.role-row:hover, .role-row.is-selected { background: var(--color-neutral-100); }
.role-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 14px; flex-shrink: 1; }
.role-process { font-size: 9.5px; font-style: italic; flex-shrink: 0; white-space: nowrap; }
.role-arrow { flex-shrink: 0; }
.role-out { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 14px; flex-shrink: 1; flex-grow: 1; flex-basis: 0; }

.other-section { padding-top: var(--space-4); }
.other-toggle { cursor: pointer; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-neutral-600); list-style: none; }
.other-toggle::-webkit-details-marker { display: none; }
.other-toggle::before { content: '▸ '; }
.other-section[open] .other-toggle::before { content: '▾ '; }
.other-body { display: flex; flex-direction: column; gap: 12px; padding-top: var(--space-3); }
.other-sub { font-size: 13px; font-style: italic; color: var(--color-neutral-600); }
.other-row { display: flex; flex-direction: column; gap: 2px; }
.other-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.other-label { font-weight: 600; font-size: 14px; }
.other-eq { font-size: 13px; color: var(--color-neutral-700); }
.other-note { margin: 0; font-size: 13px; font-style: italic; color: var(--color-neutral-600); }

.index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.tile { position: relative; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 12px 34px; text-decoration: none; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-md); }
.tile:hover { border-color: var(--color-accent); background: var(--color-accent-100); }
.tile-no { position: absolute; top: 50%; left: 10px; transform: translateY(-50%);
  font-size: 10px; color: var(--color-neutral-500); }
.tile-name { font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14.5px; line-height: 1.2; }

/* — color rule: cyan = physical change, magenta = chemical change, everything
   else stays ink/grey. Shared by the bench and ingredient-page equations. — */
.is-phys { color: var(--color-accent); }
.is-chem { color: var(--color-accent-2); }
.is-neutral { color: var(--color-neutral-500); }

/* — bench page — */
#benchBody { background: var(--color-neutral-300); }
.bench-page { gap: 18px; }

.legend-row { display: flex; flex-wrap: wrap; gap: 10px; }
.legend-btn { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 260px;
  padding: 7px 12px; font-size: 12.5px; color: var(--color-neutral-700); font-family: var(--font-body);
  background: transparent; border: 1px solid var(--color-neutral-400); border-radius: var(--radius-md);
  cursor: pointer; text-align: left; }
.legend-btn:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.legend-btn.is-open { background: var(--color-neutral-200); }
.legend-btn.is-phys.is-open { border-color: var(--color-accent); }
.legend-btn.is-chem.is-open { border-color: var(--color-accent-2); }
.legend-arrow { font-size: 15px; }
.legend-name { font-weight: 600; color: var(--color-text); white-space: nowrap; }
.legend-def { white-space: nowrap; }
.legend-count { margin-left: auto; white-space: nowrap; }

.kind-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 20px;
  margin-top: 14px; }
.kind-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kind-block-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kind-name { font-size: 16px; font-weight: 600; }
.kind-count { font-size: 13px; color: var(--color-neutral-700); }
.kind-rev { font-size: 12px; color: var(--color-neutral-700); }
.kind-evidence { margin: 0 0 2px; font-size: 12.5px; font-style: italic; color: var(--color-neutral-700); }
.kind-example { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 2px 0;
  font: inherit; font-size: 13px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind-example:hover { text-decoration: underline; }
.ke-in { color: var(--color-neutral-700); }
.ke-out { font-weight: 600; color: var(--color-text); }

.mode-row { display: inline-flex; border: 1px solid var(--color-divider); border-radius: var(--radius-md); overflow: hidden; width: fit-content; }
.mode-btn { font-family: var(--font-body); font-size: 14px; padding: 7px 16px; background: transparent;
  color: var(--color-text); border: 0; cursor: pointer; }
.mode-btn + .mode-btn { border-left: 1px solid var(--color-divider); }
.mode-btn.is-active { background: var(--color-text); color: var(--color-bg); }

.path-ends { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; }
.path-end { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; min-width: 160px; }
.path-end-label { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-neutral-600); }
.path-swap { font-size: 18px; align-self: center; }
.path-summary { margin: 0; font-size: 13px; color: var(--color-neutral-700); }
.path-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.path-step { display: flex; align-items: baseline; gap: 10px; flex-wrap: nowrap; overflow: hidden;
  white-space: nowrap; font-size: 15px; }
.path-n { font-size: 13px; color: var(--color-neutral-600); flex-shrink: 0; }
.path-lhs { flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
.path-carry { font-weight: 600; }
.path-out { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.path-evidence { margin: -4px 0 0 24px; font-size: 12.5px; font-style: italic; }
.path-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: 14px; }
.path-extras { font-size: 13px; color: var(--color-neutral-700); }

.search-row { display: flex; gap: 10px; align-items: flex-start; }
.search-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.search-suggest { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 5;
  background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); max-height: 260px; overflow-y: auto; }
.search-suggest-item { display: block; width: 100%; text-align: left; padding: 7px 10px; font-size: 14px;
  background: none; border: 0; cursor: pointer; font-family: inherit; color: var(--color-text); }
.search-suggest-item.is-active, .search-suggest-item:hover { background: var(--color-accent-100); }

.shelf-panel { display: flex; flex-direction: column; gap: var(--space-4); background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-lg); padding: var(--space-4); }
.shelf-panel[hidden] { display: none; }
.shelf-group { display: flex; flex-direction: column; gap: 4px; }
.shelf-group-title { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-neutral-600); }
.shelf-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.shelf-tile { display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 9px;
  border-radius: var(--radius-md); cursor: pointer; font-size: 13px; white-space: nowrap;
  font-family: var(--font-body); border: 1px solid var(--color-neutral-300); background: transparent; color: var(--color-text); }
.shelf-tile:hover { border-color: var(--color-accent); }
.shelf-tile.is-on { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }

.bench-section { display: flex; flex-direction: column; gap: 10px; }
.bench-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 28px; line-height: 1.25; }
.bench-line .eq-plus { font-size: 22px; color: var(--color-neutral-500); }
.bench-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--color-text); color: var(--color-bg);
  border-radius: var(--radius-md); padding: 3px 8px 3px 14px; }
.bc-name { line-height: 1; }
.bc-break, .bc-remove { font-family: var(--font-body); font-size: 17px; line-height: 1; background: none; border: 0;
  color: var(--color-bg); opacity: 0.7; cursor: pointer; padding: 2px 3px; }
.bc-break:hover, .bc-remove:hover { opacity: 1; }
.bench-arrow { font-size: 26px; }
.bench-result { font-weight: 600; }
.bench-empty-msg { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 22px;
  font-style: italic; color: var(--color-neutral-600); margin: 0; }
.start-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.ground-line { font-size: 14px; margin: 0; }
.ground-line .gl-label { color: var(--color-neutral-600); margin-right: 8px; }
.ground-line .gl-items { font-style: italic; }

.made-tree { display: flex; flex-direction: column; gap: 3px; font-size: 14px; margin-top: 4px; }
.made-tree-title { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-neutral-600); margin: 0 0 4px; }
.tree-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tree-row.tree-step { font-size: 12.5px; }
.tree-name { font-weight: 600; }
.tree-step-verb { font-weight: 600; }
.tree-step-note { color: var(--color-neutral-700); font-style: italic; }

.results-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.results-group { display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent;
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4) var(--space-2); }
.results-group-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap;
  padding-bottom: var(--space-1); }
.results-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  padding: 0 6px; box-sizing: border-box; border-radius: 17px; font-family: var(--font-heading); font-weight: 700;
  font-size: 18px; line-height: 1; border: 2px solid; align-self: center; }
.results-group-sub { font-size: 14px; color: var(--color-neutral-700); }
.result-row { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; overflow: hidden;
  width: 100%; cursor: pointer; padding: 3px 4px; border-bottom: 1px solid var(--color-divider);
  font-size: 17px; line-height: 1.3; background: none; border-left: 0; border-right: 0; border-top: 0; }
.result-row:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.result-row.is-open { background: var(--color-neutral-200); }
.rr-inputs { display: flex; gap: 7px; flex-shrink: 0; }
.rr-have { font-weight: 600; }
.rr-missing { color: var(--color-neutral-700); border: 1px dashed var(--color-neutral-500); border-radius: var(--radius-sm);
  background: none; font: inherit; padding: 0 5px; cursor: pointer; }
.rr-missing:hover { border-color: var(--color-accent-2); color: var(--color-accent-2-700); }
.rr-plus { color: var(--color-neutral-500); flex-shrink: 0; }
.rr-product { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }

.rr-action-stack { flex: none; min-width: 56px; display: inline-flex; flex-direction: column;
  align-items: stretch; gap: 3px; padding: 0 4px; align-self: center; }
.rr-action-names { display: flex; justify-content: center; gap: 5px; font-size: 14px; line-height: 17px;
  height: 17px; font-style: italic; white-space: nowrap; overflow: hidden; }
.rr-act-sep { color: var(--color-neutral-600); }
.rr-arrow-row { display: flex; align-items: center; }
.rr-arrow-line { flex: 1; height: 2px; background: var(--color-neutral-500); }
.rr-arrow-line.is-phys { background: var(--color-accent); }
.rr-arrow-line.is-chem { background: var(--color-accent-2); }
.rr-arrow-head { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  border-left: 11px solid var(--color-neutral-500); }
.rr-arrow-head.is-phys { border-left-color: var(--color-accent); }
.rr-arrow-head.is-chem { border-left-color: var(--color-accent-2); }
.rr-action-spacer { height: 17px; }

.result-detail { background: var(--color-neutral-200); border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 12px 14px 14px; margin: -1px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.detail-evidence { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: baseline; }
.de-label { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-neutral-700); }
.detail-evidence > .is-phys, .detail-evidence > .is-chem { font-size: 18px; font-style: italic; }
.de-rev { font-size: 15px; color: var(--color-neutral-700); }
.detail-steps { display: flex; flex-direction: column; gap: 2px; }
.detail-step { margin: 0; font-size: 13px; }
.detail-amounts { margin: 0; font-size: 13px; color: var(--color-neutral-700); }
