
:root{
 --bg:#071019;--sidebar:#0b141c;--panel:#0d1821;--panel2:#101c25;--line:#22313c;--line2:#30414d;
 --txt:#f1f4f6;--mut:#929ea7;--orange:#ffad18;--orange2:#e99108;--green:#76dd43;--red:#ff5158;
 --blue:#55adfb;--purple:#b365ff;--shadow:0 24px 70px rgba(0,0,0,.5)
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--txt);font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:15px;letter-spacing:.01em}
button,input,select{font:inherit}.app{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:100vh;background:linear-gradient(180deg,#08111a,#071019)}
.sidebar{background:linear-gradient(180deg,#0c151e 0%,#091219 100%);border-right:1px solid #1d2a34;padding:18px 12px;display:flex;flex-direction:column;gap:18px}
.brand{display:flex;align-items:center;gap:14px;padding:0 10px 9px}.logo{width:44px;height:44px;border:3px solid var(--orange);transform:rotate(30deg);border-radius:4px;box-shadow:0 0 18px rgba(255,173,24,.08)}.brand-name{font-size:21px;font-weight:900;letter-spacing:.5px;line-height:1}.brand-name span{display:block;color:var(--orange);font-size:13px;margin-top:5px;letter-spacing:1.4px}
.nav{display:grid;gap:6px}.nav-item{height:48px;border-radius:6px;padding:0 14px;display:flex;align-items:center;gap:11px;color:#c6cdd2;font-size:15px}.nav-item.active{background:linear-gradient(90deg,#2b2113,#211b13);color:var(--orange);font-weight:800;border-left:4px solid var(--orange);padding-left:10px}
.sidebox{border:1px solid var(--line);background:#0d1821;border-radius:7px;padding:15px}.sidebox h3{font-size:13px;margin:0 0 15px;text-transform:uppercase;color:#d2d8dc;letter-spacing:.35px}.lab{display:block;color:#96a2aa;font-size:12px;margin:12px 0 7px}.field{width:100%;height:41px;border-radius:5px;border:1px solid #334552;background:#09131b;color:#fff;padding:0 11px;outline:none}.field:focus{border-color:#986814;box-shadow:0 0 0 2px rgba(255,173,24,.08)}.side-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:12px}.btn{height:40px;border:1px solid #354753;background:#15212a;color:#eaf0f3;border-radius:5px;cursor:pointer;font-weight:750}.btn:hover,.topbtn:hover,.ibtn:hover,.history-small:hover{filter:brightness(1.15)}.btn.orange{background:linear-gradient(#ffbb34,#eb9708);border-color:#ffb52b;color:#1c1408}.btn.red{background:#7a2d34;border-color:#a64048}.btn.wide{width:100%;margin-top:9px}.stats{display:grid;gap:9px}.statrow{display:flex;justify-content:space-between;border-bottom:1px solid #1e2c35;padding-bottom:8px}.statrow:last-child{border:0;padding:0}.side-bottom{margin-top:auto;color:#71808a;font-size:11px;padding:0 6px}
.main{padding:16px 18px 30px;min-width:0}.topbar{height:58px;border:1px solid var(--line);background:#0c1720;border-radius:7px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;margin-bottom:14px}.top-left{display:flex;gap:32px;align-items:center;color:#d0d6da;font-size:14px}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#5dd36d;margin-right:7px}.top-right{display:flex;gap:11px}.topbtn{height:39px;border:1px solid #354754;background:#111d26;color:#e9eef1;border-radius:5px;padding:0 16px;cursor:pointer}.topbtn.primary{background:linear-gradient(#ffc146,#efa10d);border-color:#ffba31;color:#191207;font-weight:850}
.panel{border:1px solid var(--line);background:linear-gradient(180deg,#0e1922,#0c161e);border-radius:7px;overflow:visible;margin-bottom:14px}.panel-head{height:54px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 18px}.panel-title{font-size:16px;font-weight:850;letter-spacing:.2px}.badge{padding:5px 11px;border-radius:16px;background:#183d1e;color:#8ee74d;font-size:12px;font-weight:850}
.watch-table{width:100%;border-collapse:collapse;table-layout:fixed}.watch-table th{height:45px;text-align:left;padding:0 12px;color:#c3cbd1;font-size:12px;font-weight:750;border-bottom:1px solid #24333e;white-space:nowrap}.watch-table td{height:64px;padding:8px 12px;border-bottom:1px solid #1f2e38;vertical-align:middle}.watch-table tr:last-child td{border-bottom:0}.col-n{width:40px}.col-item{width:28%}.col-price{width:135px}.col-amount{width:95px}.col-any{width:130px}.col-market{width:120px}.col-status{width:125px}.col-actions{width:145px}.num{color:var(--orange);font-weight:850;font-size:16px}.item-cell{position:relative}.item-wrap{display:flex;align-items:center;gap:12px}.item-icon{width:43px;height:43px;flex:0 0 43px;border:1px solid #31434f;border-radius:7px;background:#09131b;display:grid;place-items:center;overflow:hidden;box-shadow:inset 0 0 18px rgba(255,255,255,.015)}.item-icon img{width:38px;height:38px;object-fit:contain}.item-name-input{width:100%;height:41px;border:1px solid #2b3c48;background:#09131b;color:#f4f6f7;outline:none;padding:0 11px;border-radius:5px;font-size:14px}.item-name-input:focus,.mini:focus{border-color:#8d6113;box-shadow:0 0 0 2px rgba(255,173,24,.07)}.item-sub{font-size:11px;color:#788893;margin-top:3px}.mini{height:41px;width:100%;background:#09131b;border:1px solid #2f414d;color:white;border-radius:5px;padding:0 10px;font-size:14px;outline:none}
.any-wrap{display:inline-flex;align-items:center;gap:9px;font-size:12px;color:#d5dce0;cursor:pointer;user-select:none}.any-wrap input{appearance:none;width:19px;height:19px;border:1px solid #60717d;border-radius:4px;background:#0a141c;display:grid;place-content:center;cursor:pointer}.any-wrap input:checked{background:var(--orange);border-color:var(--orange)}.any-wrap input:checked:after{content:"✓";font-size:14px;line-height:1;color:#1b1409;font-weight:900}.marketCell{font-size:14px;font-weight:800}.status-ok{color:#7fe04a;font-weight:800;white-space:nowrap}.actions{display:flex;gap:9px;align-items:center}.ibtn{width:38px;height:36px;border:1px solid #3b4d59;background:#101b23;color:#d4dce1;border-radius:5px;cursor:pointer;display:grid;place-items:center;padding:0}.ibtn svg,.history-small svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.ibtn.hist{border-color:#8d5d05;color:#ffb21a;background:#121b20}.ibtn.del{border-color:#6f2a31;color:#ff555d}.ibtn.edit{color:#d2d9dd}.suggest{display:none;position:absolute;z-index:30;left:55px;right:0;top:48px;background:#111e28;border:1px solid #425561;border-radius:6px;box-shadow:var(--shadow);max-height:300px;overflow:auto}.suggest.open{display:block}.sg{display:flex;align-items:center;gap:10px;padding:10px;border-bottom:1px solid #273640;cursor:pointer}.sg:hover{background:#172832}.sg img{width:34px;height:34px;object-fit:contain}.sg small{display:block;color:#82909a;margin-top:3px}
.found-head-tools{display:flex;gap:9px;align-items:center}.sort{height:37px;border:1px solid #344753;background:#111d25;color:#dce3e7;border-radius:5px;padding:0 10px;font-size:12px}.lots-table{width:100%;border-collapse:collapse;table-layout:fixed}.lots-table th{height:44px;color:#bbc4ca;text-align:left;padding:0 12px;font-size:12px;border-bottom:1px solid var(--line);font-weight:700}.lots-table td{height:70px;padding:8px 12px;border-bottom:1px solid #1f2e38;vertical-align:middle;font-size:14px}.lots-table tr:last-child td{border-bottom:0}.lot-item{display:flex;align-items:center;gap:11px}.lot-item .item-icon{width:40px;height:40px;flex-basis:40px}.lot-title{font-weight:750;font-size:14px;line-height:1.2}.eu{display:inline-block;margin-top:4px;background:#173c5d;color:#9bcfff;border-radius:9px;padding:1px 6px;font-size:10px}.seller{font-size:14px;color:#d8dfe3}.money{white-space:nowrap;font-weight:700}.deal{color:#79e143;font-weight:850}.bad{color:#ff5b62;font-weight:750}.timeleft{white-space:nowrap}.history-small{width:36px;height:36px;border:1px solid #895b04;color:#ffb21a;background:#111b22;border-radius:5px;cursor:pointer;display:grid;place-items:center;padding:0}.empty{padding:38px;text-align:center;color:#7a8993}.errors{padding:0 12px}.err{margin:9px 0;padding:10px;background:#3b181c;color:#ff9ea2;border:1px solid #682a30;border-radius:5px}
.modal-bg{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.30);display:none;align-items:center;justify-content:flex-end;padding:80px 22px 22px}.modal-bg.open{display:flex}.modal{width:min(790px,calc(100vw - 310px));max-height:calc(100vh - 105px);overflow:auto;background:linear-gradient(180deg,#101b24,#0b151d);border:1px solid #53636d;border-radius:9px;box-shadow:0 32px 95px rgba(0,0,0,.68)}.modal-head{height:58px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 17px;font-size:16px;font-weight:850}.close{background:none;border:0;color:#d6dde1;font-size:27px;cursor:pointer}.modal-body{padding:15px 17px}.periods{display:flex;gap:8px;flex-wrap:wrap}.preset{height:35px;border:1px solid #354853;background:#111d26;color:#dde3e7;border-radius:5px;padding:0 14px;cursor:pointer;font-size:12px}.preset.active{background:#f4a313;border-color:#ffb52b;color:#171109;font-weight:850}.dates{display:flex;align-items:end;gap:9px;margin-top:10px;padding-bottom:14px;border-bottom:1px solid var(--line)}.datebox label{display:block;font-size:11px;color:#909ca5;margin-bottom:5px}.datebox input{height:35px;background:#0a141b;border:1px solid #344651;border-radius:4px;color:#e9eef1;padding:0 8px}.apply{height:35px;background:#171f24;border:1px solid #8d5d08;color:#ffb21c;border-radius:5px;padding:0 14px;cursor:pointer}.metrics{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;padding:14px 0}.metric small{display:block;color:#8e9aa3;font-size:11px}.metric strong{display:block;margin-top:5px;font-size:17px}.chart-wrap{height:310px;border-top:1px solid #1d2b35;border-bottom:1px solid #1d2b35;padding:8px 0}.chart-wrap canvas{width:100%;height:100%}.legend{display:flex;gap:22px;font-size:11px;color:#a3adb4;margin:0 0 8px 70px}.lg:before{content:"";display:inline-block;width:20px;height:3px;margin-right:6px;vertical-align:middle}.lg.avg:before{background:#55aefc}.lg.med:before{background:#b166ff}.lg.vol:before{height:9px;background:#4e9a2b}.modal-bottom{display:grid;grid-template-columns:1fr 1fr;gap:11px;margin-top:11px}.subpanel{border:1px solid var(--line);border-radius:6px;padding:11px}.subpanel h4{margin:0 0 9px;font-size:12px;font-weight:750;color:#c5cdd2}.dist-row,.recent-row{display:flex;justify-content:space-between;align-items:center;gap:9px;font-size:11px;margin:7px 0}.bar{height:7px;flex:1;background:#1c2b35;border-radius:4px;overflow:hidden}.bar i{display:block;height:100%;background:#4f8eae}.modal-foot{color:#7e8c96;font-size:11px;margin-top:11px}.refresh-h{float:right;color:#ffb11f;cursor:pointer;font-size:18px}
@media(max-width:1180px){.app{grid-template-columns:1fr}.sidebar{display:none}.modal{width:min(790px,96vw)}.modal-bg{padding:20px}.watch-table,.lots-table{min-width:1120px}.panel{overflow:auto}}


/* ===== v6.4 visual polish — aligned to approved preview ===== */
html,body{font-family:"Segoe UI",Tahoma,Arial,sans-serif;font-size:16px;letter-spacing:0}
.app{grid-template-columns:272px minmax(0,1fr)}
.sidebar{padding:20px 14px;gap:20px}
.brand{padding:2px 10px 11px}.brand-name{font-size:22px}.brand-name span{font-size:13px}
.nav-item{height:50px;font-size:15px}
.sidebox{padding:17px;border-radius:8px}.sidebox h3{font-size:13px}.lab{font-size:13px}
.field{height:44px;border:0;background:#101c25;border-radius:6px;padding:0 13px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.035)}
.field:focus{border:0;box-shadow:inset 0 0 0 1px rgba(255,174,24,.65),0 0 0 2px rgba(255,174,24,.06)}
.btn{height:43px;border-radius:6px;font-size:14px}.btn:disabled{opacity:.28;filter:saturate(.35);cursor:not-allowed;box-shadow:none}.btn.orange:not(:disabled){box-shadow:0 0 0 1px rgba(255,185,48,.18)}.btn.red:not(:disabled){background:#8f3039;border-color:#b0444d;color:#fff}
.main{padding:18px 20px 34px}.topbar{height:62px;padding:0 20px;margin-bottom:16px}.top-left{font-size:14px;gap:34px}.topbtn{height:42px;font-size:14px}
.panel{border-radius:8px}.panel-head{min-height:54px;padding:0 16px}.panel-title{font-size:15px;letter-spacing:.15px}
.watch-table{table-layout:fixed}.watch-table th{height:49px;padding:0 10px;font-size:13px;font-weight:650;color:#d6dde1}.watch-table td{height:70px;padding:10px;border-bottom:1px solid #1e2c35;font-size:14px}
.col-n{width:42px}.col-item{width:31%}.col-price{width:150px}.col-amount{width:98px}.col-any{width:150px}.col-market{width:128px}.col-status{width:128px}.col-actions{width:128px}
.item-wrap{gap:11px}.item-icon{width:46px;height:46px;flex-basis:46px;border-radius:7px}.item-icon img{width:41px;height:41px}
.item-name-input,.mini{height:44px;border:0!important;background:#101c25!important;border-radius:6px!important;color:#f4f7f8;padding:0 13px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.025);font-size:14px}
.item-name-input:hover,.mini:hover{background:#12212b!important}.item-name-input:focus,.mini:focus{border:0!important;box-shadow:inset 0 0 0 1px rgba(255,174,24,.55),0 0 0 2px rgba(255,174,24,.045)!important}
.item-sub{font-size:11px;margin-top:4px}.num{font-size:17px}.any-wrap{font-size:13px;gap:9px}.any-wrap input{width:20px;height:20px;border-radius:4px;border-color:#52636f}.marketCell{font-size:15px;font-weight:850}.status-ok{font-size:14px}.actions{gap:8px}.ibtn{width:39px;height:38px;border-radius:6px}
.lots-table th{height:48px;font-size:13px;font-weight:650;padding:0 12px}.lots-table td{height:61px;padding:9px 12px;font-size:14px}.lot-title{font-size:14px}.seller{font-size:14px}.money{font-size:14px}.deal,.bad{font-size:14px;font-weight:850}.history-small{width:37px;height:37px;border-radius:6px}
.err{font-size:13px}.empty{font-size:14px;padding:44px}
.modal{width:min(1020px,94vw);border-radius:9px}.modal-head{height:62px;padding:0 18px}.modal-title{font-size:17px}.preset{height:37px;padding:0 14px;font-size:13px}.datefield{height:40px}.metric strong{font-size:19px}.chart-wrap{height:320px}
/* make tracking controls feel like grouped boxes instead of outlined form fields */
.watch-table td:nth-child(3),.watch-table td:nth-child(4),.watch-table td:nth-child(5){padding-left:7px;padding-right:7px}
/* signed market colors */
.marketCell.market-good{color:#72dd43!important}.marketCell.market-bad{color:#ff535b!important}.marketCell.market-neutral{color:#aab5bd!important}
/* seller placeholder is intentionally muted */
.seller.missing{color:#6f7d86}
@media(max-width:1400px){html,body{font-size:15px}.app{grid-template-columns:245px minmax(0,1fr)}.col-item{width:29%}.col-price{width:138px}}


/* ===== v6.5 compact + preview-scale tracking rows ===== */
.main{max-width:1580px}
.watch-table th{height:56px;font-size:14px}
.watch-table td{height:86px;font-size:15px}
.watch-table .item-icon{width:60px;height:60px;flex-basis:60px;border-radius:9px}
.watch-table .item-icon img{width:54px;height:54px}
.watch-table .item-name-input,.watch-table .mini{height:54px;font-size:16px;border:0!important;background:#101c25!important;box-shadow:none!important;border-radius:7px!important}
.watch-table .item-name-input:focus,.watch-table .mini:focus{background:#13232e!important;box-shadow:inset 0 0 0 1px rgba(255,174,24,.5)!important}
.watch-table .any-wrap{font-size:14px}.watch-table .any-wrap input{width:23px;height:23px}
.watch-table .marketCell{font-size:17px}.watch-table .status-ok{font-size:16px}
.watch-table .ibtn{width:44px;height:43px}.watch-table .ibtn svg{width:20px;height:20px}
.watch-table .num{font-size:18px}
.col-item{width:32%}.col-price{width:155px}.col-amount{width:105px}.col-any{width:145px}.col-market{width:130px}.col-status{width:125px}.col-actions{width:150px}
/* compact found-lots table: stop stretching every column across ultrawide screens */
.lots-table{table-layout:auto}
.lots-table th,.lots-table td{padding-left:10px;padding-right:10px}
.lots-table th:nth-child(1){width:330px}.lots-table th:nth-child(2){width:155px}.lots-table th:nth-child(3){width:75px}.lots-table th:nth-child(4){width:150px}.lots-table th:nth-child(5){width:145px}.lots-table th:nth-child(6){width:115px}.lots-table th:nth-child(7){width:115px}.lots-table th:nth-child(8){width:110px}.lots-table th:nth-child(9){width:48px}
.lots-table td:not(:first-child){white-space:nowrap}
/* item id is intentionally not rendered under tracked item name */


/* ===== v6.6 history fullscreen + sale-point inspector ===== */
.modal-head-actions{display:flex;align-items:center;gap:8px}
.modal-icon-btn{width:38px;height:36px;border:1px solid #344653;border-radius:7px;background:#12202a;color:#dfe8ed;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.15s}
.modal-icon-btn:hover{border-color:#f0a000;color:#f0a000;background:#172832}
.modal-icon-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.modal.fullscreen{position:fixed!important;inset:12px!important;width:auto!important;max-width:none!important;height:auto!important;max-height:none!important;border-radius:10px!important;display:flex;flex-direction:column}
.modal.fullscreen .modal-body{flex:1;overflow:auto}
.modal.fullscreen .chart-wrap{height:52vh;min-height:420px}
.modal.fullscreen .modal-bottom{grid-template-columns:1fr 1fr}
.chart-wrap{position:relative}
.chart-tooltip{position:absolute;z-index:8;pointer-events:none;display:none;min-width:210px;padding:10px 12px;border:1px solid #3a4c59;border-radius:8px;background:rgba(8,16,22,.96);box-shadow:0 8px 24px rgba(0,0,0,.35);font-size:12px;color:#dfe8ed;white-space:nowrap}
.chart-tooltip.open{display:block}
.chart-tooltip .tt-time{color:#91a1ac;margin-bottom:6px}
.chart-tooltip .tt-price{font-size:15px;font-weight:700;color:#f0a000;margin-bottom:4px}
.chart-tooltip .tt-row{display:flex;justify-content:space-between;gap:18px;margin-top:3px}.chart-tooltip .tt-row span{color:#8f9da7}.chart-tooltip .tt-row b{color:#e8eef2}
.legend .lg.sale:before{background:#f0a000;border-radius:50%;width:7px;height:7px}


/* v6.7.1 median profit */
.profit-pos{color:#72dd43!important;font-weight:850}
.profit-neg{color:#ff535b!important;font-weight:850}
.profit-zero{color:#aab5bd!important;font-weight:800}
.profit-sub{font-size:11px;color:#7f8e98;margin-top:2px;white-space:nowrap}

/* ===== v6.8 configurable result columns ===== */
.found-head-tools{position:relative}
.columns-btn{height:37px;border:1px solid #445864;background:#111d25;color:#e0e6ea;border-radius:5px;padding:0 12px;cursor:pointer;display:inline-flex;gap:7px;align-items:center}
.columns-btn:hover{border-color:#7c632e}
.columns-menu{display:none;position:absolute;z-index:80;right:0;top:44px;width:310px;padding:12px;background:#101b24;border:1px solid #4a5d68;border-radius:7px;box-shadow:0 18px 55px rgba(0,0,0,.55)}
.columns-menu.open{display:block}
.columns-menu-title{font-weight:850;font-size:13px;margin-bottom:9px;color:#e8edef}
.columns-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px 10px;max-height:360px;overflow:auto}
.col-opt{display:flex;align-items:center;gap:8px;color:#cbd3d8;font-size:12px;cursor:pointer;padding:5px 3px}
.col-opt input{appearance:none;width:17px;height:17px;border:1px solid #647580;background:#09131b;border-radius:3px;display:grid;place-content:center;cursor:pointer}
.col-opt input:checked{background:var(--orange);border-color:var(--orange)}
.col-opt input:checked:after{content:"✓";font-weight:950;color:#1b1409;font-size:12px}
.columns-actions{display:flex;justify-content:space-between;gap:8px;border-top:1px solid #263640;margin-top:10px;padding-top:10px}
.columns-actions button{height:31px;border:1px solid #384b56;background:#14212a;color:#dce3e7;border-radius:4px;padding:0 9px;cursor:pointer;font-size:11px}
.lots-table.dynamic-cols{table-layout:auto;min-width:1050px}
.lots-table.dynamic-cols th,.lots-table.dynamic-cols td{white-space:nowrap}
.stat-price{color:#7fc4ff;font-weight:800}
.profit-pos{color:#72dd43!important;font-weight:850}
.profit-neg{color:#ff535b!important;font-weight:850}
.profit-zero{color:#aab5bd!important;font-weight:800}
.profit-sub{font-size:10px;color:#7f8e98;margin-top:2px}


/* ===== v6.8.1 layout scale + modern scrollbars ===== */

/* On high-DPI / scaled desktop the previous 1580px cap looked too narrow.
   This gives roughly the width shown in the approved reference screenshot. */
.main{
  width:100%;
  max-width:2380px;
  padding-right:24px;
}

/* Keep panels readable while using much more of the available desktop width. */
.panel,.topbar{width:100%}

/* Slightly larger result area, matching the visual scale of the reference. */
.panel-head{min-height:60px}
.panel-title{font-size:17px}
.lots-table.dynamic-cols th{
  height:54px;
  font-size:13.5px;
  padding-left:13px;
  padding-right:13px;
}
.lots-table.dynamic-cols td{
  height:68px;
  font-size:14.5px;
  padding-left:13px;
  padding-right:13px;
}
.lots-table .lot-title{font-size:14.5px}
.lots-table .item-icon{width:44px;height:44px;flex-basis:44px}
.lots-table .item-icon img{width:40px;height:40px}

/* Make the column chooser a little roomier too. */
.columns-menu{width:340px;padding:14px}
.columns-menu-title{font-size:14px}
.columns-grid{gap:8px 12px;max-height:390px}
.col-opt{font-size:12.5px;padding:6px 4px}
.col-opt input{width:18px;height:18px}

/* Modern dark scrollbars — Firefox */
*{
  scrollbar-width:thin;
  scrollbar-color:#536674 #0a141c;
}

/* Modern dark scrollbars — Chromium / Yandex / Chrome / Edge */
*::-webkit-scrollbar{
  width:10px;
  height:10px;
}
*::-webkit-scrollbar-track{
  background:#09131b;
  border-radius:10px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.025);
}
*::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg,#526572,#3d4e59);
  border:2px solid #09131b;
  border-radius:10px;
  min-width:46px;
  min-height:46px;
}
*::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(180deg,#e59a18,#a96c0b);
}
*::-webkit-scrollbar-corner{
  background:#09131b;
}

/* Result table scrollbar gets a slightly thicker, cleaner bar. */
.panel > div[style*="overflow:auto"]::-webkit-scrollbar{
  height:12px;
}
.panel > div[style*="overflow:auto"]::-webkit-scrollbar-track{
  background:#0a151d;
  border-radius:8px;
}
.panel > div[style*="overflow:auto"]::-webkit-scrollbar-thumb{
  background:#465b68;
  border:3px solid #0a151d;
  border-radius:8px;
}
.panel > div[style*="overflow:auto"]::-webkit-scrollbar-thumb:hover{
  background:#d28d17;
}

/* Do not let the whole layout become absurdly wide on very large displays. */
@media (min-width:2600px){
  .main{max-width:2460px}
}


/* ===== v6.9 History analytics ===== */
.modal{
  --hist-scale:1.2;
  width:min(1320px,calc(100vw - 330px));
  max-height:calc(100vh - 82px);
  border-color:#3c4d58;
  border-radius:10px;
  overflow:hidden;
}
.modal.fullscreen{
  width:calc(100vw - 40px)!important;
  height:calc(100vh - 40px)!important;
  max-height:none!important;
  border-radius:10px;
}
.modal.fullscreen .modal-body{height:calc(100% - 62px);overflow:auto}
.modal-head{height:62px;padding:0 20px}
.modal-head #modalTitle{font-size:calc(16px * var(--hist-scale));letter-spacing:.15px}
.modal-body{padding:16px 20px 18px;overflow:auto}
.hist-toolbar{
  display:flex;align-items:flex-end;justify-content:space-between;gap:20px;
  padding-bottom:14px;border-bottom:1px solid #23333e;
}
.hist-toolbar-left{min-width:0}
.hist-toolbar-right{display:flex;align-items:flex-end;gap:15px;flex-wrap:wrap;justify-content:flex-end}
.hist-control-label{font-size:calc(10px * var(--hist-scale));color:#8997a0;margin:0 0 6px}
.hist-scale,.hist-view{display:flex;gap:5px}
.hist-scale button,.hist-view button{
  height:35px;min-width:42px;padding:0 11px;border:1px solid #344650;background:#101b24;
  color:#aeb8be;border-radius:5px;cursor:pointer;font-size:calc(10px * var(--hist-scale));
}
.hist-scale button.active,.hist-view button.active{
  border-color:#9c6c0c;color:#ffb41f;background:#181c1d;box-shadow:inset 0 -2px 0 #e99a13
}
.hist-view button.active{background:#ec9c12;color:#15100a;border-color:#ffb72f;font-weight:850}
.hist-dates-row{
  display:flex;align-items:flex-end;gap:10px;margin-top:12px;flex-wrap:wrap
}
.modal .lab{font-size:calc(10px * var(--hist-scale))}
.modal .preset{
  height:36px;font-size:calc(10px * var(--hist-scale));padding:0 14px
}
.modal .datebox label{font-size:calc(9px * var(--hist-scale))}
.modal .datebox input,.modal .apply{height:36px;font-size:calc(10px * var(--hist-scale))}
.metrics{
  grid-template-columns:repeat(6,minmax(120px,1fr));
  gap:0;padding:0;margin:15px 0;border:1px solid #24343e;border-radius:7px;overflow:hidden
}
.metric{
  padding:14px 16px;background:rgba(255,255,255,.008);border-right:1px solid #24343e;min-width:0
}
.metric:last-child{border-right:0}
.metric small{font-size:calc(9px * var(--hist-scale));line-height:1.2}
.metric strong{font-size:calc(16px * var(--hist-scale));line-height:1.1;margin-top:7px}
.metric .metric-sub{font-size:calc(8px * var(--hist-scale));margin-top:5px;color:#7f8c96}
.hist-panel-title{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin:18px 0 9px;font-size:calc(13px * var(--hist-scale));font-weight:800;color:#dde4e8
}
.hist-panel-title small{font-size:calc(8px * var(--hist-scale));color:#75848e;font-weight:500}
.legend{
  margin:10px 0 10px 72px;gap:24px;font-size:calc(9px * var(--hist-scale));flex-wrap:wrap
}
.lg.sale:before{height:9px;width:9px;border-radius:50%;background:#a960dd}
.chart-wrap{
  position:relative;height:470px;padding:0;border:1px solid #22323d;border-radius:7px;
  background:
    linear-gradient(rgba(30,44,55,.28) 1px,transparent 1px),
    linear-gradient(90deg,rgba(30,44,55,.22) 1px,transparent 1px),
    #0b141d;
  background-size:100% 54px,76px 100%,auto;
  overflow:hidden;cursor:grab
}
.chart-wrap.dragging{cursor:grabbing}
.modal.fullscreen .chart-wrap{height:min(62vh,720px)}
.chart-wrap canvas{display:block;width:100%;height:100%}
.chart-tip-note{
  position:absolute;right:10px;top:9px;padding:6px 9px;border:1px solid #2c3c47;
  border-radius:14px;background:rgba(11,20,28,.78);color:#86949e;
  font-size:calc(8px * var(--hist-scale));pointer-events:none
}
.chart-tooltip{
  font-size:calc(10px * var(--hist-scale));min-width:220px;padding:11px 13px
}
.chart-tooltip .tt-time{font-size:calc(9px * var(--hist-scale))}
.chart-tooltip .tt-price{font-size:calc(14px * var(--hist-scale))}
.chart-tooltip .tt-row{font-size:calc(9px * var(--hist-scale));margin-top:6px}
.hist-graph-view{display:block}
.hist-table-view{display:none}
.modal.view-table .hist-graph-view{display:none}
.modal.view-table .hist-table-view{display:block}
.hist-table-wrap{
  border:1px solid #273842;border-radius:7px;overflow:auto;max-height:560px;background:#0d171f
}
.hist-table{width:100%;border-collapse:collapse;min-width:760px}
.hist-table th{
  position:sticky;top:0;z-index:2;background:#121e27;color:#b9c4ca;text-align:left;
  height:46px;padding:0 14px;font-size:calc(10px * var(--hist-scale));border-bottom:1px solid #30414c
}
.hist-table td{
  height:43px;padding:0 14px;font-size:calc(10px * var(--hist-scale));
  border-bottom:1px solid #202f39;color:#d7dfe3
}
.hist-table tr:hover td{background:#13232d}
.hist-table .num{text-align:right;font-variant-numeric:tabular-nums}
.hist-table-pager{
  display:flex;justify-content:flex-end;align-items:center;gap:9px;padding:11px 2px 0;
  color:#7f8d96;font-size:calc(9px * var(--hist-scale))
}
.hist-page-btn,.hist-page-size{
  height:31px;border:1px solid #334650;background:#111d26;color:#cad2d7;border-radius:5px;padding:0 10px
}
.hist-page-btn{cursor:pointer}.hist-page-btn:disabled{opacity:.3;cursor:not-allowed}
.hist-page-size{outline:none}
.modal-bottom{
  gap:13px;margin-top:13px
}
.subpanel{padding:14px 16px}
.subpanel h4{
  margin:0 0 10px;font-size:calc(13px * var(--hist-scale));line-height:1.05;letter-spacing:0
}
.dist-row,.recent-row{
  font-size:calc(10px * var(--hist-scale));margin:5px 0;gap:7px;line-height:1.08
}
.dist-row span{min-width:calc(125px * var(--hist-scale))}
.dist-row b{min-width:52px;text-align:right}
.bar{height:9px}
.recent-row span{color:#9aa6ad}
.recent-row b{font-size:calc(10px * var(--hist-scale))}
.modal-foot{font-size:calc(9px * var(--hist-scale));margin-top:12px}
.hist-summary-note{font-size:calc(8px * var(--hist-scale));color:#798892}
@media(max-width:1500px){
  .modal{width:min(1120px,calc(100vw - 300px))}
  .metrics{grid-template-columns:repeat(3,1fr)}
  .metric:nth-child(3){border-right:0}
  .modal-bottom{grid-template-columns:1fr}
}
@media(max-width:980px){
  .modal{width:96vw}
  .metrics{grid-template-columns:1fr 1fr}
  .hist-toolbar{align-items:flex-start;flex-direction:column}
  .hist-toolbar-right{justify-content:flex-start}
}



/* Persistent history warning: separate from #modalTitle, so JS cannot erase it. */
.modal-head{position:relative;padding-top:4px;padding-bottom:4px}
#modalTitle{display:block;padding-bottom:25px}
.history-update-notice{
  position:absolute;
  left:20px;
  bottom:7px;
  color:#ff4d5a;
  font-size:inherit;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
  pointer-events:none;
}
@media(max-width:900px){
  .history-update-notice{font-size:.85em;white-space:normal;right:90px}
}

/* ===== v6.21 live monitor status ===== */
.topbar.monitor-statusbar{
  min-height:92px;height:auto;padding:12px 16px;gap:18px;
  align-items:stretch;
}
.monitor-live{
  min-width:330px;flex:1;display:flex;flex-direction:column;justify-content:center;
}
.monitor-live-head{
  display:flex;align-items:center;gap:9px;font-size:14px;font-weight:850;letter-spacing:.15px
}
.run-dot{
  width:10px;height:10px;border-radius:50%;display:inline-block;flex:0 0 10px;
  background:#65727b;box-shadow:0 0 0 3px rgba(101,114,123,.09)
}
.run-dot.off{background:#65727b;box-shadow:none}
.run-dot.active{background:#69da56;box-shadow:0 0 0 4px rgba(105,218,86,.10);animation:runPulse 1.4s ease-in-out infinite}
.run-dot.checking{background:#f1a91b;box-shadow:0 0 0 4px rgba(241,169,27,.12);animation:runPulse .72s ease-in-out infinite}
.run-dot.error{background:#ff535b;box-shadow:0 0 0 4px rgba(255,83,91,.12)}
@keyframes runPulse{0%,100%{transform:scale(.9);opacity:.72}50%{transform:scale(1.18);opacity:1}}
.monitor-uptime{
  margin-left:7px;color:#84939d;font-size:12px;font-weight:700;font-variant-numeric:tabular-nums
}
.monitor-activity{
  margin-top:7px;color:#aab6bd;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.monitor-progress{
  position:relative;height:4px;margin-top:9px;background:#17252e;border-radius:5px;overflow:hidden
}
.monitor-progress i{
  position:absolute;left:0;top:0;bottom:0;width:0;border-radius:5px;
  background:linear-gradient(90deg,#cb8310,#ffc149);transition:width .25s ease
}
.monitor-progress.checking i{
  width:34%;animation:scanSlide 1.2s ease-in-out infinite
}
@keyframes scanSlide{
  0%{transform:translateX(-105%)}
  55%{transform:translateX(195%)}
  100%{transform:translateX(310%)}
}
.monitor-progress.waiting i{background:#4fa743}
.monitor-progress.error i{width:100%;background:#b83a43}
.monitor-metrics{
  display:grid;grid-template-columns:repeat(5,minmax(92px,1fr));gap:7px;align-items:stretch;
  min-width:590px
}
.monitor-metric{
  display:flex;flex-direction:column;justify-content:center;min-width:0;
  padding:8px 10px;border-left:1px solid #263640
}
.monitor-metric small{
  color:#71818b;font-size:9px;text-transform:uppercase;letter-spacing:.55px;white-space:nowrap
}
.monitor-metric b{
  color:#e0e6e9;font-size:13px;margin-top:5px;white-space:nowrap;font-variant-numeric:tabular-nums
}
.monitor-metric b.good{color:#7ade4c}
.monitor-metric b.warn{color:#f2ad20}
.monitor-statusbar .top-right{align-items:center;flex:0 0 auto}
@media(max-width:1500px){
  .topbar.monitor-statusbar{flex-wrap:wrap}
  .monitor-live{min-width:280px}
  .monitor-metrics{order:3;width:100%;min-width:0;border-top:1px solid #22323c;padding-top:6px}
  .monitor-metric{border-left:0;border-right:1px solid #22323c}
}
@media(max-width:850px){
  .monitor-metrics{grid-template-columns:repeat(2,1fr)}
  .monitor-metric{border-bottom:1px solid #22323c}
}

/* ===== Quality tabs for found lots ===== */
.quality-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding:10px 16px;
  border-bottom:1px solid #22333e;
  background:#0b151d;
}
.quality-tab{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  padding:7px 12px;
  border:1px solid #31434e;
  border-radius:6px;
  background:#0e1921;
  color:#c6d0d6;
  cursor:pointer;
  font:inherit;
  transition:.15s;
  position:relative;
}
.quality-tab:hover{
  border-color:var(--q-color,#607782);
}
.quality-tab b{
  font-size:13px;
  font-weight:800;
  color:#e5ecef;
}
.quality-tab small{
  font-size:10px;
  color:#7d919b;
}
.quality-tab.active{
  border-color:var(--q-color,#e49a18);
  background:#1b1a10;
  box-shadow:inset 0 -2px var(--q-color,#e49a18);
}
.quality-tab.active b{
  color:var(--q-color,#ffb31e);
}
.quality-tab[data-q="all"].active{
  border-color:#e49a18;
  box-shadow:inset 0 -2px #e49a18;
}
.quality-tab[data-q="all"].active b{
  color:#ffb31e;
}
/* Click-to-copy item name */
.lot-item-copy{
  cursor:copy;
}
.lot-item-copy:hover .lot-title{
  color:#ffb31e;
  text-decoration:underline;
  text-decoration-style:dotted;
  text-underline-offset:3px;
}

/* Toast для копирования */
.copy-toast{
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:9999;
  padding:11px 15px;
  border:1px solid #426554;
  border-radius:7px;
  background:#10251a;
  color:#92d2a7;
  font:600 13px Inter,"Segoe UI",Arial,sans-serif;
  box-shadow:0 10px 30px rgba(0,0,0,.4);
  opacity:0;
  transform:translateY(8px);
  transition:.18s;
  pointer-events:none;
}
.copy-toast.show{
  opacity:1;
  transform:translateY(0);
}

/* === Watch-list toolbar (CSV/Excel export + import) === */
.watch-head-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.watch-head-actions .topbtn{padding:0 12px}

/* === Collapsible tracked-items table === */
.watch-collapse-body.collapsed{display:none}
.collapse-watch-btn{display:inline-flex;align-items:center;gap:6px}
.collapse-watch-btn.collapsed{border-color:#8d5d08;color:#ffb21c}
.watch-panel:has(.watch-collapse-body.collapsed) .panel-head{border-bottom-color:transparent}

/* Светлые иконки предметов не сливались с фоном плитки. */
.lots-table .item-icon img,.watch-table .item-icon img{filter:drop-shadow(0 1px 2px rgba(0,0,0,.45))}

/* Панель статуса в узком окне: блоки не сжимались, и кнопка «Настройки» уезжала
   за правый край. Разрешаем перенос и сжатие, подписи метрик могут переноситься. */
.monitor-statusbar{flex-wrap:wrap}
.monitor-live{min-width:0;flex:1 1 260px}
.monitor-metrics{min-width:0;flex:1 1 420px}
.monitor-metric small{white-space:normal;line-height:1.15}
.monitor-statusbar .top-right{flex-wrap:wrap;justify-content:flex-end}
/* Метрики ужимаются сильнее, поэтому панель остаётся в одну строку до 1500px. */
@media(min-width:851px){
  .monitor-metrics{grid-template-columns:repeat(5,minmax(74px,1fr))}
}

/* Выпадающий список предметов был шириной с ячейку: иконки обрезались, появлялась
   горизонтальная прокрутка. Даём ему собственную ширину и убираем горизонтальный скролл. */
.suggest{left:0;right:auto;min-width:min(340px,82vw);max-width:min(460px,92vw);overflow-x:hidden}

/* Средние ширины (1180–1500): колонки таблицы отслеживания были шире, чем панель,
   из-за чего заголовки налезали друг на друга, а правый край уезжал за экран.
   Ужимаем служебные колонки — таблица снова влезает целиком, без прокрутки. */
@media(max-width:1500px){
  .watch-table .item-icon{width:44px;height:44px;flex-basis:44px}
  .watch-table .item-icon img{width:38px;height:38px}
  .col-item{width:34%}
  .col-price{width:104px}
  .col-amount{width:74px}
  .col-any{width:104px}
  .col-market{width:100px}
  .col-status{width:102px}
  .col-actions{width:104px}
}

/* Шапка панели была фиксированной высоты (54px): когда кнопки переносились на вторую
   строку, низ обрезался и появлялась прокрутка панели. Растим шапку по содержимому. */
.panel-head{height:auto;min-height:54px;flex-wrap:wrap;row-gap:8px;padding-top:8px;padding-bottom:8px}
/* Заголовки колонок переносятся на вторую строку вместо обрезки («Ниже рынка (%)»). */
.watch-table th{white-space:normal;line-height:1.15}
