/* Final layout layer, loaded after page styles, including Bootstrap. */
body { font-family: Arial, 'Malgun Gothic', sans-serif; }
.password-change-dialog {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(420px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 24px;
    overflow-y: auto;
    border: 1px solid #d5e0eb;
    border-radius: 14px;
    background: #fff;
    text-align: left;
    color: #24384b;
    box-shadow: 0 20px 50px #173b5d33;
    z-index: 10001;
}
.password-change-dialog::backdrop { background: rgba(8, 16, 24, .65); }
.password-policy-help { margin: 0 0 16px; font-size: 12px; line-height: 1.7; color: #50657b; }
.password-change-logout { margin-top: 12px; text-align: center; }
.main-content.main-content--home {
    box-sizing: border-box;
    background: linear-gradient(to bottom, transparent 480px, #e8f1fa 650px), var(--home-background) center top / 1000px 650px no-repeat #e8f1fa;
    min-height: 650px;
    padding: 9px 28px;
}
.main-dashboard {
    display: flex;
    flex-direction: column;
    width: 340px;
    max-width: 100%;
    gap: 5px;
    margin: 0 0 0 auto;
}
.main-dashboard > div { display: block; margin: 0; padding: 0; width: 100%; }
.main-dashboard > div:nth-child(3) { grid-column: 1 / -1; }
.main-dashboard > .sidebar-container-2:nth-child(5) { grid-column: auto; }
.main-dashboard table.sidebar-table {
    display: table;
    table-layout: fixed;
    width: 100%;
    height: auto;
    min-height: 0;
    background: rgba(255,255,255,.96);
    border: 1px solid #dce5ed;
    border-radius: 4px;
    border-spacing: 0;
    box-shadow: none;
}
.main-dashboard table.sidebar-table .sidebar-header { box-sizing: border-box; height: 24px; padding: 0; font-size: 13px; border-bottom: 1px solid #d5e0eb; }
.main-dashboard .sidebar-header a { display: flex; align-items: center; justify-content: space-between; padding: 3px 9px; line-height: 16px; color: #183f63; font-weight: 700; }
.main-dashboard .sidebar-header a::after { content: '\203A'; color: #7891a7; font-size: 14px; line-height: 1; }
.main-dashboard .sidebar-header a:hover { background: #dfeaf3; }
.main-dashboard .sidebar-item-160 { width: auto; }
.main-dashboard .sidebar-item-160 a { max-width: calc(100% - 30px); font-weight: 400; line-height: 16px; vertical-align: top; }
.main-dashboard table.sidebar-table td:not(.sidebar-header) { box-sizing: border-box; height: 19px; line-height: 16px; font-size: 12px; padding: 1px 9px; }
.main-dashboard table:not(#t3) td:last-child:not(:first-child) { width: 84px; padding-left: 0; color: #7b8998; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.main-dashboard td:last-child:not(:first-child) { white-space: nowrap; }
.main-dashboard .photo-item img { display: block; width: 100%; height: 36px; object-fit: cover; border-radius: 3px; transition: opacity .15s ease; }
.main-dashboard .photo-item a:hover img { opacity: .8; }
.main-dashboard .photo-item { padding: 3px !important; }
.main-dashboard .empty-message { height: auto !important; padding: 8px !important; }
.board-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.board-header h2 { margin: 0; line-height: 1.4; }
.btn, a.primary-action, button.primary-action, a.secondary-action,
.board-write-actions .btn, .login-layer-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 40px;
    height: auto;
    padding: 10px 18px;
    line-height: 20px;
    font-size: 14px;
    vertical-align: middle;
    margin: 0;
}
.board-search-form { display: flex; align-items: center; gap: 6px; }
.board-search-form input, .board-search-form select, .board-search-form .btn {
    box-sizing: border-box; height: 40px; min-height: 40px; margin: 0; padding: 8px 12px; line-height: 22px;
}
.mobile-site-header { display: none; }
@media (max-width: 900px) {
    .main-container { position: relative; }
    .header-image { display: none !important; }
    .mobile-site-header {
        display: block !important; position: relative; width: 100%; height: auto;
        min-height: 0; background: #a8d3ef; border-bottom: 3px solid #dc714e;
        z-index: 20;
    }
    .mobile-brand { display: block; position: static; }
    .mobile-brand img { display: block; width: 100%; height: auto; }
    .login-header {
        position: absolute !important;
        top: 10px;
        right: 70px;
        z-index: 30;
        display: flex;
        align-items: center;
        gap: 5px;
        width: auto !important;
        max-width: calc(100% - 150px);
        min-height: 34px;
        margin: 0 !important;
        padding: 5px 10px !important;
        border: 1px solid rgba(255,255,255,.88);
        border-radius: 18px;
        background: rgba(255,255,255,.9) !important;
        box-shadow: 0 4px 14px rgba(23,59,93,.2);
        color: #173b5d;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        font-size: 12px;
        line-height: 1;
        white-space: nowrap;
    }
    .login-header a,
    .login-header .login-user {
        color: #173b5d !important;
        font-weight: 700;
    }
    .login-header a {
        padding: 3px 2px;
        text-shadow: none;
    }
    .login-header a:hover {
        color: #0d6ea6 !important;
        background: rgba(37,107,155,.1);
    }
    .mobile-menu-toggle {
        display: grid !important; position: absolute; top: 12px; right: 12px;
        width: 46px; height: 46px; padding: 12px; gap: 5px; place-content: center;
        border: 1px solid #ffffff99; border-radius: 10px; background: #173b5d;
        z-index: 3; cursor: pointer;
    }
    .mobile-menu-toggle span:not(.sr-only) { display: block; width: 22px; height: 2px; background: white; }
    .mobile-navigation {
        position: absolute; top: 100%; left: 10px; right: 10px; display: none;
        padding: 10px; background: white; border: 1px solid #d7e0e9; border-radius: 10px;
        box-shadow: 0 10px 30px #173b5d40; z-index: 4;
    }
    .mobile-navigation.is-open { display: grid; grid-template-columns: 1fr 1fr; visibility: visible; opacity: 1; transform: none; }
    .mobile-navigation a { padding: 14px 10px; font-size: 14px; color: #24384b; text-align: left; }
    .main-content.main-content--home { padding: 14px 14px 22px; min-height: 0; background: #f2f6f9; }
    .main-dashboard { gap: 10px; }
    .main-dashboard table.sidebar-table .sidebar-header a { padding: 8px 10px; font-size: 14px; }
    .main-dashboard table.sidebar-table td:not(.sidebar-header) { height: 32px; padding: 6px 10px; font-size: 13px; }
    .main-dashboard .sidebar-item-160 a { line-height: 19px; }
    .main-dashboard .photo-item img { height: clamp(44px, 13vw, 85px); }
    .main-dashboard .photo-item { padding: 4px !important; }
    .main-dashboard { width: 100%; }
    .main-dashboard .sidebar-item-160 a { max-width: calc(100% - 30px); }
    .board-search-form input { flex: 1; min-width: 0; width: 100%; }
    .board-search-form select { width: 82px; }
}
@media (max-width: 420px) {
    .login-header {
        top: 8px;
        right: 64px;
        max-width: calc(100% - 132px);
        min-height: 32px;
        padding: 4px 8px !important;
        font-size: 11px;
    }
}
.main-container { box-shadow: 0 4px 20px #19384f0c; }
.footer { box-sizing: border-box; border-top: 1px solid #dce5ed; background: #f4f7fa; color: #82909d; line-height: 1.8; }
.mobile-navigation a:focus-visible,
.main-dashboard a:focus-visible { outline: 2px solid #256b9b; outline-offset: -2px; border-radius: 4px; }

/* 게시글에 저장된 레거시 표가 모바일 화면 전체를 밀어내지 않도록 제한한다. */
.board-content-body iframe,
.board-content-body video {
    display: block;
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
}

.board-content-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
}
.board-content-meta > span { display: inline-flex; align-items: baseline; gap: 5px; }
.board-meta-label { color: #89939c; }

.board-view-container,
.board-content-wrapper,
.board-content-body {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 900px) {
    .board-content-header { padding: 16px 14px; text-align: left; }
    .board-content-title { margin: 0; font-size: 20px; line-height: 1.45; overflow-wrap: anywhere; }
    .board-content-meta { justify-content: flex-start; margin-top: 10px; gap: 4px 14px; font-size: 11px; line-height: 1.7; color: #697583; }
    .board-content-meta .board-meta-author { flex-basis: 100%; font-size: 12px; overflow-wrap: anywhere; }
    .board-content-meta time { white-space: nowrap; }

    .board-content-body,
    .board-content-body :where(p, div, td, center) {
        text-align: left !important;
    }

    .board-content-wrapper {
        overflow: hidden;
    }

    .board-content-body {
        width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .board-content-body table {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed;
    }

    .board-content-body table th,
    .board-content-body table td {
        min-width: 0 !important;
        width: auto !important;
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}
