/* ==========================================================
   Internal Board Theme
   - Matched to the risk assessment app dark navy theme
   ========================================================== */

:root {
    color-scheme: dark;
    --bg: #0c1420;
    --bg2: #111d2e;
    --bg3: #162033;
    --bg4: #1a263b;
    --border: rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.12);
    --text: #c5d8eb;
    --text-dim: #5d7a96;
    --text-hi: #e8f2fc;
    --accent: #e8920a;
    --accent2: #f5a623;
    --blue: #3a7fc1;
    --danger: #f08080;
    --danger-border: rgba(200, 64, 64, 0.45);
    --danger-bg: rgba(200, 50, 50, 0.12);
    --success: #6fcf97;
    --success-border: rgba(45, 157, 87, 0.35);
    --success-bg: rgba(30, 120, 60, 0.15);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body {
    padding: 32px 20px 48px;
}

a {
    color: var(--text-hi);
    text-decoration: none;
}

a:hover {
    color: var(--accent2);
}

button,
input,
select,
textarea {
    font: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: none;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(232,146,10,0.18);
}

.board-wrap {
    width: 100%;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.board-main {
    flex: 1;
    padding: 0;
}

.board-header,
.board-nav,
.page-shell,
.post-view,
.comment-section,
.write-form,
.search-panel,
.post-table,
.admin-stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    box-shadow: none;
}

.board-header {
    border-radius: 18px 18px 0 0;
    overflow: hidden;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(22, 32, 51, 0.98), rgba(17, 29, 46, 0.98));
}

.board-logo {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    color: var(--text-hi);
}

.board-logo a {
    color: var(--text-hi);
}

.header-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.user-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.user-dept {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border2);
    color: var(--text);
    font-size: 12px;
}

.user-name {
    color: var(--text-hi);
    font-weight: 700;
}

.user-badge,
.admin-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(232,146,10,0.12);
    border: 1px solid rgba(232,146,10,0.32);
    color: var(--accent2);
    font-size: 11px;
    font-weight: 700;
}

.btn-link,
.btn,
.like-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border2);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.btn-link:hover,
.btn:hover,
.like-btn:hover {
    background: rgba(255,255,255,0.10);
    color: var(--text-hi);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent) !important;
    border-color: transparent !important;
    color: #fff !important;
}

.btn-primary:hover {
    background: var(--accent2) !important;
}

.btn-link-cta {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    border-color: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(232, 146, 10, 0.28);
}

.btn-link-cta:hover {
    background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(232, 146, 10, 0.34);
}

.btn-danger {
    color: var(--danger);
    border-color: rgba(240, 128, 128, 0.25);
}

.btn-danger:hover {
    background: rgba(240, 128, 128, 0.08);
}

.btn-sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.board-nav {
    border-top: 0;
    border-radius: 0 0 18px 18px;
    margin-bottom: 18px;
    overflow: hidden;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 18px;
    background: var(--bg2);
}

.cat-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cat-tabs li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.cat-tabs li a:hover {
    background: rgba(255,255,255,0.10);
    color: var(--text-hi);
}

.cat-tabs li.active a {
    background: rgba(58,127,193,0.22);
    border-color: rgba(58,127,193,0.55);
    color: var(--text-hi);
}

.nav-search,
.search-panel {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.search-panel {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
}

.search-panel__label {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 700;
}

.nav-search select,
.nav-search input,
.nav-search button,
.search-panel select,
.search-panel input,
.search-panel button,
.form-input input[type="text"],
.form-input input[type="datetime-local"],
.form-input input[type="file"],
.form-input select,
.form-input textarea,
.comment-form textarea,
.post-table input[type="text"],
.post-table input[type="number"],
.post-table select {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border2);
    border-radius: 10px;
    background: var(--bg3);
    color: var(--text-hi);
}

.nav-search input,
.search-panel input[type="text"] {
    width: 240px;
}

.nav-search button,
.search-panel button {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    cursor: pointer;
}

.nav-search button:hover,
.search-panel button:hover {
    background: var(--accent2);
}

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 18px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
}

.page-title span:first-child {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-hi);
}

.page-title .sub {
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 700;
}

.post-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 18px;
    overflow: hidden;
}

.post-table thead th {
    padding: 12px 10px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border2);
    color: var(--text-hi);
    font-size: 12px;
    text-align: center;
    font-weight: 700;
}

.post-table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-align: center;
    background: transparent;
}

.post-table tbody tr:hover td {
    background: rgba(255,255,255,0.03);
}

.post-table tbody tr:last-child td {
    border-bottom: 0;
}

.post-table tbody td.title-cell {
    text-align: left;
    padding-left: 14px;
}

.post-table code {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: var(--text-hi);
}

.notice-row td {
    background: rgba(232,146,10,0.08) !important;
}

.col-num { width: 70px; }
.col-cat { width: 110px; }
.col-author { width: 150px; }
.col-date { width: 110px; }
.col-views,
.col-likes { width: 80px; }

.cat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(58,127,193,0.16);
    border: 1px solid rgba(58,127,193,0.34);
    color: var(--text-hi);
    font-size: 11px;
    font-weight: 700;
}

.notice-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(232,146,10,0.16);
    border: 1px solid rgba(232,146,10,0.34);
    color: var(--accent2);
    font-size: 11px;
    font-weight: 700;
}

.post-title {
    color: var(--text-hi);
    font-weight: 700;
}

.post-title:hover {
    color: var(--accent2);
}

.comment-count {
    margin-left: 5px;
    color: var(--accent2);
    font-size: 11px;
    font-weight: 700;
}

.attach-icon,
.author-dept,
.post-summary,
.admin-role-text,
.admin-note,
.poll-count,
.attach-size {
    color: var(--text-dim);
}

.author-name {
    color: var(--text-hi);
    font-weight: 700;
}

.empty-row td,
.comment-empty {
    padding: 56px 16px !important;
    color: var(--text-dim);
    text-align: center !important;
}

.action-bar,
.form-actions,
.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.write-actions-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-bar {
    margin-top: 16px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 22px 0 12px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border2);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.pagination a:hover {
    background: rgba(255,255,255,0.10);
    color: var(--text-hi);
}

.pagination .current {
    background: rgba(58,127,193,0.22);
    border-color: rgba(58,127,193,0.55);
    color: var(--text-hi);
}

.post-view,
.comment-section,
.write-form {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 18px;
}

.write-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 18, 34, 0.72);
    backdrop-filter: blur(2px);
}

.write-preview-modal[hidden] {
    display: none !important;
}

.write-preview-dialog {
    width: min(900px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 14px;
    border: 1px solid var(--border2);
    background: var(--bg2);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
}

.write-preview-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 23, 45, 0.95);
}

.write-preview-title {
    margin: 0;
    padding: 18px 18px 10px;
    color: var(--text-hi);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.4;
}

.write-preview-content {
    padding: 0 18px 20px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.write-preview-image-wrap {
    margin: 14px 0;
}

.write-preview-image-wrap img {
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border2);
}

.write-preview-image-wrap figcaption {
    margin-top: 6px;
    color: var(--text-dim);
    font-size: 12px;
}

.content-text-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    padding: 5px 8px;
    background: var(--bg4);
    border: 1px solid var(--border2);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

.content-text-toolbar .toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 26px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    line-height: 1;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.content-text-toolbar .toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border2);
}

.content-text-toolbar .toolbar-btn.is-active {
    background: rgba(58, 127, 193, 0.18);
    border-color: rgba(58, 127, 193, 0.45);
    color: #7fb8f0;
}

.content-text-toolbar .toolbar-separator {
    width: 1px;
    height: 18px;
    background: var(--border2);
    margin: 0 3px;
    flex-shrink: 0;
}

.content-text-toolbar .toolbar-select {
    height: 26px;
    padding: 0 6px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 5px;
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.content-text-toolbar .toolbar-select:focus {
    border-color: rgba(58, 127, 193, 0.5);
}

.content-text-toolbar .toolbar-color-btn {
    position: relative;
    min-width: 28px;
    height: 26px;
    padding: 0 6px;
    gap: 3px;
}

.content-text-toolbar .toolbar-color-btn .color-swatch {
    display: inline-block;
    width: 14px;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.content-text-toolbar input[type="color"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.content-editor {
    width: 100%;
    min-height: 320px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg3);
    color: var(--text);
    font-size: 15px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

.content-editor.has-toolbar {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top-color: transparent;
}

.content-editor:focus {
    outline: none;
    border-color: rgba(58,127,193,0.6);
    box-shadow: 0 0 0 2px rgba(58,127,193,0.2);
}

.content-editor.is-empty::before {
    content: attr(data-placeholder);
    color: var(--text-dim);
    pointer-events: none;
}

.editor-embed {
    display: block;
    margin: 10px 0;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--border2);
    background: rgba(255, 255, 255, 0.03);
}

.editor-embed img {
    display: block;
    max-width: 100%;
    border-radius: 8px;
}

.editor-embed figcaption {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.editor-embed.align-left {
    margin-right: auto;
    margin-left: 0;
}

.editor-embed.align-center {
    margin-right: auto;
    margin-left: auto;
}

.editor-embed.align-right {
    margin-right: 0;
    margin-left: auto;
}

.editor-embed.size-small {
    width: min(280px, 100%);
}

.editor-embed.size-medium {
    width: min(520px, 100%);
}

.editor-embed.size-large {
    width: 100%;
}

.editor-embed.size-large img {
    width: 100%;
}

.editor-embed.size-full {
    width: 100%;
}

.editor-embed.size-full img {
    width: 100%;
}

.editor-image-toolbar {
    position: fixed;
    z-index: 3500;
    display: none;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--border2);
    border-radius: 10px;
    background: rgba(8, 23, 45, 0.96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.editor-image-toolbar.is-visible {
    display: inline-flex;
}

.editor-image-toolbar .tool-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-hi);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.editor-image-toolbar .tool-btn:hover {
    background: rgba(58, 127, 193, 0.24);
    border-color: rgba(58, 127, 193, 0.55);
}

.editor-image-toolbar .tool-btn.danger:hover {
    background: rgba(226, 77, 77, 0.22);
    border-color: rgba(226, 77, 77, 0.55);
}

.editor-image-toolbar .tool-sep {
    width: 1px;
    height: 18px;
    margin: 0 2px;
    background: var(--border2);
}

.image-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 3600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 18, 34, 0.72);
}

.image-edit-modal[hidden] {
    display: none !important;
}

.image-edit-dialog {
    width: min(1480px, calc(100vw - 40px));
    max-height: calc(100vh - 24px);
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--border2);
    background: var(--bg2);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
    display: flex;
    flex-direction: column;
}

.image-edit-head,
.image-edit-tools,
.image-edit-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.image-edit-head {
    justify-content: space-between;
}

.image-edit-meta {
    margin-left: 8px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
}

.image-edit-foot {
    border-top: 1px solid var(--border);
    border-bottom: 0;
    justify-content: flex-end;
}

.image-edit-tools {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.image-edit-tools .tool-btn {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-hi);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.image-edit-modal .nm-tool-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('../../source/sp_capture_editor_2cf72a89.svg');
    background-repeat: no-repeat;
    background-size: 182px 159px;
    vertical-align: middle;
    filter: brightness(0) invert(1) contrast(1.25);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    opacity: 0.96;
}

.image-edit-modal .nm-tool-icon-crop { background-position: -4px -73px; }
.image-edit-modal .nm-tool-icon-rotate { background-position: -4px -119px; }
.image-edit-modal .nm-tool-icon-text { background-position: -145px -4px; }
.image-edit-modal .nm-tool-icon-shape { background-position: -73px -119px; }
.image-edit-modal .nm-tool-icon-draw { background-position: -73px -73px; }
.image-edit-modal .nm-tool-icon-undo { background-position: -145px -73px; }
.image-edit-modal .nm-tool-icon-redo { background-position: -27px -96px; }
.image-edit-modal .nm-tool-icon-reset { background-position: -122px -50px; }
.image-edit-modal .nm-tool-icon-remove { background-position: -96px -96px; }
.image-edit-modal .nm-tool-icon-setting { background-position: -168px -40px; }

.image-edit-modal .tool-btn:hover .nm-tool-icon-crop { background-position: -50px -73px; }
.image-edit-modal .tool-btn:hover .nm-tool-icon-rotate { background-position: -50px -119px; }
.image-edit-modal .tool-btn:hover .nm-tool-icon-text { background-position: -145px -50px; }
.image-edit-modal .tool-btn:hover .nm-tool-icon-shape { background-position: -119px -119px; }
.image-edit-modal .tool-btn:hover .nm-tool-icon-draw { background-position: -99px -27px; }
.image-edit-modal .tool-btn:hover .nm-tool-icon-undo { background-position: -145px -119px; }
.image-edit-modal .tool-btn:hover .nm-tool-icon-redo { background-position: -73px -96px; }
.image-edit-modal .tool-btn:hover .nm-tool-icon-reset { background-position: -122px -96px; }
.image-edit-modal .tool-btn:hover .nm-tool-icon-remove { background-position: -122px -27px; }
.image-edit-modal .tool-btn:hover .nm-tool-icon-setting { background-position: -168px -64px; }

.image-edit-modal .tool-btn:disabled .nm-tool-icon-crop { background-position: -27px -73px; }
.image-edit-modal .tool-btn:disabled .nm-tool-icon-rotate { background-position: -27px -119px; }
.image-edit-modal .tool-btn:disabled .nm-tool-icon-text { background-position: -145px -27px; }
.image-edit-modal .tool-btn:disabled .nm-tool-icon-shape { background-position: -96px -119px; }
.image-edit-modal .tool-btn:disabled .nm-tool-icon-draw { background-position: -99px -4px; }
.image-edit-modal .tool-btn:disabled .nm-tool-icon-undo { background-position: -145px -96px; }
.image-edit-modal .tool-btn:disabled .nm-tool-icon-redo { background-position: -50px -96px; }
.image-edit-modal .tool-btn:disabled .nm-tool-icon-reset { background-position: -122px -73px; }
.image-edit-modal .tool-btn:disabled .nm-tool-icon-remove { background-position: -122px -4px; }
.image-edit-modal .tool-btn:disabled .nm-tool-icon-setting { background-position: -168px -52px; }

.image-edit-tools .tool-btn.tool-btn-setting {
    min-width: 22px;
    width: 22px;
    padding: 0;
}

.image-edit-tools .tool-btn.tool-btn-setting .nm-tool-icon {
    width: 7px;
    height: 4px;
}

.image-edit-tools .tool-btn:hover {
    background: rgba(58, 127, 193, 0.34);
    border-color: rgba(90, 162, 232, 0.72);
}

.image-edit-tools .tool-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.image-edit-tools .tool-btn:disabled .nm-tool-icon {
    opacity: 0.55;
}

.image-edit-tools .tool-btn.is-active {
    background: rgba(58, 127, 193, 0.45);
    border-color: rgba(90, 162, 232, 0.9);
    color: #a8d4f8;
    box-shadow: inset 0 0 0 1px rgba(90, 162, 232, 0.4);
}

.image-edit-tools .tool-btn.tool-select-btn {
    font-size: 15px;
    letter-spacing: -1px;
}

.image-edit-tools .tool-btn.danger:hover {
    background: rgba(226, 77, 77, 0.22);
    border-color: rgba(226, 77, 77, 0.55);
}

.image-edit-tools .tool-sep {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: var(--border2);
}

.image-edit-tools .tool-input {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    font-size: 12px;
}

.image-edit-tools .tool-input input {
    width: 92px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border2);
    border-radius: 8px;
    background: var(--bg3);
    color: var(--text-hi);
}

.image-edit-tools .editor-select {
    height: 32px;
    border: 1px solid var(--border2);
    border-radius: 8px;
    background: var(--bg3);
    color: var(--text-hi);
    padding: 0 8px;
}

.image-edit-tools .tool-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.image-edit-tools .tool-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #2f8cff;
}

.image-edit-tools .tool-btn.is-locked {
    background: rgba(58, 127, 193, 0.24);
    border-color: rgba(58, 127, 193, 0.55);
}

.image-edit-body {
    flex: 1;
    min-height: 68vh;
    padding: 16px 18px 18px;
    overflow: auto;
    background: var(--bg3);
}

.image-edit-canvas-stage-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(68vh - 24px);
    overflow: auto;
}

.image-edit-canvas-stage {
    position: relative;
    display: inline-block;
    background: #fff;
    border: 1px solid var(--border2);
    border-radius: 10px;
}

.image-edit-canvas,
.image-edit-overlay {
    display: block;
    max-width: none;
}

.image-edit-canvas {
    position: relative;
    z-index: 1;
}

.image-edit-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    z-index: 2;
    outline: none;
}

.image-text-entry {
    position: fixed;
    z-index: 3660;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    background: rgba(8, 14, 25, 0.12);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14) inset;
}

.image-text-entry[hidden] {
    display: none !important;
}

.image-text-entry-input {
    width: 100%;
    height: 100%;
    resize: none;
    border: 0;
    outline: 0;
    padding: 6px 8px;
    background: transparent;
    color: #ff2d2d;
    caret-color: #ff2d2d;
    font: 400 22px/1.35 "Malgun Gothic", sans-serif;
    overflow: hidden;
    white-space: pre;
    word-break: normal;
}

.image-crop-action {
    position: fixed;
    z-index: 3650;
    left: 0;
    top: 0;
    transform: translate(-100%, -100%);
    width: 170px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #1ed27a;
    border-radius: 6px;
    background: #14b867;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 30px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
    cursor: pointer;
}

.image-crop-action:hover {
    background: #11a55c;
    border-color: #2ae58b;
}

.image-crop-action[hidden] {
    display: none !important;
}

.image-text-panel {
    position: fixed;
    z-index: 3700;
    width: 232px;
    padding: 12px;
    border: 1px solid var(--border2);
    border-radius: 10px;
    background: rgba(13, 27, 49, 0.98);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.34);
}

.image-text-panel[hidden] {
    display: none !important;
}

.image-text-section + .image-text-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.image-text-label {
    color: #f1f5ff;
    font-size: 13px;
    font-weight: 700;
}

.image-text-size-row {
    display: grid;
    grid-template-columns: 62px 24px 1fr 24px;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.image-text-size-input {
    width: 62px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: var(--bg3);
    color: var(--text-hi);
    font-size: 12px;
}

.image-text-size-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8eeff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.image-text-size-btn:hover {
    background: rgba(58, 127, 193, 0.34);
    border-color: rgba(90, 162, 232, 0.72);
}

.image-text-size-range {
    width: 100%;
    accent-color: #2f8cff;
}

.image-text-style-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.image-text-style-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border2);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8eeff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.image-text-style-btn.style-italic {
    font-style: italic;
}

.image-text-style-btn.style-underline {
    text-decoration: underline;
}

.image-text-style-btn.style-strike {
    text-decoration: line-through;
}

.image-text-style-btn.active,
.image-text-style-btn:hover {
    background: rgba(58, 127, 193, 0.34);
    border-color: rgba(90, 162, 232, 0.72);
}

.image-text-color-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-text-more-btn {
    border: 0;
    background: transparent;
    color: #9fb9e7;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.image-text-more-btn:hover {
    color: #d5e3ff;
}

.image-text-color-palette {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
}

.image-text-color-palette .color-chip {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    background: var(--chip, #ffffff);
    cursor: pointer;
}

.image-text-color-palette .color-chip.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 1px #0f3f7e inset;
}

.image-text-color-dim {
    position: fixed;
    inset: 0;
    z-index: 3710;
    background: rgba(4, 12, 24, 0.56);
}

.image-text-color-dim[hidden] {
    display: none !important;
}

.image-text-color-picker {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3720;
    width: 248px;
    padding: 10px;
    border: 1px solid #cfd6e3;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
}

.image-text-color-picker[hidden] {
    display: none !important;
}

.image-text-color-picker-top {
    display: grid;
    grid-template-columns: 22px 1fr auto auto;
    gap: 6px;
    align-items: center;
}

.image-text-color-preview {
    width: 22px;
    height: 22px;
    border: 1px solid #cfd6e3;
    border-radius: 2px;
    background: #ff2d2d;
}

.image-text-color-hex {
    width: 100%;
    height: 24px;
    padding: 0 6px;
    border: 1px solid #c9ced8;
    border-radius: 2px;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
}

.image-text-color-apply-btn {
    height: 24px;
    padding: 0 8px;
    border: 1px solid #c9ced8;
    border-radius: 2px;
    background: #f4f6fa;
    color: #111827;
    font-size: 12px;
    cursor: pointer;
}

.image-text-color-close-btn {
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #4b5563;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.image-text-color-sv,
.image-text-color-hue {
    width: 100%;
    display: block;
    margin-top: 10px;
    cursor: crosshair;
    border: 1px solid #d5dbe7;
}

.image-text-color-hue {
    height: 12px;
    margin-top: 8px;
}

.image-shape-panel {
    position: fixed;
    z-index: 3700;
    width: 238px;
    padding: 12px;
    border: 1px solid var(--border2);
    border-radius: 10px;
    background: rgba(13, 27, 49, 0.98);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.34);
}

.image-shape-panel[hidden] {
    display: none !important;
}

.image-shape-section + .image-shape-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.image-shape-label {
    color: #f1f5ff;
    font-size: 13px;
    font-weight: 700;
}

.image-shape-type-row {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.image-shape-type-btn,
.image-shape-line-style-btn {
    height: 28px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8eeff;
    cursor: pointer;
}

.image-shape-type-btn:hover,
.image-shape-type-btn.active,
.image-shape-line-style-btn:hover,
.image-shape-line-style-btn.active {
    background: rgba(58, 127, 193, 0.34);
    border-color: rgba(90, 162, 232, 0.72);
}

.shape-type-icon {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 14px;
}

.shape-type-icon.rect {
    border: 2px solid #dce6ff;
}

.shape-type-icon.round-rect {
    border: 2px solid #dce6ff;
    border-radius: 4px;
}

.shape-type-icon.ellipse {
    border: 2px solid #dce6ff;
    border-radius: 50%;
}

.shape-type-icon.line {
    width: 16px;
    height: 0;
    border-top: 2px solid #dce6ff;
    transform: translateY(6px);
}

.shape-type-icon.free-quad {
    width: 14px;
    height: 14px;
    border: 2px solid #dce6ff;
    clip-path: polygon(20% 0%, 100% 0%, 80% 100%, 0% 100%);
}

.image-shape-width-row {
    display: grid;
    grid-template-columns: 60px 24px 1fr 24px;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.image-shape-width-input {
    width: 60px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: var(--bg3);
    color: var(--text-hi);
    font-size: 12px;
}

.image-shape-width-range {
    width: 100%;
    accent-color: #2f8cff;
}

.image-shape-width-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8eeff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.image-shape-width-btn:hover {
    background: rgba(58, 127, 193, 0.34);
    border-color: rgba(90, 162, 232, 0.72);
}

.image-shape-line-style-row {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.line-style-sample {
    display: inline-block;
    width: 100%;
    border-top: 2px solid #dce6ff;
}

.line-style-sample.solid {
    border-top-style: solid;
}

.line-style-sample.dash {
    border-top-style: dashed;
}

.line-style-sample.dot {
    border-top-style: dotted;
}

.image-shape-color-tab-row {
    margin-top: 2px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.image-shape-color-tab-btn {
    height: 26px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #dce6ff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.image-shape-color-tab-btn:hover,
.image-shape-color-tab-btn.active {
    background: rgba(58, 127, 193, 0.34);
    border-color: rgba(90, 162, 232, 0.72);
}

.image-shape-more-btn {
    color: #b4c9ef;
}

.image-shape-color-palette {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
}

.image-shape-color-palette .color-chip {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    background: var(--chip, #ffffff);
    cursor: pointer;
}

.image-shape-color-palette .color-chip.transparent {
    position: relative;
    background:
        linear-gradient(135deg, transparent 43%, #ef4444 43%, #ef4444 57%, transparent 57%),
        linear-gradient(45deg, #ffffff 25%, #f0f0f0 25%, #f0f0f0 50%, #ffffff 50%, #ffffff 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 100% 100%, 8px 8px;
}

.image-shape-color-palette .color-chip.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 1px #0f3f7e inset;
}

.image-shape-color-dim {
    position: fixed;
    inset: 0;
    z-index: 3710;
    background: rgba(4, 12, 24, 0.56);
}

.image-shape-color-dim[hidden] {
    display: none !important;
}

.image-shape-color-picker {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3720;
    width: 248px;
    padding: 10px;
    border: 1px solid #cfd6e3;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
}

.image-shape-color-picker[hidden] {
    display: none !important;
}

.image-shape-color-picker-top {
    display: grid;
    grid-template-columns: 22px 1fr auto auto;
    gap: 6px;
    align-items: center;
}

.image-shape-color-preview {
    width: 22px;
    height: 22px;
    border: 1px solid #cfd6e3;
    border-radius: 2px;
    background: #ff2d2d;
}

.image-shape-color-hex {
    width: 100%;
    height: 24px;
    padding: 0 6px;
    border: 1px solid #c9ced8;
    border-radius: 2px;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
}

.image-shape-color-apply-btn {
    height: 24px;
    padding: 0 8px;
    border: 1px solid #c9ced8;
    border-radius: 2px;
    background: #f4f6fa;
    color: #111827;
    font-size: 12px;
    cursor: pointer;
}

.image-shape-color-close-btn {
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #4b5563;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.image-shape-color-sv,
.image-shape-color-hue {
    width: 100%;
    display: block;
    margin-top: 10px;
    cursor: crosshair;
    border: 1px solid #d5dbe7;
}

.image-shape-color-hue {
    height: 12px;
    margin-top: 8px;
}

.image-shape-alpha-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.image-shape-alpha-title {
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}

.image-shape-alpha-range {
    width: 100%;
    accent-color: #2f8cff;
}

.shape-color-alpha-label {
    color: #111827;
    font-size: 12px;
    font-weight: 700;
}

.image-shape-alpha-inline-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.shape-color-alpha-inline-label {
    color: #dce6ff;
    font-size: 12px;
    font-weight: 700;
}

.image-draw-panel {
    position: fixed;
    z-index: 3700;
    width: 238px;
    padding: 12px;
    border: 1px solid var(--border2);
    border-radius: 10px;
    background: rgba(13, 27, 49, 0.98);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.34);
}

.image-draw-panel[hidden] {
    display: none !important;
}

.image-draw-section + .image-draw-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.image-draw-label {
    color: #f1f5ff;
    font-size: 13px;
    font-weight: 700;
}

.image-draw-width-row {
    display: grid;
    grid-template-columns: 60px 24px 1fr 24px;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.image-draw-width-input {
    width: 60px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: var(--bg3);
    color: var(--text-hi);
    font-size: 12px;
}

.image-draw-width-range {
    width: 100%;
    accent-color: #2f8cff;
}

.image-draw-width-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8eeff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.image-draw-width-btn:hover {
    background: rgba(58, 127, 193, 0.34);
    border-color: rgba(90, 162, 232, 0.72);
}

.image-draw-color-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-draw-more-btn {
    border: 0;
    background: transparent;
    color: #9fb9e7;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.image-draw-more-btn:hover {
    color: #d5e3ff;
}

.image-draw-color-palette {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
}

.image-draw-color-palette .color-chip {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    background: var(--chip, #ffffff);
    cursor: pointer;
}

.image-draw-color-palette .color-chip.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 1px #0f3f7e inset;
}

.image-draw-alpha-inline-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.image-draw-panel .image-draw-alpha-title {
    color: #f1f5ff;
}

.draw-color-alpha-inline-label {
    color: #dce6ff;
    font-size: 12px;
    font-weight: 700;
}

.image-draw-color-dim {
    position: fixed;
    inset: 0;
    z-index: 3710;
    background: rgba(4, 12, 24, 0.56);
}

.image-draw-color-dim[hidden] {
    display: none !important;
}

.image-draw-color-picker {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3720;
    width: 248px;
    padding: 10px;
    border: 1px solid #cfd6e3;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
}

.image-draw-color-picker[hidden] {
    display: none !important;
}

.image-draw-color-picker-top {
    display: grid;
    grid-template-columns: 22px 1fr auto auto;
    gap: 6px;
    align-items: center;
}

.image-draw-color-preview {
    width: 22px;
    height: 22px;
    border: 1px solid #cfd6e3;
    border-radius: 2px;
    background: #ff2d2d;
}

.image-draw-color-hex {
    width: 100%;
    height: 24px;
    padding: 0 6px;
    border: 1px solid #c9ced8;
    border-radius: 2px;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
}

.image-draw-color-apply-btn {
    height: 24px;
    padding: 0 8px;
    border: 1px solid #c9ced8;
    border-radius: 2px;
    background: #f4f6fa;
    color: #111827;
    font-size: 12px;
    cursor: pointer;
}

.image-draw-color-close-btn {
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #4b5563;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.image-draw-color-sv,
.image-draw-color-hue {
    width: 100%;
    display: block;
    margin-top: 10px;
    cursor: crosshair;
    border: 1px solid #d5dbe7;
}

.image-draw-color-hue {
    height: 12px;
    margin-top: 8px;
}

.image-draw-alpha-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.image-draw-alpha-title {
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}

.image-draw-alpha-range {
    width: 100%;
    accent-color: #2f8cff;
}

.draw-color-alpha-label {
    color: #111827;
    font-size: 12px;
    font-weight: 700;
}

.live-preview-box {
    width: 100%;
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg3);
    overflow: hidden;
}

.live-preview-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-hi);
    font-size: 12px;
    font-weight: 800;
}

.live-preview-body {
    min-height: 120px;
    padding: 12px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.live-preview-empty {
    color: var(--text-dim);
}

.live-preview-body .write-preview-image-wrap {
    margin: 10px 0;
}

.write-preview-image-wrap.align-left {
    margin-right: auto;
    margin-left: 0;
    width: fit-content;
}

.write-preview-image-wrap.align-center {
    margin-right: auto;
    margin-left: auto;
    width: fit-content;
}

.write-preview-image-wrap.align-right {
    margin-right: 0;
    margin-left: auto;
    width: fit-content;
}

.write-preview-image-wrap.size-small img {
    width: min(280px, 100%);
}

.write-preview-image-wrap.size-medium img {
    width: min(520px, 100%);
}

.write-preview-image-wrap.size-large {
    width: 100%;
}

.write-preview-image-wrap.size-large img {
    width: 100%;
}

.write-preview-image-wrap.size-full {
    width: 100%;
}

.write-preview-image-wrap.size-full img {
    width: 100%;
}

.post-view-head {
    padding: 22px 24px 18px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
}

.post-view-head .title {
    margin: 0 0 12px;
    color: var(--text-hi);
    font-size: 24px;
    font-weight: 900;
    line-height: 1.4;
}

.post-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.post-meta .meta-item {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-size: 12px;
}

.post-meta .meta-item strong {
    margin-left: 4px;
    color: var(--text-hi);
}

.post-meta .meta-sep {
    display: none;
}

.post-view-body {
    padding: 24px;
    min-height: 220px;
    background: var(--bg2);
    color: var(--text);
    line-height: 1.85;
    border-bottom: 1px solid var(--border);
}

.post-view-body img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border2);
    border-radius: 12px;
    background: var(--bg3);
}

.inline-attachment-image {
    margin: 14px 0;
}

.inline-attachment-image.align-left {
    margin-right: auto;
    margin-left: 0;
    width: fit-content;
}

.inline-attachment-image.align-center {
    margin-right: auto;
    margin-left: auto;
    width: fit-content;
}

.inline-attachment-image.align-right {
    margin-right: 0;
    margin-left: auto;
    width: fit-content;
}

.inline-attachment-image.size-small img {
    width: min(280px, 100%);
}

.inline-attachment-image.size-medium img {
    width: min(520px, 100%);
}

.inline-attachment-image.size-large {
    width: 100%;
}

.inline-attachment-image.size-large img {
    width: 100%;
}

.inline-attachment-image.size-full {
    width: 100%;
}

.inline-attachment-image.size-full img {
    width: 100%;
}

.inline-attachment-image figcaption {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.post-attachments {
    padding: 14px 24px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
}

.post-attachments .label {
    display: block;
    margin-right: 0;
    margin-bottom: 10px;
    color: var(--text-hi);
    font-weight: 700;
}

.post-attachment-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.post-attachment-image {
    margin: 0;
    padding: 10px;
    border-radius: 12px;
    background: var(--bg3);
    border: 1px solid var(--border);
}

.post-attachment-image a {
    color: inherit;
    text-decoration: none;
}

.post-attachment-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 10px;
}

.post-attachment-image figcaption {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-dim);
}

.post-attachment-image figcaption a {
    color: var(--text-hi);
}

.post-attachments ul {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
}

.post-attachments li {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--bg3);
    border: 1px solid var(--border);
}

.post-actions {
    padding: 16px 24px 20px;
    background: var(--bg2);
}

.like-btn.liked {
    background: rgba(232,146,10,0.12);
    border-color: rgba(232,146,10,0.34);
    color: var(--accent2);
}

.poll-box {
    margin: 20px 24px;
    padding: 16px 18px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.poll-question {
    margin-bottom: 12px;
    color: var(--text-hi);
    font-size: 15px;
    font-weight: 700;
}

.poll-question .meta {
    margin-left: 8px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
}

.poll-options {
    list-style: none;
    margin: 0;
    padding: 0;
}

.poll-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 11px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    overflow: hidden;
}

.poll-option:hover {
    background: rgba(255,255,255,0.05);
}

.poll-option.voted-mine {
    border-color: rgba(58,127,193,0.42);
    background: rgba(58,127,193,0.12);
}

.poll-result-bar {
    position: absolute;
    inset: 0 auto 0 0;
    background: rgba(58,127,193,0.12);
    z-index: 0;
}

.poll-option > * {
    position: relative;
    z-index: 1;
}

.poll-percent {
    margin-left: auto;
    color: var(--accent2);
    font-size: 12px;
    font-weight: 700;
}

.comment-section {
    padding: 20px;
}

.comment-section h3 {
    margin: 0 0 14px;
    color: var(--text-hi);
    font-size: 18px;
    font-weight: 800;
}

.comment-section h3 .count {
    color: var(--accent2);
}

.comment-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.comment-item {
    padding: 14px 2px;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
    border-bottom: 0;
}

.comment-item.is-reply {
    margin-top: 10px;
    padding: 14px 14px 14px 40px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg3);
    position: relative;
}

.comment-item.is-reply::before {
    content: "->";
    position: absolute;
    left: 14px;
    top: 14px;
    color: var(--text-dim);
    font-weight: 700;
}

.comment-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
}

.comment-author {
    color: var(--text-hi);
    font-weight: 700;
}

.comment-author .dept,
.comment-date {
    color: var(--text-dim);
}

.comment-body {
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-actions {
    margin-top: 8px;
    font-size: 12px;
}

.comment-actions a {
    margin-right: 10px;
    color: var(--text-dim);
    font-weight: 700;
    cursor: pointer;
}

.comment-actions a:hover {
    color: var(--accent2);
}

.comment-form {
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
    background: var(--bg3);
    border: 1px solid var(--border);
}

.comment-form textarea,
.form-input textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    resize: vertical;
}

.comment-form .form-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.comment-form .form-bottom .info {
    color: var(--text-dim);
    font-size: 12px;
}

.form-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}

.form-row:last-child {
    border-bottom: 0;
}

.form-row .form-label {
    width: 130px;
    padding: 16px 18px;
    background: var(--bg3);
    border-right: 1px solid var(--border);
    color: var(--text-hi);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.form-row .form-label .req {
    margin-left: 4px;
    color: var(--accent2);
}

.form-row .form-input {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--bg2);
}

.write-form .form-input input[name="title"] {
    width: 100%;
}

.form-input textarea {
    min-height: 320px;
}

.content-form-row .form-input {
    display: block;
    padding: 18px;
}

.content-form-row textarea,
.content-form-row .content-editor,
.content-form-row .content-text-toolbar,
.content-form-row .live-preview-box {
    width: 100%;
}

@media (min-width: 1200px) {
    .content-form-row .form-label {
        width: 150px;
    }

    .content-form-row .form-input {
        padding: 20px 22px 22px;
    }

    .content-form-row textarea {
        min-height: 520px;
    }

    .content-form-row .content-editor {
        min-height: 560px;
        padding: 18px 20px;
        font-size: 16px;
        line-height: 1.85;
    }

    .image-edit-modal {
        padding: 12px;
    }

    .image-edit-head,
    .image-edit-tools,
    .image-edit-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .image-edit-body {
        min-height: 74vh;
        padding: 18px 20px 20px;
    }

    .image-edit-canvas-stage-wrap {
        min-height: calc(74vh - 28px);
    }
}

.form-input .help {
    color: var(--text-dim);
    font-size: 12px;
}

.file-list {
    margin-top: 8px;
}

.file-list .existing-file {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    margin-right: 8px;
    margin-bottom: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    font-size: 12px;
}

.file-list .existing-file .del {
    margin-left: 8px;
    color: var(--danger);
    cursor: pointer;
    font-weight: 700;
}

.file-token-list {
    margin-top: 8px;
}

.insert-attachment-token {
    margin-left: 8px;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid var(--border2);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--text-hi);
    font-size: 11px;
    cursor: pointer;
}

.insert-attachment-token:hover {
    background: rgba(255,255,255,0.14);
}

.poll-builder {
    width: 100%;
    padding: 12px;
    background: var(--bg3);
    border: 1px dashed var(--border2);
    border-radius: 14px;
}

.poll-builder .poll-opt-input {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.poll-builder .poll-opt-input input {
    flex: 1;
}

.poll-builder .add-opt {
    min-height: 34px;
    padding: 0 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border2);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.poll-builder .poll-meta {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
    color: var(--text);
    font-size: 12px;
}

.poll-builder .poll-meta input[type="datetime-local"] {
    min-height: 38px;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    border-left: 4px solid transparent;
}

.alert-info {
    background: rgba(58,127,193,0.12);
    color: var(--text);
    border-left-color: var(--blue);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-left-color: var(--success-border);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-left-color: var(--danger-border);
}

.admin-section {
    margin-bottom: 28px;
}

.admin-section h2 {
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-hi);
    font-size: 18px;
    font-weight: 800;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.admin-stat-card {
    padding: 18px 16px;
    border-radius: 16px;
    text-align: center;
}

.admin-stat-card--accent {
    background: rgba(232,146,10,0.10);
    border-color: rgba(232,146,10,0.22);
}

.admin-stat-label {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 700;
}

.admin-stat-value {
    margin-top: 6px;
    color: var(--text-hi);
    font-size: 28px;
    font-weight: 900;
}

.admin-stat-card--accent .admin-stat-value {
    color: var(--accent2);
}

.admin-add-row td {
    background: rgba(232,146,10,0.06);
}

.inline-form {
    display: inline;
}

.admin-note {
    margin-top: 10px;
    font-size: 12px;
}

.board-footer {
    margin-top: 18px;
    padding: 18px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 12px;
    text-align: center;
}

.footer-sep {
    margin: 0 8px;
    color: rgba(255,255,255,0.18);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border2);
    font-size: 11px;
    font-weight: 700;
}

.status-open {
    color: #7eb2ff;
    background: rgba(58,127,193,0.18);
    border-color: rgba(58,127,193,0.45);
}

.status-in_progress {
    color: #ffcf66;
    background: rgba(232,146,10,0.18);
    border-color: rgba(232,146,10,0.40);
}

.status-closed {
    color: #8fe2b0;
    background: rgba(30,120,60,0.20);
    border-color: rgba(45,157,87,0.40);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.detail-item {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

.detail-item h3 {
    margin: 0 0 8px;
    color: var(--text-hi);
    font-size: 14px;
}

.detail-item p {
    margin: 0;
    color: var(--text);
    line-height: 1.7;
}

.detail-item:nth-child(n + 3) {
    grid-column: span 2;
}

@media (max-width: 1024px) {
    .admin-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-search input,
    .search-panel input[type="text"] {
        width: 100%;
    }
}

@media (max-width: 900px) {
    body {
        padding: 20px 12px 32px;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 18px;
    }

    .board-nav {
        border-radius: 0 0 16px 16px;
    }

    .nav-inner {
        padding: 14px 16px 16px;
    }

    .page-title {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-view-head,
    .post-view-body,
    .post-attachments,
    .post-actions,
    .comment-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .poll-box {
        margin-left: 16px;
        margin-right: 16px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-label {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .col-cat,
    .col-views,
    .col-likes,
    .post-table thead th:nth-child(2),
    .post-table thead th:nth-child(6),
    .post-table thead th:nth-child(7),
    .post-table tbody td:nth-child(2),
    .post-table tbody td:nth-child(6),
    .post-table tbody td:nth-child(7) {
        display: none;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-item:nth-child(n + 3) {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .header-user,
    .action-bar,
    .post-actions,
    .form-actions,
    .comment-form .form-bottom,
    .nav-search,
    .search-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-link,
    .btn,
    .like-btn,
    .nav-search select,
    .nav-search input,
    .nav-search button,
    .search-panel select,
    .search-panel input,
    .search-panel button {
        width: 100%;
    }

    .cat-tabs {
        width: 100%;
    }

    .cat-tabs li {
        flex: 1 1 calc(50% - 5px);
    }

    .cat-tabs li a {
        width: 100%;
    }

    .post-table {
        display: block;
        overflow-x: auto;
    }

    .post-list-table {
        display: block;
        overflow: visible;
        background: transparent;
        border: 0;
    }

    .post-list-table thead,
    .post-list-table colgroup {
        display: none;
    }

    .post-list-table tbody {
        display: grid;
        gap: 12px;
    }

    .post-list-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: var(--bg2);
    }

    .post-list-table tbody tr:hover td {
        background: transparent;
    }

    .post-list-table tbody td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        min-width: 0;
        padding: 0;
        border: 0;
        text-align: left;
        background: transparent;
    }

    .post-list-table tbody td::before {
        content: attr(data-label);
        color: var(--text-dim);
        font-size: 11px;
        font-weight: 700;
        line-height: 1.2;
    }

    .post-list-table tbody td.title-cell {
        grid-column: 1 / -1;
        gap: 6px;
    }

    .post-list-table tbody td.title-cell::before {
        display: none;
    }

    .post-list-table tbody td:nth-child(2) {
        display: flex;
    }

    .post-list-table tbody td:nth-child(6),
    .post-list-table tbody td:nth-child(7) {
        display: none;
    }

    .post-list-table .post-title {
        display: inline;
        font-size: 15px;
        line-height: 1.5;
        word-break: break-word;
    }

    .post-list-table .author-dept,
    .post-list-table .cat-badge,
    .post-list-table .notice-tag {
        max-width: 100%;
    }

    .post-list-table .empty-row {
        display: block;
    }

    .post-list-table .empty-row td {
        display: block;
        padding: 40px 16px !important;
        text-align: center;
    }

    .post-list-table .empty-row td::before {
        display: none;
    }

    .admin-stat-grid {
        grid-template-columns: 1fr;
    }
}
