/* ============================================================
   ISO 365 Design System
   ============================================================ */
:root {
  --navy: #153B5B;
  --blue: #1F5D8F;
  --teal: #1E8A83;
  --green: #3A8D68;
  --white: #FFFFFF;
  --light-gray: #F5F7F9;
  --border: #E3E8ED;
  --dark-gray: #1F2A30;              /* [폴리싱] 본문 대비 강화 (기존 #263238) */
  --text-muted: #526069;             /* [폴리싱] 보조 텍스트 대비 강화 (기존 #5B6870) */
  --warn: #E67E22;
  --danger: #D64545;
  --purple: #6B4EA0;

  --radius: 12px;                    /* [폴리싱] 카드 라운드 소폭 확대 (기존 10px) */
  --radius-sm: 7px;
  /* [폴리싱] 그림자 계층 재정비 — 더 부드럽고 자연스러운 depth */
  --shadow-sm: 0 1px 2px rgba(21, 59, 91, 0.05), 0 1px 3px rgba(21, 59, 91, 0.06);
  --shadow: 0 2px 8px rgba(21, 59, 91, 0.07), 0 4px 12px rgba(21, 59, 91, 0.05);
  --shadow-md: 0 6px 20px rgba(21, 59, 91, 0.12), 0 2px 6px rgba(21, 59, 91, 0.06);
  --header-h: 66px;
  --max-w: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
  color: var(--dark-gray);
  background: var(--light-gray);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;   /* [폴리싱] 폰트 렌더링 선명도 개선 */
  letter-spacing: -0.1px;               /* [폴리싱] 한글 자간 미세 조정으로 가독성↑ */
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; transition: color .15s; }
img { max-width: 100%; display: block; }

.main-content { min-height: calc(100vh - var(--header-h) - 200px); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px;
}
.logo { display: flex; align-items: baseline; font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.logo-mark { color: var(--navy); }
.logo-num { color: var(--teal); }
.main-nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 8px 13px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 500; color: var(--dark-gray);
  transition: all .15s; white-space: nowrap;
}
.nav-link:hover { background: var(--light-gray); color: var(--navy); }
.nav-link.active { color: var(--navy); font-weight: 700; background: rgba(31,93,143,0.08); }
.header-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-muted); transition: all .15s;
}
.icon-btn:hover { background: var(--light-gray); color: var(--navy); }
.hamburger { display: none; background: none; border: none; font-size: 22px; color: var(--navy); cursor: pointer; }

/* Mobile menu */
.mobile-menu { display: none; flex-direction: column; padding: 8px 20px 20px; border-top: 1px solid var(--border); background: var(--white); }
.mobile-menu.open { display: flex; }
.mobile-nav-link { padding: 13px 8px; font-size: 16px; font-weight: 500; border-bottom: 1px solid var(--light-gray); }
.mobile-nav-link.active { color: var(--navy); font-weight: 700; }
.mobile-divider { height: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all .15s; white-space: nowrap;
}
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 15px 30px; font-size: 17px; }
/* [폴리싱] 주요 버튼 호버 시 살짝 떠오르며 그림자 — 클릭 유도 강화 */
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #0f2d47; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(21,59,91,0.25); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: #176b66; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,138,131,0.28); }
.btn:active { transform: translateY(0); }   /* [폴리싱] 클릭 시 눌리는 피드백 */
.btn-outline { background: #fff; border-color: var(--border); color: var(--dark-gray); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--dark-gray); }
.btn-ghost:hover { background: var(--light-gray); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 55%, var(--teal) 130%);
  color: #fff; padding: 74px 20px 64px;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,0.10) 0, transparent 42%),
    radial-gradient(circle at 12% 82%, rgba(30,138,131,0.28) 0, transparent 40%);
  pointer-events: none;
}
.hero-net {
  position: absolute; inset: 0; opacity: 0.14;
  background-image:
    linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 44px 44px; pointer-events: none;
}
.hero-inner { max-width: var(--max-w); margin: 0 auto; position: relative; z-index: 1; text-align: center; }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.25; margin-bottom: 18px; }  /* [폴리싱] 히어로 제목 임팩트 강화 */
.hero .sub { font-size: 18px; opacity: 0.94; max-width: 640px; margin: 0 auto 32px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn-primary { background: #fff; color: var(--navy); }
.hero-actions .btn-primary:hover { background: #eef3f7; }
.hero-actions .btn-outline { background: transparent; border-color: rgba(255,255,255,0.55); color: #fff; }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,0.12); }

/* ---------- Search box ---------- */
.search-wrap { max-width: 760px; margin: -32px auto 0; position: relative; z-index: 5; padding: 0 20px; }
.search-box {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; padding: 8px 8px 8px 22px; gap: 12px;
  border: 1.5px solid transparent; transition: border-color .15s, box-shadow .15s;   /* [폴리싱] 포커스 대비용 */
}
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 8px 24px rgba(31,93,143,0.18); }  /* [폴리싱] 입력 시 테두리 강조 */
.search-box i { color: var(--text-muted); font-size: 18px; }
.search-box input {
  flex: 1; border: none; outline: none; font-family: inherit; font-size: 16px;
  color: var(--dark-gray); background: transparent; padding: 12px 0;
}
.search-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.search-tag { font-size: 13px; color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.14); padding: 5px 12px; border-radius: 20px; transition: all .15s; }
.search-tag:hover { background: rgba(255,255,255,0.24); }

/* ---------- Section ---------- */
.section { padding: 64px 0; }                                    /* [폴리싱] 섹션 상하 여백 확대 (기존 56px) */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
/* [폴리싱] 섹션 타이틀 좌측에 브랜드 컬러 액센트 바 — 시선 유도·위계 강화 */
.section-title { position: relative; font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -0.6px; padding-left: 15px; }
.section-title::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; border-radius: 3px; background: linear-gradient(180deg, var(--navy), var(--teal)); }
.section-title small { display: block; font-size: 14px; font-weight: 500; color: var(--text-muted); margin-top: 4px; }
.section-more { font-size: 14px; color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; transition: gap .15s, color .15s; }
.section-more:hover { color: var(--navy); gap: 9px; }             /* [폴리싱] 호버 시 화살표가 살짝 밀려나는 마이크로 인터랙션 */

/* ---------- Service cards ---------- */
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }  /* [폴리싱] 카드 간격 확대 */
.service-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; transition: transform .2s, box-shadow .2s, border-color .2s; box-shadow: var(--shadow-sm);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--blue); }
/* [폴리싱] 카드 호버 시 아이콘이 살짝 커지며 생동감 부여 */
.service-card:hover .service-icon { transform: scale(1.08) rotate(-3deg); }
.service-icon {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 23px; color: #fff; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  transition: transform .2s;
  box-shadow: 0 4px 10px rgba(21,59,91,0.18);   /* [폴리싱] 아이콘에 미세 그림자로 입체감 */
}
.service-card:nth-child(4n+2) .service-icon { background: linear-gradient(135deg, var(--teal), var(--green)); }
.service-card:nth-child(4n+3) .service-icon { background: linear-gradient(135deg, var(--blue), var(--teal)); }
.service-card:nth-child(4n) .service-icon { background: linear-gradient(135deg, var(--green), var(--teal)); }
.service-card h3 { font-size: 17px; font-weight: 700; color: var(--dark-gray); margin-bottom: 7px; transition: color .15s; }
.service-card:hover h3 { color: var(--navy); }   /* [폴리싱] 호버 시 제목 색 강조 */
.service-card p { font-size: 14px; color: var(--text-muted); line-height: 1.55; }
/* 비회원 잠금 서비스 카드 */
.service-card.service-locked { position: relative; }
.service-card.service-locked .service-icon { opacity: 0.55; filter: grayscale(0.3); }
.service-card .service-lock-icon { font-size: 12px; color: var(--text-muted); }
.service-card .service-lock-badge { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--blue); background: #eef5fb; border: 1px solid #cfe0f0; border-radius: 999px; padding: 2px 10px; }

/* ---------- Content cards / lists ---------- */
.content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.content-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--blue); }
.card:hover .card-title { color: var(--navy); }   /* [폴리싱] 카드 호버 시 제목 강조 */
.card-thumb { height: 150px; background: linear-gradient(135deg, #e8eef3, #dce6ed); display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 34px; overflow: hidden; }
/* [이미지 우선] 대표 이미지가 있으면 썸네일 영역을 꽉 채우고, 호버 시 살짝 확대 */
.card-thumb.has-img { padding: 0; }
.card-thumb.has-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-thumb.has-img img { transform: scale(1.04); }
.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.card-cat { font-size: 12px; font-weight: 700; color: var(--teal); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.3px; }
.card-title { font-size: 16px; font-weight: 700; color: var(--dark-gray); line-height: 1.45; margin-bottom: 8px; transition: color .15s; }
.card-title.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-summary { font-size: 14px; color: var(--text-muted); line-height: 1.55; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); margin-top: auto; }
.card-meta i { margin-right: 3px; }

/* list style */
.list-group { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
/* [폴리싱] 좌측 투명 액센트 바 → 호버 시 브랜드 컬러로 나타나 클릭 대상 강조 */
.list-item { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--light-gray); transition: background .15s, box-shadow .15s; box-shadow: inset 3px 0 0 transparent; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #f7fafc; box-shadow: inset 3px 0 0 var(--teal); }
.list-item:hover .list-item-title { color: var(--navy); }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-size: 15px; font-weight: 600; color: var(--dark-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.list-item-meta { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.badge-gray { background: #eceff1; color: #546e7a; }
.badge-blue { background: #e3f0fa; color: var(--blue); }
.badge-teal { background: #e0f2f0; color: var(--teal); }
.badge-green { background: #e4f2ea; color: var(--green); }
.badge-navy { background: var(--navy); color: #fff; }
.badge-purple { background: #efeafa; color: var(--purple); }
.badge-warn { background: #fdf0e3; color: var(--warn); }
.badge-danger { background: #fbe5e5; color: var(--danger); }
.badge-ad { background: #fff4e0; color: var(--warn); border: 1px solid #f0d9b0; }

/* ---------- Home dashboard grid ---------- */
.home-dash { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

/* ---------- Page header ---------- */
.page-head { background: linear-gradient(120deg, var(--navy), var(--blue)); color: #fff; padding: 44px 20px; }
.page-head-inner { max-width: var(--max-w); margin: 0 auto; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.page-head p { font-size: 16px; opacity: 0.9; margin-top: 8px; }
.breadcrumb { font-size: 13px; opacity: 0.8; margin-bottom: 10px; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-chip { padding: 8px 16px; border-radius: 20px; background: #fff; border: 1px solid var(--border); font-size: 14px; font-weight: 500; color: var(--text-muted); transition: all .15s; cursor: pointer; }
.filter-chip:hover { border-color: var(--blue); color: var(--blue); background: #f5faff; }  /* [폴리싱] 호버 배경 추가 */
.filter-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Forms ---------- */
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--dark-gray); margin-bottom: 7px; }
.form-group label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; color: var(--dark-gray); background: #fff; transition: border .15s;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,93,143,0.12); }
textarea.form-control { resize: vertical; min-height: 110px; line-height: 1.6; }
.form-hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 460px; margin: 50px auto; padding: 0 20px; }
.auth-wrap.wide { max-width: 640px; }
.auth-title { text-align: center; font-size: 26px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--text-muted); margin-bottom: 28px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.auth-switch a { color: var(--blue); font-weight: 600; }
.auth-links { text-align: center; margin-top: 16px; font-size: 14px; }
.auth-links a { color: var(--text-muted); font-weight: 500; }
.auth-links a:hover { color: var(--blue); text-decoration: underline; }
.auth-links-sep { color: var(--border); margin: 0 8px; }
.find-result-list { list-style: none; padding: 0; margin: 12px 0; }
.find-result-list li { padding: 12px 16px; background: var(--light-gray, #f7f9fb); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 8px 0; font-weight: 600; color: var(--navy); }
.find-result-list li i { margin-right: 8px; color: var(--blue); }

.role-select { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.role-option { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px; cursor: pointer; text-align: center; transition: all .15s; }
.role-option:hover { border-color: var(--blue); }
.role-option.selected { border-color: var(--navy); background: rgba(31,93,143,0.06); }
.role-option i { font-size: 20px; color: var(--blue); margin-bottom: 6px; display: block; }
.role-option .r-name { font-weight: 700; font-size: 14px; }
.role-option .r-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ---------- Detail page ---------- */
.detail-wrap { max-width: 820px; margin: 0 auto; padding: 36px 20px; }
.detail-title { font-size: 30px; font-weight: 800; color: var(--dark-gray); line-height: 1.3; margin: 12px 0 14px; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }

/* 작성자 본인/관리자용 수정·삭제 버튼 */
.owner-actions { display: flex; gap: 8px; align-items: center; margin: -8px 0 22px; }
.btn-danger-outline { color: #dc2626; border-color: #f0c4c4; background: #fff; }
.btn-danger-outline:hover { background: #fef2f2; border-color: #dc2626; color: #dc2626; }

/* "익명으로 작성" 체크박스 */
.anon-check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--dark-gray); cursor: pointer; }
.anon-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }
.anon-check .anon-hint { color: var(--text-muted); font-size: 12.5px; font-weight: 400; }
.detail-section { margin-bottom: 28px; }
.detail-section h3 { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.detail-section h3::before { content: ''; width: 4px; height: 18px; background: var(--teal); border-radius: 2px; }
.detail-body { font-size: 16px; line-height: 1.8; color: var(--dark-gray); white-space: pre-wrap; }

/* ---------- AI Tools ---------- */
.ai-tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ai-tool-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: all .18s; box-shadow: var(--shadow-sm); }
.ai-tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--purple); }
.ai-tool-card:hover .ai-tool-icon { transform: scale(1.08) rotate(-3deg); }  /* [폴리싱] 호버 시 아이콘 생동감 */
.ai-tool-card:hover h3 { color: var(--purple); }
.ai-tool-card h3 { transition: color .15s; }
.ai-tool-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 21px; color: #fff; background: linear-gradient(135deg, var(--navy), var(--purple)); margin-bottom: 14px; transition: transform .2s; box-shadow: 0 4px 10px rgba(107,78,160,0.2); }
.ai-tool-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.ai-tool-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; min-height: 40px; }
.ai-disclaimer { background: #fdf6e9; border: 1px solid #f0e0bf; border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; color: #8a6d2f; margin: 16px 0; display: flex; gap: 10px; align-items: flex-start; }
.ai-disclaimer i { margin-top: 2px; }
.ai-quota { display: inline-flex; align-items: center; gap: 8px; background: #eef5fb; border: 1px solid #cfe0f0; color: var(--navy); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 13px; font-weight: 600; margin: 4px 0 12px; }
.ai-quota-low { background: #fdecec; border-color: #f3c2c2; color: #c0392b; }
.alert-warn { background: #fdf6e9; border: 1px solid #f0e0bf; color: #8a6d2f; }
/* 약관/개인정보처리방침 문서 */
.policy-doc { line-height: 1.75; }
.policy-doc .policy-meta { color: var(--muted, #888); font-size: 13px; margin-bottom: 18px; }
.policy-doc h3 { font-size: 16px; font-weight: 700; color: var(--navy); }
.policy-doc ul { margin: 8px 0 4px; padding-left: 20px; }
.policy-doc ul li { margin: 4px 0; }
.policy-doc .policy-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted, #666); }
.policy-doc .policy-footer p { margin: 3px 0; }
/* 회원가입 동의 영역 */
.consent-box { margin-top: 8px; padding: 16px; background: var(--light-gray, #f7f9fb); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.consent-item { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; font-size: 14px; line-height: 1.5; }
.consent-item input[type=checkbox] { margin-top: 3px; flex-shrink: 0; }
.consent-item label { cursor: pointer; }
.consent-item .consent-link { color: var(--navy); text-decoration: underline; margin-left: 4px; font-size: 13px; }
.consent-item .req { color: #c0392b; }
.consent-item .opt { color: var(--muted, #888); }
.consent-all { border-bottom: 1px dashed var(--border); padding-bottom: 10px; margin-bottom: 4px; font-weight: 700; }
.ai-result { background: var(--light-gray); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-top: 20px; white-space: pre-wrap; line-height: 1.8; font-size: 15px; }
/* 표 포함 리치 렌더링 (마크다운 → HTML) */
.ai-result-rich { white-space: normal; background: #fff; }
.ai-result-rich .md-h { color: var(--navy); font-weight: 700; margin: 16px 0 8px; padding-left: 8px; border-left: 4px solid var(--navy); font-size: 16px; }
.ai-result-rich h2.md-h { font-size: 17px; }
.ai-result-rich h4.md-h { font-size: 15px; color: #2C5A82; border-left-color: #2C5A82; }
.ai-result-rich .md-p { margin: 6px 0; }
.ai-result-rich .md-li { margin: 4px 0 4px 16px; }
.ai-result-rich .md-gap { height: 8px; }
.ai-result-rich .md-table { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 14px; }
.ai-result-rich .md-table th { background: var(--navy); color: #fff; font-weight: 700; border: 1px solid var(--navy); padding: 8px 10px; text-align: center; }
.ai-result-rich .md-table td { border: 1px solid var(--border); padding: 7px 10px; vertical-align: top; line-height: 1.55; }
.ai-result-rich .md-table tr.row-alt td { background: #EAF2F8; }
.ai-result-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--text-muted); padding: 20px; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Table (admin) ---------- */
.data-table { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); border-collapse: collapse; overflow: hidden; }
.data-table th { background: var(--light-gray); padding: 13px 16px; text-align: left; font-size: 13px; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.data-table td { padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--light-gray); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafcfd; }

/* ---------- Admin layout ---------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; max-width: var(--max-w); margin: 0 auto; padding: 30px 20px; }
.admin-sidebar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; height: fit-content; position: sticky; top: 86px; }
.admin-sidebar a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--dark-gray); margin-bottom: 2px; }
.admin-sidebar a:hover { background: var(--light-gray); }
.admin-sidebar a.active { background: var(--navy); color: #fff; }
.admin-content { min-width: 0; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .stat-num { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Misc ---------- */
/* [폴리싱] 빈 상태를 카드형으로 — 밋밋한 텍스트 대신 정돈된 안내 블록 */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-muted); background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-state i { font-size: 44px; color: #c9d4dd; margin-bottom: 14px; display: block; }
.empty-state p { font-size: 15px; margin-top: 2px; }
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; }
.alert-error { background: #fbe5e5; color: var(--danger); border: 1px solid #f3c9c9; }
.alert-success { background: #e4f2ea; color: var(--green); border: 1px solid #c4e3d1; }
.alert-info { background: #e3f0fa; color: var(--blue); border: 1px solid #c5ddf0; }
.tag-pill { display: inline-block; font-size: 12px; background: var(--light-gray); color: var(--text-muted); padding: 3px 10px; border-radius: 14px; margin: 2px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-2 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.85); margin-top: 40px; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 46px 20px 30px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer-brand .logo .logo-mark { color: #fff; }
.footer-brand .logo .logo-num { color: var(--teal); }
.footer-slogan { font-weight: 600; margin: 12px 0 6px; color: #fff; }
.footer-desc { font-size: 14px; opacity: 0.75; }
.footer-col h4 { font-size: 15px; color: #fff; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14px; opacity: 0.8; padding: 5px 0; }
.footer-col a:hover { opacity: 1; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 18px 20px; text-align: center; font-size: 13px; opacity: 0.65; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.pagination a, .pagination span { padding: 8px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; font-size: 14px; color: var(--dark-gray); }
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .main-nav, .header-right { display: none; }
  .hamburger { display: block; margin-left: auto; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: repeat(2, 1fr); }
  .home-dash { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; display: flex; flex-wrap: wrap; }
  .admin-sidebar a { flex: 1 1 auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 30px; }
  .hero .sub { font-size: 16px; }
  .service-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .content-grid, .content-grid-2, .ai-tool-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .role-select { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .detail-title { font-size: 24px; }
  .service-card { padding: 18px 16px; }
}

/* ============================================================
   Phase 2 - 이미지 업로드 / 알림 / 상세 이미지
   ============================================================ */

/* 상세 페이지 이미지 */
.detail-image {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 12px;
  margin: 16px 0 8px;
  border: 1px solid var(--border);
}

/* 이미지 업로드 위젯 */
.img-upload { border: 1px dashed var(--border); border-radius: 10px; padding: 14px; background: var(--light-gray); }
.img-upload-preview {
  width: 100%; height: 180px; border-radius: 8px; background: #fff;
  border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-muted); gap: 8px; overflow: hidden;
}
.img-upload-preview i { font-size: 32px; }
.img-upload-preview span { font-size: 13px; }
.img-upload-preview.has-img { border-style: solid; }
.img-upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.img-upload-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.img-upload-status { font-size: 13px; }

/* 헤더 알림 배지 */
.noti-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* 알림 목록 */
.noti-list { display: flex; flex-direction: column; gap: 8px; }
.noti-item {
  display: flex; gap: 14px; padding: 16px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; transition: box-shadow .15s;
}
.noti-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.noti-item.unread { background: #f0f7fb; border-color: var(--blue); }
.noti-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px;
}
.noti-warn { background: var(--warn, #e0a800); }
.noti-teal { background: var(--teal); }
.noti-green { background: var(--green); }
.noti-danger { background: var(--danger); }
.noti-blue { background: var(--blue); }
.noti-gray { background: #8a99a8; }
.noti-body { flex: 1; min-width: 0; }
.noti-title { font-weight: 700; color: var(--text); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.noti-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); display: inline-block; }
.noti-msg { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.noti-time { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== 교육 캘린더 뷰 ===== */
.calendar-wrap { margin-top: 8px; }
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 12px; }
.cal-title { font-size: 20px; font-weight: 800; color: var(--navy); min-width: 140px; text-align: center; }
.cal-legend { display: flex; gap: 16px; justify-content: center; margin-bottom: 14px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid-head { margin-bottom: 6px; gap: 6px; }
.cal-head { text-align: center; font-weight: 700; font-size: 13px; padding: 6px 0; }
.cal-cell { min-height: 96px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cal-empty { background: #fafbfc; border-style: dashed; }
.cal-today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; background: #f5faff; }
.cal-daynum { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.cal-today-badge { font-size: 10px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 4px; padding: 1px 5px; }
.cal-events { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-event { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1.25; color: #fff; padding: 3px 6px; border-radius: 5px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: filter .15s; }
.cal-event:hover { filter: brightness(1.1); }
.cal-event-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.85); flex-shrink: 0; }
@media (max-width: 640px) {
  .cal-cell { min-height: 62px; padding: 3px; }
  .cal-daynum { font-size: 12px; }
  .cal-event { font-size: 9px; padding: 2px 3px; }
  .cal-event-dot { display: none; }
  .cal-grid, .cal-grid-head { gap: 3px; }
}
