:root {
    --bg: #fafaf7;
    --card: #ffffff;
    --text: #2d3032;
    --muted: #8a9099;
    --primary: #2e7d32;
    --primary-hover: #246828;
    --primary-soft: #e8f5e9;
    --info: #f57c00;
    --info-soft: #fff3e0;
    --calc: #00838f;
    --calc-soft: #e0f7fa;
    --accent: #ff8a65;
    --pink-soft: #fde2e4;
    --pink: #ec407a;
    --border: #e8e8e6;
    --error: #c62828;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--primary); }

.container { max-width: 1024px; margin: 0 auto; padding: 0 1rem 4rem; }

/* Header */
.site-header {
    padding: 1.25rem 0 .875rem;
    border-bottom: 1px solid var(--border);
}
.site-header .brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .875rem;
    flex-wrap: wrap;
}
.site-header .brand {
    display: flex;
    flex-direction: column;
    gap: .125rem;
}
.site-header h1 { margin: 0; font-size: 1.5rem; line-height: 1.1; }
.site-header h1 a { font-weight: 700; }
.site-header .tagline {
    font-size: .8rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* User area in header */
.user-area { font-size: .9rem; }
.auth-links, .user-info {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.auth-link-btn {
    padding: .375rem .875rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    font-size: .85rem;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.4;
}
.auth-link-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}
.auth-link-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.auth-link-btn.primary:hover {
    background: var(--primary-hover);
    color: white;
}
.user-info .nickname {
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    padding: .25rem .5rem;
    border-radius: 6px;
}
.user-info .nickname:hover {
    background: var(--primary-soft);
    color: var(--primary);
}
.logout-form { margin: 0; display: inline; }

.board-nav {
    display: flex;
    gap: .25rem;
    align-items: center;
    flex-wrap: wrap;
}
.nav-tab {
    padding: .5rem 1rem;
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    font-size: .95rem;
}
.nav-tab:hover {
    background: var(--primary-soft);
    color: var(--primary);
}
.nav-tab-calc {
    background: var(--calc-soft);
    color: var(--calc);
}
.nav-tab-calc:hover {
    background: var(--calc);
    color: white;
}

.nav-dropdown { position: relative; }
.nav-dropdown summary {
    list-style: none;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after {
    content: "▾";
    font-size: .7rem;
    color: var(--muted);
    margin-left: .25rem;
}
.nav-dropdown[open] summary {
    background: var(--primary-soft);
    color: var(--primary);
}
.nav-dropdown[open] summary::after {
    content: "▴";
    color: var(--primary);
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + .25rem);
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .375rem;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: .125rem;
    z-index: 10;
}
.dropdown-menu a {
    padding: .5rem .75rem;
    border-radius: 6px;
    font-size: .9rem;
    color: var(--text);
    display: block;
}
.dropdown-menu a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}
.dropdown-group {
    display: flex;
    flex-direction: column;
    gap: .125rem;
    padding: .25rem 0;
    border-top: 1px solid var(--border);
}
.dropdown-group:first-child {
    border-top: none;
    padding-top: 0;
}
.dropdown-label {
    font-size: .7rem;
    color: var(--muted);
    padding: .25rem .75rem .125rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
}

/* Home hero banner (운영자 큐레이션, 환영 배너 영역과 같은 크기) */
.banners {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.hero-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 280px;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease;
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--pink-soft) 50%, #fef3c7 100%);
}
.hero-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.10);
    color: inherit;
}
.hero-banner.no-link { cursor: default; pointer-events: none; }
.hero-banner.no-link:hover { transform: none; box-shadow: none; }

/* 이미지가 있는 배너 — 이미지가 곧 배너 (텍스트 오버레이 없음) */
.hero-banner-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* 이미지가 없는 배너 — 파스텔 그라데이션 + 텍스트 표시 */
.hero-banner-text {
    position: relative;
    z-index: 3;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 720px;
}
.hero-banner-text h2 {
    margin: 0 0 .5rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text);
}
.hero-banner-text p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--muted);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .hero-banner { min-height: 220px; border-radius: 14px; }
    .hero-banner-text { padding: 2rem 1.25rem; }
    .hero-banner-text h2 { font-size: 1.5rem; }
    .hero-banner-text p { font-size: .95rem; }
}
@media (max-width: 480px) {
    .hero-banner { min-height: 180px; }
    .hero-banner-text { padding: 1.5rem 1rem; }
    .hero-banner-text h2 { font-size: 1.25rem; }
    .hero-banner-text p { font-size: .85rem; }
}

/* Admin banner list */
.banner-admin-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.banner-admin-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    align-items: center;
    background: white;
}
.banner-admin-item.inactive { opacity: .6; }
.banner-admin-thumb {
    width: 100px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f3 0%, #fafafa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.banner-admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.banner-admin-thumb-empty { font-size: 1.5rem; opacity: .5; }
.banner-admin-body { flex: 1; min-width: 0; }
.banner-admin-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
    flex-wrap: wrap;
}
.banner-admin-subtitle {
    margin: 0 0 .25rem;
    color: var(--muted);
    font-size: .9rem;
}
.banner-admin-link {
    margin: 0 0 .25rem;
    font-size: .8rem;
    color: var(--muted);
    word-break: break-all;
}
.banner-admin-link a { color: var(--primary); }
.banner-admin-meta {
    margin: 0;
    font-size: .75rem;
    color: var(--muted);
}
.banner-admin-actions {
    display: flex;
    gap: .375rem;
    flex-shrink: 0;
}

/* Admin tools section in mypage */
.admin-tools {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Admin board list */
.board-admin-actions {
    display: flex;
    gap: .25rem;
    justify-content: flex-end;
}
.board-admin-actions .btn {
    padding: .375rem .75rem;
    font-size: .8rem;
}
.board-admin-help {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--info-soft);
    border-radius: 12px;
    border-left: 4px solid var(--info);
    font-size: .875rem;
}
.board-admin-help h4 {
    margin: 0 0 .5rem;
    color: var(--info);
    font-size: .9rem;
}
.board-admin-help ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: var(--text);
}
.board-admin-help li { margin: .25rem 0; }
.board-admin-help p { margin: 0; color: var(--text); }
.board-admin-help h4:not(:first-child) { margin-top: 1rem; }
.badge.badge-info { background: var(--info-soft); color: var(--info); }

/* Welcome banner */
.welcome-banner {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    margin-top: 1rem;
    position: relative;
}
.welcome-banner h2 {
    margin: 0 0 .5rem;
    font-size: 1.875rem;
    color: var(--text);
    letter-spacing: -0.01em;
    font-weight: 700;
}
.welcome-banner p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.welcome-illust {
    position: relative;
    display: inline-block;
    margin-bottom: 1.25rem;
}

/* Cute cat bubble */
.cat-bubble {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, #ffe4e6 0%, #fde2e4 50%, #fef3c7 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3.75rem;
    line-height: 1;
    box-shadow: 0 10px 30px rgba(236, 64, 122, 0.15), 0 4px 8px rgba(0,0,0,0.04);
    animation: float 3.5s ease-in-out infinite;
}
.cat-bubble.small {
    width: 64px;
    height: 64px;
    font-size: 2rem;
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

/* Floating decorations */
.welcome-illust .paw,
.welcome-illust .heart {
    position: absolute;
    font-size: 1.25rem;
    opacity: .7;
    animation: floatDecor 4s ease-in-out infinite;
}
.paw-1 { top: 8px; left: -28px; animation-delay: 0s; }
.paw-2 { bottom: 12px; right: -28px; animation-delay: 1.5s; }
.heart {
    top: -8px; right: -16px;
    font-size: 1.5rem !important;
    animation-delay: 0.7s;
}
@keyframes floatDecor {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    50% { transform: translate(2px, -6px) rotate(8deg); }
}

/* Home hero - 4 cards */
.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.hero-card {
    display: block;
    padding: 1.75rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all .2s ease;
    color: inherit;
}
.hero-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    color: inherit;
}
.hero-card h3 {
    margin: 0 0 .375rem;
    font-size: 1.25rem;
}
.hero-card p {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.5;
}
.hero-icon {
    font-size: 2.25rem;
    line-height: 1;
    margin-bottom: .75rem;
}
.hero-card-info {
    background: linear-gradient(135deg, #fff8f0 0%, #ffffff 100%);
    border-color: #ffe0b2;
}
.hero-card-info:hover {
    border-color: var(--info);
    box-shadow: 0 6px 20px rgba(245, 124, 0, 0.12);
}
.hero-card-info h3 { color: var(--text); }
.hero-card-diary {
    background: linear-gradient(135deg, #f0f7f1 0%, #ffffff 100%);
    border-color: #c8e6c9;
}
.hero-card-diary:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.12);
}
.hero-card-diary h3 { color: var(--primary); }
.hero-card-calc {
    background: linear-gradient(135deg, #e0f7fa 0%, #ffffff 100%);
    border-color: #b2ebf2;
}
.hero-card-calc:hover {
    border-color: var(--calc);
    box-shadow: 0 6px 20px rgba(0, 131, 143, 0.12);
}
.hero-card-calc h3 { color: var(--calc); }

/* Calculator page */
.calculator-page {
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.calc-header { margin-bottom: 1.5rem; }
.calc-header h2 { margin: 0 0 .375rem; }
.calc-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
}
.calc-form fieldset {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem 1.25rem;
    margin: 0 0 1.25rem;
}
.calc-form legend {
    padding: 0 .5rem;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
}
.calc-form .field { margin-bottom: 0; }
.calc-form .hint {
    margin: .25rem 0 0;
    font-size: .8rem;
    color: var(--muted);
}

.calc-result-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--calc-soft);
}
.calc-result-section h3 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    color: var(--calc);
}
.calc-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.result-card {
    background: var(--bg);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.result-card.highlight {
    background: var(--calc-soft);
    border-color: #b2ebf2;
}
.result-label {
    color: var(--muted);
    font-size: .8rem;
    margin-bottom: .25rem;
}
.result-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}
.result-card.highlight .result-value { color: var(--calc); }
.result-value .unit {
    font-size: .85rem;
    color: var(--muted);
    font-weight: 500;
    margin-left: .125rem;
}

.calc-steps {
    background: #f8f8f6;
    border-radius: 10px;
    padding: .75rem 1.25rem;
    margin-bottom: 1rem;
}
.calc-steps summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    list-style: none;
    user-select: none;
}
.calc-steps summary::-webkit-details-marker { display: none; }
.calc-steps summary::after {
    content: " ▾";
    color: var(--muted);
    font-size: .75rem;
}
.calc-steps[open] summary::after { content: " ▴"; }
.calc-steps ol {
    margin: .75rem 0 .25rem;
    padding-left: 1.5rem;
    color: var(--muted);
    font-size: .9rem;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.calc-steps li { padding: .125rem 0; }

.calc-disclaimer {
    background: var(--info-soft);
    color: var(--text);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border-left: 4px solid var(--info);
    font-size: .9rem;
    line-height: 1.6;
}
.calc-disclaimer strong { color: var(--info); }

/* Community strip (less prominent) */
.community-strip { margin-top: 3rem; }
.community-strip h2 {
    margin: 0 0 1rem;
    font-size: .95rem;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.strip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .5rem;
}
.strip-item {
    display: flex;
    flex-direction: column;
    padding: .75rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all .15s ease;
}
.strip-item:hover {
    background: white;
    border-color: var(--primary);
}
.strip-name {
    font-weight: 500;
    font-size: .9rem;
}
.strip-desc {
    font-size: .75rem;
    color: var(--muted);
    margin-top: .125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Board view */
.board, .post-form, .post-detail {
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.board-header h2 { margin: 0 0 .25rem; }
.board-desc {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

/* 게시판 검색 폼 — 우측 정렬, 컴팩트 */
.search-form {
    display: flex;
    gap: .5rem;
    margin: 0 0 1rem auto;
    max-width: 340px;
    width: 100%;
}
.search-form input {
    flex: 1;
    min-width: 0;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .95rem;
    background: white;
}
.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}
.search-form button {
    flex-shrink: 0;
    padding: .5rem .875rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    white-space: nowrap;
}
.search-form button:hover { background: var(--primary-hover); }

@media (max-width: 480px) {
    .search-form { max-width: 100%; margin-left: 0; }
    .search-form button { padding: .5rem .75rem; font-size: .85rem; }
}
.search-info {
    margin: 0 0 1rem;
    padding: .625rem .875rem;
    background: var(--info-soft);
    color: var(--text);
    border-radius: 8px;
    font-size: .9rem;
}
.search-info strong { color: var(--info); }
.search-clear {
    margin-left: .75rem;
    color: var(--muted);
    font-size: .85rem;
    text-decoration: none;
}
.search-clear:hover { color: var(--error); }
.board-notice {
    background: var(--info-soft);
    color: var(--info);
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .875rem;
    margin: 0 0 1.5rem;
}
.muted-label { color: var(--muted); font-weight: 400; }

.post-list { width: 100%; border-collapse: collapse; }
.post-list th,
.post-list td {
    padding: .75rem .5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.post-list th {
    color: var(--muted);
    font-weight: 500;
    font-size: .875rem;
}
.post-list .col-id,
.post-list .col-views,
.post-list .col-date,
.post-list .col-author { text-align: center; white-space: nowrap; }
.post-list .col-id { width: 60px; }
.post-list .col-author { width: 100px; }
.post-list .col-views { width: 60px; }
.post-list .col-date { width: 140px; color: var(--muted); font-size: .875rem; }
.post-list .empty,
.faq-list .empty {
    text-align: center;
    color: var(--muted);
    padding: 3rem 1rem;
}

/* FAQ accordion */
.faq-list { display: flex; flex-direction: column; gap: .5rem; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: white;
    transition: border-color .15s ease;
}
.faq-item[open] { border-color: var(--info); }
.faq-item summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    font-weight: 500;
    user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    margin-left: auto;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--muted);
    transition: transform .2s ease;
}
.faq-item[open] summary::after {
    content: "−";
    color: var(--info);
}
.q-mark, .a-mark {
    display: inline-block;
    flex-shrink: 0;
    width: 1.5rem;
    font-weight: 700;
}
.q-mark { color: var(--info); }
.a-mark { color: var(--primary); }
.q-text { flex: 1; }
.faq-answer {
    display: flex;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: #fafaf7;
}
.answer-text {
    flex: 1;
    line-height: 1.7;
    color: #444;
}
.answer-text.rich-content p { margin: .35rem 0; }
.answer-text.rich-content p:first-child { margin-top: 0; }
.answer-text.rich-content p:last-child { margin-bottom: 0; }
.answer-text.rich-content p:empty { display: none; }
.answer-text.rich-content br + br { display: none; }
.answer-text.rich-content img { margin: .5rem 0; }
.faq-meta {
    display: flex;
    justify-content: space-between;
    padding: .5rem 1.25rem .75rem;
    font-size: .8rem;
    color: var(--muted);
    background: #fafaf7;
}
.faq-meta a { color: var(--info); }
.faq-meta a:hover { text-decoration: underline; }

/* Form */
.field { margin-bottom: 1.25rem; }
.field label { display: block; margin-bottom: .5rem; font-weight: 500; }
.field input,
.field textarea {
    width: 100%;
    padding: .625rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
}
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}
.error { color: var(--error); font-size: .85rem; margin-top: .25rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: .5rem 1.25rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: .9rem;
    font-family: inherit;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); }
.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid #ffcdd2;
    padding: .5rem 1.25rem;
    border-radius: 8px;
    font-size: .9rem;
    font-family: inherit;
    cursor: pointer;
}
.btn-danger:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.owner-actions {
    display: inline-flex;
    gap: .5rem;
    margin-left: auto;
}
.inline-form { display: inline; margin: 0; }
.actions .owner-actions { margin-left: 0; }
.post-detail .actions {
    justify-content: space-between;
}

.actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Post detail */
.post-detail .breadcrumb {
    font-size: .875rem;
    color: var(--muted);
    margin-bottom: .5rem;
}
.post-detail .breadcrumb a { color: var(--muted); }
.post-detail .breadcrumb a:hover { color: var(--primary); }
.post-detail h2 { margin: 0 0 .5rem; }
.post-detail .meta {
    display: flex;
    gap: 1rem;
    color: var(--muted);
    font-size: .875rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.post-detail .content {
    min-height: 200px;
    line-height: 1.8;
}

/* Rich content (rendered HTML from editor) */
.rich-content { line-height: 1.8; }
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: .5rem 0;
}

/* Video embed (YouTube/Vimeo) - 16:9 반응형 */
.rich-content .video-embed,
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}
.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.rich-content p { margin: .75rem 0; }
.rich-content p:first-child { margin-top: 0; }
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
    margin-top: 1.5rem;
    margin-bottom: .5rem;
}
.rich-content blockquote {
    border-left: 3px solid var(--border);
    padding: .25rem 0 .25rem 1rem;
    margin: .75rem 0;
    color: var(--muted);
}
.rich-content code {
    background: #f5f5f3;
    padding: .125rem .375rem;
    border-radius: 4px;
    font-size: .9em;
}
.rich-content pre {
    background: #f5f5f3;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}
.rich-content ul,
.rich-content ol { padding-left: 1.5rem; }

/* Editor field */
.editor-field { margin-bottom: 1.25rem; }
.editor-field > label {
    display: block;
    margin-bottom: .5rem;
    font-weight: 500;
}
#editor {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.editor-hint {
    margin: .5rem 0 0;
    font-size: .8rem;
    color: var(--muted);
}

/* Diary list - rows with thumbnail */
.diary-list-rows {
    display: flex;
    flex-direction: column;
}
.diary-row {
    display: flex;
    gap: 1rem;
    padding: .875rem .5rem;
    border-bottom: 1px solid var(--border);
    transition: background .15s ease;
    color: inherit;
    align-items: center;
}
.diary-row:first-child {
    border-top: 1px solid var(--border);
}
.diary-row:hover {
    background: #f9faf6;
    color: inherit;
}
.diary-row-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 75px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f3 0%, #fafafa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.diary-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumb-empty-row {
    font-size: 1.75rem;
    opacity: .35;
}
.diary-row-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 0;
}
.diary-row-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.diary-row-meta {
    font-size: .85rem;
    color: var(--muted);
    display: flex;
    gap: .4rem;
    align-items: center;
    flex-wrap: wrap;
}
.diary-row-meta .dot { opacity: .5; }

/* Mobile: thumbnail smaller */
@media (max-width: 480px) {
    .diary-row-thumb { width: 72px; height: 54px; }
    .diary-row-title { font-size: .95rem; }
    .diary-row-meta { font-size: .8rem; }
}

/* Auth forms */
.auth-form {
    background: var(--card);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    margin: 3rem auto 0;
    max-width: 440px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
}
.auth-illust {
    text-align: center;
    margin-bottom: .75rem;
}
.auth-form h2 {
    margin: 0 0 .25rem;
    text-align: center;
    font-size: 1.4rem;
}
.auth-welcome {
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
    margin: 0 0 1.5rem;
}
.auth-form .actions {
    margin-top: 1.5rem;
    justify-content: center;
}
.auth-form .btn-block {
    width: 100%;
    padding: .875rem;
    font-size: 1rem;
    border-radius: 12px;
    font-weight: 600;
}
.auth-form .auth-link {
    text-align: center;
    margin: 1.5rem 0 0;
    font-size: .9rem;
    color: var(--muted);
}
.auth-form .auth-link a {
    color: var(--primary);
    font-weight: 500;
}
.auth-form .hint {
    margin: .35rem 0 0;
    font-size: .8rem;
    color: var(--muted);
}

/* My page profile */
.mypage-profile { margin-top: 2rem; }
.profile-card {
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--pink-soft) 100%);
    padding: 2rem;
    border-radius: 16px;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    border: 1px solid var(--primary-soft);
}
.profile-info { flex: 1; min-width: 0; }
.profile-nickname {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: .75rem;
    color: var(--text);
}
.profile-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .5rem 1.5rem;
    margin: 0;
}
.profile-detail dt {
    color: var(--muted);
    font-size: .8rem;
    margin-bottom: .125rem;
}
.profile-detail dd {
    margin: 0;
    font-size: .95rem;
    word-break: break-word;
}

/* Nickname edit (collapsible) */
.nickname-edit {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(0,0,0,.08);
}
.nickname-edit summary {
    cursor: pointer;
    color: var(--primary);
    font-size: .85rem;
    font-weight: 500;
    list-style: none;
    user-select: none;
    display: inline-block;
}
.nickname-edit summary::-webkit-details-marker { display: none; }
.nickname-edit[open] summary { color: var(--muted); margin-bottom: .5rem; }
.nickname-form {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin-top: .25rem;
}
.nickname-form input {
    flex: 1;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .95rem;
    background: white;
}
.nickname-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}
.nickname-form button { white-space: nowrap; }
.nickname-edit .hint { margin: .375rem 0 0; }

/* Password change (collapsible) */
.password-change {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 1rem;
    overflow: hidden;
}
.password-change summary {
    cursor: pointer;
    padding: 1rem 1.5rem;
    list-style: none;
    user-select: none;
    font-weight: 500;
    color: var(--text);
}
.password-change summary::-webkit-details-marker { display: none; }
.password-change summary::after {
    content: " ▾";
    color: var(--muted);
    font-size: .75rem;
}
.password-change[open] summary::after { content: " ▴"; }
.password-form {
    padding: 0 1.5rem 1.25rem;
    max-width: 420px;
}
.password-form .actions { justify-content: flex-end; margin-top: 1rem; }

/* Account actions / danger zone */
.account-actions {
    margin-top: 2rem;
}
.account-actions h2 {
    font-size: 1.05rem;
    color: var(--muted);
    font-weight: 500;
    margin: 0 0 .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.danger-zone {
    background: white;
    border: 1px solid #ffcdd2;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.danger-info strong {
    display: block;
    color: var(--error);
    margin-bottom: .25rem;
}
.danger-info p {
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.6;
}

/* My cats page */
.my-cats-page {
    background: var(--card);
    padding: 2rem;
    border-radius: 16px;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.my-cats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.my-cats-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.my-cats-title h2 { margin: 0; }
.my-cats-title .board-desc { margin: .125rem 0 0; }

.cats-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-soft) 0%, #f0f7f1 50%, var(--pink-soft) 100%);
    border-radius: 16px;
    margin-top: .5rem;
}
.cats-empty-illust {
    font-size: 4rem;
    margin-bottom: .75rem;
    line-height: 1;
}
.cats-empty h3 {
    margin: 0 0 .5rem;
    font-size: 1.15rem;
    color: var(--text);
}
.cats-empty p {
    margin: 0 0 1.5rem;
    color: var(--muted);
    line-height: 1.7;
}
.empty-actions {
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-large {
    padding: .75rem 1.75rem;
    font-size: 1.05rem;
    font-weight: 600;
}

/* Cat grid + cards */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.cat-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all .2s ease;
    color: inherit;
}
.cat-card:hover {
    border-color: var(--pink);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(236, 64, 122, 0.10);
    color: inherit;
}
.cat-card-photo {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, #ffe4e6 0%, #fde2e4 50%, #fef3c7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cat-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cat-card-photo-empty {
    font-size: 3rem;
    line-height: 1;
}

.day-badge {
    background: var(--primary-soft);
    color: var(--primary);
    padding: .125rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}
.cat-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .375rem;
}
.cat-card h3 {
    margin: 0;
    font-size: 1.05rem;
}
.cat-card-meta {
    display: flex;
    gap: .5rem;
    font-size: .8rem;
    color: var(--muted);
    align-items: center;
}
.cat-card-info {
    margin: 0;
    font-size: .8rem;
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: .125rem .5rem;
    background: #f5f5f3;
    color: var(--text);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 500;
}
.badge-primary {
    background: var(--primary-soft);
    color: var(--primary);
}

.cat-profile {
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cat-profile-header {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.cat-profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f3 0%, #fafafa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cat-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cat-profile-body { flex: 1; min-width: 250px; }
.cat-profile-body h2 { margin: 0 0 .5rem; font-size: 1.75rem; }
.cat-profile-tags {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
}
.cat-info-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .5rem 1.5rem;
    margin: 1rem 0;
}
.cat-info-list dt {
    color: var(--muted);
    font-size: .8rem;
    margin-bottom: .125rem;
}
.cat-info-list dd {
    margin: 0;
    font-size: .95rem;
    word-break: break-word;
}
.cat-owner-actions {
    display: flex;
    gap: .5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.cat-diary-timeline {
    background: var(--card);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cat-diary-timeline h3 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}
.cat-diary-timeline h3 .count {
    color: var(--primary);
    font-weight: 600;
    margin-left: .25rem;
}

/* Photo preview */
#photo-preview-wrap {
    margin-top: .75rem;
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}
#photo-preview-wrap.hidden { display: none; }
#photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Field row (multiple fields side by side) */
.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}
.field-row .field { margin-bottom: 0; }

/* select 통일 스타일 */
.field select {
    width: 100%;
    padding: .625rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
}

/* Cat tag in diary list */
.cat-tag strong { color: var(--primary); }
.cat-tag.muted { color: var(--muted); }

/* Notice (공지) — 게시판 상단 고정 */
.notice-badge {
    display: inline-block;
    padding: .125rem .5rem;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 600;
    margin-right: .375rem;
    vertical-align: middle;
}
.notice-row {
    background: linear-gradient(90deg, var(--primary-soft) 0%, transparent 80%);
}
.notice-row a, .notice-row .diary-row-title {
    font-weight: 600;
}
.diary-row.notice-row {
    border-color: var(--primary);
}

/* 공지 체크박스 */
.notice-field {
    background: var(--primary-soft);
    padding: .75rem 1rem;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
}

/* 첨부파일 (작성/수정 폼) */
.attachments-field input[type="file"] {
    margin-bottom: .5rem;
}
.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem .75rem;
    background: #f8f8f6;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: .375rem;
    font-size: .9rem;
}
.attachment-name { flex: 1; word-break: break-all; }
.attachment-size { color: var(--muted); font-size: .85rem; }
.attachment-new {
    background: var(--primary-soft);
    color: var(--primary);
    padding: .0625rem .375rem;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 500;
    margin-left: .25rem;
}
.attachment-remove {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: .25rem .625rem;
    border-radius: 6px;
    font-size: .8rem;
    cursor: pointer;
    margin-left: .5rem;
    flex-shrink: 0;
}
.attachment-remove:hover {
    color: var(--error);
    border-color: var(--error);
}

/* 첨부파일 (글 보기) */
.attachments-view {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: #f8f8f6;
    border-radius: 10px;
}
.attachments-view h3 {
    margin: 0 0 .75rem;
    font-size: 1rem;
}
.attachments-view .count {
    color: var(--primary);
    font-weight: 600;
    margin-left: .25rem;
}
.attachment-view-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .375rem;
}
.attachment-view-list li {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.attachment-view-list a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .625rem .875rem;
    text-decoration: none;
    color: var(--text);
    font-size: .9rem;
}
.attachment-view-list a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}
.attachment-icon { font-size: 1rem; flex-shrink: 0; }
.attachment-view-name { flex: 1; word-break: break-all; }
.attachment-view-size { color: var(--muted); font-size: .8rem; flex-shrink: 0; }

/* 비밀글 체크박스 + 표시 */
.secret-field {
    background: #f3f0f8;
    padding: .75rem 1rem;
    border-radius: 8px;
    border: 1px solid #d6cce5;
}
.secret-field .checkbox-label { color: #6b4f8f; }
.secret-icon {
    color: #8a6db5;
    margin-right: .25rem;
}
.secret-badge {
    display: inline-block;
    padding: .125rem .5rem;
    background: #ede5f7;
    color: #6b4f8f;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    margin-right: .375rem;
    vertical-align: middle;
}
.secret-badge-small {
    background: #ede5f7;
    color: #6b4f8f;
    padding: .0625rem .375rem;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 500;
}

/* 비밀글 본문 잠긴 상태 */
.locked-content {
    text-align: center;
    padding: 4rem 2rem;
    background: #f8f6fb;
    border: 1px dashed #d6cce5;
    border-radius: 12px;
    margin: 1rem 0;
    color: var(--muted);
}
.locked-content .locked-icon {
    font-size: 3rem;
    margin-bottom: .75rem;
}
.locked-content h3 {
    margin: 0 0 .5rem;
    color: var(--text);
    font-size: 1.1rem;
}
.locked-content p { margin: 0; }

/* 비밀 댓글 잠긴 상태 */
.comment-locked {
    background: #f8f6fb;
    color: var(--muted);
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .875rem;
    font-style: italic;
}
.locked-icon-small { margin-right: .375rem; }

/* 댓글 폼 하단 (비밀 체크박스 + 등록 버튼) */
.comment-form-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.checkbox-label.small {
    font-size: .85rem;
    color: var(--muted);
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-weight: normal;
    color: var(--primary);
    margin: 0;
}
.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Cat banner on post view */
.cat-banner {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .5rem 1rem;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 999px;
    font-size: .9rem;
    margin-bottom: 1rem;
    text-decoration: none;
    transition: all .15s ease;
}
.cat-banner:hover {
    background: var(--primary);
    color: white;
}
.cat-banner strong { font-weight: 600; }

/* Comments */
.comments {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.comments h3 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}
.comments h3 .count {
    color: var(--primary);
    font-weight: 600;
    margin-left: .25rem;
}
.comment-list { margin-bottom: 1.5rem; }
.comment-list .empty {
    color: var(--muted);
    text-align: center;
    padding: 2rem 0;
    font-size: .9rem;
}
.comment-item {
    padding: .875rem 0;
    border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .375rem;
}
.comment-author {
    font-weight: 500;
    color: var(--text);
    font-size: .875rem;
}
.comment-delete-form {
    margin: 0 0 0 auto;
}
.comment-delete-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: .8rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.comment-delete-btn:hover { color: var(--error); }
.comment-content {
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .95rem;
}
.comment-form {
    margin-top: 1rem;
    background: #f9faf6;
    padding: 1rem;
    border-radius: 8px;
}
.comment-form textarea {
    width: 100%;
    padding: .625rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .95rem;
    font-family: inherit;
    background: white;
    resize: vertical;
    margin-bottom: .5rem;
    min-height: 60px;
}
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}
.comment-form button { float: right; }
.comment-form::after {
    content: "";
    display: block;
    clear: both;
}
.comment-login-prompt {
    text-align: center;
    color: var(--muted);
    padding: 1.25rem;
    background: var(--primary-soft);
    border-radius: 8px;
    margin-top: 1rem;
    font-size: .9rem;
}
.comment-login-prompt a {
    color: var(--primary);
    font-weight: 500;
}

/* Site footer */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    background: #f8f8f6;
}
.footer-inner {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    align-items: center;
    text-align: center;
}
.footer-brand {
    display: flex;
    gap: .75rem;
    align-items: baseline;
    flex-wrap: wrap;
    justify-content: center;
}
.footer-brand strong {
    color: var(--text);
    font-size: 1rem;
}
.footer-brand span {
    color: var(--muted);
    font-size: .875rem;
}
.footer-disclaimer {
    color: var(--muted);
    font-size: .825rem;
    max-width: 600px;
    line-height: 1.5;
}
.footer-meta {
    color: var(--muted);
    font-size: .8rem;
}

/* Alerts */
.alert {
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-error {
    background: #ffebee;
    color: var(--error);
    border: 1px solid #ffcdd2;
}
.alert-info {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid #c8e6c9;
}

/* ========================================================
   모바일·태블릿 반응형
   ======================================================== */

/* 태블릿 이하 (768px 이하) */
@media (max-width: 768px) {
    .container { padding: 0 .875rem 3rem; }

    /* 헤더 컴팩트 */
    .site-header { padding: 1rem 0 .75rem; }
    .site-header h1 { font-size: 1.3rem; }
    .site-header .tagline { font-size: .75rem; }
    .site-header .brand-row {
        align-items: center;
    }
    .auth-link-btn { padding: .35rem .75rem; font-size: .8rem; }
    .user-info .nickname { font-size: .85rem; padding: .2rem .4rem; }
    .nav-tab { padding: .4rem .8rem; font-size: .85rem; }

    /* 환영 배너 */
    .welcome-banner { padding: 2rem 1rem 1rem; }
    .welcome-banner h2 { font-size: 1.5rem; }
    .welcome-banner p { font-size: .9rem; }
    .cat-bubble { width: 90px; height: 90px; font-size: 3rem; }
    .cat-bubble.small { width: 56px; height: 56px; font-size: 1.75rem; }
    .paw-1 { left: -22px; }
    .paw-2 { right: -22px; }

    /* 메인 카드 영역들 패딩 줄임 */
    .board, .post-form, .post-detail,
    .calculator-page, .my-cats-page, .auth-form,
    .cat-profile, .cat-diary-timeline {
        padding: 1.25rem;
        border-radius: 12px;
    }

    /* Hero 카드 — 2열 → 자연스럽게 */
    .hero-card { padding: 1.25rem 1.25rem; }
    .hero-card h3 { font-size: 1.05rem; }
    .hero-card p { font-size: .85rem; }
    .hero-icon { font-size: 1.875rem; margin-bottom: .5rem; }

    /* 프로필 카드 wrap */
    .profile-card {
        flex-wrap: wrap;
        padding: 1.5rem;
        gap: 1rem;
    }
    .profile-card .cat-bubble { width: 70px; height: 70px; font-size: 2.25rem; }
    .profile-nickname { font-size: 1.2rem; }

    /* 게시판 표 — id, views 칼럼 숨김 (협소) */
    .post-list .col-id,
    .post-list .col-views {
        display: none;
    }
    .post-list th, .post-list td { padding: .625rem .375rem; }
    .post-list .col-author { width: 80px; font-size: .8rem; }
    .post-list .col-date {
        width: auto;
        font-size: .75rem;
        white-space: normal;
    }

    /* 고양이 프로필 사진 축소 */
    .cat-profile-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    .cat-profile-photo {
        width: 100%;
        max-width: 280px;
        height: auto;
        aspect-ratio: 1 / 1;
    }
    .cat-profile-body h2 { font-size: 1.4rem; }

    /* 폼 입력 터치 친화 */
    .field input, .field textarea, .field select {
        padding: .75rem .8rem;
        font-size: 1rem; /* iOS Safari가 16px 미만이면 자동 줌 — 16px 유지 */
    }

    /* 보드 헤더 */
    .board-header {
        flex-wrap: wrap;
        gap: .75rem;
    }

    /* 동영상 임베드 */
    .video-embed { margin: .75rem 0; }

    /* 댓글 */
    .comment-form textarea { min-height: 80px; }

    /* 푸터 */
    .site-footer { margin-top: 2rem; padding: 1.5rem 0; }
    .footer-disclaimer { font-size: .8rem; padding: 0 .5rem; }

    /* 다이어리 row */
    .diary-row-thumb { width: 84px; height: 64px; }

    /* 마이페이지 위험 영역 */
    .danger-zone { flex-direction: column; align-items: stretch; gap: .75rem; }
    .danger-zone .btn-danger { width: 100%; }
}

/* 폰 (480px 이하) */
@media (max-width: 480px) {
    .container { padding: 0 .75rem 2.5rem; }

    /* 환영 배너 더 작게 */
    .welcome-banner { padding: 1.5rem .75rem 1rem; }
    .welcome-banner h2 { font-size: 1.25rem; }
    .welcome-banner p { font-size: .85rem; }
    .cat-bubble { width: 80px; height: 80px; font-size: 2.5rem; }
    .paw, .heart { font-size: 1rem !important; }
    .heart { font-size: 1.15rem !important; }

    /* 헤더 brand-row 세로 정렬 */
    .site-header .brand-row {
        align-items: center;
    }
    .site-header h1 { font-size: 1.2rem; }
    .site-header .tagline { display: none; }
    .auth-link-btn { padding: .3rem .65rem; font-size: .75rem; }
    .nav-tab {
        padding: .35rem .7rem;
        font-size: .85rem;
        border-radius: 6px;
    }
    .board-nav {
        gap: .375rem;
        margin-top: .5rem;
    }
    .dropdown-menu { min-width: 180px; }

    /* Hero 카드 padding */
    .hero-card { padding: 1rem; }
    .hero-card h3 { font-size: 1rem; }
    .hero-card p { font-size: .8rem; line-height: 1.45; }
    .hero-icon { font-size: 1.625rem; margin-bottom: .375rem; }

    /* 메인 카드 영역들 더 컴팩트 */
    .board, .post-form, .post-detail,
    .calculator-page, .my-cats-page, .auth-form,
    .cat-profile, .cat-diary-timeline {
        padding: 1rem;
    }

    /* 인증 폼 */
    .auth-form h2 { font-size: 1.2rem; }
    .auth-welcome { font-size: .85rem; }

    /* 프로필 카드 */
    .profile-card { padding: 1.25rem; }
    .profile-nickname { font-size: 1.1rem; }

    /* 게시판 표 — author도 숨겨서 최소화 */
    .post-list .col-author { display: none; }
    .post-list th:nth-child(1) /* 번호 헤더 — 이미 숨김 */ { display: none; }
    .post-list .col-date { width: 90px; }

    /* 댓글 */
    .comment-header { flex-wrap: wrap; }
    .comment-delete-form { margin-left: auto; }

    /* 다이어리 메타 줄바꿈 */
    .diary-row-meta { font-size: .75rem; gap: .3rem; }
    .diary-row-thumb { width: 72px; height: 54px; }

    /* 계산기 결과 카드 */
    .result-value { font-size: 1.25rem; }
    .calc-steps ol { font-size: .8rem; padding-left: 1.25rem; }

    /* 푸터 */
    .footer-brand strong { font-size: .95rem; }
    .footer-brand span { font-size: .8rem; }
}

/* Toast UI Editor 모바일 최적화 */
@media (max-width: 768px) {
    .toastui-editor-toolbar {
        overflow-x: auto;
    }
    #editor { font-size: 16px; } /* iOS 자동 줌 방지 */

    /* 이미지·링크 등 팝업이 모바일에서 화면 밖으로 잘리는 문제 해결 */
    .toastui-editor-popup {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 92vw !important;
        max-width: 92vw !important;
        max-height: 85vh;
        overflow-y: auto;
        margin: 0 !important;
        z-index: 1000 !important;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    }
    .toastui-editor-popup-body {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    .toastui-editor-popup-add-image,
    .toastui-editor-popup-add-link,
    .toastui-editor-popup-add-table,
    .toastui-editor-popup-add-heading,
    .toastui-editor-popup-code-block-languages {
        width: 100% !important;
        max-width: 100% !important;
    }
    .toastui-editor-tabs {
        flex-wrap: wrap;
    }
    .toastui-editor-popup input[type="text"],
    .toastui-editor-popup input[type="url"] {
        width: 100% !important;
        font-size: 16px;
    }
    .toastui-editor-file-select-button,
    .toastui-editor-button-container button {
        font-size: .9rem;
        padding: .5rem .75rem;
    }
}

/* 모바일 팝업 배경 어둡게 (포커스 유도) */
@media (max-width: 768px) {
    body:has(.toastui-editor-popup[style*="display: block"])::before,
    body:has(.toastui-editor-popup:not([style*="display: none"]))::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        pointer-events: none;
    }
}

/* 글 보기: 이전/다음 글 navigation */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1.5rem 0 0.75rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}
.post-nav-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    min-width: 0;
}
a.post-nav-item:hover {
    background: var(--bg);
}
.post-nav-prev { text-align: left; }
.post-nav-next { text-align: right; }
.post-nav-label {
    font-size: 0.75rem;
    color: var(--muted);
}
.post-nav-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-nav .disabled {
    color: var(--muted);
    cursor: default;
}
@media (max-width: 480px) {
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-next { text-align: left; }
}

/* 운영자 회원 관리 */
.admin-user-list td { vertical-align: middle; }
.admin-user-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}
.flash-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    margin: 0.5rem 0 1rem;
    font-size: 0.95rem;
}

/* 글 보기: 공유 버튼 영역 */
.share-area {
    display: flex;
    justify-content: flex-end;
    margin: 1rem 0 0.5rem;
}
