:root{font-family:Inter,"Microsoft YaHei","PingFang SC",sans-serif;color:#172d29;background:#f5f7f6;font-size:100%}
*{box-sizing:border-box}body{margin:0}.wrap{margin:auto;padding:0 clamp(.75rem,2vw,3rem)}
.mast{background:#103f37;color:white}.head{display:flex;align-items:center;gap:1.25rem;height:3.9rem}
.brand{font-size:1.18rem;display:flex;align-items:center;gap:.65rem}.mark{display:grid;place-items:center;background:#c6e979;color:#183e32;border-radius:.5rem;width:2rem;height:2rem}.product{border-left:1px solid #658980;padding-left:1.2rem}.zone{margin-left:auto;color:#d2e6e1;font-size:.88rem}
nav{display:flex;gap:1.6rem;border-bottom:1px solid #cad6d1}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:default}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #4c9c77;outline-offset:2px}
nav button{background:none;border:none;border-bottom:3px solid transparent;padding:.9rem .1rem .75rem;color:#58685f}nav button[aria-current=page]{border-color:#176f53;color:#104833;font-weight:700}
.toolbar,.dialog-head,.footer,.buttons{display:flex;align-items:center;justify-content:space-between;gap:.65rem}.toolbar{margin:1rem 0}.meta{margin:0;color:#53675e;font-size:.88rem}h1{font-size:clamp(1.45rem,2vw,1.9rem);margin:.25rem 0;letter-spacing:-.045em}h2{font-size:1.35rem;margin:0}
button{background:white;border:1px solid #c6d3ca;border-radius:.5rem;color:#234a3c;padding:.58rem .95rem}.primary{background:#175d46;color:#fff;border-color:#175d46;font-weight:600}.primary:hover:enabled{background:#114534}.buttons{justify-content:flex-end}
#list{background:white;border:1px solid #d2ddd5;border-radius:.8rem;overflow:auto;margin-bottom:2rem}.empty{text-align:center;padding:3rem 1rem;color:#546b62}
table{border-collapse:collapse;width:100%;text-align:left;font-size:.94rem}th{background:#ebf1ed;padding:.7rem 1rem;color:#476154;font-weight:600;white-space:nowrap}td{padding:.75rem 1rem;border-top:1px solid #e1e8e3;vertical-align:middle;overflow-wrap:anywhere}td:last-child{max-width:25rem}.store-title{font-weight:700;display:block}.sub{display:block;color:#5c7065;font-size:.88rem;margin-top:.25rem}.times{font-variant-numeric:tabular-nums}.task-line{display:flex;gap:.7rem;margin:.24rem 0;align-items:baseline}.task-name{white-space:nowrap;color:#45594f;min-width:4rem}.edit{white-space:nowrap}
dialog{border:1px solid #c9d8cf;border-radius:.9rem;width:min(34rem,95vw);max-height:90vh;overflow:auto;padding:0;color:inherit}dialog::backdrop{background:#0a201d77}.dialog-head,.footer,#fields{padding:1rem 1.45rem}.dialog-head{border-bottom:1px solid #dce4de}.close{font-size:1.5rem;border:none;padding:0 .4rem}.footer{justify-content:flex-end;border-top:1px solid #dce4de}label.field{display:block;font-weight:600;margin:.65rem 0 1rem}input:not([type=checkbox]),select,textarea{display:block;width:100%;border:1px solid #acbfb5;border-radius:.4rem;padding:.6rem .7rem;margin-top:.35rem;background:#fff;color:inherit}select{appearance:none;background:linear-gradient(45deg,transparent 50%,#385e50 50%) calc(100% - 16px) 50%/6px 6px no-repeat,linear-gradient(135deg,#385e50 50%,transparent 50%) calc(100% - 10px) 50%/6px 6px no-repeat;padding-right:2rem}input[type=checkbox]{width:1.05rem;height:1.05rem;accent-color:#175d46}.hint{font-size:.88rem;color:#52665a;margin:.2rem 0 .65rem}.task-row{padding:.65rem 0;border-top:1px solid #e2eae5}.task-row label{display:flex;align-items:center;gap:.45rem}.task-row input:disabled{color:#758078;background:#f3f5f3}.error,#notice{padding:.7rem 1rem;background:#e6f2ea;border-radius:.4rem}.error,#notice.error{background:#fff0ee;color:#962d21}#form-error{margin:.5rem 1.45rem}textarea{min-height:6rem;resize:vertical}
@media(max-width:42rem){.head{gap:.55rem}.product{padding-left:.6rem;font-size:.9rem}.zone{font-size:.75rem}.toolbar{margin:1.4rem 0 1rem}td,th{padding:.75rem}.buttons button{padding:.5rem .65rem}table{min-width:36rem}.brand{font-size:1rem}.task-line{flex-wrap:wrap;gap:.25rem}nav{gap:1rem}}

.login-card{max-width:26rem;margin:clamp(2rem,10vh,7rem) auto;padding:1.75rem;background:white;border:1px solid #d2ddd5;border-radius:.8rem}.login-card h1{margin-bottom:1.5rem}.login-card button{width:100%}.head .zone{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.head #logout{flex-shrink:0}
.trend-filters{display:flex;align-items:end;gap:1rem;flex-wrap:wrap;padding:1rem}.trend-filters label.field{margin:0;max-width:100%}.trend-filters select{min-width:9rem}nav{overflow-x:auto}nav button{white-space:nowrap}

.trend-panel{min-width:0;background:white}
.trend-panel:fullscreen,.trend-panel.expanded{width:100%;height:100dvh;overflow:auto;background:white}
.trend-panel.expanded{position:fixed;inset:0;z-index:20}
.trend-filters{gap:.8rem;padding:1.2rem 1.4rem .7rem}
.trend-filters label.field{flex:1 1 9rem;min-width:0}
.trend-filters label.field:first-child{flex:2 1 16rem}
.trend-filters select,.trend-filters input[type=date]{min-width:0;width:100%}
.compare-toggle{display:flex;align-items:center;gap:.4rem;min-height:2.7rem;cursor:pointer}
.compare-toggle input{accent-color:#176f53;width:1.05rem;height:1.05rem}
.trend-shortcuts,.plot-legend{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem}
.trend-shortcuts{padding:0 1.4rem 1rem;border-bottom:1px solid #e6ece9}
.trend-shortcuts button{padding:.38rem .75rem;font-size:.875rem}
.expand-trend{margin-left:auto}
.plot-title{padding:1.2rem 1.5rem .3rem;font-size:1.12rem}
.plot-legend{justify-content:center;gap:.6rem 1.4rem;padding:.35rem 1rem .8rem;font-size:.9rem}
.plot-legend span{display:inline-flex;align-items:center;gap:.45rem}
.plot-legend i{width:1.8rem}
trend-plot{display:block;position:relative;margin:0 1.3rem;height:clamp(14rem,28dvh,20rem)}
.trend-panel:is(:fullscreen,.expanded) trend-plot{height:clamp(16rem,52dvh,38rem)}
trend-plot canvas{display:block;width:100%;height:100%;touch-action:pan-y}
.plot-tip,.plot-guide{position:absolute;pointer-events:none}
.plot-guide{top:1rem;bottom:2.4rem;border-left:1px solid #ff7028}
.plot-tip{background:#fff;color:#263830;box-shadow:0 5px 22px #172d2926;border:1px solid #e8eae8;border-radius:.5rem;padding:.8rem;font-size:.86rem;max-width:100%;font-variant-numeric:tabular-nums}
.plot-tip div{padding-left:.45rem;margin-top:.45rem}
.trend-details{overflow:auto;border-top:1px solid #e2eae5}
.trend-details table{white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:42rem){
 .trend-filters{padding:.85rem;gap:.6rem}
 .trend-filters label.field:first-child{flex-basis:100%}
 .trend-shortcuts{padding:0 .85rem .8rem;gap:.35rem}
 .trend-shortcuts button{padding:.35rem .5rem}
 trend-plot{margin:0 .5rem;height:clamp(12rem,28dvh,16rem)}
 .plot-legend{font-size:.78rem}
 .head .product{display:none}
}

.job-filters,.job-pages{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;padding:1rem}
.job-filters{align-items:end;border-bottom:1px solid #e1e8e3}
.job-filters label.field{margin:0;min-width:0;flex:0 1 14rem}
.job-filters label.field:first-child{flex-basis:24rem}
.job-filters select{width:100%;max-width:100%}
.job-pages{justify-content:flex-end;font-size:.9rem;color:#45594f}
.job-pages button{padding:.35rem .7rem}
.job-table{overflow-x:auto;border-bottom:1px solid #e1e8e3}
@media(max-width:42rem){.job-pages{justify-content:center;gap:.35rem;padding:.7rem .3rem}.job-pages button{padding:.35rem}.job-filters label.field{flex-grow:1}}

/* Keep each long table's header in its own scroll area. */
#list:has(>table){max-height:max(20rem,calc(100dvh - 15rem))}
.trend-details{max-height:60dvh;min-height:0}
thead th{position:sticky;top:0;z-index:1;box-shadow:inset 0 -1px #d2ddd5}
tbody tr:hover td{background:#f6faf8}
#list>table:has(.edit) :is(th,td):last-child{text-align:right;width:6rem}
#list>table:has(.times){min-width:46rem}
#list>table:has(.times) th:first-child{width:26%}
#list>table:has(.times) th:nth-child(2){width:17%}
.task-name{flex:none}
.task-line{line-height:1.45}
main:has([data-view=email][aria-current=page]) #list{max-width:54rem}
main:has([data-view=email][aria-current=page]) table{min-width:0}
main:has([data-view=email][aria-current=page]) th:first-child{width:30%}
.job-table{max-height:max(18rem,calc(100dvh - 26rem))}
.job-table table{min-width:67rem;font-variant-numeric:tabular-nums}
.job-table td:nth-child(-n+3){white-space:nowrap}
.job-table td:nth-child(4){min-width:9rem}
.job-table td:is(:nth-child(5),:nth-child(7)){white-space:nowrap}
.job-table td:last-child{min-width:10rem}
.job-filters,.job-pages{padding-block:.75rem}
@media(min-width:60rem){
 .job-pages:has(+.job-table){display:none}
}
@media(max-width:42rem){
 .head{height:3.5rem}
 .brand{flex-shrink:0}
 nav{flex-wrap:wrap;gap:0 .9rem}
 nav button{padding:.65rem 0 .5rem;font-size:.9rem}
 .toolbar{flex-wrap:wrap;margin:.8rem 0}
 .toolbar .buttons{margin-left:auto}
 .job-table{max-height:58dvh}
 .job-filters{padding:.8rem;gap:.6rem}
 .job-pages{padding-block:.6rem}
 #list>table:has(.edit) :is(th,td):last-child{position:sticky;right:0;background:white;box-shadow:-1px 0 #e1e8e3}
 #list>table:has(.edit) th:last-child{top:0;z-index:2;background:#ebf1ed}
 .dialog-head,.footer,#fields{padding:.85rem 1rem}
}

/* Store editor */
html:has(#editor[open] .store-editor){overflow:hidden}
#editor:has(.store-editor){max-height:calc(100dvh - 1.5rem)}
.store-editor{display:grid;gap:1.25rem}
.store-editor section{min-width:0}
.store-editor h3{margin:0 0 .55rem;font-size:1.05rem;color:#175d46}
.store-editor label.field{margin:.65rem 0 .35rem}
.store-editor label:has([name=screenshots]){display:flex;align-items:center;gap:.45rem}
.store-editor input[type=checkbox]{margin:0;flex:none}
.store-editor .hint{line-height:1.45;margin:.3rem 0 0}
.store-editor .task-row{padding:.75rem 0}
.store-editor .task-row:first-of-type{margin-top:.7rem}
.store-editor .task-row label{font-weight:600}
.store-editor .task-row input:disabled{background:#f4f6f5;border-color:#dce4de}
.store-editor .task-row:has([name=adjust_enabled]:checked) .hint{color:#a54b14}
@media(min-width:46rem){
 #editor:has(.store-editor){width:min(60rem,96vw)}
 .store-editor{grid-template-columns:1fr 1.12fr;gap:1.5rem}
 .store-editor section+section{border-left:1px solid #dce4de;padding-left:1.5rem}
 #editor:has(.store-editor) :is(.dialog-head,.footer){padding-block:.65rem}
}
@media(min-width:46rem) and (max-height:42rem){
 #editor:has(.store-editor) :is(.dialog-head,.footer,#fields){padding-block:.45rem}
 .store-editor label.field,.store-editor .task-row:first-of-type{margin-top:.35rem}
 .store-editor :is(input:not([type=checkbox]),select){padding-block:.35rem;margin-top:.15rem}
 .store-editor .task-row{padding:.4rem 0}
 .store-editor .hint{font-size:.81rem;line-height:1.3}
}
@media(min-width:46rem) and (max-height:34rem){
 .store-editor label.field:not(:has([type=checkbox])){display:grid;grid-template-columns:8rem minmax(0,1fr);align-items:center;font-size:.9rem}
 .store-editor .task-row{display:grid;grid-template-columns:6.5rem minmax(0,1fr);align-items:center}
 .store-editor .task-row .hint{grid-column:1/-1}
}
