:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #182b3f;
  background: #f1f5f8;
  --line: #d8e2ea;
  --muted: #4e6176;
  --navy: #122b56;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, select, input { font: inherit; }
button, select, input:not([type=range]):not([type=checkbox]) {
  min-height: 36px;
  border: 1px solid #c9d8e4;
  border-radius: 6px;
  color: inherit;
  background: #fff;
  padding: 6px 9px;
}
button { cursor: pointer; font-size: 13px; font-weight: 650; }
button:hover { background: #eef4f9; }
button.primary { background: var(--navy); color: white; border-color: var(--navy); }
button.primary:hover { background: #244674; }
:is(button, select, input, summary):focus-visible { outline: 2px solid #3278c8; outline-offset: 2px; }
label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; min-width: 0; }
label :is(input, select) { width: 100%; min-width: 0; font-size: 13px; }
input:is([type=checkbox], [type=range]) { accent-color: #2466b6; }
.onlymes-unified.food-workspace .mono-home { display: block; }
.page-heading, .replay-heading, .replay-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.page-heading { margin-bottom: 14px; padding-bottom: 13px; border-bottom: 1px solid var(--mf-border); }
.page-heading h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.source { color: #284c5b; background: #e7f4f5; border: 1px solid #c2dce0; border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 700; }
.panel, .result { background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.setup, .replay { padding: 12px; }
.setup-quantity {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto;
  align-items: end;
  gap: 7px 12px;
  margin-bottom: 9px;
}
.muted, .notice { color: var(--muted); font-size: 12px; }
.setup-quantity > span { padding-bottom: 10px; }
.notice { margin: 7px 0 0; }
.variants, .results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.variants { grid-template-columns: repeat(2, minmax(0, 1fr)); }
fieldset {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 1fr 1fr;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6f9fc;
  margin: 0;
  padding: 8px;
}
legend { font-size: 13px; font-weight: 700; padding-inline: 3px; }
[data-case="0"] { --case: #167d82; }
[data-case="1"] { --case: #2866c4; }
[data-case="2"] { --case: #a35a18; }
.results { margin: 12px 0; }
.result {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 3px;
  border-top: 3px solid var(--case);
  padding: 10px 12px;
}
.result h2 { margin: 0; color: var(--case); font-size: 14px; }
.result :is(.condition, .result-label, .delta, .output) { color: var(--muted); font-size: 12px; line-height: 1.3; }
.result-label { margin-top: 5px; }
.result .eta { font-size: clamp(16px, 2.6vw, 28px); font-variant-numeric: tabular-nums; line-height: 1.15; }
.result .delta[data-change=earlier] { color: #12706d; }
.result .delta[data-change=later] { color: #92501b; }
.progress { height: 4px; overflow: hidden; border-radius: 4px; background: #e1e8ef; margin-top: 4px; }
.progress i { display: block; height: 100%; width: 0; background: var(--case); }
.replay-heading h2 { margin: 0; font-size: 20px; }
.replay-controls { justify-content: flex-start; margin-top: 8px; gap: 6px; }
.view, .pause { display: flex; align-items: center; }
.view { gap: 7px; }
.view select { width: auto; }
.pause { margin-left: 5px; white-space: nowrap; }
.pause input { margin: 0; width: 14px; height: 14px; }
.clock { margin-left: auto; display: grid; text-align: right; font-variant-numeric: tabular-nums; }
.clock strong { font-size: 14px; }
.clock small { color: var(--muted); font-size: 11px; }
.route { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; list-style: none; padding: 0; margin: 8px 0 5px; }
.route li { min-width: 0; }
.route button {
  width: 100%;
  height: 100%;
  min-height: 32px;
  text-align: left;
  padding: 5px 7px;
  background: #eaf1f5;
  border-color: #e0eaf0;
}
.route button[aria-expanded=true] { color: #123f72; background: #e0eefc; border-color: #9bbce4; }
.route span { margin-right: 4px; color: #526b80; font-size: 11px; font-weight: 500; }
.factory-layout { display: flex; gap: 9px; }
.factory {
  position: relative;
  flex: 1;
  min-width: 0;
  height: clamp(260px, 40vw, 455px);
  overflow: hidden;
  border: 1px solid #cfdde8;
  border-radius: 7px;
  background: radial-gradient(ellipse at 38% 5%, #f8fbfd, #e4eef4);
}
.factory canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
.readings {
  flex: 0 0 280px;
  align-self: start;
  border: 1px solid #cfdde8;
  border-radius: 7px;
  background: #f8fbfd;
  padding: 11px;
}
.readings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.readings-heading h3 { margin: 2px 0 0; font-size: 19px; color: var(--navy); }
.readings-source { color: #426977; font-size: 11px; font-weight: 650; }
.readings-heading button { min-width: 30px; min-height: 30px; padding: 2px 6px; font-size: 18px; line-height: 1; }
.readings-time { display: flex; justify-content: space-between; gap: 8px; margin: 7px 0; font-size: 12px; }
.readings-time strong[data-state=Running] { color: #12706d; }
.readings-time strong[data-state=Stopped] { color: #92501b; }
.readings-time span { color: var(--muted); }
.readings dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0; }
.readings dl div { padding: 6px; min-width: 0; background: white; border: 1px solid #e0e9ef; border-radius: 4px; }
.readings dt { font-size: 11px; color: var(--muted); }
.readings dd { margin: 2px 0 0; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.readings-note { margin: 7px 0 0; font-size: 11px; color: var(--muted); }
.graphics-message { padding: 0 12px; color: var(--muted); font-size: 13px; }
.food-scene-labels { position: absolute; inset: 0; pointer-events: none; }
.food-lane-label {
  position: absolute;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 3px 5px;
  border: 1px solid #bfccd9;
  border-left: 3px solid var(--case);
  border-radius: 4px;
  background: #fff;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
}
.scrub { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 6px; }
.scrub input { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 2px; background: #eaa752; }
.assumptions { margin-top: 10px; padding: 9px 12px; color: var(--muted); font-size: 12px; }
.assumptions summary { cursor: pointer; font-weight: 650; }
.assumptions p { margin-bottom: 5px; }
.assumptions dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.assumptions dt { font-weight: 650; color: var(--navy); }
.assumptions dd { margin: 3px 0 0; }

.food-summary { margin-bottom: 12px; padding: 12px; }
.food-summary dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 6px 0; }
.food-summary dt { color: var(--muted); font-size: 12px; }
.food-summary dd { margin: 3px 0 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.food-summary dd[data-late=true] { color: #92501b; }
.food-summary .replay-heading { margin-bottom: 12px; }
.food-summary input { max-width: 100%; }
.food-table { margin-top: 15px; }
.food-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.food-table caption { text-align: left; font-weight: 750; margin-bottom: 5px; }
.food-table :is(th, td) { padding: 7px 5px; border-bottom: 1px solid var(--line); text-align: left; }
.food-stop-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.food-stop-form label { flex: 1 1 140px; }
.food-stop-form .notice { flex-basis: 100%; margin: 2px 0 0; }
.food-stop-results .result small { font-size: 12px; color: var(--muted); }
.food-reserved-link { margin: 8px 0; }
.food-station-impact { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; font-size: 12px; }
.food-station-impact h4 { margin: 0; font-size: 13px; }
.food-station-impact p { margin: 5px 0; }
.food-workspace[data-page=digital-twin] .factory { min-height: 290px; }
.food-schematic { display: grid; align-content: center; gap: 10px; height: 100%; overflow: auto; padding: 10px; }
.food-schematic > p { margin: 0; color: var(--muted); font-size: 12px; }
.food-schematic strong { display: block; margin-bottom: 4px; color: var(--case); font-size: 13px; }
.food-schematic ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; gap: 3px; }
.food-schematic button { display: grid; gap: 2px; width: 100%; height: 100%; min-width: 0; text-align: left; overflow-wrap: anywhere; font-size: 12px; }
.food-schematic button small { color: var(--muted); }
.food-schematic button[data-state=running] { border-color: #69a8a9; box-shadow: inset 0 2px #69a8a9; }
.food-schematic button[data-state=stopped] { border-color: #b16732; background: #fff3e7; }

@media (max-width: 760px) {
  .onlymes-unified.food-workspace .demo-sidebar:not(.mobile-open) nav { display: none; }
}
@media (max-width: 1030px) {
  .factory-layout { flex-direction: column; }
  .factory { flex: none; }
  .readings { flex: none; width: 100%; order: -1; }
}
@media (max-width: 620px) {
  .setup-quantity { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .setup-quantity button { grid-column: 1/-1; }
  .variants, .results { gap: 5px; }
  fieldset { grid-template-columns: minmax(0, 1fr); padding: 5px; }
  .result { padding: 6px; }
  .result h2 { font-size: 12px; }
  .result :is(.condition, .result-label, .delta, .output) { font-size: 10px; }
  .route button { padding: 4px; font-size: 10px; overflow-wrap: anywhere; }
  .route span { display: block; font-size: 10px; }
  .replay-controls .clock { flex-basis: 100%; display: flex; justify-content: space-between; gap: 6px; }
  .food-lane-label { font-size: 9px; padding: 2px 3px; }
  .assumptions dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .food-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
  .food-schematic { align-content: start; }
  .food-schematic button { padding: 4px 3px; font-size: 10px; }
  .food-table table { font-size: 11px; }
}
