/* Trilivy.AI Business Case Kit (buykit.trilivy.app) — shared styles */
:root {
  --navy: #2A4B6B;
  --blue: #356D9F;
  --ink: #1f2933;
  --muted: #52606d;
  --line: #CBD9E8;
  --tint: #EAF1F7;
  --tint2: #E4EDF5;
  --paper: #ffffff;
  --page: #f5f8fb;
  --fill-bg: #fff3cd;
  --fill-ink: #6b4e00;
  --good: #1e6b45;
  --warn: #8a5a00;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px 64px; }

/* Header band */
.kitbar {
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  letter-spacing: .04em;
}
.kitbar .wrap { padding-top: 10px; padding-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
.kitbar a { color: #fff; text-decoration: none; opacity: .85; }
.kitbar a:hover { opacity: 1; text-decoration: underline; }
.kitbar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }

.cover {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.cover .wrap { padding-top: 40px; padding-bottom: 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--blue); font-weight: 700; margin: 0 0 8px; }
h1 { font-size: 34px; line-height: 1.2; color: var(--navy); margin: 0 0 12px; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 18px; max-width: 760px; }
.meta { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 22px; }

/* Body */
section { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 26px 28px; margin: 0 0 22px; }
h2 { font-size: 23px; color: var(--navy); margin: 0 0 12px; line-height: 1.3; }
h2 .num { color: var(--blue); font-weight: 600; margin-right: 8px; }
h3 { font-size: 18px; color: var(--navy); margin: 22px 0 8px; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin: 0 0 6px; }
a { color: var(--blue); }
strong { color: var(--navy); }
small, .note { font-size: 13px; color: var(--muted); }

/* Fill-in fields: the only things the evaluator must touch */
.fill {
  background: var(--fill-bg);
  color: var(--fill-ink);
  border-bottom: 2px dotted #c9a227;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 600;
  white-space: normal;
}
.legend { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }

/* Callouts */
.callout { border-left: 4px solid var(--blue); background: var(--tint); padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 14px 0; }
.callout.warn { border-left-color: #c9a227; background: #fffaf0; }
.callout.good { border-left-color: var(--good); background: #eef7f2; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.quote { font-size: 19px; color: var(--navy); font-weight: 600; margin: 18px 0; padding-left: 16px; border-left: 4px solid var(--line); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.stat { background: var(--tint); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.15; }
.stat .k { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: #fff; }
.card h4 { margin: 0 0 6px; color: var(--navy); font-size: 16px; }
.card p { font-size: 15px; margin: 0; }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(42,75,107,.12); }
.card .tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--blue); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }

/* Tables */
.tbl { width: 100%; overflow-x: auto; margin: 12px 0 14px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--tint2); color: var(--navy); font-weight: 700; font-size: 14px; }
tr.total td { font-weight: 700; color: var(--navy); background: var(--tint); }
td.r, th.r { text-align: right; white-space: nowrap; }

/* Checklist */
.check { list-style: none; padding-left: 0; }
.check li { padding-left: 30px; position: relative; }
.check li::before { content: "☐"; position: absolute; left: 4px; top: -1px; color: var(--blue); font-size: 18px; }

/* Grade pill */
.grade { display: inline-block; background: var(--navy); color: #fff; font-weight: 700; border-radius: 6px; padding: 2px 10px; font-size: 15px; }

/* Calculator */
.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.calc fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 6px; margin: 0; }
.calc legend { font-weight: 700; color: var(--navy); padding: 0 6px; }
.calc label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; margin: 0 0 9px; }
.calc input, .calc select { width: 130px; flex: 0 0 auto; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--fill-bg); font: inherit; font-size: 14px; color: var(--ink); }
.out td.r { font-variant-numeric: tabular-nums; }

/* Sign-off */
.sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sign div { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-height: 92px; }
.sign b { display: block; color: var(--navy); }

/* Next/prev */
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.pager a { background: var(--navy); color: #fff; text-decoration: none; padding: 10px 16px; border-radius: 7px; font-weight: 600; }
.pager a.ghost { background: transparent; color: var(--navy); border: 1px solid var(--navy); }

footer { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 16px 32px; }

@media (max-width: 600px) {
  h1 { font-size: 27px; }
  section { padding: 20px 16px; }
  .lede { font-size: 16px; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .kitbar, .pager, .noprint { display: none !important; }
  section { border: none; padding: 0; margin: 0 0 18pt; break-inside: auto; }
  .cover { border: none; }
  .fill.empty { background: #fff3cd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- site chrome (buykit.trilivy.app) ---------- */
.kithead { background: #fff; border-bottom: 1px solid var(--line); }
.kithead .wrap { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.kithead .brand img { height: 38px; width: auto; display: block; }
.kithead .kitname { font-weight: 700; color: var(--navy); font-size: 15px; letter-spacing: .02em; border-left: 1px solid var(--line); padding-left: 14px; }
.tabs { background: var(--navy); }
.tabs .wrap, .subtabs .wrap { display: flex; flex-wrap: wrap; gap: 2px; padding-top: 0; padding-bottom: 0; }
.tabs a { color: #fff; text-decoration: none; padding: 10px 13px; font-size: 14px; font-weight: 600; opacity: .85; border-bottom: 3px solid transparent; }
.tabs a:hover { opacity: 1; }
.tabs a.on { opacity: 1; border-bottom-color: #f07a2a; }
.subtabs { background: var(--tint2); border-bottom: 1px solid var(--line); }
.subtabs a { color: var(--navy); text-decoration: none; padding: 8px 11px; font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; }
.subtabs a.on { border-bottom-color: var(--blue); }

/* Filled values read as normal text; only empty fields stay yellow. */
.fill { background: transparent; color: inherit; border-bottom: 1px dotted var(--blue); padding: 0; font-weight: 600; }
.fill.empty { background: var(--fill-bg); color: var(--fill-ink); border-bottom: 2px dotted #c9a227; padding: 0 4px; }

/* Fill-in form */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.btn { background: var(--navy); color: #fff; border: 0; border-radius: 7px; padding: 9px 15px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn.warn { background: #fff; color: #8a2a2a; border: 1px solid #c99; }
#progress { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#progress .bar { display: inline-block; width: 180px; height: 8px; background: var(--tint2); border-radius: 4px; overflow: hidden; }
#progress .bar span { display: block; height: 100%; background: var(--blue); }
.fgroup { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; padding: 0 20px; }
.fgroup[open] { padding-bottom: 18px; }
.fgroup summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 15px 0; font-weight: 700; color: var(--navy); font-size: 17px; }
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary::before { content: "▸"; margin-right: 8px; color: var(--blue); }
.fgroup[open] summary::before { content: "▾"; }
.fgroup summary > span:first-child { flex: 1; }
.fgroup .cnt { font-size: 13px; color: var(--muted); font-weight: 600; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 18px; }
.fgrid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.fgrid label.wide { grid-column: 1 / -1; }
.fgrid input, .fgrid select, .fgrid textarea { font: inherit; font-size: 15px; color: var(--ink); padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fffdf4; width: 100%; }
.fgrid input:focus, .fgrid select:focus, .fgrid textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; background: #fff; }

/* Report tab */
.rpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px 18px; margin: 10px 0 16px; }
.rpick label { display: flex; gap: 9px; align-items: flex-start; font-size: 15px; }
.rpick input { margin-top: 4px; }
.rquick { display: flex; flex-wrap: wrap; gap: 8px; }
#reportroot { display: none; }
.rcover { text-align: left; padding: 60px 0 0; }
.rcover img { height: 64px; width: auto; margin-bottom: 70px; }
.rcover h1 { font-size: 36px; }
.rcover .toc { margin-top: 40px; }

@media print {
  .kithead, .tabs, .subtabs, .noprint { display: none !important; }
  .fill { border: 0; font-weight: inherit; }
  body.printing > main.wrap, body.printing > header.cover, body.printing > footer { display: none !important; }
  body.printing #reportroot { display: block !important; }
  .rsec { break-before: page; }
  .rsec:first-child { break-before: auto; }
  .rsec header.cover .wrap { padding-top: 0; }
  .rsec main.wrap { display: block !important; padding: 0; max-width: none; }
  .rsec section { break-inside: auto; }
  .rsec h2, .rsec h3 { break-after: avoid; }
  .rsec tr, .rsec .stat, .rsec .card { break-inside: avoid; }
  @page { margin: 16mm 14mm; }
}

/* ---------- value states (2026-10-22): default = yellow, edited = light green, needed = orange ---------- */
:root { --dflt-bg: #fff3c4; --dflt-ink: #5c4600; --edit-bg: #d9f2df; --edit-ink: #14532d; --must-bg: #ffd8bf; --must-ink: #8a2c00; }
.fill { border-radius: 3px; padding: 0 4px; font-weight: 600; border-bottom: 2px solid transparent; }
.fill.dflt { background: var(--dflt-bg); color: var(--dflt-ink); border-bottom-color: #e2c55a; }
.fill.edited { background: var(--edit-bg); color: var(--edit-ink); border-bottom-color: #6cc287; }
.fill.must { background: var(--must-bg); color: var(--must-ink); border-bottom-color: #f07a2a; }
main .fill[data-k], header.cover .fill[data-k] { cursor: pointer; }
main .fill[data-k]:hover, header.cover .fill[data-k]:hover { outline: 2px solid var(--blue); outline-offset: 1px; }
.btn.small { padding: 5px 11px; font-size: 13px; }

.legendbar { background: #fffdf3; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.legendbar .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; }
.legendbar .fill { font-size: 12px; }
.legendbar .lbtns { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.kpop { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(20,40,70,.22); padding: 12px 14px; }
.kpop-l { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.kpop input, .kpop select, .kpop textarea { width: 100%; font: inherit; font-size: 15px; padding: 7px 9px; border: 1px solid var(--blue); border-radius: 6px; }
.kpop-b { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.kpop-h { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* Form: the same three colours on every field */
.fgrid label .flab { display: flex; justify-content: space-between; gap: 8px; }
.freset { border: 0; background: none; color: var(--blue); font: inherit; font-size: 12px; cursor: pointer; padding: 0; visibility: hidden; }
.fgrid label.edited .freset { visibility: visible; }
.fgrid label.dflt input, .fgrid label.dflt select, .fgrid label.dflt textarea { background: var(--dflt-bg); border-color: #e2c55a; }
.fgrid label.edited input, .fgrid label.edited select, .fgrid label.edited textarea { background: var(--edit-bg); border-color: #6cc287; }
.fgrid label.must input, .fgrid label.must select, .fgrid label.must textarea { background: var(--must-bg); border-color: #f07a2a; }
.fgroup.fmust { border: 2px solid #f07a2a; background: #fff8f2; }
.fgroup.fmust summary { color: #8a2c00; }
#progress .fill { font-weight: 600; }

/* Report cover: the buyer's company, never the vendor */
.rcover .rcompany { font-size: 54px; line-height: 1.1; font-weight: 800; color: var(--navy); margin: 120px 0 18px; word-break: break-word; }
.rcover .rtitle { font-size: 24px; color: var(--ink); margin: 0 0 8px; font-weight: 600; }

@media print {
  .legendbar, .kpop { display: none !important; }
  .fill.dflt, .fill.edited { background: none !important; color: inherit !important; border: 0 !important; padding: 0 !important; font-weight: inherit !important; }
  .fill.must { background: var(--must-bg) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.marks .fill.dflt { background: var(--dflt-bg) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.marks .fill.edited { background: var(--edit-bg) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Save / Load dialogs */
.kmodal-bg { position: fixed; inset: 0; background: rgba(20,35,55,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; }
.kmodal { background: #fff; border-radius: 12px; width: 100%; max-width: 680px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.kmodal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--navy); font-size: 17px; }
.kmodal-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.kmodal-b { padding: 16px 18px 18px; }
.kfield { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.kfield input { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--blue); border-radius: 6px; color: var(--ink); }
table.klist { width: 100%; font-size: 14px; }
table.klist td.r { white-space: nowrap; text-align: right; }
.btn.small.warn { background: #fff; color: #8a2a2a; border: 1px solid #c99; }
.kws { margin: 14px 0 6px; font-size: 14px; }
.kws summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.kwsrow { display: flex; gap: 8px; }
.kwsrow input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.kfiles { margin-top: 12px; }
.ktoast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 120; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.fmt { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 14px; }
.fmt label { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--navy); }
.fmt label:has(input:checked) { border-color: var(--blue); background: var(--tint); }
.rcover .raudience { font-size: 26px; font-weight: 700; color: var(--blue); margin: 0 0 22px; padding-bottom: 14px; border-bottom: 3px solid #f07a2a; display: inline-block; }
