:root{--bg:#f3f6f1;--panel:#fffefa;--panel-soft:#f7faf5;--line:#d8e1d7;--text:#17231d;--muted:#69786f;--green:#178653;--green-dark:#0e663e;--green-soft:#e5f4eb;--red:#d64550;--red-soft:#fff0f1;--amber:#b87713;--shadow:0 16px 42px rgba(41,62,49,.08)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:Inter,system-ui,sans-serif}button,input,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}.topbar{height:74px;background:rgba(255,254,250,.96);border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 32px;position:sticky;top:0;z-index:20}.brand{display:flex;align-items:center;gap:12px;color:var(--text);text-decoration:none;min-width:250px}.brand-mark{width:42px;height:42px;border-radius:9px;display:grid;place-items:center;background:var(--green);color:#fff;font-family:Manrope;font-weight:800}.brand>span:last-child{display:flex;flex-direction:column}.brand b{font-family:Manrope;font-size:15px}.brand small{font-size:10px;color:var(--muted);margin-top:2px}.main-nav{height:100%;display:flex;gap:8px;align-items:center}.nav-item{height:44px;border:0;border-radius:7px;background:transparent;color:#59685f;font-weight:600;padding:0 18px}.nav-item:hover{background:#f0f5ef}.nav-item.active{background:var(--green-soft);color:var(--green-dark);box-shadow:inset 0 -2px var(--green)}.top-actions{margin-left:auto;display:flex;align-items:center;gap:10px}.status-pill{display:flex;align-items:center;gap:8px;border:1px solid var(--line);padding:9px 12px;border-radius:8px;font-size:11px;color:var(--muted)}.status-pill i,.promo-state i{width:8px;height:8px;border-radius:50%;background:#d19a34}.status-pill.ready i,.promo-state.active i{background:#22a66a;box-shadow:0 0 0 5px rgba(34,166,106,.1)}.shell{max-width:1540px;margin:0 auto;padding:34px 32px 44px}.card{background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow)}.btn{min-height:40px;padding:0 15px;border-radius:7px;border:1px solid transparent;font-size:12px;font-weight:700}.btn.primary{background:var(--green);color:white}.btn.primary:hover{background:var(--green-dark)}.btn.secondary{background:white;border-color:#cbd7ce;color:#34453b}.btn.ghost{background:transparent;color:var(--muted)}.btn.danger{background:var(--red-soft);border-color:#efbfc3;color:var(--red)}.btn.compact{min-height:34px}.btn.wide{width:100%}.login-view{min-height:calc(100vh - 150px);display:grid;grid-template-columns:1fr 460px;align-items:center;gap:90px;max-width:1120px;margin:auto}.login-copy h1{font:800 clamp(42px,5vw,68px)/1.04 Manrope;margin:14px 0}.login-copy p{color:var(--muted);line-height:1.8;max-width:600px}.eyebrow{font-size:10px;letter-spacing:.16em;color:var(--green);font-weight:800}.login-card{padding:35px}.login-card h2{font:700 26px Manrope;margin:12px 0 8px}.login-card p{font-size:12px;color:var(--muted);margin-bottom:27px}.login-card label,.campaign-card>label{display:block;font-size:11px;font-weight:700;margin:14px 0 8px}.input-wrap{display:flex;border:1px solid #cbd7ce;border-radius:7px;background:white;overflow:hidden;height:48px}.input-wrap:focus-within,.add-group:focus-within{border-color:#62a783;box-shadow:0 0 0 3px rgba(23,134,83,.08)}.input-wrap input,.add-group input{border:0;outline:0;background:transparent;flex:1;padding:0 13px}.input-wrap button{border:0;background:#edf2ee;padding:0 14px}.login-card .primary{margin-top:14px}.alert{font-size:11px;padding:10px;border-radius:6px;margin-top:10px}.alert.error{background:var(--red-soft);color:var(--red)}.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:25px}.page-head h1{font:700 32px Manrope;margin:7px 0 5px}.page-head p{margin:0;color:var(--muted);font-size:13px}.session-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,.65fr);gap:18px}.session-card{padding:25px;min-height:610px}.status-card{padding:25px;height:max-content}.card-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:15px;border-bottom:1px solid var(--line)}.card-head small,.status-card>small,.next-card>small,.rule-card>small{font-size:9px;letter-spacing:.14em;color:#829087;font-weight:800}.card-head h2,.status-card h2{font:700 17px Manrope;margin:4px 0 0}.badge{font-size:10px;font-weight:700;padding:7px 10px;border-radius:99px}.badge.neutral{background:#eef2ef;color:#718078}.badge.success{background:var(--green-soft);color:var(--green-dark)}.muted{font-size:11px;color:var(--muted);line-height:1.6}.state-panel{text-align:center;max-width:470px;margin:0 auto;padding:65px 0 20px}.state-panel h3{font:700 22px Manrope;margin:18px 0 7px}.state-panel p{color:var(--muted);font-size:12px;line-height:1.6}.loader{width:62px;height:62px;border:4px solid #e3ebe5;border-top-color:var(--green);border-radius:50%;margin:75px auto 0;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.qr-shell{width:280px;height:280px;background:#fff;border:1px solid var(--line);padding:13px;margin:auto;border-radius:10px}.qr-shell img{width:100%;height:100%}.text-btn{border:0;background:transparent;color:var(--green);font-size:11px}.prefix span{display:grid;place-items:center;padding-left:13px}.pair-code{margin-top:16px;background:var(--green-soft);padding:16px;border-radius:8px}.pair-code small{display:block;font-size:9px}.pair-code strong{display:block;font:700 30px Manrope;letter-spacing:.13em;color:var(--green);margin-top:6px}.success-mark,.error-mark{width:70px;height:70px;border-radius:50%;display:grid;place-items:center;margin:auto;font:800 18px Manrope}.success-mark{background:var(--green-soft);color:var(--green)}.error-mark{background:var(--red-soft);color:var(--red)}.account-card{display:flex;align-items:center;gap:12px;text-align:left;border:1px solid var(--line);padding:12px;border-radius:8px;margin:22px 0}.avatar,.group-avatar{display:grid;place-items:center;background:var(--green-soft);color:var(--green);font-weight:800}.avatar{width:44px;height:44px;border-radius:7px}.account-card>div:last-child{display:flex;flex-direction:column}.account-card span{font-size:11px;color:var(--muted);margin-top:3px}.status-list{margin-top:18px}.status-list>div{display:flex;justify-content:space-between;align-items:center;min-height:48px;border-bottom:1px solid #edf1ed;font-size:11px}.status-list b{font-size:11px}.status-list .safe{color:var(--green)}.safe-note{margin-top:20px;background:var(--green-soft);border-left:3px solid var(--green);padding:15px}.safe-note b{font-size:11px}.safe-note p{font-size:10px;line-height:1.6;color:#557065;margin:6px 0 0}.control-bar{display:flex;align-items:center;gap:9px}.promo-state{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:700;margin-right:4px}.promo-state.emergency{color:var(--red)}.promo-state.emergency i{background:var(--red)}.promo-layout{display:grid;grid-template-columns:minmax(0,1fr) 365px;gap:18px}.campaign-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.campaign-card{padding:18px}.campaign-card .card-head{padding-bottom:11px}.campaign-card .card-head>div{display:flex;align-items:center;gap:9px}.campaign-number{width:30px;height:30px;border-radius:6px;background:var(--green-soft);display:grid;place-items:center;font-size:10px;color:var(--green);font-weight:800}.campaign-card h2{font-size:15px}.campaign-card textarea{width:100%;height:116px;resize:vertical;border:1px solid #ccd7ce;border-radius:7px;padding:11px;outline:0;line-height:1.55;font-size:12px;background:#fff}.campaign-card textarea:focus{border-color:#62a783;box-shadow:0 0 0 3px rgba(23,134,83,.08)}.campaign-meta{display:flex;justify-content:space-between;align-items:center;margin-top:8px}.char-count{font-size:9px;color:var(--muted)}.switch input{display:none}.switch span{width:38px;height:22px;background:#cdd6cf;border-radius:99px;display:block;position:relative}.switch span:after{content:"";width:16px;height:16px;border-radius:50%;background:white;position:absolute;left:3px;top:3px;transition:.2s}.switch input:checked+span{background:var(--green)}.switch input:checked+span:after{left:19px}.hours{display:grid;grid-template-columns:repeat(8,1fr);gap:5px}.hour{height:28px;border:1px solid #d5ddd7;background:white;border-radius:5px;color:#64736a;font-size:9px}.hour.selected{background:var(--green);border-color:var(--green);color:white;font-weight:700}.promo-side{display:flex;flex-direction:column;gap:14px}.groups-card,.next-card,.rule-card,.history-card{padding:18px}.add-group{display:flex;border:1px solid #ccd7ce;border-radius:7px;overflow:hidden;margin:13px 0}.add-group input{min-width:0;height:43px}.add-group .btn{border-radius:0}.group-list{display:flex;flex-direction:column;max-height:455px;overflow:auto}.group-row{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #edf1ed;padding:10px 2px}.group-row label{display:flex;align-items:center;gap:9px;min-width:0}.group-row label>span:last-child{display:flex;flex-direction:column;min-width:0}.group-row b{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-row small{font-size:9px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-avatar{width:32px;height:32px;border-radius:7px;flex:none}.delete-group{border:0;background:transparent;color:var(--red);font-size:10px}.summary-line{border-top:1px solid var(--line);padding-top:12px;margin-top:7px;font-size:10px;color:var(--muted)}.next-value{font:700 16px Manrope;margin:12px 0 5px}.next-card p,.rule-card li{font-size:10px;color:var(--muted);line-height:1.55}.rule-card ul{padding-left:17px;margin:12px 0 0}.history-card{margin-top:14px}.history-list{margin-top:4px}.history-row{display:grid;grid-template-columns:1.5fr .6fr .6fr .6fr;gap:10px;align-items:center;min-height:56px;border-bottom:1px solid #edf1ed;font-size:10px}.history-row>span:first-child{display:flex;flex-direction:column}.history-row small{color:var(--muted);margin-top:3px}.history-status{text-transform:capitalize;padding:5px 7px;border-radius:99px;text-align:center;background:#edf2ee}.history-status.sent{background:var(--green-soft);color:var(--green)}.history-status.failed{background:var(--red-soft);color:var(--red)}.history-status.partial,.history-status.stopped{background:#fff4df;color:var(--amber)}.empty{padding:27px 10px;text-align:center;color:#8b9890;font-size:11px}.toast{position:fixed;right:22px;bottom:22px;background:#17231d;color:white;padding:12px 16px;border-radius:7px;font-size:11px;opacity:0;transform:translateY(20px);transition:.2s;pointer-events:none;z-index:60}.toast.show{opacity:1;transform:none}.modal{position:fixed;inset:0;background:rgba(22,35,28,.3);display:grid;place-items:center;padding:20px;z-index:50}.modal-card{width:min(430px,100%);background:white;border:1px solid var(--line);border-radius:10px;padding:25px;box-shadow:0 28px 90px rgba(25,40,31,.2)}.modal-card h2{font:700 21px Manrope;margin:10px 0 8px}.modal-card p{font-size:12px;color:var(--muted);line-height:1.6}.modal-card>div{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}
.campaign-actions,.group-head-actions,.backup-actions{display:flex;align-items:center;gap:7px}.test-campaign{color:var(--green-dark)!important;border-color:#9bc8ad!important;background:#f4fbf6!important}.group-head-actions .ghost{border:1px solid transparent}.group-head-actions .ghost:hover{border-color:var(--line);background:var(--panel-soft)}.backup-card{padding:18px}.backup-card>label,.restore-box>label{display:block;font-size:9px;letter-spacing:.12em;font-weight:800;color:#728179;margin:15px 0 7px}.backup-token{width:100%;height:43px;border:1px solid #ccd7ce;border-radius:7px;padding:0 11px;background:white;outline:0}.backup-token:focus{border-color:#62a783;box-shadow:0 0 0 3px rgba(23,134,83,.08)}.backup-actions{margin-top:9px}.backup-actions .btn{flex:1}.backup-status{font-size:9px;color:var(--muted);line-height:1.5;margin-top:10px;overflow-wrap:anywhere}.restore-box{border-top:1px solid var(--line);margin-top:14px;padding-top:1px}.restore-box input[type=file]{display:block;width:100%;font-size:9px;color:var(--muted);border:1px dashed #c7d5ca;border-radius:7px;padding:9px;margin-bottom:8px;background:var(--panel-soft)}.restore-box small{display:block;font-size:9px;line-height:1.5;color:var(--muted);margin-top:7px}.btn:disabled{cursor:not-allowed;opacity:.55}
@media(max-width:1080px){.campaign-grid{grid-template-columns:1fr}.promo-layout{grid-template-columns:minmax(0,1fr) 330px}.hours{grid-template-columns:repeat(6,1fr)}}
@media(max-width:820px){.topbar{height:auto;min-height:68px;padding:10px 15px;flex-wrap:wrap}.brand{min-width:0}.main-nav{order:3;width:100%;height:46px;margin-top:8px}.nav-item{flex:1}.shell{padding:24px 14px}.login-view{grid-template-columns:minmax(0,1fr);gap:26px;width:100%;min-width:0}.login-card{width:100%;min-width:0}.login-card .input-wrap,.login-card .input-wrap input{min-width:0}.login-copy{display:none}.session-grid,.promo-layout{grid-template-columns:1fr}.page-head{display:block}.control-bar{margin-top:16px;flex-wrap:wrap}.campaign-grid{grid-template-columns:1fr}.hours{grid-template-columns:repeat(6,1fr)}}
@media(max-width:520px){.brand small,.status-pill span{display:none}.top-actions .ghost{display:none!important}.page-head h1{font-size:27px}.page-head p{font-size:11px}.session-card,.status-card{padding:16px}.campaign-card{padding:14px}.hours{grid-template-columns:repeat(4,1fr)}.control-bar .btn{flex:1}.control-bar .promo-state{width:100%;margin-bottom:4px}.qr-shell{width:230px;height:230px}.history-row{grid-template-columns:1fr .55fr .55fr}.history-row>span:nth-child(2){display:none}}

/* Backup panel: keep controls readable inside the narrow promotion sidebar. */
.backup-card{min-width:0;overflow:hidden;padding:18px}
.backup-card .backup-head{align-items:flex-start}
.backup-card .backup-head>div{min-width:0}
.backup-card .backup-head h2{font:700 17px Manrope;margin:4px 0 0}
.backup-card .badge{flex:none;max-width:130px;text-align:center}
.backup-destination{display:grid;gap:4px;margin:14px 0;padding:12px;border:1px solid #dce6de;border-left:3px solid var(--green);border-radius:7px;background:var(--panel-soft)}
.backup-destination span,.backup-destination>label,.backup-section>label,.restore-box>label{font-size:9px;letter-spacing:.12em;font-weight:800;color:#728179}
.backup-destination strong{font:700 13px Manrope;overflow-wrap:anywhere}
.backup-destination small{font-size:9px;line-height:1.45;color:var(--muted)}
.backup-chat-id{width:100%;min-width:0;height:42px;padding:0 11px;border:1px solid #c7d6ca;border-radius:7px;background:#fff;color:#23372b;font:700 12px ui-monospace,SFMono-Regular,Consolas,monospace;outline:0}.backup-chat-id:focus{border-color:#62a783;box-shadow:0 0 0 3px rgba(23,134,83,.08)}
.backup-section{display:grid;gap:9px;min-width:0}
.backup-section>label,.restore-box>label{margin:0}
.backup-token{display:block;width:100%;min-width:0;height:44px;border:1px solid #ccd7ce;border-radius:7px;padding:0 12px;background:#fff;outline:0}
.backup-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin:0}
.backup-actions .btn{width:100%;min-width:0;white-space:normal;line-height:1.25;padding:8px 10px}
.backup-status{margin:0;padding:9px 10px;border-radius:6px;background:#f2f6f2;font-size:9px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.restore-box{display:grid;gap:9px;border-top:1px solid var(--line);margin-top:15px;padding-top:15px;min-width:0}
.restore-box input[type=file]{display:block;width:100%;min-width:0;max-width:100%;font-size:9px;color:var(--muted);border:1px dashed #c7d5ca;border-radius:7px;padding:8px;background:var(--panel-soft);overflow:hidden}
.restore-box .btn{margin:0}
.restore-box small{margin:0;font-size:9px;line-height:1.5;color:var(--muted)}
@media(max-width:420px){.backup-actions{grid-template-columns:1fr}.backup-card .backup-head{gap:9px}.backup-card .badge{max-width:105px}.restore-box input[type=file]{font-size:8px}}

.refresh-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:0 13px;border:1px solid #c8d8cc;border-radius:7px;background:#f3f8f4;color:#315c43;font-size:11px;font-weight:700;box-shadow:0 1px 2px rgba(27,57,39,.06);transition:background .18s,border-color .18s,transform .18s}
.refresh-btn span{font-size:17px;line-height:1;color:var(--green);transition:transform .25s}
.refresh-btn:hover{background:var(--green-soft);border-color:#91bea0;transform:translateY(-1px)}
.refresh-btn:hover span{transform:rotate(90deg)}
.refresh-btn:active{transform:none}

/* Group identity and edit controls */
.group-row{gap:8px}
.group-row label{flex:1}
.group-actions{display:flex;align-items:center;gap:3px;flex:none}
.edit-group,.delete-group{min-height:30px;padding:0 8px;border:0;border-radius:5px;background:transparent;font-size:9px;font-weight:700}
.edit-group{color:var(--green)}
.edit-group:hover{background:var(--green-soft)}
.delete-group:hover{background:var(--red-soft)}
.edit-group-card label{display:block;margin:18px 0 7px;font-size:10px;font-weight:750;color:#43534a}
.modal-input{width:100%;height:46px;padding:0 12px;border:1px solid #cbd7ce;border-radius:7px;background:#fff;outline:0}
.modal-input:focus{border-color:#62a783;box-shadow:0 0 0 3px rgba(23,134,83,.08)}
@media(max-width:520px){.edit-group,.delete-group{padding:0 6px}.group-row small{max-width:175px}}

/* Dynamic promotion workspace */
.campaign-toolbar{min-height:64px;display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px;padding:11px 14px;border:1px solid var(--line);border-radius:9px;background:rgba(255,254,250,.78)}
.campaign-toolbar>div{display:flex;flex-direction:column;gap:3px}.campaign-toolbar span{font-size:8px;letter-spacing:.13em;font-weight:800;color:var(--green)}.campaign-toolbar strong{font-size:12px;color:#34453b}
.add-campaign-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border-color:#9bc8ad;background:var(--green-soft);color:var(--green-dark)}.add-campaign-btn:hover{background:#d8eee1}.add-campaign-btn span{font-size:18px;line-height:1;letter-spacing:0}
.campaign-head-actions{display:flex;align-items:center;gap:9px}.delete-campaign{height:30px;padding:0 9px;border:1px solid #edc9cc;border-radius:5px;background:#fff6f6;color:var(--red);font-size:9px;font-weight:700}.delete-campaign:hover:not(:disabled){background:var(--red-soft)}.delete-campaign:disabled{opacity:.35;cursor:not-allowed}
@media(max-width:520px){.campaign-toolbar{position:sticky;top:78px;z-index:8;background:#fffefa}.add-campaign-btn{min-height:38px}.campaign-head-actions{gap:6px}}

/* Header refresh keeps the current tab and scroll position. */
.page-refresh-btn{width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--line);border-radius:8px;background:#fff;color:#486057;font:700 21px/1 Inter,system-ui,sans-serif;transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease}
.page-refresh-btn:hover{border-color:#92b7a4;background:var(--green-soft);color:var(--green-dark)}
.page-refresh-btn:active{transform:rotate(35deg)}
@media(max-width:520px){.top-actions{gap:7px}.page-refresh-btn{width:35px;height:35px}.status-pill{height:35px;padding:8px 10px}}

/* Expandable delivery failure log. */
.history-entry{border-bottom:1px solid #edf1ed}.history-entry .history-row{border-bottom:0}.history-log-toggle{border:0;cursor:pointer;font:700 9px Inter,system-ui,sans-serif}.history-log-toggle:hover{filter:brightness(.96);text-decoration:underline}.history-error-log{margin:0 0 12px;padding:12px 14px;border:1px solid #f0c9cc;border-left:3px solid var(--red);border-radius:7px;background:#fff7f7}.history-error-log header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.history-error-log header>div{display:flex;flex-direction:column;gap:3px}.history-error-log header b{font:700 11px Manrope;color:#8e2932}.history-error-log header small{font-size:8px;color:#8c6a6d}.history-log-close{border:0;background:transparent;color:var(--red);font-size:9px;font-weight:700}.history-error-log ol{display:flex;flex-direction:column;gap:7px;margin:11px 0 0;padding:0;list-style:none}.history-error-log li{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start;gap:8px}.history-error-log li>span{width:20px;height:20px;display:grid;place-items:center;border-radius:5px;background:#f9dfe1;color:#a6313a;font-size:8px;font-weight:800}.history-error-log code{padding:3px 0;color:#603e41;font:500 9px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:520px){.history-entry .history-row{grid-template-columns:1fr .58fr}.history-entry .history-row>span:nth-child(2),.history-entry .history-row>span:nth-child(3){display:none}.history-entry .history-status{width:100%}.history-error-log{padding:11px}}

/* Clear bulk-selection control for promotion groups. */
.bulk-check-btn{min-width:118px;padding:0 11px;border:1px solid #9bcbb0;background:#edf8f1;color:#116f43;display:inline-flex;align-items:center;justify-content:center;gap:7px;box-shadow:0 2px 8px rgba(23,134,83,.07)}.bulk-check-btn:hover{border-color:#5da77c;background:#dff2e6}.bulk-check-icon{width:20px;height:20px;display:grid;place-items:center;border-radius:5px;background:#178653;color:#fff;font-size:12px;font-weight:800}.bulk-check-btn.all-selected{border-color:#dcc48d;background:#fff8e9;color:#8a6417}.bulk-check-btn.all-selected .bulk-check-icon{background:#c58a24}.bulk-check-btn:disabled{box-shadow:none}.bulk-check-btn:disabled .bulk-check-icon{background:#aab8b0}
@media(max-width:520px){.groups-card .card-head{align-items:flex-start;flex-direction:column}.group-head-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.group-head-actions .btn{width:100%;padding:0 8px}.bulk-check-btn{min-width:0}}

/* Per-group delivery confirmation. */
.history-group-list{margin:0 0 12px;border:1px solid #dfe8e1;border-radius:8px;background:#fbfdfb;overflow:hidden}
.history-group-row{display:grid;grid-template-columns:28px minmax(0,1fr) 126px;align-items:center;gap:10px;min-height:58px;padding:9px 12px;border-bottom:1px solid #e8eeea}
.history-group-row:last-child{border-bottom:0}
.history-group-number{width:24px;height:24px;display:grid;place-items:center;border-radius:6px;background:#edf3ef;color:#5b6e63;font-size:9px;font-weight:800}
.history-group-copy{display:flex;flex-direction:column;min-width:0;gap:4px}
.history-group-copy b{font-size:10px;line-height:1.45;color:#2d4035;overflow-wrap:anywhere}
.history-group-copy small{font-size:8px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.history-detail-status{justify-self:end;width:126px;padding:6px 8px;border-radius:99px;text-align:center;font-size:8px;font-weight:800;background:#edf2ee;color:#607067}
.history-detail-status.sent{background:var(--green-soft);color:var(--green-dark)}
.history-detail-status.failed{background:var(--red-soft);color:var(--red)}
.history-detail-status.pending{background:#fff4df;color:var(--amber)}
.history-detail-status.not_sent,.history-detail-status.waiting{background:#edf1f3;color:#66737b}
.history-status.pending{background:#fff4df;color:var(--amber)}
@media(max-width:620px){.history-group-row{grid-template-columns:24px minmax(0,1fr);gap:8px}.history-detail-status{grid-column:2;justify-self:start;width:auto;min-width:105px}.history-row>span:nth-child(3){display:none}}

/* Adjustable promotion pacing. */
.delay-card{padding:18px;overflow:hidden}
.delay-card .card-head{padding-bottom:12px}
.delay-card .card-head h2{font:700 17px Manrope;margin:4px 0 0}
.delay-icon{width:34px;height:34px;display:grid;place-items:center;border:1px solid #b8d5c2;border-radius:8px;background:var(--green-soft);color:var(--green-dark);font-size:17px}
.delay-card>.muted{margin:13px 0 14px}
.delay-fields{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.delay-fields>label{display:grid;gap:6px;min-width:0}
.delay-fields>label>span{font-size:9px;font-weight:800;color:#56675d}
.delay-fields>label>div{height:44px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;border:1px solid #cbd7ce;border-radius:7px;background:#fff;overflow:hidden}
.delay-fields input{width:100%;min-width:0;height:100%;padding:0 10px;border:0;outline:0;background:transparent;color:#1d3025;font:800 15px Manrope}
.delay-fields b{align-self:stretch;display:grid;place-items:center;padding:0 9px;border-left:1px solid #e1e8e3;background:#f1f6f2;color:#607168;font-size:8px;text-transform:uppercase;letter-spacing:.05em}
.delay-fields>label>div:focus-within{border-color:#62a783;box-shadow:0 0 0 3px rgba(23,134,83,.08)}
.delay-summary{margin:10px 0 12px;padding:9px 10px;border-left:3px solid var(--green);border-radius:5px;background:#f1f7f3;color:#496154;font-size:9px;line-height:1.5}
@media(max-width:380px){.delay-fields{grid-template-columns:1fr}}

/* Campaign photo attachment. */
.campaign-photo{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:11px;min-height:70px;margin:14px 0 4px;padding:10px;border:1px dashed #bfcfc3;border-radius:8px;background:#f7faf7}
.campaign-photo.has-photo{grid-template-columns:72px minmax(0,1fr) auto;border-style:solid;background:#f4faf6}
.campaign-photo>img{width:72px;height:58px;object-fit:cover;border-radius:6px;border:1px solid #d6e2d9;background:#fff}
.campaign-photo-empty,.campaign-photo-info{display:flex;align-items:center;gap:10px;min-width:0}
.campaign-photo-empty>span{width:36px;height:36px;display:grid;place-items:center;flex:none;border-radius:7px;background:var(--green-soft);color:var(--green);font:700 22px Manrope}
.campaign-photo-empty>div,.campaign-photo-info{flex-direction:column;align-items:flex-start;gap:3px}
.campaign-photo-empty b,.campaign-photo-info b{font-size:10px;color:#31463a}
.campaign-photo-empty small,.campaign-photo-info small{font-size:8px;line-height:1.4;color:var(--muted)}
.campaign-photo-actions{display:flex;align-items:center;gap:6px;flex:none}
.photo-upload-btn,.delete-campaign-image{height:34px;display:inline-flex;align-items:center;justify-content:center;padding:0 10px;border-radius:6px;font-size:9px;font-weight:800;cursor:pointer}
.photo-upload-btn{border:1px solid #8ebfa1;background:#e8f5ed;color:#126f43}
.photo-upload-btn:hover{background:#dbefe3}
.photo-upload-btn input{display:none}
.delete-campaign-image{border:1px solid #efc6c9;background:#fff7f7;color:var(--red)}
.delete-campaign-image:hover{background:var(--red-soft)}
@media(max-width:560px){.campaign-photo,.campaign-photo.has-photo{grid-template-columns:58px minmax(0,1fr)}.campaign-photo:not(.has-photo){grid-template-columns:1fr}.campaign-photo>img{width:58px;height:52px}.campaign-photo-actions{grid-column:1/-1;width:100%;display:grid;grid-template-columns:1fr 1fr}.campaign-photo:not(.has-photo) .campaign-photo-actions{grid-template-columns:1fr}.photo-upload-btn,.delete-campaign-image{width:100%}}

/* Live promotion monitor. Closing the drawer never stops its worker. */
.live-log-toggle{position:fixed;right:22px;bottom:22px;z-index:44;min-width:142px;height:46px;display:flex;align-items:center;justify-content:center;gap:9px;padding:0 13px;border:1px solid #3a5848;border-radius:9px;background:#15251c;color:#e9fff2;box-shadow:0 14px 38px rgba(12,29,19,.24);font-size:11px;font-weight:800}.live-log-toggle i{width:9px;height:9px;border-radius:50%;background:#71837a}.live-log-toggle.active i{background:#34d27d;box-shadow:0 0 0 5px rgba(52,210,125,.13);animation:livePulse 1.5s infinite}.live-log-toggle b{min-width:36px;padding:4px 6px;border-radius:5px;background:rgba(255,255,255,.1);font:700 9px ui-monospace,SFMono-Regular,Consolas,monospace}.live-log-toggle:hover{background:#1c3325;transform:translateY(-1px)}
@keyframes livePulse{50%{opacity:.45}}
.live-log-panel{position:fixed;right:22px;bottom:78px;z-index:43;width:min(620px,calc(100vw - 32px));max-height:min(620px,calc(100vh - 120px));display:flex;flex-direction:column;overflow:hidden;border:1px solid #294337;border-radius:11px;background:#0f1b15;color:#dff6e8;box-shadow:0 24px 80px rgba(5,20,12,.35)}
.live-log-panel>header{min-height:62px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 14px;border-bottom:1px solid #294036;background:#14241b}.live-log-panel>header>div{display:flex;align-items:center;gap:12px;min-width:0}.live-log-panel header small{display:block;color:#67bc8b;font:800 8px/1.2 Inter;letter-spacing:.13em}.live-log-panel header h2{margin:4px 0 0;overflow:hidden;color:#f2fff7;font:700 14px Manrope;white-space:nowrap;text-overflow:ellipsis}.live-log-panel>header>button{width:34px;height:34px;display:grid;place-items:center;flex:none;border:1px solid #345044;border-radius:7px;background:#1a2d23;color:#d9eee2;font-size:20px}.live-log-panel>header>button:hover{background:#263d31}.terminal-dots{display:flex;gap:4px}.terminal-dots i{width:7px;height:7px;border-radius:50%;background:#d8555e}.terminal-dots i:nth-child(2){background:#d9a83e}.terminal-dots i:nth-child(3){background:#42bd77}
.live-log-summary{padding:12px 14px;border-bottom:1px solid #263c31;background:#111f18}.live-log-summary>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:15px}.live-log-summary span{overflow:hidden;color:#91b6a0;font-size:10px;white-space:nowrap;text-overflow:ellipsis}.live-log-summary b{flex:none;color:#d8efe1;font:700 9px ui-monospace,SFMono-Regular,Consolas,monospace}.live-log-track{height:4px;margin-top:9px;overflow:hidden;border-radius:99px;background:#2b3c33}.live-log-track i{display:block;width:0;height:100%;border-radius:inherit;background:#36c878;transition:width .3s ease}
.live-log-lines{min-height:190px;max-height:430px;overflow:auto;padding:7px 0;background:#0d1812;scrollbar-color:#385344 #13231a}.live-log-line{display:grid;grid-template-columns:42px 74px minmax(0,1fr);align-items:start;gap:8px;padding:8px 13px;border-bottom:1px solid rgba(81,119,95,.13);font:500 9px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace}.live-log-line time{color:#708b7a}.live-log-code{font-weight:800;color:#9bb0a3}.live-log-line>div{display:flex;flex-direction:column;min-width:0}.live-log-line b{overflow-wrap:anywhere;color:#dcece2}.live-log-line small{margin-top:2px;overflow-wrap:anywhere;color:#6f8c7a}.live-log-line.sent .live-log-code{color:#43cf82}.live-log-line.failed .live-log-code{color:#ff737b}.live-log-line.pending .live-log-code{color:#edbc58}.live-log-line.sending .live-log-code{color:#62bdf1}.live-log-line.sending{background:rgba(42,117,158,.08)}.live-log-empty{display:grid;place-items:center;min-height:190px;color:#658071;font:500 10px ui-monospace,SFMono-Regular,Consolas,monospace}.history-detail-status.sending{background:#e9f5fc;color:#247eaa}
@media(max-width:620px){.live-log-toggle{right:12px;bottom:12px;height:44px}.live-log-panel{right:8px;bottom:64px;width:calc(100vw - 16px);max-height:calc(100vh - 82px)}.live-log-lines{max-height:50vh}.live-log-line{grid-template-columns:38px 66px minmax(0,1fr);padding:8px 10px}.live-log-panel>header{min-height:58px}}

/* On phones, settings stay reachable before the potentially long history. */
@media(max-width:820px){
  .promo-layout{display:flex;flex-direction:column}
  .promo-layout>div{display:contents}
  .campaign-toolbar{order:1}
  .campaign-grid{order:2}
  .promo-side{order:3}
  .history-card{order:4;margin-top:0}
}

/* Seven-day promotion history grouped by Jakarta calendar date. */
.history-period,.history-day-drawer,.history-archive{margin-top:12px;border:1px solid #dce6df;border-radius:9px;background:#fcfdfb;overflow:hidden}
.history-period>header,.history-day-drawer>summary,.history-archive>header{min-height:60px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 14px;background:#f5f9f6}
.history-period>header>div,.history-day-drawer>summary>div{display:flex;align-items:center;gap:10px;min-width:0}
.history-period header div div,.history-day-drawer summary div div,.history-archive>header>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.history-period header b,.history-day-drawer summary b,.history-archive header b{font:700 12px Manrope;color:#263b2f}
.history-period header small,.history-day-drawer summary small,.history-archive header small{font-size:9px;color:var(--muted)}
.history-period header strong,.history-day-drawer summary strong{font-size:9px;color:#547064;white-space:nowrap}
.history-period-mark{width:34px;height:34px;display:grid;place-items:center;flex:none;border-radius:8px;background:#e8f4ec}
.history-period-mark:before{content:"";width:10px;height:10px;border:2px solid #279560;border-radius:50%}
.history-period-mark.yesterday{background:#fff4df}.history-period-mark.yesterday:before{border-color:#c58a24}
.history-day-drawer>summary{cursor:pointer;list-style:none}.history-day-drawer>summary::-webkit-details-marker{display:none}
.history-day-drawer>summary>span{display:flex;align-items:center;gap:10px}.history-day-drawer>summary i{width:8px;height:8px;border-right:2px solid #6d7d73;border-bottom:2px solid #6d7d73;transform:rotate(45deg);transition:.2s}
.history-day-drawer[open]>summary i{transform:rotate(225deg);margin-top:5px}.history-day-drawer[open]>summary{border-bottom:1px solid #dfe7e1}
.history-period-body{padding:0 13px}.history-period-body .history-entry:last-child{border-bottom:0}
.history-period-empty{padding:20px 14px;text-align:center;color:#839188;font-size:10px}
.history-archive>header{background:#f8f6f0}.history-archive>header label{display:flex;align-items:center;gap:8px}.history-archive>header label>span{font-size:9px;font-weight:700;color:#6b766f}
.history-archive select{height:36px;min-width:142px;padding:0 30px 0 11px;border:1px solid #cbd7ce;border-radius:7px;background:#fff;color:#263b2f;font-size:10px;font-weight:700;outline:0}
.history-archive select:focus{border-color:#62a783;box-shadow:0 0 0 3px rgba(23,134,83,.08)}
.history-archive-date{padding:10px 14px;border-bottom:1px solid #e7ede8;background:#fff;color:#6b7b71;font-size:9px;font-weight:800;letter-spacing:.08em}
.history-archive.is-empty{background:#fafbf9}.history-archive.is-empty>header{border-bottom:1px solid #e5eae6}
@media(max-width:560px){.history-period>header,.history-day-drawer>summary,.history-archive>header{padding:10px 11px}.history-archive>header{align-items:flex-start;flex-direction:column}.history-archive>header label{width:100%;justify-content:space-between}.history-archive select{flex:1;min-width:0}.history-period-body{padding:0 9px}.history-period-mark{width:30px;height:30px}}

/* Compact history drawers: today, yesterday, and date archive use one pattern. */
.history-day-drawer.history-archive>summary{background:#f8f6f0}
.history-period-mark.archive{background:#edf1f7}
.history-period-mark.archive:before{border-color:#607386;border-radius:2px}
.history-archive-controls{padding:12px 14px;border-bottom:1px solid #e4ebe5;background:#fff}
.history-archive-controls label{display:flex;align-items:center;justify-content:space-between;gap:12px}
.history-archive-controls label>span,.history-archive-controls>span{font-size:10px;font-weight:700;color:#66766d}
.history-archive-controls select{height:38px;min-width:170px;padding:0 34px 0 12px;border:1px solid #cbd7ce;border-radius:7px;background:#fff;color:#263b2f;font-size:10px;font-weight:700;outline:0}
.history-archive-controls select:focus{border-color:#62a783;box-shadow:0 0 0 3px rgba(23,134,83,.08)}
@media(max-width:560px){
  .history-archive-controls{padding:10px}
  .history-archive-controls label{align-items:stretch;flex-direction:column}
  .history-archive-controls select{width:100%;min-width:0}
}

/* Compact drawers for secondary promotion controls. */
.panel-drawer{padding:0!important;min-width:0;overflow:hidden}
.panel-drawer>summary{list-style:none;display:grid;grid-template-columns:minmax(0,1fr) auto 18px;align-items:center;gap:10px;min-height:76px;padding:16px 18px;cursor:pointer;background:#fffefa;transition:background .18s ease}
.panel-drawer>summary::-webkit-details-marker{display:none}
.panel-drawer>summary:hover{background:#f5f9f5}
.panel-drawer>summary:focus-visible{outline:3px solid rgba(23,134,83,.15);outline-offset:-3px}
.panel-drawer>summary>div{min-width:0}
.panel-drawer>summary small{display:block;font-size:9px;letter-spacing:.13em;color:#7c8b82;font-weight:800}
.panel-drawer>summary h2{font:700 15px Manrope;margin:4px 0 0;color:#203128}
.panel-drawer>summary:after{content:"";width:8px;height:8px;border-right:2px solid #6d7d73;border-bottom:2px solid #6d7d73;transform:rotate(45deg) translate(-2px,-2px);transition:transform .18s ease}
.panel-drawer[open]>summary{background:#f1f7f2;border-bottom:1px solid var(--line)}
.panel-drawer[open]>summary:after{transform:rotate(225deg) translate(-1px,-1px)}
.drawer-meta{max-width:130px;padding:6px 9px;border-radius:99px;background:#edf3ef;color:#567063;font-size:9px;font-weight:800;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.panel-drawer[open] .drawer-meta{background:#dff1e6;color:var(--green-dark)}
.panel-drawer-body{padding:14px 18px 18px;min-width:0}
.drawer-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:7px;margin-bottom:12px}
.panel-drawer-body>.muted:first-child{margin-top:0}
.panel-drawer .group-list{max-height:390px}
.panel-drawer.backup-card .backup-destination{margin-top:0}
@media(max-width:520px){
  .panel-drawer>summary{min-height:68px;padding:14px;grid-template-columns:minmax(0,1fr) auto 15px}
  .panel-drawer>summary h2{font-size:14px}
  .drawer-meta{max-width:100px;padding:5px 7px}
  .panel-drawer-body{padding:12px 14px 15px}
  .drawer-toolbar{display:grid;grid-template-columns:1fr 1fr}
  .drawer-toolbar .btn{width:100%;min-width:0;padding:0 8px}
}

.account-manager{margin-bottom:18px;padding:22px 24px}.account-manager-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:18px}.account-manager-head h2,.promo-sender-bar h2{margin:4px 0 5px}.account-manager-head p,.promo-sender-bar p{margin:0;color:var(--muted)}.add-account-form{display:flex;gap:8px;min-width:min(100%,420px)}.add-account-form input{min-width:0;flex:1}.wa-account-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}.wa-account-item{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);background:#f9fcfa;padding:10px;min-height:72px}.wa-account-item.selected{border-color:#15936b;box-shadow:inset 3px 0 #15936b;background:#f1faf6}.wa-account-select{display:flex;align-items:center;gap:10px;border:0;background:transparent;padding:0;text-align:left;min-width:0;cursor:pointer}.wa-account-select>span:last-child{display:grid;min-width:0}.wa-account-select b,.wa-account-select small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wa-account-select small{color:var(--muted);margin-top:3px}.wa-account-avatar{display:grid;place-items:center;width:42px;height:42px;background:#dff4e9;color:#087750;font-weight:800}.wa-account-meta{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:6px}.account-status,.primary-badge{padding:5px 8px;font-size:11px;border:1px solid var(--line);background:#fff}.account-status.ready,.primary-badge{color:#087750;border-color:#a8dac6;background:#eaf8f1}.make-primary,.remove-account{border:0;background:transparent;color:#557069;cursor:pointer;font-size:11px;padding:5px}.remove-account{color:#cf4250}.promo-sender-bar{display:flex;align-items:center;justify-content:space-between;gap:30px;margin-bottom:18px;padding:20px 24px;border-left:4px solid #15936b}.promo-account-field{display:grid;gap:8px;min-width:min(100%,430px)}.promo-account-caption{font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#587068}.promo-account-control{position:relative;display:grid;grid-template-columns:46px minmax(0,1fr) auto 14px;align-items:center;gap:12px;min-height:70px;padding:10px 16px 10px 10px;border:1px solid #b9d6ca;background:linear-gradient(135deg,#fff 0%,#f4faf7 100%);box-shadow:0 7px 20px rgba(22,72,56,.07);transition:border-color .18s,box-shadow .18s,transform .18s}.promo-account-control:hover,.promo-account-control:focus-within{border-color:#15936b;box-shadow:0 9px 24px rgba(13,117,82,.13);transform:translateY(-1px)}.promo-account-mark{display:grid;place-items:center;width:46px;height:46px;background:#15936b;color:#fff;font-size:12px;font-weight:900;letter-spacing:.04em}.promo-account-copy{display:grid;min-width:0;gap:4px}.promo-account-copy b,.promo-account-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.promo-account-copy b{font-size:14px;color:#10251e}.promo-account-copy small{font-size:11px;font-weight:500;color:var(--muted)}.promo-account-status{display:flex;align-items:center;gap:6px;padding:5px 8px;border:1px solid #d5ded9;background:#fff;color:#718078;font-size:10px;font-weight:800;text-transform:uppercase;white-space:nowrap}.promo-account-status i{width:7px;height:7px;border-radius:50%;background:#9aa6a0}.promo-account-status em{font-style:normal}.promo-account-status.ready{border-color:#a9d9c5;background:#eaf8f1;color:#087750}.promo-account-status.ready i{background:#16a36f;box-shadow:0 0 0 3px rgba(22,163,111,.12)}.promo-account-status.waiting{border-color:#ead7a6;background:#fff9e9;color:#976d13}.promo-account-status.waiting i{background:#d89c20}.promo-account-status[data-primary]::after{content:'Utama';margin-left:2px;padding-left:7px;border-left:1px solid currentColor}.promo-account-chevron{width:9px;height:9px;border-right:2px solid #557069;border-bottom:2px solid #557069;transform:rotate(45deg) translateY(-2px)}.promo-account-control select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:16px}
@media(max-width:760px){.account-manager{padding:17px}.account-manager-head,.promo-sender-bar{align-items:stretch;flex-direction:column;gap:14px}.add-account-form{min-width:0;width:100%}.wa-account-list{grid-template-columns:1fr}.wa-account-item{align-items:flex-start}.wa-account-meta{max-width:118px}.promo-account-field{min-width:0;width:100%}.promo-account-control{grid-template-columns:42px minmax(0,1fr) 12px;padding-right:14px}.promo-account-mark{width:42px;height:42px}.promo-account-status{grid-column:2/3;width:max-content;margin-top:1px}.promo-account-chevron{grid-column:3;grid-row:1/3}}

/* Softer sender selector without turning the whole control into a pill. */
.promo-account-control{border-radius:8px}
.promo-account-mark{border-radius:7px}
.promo-account-status{border-radius:999px;padding-left:9px;padding-right:9px}

/* Telegram promo — follows the same visual language as Promosi WA. */
.tg-session-card{margin-bottom:0;padding:25px;border-left:1px solid var(--line);background:var(--panel)}
.tg-session-card .card-head{align-items:flex-start}.tg-connect-layout{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:24px;align-items:center;padding-top:16px;border-top:1px solid var(--line)}
.tg-connect-layout h3,.tg-account-ready h3{margin:0 0 6px}.tg-login-actions{display:flex;gap:10px;margin-top:16px}.tg-qr-box{display:grid;justify-items:center;gap:7px;padding:12px;border:1px solid #b8ddea;background:#fff}.tg-qr-box img{width:180px;height:180px}.tg-qr-box small{color:var(--muted)}
.tg-password-form{grid-column:1/-1;display:flex;align-items:end;gap:10px;padding:15px;background:#f6faf8;border:1px solid var(--line)}.tg-password-form label{display:grid;gap:7px;flex:1}.tg-account-ready{display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:14px;padding-top:16px;border-top:1px solid var(--line)}.tg-avatar{display:grid;place-items:center;width:52px;height:52px;border-radius:12px;background:linear-gradient(145deg,#27a7e7,#157cb5);color:#fff;font-weight:900;box-shadow:0 8px 20px rgba(34,158,217,.22)}
.tg-campaign-card{border-top:3px solid #229ed9}.tg-campaign-card input,.tg-campaign-card textarea{width:100%}.tg-campaign-card textarea{min-height:116px;font-family:inherit;font-size:13px;line-height:1.6}.tg-campaign-card>label{display:block;margin:14px 0 7px;font-weight:750;color:#263d35}.tg-campaign-card>label small{font-weight:500;color:var(--muted)}.legacy-promo-note{display:block;margin:-2px 0 8px;padding:8px 10px;border-left:3px solid #229ed9;background:#edf8fd;color:#476c7d;line-height:1.45}
.tg-interval-row{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-top:14px}.tg-interval-row label{display:grid;gap:7px;font-weight:750}.tg-interval-row label div{display:flex;align-items:center;gap:8px}.tg-interval-row input{width:110px}.tg-interval-row small{color:var(--muted)}.tg-group-row{display:flex;align-items:center;gap:10px;padding:11px 7px;border-bottom:1px solid var(--line);cursor:pointer}.tg-group-row input{width:18px;height:18px;accent-color:#15936b}.tg-group-row span{display:grid;gap:3px}.tg-group-row small{color:var(--muted)}
.tg-run-details{margin:0 14px 12px;border-top:1px solid var(--line);padding-top:9px}.tg-run-details summary{cursor:pointer;color:#29715c;font-weight:700}.tg-run-details p{display:flex;justify-content:space-between;gap:15px;margin:8px 0;padding:7px 9px;background:#f6faf8}.tg-run-details p.failed{color:#b92d3d;background:#fff2f3}.tg-run-details p.sent{color:#087750}.tg-empty-campaign{padding:36px;text-align:center;color:var(--muted)}
@media(max-width:760px){.main-nav{overflow-x:auto;justify-content:flex-start}.nav-item{white-space:nowrap}.tg-connect-layout{grid-template-columns:1fr}.tg-qr-box{justify-self:stretch}.tg-password-form{flex-direction:column;align-items:stretch}.tg-account-ready{grid-template-columns:46px minmax(0,1fr)}.tg-account-ready .btn{grid-column:1/-1}.tg-interval-row{align-items:flex-start;flex-direction:column}.tg-interval-row small{padding-top:0}}

/* Telegram groups, scheduler, and live terminal. */
.groups-card .group-head-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
.tg-group-row{justify-content:flex-start!important;text-align:left}
.tg-group-row>span{display:grid;flex:1;min-width:0;text-align:left}
.tg-group-row b,.tg-group-row small{display:block;width:100%;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}
.tg-group-row input{flex:0 0 auto;margin:0 2px 0 0}
.tg-live-log-drawer{margin-top:16px;overflow:hidden;border-color:#173a31;background:#0f1f1a;color:#d9f7e9}
.tg-live-log-drawer>summary{background:#142b24;color:#e7fff5;border-bottom-color:#23483d}
.tg-live-log-drawer>summary span,.tg-live-log-drawer>summary h2{color:#e7fff5}
.tg-live-log-drawer .drawer-meta{background:#1f493c;color:#8ff0c6}
.tg-terminal-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:12px}
.tg-terminal-head>div:first-child{display:grid;gap:3px;min-width:0}.tg-terminal-head b{color:#f1fff9}.tg-terminal-head small{color:#8db4a6}
.tg-terminal-status{padding:5px 9px;border:1px solid #315d4e;background:#17372d;color:#a4d8c2;font:800 10px ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.08em}
.tg-terminal-status.live{color:#5bffc0;border-color:#26a878}.tg-terminal-status.done{color:#87eac2}.tg-terminal-status.failed{color:#ff9ba7;border-color:#a83c4b}
.tg-terminal-track{height:6px;margin-bottom:12px;overflow:hidden;background:#203b33}.tg-terminal-track i{display:block;width:0;height:100%;background:linear-gradient(90deg,#21a875,#63e5b1);transition:width .3s ease}
.tg-terminal-lines{max-height:320px;overflow:auto;padding:11px 12px;background:#09130f;border:1px solid #23483d;font:11px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;scrollbar-color:#315e50 #0b1713}
.tg-terminal-line{display:grid;grid-template-columns:70px 24px minmax(0,1fr);gap:8px;padding:5px 0;border-bottom:1px solid rgba(103,179,149,.12)}.tg-terminal-line:last-child{border-bottom:0}.tg-terminal-line time{color:#648f80}.tg-terminal-line>b{color:#7eb6a2}.tg-terminal-line>span{min-width:0;color:#d8eee5;overflow-wrap:anywhere}.tg-terminal-line small{display:block;color:#88a99c}.tg-terminal-line.sent small{color:#5fe2aa}.tg-terminal-line.failed small{color:#ff8998}.tg-terminal-line.sending small{color:#f4cb67}.tg-terminal-line.system{grid-template-columns:70px minmax(0,1fr);color:#75d9b0}.tg-terminal-empty{padding:22px;text-align:center;color:#6e9586}
@media(max-width:520px){.groups-card .group-head-actions{grid-template-columns:1fr}.tg-terminal-lines{max-height:260px}.tg-terminal-line{grid-template-columns:58px 20px minmax(0,1fr);gap:6px;font-size:10px}.tg-terminal-line.system{grid-template-columns:58px minmax(0,1fr)}}

/* Telegram uses its own blue identity; WhatsApp remains green. */
#telegramView{--tg-blue:#229ed9;--tg-blue-dark:#147db5;--tg-blue-soft:#e8f6fd;--tg-blue-line:#acd9ee}
#telegramView .eyebrow,#telegramView .card-head small,#telegramView .campaign-toolbar>div>span,#telegramView .panel-drawer>summary small{color:var(--tg-blue-dark)}
#telegramView .btn.primary{background:var(--tg-blue);border-color:var(--tg-blue);color:#fff}#telegramView .btn.primary:hover{background:var(--tg-blue-dark)}
#telegramView .add-campaign-btn{border-color:var(--tg-blue-line);background:var(--tg-blue-soft);color:var(--tg-blue-dark)}
#telegramView .campaign-number,#telegramView .campaign-photo-empty>span{background:var(--tg-blue-soft);color:var(--tg-blue-dark)}
#telegramView .switch input:checked+span,#telegramView .hour.selected{background:var(--tg-blue);border-color:var(--tg-blue)}
#telegramView .tg-campaign-card textarea:focus,#telegramView .tg-campaign-card input:focus{border-color:var(--tg-blue);box-shadow:0 0 0 3px rgba(34,158,217,.12);outline:0}
#telegramView .panel-drawer[open]>summary{background:#eff9fe}#telegramView .panel-drawer[open] .drawer-meta{background:#dff3fd;color:var(--tg-blue-dark)}
#telegramView .tg-group-row input{accent-color:var(--tg-blue)}
#telegramView .tg-group-avatar{background:var(--tg-blue-soft);color:var(--tg-blue-dark)}
#telegramView .add-group input:focus{border-color:var(--tg-blue);box-shadow:0 0 0 3px rgba(34,158,217,.12);outline:0}
#telegramView .tg-group-search{display:flex;align-items:center;gap:9px;margin:12px 14px 0;padding:0 12px;border:1px solid var(--tg-blue-line);border-radius:7px;background:rgba(255,255,255,.88);color:var(--tg-blue-dark)}
#telegramView .tg-group-search:focus-within{border-color:var(--tg-blue);box-shadow:0 0 0 3px rgba(34,158,217,.12)}
#telegramView .tg-group-search input{width:100%;min-width:0;padding:11px 0;border:0;background:transparent;outline:0;color:#183643}
#telegramView .tg-open-group{display:inline-flex;align-items:center;gap:5px;padding:6px 8px;border:1px solid var(--tg-blue-line);border-radius:6px;background:var(--tg-blue-soft);color:var(--tg-blue-dark);font-size:11px;font-weight:800;text-decoration:none}
#telegramView .tg-open-group:hover{border-color:var(--tg-blue);background:#d9f1fc}
#telegramView .bulk-check-btn{border-color:var(--tg-blue-line);background:var(--tg-blue-soft);color:var(--tg-blue-dark)}#telegramView .bulk-check-icon{background:var(--tg-blue)}
#telegramView .history-status.completed{background:#e8f6fd;color:var(--tg-blue-dark)}
#telegramView .promo-account-control:hover,#telegramView .promo-account-control:focus-within{border-color:var(--tg-blue);box-shadow:0 9px 24px rgba(34,158,217,.14)}
#telegramView .promo-state.active i{background:var(--tg-blue);box-shadow:0 0 0 5px rgba(34,158,217,.12)}
#telegramView .tg-live-log-drawer{border-color:#174967;background:#0b2130}#telegramView .tg-live-log-drawer>summary{background:#102f43;border-bottom-color:#20536f}#telegramView .tg-live-log-drawer .drawer-meta{background:#164b69;color:#93dcff}
#telegramView .tg-terminal-track{background:#17394d}#telegramView .tg-terminal-track i{background:linear-gradient(90deg,#168dca,#70d2ff)}#telegramView .tg-terminal-lines{background:#071722;border-color:#20536f;scrollbar-color:#28627f #0a1e2a}
#telegramView .tg-terminal-status.live{color:#71d5ff;border-color:#279bd3}#telegramView .tg-terminal-line.system{color:#72caef}#telegramView .tg-terminal-line.sent small{color:#64d6ac}

.tg-floating-log-toggle{border-color:#246c92;background:#102f43;color:#e9f8ff;box-shadow:0 14px 38px rgba(5,39,59,.28)}
.tg-floating-log-toggle:hover{background:#16415a}.tg-floating-log-toggle.active i{background:#45bff3;box-shadow:0 0 0 5px rgba(69,191,243,.15)}
.tg-floating-log-panel{border-color:#23536d;background:#0a1e2a;color:#e3f7ff;box-shadow:0 24px 80px rgba(3,27,41,.4)}
.tg-floating-log-panel>header{border-bottom-color:#24516a;background:#102f43}.tg-floating-log-panel header small{color:#72caef}.tg-floating-log-panel>header>button{border-color:#32647e;background:#153d53;color:#e7f8ff}.tg-floating-log-panel>header>button:hover{background:#1b4b65}
.tg-floating-log-panel .live-log-summary{border-bottom-color:#20485e;background:#0d2736}.tg-floating-log-panel .live-log-track{background:#173d50}.tg-floating-log-panel .live-log-track i{background:linear-gradient(90deg,#168dca,#70d2ff)}
.tg-floating-log-panel .live-log-lines{background:#05090b;scrollbar-color:#28627f #05090b}.tg-floating-log-panel .live-log-line{border-bottom-color:rgba(79,164,205,.14)}.tg-floating-log-panel .live-log-line.sending{background:rgba(34,158,217,.09)}

/* Telegram campaign mode and per-campaign destinations. */
.tg-mode-modal-card{width:min(620px,100%)}
.tg-mode-modal-card>.tg-mode-options{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:20px}
.tg-mode-option{display:grid;grid-template-columns:48px minmax(0,1fr) 18px;align-items:center;gap:12px;min-height:112px;padding:16px;border:1px solid #c8dbe4;border-radius:9px;background:#f8fcfe;color:#173746;text-align:left;transition:.18s ease}
.tg-mode-option:hover{border-color:#229ed9;background:#eef9fe;box-shadow:0 9px 24px rgba(34,158,217,.13);transform:translateY(-2px)}
.tg-mode-option>span:nth-child(2){display:grid;gap:5px}.tg-mode-option b{font:700 15px Manrope}.tg-mode-option small{color:#647985;line-height:1.5}.tg-mode-option>i{font-style:normal;font-size:20px;color:#229ed9}
.tg-mode-option-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:8px;background:#dff3fd;color:#147db5;font-weight:900}
.tg-mode-option.share .tg-mode-option-icon{background:#eeeafd;color:#6552b7;font-size:20px}
.tg-mode-modal-card>.tg-mode-footer{display:flex;justify-content:flex-end;margin-top:16px}
.tg-mode-badge{display:inline-flex;margin-top:4px;padding:3px 7px;border:1px solid #acd9ee;border-radius:999px;background:#e8f6fd;color:#147db5;font-size:8px;font-weight:900;letter-spacing:.08em}
.tg-mode-badge.share{border-color:#cec5f2;background:#f1edff;color:#6552b7}
.tg-share-editor{display:grid;grid-template-columns:44px minmax(0,1fr);gap:12px;margin:15px 0;padding:15px;border:1px solid #c9c3ea;border-radius:9px;background:#faf9ff}
.tg-share-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:8px;background:#eeeafd;color:#6552b7;font-size:21px;font-weight:900}
.tg-share-editor>div{display:grid;gap:7px}.tg-share-editor label{font-size:11px;font-weight:800}.tg-share-editor input{height:43px;padding:0 12px;border:1px solid #c9c3ea;border-radius:7px;background:#fff}.tg-share-editor small{color:#6f6b83;line-height:1.5}
.tg-campaign-targets{margin:14px 0;border:1px solid #d4e2e9;border-radius:8px;background:#fbfdfe;overflow:hidden}
.tg-campaign-targets>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px;padding:11px 13px;cursor:pointer}.tg-campaign-targets>summary::-webkit-details-marker{display:none}
.tg-campaign-targets>summary>span{display:grid;gap:3px}.tg-campaign-targets>summary b{font-size:11px}.tg-campaign-targets>summary small{font-size:9px;color:var(--muted)}.tg-target-count{padding:5px 8px;border-radius:999px;background:#e8f6fd;color:#147db5;font-size:9px}
.tg-campaign-targets[open]>summary{border-bottom:1px solid #dbe6eb;background:#f0f9fd}
.tg-campaign-target-body{padding:11px}.tg-target-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-bottom:8px}.tg-target-tools>label{display:flex;align-items:center;gap:7px;padding:0 9px;border:1px solid #c7dce6;border-radius:7px;background:#fff;color:#147db5}.tg-target-tools input{min-width:0;height:35px;border:0;background:transparent;outline:0}
.tg-campaign-target-list{max-height:230px;overflow:auto;border:1px solid #e0e9ed;border-radius:7px;background:#fff}.tg-campaign-target-row{display:flex;align-items:center;gap:9px;padding:9px 10px;border-bottom:1px solid #edf2f4;cursor:pointer}.tg-campaign-target-row:last-child{border-bottom:0}.tg-campaign-target-row:hover{background:#f4fafe}.tg-campaign-target-row input{width:17px!important;height:17px;accent-color:#229ed9}.tg-campaign-target-row>span{display:grid;min-width:0;gap:2px}.tg-campaign-target-row b,.tg-campaign-target-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tg-campaign-target-row b{font-size:10px}.tg-campaign-target-row small{font-size:8px;color:var(--muted)}
.tg-campaign-card .campaign-meta{justify-content:flex-end}.tg-campaign-card>.char-count{display:block;margin-top:7px}
@media(max-width:620px){.tg-mode-modal-card>.tg-mode-options{grid-template-columns:1fr}.tg-mode-option{min-height:92px}.tg-share-editor{grid-template-columns:1fr}.tg-share-icon{width:38px;height:38px}.tg-target-tools{grid-template-columns:1fr}.tg-campaign-target-list{max-height:190px}}

/* Full-screen branded backgrounds. View changes set the matching body class. */
body.panel-bg-wa,body.panel-bg-telegram{
  background-color:#eaf2ed;
  background-repeat:no-repeat;
  background-position:center;
  background-size:cover;
  background-attachment:fixed;
}
body.panel-bg-wa{
  background-image:
    linear-gradient(110deg,rgba(232,244,238,.48),rgba(244,249,246,.36) 52%,rgba(225,240,233,.52)),
    url('/assets/wa-panel-bg.jpg');
}
body.panel-bg-telegram{
  background-image:
    linear-gradient(110deg,rgba(244,238,250,.48),rgba(248,246,252,.35) 52%,rgba(234,241,249,.54)),
    url('/assets/telegram-promo-bg.jpg');
}
body.panel-bg-wa .topbar,body.panel-bg-telegram .topbar{
  background:rgba(255,254,250,.9);
}
#sessionView,#promotionView,#telegramView{
  position:relative;
  isolation:isolate;
  min-height:calc(100vh - 142px);
  padding:28px;
  border:1px solid rgba(255,255,255,.52);
  background:rgba(249,252,250,.17);
  box-shadow:0 22px 60px rgba(20,38,30,.12);
}
#sessionView .card,#promotionView .card,#telegramView .card{
  background:rgba(255,255,252,.88);
  box-shadow:0 14px 38px rgba(28,51,40,.1);
}
#telegramView .card{box-shadow:0 14px 38px rgba(49,42,83,.11)}
#sessionView .page-head,#promotionView .page-head,#telegramView .page-head{
  padding:18px 20px;
  border:1px solid rgba(255,255,255,.7);
  background:rgba(255,255,252,.72);
  box-shadow:0 10px 30px rgba(28,51,40,.08);
}
@media(max-width:760px){
  #sessionView,#promotionView,#telegramView{
    min-height:calc(100vh - 112px);
    padding:16px;
  }
  body.panel-bg-wa,body.panel-bg-telegram{background-attachment:scroll;background-position:center top}
  #sessionView .page-head,#promotionView .page-head,#telegramView .page-head{padding:14px}
}
