/* Threads-style channel creation wizard and channel management pages (js/site-ui/threads-channel-create.js).
   Colours come from the Threads tokens on body.th-app (--bg --text --sub --line --field --pill), so light and dark follow the
   rest of the Threads screens. The page lives in #xpage; body.cc-view is set only while these pages are open. */
body.cc-view{--cc-red:#ff3040;--cc-blue:#0a6fe0}
html.dark body.cc-view,html[data-theme=dark] body.cc-view{--cc-red:#ff453a;--cc-blue:#7aa7ff}

html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage{background:var(--bg,#fff)!important;color:var(--text,#000)!important;padding-bottom:calc(40px + env(safe-area-inset-bottom,0px))!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage>.xtop{background:var(--bg,#fff)!important;color:var(--text,#000)!important;border:0!important;box-shadow:none!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage>.xtop :is(button,a,b,h1,h2,span){color:var(--text,#000)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage>.xtop svg{stroke:var(--text,#000)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage>.xtop>:is(b,h1,h2,strong){font-size:17px!important;font-weight:700!important;letter-spacing:-.3px!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-page{background:none!important;padding:0 14px!important;border:0!important}

.cc-page{max-width:560px;margin:0 auto}
.cc-page,.cc-sheet{font-family:inherit}
.cc-dots{display:flex;gap:6px;justify-content:center;padding:6px 0 14px}
.cc-dots i{width:6px;height:6px;border-radius:50%;background:var(--line,#dbdbdb)}
.cc-dots i.on{background:var(--text,#000)}
.cc-h{margin:6px 0 0;font-size:22px;line-height:1.3;font-weight:700;letter-spacing:-.4px;color:var(--text,#000)}
.cc-sub{margin:6px 0 16px;font-size:14px;line-height:1.5;color:var(--sub,#767676)}
.cc-count{margin:10px 2px 0;font-size:13px;color:var(--sub,#767676);text-align:right}
.cc-lab{padding:22px 4px 8px;font-size:13px;font-weight:600;color:var(--sub,#767676)}
.cc-fine{margin:14px 2px 0;font-size:13px;line-height:1.5;color:var(--sub,#767676)}
.cc-fine a{color:var(--sub,#767676);text-decoration:underline;text-underline-offset:2px}

/* topic chips */
.cc-chips{display:flex;flex-wrap:wrap;gap:8px}
.cc-chip{min-height:36px;padding:0 14px;border:0;border-radius:18px;background:var(--pill,#efefef);color:var(--text,#000);font-size:14px;font-weight:600;line-height:1}
.cc-chip.on{background:var(--text,#000);color:var(--bg,#fff)}
.cc-chip[data-full]:not(.on){opacity:.45}
.cc-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:10px 0 4px}
.cc-tabs::-webkit-scrollbar{display:none}
.cc-tabs .cc-chip{flex:none}

/* kind radios and toggle */
.cc-radios{display:flex;flex-direction:column;gap:10px}
.cc-radio,.cc-toggle{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:16px;background:var(--field,#f3f3f3);border:1.5px solid transparent}
.cc-toggle{margin-top:10px}
.cc-radio.on{border-color:var(--text,#000)}
.cc-radio.off,.cc-toggle.off{opacity:.5}
.cc-txt{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1 1 auto}
.cc-txt b{font-size:15.5px;font-weight:600;color:var(--text,#000);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cc-txt small{font-size:13px;line-height:1.4;color:var(--sub,#767676)}
.cc-rd{flex:none;width:22px;height:22px;border-radius:50%;border:2px solid var(--line,#c7c7c7);position:relative}
.cc-rd.on{border-color:var(--text,#000)}
.cc-rd.on::after{content:"";position:absolute;inset:4px;border-radius:50%;background:var(--text,#000)}
.cc-sw{flex:none;width:46px;height:28px;border-radius:14px;background:var(--line,#c7c7c7);position:relative}
.cc-sw::after{content:"";position:absolute;left:3px;top:3px;width:22px;height:22px;border-radius:50%;background:#fff}
.cc-soon{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:9px;background:var(--pill,#efefef);font-style:normal;font-size:11px;font-weight:600;color:var(--sub,#767676);vertical-align:1px}

/* notes and check row */
.cc-grp{border-radius:16px;background:var(--field,#f3f3f3);overflow:hidden}
.cc-note{padding:13px 16px;display:flex;flex-direction:column;gap:3px}
.cc-note+.cc-note{box-shadow:inset 0 1px 0 var(--line,#e3e3e3)}
.cc-note b{font-size:14.5px;font-weight:600;color:var(--text,#000)}
.cc-note small{font-size:13.5px;line-height:1.5;color:var(--sub,#767676)}
.cc-check{display:flex;align-items:center;gap:12px;width:100%;margin-top:14px;padding:14px 16px;border:0;border-radius:16px;background:var(--field,#f3f3f3);text-align:left;color:var(--text,#000)}
.cc-check>span{flex:none;width:24px;height:24px;border-radius:50%;border:2px solid var(--line,#c7c7c7);display:flex;align-items:center;justify-content:center}
.cc-check>span svg{width:14px;height:14px;stroke:transparent}
.cc-check.on>span{background:var(--text,#000);border-color:var(--text,#000)}
.cc-check.on>span svg{stroke:var(--bg,#fff)}
.cc-check b{font-size:15px;font-weight:600}

/* form fields */
.cc-field{display:block;margin:0 0 12px}
.cc-field>span{display:flex;justify-content:space-between;margin:0 2px 6px;font-size:13px;font-weight:600;color:var(--sub,#767676)}
.cc-field>span small,.cc-fc{font-size:12.5px;font-weight:400;color:var(--sub,#767676)}
.cc-fc{display:block;text-align:right;margin-top:4px}
.cc-field input,.cc-field textarea{display:block;width:100%;box-sizing:border-box;min-height:52px;padding:14px 16px;border:1px solid transparent;border-radius:14px;background:var(--field,#f3f3f3);color:var(--text,#000);font:inherit;font-size:16px;outline:0;resize:none}
.cc-field input:focus,.cc-field textarea:focus{border-color:var(--text,#000)}
.cc-hint{margin:-4px 2px 12px;font-size:12.5px;line-height:1.4;color:var(--sub,#767676);min-height:16px}
.cc-hint.bad{color:var(--cc-red)}
.cc-hint.ok{color:var(--sub,#767676)}

/* preview / header card and rows */
.cc-prev{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;background:var(--field,#f3f3f3)}
.cc-prev .cc-d{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--text,#000);opacity:.85}
.cc-ava{flex:none;width:42px;height:42px;border-radius:50%;background:var(--pill,#e6e6e6);display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--text,#000)}
.cc-ava img{width:100%;height:100%;object-fit:cover}
.cc-ava svg{width:22px;height:22px}
.cc-owner{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:9px;background:var(--pill,#efefef);font-style:normal;font-size:11px;font-weight:600;color:var(--sub,#767676);vertical-align:1px}
.cc-shield{display:inline-flex;margin-left:6px;vertical-align:-3px;color:var(--sub,#767676)}
.cc-shield svg{width:16px;height:16px}

/* wizard footer */
.cc-foot{display:flex;justify-content:space-between;gap:10px;margin-top:22px}
.cc-foot.cc-col{flex-direction:column}
.cc-btn{display:flex;align-items:center;justify-content:center;min-height:50px;padding:0 22px;border:0;border-radius:14px;background:var(--pill,#efefef);color:var(--text,#000);font-size:15px;font-weight:600;text-decoration:none;width:100%;box-sizing:border-box;margin-top:8px}
.cc-foot:not(.cc-col) .cc-btn{width:auto;flex:1 1 0;margin-top:0}
.cc-foot:not(.cc-col)>.cc-btn:first-child{flex:0 0 96px}
.cc-btn.cc-primary{background:var(--text,#000);color:var(--bg,#fff)}
.cc-btn.cc-danger{background:var(--pill,#efefef);color:var(--cc-red)}
.cc-btn[disabled]{opacity:.35}
.cc-foot .cc-btn{margin-top:0}

/* done */
.cc-confetti{position:relative;height:0;overflow:visible;pointer-events:none}
.cc-confetti i{position:absolute;top:-4px;width:7px;height:11px;border-radius:2px;opacity:0;animation:ccFall 1.6s ease-out forwards}
.cc-confetti i:nth-child(3n){background:#4c8dff}.cc-confetti i:nth-child(3n+1){background:#ffb020}.cc-confetti i:nth-child(3n+2){background:#34c38f}
.cc-confetti i:nth-child(1){left:6%;animation-delay:.02s}.cc-confetti i:nth-child(2){left:14%;animation-delay:.12s}.cc-confetti i:nth-child(3){left:23%;animation-delay:.05s}
.cc-confetti i:nth-child(4){left:31%;animation-delay:.2s}.cc-confetti i:nth-child(5){left:40%;animation-delay:.08s}.cc-confetti i:nth-child(6){left:48%;animation-delay:.16s}
.cc-confetti i:nth-child(7){left:56%;animation-delay:.03s}.cc-confetti i:nth-child(8){left:64%;animation-delay:.22s}.cc-confetti i:nth-child(9){left:72%;animation-delay:.1s}
.cc-confetti i:nth-child(10){left:80%;animation-delay:.18s}.cc-confetti i:nth-child(11){left:88%;animation-delay:.06s}.cc-confetti i:nth-child(12){left:94%;animation-delay:.14s}.cc-confetti i:nth-child(13){left:52%;animation-delay:.26s}
@keyframes ccFall{0%{opacity:0;transform:translateY(0) rotate(0)}15%{opacity:1}100%{opacity:0;transform:translateY(120px) rotate(220deg)}}
@media (prefers-reduced-motion:reduce){.cc-confetti{display:none}.cc-sheet,.cc-sbg{transition:none!important}}
th-ico{display:inline-flex}.cc-chk{display:flex;align-items:center;gap:12px;min-height:54px;padding:0 16px;color:var(--text,#000);text-decoration:none}
.cc-chk+.cc-chk{box-shadow:inset 0 1px 0 var(--line,#e3e3e3)}
.cc-chk b{flex:1 1 auto;font-size:15px;font-weight:500}
.cc-tick{flex:none;width:24px;height:24px;border-radius:50%;border:2px solid var(--line,#c7c7c7);display:flex;align-items:center;justify-content:center}
.cc-tick svg{width:13px;height:13px;stroke:var(--sub,#767676)}
.cc-chk>th-ico svg{width:16px;height:16px;stroke:var(--sub,#767676)}

/* management list */
.cc-search{display:flex;align-items:center;gap:10px;margin-top:6px;padding:0 14px;height:44px;border-radius:14px;background:var(--field,#f3f3f3);color:var(--sub,#767676)}
.cc-search th-ico{display:flex;flex:none;margin-right:2px}.cc-search svg{width:18px;height:18px;flex:none}
.cc-search input{flex:1 1 auto;min-width:0;height:100%;border:0;background:none;color:var(--text,#000);font:inherit;font-size:16px;outline:0}
.cc-make{display:flex;align-items:center;gap:12px;min-height:54px;margin-top:10px;padding:0 14px;border-radius:14px;background:var(--field,#f3f3f3);color:var(--text,#000);text-decoration:none}
.cc-make b{flex:1 1 auto;font-size:15px;font-weight:600}
.cc-make svg{width:20px;height:20px}
.cc-make>th-ico:last-child svg{width:16px;height:16px;stroke:var(--sub,#767676)}
.cc-list{display:flex;flex-direction:column}
.cc-row{display:flex;align-items:center;gap:12px;min-height:64px;padding:10px 0;cursor:pointer}
.cc-row+.cc-row{box-shadow:inset 0 1px 0 var(--line,#e3e3e3)}
.cc-row .cc-txt b{display:flex;align-items:center;font-size:15.5px}
.cc-row .cc-txt small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cc-fav{flex:none;width:44px;height:44px;border:0;background:none;color:var(--sub,#767676);display:flex;align-items:center;justify-content:center}
.cc-fav svg{width:20px;height:20px}
.cc-fav.on{color:var(--text,#000)}
.cc-fav.on svg{fill:currentColor}
.cc-join{flex:none;min-width:74px;min-height:34px;padding:0 14px;border-radius:17px;border:1px solid var(--line,#c7c7c7);background:none;color:var(--text,#000);font-size:13.5px;font-weight:600}
.cc-join:not(.on){background:var(--text,#000);color:var(--bg,#fff);border-color:var(--text,#000)}

/* management page rows */
.cc-mrow{display:flex;align-items:center;gap:8px;width:100%;min-height:52px;padding:0 16px;border:0;background:none;color:var(--text,#000);font-size:15px;text-align:left;text-decoration:none}
.cc-mrow+.cc-mrow{box-shadow:inset 0 1px 0 var(--line,#e3e3e3)}
.cc-mrow b{flex:1 1 auto;font-weight:400}
.cc-mrow small{font-size:13.5px;color:var(--sub,#767676);max-width:55%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cc-mrow svg{width:16px;height:16px;stroke:var(--sub,#767676);flex:none}
.cc-mrow.red,.cc-mrow.red b{color:var(--cc-red)}
.cc-mrow.off b{color:var(--sub,#767676)}

/* states */
.cc-state{padding:60px 8px;text-align:center}
.cc-state b{display:block;font-size:17px;font-weight:700;color:var(--text,#000)}
.cc-state p{margin:8px 0 18px;font-size:14px;line-height:1.5;color:var(--sub,#767676)}
.cc-state .cc-btn{width:auto;display:inline-flex}

/* bottom sheet */
.cc-sbg{position:fixed;inset:0;z-index:2147483000;background:rgba(0,0,0,.45);opacity:0;transition:opacity .2s}
.cc-sbg.on{opacity:1}
.cc-sheet{position:fixed;left:0;right:0;bottom:0;z-index:2147483001;max-width:560px;margin:0 auto;padding:10px 16px calc(16px + env(safe-area-inset-bottom,0px));border-radius:22px 22px 0 0;background:var(--bg,#fff);color:var(--text,#000);transform:translateY(100%);transition:transform .25s cubic-bezier(.2,.8,.2,1);box-sizing:border-box}
.cc-sheet.on{transform:none}
.cc-handle{display:block;width:36px;height:4px;margin:0 auto 14px;border-radius:2px;background:var(--line,#c7c7c7)}
.cc-st{margin:0 0 6px;text-align:center;font-size:17px;font-weight:700;color:var(--text,#000)}
.cc-sp{margin:0 0 14px;text-align:center;font-size:14px;line-height:1.5;color:var(--sub,#767676)}

/* beat the older global form / button rules (inputs, textareas, buttons inside the page and the sheets) */
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-field :is(input,textarea),html:root:root:root:root:root:root:root:root .cc-sheet .cc-field :is(input,textarea){border:1px solid transparent!important;border-radius:14px!important;background:var(--field,#f3f3f3)!important;color:var(--text,#000)!important;min-height:52px!important;padding:14px 16px!important;font-size:16px!important;box-shadow:none!important;width:100%!important;box-sizing:border-box!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-field :is(input,textarea):focus,html:root:root:root:root:root:root:root:root .cc-sheet .cc-field :is(input,textarea):focus{border-color:var(--text,#000)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-search input{border:0!important;background:none!important;min-height:0!important;padding:0!important;height:100%!important;margin:0!important;border-radius:0!important;box-shadow:none!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-btn,html:root:root:root:root:root:root:root:root .cc-sheet .cc-btn{border:0!important;border-radius:14px!important;min-height:50px!important;background:var(--pill,#efefef)!important;color:var(--text,#000)!important;font-size:15px!important;font-weight:600!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-btn.cc-primary,html:root:root:root:root:root:root:root:root .cc-sheet .cc-btn.cc-primary{background:var(--text,#000)!important;color:var(--bg,#fff)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-btn.cc-danger,html:root:root:root:root:root:root:root:root .cc-sheet .cc-btn.cc-danger{color:var(--cc-red,#ff3040)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-btn[disabled],html:root:root:root:root:root:root:root:root .cc-sheet .cc-btn[disabled]{opacity:.35!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage :is(.cc-chip,.cc-join,.cc-mrow,.cc-check,.cc-fav){border-radius:inherit}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-chip{border:0!important;border-radius:18px!important;min-height:36px!important;background:var(--pill,#efefef)!important;color:var(--text,#000)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-chip.on{background:var(--text,#000)!important;color:var(--bg,#fff)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-join{border-radius:17px!important;min-height:34px!important;border:1px solid var(--line,#c7c7c7)!important;background:none!important;color:var(--text,#000)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-join:not(.on){background:var(--text,#000)!important;color:var(--bg,#fff)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-mrow{border:0!important;border-radius:0!important;background:none!important;min-height:52px!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage .cc-check{border:0!important;border-radius:16px!important;background:var(--field,#f3f3f3)!important}
html:root:root:root:root:root:root:root:root body.cc-view #xpage#xpage :is(.cc-fav){border:0!important;background:none!important;min-height:44px!important}