/* LEAN Web shell — V11.23.05
   Desktop-only layout: full-width workspace + floating right dock.
   App/mobile remains isolated in app/app.css. */
@media (min-width: 769px){
  html{--lean-platform:web}
  body.lean-web{overscroll-behavior-y:auto}

  body.lean-web .app{
    width:100%;
    max-width:none;
    margin:0;
    padding:10px 76px 10px 10px;
    gap:10px;
  }

  body.lean-web .topbar,
  body.lean-web .stats,
  body.lean-web .v3-main{
    width:100%;
    max-width:none;
  }

  body.lean-web .v3-main{padding-bottom:0}

  /* Desktop view switching stays instant. */
  body.lean-web .v3-view,
  body.lean-web .v3-view.active{
    animation:none!important;
    transition:none!important;
  }

  /*
    Floating dock: same visual language as the top-right action buttons.
    Only the icon tile is visible. Labels appear as stable flyout tooltips,
    so the workspace stays clean and the dock never changes width.
  */
  body.lean-web .bottom-nav{
    position:fixed;
    top:50%;
    right:12px;
    bottom:auto;
    left:auto;
    transform:translateY(-50%);
    width:54px;
    height:auto;
    min-height:0;
    z-index:60;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:7px;
    padding:7px 5px;
    border:1px solid rgba(255,255,255,.10);
    border-radius:16px;
    background:rgba(12,17,25,.96);
    box-shadow:0 14px 38px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.03);
    backdrop-filter:blur(16px);
    overflow:visible;
  }

  body.lean-web .nav-item{
    position:relative;
    width:42px;
    height:42px;
    min-height:42px;
    padding:0;
    border:1px solid rgba(255,255,255,.06);
    border-radius:11px;
    display:grid;
    place-items:center;
    color:#8390a3;
    background:#121923;
    font-size:0;
    line-height:1;
    white-space:nowrap;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
    transition:background-color .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease;
  }

  body.lean-web .nav-item b{
    display:grid;
    place-items:center;
    width:24px;
    height:24px;
    margin:0;
    font-size:17px;
    line-height:1;
    font-weight:800;
    color:inherit;
  }

  /* Label flyout — does not reflow or resize the menu. */
  body.lean-web .nav-item span{
    position:absolute;
    top:50%;
    right:50px;
    transform:translateY(-50%) translateX(4px);
    z-index:2;
    width:max-content;
    max-width:160px;
    padding:7px 10px;
    border:1px solid rgba(255,255,255,.10);
    border-radius:9px;
    color:#e9eef6;
    background:rgba(13,18,26,.98);
    box-shadow:0 10px 28px rgba(0,0,0,.34);
    font-size:10px;
    font-weight:800;
    line-height:1;
    letter-spacing:.01em;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .12s ease,transform .12s ease,visibility .12s ease;
  }

  body.lean-web .nav-item span::after{
    content:"";
    position:absolute;
    top:50%;
    right:-5px;
    width:9px;
    height:9px;
    transform:translateY(-50%) rotate(45deg);
    border-top:1px solid rgba(255,255,255,.10);
    border-right:1px solid rgba(255,255,255,.10);
    background:rgba(13,18,26,.98);
  }

  body.lean-web .nav-item:hover,
  body.lean-web .nav-item:focus-visible{
    color:#f4f7fb;
    border-color:rgba(255,255,255,.13);
    background:#18212d;
    outline:none;
  }

  body.lean-web .nav-item:hover span,
  body.lean-web .nav-item:focus-visible span{
    opacity:1;
    visibility:visible;
    transform:translateY(-50%) translateX(0);
  }

  body.lean-web .nav-item.active{
    color:#171106;
    border-color:#efbb20;
    background:linear-gradient(145deg,#ffd43e,#efb511);
    box-shadow:0 6px 18px rgba(239,181,17,.24), inset 0 1px 0 rgba(255,255,255,.36);
  }

  /* A subtle marker keeps the active section obvious without a large yellow block. */
  body.lean-web .nav-item.active::after{
    content:"";
    position:absolute;
    left:-8px;
    top:50%;
    width:3px;
    height:16px;
    border-radius:99px;
    background:#f6c424;
    transform:translateY(-50%);
    box-shadow:0 0 10px rgba(246,196,36,.35);
  }

  body.lean-web .fab{
    right:82px;
    bottom:16px;
  }

  body.lean-web .v3-calendar-wrap,
  body.lean-web .calendar-shell,
  body.lean-web .calendar-grid{
    width:100%;
    max-width:none;
  }

  /* V11.23.05 — Week-first calendar: one clean 7-day row. Month view stays unchanged. */
  body.lean-web .calendar-shell.calendar-mode-week .head-right .jump{display:none}
  body.lean-web .v3-calendar-wrap.calendar-mode-week{height:clamp(360px,44vh,470px)!important;min-height:360px!important}
  body.lean-web .v3-calendar-wrap.calendar-mode-week .calendar-shell.calendar-mode-week{min-height:360px!important}
  body.lean-web .v3-calendar-wrap.calendar-mode-week .calendar-grid{grid-template-rows:minmax(0,1fr)!important}
  body.lean-web .v3-calendar-wrap.calendar-mode-week .day{padding:12px!important}
  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-weekday{display:inline!important;color:#aab6c7;font-size:10px!important;font-weight:800!important}
  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-number{font-size:13px!important}
  body.lean-web .v3-calendar-wrap.calendar-mode-week .pnl{font-size:clamp(18px,1.25vw,24px)!important;margin-top:12px!important}
  body.lean-web .v3-calendar-wrap.calendar-mode-week .trade-mini{font-size:9.5px!important;margin-top:10px!important}
  body.lean-web .v3-calendar-wrap.calendar-mode-week .note-preview{-webkit-line-clamp:3!important;font-size:9px!important}
}

@media (min-width:769px) and (max-width:1100px){
  body.lean-web .app{padding-right:68px}
  body.lean-web .bottom-nav{right:8px;width:50px;padding:6px 4px}
  body.lean-web .nav-item{width:38px;height:38px;min-height:38px;border-radius:10px}
  body.lean-web .nav-item b{font-size:16px}
  body.lean-web .nav-item span{right:46px}
  body.lean-web .fab{right:72px}
}

/* ===== V11.23.05 — WEEK REVIEW REBUILD (desktop only) =====
   This block REPLACES the previous V11.23.05 week-card/summary layer.
   Month layout is intentionally untouched. */
@media (min-width: 769px) {
  body.lean-web .v3-calendar-wrap.calendar-mode-week {
    height:auto !important;
    min-height:0 !important;
    overflow:visible !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .calendar-shell.calendar-mode-week {
    display:grid !important;
    grid-template-rows:auto auto !important;
    height:auto !important;
    min-height:0 !important;
    overflow:visible !important;
    border-radius:14px !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .calendar-head {
    min-height:56px !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .weekdays {
    display:none !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .calendar-grid {
    display:grid !important;
    grid-template-columns:repeat(7,minmax(0,1fr)) !important;
    grid-template-rows:380px !important;
    grid-auto-rows:380px !important;
    align-items:stretch !important;
    align-content:start !important;
    gap:7px !important;
    height:auto !important;
    min-height:380px !important;
    padding:7px !important;
    overflow:visible !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .day {
    position:relative !important;
    display:flex !important;
    flex-direction:column !important;
    width:auto !important;
    height:380px !important;
    min-height:380px !important;
    max-height:380px !important;
    min-width:0 !important;
    padding:12px 11px 10px !important;
    overflow:hidden !important;
    border-radius:12px !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-top {
    display:flex !important;
    min-height:34px !important;
    align-items:flex-start !important;
    gap:5px !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-weekday {
    display:block !important;
    max-width:62px;
    color:#d9e0ea !important;
    font-size:10px !important;
    line-height:1.1 !important;
    font-weight:850 !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-number {
    margin-top:0 !important;
    font-size:13px !important;
    line-height:1 !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-top-meta {
    margin-left:auto !important;
    gap:3px !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .pnl {
    display:block !important;
    margin-top:7px !important;
    font-size:clamp(19px,1.18vw,24px) !important;
    line-height:1.05 !important;
    letter-spacing:-.5px !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .trade-mini {
    display:flex !important;
    flex-wrap:wrap !important;
    gap:5px !important;
    margin-top:8px !important;
    font-size:9px !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-symbol { display:none !important; }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .order-count,
  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-win-count,
  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-loss-count,
  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-winrate-chip {
    display:inline-flex !important;
    align-items:center;
    min-height:19px;
    padding:2px 6px !important;
    border:1px solid rgba(255,255,255,.08);
    border-radius:7px;
    background:rgba(255,255,255,.035);
    font-size:8px !important;
    font-weight:850;
    white-space:nowrap;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-winrate-chip { color:#dfe7f2; }
  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-winbar { margin-top:8px !important; }
  body.lean-web .v3-calendar-wrap.calendar-mode-week .note-preview { display:none !important; }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .week-day-details {
    display:flex !important;
    flex:1 1 auto !important;
    min-height:0 !important;
    margin-top:10px !important;
    padding-top:8px !important;
    border-top:1px solid rgba(255,255,255,.075);
    flex-direction:column !important;
    overflow:hidden !important;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .week-detail-row {
    flex:0 0 auto;
    min-height:40px !important;
    padding:6px 0 !important;
    border-bottom:1px solid rgba(255,255,255,.055);
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .week-detail-row > span {
    display:block;
    margin-bottom:3px;
    color:#718096;
    font-size:7.5px;
    line-height:1;
    font-weight:900;
    letter-spacing:.6px;
    text-transform:uppercase;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .week-detail-row > strong {
    display:block;
    min-width:0;
    overflow:hidden;
    color:#e9eef5;
    font-size:9.5px;
    line-height:1.25;
    font-weight:800;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .week-detail-row strong em {
    float:right;
    margin-left:5px;
    font-style:normal;
    font-size:9px;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .week-detail-note > strong {
    display:-webkit-box;
    white-space:normal;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .week-day-open {
    display:block !important;
    flex:0 0 27px !important;
    width:100%;
    min-height:27px;
    margin-top:auto !important;
    border:1px solid rgba(64,222,159,.38);
    border-radius:7px;
    background:rgba(26,176,119,.06);
    color:#dce8e2;
    font-size:8.5px;
    font-weight:850;
    cursor:pointer;
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .day.loss .week-day-open {
    border-color:rgba(255,83,107,.48);
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .week-day-open:hover {
    background:rgba(255,255,255,.055);
  }

  body.lean-web .v3-calendar-wrap.calendar-mode-week .day-card-footer { margin-top:4px; }

  /* Weekly summary is a sibling AFTER calendar-shell. */
  body.lean-web #weekSummaryPanel.week-summary-panel {
    display:block !important;
    width:100% !important;
    margin:10px 0 0 !important;
    padding:13px 14px 12px !important;
    border:1px solid rgba(240,185,11,.38);
    border-radius:13px;
    background:linear-gradient(180deg,rgba(13,19,27,.98),rgba(8,12,18,.98));
    box-shadow:inset 0 1px 0 rgba(255,255,255,.025),0 12px 30px rgba(0,0,0,.16);
    order:initial !important;
  }

  body.lean-web .week-summary-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
  }
  body.lean-web .week-summary-head span { color:#8a96a8;font-size:8px;font-weight:900;letter-spacing:.8px; }
  body.lean-web .week-summary-head h3 { margin:2px 0 0;font-size:14px;color:#f2f5f8; }
  body.lean-web .week-summary-more {
    min-height:29px;padding:0 11px;border:1px solid rgba(145,159,179,.23);border-radius:8px;
    background:#111823;color:#cbd5e2;font-size:8px;font-weight:850;cursor:pointer;
  }

  body.lean-web .week-summary-grid {
    display:grid;
    grid-template-columns:1.08fr .8fr .9fr 1fr 1fr .95fr 1.12fr;
    gap:7px;
  }

  body.lean-web .week-summary-grid article {
    position:relative;min-width:0;min-height:88px;padding:10px 10px 9px;overflow:hidden;
    border:1px solid rgba(126,143,164,.17);border-radius:9px;
    background:linear-gradient(145deg,rgba(18,25,35,.92),rgba(10,15,22,.92));
  }
  body.lean-web .week-summary-grid article > span {
    display:block;color:#758298;font-size:7.5px;font-weight:900;letter-spacing:.5px;text-transform:uppercase;
  }
  body.lean-web .week-summary-grid article > strong {
    display:block;margin-top:9px;overflow:hidden;color:#f2f5f8;font-size:15px;line-height:1.05;font-weight:900;
    text-overflow:ellipsis;white-space:nowrap;
  }
  body.lean-web .week-summary-grid article > small {
    display:block;margin-top:7px;color:#7f8ca0;font-size:8px;line-height:1.3;
  }
  body.lean-web .week-summary-winrate > i {
    position:absolute;right:10px;bottom:10px;width:26px;height:26px;border-radius:50%;
    background:conic-gradient(#2bd391 var(--week-wr),rgba(255,83,107,.58) 0);
    box-shadow:inset 0 0 0 7px #111720;
  }
  body.lean-web .discipline-stars { display:flex;gap:2px;margin-top:7px; }
  body.lean-web .discipline-stars span { color:#475362;font-size:13px; }
  body.lean-web .discipline-stars span.is-on { color:#f4bd16;text-shadow:0 0 8px rgba(244,189,22,.28); }
  body.lean-web .week-summary-discipline > strong { margin-top:4px !important;font-size:11px !important; }
  body.lean-web .week-summary-note {
    display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;margin-top:8px;padding:9px 10px;
    border:1px solid rgba(131,148,170,.14);border-radius:9px;background:rgba(255,255,255,.018);
  }
  body.lean-web .week-summary-note > span { color:#eebc2c;font-size:9px;font-weight:900; }
  body.lean-web .week-summary-note p {
    margin:0;overflow:hidden;color:#aab4c2;font-size:9px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap;
  }
}
