/* Business-contract article tools. All rules stay inside the article wrapper. */
#bc-tools {
  --bc-navy: #14263a;
  --bc-gold: #cfb777;
  --bc-paper: #f8f6f0;
  --bc-ink: #172b43;
  --bc-muted: #526071;
  --bc-line: #cdd2d7;
  --bc-text-size: 19px;
  container: bc-tools / inline-size;
  min-width: 0;
}
#bc-tools *, #bc-tools *::before, #bc-tools *::after { box-sizing: border-box; }
#bc-tools [hidden] { display: none !important; }
#bc-tools button, #bc-tools input, #bc-tools select { font: inherit; }
#bc-tools button, #bc-tools summary { cursor: pointer; }
#bc-tools button:focus-visible, #bc-tools a:focus-visible, #bc-tools input:focus-visible, #bc-tools select:focus-visible, #bc-tools summary:focus-visible {
  outline: 3px solid #8b6b2f;
  outline-offset: 4px;
}
#bc-tools button {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #937840;
  border-radius: 3px;
  background: transparent;
  color: var(--bc-ink);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}
#bc-tools button:hover { background: #e7e1d2; }
#bc-tools button:disabled { cursor: default; opacity: .55; }

/* Preparation checklist: use the available article width, not viewport width. */
#bc-tools .bc-planner {
  margin: 28px 0 32px;
  padding: 24px;
  border: 1px solid var(--bc-line);
  border-block-start: 3px solid var(--bc-gold);
  border-radius: 4px;
  background: #eeece4;
  color: var(--bc-ink);
}
#bc-tools .bc-planner-heading { display: grid; grid-template-columns: 1fr; gap: 14px; margin-block-end: 22px; }
#bc-tools .bc-eyebrow { display: block; margin-block-end: 7px; color: #735924; font-size: 14px; line-height: 1.6; }
#bc-tools .bc-planner-heading h2 { margin: 0; font-size: 25px; line-height: 1.45; }
#bc-tools .bc-planner-heading > p { margin: 0; color: var(--bc-muted); font-size: 16px; line-height: 1.8; }
#bc-tools .bc-planner-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block-start: 22px; border-block-start: 1px solid #c5c7c7; }
#bc-tools .bc-planner-choices, #bc-tools .bc-preparation { min-width: 0; }
#bc-tools .bc-planner-choices > label { display: block; margin-block-end: 18px; color: var(--bc-ink); font-size: 15px; line-height: 1.65; }
#bc-tools .bc-planner-choices select { display: block; width: 100%; min-width: 0; min-height: 46px; margin-block-start: 7px; padding: 10px 12px; border: 1px solid #8c98a4; border-radius: 3px; background: var(--bc-paper); color: var(--bc-ink); font-size: 16px; line-height: 1.5; }
#bc-tools .bc-stage-note { margin: 4px 0 14px; color: var(--bc-muted); font-size: 14px; line-height: 1.85; }
#bc-tools .bc-jump-section { display: inline-flex; align-items: center; min-height: 44px; color: #735924; font-size: 14px; line-height: 1.6; text-underline-offset: 4px; }
#bc-tools .bc-checklist { display: flex; flex-direction: column; gap: 4px; }
#bc-tools .bc-checklist label { display: flex; align-items: flex-start; gap: 11px; min-height: 44px; padding-block: 8px; color: var(--bc-ink); font-size: 16px; line-height: 1.7; cursor: pointer; }
#bc-tools .bc-checklist input { flex: 0 0 20px; width: 20px; height: 20px; margin: 4px 0 0; accent-color: #82682f; }
#bc-tools .bc-checklist label > span { min-width: 0; overflow-wrap: anywhere; }
#bc-tools .bc-checklist input:checked + span { color: #425949; text-decoration: line-through; text-decoration-thickness: 1px; }
#bc-tools .bc-check-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-block-start: 16px; padding-block-start: 16px; border-block-start: 1px solid #c5c7c7; }
#bc-tools .bc-check-actions > span { color: var(--bc-muted); font-size: 14px; line-height: 1.7; }
#bc-tools .bc-check-actions button { background: var(--bc-paper); }
#bc-tools .bc-check-actions button:hover { background: #e7e1d2; }
#bc-tools .bc-tool-note { margin: 20px 0 0; color: var(--bc-muted); font-size: 14px; line-height: 1.85; }

/* Reading controls inherit the established article typefaces and heading sizes. */
#bc-tools .bc-reading-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 0 0 24px; padding-block: 15px; border-block: 1px solid var(--bc-line); }
#bc-tools .bc-toc { flex: 1 1 100%; min-width: 0; max-width: none; margin: 0; }
#bc-tools .bc-toc > summary { min-height: 44px; padding-block: 9px; color: var(--bc-ink); font-size: 16px; line-height: 1.6; }
#bc-tools #bc-toc-links { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; justify-content: normal; gap: 4px 20px; height: auto; margin-block-start: 10px; padding: 0; }
#bc-tools #bc-toc-links a { min-width: 0; padding-block: 8px; color: var(--bc-muted); font-size: 14px; line-height: 1.65; text-decoration: none; overflow-wrap: anywhere; }
#bc-tools #bc-toc-links a:hover { color: var(--bc-ink); text-decoration: underline; text-underline-offset: 4px; }
#bc-tools .bc-font-controls { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
#bc-tools .bc-font-controls button { min-width: 44px; }
#bc-tools .bc-article { min-width: 0; margin: 0; }
#bc-tools .bc-article > p, #bc-tools .bc-chapter-body > p, #bc-tools .bc-faq p { font-size: var(--bc-text-size); }
#bc-tools .bc-chapter { max-width: none; margin: 14px 0 0; padding: 0; border-block-start: 1px solid var(--bc-line); scroll-margin-top: 150px; }
#bc-tools .bc-chapter > summary { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-height: 64px; padding: 20px 0; list-style: none; }
#bc-tools .bc-chapter > summary::-webkit-details-marker { display: none; }
#bc-tools .bc-chapter > summary h2 { flex: 1; min-width: 0; margin: 0; }
#bc-tools .bc-chapter > summary::after { content: '+'; flex: 0 0 22px; color: #806019; font-size: 27px; line-height: 1; text-align: center; }
#bc-tools .bc-chapter[open] > summary::after { content: '−'; }
#bc-tools .bc-chapter-body { min-width: 0; padding-block-end: 20px; }
#bc-tools .bc-chapter-body > p:last-child { margin-block-end: 0; }
#bc-tools .bc-chapter-body table { width: 100%; margin-block: 24px; border-collapse: collapse; table-layout: fixed; font-size: 17px; line-height: 1.75; }
#bc-tools .bc-chapter-body th, #bc-tools .bc-chapter-body td { padding: 13px 12px; border-block-end: 1px solid var(--bc-line); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
#bc-tools .bc-chapter-body th { background: var(--bc-navy); color: #f2f0e9; }
#bc-tools .bc-chapter-body tbody tr:nth-child(even) td { background: #eeece4; }
#bc-tools .bc-faq { max-width: none; margin: 10px 0 0; border-block-end: 1px solid var(--bc-line); }
#bc-tools .bc-faq > summary { min-height: 44px; padding-block: 15px; color: var(--bc-ink); font-size: 20px; font-weight: 600; line-height: 1.7; }
#bc-tools .bc-faq-toggle { margin-block-end: 16px; }

/* The calculator follows the site's existing navy and champagne service panels. */
#bc-tools .bc-calc { margin: 26px 0; padding: 26px; border: 1px solid #cfb77780; border-radius: 4px; background: var(--bc-navy); color: #f2f0e9; }
#bc-tools .bc-calc h3 { margin: 0 0 12px; color: var(--bc-gold); font-size: 25px; line-height: 1.5; }
#bc-tools .bc-calc > p { margin: 0 0 22px; color: #d1d9e1; font-size: 16px; line-height: 1.85; }
#bc-tools .bc-calc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
#bc-tools .bc-calc-fields label { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; min-width: 0; color: #d1d9e1; font-size: 15px; line-height: 1.7; }
#bc-tools .bc-calc-fields input { display: block; width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #8d9cab; border-radius: 3px; background: #1b2d41; color: #fff; font-size: 18px; line-height: 1.5; direction: ltr; text-align: start; }
#bc-tools .bc-calc input:focus-visible { outline-color: #e4c77e; }
#bc-tools .bc-calc input[aria-invalid='true'] { border-color: #f0bfa2; }
#bc-tools .bc-calc-summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 17px; margin-block-start: 25px; padding-block-start: 22px; border-block-start: 1px solid #ffffff35; }
#bc-tools .bc-calc-summary > div { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; min-width: 0; }
#bc-tools .bc-calc-summary small { display: block; flex: 1 1 45%; min-width: 0; color: #d1d9e1; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
#bc-tools .bc-calc-summary strong { display: block; flex: 1 1 55%; min-width: 0; color: #e4ce9a; font-size: 26px; font-weight: 600; line-height: 1.4; text-align: end; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#bc-tools .bc-calc-breakdown { margin-block-start: 22px; padding-block-start: 16px; border-block-start: 1px solid #ffffff30; color: #c1ced9; font-size: 14px; line-height: 1.85; overflow-wrap: anywhere; }
#bc-tools .bc-calc .bc-calc-note { margin: 18px 0 0; color: #d1d9e1; font-size: 14px; line-height: 1.85; }
#bc-tools .bc-calc .bc-calc-error { margin-block-start: 20px; padding: 13px 15px; border-inline-start: 3px solid #e4b28a; background: #48382f; color: #fff0e1; font-size: 15px; line-height: 1.8; }

@container bc-tools (min-width: 650px) {
  #bc-tools .bc-planner-heading { grid-template-columns: 1.05fr 1fr; gap: 26px; align-items: end; }
  #bc-tools .bc-planner-body { grid-template-columns: minmax(0, .85fr) minmax(0, 1.2fr); gap: 28px; }
  #bc-tools .bc-reading-bar { flex-wrap: nowrap; }
  #bc-tools .bc-toc { flex: 1 1 auto; }
  #bc-tools .bc-font-controls { flex: 0 1 auto; }
  #bc-tools #bc-toc-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container bc-tools (min-width: 720px) {
  #bc-tools .bc-calc-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
  #bc-tools .bc-calc-summary > div { display: block; }
  #bc-tools .bc-calc-summary small { margin-block-end: 9px; }
  #bc-tools .bc-calc-summary strong { text-align: start; }
}
@container bc-tools (max-width: 420px) {
  #bc-tools .bc-planner { padding: 19px 17px; }
  #bc-tools .bc-planner-heading h2 { font-size: 23px; }
  #bc-tools .bc-check-actions { align-items: flex-start; flex-direction: column; }
  #bc-tools .bc-calc { padding: 21px 17px; }
  #bc-tools .bc-calc-fields { grid-template-columns: minmax(0, 1fr); }
  #bc-tools .bc-calc-summary > div { flex-wrap: wrap; gap: 5px 15px; }
  #bc-tools .bc-calc-summary small { flex-basis: 100%; }
  #bc-tools .bc-calc-summary strong { flex-basis: 100%; text-align: start; }
  #bc-tools .bc-chapter-body th, #bc-tools .bc-chapter-body td { padding: 10px 7px; font-size: 15px; }
}
@media (max-width: 850px) {
  #bc-tools { --bc-text-size: 18px; }
}
@media print {
  #bc-tools .bc-planner, #bc-tools .bc-reading-bar, #bc-tools .bc-faq-toggle { display: none !important; }
  #bc-tools .bc-chapter > summary::after { display: none; }
  #bc-tools .bc-calc { break-inside: avoid; border-color: #777; background: #fff; color: #172b43; }
  #bc-tools .bc-calc h3, #bc-tools .bc-calc p, #bc-tools .bc-calc label, #bc-tools .bc-calc small, #bc-tools .bc-calc strong, #bc-tools .bc-calc-breakdown { color: #172b43; }
  #bc-tools .bc-calc-fields input { border-color: #777; background: #fff; color: #172b43; }
}
