:root{
  --page:#eef1f4;--panel:#fff;--header:#18324a;--text:#172331;--border:#a8b2bc;--round-border:#35566f;--gold:#a47b24;--invalid:#b42318;
  --bw:1px;--round-bw:3px;--deg-row-height:46px;--moisture-row-height:46px;
  --deg-w-time:112px;--deg-w-over1:88px;--deg-w-over12:88px;--deg-w-over14:88px;--deg-w-over18:88px;--deg-w-pan:88px;--deg-w-above-half:104px;--deg-w-above-quarter:104px;--deg-w-above-eighth:104px;--deg-w-obj:88px;--deg-w-stem:88px;
  --moisture-w-time:122px;--moisture-w-brabender:124px;--moisture-w-mettler:112px;--moisture-w-raff:104px;--moisture-w-vcol:104px;--moisture-w-vcok:104px;
  --deg-time:#eef3f7;--deg-over1:#fff;--deg-over12:#f7f9fb;--deg-over14:#fff;--deg-over18:#f7f9fb;--deg-pan:#fff;--deg-above-half:#edf4f6;--deg-above-quarter:#f4f8f9;--deg-above-eighth:#edf4f6;--deg-obj:#f7f4ef;--deg-stem:#eef2ec;
  --moisture-time:#f2f5f8;--moisture-brabender:#fff;--moisture-mettler:#f3f5f7;--moisture-raff:#fff6dc;--moisture-vcol:#f4f7f8;--moisture-vcok:#f4f7f8;
  color-scheme:light;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;background:var(--page);color:var(--text);font-size:14px;overflow:hidden;-webkit-font-smoothing:antialiased}
button,input,select,output{font:inherit}
button{border:1px solid #c3ccd4;background:#f7f9fb;color:#18324a;border-radius:9px;padding:9px 13px;font-weight:750;cursor:pointer;transition:background .18s,border-color .18s,transform .08s,box-shadow .18s}
button:hover{background:#eef3f7;border-color:#9fadb9}button:active{transform:translateY(1px)}button:disabled{opacity:.48;cursor:not-allowed;transform:none}
input,select{border:1px solid #b8c3cc;border-radius:8px;background:#fff;color:#172331;padding:8px 10px;outline:none}input:focus,select:focus{border-color:#527895;box-shadow:0 0 0 3px #52789522}
.primary-button{background:var(--header);border-color:var(--header);color:#fff}.primary-button:hover{background:#234763}
.danger-button{color:#a61b13;border-color:#e0aaa6;background:#fff7f6}.danger-button:hover{background:#fde9e7}
[hidden]{display:none!important}
.login-view{height:100%;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 10%,#fff 0,#f4f7f9 38%,#dfe6eb 100%)}
.login-card{width:min(420px,100%);background:#ffffffee;border:1px solid #d0d8df;border-radius:20px;padding:30px;display:grid;gap:11px;box-shadow:0 24px 70px #1a334a24;backdrop-filter:blur(12px)}
.login-brand{display:flex;align-items:center;gap:15px}.login-brand img{object-fit:contain;background:#fff;border:1px solid #dbe2e8;border-radius:15px;box-shadow:0 8px 20px #18324a15}.login-brand span{display:block;font-size:11px;letter-spacing:.18em;color:#5d7182;font-weight:800}.login-brand h1{font-size:26px;margin:2px 0 0;letter-spacing:-.03em}.login-intro{margin:7px 0 9px;color:#637687}.login-card label{font-weight:750;font-size:12px;color:#334d62}.login-card input{width:100%;padding:13px 14px;font-size:16px}.login-card button{margin-top:7px;padding:13px}.login-note{font-size:12px;color:#71818f;text-align:center;margin:2px 0 0}.error{min-height:19px;color:var(--invalid);margin:0;text-align:center;font-weight:650}
.closed-view{height:100%;display:grid;place-items:center;padding:30px;text-align:center;background:#eef1f4}.closed-view div{max-width:440px;background:#fff;padding:30px;border-radius:18px;border:1px solid #d2dbe2}.closed-view h1{font-size:22px;margin-top:0}
.app{height:100%;display:grid;grid-template-rows:auto auto minmax(0,1fr)}
.topbar{min-height:58px;background:linear-gradient(135deg,var(--header),color-mix(in srgb,var(--header),#fff 10%));color:#fff;display:flex;align-items:center;gap:18px;padding:7px 12px;border-bottom:1px solid #ffffff20;box-shadow:0 5px 18px #0f253733;z-index:4}
.brand{display:flex;align-items:center;gap:9px;white-space:nowrap}.brand img{width:36px;height:36px;object-fit:contain;background:#fff;border-radius:9px;padding:2px}.brand strong{display:block;font-size:15px}.brand small{display:block;font-size:10px;color:#d6e2eb;margin-top:1px;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.live-meta{flex:1;min-width:0;display:flex;gap:7px;overflow:auto;scrollbar-width:none}.live-meta::-webkit-scrollbar{display:none}.live-meta span{white-space:nowrap;background:#ffffff12;border:1px solid #ffffff20;border-radius:999px;padding:5px 9px;font-size:11px}
.header-actions{display:flex;align-items:center;gap:6px}.icon-button,.small-button{background:#ffffff12;color:#fff;border-color:#ffffff38;padding:7px 9px}.connection{font-size:19px;color:#83dfa0;text-shadow:0 0 8px #83dfa099}.connection.offline{color:#ff8c86;text-shadow:0 0 8px #ff8c8699}
.tabs{--tab-count:4;display:grid;grid-template-columns:repeat(var(--tab-count),minmax(0,1fr));background:#fff;border-bottom:1px solid #d3dbe2;padding:6px;gap:5px;overflow:auto;z-index:3}.tabs button{border:0;border-radius:8px;background:transparent;padding:9px 7px;font-size:11px;color:#536879;white-space:nowrap}.tabs button.active{background:#eaf0f5;color:var(--header);box-shadow:inset 0 0 0 1px #c9d6df}
.panel{min-height:0;height:100%;background:var(--panel)}.live-panel{overflow:hidden}.table-scroll{width:100%;height:100%;overflow:auto;scrollbar-gutter:stable both-edges;overscroll-behavior:contain}
.result-table{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.result-table th,.result-table td{border-right:var(--bw) solid var(--border);border-bottom:var(--bw) solid var(--border);padding:7px 9px;text-align:center;white-space:nowrap;min-width:64px}.result-table th:first-child,.result-table td:first-child{border-left:var(--bw) solid var(--border)}
.result-table thead{position:sticky;top:0;z-index:3}.result-table thead th{background:#e8eef2;border-top:var(--bw) solid var(--border);font-size:11px;text-transform:uppercase;letter-spacing:.035em;color:#304b60}.result-table tfoot{position:sticky;bottom:0;z-index:2}.result-table tfoot td{background:#e5ebef;font-weight:800;border-top:2px solid var(--header)}
.result-table tr.grade-row td{position:sticky;left:0;text-align:left;background:#dbe5eb;color:#18324a;font-weight:800;z-index:1;border-top:2px solid #7890a2;letter-spacing:.015em}.result-table tr.invalid td{color:var(--invalid)!important;font-weight:800}.result-table tbody tr[data-single-report]{cursor:pointer}.result-table tbody tr[data-single-report]:active td{filter:brightness(.96)}
.time-main{display:block;font-size:12px;font-weight:700}.box-sub{display:block;font-style:italic;font-weight:450;margin-top:2px;color:#536675}.deg-over1{background:var(--deg-over1)}.deg-over12{background:var(--deg-over12)}.deg-over14{background:var(--deg-over14)}.deg-over18{background:var(--deg-over18)}.deg-pan{background:var(--deg-pan)}.deg-above-half{background:var(--deg-above-half)}.deg-above-quarter{background:var(--deg-above-quarter)}.deg-above-eighth{background:var(--deg-above-eighth)}.deg-obj{background:var(--deg-obj)}.deg-stem{background:var(--deg-stem)}
.deg-table tbody tr:not(.grade-row)>td{height:var(--deg-row-height)}.deg-table .time-cell{background:var(--deg-time);width:var(--deg-w-time);min-width:var(--deg-w-time)!important}.deg-table .deg-over1{width:var(--deg-w-over1);min-width:var(--deg-w-over1)}.deg-table .deg-over12{width:var(--deg-w-over12);min-width:var(--deg-w-over12)}.deg-table .deg-over14{width:var(--deg-w-over14);min-width:var(--deg-w-over14)}.deg-table .deg-over18{width:var(--deg-w-over18);min-width:var(--deg-w-over18)}.deg-table .deg-pan{width:var(--deg-w-pan);min-width:var(--deg-w-pan)}.deg-table .deg-above-half{width:var(--deg-w-above-half);min-width:var(--deg-w-above-half)}.deg-table .deg-above-quarter{width:var(--deg-w-above-quarter);min-width:var(--deg-w-above-quarter)}.deg-table .deg-above-eighth{width:var(--deg-w-above-eighth);min-width:var(--deg-w-above-eighth)}.deg-table .deg-obj{width:var(--deg-w-obj);min-width:var(--deg-w-obj)}.deg-table .deg-stem{width:var(--deg-w-stem);min-width:var(--deg-w-stem)}
.moisture-table .time-cell{background:var(--moisture-time);width:var(--moisture-w-time);min-width:var(--moisture-w-time)!important}.moisture-table .time-main{color:var(--gold);font-size:11px}.moisture-brabender{background:var(--moisture-brabender);font-weight:800;font-size:16px;width:var(--moisture-w-brabender);min-width:var(--moisture-w-brabender)}.moisture-mettler{background:var(--moisture-mettler);color:#667783;width:var(--moisture-w-mettler);min-width:var(--moisture-w-mettler)}.moisture-raff{background:var(--moisture-raff);color:var(--gold);font-weight:800;width:var(--moisture-w-raff);min-width:var(--moisture-w-raff)}.moisture-vcol{background:var(--moisture-vcol);font-style:italic;width:var(--moisture-w-vcol);min-width:var(--moisture-w-vcol)}.moisture-vcok{background:var(--moisture-vcok);font-style:italic;width:var(--moisture-w-vcok);min-width:var(--moisture-w-vcok)}
.moisture-table tbody tr.moisture-sample-row>td{height:var(--moisture-row-height);border-bottom:1px solid #d4dce2}.moisture-table tbody tr.moisture-group-start>td{border-top:var(--round-bw) solid var(--round-border)}
.nicotine-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 13px;background:#f3f6f8;border-bottom:1px solid #d4dde4}.nicotine-toolbar>div{display:grid;gap:2px}.nicotine-toolbar strong{font-size:15px}.nicotine-toolbar small{color:#718391;font-size:11px}
#panel-nicotine{display:grid;grid-template-rows:auto minmax(0,1fr)}.nicotine-table tbody tr:not(.crop-row)>td{height:44px}.nicotine-table .crop-row td{text-align:left;background:#dbe5eb;color:#18324a;font-weight:850;border-top:2px solid #7890a2;letter-spacing:.03em;padding-left:13px}.nicotine-table th:nth-child(1),.nicotine-table td:nth-child(1){min-width:96px}.nicotine-table th:nth-child(2),.nicotine-table td:nth-child(2){min-width:90px}.nicotine-table th:nth-child(3),.nicotine-table td:nth-child(3){min-width:74px}.nicotine-table th:nth-child(4),.nicotine-table td:nth-child(4){min-width:120px}.nicotine-table th:nth-child(5),.nicotine-table td:nth-child(5){min-width:120px}.nicotine-table th:nth-child(6),.nicotine-table td:nth-child(6){min-width:125px}.nicotine-table th:nth-child(7),.nicotine-table td:nth-child(7),.nicotine-table th:nth-child(8),.nicotine-table td:nth-child(8),.nicotine-table th:nth-child(9),.nicotine-table td:nth-child(9){min-width:108px}.nicotine-table th:nth-child(10),.nicotine-table td:nth-child(10){min-width:150px}.nicotine-table th:nth-child(11),.nicotine-table td:nth-child(11){min-width:140px}.nicotine-table th:nth-child(12),.nicotine-table td:nth-child(12){min-width:220px}.nicotine-table .nicotine-value{font-weight:850}.nicotine-table .note-cell{white-space:normal;text-align:left;line-height:1.25}
.empty-cell{padding:38px!important;color:#70808c;font-style:italic}.empty-state{margin:20px auto;max-width:460px;padding:28px;border:1px dashed #b9c5ce;border-radius:15px;text-align:center;display:grid;gap:6px;color:#687b89}.empty-state strong{color:#314c60}
.report-panel{overflow:auto;padding:13px;background:#f3f6f8}.report-toolbar{position:sticky;top:-13px;z-index:2;background:#f3f6f8dd;backdrop-filter:blur(10px);display:flex;align-items:center;justify-content:space-between;padding:10px 0 12px;border-bottom:1px solid #d4dde4}.report-toolbar div{display:grid;gap:2px}.report-toolbar strong{font-size:16px}.report-toolbar small{color:#718391}.report-list{display:grid;gap:16px;padding:13px 0}.report-date-group{background:#fff;border:1px solid #d5dee5;border-radius:15px;overflow:hidden;box-shadow:0 6px 20px #18324a0b}.report-date-group h2{margin:0;padding:11px 14px;background:#e7edf2;color:#29475e;font-size:14px;letter-spacing:.02em}.report-date-group>div{display:grid}.report-item{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:10px 12px;border-top:1px solid #e2e8ed}.report-item:first-child{border-top:0}.report-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;background:#f7f9fb}.report-meta{font-size:10px;color:#6d7e8a;white-space:nowrap}.report-item.daily-moisture .report-name{font-weight:800}.report-item.boxes .report-name{color:var(--invalid);font-weight:800}.report-item a{color:#1d5a42;font-weight:800;text-decoration:none;font-size:11px}
dialog{border:1px solid #b8c4cd;border-radius:16px;padding:0;color:var(--text);background:var(--panel);box-shadow:0 24px 90px #0c203055}dialog::backdrop{background:#10283c99;backdrop-filter:blur(4px)}
.settings-dialog{width:min(1040px,97vw);max-height:95vh}.settings-dialog form{display:grid;grid-template-rows:auto minmax(0,1fr) auto;max-height:95vh}.dialog-head,.dialog-actions,.pdf-head{display:flex;align-items:center;gap:10px;padding:12px 14px;background:#edf2f5;border-bottom:1px solid #d0d9e0}.dialog-head>div{display:grid;gap:2px}.dialog-head strong,.pdf-head strong{flex:1}.dialog-head small{color:#6f808c}.settings-body{overflow:auto;padding:13px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;background:#f6f8fa}.settings-body fieldset{margin:0;border:1px solid #d1dae1;border-radius:12px;background:#fff;display:grid;gap:9px;align-content:start;padding:12px}.settings-body legend{font-weight:800;color:#27465d;padding:0 5px}.settings-body label{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-body input[type=color]{width:46px;height:31px;padding:2px}.settings-body input[type=number],.settings-body select,.credential-card input{min-width:88px;max-width:100%}.settings-body output{min-width:35px;display:inline-block;color:#526a7c;font-size:11px}.settings-body input[type=range]{vertical-align:middle}.managed-settings-note{grid-column:1/-1;margin:0;background:#fff3d9;border:1px solid #edce8b;color:#76520c;padding:10px 12px;border-radius:10px;font-weight:650}
.color-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.size-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;border-top:1px solid #e4e9ed;padding-top:8px}.size-grid label{font-size:11px}.size-grid input{width:76px}.checks{display:grid;grid-template-columns:1fr 1fr;gap:6px;border-top:1px solid #e4e9ed;padding-top:8px}.checks label{justify-content:flex-start;font-size:12px}.dialog-actions{justify-content:flex-end;border-top:1px solid #d0d9e0;border-bottom:0;background:#fff}
.admin-settings{grid-column:1/-1!important;background:#f9fbfc!important;border-color:#8ea4b5!important;padding:14px!important}.admin-toolbar{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.admin-toolbar label{flex:1;min-width:240px}.credential-card{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:12px;background:#eaf0f4;border:1px solid #ccd8e1;border-radius:12px}.credential-card label{display:grid;justify-content:stretch;gap:5px;font-size:11px;font-weight:750}.key-display{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:20px!important;letter-spacing:.2em;text-align:center;font-weight:900;background:#fff!important}.credential-actions{grid-column:1/-1;display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.admin-preferences{display:grid;gap:10px}.admin-preferences h3{margin:9px 0 0;padding-bottom:6px;border-bottom:1px solid #d7e0e7;color:#27475f;font-size:14px}.panel-order-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.panel-order-row{background:#fff;border:1px solid #d8e0e6;border-radius:9px;padding:7px!important;justify-content:flex-start!important}.panel-order-row span{flex:1}.panel-order-row input[type=number]{width:58px;min-width:58px}.admin-two-columns{display:grid;grid-template-columns:1fr 1fr;gap:11px}.admin-two-columns section{background:#fff;border:1px solid #d7e0e6;border-radius:10px;padding:10px;display:grid;gap:8px}.admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.admin-color-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.admin-color-grid label{background:#fff;border:1px solid #d8e0e6;border-radius:8px;padding:6px;font-size:11px}.lock-setting{justify-content:flex-start!important;background:#fff3d9;border:1px solid #e6c67d;border-radius:9px;padding:9px!important}.admin-save-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.admin-save-row span{font-size:12px;color:#657986}
.small-dialog{width:min(460px,94vw)}.small-dialog form{display:grid}.dialog-content{padding:15px;display:grid;gap:11px}.dialog-content label{display:grid;gap:5px;font-weight:750}.dialog-content small{color:#6a7c89}
.pdf-dialog{width:98vw;height:96vh;max-width:none;max-height:none}.pdf-dialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr)}.pdf-head a{font-weight:800;color:#1f5a43}.pdf-dialog iframe{width:100%;height:100%;border:0;background:#fff}
.toast{position:fixed;left:50%;bottom:22px;transform:translate(-50%,25px);opacity:0;pointer-events:none;background:#172f43;color:#fff;padding:11px 16px;border-radius:999px;font-weight:750;box-shadow:0 10px 30px #0004;transition:.2s;z-index:999}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:760px){
  .topbar{gap:8px}.brand strong{font-size:13px}.brand small{max-width:90px}.live-meta{display:none}.small-button{font-size:10px;padding:7px}.tabs{padding:5px;gap:3px;grid-template-columns:repeat(3,minmax(0,1fr))}.tabs button{font-size:10px;padding:8px 5px}.nicotine-toolbar{padding:8px 9px}.nicotine-toolbar small{font-size:10px}
  .settings-body{grid-template-columns:1fr}.managed-settings-note,.admin-settings{grid-column:1!important}.color-grid,.size-grid,.checks,.panel-order-grid,.admin-grid,.admin-color-grid{grid-template-columns:1fr 1fr}.admin-two-columns,.credential-card{grid-template-columns:1fr}.credential-actions{grid-column:1}.report-item{grid-template-columns:minmax(0,1fr) auto}.report-meta{grid-column:1/-1;grid-row:2}.report-item a{grid-column:2;grid-row:1}
}
@media(max-width:460px){.login-card{padding:23px;border-radius:16px}.login-brand h1{font-size:23px}.settings-dialog{width:100vw;max-height:100vh;border-radius:0}.settings-dialog form{max-height:100vh}.color-grid,.size-grid,.checks,.panel-order-grid,.admin-grid,.admin-color-grid{grid-template-columns:1fr}.credential-actions{justify-content:stretch}.credential-actions button{flex:1}.admin-save-row{align-items:stretch;flex-direction:column}.report-panel{padding:9px}.report-toolbar{top:-9px}.report-item{padding:9px}.report-name{font-size:11px}}
