/* ============================================================
   LINC Portal — Lineage Dark Fantasy Style Guide
   Palette: #121214 charcoal · #0D1117 slate · #C5A059 gold
   Texture: steel frames · antique gold · subtle magical glow
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Base — deep steel charcoal & gothic slate */
    --bg-obsidian: #121214;
    --bg-slate: #0d1117;
    --bg-slate-mid: #141824;
    --bg-leather: #1a1512;
    --bg-panel: #1a1d24;
    --bg-panel-light: #22262f;

    /* Accent — antique gold & royal steel */
    --gold: #c5a059;
    --gold-bright: #d4af37;
    --gold-dim: #8b7340;
    --steel: #a3b8cc;
    --steel-dim: #8a9a9a;
    --crimson: #9e2a2b;
    --crimson-deep: #8b0000;
    --arcane-blue: #4a6fa5;

    /* Text */
    --text-primary: #e8e4dc;
    --text-secondary: #a8a4a0;
    --text-muted: #6b6864;
    --text-gold: #d4af37;

    /* Borders & effects */
    --border-gold: rgba(197, 160, 89, 0.4);
    --border-steel: rgba(163, 184, 204, 0.15);
    --glow-gold: rgba(212, 175, 55, 0.25);
    --glow-arcane: rgba(74, 111, 165, 0.2);
    --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(197, 160, 89, 0.12);

    /* Semantic */
    --danger: #9e2a2b;
    --success: #3d7a5a;

    /* Legacy aliases */
    --bg-dark: var(--bg-obsidian);
    --bg-card: var(--bg-panel);
    --bg-light: var(--bg-panel);
    --gold-light: var(--gold-bright);
    --gold-dark: var(--gold-dim);
    --text: var(--text-primary);
    --border: var(--border-gold);
    --shadow: var(--shadow-deep);

    /* Scrollbar */
    --scrollbar-size: 8px;
    --scrollbar-track: rgba(13, 17, 23, 0.88);
    --scrollbar-thumb: rgba(139, 115, 64, 0.52);
    --scrollbar-thumb-hover: rgba(197, 160, 89, 0.78);
    --scrollbar-thumb-active: rgba(212, 175, 55, 0.92);
    --scrollbar-border: rgba(163, 184, 204, 0.14);
}

/* ── Base ── */
body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body.page-standalone,
body.linc-portal {
    background: var(--bg-obsidian);
    min-height: 100vh;
}

body.page-standalone {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(74, 111, 165, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(158, 42, 43, 0.06) 0%, transparent 50%),
        linear-gradient(165deg, var(--bg-slate) 0%, var(--bg-obsidian) 40%, var(--bg-leather) 100%);
}

body.page-embed {
    width: 100%;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(74, 111, 165, 0.05) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-slate-mid) 0%, var(--bg-obsidian) 100%);
    min-height: 100vh;
}

/* subtle noise overlay */
body.page-standalone::before,
body.page-embed::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    z-index: 0;
}

/* ── Custom scrollbar (dark fantasy gold) ── */
html:has(body.page-embed),
html:has(body.page-standalone),
body.page-embed,
body.page-standalone,
.table-responsive,
.chat-messages,
.siege-member-grid,
.siege-participant-log-list {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html:has(body.page-embed)::-webkit-scrollbar,
html:has(body.page-standalone)::-webkit-scrollbar,
body.page-embed::-webkit-scrollbar,
body.page-standalone::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.siege-member-grid::-webkit-scrollbar,
.siege-participant-log-list::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

html:has(body.page-embed)::-webkit-scrollbar-track,
html:has(body.page-standalone)::-webkit-scrollbar-track,
body.page-embed::-webkit-scrollbar-track,
body.page-standalone::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.siege-member-grid::-webkit-scrollbar-track,
.siege-participant-log-list::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

html:has(body.page-embed)::-webkit-scrollbar-thumb,
html:has(body.page-standalone)::-webkit-scrollbar-thumb,
body.page-embed::-webkit-scrollbar-thumb,
body.page-standalone::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.siege-member-grid::-webkit-scrollbar-thumb,
.siege-participant-log-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--scrollbar-thumb-hover) 0%, var(--scrollbar-thumb) 100%);
    border: 1px solid var(--scrollbar-border);
    border-radius: 4px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.25);
}

html:has(body.page-embed)::-webkit-scrollbar-thumb:hover,
html:has(body.page-standalone)::-webkit-scrollbar-thumb:hover,
body.page-embed::-webkit-scrollbar-thumb:hover,
body.page-standalone::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.siege-member-grid::-webkit-scrollbar-thumb:hover,
.siege-participant-log-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--scrollbar-thumb-active) 0%, var(--scrollbar-thumb-hover) 100%);
    border-color: rgba(197, 160, 89, 0.35);
}

html:has(body.page-embed)::-webkit-scrollbar-corner,
html:has(body.page-standalone)::-webkit-scrollbar-corner,
.table-responsive::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

/* ── Auth pages ── */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: linear-gradient(160deg, var(--bg-panel-light) 0%, var(--bg-panel) 50%, var(--bg-leather) 100%);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    box-shadow:
        var(--shadow-deep),
        inset 0 1px 0 rgba(163, 184, 204, 0.1),
        0 0 40px var(--glow-gold);
    width: 100%;
    max-width: 440px;
    padding: 40px 36px;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo h1 {
    font-family: 'Cinzel', 'Noto Sans KR', serif;
    color: var(--text-gold);
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 0 24px var(--glow-gold), 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.06em;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--steel);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-steel);
    border-radius: 3px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(13, 17, 23, 0.8);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--glow-gold), 0 0 12px var(--glow-gold);
}

.form-group select option {
    background: var(--bg-panel);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    accent-color: var(--gold);
    flex-shrink: 0;
}

.form-group input[type="checkbox"]:focus,
.form-group input[type="radio"]:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    box-shadow: none;
}

.form-check {
    margin-bottom: 18px;
    text-align: left;
}

.form-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--steel);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-align: left;
}

.form-check-label span {
    line-height: 1.4;
}

/* ── Buttons ── */
.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s;
    font-family: inherit;
    letter-spacing: 0.03em;
}

.btn-primary {
    background: linear-gradient(180deg, #d4af37 0%, #a08030 50%, #8b6914 100%);
    border-color: var(--gold-bright);
    color: #1a1512;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--glow-gold), 0 0 20px var(--glow-gold);
    border-color: var(--gold-bright);
}

.btn-secondary {
    background: linear-gradient(180deg, var(--bg-panel-light) 0%, var(--bg-panel) 100%);
    border-color: var(--border-steel);
    color: var(--steel);
}

.btn-secondary:hover {
    border-color: var(--steel);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(163, 184, 204, 0.1);
}

.btn-danger {
    background: linear-gradient(180deg, #b03030 0%, var(--crimson-deep) 100%);
    border-color: var(--crimson);
    color: #fff;
}

.btn-danger:hover {
    box-shadow: 0 0 16px rgba(158, 42, 43, 0.4);
}

.btn-sm {
    padding: 7px 12px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: 3px;
    margin-bottom: 18px;
    font-size: 0.88rem;
    border: 1px solid;
}

.alert-error {
    background: rgba(139, 0, 0, 0.15);
    border-color: rgba(158, 42, 43, 0.5);
    color: #e8a0a0;
}

.alert-success {
    background: rgba(61, 122, 90, 0.15);
    border-color: rgba(61, 122, 90, 0.5);
    color: #a0d4b0;
}

.alert a {
    color: inherit;
    font-weight: 600;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.auth-footer a {
    color: var(--text-gold);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-shadow: 0 0 8px var(--glow-gold);
}

/* ── Login hero background ── */
body.page-login {
    background: #0a0908;
}

body.page-login::before {
    opacity: 0;
}

body.page-login::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        url('../img/bg.png') center center / cover no-repeat;
    transform: scale(1.02);
}

.page-login .auth-wrap--login {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    align-items: center;
    gap: clamp(24px, 5vw, 64px);
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(24px, 5vw, 56px);
}

.page-login .auth-wrap--login::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(105deg, rgba(8, 7, 6, 0.15) 0%, rgba(8, 7, 6, 0.45) 42%, rgba(8, 7, 6, 0.88) 68%, rgba(8, 7, 6, 0.95) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 100%);
}

.page-login .auth-hero {
    position: relative;
    z-index: 2;
    padding: 12px 0;
}

.page-login .auth-hero-eyebrow {
    color: var(--gold-bright);
    font-size: 0.82rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    margin-bottom: 14px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.45);
}

.page-login .auth-hero-title {
    font-family: 'Cinzel', 'Noto Sans KR', serif;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    line-height: 1.15;
    color: #f4e8c8;
    text-shadow:
        0 0 40px rgba(212, 175, 55, 0.35),
        0 4px 24px rgba(0, 0, 0, 0.85);
    margin-bottom: 16px;
}

.page-login .auth-hero-desc {
    color: rgba(232, 228, 220, 0.78);
    font-size: 1rem;
    max-width: 420px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.page-login .auth-card {
    position: relative;
    z-index: 2;
    max-width: none;
    padding: 36px 32px 32px;
    border: 1px solid rgba(197, 160, 89, 0.42);
    border-radius: 6px;
    background:
        linear-gradient(160deg, rgba(34, 30, 26, 0.82) 0%, rgba(18, 18, 20, 0.88) 55%, rgba(12, 10, 9, 0.92) 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 48px rgba(197, 160, 89, 0.12);
}

.page-login .auth-card::before {
    left: 12%;
    right: 12%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.9), transparent);
}

.page-login .auth-card::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(197, 160, 89, 0.12);
    border-radius: 4px;
    pointer-events: none;
}

.page-login .auth-logo h1 {
    font-size: 1.65rem;
}

.page-login .form-group input {
    background: rgba(8, 8, 10, 0.72);
    border-color: rgba(197, 160, 89, 0.22);
}

.page-login .form-group input:focus {
    border-color: var(--gold-bright);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.18), 0 0 18px rgba(212, 175, 55, 0.15);
}

.page-login .btn-primary {
    background: linear-gradient(180deg, #e0b84a 0%, #b8891f 48%, #8b6914 100%);
}

@media (max-width: 900px) {
    .page-login .auth-wrap--login {
        grid-template-columns: 1fr;
        justify-items: center;
        padding-top: max(24px, env(safe-area-inset-top));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    .page-login .auth-wrap--login::before {
        background:
            linear-gradient(180deg, rgba(8, 7, 6, 0.35) 0%, rgba(8, 7, 6, 0.82) 55%, rgba(8, 7, 6, 0.94) 100%);
    }

    .page-login .auth-hero {
        text-align: center;
        max-width: 420px;
    }

    .page-login .auth-hero-desc {
        margin: 0 auto;
    }

    .page-login .auth-card {
        width: 100%;
    }
}

/* ── Portal shell ── */
.portal-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-obsidian);
}

/* 모바일 상단 헤더 (미사용) */
.mobile-header,
.sidebar-overlay {
    display: none !important;
}

.portal-sidebar {
    width: 248px;
    background:
        linear-gradient(180deg, var(--bg-slate-mid) 0%, var(--bg-obsidian) 60%, var(--bg-leather) 100%);
    border-right: 1px solid var(--border-gold);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5), inset -1px 0 0 rgba(163, 184, 204, 0.05);
    display: flex;
    flex-direction: column;
    padding: 14px 10px 14px 12px;
    color: var(--text-secondary);
    min-height: 0;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.portal-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--gold-bright), transparent);
    opacity: 0.3;
}

.portal-logo {
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-steel);
    margin-bottom: 10px;
    position: relative;
    flex-shrink: 0;
}

.portal-logo-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.portal-logo-link:hover {
    opacity: 0.85;
}

.portal-logo-link:hover h1 {
    text-shadow: 0 0 20px var(--glow-gold);
}

.portal-logo::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.portal-logo h1 {
    font-family: 'Cinzel', 'Noto Sans KR', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-gold);
    text-shadow: 0 0 16px var(--glow-gold);
    letter-spacing: 0.08em;
}

.portal-logo p {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.user-box {
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid var(--border-steel);
    border-radius: 3px;
    padding: 8px 10px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 0.76rem;
    box-shadow: inset 0 1px 0 rgba(163, 184, 204, 0.06);
    flex-shrink: 0;
}

.user-box strong {
    display: block;
    color: var(--text-gold);
    font-weight: 600;
    margin-bottom: 2px;
}

/* ── Sidebar nav (스크롤바 숨김 + 컴팩트) ── */
.portal-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-right: 0;
    margin-right: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.portal-nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.nav-section-title {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gold-dim);
    margin: 8px 8px 3px;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 3px;
    border: 1px solid transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    line-height: 1.3;
}

.nav-link:hover {
    background: rgba(197, 160, 89, 0.08);
    border-color: rgba(197, 160, 89, 0.2);
    color: var(--text-gold);
    box-shadow: 0 0 12px var(--glow-gold);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(197, 160, 89, 0.15) 0%, rgba(197, 160, 89, 0.05) 100%);
    border-color: var(--border-gold);
    color: var(--text-gold);
    box-shadow: inset 3px 0 0 var(--gold), 0 0 16px var(--glow-gold);
}

.nav-link .icon {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

.portal-footer {
    padding-top: 10px;
    border-top: 1px solid var(--border-steel);
    flex-shrink: 0;
}

.portal-footer .btn {
    padding: 9px 14px;
    font-size: 0.82rem;
}

.portal-main {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.portal-content {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    padding: 14px 7px 14px 14px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(74, 111, 165, 0.06) 0%, transparent 50%),
        var(--bg-obsidian);
}

.portal-frame {
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    background: var(--bg-slate-mid);
    box-shadow:
        var(--shadow-deep),
        inset 0 0 60px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(197, 160, 89, 0.05);
}

/* ── Guild chat (페이지 이동해도 유지) ── */
.portal-chat {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: auto;
    margin: 14px 14px 14px 7px;
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    background: linear-gradient(180deg, var(--bg-slate-mid) 0%, var(--bg-obsidian) 100%);
    box-shadow: var(--shadow-deep);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    --chat-msg-size: 13px;
    --chat-meta-size: 11px;
    --chat-input-size: 14px;
}

.portal-chat.collapsed {
    flex: 0 0 168px;
    max-width: 220px;
    height: auto;
}

.portal-chat.collapsed .chat-body {
    display: none;
}

.chat-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-steel);
    background: rgba(13, 17, 23, 0.7);
    flex-shrink: 0;
}

.chat-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.chat-online {
    text-align: right;
    min-width: 0;
    flex: 1;
}

.chat-online-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.chat-online-label strong {
    color: var(--text-gold);
}

.chat-online-names {
    display: block;
    font-size: 0.72rem;
    color: var(--text-gold);
    line-height: 1.4;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.chat-online-name {
    display: inline;
}

.chat-online-name.mine {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-online-name + .chat-online-name::before {
    content: ', ';
    color: var(--text-muted);
    font-weight: 400;
    text-decoration: none;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
}

.chat-layout-mobile-only {
    display: none;
}

.chat-height-select {
    border: 1px solid var(--border-steel);
    background: rgba(13, 17, 23, 0.8);
    color: var(--text-secondary);
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 3px;
    min-width: 72px;
}

.chat-height-select:focus {
    outline: none;
    border-color: var(--border-gold);
}

.chat-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-gold);
    letter-spacing: 0.04em;
}

.chat-toggle {
    border: 1px solid var(--border-steel);
    background: rgba(13, 17, 23, 0.6);
    color: var(--text-secondary);
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-toggle:hover {
    border-color: var(--border-gold);
    color: var(--text-gold);
}

.chat-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    font-size: var(--chat-msg-size);
    line-height: 1.45;
    padding: 6px 8px;
    border-radius: 3px;
    background: rgba(13, 17, 23, 0.45);
    border: 1px solid var(--border-steel);
    max-width: 92%;
    align-self: flex-start;
}

.chat-msg.mine {
    align-self: flex-end;
    background: rgba(197, 160, 89, 0.1);
    border-color: rgba(197, 160, 89, 0.35);
}

.chat-msg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
    font-size: var(--chat-meta-size);
    color: var(--text-muted);
}

.chat-msg-meta strong {
    color: var(--text-gold);
    font-weight: 600;
}

.chat-msg-body {
    color: var(--text-primary);
    word-break: break-word;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid var(--border-steel);
    background: rgba(13, 17, 23, 0.5);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border-steel);
    border-radius: 3px;
    background: rgba(13, 17, 23, 0.8);
    color: var(--text-primary);
    font-size: var(--chat-input-size);
}

.chat-input:focus {
    outline: none;
    border-color: var(--border-gold);
    box-shadow: 0 0 0 2px var(--glow-gold);
}

.chat-send {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: var(--chat-msg-size);
}

/* ── Content pages ── */
.content-wrap {
    margin: 0 auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* 게시판(삽니다/팝니다 등) — iframe 가로 영역 전체 사용 */
.content-wrap.board-page {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 20px 24px;
    box-sizing: border-box;
}

.board-page .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.board-page .data-table {
    table-layout: auto;
    min-width: 100%;
}

.board-page .data-table th.col-title,
.board-page .data-table td.col-title {
    white-space: normal;
    word-break: break-word;
    min-width: 140px;
}

.board-page .data-table th:not(.col-title):not(.col-wrap),
.board-page .data-table td:not(.col-title):not(.col-wrap) {
    white-space: nowrap;
}

.board-page .data-table th.col-wrap,
.board-page .data-table td.col-wrap {
    white-space: normal;
    word-break: break-word;
    min-width: 100px;
    max-width: 280px;
}
.board-page .post-view .post-content {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.screenshot-gallery-wrap {
    margin-bottom: 20px;
}

.screenshot-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.screenshot-gallery-item {
    display: block;
    max-width: 100%;
    border: 1px solid var(--border-steel);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
    transition: border-color .15s;
}

.screenshot-gallery-item:hover {
    border-color: var(--text-gold);
}

.screenshot-gallery-item img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
}

.screenshot-preview-grid,
.screenshot-existing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.screenshot-preview-item,
.screenshot-existing-item {
    position: relative;
    border: 1px solid var(--border-steel);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.screenshot-preview-item img,
.screenshot-existing-item img {
    display: block;
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.screenshot-preview-item span {
    display: block;
    padding: 4px 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.screenshot-existing-item {
    cursor: pointer;
}

.screenshot-existing-item input {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
}

.screenshot-existing-label {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.68rem;
}

.screenshot-existing-item:has(input:checked) {
    border-color: #c0392b;
    box-shadow: 0 0 0 1px #c0392b;
}

.screenshot-board-list {
    display: flex;
    flex-direction: column;
}

.screenshot-board-item {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-steel);
    color: inherit;
    text-decoration: none;
    transition: background .15s;
}

.screenshot-board-item:last-child {
    border-bottom: none;
}

.screenshot-board-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.screenshot-board-thumb {
    position: relative;
    flex: 0 0 96px;
    width: 96px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-steel);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.screenshot-board-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screenshot-board-no-image {
    font-size: 1.6rem;
    opacity: 0.45;
}

.screenshot-board-count {
    position: absolute;
    right: 4px;
    bottom: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
}

.screenshot-board-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.screenshot-board-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.screenshot-board-title-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.screenshot-board-item:hover .screenshot-board-title-text {
    color: var(--text-gold);
}

.screenshot-board-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}


.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-steel);
}

.page-header h2 {
    font-family: 'Cinzel', 'Noto Sans KR', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-gold);
    text-shadow: 0 0 12px var(--glow-gold);
    letter-spacing: 0.04em;
}

.page-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 4px;
}

/* ── Cards (steel frame panels) ── */
.card {
    background: linear-gradient(160deg, var(--bg-panel-light) 0%, var(--bg-panel) 100%);
    border: 1px solid var(--border-steel);
    border-radius: 4px;
    overflow: hidden;
    box-shadow:
        var(--shadow-deep),
        inset 0 1px 0 rgba(163, 184, 204, 0.06);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(197, 160, 89, 0.3) 50%, transparent 90%);
}

.card-body {
    padding: 20px;
}

.card-body h3,
.card-body h4 {
    color: var(--text-gold);
}

/* ── Tables ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-steel);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.data-table th {
    background: rgba(13, 17, 23, 0.6);
    color: var(--steel);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.data-table tr:hover td {
    background: rgba(197, 160, 89, 0.04);
    color: var(--text-primary);
}

.data-table a {
    color: var(--text-gold);
    text-decoration: none;
    font-weight: 500;
}

.data-table a:hover {
    text-shadow: 0 0 8px var(--glow-gold);
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid;
}

.badge-pinned {
    background: rgba(197, 160, 89, 0.15);
    border-color: var(--border-gold);
    color: var(--text-gold);
}

.badge-attend {
    background: rgba(61, 122, 90, 0.15);
    border-color: rgba(61, 122, 90, 0.4);
    color: #7ec99a;
}

.badge-absent {
    background: rgba(139, 0, 0, 0.15);
    border-color: rgba(158, 42, 43, 0.4);
    color: #e8a0a0;
}

.badge-pending {
    background: rgba(197, 160, 89, 0.1);
    border-color: var(--border-gold);
    color: var(--gold);
}

.badge-done {
    background: rgba(74, 111, 165, 0.15);
    border-color: rgba(74, 111, 165, 0.4);
    color: var(--steel);
}

/* ── Account status toggle (회원 관리) ── */
.status-toggle-form {
    display: inline-flex;
    margin: 0;
}

.status-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    vertical-align: middle;
}

.status-toggle.is-readonly {
    cursor: default;
    pointer-events: none;
    opacity: 0.92;
}

.status-toggle-track {
    position: relative;
    width: 78px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(180deg, #5a6068 0%, #343a42 55%, #2a2f36 100%);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.45),
        0 1px 0 rgba(255, 255, 255, 0.06);
    transition: background 0.28s ease, box-shadow 0.28s ease;
}

.status-toggle.is-on .status-toggle-track {
    background: linear-gradient(180deg, #72ef7d 0%, #3ecf4f 45%, #28b33c 100%);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.35),
        0 0 14px rgba(62, 207, 79, 0.35);
}

.status-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #2a2a2a 0%, #050505 70%);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.55),
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-toggle.is-on .status-toggle-knob {
    transform: translateX(44px);
}

.status-toggle-knob::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 2px solid #6d737c;
    transition: border-color 0.28s ease, box-shadow 0.28s ease;
}

.status-toggle.is-on .status-toggle-knob::before {
    border-color: #4de866;
    box-shadow: 0 0 8px rgba(77, 232, 102, 0.55);
}

.status-toggle-label {
    position: relative;
    z-index: 1;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #9aa3ad;
    font-family: 'Noto Sans KR', sans-serif;
}

.status-toggle.is-on .status-toggle-label {
    color: #4de866;
    text-shadow: 0 0 8px rgba(77, 232, 102, 0.45);
}

.status-toggle:not(.is-readonly):hover .status-toggle-track {
    filter: brightness(1.06);
}

.status-toggle:not(.is-readonly):active .status-toggle-knob {
    width: 30px;
}

.status-toggle:not(.is-readonly):active.is-on .status-toggle-knob {
    transform: translateX(42px);
}

.status-toggle:focus-visible .status-toggle-track {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

/* ── Pagination ── */
.pagination-wrap {
    margin-top: 20px;
}

.pagination-meta {
    margin: 0 0 10px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.88rem;
    border: 1px solid var(--border-steel);
}

.pagination .pagination-edge {
    font-size: 0.8rem;
    padding: 8px 12px;
}

.pagination .pagination-ellipsis {
    padding: 8px 6px;
    border: none;
    color: var(--text-muted);
}

.pagination a {
    background: var(--bg-panel);
    color: var(--text-secondary);
}

.pagination a:hover {
    background: rgba(197, 160, 89, 0.15);
    border-color: var(--border-gold);
    color: var(--text-gold);
    box-shadow: 0 0 10px var(--glow-gold);
}

.pagination .current {
    background: linear-gradient(180deg, #d4af37, #8b6914);
    border-color: var(--gold-bright);
    color: #1a1512;
    font-weight: 600;
}

/* ── Post view ── */
.post-view .post-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-steel);
}

.post-view .post-content {
    min-height: 200px;
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-primary);
}

.auction-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: rgba(13, 17, 23, 0.5);
    border: 1px solid var(--border-steel);
    border-radius: 4px;
}

.auction-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.auction-summary-item .label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auction-summary-item strong {
    color: var(--text-gold);
    font-size: 1rem;
}

.sell-bid-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(197, 160, 89, 0.08);
    border: 1px solid rgba(197, 160, 89, 0.25);
    border-radius: 4px;
}

.sell-bid-banner-price {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.sell-bid-banner-price strong {
    margin-left: 6px;
    color: var(--text-gold);
    font-size: 0.95rem;
}

.sell-bid-count {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sell-best-bid {
    color: var(--text-gold);
    font-weight: 600;
}

.siege-tax-section {
    margin-bottom: 18px;
    padding-top: 8px;
    border-top: 1px solid var(--border-steel);
}

.siege-member-pick {
    border: 1px solid var(--border-steel);
    border-radius: 4px;
    padding: 12px;
    background: rgba(13, 17, 23, 0.45);
}

.siege-member-pick-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.siege-member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 6px 10px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px 2px;
}

.siege-member-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 0.82rem;
    cursor: pointer;
}

.siege-member-item input[type="checkbox"] {
    width: auto;
    min-width: 0;
    flex-shrink: 0;
}

.siege-member-sub {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.siege-tax-member-list {
    margin-bottom: 14px;
}

.siege-tax-member-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.siege-tax-member-tag {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid var(--border-steel);
    border-radius: 3px;
    background: rgba(13, 17, 23, 0.5);
    font-size: 0.8rem;
}

.siege-participant-panel {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--border-steel);
    border-radius: 4px;
    background: rgba(13, 17, 23, 0.35);
}

.siege-participant-panel.is-compact {
    padding: 10px;
    margin-bottom: 0;
}

.siege-participant-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 10px;
}

.siege-participant-panel-title {
    font-size: 0.85rem;
    color: var(--steel);
}

.siege-member-item.is-readonly {
    opacity: 0.85;
}

.siege-participant-log-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-steel);
}

.siege-participant-log-title {
    display: block;
    font-size: 0.82rem;
    color: var(--steel);
    margin-bottom: 8px;
}

.siege-participant-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.siege-participant-log-list li {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.siege-board-participant-row td {
    background: rgba(13, 17, 23, 0.55);
    vertical-align: top;
}

.siege-board-participant-cell {
    padding: 12px 14px !important;
}

.js-siege-board-expand.is-open {
    border-color: var(--border-gold);
    color: var(--text-gold);
}

.btn-web-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--border-steel);
    border-radius: 4px;
    background: rgba(13, 17, 23, 0.5);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.78rem;
    vertical-align: middle;
    line-height: 1.2;
}

.btn-web-share:hover {
    border-color: var(--border-gold);
    color: var(--text-gold);
}

.btn-web-share-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.btn-web-share-toolbar {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.col-web-share {
    width: 64px;
    text-align: center;
}

.toolbar .btn-web-share {
    margin-right: 4px;
}

.siege-paid-summary {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.siege-paid-summary strong {
    color: var(--text-gold);
}

.siege-participant-table-wrap {
    margin-top: 4px;
}

.siege-participant-table-head,
.siege-participant-row {
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    gap: 8px;
    align-items: center;
}

.siege-participant-table-head {
    font-size: 0.72rem;
    color: var(--steel);
    padding: 0 4px 6px;
    border-bottom: 1px solid var(--border-steel);
    margin-bottom: 4px;
}

.siege-participant-row {
    padding: 6px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.siege-participant-row:last-child {
    border-bottom: none;
}

.siege-participant-cell {
    min-width: 0;
}

.siege-participant-name {
    font-size: 0.85rem;
}

.siege-participant-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
}

.siege-participant-check input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.siege-participant-check.is-readonly {
    cursor: default;
    opacity: 0.85;
}

.siege-participant-paid.is-disabled {
    opacity: 0.45;
}

.siege-participant-check-label {
    white-space: nowrap;
}

.siege-tax-preview {
    margin-top: 12px;
    border: 1px solid var(--border-gold);
    background: rgba(13, 17, 23, 0.35);
}

.siege-tax-preview .card-body {
    padding: 12px 14px;
}

.siege-tax-net-negative {
    color: #e05252 !important;
}

.auction-bid-form {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-steel);
    margin-bottom: 8px;
}

.auction-best-bid {
    background: rgba(197, 160, 89, 0.08);
}

.comment-form {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-steel);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    padding: 10px 12px;
    background: rgba(13, 17, 23, 0.45);
    border: 1px solid var(--border-steel);
    border-radius: 4px;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.comment-meta strong {
    color: var(--text-gold);
}

.comment-body {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* ── Dashboard cards ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.dashboard-card {
    background: linear-gradient(160deg, var(--bg-panel-light) 0%, var(--bg-panel) 100%);
    border: 1px solid var(--border-steel);
    border-radius: 4px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--glow-gold), transparent 70%);
    opacity: 0;
    transition: opacity 0.25s;
}

.dashboard-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 20px var(--glow-gold);
}

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-card .icon {
    font-size: 2rem;
    margin-bottom: 10px;
    position: relative;
}

.dashboard-card h3 {
    font-family: 'Cinzel', 'Noto Sans KR', serif;
    color: var(--text-gold);
    margin-bottom: 6px;
    font-size: 1rem;
    position: relative;
}

.dashboard-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    position: relative;
}

.dashboard-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.dashboard-board-card .section-title {
    margin-bottom: 0;
}

.dashboard-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-steel);
}

.dashboard-board-head-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.dashboard-board-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
}

.dashboard-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-recent-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(163, 184, 204, 0.08);
}

.dashboard-recent-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-recent-title {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.86rem;
    line-height: 1.4;
    margin-bottom: 2px;
}

.dashboard-recent-title:hover {
    color: var(--text-gold);
}

.dashboard-recent-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dashboard-recent-shots .dashboard-board-head {
    margin-bottom: 14px;
}

.dashboard-shot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-shot-item {
    display: block;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border-steel);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    transition: border-color .15s, transform .15s;
}

.dashboard-shot-item:hover {
    border-color: var(--text-gold);
    transform: translateY(-1px);
}

.dashboard-shot-thumb {
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, 0.35);
}

.dashboard-shot-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-shot-title {
    padding: 8px 10px 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-shot-item:hover .dashboard-shot-title {
    color: var(--text-gold);
}

.dashboard-shot-meta {
    padding: 0 10px 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .dashboard-shot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .dashboard-shot-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Link items ── */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.link-item {
    display: block;
    padding: 18px;
    background: linear-gradient(160deg, var(--bg-panel-light) 0%, var(--bg-panel) 100%);
    border: 1px solid var(--border-steel);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
}

.link-item:hover {
    border-color: var(--border-gold);
    box-shadow: 0 0 20px var(--glow-gold);
}

.link-item h4 {
    font-family: 'Cinzel', 'Noto Sans KR', serif;
    color: var(--text-gold);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.link-item p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Vote bars ── */
.vote-bar {
    margin: 10px 0;
}

.vote-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.vote-bar-track {
    height: 22px;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--border-steel);
    border-radius: 3px;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim) 0%, var(--gold-bright) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1512;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 30px;
    box-shadow: 0 0 12px var(--glow-gold);
}

.vote-bar-fill.absent {
    background: linear-gradient(90deg, var(--crimson-deep) 0%, var(--crimson) 100%);
    color: #fff;
    box-shadow: 0 0 12px rgba(158, 42, 43, 0.3);
}

.vote-list-item {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-steel);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.vote-list-item strong {
    color: var(--text-gold);
}

.vote-list-item:hover,
.vote-list-item.active {
    background: rgba(197, 160, 89, 0.06);
}

.vote-list-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.list-divider {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-steel);
}

.list-divider strong,
.list-divider a {
    color: var(--text-gold);
    text-decoration: none;
}

.list-divider-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dashboard-vote-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.dashboard-vote-stats .badge {
    font-size: 0.72rem;
    padding: 3px 8px;
}

.boss-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.boss-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.boss-detail-actions {
    flex-shrink: 0;
}

.boss-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.boss-detail-table th {
    width: 72px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .boss-layout {
        grid-template-columns: 1fr !important;
    }
}

.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.section-title {
    color: var(--text-gold);
    margin-bottom: 14px;
    font-family: 'Cinzel', 'Noto Sans KR', serif;
    font-size: 1rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.profile-info-table th {
    width: 120px;
    color: var(--steel);
}

.user-box-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.user-box-link:hover {
    border-color: var(--border-gold);
    box-shadow: 0 0 12px var(--glow-gold);
}

.user-box-hint {
    display: none;
}

.mobile-only {
    display: none;
}

.dashboard-mobile-logout {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-steel);
}

.dashboard-mobile-user {
    margin: 0 0 12px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.dashboard-mobile-user-label {
    display: block;
    font-size: 0.62rem;
    color: var(--gold-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.dashboard-mobile-user strong {
    display: block;
    color: var(--text-gold);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

/* ── 권한 관리 페이지 (중앙 정렬) ── */
.perm-page {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 24px 40px;
}

.perm-page .page-header-center {
    justify-content: center;
    text-align: center;
    border-bottom: 1px solid var(--border-steel);
}

.perm-page .page-header-center .page-desc {
    max-width: 520px;
    margin: 4px auto 0;
}

.perm-page .alert {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.perm-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.perm-page .card {
    max-width: 100%;
}

.perm-page .card-body > .page-desc {
    text-align: center;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.perm-page .perm-table-wrap {
    display: flex;
    justify-content: center;
}

.perm-page .perm-matrix,
.perm-page .perm-table-wrap > .data-table {
    width: 100%;
    min-width: min(100%, 760px);
    table-layout: fixed;
}

.perm-col-page {
    width: 180px;
}

.perm-col-check {
    width: 52px;
}

.perm-page .perm-matrix th,
.perm-page .perm-matrix td {
    text-align: center;
    vertical-align: middle;
}

.perm-page .perm-matrix td:first-child {
    text-align: left;
    min-width: 140px;
}

.perm-page .member-select-form {
    max-width: 480px;
    margin: 0 auto;
}

.perm-page .card-body > form > .btn-primary,
.perm-page .card-body > .btn-row {
    display: flex;
    justify-content: center;
}

.perm-page .card-body > form[style] {
    text-align: center;
}

.perm-page .empty-state {
    padding: 32px 20px;
}

.perm-tab {
    padding: 10px 18px;
    border: 1px solid var(--border-steel);
    border-radius: 3px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.perm-tab:hover,
.perm-tab.active {
    border-color: var(--border-gold);
    color: var(--text-gold);
    background: rgba(197, 160, 89, 0.08);
}

.perm-table-wrap {
    overflow-x: auto;
}

.perm-matrix .perm-sub {
    font-size: 0.72rem;
    text-align: center;
}

.perm-check {
    text-align: center;
}

.perm-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
}

.perm-na {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.perm-group-row th.perm-group-label {
    background: rgba(13, 17, 23, 0.5);
    color: var(--gold-dim);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: left;
    padding: 8px 12px;
}

@media (max-width: 768px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .portal-shell {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .portal-sidebar {
        position: static;
        width: 100%;
        height: auto;
        transform: none;
        border-right: none;
        border-bottom: 1px solid var(--border-gold);
        padding: 10px 10px 8px;
        flex-shrink: 0;
    }

    .portal-logo {
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .portal-logo h1 {
        font-size: 1rem;
    }

    .portal-logo p {
        display: none;
    }

    .user-box {
        margin-bottom: 8px;
        padding: 6px 10px;
        font-size: 0.74rem;
    }

    .portal-nav {
        flex: none;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-content: flex-start;
        gap: 6px;
        overflow: visible;
        padding: 4px 0 8px;
    }

    .nav-section-title {
        display: none;
    }

    .nav-link {
        display: inline-flex;
        flex: 0 0 auto;
        flex-direction: column;
        gap: 2px;
        padding: 8px 10px;
        min-width: 0;
        width: calc(33.333% - 4px);
        max-width: calc(33.333% - 4px);
        font-size: 0.68rem;
        text-align: center;
        white-space: normal;
        word-break: keep-all;
        line-height: 1.2;
        border: 1px solid var(--border-steel);
        background: rgba(13, 17, 23, 0.5);
        box-sizing: border-box;
    }

    .nav-link span:last-child {
        display: block;
        width: 100%;
    }

    .nav-link .icon {
        font-size: 1.1rem;
        width: auto;
    }

    .nav-link.active {
        border-color: var(--border-gold);
        box-shadow: inset 0 -2px 0 var(--gold);
    }

    .portal-footer {
        display: none;
    }

    .portal-main {
        flex: none;
        flex-direction: column;
        overflow: visible;
    }

    .portal-content {
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0;
        flex: none;
    }

    .portal-frame {
        width: 100%;
        height: auto;
        min-height: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        display: block;
        flex: none;
    }

    .portal-chat {
        flex: none;
        max-width: none;
        margin: 0;
        height: var(--chat-height, 200px);
        border-left: none;
        border-right: none;
        border-radius: 0;
        position: sticky;
        bottom: 0;
        z-index: 10;
    }

    .portal-chat.collapsed {
        flex: none;
        height: auto;
    }

    .chat-layout-mobile-only {
        display: inline-block;
    }

    .mobile-only {
        display: block;
    }

    .chat-form {
        padding: 6px 8px;
    }

    .chat-input {
        font-size: max(16px, var(--chat-input-size));
    }

    .chat-online-names {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    body.page-embed {
        min-height: auto;
    }

    .content-wrap {
        padding: 16px;
        max-width: 100%;
    }

    .btn-row {
        flex-direction: column;
    }
}

/* Flatpickr — deadline picker */
.flatpickr-calendar {
    background: var(--bg-panel);
    border: 1px solid var(--border-gold);
    box-shadow: var(--shadow-deep);
    font-family: inherit;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-weekdays,
span.flatpickr-weekday {
    background: var(--bg-panel);
    color: var(--text-gold);
}

.flatpickr-day {
    color: var(--text-primary);
}

.flatpickr-day:hover,
.flatpickr-day:focus {
    background: rgba(197, 160, 89, 0.2);
    border-color: var(--gold);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: #121214;
}

.flatpickr-day.today {
    border-color: var(--gold-dim);
}

.flatpickr-time input {
    color: var(--text-primary);
}

.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: var(--text-secondary);
}

.js-deadline-picker {
    cursor: pointer;
}

/* ── Web Push ── */
.push-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.push-modal.visible {
    display: flex;
}

.push-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.push-modal-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--bg-slate-mid) 0%, var(--bg-obsidian) 100%);
    box-shadow: var(--shadow-deep);
}

.push-modal-card h3 {
    margin: 0 0 8px;
    color: var(--text-gold);
}

.push-modal-desc {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.push-modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.push-modal-hint {
    margin: 12px 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.push-notice-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-steel);
}

.push-notice-item:last-child {
    border-bottom: none;
}

.push-notice-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.push-notice-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.push-notice-body {
    margin: 0 0 8px;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.push-notice-url {
    margin: 0 0 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
}

