:root {
  --study-ink: #182943;
  --study-blue: #3456d1;
  --study-blue-dark: #2344af;
  --study-pale: #edf2ff;
  --study-surface: #f8fafc;
  --study-line: #dce4ef;
  --study-text: #465571;
  --study-mat: #edf1f7;
  --study-warm: #955826;
  --study-warm-line: #dfcbbc;
  --study-warm-soft: #faf5ef;
}
.study-deck #viewport {
  background: var(--study-mat);
}
.study-deck .slide {
  color: var(--study-ink);
  background: #fff;
  border: 1px solid var(--study-line);
  border-top: 6px solid var(--study-blue);
}
.study-deck .case-slide .s-section {
  display: flex;
  align-items: center;
  gap: 0.65em;
  color: var(--study-blue-dark);
  font-weight: 750;
  letter-spacing: 0.01em;
}
.study-deck .case-slide .s-section::before {
  content: "";
  flex: none;
  width: 0.5em;
  height: 0.5em;
  border-radius: 1px;
  background: var(--study-blue);
}
.study-deck .case-slide .s-title {
  color: var(--study-ink);
  font-weight: 800;
  letter-spacing: -0.065em;
  text-wrap: initial;
  font-size: 47px;
}
.study-deck .case-slide .s-key {
  color: var(--study-text);
  border-color: var(--study-line);
}
.study-deck .case-slide .s-key strong {
  color: var(--study-ink);
}
.study-deck .case-slide .s-body {
  gap: 19px;
}
.study-deck .side-nav {
  background: #f6f8fc;
  border-color: #d6deea;
}
.study-deck .side-nav-back {
  color: #485976;
}
.study-deck .page-link[aria-current="page"] {
  border-color: #ccdaf7;
  background: var(--study-pale);
  box-shadow: none;
}
.study-deck .page-link[aria-current="page"]::after {
  top: 9px;
  bottom: 9px;
}

.opening-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1.1fr);
  flex: 1;
  align-items: stretch;
  gap: 13px;
}
.opening-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 17px;
  padding: 26px 24px 20px;
  border: 1px solid var(--panel-line);
  border-top: 4px solid var(--panel-accent);
  background: var(--panel-bg);
}
.opening-before {
  --panel-accent: var(--study-warm);
  --panel-line: var(--study-warm-line);
  --panel-bg: var(--study-warm-soft);
}
.opening-after {
  --panel-accent: var(--study-blue);
  --panel-line: #cad8f7;
  --panel-bg: #f3f6ff;
  background-image: radial-gradient(#5179d129 1.1px, transparent 1.3px);
  background-size: 15px 15px;
}
.study-deck .opening-panel header p {
  color: var(--panel-accent);
  margin-bottom: 6px;
  font-weight: 800;
  font-size: 18px;
}
.study-deck .opening-panel h3 {
  font-size: 29px;
}
.opening-arrow {
  align-self: center;
  justify-self: center;
  color: #667994;
  font-size: 41px;
  font-weight: 550;
  line-height: 1;
}
.opening-diagram {
  display: grid;
  gap: 14px;
}
.diagram-lane {
  display: grid;
  align-items: center;
  gap: 10px;
}
.diagram-lane > b {
  font-size: 17px;
  color: var(--panel-accent);
}
.diagram-lane ol,
.new-diagram ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.diagram-lane ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}
.diagram-lane li,
.new-diagram li b,
.new-diagram li strong {
  display: grid;
  place-items: center;
  padding: 12px 6px;
  border: 1px solid var(--panel-line);
  background: #fff;
  color: var(--study-ink);
  text-align: center;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 750;
}
.diagram-lane li {
  position: relative;
}
.diagram-lane li + li::before {
  content: "→";
  position: absolute;
  right: calc(100% + 5px);
  top: 50%;
  translate: 0 -50%;
  color: var(--panel-accent);
  font-size: 18px;
}
.new-diagram {
  grid-template-columns: 0.85fr 45px 1.63fr;
  align-items: center;
  gap: 0;
}
.database-node {
  display: grid;
  gap: 8px;
  padding: 17px 12px;
  background: var(--study-blue);
  color: #fff;
  text-align: center;
}
.database-node b {
  font-size: 23px;
  font-weight: 750;
}
.database-node span {
  font-size: 15px;
  color: #e4edff;
}
.diagram-fork {
  display: grid;
  grid-template-rows: repeat(2, 25px);
}
.diagram-fork i {
  margin-left: 40%;
  border-left: 2px solid var(--panel-accent);
}
.diagram-fork i:first-child {
  border-top: 2px solid var(--panel-accent);
}
.diagram-fork i:last-child {
  border-bottom: 2px solid var(--panel-accent);
  position: relative;
}
.diagram-fork i:last-child::after {
  content: "";
  position: absolute;
  top: -1px;
  right: 100%;
  width: 18px;
  border-top: 2px solid var(--panel-accent);
}
.new-diagram ul {
  display: grid;
  gap: 11px;
}
.new-diagram li {
  display: grid;
  grid-template-columns: 1.3fr 23px 1fr;
  align-items: stretch;
}
.new-diagram li > span {
  align-self: center;
  text-align: center;
  color: var(--panel-accent);
  font-size: 18px;
}
.new-diagram li strong {
  background: #e9efff;
  color: var(--study-blue-dark);
}
.study-deck .opening-detail {
  padding-top: 12px;
  border-top: 1px solid var(--panel-line);
  font-size: 18px;
}
.opening-role {
  display: grid;
  grid-template-columns: 0.74fr repeat(3, 1fr);
  margin: 0;
  border: 1px solid var(--study-line);
}
.opening-role > div {
  padding: 15px 18px;
  min-width: 0;
}
.opening-role > div + div {
  border-left: 1px solid var(--study-line);
}
.opening-role > div:first-child {
  background: var(--study-ink);
}
.opening-role dt {
  color: var(--study-blue-dark);
  font-size: 18px;
  font-weight: 750;
}
.study-deck .opening-role dd {
  color: var(--study-ink);
  font-size: 17px;
  margin-top: 3px;
}
.opening-role > div:first-child dt,
.study-deck .opening-role > div:first-child dd {
  color: #fff;
}

/* Visual hierarchy follows the decision on each slide. */
.study-deck .case-strip {
  background: #eaf0fe;
  border-left-width: 5px;
}
.study-deck .data-architecture .data-sources > div {
  border-left: 4px solid #899bbb;
  border-radius: 0;
  background: #f5f7fb;
}
.study-deck .data-architecture article {
  border-radius: 0;
  border-top: 4px solid #98abd4;
  background: #f3f6fd;
}
.study-deck .data-architecture .data-output {
  border: 0;
  border-radius: 0;
  border-top: 4px solid #6886f4;
  background: var(--study-ink);
}
.study-deck .data-output h3,
.study-deck .data-output p {
  color: #f4f7ff;
}
.study-deck .data-output .source-size {
  color: #c1d2ff;
}
.study-deck .case-join {
  border-top: 1px solid var(--study-line);
  padding-top: 15px;
}
.study-deck .case-flow li {
  border-radius: 3px;
  background: #f7f9fd;
}
.study-deck .case-flow .is-selected {
  background: #e6eeff;
  border-color: #9ab3f3;
}
.study-deck .filter-demo {
  border-radius: 5px;
  padding: 16px;
  border: 1px solid #cbd8ef;
  background: #f5f8ff;
}
.study-deck .criteria-case .case-definition dt span {
  width: max-content;
  padding: 1px 7px;
  margin-top: 4px;
  background: #e9efff;
  border-radius: 2px;
}
.study-deck .filter-map {
  border-radius: 2px;
  background:
    radial-gradient(#8da7e176 1px, transparent 1.35px) 0 0 / 12px 12px,
    linear-gradient(135deg, #e9effd, #dce8fa);
}
.study-deck .filter-ring {
  border-width: 2px;
}
.study-deck .choice-comparison > div:first-child {
  background: var(--study-warm-soft);
  border-top-color: var(--study-warm);
}
.study-deck .choice-comparison > div:last-child {
  border-top-color: var(--study-blue);
}
.study-deck .case-tabs {
  border-bottom: 1px solid #c5d1e7;
}
.study-deck .case-tabs button[aria-selected="true"] {
  background: var(--study-blue-dark);
  color: white;
}
.study-deck .evidence-detail {
  background: #f1f5fd;
  border-left: 4px solid var(--study-blue);
  border-radius: 0;
}
.study-deck .demo-window {
  border-radius: 6px;
  background: white;
  overflow: hidden;
  padding: 0 18px 17px;
  justify-content: flex-start;
  box-shadow: 0 7px 17px #1a345312;
}
.study-deck .demo-window .demo-title {
  margin: 0 -18px 12px;
  padding: 14px 18px;
  background: var(--study-ink);
}
.study-deck .demo-window .demo-title h4,
.study-deck .demo-window .demo-title span {
  color: white;
}
.study-deck .demo-window .demo-title span {
  color: #c6d6f7;
}
.study-deck .case-table tbody tr:nth-child(even) {
  background: #f6f8fc;
}
.study-deck .scope-compare article:first-child,
.study-deck .handoff-lanes article:first-child {
  background: var(--study-warm-soft);
  border-color: var(--study-warm-line);
  border-top-color: var(--study-warm);
}
.study-deck .scope-compare article:last-child,
.study-deck .handoff-lanes article:last-child {
  background: var(--study-pale);
  border-color: #c8d6f5;
  border-top-color: var(--study-blue);
}
.study-deck .handoff-lanes article {
  border-radius: 0;
  border-top-width: 3px;
}
.study-deck .ai-cycle {
  background: #edf2fe;
  border-radius: 0;
  border-color: #cad7f1;
}
.study-deck #review-steps li:nth-child(2) {
  background: var(--study-blue-dark);
  border-color: var(--study-blue-dark);
}
.study-deck #review-steps li:nth-child(2) strong,
.study-deck #review-steps li:nth-child(2) span {
  color: white;
}
.study-deck .apply-feature {
  background: var(--study-ink);
}
.study-deck .apply-feature strong,
.study-deck .apply-feature p {
  color: #f3f6ff;
}
.study-deck .apply-feature p + p {
  color: #d1ddf2;
}
@media (max-width: 1100px) {
  .study-deck .case-slide .s-title {
    font-size: clamp(26px, 3vw, 39px);
  }
  .study-deck .opening-panel {
    padding: 17px 14px 13px;
  }
  .study-deck .opening-panel header p,
  .study-deck .opening-detail {
    font-size: 14px;
  }
  .study-deck .opening-panel h3 {
    font-size: 21px;
  }
  .opening-compare {
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.1fr);
    gap: 7px;
  }
  .opening-arrow {
    font-size: 29px;
  }
  .diagram-lane li,
  .new-diagram li b,
  .new-diagram li strong {
    font-size: 13px;
    padding: 9px 4px;
  }
  .database-node b {
    font-size: 17px;
  }
  .database-node span {
    font-size: 12px;
  }
  .opening-role dt,
  .study-deck .opening-role dd {
    font-size: 14px;
  }
  .opening-role > div {
    padding: 10px 9px;
  }
}
@media (max-width: 760px) {
  .study-deck .opening-compare {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .opening-arrow {
    transform: rotate(90deg);
  }
  .opening-role {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .opening-role > div:nth-child(3) {
    border-left: 0;
  }
  .opening-role > div:nth-child(n + 3) {
    border-top: 1px solid var(--study-line);
  }
  .study-deck .demo-window {
    padding-inline: 10px;
  }
  .study-deck .demo-window .demo-title {
    margin-inline: -10px;
    padding-inline: 10px;
  }
  .diagram-lane ol {
    gap: 19px;
  }
  .diagram-lane li + li::before {
    right: calc(100% + 2px);
    font-size: 15px;
  }
}

@media (min-width: 1101px) {
  .study-deck #criteria .criteria-case {
    flex: 1;
  }
  .study-deck #criteria .criteria-case > article {
    align-self: center;
  }
  .study-deck #criteria .filter-map {
    width: 258px;
  }
  .study-deck #criteria .filter-demo {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .study-deck .demo-window .case-table :is(th, td) {
    padding-block: 13px;
  }
}
