/* Chat Automation editor is scoped to the existing Broadcast Studio theme tokens. */
#postd-chat-automation {color:var(--bd-text);min-width:0;}
#postd-chat-automation * {box-sizing:border-box;}
#postd-chat-automation :is(button,input,textarea,select) {font:inherit;}
#postd-chat-automation button:focus-visible,#postd-chat-automation input:focus-visible,#postd-chat-automation textarea:focus-visible,#postd-chat-automation select:focus-visible {outline:2px solid var(--bd-accent);outline-offset:2px;}
#postd-chat-automation button {cursor:pointer;}
#postd-chat-automation button:disabled {opacity:.45;cursor:not-allowed;}
#postd-chat-automation .cb-shell {display:grid;gap:18px;max-width:1550px;}
#postd-chat-automation .cb-heading {display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;}
#postd-chat-automation .cb-eyebrow,#postd-chat-automation .cb-editor-heading small {font:800 10px/1.6 'DM Mono',monospace;letter-spacing:.12em;color:var(--bd-subtle);text-transform:uppercase;}
#postd-chat-automation .cb-heading h2 {font-size:clamp(24px,2.5vw,34px);letter-spacing:-.06em;line-height:1.12;margin:3px 0 7px;}
#postd-chat-automation .cb-heading h2 span {color:var(--bd-accent);}
#postd-chat-automation p {color:var(--bd-muted);margin:0;line-height:1.55;}
#postd-chat-automation .cb-chip {display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border:1px solid var(--bd-border);border-radius:30px;background:var(--bd-soft);color:var(--bd-muted);font-size:10px;font-weight:800;white-space:nowrap;}
#postd-chat-automation .cb-chip.on {background:var(--bd-success-bg);color:var(--bd-success);border-color:color-mix(in srgb,var(--bd-success) 40%,var(--bd-border));}
#postd-chat-automation .cb-stats {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
#postd-chat-automation .cb-stats>div {padding:18px 20px;background:var(--bd-surface);border:1px solid var(--bd-border);border-radius:14px;display:grid;gap:5px;}
#postd-chat-automation .cb-stats strong {font-size:clamp(21px,2vw,29px);font-weight:850;line-height:1.2;letter-spacing:-.05em;}
#postd-chat-automation .cb-stats span {color:var(--bd-muted);font-size:11px;font-weight:650;}
#postd-chat-automation .cb-top-grid {display:grid;grid-template-columns:minmax(300px,1fr) minmax(300px,1fr);gap:13px;}
#postd-chat-automation .cb-card {padding:20px;background:var(--bd-surface);border:1px solid var(--bd-border);border-radius:16px;min-width:0;}
#postd-chat-automation .cb-card h3 {font-size:20px;letter-spacing:-.045em;margin:4px 0 15px;}
#postd-chat-automation .cb-card-head {display:flex;justify-content:space-between;align-items:center;}
#postd-chat-automation .cb-illustration {height:39px;width:39px;display:grid;place-items:center;background:var(--bd-accent);color:var(--bd-accent-ink);font-size:20px;border-radius:12px;}
#postd-chat-automation .cb-form-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin:9px 0 15px;}
#postd-chat-automation label {display:grid;gap:6px;min-width:0;font-weight:750;font-size:11px;color:var(--bd-text);}
#postd-chat-automation label small {font-weight:500;color:var(--bd-subtle);}
#postd-chat-automation input:not([type="checkbox"]):not([type="color"]),#postd-chat-automation select,#postd-chat-automation textarea {width:100%;min-width:0;min-height:38px;border:1px solid var(--bd-border);border-radius:9px;padding:10px 11px;background:var(--bd-soft);color:var(--bd-text);outline-offset:2px;}
#postd-chat-automation textarea {min-height:85px;resize:vertical;line-height:1.45;}
#postd-chat-automation input[type="checkbox"] {accent-color:var(--bd-accent);width:16px;height:16px;}
#postd-chat-automation .cb-color-input {display:flex;align-items:center;gap:10px;min-height:38px;border:1px solid var(--bd-border);border-radius:9px;padding:4px 10px;background:var(--bd-soft);}
#postd-chat-automation .cb-color-input input {width:43px;height:29px;border:0;background:transparent;padding:0;}
#postd-chat-automation .cb-color-input code {color:var(--bd-muted);font-size:12px;}
#postd-chat-automation .cb-check {display:flex;flex-direction:row;gap:9px;align-items:center;font-weight:650;}
#postd-chat-automation .cb-check-row {border-top:1px solid var(--bd-border);padding-top:14px;margin-top:5px;}
#postd-chat-automation .cb-card-footer {display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:19px;flex-wrap:wrap;}
#postd-chat-automation .cb-card-footer span,#postd-chat-automation .cb-caption {font-size:11px;color:var(--bd-muted);}
#postd-chat-automation .cb-preview-chat {display:grid;gap:13px;border-radius:13px;padding:17px 15px;margin:0 0 15px;min-height:126px;background:linear-gradient(130deg,#171427,#27213d);color:#f9f5ff;}
#postd-chat-automation .cb-preview-system {font:750 10px 'DM Mono',monospace;letter-spacing:.12em;color:#b3a6cb;}
#postd-chat-automation .cb-preview-message {display:flex;align-items:baseline;gap:7px;flex-wrap:wrap;font-size:13px;line-height:1.6;overflow-wrap:anywhere;}
#postd-chat-automation .cb-preview-message strong {font-weight:800;}
#postd-chat-automation .cb-preview-colon {margin-left:-6px;color:#e2d8ee;}
#postd-chat-automation .cb-bot-tag {padding:2px 5px;border-radius:4px;background:#675381;color:#fff;font:800 9px 'DM Mono',monospace;letter-spacing:.07em;align-self:center;}
#postd-chat-automation #cb-test-form {display:grid;gap:10px;}
#postd-chat-automation #cb-test-form button {justify-self:start;}
#postd-chat-automation .cb-caption {margin-top:10px;}
#postd-chat-automation .cb-management {padding:0;overflow:hidden;}
#postd-chat-automation .cb-management-head {display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:19px 20px 14px;border-bottom:1px solid var(--bd-border);}
#postd-chat-automation .cb-management-head h3 {margin:3px 0 0;}
#postd-chat-automation .cb-switcher {display:flex;gap:3px;flex-wrap:wrap;padding:4px;background:var(--bd-soft);border:1px solid var(--bd-border);border-radius:10px;}
#postd-chat-automation .cb-switcher button {border:0;border-radius:7px;padding:8px 11px;background:transparent;color:var(--bd-muted);font-size:11px;font-weight:800;}
#postd-chat-automation .cb-switcher button span {margin-right:6px;font-size:13px;}
#postd-chat-automation .cb-switcher button.active {background:var(--bd-accent);color:var(--bd-accent-ink);}
#postd-chat-automation .cb-section-head {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;flex-wrap:wrap;}
#postd-chat-automation .cb-section-head p {font-size:12px;}
#postd-chat-automation .cb-list {display:grid;gap:1px;background:var(--bd-border);border-top:1px solid var(--bd-border);border-bottom:1px solid var(--bd-border);}
#postd-chat-automation .cb-entry {min-width:0;display:flex;gap:12px;align-items:center;padding:16px 20px;background:var(--bd-surface);}
#postd-chat-automation .cb-entry-icon {width:39px;height:39px;flex:none;display:grid;place-items:center;border-radius:10px;background:color-mix(in srgb,var(--bd-accent) 17%,var(--bd-surface));color:var(--bd-text);font-size:21px;font-weight:800;}
#postd-chat-automation .cb-entry-body {min-width:0;flex:1;}
#postd-chat-automation .cb-entry-heading {display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:4px;}
#postd-chat-automation .cb-entry-heading strong {font-size:13px;}
#postd-chat-automation .cb-entry-body p {font-size:12px;overflow-wrap:anywhere;}
#postd-chat-automation .cb-entry-meta {margin-top:5px;color:var(--bd-subtle);font-size:10px;}
#postd-chat-automation .cb-entry-actions {display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;}
#postd-chat-automation .cb-mini {min-height:29px;padding:5px 9px;border:1px solid var(--bd-border);border-radius:7px;background:var(--bd-soft);color:var(--bd-text);font-size:11px;font-weight:750;}
#postd-chat-automation .cb-mini:hover {border-color:var(--bd-accent);}
#postd-chat-automation .cb-mini.danger {color:var(--bd-danger);}
#postd-chat-automation .cb-empty {padding:35px 20px;text-align:center;background:var(--bd-surface);}
#postd-chat-automation .cb-empty strong {display:block;margin-bottom:4px;font-size:14px;}
#postd-chat-automation .cb-presets {display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:14px 20px;border-bottom:1px solid var(--bd-border);}
#postd-chat-automation .cb-presets strong {font-size:11px;margin-right:7px;}
#postd-chat-automation .cb-presets button {border:1px solid var(--bd-border);border-radius:25px;background:var(--bd-soft);color:var(--bd-text);padding:6px 11px;font-size:11px;font-weight:700;}
#postd-chat-automation .cb-tip {padding:16px 20px;background:color-mix(in srgb,var(--bd-accent) 6%,var(--bd-surface));}
#postd-chat-automation .cb-tip strong {font-size:11px;}
#postd-chat-automation .cb-tip p {margin-top:4px;font-size:11px;}
#postd-chat-automation code {color:var(--bd-text);overflow-wrap:anywhere;}
#postd-chat-automation .cb-editor {padding:19px;margin:0 20px 18px;background:var(--bd-soft);border:1px solid var(--bd-border);border-radius:12px;}
#postd-chat-automation .cb-editor-heading {display:flex;justify-content:space-between;gap:10px;align-items:center;}
#postd-chat-automation .cb-editor-heading h3 {font-size:17px;margin:3px 0 0;}
#postd-chat-automation .cb-full-label {margin:0 0 15px;}
#postd-chat-automation .cb-editor-bottom {display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding-top:12px;border-top:1px solid var(--bd-border);}
#postd-chat-automation .cb-builtins-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:6px 20px 20px;}
#postd-chat-automation .cb-builtin {border:1px solid var(--bd-border);border-radius:12px;padding:14px;min-width:0;}
#postd-chat-automation .cb-builtin-head {display:flex;justify-content:space-between;align-items:center;gap:8px;}
#postd-chat-automation .cb-builtin-head strong {font-size:13px;}
#postd-chat-automation .cb-switch-small {display:flex;align-items:center;gap:6px;font-size:10px;}
#postd-chat-automation .cb-builtin p {font-size:11px;margin:7px 0 13px;}
#postd-chat-automation .cb-builtin-options {display:grid;grid-template-columns:minmax(0,1fr) 100px auto;align-items:end;gap:8px;}
#postd-chat-automation .cb-builtin-options label {font-size:10px;}
#postd-chat-automation .cb-builtin-options select,#postd-chat-automation .cb-builtin-options input {min-height:34px;font-size:11px;}
#postd-chat-automation .cb-builtin-options button {min-height:34px;}
#postd-chat-automation .cb-status {font-size:11px;font-weight:700;padding:0 3px;color:var(--bd-success);}
#postd-chat-automation .cb-status.is-error,#postd-chat-automation .cb-error {color:var(--bd-danger);}
#postd-chat-automation .cb-loading,#postd-chat-automation .cb-error {border:1px solid var(--bd-border);border-radius:12px;padding:25px;background:var(--bd-surface);}
/* Bot identity is clearly distinguished from a signed-in account. */
#live-chat-log .postd-chat-bot-message .postd-chat-bot-badge {display:inline-flex;align-items:center;padding:1px 5px;border-radius:4px;background:color-mix(in srgb,var(--accent, #F27FB5) 30%,#31213f);color:#fff;font:800 9px 'DM Mono',monospace;letter-spacing:.08em;vertical-align:middle;}
#live-chat-log .postd-chat-bot-message {border-left:2px solid color-mix(in srgb,var(--accent,#F27FB5) 65%,transparent);padding-left:8px;}
@media(max-width:1050px) {#postd-chat-automation .cb-top-grid {grid-template-columns:minmax(0,1fr);}#postd-chat-automation .cb-builtins-grid {grid-template-columns:minmax(0,1fr);}}
@media(max-width:720px) {#postd-chat-automation .cb-stats {grid-template-columns:repeat(2,minmax(0,1fr));}#postd-chat-automation .cb-form-grid {grid-template-columns:minmax(0,1fr);}#postd-chat-automation .cb-entry {align-items:flex-start;flex-wrap:wrap;}#postd-chat-automation .cb-entry-actions {width:100%;justify-content:flex-start;margin-left:51px;}#postd-chat-automation .cb-management-head,#postd-chat-automation .cb-section-head {padding:14px;}#postd-chat-automation .cb-card {padding:15px;}#postd-chat-automation .cb-editor {margin:0 12px 12px;padding:12px;}#postd-chat-automation .cb-switcher {width:100%;}#postd-chat-automation .cb-switcher button {flex:1;}#postd-chat-automation .cb-builtins-grid {padding:8px 12px 12px;}#postd-chat-automation .cb-builtin-options {grid-template-columns:minmax(0,1fr) minmax(75px,100px);}#postd-chat-automation .cb-builtin-options button {grid-column:1/-1;} }
@media(max-width:430px) {#postd-chat-automation .cb-stats>div {padding:12px;}#postd-chat-automation .cb-switcher button {font-size:10px;padding:8px 5px;}#postd-chat-automation .cb-switcher button span {display:none;}}
/* Broadcast Studio's generic text-field selector also matches checkboxes;
   override it here so toggles never stretch across the settings card. */
#postd-broadcast-studio #postd-chat-automation input[type="checkbox"] {
  display:inline-block;width:16px;height:16px;min-width:16px;max-width:16px;min-height:16px;
  flex:0 0 16px;margin:0;padding:0;border:0;border-radius:3px;vertical-align:middle;
  accent-color:var(--bd-accent);background:transparent;
}


/* POST'D V13 bot settings: color input fits its field and hex value never wraps. */
#postd-chat-automation .cb-color-input{display:flex;align-items:center;justify-content:flex-start;gap:12px;min-height:43px;min-width:0;overflow:hidden;padding:6px 11px}
#postd-chat-automation .cb-color-input input[type="color"]{width:49px!important;min-width:49px!important;max-width:49px!important;height:30px!important;flex:0 0 49px!important;padding:1px!important;margin:0!important;border:0!important;background:transparent!important;cursor:pointer}
#postd-chat-automation .cb-color-input code{display:inline-block;flex:0 0 auto;min-width:7ch;max-width:none;white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important;font:700 12px/1.3 ui-monospace,Consolas,monospace;text-transform:uppercase}
#postd-chat-automation .cb-form-grid>label{min-width:0}
/* The chat timers live in a contained scrolling well; editing stays above it. */
#postd-chat-automation .cb-timer-anchor{margin:0 14px 14px;border:1px solid var(--bd-border);border-radius:13px;overflow:hidden;background:var(--bd-surface)}
#postd-chat-automation .cb-timer-anchor .cb-timer-scroll{display:grid;align-content:start;gap:1px;margin:0;max-height:410px;min-height:80px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--bd-border) transparent;border:0}
#postd-chat-automation .cb-timer-anchor .cb-entry{margin:0;min-width:0}
#postd-chat-automation .cb-timer-anchor .cb-entry-body{overflow-wrap:anywhere}
#postd-chat-automation .cb-timer-anchor .cb-entry-actions{flex:none}
@media(max-width:700px){#postd-chat-automation .cb-timer-anchor{margin:0 10px 12px}#postd-chat-automation .cb-timer-anchor .cb-timer-scroll{max-height:350px}}

