:root {
  --bg: #f6f4ee;
  --card: #ffffff;
  --ink: #17231f;
  --muted: #56625c;
  --line: #dad6cb;
  --line-soft: #e7e3d8;
  --accent: #0e5a4a;
  --accent-ink: #ffffff;
  --accent-soft: #e3efea;
  --warn-bg: #fbf1da;
  --warn-ink: #5b4100;
  --err-bg: #fde8e8;
  --err-ink: #8a1c1c;
  --good: #1d7a46;
  --bar: #7fb3a3;
  --assume: #c58a1a;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101713;
    --card: #17211c;
    --ink: #e9efeb;
    --muted: #9fb0a7;
    --line: #2b3a33;
    --line-soft: #243029;
    --accent: #6fc2ac;
    --accent-ink: #0a1511;
    --accent-soft: #1d2f28;
    --warn-bg: #3a2f10;
    --warn-ink: #f2d58a;
    --err-bg: #3d1b1b;
    --err-ink: #f4b4b4;
    --good: #5fcf92;
    --bar: #3f7566;
    --assume: #d9a441;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 26px 0 10px; }
.lead { color: var(--muted); margin: 0 0 20px; max-width: 70ch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.grid .field { margin: 0; }
.field > span, legend { font-weight: 600; font-size: 0.9rem; padding: 0; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
input[type="text"], input[type="number"], input[type="date"], select {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; min-height: 44px;
}
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible, .chips label:has(input:focus-visible), .seg label:has(input:focus-visible) {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 8px; cursor: pointer; font-size: 0.95rem; min-height: 44px; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 0.95rem; min-height: 40px; }
.chips input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0; }
.assume { border: 1px dashed var(--assume); border-radius: 8px; padding: 10px 14px; margin-top: 6px; }
.assume summary { cursor: pointer; font-weight: 600; }
.assume .hint { margin: 10px 0; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.presets button { font: inherit; font-size: 0.85rem; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; min-height: 36px; }
.errors { background: var(--err-bg); color: var(--err-ink); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.errors p { margin: 0 0 4px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar h2 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 8px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.btn.ghost { background: transparent; color: var(--accent); }
.tablewrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.total { font-weight: 700; position: relative; }
td.total .meter { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--bar); }
tr.is-assume td.total .meter { background: var(--assume); }
.inst { font-weight: 600; }
.inst small { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.tag.ill { background: var(--assume); color: #1b1300; }
.range { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.legend { font-size: 0.82rem; color: var(--muted); margin: 10px 0 0; }
.dot { display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; }
.dot.scale { background: var(--bar); }
.dot.ill { background: var(--assume); margin-left: 10px; }
details.inst-d { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
details.inst-d > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
details.inst-d > summary span:last-child { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.d-body { padding: 0 14px 14px; }
.d-body table { margin: 6px 0 10px; }
.d-body ul { margin: 6px 0 10px 18px; padding: 0; color: var(--muted); font-size: 0.9rem; }
.d-body .warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 12px; border-radius: 8px; margin: 8px 0; font-size: 0.9rem; }
.src { font-size: 0.85rem; color: var(--muted); }
.src a { color: var(--accent); }
.badge { display: inline-block; font-size: 0.75rem; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin-right: 6px; }
.badge.sec { background: var(--warn-bg); color: var(--warn-ink); }
.disclaimer { background: var(--accent-soft); border-radius: 8px; padding: 12px 14px; margin-top: 22px; font-size: 0.88rem; color: var(--ink); }
.foot { color: var(--muted); font-size: 0.82rem; margin-top: 18px; }
.printOnly { display: none; }

@media (max-width: 560px) {
  h1 { font-size: 1.4rem; }
  th, td { padding: 8px 8px; }
  table { font-size: 0.88rem; }
}

@media print {
  :root { --bg: #fff; --card: #fff; --ink: #000; --muted: #444; --line: #bbb; --accent: #1f4e79; --accent-soft: #eef3f8; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .no-print, .form, .legend .dot { display: none !important; }
  .printOnly { display: block; margin-bottom: 10px; }
  .card { border: 0; padding: 0; }
  .wrap { padding: 0; max-width: none; }
  details.inst-d { break-inside: avoid; }
  details.inst-d > .d-body { display: block; }
  .tablewrap { overflow: visible; }
  td.total .meter { display: none; }
  a { color: #000; text-decoration: none; }
}
.more { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.more > summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 44px; display: flex; align-items: center; gap: 8px; list-style-position: inside; }
.more > summary em { font-style: normal; font-size: 0.75rem; font-weight: 700; background: var(--assume); color: #1b1300; padding: 1px 8px; border-radius: 999px; }
.more > summary em:empty { display: none; }
.more-body { padding-top: 12px; }
div.assume { border: 1px dashed var(--assume); border-radius: 8px; padding: 12px 14px; margin-top: 6px; }
.notincl { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 10px 14px; margin: 10px 0 8px; font-size: 0.9rem; }
.srclist { margin: 0; padding-left: 18px; font-size: 0.88rem; }
.srclist li { margin-bottom: 8px; }
.srclist .srcl { color: var(--muted); }
.srclist a, .srclink { color: var(--accent); }
.inst small .srclink { font-size: inherit; }
[hidden] { display: none !important; }

/* ---- Claude Design pass: serif display, calmer ground, larger claim field ---- */
.wrap { max-width: 1040px; padding: 56px 24px 72px; }
.top { margin-bottom: 28px; }
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
h1, h2, h3, .num.total, #claim { font-family: var(--serif); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 14px; max-width: 18ch; }
h2 { font-size: 1.9rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.35rem; font-weight: 600; }
.lead { font-size: 1.1rem; max-width: 62ch; margin: 0; }
.card { padding: 28px; margin-bottom: 20px; }
#claim { font-size: 1.75rem; font-weight: 600; min-height: 56px; border: 1.5px solid var(--ink); border-radius: 10px; }
input[type="text"], input[type="number"], input[type="date"], select { min-height: 48px; border-color: #bfbaac; border-radius: 10px; }
.seg { border-radius: 10px; border-color: #bfbaac; }
.seg span { min-height: 46px; display: flex; align-items: center; justify-content: center; }
.more > summary { font-size: 1rem; }
.btn { border-radius: 10px; padding: 0 20px; min-height: 48px; }
.btn.ghost { background: var(--card); }
th { border-bottom: 2px solid var(--ink); font-size: 0.75rem; letter-spacing: 0.08em; }
td { border-bottom-color: var(--line-soft); padding: 16px 12px; }
td.total { font-size: 1.4rem; font-weight: 700; }
td.total .meter { position: static; display: block; height: 4px; margin: 8px 0 0 auto; border-radius: 2px; }
.inst { font-size: 1.05rem; }
.notincl { border-radius: 10px; padding: 14px 18px; }
.disclaimer { background: var(--accent-soft); border-radius: 10px; padding: 16px 18px; }
.tag.ill { background: #f2d9a0; color: #5b4100; }
.badge { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-radius: 6px; }

@media (max-width: 900px) {
  #summary thead { display: none; }
  #summary, #summary tbody, #summary td { display: block; width: 100%; }
  #summary tr { display: flex; flex-direction: column; width: 100%; }
  #summary tr { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
  #summary td { border: 0; padding: 4px 0; text-align: left; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.92rem; }
  #summary td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 0.85rem; text-align: left; }
  #summary td:first-child { order: -2; padding-bottom: 2px; }
  #summary td.total { order: -1; font-size: 1.6rem; padding: 6px 0 8px; flex-wrap: wrap; }
  #summary td.total .meter { flex-basis: 100%; margin-left: 0; }
  #summary td.range { white-space: normal; }
  .tablewrap { overflow: visible; }
}

@media (max-width: 640px) {
  .wrap { padding: 32px 16px 56px; }
  .card { padding: 18px; }
}

.durnote { font-size: 0.82rem; color: var(--muted); margin: 10px 0 0; }
td.dur strong { display: block; }
td.dur small { display: block; color: var(--muted); font-size: 0.8rem; }
@media (max-width: 900px) { #summary td.dur { flex-wrap: wrap; } #summary td.dur strong { display: inline; margin-left: auto; } #summary td.dur small { display: block; flex-basis: 100%; text-align: right; margin-top: 0; } }


/* partner branding, shown above the form when the page is opened with ?client=<name> */
.brandbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brandbar .logo { max-height: 44px; max-width: 180px; object-fit: contain; }
.brandbar strong { display: block; font-size: 1.05rem; }
.brandbar span { color: var(--muted); font-size: 0.9rem; }

/* ---- decision document (print / PDF): fixed light colours, laid out as A4 pages ---- */
.report { display: none; color: #17231f; font-size: 12.5px; line-height: 1.45; }
.view-report .wrap > *:not(#report) { display: none !important; }
/* report preview (?report=1): the document carries its own title, so the site's banner and tool notes are hidden (one h1) */
.view-report .tool-hero, .view-report .tool-about { display: none !important; }
.view-report .report { display: block; max-width: 794px; margin: 0 auto; background: #fff; box-shadow: 0 0 0 1px #dad6cb; }
.view-report body { background: #e9e6dd; }
.rpage { background: #fff; padding: 40px 52px; box-sizing: border-box; }
.view-report .rpage + .rpage { border-top: 1px dashed #b9b4a6; }
.report h1 { font-family: var(--serif); font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 18px; max-width: none; color: #17231f; }
.report h2 { font-family: inherit; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand, #0e5a4a); margin: 0 0 6px; font-weight: 700; }
.report h2.dark { color: #17231f; }
.rp-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #17231f; padding-bottom: 10px; margin-bottom: 18px; }
.rp-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand, #0e5a4a); }
.rp-date { font-size: 12px; color: #56625c; }
.rp-params { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; margin-bottom: 18px; }
.rp-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #56625c; }
.rp-v { font-weight: 700; font-size: 14px; }
.rp-sub { font-size: 11px; color: #56625c; font-weight: 400; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 8px; }
.rp-table th { background: var(--brand, #0e5a4a); color: #fff; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 10px; text-align: left; border: 0; }
.rp-table th.r, .rp-table td.r { text-align: right; }
.rp-table td { padding: 11px 10px; border-bottom: 1px solid #dad6cb; vertical-align: top; }
.rp-table tr:last-child td { border-bottom: 2px solid #17231f; }
.rp-cost { font-family: var(--serif); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-muted { color: #56625c; font-variant-numeric: tabular-nums; }
.rp-table td.small { font-size: 11.5px; }
.rp-fn { font-size: 11px; color: #56625c; margin: 0 0 14px; }
.rp-box { background: #fbf1da; color: #5b4100; border-radius: 6px; padding: 12px 14px; font-size: 12px; margin-bottom: 14px; }
.rp-read { border-top: 1px solid #dad6cb; padding-top: 12px; font-size: 11.5px; }
.rp-read strong { display: block; font-size: 12px; margin-bottom: 4px; }
.rp-read div { margin-bottom: 3px; }
.rp-block { border-bottom: 1px solid #dad6cb; padding: 0 0 12px; margin-bottom: 12px; break-inside: avoid; }
.rp-bh { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.rp-bh strong { font-size: 14px; }
.rp-line { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.rp-line .n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-line.muted { color: #56625c; }
.rp-note { font-size: 11.5px; color: #56625c; margin-top: 5px; }
.rp-src { font-size: 11px; color: #56625c; margin-top: 5px; }
.rp-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 14px; margin-bottom: 16px; font-size: 12px; }
.rp-grid .rp-k { text-transform: none; letter-spacing: 0; font-size: 12px; }
.rp-sources { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-bottom: 16px; }
.rp-sources td { padding: 6px 8px; border-bottom: 1px solid #dad6cb; vertical-align: top; }
.rp-sources td.b { font-weight: 700; width: 90px; padding-left: 0; }
.rp-limits { border: 1px solid #17231f; border-radius: 6px; padding: 14px 16px; font-size: 12px; break-inside: avoid; }
.rp-limits ol { margin: 0; padding-left: 18px; }
.rp-limits li { margin-bottom: 6px; }

@page {
  size: A4;
  margin: 10mm 14mm 15mm;
  @bottom-left { content: "Arbitration cost comparison \00b7  estimate only"; font: 9px system-ui, sans-serif; color: #56625c; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 9px system-ui, sans-serif; color: #56625c; }
}
@media print {
  html { color-scheme: light; }
  body { background: #fff !important; }
  .wrap { max-width: none; padding: 0; }
  .wrap > *:not(#report) { display: none !important; }
  .report { display: block; }
  .rpage { padding: 0; break-after: page; }
  .rpage:last-child { break-after: auto; }
}

/* report density: keeps the document to a few A4 sheets */
.report { font-size: 12px; line-height: 1.4; }
.rp-head { margin-bottom: 12px; padding-bottom: 8px; }
.report h1 { font-size: 30px; margin-bottom: 14px; }
.rp-params { margin-bottom: 14px; }
.rp-table td { padding: 9px 10px; }
.rp-box { padding: 10px 12px; margin-bottom: 10px; }
.rp-block { padding-bottom: 8px; margin-bottom: 8px; }
.rp-bh { margin-bottom: 4px; }
.rp-line { font-size: 11.5px; }
.rp-note { font-size: 11px; margin-top: 3px; line-height: 1.35; }
.rp-src { font-size: 10.5px; margin-top: 3px; }
.rp-grid { gap: 3px 12px; margin-bottom: 10px; font-size: 11.5px; }
.rp-sources { margin-bottom: 10px; font-size: 11px; }
.rp-sources td { padding: 3px 8px; }
.rp-limits { padding: 10px 14px; font-size: 11.5px; }
.rp-limits li { margin-bottom: 4px; }
.rp-table td:nth-child(3) { white-space: nowrap; }
.rp-table td:nth-child(1) { width: 17%; }
.rp-table td:nth-child(1) { width: 26%; }

/* print the green header and the tinted boxes even when the print dialog has "Background graphics" off */
.report, .report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-bh strong { white-space: nowrap; }

.rp-by { font-size: 13px; color: #56625c; margin: -6px 0 14px; }
.rp-sign { margin-top: 26px; width: 280px; break-inside: avoid; font-size: 12px; }
.rp-sign-line { border-bottom: 1px solid #17231f; height: 34px; margin-bottom: 6px; }

.rp-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rp-brand strong { font-size: 15px; color: #17231f; }
.rp-logo { max-height: 44px; max-width: 160px; object-fit: contain; }
.rp-foot { margin-top: 14px; font-size: 11px; color: #56625c; border-top: 1px solid #dad6cb; padding-top: 8px; }

.hint.echo { min-height: 1.2em; }
.hint.bad { color: var(--err-ink); font-weight: 600; }
label.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 0.92rem; }
label.check input { width: 18px; height: 18px; }
.rp-line.total { font-weight: 700; border-top: 1px solid #dad6cb; margin-top: 3px; padding-top: 3px; }

/* keep the worst case (three arbitrators, counterclaim) to one sheet per page */
.rp-limits { font-size: 11px; padding: 8px 12px; }
.rp-limits li { margin-bottom: 3px; }
.rp-sources { font-size: 10.5px; margin-bottom: 8px; }
.rp-sources td { padding: 2px 8px; }
.rp-grid { font-size: 11px; gap: 2px 12px; margin-bottom: 8px; }
.rp-head { margin-bottom: 10px; }

/* a selected institution is marked by more than colour */
.chips input:checked + span::before { content: "✓ "; }
/* the agreement date is a short value: no need for the full width */
input[type="date"] { max-width: 280px; }

/* a component with one figure (no range) is written once across Min, Mid and Max */
.d-body td.one { text-align: center; }
.d-body td.one small { display: block; color: var(--muted); font-size: 0.8rem; font-variant-numeric: normal; }
