/* static/dash/stocks_macro.css
   Stocks Macro — CLEAN / SINGLE SOURCE OF TRUTH
   Aesthetic: black / steel seams, sharp corners, compact tiles
*/

:root{
  --sm-seam: rgba(255,255,255,0.10);
  --sm-a: rgba(255,255,255,0.03);
  --sm-b: rgba(255,255,255,0.06);
  --sm-c: rgba(255,255,255,0.09);
  --sm-text: rgba(255,255,255,0.92);
  --sm-dim: rgba(255,255,255,0.72);
}

/* root wrapper */
.shell-main .sm-root{
  width:100%;
  min-width:0;
  box-sizing:border-box;
  margin: 14px 0 18px 0;
  padding: 12px;
  background:#000;
  color: var(--sm-text);
  border: 1px solid var(--sm-seam);
}

/* header */
.shell-main .sm-root-headwrap{ margin-bottom: 10px; }
.shell-main .sm-root-head{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.shell-main .sm-root-title{
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .95;
}

.shell-main .sm-root-line{
  display:flex;
  align-items:baseline;
  gap: 8px;
  flex-wrap:wrap;
}

.shell-main .sm-pill{
  display:inline-flex;
  align-items:center;
  padding: 3px 8px;
  border: 1px solid var(--sm-seam);
  background: var(--sm-a);
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.shell-main .sm-pill--ticker{
  background: rgba(255,255,255,0.05);
  font-weight: 800;
}

.shell-main .sm-root-company{
  font-size: 13px;
  font-weight: 700;
  opacity: .92;
  margin-left: 4px;
}

.shell-main .sm-root-sub{
  font-size: 11px;
  opacity: .70;
}

/* days container */
.shell-main .sm-days{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

/* single day card */
.shell-main .sm-day{
  border: 1px solid var(--sm-seam);
  background: var(--sm-a);
  padding: 10px;
  box-sizing:border-box;
}

/* day top row */
.shell-main .sm-day-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.shell-main .sm-day-date{
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .85;
  padding: 3px 8px;
  border: 1px solid var(--sm-seam);
  background: rgba(0,0,0,0.35);
}

.shell-main .sm-day-top-right{
  display:flex;
  gap: 8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* mini KPI blocks */
.shell-main .sm-mini{
  border: 1px solid var(--sm-seam);
  background: rgba(0,0,0,0.35);
  padding: 8px 10px;
  min-width: 150px;
  box-sizing:border-box;
}

.shell-main .sm-mini-k{
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .72;
  margin-bottom: 6px;
}

/* signal badge */
.shell-main .sm-signal{
  display:inline-flex;
  padding: 2px 8px;
  border: 1px solid var(--sm-seam);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.shell-main .sm-signal--long{ color: #7CFFB2; }
.shell-main .sm-signal--short{ color: #FF7C7C; }
.shell-main .sm-signal--neutral{ color: rgba(255,255,255,0.85); }

/* confidence bar */
.shell-main .sm-conf{
  position:relative;
  height: 16px;
  border: 1px solid var(--sm-seam);
  background: rgba(255,255,255,0.04);
  overflow:hidden;
}
.shell-main .sm-conf-fill{
  height:100%;
  background: rgba(255,255,255,0.22);
}
.shell-main .sm-conf-label{
  position:absolute;
  right:6px;
  top:50%;
  transform: translateY(-50%);
  font-size: 10px;
  letter-spacing: .10em;
  opacity: .85;
}

/* thesis / hint blocks */
.shell-main .sm-blocks{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 1050px){
  .shell-main .sm-blocks{ grid-template-columns: 1fr; }
}

.shell-main .sm-block{
  border: 1px solid var(--sm-seam);
  background: rgba(0,0,0,0.35);
  padding: 10px;
  box-sizing:border-box;
}
.shell-main .sm-block-title{
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 8px;
}
.shell-main .sm-block-body{
  font-size: 12.5px;
  line-height: 1.35;
  opacity: .92;
}

/* evidence table */
.shell-main .sm-evidence{
  border-top: 1px solid var(--sm-seam);
  padding-top: 10px;
}

.shell-main .sm-section-title{
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: 8px;
}

/* table header row */
.shell-main .sm-evhead{
  display:grid;
  grid-template-columns: 110px 1.5fr 120px 110px 1.4fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--sm-seam);
  background: var(--sm-b);
  box-sizing:border-box;
  margin-bottom: 8px;
}

.shell-main .sm-evh{
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .75;
}

/* rows */
.shell-main .sm-evtable{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.shell-main .sm-evrow{
  display:grid;
  grid-template-columns: 110px 1.5fr 120px 110px 1.4fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--sm-seam);
  background: rgba(255,255,255,0.03);
  box-sizing:border-box;
}

.shell-main .sm-evrow--selected{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
}

/* columns */
.shell-main .sm-ev-col{ min-width:0; }

.shell-main .sm-ev-id{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  opacity: .92;
}
.shell-main .sm-ev-type{
  font-size: 11px;
  opacity: .70;
  margin-top: 4px;
}

.shell-main .sm-ev-metric{
  font-size: 13px;
  font-weight: 800;
  opacity: .92;
}
.shell-main .sm-ev-formula{
  font-size: 11px;
  opacity: .70;
  margin-top: 4px;
}
.shell-main .sm-ev-inputs{
  font-size: 11px;
  opacity: .65;
  margin-top: 4px;
  word-break: break-word;
}

.shell-main .sm-ev-col--value{
  font-size: 13px;
  font-weight: 800;
  opacity: .92;
}

/* fundread badge */
.shell-main .sm-fundread{
  display:inline-flex;
  padding: 2px 8px;
  border: 1px solid var(--sm-seam);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.shell-main .sm-fundread--long{ color:#7CFFB2; }
.shell-main .sm-fundread--short{ color:#FF7C7C; }
.shell-main .sm-fundread--neutral{ color: rgba(255,255,255,0.85); }

.shell-main .sm-ev-col--note{
  font-size: 12px;
  line-height: 1.35;
  opacity: .88;
}

/* empty / error */
.shell-main .sm-empty{
  opacity: .75;
  padding: 10px;
  border: 1px dashed var(--sm-seam);
  background: rgba(0,0,0,0.35);
}

.shell-main .sm-root--error{
  border-color: rgba(255,120,120,0.35);
}
.shell-main .sm-error-title{
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.shell-main .sm-error-msg{
  color: #ff9c9c;
  opacity: .95;
}

/* --- DATE TABS (no callbacks) --- */

.shell-main .sm-tabs-wrap{
  border: 1px solid var(--sm-seam);
  background: rgba(255,255,255,0.02);
  margin-top: 10px;
}

/* make tab bar sticky within shell scroll */
.shell-main .sm-tabs-wrap .tab-container{
  position: sticky;
  top: 0;
  z-index: 3;
  background: #000;
  border-bottom: 1px solid var(--sm-seam);
}

/* remove rounding + make compact */
.shell-main .sm-tabs{
  padding: 0;
}

.shell-main .sm-tab{
  border: none !important;
  background: transparent !important;
  color: rgba(255,255,255,0.70) !important;
  font-size: 11px !important;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 10px 12px !important;
}

.shell-main .sm-tab--selected{
  color: rgba(255,255,255,0.95) !important;
  background: rgba(255,255,255,0.06) !important;
  border-left: 1px solid var(--sm-seam) !important;
  border-right: 1px solid var(--sm-seam) !important;
}




/* =============================================================================
   MOBILE — Stocks Macro (card layout, readable)
   Only affects small screens. Does NOT touch desktop.
============================================================================= */
@media (max-width: 920px){

  /* root padding tighter */
  .shell-main .sm-root{
    margin: 10px 0 14px 0;
    padding: 10px;
  }

  /* header line: stack pills + company */
  .shell-main .sm-root-line{
    gap: 6px;
  }
  .shell-main .sm-pill{
    font-size: 10px;
    padding: 3px 7px;
  }
  .shell-main .sm-root-company{
    font-size: 12px;
    margin-left: 0;
    width: 100%;
    opacity: .92;
  }

  /* day top: stack */
  .shell-main .sm-day-top{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* KPI mini blocks: full width */
  .shell-main .sm-day-top-right{
    justify-content: flex-start;
  }
  .shell-main .sm-mini{
    min-width: 0;
    width: 100%;
    padding: 9px 10px;
  }

  /* thesis/hint blocks: always 1 column on phone */
  .shell-main .sm-blocks{
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* =========================
     Tabs: horizontal scroll bar
     ========================= */
  .shell-main .sm-tabs-wrap{
    overflow: hidden; /* keep clean frame */
  }

  /* The Tabs container in dcc.Tabs is usually a flex row */
  .shell-main .sm-tabs-wrap .tab-container{
    position: sticky;
    top: 0;
    z-index: 3;
    background: #000;
    border-bottom: 1px solid var(--sm-seam);

    /* ✅ allow horizontal scroll */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .shell-main .sm-tabs-wrap .tab-container::-webkit-scrollbar{ height: 8px; }
  .shell-main .sm-tabs-wrap .tab-container::-webkit-scrollbar-track{ background: transparent; }
  .shell-main .sm-tabs-wrap .tab-container::-webkit-scrollbar-thumb{
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.10);
  }

  /* tabs row should not wrap */
  .shell-main .sm-tabs{
    display: flex !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: 100% !important;
  }

  .shell-main .sm-tab{
    white-space: nowrap !important;
    padding: 10px 10px !important;
    font-size: 10px !important;
  }

  /* =========================
     Evidence: convert to cards
     ========================= */

  /* hide the fixed 5-col header grid on mobile */
  .shell-main .sm-evhead{
    display: none !important;
  }

  /* remove table-ish gaps */
  .shell-main .sm-evtable{
    gap: 10px;
  }

  /* each row becomes a stacked card */
  .shell-main .sm-evrow{
    display: block !important;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--sm-seam);
  }

  .shell-main .sm-evrow--selected{
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.18);
  }

  /* turn columns into vertical sections */
  .shell-main .sm-ev-col{
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
  }

  /* ID + TYPE row */
  .shell-main .sm-ev-col--id{
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .shell-main .sm-ev-id{
    font-size: 12px;
    font-weight: 900;
  }
  .shell-main .sm-ev-type{
    font-size: 11px;
    opacity: .72;
    margin-top: 4px;
  }

  /* metric block */
  .shell-main .sm-ev-col--metric{
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
    border-bottom: 1px dashed rgba(255,255,255,0.08);
  }
  .shell-main .sm-ev-metric{
    font-size: 13px;
    font-weight: 900;
  }
  .shell-main .sm-ev-formula,
  .shell-main .sm-ev-inputs{
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* value + fundread in one line (terminal KPI strip) */
  .shell-main .sm-ev-col--value,
  .shell-main .sm-ev-col--fundread{
    display: inline-flex !important;
    align-items: center;
    vertical-align: middle;
    margin-right: 8px !important;
    margin-bottom: 8px !important;
  }
  .shell-main .sm-ev-col--value{
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .02em;
  }

  /* note at bottom */
  .shell-main .sm-ev-col--note{
    display: block !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255,255,255,0.08);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Make sure long content never forces horizontal scroll */
  .shell-main .sm-root,
  .shell-main .sm-day,
  .shell-main .sm-block,
  .shell-main .sm-evrow{
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
