/* The owner's «Канал» page: the queue as a channel feed on a time rail, posts drawn like Telegram posts. */
:root[data-tab="ch"] { --c1: #2aa3ff; --c2: #ff8a3d; --c3: #2ee6b0; }

.ch-head { display: grid; gap: 6px; margin: 4px 2px 14px; }
.ch-head__name { font: 800 20px/1.1 var(--display); letter-spacing: .01em; }
.ch-head__name a { color: inherit; text-decoration: none; }
.ch-head__name small { font: 600 12px var(--mono); color: var(--dim); margin-left: 8px; }
.ch-head__line { color: var(--dim); font-size: 13px; }
.ch-head__line b { color: var(--ink); font-weight: 700; }

.ch-banner {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.45;
  background: repeating-linear-gradient(135deg, rgba(255, 138, 61, .16) 0 10px, rgba(255, 138, 61, .08) 10px 20px);
  border: 1px solid rgba(255, 138, 61, .45);
}
.ch-banner b { display: block; font: 800 12px/1.3 var(--display); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; color: #ffb27a; }

#ch-root { min-width: 0; max-width: 100%; overflow-x: clip; }
.ch-views { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; margin: 0 0 16px; padding: 2px 0 6px; scrollbar-width: none; }
.ch-views::-webkit-scrollbar { display: none; }
.ch-views .chip { flex: 0 0 auto; }
.ch-views .chip i { font-style: normal; font: 700 11px var(--mono); opacity: .8; }

.ch-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.ch-tools .btn { margin: 0; width: auto; flex: 1 1 140px; padding: 12px 14px; font-size: 11px; }

/* the rail: time on the left, a node per post, the post on the right */
.feed { position: relative; padding-left: 64px; }
.feed::before { content: ''; position: absolute; left: 49px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--c1), color-mix(in oklab, var(--c1) 10%, transparent)); border-radius: 2px; }
.feed__day { position: sticky; top: 8px; z-index: 2; margin: 18px 0 10px -64px; width: max-content;
  padding: 5px 11px; border-radius: 999px; font: 800 11px/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  background: rgba(7, 6, 12, .82); border: 1px solid var(--line-hi); backdrop-filter: blur(8px); }
.feed__day:first-child { margin-top: 0; }
.item { position: relative; margin-bottom: 22px; animation: rise .45s var(--settle) both; }
.item__time { position: absolute; left: -64px; top: 4px; width: 40px; text-align: right; font: 700 12px/1.2 var(--mono); color: var(--ink); }
.item__time small { display: block; font-size: 10px; color: var(--faint); font-weight: 500; }
.item__node { position: absolute; left: -20px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ground);
  border: 3px solid var(--node, var(--faint)); box-shadow: 0 0 0 4px var(--ground), 0 0 14px var(--node, transparent);
  cursor: pointer; transition: transform .3s var(--spring); }
.item[data-st="scheduled"] { --node: #2ee6b0; }
.item[data-st="approved"] { --node: #2aa3ff; }
.item[data-st="draft"] { --node: #8b86a0; }
.item[data-st="failed"] { --node: #ff4d6d; }
.item[data-st="published"] { --node: #ffc23d; }
.item.is-picked .item__node { transform: scale(1.35); background: var(--node); }

.item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 7px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; font: 700 10px/1 var(--text);
  text-transform: uppercase; letter-spacing: .07em; color: var(--dim); background: rgba(255, 255, 255, .05); }
.tag--st { color: #0b0a12; background: var(--node, #8b86a0); }
.tag--mad { color: #ffc23d; background: rgba(255, 194, 61, .12); }
.tag--warn { color: #ff8aa0; background: rgba(255, 77, 109, .14); }
.tag--busy { color: var(--c1); background: color-mix(in oklab, var(--c1) 14%, transparent); }
.tag--busy::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1s infinite alternate; }
@keyframes blink { to { opacity: .2; } }

/* a Telegram channel post, dark theme: the thing Mad will see in the channel */
.tgp { position: relative; max-width: 440px; border-radius: 6px 16px 16px 16px; background: #182533; color: #f5f5f5;
  font: 400 15px/1.38 -apple-system, 'Segoe UI', Roboto, 'Manrope', sans-serif; overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 10px 26px rgba(0, 0, 0, .35); }
.tgp__media { display: grid; gap: 2px; grid-template-columns: repeat(var(--cols, 1), 1fr); background: #0e1621; }
.tgp__media img { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.tgp__media .tgp__ph { display: grid; place-items: center; min-height: 120px; color: #6c7a89; font: 700 12px var(--mono); }
.tgp__media--sticker { background: transparent; padding: 8px 12px 0; }
.tgp__media--sticker img { width: 160px; max-height: 160px; object-fit: contain; }
.tgp__body { padding: 8px 12px 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tgp__body:empty { display: none; }
.tgp__split { padding: 6px 12px 0; font: 600 10px var(--mono); color: #ff8a3d; }
.tgp__tag, .tgp__url { color: #6ab3f3; }
.tgp__body mark { background: rgba(255, 77, 109, .3); color: #ffd5dc; border-radius: 3px; padding: 0 2px; }
.tgp__foot { display: flex; justify-content: flex-end; gap: 6px; padding: 0 10px 6px; font-size: 12px; color: #6d7f8f; }

.item__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-width: 440px; }
.act { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(8, 7, 14, .55); color: var(--ink); font: 700 12px/1 var(--text); }
.act svg { width: 15px; height: 15px; color: var(--c1); }
.act:active { transform: scale(.95); }
.act--go { border-color: transparent; background: linear-gradient(120deg, var(--c1), var(--c3)); color: #06121b; }
.act--go svg { color: #06121b; }
.act--bad svg { color: #ff4d6d; }
.act[disabled] { opacity: .45; }
.item__err { margin-top: 6px; font-size: 12px; color: #ff8aa0; max-width: 440px; }

.ch-empty { overflow-wrap: anywhere; padding: 26px 6px; color: var(--dim); font-size: 14px; line-height: 1.5; }
.ch-empty b { display: block; color: var(--ink); font: 800 17px/1.2 var(--display); margin-bottom: 6px; }

.bulk { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 5; display: flex; gap: 8px; margin-top: 8px; }
.bulk .btn { margin: 0; padding: 15px 14px; font-size: 12px; }

.gen { display: grid; gap: 10px; }
.gen__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gen__state { font-size: 13px; color: var(--dim); }
.gen__state b { color: var(--ink); }

/* settings */
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.slot { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; border-radius: 999px;
  font: 700 14px var(--mono); background: color-mix(in oklab, var(--c1) 16%, rgba(8, 7, 14, .6)); border: 1px solid color-mix(in oklab, var(--c1) 40%, transparent); }
.slot button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: var(--ink); display: grid; place-items: center; }
.slot button svg { width: 12px; height: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row span { font-size: 14px; }
.set-row small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.set-row input[type=time], .set-row input[type=number] { width: 112px; padding: 9px 10px; font: 700 14px var(--mono); }
.sw { position: relative; flex: 0 0 auto; width: 48px; height: 28px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .12); transition: background .3s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); }
.sw[aria-pressed="true"] { background: linear-gradient(120deg, var(--c1), var(--c3)); }
.sw[aria-pressed="true"]::after { transform: translateX(20px); }

/* editor / composer: a sheet over the page, preview under the text */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: rgba(5, 4, 9, .72); backdrop-filter: blur(6px); }
.sheet[hidden] { display: none; }
.sheet__box { margin-top: auto; max-height: 94vh; overflow-y: auto; padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; background: #0d0b16; border-top: 1px solid var(--line-hi); animation: sheet-up .4s var(--settle) both; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet__top h3 { margin: 0; font: 800 15px var(--display); text-transform: uppercase; letter-spacing: .06em; }
.sheet__x { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--ink); display: grid; place-items: center; }
.sheet__x svg { width: 18px; height: 18px; }
.ed-text { min-height: 190px; font: 400 15px/1.5 var(--text); }
.ed-count { display: flex; justify-content: space-between; margin: 6px 2px 12px; font: 600 11px var(--mono); color: var(--faint); }
.ed-count .is-over { color: #ff8a3d; }
.ed-warn { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 77, 109, .1); color: #ffb3c0; font-size: 13px; line-height: 1.45; }
.ed-pics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ed-pic { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: #182533; }
.ed-pic img { width: 100%; height: 100%; object-fit: cover; }
.ed-pic button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; }
.ed-pic button svg { width: 13px; height: 13px; }
.ed-add { width: 84px; height: 84px; border-radius: 10px; border: 1px dashed var(--line-hi); background: transparent; color: var(--dim); font: 700 11px var(--text); }
.ed-label { margin: 14px 2px 8px; font: 700 11px/1 var(--text); text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.ed-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ed-acts .btn { margin: 0; padding: 14px 10px; font-size: 11px; }
.ed-acts .btn--go { grid-column: 1 / -1; }
