/* ── Analytics: one-screen LO dashboard (analytics-lo.js) ─────────── */
.lo-root{--lo-gap:14px;max-width:1440px;margin:0 auto;padding:16px 24px 18px;display:flex;flex-direction:column;gap:var(--lo-gap);font-family:'DM Sans',sans-serif;color:var(--g800,#3a3830)}
.lo-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;margin:0}

/* header + toggles */
.lo-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 18px}
.lo-title{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.lo-title h1{margin:0;font-family:'DM Serif Display',serif;font-weight:400;font-size:28px;color:var(--navy,#1B3240);line-height:1.1}
.lo-scope{font-size:13px;color:var(--g600,#5f5d55)}
.lo-ctl{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px}
.lo-seg-ctl{display:inline-flex;background:#fff;border:1px solid var(--g200,#dddbd4);border-radius:9px;padding:3px;gap:2px}
.lo-tg{border:0;background:transparent;border-radius:6px;padding:6px 11px;font:inherit;font-size:13px;font-weight:600;color:#55606a;cursor:pointer;white-space:nowrap}
.lo-tg:hover{background:var(--g50,#f7f7f5);color:var(--navy,#1B3240)}
.lo-tg.is-on{background:var(--navy,#1B3240);color:#fff}
.lo-tg:focus-visible,.lo-sel:focus-visible,.lo-link:focus-visible,.lo-row:focus-visible{outline:2px solid var(--gold,#DAAA3A);outline-offset:2px}
.lo-sel-l{font-size:12px;font-weight:700;color:var(--g600,#5f5d55)}
.lo-sel{height:36px;border:1px solid var(--g200,#dddbd4);border-radius:9px;background:#fff;padding:0 10px;font:inherit;font-size:13px;color:var(--navy,#1B3240);font-weight:600}
.lo-link{border:0;background:none;padding:6px 4px;font:inherit;font-size:13px;font-weight:700;color:var(--navy,#1B3240);text-decoration:underline;text-underline-offset:3px;cursor:pointer}

/* KPI tiles */
.lo-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.lo-kpi{background:#fff;border:1px solid var(--g200,#dddbd4);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:3px;min-width:0}
.lo-kpi.is-earned{background:var(--navy,#1B3240);border-color:var(--navy,#1B3240);color:#fff}
.lo-kpi-l{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--g600,#5f5d55)}
.lo-kpi.is-earned .lo-kpi-l{color:rgba(255,255,255,.78)}
.lo-kpi-v{font-family:'DM Serif Display',serif;font-size:26px;line-height:1.1;color:var(--navy,#1B3240);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lo-kpi.is-earned .lo-kpi-v{color:var(--gold,#DAAA3A)}
.lo-kpi-v small{font-family:'DM Sans',sans-serif;font-size:13px;color:var(--g600,#5f5d55)}
.lo-kpi-s{font-size:12px;color:var(--g600,#5f5d55)}
.lo-kpi.is-earned .lo-kpi-s{color:rgba(255,255,255,.8)}
.lo-stages{display:flex;height:6px;border-radius:4px;overflow:hidden;background:var(--g100,#eeece8);margin-top:4px}
.lo-stage-key{display:flex;gap:7px;flex-wrap:wrap;font-size:10.5px;color:var(--g600,#5f5d55);white-space:nowrap}
.lo-stage-key span{display:inline-flex;align-items:center;gap:4px}
.lo-seg-new{background:#8aa1ad}.lo-seg-active{background:#c98a14}.lo-seg-pending{background:#2d7a4f}
.lo-dot{display:inline-block;width:9px;height:9px;border-radius:2px;flex:none}

/* main panels */
.lo-main{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(300px,1fr);gap:var(--lo-gap);min-height:0}
.lo-panel{background:#fff;border:1px solid var(--g200,#dddbd4);border-radius:12px;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.lo-ph{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid var(--g100,#eeece8)}
.lo-pb{flex:1 1 auto;min-height:0;padding:12px 14px}
.lo-empty{padding:28px 8px;text-align:center;font-size:14px;color:var(--g600,#5f5d55)}

/* monthly columns */
.lo-chart .lo-pb{display:flex;flex-direction:column}
.lo-cols{flex:1 1 auto;min-height:150px;display:grid;grid-template-columns:repeat(15,minmax(0,1fr));gap:6px;align-items:stretch}
.lo-col{display:flex;flex-direction:column;min-width:0;border-radius:6px}
.lo-col.is-now{background:#faf6ea}
.lo-col-v{font-size:11px;font-weight:700;color:var(--navy,#1B3240);text-align:center;height:16px;white-space:nowrap;overflow:visible}
.lo-col-bar{flex:1 1 auto;display:flex;flex-direction:column;justify-content:flex-end;padding:0 3px}
.lo-col-bar span{display:block;width:100%;min-height:2px}
.lo-col-bar span:first-child{border-radius:4px 4px 0 0}
.lo-b-closed{background:var(--navy,#1B3240)}
.lo-b-proj{background:var(--gold,#DAAA3A)}
.lo-col.is-future .lo-b-proj{background:repeating-linear-gradient(135deg,#DAAA3A 0 6px,#e8c46e 6px 12px)}
.lo-col-m{font-size:11px;color:var(--g600,#5f5d55);text-align:center;padding-top:5px;line-height:1.25;min-height:30px}
.lo-col-m b{color:var(--navy,#1B3240)}
.lo-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:12px;color:var(--g600,#5f5d55);padding-top:8px;border-top:1px solid var(--g100,#eeece8);margin-top:6px}
.lo-legend span{display:inline-flex;align-items:center;gap:6px}
.lo-legend-tot{margin-left:auto;color:var(--navy,#1B3240)}

/* horizontal bars */
.lo-hbars{display:flex;flex-direction:column;gap:2px;height:100%}
.lo-hrow{display:grid;grid-template-columns:minmax(110px,1.1fr) minmax(0,2.4fr) 54px 74px;gap:12px;align-items:center;padding:7px 4px;border-bottom:1px solid var(--g100,#eeece8);font-size:13px}
.lo-hhead{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--g600,#5f5d55);padding-top:0}
.lo-hk{font-weight:600;color:var(--navy,#1B3240);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lo-hb{display:flex;align-items:center;gap:8px;min-width:0}
.lo-hfill{height:14px;border-radius:3px;background:var(--navy,#1B3240);flex:none;max-width:calc(100% - 64px)}
.lo-hfill.is-pipe{background:var(--gold,#DAAA3A)}
.lo-hb b{font-size:13px;color:var(--navy,#1B3240);white-space:nowrap}
.lo-num{text-align:right;font-variant-numeric:tabular-nums;color:var(--g800,#3a3830)}

/* file list */
.lo-rows{display:flex;flex-direction:column;gap:2px;overflow:auto;padding:6px 8px}
.lo-row{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;text-align:left;border:0;background:transparent;border-radius:8px;padding:8px 8px;font:inherit;cursor:pointer;border-bottom:1px solid var(--g100,#eeece8)}
.lo-row:hover{background:var(--g50,#f7f7f5)}
.lo-row-main{display:flex;flex-direction:column;min-width:0}
.lo-row-name{font-size:14px;font-weight:700;color:var(--navy,#1B3240);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lo-row-sub{font-size:12px;color:var(--g600,#5f5d55);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lo-row-right{font-size:12px;font-weight:600;color:var(--g800,#3a3830);text-align:right;flex:none;max-width:48%}
.lo-late{color:#a12b22;font-weight:700}

/* ── one-screen mode: laptop/desktop with enough height ── */
@media (min-width:900px) and (min-height:600px){
  html.lo-fit,html.lo-fit body{overflow:hidden;height:100%}
  html.lo-fit .wlp-footer,html.lo-fit .analytics-sort-bar{display:none!important}
  html.lo-fit .lo-root{height:calc(100vh - var(--lo-top,120px));padding-bottom:16px}
  html.lo-fit .lo-main{flex:1 1 auto}
}
@media (max-width:1180px){
  .lo-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
  .lo-kpi-v{font-size:22px}
}
@media (min-width:900px) and (max-width:1180px) and (min-height:600px){
  .lo-kpi{padding:9px 12px}
  .lo-kpis{gap:8px}
}
@media (max-width:899px){
  .lo-main{grid-template-columns:1fr}
  .lo-cols{min-height:220px}
  .lo-rows{max-height:none}
}
@media (max-width:640px){
  .lo-root{padding:12px 12px 18px}
  .lo-title h1{font-size:24px}
  .lo-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lo-ctl,.lo-seg-ctl{width:100%}
  .lo-seg-ctl{overflow-x:auto}
  .lo-tg{flex:1 0 auto;padding:7px 9px}
  .lo-cols{gap:2px;grid-template-columns:repeat(15,minmax(0,1fr))}
  .lo-col-v{font-size:0}
  .lo-col-m{font-size:9px}
  .lo-hrow{grid-template-columns:minmax(80px,1fr) minmax(0,1.6fr) 34px;gap:8px}
  .lo-hrow>span:nth-child(4){display:none}
  .lo-legend-tot{margin-left:0}
}
@media print{.lo-ctl{display:none}}
.lo-list .lo-ph .lo-seg-ctl,.lo-panel:not(.lo-chart) .lo-seg-ctl{max-width:100%}
.lo-panel:not(.lo-chart) .lo-tg{padding:6px 9px;font-size:12.5px}

/* ── phones & small tablets: same one-screen rule, compact layout ──
   Page is locked between the top bar and the bottom menu; the three areas
   (tiles · chart · files) share the height. Only the file list scrolls inside its card. */
@media (max-width:899px) and (min-height:540px){
  html.lo-fit,html.lo-fit body{overflow:hidden;height:100%;overscroll-behavior:none}
  html.lo-fit .wlp-footer,html.lo-fit .analytics-sort-bar{display:none!important}
  html.lo-fit .lo-root{--lo-gap:8px;padding:8px 10px 8px;height:calc(100vh - var(--lo-top,70px) - var(--lo-bot,0px));height:calc(100dvh - var(--lo-top,70px) - var(--lo-bot,0px));overflow:hidden}
  html.lo-fit .lo-head{gap:6px 10px}
  html.lo-fit .lo-title h1{font-size:19px}
  html.lo-fit .lo-scope{display:none}
  html.lo-fit .lo-ctl{width:100%;gap:6px 8px;flex-wrap:nowrap}
  html.lo-fit .lo-ctl .lo-seg-ctl{flex:1 1 100%}
  html.lo-fit .lo-head{flex-direction:column;align-items:stretch}
  html.lo-fit .lo-title{display:none}
  html.lo-fit .lo-head .lo-ctl{flex-wrap:wrap}
  html.lo-fit .lo-seg-ctl{width:100%;overflow:visible;padding:2px}
  html.lo-fit .lo-tg{flex:1 1 0;min-width:0;padding:6px 1px;font-size:11.5px;text-align:center;white-space:nowrap}
  html.lo-fit .lo-sel-l{display:none}
  html.lo-fit .lo-sel{flex:1 1 auto;height:32px;font-size:13px;min-width:0}
  html.lo-fit .lo-link{padding:4px 2px;font-size:12.5px;white-space:nowrap}
  html.lo-fit .lo-kpis{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  html.lo-fit .lo-kpi{padding:6px 8px;gap:1px;border-radius:9px}
  html.lo-fit .lo-kpi-l{font-size:9px;letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.lo-fit .lo-kpi-v{font-size:18px}
  html.lo-fit .lo-kpi-v small{font-size:11px}
  html.lo-fit .lo-kpi-s,html.lo-fit .lo-stage-key{display:none}
  html.lo-fit .lo-stages{height:4px;margin-top:2px}
  html.lo-fit .lo-main{flex:1 1 auto;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1.1fr) minmax(0,1fr);gap:8px;min-height:0}
  html.lo-fit .lo-ph{padding:5px 6px;gap:5px}
  html.lo-fit .lo-pb{padding:6px 8px;overflow:auto}
  html.lo-fit .lo-cols{min-height:0;gap:2px}
  html.lo-fit .lo-col-v{font-size:0;height:4px}
  html.lo-fit .lo-col-m{font-size:9px;min-height:22px;padding-top:3px}
  html.lo-fit .lo-legend{font-size:10.5px;gap:3px 10px;padding-top:4px;margin-top:3px}
  html.lo-fit .lo-hrow{padding:3px 2px;font-size:11.5px;gap:8px;grid-template-columns:minmax(70px,1fr) minmax(0,1.5fr) 30px}
  html.lo-fit .lo-hhead{font-size:9.5px}
  html.lo-fit .lo-hfill{height:10px}
  html.lo-fit .lo-hb b{font-size:11.5px}
  html.lo-fit .lo-rows{flex:1 1 auto;min-height:0;max-height:none;padding:2px 4px}
  html.lo-fit .lo-row{padding:5px 6px}
  html.lo-fit .lo-row-name{font-size:13px}
  html.lo-fit .lo-row-sub{font-size:11px}
  html.lo-fit .lo-row-right{font-size:11px}
  html.lo-fit .lo-empty{padding:14px 6px;font-size:12.5px}
}
@media (max-width:640px) and (min-height:540px){
  html.lo-fit .lo-root{--lo-bot:calc(76px + env(safe-area-inset-bottom,0px))}
  html.lo-fit body{padding-bottom:0!important}
}
@media (max-width:899px) and (min-height:540px){
  html.lo-fit .lo-ph .lo-seg-ctl+.lo-seg-ctl .lo-tg{padding:3px 1px;font-size:11px}
  html.lo-fit .lo-ph .lo-seg-ctl+.lo-seg-ctl{padding:1px}
}

/* ── phones: three separate full-screen views (Summary · Charts · Files) ── */
.lo-views{display:none}
@media (max-width:899px) and (min-height:540px){
  html.lo-fit .lo-views{display:block}
  html.lo-fit .lo-views .lo-seg-ctl{background:var(--g50,#f7f7f5)}
  html.lo-fit .lo-views .lo-tg{padding:8px 2px;font-size:13px}
  html.lo-fit .lo-root[data-view="tiles"] .lo-main{display:none}
  html.lo-fit .lo-root[data-view="chart"] .lo-kpis,
  html.lo-fit .lo-root[data-view="chart"] .lo-list,
  html.lo-fit .lo-root[data-view="files"] .lo-kpis,
  html.lo-fit .lo-root[data-view="files"] .lo-chart{display:none}
  html.lo-fit .lo-root:not([data-view="tiles"]) .lo-main{grid-template-rows:minmax(0,1fr)}
  /* Summary: six big tiles fill the screen */
  html.lo-fit .lo-root[data-view="tiles"] .lo-kpis{flex:1 1 auto;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:8px}
  html.lo-fit .lo-root[data-view="tiles"] .lo-kpi{padding:10px 12px;justify-content:center;gap:3px;overflow:hidden}
  html.lo-fit .lo-root[data-view="tiles"] .lo-kpi-l{font-size:10.5px}
  html.lo-fit .lo-root[data-view="tiles"] .lo-kpi-v{font-size:26px}
  html.lo-fit .lo-root[data-view="tiles"] .lo-kpi-s{display:block;font-size:11.5px;line-height:1.25}
  html.lo-fit .lo-root[data-view="tiles"] .lo-stage-key{display:flex;font-size:10px}
  /* Charts / Files get the room */
  html.lo-fit .lo-root:not([data-view="tiles"]) .lo-tg{padding:8px 1px;font-size:12px}
  html.lo-fit .lo-root[data-view="chart"] .lo-col-m{font-size:10px}
  html.lo-fit .lo-root[data-view="chart"] .lo-hrow{padding:7px 2px;font-size:12.5px}
  html.lo-fit .lo-root[data-view="files"] .lo-row{padding:9px 8px}
  html.lo-fit .lo-root[data-view="files"] .lo-row-name{font-size:14px}
  html.lo-fit .lo-root[data-view="files"] .lo-row-sub,html.lo-fit .lo-root[data-view="files"] .lo-row-right{font-size:12px}
}
@media (max-width:899px) and (min-height:540px){
  html.lo-fit .lo-root[data-view="tiles"] .lo-kpi{padding:8px 11px;gap:2px}
  html.lo-fit .lo-root[data-view="tiles"] .lo-kpi-v{font-size:24px;line-height:1.2;flex:none;overflow:visible}
  html.lo-fit .lo-root[data-view="tiles"] .lo-stage-key{flex-wrap:nowrap;gap:5px;font-size:9.5px}
  html.lo-fit .lo-root[data-view="tiles"] .lo-stage-key .lo-dot{width:7px;height:7px}
}

/* file list: colour-coded by loan type, LO comp on every row */
.lo-row{--tc:#5f5d55;--tb:#f0efe9;border-left:4px solid var(--tc);border-radius:4px 8px 8px 4px;padding-left:10px}
.lo-row[data-t="conv"]{--tc:#1a56b0;--tb:#eef4fd}
.lo-row[data-t="fha"]{--tc:#6b3fa0;--tb:#f3eefb}
.lo-row[data-t="va"]{--tc:#0e7490;--tb:#e0f7fa}
.lo-row[data-t="usda"]{--tc:#3a6b2f;--tb:#f0f7ee}
.lo-row[data-t="jumbo"]{--tc:#b8700a;--tb:#fdf3e0}
.lo-row[data-t="dscr"]{--tc:#c0392b;--tb:#fdf0ee}
.lo-row[data-t="heloc"]{--tc:#8b2fa8;--tb:#f9f0fb}
.lo-row[data-t="reverse"]{--tc:#3b4a9e;--tb:#eef0fd}
.lo-row[data-t="bridge"]{--tc:#0f766e;--tb:#e6f4f1}
.lo-chip{display:inline-block;background:var(--tb);color:var(--tc);font-size:10.5px;font-weight:700;line-height:1;padding:3px 7px;border-radius:99px;margin-right:6px;white-space:nowrap;vertical-align:1px}
.lo-row-sub{white-space:nowrap}
.lo-row-right{display:flex;flex-direction:column;align-items:flex-end;gap:1px;max-width:52%}
.lo-row-comp{font-family:'DM Serif Display',serif;font-weight:400;font-size:17px;line-height:1.1;color:#236b45}
.lo-row-note{font-size:11px;font-weight:600;color:var(--g600,#5f5d55);text-align:right}
@media (max-width:899px) and (min-height:540px){
  html.lo-fit .lo-row{padding:6px 6px 6px 8px}
  html.lo-fit .lo-row-comp{font-size:15px}
  html.lo-fit .lo-chip{font-size:9.5px;padding:2px 6px;margin-right:4px}
  html.lo-fit .lo-row-note{font-size:10.5px}
}
