body{background:#def2ff url('../assets/ui/chapter-menu-bg.png') center/cover fixed}.topbar{background:linear-gradient(#6073ff,#454eef);border-bottom:5px solid #fff;height:66px;padding:0 clamp(20px,3.5vw,65px);position:relative;z-index:8}.brand{color:#fff;border:2px solid #fff;background:linear-gradient(#a166eb,#6926cc);border-radius:24px;font-size:17px;padding:8px 16px;box-shadow:0 4px #6331b2}.top-actions{color:#fff}.header-btn{width:44px;height:44px;border:0!important;border-radius:50%!important;padding:0!important;background:white!important;box-shadow:0 4px #ced7ec;font-size:22px!important;display:grid;place-items:center}.home{max-width:1400px;padding:24px 42px}.intro{margin-bottom:27px}.intro .eyebrow{display:block;font-size:38px;letter-spacing:0;color:#ffc92e;text-shadow:2px 2px #3e3268}.intro h1{display:table;margin:10px auto 12px;font-size:28px;background:linear-gradient(#b749ef,#7221bb);border:3px solid #bc71ff;border-bottom:7px solid #572197;box-shadow:0 7px 18px #5f318022;color:#fff;border-radius:22px;padding:10px 27px}.intro p{display:table;background:linear-gradient(#20b8fc,#008dd9);color:white;border-radius:16px;border-bottom:5px solid #087bb8;padding:7px 18px;margin:0 auto;font-size:13px;font-weight:900}.chapters{gap:22px}.chapter{min-height:112px;grid-template-columns:60px 1fr 32px;gap:14px;border:3px solid var(--shade);border-bottom:8px solid var(--shade);box-shadow:none;border-radius:25px;background:linear-gradient(white,var(--tint));padding:13px 15px}.thumb{width:54px;height:54px;border-radius:50%;background:var(--shade);box-shadow:0 4px 8px #29324b22}.thumb svg{width:49px;height:41px;border-radius:14px}.chapter h2{font-size:17px}.chapter .arrow{color:white;width:31px;height:31px;background:var(--shade);border-radius:50%;display:grid;place-items:center;font-size:19px}.badge{border:1px solid var(--shade);background:#fff;font-size:10px}.footer-note{display:table;margin:20px auto;background:#ffffffeb;padding:6px 16px;border-radius:20px;color:#6c607b}.studio{margin:19px auto;background:#f4f7ffed;border:4px solid white;border-radius:28px;max-width:1360px;width:calc(100% - 54px);padding:15px 20px 20px;box-shadow:0 16px 42px #293e6f25}.activity-head{border-bottom:1px solid #e4deef;padding-bottom:12px}.activity-head h1{font-size:22px}.canvas-frame{border-radius:19px}.canvas-frame svg{max-height:calc(100dvh - 285px)}.workspace{grid-template-columns:145px minmax(0,1fr) 190px;gap:15px}.listen-btn{margin:10px 0 0;background:#e7f5ff;border:2px solid #90d7f4;color:#1475a5;border-radius:12px;padding:8px 12px;font-weight:900;cursor:pointer}.speaking{box-shadow:0 0 0 4px #fbd65a!important}.home .footer-note:empty{display:none}[hidden]{display:none!important}
@media(max-width:1050px){.workspace{grid-template-columns:125px minmax(0,1fr)}.guide{grid-column:1/-1}.canvas-frame svg{max-height:none}.chapters{grid-template-columns:repeat(3,minmax(0,1fr))}.chapter{grid-template-columns:43px 1fr 25px;gap:9px;padding:10px}.thumb{width:42px;height:42px}.thumb svg{width:38px}.chapter h2{font-size:14px}.chapter .arrow{width:25px;height:25px}.home{padding:20px}.studio{width:calc(100% - 28px)}}
@media(max-width:650px){.chapters{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.chapter{grid-template-columns:1fr 25px;min-height:135px}.chapter .thumb{display:none}.intro h1{font-size:23px}.intro p{font-size:11px}.intro .eyebrow{font-size:30px}.home{padding:18px 15px}.workspace{display:flex}.studio{padding:12px 9px;width:calc(100% - 14px);margin:10px auto}.topbar{padding:0 12px}.brand{font-size:13px;padding:7px 10px}.header-btn{width:37px;height:37px}.top-actions{gap:8px}.activity-head h1{font-size:17px}.guide .listen-btn{font-size:11px}.canvas-frame svg{height:auto}.top-actions #savedCount{display:none}}

.settings-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
#settingsPanel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  align-items: center;
  width: 0;
  opacity: 0;
  overflow: visible; /* Need overflow visible so dropdown list can render outside the container! */
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, transform 0.25s ease;
  transform: translateY(-5px);
  pointer-events: none;
  z-index: 999;
}
#settingsPanel.open {
  width: 145px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#language {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  border-bottom: 5px solid #ffffff;
  border-radius: 24px;
  padding: 6px 14px 8px;
  color: #1e293b;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05), inset 0 2px 2px #fff;
  transition: transform 0.1s, background 0.12s;
  user-select: none;
}
#language:hover {
  background: #e2e8f0;
}
#language:active {
  transform: translateY(2px);
  border-bottom-width: 2.5px;
}
#language .arrow {
  font-size: 12px;
  color: #64748b;
}
.flag-holder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Custom Dropdown List overlay */
#languageList {
  position: absolute;
  top: calc(100% + 8px);
  left: -20px;
  right: 0;
  background: #ffffff;
  border: 2.5px solid #cbd5e1;
  border-radius: 18px;
  max-height: 285px;
  overflow-y: auto;
  z-index: 999;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  display: none;
  padding: 6px 0;
}
#languageList.show {
  display: block;
  animation: dropdownFadeIn 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Scrollbar styles */
#languageList::-webkit-scrollbar {
  width: 8px;
}
#languageList::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 0 18px 18px 0;
}
#languageList::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}
#languageList::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Custom Dropdown Items */
.lang-option {
  width: 100%;
  background: transparent;
  border: none;
  padding: 9px 16px;
  text-align: left;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.lang-option:hover {
  background: #f1f5f9;
}
.lang-option.selected {
  background: #eff6ff;
  color: #2F6DF4;
}
.lang-option .flag-img, #language .flag-img {
  width: 20px !important;
  height: 14px !important;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}


#settingsPanel:not([hidden]){width:145px;opacity:1;transform:translateY(0);pointer-events:auto}
#language{background:#f1f5f9;border:2px solid #cbd5e1;border-bottom:5px solid #fff;border-radius:24px;padding:6px 14px 8px;font-size:13px;color:#1e293b}
#languageList:not([hidden]){display:block}
#languageOptions{max-height:none;overflow:visible}
.top-actions .lang-option{border:0;border-radius:0;padding:9px 16px;background:transparent;font-size:13.5px}
.top-actions .lang-option.selected{background:#eff6ff;color:#2f6df4}
.top-actions .lang-option:hover{background:#f1f5f9}
