/* 도구 상세 페이지 시안 E2(수신함 624ff3): 이미지 도구(studio.css) 작업 화면 방식을 모든 도구에 맞춘다.
   가운데 제목 + 짧은 설명 → 번호 알약 사용 방법 → 흰 도구 카드(입력 띠 회색, 결과 띠 흰색, 큰 실행 버튼, 단계 번호 유지)
   → 예시 → 자세한 안내. 값은 studio.css 작업 카드에서 가져왔다(22px 모서리, 1px 선, 옅은 그림자, 파랑 #0075de).
   도구 JS가 그린 요소는 옮기지 않는다. 모양만 바꾼다. */
main[data-tool-layout="e2"]:not(#e2) {
  --e2-blue: #0075de;
  --e2-blue-soft: #e6f3fe;
  --e2-band: #f5f5f7;
  --e2-pad: 32px;
  --e2-radius: 22px;
}

/* ── 제목: 가운데 정렬 + 짧은 설명 (studio-heading) ── */
main[data-tool-layout="e2"]:not(#e2) :is(.tool-e2-heading, .tool-hero) { text-align: center; max-width: 800px; margin: 0 auto; padding: 0 0 28px; }
main[data-tool-layout="e2"]:not(#e2) :is(.tool-e2-heading, .tool-hero) h1 { max-width: 22ch; margin: 0 auto; font-size: clamp(30px, 4vw, 48px); line-height: 1.2; letter-spacing: -.03em; text-wrap: balance; }
main[data-tool-layout="e2"]:not(#e2) :is(.tool-e2-heading, .tool-hero) > p,
main[data-tool-layout="e2"]:not(#e2) .tool-e2-lead { max-width: 600px; margin: 16px auto 0; font-size: var(--type-lead, 1.125rem); line-height: 1.65; color: var(--muted); letter-spacing: -.01em; text-wrap: pretty; }
main[data-tool-layout="e2"]:not(#e2).tools20-page > .tool-e2-heading { margin-bottom: 0; }

/* ── 간단한 사용 방법: 카드 바로 위 번호 알약 한 줄 ── */
main[data-tool-layout="e2"]:not(#e2) .tool-quick-start { max-width: none; margin: 0 0 16px; padding: 0; border: 0; background: none; text-align: center; }
main[data-tool-layout="e2"]:not(#e2) .tool-quick-start h2 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
main[data-tool-layout="e2"]:not(#e2) .tool-quick-start ol { counter-reset: e2qs; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
main[data-tool-layout="e2"]:not(#e2) .tool-quick-start li { counter-increment: e2qs; display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; margin: 0; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface, #fff); font-size: var(--type-small, .9375rem); line-height: 1.4; color: var(--ink); text-align: left; overflow-wrap: anywhere; }
main[data-tool-layout="e2"]:not(#e2) .tool-quick-start li + li { margin-top: 0; }
main[data-tool-layout="e2"]:not(#e2) .tool-quick-start li::before { content: counter(e2qs); flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--e2-blue); color: #fff; font-size: 12px; font-weight: 700; }

/* ── 도구 카드 (studio .workspace와 같은 겉모양) ── */
main[data-tool-layout="e2"]:not(#e2) .tool-e2-card { box-sizing: border-box; min-width: 0; border: 1px solid var(--line); border-radius: var(--e2-radius); box-shadow: 0 8px 40px #1d1d1f14, 0 1px 3px #1d1d1f0f; }
main[data-tool-layout="e2"]:not(#e2) .tool-e2-card + *,
main[data-tool-layout="e2"]:not(#e2) .tool-e2-seg-last + * { margin-top: 40px; }

/* tools20: 카드 = 회색 입력 띠, 마지막 단계(결과) = 흰 띠 */
main[data-tool-layout="e2"]:not(#e2) section.tool-e2-card.tools20-app { margin: 0; padding: 0 var(--e2-pad); background: var(--surface, #fff); }
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app { margin: 0; padding: 0; }
/* 도구 파트 바깥 껍데기(자체 배경·테두리·여백)를 걷어 낸다. 안쪽 칸은 그대로. */
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app > :is(section, div):first-of-type { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app > :is(section, div):first-of-type > :first-child:not(h1, h2) { margin-top: 24px; }
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app > :is(section, div):first-of-type > :last-child { margin-bottom: 24px; }
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app > :is(section, div):first-of-type > :is(h2, .lp-title):first-child + :not(section) { margin-top: 24px; }

/* 단계 칸: 상자 대신 카드 폭을 채우는 띠로. 단계 사이 가는 선. */
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app section[class*="step"]:not([class*="step-"] section),
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app section[class*="__step"] {
  margin: 0 calc(-1 * var(--e2-pad)); padding: 24px var(--e2-pad); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--e2-band); box-shadow: none;
}
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app section[class*="step"]:not(:has(~ section[class*="step"])) { background: var(--surface, #fff); border-bottom: 1px solid var(--line); }
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app section[class*="step"]:not(:has(~ section[class*="step"])):last-child { margin-bottom: 0; border-bottom: 0; border-radius: 0 0 calc(var(--e2-radius) - 1px) calc(var(--e2-radius) - 1px); }
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app > :first-of-type > section[class*="step"]:first-of-type:first-child { border-top: 0; }

/* 단계 번호: 파란 동그라미 */
main[data-tool-layout="e2"]:not(#e2) .tools20-app .lp-step-number { background: var(--e2-blue-soft); color: var(--e2-blue); }
main[data-tool-layout="e2"]:not(#e2) .tools20-app :is(.lp-step[data-state="current"], .lp-step-current) .lp-step-number { background: var(--e2-blue); color: #fff; }

/* 큰 실행 버튼: 파란 알약 */
main[data-tool-layout="e2"]:not(#e2) .tool-e2-card :is(button, a):is(.primary, .lp-primary, .dc-primary, .ir-primary, .jr-primary, .lbc-primary, [class*="__primary"]):not(.choose-file),
main[data-tool-layout="e2"]:not(#e2) .tool-e2-seg button.button.accent {
  min-height: 48px; padding-inline: 28px; border-radius: 980px; font-size: 1rem; font-weight: 600;
}
main[data-tool-layout="e2"]:not(#e2) .tool-e2-card :is(button, a):is(.primary, .lp-primary, .dc-primary, .ir-primary, .jr-primary, .lbc-primary, [class*="__primary"]):not(:disabled),
main[data-tool-layout="e2"]:not(#e2) .tool-e2-seg button.button.accent:not(:disabled) {
  border-color: var(--e2-blue); background: var(--e2-blue); color: #fff;
}
main[data-tool-layout="e2"]:not(#e2) .tool-e2-card :is(button, a):is(.primary, .lp-primary, .dc-primary, .ir-primary, .jr-primary, .lbc-primary, [class*="__primary"]):not(:disabled):hover,
main[data-tool-layout="e2"]:not(#e2) .tool-e2-seg button.button.accent:not(:disabled):hover { border-color: var(--ink); background: var(--ink); color: #fff; }

/* 이미지 도구: 원래 카드 모양 그대로, 알약 줄과 아래 예시 간격만 맞춘다. */
main[data-tool-layout="e2"]:not(#e2) .studio-heading + .tool-quick-start { margin-top: -8px; }

/* 별도 구조 도구(.tool-hero): /tool-card.js가 도구 부분에 tool-e2-seg를 붙인다. 옮기지 않고 이어 보이게 한다. */
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-seg {
  box-sizing: border-box; min-width: 0; margin: 0; padding: 20px var(--e2-pad); border: 1px solid var(--line); border-top-width: 0; border-bottom-width: 0;
  border-radius: 0; background: var(--e2-band); box-shadow: none;
}
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-seg + .tool-e2-seg { border-top: 1px solid #e8e8ed; }
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-seg-first { padding-top: 28px; border-top-width: 1px; border-top-color: var(--line); border-radius: var(--e2-radius) var(--e2-radius) 0 0; }
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-seg-last { padding-bottom: 28px; border-bottom-width: 1px; border-radius: 0 0 var(--e2-radius) var(--e2-radius); background: var(--surface, #fff); box-shadow: 0 8px 40px #1d1d1f14, 0 1px 3px #1d1d1f0f; }
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-seg-first.tool-e2-seg-last { border-radius: var(--e2-radius); }
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-seg:not(.tool-e2-seg-first):not(.tool-e2-seg-last):is(:empty, [hidden]) { padding: 0; border-top: 0; }
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-seg > :first-child { margin-top: 0; }
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-seg > :last-child { margin-bottom: 0; }
/* 결과 칸(#…-results 등)은 흰 띠 */
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-seg:is([id$="results"], [class*="results"], #print-area) { background: var(--surface, #fff); }

/* 키워드줍기: 미리캔버스에서 도는 도구라 시작 버튼과 상태 안내를 흰 카드로 묶는다. */
main[data-tool-layout="e2"]:not(#e2) .kp-e2-card { margin: 8px auto 0; padding: 24px var(--e2-pad); background: var(--surface, #fff); text-align: center; }
main[data-tool-layout="e2"]:not(#e2) .kp-e2-card .kp-actions { margin-top: 0; justify-content: center; }
main[data-tool-layout="e2"]:not(#e2) .kp-e2-card > :last-child { margin-bottom: 0; }
main[data-tool-layout="e2"]:not(#e2) .kp-hero .tool-quick-start { margin-top: 20px; }

@media (max-width: 760px) {
  main[data-tool-layout="e2"]:not(#e2) { --e2-pad: 16px; --e2-radius: 18px; }
  main[data-tool-layout="e2"]:not(#e2) :is(.tool-e2-heading, .tool-hero) { padding-bottom: 22px; }
  main[data-tool-layout="e2"]:not(#e2) :is(.tool-e2-heading, .tool-hero) > p,
  main[data-tool-layout="e2"]:not(#e2) .tool-e2-lead { font-size: 1rem; margin-top: 12px; }
  main[data-tool-layout="e2"]:not(#e2) .tool-quick-start ol { flex-direction: column; align-items: stretch; }
  main[data-tool-layout="e2"]:not(#e2) .tool-quick-start li { border-radius: 16px; }
  main[data-tool-layout="e2"]:not(#e2) .tool-e2-card :is(button, a):is(.primary, .lp-primary, .dc-primary, .ir-primary, .jr-primary, .lbc-primary, [class*="__primary"]):not(.choose-file) { padding-inline: 20px; }
  main[data-tool-layout="e2"]:not(#e2) .tool-e2-card + *,
  main[data-tool-layout="e2"]:not(#e2) .tool-e2-seg-last + * { margin-top: 32px; }
}

/* 첫 단계 앞 안내·상태 줄과 첫 단계 사이 간격 */
main[data-tool-layout="e2"]:not(#e2) .tools20-app #tool-app > :is(section, div):first-of-type > :not(section[class*="step"]):has(+ section[class*="step"]) { margin-bottom: 24px; }

/* 키워드줍기 제목도 가운데로 */
main[data-tool-layout="e2"]:not(#e2) .kp-hero { max-width: 800px; margin-inline: auto; text-align: center; }
main[data-tool-layout="e2"]:not(#e2) .kp-hero .kp-lead { margin-inline: auto; }
main[data-tool-layout="e2"]:not(#e2) .kp-e2-card .kp-first { margin-inline: auto; }

/* 긴 선택지 글(영어) 때문에 선택 상자가 카드 밖으로 나가지 않게 */
main[data-tool-layout="e2"]:not(#e2) :is(.tool-e2-card, .tool-e2-seg) :is(select, input:not([type=checkbox], [type=radio]), textarea) { max-width: 100%; }
/* 검토 화면의 '이전·다음 변경' 단추 줄(명단 비교·표 비교·연락처 정리 공용)이 좁은 화면에서 넘치지 않게 줄바꿈 */
main[data-tool-layout="e2"]:not(#e2) .tool-e2-card .lp-review-navigation { flex-wrap: wrap; }

/* 별도 구조 도구: 도구 JS가 그린 분류 줄이 사용 방법 알약과 카드 사이에 끼지 않게 제목 바로 아래로 올리고 눅인다. */
main[data-tool-layout="e2"]:not(#e2):has(> .tool-hero) { display: flex; flex-direction: column; }
main[data-tool-layout="e2"]:not(#e2):has(> .tool-hero) > .tool-hero { order: -2; }
main[data-tool-layout="e2"]:not(#e2):has(> .tool-hero) > [class*="category"]:not(.daycare-category) { order: -1; margin: -12px auto 16px; font-size: .8125rem; line-height: 1.5; color: var(--muted); text-align: center; opacity: .8; }

/* ── 별도 구조 도구(.tool-hero): 도구 JS·CSS가 늦게 붙기 전부터 최종 자리를 잡아 레이아웃 이동을 없앤다 ── */
/* 1) 위 여백: tool.css(JS가 나중에 붙임)·support.js가 나중에 바꾸는 값을 처음부터 같은 값으로 둔다. */
main[data-tool-layout="e2"]:not(#e2):has(> .tool-hero) { padding-top: 40px; }
main#tool-root[data-tool-layout="e2"]:not(#e2):has(> .tool-hero) { padding-top: 24px; }
@media (max-width: 1023px) {
  main[data-tool-layout="e2"]:not(#e2):has(> .tool-hero) { padding-top: 16px; }
  main#tool-root[data-tool-layout="e2"]:not(#e2):has(> .tool-hero) { padding-top: 24px; }
}
@media (max-width: 600px) {
  main#tool-root[data-tool-layout="e2"]:not(#e2):has(> .tool-hero) { padding-top: 20px; }
}
/* 2) 카드 틀: 정적 HTML에 처음부터 있는 빈 카드(tool-e2-seg 최종 클래스 포함). 도구가 그려지면 /tool-card.js가 걷어 낸다.
   높이는 도구를 실제로 그린 높이에 맞춘 값(scripts/tool-card-frames.json → 빌드가 만드는 /tool-card-frames.css의 --frame-h·--frame-hm; 운영 CSP style-src 'self'가 HTML 인라인 style을 막아 외부 규칙으로 둔다). visibility:hidden이라 자리만 잡고 그려지지 않는다(제목 글꼴 교체로 위 칸이 움직일 때 빈 카드가 같이 튀어 CLS로 잡히는 것을 막는다). */
main[data-tool-layout="e2"]:not(#e2) > .tool-e2-frame { min-height: var(--frame-h, 480px); pointer-events: none; visibility: hidden; }
@media (max-width: 760px) {
  main[data-tool-layout="e2"]:not(#e2) > .tool-e2-frame { min-height: var(--frame-hm, var(--frame-h, 480px)); }
}

/* ── 카드 맨 위 첫 안내 숨김(사용자 결정 A) ──
   제목 아래 짧은 설명과 거의 같은 말인 첫 안내(도구 파트 맨 위 제목 바로 뒤 일반 문단)를 카드에서 숨긴다. 빌드가 해당 페이지의 카드에 data-tool-intro="hide"를 달아 둔다.
   상태·안내(role·aria-live·status 클래스) 줄은 건드리지 않는다. display만 끄고 문구 데이터는 그대로다. */
main[data-tool-layout="e2"]:not(#e2) .tools20-app[data-tool-intro="hide"] #tool-app > :is(section, div):first-of-type > p:first-of-type:not([class*="status"], [role], [aria-live]) { display: none; }
/* 숨긴 안내 뒤 요소가 제목 바로 뒤로 올라오므로 간격을 같게 맞춘다. */
main[data-tool-layout="e2"]:not(#e2) .tools20-app[data-tool-intro="hide"] #tool-app > :is(section, div):first-of-type > :is(h2, .lp-title):first-child + p:first-of-type:not([class*="status"], [role], [aria-live]) + :not(section) { margin-top: 24px; }

/* 첫 안내 숨김 tools20 쪽: 파트(#tool-app)가 올라오기 전에도 올라온 뒤와 같은 높이를 잡아 아래 칸이 밀리지 않게 한다(scripts/tool-card-app-frames.json 높이표 → /tool-card-frames.css의 --app-h·--app-hm).
   파트가 올라오면(data-mounted) 또는 실패하면(data-mount-error) 바로 풀어, 결과가 줄거나 늘어도 빈 자리가 남지 않는다. */
main[data-tool-layout="e2"]:not(#e2) .tools20-app[data-tool-intro="hide"] #tool-app:not([data-mounted], [data-mount-error]) { min-height: var(--app-h, 0); }
@media (max-width: 760px) {
  main[data-tool-layout="e2"]:not(#e2) .tools20-app[data-tool-intro="hide"] #tool-app:not([data-mounted], [data-mount-error]) { min-height: var(--app-hm, var(--app-h, 0)); }
}
