/* ============================================================================
   Automation.

   Moved out of the template. It used to live in a <style> block nested inside
   base.html's own <style>, which closes the outer element at the first
   </style> — so the whole page sheet was being appended to base's, and CSS
   error recovery silently ate the first rule every time. (.gradient-dot was
   the casualty here; nothing looked broken because components.css happened to
   declare it too.)

   As a linked sheet it also loads after ui-system.css, so these rules now win
   the cascade instead of losing to it at equal specificity.
   ========================================================================= */

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: 28px;
    padding: 18px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 20px;
    border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-item:first-child { padding-left: 0; }
.stat-item-label {
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.56);
}
.stat-item strong {
    color: #f2f5fa;
    font-weight: 800;
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
@media (max-width: 1024px) {
    .stats-bar { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
    .stat-item:nth-child(2n) { border-right: none; }
    .stat-item:nth-child(3) { padding-left: 0; }
}
@media (max-width: 640px) {
    .stats-bar { grid-template-columns: 1fr; padding: 14px 18px; }
    .stat-item { padding: 10px 0 !important; border-right: none; border-bottom: 1px solid var(--border); }
    .stat-item:last-child { border-bottom: none; }
}

/* ===== Automation Type Cards ===== */
.automation-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.type-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    transition: transform 0.25s var(--ease-lift), border-color 0.2s, box-shadow 0.25s var(--ease-lift);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.type-card:hover {
    box-shadow: var(--button-shadow-primary);
}

/* The declared border step is dead here: ui-system.css lists .type-card in the
   card contract at (0,2,0) and loads later. Re-declared at a weight that
   wins, so the hover has a response now that the 4px lift is gone. */
html:not([data-page-theme="light"]) .type-card:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.type-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

/* Six automation types wore six gradients - green, red, white, amber, white,
   amber-to-red - and none of them meant anything: a goodbye message is not
   "danger" and a scheduled post is not a premium feature. The tile is a
   container for the icon, and the icon already says which type it is. Same
   treatment the Server-pulse stats got. */
.type-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    flex-shrink: 0;
}

.type-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.type-card-count {
    font-size: 0.75rem;
    color: var(--text-light);
}

.type-card-desc {
    font-size: 0.8125rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 14px;
}

.type-card-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-dot::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.active::before { background: var(--success); }
.status-dot.active { color: var(--success); }
.status-dot.inactive::before { background: var(--text-light); opacity: 0.4; }
.status-dot.inactive { color: var(--text-light); }

.type-card-action {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    background: var(--primary);
    color: var(--on-accent);
}

.type-card-action:hover {
    opacity: 0.85;
}

.type-card-action.configure {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.type-card-action.configure:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Sections ===== */
.auto-section {
    margin-bottom: 32px;
}

.auto-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.auto-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: white;
}

.auto-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.auto-section-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
}

/* Item Rows */
.auto-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.auto-item:last-child { border-bottom: none; }

.auto-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.auto-item-info { flex: 1; min-width: 0; }

.auto-item-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
    margin-bottom: 2px;
}

.auto-item-meta {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.auto-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-sm.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.btn-sm.danger:hover { background: rgba(239, 68, 68, 0.2); }

/* Message config card */
.message-config {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 8px;
}

.message-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.message-config-channel {
    font-size: 0.8125rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-config-body {
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
    padding: 14px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Empty states */
.empty-block {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-block i {
    font-size: 2rem;
    opacity: 0.25;
    margin-bottom: 10px;
    display: block;
}

.empty-block strong {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
}

.auto-modal.active { display: flex; }

.auto-modal.active .auto-modal-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    /* No margin: .form-group is a grid with `gap: var(--space-2)` in
       ui-system.css, and a margin here ADDS to that gap rather than
       replacing it -- so this label sat 14px above its field while the
       marketplace's sat at 8px. Pre-grid leftover. */
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 6px;
    line-height: 1.5;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* (Dropdown theming now lives globally in ui-system.css — see "UNIFIED
   DROPDOWNS" — so every select across the site, modals included, matches.) */

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.variable-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.var-tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    cursor: pointer;
    transition: background 0.15s;
    font-family: monospace;
}

.var-tag:hover {
    background: rgba(255, 255, 255, 0.2);
}

.info-callout {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
}

.info-callout code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8125rem;
}

/* Buttons */
.btn {
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.2s var(--ease-lift), box-shadow 0.2s var(--ease-lift);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary { background: var(--primary); color: var(--on-accent); }
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-light); }

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

/* Responsive */
@media (max-width: 900px) {
    .automation-types { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .automation-types { grid-template-columns: 1fr; }

    .auto-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .auto-item-actions { width: 100%; }

    .form-row { grid-template-columns: 1fr; }
}

/* ===== Components V2 builder ===== */
.auto-modal-box.wide { max-width: 1040px; }

.cv2b { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 20px; align-items: stretch; }
/* the preview pane stretches to the editor's height so this block can stick
   to the top of the scrolling modal body as you scroll / add components */
.cv2b-preview-sticky { position: sticky; top: 0; }
.cv2b-pane { min-width: 0; }
.cv2b-pane-label {
    font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light);
    margin-bottom: 10px;
}

.cv2b-accent { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cv2b-accent-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8125rem; color: var(--text); cursor: pointer; }
.cv2b-color { width: 38px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }

/* live-data token chips */
.cv2b-tokens { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(245, 158, 11, 0.06); border: 1px solid rgba(245, 158, 11, 0.18); }
.cv2b-tokens-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #f59e0b; margin-right: 2px; display: inline-flex; align-items: center; gap: 5px; }
.cv2b-token { font-family: var(--font-mono); font-size: 0.75rem; padding: 3px 8px; border-radius: 6px; background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); cursor: pointer; transition: all 0.15s; }
.cv2b-token:hover { background: rgba(245, 158, 11, 0.22); border-color: rgba(245, 158, 11, 0.5); }
.cv2b-pv-text .pv-token, .cv2b-pv-sec-text .pv-token { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border-radius: 3px; padding: 0 3px; font-size: 0.92em; }

.cv2b-blocks { display: flex; flex-direction: column; gap: 10px; }
.cv2b-block { border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.02); overflow: hidden; }
.cv2b-block-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.015); }
.cv2b-block-type { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; color: var(--primary); text-transform: uppercase; }
.cv2b-block-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.cv2b-block-body .form-input, .cv2b-block-body .form-textarea, .cv2b-block-body .form-select { margin: 0; }
/* WYSIWYG rich text editor */
.cv2b-rt-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 7px 8px; margin-bottom: 12px; border-radius: 10px; border: 1px solid var(--border); background: #16161d; box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.cv2b-rt-style { height: 30px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 0.8rem; font-weight: 600; padding: 0 8px; cursor: pointer; }
.cv2b-rt-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.cv2b-rt-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--text-light); cursor: pointer; font-size: 0.85rem; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.cv2b-rt-btn:hover { background: var(--surface-2); color: var(--text); }
.cv2b-rt-btn.active { background: rgba(255, 255, 255,0.18); border-color: rgba(255, 255, 255,0.4); color: var(--primary); }

.cv2b-rt { min-height: 120px; max-height: 420px; overflow-y: auto; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: #dbdee1; font-size: 0.95rem; line-height: 1.5; outline: none; transition: border-color 0.15s; }
.cv2b-rt:focus { border-color: rgba(255, 255, 255,0.5); }
.cv2b-rt:empty::before, .cv2b-rt > div:only-child:empty::before { content: attr(data-placeholder); color: var(--text-light); pointer-events: none; }
.cv2b-rt > div { min-height: 1.4em; }
.cv2b-rt [data-bt="h1"] { font-size: 1.5rem; font-weight: 700; color: #f2f3f5; line-height: 1.3; }
.cv2b-rt [data-bt="h2"] { font-size: 1.25rem; font-weight: 700; color: #f2f3f5; line-height: 1.3; }
.cv2b-rt [data-bt="h3"] { font-size: 1.05rem; font-weight: 700; color: #f2f3f5; line-height: 1.3; }
.cv2b-rt [data-bt="small"] { font-size: 0.8rem; color: #949ba4; }
.cv2b-rt [data-bt="quote"] { border-left: 3px solid #4e5058; padding-left: 10px; color: #c9cdd3; }
.cv2b-rt [data-bt="bullet"] { padding-left: 20px; position: relative; }
.cv2b-rt [data-bt="bullet"]::before { content: '•'; position: absolute; left: 7px; color: #c9cdd3; }
.cv2b-rt strong, .cv2b-rt b { font-weight: 700; color: #f2f3f5; }
.cv2b-rt code { background: #1e1f22; padding: 1px 5px; border-radius: 4px; font-size: 0.85em; font-family: var(--font-mono); }
.cv2b-rt a { color: #00a8fc; text-decoration: none; }
.cv2b-rt-token { background: rgba(245,158,11,0.18); color: #fbbf24; border-radius: 4px; padding: 0 4px; font-size: 0.92em; font-family: var(--font-mono); white-space: nowrap; }

/* inline link popover (replaces window.prompt) */
.cv2b-linkpop-overlay { position: fixed; inset: 0; z-index: 11000; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }
.cv2b-linkpop { width: 380px; max-width: 90vw; background: #13131a; border: 1px solid var(--border-strong); border-radius: 14px; padding: 18px; box-shadow: 0 24px 60px -12px rgba(0,0,0,0.6); }
.cv2b-linkpop-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.cv2b-linkpop-row { display: flex; gap: 10px; margin-top: 14px; }
.cv2b-linkpop-row .btn { flex: 1; justify-content: center; }

.cv2b-ctrls { display: flex; gap: 4px; }
.cv2b-ctrl {
    width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2);
    color: var(--text-light); cursor: pointer; font-size: 0.75rem; transition: all 0.15s; flex-shrink: 0;
}
.cv2b-ctrl:hover:not(:disabled) { color: var(--text); border-color: rgba(255, 255, 255,0.4); }
.cv2b-ctrl.danger:hover:not(:disabled) { color: var(--danger); border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.08); }
.cv2b-ctrl:disabled { opacity: 0.35; cursor: default; }

.cv2b-inline { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cv2b-inline:last-child { margin-bottom: 0; }
.cv2b-inline .form-input { flex: 1; }
.cv2b-btnrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cv2b-btnrow .cv2b-inline { flex: 1; margin: 0; }
.cv2b-btn-label { max-width: 140px; }
.cv2b-select { width: auto; min-width: 130px; }
.cv2b-btn-editor { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cv2b-num { width: 64px; flex: 0 0 auto; }
.cv2b-hint { font-size: 0.8125rem; color: var(--text-light); font-style: italic; }
.cv2b-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.cv2b-rolechk {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
    font-size: 0.8125rem; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-light); cursor: pointer; transition: all 0.15s;
}
.cv2b-rolechk.on { background: rgba(255, 255, 255,0.14); border-color: rgba(255, 255, 255,0.4); color: var(--primary); }
.cv2b-rolechk input { margin: 0; }
.cv2b-pv-select {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 6px;
    background: #1e1f22; border: 1px solid #3f4147; color: #949ba4; font-size: 0.85rem;
}
.cv2b-pv-select i { margin-left: auto; opacity: 0.7; }

.cv2b-sublabel { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-light); margin: 6px 0 2px; }
.cv2b-accessory { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 8px; }

.cv2b-mini {
    align-self: flex-start; padding: 5px 11px; border-radius: 7px; font-size: 0.75rem; font-weight: 600;
    background: rgba(255, 255, 255,0.1); color: var(--primary); border: 1px solid rgba(255, 255, 255,0.2); cursor: pointer;
}
.cv2b-mini:hover:not(:disabled) { background: rgba(255, 255, 255,0.18); }
.cv2b-mini:disabled { opacity: 0.4; cursor: default; }

.cv2b-add-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cv2b-add {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
    font-size: 0.8125rem; font-weight: 600; background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border); cursor: pointer; transition: all 0.15s;
}
.cv2b-add:hover { border-color: rgba(255, 255, 255,0.4); color: var(--primary); }
.cv2b-add i { font-size: 0.75rem; opacity: 0.8; }

.cv2b-counter { margin-top: 12px; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-light); }
.cv2b-counter.over { color: var(--danger); font-weight: 700; }

/* preview */
.cv2b-preview { min-width: 0; }
.cv2b-pv-card {
    background: #2b2d31; border-radius: 8px; padding: 16px; border-left: 4px solid transparent;
    color: #dbdee1; font-size: 0.875rem; line-height: 1.4; display: flex; flex-direction: column; gap: 8px;
}
.cv2b-pv-card :is(.pv-h1, .pv-h2, .pv-h3) { font-weight: 700; color: #f2f3f5; line-height: 1.3; margin-top: 4px; }
.cv2b-pv-card .pv-h1 { font-size: 1.5rem; }
.cv2b-pv-card .pv-h2 { font-size: 1.25rem; }
.cv2b-pv-card .pv-h3 { font-size: 1rem; }
.cv2b-pv-card b { color: #f2f3f5; font-weight: 700; }
.cv2b-pv-card code { background: #1e1f22; padding: 1px 5px; border-radius: 4px; font-size: 0.85em; font-family: var(--font-mono); }
.cv2b-pv-card s { color: #949ba4; }
.cv2b-pv-small, .cv2b-pv-card .pv-small { color: #949ba4; font-size: 0.8rem; }
.cv2b-pv-card .pv-link { color: #00a8fc; }
.cv2b-pv-card .pv-ts { background: rgba(255,255,255,0.06); border-radius: 3px; padding: 0 2px; color: #c9cdd3; }
.cv2b-pv-card .pv-bullet { padding-left: 18px; position: relative; }
.cv2b-pv-card .pv-bullet::before { content: '•'; position: absolute; left: 6px; color: #c9cdd3; }
.cv2b-pv-card .pv-quote { border-left: 3px solid #4e5058; padding-left: 10px; color: #dbdee1; }
.cv2b-pv-ext { font-size: 0.72em; margin-left: 6px; opacity: 0.85; }

/* faux Discord message chrome around the preview card */
.cv2b-pv-msg { display: flex; gap: 14px; align-items: flex-start; font-family: -apple-system, "Segoe UI", system-ui, sans-serif; }
.cv2b-pv-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: #1e1f22; margin-top: 2px; }
.cv2b-pv-msgbody { min-width: 0; flex: 1; }
.cv2b-pv-author { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; line-height: 1; }
.cv2b-pv-name { font-size: 1rem; font-weight: 600; color: #f2f3f5; }
.cv2b-pv-app { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.02em; color: #fff; background: #5865f2; border-radius: 4px; padding: 1px 5px; text-transform: uppercase; }
.cv2b-pv-time { font-size: 0.72rem; color: #949ba4; }
.cv2b-pv-section { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cv2b-pv-sec-text { flex: 1; min-width: 0; }
.cv2b-pv-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cv2b-pv-thumb.empty { background: #1e1f22; border: 1px dashed #4b4d52; }
.cv2b-pv-sep { height: 1px; background: #3f4147; margin: 2px 0; }
.cv2b-pv-sep.invisible { background: transparent; }
.cv2b-pv-gallery { display: flex; flex-wrap: wrap; gap: 4px; }
.cv2b-pv-img { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; background: #1e1f22; }
.cv2b-pv-btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.cv2b-pv-btn { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 6px; font-size: 0.8125rem; font-weight: 600; background: #4e5058; color: #fff; }
.cv2b-pv-btn.primary { background: #5865f2; }
.cv2b-pv-btn.success { background: #248046; }
.cv2b-pv-btn.danger { background: #da373c; }
.cv2b-pv-btn.link { background: #4e5058; }

@media (max-width: 760px) {
    .cv2b { grid-template-columns: 1fr; }
    .cv2b-preview-sticky { position: static; }
}

/* Deltas from the shared modal in components.css: a narrower box that lays its
   body out as a column, and a footer whose buttons split the width. Descendant
   form so they carry (0,2,0) and do not depend on this sheet loading after
   components.css — it does not. */
.auto-modal .auto-modal-box { max-width: 520px; overflow: hidden; flex-direction: column; }
.auto-modal .auto-modal-body { flex: 1 1 auto; }
.auto-modal .auto-modal-footer .btn { flex: 1; justify-content: center; text-align: center; }
