/* Unified course rail — shared across every page in lesson6-pages.
   Fixed rail colors so the left menu looks identical on all pages,
   regardless of each page's own content theme. Linked AFTER the page
   <style> so these rules win over any page-level rail CSS. */

.shell,
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  min-height: 100vh;
}
.rail {
  position: sticky;
  top: 0;
  width: 100%;
  min-width: 0;
  height: 100vh;
  padding: 24px 16px;
  overflow: hidden auto;
  border-right: 1px solid #d2cabd;
  background: #f7f3ea;
}
.brand {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(23, 23, 23, .1);
}
.brand h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "MS Mincho", serif;
  font-size: 21px;
  letter-spacing: 0;
}
.brand p {
  margin: 5px 0 0;
  color: #676057;
  font-size: 12px;
}
.course-switch {
  display: grid;
  gap: 6px;
  margin: 12px 0 4px;
  padding: 10px;
  border: 1px solid #d2cabd;
  background: #fffdf8;
}
.switch-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.switch-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 4px;
  border-bottom: 1px solid rgba(23, 23, 23, .08);
  color: #676057;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.switch-title::after {
  content: attr(data-count);
  color: #676057;
  font-weight: 700;
  letter-spacing: 0;
}
.course-switch a,
.switch-home {
  display: block;
  padding: 8px 9px;
  border-left: 3px solid transparent;
  color: #676057;
  text-decoration: none;
  font-size: 12px;
}
.course-switch a:hover,
.switch-home:hover {
  color: #171717;
  background: #f3eee4;
}
.course-switch a.active,
.switch-home.active {
  color: #171717;
  border-left-color: #b52e38;
  background: #f3eee4;
  font-weight: 800;
}
.switch-group.music a {
  border-left-color: rgba(23, 95, 139, .22);
}
.switch-group.music a.active {
  border-left-color: #155d86;
}
.lesson-cluster {
  border: 1px solid rgba(23, 23, 23, .08);
  background: #fbf7ef;
}
.lesson-cluster summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 6px 9px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 800;
}
.lesson-cluster summary::-webkit-details-marker {
  display: none;
}
.lesson-cluster summary::after {
  content: "+";
  color: #676057;
  font-weight: 900;
}
.lesson-cluster[open] summary::after {
  content: "\2212";
}
.lesson-cluster.current summary {
  color: #fff;
  background: #171717;
}
.lesson-cluster.current summary::after {
  color: #d9d1c5;
}
.lesson-links {
  display: grid;
  gap: 4px;
  padding: 7px;
}
.nav-label {
  margin: 22px 0 8px;
  color: #676057;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.nav {
  display: grid;
  gap: 6px;
}
.nav button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 8px 10px;
  color: #171717;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.nav button.active {
  color: #fff;
  background: #171717;
}
.nav button span {
  display: block;
  color: #676057;
  font-size: 11px;
}
.nav button.active span {
  color: #d9d1c5;
}
.progress-card {
  margin-top: 20px;
  padding: 12px;
  border: 1px solid #d2cabd;
  background: #fffdf8;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  margin: 5px 0;
  color: #676057;
  font-size: 12px;
}
.bar {
  height: 7px;
  overflow: hidden;
  background: #e5dfd5;
}
.bar i {
  display: block;
  width: 0;
  height: 100%;
  background: #32704d;
  transition: width .2s ease;
}
@media (max-width: 900px) {
  .shell,
  .layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100vw;
  }
  .rail {
    position: static;
    max-width: 100vw;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #d2cabd;
  }
  .switch-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .course-switch a,
  .switch-home {
    font-size: 11px;
    overflow-wrap: anywhere;
  }
}
