:root{--bg:#f6f5f3;--surface:#ffffff;--ink:#17171c;--muted:#65626d;--line:#e8e5e2;--red:#e11d35;--red-dark:#b8142a;--red-soft:#fde7ea;--yellow:#fba421;--yellow-soft:#fff0d9;--yellow-ink:#8a5300;--green:#157a4a;--green-soft:#e3f4ea}*{box-sizing:border-box}body,html{margin:0;background:var(--bg);color:var(--ink);font-family:Be Vietnam Pro,Segoe UI,system-ui,sans-serif;font-size:14px}body{font-feature-settings:"tnum";font-variant-numeric:tabular-nums}a{color:var(--red)}button{font:inherit;cursor:pointer}input,select,textarea{font:inherit;color:var(--ink)}.shell{display:grid;grid-template-columns:232px 1fr;min-height:100vh}.side{background:var(--surface);border-right:1px solid var(--line);padding:20px 12px;display:flex;flex-direction:column;gap:4px}.side .brand{display:flex;align-items:center;gap:10px;padding:0 8px 16px;font-weight:800;font-size:17px;white-space:nowrap}.side .brand img{flex:none}.side .brand .brand-text{display:flex;flex-direction:column;line-height:1.15}.side .brand small{font-size:12px;font-weight:600;color:var(--muted)}.side .brand span{color:var(--red)}.nav{text-align:left;border:0;background:transparent;padding:10px 12px;border-radius:10px;color:var(--ink);font-weight:500;display:flex;justify-content:space-between;align-items:center}.nav:hover{background:var(--bg)}.nav.on{background:var(--red-soft);color:var(--red-dark)}.badge,.nav.on{font-weight:700}.badge{min-width:22px;padding:1px 7px;border-radius:999px;background:var(--red);color:#fff;font-size:12px;text-align:center}.side .foot{margin-top:auto;padding:12px 8px 0;border-top:1px solid var(--line);color:var(--muted);font-size:13px;gap:8px}.main,.side .foot{display:flex;flex-direction:column}.main{padding:24px 28px 48px;gap:16px;min-width:0}h1{font-size:22px}h1,h2{margin:0}h2{font-size:16px}.sub{color:var(--muted);margin:0;max-width:72ch}.row{gap:10px;align-items:center;flex-wrap:wrap}.card,.row{display:flex}.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px;flex-direction:column;gap:12px}.grid4{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));grid-gap:12px;gap:12px}.stat{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:4px;text-align:left}.stat b{font-size:26px}.stat span{color:var(--muted)}.tbl{overflow-x:auto;background:var(--surface);border:1px solid var(--line);border-radius:14px}table{border-collapse:collapse;width:100%}td,th{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:middle}th{font-size:12px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}tr:last-child td{border-bottom:0}td.num,th.num{text-align:right;white-space:nowrap}.btn{border:1px solid var(--line);background:var(--surface);padding:8px 14px;border-radius:10px;font-weight:600}.btn:hover{border-color:#cfcac6}.btn.primary{background:var(--red);border-color:var(--red);color:#fff}.btn.primary:hover{background:var(--red-dark)}.btn.ghost{border-color:transparent;background:transparent;color:var(--red)}.btn.sm{padding:5px 10px;font-size:13px}.btn:disabled{opacity:.5;cursor:not-allowed}.btn:focus-visible,.nav:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--red);outline-offset:2px}.field{display:flex;flex-direction:column;gap:4px}.field label{font-size:12px;font-weight:600;color:var(--muted)}.input{border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:#fff;min-width:0}textarea.input{min-height:80px;resize:vertical}.pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}.pill.wait{background:var(--yellow-soft);color:var(--yellow-ink)}.pill.ok{background:var(--green-soft);color:var(--green)}.pill.bad{background:var(--red-soft);color:var(--red-dark)}.pill.muted{background:var(--bg);color:var(--muted)}.msg{padding:10px 12px;border-radius:10px}.msg.err{background:var(--red-soft);color:var(--red-dark)}.msg.ok{background:var(--green-soft);color:var(--green)}.msg ul{margin:6px 0 0;padding-left:18px}.login{min-height:100vh;display:grid;place-items:center;padding:16px}.login .card{width:100%;max-width:380px}.muted{color:var(--muted)}.mono{font-family:ui-monospace,Consolas,monospace;font-size:12px}.thread{display:flex;flex-direction:column;gap:8px}.bubble{padding:10px 12px;border-radius:12px;max-width:80%;white-space:pre-wrap}.bubble.me{align-self:flex-end;background:var(--red-soft)}.bubble.them{align-self:flex-start;background:var(--bg)}.toast{position:fixed;top:16px;right:16px;z-index:50;border:0;background:var(--ink);color:#fff;padding:12px 16px;border-radius:12px;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.18)}.wrap{overflow-wrap:anywhere;word-break:break-word}.clip{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:bottom}.bubble.sys{align-self:center;background:transparent;color:var(--muted);font-size:13px;text-align:center}.bubble img{display:block;max-width:260px;max-height:320px;border-radius:8px;margin-top:6px;cursor:zoom-in}.chips{display:flex;flex-direction:column;gap:4px}.tabs{gap:24px;border-bottom:1px solid var(--line)}.tab,.tabs{display:flex}.tab{align-items:center;gap:8px;padding:10px 2px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font-weight:500}.tab.on{border-bottom-color:var(--red);color:var(--ink);font-weight:700}.tab .count{min-width:20px;padding:0 6px;border-radius:999px;background:var(--line);color:var(--muted);font-size:12px;text-align:center}.tab.on .count{background:var(--red);color:#fff}.pcard{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;background:var(--surface);overflow:hidden}.pcard-head{padding:14px 16px}.pcard-foot,.pcard-head{display:flex;align-items:center;gap:12px}.pcard-foot{justify-content:space-between;padding:12px 16px;border-top:1px solid var(--line);background:var(--bg)}.av{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:20px;background:var(--red-soft);color:var(--red);font-weight:800;flex-shrink:0}.av.yellow{background:var(--yellow-soft);color:#b26a00}.av.grey{background:var(--bg);color:var(--muted)}.cgrid{display:grid;grid-template-columns:minmax(0,2.2fr) minmax(0,1.6fr) 120px 96px 96px 250px;grid-gap:12px;gap:12px;align-items:center;padding:10px 16px}.chead{padding-bottom:6px;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}.crow{border-top:1px solid var(--line)}.crow .input{width:100%;box-sizing:border-box;height:36px}.crow-note{padding:0 16px 10px;font-size:12px}.cname{display:inline-flex;align-items:center;gap:4px;min-width:0;color:var(--ink);font-weight:700;text-decoration:underline;-webkit-text-decoration-color:var(--line);text-decoration-color:var(--line);text-underline-offset:3px}.cname:hover{color:var(--red)}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.iconbtn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;flex-shrink:0;border:0;border-radius:6px;background:transparent;color:var(--muted)}.iconbtn:hover{background:var(--bg);color:var(--ink)}.btn.ib{display:inline-flex;align-items:center;gap:6px}.card-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px}.card-head>div:first-child{display:flex;flex-direction:column;gap:4px}.card-foot{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-top:4px}.grid-table{table-layout:fixed;width:100%}.grid-table td,.grid-table th{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:44px}.num-input{width:110px;text-align:right;font-feature-settings:"tnum";font-variant-numeric:tabular-nums}.suffix-input{display:inline-flex;align-items:center;gap:8px}.suffix-input>span{width:32px;text-align:left;color:var(--muted)}.suffix-input .num-input{width:120px}.form-row{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}.input.readonly{display:inline-flex;align-items:center;min-width:130px;background:var(--bg);color:var(--muted)}.form-row .input,.input.readonly{height:38px;box-sizing:border-box}.card.roomy{gap:22px;padding:22px 24px}.card.roomy h2{font-size:17px}.card.roomy .card-head>div:first-child{gap:6px}.card.roomy .card-head .muted{font-size:13px}.form-panel{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-end;align-self:flex-start;padding:18px 20px;border-radius:12px;background:var(--bg)}.form-panel .field{width:200px}.form-panel .field label{margin-bottom:2px}.form-panel .input{width:100%;background:#fff}.form-panel .input,.grid-table .input{height:42px;box-sizing:border-box}.form-panel .input.readonly{background:transparent;border-style:dashed}.form-panel .btn{height:42px;padding:0 22px;width:auto;flex:0 0 auto}.card.roomy .grid-table th{padding-top:6px}.card.roomy .grid-table td{height:52px}.formula{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 16px;border-radius:12px;background:var(--bg)}.formula .muted{font-size:12px;text-transform:uppercase;letter-spacing:.04em}.howto summary{cursor:pointer;color:var(--red);font-weight:600;width:-moz-fit-content;width:fit-content}.howto ul{margin:10px 0 0;padding-left:18px;color:var(--muted);line-height:1.8}.grid-table td.wrap,.grid-table th.wrap{white-space:normal}.grid-table td.expand{white-space:normal;overflow:visible;height:auto;padding:16px;background:var(--bg)}.grid-table .sub{display:block;font-size:12px;color:var(--muted);font-weight:400}.grid-table tr.total td{border-top:2px solid var(--line)}.page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap}.page-head-text{display:flex;flex-direction:column;gap:4px;min-width:0}.page-head .sub{max-width:none}.page-head .howto{margin-top:2px;font-size:13px}.page-head .howto ul{margin-top:6px}.card.toolbar{gap:10px;padding:14px 18px}.toolbar-row{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.toolbar-row .input{height:38px;box-sizing:border-box}.card.toolbar .howto{font-size:13px}.card.toolbar .howto ul{margin-top:6px}.grid-table th{vertical-align:bottom;line-height:1.35}.grid-table.revenue{min-width:1080px}.grid-table.revenue td{padding-left:10px;padding-right:10px}.grid-table.revenue td.num{font-feature-settings:"tnum";font-variant-numeric:tabular-nums}.grid-table.revenue{min-width:1200px}.grid-table.revenue th{text-transform:none;letter-spacing:0;font-size:13px;white-space:nowrap;vertical-align:middle;height:46px;padding-top:0;padding-bottom:0}.grid-table.revenue td{height:52px}.grid-table.revenue td:has(.tip){overflow:visible}.tip{position:relative;cursor:help;border-bottom:1px dashed var(--muted)}.tip:after{content:attr(data-tip);position:absolute;right:0;bottom:calc(100% + 8px);z-index:20;width:max-content;max-width:280px;padding:8px 12px;border-radius:8px;background:var(--ink);color:#fff;font-size:13px;font-weight:400;line-height:1.45;white-space:normal;text-align:left;opacity:0;pointer-events:none;transform:translateY(4px);transition:opacity .12s,transform .12s}.tip:hover:after{opacity:1;transform:none}.split{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);grid-gap:16px;gap:16px;align-items:start}@media (max-width:1200px){.split{grid-template-columns:1fr}}.card.compact{gap:12px;padding:16px 18px}.compact-head{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:38px}.compact-head h2{margin:0;font-size:16px}.compact-head .input{height:38px;box-sizing:border-box}.grid-table.tight th{height:36px;padding-top:0;padding-bottom:0;text-transform:none;letter-spacing:0;font-size:13px;vertical-align:middle}.grid-table.tight td{height:50px;padding-top:0;padding-bottom:0}.grid-table.tight .num-input{width:100%;max-width:110px;height:36px;box-sizing:border-box}.grid-table.tight tr.dim td{color:var(--muted)}.rate-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;grid-gap:8px;gap:8px;padding:12px;border-radius:12px;background:var(--bg)}.rate-form .input{width:100%;max-width:none;height:38px;box-sizing:border-box;background:#fff}.rate-form .btn{height:38px;padding:0 18px}.rate-form .rate-hint{grid-column:1/-1;font-size:12px}.scroll-list{max-height:260px;overflow-y:auto}.scroll-list thead th{position:-webkit-sticky;position:sticky;top:0;background:var(--surface);z-index:1}.split.even{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch}.panel,.split.even .card.compact{display:flex;flex-direction:column}.panel{gap:10px;padding:14px;border-radius:12px;background:var(--bg);min-height:232px;box-sizing:border-box}.panel-row{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-gap:8px;gap:8px}.panel-row .btn,.panel-row .input{height:38px;box-sizing:border-box;background-color:#fff}.panel-row .btn.primary{background-color:var(--red);min-width:120px}.fee-rows{display:flex;flex-direction:column;gap:6px}.fee-row{display:grid;grid-template-columns:minmax(0,1fr) 96px 130px 92px;grid-gap:8px;gap:8px;align-items:center;min-height:38px}.fee-row.two{grid-template-columns:minmax(0,1fr) 160px}.fee-row.head{min-height:20px;font-size:12px;color:var(--muted);font-weight:600}.fee-row .input,.fee-row .num{text-align:right}.fee-row .input{width:100%;height:36px;box-sizing:border-box;background:#fff}.fee-row .btn{justify-self:end}.fee-row.dim b{color:var(--muted)}.panel-hint{margin-top:auto;font-size:12px}.split.even .scroll-list{flex:1 1;max-height:240px}.grid-table.tight tr.sel td{background:var(--red-soft)}.fx-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-gap:16px;gap:16px;align-items:stretch}@media (max-width:1100px){.fx-grid{grid-template-columns:1fr}}.fx{padding:20px 22px;gap:14px}.fx-head{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:40px}.fx-head h2{font-size:16px}.fx-head .muted{display:block;margin-top:2px;font-size:12.5px}.fx-actions{display:flex;gap:8px;flex-shrink:0}.fx-actions .input{width:170px;height:38px}.fx-actions .btn{height:38px;min-width:76px}.fx-table{width:100%;border-collapse:collapse;table-layout:fixed}.fx-table th{height:34px;padding:0 10px;font-size:12.5px;text-transform:none;letter-spacing:0;color:var(--muted);font-weight:600;background:var(--bg);border-bottom:0}.fx-table th:first-child{border-radius:8px 0 0 8px}.fx-table th:last-child{border-radius:0 8px 8px 0}.fx-table td{height:50px;padding:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fx-table tr:last-child td{border-bottom:1px solid var(--line)}.fx-table .input{width:100%;height:36px;text-align:right}.fx-table td.center,.fx-table th.center{text-align:center}.fx-table .tag{color:var(--muted);font-size:12.5px;margin-left:6px}.fx-table tr.off td:first-child b{color:var(--muted);text-decoration:line-through}.fx-sub{display:flex;justify-content:space-between;align-items:baseline;margin-top:6px;font-weight:700;font-size:14px}.fx-sub .muted{font-weight:400;font-size:12.5px}.fx-scroll{max-height:210px}.fx-scroll th{position:-webkit-sticky;position:sticky;top:0;z-index:1}.fx-scroll tr.sel td{background:var(--red-soft)}.fx-scroll tr.click{cursor:pointer}.fx-scroll tr.click:hover td{background:var(--bg)}.switch{position:relative;display:inline-block;width:38px;height:22px;border:0;padding:0;border-radius:999px;background:#d6d2ce;transition:background .15s;vertical-align:middle}.switch:after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform .15s}.switch.on{background:var(--green)}.switch.on:after{transform:translateX(16px)}.switch:disabled{opacity:.5;cursor:default}.fx-scroll .fx-table th{font-size:12px}.fx-head>div:first-child{min-width:0}.fx-head .muted{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.side{position:-webkit-sticky;position:sticky;top:0;height:100vh;overflow-y:auto}.fx-scroll{max-height:calc(34px + 51px * 3);overflow-y:auto;scroll-snap-type:y mandatory;scroll-padding-top:34px;scrollbar-gutter:stable}.fx-scroll tbody tr{scroll-snap-align:start}.fx-scroll .fx-table td{height:50px;box-sizing:border-box}.fx-actions .input{width:200px}.switch{background:var(--red)}.switch.on{background:#8d8994}.grid-table.revenue.fit{min-width:0}.grid-table.revenue.fit td,.grid-table.revenue.fit th{padding-left:8px;padding-right:8px}