:root {
  color-scheme: light;
  --ink: #201e1f;
  --muted: #6f686b;
  --paper: #f5f3f3;
  --white: #ffffff;
  --red: #cf1647;
  --red-dark: #9e1136;
  --pink: #f7dce5;
  --green: #177a54;
  --green-soft: #dff3e9;
  --amber: #a45b00;
  --amber-soft: #fff0d5;
  --line: #ded9db;
  --shadow: 0 18px 45px rgba(42, 24, 31, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 16px; }
button, input, select { font: inherit; }
a { color: inherit; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 10px clamp(20px, 4vw, 64px);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand { display: flex; gap: 14px; align-items: center; text-decoration: none; }
.brand img { width: 54px; height: 45px; object-fit: contain; object-position: left center; }
.brand span { display: grid; gap: 2px; }
.brand strong { font-size: 1.05rem; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: .78rem; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.status { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: .85rem; }
.status i, .legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.hub-link { font-weight: 700; font-size: .9rem; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.view-tabs {
  position: sticky;
  top: 76px;
  z-index: 9;
  display: flex;
  gap: 4px;
  padding: 0 clamp(20px, 4vw, 64px);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.view-tab { padding: 15px 16px 13px; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; font-weight: 800; cursor: pointer; }
.view-tab:hover, .view-tab:focus { color: var(--ink); outline: none; }
.view-tab.active { color: var(--red); border-bottom-color: var(--red); }
.pilot-pill { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.dashboard-view[hidden] { display: none; }

main { width: min(1540px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 56px; }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--red); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.045em; line-height: 1.02; }
h1 { font-size: clamp(2.15rem, 4vw, 4.4rem); max-width: 760px; }
h2 { font-size: clamp(1.45rem, 2.1vw, 2.2rem); }

.date-control, .search-control, .sort-control { display: grid; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; }
select, input {
  min-height: 44px;
  padding: 0 14px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}
select {
  padding-right: 42px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.date-control select { min-width: 150px; font-weight: 700; }
select:focus, input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(207, 22, 71, .12); }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.metric { min-height: 142px; padding: 22px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.metric span { display: block; min-height: 34px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.metric strong { display: block; margin: 7px 0 9px; font-size: clamp(2rem, 3.5vw, 3.25rem); letter-spacing: -.055em; }
.metric small { color: var(--muted); font-size: .78rem; }
.metric-primary { background: var(--red); color: var(--white); border-color: var(--red); }
.metric-primary span, .metric-primary small { color: rgba(255,255,255,.78); }
.metric-gm { background: var(--green-soft); border-color: #b9e0cf; }
.metric-nm { background: var(--ink); color: var(--white); border-color: var(--ink); }
.metric-nm span, .metric-nm small { color: #d8d2d4; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; }
.legend i { background: var(--red); }
.trend-legends { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; }
.legend-gm i { background: var(--green); }
.legend-nm i { background: var(--ink); }
.trend-panel { margin-bottom: 12px; }
.trend-wrap { position: relative; min-height: 260px; padding: 14px 22px 20px; }
#trendChart { display: block; width: 100%; height: 230px; overflow: visible; }
.trend-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 176px;
  padding: 11px 13px;
  transform: translate(-50%, calc(-100% - 14px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(32, 30, 31, .96);
  color: #fff;
  box-shadow: 0 12px 30px rgba(32, 30, 31, .22);
  pointer-events: none;
}
.trend-tooltip[hidden] { display: none; }
.trend-tooltip strong { display: block; margin-bottom: 7px; font-size: .82rem; }
.trend-tooltip span { display: flex; justify-content: space-between; gap: 22px; font-size: .78rem; line-height: 1.55; }
.trend-tooltip b { font-variant-numeric: tabular-nums; }
.trend-hit { cursor: crosshair; outline: none; }
.trend-focus-line { opacity: 0; transition: opacity .12s ease; }
.trend-point-group:hover .trend-focus-line,
.trend-point-group:focus-within .trend-focus-line { opacity: 1; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(290px, .7fr); gap: 12px; margin-bottom: 12px; }
.shop-panel { min-width: 0; }
.search-control input { width: min(240px, 30vw); }
.table-wrap { overflow: auto; max-height: 610px; }
table { width: 100%; border-collapse: collapse; }
.products-panel table { min-width: 1380px; }
th { position: sticky; top: 0; z-index: 2; padding: 12px 16px; background: #faf9f9; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .75rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 13px 16px; border-bottom: 1px solid #eee9eb; font-size: .9rem; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.shop-row { cursor: pointer; transition: background .16s ease; }
.shop-row:hover, .shop-row:focus { background: #fff5f8; outline: none; }
.shop-row.active { background: var(--pink); }
.shop-name { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.rank { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: #eee9eb; color: var(--muted); font-size: .72rem; }
.pct-cell { min-width: 150px; }
.margin-cell { font-weight: 800; }
.nm-cell { color: var(--red-dark); }
.pct-wrap { display: grid; grid-template-columns: minmax(75px, 1fr) 54px; align-items: center; gap: 10px; }
.bar { height: 8px; background: #eee9eb; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--red); }
.pct-good .bar span { background: var(--green); }
.pct-high .bar span { background: #dd7a17; }

.insight-panel { padding-bottom: 20px; }
.insight-panel > .eyebrow, .insight-panel > h2 { margin-left: 24px; margin-right: 24px; }
.insight-panel > .eyebrow { padding-top: 24px; }
#dailyRead { display: grid; gap: 12px; padding: 24px; }
.insight { padding: 15px; border-radius: 10px; background: #f6f4f5; }
.benchmark-insight { background: var(--amber-soft); }
.insight span { display: block; color: var(--muted); font-size: .77rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.insight strong { display: block; margin-top: 6px; font-size: 1rem; line-height: 1.35; }
.insight small { display: block; margin-top: 7px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.method-note { margin: 8px 24px 0; padding: 18px; border-radius: 10px; background: var(--ink); color: white; }
.method-note strong { color: #ff7599; }
.method-note p { margin: 8px 0 0; color: #d8d2d4; font-size: .82rem; line-height: 1.5; }

.products-panel { scroll-margin-top: 94px; }
.product-heading { align-items: center; }
#productSubtitle { margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.product-help { margin: 5px 0 0; color: var(--red-dark); font-size: .82rem; font-weight: 750; }
.sort-control select { min-width: 200px; }
.product-actions { display: flex; align-items: end; gap: 10px; }
#allShopsButton { min-height: 44px; padding: 0 16px; color: var(--red); background: var(--pink); border: 1px solid transparent; border-radius: 9px; font-weight: 800; cursor: pointer; }
#allShopsButton:hover, #allShopsButton:focus { border-color: var(--red); outline: none; }
#allShopsButton:disabled { color: var(--muted); background: #eee9eb; cursor: default; }
.empty-cell { padding: 60px 20px; color: var(--muted); text-align: center; }
.product-name { font-weight: 720; }
.product-row { cursor: pointer; transition: background .15s ease; }
.product-row:hover, .product-row:focus { background: #fff5f8; outline: none; }
.product-row.expanded { background: var(--pink); }
.product-chevron { display: inline-block; width: 20px; margin-right: 4px; color: var(--red); font-size: 1.25rem; line-height: .8; transition: transform .15s ease; }
.product-row.expanded .product-chevron { transform: rotate(90deg); }
.ingredient-detail-row > td { padding: 0; background: #fbf9fa; }
.ingredient-detail { padding: 24px 28px 28px; border-bottom: 1px solid var(--line); }
.ingredient-detail-header { display: flex; justify-content: space-between; align-items: start; gap: 24px; margin-bottom: 18px; }
.ingredient-detail-header .eyebrow { margin: 0 0 5px; }
.ingredient-detail-header h3 { margin: 0; font-size: 1.22rem; }
.ingredient-detail-header p { margin: 6px 0 0; color: var(--muted); font-size: .84rem; }
.ingredient-summary { display: flex; gap: 10px; }
.ingredient-summary span { min-width: 128px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.ingredient-summary small { display: block; color: var(--muted); font-size: .66rem; font-weight: 750; text-transform: uppercase; }
.ingredient-summary strong { display: block; margin-top: 5px; font-size: .95rem; }
.ingredient-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: white; }
.ingredient-table { min-width: 620px !important; }
.ingredient-table th { position: static; padding: 9px 13px; font-size: .68rem; }
.ingredient-table td { padding: 9px 13px; font-size: .82rem; }
.ingredient-cost-note, .ingredient-empty { margin: 14px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.ingredient-cost-note strong { color: var(--ink); }
.ingredient-empty { padding: 20px 28px; }
.cost-pill { display: inline-block; min-width: 66px; padding: 5px 8px; border-radius: 999px; background: var(--pink); color: var(--red-dark); font-weight: 800; text-align: center; }
.benchmark-column { background: #fffaf0; }
.benchmark-range { color: var(--muted); white-space: nowrap; }
.benchmark-delta { display: inline-block; min-width: 72px; padding: 5px 8px; border-radius: 999px; font-weight: 800; text-align: center; }
.benchmark-delta.above { color: var(--red-dark); background: var(--pink); }
.benchmark-delta.below { color: var(--green); background: var(--green-soft); }
.benchmark-delta.near { color: var(--muted); background: #eee9eb; }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 22px 4px 0; color: var(--muted); font-size: .78rem; }
.actual-hero { display: flex; justify-content: space-between; align-items: end; gap: 36px; margin-bottom: 24px; }
.actual-intro { max-width: 820px; margin: 18px 0 0; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
.pilot-scope { min-width: 230px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: var(--shadow); }
.pilot-scope span, .pilot-scope small { display: block; color: var(--muted); font-size: .75rem; }
.pilot-scope span { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pilot-scope strong { display: block; margin: 7px 0 4px; font-size: 1.1rem; }
.actual-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 12px; }
.actual-metric { min-height: 142px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: var(--shadow); }
.actual-metric span { display: block; min-height: 32px; color: var(--muted); font-size: .82rem; font-weight: 750; }
.actual-metric strong { display: block; margin: 9px 0; font-size: clamp(1.65rem, 2.6vw, 2.75rem); letter-spacing: -.05em; }
.actual-metric small { color: var(--muted); font-size: .74rem; }
.actual-metric-dark { color: white; background: var(--ink); border-color: var(--ink); }
.actual-metric-dark span, .actual-metric-dark small { color: #d8d2d4; }
.actual-metric-green { background: var(--green-soft); border-color: #b9e0cf; }
.actual-metric-alert { color: white; background: var(--red); border-color: var(--red); }
.actual-metric-alert span, .actual-metric-alert small { color: rgba(255,255,255,.8); }
.actual-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(310px, .8fr); gap: 12px; margin-bottom: 12px; }
.formula-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 18px 24px; background: #faf9f9; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.formula-strip span { padding: 7px 10px; border-radius: 7px; background: white; border: 1px solid var(--line); }
.formula-strip b { color: var(--red); }
.formula-strip strong { color: var(--ink); }
.certified-badge { padding: 7px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .72rem; font-weight: 800; }
.comparison-bars { display: grid; gap: 22px; padding: 28px 24px 32px; }
.comparison-row { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(220px, 1.5fr) 110px; align-items: center; gap: 18px; }
.comparison-row > div:first-child strong, .comparison-row > div:first-child small { display: block; }
.comparison-row > div:first-child small { margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.comparison-row > strong { text-align: right; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.comparison-track { height: 20px; border-radius: 999px; background: #eee9eb; overflow: hidden; }
.comparison-track span { display: block; height: 100%; border-radius: inherit; }
.actual-bar { background: var(--ink); }
.theoretical-bar { background: var(--green); }
.variance-bar { background: var(--red); }
.actual-status-panel { padding: 24px; }
.actual-status-panel h2 { margin-bottom: 22px; }
.status-list { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.status-list li { position: relative; padding: 15px 15px 15px 42px; border-radius: 10px; background: #f6f4f5; }
.status-list li::before { position: absolute; left: 15px; top: 16px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: white; font-size: .68rem; font-weight: 900; }
.status-list .complete::before { content: "✓"; background: var(--green); }
.status-list .next::before { content: "→"; background: var(--red); }
.status-list strong, .status-list span { display: block; }
.status-list span { margin-top: 5px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.definition-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.definition-grid article { min-height: 150px; padding: 24px; border-right: 1px solid var(--line); }
.definition-grid article:last-child { border-right: 0; }
.definition-grid p { margin: 9px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.actual-shop-panel { margin-bottom: 12px; }
.actual-shop-panel table { min-width: 1120px; }
.actual-shop-panel td { vertical-align: middle; }
.variance-unfavorable { color: var(--red-dark); font-weight: 800; }
.variance-favorable { color: var(--green); font-weight: 800; }
.count-dates { display: block; white-space: nowrap; font-size: .78rem; }
.count-warning { display: inline-block; margin-top: 5px; padding: 3px 7px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .insight-panel { min-height: auto; }
  .actual-metrics { grid-template-columns: repeat(2, 1fr); }
  .actual-grid { grid-template-columns: 1fr; }
  .definition-grid { grid-template-columns: repeat(2, 1fr); }
  .definition-grid article:nth-child(2) { border-right: 0; }
  .definition-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .app-header { padding: 9px 16px; }
  .view-tabs { top: 59px; padding: 0 12px; overflow-x: auto; }
  .view-tab { white-space: nowrap; }
  .brand img { width: 44px; height: 38px; }
  .status { display: none; }
  main { width: min(100% - 24px, 1540px); padding-top: 42px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .metrics { grid-template-columns: 1fr; }
  .ingredient-detail-header { flex-direction: column; }
  .ingredient-summary { width: 100%; overflow: auto; }
  .metric { min-height: 122px; }
  .panel-heading { align-items: stretch; flex-direction: column; padding: 18px; }
  .search-control input, .sort-control select { width: 100%; min-width: 0; }
  .product-actions { align-items: stretch; flex-direction: column-reverse; }
  .trend-wrap { min-height: 220px; padding: 8px 10px 12px; }
  #trendChart { height: 200px; }
  th, td { padding: 12px 11px; }
  .pct-cell { min-width: 150px; }
  footer { flex-direction: column; }
  .actual-hero { align-items: stretch; flex-direction: column; }
  .actual-metrics { grid-template-columns: 1fr; }
  .comparison-row { grid-template-columns: 1fr; gap: 8px; }
  .comparison-row > strong { text-align: left; }
  .definition-grid { grid-template-columns: 1fr; }
  .definition-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .definition-grid article:last-child { border-bottom: 0; }
}

/* Inventory: shared COGS branding, purpose-specific layout. */
.intro { margin-bottom: 28px; }
.intro h1 { max-width: 900px; }
.sub { color: var(--muted); font-size: .95rem; line-height: 1.65; margin: 16px 0 0; }
.controls { display:flex; flex-wrap:wrap; align-items:end; gap:18px; padding:22px 24px; background:var(--white); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.controls label,.mode>span,.searchlabel { display:grid; gap:7px; color:var(--muted); font-size:.78rem; font-weight:700; }
.controls select,.controls input { display:block; margin-top:7px; }
#shop { min-width:235px; }
.mode { margin-left:auto; }
.mode>div { display:flex; gap:4px; padding:4px; border-radius:10px; background:#f1edef; margin-top:7px; }
button { min-height:40px; padding:9px 14px; border:1px solid var(--line); border-radius:9px; background:var(--white); color:var(--ink); font-size:.8rem; font-weight:700; cursor:pointer; }
button:hover { background:var(--pink); }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:3px solid var(--red); outline-offset:3px; }
.mode button { border-color:transparent; background:transparent; }
.mode button[aria-pressed=true] { background:var(--red); color:var(--white); }
#status { margin:18px 0; font-size:.85rem; color:var(--muted); }
.metrics { grid-template-columns:repeat(4,minmax(0,1fr)); margin:22px 0 28px; }
.metric { min-height:150px; }
.metric strong { font-size:clamp(1.65rem,2.5vw,2.5rem); }
.metric small { display:block; line-height:1.5; }
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:26px; }
.tabs button { border:0; border-bottom:3px solid transparent; border-radius:0; background:transparent; color:var(--muted); padding:15px 16px 13px; }
.tabs .selected { color:var(--red); border-bottom-color:var(--red); }
.tablehead { display:flex; justify-content:space-between; gap:20px; align-items:center; margin:0 0 20px; }
.tablehead p { margin:7px 0 0; font-size:.85rem; color:var(--muted); line-height:1.6; }
.tablehead>div:last-child { display:flex; gap:8px; align-items:end; }
.searchlabel input { min-width:220px; }
#csv { color:var(--red); background:var(--pink); border-color:transparent; }
.warning { margin:0 0 10px; padding:14px 18px; border:1px solid #ecd1a5; border-radius:10px; background:var(--amber-soft); color:#754400; font-size:.82rem; line-height:1.6; }
.warning.notice { background:#f1edef; border-color:var(--line); color:var(--muted); }
.scroll { overflow-x:auto; background:var(--white); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.scroll td { vertical-align:top; }
.scroll td:first-child { font-weight:720; min-width:180px; }
.scroll td small { display:block; color:var(--muted); font-size:.72rem; margin-top:5px; line-height:1.4; }
.qty { font-size:1.1rem; font-weight:800; font-variant-numeric:tabular-nums; white-space:nowrap; }
.good { color:var(--green); }
.hold { display:inline-block; border-radius:999px; padding:5px 9px; color:var(--amber); background:var(--amber-soft); font-size:.72rem; font-weight:700; }
.formula { max-width:380px; margin-top:8px; }
.formula summary { color:var(--red-dark); font-size:.72rem; cursor:pointer; }
.formula code { display:block; font-size:.7rem; word-break:break-all; white-space:pre-wrap; line-height:1.7; padding-top:8px; }
.method { margin-top:28px; padding:22px 24px; border-radius:14px; background:var(--ink); color:#d8d2d4; font-size:.82rem; line-height:1.7; }
.method summary { color:#ff7599; font-weight:800; cursor:pointer; }
.method p { max-width:1100px; }
.empty { padding:60px 20px; text-align:center; color:var(--muted); }
#status.error { color:var(--red-dark); }
body>footer { width:min(1540px,calc(100% - 40px)); margin:0 auto 28px; border-top:1px solid var(--line); }
@media(max-width:1100px) { .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .mode { margin-left:0; } .tablehead { flex-wrap:wrap; } }
@media(max-width:680px) { .brand small { font-size:.65rem; } .header-actions { gap:10px; } .hub-link { font-size:.8rem; } .controls { padding:18px; align-items:stretch; } .controls label { width:100%; } .controls select,.controls input { width:100%; } .mode { width:100%; } .mode button { flex:1; } .metrics { grid-template-columns:1fr; } .tablehead>div:last-child { width:100%; flex-wrap:wrap; } .searchlabel { flex:1 1 100%; } .tabs { gap:0; } .tabs button { padding:12px 9px; font-size:.75rem; } .sub br { display:none; } }
@media print { .app-header,.controls,.tabs,.tablehead>div:last-child,.method,body>footer { display:none; } main { width:100%; padding:0; } h1 { font-size:24px; } .sub { display:none; } .scroll { overflow:visible; box-shadow:none; } th { position:static; } th,td { padding:6px; font-size:9px; } .warning { font-size:9px; } .metrics { grid-template-columns:repeat(4,1fr); gap:6px; } .metric { box-shadow:none; min-height:0; padding:10px; } .metric strong { font-size:18px; } }
[hidden] { display:none !important; }
/* Worksheet-first view: daily inputs beside supplier ordering matrices. */
main { width:calc(100% - 40px); max-width:1920px; padding-top:24px; }
.intro { margin-bottom:18px; }
.intro h1 { font-size:2rem; }
.intro .eyebrow,.intro .sub { display:none; }
.controls { padding:14px 18px; gap:16px; box-shadow:none; border-radius:9px; }
.metrics { gap:0; border:1px solid var(--line); border-radius:9px; background:white; margin:14px 0; }
.metrics .metric { min-height:0; border:0; border-right:1px solid var(--line); border-radius:0; box-shadow:none; background:transparent; color:var(--ink); padding:12px 18px; }
.metrics .metric:last-child { border:0; }
.metrics .metric span,.metrics .metric small { min-height:0; color:var(--muted); font-size:.7rem; }
.metrics .metric strong { font-size:1.35rem; margin:5px 0; }
.tabs { margin-bottom:16px; }
.tablehead { margin-bottom:14px; }
.tablehead h2 { font-size:1.2rem; }
.tablehead p { font-size:.75rem; }
.worksheet-grid { display:grid; grid-template-columns:minmax(0,1.16fr) minmax(0,1fr); gap:18px; align-items:start; }
.source-sheet,.supplier-sheet { background:white; border:1px solid #cfc7ca; border-radius:6px; overflow:hidden; }
.sheet-caption,.supplier-sheet h3 { display:flex; flex-wrap:wrap; justify-content:space-between; gap:6px; margin:0; padding:10px 12px; background:var(--pink); color:var(--ink); font-size:.8rem; font-weight:800; }
.sheet-caption span { color:var(--muted); font-size:.7rem; font-weight:500; }
.sheet-scroll { overflow:auto; }
.sheet-table { font-family:Arial,Helvetica,sans-serif; font-size:12px; table-layout:auto; }
.sheet-table th,.sheet-table td { border:1px solid #e2dee0; padding:5px 7px; font-size:12px; line-height:1.3; white-space:nowrap; }
.sheet-table thead th { background:#e5e1e3; color:var(--ink); font-size:11px; letter-spacing:0; text-transform:none; position:static; text-align:right; }
.sheet-table thead th:first-child { text-align:left; }
.sheet-table th small { display:block; color:var(--muted); font-size:9px; font-weight:400; margin-top:2px; }
.sheet-table tbody th { font-weight:400; text-align:left; max-width:250px; white-space:normal; min-width:170px; }
.sheet-table .weekly { background:#f0edef; font-weight:700; border-left:2px solid #c9c0c4; }
.sheet-table .sheet-band th { background:var(--pink); color:var(--red-dark); font-weight:700; padding:7px; }
.sheet-table tbody tr:hover td,.sheet-table tbody tr:hover>th { background:#fff5f8; }
.sheet-table tbody tr.sheet-band:hover th { background:var(--pink); }
.supplier-sheet { margin-bottom:14px; }
.sheet-held { color:var(--amber); background:#fffaf0; }
.sheet-held sup { font-size:10px; }
.sheet-cell { position:relative; }
.sheet-cell summary { cursor:pointer; list-style:none; text-decoration:underline dotted #b6aeb1; text-underline-offset:3px; }
.sheet-cell summary::-webkit-details-marker { display:none; }
.sheet-cell>div { position:relative; white-space:normal; text-align:left; min-width:190px; max-width:310px; padding:10px 0 4px; font-size:11px; color:var(--ink); }
.sheet-cell code { display:block; overflow-wrap:anywhere; white-space:pre-wrap; font-size:10px; line-height:1.5; }
.sheet-footnote { color:var(--muted); font-size:.72rem; line-height:1.6; margin:8px 2px; }
.review-notes { border:1px solid var(--line); border-radius:8px; margin:16px 0; background:white; padding:12px 16px; }
.review-notes>summary { cursor:pointer; font-size:.8rem; font-weight:700; color:var(--amber); }
.review-notes[open] #warnings { margin-top:12px; }
.method { margin-top:18px; }
@media(max-width:1100px) { .worksheet-grid { grid-template-columns:1fr; } .source-sheet .sheet-table { min-width:850px; } .sheet-table { width:100%; } }
@media(max-width:680px) { main { width:calc(100% - 24px); padding-top:18px; } .metrics { grid-template-columns:1fr 1fr; } .metrics .metric:nth-child(2) { border-right:0; } .metrics .metric:nth-child(-n+2) { border-bottom:1px solid var(--line); } .tabs { flex-wrap:wrap; } .supplier-sheet .sheet-table { min-width:560px; } }
@media print { .worksheet-grid { display:block; } .sheet-scroll { overflow:visible; } .source-sheet { margin-bottom:15px; } .sheet-table { min-width:0!important; } .review-notes { display:none; } .sheet-table th,.sheet-table td { font-size:8px; padding:3px; } .sheet-table tbody th { min-width:110px; } }
.pilot-summary { display:flex; flex-wrap:wrap; gap:24px; padding:18px; margin:14px 0 24px; background:white; border:1px solid var(--line); border-radius:9px; font-size:.8rem; color:var(--muted); }
.pilot-summary strong { display:block; font-size:1.3rem; color:var(--ink); margin-bottom:5px; }
.pilot-audit h3 { margin:24px 0 14px; }
.pilot-audit td small { display:block; color:var(--muted); margin-top:6px; font-size:.75rem; line-height:1.4; }
.pilot-audit th[scope=row] { position:static; text-transform:none; letter-spacing:0; font-size:.82rem; min-width:180px; background:transparent; }
