/*
 * [Pretendard 전체 굵기 지원]
 * 가변 폰트 한 파일로 Thin(100)부터 Black(900)까지 모두 제공합니다.
 * 기존에는 300·900 등 일부 굵기 파일이 없어 브라우저가 가짜 굵기를 합성했습니다.
 */
@font-face {
  font-family: "Pretendard";
  src: url("./assets/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-950: #10203a;
  --navy-900: #172947;
  --navy-800: #1f3154;
  --navy-700: #2a416d;
  --blue-600: #3e6fe8;
  --blue-500: #5b82ea;
  --blue-100: #eaf0ff;
  --blue-50: #f5f8ff;
  --green-600: #138868;
  --green-100: #e5f7f1;
  --red-600: #ca4253;
  --red-100: #ffedf0;
  --amber-600: #b97115;
  --amber-100: #fff4dc;
  --ink-900: #1d2738;
  --ink-700: #445067;
  --ink-500: #6f7a8c;
  --ink-300: #aab2bf;
  --line: #dde3ed;
  --line-soft: #edf0f5;
  --surface: #ffffff;
  --background: #f4f6fa;
  --shadow-sm: 0 8px 24px rgba(26, 42, 70, 0.08);
  --shadow-lg: 0 24px 60px rgba(21, 37, 64, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--ink-900);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  line-height: 1.55;
  letter-spacing: -0.015em;
  word-break: keep-all;
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(221, 227, 237, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}
.header-inner {
  width: min(1180px, calc(100% - 36px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: 0 8px 20px rgba(25, 42, 72, 0.16);
}
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { font-size: 16px; line-height: 1.2; color: var(--navy-900); }
.brand-copy small { margin-top: 3px; color: var(--ink-500); font-size: 11px; }
.header-admin-btn {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 14px;
  background: #fff;
  color: var(--navy-800);
  font-size: 13px;
  font-weight: 750;
}
.header-admin-btn:hover { background: var(--blue-50); border-color: #c9d5f3; }

.hero-section {
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 8%, rgba(116, 153, 255, 0.24), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(115, 221, 193, 0.17), transparent 27%),
    linear-gradient(140deg, var(--navy-950), var(--navy-800) 62%, #304d7d);
  color: #fff;
}
.hero-inner {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 58px 0 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  align-items: end;
  gap: 48px;
}
.eyebrow, .step-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
}
.eyebrow {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8efff;
}
.hero-copy h1 {
  margin: 17px 0 13px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}
.hero-copy h1 em { color: #8fb0ff; font-style: normal; }
.hero-copy p { margin: 0; max-width: 680px; color: rgba(255,255,255,0.76); font-size: 15px; }
.hero-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 18px 19px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(8, 18, 34, 0.27);
  color: rgba(255,255,255,0.84);
  font-size: 13px;
}
.hero-note strong { color: #fff; }

.workspace {
  width: min(1180px, calc(100% - 36px));
  margin: -28px auto 76px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.progress-panel, .form-panel {
  border: 1px solid rgba(221, 227, 237, 0.96);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.progress-panel {
  position: sticky;
  top: 92px;
  padding: 24px 20px 20px;
}
.progress-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.progress-title span { color: var(--ink-700); font-size: 13px; font-weight: 750; }
.progress-title strong { color: var(--blue-600); font-size: 13px; }
.progress-bar { height: 5px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #e9edf4; }
.progress-bar span { display: block; width: 25%; height: 100%; border-radius: inherit; background: var(--blue-600); transition: width .25s ease; }
.step-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 7px; }
.step-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 60px;
  padding: 9px 10px;
  border-radius: 13px;
  color: var(--ink-500);
  transition: background .2s ease, color .2s ease;
}
.step-number {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
}
.step-item strong, .step-item small { display: block; }
.step-item strong { font-size: 13px; }
.step-item small { margin-top: 2px; font-size: 11px; }
.step-item.active { background: var(--blue-50); color: var(--navy-800); }
.step-item.active .step-number { border-color: var(--blue-600); background: var(--blue-600); color: #fff; }
.step-item.done { color: var(--green-600); }
.step-item.done .step-number { border-color: #a9dfce; background: var(--green-100); color: var(--green-600); }
.side-help {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 9px;
  padding: 13px;
  border-radius: 13px;
  background: #f6f8fb;
  color: var(--ink-500);
  font-size: 11px;
}
.side-help p { margin: 0; }
.side-help strong { color: var(--ink-700); }
.help-icon {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.form-panel { overflow: hidden; }
.form-step { display: none; min-height: 560px; padding: 36px 38px 42px; }
.form-step.active { display: block; animation: stepIn .22s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.step-heading { margin-bottom: 29px; }
.step-kicker { color: var(--blue-600); }
.step-heading h2 { margin: 7px 0 7px; font-size: 27px; line-height: 1.25; letter-spacing: -0.035em; }
.step-heading p { margin: 0; color: var(--ink-500); font-size: 14px; }

.field-grid { display: grid; gap: 18px; }
.field-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.field-group { min-width: 0; }
.field-group > label, .admin-login > label {
  display: block;
  margin-bottom: 8px;
  color: #303b4e;
  font-size: 13px;
  font-weight: 800;
}
.field-group label b { color: var(--red-600); }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
  width: 100%;
  border: 1px solid #d9e0ea;
  border-radius: 12px;
  background: #fff;
  color: var(--ink-900);
  outline: none;
  padding: 12px 13px;
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: #7192e8;
  box-shadow: 0 0 0 4px rgba(62, 111, 232, 0.11);
}
input::placeholder, textarea::placeholder { color: #a0a8b6; }
textarea { resize: vertical; min-height: 104px; }
.input-action-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }

.coach-identity-grid { align-items: start; }
.coach-check-action {
  margin-top: 20px;
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #f8fafc;
}
.coach-check-btn {
  width: min(100%, 260px);
  min-height: 44px;
  justify-content: center;
}
.coach-check-action .validation-message {
  margin-top: 0;
  text-align: center;
}
.inline-primary-btn, .primary-btn, .secondary-btn, .submit-btn {
  border: 0;
  border-radius: 11px;
  padding: 11px 16px;
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.inline-primary-btn, .primary-btn { background: var(--navy-800); color: #fff; }
.inline-primary-btn { white-space: nowrap; }
.primary-btn, .submit-btn { min-width: 112px; }
.submit-btn { background: var(--blue-600); color: #fff; box-shadow: 0 9px 22px rgba(62, 111, 232, 0.22); }
.secondary-btn { background: #edf0f5; color: var(--navy-800); }
.inline-primary-btn:hover, .primary-btn:hover, .secondary-btn:hover, .submit-btn:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .5; transform: none !important; }
.field-help, .validation-message { margin-top: 7px; color: var(--ink-500); font-size: 11px; }
.validation-message.success { color: var(--green-600); }
.validation-message.error { color: var(--red-600); }
.validation-message.warning { color: var(--amber-600); }
.registration-result {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 17px;
  border: 1px solid #c8e8dd;
  border-radius: 14px;
  background: var(--green-100);
}
.registration-result.unregistered { border-color: #f1d9aa; background: var(--amber-100); }
.result-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #fff;
  color: var(--green-600);
  font-weight: 900;
}
.registration-result.unregistered .result-icon { color: var(--amber-600); }
.registration-result strong { display: block; font-size: 14px; }
.registration-result p { margin: 3px 0 0; color: var(--ink-700); font-size: 12px; }

.choice-grid { display: grid; gap: 13px; }
/* 신청 유형 5종: 중단 해제 카드는 인증 결과가 중단 상태일 때만 표시됩니다. */
.request-choice-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.production-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.resume-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-option { position: relative; display: block; min-width: 0; }
.choice-option > input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card {
  display: block;
  min-height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
  cursor: pointer;
}
.choice-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.choice-symbol {
  width: 37px;
  height: 37px;
  margin-bottom: 13px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #eef1f6;
  color: var(--navy-800);
  font-size: 16px;
  font-weight: 900;
}
.choice-card strong, .choice-card small { display: block; }
.choice-card strong { color: var(--ink-900); font-size: 14px; }
.choice-card small { margin-top: 5px; color: var(--ink-500); font-size: 11px; line-height: 1.45; }
.choice-option > input:checked + .choice-card {
  border-color: var(--blue-600);
  background: var(--blue-50);
  box-shadow: 0 0 0 1px var(--blue-600), 0 10px 25px rgba(62, 111, 232, 0.12);
}
.choice-option > input:checked + .choice-card .choice-symbol { background: var(--blue-600); color: #fff; }
.choice-option.disabled { opacity: .38; pointer-events: none; }
.horizontal-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 12px; }
.horizontal-card .choice-symbol { margin: 0; }

.subsection {
  margin-top: 22px;
  padding: 23px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #fbfcfe;
}
.subsection:first-of-type { margin-top: 0; }
.subsection-title { margin-bottom: 17px; }
.subsection-title h3 { margin: 0; font-size: 17px; letter-spacing: -0.025em; }
.subsection-title p { margin: 5px 0 0; color: var(--ink-500); font-size: 12px; }
.compact-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.compact-title p { text-align: right; max-width: 420px; }
.unit-input { position: relative; }
.unit-input input { padding-right: 50px; }
.unit-input span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-500); font-size: 12px; }
.segmented-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.segmented-control label { position: relative; }
.segmented-control input { position: absolute; opacity: 0; }
.segmented-control span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid #d9e0ea;
  border-radius: 11px;
  background: #fff;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.segmented-control input:checked + span { border-color: var(--blue-600); background: var(--blue-100); color: #315dc7; box-shadow: inset 0 0 0 1px var(--blue-600); }
.preserve-notice { margin-top: 13px; padding: 11px 13px; border-radius: 10px; background: var(--amber-100); color: #87581a; font-size: 12px; }

.upload-zone {
  min-height: 184px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 24px;
  border: 1.5px dashed #bdc7d7;
  border-radius: 16px;
  background: #f7f9fc;
  text-align: center;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue-500); background: var(--blue-50); }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e8edf5;
  color: var(--navy-800);
  font-size: 19px;
  font-weight: 900;
}
.upload-zone strong { font-size: 14px; }
.upload-zone small { color: var(--ink-500); font-size: 11px; }
.selected-file-name { margin-top: 8px; color: var(--blue-600); font-size: 12px; font-weight: 750; }
.photo-upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr); gap: 20px; align-items: stretch; }
.photo-upload-column { display: grid; gap: 10px; align-content: start; }
.photo-upload-column .compact-btn { justify-self: start; }
.person-option-panel { display: grid; gap: 14px; align-content: start; }
#defaultCharacterField.is-inactive { opacity: .52; }
#defaultCharacterField.is-inactive input { pointer-events: none; }
.compact-upload { min-height: 160px; }

.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.template-option { position: relative; min-width: 0; }
.template-option > input { position: absolute; opacity: 0; }
.template-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.template-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.template-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; background: #edf0f5; }
.template-card > span { display: block; padding: 12px; }
.template-card strong, .template-card small { display: block; }
.template-card strong { font-size: 13px; }
.template-card small { margin-top: 3px; color: var(--ink-500); font-size: 10px; }
.template-option > input:checked + .template-card { border-color: var(--blue-600); box-shadow: 0 0 0 2px var(--blue-600), var(--shadow-sm); }

.char-counter { display: block; margin-top: 5px; color: var(--ink-500); font-size: 10px; text-align: right; }
.repeat-field-list { display: grid; gap: 12px; }
.repeat-field-row {
  display: grid;
  grid-template-columns: 37px minmax(170px, .75fr) minmax(0, 1.25fr);
  gap: 10px;
  align-items: start;
}
.repeat-index {
  width: 35px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--navy-800);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.review-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.review-section { padding: 19px 21px; border-bottom: 1px solid var(--line-soft); }
.review-section:last-child { border-bottom: 0; }
.review-section h3 { margin: 0 0 13px; font-size: 14px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 24px; }
.review-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; font-size: 12px; }
.review-item dt { color: var(--ink-500); }
.review-item dd { margin: 0; color: var(--ink-900); font-weight: 700; overflow-wrap: anywhere; }
.agreement-box {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
}
.agreement-box > input { position: absolute; opacity: 0; }
.agreement-check {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid #bec7d5;
  border-radius: 7px;
  background: #fff;
  color: transparent;
  font-size: 12px;
  font-weight: 900;
}
.agreement-box input:checked + .agreement-check { border-color: var(--blue-600); background: var(--blue-600); color: #fff; }
.agreement-box strong, .agreement-box small { display: block; }
.agreement-box strong { font-size: 13px; }
.agreement-box small { margin-top: 4px; color: var(--ink-500); font-size: 11px; }

.form-actions {
  min-height: 78px;
  padding: 16px 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  background: #fbfcfd;
}
.action-spacer { flex: 1; }

.site-footer { padding: 0 18px 34px; text-align: center; color: var(--ink-500); font-size: 11px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 22, 41, 0.58);
  backdrop-filter: blur(5px);
}
.result-modal-card, .admin-modal-card {
  width: min(100%, 470px);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(7, 18, 36, 0.28);
}
.result-modal-card { padding: 34px; text-align: center; }
.success-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 17px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--green-100);
  color: var(--green-600);
  font-size: 25px;
  font-weight: 900;
}
.result-modal-card h2 { margin: 0; font-size: 23px; }
.result-modal-card > p { margin: 9px 0 20px; color: var(--ink-500); font-size: 13px; }
.result-details { margin: 0 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.result-details div { display: grid; grid-template-columns: 100px minmax(0, 1fr); padding: 11px 13px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 12px; }
.result-details div:last-child { border-bottom: 0; }
.result-details dt { color: var(--ink-500); }
.result-details dd { margin: 0; font-weight: 750; overflow-wrap: anywhere; }
.folder-link { display: inline-flex; margin-bottom: 16px; color: var(--blue-600); font-size: 12px; font-weight: 800; }
.full-btn { width: 100%; }
.result-modal-card .secondary-btn, .result-modal-card .primary-btn { margin-top: 10px; display: inline-flex; justify-content: center; text-decoration: none; }

.admin-modal-card { width: min(100%, 980px); }
.modal-header { padding: 24px 26px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line-soft); }
.modal-header h2 { margin: 4px 0 0; font-size: 23px; }
.modal-close-btn { width: 37px; height: 37px; border: 0; border-radius: 11px; background: #eef1f5; color: var(--navy-800); font-size: 22px; }
.admin-login { padding: 24px 26px 30px; }
.admin-dashboard { padding: 20px 22px 26px; }
.admin-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; gap: 9px; margin-bottom: 15px; }
.admin-list { display: grid; gap: 11px; }
.admin-empty { padding: 42px 20px; border: 1px dashed var(--line); border-radius: 15px; color: var(--ink-500); text-align: center; font-size: 13px; }
.admin-item { border: 1px solid var(--line); border-radius: 15px; background: #fff; overflow: hidden; }
.admin-item-head { padding: 14px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; background: #f8fafc; border-bottom: 1px solid var(--line-soft); }
.admin-item-head strong { display: block; font-size: 14px; }
.admin-item-head small { display: block; margin-top: 3px; color: var(--ink-500); font-size: 10px; }
.status-badge { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: var(--blue-100); color: #315dc7; font-size: 10px; font-weight: 800; }
.admin-item-body { padding: 15px 16px; }
.admin-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 13px; }
.admin-meta div { padding: 9px; border-radius: 10px; background: #f6f8fb; }
.admin-meta span, .admin-meta strong { display: block; }
.admin-meta span { color: var(--ink-500); font-size: 9px; }
.admin-meta strong { margin-top: 2px; font-size: 11px; overflow-wrap: anywhere; }
.admin-links { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.admin-links a { padding: 7px 9px; border-radius: 8px; background: var(--blue-50); color: var(--blue-600); font-size: 10px; font-weight: 800; }
.admin-edit-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 9px; }
.admin-file-row { margin-top: 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.admin-file-row input[type="file"] { min-width: 0; font-size: 11px; }

.loading-layer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 22, 41, 0.54);
  backdrop-filter: blur(5px);
}
.loading-box { width: min(100%, 320px); padding: 30px; border-radius: 20px; background: #fff; text-align: center; box-shadow: var(--shadow-lg); }
.spinner { width: 38px; height: 38px; margin: 0 auto 15px; display: block; border: 4px solid #e4e9f1; border-top-color: var(--blue-600); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box strong { display: block; font-size: 15px; }
.loading-box p { margin: 6px 0 0; color: var(--ink-500); font-size: 11px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  max-width: min(90vw, 520px);
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--navy-950);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  text-align: center;
}
.toast.error { background: #9f2637; }
.toast.success { background: #116d55; }

@media (max-width: 1020px) {
  .request-choice-grid, .resume-action-grid, .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid.metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid.metrics-grid #week3Field { grid-column: 1 / -1; }
  .admin-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; gap: 28px; padding: 46px 0 58px; }
  .hero-note { max-width: 640px; }
  .workspace { grid-template-columns: 1fr; margin-top: -20px; }
  .progress-panel { position: static; padding: 17px; }
  .step-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 14px; }
  .step-item { grid-template-columns: 1fr; gap: 5px; justify-items: center; min-height: 67px; padding: 7px 3px; text-align: center; }
  .step-item small, .side-help { display: none; }
  .step-number { width: 28px; height: 28px; }
  .step-item strong { font-size: 10px; }
  .form-step { min-height: 0; padding: 30px 24px 34px; }
  .form-actions { padding: 15px 24px; }
  .photo-upload-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner, .hero-inner, .workspace { width: min(100% - 24px, 1180px); }
  .header-inner { height: 64px; }
  .brand-logo { width: 37px; height: 37px; border-radius: 11px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { display: none; }
  .header-admin-btn { padding: 8px 11px; font-size: 11px; }
  .hero-inner { padding: 38px 0 50px; }
  .hero-copy h1 { margin-top: 14px; font-size: 34px; }
  .hero-copy p { font-size: 13px; }
  .hero-note { grid-template-columns: 1fr; gap: 5px; padding: 15px; }
  .workspace { margin-bottom: 52px; }
  .progress-panel, .form-panel { border-radius: 18px; }
  .progress-panel { padding: 14px; }
  .progress-title { padding: 0 2px; }
  .step-list { margin-top: 11px; }
  .form-step { padding: 26px 18px 30px; }
  .step-heading { margin-bottom: 23px; }
  .step-heading h2 { font-size: 23px; }
  .step-heading p { font-size: 12px; }
  .field-grid.two-columns, .field-grid.metrics-grid, .production-choice-grid, .resume-action-grid, .request-choice-grid, .template-grid { grid-template-columns: 1fr; }
  .choice-card { padding: 15px; }
  .request-choice-grid .choice-card { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; align-items: center; }
  .request-choice-grid .choice-symbol { margin: 0; }
  .request-choice-grid .choice-card strong, .request-choice-grid .choice-card small { grid-column: 2; }
  .request-choice-grid .choice-card strong { grid-row: 1; align-self: end; }
  .request-choice-grid .choice-card small { grid-row: 2; margin-top: -12px; align-self: start; }
  .subsection { padding: 18px 15px; border-radius: 15px; }
  .compact-title { display: block; }
  .compact-title p { text-align: left; }
  .repeat-field-row { grid-template-columns: 34px minmax(0, 1fr); }
  .repeat-field-row input { grid-column: 2; }
  .repeat-field-row textarea { grid-column: 2; }
  .repeat-index { grid-row: 1 / span 2; }
  .review-grid { grid-template-columns: 1fr; }
  .review-item { grid-template-columns: 105px minmax(0, 1fr); }
  .form-actions { position: sticky; bottom: 0; z-index: 20; padding: 13px 18px; box-shadow: 0 -7px 18px rgba(28, 44, 70, 0.07); }
  .primary-btn, .submit-btn, .secondary-btn { min-width: 92px; padding: 10px 13px; font-size: 12px; }
  .modal-backdrop { padding: 12px; }
  .result-modal-card { padding: 26px 20px; }
  .admin-toolbar, .admin-edit-grid, .admin-file-row { grid-template-columns: 1fr; }
  .admin-modal-card { border-radius: 18px; }
  .modal-header { padding: 19px 18px 15px; }
  .admin-dashboard, .admin-login { padding-left: 16px; padding-right: 16px; }
  .admin-meta { grid-template-columns: 1fr 1fr; }
}

/* 자동 생성 이미지 결과 미리보기 */
.result-image-preview {
  width: min(260px, 100%);
  margin: 14px auto 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f9fc;
  box-shadow: 0 10px 28px rgba(22, 39, 68, 0.12);
}
.result-image-preview img {
  width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   템플릿 직접 편집기
   -------------------------------------------------------------------------- */
.legacy-template-fields {
  display: none !important;
}

.template-editor-section {
  overflow: visible;
}

.template-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
  align-items: start;
}

.template-editor-main {
  min-width: 0;
}

.template-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f7f9fc;
  color: var(--ink-500);
  font-size: 11px;
}

.compact-btn {
  min-width: auto !important;
  padding: 8px 11px !important;
  font-size: 11px !important;
}

.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--navy-800);
  font-weight: 750;
}

.template-editor-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid #d9e0eb;
  border-radius: 16px;
  background: #e9edf3;
  box-shadow: 0 16px 36px rgba(24, 43, 73, 0.14);
}

.template-editor-stage {
  position: relative;
  width: 1485px;
  height: 2101px;
  transform-origin: top left;
  overflow: hidden;
  background: #fff;
  user-select: none;
}

.template-editor-background,
.template-editor-nameplate,
.template-editor-default-character,
.template-editor-kids-illustration,
.template-editor-photo {
  position: absolute;
  display: block;
  pointer-events: none;
}

.template-editor-background {
  z-index: 1;
  inset: 0;
  width: 1485px;
  height: 2101px;
  object-fit: fill;
}

.template-editor-default-character,
.template-editor-kids-illustration,
.template-editor-photo {
  z-index: 2;
  object-fit: contain;
  object-position: center bottom;
}

.career-dynamic-background {
  position: absolute;
  z-index: 2;
  left: 24px;
  top: 676px;
  width: 520px;
  height: 275px;
  min-height: 275px;
  border-radius: 92px;
  pointer-events: none;
  transition: height .12s ease;
}

.template-editor-kids-illustration {
  left: 56px;
  top: 1307px;
  width: 466px;
  height: 398px;
}

.template-editor-default-character {
  left: 70px;
  top: 11px;
  width: 423px;
  height: 514px;
}

.template-editor-photo {
  left: 54px;
  top: 18px;
  width: 492px;
  height: 535px;
}

.template-editor-nameplate {
  z-index: 3;
  width: 465px;
  height: 117px;
}

.template-fixed-text {
  position: absolute;
  z-index: 4;
  color: #1c1c1c;
  font-family: Pretendard, sans-serif;
  white-space: nowrap;
  pointer-events: none;
}

.teacher-label {
  left: 276px;
  top: 562px;
  width: 86px;
  font-size: 27px;
  font-weight: 500;
  line-height: 34px;
  text-align: left;
}

.editor-text-layer {
  position: absolute;
  z-index: 6;
  box-sizing: border-box;
  min-width: 8px;
  min-height: 8px;
  padding: 1px 3px;
  border: 1px solid transparent;
  outline: 0;
  color: #303030;
  font-family: Pretendard, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: keep-all;
  line-break: strict;
  cursor: text;
  user-select: text;
  transition: top .12s ease, height .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.editor-text-layer:hover {
  border-color: rgba(43, 97, 216, 0.46);
  background: rgba(255, 255, 255, 0.34);
}

.editor-text-layer.is-selected {
  border-color: #2f64d7;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 0 0 2px rgba(47, 100, 215, 0.15);
}

.editor-text-layer.is-overflowing {
  border-color: #d7485d;
  background: rgba(255, 238, 241, 0.68);
  box-shadow: inset 0 0 0 2px rgba(215, 72, 93, 0.14);
}

.editor-text-layer:empty::before {
  content: attr(data-placeholder);
  color: rgba(53, 65, 84, 0.42);
  pointer-events: none;
}

.editor-overflow-notice {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f0bec7;
  border-radius: 11px;
  background: #fff1f3;
  color: #a52e42;
  font-size: 11px;
  line-height: 1.55;
}

.text-style-panel {
  position: sticky;
  top: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(24, 43, 73, 0.08);
}

.style-panel-empty {
  padding: 18px 4px;
  text-align: center;
}

.style-panel-empty strong {
  display: block;
  font-size: 13px;
}

.style-panel-empty p {
  margin: 6px 0 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.6;
}

.selected-field-name {
  margin-bottom: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--navy-800);
  font-size: 13px;
  font-weight: 850;
}

.style-control {
  display: block;
  margin-bottom: 14px;
}

.style-control > span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 800;
}

.range-number-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  gap: 8px;
  align-items: center;
}

.range-number-row input[type="number"] {
  padding: 8px;
  text-align: center;
}

.style-control input[type="range"] {
  width: 100%;
  accent-color: var(--blue-600);
}

.style-control output {
  display: block;
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 10px;
  text-align: right;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 750;
}

.toggle-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue-600);
}

.style-panel-actions {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.alignment-guide {
  margin: 12px 0 0;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f5f7fb;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   템플릿 관리자
   -------------------------------------------------------------------------- */
.template-admin-modal {
  width: min(100%, 1160px);
}

.template-admin-dashboard {
  padding: 20px 22px 26px;
}

.template-admin-columns {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(420px, 1.22fr);
  gap: 16px;
}

.template-admin-list-panel,
.template-admin-form-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.template-admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.template-admin-panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.template-admin-panel-head p {
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.5;
}

.template-admin-list {
  display: grid;
  gap: 9px;
  max-height: 560px;
  overflow: auto;
}

.template-admin-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f9fafc;
}

.template-admin-item img {
  width: 74px;
  aspect-ratio: 1485 / 2101;
  object-fit: cover;
  border-radius: 8px;
  background: #e9edf3;
}

.template-admin-item strong,
.template-admin-item small {
  display: block;
}

.template-admin-item strong {
  font-size: 12px;
}

.template-admin-item small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.template-admin-item button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy-800);
  padding: 7px 9px;
  font-size: 10px;
  font-weight: 800;
}

.template-enabled-row {
  margin: 14px 0;
}

@media (max-width: 1020px) {
  .template-editor-layout,
  .template-admin-columns {
    grid-template-columns: 1fr;
  }

  .text-style-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .template-editor-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .template-editor-section {
    padding-left: 10px;
    padding-right: 10px;
  }

  .text-style-panel {
    padding: 13px;
  }

  .template-admin-dashboard {
    padding: 14px;
  }

  .template-admin-list-panel,
  .template-admin-form-panel {
    padding: 13px;
  }
}


.template-editor-stage.is-exporting .editor-text-layer {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  caret-color: transparent !important;
}
.template-editor-stage.is-exporting .editor-text-layer:empty::before {
  content: none !important;
}
.template-editor-stage.is-exporting .editor-bullet {
  opacity: 1;
}
.color-control-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.color-control-row input[type="color"] {
  width: 48px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.selection-style-guide {
  margin: 10px 0 0;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f2f6ff;
  color: #48617f;
  font-size: 10px;
  line-height: 1.45;
}
.editor-text-layer span {
  white-space: inherit;
}

/* --------------------------------------------------------------------------
   [고도화] 웹게시글형 리치 텍스트 도구 모음
   - 템플릿의 일부 글자를 드래그한 뒤 글꼴·크기·색상·강조를 바로 적용합니다.
   -------------------------------------------------------------------------- */
.rich-editor-toolbar {
  position: sticky;
  top: 72px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid #d7deea;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 20px rgba(24, 43, 73, 0.1);
  backdrop-filter: blur(8px);
}

.rich-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding-right: 8px;
  border-right: 1px solid #e3e8f0;
}

.rich-tool-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.rich-tool-group > label {
  margin-right: 2px;
  color: #5c6c82;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.rich-tool-field select,
.rich-tool-size input,
.rich-tool-color input,
#toolbarLineHeightSelect {
  height: 34px;
  border: 1px solid #cfd7e5;
  border-radius: 8px;
  background: #fff;
  color: #23324b;
  font-size: 11px;
}

.rich-tool-field select {
  width: 128px;
  padding: 0 26px 0 9px;
}

.rich-tool-size input {
  width: 54px;
  padding: 0 5px;
  text-align: center;
}

.rich-tool-color input {
  width: 38px;
  padding: 2px;
  cursor: pointer;
}

#toolbarLineHeightSelect {
  width: 76px;
  padding: 0 23px 0 8px;
}

.rich-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #cfd7e5;
  border-radius: 8px;
  background: #fff;
  color: #263751;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.rich-tool-button:hover {
  border-color: #7394dc;
  background: #f3f6ff;
}

.rich-tool-button[aria-pressed="true"],
.rich-tool-button.is-active {
  border-color: #2f64d7;
  background: #eaf0ff;
  color: #1f51c0;
  box-shadow: inset 0 0 0 1px rgba(47, 100, 215, 0.12);
}

.rich-tool-button:disabled,
.rich-editor-toolbar.is-disabled .rich-tool-button,
.rich-editor-toolbar.is-disabled select,
.rich-editor-toolbar.is-disabled input {
  cursor: not-allowed;
  opacity: .5;
}

.rich-tool-wide {
  min-width: 68px;
  font-size: 10px;
}

.align-format-button {
  font-family: Arial, sans-serif;
  font-size: 18px;
  letter-spacing: -3px;
  overflow: hidden;
}

.align-center-icon {
  text-align: center;
  transform: scaleX(.72);
}

.align-right-icon {
  justify-content: flex-end;
  padding-right: 7px;
}

.rich-editor-help {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #eef4ff;
  color: #4f6482;
  font-size: 10px;
  line-height: 1.55;
}

.side-format-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -3px 0 14px;
}

.editor-text-layer.is-locked {
  cursor: default;
  caret-color: transparent;
}

.editor-text-layer.is-locked:hover,
.editor-text-layer.is-locked.is-selected {
  border-style: dashed;
}

.editor-text-layer.is-locked:empty::before {
  content: "등록 확인된 이름";
}

@media (max-width: 1020px) {
  .rich-editor-toolbar {
    position: static;
  }
}

@media (max-width: 640px) {
  .rich-editor-toolbar {
    gap: 6px;
    padding: 8px;
  }

  .rich-tool-group {
    padding-right: 6px;
  }

  .rich-tool-field select {
    width: 112px;
  }

  .rich-tool-group > label {
    display: none;
  }
}


/* --------------------------------------------------------------------------
   [수정] 편집 도구를 상단 단일 도구 모음으로 통합
   - 기존 오른쪽 보조 패널은 내부 상태 동기화를 위해 DOM에만 남기고 화면에서는 숨깁니다.
   - 템플릿과 상단 도구 모음이 전체 너비를 사용하도록 정리합니다.
   -------------------------------------------------------------------------- */
.template-editor-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

.text-style-panel {
  display: none !important;
}

.template-editor-main {
  width: 100%;
  max-width: none;
}

@media (max-width: 1020px) {
  .template-editor-layout {
    display: block;
  }
}


/* ========================================================================== 
   2026 최종 UI/UX 고도화
   ========================================================================== */
:root {
  --focus-ring: 0 0 0 3px rgba(62, 111, 232, .18);
  --surface-soft: #f8faff;
}

button, input, textarea, select { transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [contenteditable="true"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
button:active:not(:disabled) { transform: translateY(1px); }

.workspace { width: min(1280px, calc(100% - 32px)); grid-template-columns: 228px minmax(0, 1fr); }
.form-panel { overflow: clip; }
.form-step { animation: stepFadeIn .22s ease; }
@keyframes stepFadeIn { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.step-heading {
  position: relative;
  padding-bottom: 20px;
}
.step-heading::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--blue-500), var(--line-soft) 32%, transparent);
}

.choice-card { min-height: 100%; }
.choice-option input:checked + .choice-card {
  box-shadow: 0 12px 30px rgba(62, 111, 232, .14), inset 0 0 0 1px rgba(62,111,232,.18);
}

/* 단일 리치 에디터 도구 모음 */
.rich-editor-toolbar {
  position: sticky;
  top: 82px;
  z-index: 24;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d7dfec;
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(19, 39, 70, .10);
}
.rich-tool-weight select { width: 116px; }
.rich-tool-button.is-active,
.text-format-button[aria-pressed="true"],
.align-format-button[aria-pressed="true"] {
  border-color: var(--blue-500);
  background: var(--blue-100);
  color: var(--blue-600);
}
.editor-fit-status-ok { color: var(--green-600) !important; }
.editor-fit-status-warning { color: var(--red-600) !important; }

/* 배경에 포함된 기존 제목을 덮고 SemiBold 글자로 다시 출력합니다. */
.editor-text-layer.is-section-heading {
  z-index: 7;
  padding: 0 4px;
  border: 0 !important;
  background: #fff !important;
  cursor: default;
  pointer-events: none;
  white-space: nowrap;
  font-family: Pretendard, sans-serif !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.template-card img { background: #f4f6fa; }
.template-option input:checked + .template-card::after {
  content: "선택됨";
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-600);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.template-card { position: relative; }

/* 관리자 템플릿 관리 */
.template-admin-modal { width: min(1240px, calc(100vw - 28px)); max-height: min(920px, calc(100vh - 28px)); }
.template-admin-columns { grid-template-columns: minmax(270px, .8fr) minmax(0, 1.45fr); }
.template-admin-form-panel { min-width: 0; }
.template-admin-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.admin-template-preview-card {
  position: sticky;
  top: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}
.admin-template-preview-card h4 { margin: 0 0 10px; font-size: 13px; color: var(--navy-800); }
.admin-template-preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1485 / 2101;
  overflow: hidden;
  border: 1px solid #ccd5e4;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(25,42,72,.10);
}
.admin-template-preview-stage > img { position: absolute; display: block; }
#adminPreviewBackground { inset: 0; width: 100%; height: 100%; object-fit: fill; }
#adminPreviewCareerBackground {
  position: absolute;
  z-index: 1;
  left: 1.62%;
  top: 32.18%;
  width: 35.02%;
  height: 13.09%;
  border-radius: 999px;
  background: #EDC6B1;
  opacity: .96;
  pointer-events: none;
}
#adminPreviewNameplate { width: 31.313%; height: auto; z-index: 2; }
.admin-preview-placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; color: var(--ink-500); font-size: 11px; text-align: center; }
.admin-preview-meta { display: grid; gap: 5px; margin-top: 10px; color: var(--ink-500); font-size: 10px; }
.admin-file-preview-name { margin-top: 5px; color: var(--blue-600); font-size: 10px; word-break: break-all; }
.admin-action-row { display: flex; gap: 8px; margin-top: 14px; }
.admin-action-row > button { flex: 1; }
.template-admin-item.is-disabled { opacity: .68; }
.template-admin-item .template-status-badge { display: inline-flex; width: max-content; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.template-status-badge.on { background: var(--green-100); color: var(--green-600); }
.template-status-badge.off { background: var(--red-100); color: var(--red-600); }

/* 속도와 안정성: 화면 밖의 긴 단계는 브라우저 렌더링 비용을 줄입니다. */
.form-step:not(.active) { content-visibility: hidden; }
.form-step.active { content-visibility: visible; }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; margin-top: -20px; }
  .progress-panel { position: relative; top: auto; padding: 15px 18px; }
  .step-list { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .step-item { min-height: 52px; grid-template-columns: 28px minmax(0,1fr); padding: 7px; }
  .step-number { width: 27px; height: 27px; }
  .side-help { display: none; }
  .template-admin-workspace { grid-template-columns: 1fr; }
  .admin-template-preview-card { position: static; max-width: 360px; }
}

@media (max-width: 720px) {
  .workspace { width: min(100% - 18px, 1280px); }
  .hero-inner { padding: 36px 0 48px; }
  .hero-note { display: none; }
  .step-list small { display: none; }
  .step-item { display: flex; justify-content: center; }
  .step-item > span:last-child strong { font-size: 10px; }
  .rich-editor-toolbar { top: 68px; max-height: 164px; overflow-y: auto; }
  .template-admin-columns { grid-template-columns: 1fr; }
  .template-admin-list-panel { max-height: 250px; }
  .admin-action-row { flex-direction: column; }
}

.draft-status { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-500); font-size: 10px; }
.draft-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
.draft-status.is-saving::before { background: var(--amber-600); box-shadow: 0 0 0 3px var(--amber-100); }
@media (max-width: 640px) { .draft-status { display: none; } }

/* ========================================================================== 
   2026-08 전체 UI/UX·모바일·완료 화면 고도화
   ========================================================================== */
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.hero-points span {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  font-size: 11px;
  font-weight: 700;
}
.progress-title span em {
  margin-left: 6px;
  color: var(--blue-600);
  font-style: normal;
  font-weight: 850;
}

/* 배경에 포함된 기존 카테고리 제목을 가리는 전용 레이어 */
.section-heading-mask {
  position: absolute;
  z-index: 5;
  display: block;
  background: #fff;
  pointer-events: none;
}
.editor-text-layer.is-section-heading {
  z-index: 8;
  background: transparent !important;
}
.template-editor-stage.is-exporting .section-heading-mask {
  display: block !important;
  background: #fff !important;
}
.template-editor-stage.is-exporting .editor-text-layer.is-section-heading {
  background: transparent !important;
}

/* 경력 배경 박스는 실제 문장 높이에 맞춰 JS가 인라인 높이를 적용합니다. */
.career-dynamic-background {
  background: #edc6b1;
  opacity: 1;
  will-change: height;
  transition: height .14s ease-out, background-color .18s ease;
}
.editor-measure-clone {
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

/* 단계 카드와 입력 영역 */
.form-panel {
  border-color: rgba(209, 218, 232, .96);
  box-shadow: 0 26px 70px rgba(20, 38, 70, .13);
}
.form-step {
  background:
    linear-gradient(180deg, rgba(247,250,255,.72), rgba(255,255,255,0) 160px),
    #fff;
}
.choice-card {
  border-color: #dbe2ed;
  box-shadow: 0 7px 20px rgba(24, 43, 75, .045);
}
.choice-card:hover {
  border-color: #b9c9e7;
  box-shadow: 0 14px 30px rgba(32, 58, 100, .10);
}
.registration-result {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}
.form-actions {
  min-height: 82px;
  background: rgba(251,252,254,.96);
  backdrop-filter: blur(12px);
}
.form-actions .primary-btn,
.form-actions .submit-btn {
  min-width: 132px;
}

/* 처리 화면: 진행률과 현재 단계가 보이도록 개선 */
.loading-box {
  width: min(100%, 380px);
  padding: 30px 28px 26px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 24px;
}
.loading-box strong { font-size: 17px; }
.loading-box p { margin-top: 8px; font-size: 12px; line-height: 1.55; }
.loading-box > small {
  display: block;
  margin-top: 14px;
  color: var(--ink-500);
  font-size: 10px;
}
.loading-progress {
  height: 7px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}
.loading-progress span {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-600), #7b9df5);
  transition: width .35s ease;
}
.loading-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  color: var(--ink-500);
  font-size: 10px;
}
.loading-progress-meta b { color: var(--blue-600); }

/* 완료 화면 */
.result-modal-card {
  width: min(100%, 520px);
  padding: 36px;
}
.result-complete-note {
  display: grid;
  gap: 4px;
  margin: 6px 0 14px;
  padding: 13px 14px;
  border-radius: 13px;
  background: var(--green-100);
  color: var(--green-600);
  text-align: left;
}
.result-complete-note strong { font-size: 12px; }
.result-complete-note span { color: #3f685d; font-size: 10px; line-height: 1.5; }

.site-footer p {
  display: grid;
  gap: 3px;
  margin: 0;
}
.site-footer strong { color: var(--ink-700); font-size: 11px; }
.site-footer span { font-size: 10px; }

/* 모바일 우선: 진행 단계, 입력, 편집기, 완료창을 한 손 조작에 맞춤 */
@media (max-width: 720px) {
  .site-header { position: sticky; }
  .header-inner { width: calc(100% - 24px); }
  .header-admin-btn { border-radius: 999px; }

  .hero-inner { width: calc(100% - 28px); padding: 28px 0 42px; }
  .eyebrow { font-size: 9px; }
  .hero-copy h1 { font-size: clamp(29px, 9vw, 38px); line-height: 1.12; }
  .hero-copy p { line-height: 1.65; }
  .hero-points { gap: 6px; margin-top: 15px; }
  .hero-points span { min-height: 28px; padding: 5px 9px; font-size: 9px; }

  .workspace { width: calc(100% - 16px); gap: 10px; margin-top: -16px; }
  .progress-panel {
    position: sticky;
    top: 68px;
    z-index: 35;
    padding: 11px 12px 9px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(20, 38, 70, .12);
  }
  .progress-title { padding: 0 2px; }
  .progress-title span { font-size: 11px; }
  .progress-title span em { display: inline; font-size: 10px; }
  .progress-bar { margin-top: 8px; }
  .step-list { margin-top: 8px; }
  .step-item { min-height: 38px; padding: 4px 2px; gap: 4px; }
  .step-number { width: 23px; height: 23px; border-radius: 8px; font-size: 10px; }
  .step-item > span:last-child strong { font-size: 9px; }

  .form-panel { border-radius: 18px; }
  .form-step { padding: 24px 16px 28px; }
  .step-heading { margin-bottom: 22px; padding-bottom: 16px; }
  .step-heading h2 { font-size: 22px; }
  .step-heading p { font-size: 12px; line-height: 1.6; }

  .field-grid.two-columns,
  .field-grid.metrics-grid,
  .request-choice-grid,
  .production-choice-grid,
  .resume-action-grid { grid-template-columns: 1fr; }

  .request-choice-grid { gap: 9px; }
  .request-choice-grid .choice-card {
    grid-template-columns: 40px minmax(0,1fr);
    min-height: 74px;
    padding: 13px 14px;
  }
  .choice-card strong { font-size: 13px; }
  .choice-card small { font-size: 10px; }
  .choice-symbol { width: 34px; height: 34px; }

  .template-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .template-card { border-radius: 13px; }
  .template-card span { padding: 9px; }
  .template-card strong { font-size: 11px; }
  .template-card small { font-size: 9px; }

  .rich-editor-toolbar {
    position: sticky;
    top: 125px;
    z-index: 28;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
    border-radius: 12px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .rich-tool-group { flex: 0 0 auto; }
  .rich-tool-field select { width: 108px; }
  .rich-editor-help { font-size: 10px; line-height: 1.5; }
  .template-editor-viewport { border-radius: 12px; }

  .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 40;
    min-height: 70px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    gap: 8px;
    box-shadow: 0 -10px 26px rgba(20, 38, 70, .10);
  }
  .form-actions .action-spacer { display: none; }
  .form-actions .secondary-btn,
  .form-actions .primary-btn,
  .form-actions .submit-btn { flex: 1; min-width: 0; min-height: 44px; }

  .modal-backdrop { align-items: end; padding: 0; }
  .result-modal-card {
    width: 100%;
    max-height: 92dvh;
    padding: 28px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
  }
  .admin-modal-card {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
  .modal-header { position: sticky; top: 0; z-index: 10; background: #fff; }
  .loading-layer { padding: 14px; }
  .loading-box { padding: 26px 20px 22px; border-radius: 20px; }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .brand-copy strong { font-size: 13px; }
  .header-admin-btn { padding: 7px 9px; font-size: 10px; }
  .hero-copy h1 br { display: none; }
  .progress-title span em { display: none; }
  .template-grid { grid-template-columns: 1fr 1fr; }
  .review-item { grid-template-columns: 90px minmax(0,1fr); }
  .form-actions .draft-status { display: none; }
}

/* ========================================================================== 
   2026-08-07 UI/UX + 편집 안정성 최종 보강
   ========================================================================== */

/* 경력 배경은 입력 높이에 즉시 맞춰야 하므로 애니메이션 지연을 제거합니다. */
.career-dynamic-background {
  transition: background-color .16s ease !important;
}
.template-editor-stage.is-exporting .career-dynamic-background,
.template-editor-stage.is-exporting .editor-text-layer,
.template-editor-stage.is-exporting .editor-bullet {
  transition: none !important;
}

/* MBTI 기본 컬러: 밝은 이름표 위에서도 식별되는 진한 네이비 */
.editor-text-layer[data-field="mbti"] {
  color: #2F3E88;
}

/* PC: 화면 가로 공간을 제한하지 않고 실제 작업 영역으로 사용합니다. */
@media (min-width: 1081px) {
  .header-inner,
  .hero-inner,
  .workspace {
    width: calc(100% - 32px) !important;
    max-width: none !important;
  }

  .header-inner { height: 68px; }
  .hero-inner {
    padding: 42px 4px 54px;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  }
  .hero-copy h1 { font-size: clamp(36px, 3vw, 52px); }

  .workspace {
    grid-template-columns: 232px minmax(0, 1fr) !important;
    gap: 16px;
    margin-top: -24px;
  }
  .progress-panel { top: 84px; }
  .form-panel { width: 100%; }
  .form-step {
    width: 100%;
    padding: 34px clamp(32px, 3vw, 58px) 42px;
  }

  .template-editor-section,
  .template-editor-layout,
  .template-editor-main,
  .template-editor-viewport {
    width: 100%;
    max-width: none;
  }

  .template-editor-viewport {
    background:
      linear-gradient(45deg, rgba(218,224,235,.44) 25%, transparent 25%) 0 0 / 18px 18px,
      linear-gradient(-45deg, rgba(218,224,235,.44) 25%, transparent 25%) 0 9px / 18px 18px,
      #eef2f7;
  }

  .rich-editor-toolbar {
    top: 78px;
    padding: 11px 12px;
  }

  .request-choice-grid { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
  .production-choice-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .template-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
}

/* 태블릿: 모바일식 단일 흐름을 유지하면서 버튼과 편집 도구를 넓게 사용합니다. */
@media (min-width: 721px) and (max-width: 1080px) {
  .header-inner,
  .hero-inner,
  .workspace { width: calc(100% - 24px); }
  .form-step { padding: 30px 24px 36px; }
  .request-choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .template-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .rich-editor-toolbar {
    position: sticky;
    top: 76px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }
}

/* 모바일: 가로 스크롤 방지 + 터치 입력 안정성 */
@media (max-width: 720px) {
  body { overflow-x: hidden; }
  .site-header,
  .hero-section,
  .workspace,
  .form-panel,
  .form-step { max-width: 100%; }
  .field-group input,
  .field-group textarea,
  .field-group select { font-size: 16px; } /* iOS 자동 확대 방지 */
  .input-action-row { grid-template-columns: 1fr; }
  .input-action-row .primary-btn,
  #checkCoachBtn { width: 100%; min-height: 46px; }
  .template-editor-toolbar { align-items: flex-start; flex-direction: column; }
  .template-editor-toolbar .compact-btn { width: 100%; }
  .rich-editor-help { padding: 9px 10px; }
  .editor-overflow-notice { font-size: 10px; line-height: 1.55; }
  .result-modal-card { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); overflow-y: auto; }
}

/* ========================================================================== 
   자유 요소 편집기: 텍스트 박스 / 도형 / 표 / 이미지
   ========================================================================== */
.custom-element-toolbar {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #d7dfec;
  border-radius: 14px;
  background: #f8faff;
  box-shadow: 0 8px 22px rgba(19,39,70,.06);
}
.custom-tool-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.custom-tool-label {
  margin-right: 2px;
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.custom-add-btn,
.custom-action-btn {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  background: #fff;
  color: var(--ink-700);
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: .15s ease;
}
.custom-add-btn:hover,
.custom-action-btn:hover {
  border-color: #9fb5dd;
  background: #eef4ff;
  color: var(--blue-600);
}
.custom-action-btn.danger:hover {
  border-color: #efb3b6;
  background: #fff1f2;
  color: #c73843;
}
.custom-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}
.custom-inline-field input[type="number"] {
  width: 70px;
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid #cfd9e8;
  border-radius: 9px;
  background: #fff;
  color: var(--ink-700);
  font: inherit;
}
.custom-inline-field select {
  min-width: 112px;
  min-height: 32px;
  padding: 4px 26px 4px 8px;
  border: 1px solid #cfd9e8;
  border-radius: 9px;
  background: #fff;
  color: var(--ink-700);
  font: inherit;
}
.custom-inline-field input[type="color"] {
  width: 34px;
  height: 32px;
  padding: 2px;
  border: 1px solid #cfd9e8;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}
.custom-element-controls.is-disabled { opacity: .52; }
.custom-element-controls.is-disabled > :not(.custom-tool-label) { pointer-events: none; }
.custom-editor-help {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eef5ff;
  color: #52657f;
  font-size: 10px;
  line-height: 1.5;
}

.template-custom-layers {
  position: absolute;
  inset: 0;
  z-index: 32;
  pointer-events: none;
}
.template-custom-element {
  position: absolute;
  box-sizing: border-box;
  min-width: 20px;
  min-height: 12px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}
.template-custom-element.is-selected {
  outline: 2px solid #3975e9;
  outline-offset: 2px;
}
.custom-element-content {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.custom-element-text .custom-element-content {
  padding: 5px 7px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: keep-all;
  outline: none;
  user-select: text;
  cursor: text;
}
.custom-element-table .custom-element-content { overflow: hidden; }
.custom-element-table table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: transparent;
}
.custom-element-table td {
  min-width: 20px;
  padding: 4px 5px;
  border: 1px solid var(--table-border-color, currentColor);
  vertical-align: middle;
  outline: none;
  overflow: hidden;
  overflow-wrap: anywhere;
  user-select: text;
}
.custom-element-image .custom-element-content img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.custom-element-shape .custom-element-content { width: 100%; height: 100%; }
.custom-element-line .custom-element-content {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 0 !important;
  transform: translateY(-50%);
  border-top-style: solid;
}
.custom-element-move-handle,
.custom-element-resize-handle {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #2e63c4;
  border-radius: 7px;
  background: #fff;
  color: #2758ad;
  box-shadow: 0 4px 12px rgba(25,55,105,.20);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: grab;
  opacity: 0;
  pointer-events: none;
}
.custom-element-move-handle { left: -13px; top: -13px; }
.custom-element-resize-handle {
  right: -13px;
  bottom: -13px;
  cursor: nwse-resize;
}
.template-custom-element.is-selected .custom-element-move-handle,
.template-custom-element.is-selected .custom-element-resize-handle {
  opacity: 1;
  pointer-events: auto;
}
.custom-element-move-handle:active { cursor: grabbing; }

.template-editor-stage.is-exporting .template-custom-element {
  outline: 0 !important;
  box-shadow: none !important;
}
.template-editor-stage.is-exporting .custom-element-move-handle,
.template-editor-stage.is-exporting .custom-element-resize-handle {
  display: none !important;
}

@media (max-width: 720px) {
  .custom-element-toolbar {
    position: relative;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .custom-tool-section {
    width: max-content;
    max-width: none;
    flex-wrap: nowrap;
  }
  .custom-element-controls { padding-bottom: 2px; }
  .custom-add-btn,
  .custom-action-btn { min-height: 38px; padding: 7px 11px; font-size: 10px; }
  .custom-element-move-handle,
  .custom-element-resize-handle { width: 32px; height: 32px; }
  .custom-element-move-handle { left: -17px; top: -17px; }
  .custom-element-resize-handle { right: -17px; bottom: -17px; }
}

/* ========================================================================== 
   2026-08-07 기본 템플릿 요소 삭제/복원 + 편집 성능 보강
   ========================================================================== */

/* 사용자가 삭제한 기본 문구/불릿은 편집 화면과 최종 출력 모두에서 완전히 제외합니다. */
.editor-text-layer.is-user-deleted,
.editor-bullet.is-user-deleted {
  display: none !important;
}

/* 카테고리 제목을 삭제해도 PPT 배경에 포함된 원래 제목을 가리는 마스크는 유지됩니다. */
.editor-text-layer.is-section-heading.is-user-deleted + .section-heading-mask,
.section-heading-mask {
  pointer-events: none;
}

.builtin-element-tools {
  gap: 6px;
}

.rich-tool-button.danger-soft {
  border-color: #f1c0c8;
  background: #fff5f6;
  color: #a83145;
}

.rich-tool-button.danger-soft:hover:not(:disabled) {
  border-color: #df8090;
  background: #ffecef;
}

/* PC에서는 자유 요소 도구가 많아도 한 줄에서 과도하게 밀리지 않도록 자연스럽게 감쌉니다. */
@media (min-width: 1081px) {
  .rich-editor-toolbar,
  .custom-element-toolbar {
    flex-wrap: wrap;
  }
}

/* 모바일: 삭제/복원도 손가락으로 누르기 쉬운 최소 높이를 확보합니다. */
@media (max-width: 720px) {
  .builtin-element-tools .rich-tool-button {
    min-height: 40px;
  }
}

/* ========================================================================== 
   2026-09-03 UI Renewal v4
   - 첨부 레퍼런스의 밝고 깨끗한 교육/학습 서비스 톤을 참고한 재구성
   - 기존 DOM/기능은 유지하고 스타일만 안정적으로 고도화
   ========================================================================== */
:root {
  --navy-950: #14213d;
  --navy-900: #1c2b4a;
  --navy-800: #24385e;
  --navy-700: #355078;
  --blue-600: #3978f6;
  --blue-500: #5b91ff;
  --blue-100: #e7f0ff;
  --blue-50: #f4f8ff;
  --cyan-500: #22c6d7;
  --mint-500: #43d7bb;
  --mint-100: #e8fbf6;
  --purple-500: #7769f5;
  --green-600: #0e9a73;
  --green-100: #e8faf4;
  --red-600: #e35268;
  --red-100: #fff0f3;
  --amber-600: #b97612;
  --amber-100: #fff6df;
  --ink-900: #172238;
  --ink-700: #46536b;
  --ink-500: #768198;
  --ink-300: #aab4c5;
  --line: #e1e8f1;
  --line-soft: #edf2f7;
  --surface: rgba(255,255,255,.96);
  --background: #f7fbff;
  --shadow-sm: 0 10px 28px rgba(53, 93, 145, .08);
  --shadow-lg: 0 22px 60px rgba(47, 85, 135, .11);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
}

body {
  background:
    radial-gradient(circle at 7% 5%, rgba(102, 186, 255, .16), transparent 22rem),
    radial-gradient(circle at 92% 15%, rgba(102, 234, 210, .15), transparent 23rem),
    linear-gradient(180deg, #fbfdff 0, #f7fbff 520px, #f4f8fc 100%);
}

.site-header {
  border-bottom: 1px solid rgba(219, 229, 240, .75);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(22px) saturate(1.2);
}
.header-inner { height: 68px; width: min(1240px, calc(100% - 40px)); }
.brand { gap: 10px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 14px;
  box-shadow: 0 10px 25px rgba(54, 111, 233, .16);
}
.brand-copy strong { font-size: 15px; letter-spacing: -.03em; }
.brand-copy small { color: #8a96aa; }
.header-admin-btn {
  border-color: #dce6f1;
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255,255,255,.9);
  color: #48607e;
  box-shadow: 0 7px 20px rgba(52, 92, 143, .06);
}
.header-admin-btn:hover { background: #f2f7ff; border-color: #bdd2f4; }

.hero-section {
  position: relative;
  overflow: hidden;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 82% 24%, rgba(108, 229, 211, .32), transparent 21rem),
    radial-gradient(circle at 8% 14%, rgba(110, 181, 255, .27), transparent 24rem),
    linear-gradient(135deg, #eef8ff 0%, #f7fbff 43%, #effdf8 100%);
  border-bottom: 1px solid #e8f0f7;
}
.hero-section::before,
.hero-section::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(.2px);
}
.hero-section::before {
  width: 210px; height: 210px; right: 9%; top: -55px;
  background: linear-gradient(145deg, rgba(83,135,255,.20), rgba(125,111,250,.08));
}
.hero-section::after {
  width: 150px; height: 150px; right: 3%; bottom: -62px;
  background: linear-gradient(145deg, rgba(65,214,184,.22), rgba(70,172,255,.08));
}
.hero-inner {
  position: relative; z-index: 1;
  width: min(1240px, calc(100% - 40px));
  padding: 54px 0 80px;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 420px);
  gap: 54px;
}
.eyebrow {
  border: 1px solid rgba(63,120,246,.14);
  background: rgba(255,255,255,.78);
  color: #3978f6;
  box-shadow: 0 6px 18px rgba(57,120,246,.06);
}
.hero-copy h1 {
  color: #172238;
  font-size: clamp(36px, 4.8vw, 58px);
  line-height: 1.09;
  letter-spacing: -.055em;
}
.hero-copy h1 em {
  color: transparent;
  background: linear-gradient(100deg, #3978f6, #28b8d3 55%, #23b88d);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-copy p { color: #66748b; font-size: 15px; max-width: 700px; }
.hero-points { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-points span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 11px; border-radius: 999px;
  background: rgba(255,255,255,.85); border: 1px solid #e1ebf5;
  color: #4d617c; font-size: 11px; font-weight: 750;
  box-shadow: 0 7px 18px rgba(57,87,127,.05);
}
.hero-note {
  position: relative;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 24px 25px 25px;
  border: 1px solid rgba(211, 225, 239, .95);
  border-radius: 26px;
  background: rgba(255,255,255,.86);
  color: #66758c;
  box-shadow: 0 22px 55px rgba(61, 101, 151, .10);
  backdrop-filter: blur(14px);
}
.hero-note::before {
  content: "QUICK GUIDE";
  display: inline-flex; width: fit-content;
  padding: 6px 9px; border-radius: 999px;
  background: #eaf4ff; color: #3978f6;
  font-size: 9px; font-weight: 900; letter-spacing: .12em;
}
.hero-note strong { color: #172238; font-size: 18px; }

.workspace {
  width: min(1240px, calc(100% - 40px));
  margin: -34px auto 84px;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 22px;
}
.progress-panel, .form-panel {
  border-color: rgba(219, 229, 240, .9);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-lg);
}
.progress-panel {
  top: 88px;
  padding: 22px 18px;
  border-radius: 26px;
}
.progress-title span { color: #64728a; }
.progress-title strong { color: #3978f6; }
.progress-bar { background: #edf2f7; height: 6px; }
.progress-bar span { background: linear-gradient(90deg, #3978f6, #22c6d7); }
.step-list { gap: 8px; }
.step-item { border: 1px solid transparent; }
.step-item.active {
  color: #203452;
  background: linear-gradient(135deg, #eef5ff, #f2fbff);
  border-color: #d8e8fb;
}
.step-item.active .step-number {
  border: 0;
  background: linear-gradient(135deg, #3978f6, #5b91ff);
  box-shadow: 0 7px 18px rgba(57,120,246,.2);
}
.step-item.done .step-number { border-color: #c6ece1; background: #e8faf4; }
.side-help { background: linear-gradient(135deg, #f6faff, #f5fbf8); border: 1px solid #e8f0f7; }
.help-icon { background: linear-gradient(135deg, #3978f6, #22b9d4); }

.form-panel { border-radius: 30px; }
.form-step { padding: 40px 42px 44px; }
.step-heading { margin-bottom: 30px; }
.step-kicker {
  min-height: auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #3978f6;
  letter-spacing: .09em;
}
.step-heading h2 { margin-top: 10px; font-size: 29px; color: #172238; }
.step-heading p { color: #778299; }

.field-group > label, .admin-login > label { color: #35445b; }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
  border-color: #dde6ef;
  border-radius: 14px;
  background: #fbfdff;
  padding: 13px 14px;
}
input:focus, textarea:focus, select:focus {
  border-color: #76a2ff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(57,120,246,.09);
}
.coach-check-action {
  margin-top: 22px;
  padding: 18px;
  border-color: #e5edf5;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff, #f7fcfa);
}
.inline-primary-btn, .primary-btn {
  background: linear-gradient(135deg, #2f6ff1, #4387ff);
  box-shadow: 0 9px 20px rgba(57,120,246,.18);
}
.submit-btn {
  background: linear-gradient(135deg, #3978f6, #28b8d3);
  box-shadow: 0 10px 24px rgba(57,120,246,.22);
}
.secondary-btn { background: #eff4f8; color: #40536e; }
.ghost-btn { border-color: #dce6ef; color: #40536e; }

.choice-grid { gap: 12px; }
.choice-card {
  border-color: #e2eaf2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(42,77,119,.045);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.choice-option:hover .choice-card {
  transform: translateY(-2px);
  border-color: #c8daf2;
  box-shadow: 0 14px 32px rgba(45,84,132,.09);
}
.choice-option input:checked + .choice-card {
  border-color: #82a9ff;
  background: linear-gradient(140deg, #f0f6ff, #f2fcfb);
  box-shadow: 0 12px 30px rgba(57,120,246,.12);
}
.choice-symbol {
  border-radius: 14px;
  background: linear-gradient(145deg, #ecf4ff, #e9fbf7);
  color: #3978f6;
}
.choice-option input:checked + .choice-card .choice-symbol {
  background: linear-gradient(135deg, #3978f6, #28b8d3);
  color: #fff;
}

.subsection {
  border-color: #e1eaf3;
  border-radius: 22px;
  background: linear-gradient(180deg, #fcfeff, #fafcff);
  box-shadow: 0 8px 25px rgba(57,91,130,.035);
}
.subsection-title h3 { color: #1f2d44; }
.template-option-card { border-radius: 18px; }
.template-thumb { border-radius: 14px; }

.registration-result {
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(25,122,92,.05);
}
.preserve-notice { border-radius: 16px; }

.form-actions {
  padding: 17px 42px;
  border-top-color: #e9eff5;
  background: rgba(251,253,255,.94);
  backdrop-filter: blur(10px);
}

.template-editor-viewport {
  border-color: #dce6ef;
  border-radius: 22px;
  background: linear-gradient(135deg, #eef3f8, #f4f7fb);
  box-shadow: 0 18px 45px rgba(42, 79, 122, .12);
}
.template-editor-toolbar,
.text-style-panel,
.custom-editor-panel {
  border-color: #e1e9f1 !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 9px 25px rgba(45,80,122,.055);
}
.text-style-panel { border-radius: 18px; }

.result-modal-card, .admin-modal-card {
  border: 1px solid #e3ebf3;
  border-radius: 26px;
  box-shadow: 0 28px 85px rgba(32,67,110,.22);
}
.success-mark { background: linear-gradient(135deg, #e6faf4, #e8f5ff); color: #159476; }
.loading-box { border: 1px solid #e2eaf2; border-radius: 24px; }
.spinner { border-top-color: #3978f6; }
.toast { border-radius: 999px; background: #1d2b45; padding-inline: 18px; }

.site-footer { color: #98a3b4; }

@media (max-width: 820px) {
  .hero-inner { padding: 42px 0 62px; gap: 24px; }
  .workspace { margin-top: -27px; }
  .progress-panel {
    padding: 14px 12px;
    border-radius: 21px;
  }
  .progress-title { padding: 0 5px; }
  .step-list { gap: 4px; }
  .step-item {
    min-height: 65px;
    border-radius: 14px;
  }
  .form-panel { border-radius: 24px; }
}

@media (max-width: 640px) {
  body { background: #f7fbff; }
  .header-inner, .hero-inner, .workspace { width: min(100% - 22px, 1240px); }
  .site-header { background: rgba(255,255,255,.93); }
  .header-inner { height: 60px; }
  .brand-logo { width: 35px; height: 35px; }
  .brand-copy strong { font-size: 13px; }
  .header-admin-btn { padding: 7px 10px; }
  .hero-section {
    background:
      radial-gradient(circle at 84% 15%, rgba(90,222,202,.26), transparent 13rem),
      linear-gradient(145deg, #eef8ff, #f8fcff 50%, #f0fbf8);
  }
  .hero-inner { padding: 34px 0 50px; }
  .hero-copy h1 { font-size: 32px; line-height: 1.08; }
  .hero-copy p { font-size: 12.5px; line-height: 1.65; }
  .hero-points { margin-top: 16px; gap: 6px; }
  .hero-points span { padding: 7px 9px; font-size: 10px; }
  .hero-note { padding: 18px; border-radius: 20px; }
  .hero-note strong { font-size: 16px; }
  .workspace { margin-top: -20px; }
  .progress-panel { box-shadow: 0 14px 36px rgba(48,87,133,.10); }
  .step-number { border-radius: 10px; }
  .form-step { padding: 25px 17px 30px; }
  .step-heading h2 { font-size: 23px; }
  .step-heading p { font-size: 12px; }
  input[type="text"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
    min-height: 46px;
    border-radius: 13px;
  }
  .choice-card { border-radius: 16px; }
  .subsection { padding: 17px 14px; border-radius: 18px; }
  .form-actions {
    padding: 12px 17px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.94);
    border-top: 1px solid #e5edf5;
    box-shadow: 0 -9px 24px rgba(42,77,119,.08);
  }
  .primary-btn, .submit-btn, .secondary-btn { border-radius: 12px; }
  .template-editor-viewport { border-radius: 17px; }
  .result-modal-card, .admin-modal-card { border-radius: 22px; }
}

/* ========================================================================== 
   2026-09-03 v5 보완
   - 좌우 패널 높이 정렬
   - AI 문구 도우미
   - 좌측 기본 그래픽 자유 편집
   - 비활성 버튼 실제 클릭 차단
   ========================================================================== */
@media (min-width: 1081px) {
  .progress-panel { min-height: 640px; box-sizing: border-box; }
}
@media (max-width: 1080px) {
  .progress-panel { min-height: 0; }
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed !important;
}
button:disabled { pointer-events: none !important; }

/* 기존 고정 어린이 이미지는 자유 편집 레이어의 시스템 요소로 대체합니다. */
.template-editor-kids-illustration { display: none !important; }
.template-editor-slogan-mask {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 1708px;
  width: 585px;
  height: 393px;
  background: #f7e4c3;
  pointer-events: none;
}
.template-editor-slogan-mask.hidden { display: none !important; }
.template-custom-element.is-system-graphic .custom-element-content {
  background: transparent !important;
  border: 0 !important;
}
.template-custom-element.is-system-graphic:not(.is-selected) .custom-element-move-handle,
.template-custom-element.is-system-graphic:not(.is-selected) .custom-element-resize-handle { opacity: 0; }

.ai-copy-section {
  position: relative;
  overflow: hidden;
  border-color: #d8e7ff;
  background:
    radial-gradient(circle at 94% 8%, rgba(61, 126, 255, .12), transparent 13rem),
    linear-gradient(145deg, #f7fbff, #f7fffc);
}
.ai-copy-section::after {
  content: "AI";
  position: absolute;
  right: -8px;
  bottom: -42px;
  color: rgba(57, 120, 246, .045);
  font-size: 150px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}
.ai-copy-heading { position: relative; z-index: 1; }
.ai-copy-heading h3 { margin-top: 8px; font-size: 19px; }
.ai-mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 5px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3978f6, #25bfcf);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .04em;
}
.ai-copy-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 15px;
  align-items: stretch;
}
.ai-source-field textarea {
  min-height: 132px;
  resize: vertical;
  background: rgba(255,255,255,.92);
}
.optional-label {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf3fa;
  color: #718096;
  font-size: 9px;
  font-weight: 700;
}
.ai-source-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.ai-source-tips span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #5a6f8e;
  font-size: 9px;
  font-weight: 650;
}
.ai-copy-action {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding: 14px;
  border: 1px solid #dbe8f7;
  border-radius: 16px;
  background: rgba(255,255,255,.86);
}
.ai-generate-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #326ff0, #20b9cf);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(57,120,246,.18);
  cursor: pointer;
}
.ai-generate-btn:hover:not(:disabled) { transform: translateY(-1px); }
.ai-generate-btn:disabled { opacity: .65; }
.ai-button-icon { font-size: 18px; }
.ai-copy-action p {
  margin: 0;
  color: #7a8798;
  font-size: 9.5px;
  line-height: 1.55;
}
.ai-draft-status {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(238,245,255,.85);
  color: #667790;
  font-size: 10px;
  line-height: 1.5;
}
.ai-draft-status.is-loading { color: #2f6ff1; background: #edf4ff; }
.ai-draft-status.is-success { color: #137b62; background: #eaf9f4; }
.ai-draft-status.is-error { color: #bd3e53; background: #fff0f3; }

@media (max-width: 760px) {
  .ai-copy-layout { grid-template-columns: 1fr; }
  .ai-copy-action { padding: 11px; }
  .ai-generate-btn { width: 100%; }
  .ai-source-field textarea { min-height: 150px; }
}


/* ========================================================================== 
   2026-09-03 v6 MOBILE APP OPTIMIZATION
   - 모바일 레퍼런스 기준: 얇은 상단바 / 카드형 섹션 / 큰 터치영역 / 하단 CTA
   - PC 레이아웃 축소가 아니라 720px 이하 전용 재배치
   ========================================================================== */
@media (max-width: 720px) {
  :root {
    --mobile-page: #f4f7fb;
    --mobile-card: #ffffff;
    --mobile-line: #e7edf5;
    --mobile-blue: #3978f6;
    --mobile-text: #172238;
    --mobile-sub: #718096;
  }

  html { scroll-padding-top: 64px; }
  body {
    min-width: 0;
    overflow-x: hidden;
    background: var(--mobile-page) !important;
    color: var(--mobile-text);
    word-break: keep-all;
    -webkit-text-size-adjust: 100%;
  }
  .app-shell { width: 100%; overflow: clip; }

  /* 상단: 레퍼런스처럼 얇고 단순한 앱 헤더 */
  .site-header {
    position: sticky !important;
    top: 0;
    z-index: 80;
    height: 56px;
    background: rgba(255,255,255,.97) !important;
    border-bottom: 1px solid var(--mobile-line);
    box-shadow: 0 3px 14px rgba(41,71,110,.05);
    backdrop-filter: blur(16px);
  }
  .header-inner {
    width: 100% !important;
    height: 56px !important;
    padding: 0 14px;
    gap: 8px;
  }
  .brand { gap: 8px; max-width: calc(100% - 78px); }
  .brand-logo { width: 31px !important; height: 31px !important; border-radius: 10px !important; box-shadow: none !important; }
  .brand-copy strong { font-size: 13px !important; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-copy small { display: none !important; }
  .header-admin-btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    background: #f5f8fc !important;
    border-color: #e5ebf3 !important;
    box-shadow: none !important;
    font-size: 10px !important;
  }

  /* 거대한 PC Hero를 모바일용 컴팩트 인트로로 변환 */
  .hero-section {
    min-height: 0;
    background: linear-gradient(145deg, #eef5ff 0%, #f7fbff 55%, #eefaf7 100%) !important;
    border-bottom: 0;
  }
  .hero-section::before,
  .hero-section::after { display: none !important; }
  .hero-inner {
    display: block !important;
    width: 100% !important;
    padding: 19px 16px 31px !important;
  }
  .eyebrow { display: none !important; }
  .hero-copy h1 {
    margin: 0 0 8px !important;
    font-size: 25px !important;
    line-height: 1.18 !important;
    letter-spacing: -.045em !important;
  }
  .hero-copy h1 br { display: none; }
  .hero-copy p {
    max-width: 100%;
    margin: 0;
    color: #66758b !important;
    font-size: 11.5px !important;
    line-height: 1.55 !important;
  }
  .hero-points,
  .hero-note { display: none !important; }

  /* 전체 흐름: 앱 카드가 아래로 이어지는 1열 구조 */
  .workspace {
    display: block !important;
    width: 100% !important;
    margin: -13px 0 30px !important;
    padding: 0 10px;
  }
  .progress-panel {
    position: relative !important;
    top: auto !important;
    z-index: 3;
    min-height: 0 !important;
    margin: 0 0 9px;
    padding: 12px 12px 10px !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,.98) !important;
    box-shadow: 0 8px 24px rgba(44,75,114,.07) !important;
  }
  .progress-title { padding: 0 2px !important; }
  .progress-title span,
  .progress-title strong { font-size: 10.5px !important; }
  .progress-title span em { margin-left: 4px; font-size: 10px; }
  .progress-bar { height: 4px !important; margin-top: 8px !important; }
  .step-list {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0,1fr)) !important;
    gap: 4px !important;
    margin: 9px 0 0 !important;
  }
  .step-item {
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    align-content: center;
    min-height: 45px !important;
    padding: 5px 2px !important;
    border: 0 !important;
    border-radius: 12px !important;
    text-align: center;
    background: transparent !important;
  }
  .step-item.active { background: #f1f6ff !important; }
  .step-number {
    width: 24px !important;
    height: 24px !important;
    border-radius: 8px !important;
    font-size: 9px !important;
  }
  .step-item > span:last-child strong { margin-top: 3px; font-size: 9px !important; line-height: 1.15; }
  .step-item small,
  .side-help { display: none !important; }

  .form-panel {
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .form-step {
    min-height: 0 !important;
    margin: 0;
    padding: 18px 14px 22px !important;
    border: 1px solid var(--mobile-line);
    border-radius: 20px;
    background: var(--mobile-card) !important;
    box-shadow: 0 8px 24px rgba(44,75,114,.055);
  }
  .step-heading {
    margin: 0 0 17px !important;
    padding: 0 0 14px !important;
  }
  .step-heading::after { background: var(--mobile-line) !important; }
  .step-kicker {
    padding: 4px 8px !important;
    border-radius: 8px !important;
    font-size: 9px !important;
  }
  .step-heading h2 {
    margin: 8px 0 6px !important;
    font-size: 20px !important;
    line-height: 1.3 !important;
  }
  .step-heading p {
    font-size: 11px !important;
    line-height: 1.55 !important;
  }

  /* 필드: 모바일 기본 폼처럼 한 줄씩, 터치영역 50px 이상 */
  .field-grid,
  .field-grid.two-columns,
  .field-grid.metrics-grid,
  .coach-identity-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  .field-group > label,
  .admin-login > label { margin-bottom: 7px; font-size: 12px !important; }
  input[type="text"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
    width: 100%;
    min-height: 50px !important;
    padding: 13px 13px !important;
    border-radius: 14px !important;
    border-color: #e0e7f0 !important;
    background: #fafcff !important;
    font-size: 16px !important;
  }
  textarea { min-height: 116px !important; line-height: 1.55; }
  .field-help,
  .validation-message { font-size: 10px !important; line-height: 1.45; }
  .coach-check-action {
    margin-top: 15px !important;
    padding: 12px !important;
    border-radius: 16px !important;
    background: #f7faff !important;
  }
  #checkCoachBtn,
  .coach-check-btn { width: 100% !important; min-height: 48px !important; border-radius: 13px !important; }
  .registration-result { margin-top: 12px; padding: 13px; border-radius: 15px; }

  /* 선택 UI: 작은 데스크톱 카드가 아니라 모바일 리스트 카드 */
  .choice-grid,
  .request-choice-grid,
  .production-choice-grid,
  .resume-action-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
  .choice-card,
  .request-choice-grid .choice-card,
  .production-choice-grid .choice-card,
  .resume-action-grid .choice-card {
    display: grid !important;
    grid-template-columns: 38px minmax(0,1fr) !important;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 10px !important;
    min-height: 70px !important;
    padding: 11px 12px !important;
    border-radius: 15px !important;
    text-align: left !important;
  }
  .choice-symbol {
    grid-row: 1 / span 2;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }
  .choice-card strong { grid-column: 2; grid-row: 1; align-self: end; font-size: 12.5px !important; }
  .choice-card small { grid-column: 2; grid-row: 2; margin: 0 !important; font-size: 9.5px !important; line-height: 1.4; }
  .choice-option input:disabled + .choice-card { opacity: .42; filter: grayscale(.1); }

  .subsection {
    margin-top: 13px;
    padding: 14px 12px !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  .subsection-title { margin-bottom: 12px !important; }
  .subsection-title h3 { font-size: 14px !important; line-height: 1.35; }
  .subsection-title p { margin-top: 4px !important; font-size: 10px !important; line-height: 1.5; text-align: left !important; }

  /* 템플릿: 레퍼런스의 카드 캐러셀처럼 크게 보고 좌우 스와이프 */
  .template-grid {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 10px !important;
    width: auto;
    margin: 0 -2px;
    padding: 2px 8px 8px 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .template-grid::-webkit-scrollbar { display: none; }
  .template-option {
    flex: 0 0 min(76vw, 286px);
    scroll-snap-align: start;
  }
  .template-card { border-radius: 17px !important; box-shadow: 0 7px 20px rgba(45,74,112,.07); }
  .template-card img { width: 100%; aspect-ratio: 1485 / 2101; object-fit: cover; object-position: top; }
  .template-card span { padding: 10px 11px 11px !important; }
  .template-card strong { font-size: 12px !important; }
  .template-card small { margin-top: 2px; font-size: 9.5px !important; }

  /* 사진/제작 관련 */
  .photo-upload-layout { grid-template-columns: 1fr !important; gap: 10px !important; }
  .upload-zone { min-height: 112px; border-radius: 16px !important; }
  .segmented-control.vertical-mobile { grid-template-columns: 1fr 1fr !important; }

  /* AI 도우미: 하나의 모바일 카드 + 전체 폭 CTA */
  .ai-copy-section {
    padding: 15px 13px !important;
    border-radius: 19px !important;
    background: linear-gradient(155deg, #f4f8ff, #f5fffb) !important;
  }
  .ai-copy-section::after { font-size: 92px; right: -3px; bottom: -23px; }
  .ai-copy-heading h3 { margin: 7px 0 5px !important; font-size: 16px !important; line-height: 1.35; }
  .ai-copy-heading p { font-size: 10px !important; line-height: 1.5; }
  .ai-copy-layout { display: block !important; }
  .ai-source-field textarea { min-height: 145px !important; }
  .ai-source-tips { gap: 4px; }
  .ai-source-tips span { padding: 4px 7px; font-size: 8.5px; }
  .ai-copy-action { margin-top: 10px; padding: 10px !important; border-radius: 14px !important; }
  .ai-generate-btn { width: 100%; min-height: 50px; border-radius: 13px; font-size: 12px; }
  .ai-copy-action p { font-size: 9px !important; }
  .ai-draft-status { margin-top: 9px; font-size: 9.5px; }

  /* 이미지 편집: 화면 폭 전체 활용, 상단 도구는 스와이프 가능한 터치 툴레일 */
  .template-editor-section {
    margin-left: -4px;
    margin-right: -4px;
    padding: 13px 8px !important;
    overflow: visible !important;
  }
  .template-editor-toolbar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-bottom: 8px;
    padding: 9px 10px !important;
    border-radius: 13px !important;
    font-size: 9.5px !important;
  }
  .template-editor-toolbar .compact-btn { width: 100% !important; min-height: 40px; }
  .rich-editor-toolbar {
    position: relative !important;
    top: auto !important;
    z-index: 2 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100%;
    max-height: none !important;
    margin: 0 0 8px !important;
    padding: 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-radius: 13px !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .rich-editor-toolbar::-webkit-scrollbar { display: none; }
  .rich-tool-group { flex: 0 0 auto; min-height: 40px; padding-right: 6px; }
  .rich-tool-group > label { display: none !important; }
  .rich-tool-button { min-width: 38px !important; height: 38px !important; border-radius: 10px !important; }
  .rich-tool-field select { width: 116px !important; height: 38px !important; font-size: 12px !important; }
  .rich-tool-size input { width: 52px !important; height: 38px !important; font-size: 12px !important; }
  #toolbarLineHeightSelect { height: 38px !important; }
  .rich-editor-help { margin-bottom: 8px; padding: 8px 9px; border-radius: 10px; font-size: 9px !important; }

  .custom-element-toolbar {
    position: relative !important;
    display: block !important;
    margin: 8px 0 !important;
    padding: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-radius: 13px !important;
    scrollbar-width: none;
  }
  .custom-element-toolbar::-webkit-scrollbar { display: none; }
  .custom-tool-section { width: max-content !important; flex-wrap: nowrap !important; gap: 6px; }
  .custom-add-btn,
  .custom-action-btn { min-height: 40px !important; border-radius: 10px !important; }
  .custom-inline-field input[type="number"],
  .custom-inline-field select { min-height: 38px !important; font-size: 12px !important; }

  .template-editor-viewport {
    width: 100% !important;
    border-radius: 14px !important;
    border-color: #dce5ef !important;
    box-shadow: 0 8px 26px rgba(43,74,114,.08) !important;
    touch-action: pan-y;
  }
  .template-editor-stage { transform-origin: top left; }
  .editor-text-layer { -webkit-tap-highlight-color: transparent; }
  .template-custom-element.is-selected { outline-width: 3px; }
  .custom-element-move-handle,
  .custom-element-resize-handle { width: 38px !important; height: 38px !important; border-radius: 11px !important; font-size: 16px; }
  .custom-element-move-handle { left: -19px !important; top: -19px !important; }
  .custom-element-resize-handle { right: -19px !important; bottom: -19px !important; }

  /* 리뷰와 동의 */
  .review-card { border-radius: 16px !important; }
  .review-item { grid-template-columns: 86px minmax(0,1fr) !important; gap: 8px; font-size: 10.5px; }
  .agreement-box { padding: 13px !important; border-radius: 15px !important; }
  .agreement-box strong { font-size: 11.5px !important; }
  .agreement-box small { font-size: 9.5px !important; line-height: 1.45; }

  /* 모바일 앱의 하단 주요 CTA처럼 고정감 있게 */
  .form-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 70 !important;
    min-height: 68px !important;
    margin: 9px -10px 0;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom)) !important;
    gap: 8px !important;
    border: 1px solid var(--mobile-line) !important;
    border-bottom: 0 !important;
    border-radius: 18px 18px 0 0;
    background: rgba(255,255,255,.97) !important;
    box-shadow: 0 -8px 26px rgba(41,70,108,.10) !important;
    backdrop-filter: blur(16px);
  }
  .form-actions .action-spacer,
  .draft-status { display: none !important; }
  .form-actions .secondary-btn,
  .form-actions .primary-btn,
  .form-actions .submit-btn {
    flex: 1 1 0;
    width: auto !important;
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 11px 10px !important;
    border-radius: 13px !important;
    font-size: 12px !important;
  }

  .site-footer { display: none !important; }
  .toast {
    left: 12px !important;
    right: 12px !important;
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    max-width: none !important;
    transform: none !important;
    border-radius: 13px !important;
    font-size: 10.5px !important;
  }

  /* 모달은 모바일 하단 시트/전체화면 패턴 */
  .modal-backdrop { align-items: end !important; padding: 0 !important; }
  .result-modal-card {
    width: 100% !important;
    max-height: 92dvh !important;
    padding: 25px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    border-radius: 24px 24px 0 0 !important;
    overflow-y: auto;
  }
  .admin-modal-card {
    width: 100% !important;
    height: 100dvh !important;
    max-height: none !important;
    border-radius: 0 !important;
  }
  .modal-header { position: sticky; top: 0; z-index: 12; padding: 15px 14px !important; background: #fff; }
  .template-admin-dashboard { padding: 10px !important; }
  .template-admin-columns { grid-template-columns: 1fr !important; }
  .template-admin-list-panel,
  .template-admin-form-panel { padding: 12px !important; border-radius: 15px !important; }
  .template-admin-workspace { grid-template-columns: 1fr !important; }
  .admin-template-preview-card { position: static !important; max-width: 100% !important; }
}

@media (max-width: 390px) {
  .hero-copy h1 { font-size: 23px !important; }
  .workspace { padding: 0 8px; }
  .form-step { padding-left: 12px !important; padding-right: 12px !important; }
  .template-option { flex-basis: 80vw; }
  .review-item { grid-template-columns: 78px minmax(0,1fr) !important; }
}
