/* Kedge Library decision tools · Batch 03 · 2026-08-20 */
.page-library-tool .article-shell {
  width: min(calc(100% - (2 * var(--gutter))), 880px);
}

.page-library-tool .article-shell > h1 {
  max-width: 18ch;
}

.page-library-tool .article-cta {
  padding-inline: max(var(--gutter), calc((100vw - 880px) / 2));
}

.tool-answer {
  margin: 0 0 44px;
  padding: 26px 0 30px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.tool-answer + .tool-boundary {
  margin-top: -20px;
}

.tool-boundary {
  margin: 24px 0 42px;
  padding: 18px 20px;
  border-left: 3px solid var(--green);
  background: var(--card);
  color: var(--secondary);
  font-size: 0.94rem;
}

.tool-boundary p {
  margin: 0;
}

.tool-section-intro {
  max-width: 760px;
}

.decision-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 28px 0 42px !important;
  padding: 1px !important;
  background: var(--rule);
  counter-reset: rule;
  list-style: none;
}

.decision-rules > li {
  min-height: 190px;
  margin: 0 !important;
  padding: 28px;
  background: var(--card);
  counter-increment: rule;
}

.decision-rules > li::before {
  display: block;
  margin-bottom: 28px;
  color: var(--green);
  content: '0' counter(rule);
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.decision-rules h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}

.decision-rules p {
  margin: 0;
  color: var(--secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.parallel-record {
  margin: 28px 0 48px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.parallel-record__row {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid var(--rule);
}

.parallel-record__row:last-child {
  border-bottom: 0;
}

.parallel-record__label {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 18px 20px 18px 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.parallel-record__track {
  display: grid;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

.parallel-record__track--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.parallel-record__track--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.parallel-record__track li {
  display: flex;
  min-height: 92px;
  align-items: center;
  margin: 0 !important;
  padding: 16px 14px;
  border-left: 1px solid var(--rule);
  background: var(--card);
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.35;
}

.flow-steps {
  display: grid;
  margin: 28px 0 46px;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.flow-steps--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.flow-steps--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-step {
  min-height: 230px;
  padding: 24px 22px 26px;
  background: var(--card);
}

.flow-step + .flow-step {
  border-left: 1px solid var(--rule);
}

.flow-step__index,
.flow-step__owner {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.flow-step__index {
  margin-bottom: 34px;
  color: var(--green);
  font-size: 1.5rem;
  letter-spacing: 0.12em;
}

.flow-step__owner {
  margin-top: 20px;
  color: var(--secondary);
}

.flow-step h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.flow-step p:not([class]) {
  margin: 0;
  color: var(--secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.decision-table {
  table-layout: auto !important;
}

.decision-table th:first-child {
  width: 24%;
}

.decision-table th:last-child {
  width: 28%;
}

.decision-table td strong {
  display: block;
  margin-bottom: 4px;
}

.status-key {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 20px 0 0 !important;
  padding: 0 !important;
  list-style: none;
  color: var(--secondary);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-key li {
  margin: 0 !important;
}

.status-key li::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border: 1px solid var(--ink);
  content: '';
}

.status-key li:first-child::before {
  background: var(--green);
  border-color: var(--green);
}

.status-key li:nth-child(2)::before {
  background: var(--paper);
}

.status-key li:nth-child(3)::before {
  border-style: dashed;
}

.worked-example {
  margin: 58px 0 50px;
  padding: 30px 32px 32px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}

.worked-example__label {
  margin: 0 0 14px !important;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.worked-example h2 {
  max-width: 20ch;
  margin: 0 0 18px !important;
  font-size: clamp(2rem, 4vw, 3rem) !important;
}

.worked-example p:last-child {
  margin-bottom: 0;
}

.example-ledger {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 2fr);
  gap: 0;
  margin: 22px 0 0;
  border-top: 1px solid var(--rule);
}

.example-ledger dt,
.example-ledger dd {
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}

.example-ledger dt {
  padding-right: 18px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.example-ledger dd {
  color: var(--secondary);
}

.tool-checklist {
  margin: 26px 0 44px !important;
  padding: 0 !important;
  border-top: 2px solid var(--ink);
  counter-reset: checklist;
  list-style: none;
}

.tool-checklist > li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  margin: 0 !important;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  counter-increment: checklist;
}

.tool-checklist > li::before {
  color: var(--green);
  content: '0' counter(checklist);
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.tool-checklist strong {
  display: block;
  margin-bottom: 3px;
}

.tool-checklist span {
  color: var(--secondary);
}

.choice-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 26px 0 44px !important;
  padding: 1px !important;
  background: var(--rule);
  list-style: none;
}

.choice-strip li {
  min-height: 170px;
  margin: 0 !important;
  padding: 22px 18px;
  background: var(--card);
}

.choice-strip strong {
  display: block;
  margin-bottom: 12px;
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 1;
  text-transform: uppercase;
}

.choice-strip span {
  color: var(--secondary);
  font-size: 0.86rem;
  line-height: 1.45;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 28px 0 44px;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.value-card {
  min-height: 180px;
  padding: 26px;
  background: var(--card);
}

.value-card__label {
  margin: 0 0 28px !important;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.value-card h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  line-height: 1;
  text-transform: uppercase;
}

.value-card p:last-child {
  margin: 0;
  color: var(--secondary);
  font-size: 0.93rem;
  line-height: 1.5;
}

.tool-audience {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 34px 0 46px;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.tool-audience > div {
  padding: 24px;
  background: var(--card);
}

.tool-audience h3 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.45;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.tool-audience p {
  margin: 0;
  color: var(--secondary);
}

.tool-next-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 54px 0 8px;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.tool-next-links a {
  display: block;
  min-height: 150px;
  padding: 24px;
  background: var(--card);
  text-decoration: none;
}

.tool-next-links a:hover strong {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}

.tool-next-links span,
.tool-next-links strong {
  display: block;
}

.tool-next-links span {
  margin-bottom: 26px;
  color: var(--secondary);
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-next-links strong {
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .flow-steps--five {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-steps--five .flow-step:nth-child(4) {
    border-left: 0;
  }

  .flow-steps--five .flow-step:nth-child(n + 4) {
    border-top: 1px solid var(--rule);
  }

  .flow-steps--five .flow-step:last-child {
    grid-column: span 2;
  }

  .choice-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .choice-strip li:nth-child(n + 4) {
    min-height: 150px;
  }

  .choice-strip li:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .decision-rules,
  .value-grid,
  .tool-audience,
  .tool-next-links {
    grid-template-columns: 1fr;
  }

  .decision-rules > li,
  .value-card,
  .tool-next-links a {
    min-height: 0;
  }

  .parallel-record__row {
    grid-template-columns: 1fr;
  }

  .parallel-record__label {
    padding: 16px 0 12px;
  }

  .parallel-record__track--five,
  .parallel-record__track--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parallel-record__track li {
    min-height: 74px;
    border-top: 1px solid var(--rule);
  }

  .flow-steps--five,
  .flow-steps--four,
  .choice-strip {
    grid-template-columns: 1fr;
  }

  .flow-steps--five .flow-step,
  .flow-steps--four .flow-step,
  .choice-strip li {
    grid-column: auto;
    min-height: 0;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .flow-steps--five .flow-step:last-child,
  .choice-strip li:last-child {
    grid-column: 1 !important;
  }

  .flow-steps .flow-step:first-child,
  .choice-strip li:first-child {
    border-top: 0;
  }

  .flow-step__index {
    margin-bottom: 18px;
  }

  .decision-table {
    display: block !important;
    overflow: visible !important;
    border: 0;
  }

  .decision-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .decision-table tbody,
  .decision-table tr,
  .decision-table td {
    display: block;
    width: 100%;
  }

  .decision-table tr {
    margin-bottom: 18px;
    border: 1px solid var(--rule);
    background: var(--card);
  }

  .decision-table td {
    display: grid;
    grid-template-columns: minmax(112px, 0.75fr) minmax(0, 1.6fr);
    gap: 14px;
    padding: 12px 14px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--rule) !important;
    background: transparent !important;
    font-size: 0.9rem;
  }

  .decision-table td:last-child {
    border-bottom: 0 !important;
  }

  .decision-table td::before {
    color: var(--secondary);
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .worked-example {
    padding-inline: 24px;
  }

  .example-ledger {
    grid-template-columns: 1fr;
  }

  .example-ledger dt {
    padding-bottom: 4px;
    border-bottom: 0;
  }

  .example-ledger dd {
    padding-top: 0;
  }
}

@media (max-width: 430px) {
  .page-library-tool .article-shell > h1 {
    max-width: 100%;
  }

  .tool-answer {
    padding-top: 22px;
  }

  .parallel-record__track--five,
  .parallel-record__track--four {
    grid-template-columns: 1fr;
  }

  .parallel-record__track li {
    border-left: 0;
  }

  .decision-table td {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tool-checklist > li {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
  }

  .worked-example {
    margin-inline: 0;
    padding-inline: 18px;
  }
}

@media print {
  .decision-rules,
  .parallel-record,
  .flow-steps,
  .value-grid,
  .tool-audience,
  .choice-strip,
  .tool-next-links,
  .worked-example {
    break-inside: avoid;
  }
}
