.water-deadlocks-guide {
  --deadlock-blue: #267fae;
  --deadlock-red: #b94d58;
  --deadlock-green: #2e8b66;
  --deadlock-ink: #263a55;
}

.deadlock-quick-answer {
  border-left-color: var(--deadlock-blue);
  background: linear-gradient(135deg, #eaf8ff, #f2f7ff 58%, #fff7ec);
}

.deadlock-definition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.deadlock-definition-grid article {
  padding: 19px;
  border: 1px solid #dbe5ef;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(47, 69, 101, .06);
}

.deadlock-definition-grid span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: #59789f;
  font-size: .76rem;
  font-weight: 900;
}

.deadlock-definition-grid h3 {
  margin: 12px 0 6px;
  font-size: 1.05rem;
}

.deadlock-definition-grid p { margin: 0; color: #5c6c80; }

.deadlock-cases-intro {
  padding-bottom: 10px;
  border-bottom: 1px solid #dce5ef;
}

.deadlock-case {
  margin: 38px 0;
  padding: 26px;
  border: 1px solid #dbe4ee;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(46, 65, 96, .07);
}

.deadlock-case > header {
  position: relative;
  padding-right: 150px;
}

.deadlock-case > header > span {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--deadlock-blue);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.deadlock-case > header h3 {
  margin: 0 0 8px;
  color: var(--deadlock-ink);
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
}

.deadlock-case > header p { margin: 0; color: #59697e; }

.deadlock-case > header a {
  position: absolute;
  top: 3px;
  right: 0;
  font-size: .86rem;
  font-weight: 800;
}

.deadlock-scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.deadlock-scenario-grid figure {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid #dce5ef;
  border-radius: 16px;
  background: #f7fafc;
}

.deadlock-scenario-grid figure.is-wrong {
  border-color: #edcfd2;
  background: #fff7f7;
}

.deadlock-scenario-grid figure.is-correct {
  border-color: #cce5d8;
  background: #f4fbf7;
}

.deadlock-scenario-grid figcaption {
  display: grid;
  gap: 2px;
  min-height: 50px;
  margin-bottom: 12px;
}

.deadlock-scenario-grid figcaption small {
  color: #728197;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.deadlock-scenario-grid figcaption strong {
  color: var(--deadlock-ink);
  font-size: .94rem;
  line-height: 1.35;
}

.deadlock-board {
  overflow: hidden;
  min-height: 104px;
  display: grid;
  align-items: end;
}

.deadlock-board > div {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 7px 5px;
}

.deadlock-bottle {
  width: 28px;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.deadlock-bottle-layers {
  position: relative;
  width: 26px;
  height: 70px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 3px;
  border: 2px solid #8093aa;
  border-top-color: transparent;
  border-radius: 4px 4px 10px 10px;
  background: rgba(255, 255, 255, .72);
}

.deadlock-bottle-layers::before,
.deadlock-bottle-layers::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 11px;
  border-top: 2px solid #8093aa;
}

.deadlock-bottle-layers::before { left: 0; }
.deadlock-bottle-layers::after { right: 0; }

.deadlock-bottle-layers i {
  flex: 0 0 15px;
  display: block;
  background: var(--deadlock-color);
  border-top: 1px solid rgba(255,255,255,.45);
}

.deadlock-bottle-layers i:first-child { border-radius: 3px 3px 0 0; }
.deadlock-bottle-layers i:last-child { border-radius: 0 0 6px 6px; }

.deadlock-bottle b {
  color: #64748a;
  font-size: .72rem;
  line-height: 1;
}

.deadlock-bottle.is-highlighted .deadlock-bottle-layers {
  border-color: #cf626b;
  border-top-color: transparent;
  box-shadow: 0 0 0 3px rgba(207, 98, 107, .13);
}

.deadlock-result {
  min-height: 37px;
  display: grid;
  place-items: center;
  margin-top: 12px;
  padding: 7px 9px;
  border-radius: 10px;
  color: #6b778a;
  background: rgba(255,255,255,.8);
  text-align: center;
  font-size: .76rem;
  font-weight: 850;
  line-height: 1.35;
}

.is-wrong .deadlock-result { color: #9c3f49; background: #ffe9eb; }
.is-correct .deadlock-result { color: #257253; background: #e2f5ea; }

.deadlock-case-reading {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.deadlock-case-reading p {
  margin: 0;
  padding: 17px 18px;
  border-radius: 14px;
  background: #f5f8fb;
}

.deadlock-case-reading p:first-child { border-left: 4px solid #ca6069; }
.deadlock-case-reading p:last-child { border-left: 4px solid #3d9672; }

.deadlock-source-note {
  margin: 16px 0 0;
  color: #718097;
  font-size: .82rem;
}

.deadlock-decision-table th,
.deadlock-decision-table td { vertical-align: top; }

.deadlock-checklist {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
  counter-reset: deadlock-step;
}

.deadlock-checklist li {
  position: relative;
  min-height: 48px;
  display: grid;
  align-content: center;
  padding: 11px 14px 11px 58px;
  border: 1px solid #dce5ee;
  border-radius: 14px;
  background: #fff;
  counter-increment: deadlock-step;
}

.deadlock-checklist li::before {
  content: counter(deadlock-step);
  position: absolute;
  left: 13px;
  top: 50%;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #4a739f;
  transform: translateY(-50%);
  font-weight: 900;
}

@media (max-width: 900px) {
  .deadlock-scenario-grid { grid-template-columns: 1fr; }
  .deadlock-scenario-grid figure { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; column-gap: 12px; }
  .deadlock-scenario-grid figcaption { min-height: 0; margin: 0; }
  .deadlock-scenario-grid .deadlock-result { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .deadlock-definition-grid,
  .deadlock-case-reading { grid-template-columns: 1fr; }
  .deadlock-case { padding: 19px 14px; border-radius: 17px; }
  .deadlock-case > header { padding-right: 0; }
  .deadlock-case > header a { position: static; display: inline-flex; margin-top: 10px; }
  .deadlock-scenario-grid figure { display: block; }
  .deadlock-scenario-grid figcaption { margin-bottom: 12px; }
  .deadlock-board { min-height: 103px; }
}

