/* Predictive DfR Assessment MVP — internal technical UI */

:root {
  --ink: #16222e;
  --paper: #f5f7f9;
  --card: #ffffff;
  --line: #d4dce3;
  --muted: #5c6b7a;
  --accent: #2e5e8c;
  --accent-dark: #234a70;

  --favourable: #2e7d4f;
  --favourable-bg: #e8f4ec;
  --conditional: #a06e12;
  --conditional-bg: #faf1dc;
  --unfavourable: #b03a2e;
  --unfavourable-bg: #f9e8e6;
  --notevaluable: #55616e;
  --notevaluable-bg: #eceff2;
  --notapplicable: #8a94a0;

  /* material family chips */
  --m-pe: #4f8fca; --m-pp: #6fb3a0; --m-pet: #c96f5c; --m-pa: #b58ac2;
  --m-evoh: #e0a93c; --m-alu: #9aa4ad; --m-adh: #c9c27a; --m-ink: #7d7d7d;
  --m-coat: #a3c48b; --m-unk: #d0d5da;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

main { max-width: 1080px; margin: 0 auto; padding: 18px 20px 60px; }

.topbar { background: #dd1e10; color: #fff; border-bottom: 4px solid #b01810; }
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .2px; }
.mvp-tag {
  font-size: 11px; vertical-align: middle; border: 1px solid rgba(255,255,255,.5);
  padding: 1px 6px; border-radius: 3px; margin-left: 6px; font-weight: 500;
}
.subtitle { margin: 3px 0 0; font-size: 12.5px; color: #b9c6d2; }
.author-line { margin: 2px 0 0; font-size: 12px; color: #ffe3df; font-weight: 500; }

.demo-loader { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.demo-label { font-size: 12px; color: #b9c6d2; margin-right: 2px; }
.demo-btn {
  background: transparent; color: #dfe8ef; border: 1px solid #4a5a68; border-radius: 4px;
  padding: 5px 10px; font-size: 12.5px; cursor: pointer;
}
.demo-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.scope-note {
  font-size: 13px; color: var(--muted); border-left: 3px solid var(--accent);
  padding: 6px 12px; margin: 18px 0; background: #eef2f6;
}

.context-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #dd1e10;
  border-radius: 6px;
  padding: 18px 22px;
  margin: 18px 0 22px;
}
.context-panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
}
.context-panel h3 {
  margin: 15px 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.context-panel p {
  margin: 7px 0;
  color: #243342;
}
.context-panel ul {
  margin: 7px 0 8px 20px;
  padding: 0;
}
.context-panel li {
  margin: 4px 0;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 20px 22px; margin-bottom: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.step {
  display: inline-flex; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 600; flex: 0 0 auto;
}
.card h3 { font-size: 14px; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.hint { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select {
  font: inherit; font-size: 14px; color: var(--ink); border: 1px solid var(--line);
  border-radius: 4px; padding: 7px 9px; background: #fff;
}
input:focus, select:focus, button:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[readonly] { background: #f0f3f5; color: var(--muted); }

table { border-collapse: collapse; width: 100%; margin-top: 8px; font-size: 13.5px; }
th, td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: middle; }
th { background: #eef2f6; font-weight: 600; font-size: 12.5px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* layer table styled as film cross-section */
.layer-table .chip-col { width: 8px; padding: 0; border-right: none; }
.layer-table td.chip { padding: 0; width: 8px; border-right: none; }
.layer-table input, .layer-table select { width: 100%; min-width: 70px; border: none; padding: 6px 4px; background: transparent; }
.layer-table input:focus, .layer-table select:focus { background: #eef4fa; }
.layer-table .mass-cell { font-variant-numeric: tabular-nums; text-align: right; color: var(--accent-dark); font-weight: 600; }
.remove-layer { background: none; border: none; color: var(--unfavourable); cursor: pointer; font-size: 15px; }

button.primary {
  background: var(--accent); color: #fff; border: none; border-radius: 4px;
  padding: 10px 18px; font-size: 14.5px; font-weight: 600; cursor: pointer;
}
button.primary:hover { background: var(--accent-dark); }
button.secondary {
  background: #fff; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px;
  padding: 7px 14px; font-size: 13.5px; cursor: pointer; margin-top: 8px;
}
button.secondary:hover { background: #eef4fa; }
.actions { margin-top: 18px; display: flex; align-items: center; gap: 14px; }
.status-msg { font-size: 13px; color: var(--muted); }
.status-msg.error { color: var(--unfavourable); }

.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.sum-card { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; background: #fbfcfd; }
.sum-card .k { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.sum-card .v { font-size: 21px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sum-card .u { font-size: 12px; color: var(--muted); }

.comp-chart { display: flex; height: 30px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); margin: 8px 0 6px; }
.comp-chart .seg { height: 100%; min-width: 2px; }
.comp-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.comp-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge.favourable { background: var(--favourable-bg); color: var(--favourable); }
.badge.conditional { background: var(--conditional-bg); color: var(--conditional); }
.badge.unfavourable { background: var(--unfavourable-bg); color: var(--unfavourable); }
.badge.not-evaluable { background: var(--notevaluable-bg); color: var(--notevaluable); }
.badge.not-applicable { background: #f2f4f6; color: var(--notapplicable); }

.controlling { color: var(--unfavourable); font-weight: 700; margin-left: 4px; }

.two-col { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

.conf-card, .rec-card { border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.conf-score { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.conf-level { font-size: 14px; font-weight: 600; }
.conf-level.high { color: var(--favourable); }
.conf-level.medium { color: var(--conditional); }
.conf-level.low { color: var(--unfavourable); }
.conf-breakdown { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.7; }

.rec-card .rec-type { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.rec-card p { margin: 6px 0; font-size: 14px; }
.rec-card .rec-k { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-top: 12px; }

.warn-box {
  margin-top: 14px; border: 1px solid var(--conditional); background: var(--conditional-bg);
  border-radius: 6px; padding: 12px 16px; font-size: 13.5px;
}
.warn-box ul { margin: 6px 0 0; padding-left: 18px; columns: 2; }
@media (max-width: 640px) { .warn-box ul { columns: 1; } }

#report-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

footer { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; }
footer p { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .card { transition: box-shadow .15s ease; }
  .card:hover { box-shadow: 0 1px 6px rgba(22,34,46,.07); }
}


.bottom-scope-note {
  margin: 28px 0 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #f7f9fb;
  color: var(--muted);
  font-size: 13px;
}
.bottom-scope-note h2 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--ink);
}
.bottom-scope-note p {
  margin: 0;
}
