/* Customize page — per-bot switches and reply editor. Uses the portal's tokens. */
.cz-page{padding-bottom:110px}
.cz-bot-pick{min-width:220px;margin:0}
.cz-bot-pick select{width:100%}
.cz-status{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin:-12px 0 24px;font-size:12px;color:var(--muted)}
.cz-bot-name{display:inline-flex;align-items:center;gap:7px;color:var(--text)}
.cz-bot-name .icon{width:16px;height:16px;color:var(--accent)}
.cz-live{color:var(--faint)}
.cz-features{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:18px;align-items:start}
.cz-feature{padding:22px 24px}
.cz-feature-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.cz-feature-head h2{font-size:17px;margin-bottom:4px}
.cz-feature-head p{font-size:12px;margin-bottom:0}
.cz-feature .field-help{margin:14px 0 0}
.cz-sub{margin-top:16px;border-top:1px solid var(--border);transition:opacity .2s}
.cz-sub.cz-off{opacity:.5}
.cz-sub-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--border)}
.cz-sub-row:last-child{border-bottom:0;padding-bottom:0}
.cz-sub-row strong{display:block;font-size:13px;font-weight:600}
.cz-sub-row small{display:block;font-size:11.5px;line-height:1.55}

/* switch */
.cz-switch{position:relative;display:inline-flex;flex-shrink:0;width:42px;height:24px;cursor:pointer}
.cz-switch input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;z-index:1}
.cz-switch input:disabled{cursor:not-allowed}
.cz-switch span{position:absolute;inset:0;border-radius:999px;background:var(--panel-2);border:1px solid var(--border);transition:background .18s,border-color .18s}
.cz-switch span::after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:var(--faint);transition:transform .2s cubic-bezier(.3,.7,.4,1),background .18s}
.cz-switch input:checked+span{background:linear-gradient(110deg,#bc5af4,#ee80e7);border-color:#d381f5}
.cz-switch input:checked+span::after{transform:translateX(18px);background:#fff}
.cz-switch input:focus-visible+span{outline:2px solid var(--accent);outline-offset:3px}
.cz-switch input:disabled+span{opacity:.55}

.cz-tools{margin-top:30px}
.cz-filters{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.cz-filters select{min-height:40px;max-width:200px;font-size:12px}
.cz-bulk{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:-4px 0 14px}
.cz-bulk .count-caption{margin:0}
.cz-bulk>div{display:flex;gap:8px;flex-wrap:wrap}

.cz-list{display:grid;gap:10px}
.cz-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 18px;align-items:center;background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:14px 18px;transition:border-color .15s,opacity .15s}
.cz-row:hover{border-color:#bd59f54a}
.cz-row-off .cz-main{opacity:.55}
.cz-main{min-width:0}
.cz-main p{font-size:12px;margin:4px 0 0;overflow-wrap:anywhere}
.cz-title{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
.cz-title code{font-size:13px;font-weight:650;color:var(--text);background:var(--field);border:1px solid var(--border);border-radius:6px;padding:1px 7px}
.cz-title .tag{margin:0}
.cz-tag-edited{color:var(--accent)!important;border-color:#bd59f54a!important}
.cz-actions{display:flex;align-items:center;gap:12px}
.cz-actions .button{white-space:nowrap}
.cz-n{font-size:10px;padding:0 5px;border-radius:4px;background:var(--bg);color:var(--faint)}
.cz-none{font-size:11px;color:var(--faint);white-space:nowrap}
.cz-locked{display:inline-grid;place-items:center;width:42px;color:var(--faint)}
.cz-locked .icon{width:18px;height:18px}

.cz-editor{grid-column:1/-1;margin-top:10px;padding-top:14px;border-top:1px dashed var(--border);display:grid;gap:14px;animation:cz-in .22s ease-out}
.cz-editor-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.cz-editor-head p{font-size:12px;margin:0}
.cz-editor code,.cz-holes code{font-size:11px;background:var(--field);border:1px solid var(--border);border-radius:4px;padding:0 4px}
.cz-reply{display:grid;gap:6px}
.cz-reply-top{display:flex;justify-content:space-between;align-items:center;gap:10px}
.cz-reply-top label{font-size:12px;font-weight:600;color:var(--muted)}
.cz-reply-edited .cz-reply-top label{color:var(--text)}
.cz-page textarea.cz-text{width:100%;min-height:58px;font-family:inherit!important;font-size:13px!important;line-height:1.6!important;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--field);color:var(--text);resize:vertical}
.cz-reply-edited textarea.cz-text{border-color:#bd59f54a}
.cz-page textarea.cz-invalid{border-color:var(--red)!important;outline-color:#f5a3b230}
.cz-reply-foot{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:11px;color:var(--faint)}
.cz-error{margin:0;font-size:12px;color:var(--red)}
.cz-wait-note{font-size:11px;color:var(--faint)}
.link-button{background:none;border:0;padding:2px 0;color:var(--accent);font-size:12px;font-weight:600;cursor:pointer}
.link-button:hover{color:var(--pink)}

.cz-savebar{position:fixed;left:calc(var(--nav-width) + 24px);right:24px;bottom:18px;z-index:40;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px 12px 18px;border:1px solid var(--border);border-radius:14px;background:var(--panel);box-shadow:0 18px 50px #00000030;animation:cz-up .25s ease-out}
.cz-savebar>span{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text)}
.cz-savebar>span .icon{width:16px;height:16px;color:var(--accent)}
.cz-savebar>div{display:flex;gap:8px}
/* optional step inside "Create New Bot" */
.cz-setup{border:1px solid var(--border);border-radius:14px;background:var(--field);padding:18px;display:grid;gap:14px}
.cz-setup-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.cz-setup-head .eyebrow{margin-bottom:4px}
.cz-setup-head h3{margin:0 0 4px;font-size:16px}
.cz-setup-head p{font-size:12px;margin:0}
.cz-setup-loading{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted);padding:6px 0}
.cz-setup .cz-features{grid-template-columns:1fr;gap:12px}
.cz-setup .cz-feature{padding:16px 18px;box-shadow:none}
.cz-setup .cz-tools{margin:6px 0 12px;flex-direction:column;align-items:stretch;gap:10px}
.cz-setup .cz-filters{justify-content:stretch}
.cz-setup .cz-filters .search{width:auto;flex:1 1 180px}
.cz-setup .cz-filters select{max-width:none;flex:1 1 140px}
.cz-setup .cz-list{max-height:460px;overflow:auto;overscroll-behavior:contain;padding-right:4px}
.cz-setup .cz-row{padding:12px 14px}
.cz-setup-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border-top:1px solid var(--border);padding-top:14px}
.cz-setup-foot>span{font-size:12px;color:var(--muted)}
.cz-setup-foot>div{display:flex;gap:8px;flex-wrap:wrap}
.cz-setup-collapsed{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text)}
.cz-setup-collapsed .icon{width:16px;height:16px;color:var(--green)}
.cz-setup-collapsed span{flex:1;min-width:0}
@media (max-width:620px){
  .cz-setup{padding:14px}
  .cz-setup-head{flex-direction:column}
  .cz-setup-foot>div,.cz-setup-foot>div .button{width:100%}
  .cz-setup-foot>div .button{flex:1}
  .cz-setup .cz-list{max-height:400px}
}
@keyframes cz-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@keyframes cz-up{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.cz-editor,.cz-savebar{animation:none}.cz-switch span,.cz-switch span::after{transition:none}}

@media (max-width:1020px){
  .cz-savebar{left:16px;right:16px}
}
@media (max-width:860px){
  .cz-features{grid-template-columns:1fr}
  .cz-tools{flex-direction:column;align-items:stretch}
  .cz-filters{justify-content:stretch}
  .cz-filters .search{width:auto;flex:1 1 200px}
  .cz-filters select{max-width:none;flex:1 1 140px}
}
@media (max-width:620px){
  .cz-page .page-heading{flex-direction:column;align-items:stretch}
  .cz-bot-pick{min-width:0}
  .cz-row{grid-template-columns:1fr;padding:14px}
  .cz-actions{justify-content:space-between}
  .cz-feature{padding:18px}
  .cz-savebar{left:10px;right:10px;bottom:10px;flex-direction:column;align-items:stretch;padding:12px;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  .cz-savebar>div{justify-content:stretch}
  .cz-savebar>div .button{flex:1}
  .cz-editor-head{flex-direction:column}
}
