/* Autopost, settings, and the shared switch, chips and sheet. */
.switch { position: relative; display: inline-flex; flex: none; width: 46px; height: 28px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: inherit; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--strong-line); transition: background .2s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .22s var(--ease); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--b2) 25%, transparent); }
.switch.disabled { opacity: .45; cursor: not-allowed; }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 7px 13px; font-size: 13px; font-weight: 600; background: var(--card); color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; }
.chip:hover { background: var(--hover); box-shadow: none; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.chip .icon { width: 14px; height: 14px; }
.pf-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 9px; font-weight: 800; color: #fff; flex: none; }
.pf-logo { display: inline-grid; place-items: center; border-radius: 28%; color: #fff; flex: none; }
.pf-logo .icon { width: 58%; height: 58%; }
.pf-tiktok { background: #111; box-shadow: inset 2px 0 0 #25f4ee, inset -2px 0 0 #fe2c55; }
.pf-instagram { background: linear-gradient(45deg, #feda75, #fa7e1e 30%, #d62976 60%, #962fbf 85%, #4f5bd5); }
.pf-youtube { background: #ff0033; }
.pf-facebook { background: #1877f2; } .pf-linkedin { background: #0a66c2; } .pf-x, .pf-threads { background: #111; }
.pf-pinterest { background: #e60023; } .pf-google_business { background: #4285f4; } .pf-telegram { background: #26a5e4; }
.pf-discord { background: #5865f2; } .pf-mastodon { background: #6364ff; } .pf-wordpress { background: #21759b; }

.sheet { width: min(620px, calc(100vw - 32px)); max-height: min(86vh, 780px); padding: 0; border: 0; border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(10, 10, 20, .4); backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-size: 19px; }
.sheet-body { padding: 8px 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { font-weight: 400; color: var(--ink); width: 100%; }
.field textarea { resize: vertical; }
button.danger.solid { background: var(--danger); color: #fff; border-color: transparent; font-weight: 600; }

/* Autopost */
.autopost { max-width: 1180px; padding-bottom: 150px; }
.brand-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.brand-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.brand-pill img, .brand-pill .avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: contain; font-size: 11px; }
.brand-pill img { background: #fff; }
.brand-pill.on { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.ap-hero { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 26px; margin-bottom: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--b1) 10%, var(--card)), color-mix(in srgb, var(--b3) 10%, var(--card))); border: 1px solid var(--line); }
.ap-hero h2 { margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: -.02em; }
.ap-hero p { margin: 3px 0 0; color: var(--muted); }
.ap-hero.live { background: linear-gradient(135deg, color-mix(in srgb, var(--success) 14%, var(--card)), color-mix(in srgb, var(--b1) 10%, var(--card))); }
.facts { margin-top: 12px; gap: 6px; }
.fact { font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-sm); }
.ap-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ap-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ap-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; }
.ap-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ap-card h2 { margin: 0; font-family: var(--display); font-size: 17px; letter-spacing: -.015em; }
.ap-card-head p { margin: 2px 0 0; font-size: 13px; }
.ap-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 34px 16px; color: var(--muted); border-radius: 16px; background: var(--side); }
.ap-empty .icon { width: 28px; height: 28px; }
.ap-empty p { margin: 0; max-width: 300px; }
.queue-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; transition: background .15s; }
.queue-row:hover { background: var(--side); }
.queue-row.failed { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.queue-thumb { width: 52px; height: 76px; border-radius: 10px; object-fit: cover; background: var(--raise); display: grid; place-items: center; color: var(--muted); flex: none; }
.queue-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.queue-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-text .muted { display: flex; align-items: center; gap: 5px; font-size: 12.5px; }
.queue-text .muted .icon { width: 13px; height: 13px; }
.queue-text .error { margin: 0; font-size: 12.5px; }
.queue-text .row { gap: 4px; }
.queue-actions { display: flex; align-items: center; gap: 2px; }
.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.channel { flex-direction: column; gap: 5px; padding: 14px 8px 12px; border-radius: 18px; background: var(--side); color: var(--ink); border: 1px solid transparent; box-shadow: none; font-weight: 600; }
.channel:hover { background: var(--hover); box-shadow: none; }
.channel small { font-size: 11.5px; color: var(--muted); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel.connected small { color: var(--success); }
.channel.reconnect small { color: var(--danger); }
.channel-logo { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; font-weight: 800; font-size: 14px; }
.channel.soon .channel-logo { filter: grayscale(1); opacity: .45; }
.channel .badge { position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; border: 2px solid var(--side); background: var(--muted); }
.channel .badge .icon { width: 11px; height: 11px; stroke-width: 3; }
.channel.connected .badge { background: var(--success); }
.channel.connect .badge { background: var(--link); }
.channel.reconnect .badge { background: var(--danger); }
.channel.soon .badge { display: none; }
.plan-row { display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: center; }
.plan-row.top { align-items: start; }
.plan-label { font-size: 13px; font-weight: 700; color: var(--ink-2); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 4px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--raise); gap: 2px; justify-self: start; }
.segmented button { width: 42px; padding: 7px 0; border-radius: 9px; background: transparent; color: var(--ink-2); box-shadow: none; }
.segmented button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.times { display: flex; flex-direction: column; gap: 8px; }
.time-day { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.time-dayname { width: 38px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.time-chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 11px; border-radius: 999px; background: var(--side); font-size: 13px; font-weight: 600; }
.time-x { width: 22px; height: 22px; padding: 0; background: transparent; color: var(--muted); box-shadow: none; }
.time-x:hover { background: var(--hover); box-shadow: none; }
.time-x .icon { width: 12px; height: 12px; }
.add-time { margin-top: 4px; gap: 6px; }
.add-time select, .add-time input { padding: 6px 10px; font-size: 13px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; }
.opt p { margin: 2px 0 0; font-size: 13px; }
.refill { gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--side); }
.num { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.num input { width: 92px; padding: 6px 10px; }
.ap-assistant { position: sticky; bottom: 0; margin: 26px -12px 0; padding: 14px 12px 18px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(transparent, var(--bg) 28%); }
.ap-reply { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 18px 18px 18px 6px; background: var(--side); max-width: 640px; font-size: 14px; line-height: 1.45; }
.ap-reply[hidden] { display: none; }
.chip.idea { background: var(--glass); backdrop-filter: blur(10px); }
.ap-field { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ap-field input { flex: 1; border: 0; padding: 8px 0; background: transparent; box-shadow: none; }
.ap-field .send { width: 38px; height: 38px; padding: 0; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pick { position: relative; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px; border-radius: 16px; background: var(--side); color: var(--ink); border: 2px solid transparent; box-shadow: none; font-weight: 500; }
.pick:hover { box-shadow: none; background: var(--hover); }
.pick img, .pick > span:first-child { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 11px; background: var(--raise); display: grid; place-items: center; }
.pick-title { font-size: 12px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-check { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .35); border: 2px solid #fff; color: transparent; }
.pick-check .icon { width: 13px; height: 13px; stroke-width: 3; }
.pick[aria-pressed="true"] { border-color: var(--link); }
.pick[aria-pressed="true"] .pick-check { background: var(--link); color: #fff; }


@media (max-width: 980px) {
  .ap-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .plan-row { grid-template-columns: 1fr; gap: 6px; }
  .ap-hero { flex-wrap: wrap; }
}
