:root {
    --primary: #ff7ca3;
    --primary-dark: #ff5c89;
    --primary-light: #ffe1ea;
    --secondary: #a78bfa;
    --secondary-light: #ede6ff;
    --text: #2d2233;
    --muted: #8b7c8c;
    --border: #f2e3ea;
    --bg: #fffaf9;
    --surface: #ffffff;
    --success: #2e9e5b;
    --success-bg: #e9f9ef;
    --error: #e0525a;
    --error-bg: #fdeaeb;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 8px rgba(45, 34, 51, 0.06);
    --shadow-hover: 0 12px 28px rgba(255, 124, 163, 0.18);
}

* { box-sizing: border-box; }

/* 다음(Daum) 웹마스터도구 소유 확인용 태그 — 검증 크롤러가 읽을 수 있게 DOM에는 남기고 화면에서만 숨긴다. */
.daum-wm-title, .daum-wm-content, .daum-wm-datetime { display: none; }

/* 가로로 삐져나온 요소가 있어도 페이지 전체가 좌우로 흔들리지 않게 하는 안전장치(clip은 sticky 헤더를 깨지 않는다). */
html, body { overflow-x: clip; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Noto Sans KR', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; }
ul, ol { padding-left: 1.4rem; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; flex-wrap: nowrap; padding-top: 10px; padding-bottom: 10px; }
.logo { font-weight: 800; font-size: 1.2rem; white-space: nowrap; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.main-nav { display: flex; gap: 2px; flex-wrap: nowrap; font-size: 0.84rem; font-weight: 600; overflow: visible; }
.main-nav a { padding: 7px 10px; border-radius: 999px; color: var(--muted); white-space: nowrap; }
.main-nav a:hover { background: var(--primary-light); color: var(--primary-dark); }
.main-nav a.active { background: var(--primary); color: #fff; }
.main-nav a .nav-icon { display: none; }
.header-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.auth-area { display: flex; align-items: center; gap: 12px; font-size: 0.84rem; white-space: nowrap; font-weight: 600; flex-shrink: 0; }
.nickname { color: var(--primary-dark); }
.header-avatar-link { display: inline-flex; align-items: center; gap: 5px; }
.unread-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
    padding: 0 4px; border-radius: 999px; background: var(--error); color: #fff; font-size: 0.68rem;
    font-weight: 800; margin-left: 3px; vertical-align: middle; line-height: 1;
}
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text); flex-shrink: 0; }

/* ---------- Layout ---------- */
.page-main { min-height: 30vh; padding: 40px 24px 64px; }
.site-footer { background: var(--text); color: #d8cddd; padding: 36px 0; margin-top: 56px; }
.footer-inner { text-align: center; font-size: 0.85rem; }
.footer-brand { font-size: 1.1rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.footer-links { margin-top: 12px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: #d8cddd; opacity: 0.85; font-weight: 600; }
.footer-links a:hover { opacity: 1; color: #fff; }
.footer-copy { opacity: 0.6; margin-top: 8px; }

/* ---------- Flash ---------- */
.flash { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 0.9rem; font-weight: 600; }
.flash-info { background: var(--secondary-light); color: #5b3fc9; }
.flash-error { background: var(--error-bg); color: var(--error); }
.flash-success { background: var(--success-bg); color: var(--success); }

/* ---------- Titles ---------- */
.page-title { font-size: 1.7rem; margin: 0 0 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header .page-title { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 22px; border-radius: 999px; border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; cursor: pointer; font-size: 0.9rem; font-weight: 700;
    box-shadow: 0 4px 14px rgba(255, 92, 137, 0.28);
    transition: transform .15s, box-shadow .15s;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255, 92, 137, 0.36); }
.btn-secondary { background: #fff; border: 1.5px solid var(--border); color: var(--text); box-shadow: none; }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-dark); box-shadow: var(--shadow); }
.btn-danger { background: linear-gradient(135deg, var(--error) 0%, #c23f47 100%); box-shadow: 0 4px 14px rgba(224, 82, 90, 0.28); }
.btn-small { padding: 7px 14px; font-size: 0.8rem; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card-grid > p, .empty-state { grid-column: 1 / -1; text-align: center; padding: 40px 0; color: var(--muted); }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; display: block;
    border-top: 4px solid var(--tile, var(--primary));
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary-light); }
.card-icon-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-icon-row .badge { margin: 0; }
.card-emoji {
    font-size: 1.5rem; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--tile, var(--primary)) 16%, var(--surface));
}
.card-title { font-weight: 800; margin: 12px 0 6px; font-size: 1.05rem; color: var(--text); }
.card-summary { color: var(--muted); font-size: 0.88rem; }
.badge { display: inline-block; background: var(--primary-light); color: var(--primary-dark); border-radius: 999px; padding: 3px 12px; font-size: 0.74rem; font-weight: 700; margin-top: 10px; margin-right: 4px; }
.badge.tile-badge { background: color-mix(in srgb, var(--tile, var(--primary)) 18%, var(--surface)); color: color-mix(in srgb, var(--tile, var(--primary)) 75%, black); }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.78rem; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.card-meta .badge { margin: 0; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 0.76rem; color: var(--muted-2, var(--muted)); }
.card img.detail-image, .card .detail-image { border-radius: var(--radius-sm); margin-bottom: 10px; height: 150px; width: 100%; object-fit: cover; }
.card-thumb { display: block; border-radius: var(--radius-sm); margin-bottom: 10px; height: 150px; width: 100%; object-fit: cover; }
/* 대표 이미지가 없는 카드는 밋밋한 "이미지 없음" 문구 대신, 게시판/카테고리 이모지를 크게
   보여주는 그라데이션 카드로 대체한다 - 실제 사진은 없어도 허전해 보이지 않게. */
.card-thumb-empty {
    display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
    background: linear-gradient(160deg, #ffe9f0 0%, #ffd3e0 100%);
}
.card-thumb-empty .card-thumb-emoji { font-size: 2.6rem; filter: drop-shadow(0 4px 10px rgba(255,92,137,0.22)); }
.card-thumb-empty::before, .card-thumb-empty::after { content: '✦'; position: absolute; color: rgba(255,255,255,0.75); font-size: 0.85rem; }
.card-thumb-empty::before { top: 10px; left: 14px; }
.card-thumb-empty::after { bottom: 10px; right: 16px; font-size: 0.65rem; }

/* ---------- 회원 프로필 사진(원형 아바타) ---------- */
.avatar {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    border-radius: 50%; object-fit: cover; vertical-align: middle;
}
.avatar-fallback { color: #fff; font-weight: 800; line-height: 1; }

/* ---------- 병원 페이지 공공데이터 출처 표시 ---------- */
.hospital-source-notice {
    margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--border);
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
}
.hospital-source-notice p { margin: 0; flex: 1; min-width: 220px; color: var(--muted); font-size: 0.78rem; line-height: 1.6; }
.hospital-source-notice strong { color: var(--text); }
.hospital-source-notice p a { color: var(--primary-dark); text-decoration: underline; }
.hospital-source-badge { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hospital-source-badge img { height: 36px; width: auto; display: block; }
.hospital-source-badge span { font-size: 0.7rem; line-height: 1.3; color: var(--muted); }

/* ---------- 배너 광고 자리(고정 높이 — 나중에 이미지만 교체해도 레이아웃 유지) ---------- */
.ad-banner {
    display: block; border-radius: var(--radius); overflow: hidden; margin: 28px 0;
    box-shadow: var(--shadow); min-height: 90px;
}
.ad-banner img { display: block; width: 100%; height: 90px; object-fit: cover; }
.ad-banner-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 90px; padding: 14px 20px; text-align: center; color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    transition: opacity .15s;
}
.ad-banner:hover .ad-banner-placeholder { opacity: 0.92; }
.ad-banner-placeholder strong { font-size: 1rem; }
.ad-banner-placeholder span { font-size: 0.8rem; opacity: 0.9; }
@media (max-width: 640px) {
    .ad-banner { min-height: 64px; }
    .ad-banner img, .ad-banner-placeholder { min-height: 64px; height: 64px; }
    .ad-banner-placeholder strong { font-size: 0.86rem; }
    .ad-banner-placeholder span { font-size: 0.7rem; }
}
.profile-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-avatar-row form { display: flex; align-items: center; gap: 8px; }
.profile-avatar-row label.btn { cursor: pointer; }

/* 모바일에서는 네이버 뉴스처럼 한 줄에 카드 2개씩 보여준다(1개씩 쌓이면 너무 크고 사진도 늘어져 보임) */
@media (max-width: 640px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card { padding: 10px; border-top-width: 3px; }
    .card-thumb, .card-thumb-empty { height: auto; aspect-ratio: 4 / 3; margin-bottom: 6px; }
    .card-thumb-empty .card-thumb-emoji { font-size: 1.8rem; }
    .card-icon-row { gap: 4px; flex-wrap: wrap; }
    .card-icon-row .badge { font-size: 0.6rem; padding: 2px 7px; }
    .card-emoji { width: 30px; height: 30px; font-size: 1.05rem; }
    .card-title { font-size: 0.84rem; margin: 8px 0 4px; line-height: 1.3; }
    .card-summary { font-size: 0.7rem; }
    .card-meta, .card-foot { font-size: 0.64rem; gap: 4px; margin-top: 6px; padding-top: 6px; }
    .card-meta .badge { font-size: 0.6rem; padding: 2px 7px; }
}

/* ---------- Home hero (menu grid + illustrated banner) ---------- */
.home-hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-bottom: 44px; align-items: stretch; }
.home-hero-menu { display: flex; }
.home-hero-menu .category-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 0; flex: 1; align-content: center; }
.home-hero-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 24px; padding: 22px 24px; color: #fff; position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px;
    box-shadow: 0 16px 32px rgba(167, 139, 250, 0.25); min-height: 220px;
}
.hero-illustration { width: 156px; height: 156px; flex-shrink: 0; }
.hero-illustration svg { width: 100%; height: 100%; }
.hero-banner-text h1 { font-size: 1.2rem; margin: 0 0 6px; }
.hero-banner-text p { font-size: 0.85rem; margin: 0; opacity: 0.95; line-height: 1.5; }

@media (max-width: 860px) {
    .home-hero { grid-template-columns: 1fr; }
    .home-hero-banner { display: none; }
    .home-hero-menu .category-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Category quick-nav grid ---------- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin-bottom: 44px; }
.category-tile {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 8px 16px; text-align: center;
    border-radius: 18px; border: 1px solid color-mix(in srgb, var(--tile) 28%, var(--border));
    background: color-mix(in srgb, var(--tile) 10%, var(--surface));
    transition: transform .18s, box-shadow .18s, background .18s;
}
.category-tile:hover {
    transform: translateY(-4px); color: var(--text);
    box-shadow: 0 12px 22px color-mix(in srgb, var(--tile) 30%, transparent);
    background: color-mix(in srgb, var(--tile) 16%, var(--surface));
}
.category-tile .cat-icon {
    width: 50px; height: 50px; border-radius: 50%; background: var(--tile); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--tile) 45%, transparent);
}
.category-tile .cat-label { font-weight: 800; font-size: 0.86rem; }
.category-tile .cat-count { font-size: 0.72rem; color: var(--muted); }
@media (max-width: 860px) {
    .category-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .category-tile {
        display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; text-align: center;
    }
    .category-tile .cat-icon { width: 32px; height: 32px; font-size: 0.95rem; box-shadow: none; }
    .category-tile .cat-label { font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .category-tile .cat-count { font-size: 0.6rem; }
}

/* ---------- Section rhythm ---------- */
.section-block.tinted {
    background: color-mix(in srgb, var(--tile) 6%, var(--bg));
    border-radius: 24px; padding: 32px 24px; margin-left: -24px; margin-right: -24px;
}
@media (max-width: 640px) { .section-block.tinted { margin-left: -18px; margin-right: -18px; padding: 24px 18px; } }
.section-head .cat-icon-sm {
    width: 30px; height: 30px; border-radius: 50%; background: var(--tile, var(--primary)); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.95rem; margin-right: 8px;
}

/* ---------- Forms ---------- */
form.form-box {
    position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 36px 36px 30px; max-width: 720px; box-shadow: var(--shadow-hover);
    overflow: hidden;
}
form.form-box::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}
.form-row { margin-bottom: 20px; }
.form-row label { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 8px; font-size: 0.88rem; color: var(--text); }
.form-row label::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--primary); flex-shrink: 0; }
.form-row input[type=text], .form-row input[type=number], .form-row input[type=password], .form-row input[type=email],
.form-row input[type=date], .form-row input[type=url], .form-row select, .form-row textarea {
    width: 100%; padding: 12px 15px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.92rem; font-family: inherit; background: #fdfbfc; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s;
    appearance: none; -webkit-appearance: none;
}
.form-row select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%238b7c8c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer;
}
.form-row input[type=file] {
    width: 100%; padding: 10px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
    background: #fdfbfc; font-size: 0.85rem; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.form-row input[type=file]:hover { border-color: var(--primary); background: var(--primary-light); }
.form-row input[type=file]::file-selector-button {
    padding: 8px 16px; margin-right: 12px; border: none; border-radius: 999px; cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; font-weight: 700; font-size: 0.82rem;
    transition: transform .15s;
}
.form-row input[type=file]::file-selector-button:hover { transform: translateY(-1px); }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); background: #fff;
}
.form-row input:hover, .form-row select:hover, .form-row textarea:hover { border-color: var(--primary); }
.form-row textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.emoji-select { font-size: 1.05rem; }

/* ---------- Rich Editor (글쓰기 에디터, Quill) ---------- */
.rich-editor { border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s; }
.rich-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.rich-editor .ql-toolbar.ql-snow {
    border: none; border-bottom: 1.5px solid var(--border); background: var(--primary-light);
    padding: 8px 10px; font-family: inherit;
}
.rich-editor { height: auto; }
.rich-editor .ql-container.ql-snow { border: none; font-family: inherit; font-size: 0.92rem; height: auto; }
.rich-editor .ql-editor { height: auto; min-height: 140px; max-height: 320px; overflow-y: auto; padding: 12px 14px; line-height: 1.7; color: var(--text); }
.rich-editor .ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.rich-editor .ql-snow.ql-toolbar button, .rich-editor .ql-snow .ql-picker-label { border-radius: 6px; }
.rich-editor .ql-snow.ql-toolbar button:hover, .rich-editor .ql-snow.ql-toolbar button.ql-active,
.rich-editor .ql-snow .ql-picker-label:hover, .rich-editor .ql-snow .ql-picker-item:hover {
    color: var(--primary-dark);
}
.rich-editor .ql-snow.ql-toolbar button:hover .ql-stroke, .rich-editor .ql-snow.ql-toolbar button.ql-active .ql-stroke,
.rich-editor .ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--primary-dark); }
.rich-editor .ql-snow.ql-toolbar button:hover .ql-fill, .rich-editor .ql-snow.ql-toolbar button.ql-active .ql-fill {
    fill: var(--primary-dark);
}
.rich-editor .ql-editor img { max-width: 100%; border-radius: 10px; margin: 8px 0; display: block; }
.rich-editor .ql-editor blockquote { border-left: 3px solid var(--primary); color: var(--muted); }

/* 저장된 글 상세 화면에 출력되는 리치 콘텐츠(에디터 미사용, 표시 전용) */
.rich-content { word-break: break-word; }
.rich-content img { max-width: 100%; border-radius: 10px; margin: 8px 0; display: block; }
.rich-content p { margin: 0 0 14px; }
.rich-content ul, .rich-content ol { margin: 0 0 14px; padding-left: 1.4rem; }
.rich-content a { color: var(--primary-dark); text-decoration: underline; }
.rich-content blockquote { margin: 0 0 14px; padding-left: 14px; border-left: 3px solid var(--primary); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-group label {
    font-weight: 600; display: inline-flex; align-items: center; gap: 6px; margin: 0;
    padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--border); background: #fdfbfc;
    cursor: pointer; transition: border-color .15s, background .15s, color .15s; font-size: 0.86rem;
}
.checkbox-group label::before { content: none; }
.checkbox-group label:hover { border-color: var(--primary); }
.checkbox-group label:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.checkbox-group input[type=radio], .checkbox-group input[type=checkbox] { accent-color: var(--primary-dark); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
    form.form-box { padding: 26px 20px 22px; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .form-actions { justify-content: stretch; }
    .form-actions .btn, .form-actions .btn-secondary { flex: 1; }
}

/* ---------- Tables ---------- */
/* 주소/이메일처럼 긴 값이 있는 컬럼과 "상태"/"등록일"처럼 짧은 컬럼이 같은 테이블에 있으면,
   기본(줄바꿈 허용) 상태에서는 좁은 컬럼이 억지로 눌려서 "상태"가 "상"/"태"로 한 글자씩
   줄바꿈되는 등 화면이 깨져 보인다. (nowrap으로 전체를 막았더니 이번엔 표 자체가 화면보다
   넓어져서 맨 끝 "수정/삭제" 버튼이 화면 밖으로 밀려나는 문제가 생겨 되돌렸다.)
   그래서 각 셀에 최소 너비만 줘서 짧은 값은 절대 줄바꿈되지 않을 만큼 공간을 보장하고,
   길고 띄어쓰기 없는 값(이메일 등)은 overflow-wrap으로 셀 너비 안에서 강제로 줄바꿈되게 해서
   표 전체가 화면 폭을 벗어나지 않게 한다. */
table.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
table.admin-table th, table.admin-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 0.87rem; text-align: left; min-width: 4.2em; overflow-wrap: anywhere; }
table.admin-table th { white-space: nowrap; }
table.admin-table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
table.admin-table tbody tr:hover { background: #fffafb; }
@media (max-width: 700px) {
    table.admin-table { border-radius: var(--radius-sm); }
    table.admin-table th, table.admin-table td { padding: 11px 12px; }
}

/* 여러 컬럼(글 미리보기, 버튼 여러 개 등)이 있는 테이블: 모바일에서 가로 스크롤 없이 카드형으로 쌓아 보여준다.
   (아이 프로필 관리, 관리자 게시글 자동검사 등 여러 곳에서 공용으로 사용) */
@media (max-width: 700px) {
    table.stack-table { overflow-x: visible; white-space: normal; box-shadow: none; background: transparent; border-radius: 0; }
    table.stack-table thead { display: none; }
    table.stack-table, table.stack-table tbody, table.stack-table tr, table.stack-table td { display: block; width: 100%; }
    table.stack-table tr {
        background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
        margin-bottom: 10px; padding: 4px 14px; box-shadow: var(--shadow);
    }
    table.stack-table td {
        display: flex; align-items: center; justify-content: space-between; gap: 10px;
        padding: 10px 0; border-bottom: 1px dashed var(--border);
    }
    table.stack-table td:last-child { border-bottom: none; }
    table.stack-table td::before { content: attr(data-label); font-weight: 700; color: var(--muted); flex-shrink: 0; }
    table.stack-table td.stack-cell-action { justify-content: flex-end; gap: 8px; }
    table.stack-table td.stack-cell-action::before { content: none; }
    table.stack-table td.stack-cell-wrap { align-items: flex-start; flex-direction: column; gap: 4px; }
    table.stack-table td.stack-cell-wrap::before { margin-bottom: 2px; }
    table.stack-table td[colspan] { display: block; text-align: center; border-bottom: none; }
    table.stack-table td[colspan]::before { content: none; }
}
table td[colspan] { text-align: center; color: var(--muted); }

/* 쪽지 목록: 모바일에서는 가로 스크롤 표(위 규칙)가 아니라 카드 목록으로 보여준다. */
@media (max-width: 700px) {
    table.message-list-table { display: none !important; }
}
.message-card-list { display: none; flex-direction: column; gap: 10px; }
@media (max-width: 700px) {
    .message-card-list { display: flex; }
}
.message-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px;
}
.message-card.unread { border-color: var(--primary); background: var(--primary-light); }
.message-card-link { display: block; color: inherit; }
.message-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.message-card-name { font-weight: 700; }
.message-card-date { color: var(--muted); font-size: 0.76rem; flex-shrink: 0; }
.message-card-preview {
    margin: 6px 0 0; color: var(--muted); font-size: 0.85rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.message-card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.message-card-status { color: var(--muted); font-size: 0.76rem; margin-right: auto; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.page-numbers { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--border); font-size: 0.85rem; font-weight: 600; }
.pagination a:hover { border-color: var(--primary); color: var(--primary-dark); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-arrow { color: var(--muted); }
.pagination .page-arrow.disabled { opacity: 0.35; pointer-events: none; }
.page-numbers-mobile { display: none; }
.page-arrow-mobile { display: none; }
@media (max-width: 640px) {
    .page-numbers-desktop { display: none; }
    .page-numbers-mobile { display: inline-flex; }
    .page-arrow-desktop { display: none; }
    .page-arrow-mobile { display: inline-flex; }
    .pagination a, .pagination span { padding: 7px 11px; font-size: 0.8rem; }
}

/* ---------- Detail ---------- */
.detail-box {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 34px 36px 38px; box-shadow: var(--shadow-hover); position: relative; overflow: hidden;
}
.detail-box::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}
.detail-box .page-header {
    padding-bottom: 20px; margin-bottom: 4px; border-bottom: 1.5px solid var(--border);
    align-items: flex-start;
}
.detail-box .page-title { font-size: 1.5rem; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.detail-image {
    max-width: 100%; border-radius: var(--radius); margin: 22px 0; display: block;
    box-shadow: 0 10px 26px rgba(45, 34, 51, 0.12);
}

.detail-lead { font-size: 1rem; color: var(--text); line-height: 1.75; margin: 14px 0; }

.detail-author-row {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    margin: 18px 0 10px; padding-bottom: 14px; border-bottom: 1px dashed var(--border);
}
.detail-author { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-author-name { font-weight: 800; font-size: 1rem; color: var(--text); }
.detail-msg-btn {
    display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 700;
    color: var(--primary-dark); background: var(--primary-light); border-radius: 999px; padding: 5px 12px;
}
.detail-msg-btn:hover { background: var(--primary); color: #fff; }
.detail-author-stats { display: flex; gap: 12px; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }

.detail-meta {
    color: var(--text); font-size: 0.84rem; margin: 0 0 26px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
    border-radius: var(--radius-sm); padding: 14px 16px;
}
.detail-meta-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-meta-pills span { background: rgba(255,255,255,0.7); border-radius: 999px; padding: 5px 12px; font-weight: 600; }
.detail-meta-line + .detail-meta-line { margin-top: 6px; }
.detail-meta-line-split { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.detail-meta-line-split > a { white-space: nowrap; flex-shrink: 0; }
.detail-meta-date { color: var(--muted); flex-shrink: 0; }

.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.detail-info-item {
    background: rgba(255,255,255,0.7); border-radius: var(--radius-sm); padding: 10px 14px;
    display: flex; flex-direction: column; gap: 2px;
}
.detail-info-item .di-label { font-size: 0.74rem; color: var(--muted); font-weight: 700; }
.detail-info-item .di-value { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.detail-info-full { grid-column: 1 / -1; }
.detail-info-link { margin-top: 14px; text-align: center; }
@media (max-width: 640px) {
    .detail-info-grid { grid-template-columns: 1fr; }
}

.detail-box h2 {
    font-size: 0.98rem; margin: 34px 0 16px; padding: 11px 18px;
    border-left: 4px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: linear-gradient(90deg, var(--primary-light) 0%, rgba(255,255,255,0) 100%);
    color: var(--primary-dark); display: flex; align-items: center; gap: 6px; font-weight: 800;
}
.detail-box > h2:first-of-type { margin-top: 6px; }
.detail-box > p { line-height: 1.8; margin: 12px 0; }
.detail-box ul, .detail-box ol { margin: 0; padding-left: 1.3rem; line-height: 1.8; }
.detail-box li { margin-bottom: 6px; }
.detail-box .badge { margin-top: 4px; }

/* ---------- Notices ---------- */
.notice-list { display: flex; flex-direction: column; gap: 8px; }
.notice-item {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px 18px; color: var(--text);
}
.notice-item:hover { border-color: var(--primary); color: var(--text); }
.notice-title {
    font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notice-meta { font-size: 0.78rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
@media (max-width: 640px) {
    .notice-item { flex-direction: column; align-items: flex-start; gap: 4px; }
    .notice-title { white-space: normal; }
}

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 4px 20px;
}
.faq-item summary {
    padding: 14px 0; font-weight: 700; cursor: pointer; list-style: none; color: var(--text);
    display: flex; align-items: center; gap: 8px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: '+'; color: var(--primary-dark); font-weight: 800; font-size: 1.1rem; width: 18px; }
.faq-item[open] summary::before { content: '−'; }
.faq-item p { margin: 0 0 16px; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--muted); line-height: 1.7; }

/* ---------- Comments / Likes ---------- */
.like-section {
    text-align: center; margin: 24px 0 0; padding: 16px;
    background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
}
.like-join-row { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.comment-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px 36px 38px; box-shadow: var(--shadow-hover); margin-top: 20px;
}
.comment-list { margin-top: 0; }
.comment-list form.form-box { max-width: none; }
form.form-box.form-box-wide { max-width: none; }
#child-profile-form { scroll-margin-top: 84px; }
.comment-item {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px 16px; margin-bottom: 10px;
}
.comment-item .nickname { color: var(--text); font-weight: 700; margin-left: 8px; }
.comment-item .meta { color: var(--muted); font-size: 0.78rem; margin-left: 8px; }

.comment-item.comment-reply {
    margin: 10px 0 0 28px; background: var(--bg); border-style: dashed;
}
.comment-item.comment-reply .reply-arrow { color: var(--primary); font-weight: 800; margin-right: 4px; }

/*
 * 댓글 한 줄 레이아웃(CSS 그리드): PC에서는 "작성자/등록일 - 좋아요 - 답글/삭제"가 전부 한 줄에,
 * 모바일(640px 이하)에서는 좋아요만 작성자/등록일과 같은 줄 오른쪽에 남고 답글/삭제는 본문 아래 별도 줄로 내려간다.
 */
.comment-grid {
    display: grid; align-items: center; column-gap: 10px; row-gap: 6px;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "who like secondary" "content content content";
}
.comment-who { grid-area: who; display: flex; align-items: center; flex-wrap: wrap; }
.comment-like-wrap { grid-area: like; }
.comment-body-text { grid-area: content; margin: 0; }
.comment-secondary { grid-area: secondary; display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
    .comment-grid {
        grid-template-columns: 1fr auto;
        grid-template-areas: "who like" "content content" "secondary secondary";
    }
    .comment-secondary { justify-content: flex-start; }
}

.comment-like-form { display: inline-flex; }
.comment-like-btn {
    display: inline-flex; align-items: center; gap: 4px; cursor: pointer; border: 1.5px solid var(--border);
    background: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 0.78rem; color: var(--muted);
    transition: all .15s;
}
.comment-like-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.comment-like-btn.liked { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.comment-reply-btn {
    border: none; background: none; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 0.78rem;
    padding: 5px 4px; transition: color .15s;
}
.comment-reply-btn:hover { color: var(--primary-dark); }
.comment-reply-form { margin: 10px 0 0 28px; }
.comment-reply-form textarea {
    width: 100%; min-height: 60px; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.88rem; font-family: inherit; background: #fdfbfc; color: var(--text); resize: vertical;
}
.comment-reply-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); background: #fff; }
.comment-reply-form .btn { margin-top: 8px; }

.like-btn {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1.5px solid var(--border);
    background: #fff; border-radius: 999px; padding: 10px 20px; font-weight: 700; font-size: 0.9rem; transition: all .15s;
}
.like-btn:hover { border-color: var(--primary); }
.like-btn.liked { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* (비회원 가입 유도 배너의 스타일은 style.css 캐시와 무관하게 동작하도록 includes/footer.php 안에 직접 있다) */

/* ---------- 공유 버튼(카카오톡 / 링크 복사) ---------- */
.share-buttons { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.share-btn {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1.5px solid var(--border);
    background: #fff; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 0.88rem;
    font-family: inherit; color: var(--text); transition: all .15s;
}
.share-btn:hover { border-color: var(--primary); }
.share-btn.share-kakao { background: #fee500; border-color: #fee500; color: #3c1e1e; }
.share-btn.share-kakao:hover { background: #ffed4a; border-color: #e6cf00; }
@media (max-width: 640px) {
    .share-btn { padding: 9px 14px; font-size: 0.82rem; }
}

/* ---------- 이전글/다음글 네비게이션 ---------- */
.post-nav {
    margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
    background: var(--surface);
}
.post-nav-link {
    display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: var(--text);
    border-bottom: 1px solid var(--border); transition: background .15s;
}
.post-nav-link:last-child { border-bottom: none; }
.post-nav-link:not(.post-nav-empty):hover { background: var(--primary-light); }
.post-nav-label { font-weight: 700; font-size: 0.82rem; color: var(--muted); flex-shrink: 0; width: 70px; }
.post-nav-title { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-nav-empty .post-nav-title { color: var(--muted); }

/* ---------- 다른 글 더보기(목록 미리보기) ---------- */
.post-list-preview { margin-top: 32px; }
.post-list-preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.post-list-preview-head h2 { font-size: 1.15rem; margin: 0; }
.post-list-preview-table {
    width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; font-size: 0.86rem;
}
.post-list-preview-table th, .post-list-preview-table td {
    padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-list-preview-table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; font-size: 0.78rem; }
.post-list-preview-table tbody tr:last-child td { border-bottom: none; }
.post-list-preview-table tbody tr:hover { background: #fffafb; }
/* 제목 컬럼만 넓게 고정하고, 나머지(작성자/작성일/조회 등 — 게시판마다 개수가 다름)는 남는 공간을 균등하게 나눠 가진다. */
.post-list-preview-table th:first-child, .post-list-preview-table td:first-child { width: 50%; }
.post-list-preview-table td.post-list-preview-empty { text-align: center; color: var(--muted); white-space: normal; }
@media (min-width: 641px) {
    /* PC에서만: 마지막 컬럼(조회/영업시간 등)은 오른쪽 정렬. 모바일 정렬은 data-mobile-right로만 제어한다. */
    .post-list-preview-table th:last-child, .post-list-preview-table td:last-child { text-align: right; }
}

/* 모바일에서는 가로 스크롤 표 대신, 행 하나가 카드 하나가 되는 형태로 재배치한다(컬럼 수가 게시판마다 달라도 안전). */
@media (max-width: 640px) {
    .post-list-preview-table { table-layout: auto; }
    .post-list-preview-table thead { display: none; }
    .post-list-preview-table, .post-list-preview-table tbody, .post-list-preview-table td {
        display: block; width: auto;
    }
    /* tr을 flex column으로 둬서, 오른쪽 정렬 필드(order:1)를 PC 컬럼 순서와 무관하게 항상 맨 아래로 보낸다. */
    .post-list-preview-table tr { display: flex; flex-direction: column; padding: 12px 14px; border-bottom: 1px solid var(--border); }
    .post-list-preview-table tbody tr:last-child { border-bottom: none; }
    .post-list-preview-table td {
        border-bottom: none; padding: 3px 0; white-space: normal; overflow: visible; text-align: left;
    }
    .post-list-preview-table td:first-child { font-weight: 700; margin-bottom: 4px; }
    .post-list-preview-table td[data-label]:not(:first-child)::before {
        content: attr(data-label) ": "; color: var(--muted); font-weight: 600; font-size: 0.78rem;
    }
    .post-list-preview-table td.post-list-preview-empty { padding: 16px 0; }

    /* 필드 하나는 오른쪽 정렬 + 항상 맨 아래로(예: 병원-영업시간, 이벤트-상태), 나머지는 왼쪽 정렬 한 줄씩 원래 순서대로. */
    .post-list-preview-table td[data-mobile-right] { text-align: right; order: 1; }
}
.post-list-preview-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.post-list-preview-top { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.post-list-preview-top:hover { color: var(--primary-dark); }

/* ---------- Banner ---------- */
.banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff; border-radius: 24px; padding: 48px 40px; margin-bottom: 40px;
    box-shadow: 0 16px 32px rgba(167, 139, 250, 0.25); position: relative; overflow: hidden;
}
.banner h1 { margin: 0 0 10px; font-size: 1.8rem; }
.banner p { margin: 0 0 22px; opacity: 0.95; font-size: 1rem; }
.banner .btn-secondary { background: #fff; color: var(--primary-dark); border: none; box-shadow: 0 4px 14px rgba(0,0,0,0.12); }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 40px; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; box-shadow: var(--shadow); }
.stat-box .num { font-size: 1.8rem; font-weight: 800; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-box .label { color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-top: 4px; }
@media (max-width: 640px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat-box { padding: 14px 6px; }
    .stat-box .num { font-size: 1.1rem; }
    .stat-box .label { font-size: 0.66rem; margin-top: 2px; }
}

/* ---------- Sections ---------- */
.section-block { margin-bottom: 44px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: 1.2rem; }
.section-head .links a { font-size: 0.84rem; margin-left: 12px; color: var(--muted); font-weight: 700; }
.section-head .links a:hover { color: var(--primary-dark); }

/* ---------- Quick menu / tabs ---------- */
.quick-menu { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }

.search-bar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 28px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 22px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.search-bar::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}
.search-bar select, .search-bar input[type=text] {
    padding: 11px 16px; border: 1.5px solid var(--border); border-radius: 999px;
    font-size: 0.88rem; font-family: inherit; background: #fdfbfc; color: var(--text); font-weight: 600;
    appearance: none; -webkit-appearance: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-bar select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23ff5c89' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; cursor: pointer;
    min-width: 108px;
}
.search-bar .search-divider { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }
.search-bar .search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-bar .search-input-wrap::before {
    content: "🔍"; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    font-size: 0.82rem; opacity: 0.55; pointer-events: none;
}
.search-bar input[type=text] { width: 100%; font-weight: 500; padding-left: 36px; }
.search-bar select:hover, .search-bar input[type=text]:hover { border-color: var(--primary); }
.search-bar select:focus, .search-bar input[type=text]:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); background: #fff;
}
.search-bar button { flex-shrink: 0; }
.search-bar .search-row { display: contents; }

@media (max-width: 640px) {
    .search-bar { flex-wrap: wrap; align-items: stretch; padding: 14px; gap: 8px; }
    .search-bar .search-row {
        display: flex; align-items: center; gap: 6px; width: 100%;
    }
    .search-bar .search-row select {
        flex: 1 1 0; min-width: 0; width: auto; padding: 9px 22px 9px 10px; font-size: 0.76rem;
        background-position: right 8px center; background-size: 10px 7px;
    }
    .search-bar .search-divider { display: none; }
    .search-bar .search-row-submit .search-input-wrap { flex: 1; min-width: 0; }
    .search-bar .search-row-submit input[type=text] { padding: 9px 12px 9px 30px; font-size: 0.82rem; }
    .search-bar .search-row-submit .btn { flex-shrink: 0; padding: 9px 16px; font-size: 0.82rem; }
}

/* ---------- Repeatable field groups (ingredients/steps/itinerary) ---------- */
.repeat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.repeat-row { display: flex; align-items: center; gap: 8px; }
.repeat-row input[type=text] { flex: 1; }
.repeat-remove {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border);
    background: #fff; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1;
}
.repeat-remove:hover { border-color: var(--error); color: var(--error); }
.repeat-add { margin-top: 4px; }

.itinerary-row {
    align-items: flex-start; background: #faf6f8; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px; gap: 10px;
}
.itinerary-row .day-label { flex-shrink: 0; font-weight: 800; color: var(--primary-dark); padding-top: 10px; min-width: 52px; }
.itinerary-row .itinerary-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.itinerary-row input[type=text], .itinerary-row textarea { width: 100%; }
.itinerary-row textarea { min-height: 60px; }
.itinerary-row .repeat-remove { margin-top: 4px; }

/* ---------- Gallery (multi attachments) ---------- */
.gallery-wrap { margin: 18px 0 26px; }
.gallery-count { font-size: 0.82rem; font-weight: 700; color: var(--primary-dark); margin: 0 0 10px; }
.gallery-count-max { font-weight: 500; color: var(--muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.gallery-item {
    position: relative; display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow);
}
.gallery-item a { display: block; aspect-ratio: 1 / 1; overflow: hidden; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-filename {
    display: block; padding: 6px 8px; font-size: 0.72rem; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid var(--border);
}
.gallery-delete-btn {
    position: absolute; top: 6px; right: 6px; z-index: 1; margin: 0;
    width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(45,34,51,0.7); color: #fff;
    cursor: pointer; font-size: 0.9rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.gallery-delete-btn:hover { background: var(--error); }
.file-hint { color: var(--muted); font-size: 0.78rem; margin-top: 6px; }
.file-total { font-weight: 700; }
.flash-attention { animation: flash-attention .9s ease 2; }
@keyframes flash-attention { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .flash-attention { animation: none; } }
.file-warning {
    display: none; color: var(--error); background: var(--error-bg); border-radius: var(--radius-sm);
    padding: 8px 12px; font-size: 0.8rem; font-weight: 700; margin-top: 8px;
}
.file-name-list {
    list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px;
}
.file-name-list:empty { display: none; }
.file-name-list li {
    background: #fdfbfc; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 8px 6px 12px; font-size: 0.78rem; color: var(--text);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.file-name-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-remove-btn {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; border: none;
    background: rgba(45,34,51,0.12); color: var(--text); cursor: pointer; font-size: 0.85rem;
    line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0;
    transition: background .15s, color .15s;
}
.file-remove-btn:hover { background: var(--error); color: #fff; }

.existing-image-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.existing-image-preview img { max-width: 160px; border-radius: var(--radius-sm); display: block; }
.existing-image-preview .file-remove-btn { width: 24px; height: 24px; font-size: 0.95rem; }

/* ---------- Social login ---------- */
.social-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.social-btn {
    position: relative; display: flex; align-items: center; justify-content: center;
    padding: 12px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.88rem;
}
.social-btn .social-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; flex-shrink: 0; }
.social-btn.kakao { background: #FEE500; color: #191600; }
.social-btn.naver { background: #03C75A; color: #fff; }
.social-btn.google { background: #fff; color: #3c4043; border: 1.5px solid var(--border); }
.social-btn.google:hover { border-color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
    .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 14px; border-bottom: 1px solid var(--border); display: none; box-shadow: var(--shadow); font-size: 0.95rem; max-height: 80vh; overflow-y: auto; }
    .main-nav.open { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .main-nav a {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
        padding: 16px 10px; border-radius: var(--radius-sm); white-space: normal; text-align: center;
        background: color-mix(in srgb, var(--tile, var(--primary)) 16%, #fff);
    }
    .main-nav a .nav-icon { display: block; font-size: 1.6rem; }
    .main-nav a.active { background: var(--tile, var(--primary)); color: #fff; }
    .nav-toggle { display: block; }
}
@media (max-width: 640px) {
    /* 폰에서 로그인 메뉴(쪽지·닉네임·관리자·로그아웃)가 화면보다 넓어 페이지가 좌우로 흔들리던 문제:
       헤더가 줄어들 수 있게 하고 닉네임은 말줄임 처리한다. 햄버거 버튼은 항상 보이게 유지. */
    .header-inner { gap: 8px; }
    .header-right { min-width: 0; flex-shrink: 1; gap: 6px; }
    .auth-area { font-size: 0.74rem; gap: 7px; min-width: 0; flex-shrink: 1; }
    .auth-area > a { flex-shrink: 0; }
    .auth-area > a.header-avatar-link { flex-shrink: 1; min-width: 0; max-width: 34vw; }
    .header-avatar-link .nickname-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
    .logo { font-size: 1.05rem; margin-left: 6px; }
    .banner { padding: 32px 24px; }
    .banner h1 { font-size: 1.4rem; }
    .nav-toggle { margin-right: 6px; }
}
@media (max-width: 480px) {
    /* 아주 좁은 폰에서는 닉네임 글자를 숨기고 프로필 사진만 남긴다(사진을 누르면 마이페이지로 이동). */
    .header-avatar-link .nickname-text { display: none; }
}
