/* 마스터클래스 앱 — css/style.css 토큰(색상·폰트·radius)을 그대로 이어받아 사용.
   반드시 css/style.css 뒤에 로드할 것. */

.app-shell {
  min-height: 100vh;
  background: var(--color-bg);
  padding: 32px 20px 80px;
}

.app-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.app-topbar .app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 15px;
}
.app-topbar .app-logo img { width: 30px; height: 30px; border-radius: 8px; }

.app-topbar .app-signout {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.app-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
}

.app-card h1 { font-size: 22px; color: var(--color-secondary); margin: 0 0 8px; }
.app-card h2 { font-size: 17px; color: var(--color-secondary); margin: 0 0 6px; }
.app-card p.app-desc { color: var(--color-text-muted); font-size: 14px; margin: 0 0 18px; line-height: 1.6; }

.app-week-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.app-week-nav a {
  display: block;
  text-align: center;
  padding: 14px 6px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text);
  font-size: 12.5px;
  font-weight: 700;
}
.app-week-nav a .wk-num { display: block; font-size: 18px; color: var(--color-primary); margin-bottom: 2px; }
.app-week-nav a.is-done { background: var(--color-bg-alt); border-color: var(--color-primary); }
.app-week-nav a.is-done .wk-num::after { content: " ✓"; color: var(--color-primary); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--color-secondary); margin-bottom: 6px; }
.field input[type="text"],
.field input[type="number"],
.field input[type="month"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
}
.field textarea { min-height: 84px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 5px; }

.app-btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  background: var(--gradient-brand);
  color: #fff;
}
.app-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.app-btn.app-btn-ghost { background: none; border: 1.5px solid var(--color-border); color: var(--color-secondary); }
.app-btn.app-btn-kakao {
  background: #FEE500;
  color: #191600;
  width: 100%;
  padding: 14px 20px;
  font-size: 15.5px;
}

.app-subhead {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 22px 0 6px;
}
.app-subhead:first-of-type { margin-top: 4px; }

.app-list { list-style: none; margin: 0 0 18px; padding: 0; }
.app-list li.group-head {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  margin-top: 8px;
  border-bottom: none;
  background: var(--color-bg-alt);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-secondary);
}
.app-list li.group-head:first-child { margin-top: 0; }
.app-list li.app-empty { color: var(--color-text-muted); font-size: 13px; padding: 10px 0; }
.app-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}
.app-list li:last-child { border-bottom: none; }
.app-list .item-name { color: var(--color-text); }
.app-list .item-cat { color: var(--color-text-muted); font-size: 12px; display: block; }
.app-list .item-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-list .item-amount.is-liability { color: var(--color-primary-dark); }
.app-list .item-del { background: none; border: none; color: var(--color-text-muted); cursor: pointer; font-size: 12px; text-decoration: underline; }

.app-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 20px;
}
.app-totals .tot {
  background: var(--color-bg-alt);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.app-totals .tot .tot-label { display: block; font-size: 11.5px; color: var(--color-text-muted); margin-bottom: 4px; }
.app-totals .tot .tot-value { font-size: 17px; font-weight: 800; color: var(--color-secondary); font-variant-numeric: tabular-nums; }

.app-badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--color-bg-alt); color: var(--color-primary-dark); }
.app-badge.is-submitted { background: var(--color-secondary); color: #fff; }

.app-note { font-size: 12.5px; color: var(--color-text-muted); background: var(--color-bg-alt); border-radius: 10px; padding: 10px 14px; margin: 10px 0 0; line-height: 1.6; }

.app-error { color: #B3261E; font-size: 13px; margin-top: 8px; }
.app-success { color: var(--color-primary-dark); font-size: 13px; margin-top: 8px; }

/* 워크북 — 리커트 척도 문항 */
.likert-item { padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.likert-item:last-child { border-bottom: none; }
.likert-item .likert-text { font-size: 14px; color: var(--color-text); margin-bottom: 10px; line-height: 1.5; }
.likert-scale { display: flex; gap: 6px; justify-content: space-between; }
.likert-scale label {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; border: 1.5px solid var(--color-border); border-radius: 10px;
  cursor: pointer; font-size: 11px; color: var(--color-text-muted);
}
.likert-scale input { margin: 0; }
.likert-scale label.is-checked { border-color: var(--color-primary); background: var(--color-bg-alt); color: var(--color-secondary); font-weight: 700; }
.likert-axis-head { font-size: 13.5px; font-weight: 800; color: var(--color-secondary); margin: 18px 0 4px; }
.likert-axis-head:first-child { margin-top: 0; }

/* 워크북 — 결과 스코어 배지 */
.score-result { margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--color-bg-alt); }
.score-result .score-num { font-size: 26px; font-weight: 800; color: var(--color-secondary); }
.score-result .score-band { font-size: 13.5px; font-weight: 700; color: var(--color-primary-dark); margin-top: 2px; }
.score-result .score-desc { font-size: 12.5px; color: var(--color-text-muted); margin-top: 6px; line-height: 1.6; }

/* 워크북 — 입력 표 */
.app-table-wrap { overflow-x: auto; margin: 10px 0 16px; }
.app-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.app-table th, .app-table td { border: 1px solid var(--color-border); padding: 7px 8px; text-align: center; }
.app-table th { background: var(--color-bg-alt); font-weight: 700; color: var(--color-secondary); white-space: nowrap; }
.app-table td:first-child, .app-table th:first-child { text-align: left; white-space: nowrap; }
.app-table input[type="number"] { width: 78px; box-sizing: border-box; border: 1.5px solid var(--color-border); border-radius: 6px; padding: 5px 6px; font-size: 12.5px; text-align: right; }
.app-table .computed { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.app-table .score-cell { font-weight: 700; }
.app-table .score-cell.is-full { color: var(--color-primary-dark); }
.app-table .score-cell.is-zero { color: #B3261E; }

.track-toggle { display: flex; gap: 8px; margin: 6px 0 14px; }
.track-toggle label {
  flex: 1; text-align: center; padding: 9px; border: 1.5px solid var(--color-border);
  border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--color-text-muted);
}
.track-toggle label.is-checked { border-color: var(--color-primary); background: var(--color-bg-alt); color: var(--color-secondary); }
.track-toggle input { display: none; }

.radar-wrap { display: flex; justify-content: center; margin: 12px 0; }
.radar-wrap svg { max-width: 280px; width: 100%; height: auto; }

/* 워크북 — 체크리스트 */
.checklist-group { margin: 16px 0; }
.checklist-group-title { font-size: 13px; font-weight: 800; color: var(--color-secondary); margin-bottom: 6px; }
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--color-text); cursor: pointer; line-height: 1.5; }
.checklist-item input { margin-top: 3px; flex-shrink: 0; }
.checklist-progress { font-size: 13px; font-weight: 700; color: var(--color-primary-dark); margin: 6px 0 4px; }

.app-table tr.is-my-grade td { background: var(--color-bg-alt); font-weight: 700; color: var(--color-secondary); }
.app-table input[type="text"] { width: 100%; box-sizing: border-box; border: 1.5px solid var(--color-border); border-radius: 6px; padding: 5px 6px; font-size: 12.5px; }

@media (max-width: 520px) {
  .app-week-nav { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .app-totals { grid-template-columns: 1fr; }
  .likert-scale label { font-size: 10px; padding: 6px 2px; }
}
