/* The campaign builder (docs/UI-REDESIGN-PLAN.md step 2): a full-screen,
   four-step page over the app. Tokens and parts come from rl-ui.css and
   rl-parts.css, the filter panel from rl-page.css; only what is the builder's
   own lives here. Classes are rl-cb-*, scoped under .rlx like everything else. */
.rl-cb-host{position:fixed;inset:0;z-index:2500;background:var(--rl-bg,#f6f7fa)}
body.rl-cb-open{overflow:hidden}
.rlx.rl-cb{height:100%;display:flex;flex-direction:column;background:var(--rl-bg)}
.rlx .rl-cb-top{flex:none;display:flex;align-items:center;gap:14px;height:64px;padding:0 20px;background:rgba(255,255,255,.92);backdrop-filter:blur(12px);border-bottom:1px solid var(--rl-line);box-shadow:0 10px 24px -22px rgba(16,24,40,.45)}
.rlx .rl-cb-name{flex:0 1 300px;min-width:120px}
.rlx .rl-cb-name small{display:block;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--rl-ink3)}
.rlx .rl-cb-name input.rl-bare{width:100%;font-size:16px!important;font-weight:800;letter-spacing:-.02em;text-overflow:ellipsis}
.rlx .rl-cb-top .rl-wsteps{flex:1;max-width:560px;margin:0 auto;padding:0}
.rlx .rl-cb-top .rl-wsteps .s{cursor:pointer}
.rlx .rl-cb-saved{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--rl-ink3);white-space:nowrap}
.rlx .rl-cb-saved .rl-ic{color:var(--rl-ok)}
.rlx .rl-cb-bar{display:none}
.rlx .rl-cb-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 372px;gap:20px;padding:20px}
.rlx .rl-cb-main{min-height:0;display:flex;flex-direction:column;border:1px solid var(--rl-line);border-radius:var(--rl-r16);background:#fff;box-shadow:var(--rl-sh-sm);overflow:hidden}
.rlx .rl-cb-scroll{flex:1;min-height:0;overflow:auto;padding:24px}
.rlx .rl-cb-scroll.is-flush{padding:0;display:flex;flex-direction:column;overflow:hidden auto}
.rlx .rl-cb-col{max-width:720px}
.rlx .rl-cb-h{font-size:19px;font-weight:800;letter-spacing:-.02em;margin:0}
.rlx .rl-cb-p{font-size:13.5px;color:var(--rl-ink3);margin:3px 0 20px}
.rlx .rl-cb-foot{flex:none;display:flex;align-items:center;gap:10px;padding:14px 20px;border-top:1px solid var(--rl-line);background:#fcfcfd}
.rlx .rl-cb-foot .why{font-size:12.5px;color:var(--rl-ink3);display:flex;align-items:center;gap:6px}
.rlx .rl-cb-foot .sp{flex:1}
.rlx .rl-cb-sec{margin-top:24px;padding-top:22px;border-top:1px solid #f0f1f5}
.rlx .rl-cb-sec>h3{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:700;margin:0 0 3px}
.rlx .rl-cb-sec>p{font-size:12.5px;color:var(--rl-ink3);margin:0 0 12px}
.rlx .rl-choice .rl-tile{width:38px;height:38px}
.rlx .rl-cb-types{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.rlx .rl-cb-types .rl-choice{flex-direction:column;align-items:flex-start;gap:10px;height:100%}
.rlx .rl-cb-map{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}

/* audience step: AI strip, the real filter panel, the matched people */
.rlx .rl-cb-ask{flex:none;margin:16px 16px 0;padding:14px 16px}
.rlx .rl-cb-ask .row{display:flex;align-items:center;gap:11px;color:#ff8a70}
.rlx .rl-cb-ask input.rl-bare{font-size:15px!important;color:#fff!important}
.rlx .rl-cb-ask input::placeholder{color:#7d8498}
.rlx .rl-cb-quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.rlx .rl-cb-quick button{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 11px;border-radius:99px;background:rgba(255,255,255,.07);box-shadow:inset 0 0 0 1px rgba(255,255,255,.1);color:#d5d9e4;font-size:12.5px;font-weight:500;white-space:nowrap}
.rlx .rl-cb-quick button:hover,.rlx .rl-cb-quick button.is-on{background:rgba(255,255,255,.16);color:#fff}
.rlx .rl-cb-quick button b{font-weight:800;color:#fff;font-variant-numeric:tabular-nums}
.rlx .rl-cb-ask .note{margin-top:10px;font-size:12px;color:#8e95a8}
.rlx .rl-cb-aud{flex:1 0 0;min-height:460px;display:flex;margin:16px;border:1px solid var(--rl-line);border-radius:var(--rl-r12);overflow:hidden}
.rlx .rl-cb-aud .rl-pf{width:280px}
.rlx .rl-cb-people{flex:1;min-width:0;display:flex;flex-direction:column}
.rlx .rl-cb-people .hd{flex:none;display:flex;align-items:center;gap:10px;padding:11px 14px;border-bottom:1px solid var(--rl-line);font-size:13.5px;color:var(--rl-ink2)}
.rlx .rl-cb-people .hd b{color:var(--rl-ink)}
.rlx .rl-cb-people .hd>span{white-space:nowrap}
.rlx .rl-cb-people .list{flex:1;min-height:0;overflow:auto}
.rlx .rl-cb-person{display:flex;align-items:center;gap:11px;padding:9px 14px;border-bottom:1px solid #f0f1f5}
.rlx .rl-cb-person b{display:block;font-size:13.5px;font-weight:700}
.rlx .rl-cb-person span{font-size:12px;color:var(--rl-ink3)}
.rlx .rl-cb-person .rl-tag{margin-left:auto;max-width:170px}
.rlx .rl-cb-person .rl-av{width:30px;height:30px;font-size:10.5px}

/* right rail */
.rlx .rl-cb-rail{min-height:0;display:flex;flex-direction:column;gap:14px;overflow:auto;scrollbar-width:none}
.rlx .rl-cb-card{flex:none;border:1px solid var(--rl-line);border-radius:var(--rl-r16);background:#fff;box-shadow:var(--rl-sh-sm);padding:16px}
.rlx .rl-cb-card>h4{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--rl-ink3);margin:0 0 12px}
.rlx .rl-cb-card>h4 .r{margin-left:auto;text-transform:none;letter-spacing:0;font-size:12px}
.rlx .rl-cb-big{font-size:34px;font-weight:800;letter-spacing:-.04em;line-height:1;font-variant-numeric:tabular-nums}
.rlx .rl-cb-big small{display:block;margin-top:6px;font-size:13px;font-weight:500;letter-spacing:0;color:var(--rl-ink3)}
.rlx .rl-cb-check{display:flex;align-items:flex-start;gap:10px;padding:8px 0;font-size:13px;border-top:1px solid #f0f1f5}
.rlx .rl-cb-check:first-of-type{border-top:0;padding-top:0}
.rlx .rl-cb-check .k{flex:none;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;color:#fff;background:var(--rl-ok)}
.rlx .rl-cb-check.is-todo .k{background:var(--rl-surface3);color:var(--rl-ink3)}
.rlx .rl-cb-check.is-bad .k{background:var(--rl-warn)}
.rlx .rl-cb-check b{display:block;font-weight:700}
.rlx .rl-cb-check span{color:var(--rl-ink3);font-size:12.5px}
.rlx .rl-cb-check a{margin-left:auto;font-size:12.5px;font-weight:700;color:var(--rl-acc2);cursor:pointer;white-space:nowrap}

/* the phone preview (our own drawing of a chat, not a copy of any app's UI) */
.rlx .rl-cb-phone{margin:0 auto;width:286px;border-radius:30px;padding:9px;background:linear-gradient(160deg,#2a2f3d,#11141b);box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 24px 40px -18px rgba(16,24,40,.5)}
.rlx .rl-cb-phone.is-ios{border-radius:38px}
.rlx .rl-cb-screen{border-radius:22px;overflow:hidden;background:#efe9e1;display:flex;flex-direction:column;height:456px}
.rlx .rl-cb-phone.is-ios .rl-cb-screen{border-radius:30px}
.rlx .rl-cb-chat-hd{flex:none;display:flex;align-items:center;gap:9px;padding:10px 12px;background:#fff;border-bottom:1px solid rgba(16,24,40,.06);font-size:13px;font-weight:700}
/* Scoped to the text block. A bare descendant `span` rule also matches the
   tile or avatar beside it, which are <span>s, and flattening their grid drops
   the icon to the top of the box. */
.rlx .rl-cb-chat-hd div span{display:block;font-size:10.5px;font-weight:500;color:var(--rl-ink3)}
.rlx .rl-cb-chat{flex:1;overflow:auto;padding:12px 10px;scrollbar-width:none}
.rlx .rl-cb-day{margin:0 auto 10px;width:max-content;padding:3px 9px;border-radius:7px;background:rgba(255,255,255,.85);font-size:10.5px;font-weight:600;color:var(--rl-ink3)}
.rlx .rl-cb-bubble{max-width:92%;border-radius:4px 14px 14px 14px;background:#fff;box-shadow:0 1px 1px rgba(16,24,40,.1);overflow:hidden;font-size:12.5px;line-height:1.45;color:#16181d}
.rlx .rl-cb-media{height:118px;display:grid;place-items:center;color:#fff;background:radial-gradient(90% 120% at 10% 0%,rgba(241,91,65,.9),transparent 60%),linear-gradient(135deg,#262b3b,#141722);font-size:12px;font-weight:700;letter-spacing:.02em;text-align:center;gap:6px}
.rlx .rl-cb-media.is-empty{background:repeating-linear-gradient(45deg,#f1f3f7,#f1f3f7 8px,#e8ebf1 8px,#e8ebf1 16px);color:var(--rl-ink3)}
/* The header with the real file in it: the picture, the video's own frame, or
   the PDF's first page. The gradient tile above is only for "nothing attached
   yet" now. */
.rlx .rl-cb-media.is-real{position:relative;height:auto;padding:0;overflow:hidden;background:#0b0d12}
.rlx .rl-cb-media.is-real img,.rlx .rl-cb-media.is-real video{display:block;width:100%;max-height:170px;object-fit:cover}
.rlx .rl-cb-media.is-real object{display:block;width:100%;height:158px;border:0;background:#fff;pointer-events:none}
.rlx .rl-cb-btext{padding:8px 10px 4px;white-space:pre-wrap;word-break:break-word}
.rlx .rl-cb-btext .v{background:#fff1ed;color:var(--rl-acc2);border-radius:4px;padding:0 2px;margin:0 -1px;font-weight:600}
.rlx .rl-cb-btext .v.is-miss{background:#fff1f3;color:var(--rl-danger)}
.rlx .rl-cb-time{padding:0 10px 6px;text-align:right;font-size:10px;color:var(--rl-ink3)}
.rlx .rl-cb-bbtn{display:flex;align-items:center;justify-content:center;gap:6px;height:36px;border-top:1px solid #eef0f4;font-size:12.5px;font-weight:700;color:#0b7fc2}
.rlx .rl-cb-reply{margin:8px 0 0 auto;max-width:80%;padding:7px 10px;border-radius:14px 4px 14px 14px;background:#d9f7c8;font-size:12.5px;box-shadow:0 1px 1px rgba(16,24,40,.1)}
.rlx .rl-cb-auto{margin-top:8px}

/* message step */
.rlx .rl-cb-tpl{display:flex;align-items:center;gap:13px;padding:13px;border-radius:var(--rl-r12);box-shadow:inset 0 0 0 1px var(--rl-line)}
.rlx .rl-cb-tpl .t{flex:1;min-width:0}
.rlx .rl-cb-tpl .t b{display:block;font-size:14px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:600}
.rlx .rl-cb-tpl .t span{font-size:12.5px;color:var(--rl-ink3)}
.rlx .rl-cb-var{display:grid;grid-template-columns:54px minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:start;padding:12px 0;border-top:1px solid #f0f1f5}
.rlx .rl-cb-var:first-of-type{border-top:0}
.rlx .rl-cb-var .n{height:42px;display:grid;place-items:center;border-radius:var(--rl-r10);background:var(--rl-acc-soft);color:var(--rl-acc2);font-weight:800;font-size:13px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.rlx .rl-cb-var.is-miss .n{background:#fff1f3;color:var(--rl-danger)}
.rlx .rl-cb-breply{display:grid;grid-template-columns:minmax(0,190px) minmax(0,1fr);gap:10px;align-items:start;padding:10px 0;border-top:1px solid #f0f1f5}
/* The reply is a real message: WhatsApp shows the line breaks, so Enter has
   to make one. An <input> silently cannot, which is why it is a textarea. */
.rlx .rl-cb-rtext{min-height:60px;height:auto;resize:vertical;line-height:1.55;padding-top:9px;padding-bottom:9px;white-space:pre-wrap}
.rlx .rl-cb-breply .rl-tag{margin-top:3px}
.rlx .rl-cb-breply:first-of-type{border-top:0}
.rlx .rl-cb-upload{display:flex;align-items:center;gap:12px;padding:12px;border-radius:var(--rl-r12);box-shadow:inset 0 0 0 1px var(--rl-line)}
.rlx .rl-cb-upload .th{position:relative;flex:none;width:54px;height:54px;border-radius:10px;overflow:hidden;background:radial-gradient(90% 120% at 10% 0%,rgba(241,91,65,.9),transparent 60%),linear-gradient(135deg,#262b3b,#141722)}
.rlx .rl-cb-upload .th.is-real{background:var(--rl-surface3)}
.rlx .rl-cb-upload .th img,.rlx .rl-cb-upload .th video{display:block;width:100%;height:100%;object-fit:cover}
.rlx .rl-cb-upload .th object{position:absolute;top:0;left:0;width:calc(100% + 17px);height:100%;border:0;background:#fff;pointer-events:none}
.rlx .rl-cb-upload .th .rl-md-play{width:22px;height:22px}
.rlx .rl-cb-upload .t{flex:1;min-width:0}.rlx .rl-cb-upload b{display:block;font-size:13.5px}.rlx .rl-cb-upload span{font-size:12.5px;color:var(--rl-ink3)}

/* launch */
.rlx .rl-cb-go{display:flex;align-items:center;gap:14px;padding:14px 16px}
.rlx .rl-cb-go .n{font-size:30px;font-weight:800;letter-spacing:-.04em;color:#fff;font-variant-numeric:tabular-nums;min-width:40px}
.rlx .rl-cb-go .t{flex:1}.rlx .rl-cb-go b{color:#fff;display:block}.rlx .rl-cb-go span{font-size:12.5px;color:#b9bfce}
.rlx .rl-cb-prog{height:8px;border-radius:9px;background:var(--rl-surface3);overflow:hidden}
.rlx .rl-cb-prog i{display:block;height:100%;border-radius:9px;background:linear-gradient(90deg,#f56a51,#ec4f33);transition:width .3s}
.rlx .rl-cb-only-ph,.rlx .rl-btn.rl-cb-only-ph,.rlx .rl-btn.rl-cb-only-sm{display:none}

@media (max-width:1280px){.rlx .rl-cb-body{grid-template-columns:minmax(0,1fr) 320px}.rlx .rl-cb-aud .rl-pf{width:256px}.rlx .rl-cb-phone{width:260px}}
/* A short window: the AI strip gives its height back to the filter. */
@media (max-height:860px){.rlx .rl-cb-ask{padding:10px 14px}.rlx .rl-cb-ask .note{display:none}.rlx .rl-cb-quick{margin-top:9px}.rlx .rl-cb-body{padding:14px;gap:14px}.rlx .rl-cb-aud{margin:12px}}
/* No room for the rail (a small laptop window, a tablet): it folds into the
   page — the sum becomes a bar over the list, the preview a button. */
@media (max-width:1100px){
  .rlx .rl-cb-body{grid-template-columns:minmax(0,1fr)}
  .rlx .rl-cb-rail{display:none}
  .rlx .rl-cb-only-ph{display:block}
  .rlx .rl-btn.rl-cb-only-ph{display:inline-flex}
  .rlx .rl-cb-top .rl-wsteps .s span{display:none}
  .rlx .rl-cb-saved{display:none}
  .rlx .rl-cb-sumbar{flex:none;display:flex;align-items:center;gap:10px;margin:12px 16px 0;padding:10px 14px;border-radius:var(--rl-r12);background:#fff;box-shadow:inset 0 0 0 1px var(--rl-line);font-size:13px;text-align:left;width:calc(100% - 32px)}
  .rlx .rl-cb-sumbar b{font-size:18px;font-weight:800;letter-spacing:-.02em}
  .rlx .rl-cb-sumbar .go{margin-left:auto;color:var(--rl-acc2);font-weight:700;font-size:12.5px}
}
@media (max-width:760px){
  .rlx .rl-cb-top{height:56px;padding:0 12px;gap:8px}
  .rlx .rl-cb-top .rl-wsteps,.rlx .rl-cb-saved,.rlx .rl-cb-top .rl-hide-ph{display:none}
  .rlx .rl-cb-name{flex:1}
  .rlx .rl-cb-bar{flex:none;display:block;padding:10px 16px 0;background:#fff}
  .rlx .rl-cb-bar .segs{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}
  .rlx .rl-cb-bar .segs i{height:4px;border-radius:4px;background:var(--rl-surface3)}
  .rlx .rl-cb-bar .segs i.is-done{background:var(--rl-ok)}.rlx .rl-cb-bar .segs i.is-on{background:var(--rl-acc)}
  .rlx .rl-cb-bar p{margin:8px 0 10px;font-size:12px;font-weight:600;color:var(--rl-ink3)}.rlx .rl-cb-bar p b{color:var(--rl-ink)}
  .rlx .rl-cb-body{display:block;padding:0;overflow:hidden}
  .rlx .rl-cb-main{height:100%;border:0;border-radius:0;box-shadow:none}
  .rlx .rl-cb-scroll{padding:18px 16px 22px}
  .rlx .rl-btn.rl-cb-only-sm{display:inline-flex}
  .rlx .rl-cb-types,.rlx .rl-cb-map{grid-template-columns:1fr}
  .rlx .rl-cb-types .rl-choice{flex-direction:row;align-items:center}
  .rlx .rl-cb-ask{margin:12px 12px 0}
  .rlx .rl-cb-quick{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-right:-16px;padding-right:16px}
  .rlx .rl-cb-aud{margin:12px 0 0;border-width:1px 0 0;border-radius:0;min-height:0;flex:1 1 0}
  .rlx .rl-cb-scroll.is-flush{overflow:hidden}
  .rlx .rl-cb-aud .rl-pf{width:auto}
  .rlx .rl-cb-person .rl-tag{display:none}
  .rlx .rl-cb-sumbar{margin:12px 12px 0;width:calc(100% - 24px)}
  .rlx .rl-cb-var{grid-template-columns:44px minmax(0,1fr)}
  .rlx .rl-cb-var>:nth-child(3){grid-column:2}
  .rlx .rl-cb-breply{grid-template-columns:1fr}
  .rlx .rl-cb-foot{padding:10px 12px calc(10px + env(safe-area-inset-bottom))}
  .rlx .rl-cb-foot .why{display:none}
  .rlx .rl-cb-foot .rl-btn{height:46px;min-height:46px!important;border-radius:var(--rl-r12)!important}
  .rlx .rl-cb-foot .rl-btn.is-grow{flex:1}
}
