/* 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-structure-media {
  position: relative;
  margin: 4px auto 18px;
  max-width: 720px;
  text-align: center;
}

#atlasSheet .atlas-structure-media img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 540px;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
}

#atlasSheet .atlas-structure-media figcaption { margin-top: 9px; color: #64716c; font-size: .88rem; line-height: 1.4; }
#atlasSheet .atlas-media-credit { margin-top: 4px; color: #7a8580; font-size: .78rem; }

#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,.22); border-radius: 16px; background: rgba(255,255,255,.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; }
#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,.12); color:#35443f; font-size:.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,.10); }
#atlasSheet .atlas-soap-card h4 { margin:0 0 7px; color:#1f7357; font-size:.94rem; }
#atlasSheet .atlas-soap-card p { margin:0; color:#46534f; line-height:1.48; font-size:.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:.82rem; letter-spacing:.11em; text-transform:uppercase; }

/* Full-screen anatomy image viewer */
.atlas-image-lightbox { position:fixed; inset:0; z-index:200; display:grid; place-items:center; padding:28px; background:rgba(10,18,15,.88); }
.atlas-image-lightbox[hidden] { display:none!important; }
.atlas-image-lightbox__image { display:block; max-width:min(1200px,94vw); max-height:90vh; width:auto; height:auto; object-fit:contain; background:#fff; border-radius:14px; box-shadow:0 24px 80px rgba(0,0,0,.38); }
.atlas-image-lightbox__close { position:fixed; top:22px; right:24px; width:46px; height:46px; border:1px solid rgba(255,255,255,.65); border-radius:50%; background:#fff; color:#14251f; font-size:28px; line-height:1; cursor:pointer; box-shadow:0 8px 28px rgba(0,0,0,.25); }
.atlas-image-zoom { position:absolute; right:12px; top:12px; width:42px; height:42px; border:1px solid rgba(20,37,31,.18); border-radius:50%; background:rgba(255,255,255,.94); color:#173d31; font-size:20px; cursor:pointer; box-shadow:0 4px 18px rgba(0,0,0,.14); }

/* One guided learning control */
#atlasSheet .atlas-learning-modes__tabs {
  grid-template-columns: 1fr !important;
}

#atlasSheet .atlas-mode-tab[data-mode="read"],
#atlasSheet .atlas-mode-tab[data-mode="listen"] {
  display: none !important;
}

#atlasSheet .atlas-mode-tab[data-mode="watch"] {
  display: block !important;
  width: 100%;
  background: #173d31;
  color: #fff;
  font-size: 0;
  padding: 13px 16px;
}

#atlasSheet .atlas-mode-tab[data-mode="watch"]::after {
  content: "Learn";
  font-size: .95rem;
  font-weight: 850;
  letter-spacing: .04em;
}

#atlasSheet .atlas-mode-panel[data-panel="read"],
#atlasSheet .atlas-mode-panel[data-panel="listen"] {
  display: none !important;
}

#atlasSheet [data-atlas-audio-play],
#atlasSheet [data-atlas-audio-pause],
#atlasSheet [data-atlas-audio-stop] {
  min-height: 40px;
}

#atlasSheet [data-atlas-audio-pause],
#atlasSheet [data-atlas-audio-stop] {
  background: #fff;
  color: #173d31;
  border: 1px solid rgba(23,61,49,.28);
  margin-left: 8px;
}

#atlasSheet [data-atlas-audio-play]:disabled,
#atlasSheet [data-atlas-audio-pause]:disabled,
#atlasSheet [data-atlas-audio-stop]:disabled {
  opacity: .48;
  cursor: default;
}

@media (min-width:780px) {
  #atlasSheet .kos-sheet__panel { width:min(900px,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-structure-media { max-width:100%; }
  #atlasSheet .atlas-structure-media img { width:100%; max-height:320px; }
  #atlasSheet .atlas-accordion-group summary { padding-left:14px; }
  #atlasSheet .atlas-detail-content { padding-left:14px; padding-right:14px; }
  .atlas-image-zoom { display:none; }
  #atlasSheet [data-atlas-audio-play],
  #atlasSheet [data-atlas-audio-pause],
  #atlasSheet [data-atlas-audio-stop] { margin:6px 6px 0 0; }
}

/* 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; }
