/* =========================================================
   겨울신록에듀 — 사이버 입학원서 (태블릿 최적화)
   iPad 768~1180px 우선 / 세로·가로 모두 대응 / 터치 최소 56px
   ========================================================= */

.apply-body {
  --ap-radius: 18px;
  --ap-gap: 22px;
  --ap-touch: 58px;
  background: #f2f7fa;
  color: var(--ink);
  font-family: var(--font-sans, 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: 108px;
  margin: 0;
  min-height: 100vh;
}

.apply-body * { box-sizing: border-box; }

/* ---------------- 상단 바 ---------------- */
.ap-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: #061620;
  color: #fff;
  padding-top: max(12px, env(safe-area-inset-top));
}

.ap-brand { display: flex; align-items: center; }
.ap-brand img { height: 32px; width: auto; display: block; }

.ap-topbar-right { display: flex; align-items: center; gap: 14px; }

.ap-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  background: rgba(17, 178, 234, 0.18);
  border: 1px solid rgba(17, 178, 234, 0.4);
  font-size: 13px;
  color: #bfe8f8;
}
.ap-code-pill strong { color: #fff; letter-spacing: 0.04em; }

.ap-help {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #cfe6f0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.ap-help svg { width: 17px; height: 17px; }

/* ---------------- 진행 표시 ---------------- */
.ap-progress-wrap {
  position: sticky;
  top: 56px;
  z-index: 35;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 28px 10px;
}

.ap-progress {
  height: 5px;
  border-radius: 100px;
  background: #e3edf2;
  overflow: hidden;
}
.ap-progress-bar {
  height: 100%;
  width: 16.6%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--glacier), var(--deep));
  transition: width 0.35s var(--ease, ease);
}

.ap-steps {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ap-steps::-webkit-scrollbar { display: none; }

.ap-step {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 100px;
  white-space: nowrap;
  color: var(--ink-300, #8aa2b0);
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.25s var(--ease, ease);
}
.ap-step-num {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #e3edf2;
  color: #7b95a3;
  font-size: 11.5px;
  font-weight: 800;
}
.ap-step.active { color: var(--deep); background: var(--paper-3, #eef6f9); }
.ap-step.active .ap-step-num { background: var(--glacier); color: #fff; }
.ap-step.done .ap-step-num { background: #1f7a44; color: #fff; }
.ap-step.done { color: #1f7a44; }

/* ---------------- 본문 ---------------- */
.ap-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 30px 28px 40px;
}

.ap-panel { display: none; animation: apFade 0.3s ease; }
.ap-panel.active { display: block; }

@keyframes apFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.ap-panel-head { margin-bottom: 28px; }
.ap-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--glacier);
  margin-bottom: 10px;
}
.ap-panel-head h1 {
  font-size: clamp(25px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.28;
  margin: 0 0 10px;
}
.ap-panel-head p {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-500, #5b7482);
  margin: 0;
  max-width: 720px;
}
.ap-panel-head p strong { color: var(--ink-700); }

/* ---------------- 과정 선택 카드 ---------------- */
.ap-program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.ap-program-card { position: relative; cursor: pointer; }
.ap-program-card input { position: absolute; opacity: 0; pointer-events: none; }

.ap-program-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 168px;
  padding: 24px 22px;
  border-radius: var(--ap-radius);
  border: 2px solid var(--line);
  background: #fff;
  transition: all 0.22s var(--ease, ease);
  position: relative;
}

.ap-program-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--paper-3, #eef6f9);
  color: var(--deep);
  margin-bottom: 4px;
}
.ap-program-icon svg { width: 24px; height: 24px; }

.ap-program-inner strong { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.ap-program-inner em {
  font-style: normal;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-400, #7b95a3);
}

.ap-program-check {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all 0.2s ease;
}
.ap-program-check svg { width: 15px; height: 15px; }

.ap-program-card input:checked + .ap-program-inner {
  border-color: var(--glacier);
  box-shadow: 0 10px 30px -12px rgba(17, 178, 234, 0.5);
  background: linear-gradient(180deg, #f7fdff 0%, #fff 100%);
}
.ap-program-card input:checked + .ap-program-inner .ap-program-check {
  background: var(--glacier);
  border-color: var(--glacier);
  color: #fff;
}
.ap-program-card input:focus-visible + .ap-program-inner {
  outline: 3px solid rgba(17, 178, 234, 0.4);
  outline-offset: 3px;
}

/* ---------------- 필드 공통 ---------------- */
.ap-field { margin-bottom: 24px; }
.ap-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
}
.ap-col-span { grid-column: 1 / -1; }

.ap-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink-800, #16303d);
  margin-bottom: 10px;
}
.ap-req { color: #d9534f; font-weight: 800; }

.ap-input,
.ap-textarea {
  width: 100%;
  min-height: var(--ap-touch);
  padding: 15px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 17px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.ap-textarea { min-height: 120px; line-height: 1.7; resize: vertical; padding-top: 16px; }
.ap-input:focus,
.ap-textarea:focus {
  outline: none;
  border-color: var(--glacier);
  box-shadow: 0 0 0 4px rgba(17, 178, 234, 0.14);
}
.ap-input::placeholder,
.ap-textarea::placeholder { color: #a9bcc7; }

.ap-value-badge {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--paper-3, #eef6f9);
  color: var(--deep);
  font-size: 13px;
  font-weight: 800;
}

/* 칩(라디오) */
.ap-chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-chip { position: relative; cursor: pointer; }
.ap-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ap-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-600, #3c5a68);
  transition: all 0.18s ease;
}
.ap-chip input:checked + span {
  border-color: var(--glacier);
  background: var(--paper-3, #eef6f9);
  color: var(--deep);
  box-shadow: inset 0 0 0 1px var(--glacier);
}
.ap-chip input:focus-visible + span { outline: 3px solid rgba(17, 178, 234, 0.4); }

/* 슬라이더 */
.ap-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--glacier) 0%, var(--glacier) 37%, #e3edf2 37%);
  outline: none;
  margin: 10px 0 6px;
}
.ap-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--glacier);
  box-shadow: 0 4px 14px rgba(6, 22, 32, 0.18);
  cursor: pointer;
}
.ap-range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--glacier);
  cursor: pointer;
}
.ap-range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-300, #8aa2b0);
  font-weight: 600;
}

/* ---------------- LMCT 영역 ---------------- */
.ap-dim {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--ap-radius);
  padding: 22px 24px 10px;
  margin-bottom: 20px;
}

.ap-dim-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft, #eef3f6);
  margin-bottom: 6px;
}
.ap-dim-no {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 900;
  color: var(--glacier);
  letter-spacing: 0.06em;
  padding-top: 3px;
}
.ap-dim-head h2 { font-size: 18.5px; font-weight: 800; margin: 0 0 3px; letter-spacing: -0.02em; }
.ap-dim-head p { font-size: 13.5px; color: var(--ink-400, #7b95a3); margin: 0; line-height: 1.55; }
.ap-dim-count {
  margin-left: auto;
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 100px;
  background: #f2f7fa;
  color: var(--ink-400, #7b95a3);
  font-size: 12.5px;
  font-weight: 800;
}
.ap-dim-count.done { background: #e6f5ea; color: #1f7a44; }

.ap-q { padding: 18px 0; border-bottom: 1px solid var(--line-soft, #eef3f6); }
.ap-q:last-child { border-bottom: 0; }

.ap-q-text {
  display: flex;
  gap: 11px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink-800, #16303d);
  margin-bottom: 14px;
}
.ap-q-no {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: var(--paper-3, #eef6f9);
  color: var(--deep);
  font-size: 12.5px;
  font-weight: 800;
  margin-top: 1px;
}

/* 리커트 5점 */
.ap-likert {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.ap-likert-item {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 4px 10px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  transition: all 0.18s ease;
}
.ap-likert-item:hover { background: #f7fbfd; }
.ap-likert-item input { position: absolute; opacity: 0; pointer-events: none; }

.ap-likert-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #d3e2ea;
  background: #fff;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}
.ap-likert-dot::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.18s ease;
}
.ap-likert-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-300, #8aa2b0);
  text-align: center;
  line-height: 1.3;
  word-break: keep-all;
}

.ap-likert-item input:checked ~ .ap-likert-dot {
  border-color: var(--glacier);
  background: var(--paper-3, #eef6f9);
}
.ap-likert-item input:checked ~ .ap-likert-dot::after { background: var(--glacier); }
.ap-likert-item input:checked ~ .ap-likert-label { color: var(--deep); }
.ap-likert-item input:checked ~ .ap-likert-dot { transform: scale(1.06); }
.ap-likert-item:has(input:checked) {
  background: #f7fdff;
  border-color: rgba(17, 178, 234, 0.35);
}
.ap-likert-item input:focus-visible ~ .ap-likert-dot {
  outline: 3px solid rgba(17, 178, 234, 0.4);
  outline-offset: 3px;
}

/* ---------------- 통사·통과 ---------------- */
.ap-scale-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 22px;
}
.ap-scale-tag {
  padding: 8px 15px;
  border-radius: 100px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-500, #5b7482);
}
.ap-scale-tag strong { color: var(--deep); }

.ap-q-choice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--ap-radius);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.ap-subject-tag {
  display: inline-block;
  padding: 3px 9px;
  margin-right: 8px;
  border-radius: 6px;
  background: #eef6f9;
  color: var(--deep);
  font-size: 11.5px;
  font-weight: 800;
  vertical-align: 2px;
}
.ap-subject-tag.sci { background: #eaf6ee; color: #1f7a44; }

.ap-options { display: grid; gap: 9px; }
.ap-option {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 56px;
  padding: 15px 18px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: #fff;
  transition: all 0.16s ease;
}
.ap-option input { position: absolute; opacity: 0; pointer-events: none; }
.ap-option-mark {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-300, #8aa2b0);
  line-height: 1.45;
}
.ap-option-text { font-size: 15.5px; line-height: 1.6; color: var(--ink-700, #23414f); }

.ap-option:hover { border-color: #c3dbe7; background: #fafdfe; }
.ap-option input:checked ~ .ap-option-mark { color: var(--glacier); }
.ap-option:has(input:checked) {
  border-color: var(--glacier);
  background: #f7fdff;
  box-shadow: inset 0 0 0 1px var(--glacier);
}
.ap-option input:focus-visible ~ .ap-option-text { text-decoration: underline; }

/* ---------------- 요약 / 동의 / 제출 ---------------- */
.ap-summary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--ap-radius);
  padding: 6px 24px;
  margin-bottom: 24px;
}
.ap-sum-row {
  display: flex;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft, #eef3f6);
  font-size: 15px;
}
.ap-sum-row:last-child { border-bottom: 0; }
.ap-sum-row dt {
  flex: 0 0 128px;
  font-weight: 800;
  color: var(--ink-400, #7b95a3);
  font-size: 13.5px;
  padding-top: 1px;
}
.ap-sum-row dd { margin: 0; flex: 1; color: var(--ink-800, #16303d); font-weight: 600; line-height: 1.6; }
.ap-sum-row dd.muted { color: var(--ink-300, #8aa2b0); font-weight: 500; }
.ap-sum-sec {
  padding: 18px 0 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--glacier);
}

.ap-consent { margin-bottom: 22px; }
.ap-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  border-radius: var(--ap-radius);
  border: 1.5px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.ap-consent-row input { position: absolute; opacity: 0; pointer-events: none; }
.ap-consent-box {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 2px solid #cbdde6;
  display: grid;
  place-items: center;
  color: transparent;
  background: #fff;
  transition: all 0.18s ease;
  margin-top: 2px;
}
.ap-consent-box svg { width: 17px; height: 17px; }
.ap-consent-row input:checked ~ .ap-consent-box {
  background: var(--glacier);
  border-color: var(--glacier);
  color: #fff;
}
.ap-consent-text { display: flex; flex-direction: column; gap: 5px; }
.ap-consent-text strong { font-size: 15.5px; font-weight: 800; color: var(--ink-800, #16303d); }
.ap-consent-text em {
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-400, #7b95a3);
}

.ap-error {
  padding: 15px 18px;
  border-radius: 13px;
  background: #fdf0ef;
  border: 1px solid #f3c9c5;
  color: #a93b34;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 18px;
}

.ap-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--glacier) 0%, var(--deep) 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 14px 34px -12px rgba(17, 178, 234, 0.6);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.ap-submit svg { width: 21px; height: 21px; }
.ap-submit:active { transform: scale(0.99); }
.ap-submit:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.ap-submit-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-300, #8aa2b0);
  margin: 14px 0 0;
}

/* ---------------- 하단 고정 내비 ---------------- */
.ap-bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px -18px rgba(6, 22, 32, 0.3);
}
.ap-bottomnav[hidden] { display: none; }

.ap-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  min-height: var(--ap-touch);
  padding: 0 26px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-700, #23414f);
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
}
.ap-nav-btn svg { width: 18px; height: 18px; }
.ap-nav-btn svg.flip { transform: rotate(180deg); }
.ap-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ap-nav-btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--glacier), var(--deep));
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(17, 178, 234, 0.7);
}

.ap-nav-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.ap-nav-progress { font-size: 13px; font-weight: 900; color: var(--deep); }
.ap-nav-hint {
  font-size: 12.5px;
  color: var(--ink-300, #8aa2b0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------------- 결과 화면 ---------------- */
.ap-result { display: none; animation: apFade 0.4s ease; }
.ap-result.active { display: block; }

.ap-result-hero {
  text-align: center;
  padding: 20px 0 34px;
}
.ap-result-hero h1 {
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 8px 0 12px;
}
.ap-result-hero p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-500, #5b7482);
  max-width: 700px;
  margin: 0 auto;
}
.ap-result-code {
  display: inline-block;
  margin-top: 18px;
  padding: 9px 20px;
  border-radius: 100px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-400, #7b95a3);
}
.ap-result-code strong { color: var(--deep); letter-spacing: 0.06em; font-size: 15px; }

.ap-score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.ap-score-card {
  padding: 26px 24px;
  border-radius: var(--ap-radius);
  background: #fff;
  border: 2px solid var(--line);
}
.ap-score-card.lmct { border-color: rgba(17, 178, 234, 0.4); background: linear-gradient(180deg, #f7fdff, #fff); }
.ap-score-card.tt { border-color: rgba(31, 122, 68, 0.32); background: linear-gradient(180deg, #f6fbf7, #fff); }

.ap-score-label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400, #7b95a3);
  margin-bottom: 8px;
}
.ap-score-value { display: flex; align-items: baseline; gap: 4px; }
.ap-score-value strong {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--deep);
}
.ap-score-card.tt .ap-score-value strong { color: #1f7a44; }
.ap-score-value span { font-size: 17px; font-weight: 700; color: var(--ink-300, #8aa2b0); }
.ap-score-level { margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--ink-500, #5b7482); }

.ap-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.ap-chart {
  margin: 0;
  padding: 20px;
  border-radius: var(--ap-radius);
  background: #fff;
  border: 1px solid var(--line);
}
.ap-chart figcaption {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-600, #3c5a68);
  margin-bottom: 12px;
}
.ap-canvas-box { position: relative; height: 250px; }

.ap-reco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.ap-reco {
  padding: 22px;
  border-radius: var(--ap-radius);
  background: #fff;
  border: 1px solid var(--line);
}
.ap-reco-label {
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--glacier);
  margin-bottom: 8px;
}
.ap-reco strong { display: block; font-size: 17px; font-weight: 800; margin-bottom: 7px; letter-spacing: -0.02em; }
.ap-reco p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--ink-400, #7b95a3); }

.ap-detail-block {
  padding: 26px 24px;
  border-radius: var(--ap-radius);
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 22px;
}
.ap-detail-block h2 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

.ap-bar-list { display: grid; gap: 14px; }
.ap-bar-item { display: grid; grid-template-columns: 132px 1fr 54px; align-items: center; gap: 14px; }
.ap-bar-name { font-size: 14px; font-weight: 700; color: var(--ink-700, #23414f); }
.ap-bar-track {
  height: 12px;
  border-radius: 100px;
  background: #eef4f7;
  overflow: hidden;
}
.ap-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--glacier), var(--deep));
  transition: width 0.6s var(--ease, ease);
}
.ap-bar-fill.low { background: linear-gradient(90deg, #e8a33d, #c9821e); }
.ap-bar-fill.vlow { background: linear-gradient(90deg, #d4695f, #b23c3c); }
.ap-bar-fill.good { background: linear-gradient(90deg, #45b06a, #1f7a44); }
.ap-bar-score { font-size: 14px; font-weight: 900; color: var(--deep); text-align: right; }

.ap-prescription { display: grid; gap: 14px; }
.ap-presc-item {
  padding: 18px 20px;
  border-radius: 14px;
  background: #f7fbfd;
  border: 1px solid #e4eff5;
}
.ap-presc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}
.ap-presc-head strong { font-size: 15px; font-weight: 800; }
.ap-presc-score {
  margin-left: auto;
  padding: 3px 11px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-500, #5b7482);
}
.ap-presc-item p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-500, #5b7482); }

.ap-result-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 1;
  min-height: 60px;
  border-radius: 15px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-700, #23414f);
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
}
.ap-btn svg { width: 19px; height: 19px; }
.ap-btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--glacier), var(--deep));
  color: #fff;
  box-shadow: 0 12px 28px -14px rgba(17, 178, 234, 0.7);
}
.ap-btn-ghost { background: #fff; }

.ap-result-foot {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-300, #8aa2b0);
  margin: 18px 0 0;
  line-height: 1.7;
}

/* ---------------- 토스트 ---------------- */
.ap-toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translate(-50%, 20px);
  z-index: 60;
  max-width: min(560px, calc(100vw - 48px));
  padding: 15px 24px;
  border-radius: 14px;
  background: rgba(6, 22, 32, 0.94);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.26s var(--ease, ease);
}
.ap-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ap-toast.error { background: rgba(178, 60, 60, 0.96); }

/* ---------------- 반응형 ---------------- */
/* 태블릿 세로 이하 */
@media (max-width: 900px) {
  .ap-topbar { padding: 10px 18px; }
  .ap-progress-wrap { top: 52px; padding: 10px 18px 8px; }
  .ap-main { padding: 24px 18px 32px; }
  .ap-grid-2 { grid-template-columns: 1fr; }
  .ap-col-span { grid-column: auto; }
  .ap-program-grid { grid-template-columns: 1fr; }
  .ap-program-inner { min-height: auto; padding: 20px; }
  .ap-chart-grid { grid-template-columns: 1fr; }
  .ap-score-grid { gap: 12px; }
  .ap-score-value strong { font-size: 42px; }
  .ap-bottomnav { padding: 12px 18px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .ap-nav-btn { min-width: 104px; padding: 0 18px; font-size: 15px; }
  .ap-nav-mid { display: none; }
  .ap-dim { padding: 18px 16px 6px; }
  .ap-q-choice { padding: 18px 16px; }
  .ap-likert { gap: 4px; }
  .ap-likert-label { font-size: 10px; }
  .ap-likert-dot { width: 26px; height: 26px; }
  .ap-bar-item { grid-template-columns: 96px 1fr 44px; gap: 10px; }
  .ap-bar-name { font-size: 12.5px; }
  .ap-sum-row { flex-direction: column; gap: 4px; }
  .ap-sum-row dt { flex: none; }
  .ap-result-actions { flex-direction: column; }
  .ap-code-pill { display: none; }
  .ap-help span { display: none; }
}

/* 소형 화면 */
@media (max-width: 560px) {
  .ap-steps { display: none; }
  .ap-result { padding: 0; }
  .ap-score-grid { grid-template-columns: 1fr; }
  .ap-likert-label { display: none; }
  .ap-likert { gap: 8px; }
  .ap-likert-dot { width: 32px; height: 32px; }
  .ap-likert-item { padding: 10px 0; }
}

/* 가로 모드 태블릿: 좌우 여백 확보 */
@media (min-width: 1024px) and (orientation: landscape) {
  .ap-main { max-width: 1100px; }
}

@media (min-width: 1180px) {
  .ap-main { padding-top: 40px; }
  .ap-canvas-box { height: 280px; }
}

/* 인쇄 (결과지 PDF 저장) */
@media print {
  .ap-topbar,
  .ap-progress-wrap,
  .ap-bottomnav,
  .ap-toast,
  .ap-result-actions,
  .apply-body > header { display: none !important; }
  .apply-body { background: #fff; padding: 0; }
  .ap-main { max-width: 100%; padding: 0; }
  .ap-result { display: block !important; }
  .ap-panel { display: none !important; }
  .ap-chart, .ap-detail-block, .ap-reco, .ap-score-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  .ap-canvas-box { height: 220px; }
}

/* ---------------- 검증 오류 표시 ---------------- */
.ap-alert {
  margin: 0 0 22px;
  padding: 15px 18px;
  border-radius: 13px;
  background: #fdf1f1;
  border: 1px solid #f0cfcf;
  border-left: 4px solid #b23c3c;
  color: #8f2f2f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}
.ap-alert[hidden] { display: none; }

.ap-q.is-missing {
  border-color: #e8b4b4;
  background: #fffafa;
}
.ap-q.is-missing .ap-q-text { color: #a83a3a; }
.ap-q.is-missing .ap-q-no { background: #b23c3c; color: #fff; }

.ap-q.answered .ap-q-no {
  background: rgba(17, 178, 234, 0.16);
  color: var(--deep);
}

.ap-input.is-invalid,
.ap-textarea.is-invalid {
  border-color: #d4695f;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(178, 60, 60, 0.1);
}

.ap-dim-count.is-done {
  background: rgba(31, 122, 68, 0.12);
  color: #1f7a44;
  border-color: rgba(31, 122, 68, 0.28);
}
