:root { --navy: #1a4b8c; --line: #d8dde6; --bg: #f6f7f9; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #1f2733;
}
header { background: #fff; border-bottom: 2px solid var(--navy); padding: 16px 24px; }
header h1 { margin: 0; color: var(--navy); font-size: 20px; }
.meta { color: #6b7585; font-size: 12px; margin-top: 4px; }
main { padding: 20px 24px; }
.hint { color: #6b7585; font-size: 13px; margin: 0 0 12px; }
.status { font-size: 13px; margin-bottom: 10px; min-height: 18px; }
.status.error { color: #b3261e; }
.status.ok { color: #2e7d32; }
table { border-collapse: collapse; width: 100%; background: #fff; font-size: 13px; }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: right; white-space: nowrap; }
th { background: var(--navy); color: #fff; position: sticky; top: 0; font-weight: 600; }
td.label, th.label { text-align: left; }
tr.product-row td.label { font-weight: 600; cursor: pointer; }
td.manual { background: #fffdf3; cursor: pointer; }
td.manual:hover { outline: 2px solid #e3c34a; }
td.calc { background: #f0f4fa; font-weight: 600; }
td.editing { padding: 0; }
td.editing input { width: 100%; border: 2px solid var(--navy); padding: 4px 6px;
  font: inherit; text-align: right; }
.margin-good { color: #2e7d32; }
.margin-mid { color: #b07d00; }
.margin-bad { color: #b3261e; }
.incomplete td.label::after { content: " ⚠"; color: #b07d00; }
tr.child-row td { background: #fbfbfc; color: #6b7585; font-size: 12px; }
tr.child-row td.label { padding-left: 24px; }
.toggle { display: inline-block; width: 14px; color: var(--navy); }
.history-panel { position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; }
.history-panel.hidden { display: none; }
.history-inner { background: #fff; border-radius: 6px; padding: 20px;
  width: min(760px, 92vw); position: relative; }
.history-inner h2 { color: var(--navy); margin: 0 0 12px; font-size: 16px; }
.history-close { position: absolute; top: 10px; right: 12px; border: none;
  background: none; font-size: 18px; cursor: pointer; color: #6b7585; }
