:root{--bg:#f3f0e9;--panel:#fffdf9;--sidebar:#1b1c19;--text:#1d1d1a;--muted:#79756d;--line:#ddd7cc;--red:#bc2d27;--red-dark:#9f241f;--cream:#efe5d5;--amber:#fff4d7;--amber-text:#8a6124;--green:#3d7250;--green-bg:#e8f2e9;--blue:#315e96;--blue-bg:#e8eff8;--shadow:0 18px 60px rgba(43,37,27,.18)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font:14px/1.6 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer}.sidebar{position:fixed;inset:0 auto 0 0;width:222px;background:var(--sidebar);color:#fff;padding:29px 19px;display:flex;flex-direction:column;z-index:5}.brand{padding:0 9px}.brand b{display:block;font-size:22px;letter-spacing:.02em}.brand span{display:block;color:#9b9b91;font-size:11px;margin-top:8px}.sidebar nav{margin-top:35px;display:grid;gap:7px}.nav-button{width:100%;border:0;background:transparent;color:#c7c4ba;padding:12px 13px;border-radius:8px;text-align:left;font-weight:600}.nav-button:hover{background:#2c2d28;color:#fff}.nav-button.active{background:var(--cream);color:#1b1b18}.nav-button .nav-count{float:right;min-width:21px;height:21px;padding:0 6px;border-radius:11px;background:var(--red);color:#fff;text-align:center;font-size:11px;line-height:21px}.sidebar-foot{margin-top:auto;border-top:1px solid #3a3a34;padding-top:15px;display:flex;gap:9px;color:#aaa89f;font-size:12px}.sidebar-foot i{width:8px;height:8px;border-radius:50%;background:#d1cbbb;margin-top:6px}main{margin-left:222px;padding:29px 38px 60px;min-height:100vh}.topbar{display:flex;align-items:center;justify-content:space-between;gap:25px}.topbar h1{font-size:25px;margin:0}.topbar p{margin:5px 0 0;color:var(--muted)}.top-actions{display:flex;align-items:center;gap:10px}.mode,.user{border:1px solid var(--line);background:var(--panel);border-radius:20px;padding:7px 12px;font-size:12px}.mode{color:var(--red)}.notification-button{border:1px solid var(--line);background:var(--panel);width:37px;height:37px;border-radius:50%;position:relative}.notification-button:before{content:'●';color:var(--muted)}.notification-button.has-unread:after{content:attr(data-count);position:absolute;top:-6px;right:-5px;background:var(--red);color:#fff;min-width:18px;height:18px;padding:0 4px;border-radius:9px;font-size:10px;line-height:18px}.safety-banner{margin:24px 0;background:var(--amber);border:1px solid #ead39b;color:var(--amber-text);padding:12px 16px;border-radius:8px}.loading,.empty{padding:52px 20px;text-align:center;color:var(--muted)}.empty b{display:block;color:var(--text);font-size:17px;margin-bottom:6px}.cards{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:15px;margin:20px 0}.card,.panel{background:var(--panel);border:1px solid var(--line);border-radius:12px}.card{padding:21px}.card span{color:var(--muted);font-size:13px}.card strong{display:block;font-size:29px;margin:10px 0 2px}.card small{color:var(--muted)}.panel{padding:22px;margin:16px 0}.panel h2,.panel h3{margin:0 0 14px}.panel h2{font-size:18px}.panel h3{font-size:16px}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:15px}.panel-head h2,.panel-head h3{margin:0}.toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:16px 0}.toolbar.end{justify-content:flex-end}.btn{border:1px solid var(--line);background:var(--panel);padding:9px 15px;border-radius:7px;min-height:40px}.btn:hover:not(:disabled){background:var(--cream)}.btn.primary{background:var(--red);border-color:var(--red);color:#fff}.btn.primary:hover:not(:disabled){background:var(--red-dark)}.btn.danger{border-color:#d9a9a6;color:var(--red)}.btn.link{border:0;padding:2px 4px;min-height:auto;color:var(--red);background:transparent}.btn:disabled{opacity:.48;cursor:not-allowed}.filters{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.field{display:flex;flex-direction:column;gap:6px;min-width:180px}.field.wide{grid-column:1/-1}.field>span,.field>label{color:#68645d;font-size:13px}input,select,textarea{border:1px solid var(--line);background:#fffefb;border-radius:7px;padding:10px 12px;outline:none}input:focus,select:focus,textarea:focus{border-color:var(--red);box-shadow:0 0 0 2px rgba(188,45,39,.12)}textarea{width:100%;min-height:150px;resize:vertical}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.form-note{color:var(--muted);margin:8px 0}.table-wrap{overflow:auto;border:1px solid #ebe6dc;border-radius:9px}table{border-collapse:collapse;width:100%;text-align:left}th,td{padding:13px 12px;border-bottom:1px solid #ebe6dc;white-space:nowrap;vertical-align:top}th{background:#f7f3eb;color:#706b62;font-weight:600}tr:last-child td{border-bottom:0}tbody tr:hover td{background:#fbf7ef}.cell-title{font-weight:650}.cell-sub{display:block;color:var(--muted);font-size:12px;margin-top:3px}.tag{display:inline-block;padding:3px 8px;border-radius:5px;font-size:12px;background:#eee9df;color:#635f57}.tag.success{background:var(--green-bg);color:var(--green)}.tag.warn{background:var(--amber);color:var(--amber-text)}.tag.info{background:var(--blue-bg);color:var(--blue)}.tag.danger{background:#f8e8e6;color:var(--red)}.positive{color:var(--green)}.negative{color:var(--red)}.split{display:grid;grid-template-columns:1.2fr .8fr;gap:16px}.timeline{display:grid;gap:11px}.timeline-item{display:grid;grid-template-columns:125px 1fr;gap:10px;padding-bottom:11px;border-bottom:1px solid #eee8de}.timeline-item:last-child{border-bottom:0}.timeline time{color:var(--muted);font-size:12px}.account-tree{display:grid;gap:14px}.application{border:1px solid var(--line);border-radius:10px;overflow:hidden}.application-head{display:flex;justify-content:space-between;align-items:center;background:#f7f3eb;padding:15px 17px}.application-body{padding:15px 17px}.binding{border-left:3px solid #d6c7b0;padding:4px 0 4px 15px;margin:12px 0}.account-row{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:10px 12px;margin-top:8px;background:#fbf8f1;border-radius:7px}.steps{display:flex;gap:9px;margin:0 0 18px}.step{padding:7px 12px;border-radius:20px;background:#eee9df;color:#716c63}.step.active{background:var(--red);color:#fff}.tabs{display:flex;gap:5px;border-bottom:1px solid var(--line);margin-bottom:18px}.tab{border:0;background:transparent;padding:11px 16px;border-bottom:3px solid transparent}.tab.active{color:var(--red);border-bottom-color:var(--red);font-weight:700}.checkbox{width:17px;height:17px;accent-color:var(--red)}.result-box{background:#f8f5ee;border:1px solid var(--line);padding:13px;border-radius:8px;margin:10px 0}.rule-card{display:grid;grid-template-columns:1fr auto;gap:16px;padding:17px;border:1px solid var(--line);border-radius:10px;margin:12px 0}.rule-card h3{margin:0 0 5px}.rule-meta{display:flex;gap:8px;flex-wrap:wrap;margin:11px 0;color:var(--muted)}.rule-actions{display:flex;gap:8px;align-items:center}.switch{position:relative;width:46px;height:25px}.switch input{opacity:0}.switch span{position:absolute;inset:0;border-radius:15px;background:#bdb8ae;transition:.2s}.switch span:after{content:'';position:absolute;width:19px;height:19px;left:3px;top:3px;border-radius:50%;background:#fff;transition:.2s}.switch input:checked+span{background:var(--green)}.switch input:checked+span:after{transform:translateX(21px)}dialog{border:0;border-radius:15px;padding:0;width:min(760px,94vw);max-height:90vh;box-shadow:var(--shadow);background:var(--panel)}dialog::backdrop{background:rgba(26,25,22,.58)}#modal-content{padding:26px;max-height:90vh;overflow:auto}.modal-head{display:flex;align-items:start;justify-content:space-between;gap:20px;margin-bottom:18px}.modal-head h2{margin:0}.modal-head p{margin:4px 0;color:var(--muted)}.close{border:1px solid var(--line);background:transparent;width:38px;height:38px;border-radius:7px}.confirm-line{display:flex;gap:9px;align-items:start;padding:12px;background:var(--amber);color:var(--amber-text);border-radius:7px}.notice-drawer{position:fixed;right:28px;top:82px;width:360px;max-height:70vh;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:16px;z-index:10}.notice-drawer h3{margin:0 0 12px}.notice-item{padding:12px 0;border-bottom:1px solid var(--line)}.notice-item:last-child{border-bottom:0}#toast{position:fixed;right:30px;bottom:27px;background:#292a25;color:#fff;padding:12px 18px;border-radius:8px;z-index:20;opacity:0;transform:translateY(12px);transition:.2s;pointer-events:none}#toast.show{opacity:1;transform:none}.money{font-variant-numeric:tabular-nums}.subtle{color:var(--muted)}.hidden{display:none!important}
@media(max-width:1120px){.cards{grid-template-columns:repeat(3,1fr)}.split{grid-template-columns:1fr}}
/* Spacious invitation dialog matching the supplied desktop reference. */
.authorization-types{border:0;padding:0;margin:0 0 24px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;min-width:0}
.authorization-types legend{font-size:18px;font-weight:600;margin-bottom:12px}
.authorization-choice{display:flex;align-items:start;gap:12px;padding:16px;border:1px solid var(--line);border-radius:10px;cursor:pointer;background:#fffefb;transition:border-color .15s,background .15s}
.authorization-choice:hover{border-color:#b7a796}
.authorization-choice:has(input:checked){border-color:var(--red);background:#fff7f2}
#invite-form .authorization-choice input{margin-top:6px;flex-shrink:0}
.authorization-choice small{display:grid;gap:3px;margin-top:8px;color:var(--muted);font-size:13px;font-weight:400;line-height:1.7}
.authorization-choice b{font-size:16px}
.creator-profile{display:flex;align-items:center;gap:12px;min-width:210px}
.creator-profile small{display:block;font-size:12px;color:var(--muted);margin-top:3px}
.creator-avatar{position:relative;display:flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;border-radius:50%;overflow:hidden;background:var(--cream);color:var(--muted);font-size:10px;text-align:center;line-height:1.3}
.creator-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:var(--cream);z-index:1}
dialog:has(#batch-details){width:min(960px,94vw)}
dialog:has(#invite-confirm){width:min(1280px,calc(100vw - 32px));max-height:calc(100dvh - 32px)}
dialog:has(#invite-confirm) #modal-content{padding:32px;min-height:min(620px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);display:flex;flex-direction:column;font-size:15px}
dialog:has(#invite-confirm) .modal-head{margin-bottom:24px}
dialog:has(#invite-confirm) table{width:100%;table-layout:fixed}
dialog:has(#invite-confirm) th,dialog:has(#invite-confirm) td{padding:16px;white-space:normal;overflow-wrap:anywhere}
dialog:has(#invite-confirm) th:nth-child(1){width:18%}
dialog:has(#invite-confirm) th:nth-child(2){width:16%}
dialog:has(#invite-confirm) th:nth-child(3),dialog:has(#invite-confirm) th:nth-child(4){width:12%}
dialog:has(#invite-confirm) th:nth-child(5){width:42%}
dialog:has(#invite-confirm) .confirm-line{margin-top:18px}
dialog:has(#invite-confirm) .toolbar.end{margin-top:auto;padding-top:18px;margin-bottom:0}
@media(max-width:760px){dialog:has(#invite-confirm) #modal-content{padding:20px}dialog:has(#invite-confirm) th,dialog:has(#invite-confirm) td{padding:10px 8px}}
dialog:has(#rebuild-confirm),dialog:has(#rebuild-results){width:min(1440px,calc(100vw - 32px));max-height:calc(100dvh - 32px)}
dialog:has(#rebuild-confirm) #modal-content{padding:32px;min-height:min(560px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);font-size:15px;display:flex;flex-direction:column}
dialog:has(#rebuild-confirm) .modal-head{margin-bottom:24px}
dialog:has(#rebuild-confirm) table{table-layout:fixed;min-width:1040px}
dialog:has(#rebuild-confirm) th,dialog:has(#rebuild-confirm) td{padding:16px;white-space:normal;overflow-wrap:anywhere}
dialog:has(#rebuild-confirm) th:nth-child(1){width:17%}
dialog:has(#rebuild-confirm) th:nth-child(2){width:23%}
dialog:has(#rebuild-confirm) th:nth-child(3){width:15%}
dialog:has(#rebuild-confirm) td:nth-child(3){font-size:13px;font-variant-numeric:tabular-nums;white-space:nowrap}
dialog:has(#rebuild-confirm) th:nth-child(4){width:8%}
dialog:has(#rebuild-confirm) th:nth-child(5){width:12%}
dialog:has(#rebuild-confirm) th:nth-child(6){width:25%}
.rebuild-reason{white-space:normal;overflow-wrap:anywhere;min-width:160px;line-height:1.7}
.candidate-reason{white-space:normal;min-width:260px;max-width:420px}
.candidate-plan{white-space:normal;min-width:180px;max-width:300px;overflow-wrap:anywhere}
dialog:has(#rebuild-confirm) .toolbar.end{margin-top:auto;padding-top:20px;margin-bottom:0}
@media(max-width:760px){dialog:has(#rebuild-confirm) #modal-content{padding:20px}}
.plan-filter-form{padding:2px 0 16px;border-bottom:1px solid var(--line)}
.plan-filter-form .field{min-width:150px}.plan-filter-form .keyword-field{flex:1;max-width:440px}
.history-filters{margin-top:16px}.plan-filter-form .roi-filter{min-width:110px;width:120px}
.filter-summary{padding:16px 0}.plan-filter-form .form-note{margin-top:12px}
dialog:has(#invite-form){width:min(1180px,calc(100vw - 32px));height:min(820px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);overflow:hidden}
dialog:has(#invite-form) #modal-content{height:100%;max-height:none;overflow-y:auto;padding:28px;display:flex;flex-direction:column}
dialog:has(#invite-form) .modal-head{margin-bottom:24px}
dialog:has(#invite-form) .modal-head p{margin-top:14px}
#invite-form{display:flex;flex:1;flex-direction:column;font-size:16px;line-height:1.8}
#invite-form h3{font-size:18px;margin:0 0 18px}
#invite-form p{margin:0 0 26px;color:var(--muted)}
#invite-form h3:not(:first-child){margin-top:8px}
#invite-form .toolbar:not(.end){gap:26px;margin:8px 0 30px}
#invite-form .toolbar label{display:flex;align-items:center;gap:7px}
#invite-form .checkbox{width:18px;height:18px;margin:0}
#invite-form .field{flex:1;gap:14px}
#invite-form .field>span{font-size:18px;font-weight:600;color:var(--text)}
#invite-form textarea{min-height:210px;flex:1;font-size:16px;line-height:1.8}
#invite-form .form-note{margin:8px 0 0}
#invite-form .toolbar.end{margin:18px 0 0}
@media(max-width:760px){.authorization-types{grid-template-columns:1fr}dialog:has(#invite-form) #modal-content{padding:20px}#invite-form .toolbar:not(.end){gap:16px;margin-bottom:24px}}
@media(max-width:760px){.sidebar{position:static;width:100%;height:auto}.sidebar nav{grid-template-columns:repeat(2,1fr);margin-top:18px}.sidebar-foot{display:none}main{margin:0;padding:20px}.topbar{align-items:start}.cards{grid-template-columns:repeat(2,1fr)}.form-grid{grid-template-columns:1fr}.top-actions .user{display:none}.account-row{align-items:start;flex-direction:column}}

.name-editor{margin:20px 0;padding:18px;border:1px solid #e3d9cc;border-radius:10px;background:#faf8f4}.name-fields{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.name-fields .btn{padding:6px 12px}.name-editor [data-name-example]{overflow-wrap:anywhere}.name-editor .result-box{margin-top:12px}

dialog:has(#create-confirm){width:min(1440px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px)}
dialog:has(#create-confirm) #modal-content{padding:28px;max-height:calc(100dvh - 32px);overflow-y:auto}
dialog:has(#create-confirm) table{width:100%;min-width:0;table-layout:fixed}
dialog:has(#create-confirm) th,dialog:has(#create-confirm) td{white-space:normal;overflow-wrap:anywhere;padding:14px;min-width:0;max-width:none;vertical-align:top}
dialog:has(#create-confirm) th:nth-child(1){width:16%}
dialog:has(#create-confirm) th:nth-child(2){width:32%}
dialog:has(#create-confirm) th:nth-child(3){width:11%}
dialog:has(#create-confirm) th:nth-child(4){width:9%}
dialog:has(#create-confirm) th:nth-child(5){width:32%}
dialog:has(#create-confirm) .result-box{overflow-wrap:anywhere}
[data-custom-editor]{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:8px}
[data-custom-editor] .btn{margin-top:8px}

dialog:has(#build-progress-content){width:min(1440px,calc(100vw - 32px));max-width:none}#build-progress-content table{table-layout:fixed;min-width:0;width:100%}#build-progress-content td,#build-progress-content th{white-space:normal;overflow-wrap:anywhere}#build-progress-content th:nth-child(1){width:16%}#build-progress-content th:nth-child(2){width:32%}#build-progress-content th:nth-child(3){width:10%}#build-progress-content th:nth-child(4){width:42%}#build-progress-content progress{display:block;width:100%;height:18px;margin:14px 0;accent-color:var(--red)}.build-stats{display:flex;gap:18px;flex-wrap:wrap;margin-bottom:10px}
/* compact account list and authorization modal */
.accounts-panel{padding:18px 20px}.accounts-panel .panel-head{margin-bottom:12px}.account-name{font-size:14px}.account-actions{display:flex;gap:8px;align-items:center}.accounts-panel th,.accounts-panel td{padding:11px 12px}.accounts-panel .btn{min-height:34px;padding:6px 11px}
#modal{width:min(820px,94vw)}#modal-content{padding:20px 24px;font-size:13px}.modal-head{margin-bottom:12px}.modal-head h2{font-size:20px}.modal-head p{font-size:12px}.modal-head .close{width:34px;height:34px}.authorization-types{gap:10px;margin:8px 0 14px}.authorization-choice{padding:13px 15px;min-height:0}.authorization-choice b{font-size:15px}.authorization-choice small{gap:3px;margin-top:6px;font-size:12px}.authorization-choice small span{line-height:1.35}.modal-head+form h3{font-size:15px;margin:10px 0 7px}.modal-head+form p{font-size:12px;line-height:1.45;margin:5px 0}.modal-head+form .toolbar{margin:9px 0;gap:8px}.modal-head+form .field{gap:4px}.modal-head+form textarea{min-height:108px}.modal-head+form input,.modal-head+form select,.modal-head+form textarea{padding:8px 10px}
@media(max-height:850px){#modal-content{max-height:94vh;padding:16px 20px}.authorization-choice{padding:10px 12px}.authorization-choice small{gap:2px}.modal-head+form textarea{min-height:92px}}
 .sort-head{border:0;background:transparent;color:inherit;font:inherit;font-weight:600;cursor:pointer;padding:0;white-space:nowrap}
