* {
  box-sizing: border-box;
}

:root {
  --orange: #f4a04d;
  --orange-dark: #de8430;
  --orange-light: #fff0dd;

  --mint: #bfe3d7;
  --cream: #fffaf2;

  --text: #2c2927;
  --subtext: #756f69;

  --line: #ddd6cd;
  --white: #ffffff;

  --shadow:
    0 16px 50px rgba(70, 56, 42, 0.12);
}

body {
  margin: 0;
  min-width: 1100px;

  font-family:
    Arial,
    "Noto Sans KR",
    sans-serif;

  color: var(--text);
  background: #f3efe9;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* 전체 화면 */

.studio-layout {
  display: grid;
  grid-template-columns: 370px 1fr;

  min-height: 100vh;
}

/* 설정 패널 */

.studio-panel {
  position: sticky;
  top: 0;

  height: 100vh;
  overflow-y: auto;

  padding: 28px;

  background: var(--white);
  border-right: 1px solid var(--line);
}

.studio-logo {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-bottom: 28px;
}

.logo-mark {
  display: grid;
  place-items: center;

  width: 50px;
  height: 50px;

  font-size: 18px;
  font-weight: 900;

  color: var(--white);
  background: var(--orange);

  border-radius: 17px;
}

.studio-logo strong {
  display: block;

  font-size: 18px;
  letter-spacing: 1.8px;
}

.studio-logo p {
  margin: 2px 0 0;

  font-size: 13px;
  color: var(--subtext);
}

.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;

  margin-bottom: 22px;
  padding: 16px;

  background: var(--orange-light);
  border-radius: 14px;
}

.panel-heading span {
  font-size: 18px;
  font-weight: 800;
}

.panel-heading small {
  color: var(--subtext);
}

.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: block;

  margin-bottom: 8px;

  font-size: 14px;
  font-weight: 800;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label-row span {
  padding: 3px 8px;

  font-size: 12px;
  font-weight: 700;

  color: var(--orange-dark);
  background: var(--orange-light);

  border-radius: 99px;
}

input,
textarea,
select {
  width: 100%;

  padding: 12px 13px;

  color: var(--text);
  background: var(--white);

  border: 1px solid #cfc8bf;
  border-radius: 10px;

  outline: none;
}

textarea {
  line-height: 1.55;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--orange);

  box-shadow:
    0 0 0 3px
    rgba(244, 160, 77, 0.15);
}

.help-text {
  margin: 7px 0 0;

  font-size: 12px;
  color: var(--subtext);
}

.primary-button,
.print-button {
  width: 100%;

  padding: 14px;

  font-weight: 800;

  border: 0;
  border-radius: 11px;
}

.primary-button {
  color: var(--white);
  background: var(--orange);
}

.primary-button:hover {
  background: var(--orange-dark);
}

.secondary-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;

  margin-top: 10px;
}

.secondary-buttons button {
  padding: 11px;

  font-weight: 700;

  color: var(--text);
  background: var(--white);

  border: 1px solid var(--line);
  border-radius: 10px;
}

.secondary-buttons button.active {
  color: var(--white);
  background: var(--text);
  border-color: var(--text);
}

.print-button {
  margin-top: 10px;

  color: #31584c;
  background: var(--mint);
}

.status-message {
  margin-top: 14px;
  padding: 11px 12px;

  font-size: 12px;
  line-height: 1.5;

  color: var(--subtext);
  background: #f7f5f2;

  border-radius: 9px;
}

.status-message.error {
  color: #a94031;
  background: #fff0ed;
}

/* 미리보기 영역 */

.preview-area {
  padding: 26px 34px 70px;

  overflow: auto;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  width: 794px;
  margin: 0 auto 16px;
}

.preview-toolbar div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-toolbar span {
  padding: 5px 9px;

  font-size: 12px;

  color: var(--subtext);
  background: var(--white);

  border: 1px solid var(--line);
  border-radius: 99px;
}

/* A4 활동지 */

.worksheet {
  position: relative;

  width: 794px;
  min-height: 1123px;

  margin: 0 auto;
  padding: 54px 58px 46px;

  background: var(--cream);

  border-radius: 4px;
  box-shadow: var(--shadow);

  overflow: hidden;
}

.worksheet::before {
  position: absolute;
  top: -70px;
  right: -70px;

  width: 210px;
  height: 210px;

  content: "";

  background: var(--orange-light);
  border-radius: 50%;
}

.worksheet::after {
  position: absolute;
  bottom: -90px;
  left: -90px;

  width: 230px;
  height: 230px;

  content: "";

  background: #e5f3ee;
  border-radius: 50%;
}

.empty-preview {
  position: relative;
  z-index: 1;

  display: grid;
  place-items: center;

  min-height: 900px;

  text-align: center;
  color: var(--subtext);
}

.empty-icon {
  margin-bottom: -300px;

  font-size: 64px;
}

.empty-preview h2 {
  margin-bottom: -340px;

  color: var(--text);
}

.empty-preview p {
  line-height: 1.7;
}

/* 활동지 상단 */

.worksheet-header {
  position: relative;
  z-index: 1;
}

.worksheet-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 18px;
}

.day-badge {
  padding: 7px 13px;

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.4px;

  color: var(--white);
  background: var(--orange);

  border-radius: 99px;
}

.name-box {
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 13px;
  font-weight: 700;
}

.name-line {
  width: 120px;
  height: 24px;

  border-bottom: 1.5px solid var(--text);
}

.worksheet-title {
  margin: 0;

  font-size: 34px;
  line-height: 1.25;
  letter-spacing: -1px;
}

.worksheet-subtitle {
  margin: 9px 0 0;

  font-size: 14px;
  color: var(--subtext);
}

/* 미션 카드 */

.mission-card {
  position: relative;
  z-index: 1;

  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;

  margin: 24px 0 26px;
  padding: 17px 20px;

  background: var(--white);

  border: 1px solid #ead8c4;
  border-radius: 18px;
}

.mission-icon {
  display: grid;
  place-items: center;

  width: 48px;
  height: 48px;

  font-size: 23px;

  background: var(--orange-light);
  border-radius: 15px;
}

.mission-card strong {
  display: block;

  margin-bottom: 4px;

  font-size: 13px;
  color: var(--orange-dark);
}

.mission-card p {
  margin: 0;

  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

/* 퍼즐 */

.puzzle-section {
  position: relative;
  z-index: 1;
}

.puzzle-frame {
  display: flex;
  justify-content: center;

  padding: 18px;

  background: var(--white);

  border: 2px solid #3e3935;
  border-radius: 20px;
}

.puzzle-grid {
  border-collapse: collapse;
  table-layout: fixed;

  background: var(--white);
}

.puzzle-grid td {
  width: 34px;
  min-width: 34px;
  height: 34px;

  padding: 0;

  text-align: center;
  vertical-align: middle;

  font-size: 18px;
  font-weight: 800;

  border: 1px solid #b8b1aa;
}

.puzzle-grid td.answer-cell {
  background: #ffd38f;
}

/* 낱말 목록 */

.word-section {
  position: relative;
  z-index: 1;

  margin-top: 24px;
}

.word-section h3 {
  margin: 0 0 12px;

  font-size: 16px;
}

.worksheet-word-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px 12px;

  padding: 17px 20px;

  background: var(--white);

  border: 1px solid var(--line);
  border-radius: 17px;
}

.word-item {
  display: flex;
  align-items: center;
  gap: 7px;

  min-width: 0;

  font-size: 14px;
  font-weight: 700;
}

.check-box {
  flex: 0 0 auto;

  width: 15px;
  height: 15px;

  border: 1.5px solid #625c57;
  border-radius: 3px;
}

/* 하단 */

.worksheet-footer {
  position: relative;
  z-index: 1;

  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  margin-top: 26px;
}

.tip-card {
  max-width: 480px;
  padding: 13px 17px;

  font-size: 13px;
  line-height: 1.5;

  color: #4e4944;
  background: #edf7f3;

  border-radius: 14px;
}

.footer-logo {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.5px;

  color: var(--orange-dark);
}

/* 정답표 */

.answer-section {
  position: relative;
  z-index: 1;

  margin-top: 24px;
}

.answer-section h3 {
  margin-bottom: 10px;
}

.answer-table {
  width: 100%;

  border-collapse: collapse;
  background: var(--white);
}

.answer-table th,
.answer-table td {
  padding: 8px 7px;

  text-align: center;
  font-size: 12px;

  border: 1px solid #b8b1aa;
}

.answer-table th {
  background: #f3eee8;
}

/* 인쇄 */

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  body {
    min-width: auto;
    margin: 0;
    background: white;
  }

  .studio-panel,
  .preview-toolbar {
    display: none !important;
  }

  .studio-layout {
    display: block;
  }

  .preview-area {
    margin: 0;
    padding: 0;
  }

  .worksheet {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;

    margin: 0;
    padding: 10mm 14mm 8mm;

    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
  }

  .worksheet-topline {
    margin-bottom: 10px;
  }

  .worksheet-title {
    font-size: 27px;
  }

  .worksheet-subtitle {
    margin-top: 5px;
    font-size: 12px;
  }

  .mission-card {
    grid-template-columns: 44px 1fr;
    gap: 10px;

    margin: 14px 0 14px;
    padding: 10px 14px;
  }

  .mission-icon {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .mission-card p {
    font-size: 13px;
  }

  .puzzle-frame {
    padding: 10px;
    border-radius: 14px;
  }

  .puzzle-grid td {
    width: 7.8mm;
    min-width: 7.8mm;
    height: 7.8mm;

    font-size: 15px;
  }

  .word-section {
    margin-top: 14px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .word-section h3 {
    margin-bottom: 7px;
    font-size: 14px;
  }

  .worksheet-word-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px 10px;

    padding: 10px 14px;
    border-radius: 12px;

    break-inside: avoid;
    page-break-inside: avoid;
  }

  .word-item {
    gap: 5px;
    font-size: 11px;
  }

  .check-box {
    width: 12px;
    height: 12px;
  }

  .worksheet-footer {
    margin-top: 12px;
  }

  .tip-card {
    padding: 8px 12px;
    font-size: 10px;
  }

  .footer-logo {
    font-size: 9px;
  }

  .worksheet::before,
  .worksheet::after {
    opacity: 0.7;
  }
}