/* V17: focused OnConnect documentation, consistent code labels, compact OnStudy showcase */
.v16-unified #features .feature-grid .feature {
  min-height: 320px;
  justify-content: flex-start;
}
.v16-unified #features .feature-grid .feature p {
  font-size: 0.95rem;
  line-height: 1.67;
}
.v16-unified #deep-dive .v6-module-grid .v6-module-card {
  min-height: 0;
  justify-content: flex-start;
  padding: 26px 28px;
}
.v16-unified #deep-dive .v6-module-card h3 {
  margin: 2px 0 4px;
  font-size: 1.13rem;
}
.v16-unified #deep-dive .v6-module-card p {
  font-size: 0.92rem;
  line-height: 1.72;
}
.v17-detail-bullets {
  margin: 7px 0 0;
  padding: 0 0 0 20px;
  display: grid;
  gap: 9px;
  color: var(--theme-muted, #f3d9db);
  font-size: 0.88rem;
  line-height: 1.6;
}
.v17-detail-bullets li::marker {
  color: var(--theme-accent, #ff647c);
}
.v17-architecture {
  margin: 26px 0 0;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.24));
  border-radius: 22px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.055);
}
.v17-arch-heading h3 {
  font-size: 1.28rem;
  margin: 0 0 7px;
}
.v17-arch-heading p,
.v17-arch-note {
  line-height: 1.65;
  opacity: 0.88;
  font-size: 0.91rem;
  margin: 0 0 18px;
}
.v17-arch-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px minmax(0, 1fr) 105px minmax(
      0,
      1fr
    );
  gap: 9px;
  align-items: stretch;
}
.v17-arch-node {
  padding: 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.21);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.v17-arch-node b {
  font-size: 0.99rem;
}
.v17-arch-node small {
  font-size: 0.83rem;
  opacity: 0.9;
}
.v17-arch-node span {
  font-size: 0.84rem;
  opacity: 0.8;
  line-height: 1.5;
}
.v17-arch-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  flex-wrap: wrap;
  font-size: 0.78rem;
  opacity: 0.85;
}
.v17-arch-arrow strong {
  font-size: 1.25rem;
}
.v17-arch-foundation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
.v17-arch-foundation > div {
  display: grid;
  gap: 6px;
  padding: 13px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 12px;
}
.v17-arch-foundation span {
  font-size: 0.84rem;
  line-height: 1.5;
  opacity: 0.83;
}
.v17-arch-note {
  margin: 10px 0 0;
}
.v17-sequence {
  padding: 0;
  margin: 20px 0 15px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  counter-reset: seq;
}
.v17-sequence li {
  counter-increment: seq;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.17);
  border-radius: 13px;
  padding: 15px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.v17-sequence li::before {
  content: counter(seq, decimal-leading-zero);
  color: var(--theme-accent, #ff7181);
  font-weight: 800;
  font-size: 0.78rem;
}
.v17-sequence li strong {
  font-size: 0.9rem;
  line-height: 1.3;
}
.v17-sequence li span {
  line-height: 1.5;
  font-size: 0.79rem;
  opacity: 0.88;
}
.v16-unified #code .v7-code-heading > span {
  display: inline-flex;
}
.v16-unified #code .v7-code-explainer .code-head .v16-language {
  display: none;
}
.v16-unified #code .v7-code-explainer .code-head {
  justify-content: space-between;
}
.v16-unified #code .v7-code-explainer .code-copy {
  margin-left: auto;
}
.v17-source-note {
  margin: 24px 0 0;
  max-width: 105ch;
  padding: 14px 18px;
  border-left: 3px solid var(--theme-accent, #ff7181);
  background: rgba(0, 0, 0, 0.12);
}
.v16-unified #interactive .v16-preview {
  min-height: 240px;
}
.v16-unified #interactive .v16-preview p {
  max-width: 73ch;
  line-height: 1.72;
}
/* Constrain the study walkthrough only, preserving legibility and image aspect ratio. */
body[data-project="onstudy"] #interactive .v7-showcase-row {
  min-height: 0 !important;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr) !important;
  gap: 16px !important;
  padding: 16px 18px !important;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
body[data-project="onstudy"] #interactive .v7-showcase-row:nth-of-type(even) {
  grid-template-columns: minmax(0, 1.3fr) minmax(230px, 0.7fr) !important;
}
body[data-project="onstudy"] #interactive .v7-showcase-row .showcase-shot {
  min-height: 0 !important;
  padding: 8px 12px;
}
body[data-project="onstudy"] #interactive .v7-showcase-row .showcase-shot img {
  max-height: 300px !important;
}
body[data-project="onstudy"] #interactive .v7-showcase-row .showcase-copy {
  padding: 10px !important;
}
body[data-project="onstudy"] #interactive .v7-showcase-row .showcase-copy p {
  font-size: 0.9rem;
  line-height: 1.58;
}
@media (max-width: 1050px) {
  .v17-arch-flow {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .v17-arch-arrow {
    min-height: 28px;
  }
  .v17-arch-foundation {
    grid-template-columns: 1fr;
  }
  .v17-sequence {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 850px) {
  body[data-project="onstudy"] #interactive .v7-showcase-row,
  body[data-project="onstudy"] #interactive .v7-showcase-row:nth-of-type(even) {
    grid-template-columns: 1fr !important;
  }
  body[data-project="onstudy"]
    #interactive
    .v7-showcase-row
    .showcase-shot
    img {
    max-height: 340px !important;
  }
  .v17-sequence {
    grid-template-columns: 1fr;
  }
}

/* Balanced thesis module cards; no oversized empty final cell. */
body[data-project="onconnect"] #deep-dive .v6-module-grid .v6-module-card {
  min-height: 405px;
}
@media (max-width: 850px) {
  body[data-project="onconnect"] #deep-dive .v6-module-grid .v6-module-card {
    min-height: 0;
  }
}
