/* K-OS Clinical Atlas UI 2.3 */

#atlasSheet .kos-sheet__panel {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 42px);
  margin: 21px auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(24, 20, 14, 0.26);
}

#atlasSheet .kos-sheet__body {
  padding: 18px 18px 34px;
  overflow-y: auto;
}

#atlasSheet .atlas-structure-detail { padding-bottom: 18px; }

#atlasSheet .atlas-location {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f6f1e8;
  line-height: 1.45;
}

#atlasSheet .atlas-accordion-group {
  display: grid;
  gap: 10px;
}

#atlasSheet .atlas-accordion-group details {
  border: 1px solid rgba(119, 95, 55, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

#atlasSheet .atlas-accordion-group summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding: 15px 48px 15px 16px;
  font-weight: 800;
}

#atlasSheet .atlas-accordion-group summary::-webkit-details-marker { display: none; }

#atlasSheet .atlas-accordion-group summary::after {
  content: "+";
  position: absolute;
  right: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: #1f7357;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 800;
}

#atlasSheet .atlas-accordion-group details[open] summary::after { content: "−"; }

#atlasSheet .atlas-detail-content { padding: 0 16px 16px; }

#atlasSheet .atlas-detail-content p {
  margin: 0;
  line-height: 1.55;
  color: #5b6864;
}

/* Correct padding for Related symptoms / Related movements */
#atlasSheet .atlas-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

#atlasSheet .atlas-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f6f1e8;
  border: 1px solid rgba(119, 95, 55, 0.12);
  color: #35443f;
  font-size: 0.92rem;
  line-height: 1.2;
}

#atlasSheet .atlas-soap-wrap { padding-top: 2px; }

#atlasSheet .atlas-soap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#atlasSheet .atlas-soap-card {
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f2f7f0 0%, #edf4eb 100%);
  border: 1px solid rgba(31, 115, 87, 0.10);
}

#atlasSheet .atlas-soap-card h4 {
  margin: 0 0 7px;
  color: #1f7357;
  font-size: 0.94rem;
}

#atlasSheet .atlas-soap-card p {
  margin: 0;
  color: #46534f;
  line-height: 1.48;
  font-size: 0.93rem;
}

#atlasSheet .atlas-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0 4px;
}

#atlasSheet .atlas-detail-actions::after {
  content: "";
  flex-basis: 100%;
  height: 8px;
}

#atlasSheet .atlas-structure-group { margin: 0 0 18px; }

#atlasSheet .atlas-structure-group__title {
  margin: 0 0 8px;
  padding: 0 4px;
  color: #1f7357;
  font-size: 0.82rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

@media (min-width: 780px) {
  #atlasSheet .kos-sheet__panel {
    width: min(820px, calc(100vw - 64px));
    margin: 32px auto;
    max-height: calc(100vh - 64px);
  }

  #atlasSheet .kos-sheet__body { padding: 20px 22px 42px; }
}

@media (max-width: 620px) {
  #atlasSheet .kos-sheet__panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    border-radius: 22px;
  }

  #atlasSheet .kos-sheet__body { padding: 14px 12px 28px; }
  #atlasSheet .atlas-soap-grid { grid-template-columns: 1fr; }

  #atlasSheet .atlas-accordion-group summary { padding-left: 14px; }

  #atlasSheet .atlas-detail-content {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* Atlas Professional — scrollable detail sheet */
.kos-sheet__panel {
    max-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.kos-sheet__header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
}
.kos-sheet {
    overflow: hidden;
}

.kos-sheet__panel {
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.kos-sheet__body {
    min-height: 0;
    overflow: visible;
    padding-bottom: 48px;
}