/* static/dash/fin_events.css
   FIN EVENTS — AA terminal board (90°, sharp, readable)
   Contract:
   - no anchors / no hash routing dependencies
   - one tab = one day
   - 3×3 pages (horizontal paging) inside the active day
   Namespaced: fe-*
*/

:root{
  --fe-bg:#000;
  --fe-panel: rgba(255,255,255,0.03);
  --fe-panel2: rgba(255,255,255,0.06);

  --fe-line: rgba(255,255,255,0.12);
  --fe-line2: rgba(255,255,255,0.18);

  --fe-text: rgba(255,255,255,0.92);
  --fe-dim:  rgba(255,255,255,0.72);
  --fe-dim2: rgba(255,255,255,0.58);

  --fe-silver-a: rgba(220,230,240,0.22);
  --fe-silver-b: rgba(220,230,240,0.12);
}

/* hard edges everywhere */
.shell-main .fe-root,
.shell-main .fe-root *{
  border-radius: 0 !important;
  box-sizing: border-box;
}

.shell-main .fe-root{
  width: 100%;
  min-width: 0;
  margin: 12px 0 16px 0;
  padding: 12px;

  background: var(--fe-bg);
  color: var(--fe-text);
  border: 1px solid var(--fe-line);
}

/* ------------------------------------------------------------------
   TOPBAR (title)
------------------------------------------------------------------ */

.shell-main .fe-topbar{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 10px;
  margin-bottom: 10px;

  border: 1px solid var(--fe-line);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.35));
}

.shell-main .fe-top-title{
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  line-height: 1.2;
}

.shell-main .fe-top-sub{
  font-size: 11px;
  color: var(--fe-dim2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ------------------------------------------------------------------
   TABS (one tab = one day)
------------------------------------------------------------------ */

.shell-main .fe-tabs-wrap{
  border: 1px solid var(--fe-line);
  background: rgba(255,255,255,0.04);
}

.shell-main .fe-tabs{
  padding: 0;
}

/* Dash Tabs default markup varies; keep it robust */
.shell-main .fe-tabs .tab,
.shell-main .fe-tab{
  background: rgba(0,0,0,0.75) !important;
  color: rgba(255,255,255,0.80) !important;

  border-right: 1px solid var(--fe-line) !important;
  border-left: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;

  padding: 10px 12px !important;

  font-size: 11px !important;
  line-height: 1.1 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;

  margin: 0 !important;
}

.shell-main .fe-tabs .tab:hover,
.shell-main .fe-tab:hover{
  background: rgba(255,255,255,0.06) !important;
  color: rgba(255,255,255,0.96) !important;
}

/* selected = cool silver (no beige) */
.shell-main .fe-tabs .tab--selected,
.shell-main .fe-tab--selected{
  color: #000 !important;
  background: linear-gradient(180deg, rgba(235,245,255,0.92), rgba(190,205,220,0.86)) !important;

  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.10);
}

/* remove underline from default */
.shell-main .fe-tabs .tab--selected:after{
  background: transparent !important;
}

/* active tab pane wrapper */
.shell-main .fe-tabpane{
  padding: 10px;
  border-top: 1px solid var(--fe-line);
  background: rgba(0,0,0,0.60);
}

/* ------------------------------------------------------------------
   DAY PANEL
------------------------------------------------------------------ */

.shell-main .fe-daypanel{
  border: 1px solid var(--fe-line);
  background: var(--fe-panel);
  padding: 10px;
  min-width: 0;
}

/* headline */
.shell-main .fe-dayhead{
  display:flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  min-width: 0;
}

.shell-main .fe-headline{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.shell-main .fe-badge{
  display:inline-flex;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}

.shell-main .fe-badge--ticker{
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
}

.shell-main .fe-title{
  font-weight: 900;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  opacity: 0.96;

  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-main .fe-subtitle{
  font-size: 12px;
  line-height: 1.25;
  color: var(--fe-dim);
}

/* ------------------------------------------------------------------
   PAGES (horizontal paging) + 3×3 grid
------------------------------------------------------------------ */

.shell-main .fe-pages{
  display:flex;
  gap: 10px;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;

  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}

.shell-main .fe-pages::-webkit-scrollbar{ height: 8px; }
.shell-main .fe-pages::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.18);
}
.shell-main .fe-pages::-webkit-scrollbar-track{
  background: rgba(0,0,0,0.25);
}

.shell-main .fe-grid--page{
  scroll-snap-align: start;
  flex: 0 0 100%;
  min-width: 0;

  display:grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(320px, auto);
  align-content: start;
}

@media (max-width: 1200px){
  .shell-main .fe-grid--page{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(340px, auto);
  }
}

@media (max-width: 780px){
  .shell-main .fe-grid--page{
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
}

/* ------------------------------------------------------------------
   TILE
------------------------------------------------------------------ */

.shell-main .fe-tile{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.62);
  padding: 10px;
  min-width: 0;

  display:flex;
  flex-direction: column;
  gap: 8px;

  overflow: hidden;
}

.shell-main .fe-ev-title{
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shell-main .fe-ev-summary{
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255,255,255,0.86);

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shell-main .fe-ev-meta{
  display:flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.shell-main .fe-chiprow{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.shell-main .fe-chip{
  display:inline-flex;
  align-items: center;
  padding: 2px 8px;

  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;

  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  opacity: 0.95;

  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell-main .fe-chip--actor{ border-color: rgba(255,255,255,0.18); }
.shell-main .fe-chip--topic{ border-color: rgba(255,255,255,0.14); }
.shell-main .fe-chip--solution{ border-color: rgba(255,255,255,0.14); }

/* bullets */
.shell-main .fe-bullets{
  display:flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;

  max-height: 220px;
  overflow: hidden;
}

.shell-main .fe-bullet{
  border-left: 2px solid rgba(255,255,255,0.14);
  padding-left: 8px;
  min-width: 0;
}

.shell-main .fe-bullet-text{
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255,255,255,0.90);

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;

  overflow-wrap: anywhere;
}

/* numeric facts */
.shell-main .fe-nf{
  margin-top: 6px;
  display:flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.shell-main .fe-nf-row{
  display:flex;
  gap: 8px;
  align-items: baseline;

  font-size: 12px;
  line-height: 1.25;
  color: rgba(255,255,255,0.88);

  min-width: 0;
}

.shell-main .fe-nf-num{
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.shell-main .fe-nf-desc{
  color: rgba(255,255,255,0.75);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* source pinned to bottom */
.shell-main .fe-src-wrap{
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.shell-main .fe-src-link{
  display:block;
  text-decoration: none;
  color: inherit;
}

.shell-main .fe-src-card{
  display:grid;
  grid-template-columns: 66px 1fr;
  gap: 10px;
  align-items: center;

  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  padding: 8px;

  min-width: 0;
}

.shell-main .fe-src-img{
  width: 66px;
  height: 44px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.12);
}

.shell-main .fe-src-img--empty{
  background: rgba(255,255,255,0.06);
}

.shell-main .fe-src-text{ min-width: 0; }

.shell-main .fe-src-title{
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shell-main .fe-src-meta{
  font-size: 11px;
  line-height: 1.2;
  color: rgba(255,255,255,0.72);
  margin-top: 2px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* mobile comfort */
@media (max-width: 780px){
  .shell-main .fe-root{ padding: 10px; }
  .shell-main .fe-tabpane{ padding: 10px; }

  .shell-main .fe-title{ font-size: 12.5px; }
  .shell-main .fe-tile{ padding: 10px; }
  .shell-main .fe-bullets{ max-height: none; }

  .shell-main .fe-nf-desc{
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

/* misc */
.shell-main .fe-empty{
  opacity: 0.75;
  font-size: 12px;
  line-height: 1.35;
}

.shell-main .fe-path{
  opacity: 0.65;
  font-size: 12px;
  margin-top: 6px;
}

.shell-main .fe-root--error{
  border-color: rgba(255,120,120,0.35);
}

.shell-main .fe-error-title{
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.shell-main .fe-error-msg{
  color: rgba(255,140,140,0.95);
  margin-top: 6px;
}

.shell-main .fe-error-path{
  color: rgba(255,255,255,0.55);
  margin-top: 6px;
  font-size: 12px;
}

/* =====================================================================
   FIN EVENTS — CLEANUP PATCH
   - hide subtitle (date + updated)
   - justify text
   - more spacing
   - remove most borders/frames
   ===================================================================== */

/* 1) Hide: "2026-02-03 • updated ..." (date already in tab) */
.shell-main .fe-subtitle{
  display:none !important;
}

/* 2) More airy layout */
.shell-main .fe-root{
  padding: 16px !important;
}

.shell-main .fe-topbar{
  margin-bottom: 14px !important;
  padding: 12px 12px !important;
}

.shell-main .fe-tabpane{
  padding: 14px !important;
}

.shell-main .fe-daypanel{
  padding: 14px !important;
}

.shell-main .fe-headline{
  gap: 10px !important;
  margin-bottom: 2px;
}

.shell-main .fe-grid--page{
  gap: 14px !important;
}

.shell-main .fe-pages{
  gap: 14px !important;
  padding-bottom: 10px !important;
}

/* 3) Justify text blocks (telegram/paper feel) */
.shell-main .fe-ev-summary,
.shell-main .fe-bullet-text,
.shell-main .fe-nf-desc,
.shell-main .fe-src-title{
  text-align: justify !important;
  text-justify: inter-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* bullets container: let it breathe a bit */
.shell-main .fe-bullets{
  gap: 10px !important;
  max-height: 240px; /* slightly more room */
}

/* 4) Remove frames / borders (keep only subtle separators) */

/* kill outer frames */
.shell-main .fe-root{
  border: 0 !important;
  background: var(--fe-bg);
}

.shell-main .fe-topbar{
  border: 0 !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.25)) !important;
}

/* tabs wrapper without frame */
.shell-main .fe-tabs-wrap{
  border: 0 !important;
  background: transparent !important;
}

/* remove tab dividers (optional: keep as hairline if you want) */
.shell-main .fe-tabs .tab,
.shell-main .fe-tab{
  border-right: 0 !important;
}

/* day panel: no box frame, just a soft surface */
.shell-main .fe-daypanel{
  border: 0 !important;
  background: rgba(255,255,255,0.03) !important;
}

/* tiles: remove border, use subtle background only */
.shell-main .fe-tile{
  border: 0 !important;
  background: rgba(255,255,255,0.03) !important;
  padding: 12px !important;
  gap: 10px !important;
}

/* badges/chips: remove borders, keep faint fill */
.shell-main .fe-badge,
.shell-main .fe-chip{
  border: 0 !important;
  background: rgba(255,255,255,0.06) !important;
}

/* bullets: remove left border, replace with faint inset marker */
.shell-main .fe-bullet{
  border-left: 0 !important;
  padding-left: 10px !important;
  position: relative;
}
.shell-main .fe-bullet:before{
  content:"";
  position:absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 2px;
  background: rgba(255,255,255,0.10);
}

/* source: remove box border, keep top separator line */
.shell-main .fe-src-wrap{
  border-top: 1px solid rgba(255,255,255,0.08) !important;
  padding-top: 10px !important;
}

.shell-main .fe-src-card{
  border: 0 !important;
  background: rgba(255,255,255,0.04) !important;
  padding: 10px !important;
}

/* thumbs: optional soften frame */
.shell-main .fe-src-img{
  border: 0 !important;
  outline: 1px solid rgba(255,255,255,0.10);
  outline-offset: -1px;
}

/* 5) Mobile keeps comfort */
@media (max-width: 780px){
  .shell-main .fe-root{ padding: 12px !important; }
  .shell-main .fe-tabpane{ padding: 12px !important; }
  .shell-main .fe-daypanel{ padding: 12px !important; }
  .shell-main .fe-grid--page{ gap: 12px !important; }
}


/* =====================================================================
   FIN EVENTS — SM COLOR & AUTO-HEIGHT PATCH
   - adopt stocks_macro tokens (sm-*)
   - tiles expand to content (no clamps, no hard caps)
   - consistent seams, fewer frames
   ===================================================================== */

/* 0) Use SM tokens as the source of truth */
:root{
  --fe-bg:   #000;
  --fe-seam: var(--sm-seam, rgba(255,255,255,0.10));
  --fe-a:    var(--sm-a, rgba(255,255,255,0.03));
  --fe-b:    var(--sm-b, rgba(255,255,255,0.06));
  --fe-c:    var(--sm-c, rgba(255,255,255,0.09));
  --fe-text: var(--sm-text, rgba(255,255,255,0.92));
  --fe-dim:  var(--sm-dim, rgba(255,255,255,0.72));
}

/* 1) hide subtitle line ("date • updated ...") */
.shell-main .fe-subtitle{ display:none !important; }

/* 2) Root styling aligned to sm-root */
.shell-main .fe-root{
  background: var(--fe-bg) !important;
  color: var(--fe-text) !important;
  border: 1px solid var(--fe-seam) !important;
  padding: 12px !important;
  margin: 14px 0 18px 0 !important;
}

/* remove extra frames you added earlier */
.shell-main .fe-topbar{
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 0 10px 0 !important;
}
.shell-main .fe-top-title{
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  opacity: .95 !important;
}
.shell-main .fe-top-sub{ display:none !important; } /* optional: keep clean */

/* 3) Tabs: match SM tab look */
.shell-main .fe-tabs-wrap{
  border: 1px solid var(--fe-seam) !important;
  background: rgba(255,255,255,0.02) !important;
  margin-top: 10px !important;
}

/* make tab bar sticky like sm-tabs-wrap */
.shell-main .fe-tabs-wrap .tab-container{
  position: sticky;
  top: 0;
  z-index: 3;
  background: #000;
  border-bottom: 1px solid var(--fe-seam);
}

/* compact tabs */
.shell-main .fe-tabs{ padding: 0 !important; }

.shell-main .fe-tabs .tab,
.shell-main .fe-tab{
  border: none !important;
  background: transparent !important;
  color: rgba(255,255,255,0.70) !important;
  font-size: 11px !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  padding: 10px 12px !important;
  white-space: nowrap !important;
}

.shell-main .fe-tabs .tab--selected,
.shell-main .fe-tab--selected{
  color: rgba(255,255,255,0.95) !important;
  background: rgba(255,255,255,0.06) !important;
  border-left: 1px solid var(--fe-seam) !important;
  border-right: 1px solid var(--fe-seam) !important;
}

/* 4) Pane + day panel: fewer frames, SM surfaces */
.shell-main .fe-tabpane{
  padding: 12px !important;
  border-top: 1px solid var(--fe-seam) !important;
  background: rgba(0,0,0,0.35) !important;
}

.shell-main .fe-daypanel{
  border: 1px solid var(--fe-seam) !important;
  background: var(--fe-a) !important;
  padding: 10px !important;
}

/* badges/chips like sm-pill */
.shell-main .fe-badge,
.shell-main .fe-chip{
  border: 1px solid var(--fe-seam) !important;
  background: var(--fe-a) !important;
}

/* 5) IMPORTANT: allow content to expand (no clamps, no hard caps) */

/* grid rows should be auto height (not min 320) */
.shell-main .fe-grid--page{
  grid-auto-rows: auto !important;
  align-content: start;
}

/* tiles must not hide overflow */
.shell-main .fe-tile{
  border: 1px solid var(--fe-seam) !important;  /* keep a single seam like SM */
  background: rgba(0,0,0,0.35) !important;
  padding: 12px !important;
  overflow: visible !important; /* ✅ allow content to show */
}

/* remove text clamps so the card grows */
.shell-main .fe-ev-title,
.shell-main .fe-ev-summary,
.shell-main .fe-bullet-text,
.shell-main .fe-src-title{
  display: block !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  overflow: visible !important;
}

/* bullets must not be capped */
.shell-main .fe-bullets{
  max-height: none !important;
  overflow: visible !important;
}

/* numeric facts: allow wrapping */
.shell-main .fe-nf-desc{
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

/* source meta: allow wrap instead of ellipsis */
.shell-main .fe-src-meta{
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

/* 6) Typography: justify + readable spacing */
.shell-main .fe-ev-summary,
.shell-main .fe-bullet-text,
.shell-main .fe-nf-desc{
  text-align: justify;
  text-justify: inter-word;
  overflow-wrap: anywhere;
  hyphens: auto;

  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255,255,255,0.88);
}

.shell-main .fe-ev-title{
  font-size: 13.5px;
  line-height: 1.25;
}

/* more breathing room */
.shell-main .fe-grid--page{ gap: 12px !important; }
.shell-main .fe-pages{ gap: 12px !important; padding-bottom: 10px !important; }
.shell-main .fe-ev-meta{ gap: 8px !important; }
.shell-main .fe-chiprow{ gap: 6px !important; }
.shell-main .fe-bullets{ gap: 10px !important; }
.shell-main .fe-bullet{ padding-left: 10px !important; }

/* 7) Reduce inner frames: source card becomes SM-like */
.shell-main .fe-src-wrap{
  border-top: 1px solid var(--fe-seam) !important;
  padding-top: 10px !important;
}

.shell-main .fe-src-card{
  border: 1px solid var(--fe-seam) !important;
  background: var(--fe-a) !important;
  padding: 10px !important;
}

/* 8) Mobile: keep horizontal scroll tabs */
@media (max-width: 920px){
  .shell-main .fe-tabs-wrap{ overflow: hidden; }
  .shell-main .fe-tabs-wrap .tab-container{
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .shell-main .fe-tabs-wrap .tab-container::-webkit-scrollbar{ height: 8px; }
  .shell-main .fe-tabs-wrap .tab-container::-webkit-scrollbar-thumb{
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.10);
  }
  .shell-main .fe-tabs{
    display:flex !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: 100% !important;
  }
}
