/* 콩나물 2026-08 6종 기능 공통 스타일 - 320/360/390/430/768/1024/1440px 전부에서 가로 스크롤이
   생기지 않도록 모든 폭을 상대 단위 + max-width:100%로 잡고, 표/코드/카드는 자체 스크롤 박스를 씁니다. */

.v6-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.v6-wrap * { box-sizing: border-box; max-width: 100%; }

.v6-head { margin: 8px 0 18px; }
.v6-head h1 { font-size: clamp(1.35rem, 5vw, 2rem); line-height: 1.3; margin: 0 0 8px; word-break: keep-all; overflow-wrap: anywhere; }
.v6-head p { margin: 0; color: #4b5563; line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere; }
.v6-eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .08em; color: #2E9E44; text-transform: uppercase; }

.v6-card {
  border: 1px solid #e5e7eb; border-radius: 14px; background: #fff;
  padding: 16px; margin: 0 0 14px;
}
.v6-card h2 { font-size: 1.05rem; margin: 0 0 10px; word-break: keep-all; }
.v6-card h3 { font-size: .95rem; margin: 14px 0 8px; }

.v6-field { margin: 0 0 14px; }
.v6-field > label, .v6-legend { display: block; font-weight: 700; font-size: .92rem; margin: 0 0 6px; }
.v6-field .v6-help { font-size: .82rem; color: #6b7280; margin: 0 0 8px; line-height: 1.5; }
.v6-field input[type="text"], .v6-field input[type="number"], .v6-field select, .v6-field textarea {
  width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 1rem;
  background: #fff; color: #111827;
}
.v6-field input:focus-visible, .v6-field select:focus-visible, .v6-field textarea:focus-visible,
.v6-wrap button:focus-visible, .v6-wrap a:focus-visible, .v6-opt input:focus-visible + span {
  outline: 3px solid #f59e0b; outline-offset: 2px;
}
.v6-err { margin-top: 6px; color: #b91c1c; font-size: .85rem; font-weight: 700; }

.v6-opts { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 480px) { .v6-opts.two { grid-template-columns: 1fr 1fr; } }
.v6-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px;
  border: 1px solid #d1d5db; border-radius: 10px; cursor: pointer; line-height: 1.45;
  font-size: .95rem; background: #fff;
}
.v6-opt input { margin-top: 2px; flex: 0 0 auto; width: 18px; height: 18px; }
.v6-opt.checked { border-color: #2E9E44; background: #f2fbf4; }
.v6-opt.checked span::before { content: "✔ "; font-weight: 900; color: #2E9E44; }

.v6-steps { display: flex; gap: 6px; margin: 0 0 16px; flex-wrap: wrap; }
.v6-step {
  flex: 1 1 auto; min-width: 56px; text-align: center; font-size: .78rem; font-weight: 700;
  padding: 8px 4px; border-radius: 999px; background: #f3f4f6; color: #6b7280;
}
.v6-step.on { background: #2E9E44; color: #fff; }
.v6-step.done { background: #dcfce7; color: #166534; }

.v6-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.v6-actions .btn, .v6-actions button { flex: 1 1 150px; min-height: 48px; }

.v6-result-price {
  font-size: clamp(1.35rem, 6vw, 2.1rem); font-weight: 900; color: #14532d;
  line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere;
}
.v6-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .78rem;
  font-weight: 800; border: 1px solid transparent;
}
.v6-badge.ok { background: #dcfce7; color: #166534; border-color: #86efac; }
.v6-badge.warn { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.v6-badge.info { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.v6-badge.gray { background: #f3f4f6; color: #374151; border-color: #d1d5db; }

.v6-kv { display: grid; grid-template-columns: minmax(96px, 40%) 1fr; gap: 6px 12px; font-size: .9rem; }
.v6-kv dt { color: #6b7280; word-break: keep-all; }
.v6-kv dd { margin: 0; font-weight: 600; word-break: keep-all; overflow-wrap: anywhere; }

.v6-tablebox { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 12px; }
.v6-tablebox table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: .88rem; }
.v6-tablebox th, .v6-tablebox td { border-bottom: 1px solid #e5e7eb; padding: 9px 8px; text-align: right; white-space: nowrap; }
.v6-tablebox th:first-child, .v6-tablebox td:first-child { text-align: left; white-space: normal; word-break: keep-all; }
.v6-tablebox thead th { background: #f9fafb; font-weight: 800; }

.v6-state { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: 12px; background: #f9fafb;
  border: 1px solid #e5e7eb; font-size: .92rem; line-height: 1.55; flex-wrap: wrap; }
.v6-state-icon { font-size: 1.15rem; }
.v6-state-msg { flex: 1 1 180px; word-break: keep-all; overflow-wrap: anywhere; }
.v6-state-action { flex: 1 1 100%; }
.v6-state-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.v6-state-denied { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.v6-note { font-size: .84rem; color: #6b7280; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.v6-disclaimer {
  margin-top: 14px; padding: 12px 14px; border-left: 4px solid #f59e0b; background: #fffbeb;
  border-radius: 0 10px 10px 0; font-size: .84rem; line-height: 1.65; color: #78350f;
  word-break: keep-all; overflow-wrap: anywhere;
}
.v6-lawnote { font-size: .8rem; color: #6b7280; margin-top: 10px; line-height: 1.6; }

.v6-share-img { width: 100%; height: auto; border-radius: 14px; display: block; border: 1px solid #e5e7eb; }
.v6-copy-input { width: 100%; margin-top: 8px; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: .85rem; }

.v6-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.v6-listitem { border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; }
.v6-listitem .row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.v6-listitem .row strong { word-break: keep-all; overflow-wrap: anywhere; }

/* 고정 카카오 문의 버튼과 겹치지 않도록 하단 CTA에 여백을 확보합니다. */
/* 카카오 문의 버튼은 우측 하단 고정(높이 48px + 아래 14~20px 여백)이므로, 가로 폭을 줄이는 대신
   하단 여백으로 CTA를 그 위로 띄웁니다. 이렇게 하면 320px 화면에서도 버튼이 좁아지지 않습니다. */
.v6-sticky-cta {
  position: sticky; bottom: 0; padding: 12px 0 calc(76px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 24%);
}
@media (min-width: 768px) { .v6-sticky-cta { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }

/* 스크린리더 전용 텍스트(표 caption 등) - site.css에 없어 여기서 정의합니다. */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: static !important; left: auto !important; display: inline-block;
  padding: 8px 12px; background: #111827; color: #fff; border-radius: 0 0 8px 0;
}

.v6-modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex;
  align-items: flex-end; justify-content: center; z-index: 60; padding: 0; }
@media (min-width: 640px) { .v6-modal { align-items: center; padding: 24px; } }
.v6-modal[hidden] { display: none; }
.v6-modal-inner {
  background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0;
  max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 640px) { .v6-modal-inner { border-radius: 16px; max-height: 82vh; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------------------
   라운드9: 파일 생성 진행 표시 + 준비 전 공유 버튼 잠금 (모바일 320px 겹침 방지)
   --------------------------------------------------------------------------- */
.v6-genstatus { margin: 12px 0 4px; }
.v6-genstatus .v6-state { flex-wrap: wrap; padding: 12px 14px; }
.v6-genstatus .v6-state-action { margin-top: 8px; }
.v6-genstatus .v6-state-action .btn { min-height: 44px; width: 100%; }

/* 진행 표시와 버튼 줄이 세로로 확실히 분리되도록(겹침 방지) 별도 블록으로 둡니다. */
.v6-shareactions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.v6-shareactions .btn, .v6-shareactions button { min-height: 48px; }

/* 320~429px(대부분의 소형 단말)에서는 버튼을 한 줄에 하나씩 - 글자가 잘리거나
   버튼끼리 겹치는 일이 생기지 않습니다. 430px 이상에서만 2열로 배치합니다. */
@media (max-width: 429px) {
  .v6-shareactions .btn, .v6-shareactions button { flex: 1 1 100%; }
}
@media (min-width: 430px) {
  .v6-shareactions .btn, .v6-shareactions button { flex: 1 1 46%; }
}

/* 준비 전 잠금 상태: 색상만이 아니라 커서/투명도/aria-disabled 로 함께 알립니다. */
.v6-locked, .btn.v6-locked, button.v6-locked, a.v6-locked {
  opacity: .5; cursor: not-allowed; pointer-events: none; filter: grayscale(35%);
}
a.v6-locked { text-decoration: none; }

.v6-share-img { width: 100%; max-width: 100%; height: auto; display: block; border-radius: 12px; }
