/* =====================================================================
   학원 홈페이지 체험(/experience) — 편집 도구 (WO-TANZMATE-EXPERIENCE-FIRST-PHASE1B-001)
   홈페이지 디자인은 academy-site.css(ah-)를 그대로 쓰고, 여기에는 그 위에 얹는 체험 도구(ax-)만 둔다.
   ===================================================================== */
#ax-app { min-height: 100vh; }
#ax-app section:focus { outline: none; }
/* --ax-fixed: 스크롤해도 화면 위에 남는 도구 막대 높이 */
html:has(.ax-bar) { --ax-fixed: 60px; scroll-padding-top: calc(var(--ax-fixed) + 64px); }
html:has(dialog[open]) { overflow: hidden; }

/* ---------- 시작 화면 ---------- */
.ax-start { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 40px 24px; background: radial-gradient(1200px 600px at 50% 110%, #EDE6F7 0%, rgba(237,230,247,0) 70%), #fff; }
.ax-home { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; flex: none; }
.ax-home:hover { text-decoration: underline; }
.ax-start .ax-home { position: absolute; top: 12px; left: 20px; color: var(--ah-ink-2); }
.ax-start h1 { font-family: var(--ah-serif); font-size: 44px; line-height: 1.3; margin: 0 0 32px; }
.ax-start .ah-btn { height: 56px; padding: 0 40px; font-size: 17px; }
.ax-start p { margin: 22px 0 0; font-size: 13px; color: var(--ah-ink-3); }
.ax-reveal { animation: ax-reveal .6s ease both; }
@keyframes ax-reveal { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 체험 도구 막대 (편집 화면·방문자 화면 공통) ---------- */
.ax-bar { position: sticky; top: 0; z-index: 60; background: var(--ah-ink); color: #fff; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 20px; }
.ax-bar-top { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.ax-bar-main { flex: none; display: flex; align-items: center; gap: 10px; }
.ax-steps { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ax-steps button { border: 1px solid rgba(255,255,255,.22); color: #DDD7E4; border-radius: 999px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.ax-steps button.ax-done { border-color: rgba(74,222,128,.55); color: #BBF7D0; }
.ax-steps button span { font-size: 11px; }
.ax-steps button.ax-current { background: #fff; color: var(--ah-ink); border-color: #fff; font-weight: 700; }
.ax-count { font-size: 13px; color: #CFCAD6; white-space: nowrap; }
.ax-progress { display: none; margin-left: auto; min-height: 44px; font-size: 13px; color: #fff; white-space: nowrap; text-decoration: underline; text-underline-offset: 4px; }
.ax-visitor-note { font-size: 13px; line-height: 1.35; color: #FDE68A; }
.ax-modes { display: flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.14); }
.ax-modes button { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; color: #DDD7E4; white-space: nowrap; }
.ax-modes button[aria-pressed="true"] { background: #fff; color: var(--ah-ink); font-weight: 700; }
.ax-text { color: #DDD7E4; font-size: 13px; padding: 10px 6px; white-space: nowrap; }
.ax-text:hover { color: #fff; }
.ax-bar .ah-btn { height: 40px; font-size: 13px; padding: 0 14px; }
.ax-bar :is(a, button):focus-visible { outline: 2px solid #FDE68A; outline-offset: 2px; }
:is(.ax-editing, .ax-visitor) .ah-site-header { top: var(--ax-fixed); }

/* ---------- 섹션 편집 표시: 예시도 완성된 홈페이지처럼 보이게 흐리지 않는다 ---------- */
.ax-section { position: relative; }
.ax-section.ax-current::after { content: ""; position: absolute; inset: 4px; border: 3px solid var(--ah-accent); border-radius: 20px; pointer-events: none; z-index: 3; }
.ax-flash { animation: ax-flash 1.4s ease; }
@keyframes ax-flash { 0% { background-color: #F3EEFE; } }
.ax-tools { position: absolute; top: 18px; right: 20px; z-index: 5; display: flex; gap: 8px; align-items: center; }
.ax-tools span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #FFF4D6; color: #7A5300; border: 1px solid #F1DDA5; white-space: nowrap; }
.ax-tools span.ax-mine { background: #E9F7EE; color: #166534; border-color: #BBE5C8; }
.ax-tools button { height: 44px; padding: 0 18px; border-radius: 999px; background: var(--ah-accent); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 4px 14px rgba(124,58,237,.35); }
.ax-tools button:hover { background: var(--ah-accent-ink); }
[data-edit-item] { cursor: pointer; }
.ax-editing article[data-edit-item] { position: relative; transition: border-color .15s; }
.ax-editing article[data-edit-item]:hover { border-color: var(--ah-accent); }
.ax-editing article[data-example]::after { content: "예시"; position: absolute; top: 10px; right: 10px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #FFF4D6; color: #7A5300; border: 1px solid #F1DDA5; }
.ax-map { position: relative; }
.ax-map i { position: absolute; background: #fff; }
.ax-map i:nth-child(1) { left: 0; right: 0; top: 58%; height: 18px; }
.ax-map i:nth-child(2) { top: 0; bottom: 0; left: 38%; width: 16px; }
.ax-map span { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); background: var(--ah-ink); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 8px; max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 다음 할 일 ---------- */
.ax-next { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 55; width: max-content; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--ah-line); box-shadow: 0 12px 40px rgba(20,16,24,.18); border-radius: 16px; padding: 14px 14px 14px 20px; display: flex; gap: 16px; align-items: center; }
.ax-next b { display: block; font-size: 12px; color: var(--ah-accent); }
.ax-next span { display: block; font-size: 15px; font-weight: 600; }
.ax-next .ah-btn { flex: none; }
.ax-close { color: var(--ah-ink-3); font-size: 13px; padding: 12px 6px; flex: none; }
.ax-editing .ah-site-footer { padding-bottom: 130px; }

/* ---------- 편집창: PC = 오른쪽 패널 / 모바일 = Bottom Sheet ---------- */
.ax-sheet { position: fixed; inset: 0 0 0 auto; margin: 0; width: 460px; max-width: 100vw; height: 100%; max-height: none; border: 0; padding: 0; background: #fff; color: var(--ah-ink); box-shadow: -12px 0 40px rgba(20,16,24,.15); }
.ax-sheet[open] { animation: ax-from-right .22s ease; }
.ax-sheet::backdrop, .ax-modal::backdrop { background: rgba(20,16,24,.35); }
@keyframes ax-from-right { from { transform: translateX(60px); opacity: 0; } }
@keyframes ax-from-bottom { from { transform: translateY(80px); opacity: 0; } }
.ax-form { display: flex; flex-direction: column; height: 100%; }
.ax-form header { padding: 20px 24px 12px; border-bottom: 1px solid var(--ah-line); }
.ax-form header span { font-size: 12px; color: var(--ah-accent); font-weight: 700; }
.ax-form h2 { margin: 2px 0 4px; font-size: 21px; outline: none; }
.ax-form header p { margin: 0; font-size: 13px; color: var(--ah-ink-2); }
.ax-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px; }
.ax-form footer { border-top: 1px solid var(--ah-line); padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 8px; }
.ax-form footer p { width: 100%; margin: 0; font-size: 14px; font-weight: 600; }
.ax-form footer .ah-btn { flex: 1; height: 50px; padding: 0 12px; }
.ax-form footer .ah-btn-accent { flex: 2; }
.ax-danger { background: #B42318; color: #fff; }
.ax-danger:hover { background: #912018; }

.ax-field { margin-bottom: 18px; }
.ax-field > label, .ax-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.ax-field em { color: #D92D20; font-style: normal; margin-left: 2px; }
.ax-sheet :is(input:not([type=checkbox]), textarea, select) { width: 100%; min-height: 46px; border: 1px solid #BDB6C7; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ah-ink); background-color: #fff; }
.ax-sheet textarea { resize: vertical; }
.ax-sheet :is(input, textarea, select):focus { outline: 2px solid var(--ah-accent); outline-offset: 0; border-color: var(--ah-accent); }
.ax-sheet [aria-invalid="true"] { border-color: #D92D20 !important; }
.ax-hint { margin: 6px 0 0; font-size: 12px; color: var(--ah-ink-3); display: flex; justify-content: space-between; gap: 12px; }
.ax-error { margin: 6px 0 0; font-size: 13px; color: #B42318; }
.ax-check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 14px; }
.ax-check input { width: 20px; height: 20px; accent-color: var(--ah-accent); }
.ax-choice { display: flex; gap: 6px; }
.ax-choice button { flex: 1; height: 46px; border: 1px solid #BDB6C7; border-radius: 10px; font-size: 14px; }
.ax-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ax-tags button { min-height: 44px; padding: 0 16px; border: 1px solid #BDB6C7; border-radius: 999px; font-size: 14px; }
.ax-sheet button[aria-pressed="true"] { background: var(--ah-ink); border-color: var(--ah-ink); color: #fff; }
.ax-note { margin: 16px 0 0; font-size: 12px; color: var(--ah-ink-2); background: var(--ah-paper-2); border-radius: 10px; padding: 10px 12px; }
.ax-none { color: var(--ah-ink-3); font-size: 14px; margin: 0 0 12px; }
.ax-add { width: 100%; height: 48px; border: 1.5px dashed #B79DF0; background: #FBF9FF; color: var(--ah-accent-ink); border-radius: 12px; font-weight: 600; }
.ax-link { color: var(--ah-ink-2); font-size: 13px; text-decoration: underline; padding: 12px 0; display: block; }
.ax-remove { color: #B42318; margin-top: 8px; }
.ax-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.ax-list li { border: 1px solid var(--ah-line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.ax-list li > div { flex: 1; min-width: 0; }
.ax-list b { font-size: 15px; }
.ax-list span { display: block; font-size: 13px; color: var(--ah-ink-2); }
.ax-list i { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #FFF4D6; color: #7A5300; margin-left: 4px; white-space: nowrap; }
.ax-list button { border: 1px solid var(--ah-line); border-radius: 8px; height: 44px; padding: 0 14px; font-size: 13px; flex: none; }
.ax-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; padding: 10px 12px 12px; border: 1px solid var(--ah-line); border-radius: 12px; margin: 0 0 10px; min-width: 0; }
.ax-row legend { font-size: 12px; color: var(--ah-ink-3); padding: 0 4px; }
.ax-row label { font-size: 12px; font-weight: 600; min-width: 0; }
.ax-row :is(input, select) { margin-top: 4px; padding: 8px; min-width: 0; }
.ax-row label:first-of-type { grid-column: 1 / -1; }
.ax-row button { align-self: end; height: 46px; border: 1px solid var(--ah-line); border-radius: 10px; font-size: 13px; }
.ax-row .ax-error { grid-column: 1 / -1; margin: 0; }
.ax-menu { display: grid; gap: 8px; margin-bottom: 18px; }
.ax-menu > * { border: 1px solid var(--ah-line); border-radius: 12px; padding: 14px 16px; min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; text-decoration: none; }
.ax-menu span { font-size: 13px; color: var(--ah-ink-2); flex: none; }

/* ---------- 안내 창 · 알림 ---------- */
.ax-modal { width: min(440px, calc(100vw - 32px)); margin: auto; border: 0; border-radius: 20px; padding: 28px; color: var(--ah-ink); background: #fff; }
.ax-modal h2 { font-family: var(--ah-serif); font-size: 23px; line-height: 1.4; margin: 0 0 10px; }
.ax-modal p { color: var(--ah-ink-2); font-size: 15px; margin: 0 0 12px; }
.ax-modal p.ax-note { font-size: 13px; }
.ax-modal .ah-btn { width: 100%; height: 50px; margin-top: 8px; }
.ax-toast { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); background: var(--ah-ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 80; opacity: 0; transition: opacity .2s; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
.ax-toast.ax-show { opacity: 1; }
.ax-noscript { padding: 80px 24px; text-align: center; }

/* 단계 버튼이 한 줄에 들어가지 않는 폭: 「체험 단계」 버튼으로 대신한다 */
@media (max-width: 1279px) {
  .ax-steps, .ax-count { display: none; }
  .ax-progress { display: inline-block; }
}
/* 휴대전화·태블릿: 첫 줄(홈·진행 상태)은 스크롤하면 올라가고 나머지는 남는다 */
@media (max-width: 960px) {
  .ax-bar { display: block; height: auto; top: -44px; padding: 0 16px; }
  .ax-bar:has(.ax-bar-top :focus-visible) { top: 0; }   /* 키보드로 이동하면 올라간 첫 줄을 다시 보인다 */
  .ax-bar-top { height: 44px; }
  .ax-bar-main { height: 60px; }
  .ax-bar-main .ah-btn { margin-left: auto; }
  .ax-visitor-note { margin-left: auto; text-align: right; }
  .ax-modes button { height: 38px; }
  .ax-text { min-height: 44px; padding: 0 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; }
  .ax-bar .ah-btn { height: 44px; }
}
/* 휴대전화: 회원가입 버튼을 한 줄로. 학원 헤더는 고정하지 않아 홈페이지를 가리는 높이가 늘지 않는다
   (터치 기기는 640px까지, 마우스를 쓰는 기기는 확대한 PC 배치가 들어가지 않는 600px 미만부터) */
@media (max-width: 599.98px), (max-width: 640px) and (hover: none), (max-width: 640px) and (pointer: coarse), (max-width: 640px) and (pointer: none) {
  html:has(.ax-bar) { --ax-fixed: 108px; scroll-padding-top: calc(var(--ax-fixed) + 8px); }
  .ax-bar { padding: 0 12px; }
  .ax-bar-main { height: 108px; flex-wrap: wrap; align-content: center; gap: 8px; }
  .ax-modes { flex: 1; }
  .ax-modes button { flex: 1; height: 38px; padding: 0 4px; }
  .ax-bar-main .ah-btn { flex: 1 0 100%; font-size: 15px; }
  .ax-visitor-note { font-size: 12px; }
  :is(.ax-editing, .ax-visitor) .ah-site-header { position: relative; top: auto; }
}
@media (max-width: 960px) {
  .ax-start h1 { font-size: 34px; }
  .ax-tools { top: 12px; right: 12px; }
  .ax-next { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); transform: none; width: auto; max-width: none; padding: 12px 8px 12px 16px; gap: 10px; }
  .ax-next > div { flex: 1; min-width: 0; }
  .ax-next span { font-size: 14px; }
  .ax-next .ah-btn { padding: 0 14px; font-size: 14px; white-space: normal; max-width: 46%; line-height: 1.25; }
  .ax-sheet { inset: auto 0 var(--ax-bottom, 0) 0; width: 100%; height: calc(var(--ax-visible, 100dvh) * .92); border-radius: 20px 20px 0 0; }
  .ax-sheet[open] { animation-name: ax-from-bottom; }
  .ax-form header { padding: 18px 20px 12px; }
  .ax-body { padding: 16px 20px; }
  .ax-form footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
}
/* PC: 「← TANZMATE 홈」을 테두리 버튼으로, 스크롤해도 항상 보이게 한다.
   PC 브라우저를 확대하면 폭이 960px 이하가 되므로 마우스를 쓰는 기기도 포함한다. 터치 기기(휴대전화 가로 모드 포함)는 바뀌지 않는다. */
@media (min-width: 961px), (min-width: 600px) and (hover: hover) and (pointer: fine) {
  .ax-home { min-height: 40px; padding: 0 16px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; font-size: 15px; font-weight: 700; }
  .ax-home:hover { background: rgba(255,255,255,.14); text-decoration: none; }
  .ax-start .ax-home { top: 10px; border-color: var(--ah-ink-2); color: var(--ah-ink); background: #fff; }
  .ax-start .ax-home:hover { background: var(--ah-paper-2); }
}
/* 확대한 PC(600~960px): 진행 상태만 올라가고 홈 버튼은 화면 전환·처음부터·회원가입과 같은 줄에 남는다 */
@media (min-width: 600px) and (max-width: 960px) and (hover: hover) and (pointer: fine) {
  .ax-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; height: 104px; padding: 0 12px; }
  .ax-bar-top, .ax-bar-main { display: contents; }
  .ax-progress, .ax-visitor-note { order: -1; flex: 0 0 100%; height: 44px; display: flex; align-items: center; justify-content: flex-end; }
  .ax-home { font-size: 14px; padding: 0 12px; }
  .ax-modes, .ax-text, .ax-bar .ah-btn { margin-block: 8px; }
  .ax-modes button { padding: 0 8px; }
  .ax-bar .ah-btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) { .ax-reveal, .ax-flash, .ax-sheet[open] { animation: none; } }
