#affiliateRoot{min-width:0}#affiliateRoot .af-header{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}#affiliateRoot .af-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}#affiliateRoot button{cursor:pointer;min-height:40px;padding:8px 13px;border:1px solid var(--line,#ddd);border-radius:10px;background:var(--surface2,#f4f4f7);color:inherit}#affiliateRoot button[aria-pressed=true],#affiliateRoot button[type=submit]{background:var(--brand,#7252de);color:white}#affiliateRoot button:disabled{opacity:.55;cursor:wait}#affiliateRoot .af-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}#affiliateRoot .af-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}#affiliateRoot .af-kpi{padding:16px;border:1px solid var(--line,#ddd);border-radius:14px}#affiliateRoot .af-kpi strong{display:block;margin-top:10px;font-size:22px}#affiliateRoot .af-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid var(--line,#ddd)}#affiliateRoot .af-item>div{min-width:0;overflow-wrap:anywhere}#affiliateRoot .af-muted,#affiliateRoot .af-foot{color:var(--muted,#777)}#affiliateRoot .af-note{padding:14px;background:var(--surface2,#f4f4f7);border-radius:12px;margin:16px 0;line-height:1.6}#affiliateRoot label{display:block}#affiliateRoot input:not([type=checkbox]),#affiliateRoot select,#affiliateRoot textarea{display:block;width:100%;box-sizing:border-box;margin:6px 0 16px;padding:10px;border:1px solid var(--line,#ddd);border-radius:8px;background:var(--surface,#fff);color:inherit;font:inherit}#affiliateRoot #afFocus{max-width:680px}#affiliateRoot .af-step{padding:14px 0;border-bottom:1px solid var(--line,#ddd)}#affiliateRoot .af-step p{margin-left:24px;line-height:1.65}#affiliateRoot .af-dialog{box-sizing:border-box;width:min(720px,94vw);max-height:88dvh;overflow:auto;border:1px solid var(--line,#ddd);border-radius:18px;padding:24px;background:var(--surface,#fff);color:inherit}#affiliateRoot .af-dialog::backdrop{background:#0008}#affiliateRoot .af-dialog h3{flex:1}#affiliateRoot .af-edit-message{white-space:pre-wrap}#affiliateRoot [role=status]{overflow-wrap:anywhere}#affiliateRoot .af-empty{padding:30px 12px;text-align:center}@media(max-width:600px){#affiliateRoot .af-dialog{padding:16px}#affiliateRoot .af-kpis{grid-template-columns:1fr 1fr}#affiliateRoot .af-kpi strong{font-size:18px}#affiliateRoot .af-tabs{gap:6px}#affiliateRoot .af-tabs button{flex:1 1 30%}}
#affiliateRoot [hidden]{display:none!important}

/* Dedicated Affiliate workspace, with the existing M-AI account/session. */
body.affiliate-mode{background:#f3f6fa;color:#172b45}
body.affiliate-mode .app{display:block}
body.affiliate-mode .sidebar,body.affiliate-mode .topbar,body.affiliate-mode .mobile-bottom{display:none!important}
body.affiliate-mode .main{height:auto;min-height:100dvh;display:block;padding:28px clamp(16px,4vw,64px)}
body.affiliate-mode #affiliate{overflow:visible}
#affiliateRoot{--brand:#155d68;--surface:#fff;--surface2:#f3f6fa;--line:#dce4ed;--muted:#53677c;max-width:1380px;margin:auto;background:#fff;border:1px solid var(--line);border-radius:24px;padding:26px;box-shadow:0 12px 45px #18324708;line-height:1.6}
#affiliateRoot *{box-sizing:border-box}
#affiliateRoot h2{font-size:28px;margin:3px 0;letter-spacing:-.6px}
#affiliateRoot h3{font-size:21px;line-height:1.35;margin:0 0 15px}
#affiliateRoot h4{font-size:17px;margin:0 0 12px}
#affiliateRoot p{margin:8px 0 15px}
#affiliateRoot button{min-height:44px;background:#fff;border-color:var(--line);font-weight:600;transition:background .15s}
#affiliateRoot button:hover{background:#eaf4f4}
#affiliateRoot button:focus-visible,#affiliateRoot a:focus-visible,#affiliateRoot input:focus-visible,#affiliateRoot summary:focus-visible{outline:3px solid #1b8999;outline-offset:3px}
#affiliateRoot button[aria-pressed=true],#affiliateRoot button[type=submit]{background:#155d68;color:#fff;border-color:#155d68}
#affiliateRoot .af-header{padding-bottom:20px;border-bottom:1px solid var(--line)}
#affiliateRoot .af-eyebrow{font-size:11px;font-weight:800;letter-spacing:1.6px;color:#155d68}
#affiliateRoot .af-back{display:inline-flex;align-items:center;min-height:44px;color:#155d68;text-decoration:none;font-weight:700;padding:6px 10px}
#affiliateRoot .af-tabs{float:left;width:190px;display:flex;flex-direction:column;gap:4px;margin:0;padding:0 18px 25px 0;overflow:visible}
#affiliateRoot .af-tabs button{flex:none;text-align:left;border:none;padding:9px 13px;white-space:normal}
#affiliateRoot .af-body{margin-left:214px;min-height:650px}
#affiliateRoot .af-foot{clear:both;padding-top:20px;font-size:12px}
#affiliateRoot .af-pagehead{justify-content:space-between;margin-bottom:20px}
#affiliateRoot #afSearch{width:min(100%,280px);margin:0}
#affiliateRoot .af-hero{padding:28px;border-radius:20px;background:linear-gradient(115deg,#e6f3ef,#eff4fc);margin-bottom:22px}
#affiliateRoot .af-hero h3{font-size:30px;max-width:520px;margin:10px 0}
#affiliateRoot .af-hero p{color:#476474}
#affiliateRoot #afQuick{display:flex;gap:10px;margin-top:22px;align-items:stretch}
#affiliateRoot #afQuick input{margin:0;flex:1;min-width:0;background:#fff;min-height:48px}
#affiliateRoot #afQuick button{flex-shrink:0}
#affiliateRoot .af-kpis{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin:0 0 22px}
#affiliateRoot .af-kpi{background:#fff;padding:18px;border-radius:16px}
#affiliateRoot .af-kpi span{font-size:13px;color:var(--muted)}
#affiliateRoot .af-kpi strong{font-size:25px;line-height:1.25;color:#163e47;overflow-wrap:anywhere}
#affiliateRoot .af-next{padding:22px;background:#f8fafc;border:1px solid var(--line);border-radius:18px;margin:0 0 22px}
#affiliateRoot .af-next button{margin:4px 8px 0 0}
#affiliateRoot .af-pipeline{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;margin-bottom:22px}
#affiliateRoot .af-pipeline>div{border-left:3px solid #6aa5a5;padding:10px 12px;background:#f4f8fa;border-radius:0 8px 8px 0;font-size:12px}
#affiliateRoot .af-pipeline strong{display:block;font-size:23px}
#affiliateRoot .af-toolgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#affiliateRoot .af-toolgrid>button{text-align:left;padding:22px 18px;font-size:16px}
#affiliateRoot .af-toolgrid .af-next{margin:0}
#affiliateRoot .af-badge{display:inline-block;font-size:12px;border-radius:8px;padding:5px 8px;background:#e9eef4;color:#405870}
#affiliateRoot .af-item{border:1px solid var(--line);border-radius:14px;margin:10px 0;padding:16px}
#affiliateRoot .af-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#affiliateRoot .af-bottom{display:none}
#affiliateRoot .af-dialog{width:min(820px,96vw);max-height:92dvh;color:#172b45;background:#fff;padding:24px}
#affiliateRoot .af-dialog .af-controls:first-child{position:sticky;top:-24px;z-index:2;padding:14px 0;background:#fff;border-bottom:1px solid var(--line);margin-bottom:20px}
#affiliateRoot .af-fields>details{border:1px solid var(--line);border-radius:12px;padding:12px 16px;margin:12px 0}
#affiliateRoot summary{cursor:pointer;font-weight:700;padding:4px 0}
#affiliateRoot .af-fields>details[open]>summary{margin-bottom:14px}
#affiliateRoot input,#affiliateRoot select,#affiliateRoot textarea{font-size:16px!important}
#affiliateRoot [data-af-message]:empty{display:none}
body.theme-dark.affiliate-mode #affiliateRoot{color:#172b45}
@media(max-width:760px){
body.affiliate-mode .main{padding:12px 10px calc(92px + env(safe-area-inset-bottom))}
#affiliateRoot{padding:16px 12px;border-radius:18px}
#affiliateRoot .af-header{gap:8px;padding-bottom:14px}
#affiliateRoot .af-header h2{font-size:24px}
#affiliateRoot .af-header .af-controls{gap:6px}
#affiliateRoot .af-header .af-controls button{font-size:12px;min-height:40px;padding:7px 9px}
#affiliateRoot .af-tabs{display:none}
#affiliateRoot .af-body{margin-left:0;min-height:450px}
#affiliateRoot .af-hero{padding:20px 16px}
#affiliateRoot .af-hero h3{font-size:26px}
#affiliateRoot #afQuick{flex-direction:column}
#affiliateRoot .af-kpis{grid-template-columns:1fr 1fr;gap:9px}
#affiliateRoot .af-kpi{padding:13px 10px}
#affiliateRoot .af-kpi strong{font-size:21px}
#affiliateRoot .af-next{padding:16px}
#affiliateRoot .af-toolgrid{grid-template-columns:1fr}
#affiliateRoot .af-bottom{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;position:fixed;bottom:0;left:0;right:0;background:#fff;box-shadow:0 -5px 24px #19344912;border-top:1px solid var(--line);padding:9px 6px calc(9px + env(safe-area-inset-bottom));z-index:20}
#affiliateRoot .af-bottom button{font-size:11px;line-height:1.35;padding:9px 3px;min-height:48px;border:none;border-radius:10px;white-space:normal}
#affiliateRoot .af-pagehead{gap:12px}
#affiliateRoot #afSearch{width:100%}
#affiliateRoot .af-dialog{padding:16px 12px}
#affiliateRoot .af-dialog .af-controls:first-child{top:-16px}
}
