/* 공통 common.css */

/* Pretendard — 페이지에서 사용하는 굵기(300~800) */
@font-face {
  font-family: 'Pretendard';
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Pretendard-Light.woff2') format('woff2');
}

@font-face {
  font-family: 'Pretendard';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Pretendard-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Pretendard';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Pretendard-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Pretendard';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Pretendard-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Pretendard';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Pretendard-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'Pretendard';
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Pretendard-ExtraBold.woff2') format('woff2');
}

:root {
  /* text */
  --text: #0f172a;
  --text-sub: #4b586b;
  --text-muted: #64748b;
  --text-placeholder: #9ca3af;

  /* border */
  --border: #e2e8f0;
  --border-strong: #d1d5db;
  --focus-border: #94a3b8;

  /* background */
  --bg: #ffffff;
  --bg-sub: #f8fafc;
  --bg-elevated: #f1f5f9;

  /* primary */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;

  /* state */
  --danger: #ef4444;
  --success: #0d9488;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-inner {
  width: 100%;
  max-width: 1024px;
  box-sizing: border-box;
}

.page-inner-narrow {
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------------------- */
/* 검색 필드(MFC002·MFC003) · .search-page 레이아웃은 content.css */
/* -------------------------------------------------------------------------- */

.search-page-title {
  margin: 0 0 32px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.03em;
  color: var(--text);
  text-align: center;
}

.search-page-form {
  margin: 0;
}

.search-field {
  position: relative;
  display: block;
}

.search-field-label {
  display: block;
}

.search-field-input {
  width: 100%;
  height: 52px;
  padding: 0 52px 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.search-field-input::placeholder {
  color: var(--text-placeholder);
}

.search-field-input:hover {
  border-color: var(--border-strong);
}

.search-field-input:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.search-field-submit {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.search-field-submit:hover {
  color: var(--text-muted);
  background: var(--bg-sub);
}

.search-field-submit:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.search-field-submit img {
  width: 22px;
  height: 22px;
  opacity: 0.85;
}

.search-recent {
  margin-top: 36px;
  text-align: left;
}

.search-recent-label {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.search-recent-empty {
  margin: 20px 0;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-placeholder);
  text-align: center;
}

.search-recent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.search-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  font-size: inherit;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.search-tag:hover {
  border-color: var(--focus-border);
  background: var(--bg-sub);
}

.search-tag:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* 본문 main 기본 패딩·정렬(layout.css min-height 와 병합 · main.css .main-page > main 예외) */
/* -------------------------------------------------------------------------- */

.layout-wrapper>main {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 24px 80px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .layout-wrapper>main {
    padding: 36px 20px 80px;
  }
}

.flow-result>main {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.flow-result>main::before {
  content: '';
  flex: 4 0 0;
}

.flow-result>main::after {
  content: '';
  flex: 6 0 0;
}

/* 섹션 블록 상단 간격(메인·콘텐츠 공통) */
.section {
  margin: 70px 0 0;
}

@media (max-width: 640px) {
  .section {
    margin: 40px 0 0;
  }
}

/* 섹션 헤드 · 타이틀 · 더보기(레이아웃 공통) */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

h2.section-title,
h3.section-title {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.35px;
  line-height: 1.35;
  color: var(--text);
}

.section-more {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
}

/* 페이지 공통 상단 타이틀 */
.page-main-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 56px;
}

.page-main-lead {
  margin: 0 0 24px;
  text-align: center;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--text-muted);
}

.page-main-title:has(+ .page-main-lead) {
  margin-bottom: 10px;
}

.page-main-title+.page-main-lead {
  margin-bottom: 56px;
}

.section-head:has(.page-main-title)+.page-main-lead {
  margin-bottom: 56px;
}

@media (max-width: 640px) {

  html,
  body {
    font-size: 14px;
  }

  .page-main-title {
    font-size: 22px;
    margin-bottom: 36px;
  }

  .page-main-lead {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
  }

  .page-main-title+.page-main-lead {
    margin-bottom: 36px;
  }

  .section-head:has(.page-main-title)+.page-main-lead {
    margin-bottom: 36px;
  }

  .section-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  h2.section-title,
  h3.section-title {
    font-size: 18px;
    margin-bottom: 12px;
  }
}

/* 폼 기본 */
input[type='text'],
input[type='search'],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  background-color: var(--bg);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-active);
  box-shadow: 0 0 0 2px rgba(26, 77, 140, 0.15);
}

/* form-box 공통 */
.form-box>div {
  margin-bottom: 22px;
}

/* 필드 제목 — 마크업에 .form-label 필수 (.form-box 안 어디에 두어도 동일 적용) */
.form-box .form-label {
  display: block;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-sub);
}

.form-box .form-label b {
  color: var(--danger);
  font-weight: 700;
}

/* 파일 첨부 — .form-box 공통 (상담 요청·심의필·광고 신청 등, .file-upload-rows 행 사용 시) */
.form-box .file-upload>.file-upload-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.form-box .file-upload>.file-upload-head .form-label {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.form-box .file-upload>.file-upload-head>.btn {
  flex-shrink: 0;
}

.form-box .file-upload .file-upload-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-box .file-upload .file-upload-rows>[data-upload-row] {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.form-box .file-upload .file-upload-rows>[data-upload-row]>input[readonly] {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  height: 50px;
  padding: 0 16px;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  cursor: default;
}

.form-box .file-upload .file-upload-rows>[data-upload-row]>input[readonly]::placeholder {
  color: var(--text-placeholder);
}

.form-box .file-upload .file-upload-rows>[data-upload-row]>input[readonly]:focus {
  box-shadow: none;
  border-color: var(--border);
}

.form-box .file-upload .file-upload-rows>[data-upload-row]>.file-upload-file-trigger {
  box-sizing: border-box;
  flex: 0 0 104px;
  width: 104px;
  min-width: 104px;
  height: 50px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  white-space: nowrap;
}

.form-box .file-upload .file-upload-rows>[data-upload-row]>.file-upload-row-remove {
  box-sizing: border-box;
  flex: 0 0 50px;
  width: 50px;
  min-width: 50px;
  height: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sub);
}

.form-box .file-upload>.file-upload-add {
  display: block;
  width: 24px;
  height: 24px;
  margin: 10px auto 0;
  border: none;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary);
  font-size: 18px;
  line-height: 24px;
}

.form-box .file-upload>.file-upload-add::before {
  content: '+';
}

.form-box .combo {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.form-box .combo:focus-within {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.form-box .combo input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  font-family: inherit;
  color: var(--text);
  border: none;
  background: transparent;
}

.form-box .combo input::placeholder {
  color: var(--text-placeholder);
}

.form-box .combo input:focus {
  outline: none;
}

.form-box .combo button {
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--bg-sub);
  border: none;
  border-left: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.form-box .combo button:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.form-box .combo button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  z-index: 1;
}

.form-field {
  width: 100%;
}

/* 한 줄: 필드 제목 + 인라인 라디오(예/아니오 등) */
.form-box .form-field.form-field--label-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 40px;
}

.form-box .form-field.form-field--label-inline>.form-label {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.form-box .form-field.form-field--label-inline .c-radio {
  margin-right: 0;
}

@media (max-width: 640px) {

  /* 모바일: 라벨 아래로 인라인 라디오 내려쓰기 */
  .form-box .form-field.form-field--label-inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 14px;
  }

  .form-box .form-field.form-field--label-inline>.form-label {
    flex: 0 0 100%;
    width: 100%;
  }
}

/* 후기 별점(0.5단위) — .star-unit data-state ↔ assets/js/ui.js */
.form-box .review-rate {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.form-box .review-rate>p:first-of-type {
  margin: 24px 0 10px 0;
  font-size: 17px;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.02em;
}

.form-box .review-rate-stars.star-half {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  margin: 16px 0 0;
  padding: 4px 0;
}

.form-box .review-rate-stars.star-half .star-unit {
  position: relative;
  width: 40px;
  height: 38px;
  flex-shrink: 0;
}

.form-box .review-rate-stars.star-half .star-bg,
.form-box .review-rate-stars.star-half .star-fill {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.form-box .review-rate-stars.star-half .star-bg {
  z-index: 0;
  color: var(--border-strong);
}

.form-box .review-rate-stars.star-half .star-fill {
  z-index: 1;
  color: #ffd910;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.12s ease;
}

.form-box .review-rate-stars.star-half .star-unit[data-state='half'] .star-fill {
  clip-path: inset(0 50% 0 0);
}

.form-box .review-rate-stars.star-half .star-unit[data-state='full'] .star-fill {
  clip-path: inset(0 0 0 0);
}

.form-box .review-rate-stars.star-half .star-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: block;
  width: 50%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.form-box .review-rate-stars.star-half .star-hit-l {
  left: 0;
}

.form-box .review-rate-stars.star-half .star-hit-r {
  right: 0;
}

.form-box .review-rate-stars.star-half .star-hit input[type='radio'] {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  transform: translate(-50%, -50%);
}

/* 폼 하단 CTA — 주 버튼 전폭 + 선택 시 보조 버튼 행(form-actions-sub) */
.form-actions {
  margin-top: 22px;
}

.form-actions>.btn-primary {
  width: 100%;
  box-sizing: border-box;
}

.form-actions-sub {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.form-actions-sub .btn {
  flex: 1;
  min-width: 0;
}

/* 폼 하단 2열 — 보조(링크·라인) + 주요 제출 (모달 .c-modal-btns 와 동일 레이아웃, 페이지 폼용) */
.form-actions.form-actions-split {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.form-actions.form-actions-split .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 16px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  text-decoration: none;
}

.form-actions.form-actions-split .btn:hover {
  border-color: var(--focus-border);
  background: var(--bg-sub);
}

.form-actions.form-actions-split .btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-actions.form-actions-split .btn-primary {
  border: none;
  border-radius: 12px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--bg);
  background: var(--primary);
}

.form-actions.form-actions-split .btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.form-actions.form-actions-split .btn-primary:focus-visible {
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .form-actions {
    margin-top: 12px;
  }

  .form-actions.form-actions-split {
    display: flex;
    flex-direction: column;
    max-width: none;
  }
}

.form-input,
.form-textarea {
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-family: inherit;
}

.form-textarea {
  font-size: 16px;
  min-height: 132px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-placeholder);
  font-size: 16px;
}

.form-input+.form-text {
  margin-top: 10px;
}

@media (max-width: 768px) {

  .form-input,
  .form-textarea {
    font-size: 14px;
  }

  .form-input::placeholder,
  .form-textarea::placeholder {
    font-size: 14px;
  }
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.form-input[readonly] {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
  cursor: default;
}

.form-input[readonly]:focus {
  box-shadow: none;
  border-color: var(--border);
}

.form-textarea[readonly] {
  height: auto;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
  cursor: default;
  resize: none;
}

.form-textarea[readonly]:focus {
  box-shadow: none;
  border-color: var(--border);
}

.form-inline {
  display: flex;
  gap: 8px;
}

.form-inline .form-input {
  flex: 1;
}

.form-input[type='password']+.form-input[type='password'] {
  margin-top: 10px;
}

.form-text {
  margin: -2px 0 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.form-label+.form-text {
  margin-top: -5px;
}

.form-box .signup-agree {
  padding: 0;
  border: none;
}

.form-box .signup-agree>label {
  display: flex;
  gap: 10px;
  cursor: pointer;
}

.form-box .signup-agree>label.all {
  align-items: center;
  display: flex;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.form-box .signup-agree>label:not(.all) {
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-sub);
}

.form-box .signup-agree>div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 36px;
}

.form-box .signup-agree>div label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-sub);
  cursor: pointer;
}

@media (max-width: 640px) {
  .form-box .signup-agree>div label {
    font-size: 14px;
  }
}

.form-box .signup-agree>label.all.c-check>input[type='checkbox'] {
  margin-top: 0;
}

.form-box .signup-agree a.more {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: transparent url('/assets/images/ic-chevron-right.svg') center / 18px 18px no-repeat;
  border-radius: 8px;
}

.form-box .signup-agree a.more:is(:hover, :focus-visible) {
  background-color: var(--bg-sub);
}

.form-box .signup-agree a.more:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-box>button[type='submit'],
.form-box>.form-actions>button[type='submit'] {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-sub);
  background: #e5e7eb;
  border: none;
  border-radius: 12px;
  cursor: not-allowed;
  font-family: inherit;
}

.form-box>button[type='submit']:not(:disabled),
.form-box>.form-actions>button[type='submit']:not(:disabled) {
  color: var(--bg);
  background: var(--primary);
  cursor: pointer;
}

.form-box>button[type='submit']:not(:disabled):hover,
.form-box>.form-actions>button[type='submit']:not(:disabled):hover {
  background: var(--primary-hover);
}

.form-box>button[type='submit']:focus-visible:not(:disabled),
.form-box>.form-actions>button[type='submit']:focus-visible:not(:disabled) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-box>.form-actions>button[type='submit'] {
  margin-top: 0;
}

/* 버튼 베이스 — 변형은 main.css 등에서 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 버튼 변형 — 항상 .btn 과 함께 사용 (예: class="btn btn-primary", <a class="btn btn-line btn-sm">) */
.btn.btn-primary {
  border: none;
  color: var(--bg);
  background: var(--primary);
  font-weight: 700;
}

.btn.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn.btn-primary:focus-visible {
  outline-offset: 3px;
}

.btn.btn-line,
.btn.btn-sub {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  box-sizing: border-box;
}

.btn.btn-line {
  text-decoration: none;
}

.btn.btn-line:hover:not(:disabled),
.btn.btn-sub:hover:not(:disabled) {
  background: var(--bg-sub);
  border-color: var(--focus-border);
}

.btn.btn-sub {
  font-weight: 600;
}

/* 크기(sm) — 항상 .btn 과 함께 (예: class="btn btn-line btn-sm") */
.btn.btn-sm {
  min-height: auto;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* MO 전용 줄바꿈 — PC 기본 숨김, 모바일(640px 이하)에서만 줄바꿈 */
br.br-mo {
  display: none;
}

/* 칩 행: 가로 스크롤(ui.js 드래그와 연동) */
.chip-scroll {
  min-width: 0;
  max-width: 100%;
  margin-bottom: 6px;
}

.chip-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 0 2px 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  touch-action: pan-x pinch-zoom;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip-scroll>.chip-row {
  cursor: grab;
}

.chip-scroll>.chip-row.dragging {
  cursor: grabbing;
  user-select: none;
}

/* FC 프로필 · 별점 · 메타 */
/* 원형 프로필 이미지(공통) — 컨텍스트별 사이즈는 부모 선택자로 재정의 (.fc-profile-grid .avatar 등) */
.avatar {
  width: 70px;
  height: 70px;
  border-radius: 999px;
  background: #eef2f7;
  border: 1px solid var(--border);
  object-fit: cover;
  object-position: center 89%;
  display: block;
  flex: none;
}

.c-rate {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--primary);
}

.c-rate-star {
  color: #ffd910;
}

.c-rate-count {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-sub);
}

.c-dot-line {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-sub);
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: flex-start;
  text-align: left;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.c-dot-line>span:not(.location) {
  flex-shrink: 0;
}

.c-dot-line>span.location {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.c-dot-line .location>span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.c-dot-line>span:not(:last-child)::after {
  content: '|';
  display: inline-block;
  margin: 0 6px;
  font-size: 10px;
  line-height: 1;
  font-weight: 300;
  color: #cbd5e1;
  vertical-align: 0.06em;
}

/* 공통 폼 선택 컨트롤 (checkbox / radio) */
.c-check,
.c-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-sub);
  margin-right: 10px;
}

@media (max-width: 640px) {

  /* 모바일: 체크박스/라디오 텍스트가 여러 줄일 때 아이콘 기준 상단 정렬 */
  .c-check,
  .c-radio {
    align-items: flex-start;
  }
}

.c-check>input[type='checkbox'],
.c-radio>input[type='radio'] {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--primary);
  cursor: pointer;
}

@media (max-width: 768px) {

  .c-check>input[type='checkbox'],
  .c-radio>input[type='radio'] {
    width: 18px;
    height: 18px;
  }
}

.c-check>input[type='checkbox']:focus-visible,
.c-radio>input[type='radio']:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.c-check>input[type='checkbox']:disabled,
.c-radio>input[type='radio']:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.c-check>input[type='checkbox']:disabled+*,
.c-radio>input[type='radio']:disabled+* {
  color: var(--focus-border);
}

/* 회색 배경 안내 박스 — 폼 부가 안내·유의사항 등 */
.gray-box {
  margin: 8px 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-sub);
  box-sizing: border-box;
}

.gray-box>.dash-list {
  margin: 0;
}

/* 공통 대시 목록 (-) — 폼 안내(탈퇴·심의필 등) */
.dash-list {
  margin: 0;
}

.dash-list>li {
  position: relative;
  margin-bottom: 6px;
  padding-left: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.dash-list>li:last-child {
  margin-bottom: 0;
}

.dash-list>li::before {
  content: '-';
  position: absolute;
  top: 0;
  left: 0;
  color: currentColor;
}

/* 인라인 경고·필수 강조 — 폼·완료 화면 등 공통 (strong.warn) */
strong.warn {
  font-weight: 700;
  color: var(--danger);
}

/* dash-list 내 보조 강조(안내·경고 문구 등) — 부모 .dash-list 안에서만 적용 */
.dash-list .warn {
  font-weight: 700;
  color: var(--danger);
}

.dash-list .uline {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #475569;
}

/* 헤더 · 반응형 (모든 페이지 공통 · layout.css 이후 덮어쓰기용 .site-header) */
@media (max-width: 640px) {
  .site-header .header-inner {
    padding: 10px 16px;
    justify-content: space-between;
    min-height: auto;
    gap: 10px 0;
  }

  .site-header .gnb {
    width: 100%;
  }

  .site-header .gnb ul {
    flex-wrap: wrap;
    justify-content: end;
    gap: 14px;
  }

  .site-header .gnb a {
    font-size: 14px;
    padding: 8px 0;
  }

  /* 모바일: 검색 아이콘 · 회원가입·로그인 버튼 축소 */
  .site-header .gnb ul {
    gap: 10px;
  }

  .site-header .gnb a.gnb-search {
    padding: 2px;
  }

  .site-header .gnb a.gnb-search .gnb-ico {
    width: 18px;
    height: 18px;
  }

  .site-header .gnb a.gnb-btn-line {
    padding: 5px 8px;
    font-size: 13px;
    line-height: 1.2;
    border-radius: 6px;
  }

  br.br-mo {
    display: revert;
  }
}

/* -------------------------------------------------------------------------- */
/* 헤더 · 모바일 전용 상단 바 (.header-mo) — PC는 .header-inner만 노출 */
/* <header class="site-header …">
 *   <div class="header-mo" aria-label="상단 도구">…</div>
 *   <div class="header-inner">…로고·GNB…</div>
 * </header>
 * -------------------------------------------------------------------------- */

.site-header>.header-mo {
  display: none;
}

@media (max-width: 640px) {
  .site-header:has(> .header-mo)>.header-mo {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    justify-items: stretch;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 12px 18px;
    box-sizing: border-box;
    min-height: 52px;
    background: var(--bg);
    border-bottom: 1px solid #e0e0e0;
  }

  .site-header:has(> .header-mo) {
    background: var(--bg);
    box-shadow: none;
    border-bottom: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header:has(> .header-mo)>.header-inner {
    display: none !important;
  }

  .site-header>.header-mo>a:first-of-type {
    grid-column: 1;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: -8px 0 -8px -8px;
    color: var(--text-sub);
    text-decoration: none;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
  }

  .site-header>.header-mo>a:first-of-type:hover {
    color: var(--text);
  }

  .site-header>.header-mo>a:first-of-type:focus-visible {
    color: var(--text);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }

  .site-header>.header-mo .header-mo-spacer {
    grid-column: 3;
    justify-self: end;
    width: 44px;
    height: 1px;
  }

  .site-header>.header-mo>div {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .site-header>.header-mo button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--text-sub);
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .site-header>.header-mo button:hover {
    color: var(--text);
  }

  .site-header>.header-mo button:focus-visible {
    color: var(--text);
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }

  .site-header>.header-mo .c-bookmark-btn {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    background-image: url('/assets/images/ic-detail-bookmark.svg');
  }

  .site-header>.header-mo .c-bookmark-btn[aria-pressed='true'] {
    background-image: url('/assets/images/ic-detail-bookmark-on.svg');
  }

  .site-header>.header-mo .detail-share-btn {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    background-image: url('/assets/images/ic-detail-share.svg');
  }

  .site-header>.header-mo svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  .site-header>.header-mo img {
    width: 22px;
    height: 22px;
    display: block;
  }
}

/* -------------------------------------------------------------------------- */
/* 세그먼트 탭(MFC005 상담관리 등) — 페이지별 오버라이드는 content.css */
/* -------------------------------------------------------------------------- */

.c-tabs {
  display: flex;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}

.c-tabs>a,
.c-tabs>button {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-right: 1px solid #e5e7eb;
  box-sizing: border-box;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.c-tabs>a:last-child,
.c-tabs>button:last-child {
  border-right: none;
}

/* -------------------------------------------------------------------------- */
/* 공통 팝업 (PC: 중앙 모달 · 모바일: 바텀시트) data-popup-target 로 열기 */
/* 토스트 app-toast (아래) 포함 body.popup-open 스크롤 잠금 */
/* -------------------------------------------------------------------------- */

body.popup-open {
  overflow: hidden;
}

.c-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.c-modal.is-open {
  display: flex;
}

.c-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.c-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 400px;
  max-height: min(90vh, 640px);
  background: var(--bg);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

/* 공통 팝업 크기 옵션: sm(기본) / md / lg */
.c-modal.sm .c-modal-panel {
  max-width: 400px;
}

.c-modal.md .c-modal-panel {
  max-width: 640px;
}

.c-modal.lg .c-modal-panel {
  max-width: 920px;
  max-height: min(92vh, 760px);
}

.c-modal-head {
  position: relative;
  flex-shrink: 0;
  padding: 18px 48px 14px;
  border-bottom: 1px solid var(--bg-elevated);
}

.c-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--text);
}

.c-modal-meta {
  margin-bottom: 10px;
  text-align: right;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
}

.c-modal-close {
  position: absolute;
  top: 9px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent url('/assets/images/ic-close.svg') center / 20px 20px no-repeat;
  color: var(--text-muted);
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  cursor: pointer;
  border-radius: 8px;
}

.c-modal-close:hover {
  background-color: var(--bg-sub);
}

.c-modal-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.c-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--text-sub);
}

.c-modal-body .form-text {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.c-modal-list {
  margin: 0;
  padding: 8px 0;
}

.c-modal-list>li {
  margin: 0;
  padding: 0;
}

.c-modal-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: var(--bg);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-sub);
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.c-modal-option:hover {
  background: var(--bg-sub);
}

.c-modal-option.is-selected {
  color: var(--primary);
  font-weight: 600;
}

.c-modal-option-label {
  flex: 1 1 auto;
  min-width: 0;
}

.c-modal-option-ico {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  box-sizing: border-box;
  background: var(--bg);
}

.c-modal-option.is-selected .c-modal-option-ico {
  border-color: var(--primary);
  background-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6 5 8.5 9.5 3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.c-modal-foot {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--bg-elevated);
}

/* 두 개 버튼 레이아웃 — 단일 버튼은 wrapper 없이 .c-modal-foot > .btn 으로 직접 배치 */
.c-modal-btns {
  display: grid;
  grid-template-columns: minmax(180px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

/* 안전망: 기존 1버튼 wrapper 잔존 시에도 100% 폭으로 표시 */
.c-modal-btns>.btn:only-child {
  grid-column: 1 / -1;
}

/* 단일 버튼: wrapper 없이 바로 배치 시 100% 폭 (.btn 기본 flex/center 활용) */
.c-modal-foot>.btn {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

/* 모달 전용 primary 변형 — wrapper 유무 모두 동일 톤 */
.c-modal-btns .btn-primary,
.c-modal-foot>.btn.btn-primary {
  border: none;
  border-radius: 12px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--bg);
  background: var(--primary);
}

@media (max-width: 640px) {
  .c-modal {
    padding: 0;
    align-items: flex-end;
  }

  .c-modal-panel {
    max-width: none;
    width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
  }

  .c-modal-head {
    padding-top: 20px;
  }

  .c-modal-btns {
    display: flex;
    max-width: none;
  }

  .c-modal-btns .btn-sub {
    display: none;
  }
}

/* -------------------------------------------------------------------------- */
/* 토스트 MyFC.showToast() · 클릭 시 data-toast / data-toast-type(error) / data-toast-ms */
/* -------------------------------------------------------------------------- */

.app-toast-host {
  position: fixed;
  z-index: 3000;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  align-items: center;
  max-width: min(400px, calc(100vw - 32px));
  width: max-content;
  pointer-events: none;
  box-sizing: border-box;
}

.app-toast {
  pointer-events: auto;
  margin: 0;
  padding: 12px 18px;
  max-width: min(400px, calc(100vw - 32px));
  border-radius: 12px;
  background: #1e293b;
  color: var(--bg-sub);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-align: center;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.app-toast.is-shown {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.error {
  background: #dc2626;
  color: #fef2f2;
}

/* -------------------------------------------------------------------------- */
/* 페이징 (PC: 번호형 / 모바일: 더보기) - JS 필요 없음 */
/* -------------------------------------------------------------------------- */

.c-paging {
  margin: 18px 0 0;
  padding: 0 0 10px;
  display: flex;
  justify-content: center;
}

.c-paging>ul {
  margin: 0;
  display: flex;
  gap: 5px;
  align-items: center;
}

.c-paging>ul a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

/* 첫·마지막 li: 이전/다음, 가운데: 페이지 번호 */
.c-paging>ul li:not(:first-child):not(:last-child) a {
  width: auto;
  min-height: 24px;
  height: 24px;
  padding: 0 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
}

.c-paging>ul li:not(:first-child):not(:last-child) a[aria-current='page'] {
  font-weight: 700;
  color: #1e293b;
}

.c-paging>ul li:first-child a,
.c-paging>ul li:last-child a {
  display: block;
  min-height: 24px;
  height: 24px;
  width: 24px;
  padding: 0;
  border-radius: 6px;
  font-size: 0;
  /* span은 visually-hidden */
  line-height: 0;
  position: relative;
  background: transparent;
}

.c-paging>ul li:first-child a::before,
.c-paging>ul li:last-child a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  background-image: url('/assets/images/ic-chevron-left-black.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  transform: translate(-50%, -50%) rotate(0deg);
}

.c-paging>ul li:last-child a::before {
  transform: translate(-50%, -50%) rotate(180deg);
}

.c-paging>ul a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.c-paging>div {
  display: none;
  width: 100%;
}

.c-paging>div a {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.c-paging>div a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .c-paging {
    justify-content: stretch;
    margin-top: 14px;
  }

  .c-paging>ul {
    display: none;
  }

  .c-paging>div {
    display: block;
  }
}

/* Swiper 커스텀 이전·다음(.control-btn): 넘길 슬라이드 없을 때 클릭 불가 (Swiper가 .swiper-button-disabled 토글) */
.control-btn.swiper-nav-prev.swiper-button-disabled,
.control-btn.swiper-nav-next.swiper-button-disabled,
.control-btn.swiper-nav-prev:disabled,
.control-btn.swiper-nav-next:disabled {
  pointer-events: none;
  cursor: default;
  opacity: 0.38;
}