.worksheet-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px 16px 32px;
  display: grid;
  gap: 16px;
}

.worksheet-shell,
.worksheet-shell * {
  box-sizing: border-box;
}

.worksheet-shell__card {
  width: 100%;
  border-radius: 24px;
  background: #fffdf8;
  border: 2px solid rgba(26, 121, 165, 0.1);
  box-shadow: 0 18px 36px rgba(53, 57, 62, 0.12);
}

.worksheet-shell__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}

.worksheet-shell__topbar-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #2c2722;
}

.worksheet-shell__intro {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background: linear-gradient(120deg, #d8effb 0%, #9bd6ee 54%, #567fa3 100%);
}

.worksheet-shell__intro-icon {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: rgba(255, 248, 223, 0.92);
  border: 4px solid rgba(255, 255, 255, 0.55);
  font-size: 46px;
}

.worksheet-shell__intro-text h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  color: #2b2723;
}

.worksheet-shell__intro-text p {
  margin: 0;
  line-height: 1.8;
  color: #43515a;
}

.worksheet-shell__section {
  padding: 18px;
}

.worksheet-shell__section--guide,
.worksheet-shell__section--workspace {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.worksheet-shell__section .guide-card,
.worksheet-shell__section .controls,
.worksheet-shell__section .actions,
.worksheet-shell__section .status,
.worksheet-shell__section .workspace,
.worksheet-shell__section .board,
.worksheet-shell__section .teacher-panel,
.worksheet-shell__section .answer-card {
  width: 100%;
}

.worksheet-shell .controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.worksheet-shell .control-card {
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 2px solid rgba(26, 121, 165, 0.12);
}

.worksheet-shell .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.worksheet-shell .actions button {
  min-height: 48px;
  padding: 11px 14px;
}

.worksheet-shell .status {
  margin-top: 16px;
}

.worksheet-shell__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
}

.worksheet-shell__problem {
  min-width: 0;
}

.worksheet-shell__teacher {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.worksheet-shell__teacher-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 2px solid rgba(26, 121, 165, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, #f4fbff 0%, #fffdfa 100%);
  color: #1a5672;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.worksheet-shell__teacher-toggle::after {
  content: "접기";
  font-size: 0.92rem;
}

.worksheet-shell__teacher.is-collapsed .worksheet-shell__teacher-toggle::after {
  content: "펼치기";
}

.worksheet-shell__teacher-body {
  display: grid;
  gap: 12px;
}

.worksheet-shell__teacher.is-collapsed .worksheet-shell__teacher-body {
  display: none;
}

.worksheet-shell .teacher-panel,
.worksheet-shell .answer-card {
  display: grid;
  gap: 12px;
}

@media (max-width: 940px) {
  .worksheet-shell__workspace {
    grid-template-columns: 1fr;
  }

  .worksheet-shell__teacher {
    order: 2;
  }
}

@media (max-width: 768px) {
  .worksheet-shell {
    padding: 16px 16px 32px;
    gap: 14px;
  }

  .worksheet-shell__card {
    width: 100%;
    max-width: none;
    border-radius: 22px;
  }

  .worksheet-shell__topbar {
    padding: 14px 16px;
  }

  .worksheet-shell__intro {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }

  .worksheet-shell__intro-icon {
    width: 84px;
    height: 84px;
    font-size: 40px;
  }

  .worksheet-shell__section {
    padding: 16px;
    width: 100%;
    max-width: none;
  }

  .worksheet-shell__section--guide,
  .worksheet-shell__section--workspace {
    padding: 0;
    width: 100%;
    max-width: none;
  }

  .worksheet-shell__workspace {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    max-width: none;
  }

  .worksheet-shell__teacher {
    order: 2;
    width: 100%;
    max-width: none;
  }

  .worksheet-shell__problem {
    width: 100%;
    max-width: none;
  }

  .worksheet-shell .controls {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
  }

  .worksheet-shell .actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
  }

  .worksheet-shell .actions button {
    width: 100%;
  }

  .worksheet-shell .guide-card,
  .worksheet-shell .controls,
  .worksheet-shell .control-card,
  .worksheet-shell .actions,
  .worksheet-shell .status,
  .worksheet-shell .board,
  .worksheet-shell .teacher-panel,
  .worksheet-shell .answer-card,
  .worksheet-shell__teacher-toggle,
  .worksheet-shell__teacher-body {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .worksheet-shell .panel,
  .worksheet-shell .hero,
  .worksheet-shell .workspace {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .worksheet-shell .workspace {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .worksheet-shell .board,
  .worksheet-shell .teacher-panel,
  .worksheet-shell .answer-card {
    justify-self: stretch;
    align-self: stretch;
  }

  .worksheet-shell .guide-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .worksheet-shell .guide-link {
    width: 100%;
    justify-content: center;
  }

  .worksheet-shell .teacher-panel,
  .worksheet-shell .answer-card {
    order: 2;
  }

  .worksheet-shell__teacher.is-collapsed .worksheet-shell__teacher-body {
    display: none;
  }
}
