/* Engine Workbench. Pages are meant to be screenshotted and printed (plan 9.4),
   so: no web fonts or third-party assets (CSP), and a print block at the end. */
:root {
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0; --line-2: #cbd5e1;
  --bg: #f4f6f9; --panel: #ffffff; --head: #f8fafc;
  /* EEtility brand sheet: navy 1E376D, blue 007DAF, light blues 9DDAE6 / A8DDE4, greens 275A3F / 2E845C / 01863F / 17B157 */
  --brand: #1E376D; --brand-2: #24427F; --accent: #007DAF; --accent-soft: #E6F5F8; --accent-line: #A8DDE4;
  --green: #2E845C; --green-dark: #275A3F; --green-bright: #17B157;
  --pass: #01863F; --pass-soft: #ECF8F1; --pass-line: #B5E3C7;
  --fail: #b91c1c; --fail-soft: #fef2f2; --fail-line: #fecaca;
  --warn: #a16207; --warn-soft: #fefce8;
  --radius: 10px; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
       color: var(--ink); background: var(--bg); margin: 0; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }

/* ------------------------------------------------------------- header */
header.top { display: flex; align-items: center; gap: 28px; padding: 0 28px; height: 56px; color: #fff;
             background: linear-gradient(90deg, var(--brand), var(--brand-2)); position: sticky; top: 0; z-index: 10;
             box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
header.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: #fff; letter-spacing: .1px; }
header.top .brand:hover { text-decoration: none; }
header.top .brand .name { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
header.top .brand .tagline { font-size: 11.5px; font-weight: 500; color: rgba(255, 255, 255, .7); padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .3); }
/* the leaf's colours: sky blue over green */
header.top .brand::before { content: ""; width: 20px; height: 24px; border-radius: 80% 10% 80% 45%;
  background: linear-gradient(160deg, #9DDAE6 0 30%, #007DAF 30% 48%, #17B157 48% 78%, #01863F 78% 100%); }
header.top { border-bottom: 3px solid var(--green-bright); }
header.top nav { display: flex; gap: 4px; flex: 1; }
header.top nav a { color: rgba(255, 255, 255, .78); padding: 6px 12px; border-radius: 7px; font-weight: 500; }
header.top nav a:hover { color: #fff; background: rgba(255, 255, 255, .1); text-decoration: none; }
header.top nav a.on { color: #fff; background: rgba(255, 255, 255, .16); }
header.top .who { color: rgba(255, 255, 255, .72); font-size: 12px; text-align: right; line-height: 1.35; }
form.signout { margin: 0; }
form.signout button { font: inherit; color: #fff; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* --------------------------------------------------------------- page */
main { max-width: 1200px; margin: 0 auto; padding: 26px 28px 64px; }
.crumbs { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--accent); }
h1 { color: var(--brand); font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -.2px; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 650; margin: 30px 0 10px; color: var(--ink); }
h3 { font-size: 13px; font-weight: 650; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
p { margin: 0 0 10px; }
.sub { color: var(--muted); margin: 0 0 18px; max-width: 900px; }
.meta, .note { color: var(--muted); } .note { font-size: 13px; margin: 8px 2px 0; max-width: 980px; }
ul { margin: 6px 0 10px; padding-left: 20px; color: var(--ink-2); } li { margin: 2px 0; }

/* ------------------------------------------------------------- tables */
.scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; vertical-align: top; }
th { background: var(--head); color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .35px;
     border-bottom: 1px solid var(--line-2); }
th.w { white-space: normal; min-width: 120px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: #fafcfe; }
td.l, th.l { text-align: left; } td.w { white-space: normal; min-width: 180px; color: var(--ink-2); }
tr.total td { font-weight: 650; background: var(--head); }
td b { font-weight: 650; }

/* pass / fail as a dot + word: reads in colour, in greyscale print and in a screenshot */
.pass { color: var(--pass); font-weight: 600; } .fail { color: var(--fail); font-weight: 600; } .warn { color: var(--warn); font-weight: 600; }
td.pass::before, td.fail::before, td.warn::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; vertical-align: 1px; background: currentColor; }

/* ----------------------------------------------------- banner, boxes */
.banner { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius);
          padding: 14px 18px; margin: 4px 0 16px; background: var(--panel); box-shadow: var(--shadow); color: var(--ink-2); font-weight: 400; }
.banner.pass { background: var(--pass-soft); border-color: var(--pass-line); }
.banner.fail { background: var(--fail-soft); border-color: var(--fail-line); }
.banner.warn-banner { display: block; background: var(--warn-soft, #fff7e6); border-color: var(--warn-line, #e6c27a); }
.banner.warn-banner > b { color: var(--warn); } .banner.warn-banner ul.findings a { color: inherit; } .banner.warn-banner p { margin: 8px 0 0; }
tr.reference td { background: var(--accent-soft); }
.banner b { font-size: 15px; font-weight: 650; }
.banner b.pass, .banner.pass > b { color: var(--pass); } .banner b.fail, .banner.fail > b { color: var(--fail); }
.box { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0 0; color: var(--ink-2); max-width: 980px; }

.tag { display: inline-block; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px;
       background: #f1f5f9; color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
.tag.calibrated { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.tag.locked { background: #f1f5f9; border-color: var(--line-2); color: var(--ink-2); }

/* -------------------------------------------------------- stat cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 6px 0 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.card .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .35px; color: var(--muted); }
.card .big { font-size: 26px; font-weight: 650; letter-spacing: -.4px; line-height: 1.2; margin-top: 4px; }
.card .big small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.card .foot { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card.pass { border-top: 3px solid var(--pass); } .card.fail { border-top: 3px solid var(--fail); } .card.info { border-top: 3px solid var(--brand); }
.card.pass .big, .card.fail .big { color: var(--ink); font-weight: 650; }

/* --------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin: 18px 0 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; }
.tabs a:hover { color: var(--ink); background: rgba(15, 23, 42, .04); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a.right { margin-left: auto; color: var(--accent); font-weight: 600; }
.tabs a.right::before { content: "⎙ "; }

.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; background: var(--green); color: #fff; font-weight: 600; box-shadow: var(--shadow); }
.btn:hover { background: var(--green-dark); text-decoration: none; }
.signin { max-width: 460px; margin: 8vh auto 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 30px 32px; box-shadow: var(--shadow); }

/* -------------------------------------------------------------- print */
@media print {
  body { background: #fff; font-size: 11.5px; }
  header.top { position: static; height: auto; padding: 0 0 6px; background: none; color: #000; box-shadow: none; border-bottom: 1px solid #000; }
  header.top .brand, header.top .who { color: #000; } header.top .brand::before { display: none; }
  header.top nav, .tabs, .noprint, form.signout button { display: none !important; }
  main { max-width: none; padding: 10px 0; }
  .scroll, .card, .banner, .box { box-shadow: none; } .scroll { overflow: visible; }
  th, td { padding: 5px 8px; white-space: normal; }
  h2 { page-break-after: avoid; } table, .banner, .box, .card { page-break-inside: avoid; }
  a { color: inherit; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ------------------------------------------------ actions, log, forms */
.titlebar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; align-items: center; } .actions form { margin: 0; }
.right { text-align: right; }
button.btn { font: inherit; font-weight: 600; border: 0; cursor: pointer; }
.btn.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); }
.btn.secondary:hover { background: var(--head); }
pre.log { background: #0f172a; color: #e2e8f0; border-radius: var(--radius); padding: 14px 16px; font: 12px/1.5 Consolas, "Cascadia Mono", monospace;
          overflow-x: auto; white-space: pre-wrap; max-height: 460px; overflow-y: auto; }

/* ---------------------------------------------------------- input form */
.opt { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; margin-left: 6px; }
form.inputs section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
                      padding: 6px 20px 20px; margin: 16px 0; scroll-margin-top: 110px; }
form.inputs section h2 { margin-top: 16px; }
form.inputs section .scroll { box-shadow: none; }
.steps { position: sticky; top: 56px; z-index: 5; display: flex; gap: 4px; padding: 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.steps a { padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 500; background: var(--panel); border: 1px solid var(--line); }
.steps a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; margin-top: 12px; }
.fields.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.field.wide { grid-column: span 2; } .field { scroll-margin-top: 120px; min-width: 0; }
.field > label, .field label:first-child { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field label em { font-style: normal; font-weight: 500; color: var(--accent); font-size: 11.5px; margin-left: 4px; }
.control { display: flex; align-items: center; gap: 8px; }
.control.check { margin: 8px 0; } .control.check label { display: inline; font-weight: 500; margin: 0; color: var(--ink); font-size: 14px; }
input[type=text], input[type=search], select, textarea { font: inherit; color: var(--ink); width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; }
textarea { font: 12.5px/1.5 Consolas, "Cascadia Mono", monospace; resize: vertical; }
input[type=text]:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.unit { color: var(--muted); font-size: 13px; white-space: nowrap; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.msg { font-size: 12.5px; margin-top: 4px; font-weight: 500; white-space: normal; } .msg.err { color: var(--fail); } .msg.wrn { color: var(--warn); }
.basis { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--fail); background: var(--fail-soft); }
.has-wrn input, .has-wrn select, .has-wrn textarea { border-color: #eab308; background: var(--warn-soft); }
table.grid td { padding: 6px 10px; min-width: 190px; } table.grid td:first-child { min-width: 210px; color: var(--ink-2); font-weight: 500; }
table.grid tr:hover td { background: none; }
ul.findings { margin: 6px 0 0; flex-basis: 100%; } ul.findings a { color: var(--fail); }
.formbar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ------------------------------------------------- footer, logo, report */
body { min-height: 100vh; display: flex; flex-direction: column; } main { flex: 1; width: 100%; }
footer.site { display: flex; align-items: center; gap: 22px; padding: 16px 28px; background: var(--panel); border-top: 1px solid var(--line);
              color: var(--muted); font-size: 12px; line-height: 1.5; }
footer.site img { display: block; height: 44px; width: auto; }
footer.site .legal b { color: var(--brand); letter-spacing: .5px; }
.signin .logo { display: block; height: 64px; width: auto; margin: 0 0 18px; }
.reportlogo { height: 52px; width: auto; }
.kicker { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--green); margin: 0 0 2px; }
@media print {
  header.top { border-bottom: 1px solid #000; }
  footer.site { padding: 8px 0 0; margin-top: 14px; font-size: 9.5px; gap: 12px; } footer.site img { height: 28px; }
}

/* --------------------------------------------- live checks, system columns */
.hidden { display: none !important; }
.linkbtn { font: inherit; font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--accent); background: none;
           border: 0; padding: 0 0 0 8px; cursor: pointer; } .linkbtn:hover { text-decoration: underline; }
.hint.live { min-height: 18px; } .hint.live.err { color: var(--fail); font-weight: 500; } .hint.live.ok { color: var(--pass); font-weight: 500; }
form.one-system table.grid { width: auto; } form.one-system table.grid td[data-sys] { min-width: 300px; }

/* ------------------------------------------------------------ bill chart */
.billgrid { display: grid; grid-template-columns: minmax(320px, 3fr) minmax(240px, 2fr); gap: 16px; align-items: start; }
.billchart { width: 100%; height: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
@media (max-width: 800px), print { .billgrid { grid-template-columns: 1fr; } }

/* ------------------------------------- admin, help, methods, csv, search */
label.inline { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; font-weight: 500; white-space: nowrap; }
input.narrow { width: 110px; } .scroll.tall { max-height: 420px; overflow-y: auto; }
.cardtext { margin: 8px 0 0; color: var(--ink-2); font-size: 13.5px; }
a.csv { display: inline-block; font-size: 12px; color: var(--muted); margin: 4px 2px 0; } a.csv:hover { color: var(--accent); }
form.search { display: flex; gap: 6px; margin: 0; } form.search input { width: 240px; }
article.method { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 28px 24px; max-width: 980px; }
article.method p, article.method li { color: var(--ink-2); line-height: 1.6; } article.method .sub { color: var(--ink); font-size: 15px; margin-top: 16px; }
article.method .scroll { box-shadow: none; margin: 8px 0 14px; } article.method code { background: var(--head); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
@media print { article.method { border: 0; padding: 0; max-width: none; } }
.card .big.small { font-size: 17px; letter-spacing: 0; line-height: 1.35; padding: 5px 0 3px; }

/* ------------------------------------------ project inputs panel, edited copies */
.twocol { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 18px; }
.hint.was { color: var(--accent); font-weight: 500; }

/* ------------------------------------ tooltips, bills grid, scope, dual fuel */
.tip { position: relative; display: inline-block; color: var(--accent); font-weight: 500; cursor: help; border-bottom: 1px dotted var(--accent); }
.tip::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: 320px; max-width: 70vw; padding: 8px 10px;
              background: var(--ink); color: #fff; font-size: 12px; font-weight: 400; line-height: 1.45; border-radius: 6px; box-shadow: 0 4px 14px rgba(15, 23, 42, .25);
              white-space: normal; text-align: left; opacity: 0; pointer-events: none; transition: opacity .1s; }
.tip:hover::after, .tip:focus::after { opacity: 1; }
td .tip { border-bottom: 0; }
.hint.deflt:empty { display: none; }
.billtext { display: none; } .billtext.shown { display: block; }
table.bills { width: 100%; } table.bills td { padding: 3px 4px; border: 0; } table.bills th { padding: 4px 6px; }
table.bills input[type=date] { width: 150px; } table.bills input[type=text] { width: 110px; }
table.bills tr:hover td { background: none; }
.billtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.btn.small { padding: 5px 10px; font-size: 12.5px; box-shadow: none; }
.run-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.run-actions .btn { white-space: nowrap; }
.billtools input[type=date] { width: 150px; padding: 5px 8px; }
td.dim input, td.dim select { opacity: .45; }
input.locked, select.locked { background: var(--head); color: var(--muted); }
tr.scope td { background: var(--accent-soft); }
tr.scope select { font-weight: 600; }
@media print { .tip { border: 0; color: var(--ink-2); } .tip::after { position: static; display: inline; opacity: 1; width: auto; max-width: none; padding: 0 0 0 4px;
  background: none; color: var(--muted); box-shadow: none; font-size: 10px; content: "(" attr(data-tip) ")"; } }
tr.dualbox td { background: var(--head); } tr.dualbox label.inline { font-size: 13px; }

/* Operational project workspace */
.review-path { line-height:1.8; padding-left:22px; }
.evidence-json { white-space:pre-wrap; overflow-wrap:anywhere; max-height:520px; overflow:auto; font-size:12px; }
.evidence-formula { overflow-wrap:anywhere; }
.evidence-case { margin:16px 0; }
.evidence-case h3 { margin-top:0; }
.skip-link { position:absolute; top:-60px; left:16px; z-index:100; background:white; padding:12px; }
.skip-link:focus { top:8px; }
:focus-visible { outline: 3px solid #147c91; outline-offset: 3px; }
.workspace-intro { display:flex; justify-content:space-between; align-items:center; gap:24px; margin-bottom:24px; }
.workspace-intro .sub { max-width:660px; }
.project-filters { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin:24px 0 14px; }
.project-filters label { display:grid; gap:5px; font-size:12px; color:var(--ink-2); }
.project-filters input { min-width:260px; }
.project-filters select { min-width:160px; }
@media (max-width: 1050px) {
 header.top { height:auto; min-height:56px; flex-wrap:wrap; gap:10px 16px; padding:12px 20px; }
 header.top nav { order:3; flex-basis:100%; flex-wrap:wrap; }
 header.top .who { margin-left:auto; }
}
@media (max-width: 640px) {
 header.top { position:relative; padding:12px 16px; }
 header.top .brand .tagline { display:none; }
 header.top .who { max-width:190px; font-size:11px; }
 header.top nav a { padding:8px 10px; }
 main { padding:22px 16px 40px; }
 details .note { overflow-wrap:anywhere; }
}
.empty-projects { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:48px 24px; text-align:center; }
.empty-projects p { max-width:560px; margin:12px auto 24px; color:var(--muted); }
.project-id { display:block; font-size:11px; color:var(--muted); margin-top:3px; }
.resource-links { margin-bottom:10px; font-size:13px; }
@media (max-width:700px) {
 .workspace-intro { align-items:flex-start; flex-direction:column; }
 .top { flex-wrap:wrap; gap:10px; }
 .top nav { flex-wrap:wrap; }
 .twocol { grid-template-columns:minmax(0,1fr); }
 .project-filters, .project-filters label { width:100%; }
 .project-filters input, .project-filters select { min-width:0; width:100%; }
}
