/* 로그인 뒤 화면의 디자인과 휴대폰 화면(650px 이하)의 앱 틀.
   주요 메뉴는 아래 탭바로, 글자 크기·공유·로그아웃 같은 단추는 내 정보 시트로 옮기고, 본문을 맨 위로 올립니다.
   단추와 메뉴의 DOM은 그대로 두고 자리만 바꾸므로 다른 스크립트(공유, 사용법, 앱 설치 등)는 고치지 않아도 됩니다.
   앞부분은 모든 너비에서 쓰는 로그인 뒤 화면의 디자인이고, 뒷부분이 휴대폰 배치입니다. PC 배치는 clean-tone.css에 있습니다.
   인트로와 로그인 화면은 이 디자인을 쓰지 않습니다. 동작은 mobile-shell.js에 있습니다. */

body.sb-theme.curriculum-app.readable-app {
  --ms-ink: #2c3566;
  --ms-text: #3a3f62;
  --ms-muted: #5f6480;
  --ms-line: #e8e0cd;
  --ms-hair: #f1ebdc;
  --ms-track: #ece5d4;
  --ms-card: #fffdf8;
  --ms-soft: #f7f3e9;
  --ms-green: #1f7040;
  --ms-green-soft: #e7f3e9;
  --ms-coral: #b93825;
  --ms-coral-soft: #fdebe5;
  --ms-amber: #8a5a10;
  --ms-amber-soft: #fdf3d7;
  --ms-mint: #1f5f59;
  --ms-mint-soft: #e3f4f1;
  --ms-violet: #4a3f8c;
  --ms-violet-soft: #f0edfb;
  --ms-tabbar: 78px;
  --ms-radius: 18px;
  /* 주 단추, 고른 항목, 눈금 막대의 색입니다. 휴대폰은 남색 그대로 두고, PC는 clean-tone.css에서 동화풍 색으로 바꿉니다. */
  --ms-action: var(--ms-ink);
  --ms-action-hover: #3a4478;
  --ms-action-ink: var(--ms-card);
  --ms-fill: var(--ms-ink);
  --ms-fill-ink: var(--ms-card);
  --ms-fill-line: var(--ms-ink);
  --ms-fill-soft: var(--ms-track);
  --ms-fill-track: rgba(255, 253, 248, .28);
  --ms-fill-bar: var(--sb-yellow, #f6c24a);
  --ms-spark: var(--sb-yellow, #f6c24a);
  --ms-meter: var(--ms-ink);
  --ms-row-on: var(--ms-track);
}

.app-phone-actions,
.phone-sheet-head,
.phone-sheet-scrim,
.phone-quick-links,
.board-summary-meter,
.app-nav-icon { display: none; }

@media screen {
  /* ── 머리말: 로고와 단추 둘만 남깁니다 ── */
  body.sb-theme.curriculum-app.readable-app .app-brand { min-width: 0; gap: 8px; }
  body.sb-theme.curriculum-app.readable-app .app-school { display: none; }
  body.sb-theme.curriculum-app.readable-app .app-phone-actions { display: flex; flex: none; align-items: center; }
  body.sb-theme.curriculum-app.readable-app .app-phone-btn {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--ms-ink);
    font: inherit; font-size: 19px; font-weight: 700; background: none; border: 0; border-radius: 50%; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  body.sb-theme.curriculum-app.readable-app .app-phone-avatar {
    display: grid; place-items: center; width: 38px; height: 38px; color: var(--ms-fill-ink); background: var(--ms-fill); border-radius: 50%;
  }
  /* 캐릭터 그림에는 동그라미까지 들어 있습니다. 왕관 그림은 세로가 더 길어서, 아래에 맞추면 왕관만 동그라미 위로 올라옵니다. */
  body.sb-theme.curriculum-app.readable-app .app-phone-avatar.has-character { position: relative; background: none; }
  body.sb-theme.curriculum-app.readable-app .app-phone-avatar.has-character img { position: absolute; left: 0; bottom: 0; display: block; width: 100%; height: auto; }
  body.sb-theme.curriculum-app.readable-app .app-phone-avatar svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  body.sb-theme.curriculum-app.readable-app :is(.app-phone-btn, .phone-quick-links a, .phone-quick-links button):focus-visible,
  body.sb-theme.curriculum-app.readable-app .app-navigation button:focus-visible,
  body.sb-theme.curriculum-app.readable-app .app-utilities button:focus-visible { outline: 3px solid var(--sb-violet, #7d6bc7); outline-offset: -3px; }

  /* 학생 모드 안내는 시트로, 수강신청 단추는 요약 카드 아래로 옮깁니다. */
  body.sb-theme.curriculum-app.readable-app .app-context { padding: 0; gap: 10px; }
  body.sb-theme.curriculum-app.readable-app .mode-text { display: none; }
  body.sb-theme.curriculum-app.readable-app .app-external-links { width: 100%; }
  body.sb-theme.curriculum-app.readable-app .app-external-links .btn { flex: 1 1 0; }
  body.sb-theme.curriculum-app.readable-app.phone-has-quick-links .app-external-links { display: none; }

  body.sb-theme.curriculum-app.readable-app .app-nav-icon {
    display: block; flex: none; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
  body.sb-theme.curriculum-app.readable-app .app-navigation button[aria-current] .app-nav-icon { stroke-width: 2; }
  body.sb-theme.curriculum-app.readable-app .app-navigation button[aria-current] .app-nav-needle { fill: currentColor; }
  body.sb-theme.curriculum-app.readable-app .phone-sheet-head { order: -2; display: flex; flex: none; align-items: center; gap: 12px; }
  body.sb-theme.curriculum-app.readable-app .phone-sheet-head .app-phone-avatar { flex: none; width: 56px; height: 56px; }
  body.sb-theme.curriculum-app.readable-app .phone-sheet-head .app-phone-avatar svg { width: 26px; height: 26px; }
  body.sb-theme.curriculum-app.readable-app .phone-sheet-who { min-width: 0; }
  body.sb-theme.curriculum-app.readable-app .phone-sheet-who p { margin: 0; color: var(--ms-muted); font-size: calc(14px * var(--reading-scale, 1)); line-height: 1.4; }
  body.sb-theme.curriculum-app.readable-app .phone-sheet-who strong { color: var(--ms-ink); font-size: calc(19px * var(--reading-scale, 1)); font-weight: 800; letter-spacing: -.03em; }
  body.sb-theme.curriculum-app.readable-app .phone-sheet-who [data-phone-school] { margin-left: 4px; color: var(--ms-green); font-size: calc(13px * var(--reading-scale, 1)); font-weight: 700; }

  body.sb-theme.curriculum-app.readable-app .app-utilities .reading-controls {
    order: -1; display: flex; flex: none; align-items: center; gap: 0; min-height: 60px; margin: 18px 0 6px; padding: 0 6px 0 16px; box-sizing: border-box;
    color: var(--ms-ink); background: #f7f3e9; border: 0; border-radius: 16px;
  }
  body.sb-theme.curriculum-app.readable-app .app-utilities .reading-controls > span { margin-right: auto; font-size: calc(16px * var(--reading-scale, 1)); font-weight: 600; }
  body.sb-theme.curriculum-app.readable-app .app-utilities .reading-controls button {
    display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; color: var(--ms-ink); font-size: 20px; font-weight: 700; background: none; border: 0; border-radius: 12px;
  }
  body.sb-theme.curriculum-app.readable-app .app-utilities .reading-controls button:disabled { color: #a9a493; }

  /* .hidden·[hidden]으로 숨긴 단추가 나타나지 않게 display는 숨기지 않은 단추에만 줍니다. */
  body.sb-theme.curriculum-app.readable-app .app-utilities > button:not(.hidden):not([hidden]) { display: flex; }
  body.sb-theme.curriculum-app.readable-app .app-utilities > button,
  body.sb-theme.curriculum-app.readable-app .app-utilities #changeModeBtn.app-mode-switch {
    flex: none; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-width: 0; min-height: 56px; margin: 0; padding: 0 4px;
    color: var(--ms-ink); font: inherit; font-size: calc(16px * var(--reading-scale, 1)); font-weight: 600; line-height: 1.3; text-align: left;
    background: none !important; border: 0; border-bottom: 1px solid var(--ms-hair); border-radius: 0; box-shadow: none; cursor: pointer;
  }
  body.sb-theme.curriculum-app.readable-app .app-utilities > button:is(:hover, :active),
  body.sb-theme.curriculum-app.readable-app .app-utilities #changeModeBtn.app-mode-switch:is(:hover, :active) { background: none !important; box-shadow: none; }
  body.sb-theme.curriculum-app.readable-app .app-utilities > button svg {
    display: block; flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
  }
  body.sb-theme.curriculum-app.readable-app .app-utilities #socialAccountBtn,
  body.sb-theme.curriculum-app.readable-app .app-utilities #teacherPasswordBtn { order: 1; }
  body.sb-theme.curriculum-app.readable-app .app-utilities #installAppBtn,
  body.sb-theme.curriculum-app.readable-app .app-utilities #shareLinkBtn,
  body.sb-theme.curriculum-app.readable-app .app-utilities #openManualBtn { order: 2; }
  body.sb-theme.curriculum-app.readable-app .app-utilities #socialAccountBtn::after {
    content: "카카오·네이버"; margin-left: auto; color: var(--ms-muted); font-size: calc(14px * var(--reading-scale, 1)); font-weight: 500;
  }
  body.sb-theme.curriculum-app.readable-app .app-utilities #changeModeBtn.app-mode-switch { order: 3; color: var(--ms-muted); border-bottom: 0; }
  body.sb-theme.curriculum-app.readable-app .app-utilities #changeModeBtn.app-mode-switch::before {
    content: ""; flex: none; width: 22px; height: 22px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  /* ── 나의 교육과정 ── */
  body.sb-theme .student-dashboard.curriculum-board { gap: 14px; font-family: inherit; color: var(--ms-text); }
  body.sb-theme .student-dashboard.curriculum-board .board-overview {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; margin: 0; padding: 10px 0 0; border: 0;
  }
  body.sb-theme .student-dashboard.curriculum-board .board-overview > div { display: contents; }
  body.sb-theme .student-dashboard.curriculum-board .board-overview h2 {
    grid-column: 1 / -1; margin: 0; color: var(--ms-ink); font-size: calc(27px * var(--reading-scale, 1)); line-height: 1.25; font-weight: 800; letter-spacing: -.035em;
  }
  body.sb-theme .student-dashboard.curriculum-board .board-overview h2::after { display: none; }
  body.sb-theme .student-dashboard.curriculum-board .board-overview p { margin: 0; color: var(--ms-muted); font-size: calc(15px * var(--reading-scale, 1)); line-height: 1.4; }
  body.sb-theme .student-dashboard.curriculum-board .board-outline-button,
  body.sb-theme .student-dashboard.curriculum-board .board-view-toggle {
    display: inline-flex; align-items: center; gap: 6px; width: auto; min-width: 0; min-height: 40px; margin: 0; padding: 0 13px; color: var(--ms-ink);
    font-size: calc(14px * var(--reading-scale, 1)); font-weight: 700; white-space: nowrap;
    background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 12px; box-shadow: 0 1px 0 var(--ms-line);
  }
  body.sb-theme .student-dashboard.curriculum-board :is(.board-outline-button, .board-view-toggle):hover { color: var(--ms-ink); background: var(--ms-soft); border-color: var(--ms-line); box-shadow: 0 1px 0 var(--ms-line) !important; }
  body.sb-theme .student-dashboard.curriculum-board .board-view-toggle[aria-pressed="true"],
  body.sb-theme .student-dashboard.curriculum-board .board-view-toggle[aria-pressed="true"]:hover { color: var(--ms-fill-ink); background: var(--ms-fill); border-color: var(--ms-fill-line); box-shadow: 0 1px 0 var(--ms-fill-line) !important; }
  body.sb-theme .student-dashboard.curriculum-board .board-toggle-icon { flex: none; }

  /* 요약 카드: 칸을 풀어 큰 숫자 하나가 먼저 보이게 다시 놓습니다. */
  body.sb-theme .student-dashboard.curriculum-board .board-summary {
    position: static; display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 0 20px; margin: 0; padding: 18px 20px 16px;
    background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: var(--ms-radius); box-shadow: none;
  }
  body.sb-theme .student-dashboard.curriculum-board .board-summary::before,
  body.sb-theme .student-dashboard.curriculum-board .board-summary::after { display: none; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-item {
    display: flex; align-items: baseline; gap: 5px; min-width: 0; margin: 0; padding: 0; text-align: left; border: 0; border-right: 0;
  }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-item > span { color: var(--ms-muted); font-size: calc(15px * var(--reading-scale, 1)); font-weight: 500; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-item > strong { margin: 0; color: var(--ms-ink); font-size: calc(15px * var(--reading-scale, 1)); line-height: 1.4; font-weight: 700; letter-spacing: -.02em; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-item:first-child { display: contents; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-item:first-child > span { grid-row: 1; grid-column: 1 / 3; font-size: calc(14px * var(--reading-scale, 1)); font-weight: 600; white-space: nowrap; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-item:first-child > strong { grid-row: 2; grid-column: 1 / -1; font-size: calc(48px * var(--reading-scale, 1)); line-height: 1.15; font-weight: 800; letter-spacing: -.035em; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-item:first-child > strong small { margin-left: 2px; color: var(--ms-muted); font-size: calc(18px * var(--reading-scale, 1)); font-weight: 500; letter-spacing: -.01em; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-item:nth-child(2),
  body.sb-theme .student-dashboard.curriculum-board .board-summary-item:nth-child(3) { grid-row: 4; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-meter { grid-row: 3; grid-column: 1 / -1; display: block; height: 6px; margin: 10px 0 12px; overflow: hidden; background: var(--ms-track); border-radius: 3px; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-meter > span { display: block; height: 100%; background: var(--ms-meter); border-radius: 3px; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-status,
  body.sb-theme .student-dashboard.curriculum-board .board-summary-status > div { display: contents; }
  body.sb-theme .student-dashboard.curriculum-board .board-status-symbol { display: none; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-status strong {
    grid-row: 1; grid-column: 3; justify-self: end; display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; box-sizing: border-box;
    color: var(--ms-green); font-size: calc(13px * var(--reading-scale, 1)); line-height: 1.3; font-weight: 700; background: var(--ms-green-soft); border-radius: 13px;
  }
  /* 글자를 키웠거나 화면이 아주 좁으면 상태 표시가 세로로 꺾이지 않게 숫자 아래로 내립니다. */
  body[data-reading-step="2"] .student-dashboard.curriculum-board .board-summary-status strong,
  body[data-reading-step="3"] .student-dashboard.curriculum-board .board-summary-status strong { grid-row: 6; grid-column: 1 / -1; justify-self: start; margin-top: 10px; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-status.is-good strong::before { content: "✓"; margin-right: 4px; font-weight: 800; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-status.needs-review strong { color: #8a5a10; background: #fff3cf; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-status.needs-review strong::before { content: "!"; margin-right: 4px; font-weight: 800; }
  body.sb-theme .student-dashboard.curriculum-board .board-summary-status > div > span { grid-row: 5; grid-column: 1 / -1; margin-top: 4px; color: #6b6f86; font-size: calc(13px * var(--reading-scale, 1)); line-height: 1.4; font-weight: 400; }

  /* 수강신청 사이트: 요약 카드 바로 아래 */
  body.sb-theme .phone-quick-links { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
  body.sb-theme .phone-quick-links button {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 50px; margin: 0; padding: 4px 16px; box-sizing: border-box;
    color: var(--ms-coral); font: inherit; font-size: calc(16px * var(--reading-scale, 1)); line-height: 1.25; font-weight: 700; text-align: left;
    background: var(--ms-coral-soft); border: 0; border-radius: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  body.sb-theme .phone-quick-links button + button { color: #7a4f0c; background: #fff3cf; }
  body.sb-theme .phone-quick-links svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

  body.sb-theme .student-dashboard.curriculum-board .board-alert-notice { border: 0; border-radius: 14px; }
  body.sb-theme .student-dashboard.curriculum-board .board-courses { margin-top: 6px; }
  body.sb-theme .student-dashboard.curriculum-board .board-section-heading { margin-bottom: 8px; }
  body.sb-theme .student-dashboard.curriculum-board .board-heading-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: nowrap; width: 100%; }
  body.sb-theme .student-dashboard.curriculum-board h3 { color: var(--ms-ink); font-size: calc(19px * var(--reading-scale, 1)); font-weight: 800; letter-spacing: -.03em; }
  body.sb-theme .student-dashboard.curriculum-board .board-section-heading p { margin: 0; color: var(--ms-muted); font-size: calc(14px * var(--reading-scale, 1)); }

  /* 학년 선택: 한 덩어리 세그먼트 */
  body.sb-theme .student-dashboard.curriculum-board .board-year-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin-bottom: 12px; padding: 3px; background: var(--ms-track); border: 0; border-radius: 12px;
  }
  body.sb-theme .student-dashboard.curriculum-board .board-year-tabs button,
  body.sb-theme .student-dashboard.curriculum-board .board-year-tabs button:nth-child(n) {
    display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 5px; min-height: 42px; padding: 8px 2px; color: var(--ms-muted);
    background: transparent; border: 0; border-radius: 9px; box-shadow: none; transform: none; filter: none;
  }
  body.sb-theme .student-dashboard.curriculum-board .board-year-tabs strong { display: inline; font-size: calc(15px * var(--reading-scale, 1)); line-height: 1.5; font-weight: 600; }
  body.sb-theme .student-dashboard.curriculum-board .board-year-tabs button > span { display: inline; margin: 0; font-size: calc(13px * var(--reading-scale, 1)); line-height: 1.5; }
  body.sb-theme .student-dashboard.curriculum-board .board-year-tabs button[aria-pressed="true"],
  body.sb-theme .student-dashboard.curriculum-board .board-year-tabs button[aria-pressed="true"]:nth-child(n) { color: var(--ms-ink); background: var(--ms-card); border: 0; box-shadow: none; transform: none; }
  body.sb-theme .student-dashboard.curriculum-board .board-year-tabs button[aria-pressed="true"] strong { font-weight: 700; }

  /* 학기 카드와 접는 칸 */
  body.sb-theme .student-dashboard.curriculum-board :is(.board-semester, .board-disclosure) {
    background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: var(--ms-radius); box-shadow: none;
  }
  body.sb-theme .student-dashboard.curriculum-board .board-semester > header { padding: 14px 18px 12px; background: none; border-bottom: 1px solid var(--ms-hair); }
  body.sb-theme .student-dashboard.curriculum-board .board-semester h4 { color: var(--ms-ink); font-size: calc(17px * var(--reading-scale, 1)); font-weight: 700; letter-spacing: -.03em; }
  body.sb-theme .student-dashboard.curriculum-board .board-semester > header p { color: var(--ms-muted); font-size: calc(14px * var(--reading-scale, 1)); }
  body.sb-theme .student-dashboard.curriculum-board .course-detail { border-style: solid; border-color: var(--ms-hair); }
  body.sb-theme .student-dashboard.curriculum-board .course-detail > summary:hover { background: none; }
  body.sb-theme .student-dashboard.curriculum-board .course-detail[open] > summary { background: #f7f3e9; }
  body.sb-theme .student-dashboard.curriculum-board .course-detail-body { background: #f7f3e9; border-color: var(--ms-hair); }
  body.sb-theme .student-dashboard.curriculum-board .board-chevron { color: #a9a493; }
  body.sb-theme .student-dashboard.curriculum-board .course-kind { border-radius: 7px; border-width: 1px; }
  body.sb-theme .student-dashboard.curriculum-board .dashboard-mark { border-radius: 13px; }

  /* ── 교사 화면의 조회 칸 ── */
  body.sb-theme.curriculum-app.readable-app #teacherTools {
    margin-top: 10px; padding: 18px 16px; background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: var(--ms-radius); box-shadow: none;
  }
  body.sb-theme.curriculum-app.readable-app #teacherTools::before,
  body.sb-theme.curriculum-app.readable-app #teacherTools::after { display: none; }
  body.sb-theme.curriculum-app.readable-app #teacherTools h3 { font-size: calc(19px * var(--reading-scale, 1)); font-weight: 800; }
  body.sb-theme :is(#teacherTools, #adminView) .btn:not(.secondary):not(.ghost) { color: var(--ms-action-ink) !important; background: var(--ms-action) !important; border: 0 !important; border-radius: 14px; box-shadow: none !important; }
  body.sb-theme :is(#teacherTools, #adminView) .btn.secondary { color: var(--ms-ink) !important; background: var(--ms-card) !important; border: 1px solid var(--ms-line) !important; border-radius: 14px; box-shadow: none !important; }
  body.sb-theme :is(#teacherTools, #adminView) :is(input, select) { background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 12px; }

  /* ── 편제표·과목선택도우미·성장 포트폴리오의 제목 ── */
  :is(#helperView, #planView, #growthView) .sh-head { display: flex; flex-direction: column-reverse; gap: 2px; margin: 0 0 14px; padding-top: 10px; }
  :is(#helperView, #planView, #growthView) .sh-head h2 { display: block; margin: 0; color: var(--ms-ink); font-size: calc(27px * var(--reading-scale, 1)); line-height: 1.25; font-weight: 800; letter-spacing: -.035em; }
  :is(#helperView, #planView, #growthView) .sh-head h2::after { display: none; }
  :is(#helperView, #planView, #growthView) .sh-eyebrow { color: var(--ms-muted); font-size: calc(15px * var(--reading-scale, 1)); line-height: 1.4; font-weight: 400; }

  /* ── 성장 포트폴리오: 공책 무늬를 덜어 내고 홈과 같은 카드로 맞춥니다 ── */
  #growthView { margin-top: 0; color: var(--ms-text); }
  #growthView .gb-body { gap: 12px; }
  #growthView .gb-desk { gap: 12px; padding-bottom: 104px; font-size: calc(15px * var(--reading-scale, 1)); }
  #growthView :is(h3, h4) { color: var(--ms-ink); }

  #growthView :is(.gb-card, .gb-card:nth-of-type(2n), .gb-strip, .gb-ledger, .gb-mapmini, .gb-homeroom) {
    background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: var(--ms-radius); box-shadow: none;
  }
  #growthView .gb-card { padding: 18px 16px; }
  #growthView .gb-card__head h3 { font-size: calc(19px * var(--reading-scale, 1)); }
  #growthView .gb-card__head p { color: var(--ms-muted); }

  /* 진로 목표 */
  #growthView .gb-strip { gap: 8px 10px; padding: 14px 16px; }
  #growthView .gb-strip__who { padding: 0 0 10px; border-bottom: 1px solid var(--ms-hair); }
  #growthView .gb-strip__who strong { font-size: calc(16px * var(--reading-scale, 1)); }
  #growthView .gb-strip__who span { font-size: calc(13px * var(--reading-scale, 1)); font-weight: 500; }
  #growthView .gb-strip__label { padding: 3px 10px; color: var(--ms-ink); font-size: calc(13px * var(--reading-scale, 1)); font-weight: 700; background: var(--ms-track); border-radius: 13px; transform: none; }
  #growthView .gb-strip__empty { font-size: calc(14px * var(--reading-scale, 1)); font-weight: 500; }
  #growthView .gb-strip__meta { font-size: calc(13px * var(--reading-scale, 1)); font-weight: 500; }
  #growthView .gb-strip__end { width: 100%; justify-content: space-between; }
  #growthView .gb-pill { border-width: 1px; border-color: var(--ms-line); }
  #growthView .gb-mini-btn {
    min-height: 40px; padding: 2px 14px; color: var(--ms-ink); font-size: calc(14px * var(--reading-scale, 1)); font-weight: 700;
    background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 12px; box-shadow: none;
  }
  #growthView .gb-mini-btn:hover { background: var(--ms-card); }
  #growthView .gb-drawer { padding: 14px; background: #f7f3e9; border: 0; border-radius: 14px; }
  #growthView .gb-editor { background: #f7f3e9; border: 0; border-radius: 14px; }

  /* 학기 선택 */
  #growthView .gb-ledger__head { padding: 16px 16px 0; }
  #growthView .gb-ledger__head h3 { font-size: calc(19px * var(--reading-scale, 1)); font-weight: 800; letter-spacing: -.03em; }
  #growthView .gb-ledger__head span { font-size: calc(13px * var(--reading-scale, 1)); font-weight: 500; }
  #growthView .gb-tabs {
    grid-auto-columns: minmax(84px, 1fr); gap: 6px; padding: 16px 16px 14px; scroll-padding-inline: 16px;
    border-bottom: 1px solid var(--ms-hair);
  }
  #growthView .gb-tab {
    gap: 5px; margin: 0; padding: 8px 10px 9px; color: var(--ms-muted); background: #f7f3e9; border: 0; border-radius: 12px;
  }
  #growthView .gb-tab strong { font-size: calc(15px * var(--reading-scale, 1)); font-weight: 700; }
  #growthView .gb-tab small { font-size: calc(12px * var(--reading-scale, 1)); font-weight: 500; }
  #growthView .gb-tab__bar { height: 4px; background: var(--ms-track); border: 0; border-radius: 2px; }
  #growthView .gb-tab__bar i { background: var(--sb-green, #2f8f55); }
  #growthView .gb-tab:not(:disabled):hover { color: var(--ms-muted); background: #f7f3e9; }
  #growthView .gb-tab.is-on,
  #growthView .gb-tab.is-on:not(:disabled):hover { color: var(--ms-fill-ink); background: var(--ms-fill); border: 0; }
  #growthView .gb-tab.is-on .gb-tab__bar { background: var(--ms-fill-track); }
  #growthView .gb-tab.is-on .gb-tab__bar i { background: var(--ms-fill-bar); }
  #growthView .gb-tab:disabled { color: #8d8a7a; background: #f7f3e9; }
  #growthView .gb-tab:disabled .gb-tab__bar { border: 0; }
  #growthView .gb-tab__now { top: -8px; right: 6px; padding: 0 6px; font-size: 11px; line-height: 16px; border: 0; border-radius: 8px; transform: none; }

  /* 과목 목록 */
  #growthView .gb-items { padding: 4px 0 8px; background: none; border: 0; }
  #growthView .gb-items__group { padding: 12px 16px 4px; color: var(--ms-green); font-size: calc(13px * var(--reading-scale, 1)); font-weight: 700; }
  #growthView .gb-items li + li .gb-item { border-top: 1px solid var(--ms-hair); }
  #growthView .gb-item,
  #growthView .gb-item--fold {
    gap: 10px; min-height: 52px; padding: 6px 16px; font-size: calc(16px * var(--reading-scale, 1)); border-left: 0;
  }
  #growthView .gb-item:hover { background: none; }
  #growthView .gb-item.is-on { background: #f7f3e9; border-left: 0; }
  #growthView .gb-item__name { font-weight: 600; }
  #growthView .gb-item.is-on .gb-item__name { font-weight: 700; }
  #growthView .gb-item__meta { font-size: calc(13px * var(--reading-scale, 1)); font-weight: 500; }
  #growthView .gb-item__chev { color: #a9a493; }
  #growthView .gb-dot { border-width: 1.5px; }

  /* 쓰기 칸 */
  #growthView .gb-pane,
  #growthView .gb-pane--inline { gap: 10px; padding: 12px 16px 16px; background: #f7f3e9; border: 0; }
  #growthView .gb-pane__q { padding: 0; color: var(--ms-ink); font-size: calc(15px * var(--reading-scale, 1)); line-height: 1.5; background: none; border-radius: 0; }
  #growthView .gb-memo-editor { gap: 10px; padding: 0; background: none; border: 0; border-radius: 0; }
  #growthView textarea {
    min-height: 130px; padding: 12px 14px; font-size: calc(16px * var(--reading-scale, 1)); line-height: 1.65;
    background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 14px;
  }
  #growthView .gb-pane textarea,
  #growthView .gb-homeroom textarea { min-height: 130px; font-size: calc(16px * var(--reading-scale, 1)); }
  #growthView textarea:focus { border-color: var(--ms-ink); box-shadow: 0 0 0 1px var(--ms-ink); }
  #growthView input:not([type="checkbox"]):not([type="radio"]),
  #growthView select { background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 12px; }
  #growthView .gb-note-card,
  #growthView .gb-note-card--obs,
  #growthView .gb-note-card--hr { padding: 10px 14px; background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 14px; }
  #growthView .gb-note-card > div { font-size: calc(13px * var(--reading-scale, 1)); }
  #growthView .gb-note-card p { font-size: calc(15px * var(--reading-scale, 1)); line-height: 1.6; }
  #growthView .gb-memos h5 { font-size: calc(15px * var(--reading-scale, 1)); }
  #growthView .gb-pane__foot > span,
  #growthView .gb-memo-capacity-note { font-size: calc(13px * var(--reading-scale, 1)); font-weight: 400; }
  #growthView .gb-owner-note { color: var(--ms-muted); background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 12px; }

  /* 버튼: 그림자를 빼고 한 가지 모양으로 맞춥니다 */
  body.sb-theme.curriculum-app.readable-app #growthView .btn:not(.ghost):not(.secondary),
  body.sb-theme.curriculum-app.readable-app #growthAiModal .modal-body .btn:not(.ghost):not(.secondary) {
    min-height: 48px; padding: 6px 18px; font-size: calc(16px * var(--reading-scale, 1)); font-weight: 700; color: var(--ms-action-ink) !important;
    background: var(--ms-action) !important; border: 0 !important; border-radius: 14px; box-shadow: none !important; transform: none;
  }
  body.sb-theme.curriculum-app.readable-app #growthView .btn:is(.ghost, .secondary),
  body.sb-theme.curriculum-app.readable-app #growthAiModal .modal-body .btn:is(.ghost, .secondary) {
    min-height: 48px; padding: 6px 18px; font-size: calc(15px * var(--reading-scale, 1)); font-weight: 700; color: var(--ms-ink) !important;
    background: var(--ms-card) !important; border: 1px solid var(--ms-line) !important; border-radius: 14px; box-shadow: none !important; transform: none;
  }
  body.sb-theme.curriculum-app.readable-app #growthView .btn:disabled { opacity: .45 !important; }

  /* 진로 맵·담임 칸 */
  #growthView .gb-mapmini { padding: 16px; }
  #growthView .gb-mapmini__head h3,
  #growthView .gb-homeroom__head h3 { font-size: calc(19px * var(--reading-scale, 1)); font-weight: 800; letter-spacing: -.03em; }
  #growthView .gb-mt { min-height: 36px; padding: 0 12px; font-size: calc(14px * var(--reading-scale, 1)); font-weight: 700; color: var(--ms-muted); background: #f7f3e9; border: 0; border-radius: 10px; }
  #growthView .gb-mt.is-on { color: var(--ms-fill-ink); background: var(--ms-fill); border: 0; }
  #growthView .gb-cover { font-size: calc(13px * var(--reading-scale, 1)); }
  #growthView .gb-cover__bar { height: 6px; background: var(--ms-track); border: 0; border-radius: 3px; }
  #growthView .gb-cover__bar i { background: var(--sb-green, #2f8f55); }
  #growthView .gb-subjects li { padding: 8px 0; font-size: calc(15px * var(--reading-scale, 1)); border-bottom: 1px solid var(--ms-hair); }
  #growthView .gb-subjects em { padding: 1px 8px; font-size: calc(12px * var(--reading-scale, 1)); border-radius: 10px; border-width: 0; }
  #growthView .gb-lv { border-width: 0; border-radius: 6px; font-size: 11.5px; }
  #growthView .gb-homeroom { padding: 16px; }
  #growthView .gb-homeroom__body { padding-left: 0; background: none; }
  #growthView .gb-hr-tab { padding: 8px 10px; background: #f7f3e9; border: 0; border-radius: 12px; }
  #growthView .gb-hr-tab.is-on,
  #growthView .gb-hr-tab.is-on:not(:disabled):hover { color: var(--ms-fill-ink); background: var(--ms-fill); border: 0; }
  #growthView .gb-hr-tab:disabled { background: #f7f3e9; }

  /* 교사: 학생 찾기 */
  #growthView .gb-postits { gap: 2px; margin-bottom: 12px; padding: 3px; background: var(--ms-track); border-radius: 12px; }
  #growthView .gb-postit,
  #growthView .gb-postit--1,
  #growthView .gb-postit--2 {
    min-height: 42px; padding: 6px 4px; color: var(--ms-muted); text-align: center; background: transparent; border: 0; border-radius: 9px; box-shadow: none; transform: none; transition: none;
  }
  #growthView .gb-postit strong { font-size: calc(15px * var(--reading-scale, 1)); font-weight: 600; }
  #growthView .gb-postit:hover { color: var(--ms-muted); transform: none; }
  #growthView .gb-postit.is-on,
  #growthView .gb-postit--0.is-on,
  #growthView .gb-postit--1.is-on,
  #growthView .gb-postit--2.is-on { color: var(--ms-ink); background: var(--ms-card); border: 0; box-shadow: none; transform: none; }
  #growthView .gb-postit.is-on strong { font-weight: 700; }
  #growthView .gb-chip { min-height: 40px; padding: 4px 14px; color: var(--ms-muted); font-size: calc(14px * var(--reading-scale, 1)); font-weight: 600; background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 20px; }
  #growthView button.gb-chip:hover { border-color: var(--ms-line); background: var(--ms-card); }
  #growthView .gb-chip.is-on,
  #growthView button.gb-chip.is-on:hover { color: var(--ms-fill-ink); background: var(--ms-fill); border-color: var(--ms-fill-line); }
  #growthView .gb-badge { border-width: 1px; border-radius: 13px; }
  #growthView .gb-table-wrap { background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 14px; }
  #growthView .gb-table th { background: #f7f3e9; border-bottom: 1px solid var(--ms-line); }
  #growthView .gb-table td { border-bottom: 1px solid var(--ms-hair); }
  #growthView .gb-table td:first-child { white-space: nowrap; }
  #growthView .gb-banner,
  #growthView .gb-error { border-width: 1px; border-style: solid; border-radius: 14px; }

  /* 교사 첫 화면: 제목 자리가 우리 반·전체 학생 전환이 됩니다. */
  #growthView.gb-has-scope .sh-head { display: flex; flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 0 2px; padding-top: 6px; }
  #growthView.gb-has-scope .sh-head > :is(.sh-eyebrow, h2) { display: none; }
  #growthView .gb-scope { flex: 1; align-items: flex-start; justify-content: space-between; min-width: 0; }
  #growthView .gb-scope__tabs { display: flex; gap: clamp(12px, 4.6vw, 18px); min-width: 0; padding: 0; background: none; border: 0; border-radius: 0; }
  #growthView .gb-scope__tab {
    position: relative; min-height: 44px; padding: 2px 0 6px; color: #8a8675; font-size: min(calc(27px * var(--reading-scale, 1)), 7.2vw); line-height: 1.26; font-weight: 800; letter-spacing: -.035em;
    background: none; border-radius: 0; -webkit-tap-highlight-color: transparent;
  }
  #growthView .gb-scope__tab.is-on { color: var(--ms-ink); background: none; }
  #growthView .gb-scope__tab.is-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--sb-yellow, #f6c24a); border-radius: 2px; }
  #growthView .gb-scope__search { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; padding: 0; color: var(--ms-ink); background: none; border: 0; -webkit-tap-highlight-color: transparent; }

  /* 교사: 내 교과. 학년마다 한 줄로 과목을 고르고, 그 아래에서 반을 고릅니다. */
  #growthView .gb-course-pick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #growthView .gb-course-pick__row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
  #growthView .gb-course-pick__label { flex: none; width: calc(46px * var(--reading-scale, 1)); padding-top: 10px; color: var(--ms-muted); font-size: calc(14px * var(--reading-scale, 1)); font-weight: 700; white-space: nowrap; }
  #growthView .gb-course-pick__list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
  #growthView .gb-course-pick .gb-chip { display: inline-flex; flex: none; align-items: center; gap: 5px; box-sizing: border-box; color: var(--ms-ink); white-space: nowrap; -webkit-tap-highlight-color: transparent; }
  #growthView .gb-course-pick .gb-chip small { color: var(--ms-muted); font-size: calc(12.5px * var(--reading-scale, 1)); font-weight: 500; }
  #growthView .gb-course-pick .gb-chip.is-on { color: var(--ms-fill-ink); font-weight: 700; }
  #growthView .gb-course-pick .gb-chip.is-on small { color: var(--ms-fill-soft); }
  /* 패널에서는 학생 성찰을 먼저 읽고 그 아래에 관찰을 씁니다. */
  #growthView .gb-panel__pane { padding: 0; background: none; }
  #growthView .gb-panel__pane > .gb-memos[aria-label="성찰 메모"] { order: 1; }
  #growthView .gb-panel__pane > .gb-memo-editor,
  #growthView .gb-panel__pane > .gb-owner-note { order: 2; }
  #growthView .gb-panel__pane > .gb-inline-note { order: 3; }
  #growthView .gb-panel__pane > .gb-memos[aria-label="관찰 메모"] { order: 4; }

  /* 교사: 전체 학생 */
  #growthView .gb-phone-finder { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 8px; }
  body.sb-theme.curriculum-app.readable-app #growthView .gb-finder__search input:not([type="checkbox"]):not([type="radio"]) { width: 100%; height: 48px; min-height: 48px; box-sizing: border-box; padding: 0 14px 0 44px; font-size: calc(16px * var(--reading-scale, 1)); border: 1px solid var(--ms-line); border-radius: 14px; background: var(--ms-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6480' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.8-3.8'/%3E%3C/svg%3E") 14px center / 20px 20px no-repeat; }
  body.sb-theme.curriculum-app.readable-app #growthView .gb-finder__search input:not([type="checkbox"]):not([type="radio"]):focus { border-color: var(--ms-ink); box-shadow: 0 0 0 1px var(--ms-ink); }
  #growthView .gb-phone-finder__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
  #growthView .gb-pick {
    display: inline-flex; align-items: center; gap: 3px; min-height: 44px; box-sizing: border-box; padding: 0 10px 0 14px; color: var(--ms-ink); font-size: calc(14.5px * var(--reading-scale, 1)); font-weight: 600; white-space: nowrap;
    background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 22px; -webkit-tap-highlight-color: transparent;
  }
  #growthView .gb-pick.is-on { color: var(--ms-fill-ink); background: var(--ms-fill); border-color: var(--ms-fill-line); }
  #growthView .gb-phone-finder__count { margin-left: auto; color: var(--ms-muted); font-size: calc(13px * var(--reading-scale, 1)); white-space: nowrap; }
  #growthView .gb-phone-finder .gb-empty,
  #growthView .gb-class .gb-empty { margin: 0; padding: 24px 16px; text-align: center; background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: var(--ms-radius); }

  /* 교사: 명렬표. 번호와 이름, 숫자 칸이 줄을 맞춰 서고, 0은 줄표로 가라앉습니다. */
  #growthView .gb-roster { margin: 0; overflow: visible; background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: var(--ms-radius); }
  #growthView .gb-roster__group + .gb-roster__group { border-top: 1px solid var(--ms-line); }
  #growthView .gb-roster__head {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 6px 0 14px; color: var(--ms-muted);
    font-size: min(calc(12.5px * var(--reading-scale, 1)), 14px); font-weight: 600; background: var(--ms-hair); border-bottom: 0;
  }
  #growthView .gb-roster > .gb-roster__head,
  #growthView .gb-roster__group:first-child .gb-roster__head { border-radius: 17px 17px 0 0; }
  #growthView .gb-roster__head strong { color: var(--ms-ink); font-size: calc(14px * var(--reading-scale, 1)); font-weight: 800; white-space: nowrap; }
  #growthView .gb-roster__count { flex: 1; font-size: calc(13px * var(--reading-scale, 1)); font-weight: 400; white-space: nowrap; }
  #growthView .gb-roster__col { flex: none; width: min(calc(34px * var(--reading-scale, 1)), 36px); text-align: center; white-space: nowrap; }
  #growthView .gb-roster__col--wide { width: min(calc(44px * var(--reading-scale, 1)), 50px); }
  #growthView .gb-roster__end { flex: none; width: 16px; }
  #growthView .gb-line {
    display: flex; gap: 6px; width: 100%; min-height: 62px; padding: 10px 6px 10px 14px; color: var(--ms-text); line-height: 1.3; background: none; border: 0; border-top: 1px solid var(--ms-hair); -webkit-tap-highlight-color: transparent;
  }
  #growthView .gb-roster__list li:first-child .gb-line { border-top: 0; }
  #growthView .gb-roster__list li:last-child .gb-line { border-bottom: 0; }
  #growthView .gb-line:hover { background: none; }
  #growthView .gb-line:active,
  #growthView .gb-line.is-on { background: #f7f3e9; }
  #growthView .gb-line__no { flex: none; width: calc(22px * var(--reading-scale, 1)); color: var(--ms-muted); font-size: calc(15px * var(--reading-scale, 1)); font-weight: 600; text-align: right; }
  #growthView .gb-line__who { flex: 1; display: block; min-width: 0; margin-left: 4px; }
  #growthView .gb-line__name { display: flex; align-items: center; gap: 5px; color: var(--ms-ink); font-size: calc(16px * var(--reading-scale, 1)); line-height: 1.38; font-weight: 700; }
  #growthView .gb-line__name .gb-magic { flex: none; width: 16px; height: 16px; }
  #growthView .gb-line__goal { display: block; color: var(--ms-muted); font-size: calc(13px * var(--reading-scale, 1)); line-height: 1.4; }
  #growthView .gb-line__num { flex: none; width: min(calc(34px * var(--reading-scale, 1)), 36px); color: var(--ms-ink); font-size: calc(15px * var(--reading-scale, 1)); }
  #growthView .gb-line__num.is-zero { font-weight: 500; }
  #growthView .gb-line__wide { flex: none; display: flex; justify-content: center; width: min(calc(44px * var(--reading-scale, 1)), 50px); }
  #growthView .gb-line__mark { flex: none; display: flex; align-items: center; justify-content: center; width: min(calc(34px * var(--reading-scale, 1)), 36px); height: 22px; }
  #growthView .gb-line__mark::before { content: ""; display: block; box-sizing: border-box; width: 20px; height: 20px; border: 1.5px dashed #8d8a7a; border-radius: 50%; }
  #growthView .gb-line__mark--ok::before {
    width: 22px; height: 22px; border: 0;
    background: var(--ms-green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f7040' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  }
  #growthView .gb-line__mark--draft::before { width: 22px; height: 22px; border: 0; background: var(--ms-coral-soft) radial-gradient(circle, var(--ms-coral) 0 4px, transparent 4.5px); }
  #growthView .gb-line .gb-chev { flex: none; color: #a9a493; }
  /* 글자를 키우면 꺾쇠 자리를 이름에 내줍니다. */
  body[data-reading-step="2"] #growthView .gb-line .gb-chev,
  body[data-reading-step="3"] #growthView .gb-line .gb-chev,
  body[data-reading-step="2"] #growthView .gb-roster__end,
  body[data-reading-step="3"] #growthView .gb-roster__end { display: none; }

  /* 교사: 학급·상태 고르기 시트 */
  #growthView .gb-sheet--pick { gap: 12px; padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
  #growthView .gb-sheet--pick h3 { margin-top: 8px; font-size: calc(19px * var(--reading-scale, 1)); font-weight: 800; letter-spacing: -.03em; }
  #growthView .gb-sheet--pick .gb-postits { margin: 0; }
  #growthView .gb-pick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  #growthView .gb-pick-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 58px; padding: 0; color: var(--ms-ink); font-size: calc(16px * var(--reading-scale, 1)); font-weight: 600; background: #f7f3e9; border: 0; border-radius: 14px; -webkit-tap-highlight-color: transparent; }
  #growthView .gb-pick-cell small { color: var(--ms-green); font-size: calc(12px * var(--reading-scale, 1)); line-height: 1.25; font-weight: 700; }
  #growthView .gb-pick-cell.is-on { color: var(--ms-fill-ink); font-weight: 700; background: var(--ms-fill); }
  #growthView .gb-pick-cell.is-on small { color: var(--ms-fill-ink); }
  #growthView .gb-pick-list { display: grid; }
  #growthView .gb-pick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 0 4px; color: var(--ms-ink); font-size: calc(16px * var(--reading-scale, 1)); font-weight: 600; text-align: left; background: none; border: 0; border-top: 1px solid var(--ms-hair); -webkit-tap-highlight-color: transparent; }
  #growthView .gb-pick-row:first-child { border-top: 0; }
  #growthView .gb-pick-row small { margin-left: auto; color: var(--ms-muted); font-size: calc(15px * var(--reading-scale, 1)); font-weight: 500; }
  #growthView .gb-pick-row.is-on { font-weight: 700; }
  #growthView .gb-pick-row.is-on::after { content: "✓"; color: var(--ms-ink); font-size: 18px; font-weight: 800; }

  /* 교사: 우리 반. 홈의 요약 카드와 같은 모양으로 행특 진행률을 먼저 보여 줍니다. */
  #growthView .gb-class { display: block; }
  #growthView .gb-class__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #growthView .gb-class__sub { margin: 0; color: var(--ms-muted); font-size: calc(14.5px * var(--reading-scale, 1)); line-height: 1.4; }
  #growthView .gb-class__hero { padding: 14px 12px 6px; background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: var(--ms-radius); }
  #growthView .gb-class__hero-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 12px; padding: 0 4px; }
  #growthView .gb-class__hero-label { margin: 0; color: var(--ms-muted); font-size: calc(14px * var(--reading-scale, 1)); line-height: 1.3; font-weight: 600; }
  #growthView .gb-class__hero-num { display: flex; align-items: baseline; gap: 5px; margin: 2px 0 0; white-space: nowrap; }
  #growthView .gb-class__hero-num strong { color: var(--ms-ink); font-size: calc(40px * var(--reading-scale, 1)); line-height: 1.1; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
  #growthView .gb-class__hero-num span { color: var(--ms-muted); font-size: calc(17px * var(--reading-scale, 1)); font-weight: 500; }
  #growthView .gb-class__next {
    flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-left: auto; padding: 0 10px 0 16px; color: var(--ms-action-ink); font-size: calc(15px * var(--reading-scale, 1)); font-weight: 700; white-space: nowrap;
    background: var(--ms-action); border: 0; border-radius: 14px; -webkit-tap-highlight-color: transparent;
  }
  #growthView .gb-class__done { flex: none; color: var(--ms-green); font-size: calc(14px * var(--reading-scale, 1)); font-weight: 700; }
  #growthView .gb-class__bar { height: 6px; margin: 10px 4px 0; overflow: hidden; background: var(--ms-track); border-radius: 3px; }
  #growthView .gb-class__bar i { display: block; height: 100%; background: var(--ms-meter); border-radius: 3px; }
  #growthView .gb-class__cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin-top: 8px; }
  #growthView .gb-class__cells--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #growthView .gb-class__cell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 54px; padding: 2px 0; color: var(--ms-ink); background: none; border: 0; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
  #growthView .gb-class__cell strong { font-size: calc(17px * var(--reading-scale, 1)); line-height: 1.3; font-weight: 800; font-variant-numeric: tabular-nums; }
  #growthView .gb-class__cell span { color: var(--ms-muted); font-size: min(calc(12.5px * var(--reading-scale, 1)), 3.4vw); line-height: 1.3; font-weight: 600; white-space: nowrap; }
  #growthView .gb-class__cell.is-on { color: var(--ms-fill-ink); background: var(--ms-fill); }
  #growthView .gb-class__cell.is-on span { color: var(--ms-fill-soft); }

  #growthView .gb-panel__who { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  #growthView .gb-panel__who h3 { font-size: calc(22px * var(--reading-scale, 1)); font-weight: 800; }
  #growthView .gb-panel__nav { grid-row: 1; grid-column: 2; gap: 0; }
  #growthView .gb-panel__go { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; color: var(--ms-ink); font-size: 18px; background: #f7f3e9; border: 0; border-radius: 12px; }
  #growthView .gb-panel__word { display: none; }
  #growthView .gb-panel__pos { min-width: 50px; font-size: calc(14px * var(--reading-scale, 1)); font-weight: 600; text-align: center; white-space: nowrap; }
  /* 칸이 좁으면 글자를 자르지 않고 다음 줄로 내립니다. */
  #growthView .gb-panel__stats { display: flex; flex-wrap: wrap; gap: 6px; }
  #growthView .gb-panel__stat { flex: 1 1 auto; min-height: 62px; padding: 6px 10px; background: #f7f3e9; border: 0; border-radius: 14px; }
  #growthView .gb-panel__stat:hover { background: #f7f3e9; }
  #growthView .gb-panel__stat strong { font-weight: 800; }
  #growthView .gb-panel__note-head h4 { font-size: calc(16px * var(--reading-scale, 1)); font-weight: 800; letter-spacing: -.03em; }
  #growthView .gb-panel textarea { min-height: 150px; font-size: calc(16px * var(--reading-scale, 1)); line-height: 1.6; }
  #growthView .gb-panel__count { color: var(--ms-muted); font-size: calc(13px * var(--reading-scale, 1)); }
  #growthView .gb-panel .gb-hint { font-size: calc(13px * var(--reading-scale, 1)); }
  #growthView .gb-panel__actions { flex-wrap: nowrap; gap: 8px; }
  #growthView .gb-panel__actions .btn,
  body.sb-theme.curriculum-app.readable-app #growthView .gb-panel__actions .btn:is(.ghost, .secondary) { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: min(calc(15px * var(--reading-scale, 1)), 4vw); }
  #growthView .gb-panel__sketch .gb-magic { flex: none; width: 18px; height: 18px; }
  #growthView .gb-panel__link { display: flex; align-items: center; justify-content: center; gap: 2px; min-height: 44px; padding: 0; color: var(--ms-ink); font-size: calc(15px * var(--reading-scale, 1)); font-weight: 700; background: none; border: 0; }

  #growthView .gb-sheet { padding-top: 10px; background: var(--ms-card); border: 0; border-radius: 24px 24px 0 0; }
  #growthView .gb-sheet__scrim { background: rgba(34, 42, 85, .5); }
  #growthView .gb-sheet__grip { width: 40px; height: 4px; background: #d8d0bd; border-radius: 2px; }
  #growthView .gb-tool__close { background: none; border: 0; box-shadow: none; }
  /* 마법나침반 종류: 칸마다 단추로 보이게 하고, 고른 칸은 채운 색과 작은 별로 표시합니다 */
  #growthView .gb-kinds { gap: 6px; margin-top: 12px; padding: 0; background: none; border: 0; border-radius: 0; }
  #growthView .gb-kind {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 42px; padding: 4px 6px; color: var(--ms-text);
    font-size: calc(14px * var(--reading-scale, 1)); font-weight: 600; line-height: 1.2; background: var(--ms-card); border: 1px solid var(--ms-line); border-radius: 12px; box-shadow: 0 1px 0 var(--ms-line);
  }
  #growthView .gb-sheet .gb-kind { min-height: 44px; }
  #growthView .gb-kind > span { white-space: nowrap; }
  #growthView .gb-kind__icon { flex: none; color: var(--ms-muted); }
  #growthView .gb-kind:not(.is-on):hover { color: var(--ms-ink); background: var(--ms-soft); }
  #growthView .gb-kind.is-on,
  #growthView .gb-kind.is-on:hover { color: var(--ms-fill-ink); font-weight: 700; background: var(--ms-fill); border-color: var(--ms-fill-line); box-shadow: 0 1px 0 var(--ms-fill-line); }
  #growthView .gb-kind.is-on .gb-kind__icon { color: inherit; }
  #growthView .gb-kind.is-on::after {
    content: ""; position: absolute; top: 4px; right: 5px; width: 9px; height: 9px; background: var(--ms-spark);
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  }
  /* 설명이 한 줄이든 두 줄이든 칸 높이가 같아야 종류를 바꿔도 아래가 움직이지 않습니다 */
  #growthView .gb-tool__desc { display: flex; align-items: center; min-height: 2.9em; margin: 8px 0 0; padding: 0 4px; color: var(--ms-muted); font-size: calc(13px * var(--reading-scale, 1)); font-weight: 600; line-height: 1.45; word-break: keep-all; }
  #growthView .gb-tool__bar { background: var(--ms-track); border: 0; }
  #growthView .gb-tool__bar i { background: var(--sb-violet, #7d6bc7); }
  #growthView .gb-tool__inputs { background: #f7f3e9; border: 0; border-radius: 12px; }
  #growthView .gb-tool__pick select { border: 1px solid var(--ms-line); }

  /* 분석 결과 창 */
  body.sb-theme #growthAiModal { background: rgba(34, 42, 85, .5); backdrop-filter: none; }
  body.sb-theme #growthAiModal .modal-panel { background: var(--ms-card); border: 0; border-radius: 20px; box-shadow: none; }
  body.sb-theme #growthAiModal .modal-panel::before { display: none; }
  body.sb-theme #growthAiModal .modal-head { background: none; border-bottom: 1px solid var(--ms-hair); border-radius: 20px 20px 0 0; }
  body.sb-theme.curriculum-app.readable-app #growthAiModal .modal-head .btn { min-height: 40px; padding: 2px 8px; color: var(--ms-ink) !important; background: none !important; border: 0 !important; border-radius: 12px; box-shadow: none !important; }
  #growthAiModal .gb-modal-titles span { color: var(--ms-muted); font-weight: 600; }
  #growthAiModal .gb-modal-tabs { background: var(--ms-track); border: 0; border-radius: 12px; }
  #growthAiModal .gb-modal-tab { color: var(--ms-muted); font-weight: 600; border-radius: 9px; }
  #growthAiModal .gb-modal-tab.is-on { color: var(--ms-ink); font-weight: 700; background: var(--ms-card); }
  #growthAiModal .gb-result,
  #growthAiModal .gb-result:nth-child(n) { background: none; border: 1px solid var(--ms-line); border-radius: 14px; }
  #growthAiModal .gb-note,
  #growthAiModal .gb-caution,
  #growthAiModal .gb-example { border-width: 1px; border-style: solid; border-radius: 14px; }
  #growthAiModal .gb-modal-foot { border-top: 1px solid var(--ms-hair); }
}

/* ── 휴대폰 배치: 아래 탭바, 시트, 머리말 ── */
@media screen and (max-width: 650px) {
  /* 교사: 탭이 셋이면 글자를 줄여 한 줄에 둡니다. 내 교과의 과목·반은 줄마다 옆으로 밀어 봅니다. */
  #growthView .gb-scope__tabs--three { gap: clamp(10px, 3.6vw, 14px); }
  #growthView .gb-scope__tabs--three .gb-scope__tab { font-size: min(calc(22px * var(--reading-scale, 1)), 5.6vw); }
  #growthView .gb-course-pick__list { flex: 1; flex-wrap: nowrap; margin-right: -20px; padding-right: 20px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #growthView .gb-course-pick__list::-webkit-scrollbar { display: none; }
  body.sb-theme.curriculum-app.readable-app {
    font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
    letter-spacing: -.02em;
  }
  body.sb-theme.curriculum-app.readable-app.phone-app-open { padding-bottom: calc(var(--ms-tabbar) + env(safe-area-inset-bottom, 0px)); }
  body.sb-theme.curriculum-app.readable-app #app.page { width: 100%; box-sizing: border-box; margin: 0 auto; padding: 0 20px 24px; }
  body.sb-theme.curriculum-app.readable-app.phone-sheet-open { overflow: hidden; }

  body.sb-theme.curriculum-app.readable-app .app-topbar {
    position: static; display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 60px; margin: 0 -8px 0 0; padding: 0; color: inherit;
    background: none; border: 0; border-radius: 0; box-shadow: none; clip-path: none; transform: none; animation: none;
  }
  body.sb-theme.curriculum-app.readable-app .app-topbar:hover { background: none; }
  body.sb-theme.curriculum-app.readable-app .app-topbar::before,
  body.sb-theme.curriculum-app.readable-app .app-topbar::after { display: none; }
  body.sb-theme.curriculum-app.readable-app .app-brand .app-logo.sb-app-logo { flex: none; width: 32px !important; height: 32px !important; }
  body.sb-theme.curriculum-app.readable-app .app-title { width: 132px; margin: 0; }
  /* ── 아래 탭바 ── */
  body.sb-theme.curriculum-app.readable-app .app-navigation {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; order: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; width: auto;
    height: calc(var(--ms-tabbar) + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; margin: 0;
    padding: 0 max(4px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
    background: var(--ms-card); border-top: 1px solid var(--ms-line);
  }
  body.sb-theme.curriculum-app.readable-app .app-navigation button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-width: 0; min-height: 0; margin: 0; padding: 8px 0 0; color: var(--ms-muted);
    font-size: calc(13px * var(--reading-scale, 1)); font-weight: 600; line-height: 1.2; letter-spacing: -.03em; text-align: center; white-space: nowrap;
    background: none; border: 0; border-radius: 0; box-shadow: none; transform: none; -webkit-tap-highlight-color: transparent;
  }
  body.sb-theme.curriculum-app.readable-app .app-navigation button:is(:hover, :active) { color: var(--ms-muted); background: none; box-shadow: none; transform: none; }
  body.sb-theme.curriculum-app.readable-app .app-navigation button[aria-current],
  body.sb-theme.curriculum-app.readable-app .app-navigation button[aria-current]:is(:hover, :active) { color: var(--ms-ink); font-weight: 700; background: none; box-shadow: none; }
  body.sb-theme.curriculum-app.readable-app .app-navigation button[aria-current]::before {
    content: ""; position: absolute; top: -1px; left: 50%; width: 22px; height: 7px; margin-left: -11px;
    background: var(--sb-red, #e0533d); clip-path: polygon(0 0, 100% 0, 50% 100%);
  }
  /* 글을 쓰는 동안에는 키보드 위로 올라온 탭바가 입력칸과 등록 단추를 가리지 않게 숨깁니다. */
  #app:has(:is(textarea, input:not([type="checkbox"]):not([type="radio"])):focus) .app-navigation { display: none; }
  /* 긴 이름의 앞뒤 낱말은 화면에서만 빼고, 화면 읽기에는 전체 이름을 그대로 남깁니다. */
  body.sb-theme.curriculum-app.readable-app .app-nav-extra {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }

  /* ── 내 정보 시트: 머리말의 단추 묶음을 그대로 아래에서 올립니다 ── */
  body.sb-theme.curriculum-app.readable-app .app-utilities {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 19; display: none; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 0;
    width: auto; max-height: 86vh; max-height: 86dvh; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
    padding: 28px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    color: var(--ms-ink); background: var(--ms-card); border-radius: 24px 24px 0 0;
  }
  body.sb-theme.curriculum-app.readable-app.phone-sheet-open .app-utilities { display: flex; animation: msSheetIn .2s ease-out; }
  body.sb-theme.curriculum-app.readable-app .app-utilities::before {
    content: ""; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; background: #d8d0bd; border-radius: 2px;
  }
  body.phone-sheet-open .phone-sheet-scrim {
    position: fixed; inset: 0; z-index: 18; display: block; width: 100%; height: 100%; padding: 0;
    background: rgba(34, 42, 85, .5); border: 0; -webkit-tap-highlight-color: transparent;
  }
  /* 탭바 위로 올라오는 알림 */
  body.phone-app-open .install-toast { bottom: calc(var(--ms-tabbar) + 14px + env(safe-area-inset-bottom, 0px)); }

  /* 교사: 학생 패널은 바텀시트로 올라옵니다. */
  #growthView .gb-class__side { flex-direction: column; justify-content: flex-end; bottom: var(--gb-keyboard, 0px); }
  #growthView .gb-class__scrim { background: rgba(34, 42, 85, .5); }
  #growthView .gb-class__side.is-entering .gb-panel { animation: msSheetIn .2s ease-out; }
  #growthView .gb-panel,
  #growthView .gb-card.gb-panel {
    gap: 12px; width: 100%; height: auto; max-height: 90vh; max-height: min(90dvh, 100%); padding: 10px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    background: var(--ms-card); border: 0; border-radius: 24px 24px 0 0; box-shadow: none;
  }
  #growthView .gb-panel .gb-sheet__grip { display: block; justify-self: center; width: 40px; height: 4px; background: #d8d0bd; border-radius: 2px; }
  /* 마법나침반: 탭바 위에 띄웁니다. */
  #growthView .gb-fab { right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(var(--ms-tabbar) + 12px + env(safe-area-inset-bottom, 0px)); }
  #growthView .gb-fab__btn { width: 64px; height: 64px; }
  #growthView .gb-fab__btn .gb-magic { width: 64px; height: 64px; filter: drop-shadow(0 4px 10px rgba(44, 53, 102, .26)); }
  #growthView .gb-fab__chip { padding: 7px 12px; font-weight: 700; border-radius: 13px; box-shadow: none; }
  #growthView .gb-panel__head { grid-template-columns: minmax(0, 1fr) auto 44px; gap: 2px; }
  #growthView .gb-panel__close { grid-column: 3; width: 44px; height: 44px; background: none; border: 0; box-shadow: none; color: var(--ms-muted); }
}

/* 다섯 종류가 세 칸씩 놓이는 작은 휴대폰에서는 이름이 잘리지 않게 그림을 뺍니다 */
@media screen and (max-width: 400px) {
  #growthView .gb-kinds--two .gb-kind__icon { display: none; }
}

@media screen and (max-width: 359px) {
  body.sb-theme .student-dashboard.curriculum-board .board-summary-status strong { grid-row: 6; grid-column: 1 / -1; justify-self: start; margin-top: 10px; }
}

@media screen and (max-width: 650px) and (prefers-reduced-motion: reduce) {
  body.sb-theme.curriculum-app.readable-app.phone-sheet-open .app-utilities { animation: none; }
}

@keyframes msSheetIn { from { opacity: .6; transform: translateY(28px); } }
