/* ---------------------------------------------------------------------------
   Decision tree — the Article 50 labelling tool, and the risk classifier later.

   Loaded only on pages that declare `tool: "decision-tree"`, so the other 45
   pages do not pay for it. Rendered entirely by /assets/decision-tree.js; the
   mount stays [hidden] until the JSON has loaded, so a failed fetch leaves no
   dead skeleton on the page.

   This file is identical on promptguide.no and promptworkbook.com, and
   check-parity.mjs fails if it stops being.
   --------------------------------------------------------------------------- */
.tree {
  --tree-muted: #56637a;
  margin: 34px 0 40px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.tree[hidden] { display: none; }
.tree-head h2 { margin: 0 0 6px; font-size: 1.5rem; }
.tree-intro { margin: 0; color: var(--tree-muted); }
.tree-stage { margin-top: 24px; }

.tree-question-block fieldset { margin: 0; padding: 0; border: 0; }
.tree-question-block legend { display: block; width: 100%; padding: 0; }
.tree-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tree-step { color: var(--blue); font-size: .74rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.tree-dots { display: flex; gap: 6px; }
.tree-dots i { width: 7px; height: 7px; border-radius: 50%; background: #c3cddd; }
.tree-dots i.is-current { background: var(--blue); }
.tree-question { display: block; color: var(--ink); font-size: 1.3rem; font-weight: 900; line-height: 1.35; }
.tree-question:focus-visible { outline: 3px solid rgba(23,101,255,.38); outline-offset: 4px; }

.tree-help { margin: 14px 0 0; }
.tree-help summary { color: var(--blue); font-size: .88rem; font-weight: 800; cursor: pointer; }
.tree-help p { margin: 10px 0 0; color: var(--tree-muted); font-size: .93rem; }

.tree-options { display: grid; gap: 10px; margin-top: 20px; }
.tree-options-single { justify-items: start; }
.tree-option {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  text-align: left;
  background: var(--white);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.tree-option:hover { border-color: var(--blue); transform: translateX(4px); }

.tree-checklist { display: grid; gap: 2px; margin-top: 20px; }
.tree-check { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; padding: 11px 14px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.tree-check:hover { border-color: var(--line); background: var(--white); }
.tree-check input { width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--blue); }

.tree-btn {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--white);
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
}
.tree-btn:hover { border-color: var(--blue); color: var(--blue); }
.tree-btn.is-done { border-color: var(--blue); color: var(--blue); }
.tree-btn-primary { color: white; border-color: var(--blue); background: var(--blue); }
.tree-btn-primary:hover { color: white; background: var(--blue-bright); }
.tree-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.tree-outcome { padding: 26px; border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: 15px; background: var(--white); }
.tree-outcome.verdict-no-duty, .tree-outcome.verdict-exempt { border-left-color: #1c7a4f; }
.tree-outcome.verdict-must-label { border-left-color: #b5501f; }
.tree-outcome.verdict-reduced, .tree-outcome.verdict-provider-duty { border-left-color: #9a7410; }
.tree-outcome-title { margin: 0 0 12px; color: var(--ink); font-size: 1.55rem; line-height: 1.25; }
.tree-outcome-title:focus-visible { outline: 3px solid rgba(23,101,255,.38); outline-offset: 4px; }
.tree-outcome-body { margin: 0; }
.tree-outcome h4 { margin: 26px 0 12px; color: var(--ink); font-size: .78rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }

.tree-disclosures { display: grid; gap: 12px; }
.tree-disclosure { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--pale); }
.tree-disclosure-label { grid-column: 1 / -1; color: var(--tree-muted); font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.tree-disclosure-text { margin: 0; color: var(--ink); font-weight: 700; }
.tree-note { margin: 12px 0 0; color: var(--tree-muted); font-size: .9rem; }
.tree-note-carried { margin: 0 0 18px; padding: 11px 14px; border-left: 3px solid var(--blue); background: var(--white); }
.tree-alternative { margin-top: 22px; padding: 16px 18px; border-left: 3px solid var(--line); }
.tree-alternative strong { display: block; margin-bottom: 4px; color: var(--blue); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.tree-alternative p { margin: 0; }
.tree-basis { margin: 20px 0 0; color: var(--tree-muted); font-size: .88rem; }
.tree-caveats ul { margin: 0; padding-left: 20px; }
.tree-caveats li { margin-bottom: 8px; color: var(--tree-muted); font-size: .93rem; }
.tree-readmore { display: inline-block; margin-top: 18px; color: var(--blue); font-weight: 800; }

.tree-summary { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.tree-summary h3 { margin: 0 0 10px; color: var(--tree-muted); font-size: .74rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.tree-summary ol { margin: 0; padding-left: 20px; }
.tree-summary li { margin-bottom: 8px; font-size: .92rem; }
.tree-summary-q { display: block; color: var(--tree-muted); }
.tree-summary-a { display: block; color: var(--ink); font-weight: 700; }
.tree-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.tree-disclaimer { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--tree-muted); font-size: .86rem; }
.tree-error { color: #b5501f; font-weight: 700; }

@media (max-width: 720px) {
  .tree { padding: 20px; }
  .tree-disclosure { grid-template-columns: 1fr; }
}

/* The printed sheet is the artefact people file internally: the questions they
   answered, what they answered, and the verdict — on one page, without chrome. */

/* Verdicts for the risk classifier. Same colour language as the labelling tool:
   green where nothing is required, amber where something is, red where it stops. */
.tree-outcome.verdict-minimal, .tree-outcome.verdict-outside { border-left-color: #1c7a4f; }
.tree-outcome.verdict-limited { border-left-color: #9a7410; }
.tree-outcome.verdict-high-risk { border-left-color: #b5501f; }
.tree-outcome.verdict-prohibited { border-left-color: #a51f1f; }
.tree-outcome.verdict-gpai, .tree-outcome.verdict-distributor { border-left-color: var(--blue); }

/* Build-time rendering of every outcome, below the tool. Crawlers and visitors
   without JavaScript get the same text the tool would have shown. */
.tree-static { display: grid; gap: 18px; margin-top: 22px; }
.tree-static-outcome { padding: 22px 24px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 13px; background: var(--white); }
.tree-static-outcome h3 { margin: 0 0 8px; color: var(--ink); font-size: 1.12rem; }
.tree-static-outcome p { margin: 0 0 10px; }
.tree-static-outcome ul { margin: 0 0 10px; padding-left: 20px; }
.tree-static-outcome li { margin-bottom: 6px; color: var(--tree-muted, #56637a); font-size: .93rem; }
.tree-static-outcome > *:last-child { margin-bottom: 0; }
.tree-static-basis { color: var(--tree-muted, #56637a); font-size: .88rem; }
.tree-static-note { color: var(--tree-muted, #56637a); font-size: .9rem; }
.tree-static-wording li { color: var(--ink); }

@media print {
  .site-header, .site-footer, .consent, .skip-link, .tree-nav, .tree-actions, .tree-help { display: none !important; }
  .tree { border: 0; padding: 0; background: none; }
  .tree-outcome { border: 1px solid #999; border-left-width: 4px; page-break-inside: avoid; }
  .tree-disclosure { background: none; border: 1px solid #bbb; }
  .tree-copy { display: none !important; }
  .tree-summary { page-break-inside: avoid; }
  a[href^="/"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}
