/* WPC Support — Frontend Styles (Flat Design) */
:root {
    --wpcs-primary: #2271b1;
    --wpcs-primary-hover: #135e96;
    --wpcs-success: #00a32a;
    --wpcs-warning: #dba617;
    --wpcs-danger: #d63638;
    --wpcs-info: #0087be;
    --wpcs-purple: #7b4fa3;
    --wpcs-text: #1d2327;
    --wpcs-text-muted: #646970;
    --wpcs-border: #dcdcde;
    --wpcs-bg: #f6f7f7;
    --wpcs-card: #ffffff;
    --wpcs-radius: 5px;
    --wpcs-radius-sm: 5px;
    --wpcs-shadow: none;
}

.wpcs-wrap { margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; color: var(--wpcs-text); }
.wpcs-wrap *, .wpcs-wrap *::before, .wpcs-wrap *::after { box-sizing: border-box; }
.wpcs-wrap a, .wpcs-wrap a:hover, .wpcs-wrap a:focus, .wpcs-wrap a:active { text-decoration: none !important; }

/* ---- Header ---- */
.wpcs-page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.wpcs-page-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; line-height: 1.2; }
.wpcs-page-sub { color: var(--wpcs-text-muted); margin: 0; font-size: 14px; }
.wpcs-back-link { display: inline-block; color: var(--wpcs-primary); text-decoration: none; font-size: 13px; margin-bottom: 16px; font-weight: 500; transition: color .15s; }
.wpcs-back-link:hover { color: var(--wpcs-primary-hover); text-decoration: none; }

/* ---- Buttons (Flat) ---- */
.wpcs-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--wpcs-radius); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; border: none; transition: background .15s, color .15s; line-height: 1.2; box-shadow: none; }
.wpcs-btn:active { transform: translateY(1px); }
.wpcs-btn-primary { background: var(--wpcs-primary); color: #fff; border: 1px solid var(--wpcs-primary); }
.wpcs-btn-primary:hover { background: var(--wpcs-primary-hover); border-color: var(--wpcs-primary-hover); color: #fff; text-decoration: none; box-shadow: none; }
.wpcs-btn-secondary { background: var(--wpcs-bg); color: var(--wpcs-text-muted); border: 1px solid var(--wpcs-border); }
.wpcs-btn-secondary:hover { background: #ececec; color: var(--wpcs-text); text-decoration: none; }
.wpcs-btn-close { background: #fff; color: var(--wpcs-danger); border: 1px solid var(--wpcs-danger); padding: 7px 14px; font-size: 13px; border-radius: var(--wpcs-radius); cursor: pointer; font-weight: 600; transition: background .15s, color .15s; }
.wpcs-btn-close:hover { background: var(--wpcs-danger); color: #fff; }
.wpcs-btn-loading { display: none; }
.wpcs-icon-plus { vertical-align: middle; margin-right: 6px; }

/* ---- Alerts ---- */
.wpcs-alert { padding: 12px 16px; border-radius: var(--wpcs-radius); font-size: 14px; margin-bottom: 20px; font-weight: 500; border-left: 4px solid; }
.wpcs-alert-success { background: #edfaef; color: #00a32a; border-color: #00a32a; }
.wpcs-alert-error { background: #fceaea; color: #c02b2b; border-color: #d63638; }
.wpcs-alert-info { background: #e8f4ff; color: #0369a1; border-color: #0087be; }

/* ---- Badges ---- */
.wpcs-badge { display: inline-flex; align-items: center; justify-content: center; height: 22px; padding: 0 8px; border-radius: var(--wpcs-radius); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; line-height: 1; white-space: nowrap; }
.wpcs-status-open { background: #edfaef; color: #00a32a; }
.wpcs-status-pending { background: #fef7e7; color: #c07a00; }
.wpcs-status-closed { background: #f0f0f1; color: #646970; }
.wpcs-type-public { background: #e8f4ff; color: var(--wpcs-info); }
.wpcs-type-private { background: #f3e8ff; color: var(--wpcs-purple); }
.wpcs-badge-featured { background: #fff8e7; color: #b45309; border: 1px solid #fcd34d; }

/* ---- Tabs Bar & Search ---- */
.wpcs-tabs-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 1.5px solid var(--wpcs-border); margin-bottom: 24px; flex-wrap: wrap; }
.wpcs-tabs { display: flex; gap: 4px; margin-bottom: -2px; border-bottom: none; }
.wpcs-tab { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--wpcs-text-muted); text-decoration: none; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; border-radius: var(--wpcs-radius) var(--wpcs-radius) 0 0; }
.wpcs-tab:hover { color: var(--wpcs-primary); text-decoration: none; }
.wpcs-tab-active { color: var(--wpcs-primary); border-bottom-color: var(--wpcs-primary); }
.wpcs-tab-count { background: var(--wpcs-bg); color: var(--wpcs-text-muted); border-radius: var(--wpcs-radius); padding: 2px 6px; font-size: 11px; font-weight: 700; }
.wpcs-tab-active .wpcs-tab-count { background: #e8f4ff; color: var(--wpcs-primary); }
.wpcs-tab-lock { font-size: 12px; margin-left: 2px; opacity: 0.7; }

.wpcs-search-form { margin-bottom: 8px; flex-shrink: 0; }
.wpcs-search-input-wrap { position: relative; display: flex; align-items: center; }
.wpcs-search-input { height: 36px; padding: 6px 36px 6px 12px; border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); font-size: 13px; color: var(--wpcs-text); background: var(--wpcs-card); transition: border-color .15s, width .2s; width: 200px; outline: none; font-family: inherit; box-shadow: none; }
.wpcs-search-input:focus { border-color: var(--wpcs-primary); box-shadow: none; width: 240px; }
.wpcs-search-btn { position: absolute; right: 10px; background: transparent; border: none; padding: 0; color: var(--wpcs-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; transition: color .15s; }
.wpcs-search-btn:hover { color: var(--wpcs-primary); }
.wpcs-search-clear { position: absolute; right: 30px; color: var(--wpcs-text-muted); text-decoration: none; font-size: 16px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #e5e5e5; transition: background .12s, color .12s; }
.wpcs-search-clear:hover { background: #d0d0d0; color: #1d2327; text-decoration: none; }

.wpcs-search-notice { display: flex; justify-content: space-between; align-items: center; background: #e8f4ff; border: 1px solid #cce5ff; padding: 10px 16px; border-radius: var(--wpcs-radius); font-size: 13px; color: #0369a1; margin-bottom: 20px; font-weight: 500; }
.wpcs-search-reset-link { color: var(--wpcs-primary); font-weight: 600; text-decoration: none; font-size: 13px; }
.wpcs-search-reset-link:hover { color: var(--wpcs-primary-hover); text-decoration: none; }

/* ---- Ticket List (Single Row / Two Lines - Flat) ---- */
.wpcs-list { border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); overflow: hidden; background: var(--wpcs-card); }
.wpcs-ticket-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; text-decoration: none !important; color: var(--wpcs-text); border-bottom: 1px solid var(--wpcs-border); transition: background .15s; cursor: pointer; }
.wpcs-ticket-row:last-child { border-bottom: none; }
.wpcs-ticket-row:hover { background: #f8faff; }
.wpcs-ticket-title-link { text-decoration: none !important; color: var(--wpcs-text); display: inline; }
.wpcs-ticket-title-link:hover .wpcs-ticket-title-text, .wpcs-ticket-row:hover .wpcs-ticket-title-text { color: var(--wpcs-primary); }
.wpcs-ticket-code, .wpcs-ticket-code:hover { text-decoration: none !important; }
.wpcs-ticket-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

/* Line 1: Header (Key & Title) */
.wpcs-ticket-row-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wpcs-ticket-code { font-size: 11px; font-weight: 700; color: var(--wpcs-primary); background: #e8f4ff; height: 22px; padding: 0 7px; border-radius: var(--wpcs-radius); font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: .5px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.wpcs-ticket-title-text { font-size: 15px; font-weight: 600; color: var(--wpcs-text); line-height: 1.4; transition: color .15s; }
.wpcs-ticket-row:hover .wpcs-ticket-title-text { color: var(--wpcs-primary); }
.wpcs-row-status-closed .wpcs-ticket-title-text { color: var(--wpcs-text-muted); }

/* Line 2: Meta (User / Category / Status / Date) */
.wpcs-ticket-row-meta, .wpcs-ticket-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--wpcs-text-muted); line-height: 1.3; }
.wpcs-meta-unit { display: inline-flex; align-items: center; gap: 6px; }
.wpcs-meta-user { font-weight: 500; }
.wpcs-meta-avatar { border-radius: 50%; width: 18px; height: 18px; display: block; flex-shrink: 0; }
.wpcs-meta-author-name { color: #374151; font-weight: 600; }
.wpcs-meta-sep { color: #cbd5e1; font-size: 10px; user-select: none; }
.wpcs-meta-cat-chip { background: var(--wpcs-bg); color: var(--wpcs-text-muted); border: 1px solid var(--wpcs-border); padding: 0 7px; height: 22px; display: inline-flex; align-items: center; border-radius: var(--wpcs-radius); font-size: 11px; font-weight: 500; line-height: 1; }
a.wpcs-meta-cat-chip, a.wpcs-meta-cat-link { text-decoration: none; transition: all .15s ease; cursor: pointer; }
a.wpcs-meta-cat-chip:hover, a.wpcs-meta-cat-link:hover { background: var(--wpcs-primary); color: #ffffff; border-color: var(--wpcs-primary); text-decoration: none; }
.wpcs-meta-status { display: inline-flex; align-items: center; gap: 4px; }
.wpcs-meta-date { color: var(--wpcs-text-muted); }

/* Right side: Reply Count Bubble */
.wpcs-ticket-row-replies { flex-shrink: 0; }
.wpcs-reply-bubble { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--wpcs-radius); font-size: 12px; font-weight: 600; color: var(--wpcs-text-muted); background: var(--wpcs-bg); border: 1px solid var(--wpcs-border); transition: background .15s, color .15s, border-color .15s; line-height: 1; }
.wpcs-reply-bubble.has-replies { background: #f0f7ff; color: var(--wpcs-primary); border-color: #cce3f9; }
.wpcs-ticket-row:hover .wpcs-reply-bubble.has-replies { background: var(--wpcs-primary); color: #fff; border-color: var(--wpcs-primary); }
.wpcs-reply-icon { display: block; flex-shrink: 0; }
.wpcs-reply-num { line-height: 1; }

/* ---- Empty State ---- */
.wpcs-empty { text-align: center; padding: 60px 24px; background: var(--wpcs-card); border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); }
.wpcs-empty-icon { font-size: 48px; margin-bottom: 16px; }
.wpcs-empty h3 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.wpcs-empty p { color: var(--wpcs-text-muted); font-size: 14px; margin: 0 0 20px; }

/* ---- Login Notice ---- */
.wpcs-login-notice { text-align: center; padding: 60px 24px; background: var(--wpcs-card); border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); }
.wpcs-login-icon { font-size: 48px; margin-bottom: 16px; }
.wpcs-login-notice h3 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.wpcs-login-notice p { color: var(--wpcs-text-muted); font-size: 14px; margin: 0 0 20px; }

/* ---- Form Card (Flat) ---- */
.wpcs-form-card { background: var(--wpcs-card); border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); padding: 32px; box-shadow: none; }
.wpcs-form-group { margin-bottom: 22px; }
.wpcs-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 22px; }
.wpcs-label { display: block; font-size: 13px; font-weight: 700; color: var(--wpcs-text); margin-bottom: 6px; }
.wpcs-required { color: var(--wpcs-danger); }
.wpcs-input, .wpcs-select, .wpcs-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); font-size: 14px; color: var(--wpcs-text); background: #fff; transition: border-color .15s; font-family: inherit; box-shadow: none; }
.wpcs-input:focus, .wpcs-select:focus, .wpcs-textarea:focus { outline: none; border-color: var(--wpcs-primary); box-shadow: none; }
.wpcs-textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.wpcs-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23646970' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.wpcs-form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 8px; }

/* ---- Select2 Custom Styling ---- */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single { height: 42px; border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); background: #fff; display: flex; align-items: center; transition: border-color .15s; outline: none; box-shadow: none; }
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--wpcs-primary); box-shadow: none; outline: none; }
.select2-container--default .select2-selection--single .select2-selection__rendered { font-size: 14px; color: var(--wpcs-text); line-height: 40px; padding-left: 14px; padding-right: 36px; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--wpcs-text-muted); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; right: 10px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: #646970 transparent transparent transparent; border-width: 5px 4px 0 4px; }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #646970 transparent; border-width: 0 4px 5px 4px; }
.select2-dropdown { border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); box-shadow: 0 6px 20px rgba(0,0,0,.08); font-family: inherit; z-index: 99999; }
.select2-container--default .select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); padding: 8px 12px; font-size: 13.5px; outline: none; transition: border-color .15s; width: 100%; box-sizing: border-box; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--wpcs-primary); box-shadow: none; }
.select2-results__option { padding: 8px 14px; font-size: 13.5px; color: var(--wpcs-text); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--wpcs-primary); color: #fff; }
.select2-container--default .select2-results__option[aria-selected=true] { background-color: #f0f7ff; color: var(--wpcs-primary); font-weight: 600; }

/* ---- Type Selector ---- */
.wpcs-type-selector { display: flex; gap: 10px; }
.wpcs-type-opt { flex: 1; cursor: pointer; }
.wpcs-type-opt input[type="radio"] { display: none; }
.wpcs-type-opt-body { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--wpcs-border); border-radius: var(--wpcs-radius); transition: border-color .15s, background .15s; }
.wpcs-type-opt input:checked + .wpcs-type-opt-body { border-color: var(--wpcs-primary); background: #f0f7ff; }
.wpcs-type-opt-body:hover { border-color: #b0c4d8; }
.wpcs-type-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.wpcs-type-opt-body strong { display: block; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.wpcs-type-opt-body p { font-size: 12px; color: var(--wpcs-text-muted); margin: 0; line-height: 1.4; }
.wpcs-public-warning { display: none; margin-top: 12px; background: #fff8e7; border: 1px solid #f0d000; border-left: 4px solid #dba617; border-radius: var(--wpcs-radius); padding: 12px 16px; font-size: 13px; line-height: 1.5; color: #6a4b00; align-items: flex-start; gap: 10px; animation: wpcsFadeIn .2s ease; }
.wpcs-public-warning.is-visible { display: flex; }
.wpcs-warning-icon { font-size: 16px; flex-shrink: 0; line-height: 1.2; }
.wpcs-warning-text strong { color: #1d2327; display: inline; margin-right: 4px; }
@keyframes wpcsFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Ticket Card (single view header - Flat) ---- */
.wpcs-ticket-card { background: var(--wpcs-card); border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); padding: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; box-shadow: none; }
.wpcs-ticket-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.wpcs-ticket-id { font-size: 11px; font-weight: 700; color: var(--wpcs-primary); background: #e8f4ff; height: 22px; padding: 0 8px; border-radius: var(--wpcs-radius); font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: .5px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; margin: 0; }
.wpcs-ticket-title { font-size: 20px; font-weight: 700; margin: 12px 0; line-height: 1.3; }
.wpcs-ticket-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wpcs-meta-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--wpcs-text-muted); background: var(--wpcs-bg); padding: 0 8px; height: 22px; border-radius: var(--wpcs-radius); line-height: 1; }

/* ---- Thread / Conversation (Flat) ---- */
.wpcs-thread { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.wpcs-message { display: flex; gap: 14px; background: var(--wpcs-card); border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); padding: 20px; border-left-width: 4px; box-shadow: none; }
.wpcs-msg-original { border-left-color: var(--wpcs-success); }
.wpcs-msg-staff { border-left-color: var(--wpcs-primary); }
.wpcs-msg-customer { border-left-color: var(--wpcs-border); }
.wpcs-avatar { border-radius: 50%; display: block; width: 46px; height: 46px; }
.wpcs-message-avatar { flex-shrink: 0; width: 46px; display: flex; flex-direction: column; align-items: center; }
.wpcs-message-body { flex: 1; min-width: 0; }
.wpcs-message-header { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.wpcs-msg-author { font-weight: 600; font-size: 14px; color: var(--wpcs-text); display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wpcs-msg-action-text { font-size: 14px; font-weight: 400; color: var(--wpcs-text-muted); margin-left: 2px; }
.wpcs-msg-date { font-size: 12px; color: var(--wpcs-text-muted); font-weight: 400; }
.wpcs-msg-role { display: flex; align-items: center; justify-content: center; width: 46px; height: 20px; box-sizing: border-box; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; border-radius: var(--wpcs-radius); margin-top: 6px; line-height: 1; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.wpcs-role-staff { color: var(--wpcs-primary); background: #e8f4ff; }
.wpcs-message-content { font-size: 14px; line-height: 1.75; color: var(--wpcs-text); }
.wpcs-message-content p { margin: 0 0 10px; }
.wpcs-message-content p:last-child { margin-bottom: 0; }
.wpcs-message-content code.wpcs-inline-code { background: #f0f0f1; color: #d63638; padding: 2px 6px; border-radius: var(--wpcs-radius); font-size: 13px; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.wpcs-message-content pre.wpcs-code-block { background: #1e1e2e; color: #cdd6f4; padding: 14px 18px; border-radius: var(--wpcs-radius); font-size: 13px; line-height: 1.6; overflow-x: auto; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; margin: 12px 0; border: 1px solid #313244; }
.wpcs-message-content pre.wpcs-code-block code { background: transparent; color: inherit; padding: 0; font-size: inherit; font-family: inherit; }
.wpcs-message-content blockquote, .wpcs-message-content blockquote.wpcs-blockquote { margin: 12px 0; padding: 8px 16px; border-left: 4px solid var(--wpcs-primary); background: #f6f7f7; border-radius: 0 var(--wpcs-radius) var(--wpcs-radius) 0; color: #50575e; font-style: italic; }
.wpcs-message-content blockquote p, .wpcs-message-content blockquote.wpcs-blockquote p { margin: 0 0 6px; }
.wpcs-message-content blockquote p:last-child, .wpcs-message-content blockquote.wpcs-blockquote p:last-child { margin-bottom: 0; }
.wpcs-message-content ul, .wpcs-msg-content ul { margin: 10px 0; padding-left: 24px; list-style-type: disc; }
.wpcs-message-content ol, .wpcs-msg-content ol { margin: 10px 0; padding-left: 24px; list-style-type: decimal; }
.wpcs-message-content ul li, .wpcs-msg-content ul li { margin-bottom: 4px; list-style-type: disc; }
.wpcs-message-content ol li, .wpcs-msg-content ol li { margin-bottom: 4px; list-style-type: decimal; }
.wpcs-message-content a { color: var(--wpcs-primary); text-decoration: none; }
.wpcs-message-content a:hover { color: var(--wpcs-primary-hover); text-decoration: none; }
.wpcs-message-content img { max-width: 100%; height: auto; border-radius: var(--wpcs-radius); margin: 8px 0; display: inline-block; vertical-align: middle; border: 1px solid var(--wpcs-border); }
.wpcs-message-content pre.ql-syntax, .wpcs-message-content pre.wpcs-code-block { background: #1e1e2e; color: #cdd6f4; padding: 14px 18px; border-radius: var(--wpcs-radius); font-size: 13px; line-height: 1.6; overflow-x: auto; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; margin: 12px 0; border: 1px solid #313244; }
.wpcs-message-content pre.ql-syntax code, .wpcs-message-content pre.wpcs-code-block code { background: transparent; color: inherit; padding: 0; font-size: inherit; font-family: inherit; }

/* ---- Visual Editor (Quill - Flat) ---- */
.wpcs-quill-wrap { background: #fff; border-radius: var(--wpcs-radius); margin-bottom: 4px; }
.wpcs-quill-wrap .ql-toolbar.ql-snow { border: 1px solid var(--wpcs-border); border-top-left-radius: var(--wpcs-radius); border-top-right-radius: var(--wpcs-radius); background: #f8f9fa; padding: 8px; font-family: inherit; }
.wpcs-quill-wrap .ql-container.ql-snow { border: 1px solid var(--wpcs-border); border-top: none; border-bottom-left-radius: var(--wpcs-radius); border-bottom-right-radius: var(--wpcs-radius); font-family: inherit; font-size: 14px; min-height: 150px; background: #fff; }
.wpcs-quill-wrap .ql-editor { min-height: 150px; font-size: 14px; line-height: 1.7; color: var(--wpcs-text); font-family: inherit; }
.wpcs-quill-wrap .ql-editor p { margin: 0 0 12px 0; padding: 0; }
.wpcs-quill-wrap .ql-editor p:last-child { margin-bottom: 0; }
.wpcs-message-content p { margin: 0 0 12px 0; }
.wpcs-message-content p:last-child { margin-bottom: 0; }
.wpcs-quill-wrap .ql-editor img { max-width: 100%; height: auto; border-radius: var(--wpcs-radius); margin: 6px 0; display: inline-block; vertical-align: middle; }
.wpcs-quill-wrap .ql-editor.ql-blank::before { font-style: normal; color: var(--wpcs-text-muted); font-family: inherit; left: 15px; }
.wpcs-quill-wrap:focus-within .ql-toolbar.ql-snow, .wpcs-quill-wrap:focus-within .ql-container.ql-snow { border-color: var(--wpcs-primary); }
.wpcs-editor-target { display: none; }
.wpcs-btn.is-loading .wpcs-btn-text { display: none; }
.wpcs-btn.is-loading .wpcs-btn-loading { display: inline-flex; }
.wpcs-fade-out { opacity: 0; max-height: 0; overflow: hidden; transition: opacity .4s, max-height .4s; }

/* ---- Form Footer (Attachments left, Actions right) ---- */
.wpcs-form-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.wpcs-form-footer-left { flex: 1; min-width: 260px; }
.wpcs-form-footer-left .wpcs-attachment-uploader { margin-top: 0; margin-bottom: 0; }
.wpcs-form-footer-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-shrink: 0; padding-top: 2px; }

/* ---- Attachment Uploader & Thumbnails (Flat) ---- */
.wpcs-dropzone { height: 40px; box-sizing: border-box; border: 1.5px dashed var(--wpcs-border); border-radius: var(--wpcs-radius); padding: 0 14px; text-align: left; background: #fbfcfd; transition: border-color .15s, background .15s; cursor: pointer; display: inline-flex; align-items: center; }
.wpcs-dropzone:hover, .wpcs-dropzone.is-dragover { border-color: var(--wpcs-primary); background: #f0f7ff; }
.wpcs-file-input { display: none; }
.wpcs-dropzone-label { cursor: pointer; display: flex; align-items: center; gap: 8px; margin: 0; }
.wpcs-upload-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.wpcs-upload-text { font-size: 13px; color: var(--wpcs-text); line-height: 1.3; }
.wpcs-upload-text strong { display: inline; font-size: 13px; font-weight: 600; color: var(--wpcs-text); }
.wpcs-upload-hint { font-size: 11px; color: var(--wpcs-text-muted); display: inline; margin-left: 6px; }
.wpcs-attachment-thumbnails { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.wpcs-thumb-card { position: relative; width: 76px; display: inline-flex; flex-direction: column; }
.wpcs-thumb-preview { position: relative; width: 76px; height: 58px; border-radius: var(--wpcs-radius); border: 1px solid var(--wpcs-border); overflow: hidden; background: #fff; box-shadow: none; }
.wpcs-thumb-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wpcs-thumb-remove { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.65); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: background .12s; z-index: 2; }
.wpcs-thumb-remove:hover { background: var(--wpcs-danger); }
.wpcs-thumb-card.is-uploading .wpcs-thumb-preview::after { content: "⏳"; position: absolute; inset: 0; background: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; font-size: 16px; z-index: 1; }
.wpcs-thumb-name { font-size: 11px; color: var(--wpcs-text-muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 76px; text-align: center; line-height: 1.3; }

/* ---- Attached Images Gallery (Flat) ---- */
.wpcs-attached-gallery { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--wpcs-border); }
.wpcs-gallery-label { font-size: 12px; font-weight: 700; color: var(--wpcs-text-muted); margin-bottom: 10px; }
.wpcs-gallery-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.wpcs-gallery-item { display: inline-flex; flex-direction: column; align-items: center; padding: 6px; background: var(--wpcs-bg); border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); text-decoration: none; transition: border-color .15s; max-width: 140px; box-shadow: none; }
.wpcs-gallery-item:hover { border-color: var(--wpcs-primary); text-decoration: none; box-shadow: none; }
.wpcs-gallery-thumb { width: 124px; height: 90px; object-fit: cover; border-radius: var(--wpcs-radius); display: block; }
.wpcs-gallery-name { font-size: 11px; color: var(--wpcs-text-muted); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 124px; text-align: center; }

/* ---- Reply Box (Flat) ---- */
.wpcs-reply-box { background: var(--wpcs-card); border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); padding: 28px; box-shadow: none; }
.wpcs-reply-title { font-size: 16px; font-weight: 700; margin: 0 0 16px; }
.wpcs-reply-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.wpcs-msg-link { font-size: 12px; color: var(--wpcs-text-muted); text-decoration: none; transition: color .15s; }
.wpcs-msg-link:hover { color: var(--wpcs-primary); text-decoration: none; }
.wpcs-guest-reply-prompt { text-align: center; padding: 24px 16px; background: #f8fafc; border: 1px dashed var(--wpcs-border); border-radius: var(--wpcs-radius); }
.wpcs-guest-reply-prompt p { font-size: 14px; color: var(--wpcs-text-muted); margin: 0 0 14px; }

/* ---- Closed Notice ---- */
.wpcs-closed-notice { background: var(--wpcs-bg); border: 1px solid var(--wpcs-border); border-radius: var(--wpcs-radius); padding: 24px; text-align: center; }
.wpcs-closed-notice p { color: var(--wpcs-text-muted); font-size: 14px; margin: 0 0 16px; }
.wpcs-close-form { flex-shrink: 0; }

/* ---- Pagination (Flat) ---- */
.wpcs-pagination { display: flex; gap: 4px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.wpcs-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--wpcs-radius); font-size: 13px; font-weight: 600; text-decoration: none; color: var(--wpcs-text-muted); background: var(--wpcs-card); border: 1px solid var(--wpcs-border); transition: background .12s, color .12s; box-shadow: none; }
.wpcs-pagination .page-numbers:hover { background: var(--wpcs-bg); color: var(--wpcs-primary); text-decoration: none; }
.wpcs-pagination .current { background: var(--wpcs-primary); color: #fff; border-color: var(--wpcs-primary); }
.wpcs-pagination .prev, .wpcs-pagination .next { width: auto; padding: 0 12px; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .wpcs-tabs-bar { flex-direction: column; align-items: stretch; gap: 12px; }
    .wpcs-search-form { margin-bottom: 0; }
    .wpcs-search-input { width: 100%; }
    .wpcs-search-input:focus { width: 100%; }
    .wpcs-form-row-2 { grid-template-columns: 1fr; }
    .wpcs-type-selector { flex-direction: column; }
    .wpcs-ticket-row { padding: 12px 14px; gap: 10px; }
    .wpcs-ticket-title-text { font-size: 14px; }
    .wpcs-ticket-row-meta { gap: 6px; font-size: 11px; }
    .wpcs-ticket-card { flex-direction: column; }
    .wpcs-message { flex-direction: column; }
    .wpcs-form-footer { flex-direction: column; align-items: stretch; gap: 14px; }
    .wpcs-form-footer-right { justify-content: flex-end; width: 100%; }
    .wpcs-page-header { flex-direction: column; }
}

.ql-toolbar .ql-html-code { width: 28px; height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.ql-toolbar .ql-html-code svg { width: 16px; height: 16px; stroke: #444; stroke-width: 2; transition: stroke .15s; }
.ql-toolbar .ql-html-code:hover svg { stroke: var(--wpcs-primary); }

/* ---- Code Block Modal & Editor Pre with Zebra Stripes ---- */
.wpcs-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; }
.wpcs-modal-backdrop { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .5); }
.wpcs-modal-dialog { position: relative; background: #fff; border-radius: 6px; width: 90%; max-width: 540px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); z-index: 1; overflow: hidden; }
.wpcs-code-modal-dialog { max-width: 680px; }
.wpcs-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #dcdcde; }
.wpcs-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: #1d2327; }
.wpcs-modal-close { background: none; border: none; font-size: 22px; color: #8c8f94; cursor: pointer; padding: 0; line-height: 1; }
.wpcs-modal-close:hover { color: #d63638; }
.wpcs-modal-body { padding: 20px; }
.wpcs-code-modal-textarea-wrap { width: 100%; }
.wpcs-code-modal-textarea {
    width: 100%;
    height: 320px;
    border-radius: 6px;
    padding: 12px 16px;
    font-family: Consolas, Menlo, Monaco, "Courier New", monospace;
    font-size: 13px;
    line-height: 24px;
    border: 1px solid #3e4451;
    resize: vertical;
    box-sizing: border-box;
    color: #abb2bf;
    background-color: #21252b;
    background-image: repeating-linear-gradient(
        to bottom,
        #282c34 0px,
        #282c34 24px,
        #21252b 24px,
        #21252b 48px
    );
    background-origin: content-box;
    background-attachment: local;
    tab-size: 4;
}
.wpcs-code-modal-hint { margin-top: 8px; margin-bottom: 0; font-size: 12px; color: #646970; }
.wpcs-code-modal-hint p { margin: 0 0 4px 0; }
.wpcs-code-modal-hint p:last-child { margin-bottom: 0; }
.wpcs-code-modal-hint kbd { background: #f0f0f1; border: 1px solid #dcdcde; border-radius: 3px; padding: 1px 5px; font-size: 11px; font-family: inherit; color: #1d2327; }
.wpcs-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; background: #f6f7f7; border-top: 1px solid #dcdcde; }

/* ---- Code Blocks in Editor & Formatted Content ---- */
.ql-snow .ql-editor pre.ql-syntax,
.ql-editor pre,
.ql-editor .ql-syntax,
.wpcs-content pre,
.wpcs-message-content pre,
.wpcs-ticket-body pre,
.wpcs-msg-content pre {
    background-color: #21252b !important;
    background-image: repeating-linear-gradient(
        to bottom,
        #282c34 0px,
        #282c34 24px,
        #21252b 24px,
        #21252b 48px
    ) !important;
    background-origin: content-box !important;
    color: #abb2bf !important;
    line-height: 24px !important;
    font-size: 13px !important;
    font-family: Consolas, Menlo, Monaco, "Courier New", monospace !important;
    padding: 12px 16px !important;
    border-radius: 6px !important;
    border: 1px solid #353b45 !important;
    margin: 14px 0 !important;
    overflow-x: auto !important;
}

.ql-editor pre,
.ql-editor .ql-syntax {
    cursor: pointer !important;
    position: relative;
    user-select: none;
    transition: outline-color .15s;
}
.ql-editor pre:hover,
.ql-editor .ql-syntax:hover {
    outline: 2px solid #2271b1;
}
.ql-editor pre::after,
.ql-editor .ql-syntax::after {
    content: "✎ Double-click to edit";
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 11px;
    color: #abb2bf;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-style: normal;
    font-weight: normal;
}
.ql-editor pre:hover::after,
.ql-editor .ql-syntax:hover::after {
    opacity: 1;
}

/* ---- Code Wrap & Copy Button ---- */
.wpcs-code-wrap {
    position: relative;
    margin: 14px 0;
}
.wpcs-code-wrap pre,
.wpcs-code-wrap .ql-syntax {
    margin: 0 !important;
}
.wpcs-code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.1);
    color: #abb2bf;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.65;
    transition: opacity .15s, background .15s, color .15s, border-color .15s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    outline: none;
    box-shadow: none;
}
.wpcs-code-wrap:hover .wpcs-code-copy-btn {
    opacity: 1;
}
.wpcs-code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
}
.wpcs-code-copy-btn.is-copied {
    background: #238636 !important;
    color: #ffffff !important;
    border-color: #2ea043 !important;
    opacity: 1 !important;
}
.wpcs-copy-icon {
    font-size: 11px;
    line-height: 1;
}

/* ---- Inline Editor Validation Errors ---- */
.wpcs-quill-wrap.wpcs-input-error .ql-toolbar,
.wpcs-quill-wrap.wpcs-input-error .ql-container {
    border-color: #d63638 !important;
}
.wpcs-editor-error-banner {
    margin-bottom: 12px !important;
    animation: wpcsShake 0.35s ease;
}
@keyframes wpcsShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ---- Like Button & Avatars System ---- */
.wpcs-likes-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
}
.wpcs-likes-left {
    display: flex;
    align-items: center;
}
.wpcs-likes-users-wrap {
    display: flex;
    align-items: center;
}
.wpcs-like-avatars-stack {
    display: inline-flex;
    align-items: center;
    flex-direction: row-reverse;
}
.wpcs-like-avatar-wrap {
    display: inline-block;
    margin-left: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    overflow: hidden;
    line-height: 0;
    transition: transform 0.15s ease, z-index 0.15s ease;
    position: relative;
    background: #ffffff;
}
.wpcs-like-avatar-wrap:hover {
    transform: scale(1.18);
    z-index: 10 !important;
}
.wpcs-like-avatar-wrap img,
.wpcs-like-avatar-wrap .avatar {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    border: 0 !important;
}
.wpcs-like-more-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    padding: 0 6px;
    height: 22px;
    border-radius: 11px;
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}
.wpcs-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.3;
    transition: all 0.15s ease;
    text-decoration: none !important;
    vertical-align: middle;
}
.wpcs-like-btn:hover:not(:disabled) {
    background: #f3f4f6;
    color: #3858e9;
    border-color: #3858e9;
}
.wpcs-like-btn.is-liked {
    background: #eff6ff;
    color: #3858e9;
    border-color: #3858e9;
}
.wpcs-like-btn.is-liked .wpcs-like-icon {
    fill: #3858e9;
    stroke: #3858e9;
}
.wpcs-like-btn:disabled, .wpcs-like-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
}
.wpcs-like-count {
    font-size: 11px;
    font-weight: 600;
}

.wpcs-attached-gallery .wpcs-gallery-item img {
    background-color: #ffffff;
    margin: 0;
}

/* ---- LightGallery Custom Overrides ---- */
.lg-outer .lg-thumb {
    width: 100% !important;
}
.lg-outer .lg-thumb-item {
    float: none !important;
    height: 80px !important;
    width: auto !important;
    margin-bottom: 0 !important;
}
.lg-outer .lg-thumb-item img {
    height: 100% !important;
    width: auto !important;
}
