/* ── Detail Panel ── */
.placeholder-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-muted);
    font-size: 15px;
}

#ticket-detail {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.detail-ticket-id {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}
.detail-header h2 {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ── Customer Profile ── */
.customer-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    cursor: pointer;
    transition: background var(--transition);
}

.customer-profile:hover {
    background: var(--color-primary-light);
}

.customer-avatar {
    font-size: 20px;
    line-height: 1;
}

/* Related tickets */
.related-tickets {
    margin: 0 0 12px;
    max-height: 200px;
    overflow-y: auto;
}
.related-tickets:empty { display: none; }
.related-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 6px 0 4px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 4px;
}
.related-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}
.related-item:hover { background: var(--color-muted); }
.related-id { color: var(--color-primary); font-weight: 600; min-width: 60px; }
.related-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}
.related-status.badge-new { background: #DBEAFE; color: #1D4ED8; }
.related-status.badge-open { background: var(--color-warning-light); color: var(--color-warning-text); }
.related-status.badge-pending { background: #E0E7FF; color: #4338CA; }
.related-status.badge-solved { background: var(--color-success-light); color: #065F46; }
.related-status.badge-closed { background: var(--color-muted); color: #6B7280; }
.related-subject { flex: 1; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-date { color: var(--color-text-subtle); font-size: 11px; flex: none; }

/* Merge */
.btn-merge-select {
    float: right;
    font-size: 11px;
    padding: 2px 8px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all 0.2s;
}
.btn-merge-select:hover, .btn-merge-select.active {
    background: #4F46E5;
    color: #fff;
    border-color: #4F46E5;
}
.merge-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: var(--color-warning-light);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}
.merge-info { color: var(--color-cta-text); }
.merge-manual-input { display: flex; gap: 4px; align-items: center; }
.merge-id-input {
    flex: 1; padding: 4px 8px; border: 1px solid var(--color-cta-hover); border-radius: 4px;
    font-size: 12px; background: #fff; outline: none;
}
.merge-id-input:focus { border-color: var(--color-warning-text); box-shadow: 0 0 0 2px rgba(217,119,6,0.15); }
.merge-id-input::placeholder { color: var(--color-cta-hover); opacity: 0.6; }
.merge-manual-list { display: flex; flex-wrap: wrap; gap: 4px; }
.merge-manual-tag {
    display: inline-flex; align-items: center; gap: 2px;
    background: #FDE68A; color: var(--color-cta-text); padding: 2px 6px; border-radius: 4px;
    font-size: 11px; font-weight: 600;
}
.merge-manual-remove {
    background: none; border: none; color: var(--color-warning-text); cursor: pointer;
    font-size: 13px; padding: 0 2px; line-height: 1;
}
.merge-manual-remove:hover { color: #DC2626; }
.merge-actions { display: flex; gap: 6px; }
.merge-check { width: 16px; height: 16px; cursor: pointer; flex: none; margin-right: -4px; }
.btn-danger { background: #DC2626; color: #fff; border: none; border-radius: 6px; font-size: 11px; cursor: pointer; padding: 4px 10px; }
.btn-danger:hover { background: var(--color-danger-text); }

.customer-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.customer-name {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.customer-email {
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ── Platform Language Dropdown (in customer profile card) ── */
.customer-platform-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.platform-lang-label {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.platform-lang-select {
    font-family: var(--font-heading);
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #fff;
    color: var(--color-text);
    cursor: pointer;
    min-width: 48px;
}

.platform-lang-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.platform-lang-status {
    font-size: 12px;
    min-width: 14px;
    text-align: center;
}

.platform-lang-status.saved {
    color: var(--color-success);
    font-weight: 600;
}

.platform-lang-status.error {
    color: var(--color-danger);
    font-weight: 600;
}

.platform-lang-status.saving {
    color: var(--color-text-muted);
}

/* ── Market Filter Tab Group ── */
.filter-market-group {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.filter-market-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 4px;
}

.filter-tab {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #fff;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.3;
    white-space: nowrap;
}

.filter-tab:hover {
    background: var(--color-muted);
}

.filter-tab.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    font-weight: 600;
}

/* ── Profile Modal ── */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-modal {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    position: relative;
}

.profile-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.profile-modal-close:hover {
    color: var(--color-text);
}

.profile-modal-title {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-row td {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.profile-row:last-child td {
    border-bottom: none;
}

.profile-label {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--color-text-muted);
    width: 100px;
    white-space: nowrap;
}

.profile-value {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.profile-value.profile-mono {
    font-family: var(--font-heading);
}

.profile-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    margin-left: 6px;
    border-radius: 4px;
    vertical-align: middle;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.profile-copy-btn:hover {
    opacity: 1;
    background: var(--color-bg);
}

.profile-vip-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.profile-vip-badge.vip {
    background: var(--color-warning-light);
    color: var(--color-cta-text);
    border: 1px solid var(--color-cta);
}

.profile-vip-badge.normal {
    background: var(--color-muted);
    color: #64748B;
    border: 1px solid var(--color-border);
}

.profile-vip-badge.state {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid var(--color-secondary);
}

.profile-admin-link {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.profile-admin-link:hover {
    text-decoration: underline;
}

.profile-admin-link.disabled {
    color: var(--color-text-subtle);
    font-weight: 400;
}

.detail-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.detail-actions-bar select {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    transition: border-color var(--transition);
}

.detail-actions-bar select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ── Conversation ── */
.conversation {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.comment {
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.6;
}

.comment-customer {
    background: var(--color-primary-light);
    border-left: 3px solid var(--color-info);
}

.comment-agent {
    background: #F0FDF4;
    border-left: 3px solid var(--color-success);
}

.comment-internal {
    background: #FFFBEB;
    border-left: 3px solid var(--color-warning);
    font-style: italic;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 700;
    font-family: var(--font-body);
}

.comment-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    margin-top: 4px;
}

/* ── Quality Score 6-dimension ── */
.quality-breakdown {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding: 4px 0;
}

.quality-dim {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
}

.dim-label {
    font-family: var(--font-body);
    font-size: 10px;
    color: var(--color-text-muted);
}

.dim-value {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
}

/* ── Quality Evaluation Card ── */
.quality-eval-card {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 8px;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.eval-card-left {
    flex: 0 0 auto;
    text-align: center;
    min-width: 60px;
}

.eval-overall-score {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.eval-overall-label {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.eval-card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.eval-dim-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eval-dim-label {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--color-text-muted);
    min-width: 60px;
    flex-shrink: 0;
}

.eval-dim-bar {
    flex: 1;
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.eval-dim-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.eval-dim-value {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    min-width: 32px;
    text-align: right;
}

/* ── Compose Section ── */
/* ── Conversation Tabs (Replies / Internal Notes) ── */
.conv-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 0;
}
.conv-tab {
    flex: 1;
    padding: 7px 10px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.conv-tab:hover {
    color: var(--color-text);
    background: var(--color-bg-hover);
}
.conv-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.conv-tab[data-conv="notes"].active {
    color: var(--color-cta-hover);
    border-bottom-color: var(--color-cta-hover);
}
.conv-tab-count {
    font-size: 10px;
    background: var(--color-border);
    color: #6B7280;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 3px;
}
.conv-tab.active .conv-tab-count {
    background: var(--color-primary);
    color: #fff;
}
.conv-tab[data-conv="notes"].active .conv-tab-count {
    background: var(--color-cta-hover);
    color: #fff;
}

.compose-section {
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
}

/* ── Compose Mode Tabs (Reply / Internal Note) ── */
.compose-mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}
.compose-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.compose-tab:hover {
    color: var(--color-text);
    background: var(--color-bg-hover);
}
.compose-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.compose-tab[data-mode="note"].active {
    color: var(--color-cta-hover);
    border-bottom-color: var(--color-cta-hover);
}

/* ── Note Mode ── */
.note-mode-banner {
    background: #FFFBEB;
    border: 1px solid var(--color-cta);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-cta-text);
    margin-bottom: 8px;
}
.note-editable {
    min-height: 80px;
    border-color: var(--color-cta) !important;
}
.note-editable:focus {
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2) !important;
    border-color: var(--color-cta-hover) !important;
}
.btn-note-send {
    border-color: var(--color-cta-hover) !important;
    color: var(--color-cta-text) !important;
}
.btn-note-send:hover {
    background: #FFFBEB !important;
}

.compose-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

/* ── Compose Toolbar ── */
.compose-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 26px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text-muted);
    transition: all var(--transition);
}

.toolbar-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
    border-color: var(--color-border);
}

.toolbar-sep {
    width: 1px;
    height: 18px;
    background: var(--color-border);
    margin: 0 4px;
}

.toolbar-highlight-group {
    position: relative;
}

.toolbar-highlight-icon {
    font-size: 14px;
    background: linear-gradient(135deg, #FEF08A 25%, #BBF7D0 50%, #BFDBFE 75%, #FECACA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.toolbar-highlight-palette {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    padding: 4px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    gap: 4px;
    flex-direction: row;
    margin-top: 2px;
}

.toolbar-highlight-palette.open {
    display: flex;
}

.toolbar-color {
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.1s;
}

.toolbar-color:hover {
    transform: scale(1.15);
    border-color: var(--color-text-muted);
}

.toolbar-color[data-color="#FEF08A"] { background: #FEF08A; }
.toolbar-color[data-color="#BBF7D0"] { background: #BBF7D0; }
.toolbar-color[data-color="#BFDBFE"] { background: #BFDBFE; }
.toolbar-color[data-color="#FECACA"] { background: #FECACA; }

.toolbar-color-none {
    background: #fff;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Compose Editable (contenteditable div replacing textarea) ── */
#compose-text {
    width: 100%;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
    box-sizing: border-box;
    transition: border-color var(--transition);
    white-space: pre-wrap;
    word-wrap: break-word;
}

#compose-text:empty::before {
    content: attr(data-placeholder);
    color: var(--color-text-subtle);
    pointer-events: none;
}

#compose-text:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30,64,175,0.06);
}

.quality-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s, background 0.3s;
}

.draft-sections {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ref-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.ref-manual { background: var(--color-primary-light); border: 1px solid #BFDBFE; }
.ref-cases  { background: #FFF7ED; border: 1px solid #FED7AA; }
.ref-icon   { font-size: 15px; flex-shrink: 0; }
.ref-label  {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    min-width: 72px;
}

.badge-manual {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    background: #DBEAFE;
    color: var(--color-primary);
}

.badge-case {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    background: #FFEDD5;
    color: #C2410C;
    font-family: var(--font-heading);
}

.compose-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 0 0;
    border-top: 1px solid var(--color-border);
}

.compose-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.compose-actions-primary {
    flex-wrap: wrap;
}

.compose-actions-primary .btn-danger-outline {
    font-size: 11px;
    padding: 5px 8px;
    margin-left: auto;
}

.compose-actions-primary .btn-danger-outline ~ .btn-danger-outline {
    margin-left: 0;
}

.compose-actions-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.compose-actions-divider {
    width: 1px;
    height: 24px;
    background: var(--color-border);
    flex-shrink: 0;
}


/* ── Generic Followup Panel (VIP, Login, Fraud) ── */
.followup-panel {
    background: var(--color-bg);
    border: 2px solid var(--color-text-subtle);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.followup-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.followup-icon { font-size: 18px; }
.followup-desc {
    font-size: 12.5px;
    color: #64748B;
    margin-bottom: 12px;
    line-height: 1.5;
}
.followup-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.followup-confirm-btn {
    width: 100%;
}

/* Fraud panel (3.7) — red theme */
.followup-panel-fraud {
    background: #FEF2F2;
    border-color: var(--color-danger);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
    animation: fraudPanelPulse 2s ease-in-out;
}
@keyframes fraudPanelPulse {
    0% { border-color: var(--color-danger); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15); }
    50% { border-color: #DC2626; box-shadow: 0 2px 16px rgba(239, 68, 68, 0.35); }
    100% { border-color: var(--color-danger); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15); }
}
.followup-panel-fraud .followup-header { color: #991B1B; }

/* VIP panel — purple theme */
.followup-panel-vip {
    background: var(--color-bg);
    border-color: #A855F7;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
}
.followup-panel-vip .followup-header { color: #6B21A8; }

/* ── Admin Lookup in Profile Modal ── */
.profile-lookup-btn { margin-left: 8px; font-size: 11px; padding: 2px 10px; }
.admin-lookup-section { margin-top: 14px; border-top: 1px solid var(--color-border); padding-top: 10px; }
.admin-lookup-title { font-size: 13px; font-weight: 700; color: var(--color-text); margin-bottom: 8px; }
.admin-lookup-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.admin-lookup-table td { padding: 4px 8px; border-bottom: 1px solid var(--color-muted); }
.admin-lookup-table td:first-child { color: #64748B; width: 100px; white-space: nowrap; }
.admin-lookup-data-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.admin-lookup-data-table th { background: var(--color-bg); padding: 4px 6px; font-weight: 600; color: var(--color-text-muted); border-bottom: 2px solid var(--color-border); text-align: left; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.admin-lookup-data-table td { padding: 3px 6px; border-bottom: 1px solid var(--color-muted); white-space: nowrap; }
.admin-lookup-scroll {
    max-height: 240px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
/* Always-visible scrollbar styling */
.admin-lookup-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.admin-lookup-scroll::-webkit-scrollbar-track { background: var(--color-muted); border-radius: 4px; }
.admin-lookup-scroll::-webkit-scrollbar-thumb { background: var(--color-text-subtle); border-radius: 4px; min-height: 32px; }
.admin-lookup-scroll::-webkit-scrollbar-thumb:hover { background: #64748B; }
/* Firefox */
.admin-lookup-scroll { scrollbar-width: thin; scrollbar-color: var(--color-text-subtle) var(--color-muted); }

/* Admin lookup result container — scrollable on small screens */
#admin-lookup-result {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
}
#admin-lookup-result::-webkit-scrollbar { width: 8px; }
#admin-lookup-result::-webkit-scrollbar-track { background: var(--color-muted); border-radius: 4px; }
#admin-lookup-result::-webkit-scrollbar-thumb { background: var(--color-text-subtle); border-radius: 4px; }
#admin-lookup-result::-webkit-scrollbar-thumb:hover { background: #64748B; }
#admin-lookup-result { scrollbar-width: thin; scrollbar-color: var(--color-text-subtle) var(--color-muted); }

/* Profile modal — scrollable on low-res */
.profile-modal {
    max-height: 85vh;
    overflow-y: auto;
}
.profile-modal::-webkit-scrollbar { width: 8px; }
.profile-modal::-webkit-scrollbar-track { background: var(--color-muted); border-radius: 4px; }
.profile-modal::-webkit-scrollbar-thumb { background: var(--color-text-subtle); border-radius: 4px; }
.profile-modal { scrollbar-width: thin; scrollbar-color: var(--color-text-subtle) var(--color-muted); }

@media (max-width: 1024px) {
    .admin-lookup-scroll { max-height: 180px; }
    #admin-lookup-result { max-height: 350px; }
    .admin-lookup-data-table { font-size: 10px; }
    .admin-lookup-data-table th, .admin-lookup-data-table td { padding: 2px 4px; }
}
@media (max-width: 600px) {
    .admin-lookup-scroll { max-height: 160px; }
    #admin-lookup-result { max-height: 300px; }
    .admin-lookup-data-table { font-size: 9px; }
    .admin-lookup-data-table th, .admin-lookup-data-table td { padding: 2px 3px; }
    .admin-lookup-title { font-size: 12px; }
}

.admin-lookup-empty { color: var(--color-text-subtle); font-size: 12px; text-align: center; padding: 12px; }
.admin-cache-tag { font-size: 10px; background: var(--color-border); color: #64748B; padding: 1px 6px; border-radius: 8px; font-weight: 500; vertical-align: middle; }
.badge-vip { background: var(--color-purple); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.badge-muted { background: var(--color-border); color: #64748B; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* ── PG Refund Button & Modal ── */
.btn-refund-pg { font-size: 10px; padding: 2px 8px; background: #DC2626; color: #fff; border: none; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.btn-refund-pg:hover { background: var(--color-danger-text); }
.btn-refund-pg.btn-refunded { background: var(--color-text-subtle); cursor: default; }
.refund-confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000; display: flex; align-items: center; justify-content: center; }
.refund-confirm-box { background: #fff; border-radius: 12px; padding: 24px; max-width: 440px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.refund-confirm-box h4 { margin: 0 0 16px; font-size: 16px; color: var(--color-text); }
.refund-confirm-info { width: 100%; font-size: 13px; border-collapse: collapse; margin-bottom: 12px; }
.refund-confirm-info td { padding: 6px 8px; border-bottom: 1px solid var(--color-muted); }
.refund-confirm-info td:first-child { color: #64748B; width: 80px; }
.refund-confirm-info code { background: var(--color-muted); padding: 2px 6px; border-radius: 3px; font-size: 11px; }
.refund-confirm-info .input-sm { padding: 4px 8px; border: 1px solid var(--color-border-strong); border-radius: 4px; font-size: 12px; }
.refund-confirm-warning { background: var(--color-warning-light); border: 1px solid var(--color-cta); border-radius: 6px; padding: 8px 12px; font-size: 12px; color: var(--color-cta-text); margin-bottom: 14px; }
.refund-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.refund-result-success { margin-top: 12px; background: #F0FDF4; border: 1px solid #22C55E; border-radius: 6px; padding: 10px; font-size: 12px; color: #166534; }
.refund-result-fail { margin-top: 12px; background: #FEF2F2; border: 1px solid var(--color-danger); border-radius: 6px; padding: 10px; font-size: 12px; color: #991B1B; }

/* ── Refund Status Badge ── */
.btn-check-refund-status { background: var(--color-secondary); color: #fff; border: none; border-radius: 4px; padding: 4px 10px; font-size: 11px; cursor: pointer; }
.btn-check-refund-status:hover { background: var(--color-primary); }
.btn-check-refund-status:disabled { opacity: 0.5; cursor: not-allowed; }
.refund-status-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.refund-status-completed { background: #DCFCE7; color: #166534; border: 1px solid #22C55E; }
.refund-status-pending { background: var(--color-warning-light); color: #854D0E; border: 1px solid #EAB308; }
.refund-status-failed { background: var(--color-danger-light); color: #991B1B; border: 1px solid var(--color-danger); }

/* ── Refund Followup Decision Panel ── */
.refund-followup-panel {
    background: #FFF7ED;
    border: 2px solid var(--color-cta);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
    animation: refundPanelPulse 2s ease-in-out;
}
@keyframes refundPanelPulse {
    0% { border-color: var(--color-cta); box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15); }
    50% { border-color: var(--color-cta-hover); box-shadow: 0 2px 16px rgba(245, 158, 11, 0.35); }
    100% { border-color: var(--color-cta); box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15); }
}
.refund-followup-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-cta-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cancel-subcase-badge {
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-heading);
    background: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid #BFDBFE;
    border-radius: var(--radius-pill);
    padding: 2px 10px;
}
.subcase-badge-standalone {
    margin: 6px 0;
}
.refund-followup-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
/* Last odd child spans full width to avoid orphan half-row */
.refund-followup-checks > label.refund-check:nth-child(odd):last-of-type {
    grid-column: 1 / -1;
}
.refund-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 8px;
    border: 1px solid #D1D5DB;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.refund-check:hover { border-color: var(--color-primary); box-shadow: 0 2px 8px rgba(30,64,175,0.10); }
.refund-check:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-light); box-shadow: 0 0 0 2px rgba(30,64,175,0.15); }
.refund-check:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.refund-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--color-primary); cursor: pointer; flex-shrink: 0; }
.refund-check-approved { border-color: #86EFAC; background: #F0FDF4; }
.refund-check-approved:has(input:checked) { border-color: #22C55E; background: #DCFCE7; }
.refund-check-denied { border-color: #FCA5A5; background: #FFF5F5; }
.refund-check-denied:has(input:checked) { border-color: var(--color-danger); background: var(--color-danger-light); }
.refund-check-icon { font-size: 20px; flex-shrink: 0; }
.refund-check-text { display: flex; flex-direction: column; gap: 1px; }
.refund-check-label { font-size: 13px; font-weight: 600; color: var(--color-text); }
.refund-check-desc { font-size: 11px; color: var(--color-text-muted); }
.refund-template-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-left: 4px; background: #DCFCE7; color: #166534; vertical-align: middle; }
.refund-template-tag.denied { background: var(--color-danger-light); color: #991B1B; }
.refund-check-consumer-law { border-color: #93C5FD; background: var(--color-primary-light); }
.refund-check-consumer-law:has(input:checked) { border-color: var(--color-secondary); background: #DBEAFE; }
.refund-template-tag.consumer-law { background: #DBEAFE; color: #1E40AF; }
.refund-template-hint { display: none; padding: 6px 10px; margin: 4px 0 6px; font-size: 12px; color: #1E40AF; background: var(--color-primary-light); border: 1px solid #BFDBFE; border-radius: 6px; }
.refund-template-hint .hint-arrow { font-weight: 700; color: var(--color-primary); }
.refund-confirm-btn { width: 100%; padding: 8px; font-size: 13px; font-weight: 600; }
.refund-confirm-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cancel scenario: radio reuses checkbox styles */
.refund-check input[type="radio"] { width: 16px; height: 16px; accent-color: var(--color-primary); cursor: pointer; flex-shrink: 0; }

/* ── AI Recommendation Highlight (panel integration) ── */
.refund-check.ai-recommended {
    border: 2px solid var(--color-secondary);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}
.refund-check.ai-recommended:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}
.ai-recommend-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-secondary);
    margin-left: 4px;
    vertical-align: middle;
}


/* ── Inline body images (from markdown) ── */
.inline-body-img {
    display: block;
    max-width: 240px;
    max-height: 200px;
    margin: 6px 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: box-shadow 0.15s;
    object-fit: contain;
}

.inline-body-img:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Sort toggle ── */
.btn-sort {
    font-size: 12px;
    padding: 4px 10px;
    white-space: nowrap;
    min-width: 80px;
}

/* ── Attachment display in comments ── */
.comment-attachments { margin-top: 8px; }

.attachment-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.attachment-image-wrap {
    position: relative;
    cursor: pointer;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: box-shadow 0.15s;
    max-width: 180px;
}

.attachment-image-wrap:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.attachment-thumb {
    display: block;
    max-width: 180px;
    max-height: 140px;
    object-fit: cover;
}

.attachment-image-name {
    display: block;
    font-size: 10px;
    color: var(--color-text-muted);
    padding: 2px 6px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-files { margin-top: 6px; }

.attachment-file-link {
    display: inline-block;
    font-size: 12px;
    color: var(--color-primary);
    text-decoration: none;
    padding: 3px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-right: 6px;
    margin-bottom: 4px;
    transition: background 0.15s;
}

.attachment-file-link:hover { background: var(--color-primary-light); }
.attachment-file-size { color: var(--color-text-muted); font-size: 11px; }

/* ── Lightbox ── */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.lightbox-filename {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lightbox-actions { display: flex; gap: 8px; }

.lightbox-btn {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 8px;
    color: var(--color-text-muted);
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.15s;
}

.lightbox-btn:hover { background: var(--color-muted); }

.lightbox-body {
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: var(--color-bg);
}

.lightbox-img {
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
}

/* ── Upload Zone ── */
.upload-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border: 2px dashed transparent;
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, background 0.2s;
}

.upload-zone.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.btn-attach {
    white-space: nowrap;
    font-size: 12px;
    padding: 4px 10px;
}

.upload-hint {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ── Attachment Previews (compose area) ── */
.attachment-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.attachment-preview-item {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: 80px;
    background: var(--color-bg);
}

.attachment-preview-item img {
    display: block;
    width: 80px;
    height: 60px;
    object-fit: cover;
}

.attachment-preview-info {
    font-size: 9px;
    color: var(--color-text-muted);
    padding: 2px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-preview-remove {
    position: absolute;
    top: 2px; right: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.attachment-preview-remove:hover { background: var(--color-danger); }

/* ── End-User Internal Note Badge ── */
.badge-eu-internal {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-warning-text);
    background: var(--color-warning-light);
    border: 1px solid var(--color-cta);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}

.comment-eu-internal {
    border-left: 3px solid var(--color-cta);
}

/* ── Image Resize Controls ── */
.upload-resize-separator {
    color: var(--color-border);
    font-size: 14px;
    margin: 0 2px;
    user-select: none;
}

.upload-resize-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    user-select: none;
}

.upload-resize-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.resize-max-select {
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    outline: none;
}

.resize-max-select:focus {
    border-color: var(--color-primary);
}

.resize-max-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.attachment-preview-info.resized {
    color: var(--color-success, #16A34A);
    font-weight: 600;
}

/* Inline image resize in compose */
.compose-img-wrapper {
    outline: 2px solid transparent;
    border-radius: 4px;
    transition: outline-color 0.15s;
    cursor: default;
}
.compose-img-wrapper:hover {
    outline-color: var(--color-primary, #2563EB);
}
.compose-img-resize-handle {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 12px;
    height: 12px;
    background: var(--color-primary, #2563EB);
    border: 2px solid #fff;
    border-radius: 2px;
    cursor: nwse-resize;
    opacity: 0;
    transition: opacity 0.15s;
}
.compose-img-wrapper:hover .compose-img-resize-handle {
    opacity: 1;
}

.attachment-preview-uploading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Scenario Recommendation Badge ─────────────────────────── */
.scenario-recommend-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin: 8px 0;
    border-radius: 8px;
    font-size: 13px;
    flex-wrap: wrap;
    animation: fadeIn 0.3s ease;
}
.scenario-recommend-badge.conf-high {
    background: #ECFDF5;
    border: 1px solid #6EE7B7;
    color: #065F46;
}
.scenario-recommend-badge.conf-med {
    background: #FFF7ED;
    border: 1px solid #FDBA74;
    color: #9A3412;
}
.scenario-recommend-badge.conf-low {
    background: var(--color-muted);
    border: 1px solid #D1D5DB;
    color: #6B7280;
}
.scenario-icon { font-size: 18px; }
.scenario-id {
    font-weight: 700;
    font-size: 15px;
    background: rgba(0,0,0,0.06);
    padding: 2px 8px;
    border-radius: 4px;
}
.scenario-name { font-weight: 600; }
.scenario-conf {
    font-weight: 700;
    font-size: 12px;
    padding: 1px 6px;
    border-radius: 10px;
}
.conf-high .scenario-conf { background: var(--color-success-light); color: #065F46; }
.conf-med .scenario-conf { background: #FED7AA; color: #9A3412; }
.conf-low .scenario-conf { background: var(--color-border); color: #6B7280; }
.scenario-reason {
    font-size: 12px;
    opacity: 0.7;
    font-style: italic;
}
.scenario-keywords {
    width: 100%;
    margin-top: 4px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.scenario-kw {
    font-size: 11px;
    background: rgba(0,0,0,0.05);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* ── Scenario Badge: clickable + applied states ─────────── */
.scenario-recommend-badge.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}
.scenario-recommend-badge.clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.scenario-recommend-badge.clickable:active {
    transform: translateY(0);
}
.scenario-apply-hint {
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.06);
}
.scenario-recommend-badge.clickable:hover .scenario-apply-hint {
    background: rgba(0,0,0,0.12);
}
.scenario-recommend-badge.applying {
    opacity: 0.7;
    pointer-events: none;
}
.scenario-recommend-badge.applied {
    cursor: default;
    background: var(--color-success-light);
    border-color: #34D399;
}
.scenario-recommend-badge.applied .scenario-icon {
    font-size: 16px;
}

/* ── Auto-Draft Banner & Badge ────────────────────────── */
.badge-draft-ready {
    background: var(--color-warning-light); color: var(--color-cta-text); border: 1px solid #FCD34D;
    font-weight: 700; font-size: 10px; letter-spacing: 0.3px;
    padding: 1px 5px; border-radius: 4px; margin-right: 4px;
}

.auto-draft-banner {
    margin: 0 0 12px; padding: 12px 16px;
    background: linear-gradient(135deg, var(--color-warning-light) 0%, #FDE68A 100%);
    border: 1px solid #FCD34D; border-radius: 10px;
}
.auto-draft-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.auto-draft-title {
    font-weight: 700; font-size: 14px; color: var(--color-cta-text);
}
.auto-draft-meta {
    display: flex; align-items: center; gap: 6px; font-size: 12px;
}
.auto-draft-quality {
    font-weight: 700; padding: 1px 6px; border-radius: 4px;
}
.auto-draft-quality.quality-high { background: var(--color-success-light); color: #065F46; }
.auto-draft-quality.quality-mid { background: var(--color-warning-light); color: var(--color-cta-text); }
.auto-draft-quality.quality-low { background: var(--color-danger-light); color: #991B1B; }
.auto-draft-scenario {
    color: #78716C; font-style: italic;
}
.auto-draft-text {
    background: #FFFBEB; border: 1px solid #FCD34D; border-radius: 8px;
    padding: 10px 14px; font-size: 13px; color: #1C1917;
    max-height: 200px; overflow-y: auto; white-space: pre-wrap;
    margin-bottom: 10px; line-height: 1.5;
}
.auto-draft-actions {
    display: flex; gap: 8px; align-items: center;
}
.btn-approve-open {
    background: var(--color-primary); color: #fff; border: 1px solid transparent; border-radius: 8px;
    padding: 4px 12px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.btn-approve-open:hover { background: #1D4ED8; }
.btn-approve-pending {
    background: var(--color-success); color: #fff; border: 1px solid transparent; border-radius: 8px;
    padding: 4px 12px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.btn-approve-pending:hover { background: #059669; }
.approve-status-tag {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 10px; font-weight: 700; margin-left: 4px;
    background: rgba(255,255,255,0.25); vertical-align: middle;
}
.auto-draft-reject-form {
    display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
    padding: 10px; background: #FEF2F2; border-radius: 8px; border: 1px solid #FECACA;
}
.auto-draft-reject-form .reject-reasons-grid {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.auto-draft-reject-form .reject-reasons-grid label {
    display: flex; align-items: center; gap: 4px; padding: 3px 8px;
    background: white; border: 1px solid #E7E5E4; border-radius: 6px;
    font-size: 11px; cursor: pointer; user-select: none;
}
.auto-draft-reject-form .reject-reasons-grid label:has(input:checked) {
    background: var(--color-danger-light); border-color: #F87171; font-weight: 600;
}
.auto-draft-reject-form .reject-reasons-grid input[type="checkbox"] {
    width: 13px; height: 13px; accent-color: var(--color-danger);
}
.auto-draft-reject-form .input-sm {
    padding: 4px 8px; font-size: 12px;
    border: 1px solid #D6D3D1; border-radius: 6px;
    background: white; color: #1C1917;
}
.auto-draft-reject-form .reject-actions {
    display: flex; gap: 6px;
}

/* Post-status recommendation on Reply buttons */
.btn-recommended {
    box-shadow: 0 0 0 2px var(--color-primary), 0 2px 8px rgba(37,99,235,0.3);
    animation: pulse-recommend 1.5s ease-in-out 3;
}
@keyframes pulse-recommend {
    0%, 100% { box-shadow: 0 0 0 2px var(--color-primary), 0 2px 8px rgba(37,99,235,0.3); }
    50% { box-shadow: 0 0 0 3px var(--color-primary), 0 4px 16px rgba(37,99,235,0.5); }
}
/* ── Reject Draft Modal ───────────────────────────────────── */
.reject-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.reject-modal {
    background: #fff; border-radius: 12px; width: 440px; max-width: 92vw;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18); overflow: hidden;
}
.reject-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid var(--color-border);
    font-weight: 600; font-size: 14px; color: var(--color-text);
}
.reject-modal-close {
    background: none; border: none; font-size: 20px; cursor: pointer; color: #6B7280;
    line-height: 1; padding: 0 4px;
}
.reject-modal-close:hover { color: #111; }
.reject-modal-body { padding: 16px 18px; }
.reject-modal-desc { font-size: 13px; color: var(--color-text-muted); margin: 0 0 12px; }
.reject-reason-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px;
}
.reject-reason-tag {
    display: flex; align-items: center; cursor: pointer;
}
.reject-reason-tag input { display: none; }
.reject-tag-label {
    display: block; width: 100%; text-align: center;
    padding: 7px 6px; border-radius: 8px; font-size: 12px; font-weight: 500;
    border: 1.5px solid var(--color-border); background: var(--color-bg); color: #374151;
    transition: all .15s;
}
.reject-reason-tag input:checked + .reject-tag-label {
    border-color: var(--color-danger); background: #FEF2F2; color: #DC2626; font-weight: 600;
}
.reject-tag-label:hover { border-color: #D1D5DB; background: var(--color-muted); }
.reject-note {
    width: 100%; border: 1px solid var(--color-border); border-radius: 8px; padding: 8px 10px;
    font-size: 12px; resize: none; font-family: inherit; color: #374151;
}
.reject-note:focus { outline: none; border-color: var(--color-secondary); }
.reject-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 18px; border-top: 1px solid var(--color-border); background: var(--color-bg);
}

/* ── Feedback Summary Card (KPI strip extension) ──────────── */
.feedback-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 16px 20px;
    max-width: 1032px;
    margin: 0 auto 16px;
    margin-left: max(24px, calc((100% - 1032px) / 2));
    margin-right: max(24px, calc((100% - 1032px) / 2));
    overflow: hidden;
}
.feedback-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.feedback-card-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.feedback-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.feedback-stat-badge {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    color: #DC2626;
    background: var(--color-danger-light);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    letter-spacing: 0.3px;
}
.feedback-card-period {
    font-size: 11px;
    color: var(--color-text-subtle);
    margin-left: 8px;
}
.feedback-bar-list { }
.feedback-bar-row {
    display: grid;
    grid-template-columns: 120px 1fr 30px;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}
.feedback-bar-label {
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: right;
}
.feedback-bar-track {
    height: 8px;
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
}
.feedback-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--color-danger), #F97316);
    border-radius: 4px;
    transition: width .3s;
}
.feedback-bar-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    text-align: right;
}

/* REMOVED: A/B draft comparison (2026-03-14) — feature retired */

/* ═══ 1단계: Inline Translation Toggle ═══ */
.btn-translate-toggle {
    display: inline-block; margin: 6px 0 2px; padding: 3px 10px;
    font-size: 11px; font-weight: 500; color: var(--color-primary);
    background: var(--color-primary-light); border: 1px solid #BFDBFE; border-radius: var(--radius-pill);
    cursor: pointer; transition: var(--transition);
}
.btn-translate-toggle:hover { background: #DBEAFE; }
.btn-translate-toggle:disabled { opacity: 0.5; cursor: wait; }
.spinner-sm {
    display: inline-block; width: 12px; height: 12px;
    border: 2px solid #BFDBFE; border-top-color: var(--color-primary);
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
/* @keyframes spin defined once at line ~2136 — no duplicate */
.translate-panel {
    margin: 4px 0 8px; padding: 8px 12px;
    background: var(--color-bg); border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.translate-label {
    display: block; font-size: 10px; font-weight: 600; color: var(--color-primary);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.translate-text { font-size: 13px; color: var(--color-text); line-height: 1.5; white-space: pre-wrap; }

/* REMOVED: EN summary auto-generation (2026-03-14) — operators use external translation tools when needed */

/* ═══ 3단계: Vocab Glossary Panel ═══ */
.vocab-glossary-panel {
    margin: 8px 0; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: var(--color-card); overflow: hidden;
}
.vocab-glossary-panel.collapsed .glossary-body { display: none; }
.vocab-glossary-panel.collapsed .glossary-collapse { transform: rotate(-90deg); }
.glossary-header {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; background: #FFFBEB; border-bottom: 1px solid #FDE68A;
}
.glossary-title { font-size: 12px; font-weight: 700; color: var(--color-cta-text); }
.glossary-category {
    font-size: 10px; font-weight: 500; color: var(--color-text-muted);
    background: var(--color-warning-light); padding: 1px 6px; border-radius: var(--radius-pill);
}
.glossary-collapse {
    margin-left: auto; border: none; background: none; cursor: pointer;
    font-size: 10px; color: var(--color-text-muted); transition: transform 0.2s;
}
.glossary-body {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
    padding: 6px 10px; max-height: 180px; overflow-y: auto;
}
.glossary-term {
    display: flex; align-items: center; gap: 4px; padding: 3px 6px;
    font-size: 11px; border-radius: 4px; cursor: pointer; transition: var(--transition);
}
.glossary-term:hover { background: var(--color-warning-light); }
.glossary-term.glossary-copied { background: var(--color-success-light); }
.glossary-ko { color: var(--color-text-muted); font-size: 10px; min-width: 60px; }
.glossary-arrow { color: var(--color-text-subtle); font-size: 10px; }
.glossary-tr { color: var(--color-text); font-weight: 500; }

/* draft-progress-float: floating AI draft progress indicator */
.draft-progress-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-text);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Print mode ── */
@media print {
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .detail-actions, .detail-close, .tab-btn, button[class*="action"] { display: none !important; }
    .comment-body, .msg-body, [class*="-body"][style*="max-height"] {
        max-height: none !important;
        overflow: visible !important;
    }
    .detail-panel, .comment-item, .message-item { page-break-inside: avoid; box-shadow: none; }
}
