/* GHG Assurance Workbench · center layout only.
   Reuses every token + class from app-base.css (header, chips, panels, tiles,
   badges, tables, ledger, footer, focus rings). This file adds only the
   distinct mechanic: the control deck, the in-table TOLERANCE BAR, the
   modified-opinion draft box, and the trust-boundary strip. No palette
   re-definition; colours come from the base custom properties. */

main.wrap { max-width: 1140px; }

.synline { margin: 14px 0 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- control deck (the live swap · the hero interaction) ---- */
.deck {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--surface); margin-bottom: 22px;
}
.deck .ctrl { padding: 16px 18px; border-right: 1px solid var(--line2); }
.deck .ctrl:last-child { border-right: none; }
.deck label {
  display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--cap); margin-bottom: 8px;
}
.sel {
  width: 100%; font-family: var(--sans); font-size: 13.5px; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238A8D94' stroke-width='1.4' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41,98,217,.12); }
.deck .hint { font-size: 11.5px; color: var(--body); margin: 9px 0 0; line-height: 1.5; min-height: 30px; }
.deck .hint b { color: var(--ink); font-weight: 600; }
.deck .hint .up { color: var(--danger); font-weight: 600; }
.deck .ctrl-fix .btn { width: 100%; justify-content: center; }
.deck .ctrl-fix .btn:disabled { opacity: .5; }

/* ---- summary ---- */
.summary { margin-bottom: 22px; }
.summary .tiles { margin-bottom: 0; border-radius: 8px 8px 0 0; }
.tiles .t .v.vfix { transition: color .25s; }
.opinion {
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 8px 8px;
  padding: 14px 18px; font-size: 14px; display: flex; align-items: center; gap: 12px;
  background: var(--surface);
}
.opinion .lbl {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 11px; border-radius: 30px; white-space: nowrap;
}
.opinion.modified { background: var(--esc-bg); }
.opinion.modified .lbl { background: var(--warn); color: #fff; }
.opinion.clean { background: var(--allow-bg); }
.opinion.clean .lbl { background: var(--ok); color: #fff; }
.opinion .txt { color: var(--body2); }
.opinion .txt b { color: var(--ink); }

/* ---- recompute table + tolerance bars (distinct mechanic) ---- */
.tblpanel { margin-bottom: 22px; }
.recompute th.num, .recompute td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.recompute td.metricname { font-weight: 500; max-width: 280px; }
.recompute td.metricname .mid { font-family: var(--mono); font-size: 10px; color: var(--cap); display: block; }
.recompute .tolcol { width: 230px; }
.recompute tr.active { background: var(--wash); }
.recompute tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* the tolerance bar: a centered band with a deviation marker */
.tolbar { position: relative; height: 26px; width: 210px; }
.tolbar .track {
  position: absolute; top: 11px; left: 0; right: 0; height: 4px;
  background: var(--line2); border-radius: 2px;
}
.tolbar .band {
  position: absolute; top: 8px; height: 10px; border-radius: 2px;
  background: var(--allow-bg); border: 1px solid #CDE6D7;
}
.tolbar .center { position: absolute; top: 4px; height: 18px; width: 1px; background: var(--faint); left: 50%; }
.tolbar .marker {
  position: absolute; top: 5px; width: 3px; height: 16px; border-radius: 2px;
  transform: translateX(-50%); transition: left .35s cubic-bezier(.4,0,.2,1), background .25s;
}
.tolbar .marker.in { background: var(--ok); }
.tolbar .marker.out { background: var(--danger); }
.tolbar .marker.nv { background: var(--cap); }
.tolbar .dev {
  position: absolute; top: -2px; right: 0; font-family: var(--mono); font-size: 9.5px;
  color: var(--cap);
}
.recompute td.verdictcell { white-space: nowrap; }
.badge.b-nv { background: var(--wash); color: var(--body2); border: 1px dashed var(--faint); }

/* row flip animation when the swap moves a verdict */
@keyframes flipflash { 0% { background: #FCEFEA; } 100% { background: transparent; } }
.recompute tr.flip { animation: flipflash .9s ease; }

/* ---- trace panel ---- */
.tracepanel .trace-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.trace-step { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.trace-step .sh {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--cap); padding: 9px 13px; border-bottom: 1px solid var(--line2); background: #FCFCFB;
}
.trace-step .sb { padding: 12px 13px; }
.trace-step .sb .calc { font-family: var(--mono); font-size: 12px; color: var(--body2); line-height: 1.9; }
.trace-step .sb .calc b { color: var(--ink); }
.trace-step .sb .calc .eq { color: var(--accent); }
.cite { display: inline-block; font-family: var(--mono); font-size: 10px; background: var(--wash); border-radius: 30px; padding: 2px 9px; color: var(--body2); margin: 2px 4px 2px 0; }
.cite.src { background: #EEF3FD; color: var(--accent-d); }
.trace-draft {
  border: 1px solid var(--line); border-radius: 7px; padding: 14px 15px; background: #FCFCFB; margin-top: 4px;
}
.trace-draft .dh { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); margin-bottom: 8px; }
.trace-draft .dh::before { content: "✎ "; }
.trace-draft p { margin: 0; font-size: 13.5px; color: var(--body2); line-height: 1.6; }
.trace-draft p b { color: var(--ink); }
.trace-draft .abstain { color: var(--warn); font-weight: 600; }

/* ---- two-column: modified opinion + ledger ---- */
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 26px; align-items: start; }
.qlist { list-style: none; padding: 0; margin: 0 0 14px; }
.qlist li {
  display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line2); font-size: 13px;
}
.qlist li:first-child { border-top: none; }
.qlist li .mid { font-family: var(--mono); font-size: 11px; color: var(--cap); }
.qlist .empty { color: var(--ok); font-size: 13px; padding: 8px 0; }
.draftbox {
  border: 1px solid var(--line); border-radius: 7px; padding: 13px 15px; background: #FCFCFB; font-size: 13px; line-height: 1.6;
}
.draftbox .dh { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); margin-bottom: 7px; }
.draftbox .dh::before { content: "✎ drafted by template · "; }
.draftbox p { margin: 0; color: var(--body2); } .draftbox p b { color: var(--ink); }
.draftbox .qual { color: var(--warn); font-weight: 600; }
.hitl { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hitl .who { font-family: var(--mono); font-size: 10.5px; color: var(--cap); }
.hitl .signed { font-family: var(--mono); font-size: 10.5px; color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.hitl .signed::before { content: "✓"; }

/* ---- trust-boundary strip ---- */
.trustline {
  display: flex; align-items: stretch; flex-wrap: wrap; gap: 0; margin: 8px 0 40px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-family: var(--mono); font-size: 11px;
}
.trustline span { padding: 12px 16px; line-height: 1.5; }
.tb-code { flex: 1 1 320px; background: var(--allow-bg); color: var(--ok); }
.tb-sep { display: flex; align-items: center; background: var(--ink); color: #fff; letter-spacing: .04em; white-space: nowrap; }
.tb-llm { flex: 1 1 320px; background: var(--esc-bg); color: var(--warn); }

@media (max-width: 900px) {
  .deck { grid-template-columns: 1fr; }
  .deck .ctrl { border-right: none; border-bottom: 1px solid var(--line2); }
  .twocol { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .recompute .tolcol { display: none; } .tolbar { width: 120px; }
}
