/* =========================================================
   Financial Decision Terminal V2
   Static frontend for iran-market-agent backend
   ========================================================= */

:root{
  --bg:#07111b;
  --bg-2:#091725;
  --panel:#0b1b2a;
  --panel-2:#0e2132;
  --panel-3:#10273a;
  --line:#1d3144;
  --line-soft:#142637;
  --text:#edf5fb;
  --muted:#8da4b8;
  --faint:#60778a;
  --blue:#4cb9ff;
  --green:#3fd596;
  --green-soft:#10291f;
  --yellow:#e8bb53;
  --yellow-soft:#2a2211;
  --red:#ef7080;
  --red-soft:#2b171b;
  --gray:#7f8d9b;
  --gray-soft:#18212b;
  --shadow:0 12px 30px rgba(0,0,0,.18);
  --sidebar:168px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Tahoma,"Segoe UI",Arial,sans-serif;
  font-size:13px;
}
button,input,select{font:inherit}
button{cursor:pointer}
a{text-decoration:none;color:inherit}
[hidden]{display:none!important}

.app-shell{min-height:100vh}
.sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--sidebar);
  background:#06101a;
  border-right:1px solid var(--line-soft);
  display:flex;
  flex-direction:column;
  z-index:80;
}
.brand{
  min-height:68px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  border-bottom:1px solid var(--line-soft);
}
.brand-logo{
  width:34px;height:34px;border-radius:8px;
  display:grid;place-items:center;
  color:#fff;font-weight:800;font-size:18px;
  background:linear-gradient(135deg,#0c88d8,#33baff);
}
.brand-copy strong{display:block;font-size:13px}
.brand-copy span{display:block;color:var(--faint);font-size:10px;margin-top:3px}

.nav{padding:10px 7px;display:grid;gap:3px}
.nav-item{
  border:0;background:transparent;color:var(--muted);
  height:42px;border-radius:6px;
  display:flex;align-items:center;gap:10px;
  padding:0 12px;text-align:right;
}
.nav-item span{width:18px;text-align:center;font-size:16px;color:#8fb2ce}
.nav-item b{font-weight:600}
.nav-item:hover{background:#0a2235;color:#fff}
.nav-item.active{
  background:linear-gradient(90deg,#0a3452,#0a2336);
  color:#fff;
  box-shadow:inset 3px 0 var(--blue);
}
.sidebar-state{
  margin:auto 9px 12px;
  padding:10px;
  border:1px solid rgba(63,213,150,.18);
  background:rgba(63,213,150,.05);
  border-radius:6px;
}
.sidebar-state span,.sidebar-state small{display:block;color:var(--faint);font-size:9px}
.sidebar-state strong{display:block;color:var(--green);margin:5px 0;font-size:11px}

.main{margin-left:var(--sidebar);min-width:0}
.topbar{
  min-height:66px;
  padding:10px 16px;
  display:grid;
  grid-template-columns:minmax(240px,320px) 1fr auto;
  align-items:center;
  gap:16px;
  position:sticky;top:0;z-index:60;
  background:#071521;
  border-bottom:1px solid var(--line-soft);
}
.topbar-search{
  height:36px;
  border:1px solid var(--line);
  background:#0a1d2d;
  border-radius:6px;
  display:flex;align-items:center;gap:7px;
  padding:0 10px;
}
.topbar-search input{
  flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--text)
}
.topbar-search kbd{
  border:1px solid var(--line);
  background:#102739;
  color:var(--faint);
  border-radius:4px;padding:2px 6px;font-size:10px
}
.market-mini{
  display:flex;align-items:center;gap:14px;overflow:auto;
}
.market-mini-item{display:flex;gap:5px;align-items:center;white-space:nowrap;font-size:11px}
.market-mini-item b{font-weight:700}
.market-mini-item .up{color:var(--green)}
.market-mini-item .down{color:var(--red)}
.topbar-actions{display:flex;align-items:center;gap:10px}
.last-update span{display:block;color:var(--faint);font-size:9px}
.last-update strong{font-size:11px}
.btn{
  border:1px solid var(--line);border-radius:6px;
  height:34px;padding:0 12px;
  background:#0d2233;color:var(--text)
}
.btn.primary{background:#0b4166;border-color:#17618e;color:#dff4ff}
.btn.ghost{background:transparent}
.btn:hover{filter:brightness(1.08)}

.command-summary{padding:12px 16px 6px}
.page-title{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:10px}
.page-title h1{margin:0;font-size:21px}
.page-title p{margin:4px 0 0;color:var(--muted);font-size:11px}
.market-regime-pill{
  padding:7px 10px;border-radius:999px;
  color:var(--green);background:rgba(63,213,150,.08);
  border:1px solid rgba(63,213,150,.18);font-size:11px
}
.summary-strip{
  display:grid;
  grid-template-columns:repeat(8,minmax(110px,1fr));
  border:1px solid var(--line);
  background:var(--panel);
  border-radius:7px;
  overflow:hidden;
}
.summary-item{
  min-height:72px;padding:9px 10px;
  border-left:1px solid var(--line-soft);
  display:flex;flex-direction:column;justify-content:center;gap:3px;
}
.summary-item:last-child{border-left:0}
.summary-item span{color:var(--faint);font-size:9px}
.summary-item strong{font-size:19px}
.summary-item small{color:var(--muted);font-size:9px}

.workspace{
  margin:10px 16px 0;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--panel);
  overflow:hidden;
}
.workspace-header{
  min-height:62px;padding:10px 12px;
  display:flex;align-items:flex-end;justify-content:space-between;gap:12px;
  border-bottom:1px solid var(--line-soft);
}
.workspace-header h2{margin:0;font-size:16px}
.workspace-header p{margin:4px 0 0;color:var(--faint);font-size:10px}
.view-tabs{display:flex;gap:3px;overflow:auto}
.view-tabs button{
  border:0;background:transparent;color:var(--muted);
  height:30px;padding:0 10px;border-radius:5px;white-space:nowrap
}
.view-tabs button.active{
  background:#123b59;color:#fff;box-shadow:inset 0 -2px var(--blue)
}
.filters{
  min-height:48px;padding:7px 10px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  border-bottom:1px solid var(--line-soft);background:#091a29
}
.filter-group,.filter-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
select{
  height:32px;border:1px solid var(--line);
  border-radius:5px;background:#0b2132;color:var(--text);
  padding:0 9px;outline:none
}
.density{display:flex;align-items:center;gap:6px;color:var(--faint);font-size:10px}

.table-wrap{overflow:auto;max-height:560px}
.decision-table{width:100%;border-collapse:collapse;min-width:1050px}
.decision-table th{
  position:sticky;top:0;z-index:15;
  background:#0a1d2c;color:var(--faint);
  padding:8px 9px;border-bottom:1px solid var(--line);
  font-size:10px;font-weight:600;white-space:nowrap;text-align:right
}
.decision-table td{
  padding:7px 9px;
  border-bottom:1px solid var(--line-soft);
  white-space:nowrap;vertical-align:middle
}
.decision-table tbody tr{background:#071927;transition:.12s}
.decision-table tbody tr:hover{background:#0a2639}
.decision-table tbody tr.selected{background:#0b2a3d;box-shadow:inset -3px 0 var(--blue)}
.symbol-cell{display:flex;align-items:center;gap:9px}
.symbol-copy strong{display:block;font-size:13px}
.symbol-copy span{display:block;color:var(--faint);font-size:10px;margin-top:2px}
.sparkline{width:58px;height:20px}
.decision-pill,.status-chip{
  display:inline-flex;align-items:center;border-radius:4px;
  padding:3px 7px;font-size:10px;font-weight:700
}
.tone-buy{color:var(--green);background:var(--green-soft)}
.tone-watch{color:var(--yellow);background:var(--yellow-soft)}
.tone-risk{color:var(--red);background:var(--red-soft)}
.tone-neutral{color:var(--gray);background:var(--gray-soft)}
.num{direction:ltr;unicode-bidi:isolate;font-variant-numeric:tabular-nums}
.score-good{color:var(--green)}
.score-mid{color:var(--yellow)}
.score-bad{color:var(--red)}
.reason-cell{max-width:250px;overflow:hidden;text-overflow:ellipsis;color:#b9c8d5}
.muted{color:var(--muted)}
.faint{color:var(--faint)}
.details-arrow{color:var(--blue);font-weight:700}
.empty-state{padding:48px;text-align:center;color:var(--faint)}
.density-comfortable .decision-table td{padding-top:11px;padding-bottom:11px}

.section-heading{
  display:flex;align-items:center;justify-content:space-between;
  margin:16px 16px 7px;padding-bottom:7px;border-bottom:1px solid var(--line-soft)
}
.section-heading h2{margin:0;font-size:14px}
.section-heading p{margin:4px 0 0;color:var(--faint);font-size:10px}
.trust-grid{
  display:grid;
  grid-template-columns:1.05fr 1fr 1fr 1fr;
  gap:8px;margin:0 16px
}
.trust-panel{
  min-height:190px;
  border:1px solid var(--line);border-radius:6px;
  background:var(--panel);padding:11px
}
.panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.panel-head h3{margin:0;font-size:12px}
.panel-head>span{color:var(--faint);font-size:9px}
.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px 12px}
.metric-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.metric-row span{color:var(--faint);font-size:10px}
.metric-row strong{font-size:11px}
.panel-note{
  margin-top:11px;padding:8px;border-radius:5px;
  color:var(--yellow);background:var(--yellow-soft);font-size:10px;line-height:1.7
}
.mini-result{
  display:grid;grid-template-columns:64px 1fr auto;
  gap:8px;align-items:center;padding:7px 0;border-bottom:1px solid var(--line-soft)
}
.mini-result:last-child{border-bottom:0}
.news-item{padding:7px 0;border-bottom:1px solid var(--line-soft)}
.news-item:last-child{border-bottom:0}
.news-item-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.news-item p{margin:4px 0 0;color:var(--muted);font-size:10px;line-height:1.65}
.health-ring-wrap{display:grid;grid-template-columns:110px 1fr;gap:10px;align-items:center}
.health-ring{
  width:94px;height:94px;border-radius:50%;
  display:grid;place-items:center;
  margin:auto;
  background:conic-gradient(var(--green) 0 79%, #173044 79% 100%);
  position:relative
}
.health-ring::after{
  content:"";position:absolute;inset:10px;border-radius:50%;background:var(--panel)
}
.health-ring strong{position:relative;z-index:2;font-size:20px;color:var(--green)}
.health-list{display:grid;gap:5px}
.health-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.health-row span{font-size:10px;color:var(--muted)}
.health-warning{margin-top:10px;color:var(--yellow);font-size:10px;line-height:1.6}

.market-section{padding-bottom:28px}
.market-ticker{
  margin:0 16px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--panel);
  display:flex;align-items:stretch;overflow:auto
}
.market-card{
  min-width:150px;flex:1;
  padding:9px 11px;border-left:1px solid var(--line-soft)
}
.market-card:last-child{border-left:0}
.market-card span{display:block;color:var(--faint);font-size:9px}
.market-card strong{display:block;margin-top:4px;font-size:14px}
.market-card small{display:block;margin-top:3px;font-size:10px}

.drawer-backdrop{
  position:fixed;inset:0;background:rgba(2,6,10,.58);z-index:95
}
.detail-drawer{
  position:fixed;top:0;bottom:0;right:-520px;
  width:min(500px,100vw);
  background:#081725;border-left:1px solid var(--line);
  z-index:100;transition:right .2s ease;
  display:flex;flex-direction:column;
  box-shadow:-20px 0 50px rgba(0,0,0,.25)
}
.detail-drawer.open{right:0}
.drawer-head{
  min-height:67px;padding:12px 14px;
  display:flex;align-items:flex-start;justify-content:space-between;
  border-bottom:1px solid var(--line-soft)
}
.drawer-title-line{display:flex;align-items:baseline;gap:8px}
.drawer-title-line h2{margin:0;font-size:18px}
.drawer-title-line span{color:var(--muted)}
.drawer-head small{color:var(--faint)}
.icon-btn{border:0;background:transparent;color:var(--muted);font-size:24px;line-height:1}
.drawer-tabs{
  display:flex;gap:3px;padding:8px 10px;overflow:auto;border-bottom:1px solid var(--line-soft)
}
.drawer-tabs button{
  height:30px;padding:0 9px;border:0;border-radius:5px;
  background:transparent;color:var(--muted);white-space:nowrap
}
.drawer-tabs button.active{background:#123b59;color:#fff}
.drawer-body{padding:13px;overflow:auto;flex:1}
.drawer-decision{
  padding:11px;border-radius:6px;margin-bottom:10px
}
.drawer-decision span{display:block;color:var(--faint);font-size:10px}
.drawer-decision strong{display:block;margin-top:4px;font-size:17px}
.drawer-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:12px}
.drawer-metric{
  text-align:center;padding:8px;border:1px solid var(--line-soft);background:var(--panel);border-radius:5px
}
.drawer-metric span{display:block;color:var(--faint);font-size:9px}
.drawer-metric strong{display:block;margin-top:4px;font-size:13px}
.drawer-block{margin-top:13px}
.drawer-block h4{margin:0 0 7px;font-size:11px;color:var(--muted)}
.reason-list{display:grid;gap:6px}
.reason-list div{display:flex;gap:7px;align-items:flex-start;line-height:1.7}
.reason-dot{width:6px;height:6px;border-radius:50%;margin-top:7px;flex:0 0 auto}
.engine-row{
  display:grid;grid-template-columns:90px 1fr 42px 62px;
  gap:8px;align-items:center;padding:7px 0;border-bottom:1px solid var(--line-soft)
}
.engine-row:last-child{border-bottom:0}
.engine-label{color:var(--muted);font-size:10px}
.engine-bar{height:6px;border-radius:99px;background:#152b3d;overflow:hidden}
.engine-bar>span{display:block;height:100%;border-radius:inherit}
.drawer-grid{display:grid;gap:0}
.drawer-grid-row{
  display:flex;align-items:center;justify-content:space-between;
  padding:9px 0;border-bottom:1px solid var(--line-soft)
}
.drawer-grid-row span{color:var(--faint);font-size:10px}
.drawer-grid-row strong{font-size:11px;text-align:left}
.warning-box{
  padding:9px;border-radius:5px;background:var(--yellow-soft);color:var(--yellow);
  line-height:1.7;font-size:10px
}

@media (max-width:1350px){
  .summary-strip{grid-template-columns:repeat(4,1fr)}
  .trust-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:1100px){
  :root{--sidebar:62px}
  .brand-copy,.nav-item b,.sidebar-state{display:none}
  .brand{justify-content:center;padding:10px 6px}
  .nav-item{justify-content:center;padding:0}
  .topbar{grid-template-columns:minmax(220px,290px) 1fr auto}
}
@media (max-width:850px){
  :root{--sidebar:0px}
  .sidebar{display:none}
  .main{margin-left:0}
  .topbar{grid-template-columns:1fr auto}
  .market-mini{display:none}
  .summary-strip{grid-template-columns:repeat(2,1fr)}
  .trust-grid{grid-template-columns:1fr}
  .workspace-header{align-items:stretch;flex-direction:column}
}
@media (max-width:560px){
  .command-summary,.workspace,.section-heading,.trust-grid,.market-ticker{margin-left:8px;margin-right:8px}
  .command-summary{padding-left:0;padding-right:0}
  .topbar{padding-left:8px;padding-right:8px}
  .last-update{display:none}
  .page-title{align-items:flex-start;flex-direction:column}
  .summary-strip{grid-template-columns:1fr 1fr}
  .filters{align-items:stretch;flex-direction:column}
  .filter-actions{justify-content:space-between}
  .drawer-metrics{grid-template-columns:1fr 1fr}
}


/* =========================================================
   FINANCIAL UI V2.1 — PROFESSIONAL POLISH
   ========================================================= */

:root {

  --sidebar:
    146px;

  --bg:
    #06111b;

  --panel:
    #081a29;

  --panel-2:
    #0a1e2e;

  --line:
    #1b3042;

  --line-soft:
    #112637;

}


/* ---------- GLOBAL ---------- */

body {

  font-size:
    12px;

  letter-spacing:
    0;

}


.main {

  background:
    #06111b;

}


/* ---------- SIDEBAR ---------- */

.sidebar {

  width:
    var(--sidebar);

  background:
    #050f18;

}


.brand {

  min-height:
    60px;

  padding:
    9px 10px;

}


.brand-logo {

  width:
    31px;

  height:
    31px;

  font-size:
    16px;

}


.brand-copy strong {

  font-size:
    11px;

}


.brand-copy span {

  font-size:
    8px;

}


.nav {

  padding:
    8px 6px;

}


.nav-item {

  height:
    38px;

  padding:
    0 10px;

  border-radius:
    4px;

  font-size:
    10px;

}


.nav-item.active {

  background:
    #0b2e47;

}


/* ---------- HEADER ---------- */

.topbar {

  min-height:
    56px;

  padding:
    7px 12px;

  grid-template-columns:
    minmax(230px, 300px)
    1fr
    auto;

  gap:
    12px;

}


.topbar-search {

  height:
    32px;

  border-radius:
    4px;

}


.topbar-search input {

  font-size:
    10px;

}


.last-update span {

  font-size:
    8px;

}


.last-update strong {

  font-size:
    9.5px;

}


.btn {

  height:
    31px;

  border-radius:
    4px;

  font-size:
    9px;

}


/* ---------- TITLE ---------- */

.command-summary {

  padding:
    9px 12px 5px;

}


.page-title {

  margin-bottom:
    7px;

}


.page-title h1 {

  font-size:
    18px;

  font-weight:
    800;

}


.page-title p {

  margin-top:
    2px;

  font-size:
    9px;

}


.market-regime-pill {

  padding:
    5px 8px;

  font-size:
    9px;

}


/* ---------- SUMMARY ---------- */

.summary-strip {

  border-radius:
    4px;

}


.summary-item {

  min-height:
    56px;

  padding:
    6px 9px;

}


.summary-item span {

  font-size:
    8px;

}


.summary-item strong {

  font-size:
    16px;

  line-height:
    1.1;

}


.summary-item small {

  font-size:
    7.5px;

}


/* ---------- WORKSPACE ---------- */

.workspace {

  margin:
    8px 12px 0;

  border-radius:
    4px;

}


.workspace-header {

  min-height:
    52px;

  padding:
    8px 10px;

}


.workspace-header h2 {

  font-size:
    14px;

}


.workspace-header p {

  font-size:
    9px;

}


.view-tabs button {

  height:
    27px;

  padding:
    0 9px;

  border-radius:
    3px;

  font-size:
    9px;

}


.filters {

  min-height:
    42px;

  padding:
    5px 8px;

}


select {

  height:
    29px;

  border-radius:
    3px;

  font-size:
    9px;

}


/* ---------- TABLE ---------- */

.table-wrap {

  max-height:
    610px;

}


.decision-table {

  min-width:
    1000px;

}


.decision-table th {

  height:
    34px;

  padding:
    6px 8px;

  font-size:
    8.5px;

  font-weight:
    600;

  color:
    #7893a8;

  background:
    #081b2a;

}


.decision-table td {

  height:
    48px;

  padding:
    5px 8px;

}


.decision-table tbody tr {

  background:
    #071825;

}


.decision-table tbody tr:nth-child(even) {

  background:
    #081b29;

}


.decision-table tbody tr:hover {

  background:
    #0b293d;

}


.decision-table tbody tr.selected {

  background:
    #0b3045;

}


.symbol-cell {

  gap:
    7px;

}


.symbol-copy strong {

  font-size:
    12px;

  font-weight:
    800;

}


.symbol-copy span {

  margin-top:
    1px;

  font-size:
    8px;

}


.sparkline {

  width:
    54px;

  height:
    18px;

}


/* ---------- DECISION ---------- */

.decision-pill {

  min-width:
    124px;

  justify-content:
    center;

  padding:
    4px 8px;

  border-radius:
    3px;

  font-size:
    9px;

  font-weight:
    800;

}


.reason-cell {

  display:
    inline-block;

  max-width:
    290px;

  overflow:
    hidden;

  text-overflow:
    ellipsis;

  white-space:
    nowrap;

  color:
    #c0ced8;

  font-size:
    9.5px;

}


.status-chip {

  padding:
    3px 6px;

  border-radius:
    3px;

  font-size:
    8.5px;

}


/* ---------- NUMBERS ---------- */

.num {

  font-variant-numeric:
    tabular-nums;

  font-feature-settings:
    "tnum";

}


.score-good {

  color:
    #52dca0;

}


.score-mid {

  color:
    #e9bb50;

}


.score-bad {

  color:
    #ef7182;

}


/* ---------- SCROLLBAR ---------- */

.table-wrap::-webkit-scrollbar {

  width:
    8px;

  height:
    8px;

}


.table-wrap::-webkit-scrollbar-track {

  background:
    #06111b;

}


.table-wrap::-webkit-scrollbar-thumb {

  background:
    #183850;

  border-radius:
    8px;

}


.table-wrap::-webkit-scrollbar-thumb:hover {

  background:
    #24516f;

}


/* ---------- DETAIL DRAWER ---------- */

.detail-drawer {

  width:
    min(480px, 100vw);

  background:
    #071725;

}


.drawer-head {

  min-height:
    58px;

  padding:
    9px 12px;

}


.drawer-title-line h2 {

  font-size:
    16px;

}


.drawer-tabs {

  padding:
    6px 8px;

}


.drawer-tabs button {

  height:
    27px;

  font-size:
    9px;

}


.drawer-body {

  padding:
    11px;

}


/* ---------- TRUST SECTION ---------- */

.section-heading {

  margin:
    13px 12px 6px;

}


.trust-grid {

  margin:
    0 12px;

  gap:
    6px;

}


.trust-panel {

  border-radius:
    4px;

  background:
    #081a29;

}


/* ---------- TOOLTIP CLEANUP ---------- */

.reason-cell[title] {

  cursor:
    help;

}


/* ---------- MOBILE ---------- */

@media (max-width: 1100px) {

  :root {

    --sidebar:
      58px;

  }

}


@media (max-width: 850px) {

  :root {

    --sidebar:
      0px;

  }

}



/* =========================================================
   V2 FULL BACKEND CONNECTION UI
   ========================================================= */

.news-health-line {
  padding:
    6px 0 9px;

  margin-bottom:
    3px;

  color:
    var(--faint);

  font-size:
    9px;

  border-bottom:
    1px solid
    var(--line-soft);
}

.news-health-line strong {
  color:
    var(--text);
}

.news-type {
  display:
    inline-block;

  margin-top:
    4px;

  color:
    var(--blue);

  font-size:
    8px;
}

.news-detail-events {
  display:
    grid;

  gap:
    5px;
}

.news-detail-event {
  display:
    flex;

  justify-content:
    space-between;

  gap:
    10px;

  padding:
    7px 8px;

  border:
    1px solid
    var(--line-soft);

  border-radius:
    4px;

  background:
    var(--panel);
}

.news-detail-event strong {
  font-size:
    9px;

  line-height:
    1.7;
}

.news-detail-event span {
  color:
    var(--muted);

  font-size:
    8px;

  white-space:
    nowrap;
}

.mini-result-outcome {
  display:
    flex;

  align-items:
    center;

  gap:
    5px;
}

.health-status-pack {
  display:
    flex;

  align-items:
    center;

  gap:
    5px;
}

.health-status-pack small {
  color:
    var(--faint);

  font-size:
    8px;
}


/* PORTFOLIO */

.portfolio-section-v2 {
  margin:
    0;
}

.portfolio-shell-v2 {
  margin:
    0 12px 10px;

  border:
    1px solid
    var(--line);

  border-radius:
    4px;

  background:
    var(--panel);
}

.portfolio-empty-v2 {
  min-height:
    70px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    12px;

  padding:
    10px 12px;
}

.portfolio-empty-v2 strong {
  display:
    block;

  font-size:
    11px;
}

.portfolio-empty-v2 span {
  display:
    block;

  margin-top:
    4px;

  color:
    var(--faint);

  font-size:
    9px;
}

.portfolio-metrics-v2 {
  display:
    grid;

  grid-template-columns:
    repeat(6, 1fr);
}

.portfolio-metrics-v2 > div {
  min-height:
    63px;

  padding:
    9px;

  border-left:
    1px solid
    var(--line-soft);
}

.portfolio-metrics-v2 > div:last-child {
  border-left:
    0;
}

.portfolio-metrics-v2 span {
  display:
    block;

  color:
    var(--faint);

  font-size:
    8px;
}

.portfolio-metrics-v2 strong {
  display:
    block;

  margin-top:
    5px;

  font-size:
    14px;
}

.portfolio-warning-v2 {
  padding:
    8px 10px;

  border-top:
    1px solid
    var(--line-soft);

  color:
    var(--yellow);

  font-size:
    9px;
}


/* Better news/codal panel visibility */

.news-list {
  max-height:
    300px;

  overflow:
    auto;
}

.trust-panel {
  overflow:
    hidden;
}


/* market ticker */

.market-card small {
  font-weight:
    700;
}


/* responsive */

@media (max-width: 1200px) {
  .portfolio-metrics-v2 {
    grid-template-columns:
      repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .portfolio-metrics-v2 {
    grid-template-columns:
      repeat(2, 1fr);
  }
}



/* =========================================================
   V2.2 PROFESSIONAL READABILITY PASS
   ========================================================= */


/* ---------------------------------------------------------
   FONT
   --------------------------------------------------------- */

@import url(
  'https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap'
);


:root {

  --ui-font:
    "Vazirmatn",
    "IRANSansX",
    "Segoe UI",
    Tahoma,
    Arial,
    sans-serif;

}


body,
button,
input,
select,
textarea {

  font-family:
    var(--ui-font) !important;

}


body {

  font-size:
    14px;

  line-height:
    1.65;

  text-rendering:
    optimizeLegibility;

  -webkit-font-smoothing:
    antialiased;

}


/* ---------------------------------------------------------
   SIDEBAR
   --------------------------------------------------------- */

:root {

  --sidebar:
    158px;

}


.brand {

  min-height:
    66px;

}


.brand-logo {

  width:
    34px;

  height:
    34px;

}


.brand-copy strong {

  font-size:
    12px;

  font-weight:
    800;

}


.brand-copy span {

  font-size:
    9px;

}


.nav-item {

  height:
    42px;

  font-size:
    11px;

}


.nav-item span {

  font-size:
    17px;

}


.sidebar-state {

  padding:
    10px;

}


.sidebar-state span,
.sidebar-state small {

  font-size:
    9px;

}


.sidebar-state strong {

  font-size:
    11px;

}


/* ---------------------------------------------------------
   HEADER
   --------------------------------------------------------- */

.topbar {

  min-height:
    62px;

  padding:
    8px 14px;

}


.topbar-search {

  height:
    36px;

}


.topbar-search input {

  font-size:
    11px;

}


.last-update span {

  font-size:
    9px;

}


.last-update strong {

  font-size:
    10.5px;

}


.btn {

  height:
    34px;

  padding:
    0 13px;

  font-size:
    10px;

}


/* ---------------------------------------------------------
   TOP MARKET TICKER
   --------------------------------------------------------- */

.market-mini {

  gap:
    18px;

}


.market-mini-item {

  gap:
    6px;

  font-size:
    10.5px;

}


.market-mini-item b {

  font-size:
    11.5px;

}


.market-price-v22 {

  direction:
    ltr;

  unicode-bidi:
    isolate;

  font-variant-numeric:
    tabular-nums;

  letter-spacing:
    .15px;

}


/* ---------------------------------------------------------
   PAGE TITLE
   --------------------------------------------------------- */

.command-summary {

  padding:
    12px 14px 7px;

}


.page-title h1 {

  font-size:
    21px;

  line-height:
    1.35;

}


.page-title p {

  font-size:
    10.5px;

}


.market-regime-pill {

  font-size:
    10px;

  padding:
    6px 10px;

}


/* ---------------------------------------------------------
   SUMMARY STRIP
   --------------------------------------------------------- */

.summary-item {

  min-height:
    66px;

  padding:
    8px 11px;

}


.summary-item span {

  font-size:
    9.5px;

}


.summary-item strong {

  font-size:
    18px;

  line-height:
    1.25;

}


.summary-item small {

  font-size:
    8.5px;

}


/* ---------------------------------------------------------
   WORKSPACE HEADER
   --------------------------------------------------------- */

.workspace {

  margin:
    9px 14px 0;

}


.workspace-header {

  min-height:
    59px;

  padding:
    9px 11px;

}


.workspace-header h2 {

  font-size:
    16px;

}


.workspace-header p {

  font-size:
    10px;

}


.view-tabs button {

  height:
    31px;

  padding:
    0 11px;

  font-size:
    10px;

}


/* ---------------------------------------------------------
   FILTERS
   --------------------------------------------------------- */

.filters {

  min-height:
    48px;

  padding:
    7px 10px;

}


select {

  min-width:
    118px;

  height:
    34px;

  padding:
    0 10px;

  font-size:
    10.5px;

}


select option {

  font-size:
    12px;

}


/* ---------------------------------------------------------
   TABLE
   --------------------------------------------------------- */

.table-wrap {

  max-height:
    650px;

}


.decision-table th {

  height:
    39px;

  padding:
    7px 9px;

  font-size:
    10px;

  font-weight:
    700;

}


.decision-table td {

  height:
    55px;

  padding:
    7px 9px;

  font-size:
    11px;

}


.symbol-copy strong {

  font-size:
    13px;

}


.symbol-copy span {

  font-size:
    9.5px;

}


.sparkline {

  width:
    62px;

  height:
    21px;

}


.decision-pill {

  min-width:
    138px;

  padding:
    5px 9px;

  font-size:
    10px;

}


.status-chip {

  padding:
    4px 7px;

  font-size:
    9.5px;

}


.reason-cell {

  max-width:
    330px;

  font-size:
    10.5px;

  line-height:
    1.7;

}


.details-arrow {

  font-size:
    16px;

}


/* ---------------------------------------------------------
   NUMBER CELLS
   --------------------------------------------------------- */

.decision-table .num {

  font-size:
    11.5px;

  font-weight:
    600;

}


.score-good,
.score-mid,
.score-bad {

  font-weight:
    700;

}


/* ---------------------------------------------------------
   DRAWER
   --------------------------------------------------------- */

.detail-drawer {

  width:
    min(540px, 100vw);

}


.drawer-head {

  min-height:
    68px;

  padding:
    12px 15px;

}


.drawer-title-line h2 {

  font-size:
    19px;

}


.drawer-title-line span {

  font-size:
    12px;

}


.drawer-head small {

  font-size:
    10px;

}


.drawer-tabs {

  padding:
    8px 10px;

  gap:
    5px;

}


.drawer-tabs button {

  height:
    32px;

  padding:
    0 11px;

  font-size:
    10px;

}


.drawer-body {

  padding:
    15px;

}


.drawer-decision {

  padding:
    13px;

}


.drawer-decision span {

  font-size:
    10px;

}


.drawer-decision strong {

  font-size:
    19px;

}


.drawer-metric {

  padding:
    10px 8px;

}


.drawer-metric span {

  font-size:
    9.5px;

}


.drawer-metric strong {

  font-size:
    14px;

}


.drawer-block {

  margin-top:
    16px;

}


.drawer-block h4 {

  font-size:
    11.5px;

  margin-bottom:
    9px;

}


.drawer-grid-row {

  min-height:
    39px;

  padding:
    9px 2px;

}


.drawer-grid-row span {

  font-size:
    10.5px;

}


.drawer-grid-row strong {

  font-size:
    11px;

}


.reason-list div {

  font-size:
    11px;

}


.engine-row {

  grid-template-columns:
    100px
    1fr
    52px
    64px;

  min-height:
    39px;

}


.engine-label {

  font-size:
    10px;

}


.warning-box {

  padding:
    10px;

  font-size:
    10.5px;

}


/* ---------------------------------------------------------
   TRUST / PERFORMANCE
   --------------------------------------------------------- */

.section-heading {

  margin:
    16px 14px 7px;

}


.section-heading h2 {

  font-size:
    15px;

}


.section-heading p {

  font-size:
    10px;

}


.trust-grid {

  margin:
    0 14px;

  gap:
    8px;

}


.trust-panel {

  min-height:
    215px;

  padding:
    13px;

}


.panel-head h3 {

  font-size:
    13px;

}


.panel-head > span {

  font-size:
    9px;

}


.metric-row {

  min-height:
    27px;

}


.metric-row span {

  font-size:
    10.5px;

}


.metric-row strong {

  font-size:
    11.5px;

}


.panel-note {

  font-size:
    10.5px;

  line-height:
    1.8;

}


.mini-result {

  min-height:
    38px;

  font-size:
    10.5px;

}


.news-item {

  padding:
    9px 0;

}


.news-item-head strong {

  font-size:
    11px;

}


.news-item p {

  font-size:
    10px;

  line-height:
    1.75;

}


/* ---------------------------------------------------------
   HEALTH
   --------------------------------------------------------- */

.health-ring {

  width:
    102px;

  height:
    102px;

}


.health-ring strong {

  font-size:
    22px;

}


.health-row span {

  font-size:
    10.5px;

}


.health-warning {

  font-size:
    10px;

}


/* ---------------------------------------------------------
   MARKET TICKER
   --------------------------------------------------------- */

.market-ticker {

  margin:
    0 14px;

}


.market-card {

  min-width:
    175px;

  padding:
    10px 12px;

}


.market-card span {

  font-size:
    9.5px;

}


.market-card strong {

  margin-top:
    5px;

  font-size:
    16px;

  white-space:
    nowrap;

}


.market-card small {

  margin-top:
    4px;

  font-size:
    10px;

}


/* ---------------------------------------------------------
   PORTFOLIO
   --------------------------------------------------------- */

.portfolio-shell-v2 {

  margin:
    0 14px 12px;

}


.portfolio-empty-v2 {

  min-height:
    78px;

  padding:
    12px 14px;

}


.portfolio-empty-v2 strong {

  font-size:
    12px;

}


.portfolio-empty-v2 span {

  font-size:
    10px;

}


/* ---------------------------------------------------------
   SCROLLBARS
   --------------------------------------------------------- */

* {

  scrollbar-width:
    thin;

  scrollbar-color:
    #244b65
    #07131f;

}


*::-webkit-scrollbar {

  width:
    8px;

  height:
    8px;

}


*::-webkit-scrollbar-thumb {

  background:
    #244b65;

  border-radius:
    8px;

}


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 1200px) {

  :root {

    --sidebar:
      64px;

  }

}


@media (max-width: 850px) {

  body {

    font-size:
      13px;

  }


  .decision-table td {

    font-size:
      10.5px;

  }

}




/* =========================================================
   V2.3 MICRO-UX / TYPOGRAPHY / DRAWER / ENGINES / STARS
   ========================================================= */

:root{
  --ok:#4fe0a1;
  --ok-soft:#123527;
  --warn:#e7b84f;
  --warn-soft:#3a2b0d;
  --bad:#ef6e7b;
  --bad-soft:#3a1620;
  --neutral:#7da0b8;
  --neutral-soft:#11283a;
}

/* -------------------- TABLE READABILITY -------------------- */

.decision-table th{
  font-size: 10.5px !important;
  font-weight: 700 !important;
}

.decision-table td{
  font-size: 12px !important;
  padding: 7px 9px !important;
  height: 54px !important;
}

.symbol-copy strong{
  font-size: 14px !important;
  font-weight: 800 !important;
}

.symbol-copy span{
  font-size: 10px !important;
  color:#88a4b8 !important;
}

.reason-cell{
  font-size: 10.8px !important;
  line-height: 1.75 !important;
}

.decision-pill{
  font-size: 10.5px !important;
  font-weight: 800 !important;
  min-width: 138px !important;
}

.status-chip{
  font-size: 9.8px !important;
  font-weight: 700 !important;
}

/* -------------------- SPARKLINE -------------------- */

.sparkline{
  width: 68px !important;
  height: 24px !important;
  display:flex;
  align-items:center;
  justify-content:center;
}

.sparkline svg{
  width:68px;
  height:24px;
  overflow:visible;
}

.sparkline-v23 path.spark-area{
  opacity:.10;
}

.sparkline-v23 path.spark-line{
  fill:none;
  stroke-width:2.15;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.sparkline-v23 circle.spark-dot{
  r:2.6;
}

.sparkline-v23.buy  path.spark-line,
.sparkline-v23.buy  circle.spark-dot{ stroke:var(--ok); fill:var(--ok); }

.sparkline-v23.watch path.spark-line,
.sparkline-v23.watch circle.spark-dot{ stroke:var(--warn); fill:var(--warn); }

.sparkline-v23.trim path.spark-line,
.sparkline-v23.trim circle.spark-dot{ stroke:var(--bad); fill:var(--bad); }

.sparkline-v23.neutral path.spark-line,
.sparkline-v23.neutral circle.spark-dot{ stroke:#78a6c5; fill:#78a6c5; }

/* -------------------- STAR RATING -------------------- */

.symbol-stars-v23{
  margin-top:4px;
  display:flex;
  gap:2px;
  align-items:center;
  justify-content:flex-start;
  line-height:1;
}

.symbol-stars-v23 .star{
  font-size:11px;
  letter-spacing:0;
}

.symbol-stars-v23 .star.on{
  color:#f6c85f;
  text-shadow:0 0 8px rgba(246,200,95,.18);
}

.symbol-stars-v23 .star.off{
  color:#385266;
}

/* -------------------- DRAWER BIGGER -------------------- */

.detail-drawer{
  width:min(560px,100vw) !important;
}

.drawer-head{
  padding:14px 16px !important;
}

.drawer-title-line h2{
  font-size:22px !important;
  font-weight:800 !important;
}

.drawer-title-line span,
.drawer-head small{
  font-size:11.5px !important;
}

.drawer-tabs button{
  font-size:12px !important;
  font-weight:700 !important;
  height:34px !important;
  padding:0 12px !important;
}

.drawer-body{
  padding:16px !important;
}

.drawer-decision strong{
  font-size:21px !important;
  font-weight:800 !important;
}

.drawer-decision span{
  font-size:11.5px !important;
}

.drawer-metric strong{
  font-size:15px !important;
  font-weight:800 !important;
}

.drawer-metric span{
  font-size:10.5px !important;
}

.drawer-block h4{
  font-size:12.5px !important;
  font-weight:800 !important;
}

.drawer-grid-row{
  min-height:42px !important;
  padding:10px 2px !important;
}

.drawer-grid-row span{
  font-size:11px !important;
  color:#91aabd !important;
}

.drawer-grid-row strong{
  font-size:12.5px !important;
  font-weight:800 !important;
  color:#e6f0f7 !important;
}

.warning-box{
  font-size:11px !important;
  line-height:1.85 !important;
}

/* -------------------- ENGINE VIEW -------------------- */

.engine-row{
  min-height:42px !important;
  display:grid !important;
  align-items:center !important;
  gap:8px !important;
  padding:9px 0 !important;
  border-bottom:1px solid rgba(255,255,255,.05) !important;
}

.engine-label{
  font-size:11px !important;
  font-weight:700 !important;
  color:#c7d9e5 !important;
}

.engine-score-v23{
  font-size:13px !important;
  font-weight:800 !important;
  font-variant-numeric:tabular-nums;
}

.engine-chip-v23{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:52px;
  height:26px;
  padding:0 8px;
  border-radius:7px;
  font-size:11px;
  font-weight:800;
}

.engine-row.engine-good .engine-score-v23,
.engine-row.engine-good .engine-label{ color:var(--ok) !important; }
.engine-row.engine-good .engine-chip-v23{
  background:var(--ok-soft);
  color:var(--ok);
  border:1px solid rgba(79,224,161,.22);
}

.engine-row.engine-mid .engine-score-v23,
.engine-row.engine-mid .engine-label{ color:var(--warn) !important; }
.engine-row.engine-mid .engine-chip-v23{
  background:var(--warn-soft);
  color:var(--warn);
  border:1px solid rgba(231,184,79,.22);
}

.engine-row.engine-bad .engine-score-v23,
.engine-row.engine-bad .engine-label{ color:var(--bad) !important; }
.engine-row.engine-bad .engine-chip-v23{
  background:var(--bad-soft);
  color:var(--bad);
  border:1px solid rgba(239,110,123,.22);
}

.engine-row.engine-neutral .engine-score-v23,
.engine-row.engine-neutral .engine-label{ color:#86a7be !important; }
.engine-row.engine-neutral .engine-chip-v23{
  background:var(--neutral-soft);
  color:#86a7be;
  border:1px solid rgba(125,160,184,.20);
}

/* -------------------- FILTERS / TABS -------------------- */

.view-tabs button,
.filters button,
select{
  font-size:11px !important;
  font-weight:700 !important;
}

/* -------------------- SMALL RESPONSIVE -------------------- */

@media (max-width: 1200px){
  .detail-drawer{
    width:min(520px,100vw) !important;
  }
}




/* =========================================================
   V2.3.1 HONEST SYMBOL INDICATOR
   Stars + semantic decision line
   NO fake historical chart
   ========================================================= */

.sparkline{
  width:auto !important;
  min-width:108px !important;
  height:27px !important;

  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;

  overflow:visible !important;
}


/* completely hide old synthetic SVG chart */

.sparkline-v23{
  display:none !important;
}


/* new symbol quality indicator */

.symbol-quality-v231{
  display:flex;
  align-items:center;
  gap:8px;

  direction:ltr;

  min-width:105px;
}


/* stars */

.symbol-quality-stars-v231{
  display:flex;
  align-items:center;
  gap:1px;

  white-space:nowrap;
}


.symbol-quality-stars-v231 .star{
  font-size:13px;
  line-height:1;

  transition:
    opacity .15s ease;
}


.symbol-quality-stars-v231 .star.on{
  color:#f4c45d;

  text-shadow:
    0 0 6px
    rgba(244,196,93,.18);
}


.symbol-quality-stars-v231 .star.off{
  color:#31495a;

  opacity:.62;
}


/* semantic status line - NOT A CHART */

.symbol-decision-line-v231{
  position:relative;

  width:32px;
  height:3px;

  border-radius:99px;

  background:#294152;

  overflow:hidden;
}


.symbol-decision-line-v231::after{
  content:"";

  position:absolute;

  inset:0 auto 0 0;

  width:var(--decision-strength,65%);

  border-radius:99px;

  background:#7f9bad;
}


/* semantic colors */

.symbol-quality-v231.buy
.symbol-decision-line-v231::after{
  background:#45d99a;
}


.symbol-quality-v231.watch
.symbol-decision-line-v231::after{
  background:#e4b54b;
}


.symbol-quality-v231.trim
.symbol-decision-line-v231::after{
  background:#ed6c79;
}


.symbol-quality-v231.neutral
.symbol-decision-line-v231::after{
  background:#78a3be;
}


/* remove duplicate stars below symbol name */

.symbol-copy >
.symbol-stars-v23{
  display:none !important;
}


/* tooltip-ish hover */

.symbol-quality-v231{
  cursor:default;
}


.symbol-quality-v231:hover
.symbol-quality-stars-v231 .star.on{
  filter:brightness(1.12);
}


/* keep symbol clean */

.symbol-cell{
  gap:10px !important;
}


@media (max-width:1100px){

  .symbol-quality-v231{
    min-width:92px;
    gap:6px;
  }

  .symbol-quality-stars-v231 .star{
    font-size:12px;
  }

  .symbol-decision-line-v231{
    width:25px;
  }

}



/* =========================================================
   V2.3.2 DIRECT SYMBOL + LOWER PANELS FIX
   ========================================================= */

/* final symbol layout */

.symbol-cell-v232{
  display:flex !important;
  align-items:center !important;
  min-width:230px;
}

.symbol-cell-v232 .symbol-copy{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:5px;
}

.symbol-top-v232{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.symbol-top-v232 > strong{
  font-size:16px !important;
  font-weight:800 !important;
}

.symbol-cell-v232 .symbol-copy > span{
  font-size:12px !important;
  opacity:.78;
}

.symbol-quality-v232{
  direction:ltr;
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}

.symbol-stars-v232{
  display:inline-flex;
  align-items:center;
  gap:1px;
}

.symbol-stars-v232 b{
  font-size:13px;
  font-weight:400;
  line-height:1;
}

.symbol-stars-v232 b.on{
  color:#f4c45d;
}

.symbol-stars-v232 b.off{
  color:#314a5d;
}

.symbol-no-stars-v232{
  font-size:9px;
  color:#6f899c;
}

.symbol-strength-v232{
  width:48px;
  height:5px;
  display:inline-block;
  overflow:hidden;
  border-radius:99px;
  background:#183044;
}

.symbol-strength-v232 i{
  height:100%;
  display:block;
  border-radius:99px;
}

.symbol-quality-v232.buy .symbol-strength-v232 i{
  background:#3fd596;
}

.symbol-quality-v232.watch .symbol-strength-v232 i{
  background:#e8bb53;
}

.symbol-quality-v232.risk .symbol-strength-v232 i{
  background:#ef7080;
}

.symbol-quality-v232.neutral .symbol-strength-v232 i{
  background:#789bb3;
}


/* Make sure all old fake sparklines disappear */

.symbol-cell .sparkline,
.symbol-cell .sparkline-v23,
.symbol-cell .sparkline-v231{
  display:none !important;
}


/* drawer typography */

.detail-drawer{
  font-size:15px !important;
}

.drawer-tabs button{
  font-size:12px !important;
}

.drawer-grid-row span{
  font-size:12px !important;
}

.drawer-grid-row strong{
  font-size:14px !important;
}

.drawer-block h4{
  font-size:14px !important;
}


/* lower dashboard sections must not be clipped */

.portfolio-section-v2,
.portfolio-shell-v2,
#portfolioPanelV2,
.portfolio-empty-v2,
.portfolio-metrics-v2{
  display:block;
  visibility:visible !important;
  opacity:1 !important;
  overflow:visible !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
}

.portfolio-empty-v2{
  display:flex !important;
}

.portfolio-metrics-v2{
  display:grid !important;
}

section#portfolio{
  position:relative;
  z-index:1;
  width:100%;
  overflow:visible !important;
}


/* protect lower report panels */

.trust-grid,
.trust-panel,
.news-list,
.health-grid,
.market-ticker{
  overflow:visible;
  min-width:0;
}


/* do not let main page crop sections */

main,
.main,
.workspace{
  min-height:0;
}




/* =========================================================
   V2.3.3 NEWS / CODAL CONTAINMENT FIX
   ========================================================= */

/* News/Codal panel must stay inside its own card */
.news-list{
  max-height:300px !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding-left:4px;
  padding-right:2px;
}

/* individual news rows */
.news-item{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  padding:10px 4px !important;
  border-bottom:1px solid rgba(255,255,255,.05);
}

.news-item:last-child{
  border-bottom:0;
}

/* long titles must wrap instead of escaping */
.news-item-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  min-width:0;
}

.news-item-head strong{
  min-width:0;
  max-width:100%;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
  line-height:1.7 !important;
}

.news-item p{
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
  line-height:1.75 !important;
  margin:5px 0 0 !important;
}

/* make sure the news/codal trust panel clips correctly */
.trust-panel{
  overflow:hidden !important;
}

.trust-panel .news-list{
  overflow-y:auto !important;
}

/* prevent any lower panel from spilling horizontally */
.trust-grid,
.trust-panel,
.news-list,
.news-item,
.news-item-head{
  min-width:0 !important;
  max-width:100% !important;
}

/* remove previous generic rule that made news overflow visible */
.news-list{
  overflow-y:auto !important;
  overflow-x:hidden !important;
}




/* =========================================================
   V2.3.4 RIGHT EDGE / RTL TEXT FIX
   Fix clipped text on the right side in RTL layout
   ========================================================= */

/* give all major panels safe inner padding */
.section-card,
.panel,
.card,
.health-panel,
.report-panel,
.news-panel,
.journal-panel,
.portfolio-section-u2,
.portfolio-panel-u2,
.portfolio-empty-u2,
.portfolio-metrics-u2 {
  padding-inline-start: 14px !important;
  padding-inline-end: 18px !important;
  box-sizing: border-box !important;
}

/* scrollable containers should reserve space for scrollbar */
.table-wrap,
.news-list,
.journal,
.portfolio-section-u2,
.portfolio-panel-u2,
main,
section,
.panel-body {
  scrollbar-gutter: stable both-edges !important;
}

/* keep right side table text away from the edge */
table th,
table td {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  padding-inline-start: 10px !important;
  padding-inline-end: 16px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

/* specifically the symbol / rightmost visible cells in RTL */
table th:last-child,
table td:last-child,
table th:first-child,
table td:first-child {
  padding-inline-end: 18px !important;
  padding-inline-start: 14px !important;
}

/* symbol block on right side */
.symbol-cell,
.symbol-col,
.ticker-cell,
.name-cell,
.asset-cell {
  padding-inline-end: 18px !important;
  min-width: 0 !important;
  overflow: visible !important;
}

/* allow right-side labels to wrap cleanly */
.symbol-cell strong,
.symbol-cell small,
.name-cell strong,
.name-cell small,
.asset-cell strong,
.asset-cell small,
.report-panel strong,
.report-panel span,
.report-panel small,
.card strong,
.card span,
.card small {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  line-height: 1.8 !important;
}

/* lower right report card text fix */
.system-report,
.report-box,
.report-card,
.snapshot-card {
  padding-inline-end: 18px !important;
  padding-inline-start: 14px !important;
  overflow: hidden !important;
}

.system-report *,
.report-box *,
.report-card *,
.snapshot-card * {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* headings on right side should be more readable */
.section-title,
.panel-title,
.card-title,
.report-title {
  line-height: 1.9 !important;
  padding-inline-end: 6px !important;
}

/* if some rows are clipped by hidden overflow, relax them */
tr, td, th {
  overflow: visible !important;
}




/* =========================================================
   V2.3.5 DRAWER CLOSED-STATE FIX
   Drawer must occupy ZERO visual space when closed
   ========================================================= */

.detail-drawer{
  position:fixed !important;
  top:0 !important;
  right:0 !important;
  bottom:0 !important;

  width:min(560px,100vw) !important;
  max-width:100vw !important;

  z-index:1200 !important;

  background:#071725 !important;

  transform:translateX(101%) !important;

  visibility:hidden !important;
  opacity:0 !important;

  pointer-events:none !important;

  overflow:hidden !important;

  transition:
    transform .18s ease,
    opacity .15s ease,
    visibility 0s linear .18s !important;
}


/* drawer is visible ONLY when explicitly open */

.detail-drawer.open{
  transform:translateX(0) !important;

  visibility:visible !important;
  opacity:1 !important;

  pointer-events:auto !important;

  overflow-y:auto !important;

  transition:
    transform .18s ease,
    opacity .15s ease !important;
}


/* hidden aria state is extra protection */

.detail-drawer[aria-hidden="true"]{
  transform:translateX(101%) !important;
  visibility:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
}


/* backdrop */

.drawer-backdrop{
  position:fixed !important;
  inset:0 !important;

  z-index:1190 !important;

  background:rgba(0,10,18,.62) !important;
}


.drawer-backdrop[hidden]{
  display:none !important;
}


/* closed drawer must never influence page width */

body,
html{
  overflow-x:hidden !important;
}


main{
  width:100% !important;
  max-width:100% !important;
  margin-right:0 !important;
  padding-right:0 !important;
}


/* drawer close button only belongs to open drawer */

.detail-drawer:not(.open) #drawerClose{
  display:none !important;
}


.detail-drawer.open #drawerClose{
  display:inline-flex !important;
}


/* =========================================================
   V2.3.6 MAIN WIDTH / LEFT SIDEBAR FIX
   Undo the 100%-width rule that pushed content under sidebar
   ========================================================= */

main {
  width:auto !important;
  max-width:none !important;
  min-width:0 !important;
  flex:1 1 auto !important;
}

/* Do not reserve fake scrollbar space on both sides of main */
main,
section {
  scrollbar-gutter:auto !important;
}

/* Workspace/table must shrink inside available area */
.workspace,
.workspace-header,
.table-wrap,
.decision-table {
  min-width:0 !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

/* View tabs must remain visible and wrap instead of going under sidebar */
.view-tabs {
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  gap:6px !important;
  min-width:0 !important;
  overflow:visible !important;
}

/* Keep left edge safely away from sidebar */
.workspace {
  overflow:visible !important;
}

/* horizontal scrolling belongs to table, not whole page */
.table-wrap {
  overflow-x:auto !important;
  overflow-y:auto !important;
}

/* Drawer remains fully detached from layout */
.detail-drawer {
  position:fixed !important;
}



/* =========================================================
   P1-9 MARKET PULSE RESPONSIVE WIDTH FIX
   Keep pulse cards inside the main workspace and prevent
   overlap with the left sidebar at medium desktop widths.
   ========================================================= */

.market-section {
  min-width:0 !important;
  max-width:100% !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
}

.market-ticker {
  width:auto !important;
  max-width:calc(100% - 32px) !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}

/* At medium desktop widths, cards wrap instead of extending
   underneath the fixed sidebar. */
@media (max-width:1400px) {
  .market-ticker {
    display:flex !important;
    flex-wrap:wrap !important;
    overflow-x:hidden !important;
    overflow-y:visible !important;
  }

  .market-card {
    flex:1 1 140px !important;
    min-width:130px !important;
    max-width:none !important;
    box-sizing:border-box !important;
  }
}

@media (max-width:850px) {
  .market-ticker {
    margin-left:10px !important;
    margin-right:10px !important;
    max-width:calc(100% - 20px) !important;
  }

  .market-card {
    flex:1 1 125px !important;
    min-width:120px !important;
  }
}

/* P2-15: measurable density modes */

/* Compact = dense terminal-style view */
body:not(.density-comfortable) .decision-table th,
body:not(.density-comfortable) .decision-table td {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

body:not(.density-comfortable) .decision-table tbody tr {
  height: 34px;
}

body:not(.density-comfortable) .decision-table td {
  line-height: 1.25;
}

body:not(.density-comfortable) .metric-row,
body:not(.density-comfortable) .drawer-grid-row {
  padding-top: 5px;
  padding-bottom: 5px;
}

/* Comfortable = visibly more breathing room */
body.density-comfortable .decision-table th,
body.density-comfortable .decision-table td {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

body.density-comfortable .decision-table tbody tr {
  height: 48px;
}

body.density-comfortable .decision-table td {
  line-height: 1.55;
}

body.density-comfortable .metric-row,
body.density-comfortable .drawer-grid-row {
  padding-top: 9px;
  padding-bottom: 9px;
}

body.density-comfortable .drawer-block {
  padding-top: 14px;
  padding-bottom: 14px;
}

body.density-comfortable .summary-item {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* P2-16: improve readability of explanatory/supporting text */

.brand-copy span,
.sidebar-state span,
.sidebar-state small,
.last-update span,
.summary-item span,
.summary-item small,
.workspace-header p,
.section-heading p,
.panel-head > span,
.symbol-copy span,
.market-card span {
  font-size: 11px !important;
  line-height: 1.55;
}

.page-title p,
.density,
.metric-row span,
.news-item p,
.health-row span,
.health-warning,
.drawer-decision span,
.drawer-metric span,
.engine-label,
.drawer-grid-row span,
.panel-note,
.market-card small {
  font-size: 12px !important;
  line-height: 1.65;
}

.drawer-head small,
.drawer-block .faint,
.empty-state,
.warning-box {
  font-size: 12px !important;
  line-height: 1.7;
}

/* Keep labels readable without enlarging core numeric data too much */
.drawer-block h4 {
  font-size: 12px !important;
}

.drawer-grid-row strong,
.metric-row strong {
  font-size: 12px !important;
}

/* P2-18: sortable table accessibility and visible state */

.decision-table th[data-sort][role="button"] {
  cursor: pointer;
  user-select: none;
}

.decision-table th.sort-active {
  color: var(--green);
}

.decision-table .sort-indicator {
  display: inline-block;
  margin-inline-start: 5px;
  font-size: 9px;
  line-height: 1;
}

.decision-table th[data-sort][role="button"]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  background: rgba(63,213,150,.08);
}


/* ===== V2 LIGHT THEME STABLE OVERRIDE =====
   Presentation only. No decision/API/scoring logic.
   =========================================== */

:root{
  --bg:#f4f7fb;
  --bg-2:#eef3f8;

  --panel:#ffffff;
  --panel-2:#f8fafc;
  --panel-3:#f1f5f9;

  --line:#d7e0e9;
  --line-soft:#e7edf3;

  --text:#172033;
  --muted:#5f6f82;
  --faint:#7c8a99;

  --blue:#2563eb;

  --green:#168a5b;
  --green-soft:#e8f7ef;

  --yellow:#9a6700;
  --yellow-soft:#fff6d8;

  --red:#c43b4d;
  --red-soft:#fdecef;

  --gray:#64748b;
  --gray-soft:#eef2f6;

  --ok:#168a5b;
  --ok-soft:#e8f7ef;

  --warn:#9a6700;
  --warn-soft:#fff6d8;

  --bad:#c43b4d;
  --bad-soft:#fdecef;

  --neutral:#64748b;
  --neutral-soft:#eef2f6;

  --shadow:
    0 6px 22px rgba(15,23,42,.07);
}


/* ---------- PAGE ---------- */

html,
body{
  background:#f4f7fb !important;
  color:#172033 !important;
}

.main,
main,
.app-shell{
  background:#f4f7fb !important;
  color:#172033 !important;
}


/* ---------- SIDEBAR ---------- */

.sidebar{
  background:#ffffff !important;
  border-color:#dfe6ee !important;
  box-shadow:
    2px 0 14px rgba(15,23,42,.04);
}

.brand{
  background:#ffffff !important;
  border-color:#e7edf3 !important;
}

.brand-copy strong{
  color:#172033 !important;
}

.brand-copy span{
  color:#7c8a99 !important;
}

.nav-item{
  color:#5f6f82 !important;
}

.nav-item:hover{
  background:#f1f5f9 !important;
  color:#172033 !important;
}

.nav-item.active{
  background:#eaf2ff !important;
  color:#1d4ed8 !important;
  box-shadow:
    inset 3px 0 #2563eb !important;
}

.sidebar-state{
  background:#f8fafc !important;
  border-color:#e7edf3 !important;
}


/* ---------- TOP / HEADER ---------- */

.topbar,
.market-ticker,
.command-summary{
  background:#ffffff !important;
  border-color:#e0e7ef !important;
}

.page-title h1,
.page-title strong,
.workspace-header h2,
.section-heading h2{
  color:#172033 !important;
}

.page-title p,
.workspace-header p,
.section-heading p,
.last-update,
.last-update span{
  color:#6b7b8d !important;
}


/* ---------- CARDS / PANELS ---------- */

.summary-strip,
.workspace,
.panel,
.market-card,
.drawer-metric,
.drawer-block,
.trust-card,
.command-card{
  background:#ffffff !important;
  border-color:#dce4ec !important;
  box-shadow:
    0 4px 16px rgba(15,23,42,.045) !important;
}

.summary-item{
  background:#ffffff !important;
  border-color:#e7edf3 !important;
}

.summary-item span,
.summary-item small,
.metric-row span,
.drawer-grid-row span,
.drawer-metric span,
.panel-head > span{
  color:#718096 !important;
}

.summary-item strong,
.metric-row strong,
.drawer-grid-row strong,
.drawer-metric strong{
  color:#172033 !important;
}


/* ---------- FILTERS / INPUTS ---------- */

.filters,
.workspace-toolbar{
  background:#f8fafc !important;
  border-color:#e0e7ef !important;
}

input,
select,
textarea{
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#ccd7e2 !important;
}

input:focus,
select:focus,
textarea:focus{
  border-color:#2563eb !important;
  box-shadow:
    0 0 0 3px rgba(37,99,235,.10) !important;
}

button{
  border-color:#d3dde7;
}


/* ---------- TABLE ---------- */

.decision-table{
  background:#ffffff !important;
  color:#172033 !important;
}

.decision-table thead,
.decision-table th{
  background:#eef3f8 !important;
  color:#425466 !important;
  border-color:#dce4ec !important;
}

.decision-table td{
  color:#243247 !important;
  border-color:#e8edf2 !important;
}

.decision-table tbody tr{
  background:#ffffff !important;
}

.decision-table tbody tr:nth-child(even){
  background:#fbfcfe !important;
}

.decision-table tbody tr:hover{
  background:#f1f6fc !important;
}

.decision-table tbody tr.selected{
  background:#e9f3ff !important;
  box-shadow:
    inset -3px 0 #2563eb !important;
}

.symbol-copy strong{
  color:#172033 !important;
}

.symbol-copy span{
  color:#73859a !important;
}


/* ---------- DECISION TONES ---------- */

.tone-buy{
  color:#0f7a4f !important;
  background:#e6f7ee !important;
}

.tone-watch{
  color:#8a5b00 !important;
  background:#fff4cf !important;
}

.tone-risk{
  color:#b52d42 !important;
  background:#fde9ed !important;
}

.tone-neutral{
  color:#526274 !important;
  background:#eef2f6 !important;
}

.score-good{
  color:#168a5b !important;
}

.score-mid{
  color:#9a6700 !important;
}

.score-bad{
  color:#c43b4d !important;
}


/* ---------- ENGINE HEALTH ---------- */

.engine-row{
  border-color:#e7edf3 !important;
}

.engine-row.engine-good{
  background:#f2fbf6 !important;
}

.engine-row.engine-mid{
  background:#fffaf0 !important;
}

.engine-row.engine-bad{
  background:#fff4f5 !important;
}

.engine-row.engine-neutral{
  background:#f6f8fa !important;
}


/* ---------- NEWS / HEALTH ---------- */

.news-item,
.health-row{
  border-color:#e7edf3 !important;
}

.news-item p,
.health-row span{
  color:#66788a !important;
}

.health-warning{
  color:#8a5b00 !important;
  background:#fff8df !important;
}

.health-ring{
  background:
    conic-gradient(
      var(--green) 0 79%,
      #e2e8f0 79% 100%
    ) !important;
}

.health-ring::after{
  background:#ffffff !important;
}


/* ---------- DRAWER ---------- */

.detail-drawer,
.drawer{
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#d7e0e9 !important;
  box-shadow:
    -10px 0 30px rgba(15,23,42,.10) !important;
}

.drawer-head,
.drawer-tabs{
  background:#ffffff !important;
  border-color:#e7edf3 !important;
}

.drawer-tab{
  color:#64748b !important;
}

.drawer-tab.active{
  color:#1d4ed8 !important;
  background:#eaf2ff !important;
}

.drawer-title-line,
.drawer-title-line strong{
  color:#172033 !important;
}

.drawer-title-line span,
.drawer-head small{
  color:#718096 !important;
}

.icon-btn{
  color:#526274 !important;
}


/* ---------- NOTES / WARNINGS ---------- */

.panel-note{
  background:#f8fafc !important;
  color:#5f6f82 !important;
  border-color:#e1e8ef !important;
}


/* ---------- SCROLLBAR ---------- */

::-webkit-scrollbar{
  width:10px;
  height:10px;
}

::-webkit-scrollbar-track{
  background:#eef2f6;
}

::-webkit-scrollbar-thumb{
  background:#c2ccd7;
  border-radius:10px;
  border:2px solid #eef2f6;
}

::-webkit-scrollbar-thumb:hover{
  background:#9eabb8;
}



/* =========================================================
   V2 SOFT LIGHT HARMONY — FINAL VISUAL OVERRIDE
   Presentation only — no logic/API/scoring changes
   ========================================================= */

:root{
  --bg:#edf2f7;
  --bg-2:#e8eef5;

  --panel:#f8fafc;
  --panel-2:#f3f6f9;
  --panel-3:#eef3f7;

  --line:#d5dee8;
  --line-soft:#e3e9ef;

  --text:#1e293b;
  --muted:#64748b;
  --faint:#8290a1;

  --blue:#2463a9;

  --green:#16805c;
  --green-soft:#e8f5ef;

  --yellow:#9a6a00;
  --yellow-soft:#fff5d6;

  --red:#bd3f50;
  --red-soft:#fbecef;

  --gray:#64748b;
  --gray-soft:#edf1f5;

  --ok:#16805c;
  --ok-soft:#e8f5ef;

  --warn:#9a6a00;
  --warn-soft:#fff5d6;

  --bad:#bd3f50;
  --bad-soft:#fbecef;

  --neutral:#64748b;
  --neutral-soft:#edf1f5;
}


/* PAGE */

html,
body,
.app-shell,
.main,
main{
  background:#edf2f7 !important;
  color:#1e293b !important;
}


/* SIDEBAR */

.sidebar{
  background:#f3f6f9 !important;
  border-color:#d4dde7 !important;
  box-shadow:
    2px 0 12px rgba(15,23,42,.04) !important;
}

.brand,
.sidebar-state{
  background:#f3f6f9 !important;
}

.nav-item{
  color:#526477 !important;
}

.nav-item:hover{
  background:#e7edf4 !important;
}

.nav-item.active{
  background:#dfeaf7 !important;
  color:#1e5b99 !important;
}


/* TOP AREA */

.topbar{
  background:#f8fafc !important;
  border-color:#d9e1e9 !important;
}

.market-ticker{
  background:#f7f9fb !important;
  border-color:#dce4eb !important;
}

.command-summary{
  background:#f4f7fa !important;
}


/* MAIN CARDS */

.summary-strip,
.workspace,
.panel,
.market-card,
.command-card{
  background:#f8fafc !important;
  border-color:#d7e0e8 !important;
  box-shadow:
    0 2px 8px rgba(15,23,42,.035) !important;
}

.summary-item{
  background:#f7f9fb !important;
  border-color:#e0e6ec !important;
}


/* REMOVE DARK ISLANDS */

.trust-grid,
.trust-grid > *,
.trust-grid article,
.trust-grid section,
.trust-card,
.trust-card *,
.performance-card,
.performance-panel,
.journal-card,
.journal-panel,
.attribution-card,
.attribution-panel,
.system-health-card,
.system-health-panel{
  border-color:#d9e1e8 !important;
}

.trust-grid > *,
.trust-grid article,
.trust-grid section,
.trust-card,
.performance-card,
.performance-panel,
.journal-card,
.journal-panel,
.attribution-card,
.attribution-panel,
.system-health-card,
.system-health-panel{
  background:#f6f8fb !important;
  color:#1e293b !important;
  box-shadow:
    0 3px 10px rgba(15,23,42,.045) !important;
}


/* FORCE TEXT INSIDE FORMER DARK CARDS */

.trust-grid h1,
.trust-grid h2,
.trust-grid h3,
.trust-grid h4,
.trust-grid strong,
.trust-grid b,
.trust-card h1,
.trust-card h2,
.trust-card h3,
.trust-card h4,
.trust-card strong{
  color:#1e293b !important;
}

.trust-grid span,
.trust-grid p,
.trust-grid small,
.trust-grid label,
.trust-card span,
.trust-card p,
.trust-card small{
  color:#66778a !important;
}


/* INNER ROWS OF TRUST / PERFORMANCE */

.trust-grid .metric-row,
.trust-grid .drawer-grid-row,
.trust-grid .news-item,
.trust-grid .health-row{
  background:transparent !important;
  border-color:#dde5ec !important;
}


/* TABLE */

.workspace-header,
.filters,
.workspace-toolbar{
  background:#f5f8fb !important;
  border-color:#dce4eb !important;
}

.decision-table{
  background:#f8fafc !important;
}

.decision-table thead,
.decision-table th{
  background:#e9eff5 !important;
  color:#45576a !important;
}

.decision-table tbody tr{
  background:#f9fbfc !important;
}

.decision-table tbody tr:nth-child(even){
  background:#f4f7fa !important;
}

.decision-table tbody tr:hover{
  background:#eaf1f8 !important;
}

.decision-table tbody tr.selected{
  background:#e2edf8 !important;
}


/* INPUTS */

input,
select,
textarea{
  background:#f9fbfc !important;
  color:#1e293b !important;
  border-color:#cfd9e3 !important;
}


/* DRAWER */

.detail-drawer,
.drawer{
  background:#f5f8fb !important;
}

.drawer-head,
.drawer-tabs,
.drawer-metric,
.drawer-block{
  background:#f8fafc !important;
  border-color:#dce4eb !important;
}


/* SOFTER STATUS COLORS */

.tone-buy{
  background:#e6f4ed !important;
  color:#147650 !important;
}

.tone-watch{
  background:#fff3cf !important;
  color:#8a6100 !important;
}

.tone-risk{
  background:#f9e8ec !important;
  color:#b3394a !important;
}

.tone-neutral{
  background:#e9eef3 !important;
  color:#536477 !important;
}


/* HEALTH CARDS */

.engine-row.engine-good{
  background:#ebf6f0 !important;
}

.engine-row.engine-mid{
  background:#fff6dd !important;
}

.engine-row.engine-bad{
  background:#faecef !important;
}

.engine-row.engine-neutral{
  background:#edf1f5 !important;
}


/* HEALTH RING */

.health-ring{
  background:
    conic-gradient(
      #16805c 0 79%,
      #d9e2ea 79% 100%
    ) !important;
}

.health-ring::after{
  background:#f6f8fb !important;
}


/* SECTION SEPARATION */

.section-heading{
  border-color:#d9e1e8 !important;
}

.panel-note,
.health-warning{
  background:#fff7df !important;
  border-color:#ead9a4 !important;
}


/* REMOVE ANY ACCIDENTAL DEEP NAVY BACKGROUNDS
   INSIDE THE TRUST/PERFORMANCE AREA */

.trust-grid [style*="background"],
.trust-card [style*="background"]{
  background-color:#f6f8fb !important;
}


/* SCROLLBAR */

::-webkit-scrollbar-track{
  background:#e9eef3 !important;
}

::-webkit-scrollbar-thumb{
  background:#b9c5d1 !important;
  border-color:#e9eef3 !important;
}


/* =========================================================
   V2 VISUAL HIERARCHY V3
   Better readability + semantic colors + structured KPI cards
   Presentation only
   ========================================================= */


/* ---------------------------------------------------------
   1) MAIN REASON — make it actually important
   --------------------------------------------------------- */

.reason-cell{
  max-width:360px !important;
  min-width:210px;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;

  font-size:11.5px !important;
  font-weight:650 !important;
  line-height:1.75 !important;

  color:#41556a !important;
  letter-spacing:-.05px;
}

/* Semantic color follows the actual decision badge in row */

.decision-table tbody tr:has(.tone-buy) .reason-cell{
  color:#147650 !important;
}

.decision-table tbody tr:has(.tone-watch) .reason-cell{
  color:#856000 !important;
}

.decision-table tbody tr:has(.tone-risk) .reason-cell{
  color:#b3394a !important;
}

.decision-table tbody tr:has(.tone-neutral) .reason-cell{
  color:#526579 !important;
}


/* Slight emphasis when row selected */

.decision-table tbody tr.selected .reason-cell{
  font-weight:750 !important;
}


/* ---------------------------------------------------------
   2) TRUST / PERFORMANCE AREA — real card framework
   --------------------------------------------------------- */

.trust-grid{
  gap:12px !important;
}

.trust-panel{
  min-height:225px !important;
  padding:14px !important;

  border:1px solid #d4dee8 !important;
  border-radius:10px !important;

  background:#f8fafc !important;

  box-shadow:
    0 2px 4px rgba(15,23,42,.025),
    0 8px 20px rgba(15,23,42,.035) !important;
}


/* Strong card header */

.panel-head{
  min-height:34px;
  margin:-2px 0 12px !important;
  padding:0 0 10px !important;

  border-bottom:1px solid #dde5ed !important;
}

.panel-head h3{
  margin:0 !important;

  color:#1e293b !important;

  font-size:13px !important;
  font-weight:800 !important;
  line-height:1.4;
}

.panel-head > span{
  color:#728196 !important;

  font-size:9.5px !important;
  font-weight:600;
}


/* ---------------------------------------------------------
   3) SCORECARD / KPI GRID
   --------------------------------------------------------- */

.metric-grid{
  grid-template-columns:1fr 1fr !important;
  gap:8px !important;
}

.metric-row{
  min-height:48px;

  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:center !important;
  gap:4px !important;

  padding:8px 10px !important;

  background:#ffffff !important;

  border:1px solid #e0e7ee !important;
  border-radius:7px !important;
}

.metric-row span{
  color:#718096 !important;

  font-size:9.5px !important;
  font-weight:600 !important;
}

.metric-row strong{
  color:#1e293b !important;

  font-size:14px !important;
  font-weight:800 !important;

  direction:ltr;
  unicode-bidi:isolate;
}


/* First metrics are visually stronger */

.metric-grid .metric-row:nth-child(-n+3) strong{
  font-size:16px !important;
}


/* ---------------------------------------------------------
   4) SYSTEM HEALTH — stronger visual anchor
   --------------------------------------------------------- */

.health-ring-wrap{
  grid-template-columns:132px 1fr !important;
  gap:14px !important;
  align-items:center !important;
}

.health-ring{
  width:116px !important;
  height:116px !important;

  box-shadow:
    inset 0 0 0 1px rgba(22,128,92,.08),
    0 5px 14px rgba(15,23,42,.05);
}

.health-ring::after{
  inset:12px !important;
  background:#f8fafc !important;
}

.health-ring strong{
  font-size:29px !important;
  font-weight:850 !important;
  letter-spacing:-1px;

  color:#147650 !important;
}


/* Health components */

.health-list{
  gap:7px !important;
}

.health-row{
  min-height:26px;

  padding:4px 0 !important;

  border-bottom:1px solid #edf1f4 !important;
}

.health-row:last-child{
  border-bottom:0 !important;
}

.health-row span{
  color:#536579 !important;

  font-size:10.5px !important;
  font-weight:600 !important;
}

.health-row strong,
.health-row b{
  font-size:10.5px !important;
  font-weight:750 !important;
}


/* Health warning / recommendation */

.health-warning{
  margin-top:12px !important;
  padding:9px 10px !important;

  background:#fff7dd !important;

  border:1px solid #ead9a1 !important;
  border-radius:6px !important;

  color:#805b00 !important;

  font-size:10.5px !important;
  font-weight:600 !important;
  line-height:1.75 !important;
}


/* ---------------------------------------------------------
   5) JOURNAL — structured result rows
   --------------------------------------------------------- */

.mini-result{
  grid-template-columns:70px minmax(0,1fr) auto !important;

  min-height:38px;

  padding:7px 4px !important;

  border-bottom:1px solid #e2e8ef !important;
}

.mini-result:last-child{
  border-bottom:0 !important;
}

.mini-result > *{
  min-width:0;
}

.mini-result strong{
  color:#1e293b !important;
  font-weight:750 !important;
}

.mini-result span{
  color:#607185 !important;
  font-size:10px !important;
}


/* ---------------------------------------------------------
   6) ATTRIBUTION / NEWS
   --------------------------------------------------------- */

.news-item{
  padding:9px 3px !important;

  border-bottom:1px solid #e2e8ef !important;
}

.news-item-head{
  gap:10px !important;
}

.news-item-head strong{
  color:#243247 !important;

  font-size:10.5px !important;
  font-weight:750 !important;
  line-height:1.7;
}

.news-item p{
  margin-top:5px !important;

  color:#607185 !important;

  font-size:10.5px !important;
  line-height:1.8 !important;
}


/* ---------------------------------------------------------
   7) ENGINE / HEALTH BARS
   --------------------------------------------------------- */

.engine-row{
  grid-template-columns:95px 1fr 46px 66px !important;

  min-height:34px;

  padding:7px 3px !important;
}

.engine-label{
  color:#536579 !important;

  font-size:10.5px !important;
  font-weight:650 !important;
}

.engine-bar{
  height:7px !important;

  background:#dce4eb !important;

  border-radius:99px !important;
}


/* ---------------------------------------------------------
   8) DECISION PILLS — clearer semantic hierarchy
   --------------------------------------------------------- */

.tone-buy,
.tone-watch,
.tone-risk,
.tone-neutral{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-height:22px;

  padding:3px 9px !important;

  border-radius:5px !important;

  font-size:10px !important;
  font-weight:750 !important;
}

.tone-buy{
  color:#116b49 !important;
  background:#e4f4ec !important;
  border:1px solid #cce9dc !important;
}

.tone-watch{
  color:#805b00 !important;
  background:#fff2c9 !important;
  border:1px solid #f1dfa4 !important;
}

.tone-risk{
  color:#ad3547 !important;
  background:#fae7eb !important;
  border:1px solid #f0ccd3 !important;
}

.tone-neutral{
  color:#506174 !important;
  background:#e9eef3 !important;
  border:1px solid #dbe3ea !important;
}


/* ---------------------------------------------------------
   9) TABLE TYPOGRAPHY
   --------------------------------------------------------- */

.decision-table th{
  font-size:10px !important;
  font-weight:750 !important;
}

.decision-table td{
  font-size:10.5px !important;
}

.symbol-copy strong{
  font-size:13px !important;
  font-weight:800 !important;
}

.symbol-copy span{
  margin-top:3px;
  font-size:9.5px !important;
}


/* ---------------------------------------------------------
   10) SECTION TITLES
   --------------------------------------------------------- */

.section-heading{
  margin-top:20px !important;
  margin-bottom:9px !important;
}

.section-heading h2{
  color:#1e293b !important;

  font-size:15px !important;
  font-weight:850 !important;
}

.section-heading p{
  color:#687a8d !important;

  font-size:10.5px !important;
  line-height:1.6;
}


/* ---------------------------------------------------------
   11) PERFORMANCE EMPTY / INSUFFICIENT EVIDENCE
   --------------------------------------------------------- */

.warning-box,
.panel-note{
  padding:10px 11px !important;

  border:1px solid #eadcae !important;
  border-radius:7px !important;

  background:#fff8e3 !important;

  color:#735600 !important;

  font-size:10.5px !important;
  line-height:1.8 !important;
}


/* ---------------------------------------------------------
   12) RESPONSIVE
   --------------------------------------------------------- */

@media (max-width:1350px){

  .health-ring-wrap{
    grid-template-columns:112px 1fr !important;
  }

  .health-ring{
    width:100px !important;
    height:100px !important;
  }

  .health-ring strong{
    font-size:25px !important;
  }

}

@media (max-width:850px){

  .reason-cell{
    min-width:160px;
    font-size:11px !important;
  }

  .metric-grid{
    grid-template-columns:1fr 1fr !important;
  }

}


/* =========================================================
   NEWS INTELLIGENCE V2
   ========================================================= */

.news-intel-summary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-bottom:12px;
}

.news-intel-summary > div{
  background:#f4f7fa;
  border:1px solid #dce4eb;
  border-radius:7px;
  padding:8px 10px;
}

.news-intel-summary span{
  display:block;
  color:#718096;
  font-size:9px;
  margin-bottom:4px;
}

.news-intel-summary strong{
  color:#1e293b;
  font-size:15px;
  font-weight:800;
}

.news-intel-card{
  padding:11px 10px;
  margin-bottom:9px;

  border:1px solid #dae3eb;
  border-radius:8px;

  background:#ffffff;

  box-shadow:
    0 2px 6px rgba(15,23,42,.035);
}

.news-intel-card:hover{
  border-color:#b9cad9;
  box-shadow:
    0 4px 12px rgba(15,23,42,.055);
}

.news-intel-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}

.news-badges{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}

.news-category-badge,
.news-impact-badge,
.news-scope-badge,
.news-symbol-chip{
  display:inline-flex;
  align-items:center;

  min-height:21px;

  padding:2px 7px;

  border-radius:5px;

  font-size:9px;
  font-weight:700;
}

.news-category-badge{
  color:#315b7d;
  background:#e9f1f8;
  border:1px solid #d3e1ec;
}

.news-impact-positive{
  color:#116b49;
  background:#e5f4ec;
  border:1px solid #cae7d9;
}

.news-impact-negative{
  color:#ad3547;
  background:#fae8eb;
  border:1px solid #efccd3;
}

.news-impact-mixed{
  color:#805b00;
  background:#fff3ce;
  border:1px solid #eedda5;
}

.news-impact-unknown{
  color:#5d6c7b;
  background:#edf1f5;
  border:1px solid #dbe3ea;
}

.news-intel-top time{
  color:#8593a3;
  font-size:8.5px;
  white-space:nowrap;
}

.news-intel-card h4{
  margin:0 0 6px;

  color:#1f2c3d;

  font-size:11.5px;
  font-weight:800;
  line-height:1.75;
}

.news-intel-summary-text{
  margin:0 0 8px;

  color:#53667a !important;

  font-size:10px !important;
  line-height:1.85 !important;
}

.news-intel-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;

  margin-bottom:8px;

  color:#788798;
  font-size:9px;
}

.news-intel-meta strong{
  color:#4a5d70;
}

.news-symbol-list{
  display:flex;
  flex-wrap:wrap;
  gap:5px;

  margin:7px 0;
}

.news-symbol-chip{
  color:#1d5f8f;
  background:#e9f4fb;
  border:1px solid #cfe3f1;
}

.news-scope-badge{
  margin:7px 0;

  color:#6b5a23;
  background:#fff6dc;
  border:1px solid #eadba7;
}

.news-outcome-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:6px;

  margin-top:8px;
}

.news-outcome-grid > div{
  padding:6px 7px;

  text-align:center;

  background:#f7f9fb;
  border:1px solid #e2e8ee;
  border-radius:6px;
}

.news-outcome-grid span{
  display:block;

  color:#7b8998;
  font-size:8.5px;
}

.news-outcome-grid strong{
  display:block;
  margin-top:3px;

  color:#27374a;

  font-size:10.5px;
  font-weight:800;
}

.news-outcome-pending{
  margin-top:8px;
  padding:6px 8px;

  color:#74633b;

  background:#fff9e9;
  border:1px solid #eee1bb;
  border-radius:6px;

  font-size:9px;
}

.news-intel-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;

  margin-top:9px;
  padding-top:8px;

  border-top:1px solid #e8edf2;
}

.news-original-link{
  display:inline-flex;
  align-items:center;

  padding:5px 9px;

  color:#ffffff !important;
  background:#245d89;

  border-radius:5px;

  text-decoration:none !important;

  font-size:9.5px;
  font-weight:700;
}

.news-original-link:hover{
  background:#174b73;
}

.news-shadow-note{
  color:#8a97a5;
  font-size:8.5px;
}

@media (max-width:850px){
  .news-intel-summary,
  .news-outcome-grid{
    grid-template-columns:1fr;
  }

  .news-intel-top,
  .news-intel-actions{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* NEWS PANEL SCROLLBAR — light theme harmony */

#newsList{
  scrollbar-width:thin;
  scrollbar-color:#9fb4c7 #edf2f7;
}

#newsList::-webkit-scrollbar{
  width:7px;
}

#newsList::-webkit-scrollbar-track{
  background:#edf2f7;
  border-radius:10px;
}

#newsList::-webkit-scrollbar-thumb{
  background:#9fb4c7;
  border-radius:10px;
  border:1px solid #edf2f7;
}

#newsList::-webkit-scrollbar-thumb:hover{
  background:#7f9bb3;
}


/* =========================================================
   NEWS SYMBOL IMPACT VIEW
   ========================================================= */

.news-kpi-detail{
  position:relative;
  min-width:0;
}

.news-kpi-detail > summary{
  list-style:none;
  cursor:pointer;

  height:100%;
  padding:8px 10px;

  background:#f4f7fa;
  border:1px solid #dce4eb;
  border-radius:7px;

  transition:.15s ease;
}

.news-kpi-detail > summary::-webkit-details-marker{
  display:none;
}

.news-kpi-detail > summary:hover{
  background:#eaf2f8;
  border-color:#bfd0df;
}

.news-kpi-detail[open] > summary{
  background:#e8f1f8;
  border-color:#abc4d8;
}

.news-kpi-detail > summary span{
  display:block;
  color:#66788a;
  font-size:9px;
  margin-bottom:4px;
}

.news-kpi-detail > summary strong{
  color:#163b59;
  font-size:16px;
  font-weight:850;
}

.news-kpi-expanded{
  position:absolute;
  z-index:50;

  top:calc(100% + 6px);
  right:0;

  width:430px;
  max-height:330px;
  overflow:auto;

  padding:8px;

  background:#ffffff;
  border:1px solid #cfdbe5;
  border-radius:9px;

  box-shadow:
    0 12px 28px rgba(15,23,42,.14);
}

.news-symbol-impact-list{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.news-symbol-impact-row{
  display:grid;
  grid-template-columns:
    minmax(65px,1fr)
    52px
    72px
    72px
    72px;

  align-items:center;
  gap:5px;

  padding:7px 8px;

  background:#f8fafc;
  border:1px solid #e2e8ef;
  border-radius:6px;

  font-size:9px;
}

.news-impact-symbol{
  color:#173b58;
  font-size:10.5px;
}

.impact-up{
  color:#137451 !important;
  font-weight:750;
}

.impact-down{
  color:#b83c4d !important;
  font-weight:750;
}

.impact-flat{
  color:#758496 !important;
}

.news-symbol-cloud{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.news-symbol-chip-large{
  font-size:10px;
  cursor:default;
}

.news-symbol-chip-large small{
  margin-right:5px;
  padding:1px 4px;

  background:#dcebf5;
  border-radius:4px;

  font-size:8px;
}


/* ---------------------------------------------------------
   LIGHT SCROLLBARS — NEWS + SYMBOL/TABLE AREAS
   --------------------------------------------------------- */

#newsList,
.news-kpi-expanded,
.table-wrap,
.table-scroll,
.decision-table-wrap,
.decision-table-container,
.workspace-table,
.workspace{
  scrollbar-width:thin;
  scrollbar-color:#9fb4c7 #edf2f7;
}

#newsList::-webkit-scrollbar,
.news-kpi-expanded::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar,
.decision-table-wrap::-webkit-scrollbar,
.decision-table-container::-webkit-scrollbar,
.workspace-table::-webkit-scrollbar,
.workspace::-webkit-scrollbar{
  width:7px;
  height:7px;
}

#newsList::-webkit-scrollbar-track,
.news-kpi-expanded::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track,
.decision-table-wrap::-webkit-scrollbar-track,
.decision-table-container::-webkit-scrollbar-track,
.workspace-table::-webkit-scrollbar-track,
.workspace::-webkit-scrollbar-track{
  background:#edf2f7;
}

#newsList::-webkit-scrollbar-thumb,
.news-kpi-expanded::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb,
.decision-table-wrap::-webkit-scrollbar-thumb,
.decision-table-container::-webkit-scrollbar-thumb,
.workspace-table::-webkit-scrollbar-thumb,
.workspace::-webkit-scrollbar-thumb{
  background:#9fb4c7;
  border-radius:10px;
  border:1px solid #edf2f7;
}

#newsList::-webkit-scrollbar-thumb:hover,
.news-kpi-expanded::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.table-scroll::-webkit-scrollbar-thumb:hover,
.decision-table-wrap::-webkit-scrollbar-thumb:hover,
.decision-table-container::-webkit-scrollbar-thumb:hover,
.workspace-table::-webkit-scrollbar-thumb:hover,
.workspace::-webkit-scrollbar-thumb:hover{
  background:#7897b0;
}

@media (max-width:850px){
  .news-kpi-expanded{
    width:320px;
  }

  .news-symbol-impact-row{
    grid-template-columns:1fr 45px;
  }

  .news-symbol-impact-row span:nth-child(n+3){
    grid-column:1 / -1;
  }
}


/* =========================================================
   NEWS KPI DETAILS LAYOUT FIX
   Prevent overlapping expanded panels
   ========================================================= */

.news-intel-summary{
  align-items:start;
}

/* Each KPI becomes its own vertical block */
.news-kpi-detail{
  position:relative !important;
  width:100%;
  min-width:0;
}

/* Keep summary as the KPI card */
.news-kpi-detail > summary{
  width:100%;
  box-sizing:border-box;
}

/* Expanded content must stay in document flow */
.news-kpi-expanded{
  position:static !important;

  top:auto !important;
  right:auto !important;
  left:auto !important;

  width:100% !important;
  max-width:none !important;

  margin-top:7px !important;

  max-height:270px;
  overflow:auto;

  box-sizing:border-box;

  box-shadow:none !important;

  border:1px solid #d7e1e9 !important;
  background:#ffffff !important;
}

/* Make opened KPI visually connected to its content */
.news-kpi-detail[open]{
  grid-column:1 / -1;
}

.news-kpi-detail[open] > summary{
  border-bottom-left-radius:6px;
  border-bottom-right-radius:6px;
}

/* Give impact rows enough room */
.news-symbol-impact-row{
  grid-template-columns:
    minmax(90px,1.3fr)
    60px
    85px
    85px
    85px !important;

  gap:8px !important;
}

/* Symbol cloud cleaner */
.news-symbol-cloud{
  display:flex !important;
  flex-wrap:wrap !important;
  align-content:flex-start;
  gap:7px !important;
}

/* Prevent inner content from spilling over the card */
#newsList,
.news-intel-card,
.news-kpi-detail,
.news-kpi-expanded{
  min-width:0;
}

/* Better spacing when either details section is open */
.news-kpi-detail[open] + .news-kpi-detail{
  margin-top:8px;
}

@media (max-width:1100px){
  .news-symbol-impact-row{
    grid-template-columns:
      minmax(80px,1fr)
      55px
      75px
      75px
      75px !important;
  }
}

@media (max-width:850px){

  .news-kpi-detail[open]{
    grid-column:auto;
  }

  .news-kpi-expanded{
    max-height:320px;
  }

  .news-symbol-impact-row{
    display:grid !important;
    grid-template-columns:1fr 55px !important;
  }

  .news-symbol-impact-row span:nth-child(n+3){
    grid-column:1 / -1;
  }
}


/* =========================================================
   EXISTING CODAL ATTRIBUTION UI
   ========================================================= */

.codal-existing-panel{
  margin-bottom:12px;
  padding:10px;

  background:#f7fafc;
  border:1px solid #d8e3eb;
  border-radius:9px;
}

.codal-panel-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;

  margin-bottom:9px;
}

.codal-panel-head > div:first-child strong{
  display:block;
  color:#18364f;
  font-size:11px;
}

.codal-panel-head > div:first-child span{
  display:block;
  margin-top:3px;
  color:#7d8d9c;
  font-size:8.5px;
}

.codal-kpis{
  display:flex;
  gap:6px;
}

.codal-kpis > div{
  min-width:72px;

  padding:6px 8px;

  background:#fff;
  border:1px solid #dce5ec;
  border-radius:6px;

  text-align:center;
}

.codal-kpis span{
  display:block;

  color:#738496;
  font-size:8px;
}

.codal-kpis b{
  display:block;

  margin-top:2px;

  color:#163b59;
  font-size:13px;
}

.codal-master-details > summary{
  cursor:pointer;

  padding:7px 9px;

  color:#245d89;
  background:#eaf3f9;

  border:1px solid #cfdee9;
  border-radius:6px;

  font-size:9.5px;
  font-weight:700;
}

.codal-symbol-list{
  max-height:330px;
  overflow:auto;

  margin-top:7px;

  scrollbar-width:thin;
  scrollbar-color:#9fb4c7 #edf2f7;
}

.codal-symbol-list::-webkit-scrollbar{
  width:7px;
}

.codal-symbol-list::-webkit-scrollbar-track{
  background:#edf2f7;
}

.codal-symbol-list::-webkit-scrollbar-thumb{
  background:#9fb4c7;
  border-radius:10px;
}

.codal-symbol-card{
  margin-bottom:6px;

  background:#fff;
  border:1px solid #dce5ec;
  border-radius:7px;
}

.codal-symbol-card > summary{
  display:grid;

  grid-template-columns:
    minmax(60px,1fr)
    minmax(90px,1.6fr)
    minmax(70px,1fr)
    minmax(70px,1fr);

  gap:7px;
  align-items:center;

  cursor:pointer;

  padding:7px 8px;

  font-size:9px;
}

.codal-symbol-card > summary strong{
  color:#173d5b;
  font-size:10.5px;
}

.codal-detail-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:6px;

  padding:8px;

  border-top:1px solid #e6edf2;
}

.codal-detail-grid > div{
  padding:6px;

  background:#f8fafc;
  border-radius:5px;
}

.codal-detail-grid span{
  display:block;

  color:#82909d;
  font-size:8px;
}

.codal-detail-grid strong{
  display:block;

  margin-top:3px;

  color:#34495e;
  font-size:9.5px;
}

.codal-positive{
  color:#11724e !important;
}

.codal-negative{
  color:#b33b4c !important;
}

.codal-neutral{
  color:#657789 !important;
}

.codal-evidence{
  margin:5px 8px;
  padding:7px;

  border-radius:5px;

  font-size:9px;
  line-height:1.8;
}

.codal-evidence.positive{
  color:#17694c;
  background:#edf8f3;
  border:1px solid #d4ebdf;
}

.codal-evidence.negative{
  color:#a63847;
  background:#fdf0f2;
  border:1px solid #f0d8dd;
}

.codal-checked{
  padding:5px 8px 8px;

  color:#8996a3;

  font-size:8px;
}

@media(max-width:850px){

  .codal-panel-head{
    flex-direction:column;
  }

  .codal-kpis{
    width:100%;
  }

  .codal-kpis > div{
    flex:1;
  }

  .codal-symbol-card > summary{
    grid-template-columns:1fr 1fr;
  }

  .codal-detail-grid{
    grid-template-columns:1fr 1fr;
  }
}


/* =========================================================
   TRUST AREA V2 — PERFORMANCE / HEALTH / NEWS / CODAL
   ========================================================= */

.trust-grid{
  display:grid !important;
  grid-template-columns:
    minmax(0,1.25fr)
    minmax(0,.95fr)
    minmax(0,1.05fr)
    minmax(0,1.05fr) !important;

  gap:12px !important;
  align-items:stretch;
}

.trust-panel{
  min-width:0;
  overflow:hidden;
}

.panel-subtitle{
  display:block;
  margin-top:3px;

  color:#8392a1;
  font-size:8.5px;
  font-weight:400;
}


/* ---------------------------------------------------------
   Combined performance + health
   --------------------------------------------------------- */

.combined-system-panel{
  padding:12px !important;
}

.combined-system-layout{
  display:grid;
  grid-template-columns:1fr 1fr;

  gap:10px;
  margin-top:9px;
}

.combined-performance-block,
.combined-health-block{
  min-width:0;

  padding:9px;

  background:#f8fafc;
  border:1px solid #dfe7ee;
  border-radius:8px;
}

.combined-block-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;

  margin-bottom:8px;
  padding-bottom:6px;

  border-bottom:1px solid #e4ebf1;
}

.combined-block-title strong{
  color:#213b52;
  font-size:10px;
}

.combined-block-title span{
  color:#75889a;
  font-size:8.5px;
}

.combined-system-panel .metric-grid{
  grid-template-columns:
    repeat(2,minmax(0,1fr));
}

.combined-system-panel .health-ring-wrap{
  gap:8px;
}

.combined-system-panel .health-ring{
  flex:0 0 92px;
  width:92px;
  height:92px;
}

.combined-system-panel .health-ring strong{
  font-size:24px !important;
}


/* ---------------------------------------------------------
   News-only card
   --------------------------------------------------------- */

.news-only-panel .news-list{
  max-height:390px;
  overflow:auto;
}

.news-only-panel .codal-existing-panel{
  display:none !important;
}


/* ---------------------------------------------------------
   Codal-only card
   --------------------------------------------------------- */

.codal-only-panel{
  background:#ffffff;
}

.codal-list-host{
  max-height:390px;
  overflow:auto;

  scrollbar-width:thin;
  scrollbar-color:#9fb4c7 #edf2f7;
}

.codal-list-host::-webkit-scrollbar{
  width:7px;
}

.codal-list-host::-webkit-scrollbar-track{
  background:#edf2f7;
}

.codal-list-host::-webkit-scrollbar-thumb{
  background:#9fb4c7;
  border-radius:10px;
}

.codal-list-host .codal-existing-panel{
  margin:0 !important;
  padding:0 !important;

  border:0 !important;
  box-shadow:none !important;
  background:transparent !important;
}

.codal-list-host .codal-panel-head{
  padding:8px;

  background:#f7fafc;
  border:1px solid #dce5ec;
  border-radius:8px;

  margin-bottom:8px;
}

.codal-list-host .codal-kpis{
  flex-wrap:wrap;
}

.codal-list-host .codal-kpis > div{
  flex:1;
  min-width:70px;
}

.codal-list-host .codal-master-details > summary{
  padding:8px 9px;
}

.codal-list-host .codal-symbol-list{
  max-height:none !important;
  overflow:visible !important;
}


/* ---------------------------------------------------------
   Make Codal detail denser but clearer
   --------------------------------------------------------- */

.codal-symbol-card > summary{
  grid-template-columns:
    minmax(55px,.8fr)
    minmax(90px,1.6fr)
    minmax(65px,1fr)
    minmax(65px,1fr) !important;
}

.codal-detail-grid{
  grid-template-columns:
    repeat(2,minmax(0,1fr)) !important;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width:1350px){

  .trust-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr)) !important;
  }

  .combined-system-panel{
    grid-column:1 / -1;
  }
}

@media (max-width:850px){

  .trust-grid{
    grid-template-columns:
      1fr !important;
  }

  .combined-system-panel{
    grid-column:auto;
  }

  .combined-system-layout{
    grid-template-columns:1fr;
  }

  .combined-system-panel .health-ring-wrap{
    flex-direction:column;
    align-items:center;
  }
}


/* =========================================================
   TRUST AREA FINAL LAYOUT FIX
   ========================================================= */

/* Desktop: combined system full width, 3 cards below */
.trust-grid{
  display:grid !important;
  grid-template-columns:
    repeat(3,minmax(0,1fr)) !important;

  gap:14px !important;
  align-items:stretch !important;
}

/* Combined system gets its own full row */
.combined-system-panel{
  grid-column:1 / -1 !important;

  min-height:auto !important;
  padding:14px !important;
}

/* Two clean halves inside combined panel */
.combined-system-layout{
  display:grid !important;
  grid-template-columns:
    minmax(0,1.15fr)
    minmax(0,.85fr) !important;

  gap:14px !important;
  align-items:stretch !important;
}

/* Performance area */
.combined-performance-block,
.combined-health-block{
  min-width:0 !important;
  padding:12px !important;

  background:#f8fafc !important;
  border:1px solid #dce5ec !important;
  border-radius:9px !important;
}

/* Make scorecard breathe */
.combined-system-panel .metric-grid{
  display:grid !important;
  grid-template-columns:
    repeat(4,minmax(0,1fr)) !important;

  gap:8px !important;
}

/* Health arrangement */
.combined-system-panel .health-ring-wrap{
  display:grid !important;
  grid-template-columns:
    125px minmax(0,1fr) !important;

  gap:14px !important;
  align-items:center !important;
}

.combined-system-panel .health-ring{
  width:118px !important;
  height:118px !important;
  flex:none !important;
  margin:auto !important;
}

.combined-system-panel .health-ring strong{
  font-size:29px !important;
  line-height:1 !important;
  font-weight:850 !important;
}

/* Health list: stop crushing text */
.combined-system-panel .health-list{
  min-width:0 !important;
  width:100% !important;
}

.combined-system-panel .health-list > *{
  min-width:0 !important;
}

/* Prevent warning block getting squeezed */
.combined-system-panel .health-warning,
.combined-system-panel .panel-note{
  margin-top:9px !important;
  line-height:1.8 !important;
}

/* All lower cards same visual height */
.trust-panel:not(.combined-system-panel){
  min-height:430px !important;
}

/* Results / News / Codal headers */
.trust-panel .panel-head{
  min-height:42px;
  align-items:flex-start !important;
}

/* Cleaner content areas */
.news-only-panel .news-list,
.codal-list-host{
  max-height:365px !important;
  overflow:auto !important;
}

/* Card borders more consistent */
.trust-panel{
  border:1px solid #d8e2ea !important;
  border-radius:10px !important;
  box-shadow:
    0 2px 8px rgba(15,23,42,.035) !important;
}

/* Codal should not collapse */
.codal-only-panel,
.codal-list-host{
  min-width:0 !important;
}

.codal-list-host{
  min-height:320px !important;
}

/* News/Kodal scrollbars */
.news-only-panel .news-list,
.codal-list-host{
  scrollbar-width:thin;
  scrollbar-color:#9fb4c7 #edf2f7;
}

.news-only-panel .news-list::-webkit-scrollbar,
.codal-list-host::-webkit-scrollbar{
  width:7px;
}

.news-only-panel .news-list::-webkit-scrollbar-track,
.codal-list-host::-webkit-scrollbar-track{
  background:#edf2f7;
}

.news-only-panel .news-list::-webkit-scrollbar-thumb,
.codal-list-host::-webkit-scrollbar-thumb{
  background:#9fb4c7;
  border-radius:10px;
}

/* Medium screens */
@media (max-width:1350px){

  .trust-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr)) !important;
  }

  .combined-system-panel{
    grid-column:1 / -1 !important;
  }

  .combined-system-panel .metric-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr)) !important;
  }

  .codal-only-panel{
    grid-column:1 / -1;
  }
}

/* Mobile / narrow */
@media (max-width:850px){

  .trust-grid{
    grid-template-columns:1fr !important;
  }

  .combined-system-panel{
    grid-column:auto !important;
  }

  .combined-system-layout{
    grid-template-columns:1fr !important;
  }

  .combined-system-panel .metric-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr)) !important;
  }

  .combined-system-panel .health-ring-wrap{
    grid-template-columns:1fr !important;
  }

  .trust-panel:not(.combined-system-panel){
    min-height:auto !important;
  }

  .codal-only-panel{
    grid-column:auto;
  }
}


/* =========================================================
   CODAL CARD V2
   ========================================================= */

.codal-status-summary{
  display:grid;
  grid-template-columns:
    repeat(4,minmax(0,1fr));

  gap:6px;
  margin:8px 0;
}

.codal-status-stat{
  padding:7px 6px;

  text-align:center;

  background:#fff;
  border:1px solid #dbe5ec;
  border-radius:7px;
}

.codal-status-stat span{
  display:block;
  font-size:8px;
  color:#718292;
}

.codal-status-stat b{
  display:block;
  margin-top:2px;

  font-size:14px;
  color:#20394f;
}

.codal-status-stat.positive{
  background:#edf8f3;
  border-color:#d3eadd;
}

.codal-status-stat.positive b{
  color:#15704c;
}

.codal-status-stat.neutral{
  background:#f4f7f9;
}

.codal-status-stat.context{
  background:#eef5fb;
  border-color:#d7e6f2;
}

.codal-status-stat.context b{
  color:#346b95;
}

.codal-status-stat.insufficient{
  background:#fff8e7;
  border-color:#eedfae;
}

.codal-status-stat.insufficient b{
  color:#9b6a00;
}


/* -----------------------------------------
   Symbol rows
   ----------------------------------------- */

.codal-symbol-card{
  transition:
    border-color .15s ease,
    background .15s ease;
}

.codal-symbol-card.codal-row-evaluated{
  border-right:3px solid #8fb8d3;
}

.codal-symbol-card.codal-row-strong-positive{
  border-right:3px solid #2a9669;
  background:#fbfefd;
}

.codal-symbol-card.codal-row-strong-negative{
  border-right:3px solid #cf5262;
  background:#fffdfd;
}

.codal-symbol-card.codal-row-insufficient{
  border-right:3px solid #d7b15b;
  background:#fffdf7;
}

.codal-symbol-card.codal-row-insufficient > summary{
  opacity:.78;
}

.codal-symbol-card[open]{
  box-shadow:
    0 2px 8px rgba(15,23,42,.05);
}


/* -----------------------------------------
   Better summary readability
   ----------------------------------------- */

.codal-symbol-card > summary{
  min-height:34px;
}

.codal-symbol-card > summary > strong{
  font-weight:800;
  color:#173c5a;
}

.codal-symbol-card > summary > span{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}


/* -----------------------------------------
   Better opened details
   ----------------------------------------- */

.codal-detail-grid{
  background:#fbfcfd;
}

.codal-evidence b{
  display:block;
  margin-bottom:3px;
}


/* -----------------------------------------
   Responsive
   ----------------------------------------- */

@media(max-width:1100px){

  .codal-status-summary{
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }
}

@media(max-width:650px){

  .codal-status-summary{
    grid-template-columns:1fr 1fr;
  }
}


/* =========================================================
   CODAL PRIORITY VIEW
   ========================================================= */

.codal-analysis-section{
  margin-top:9px;
}

.codal-section-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;

  padding:7px 8px;
  margin-bottom:7px;

  background:#f4f8fb;
  border:1px solid #dbe6ee;
  border-radius:7px;
}

.codal-section-title strong{
  display:block;
  color:#173e5b;
  font-size:9.5px;
}

.codal-section-title span{
  display:block;
  margin-top:2px;

  color:#778a9a;
  font-size:8px;
}

.codal-count-badge{
  min-width:28px;
  padding:4px 7px;

  text-align:center;

  border-radius:999px;
  font-weight:800;
  font-size:10px;
}

.codal-count-badge.good{
  color:#116947;
  background:#e4f4ec;
  border:1px solid #cbe6d8;
}


/* Real analyses should be immediately visible */
.codal-analyzed-list{
  max-height:250px !important;
  overflow:auto !important;
  padding-left:2px;
}

/* Make good analyses visually stronger */
.codal-analyzed-list .codal-symbol-card{
  opacity:1 !important;
}

.codal-analyzed-list
.codal-symbol-card > summary{
  background:#ffffff;
}


/* Insufficient data gets demoted */
.codal-insufficient-details{
  margin-top:9px;
}

.codal-insufficient-details > summary{
  display:flex;
  justify-content:space-between;
  align-items:center;

  cursor:pointer;

  padding:7px 9px;

  color:#8a6500;
  background:#fff8e8;

  border:1px solid #eadcae;
  border-radius:7px;

  font-size:9px;
  font-weight:700;
}

.codal-insufficient-details > summary b{
  min-width:25px;
  padding:2px 6px;

  text-align:center;

  color:#8a6500;
  background:#fff;
  border:1px solid #e7d8a7;
  border-radius:999px;
}

.codal-insufficient-list{
  max-height:220px !important;
  overflow:auto !important;

  margin-top:6px;
}

.codal-insufficient-list
.codal-symbol-card{
  opacity:.75;
}

.codal-empty{
  padding:12px;

  text-align:center;

  color:#8493a0;
  background:#fafcfd;

  border:1px dashed #d6e0e7;
  border-radius:7px;

  font-size:9px;
}


/* =========================================================
   UI POLISH V3
   Visual hierarchy / readability only
   ========================================================= */

/* ---------------------------------------------------------
   Global card refinement
   --------------------------------------------------------- */

.trust-panel{
  background:#fff !important;
  border-color:#d8e3eb !important;
}

.trust-panel .panel-head{
  padding-bottom:8px;
  margin-bottom:8px;

  border-bottom:1px solid #e8eef3;
}

.trust-panel .panel-head h3{
  margin:0;

  color:#162f45;
  font-size:12px !important;
  font-weight:850;
}

.trust-panel .panel-head > span{
  color:#71879a;
  font-size:8px;
  font-weight:600;
}

.panel-subtitle{
  margin-top:4px !important;

  color:#7d8e9e !important;
  font-size:8.5px !important;
  line-height:1.7;
}


/* ---------------------------------------------------------
   Latest evaluated results
   --------------------------------------------------------- */

/* Give each result a real row */
#journalList > *{
  margin-bottom:4px;
  padding:6px 7px;

  background:#f9fbfc;
  border:1px solid #e5ebf0;
  border-radius:6px;
}

/* Alternating subtle row tone */
#journalList > *:nth-child(even){
  background:#f5f8fa;
}

/* Symbol/name readability */
#journalList strong,
#journalList b{
  font-weight:800;
}

/* Chips breathe a little */
#journalList .status-chip,
#journalList .badge,
#journalList [class*="chip"]{
  min-width:62px;
  padding:4px 7px !important;

  text-align:center;
  border-radius:5px;
}

/* Returns / numbers should not look secondary */
#journalList .num{
  font-weight:750;
  font-size:9px;
}


/* ---------------------------------------------------------
   News card hierarchy
   --------------------------------------------------------- */

.news-only-panel .news-list{
  padding-left:2px;
  padding-right:2px;
}

.news-only-panel .news-list > *{
  margin-bottom:8px !important;

  border:1px solid #e2e9ef !important;
  border-radius:8px !important;

  background:#fff !important;

  box-shadow:
    0 1px 4px rgba(15,23,42,.025);
}

/* Main news title */
.news-only-panel
.news-list h3,
.news-only-panel
.news-list h4,
.news-only-panel
.news-list strong{
  color:#1d3449;
}

/* News content easier to scan */
.news-only-panel .news-list p{
  color:#5f7385;
  line-height:1.8;
}

/* Source/meta information */
.news-only-panel
.news-list small,
.news-only-panel
.news-list .muted,
.news-only-panel
.news-list .faint{
  color:#8192a1 !important;
}

/* Read original news button */
.news-only-panel a,
.news-only-panel button{
  border-radius:5px !important;
}


/* ---------------------------------------------------------
   Codal readability
   --------------------------------------------------------- */

.codal-panel-head{
  padding:8px 9px !important;
}

.codal-panel-head strong{
  font-size:10.5px !important;
}

.codal-panel-head span{
  line-height:1.6;
}

.codal-status-summary{
  margin-top:9px !important;
  margin-bottom:9px !important;
}

.codal-status-stat{
  min-height:46px;

  display:flex;
  flex-direction:column;
  justify-content:center;
}

.codal-status-stat span{
  font-size:8.5px !important;
}

.codal-status-stat b{
  font-size:15px !important;
}

.codal-section-title{
  padding:8px 9px !important;
}

.codal-section-title strong{
  font-size:10px !important;
}

.codal-symbol-card > summary{
  padding:8px 9px !important;
  min-height:38px !important;
}

.codal-symbol-card > summary strong{
  font-size:10.5px !important;
}

.codal-symbol-card > summary span{
  font-size:8.5px;
}

.codal-detail-grid > div{
  min-height:49px;

  display:flex;
  flex-direction:column;
  justify-content:center;
}

.codal-detail-grid span{
  font-size:8px !important;
}

.codal-detail-grid strong{
  font-size:9.5px !important;
}


/* ---------------------------------------------------------
   Combined health + scorecard
   --------------------------------------------------------- */

.combined-system-panel{
  background:#ffffff !important;
}

.combined-block-title{
  padding-bottom:7px !important;
}

.combined-block-title strong{
  font-size:10.5px !important;
}

.combined-health-block,
.combined-performance-block{
  background:#fbfcfd !important;
}

.combined-system-panel .health-list > *{
  padding-top:5px;
  padding-bottom:5px;
}

/* Health score becomes the visual anchor */
.combined-system-panel .health-ring strong{
  font-size:31px !important;
  font-weight:900 !important;
}


/* ---------------------------------------------------------
   Warning / note boxes
   --------------------------------------------------------- */

.panel-note,
.health-warning,
.warning-box{
  border-radius:7px !important;

  font-size:9px;
  line-height:1.85;
}

.panel-note{
  padding:9px 10px !important;
}


/* ---------------------------------------------------------
   Market pulse
   --------------------------------------------------------- */

#market{
  margin-top:8px;
}

.market-strip,
.market-pulse,
[id*="marketPulse"]{
  border-top:1px solid #dce5ec;
}

/* Numeric pulse values clearer */
#market .num{
  font-weight:800;
}


/* ---------------------------------------------------------
   Scrollbars: consistent light theme
   --------------------------------------------------------- */

#journalList,
.news-list,
.codal-list-host,
.codal-symbol-list{
  scrollbar-width:thin;
  scrollbar-color:#a8bccd #edf3f7;
}

#journalList::-webkit-scrollbar,
.news-list::-webkit-scrollbar,
.codal-list-host::-webkit-scrollbar,
.codal-symbol-list::-webkit-scrollbar{
  width:6px;
}

#journalList::-webkit-scrollbar-track,
.news-list::-webkit-scrollbar-track,
.codal-list-host::-webkit-scrollbar-track,
.codal-symbol-list::-webkit-scrollbar-track{
  background:#edf3f7;
  border-radius:8px;
}

#journalList::-webkit-scrollbar-thumb,
.news-list::-webkit-scrollbar-thumb,
.codal-list-host::-webkit-scrollbar-thumb,
.codal-symbol-list::-webkit-scrollbar-thumb{
  background:#a8bccd;
  border-radius:8px;
}


/* ---------------------------------------------------------
   Responsive refinement
   --------------------------------------------------------- */

@media(max-width:1100px){

  .trust-panel .panel-head h3{
    font-size:11px !important;
  }

  .codal-symbol-card > summary{
    grid-template-columns:
      1fr 1fr !important;
  }
}


/* =========================================================
   REAL PERSONAL PORTFOLIO V1
   Compact Light V2
   ========================================================= */

.pf2-loading,
.pf2-empty,
.pf2-error{
  padding:16px;
  border:1px solid #dce6ed;
  background:#fff;
  border-radius:8px;
  color:#657b8d;
  font-size:10px;
}

.pf2-error{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.pf2-error strong{
  color:#a84050;
}

.pf2-error button,
.pf2-toolbar button,
.pf2-login button,
.pf2-alert button{
  border:1px solid #cbd9e3;
  background:#f6f9fb;
  color:#37556c;
  border-radius:6px;
  padding:6px 9px;
  cursor:pointer;
  font:inherit;
}

.pf2-login{
  background:#fff;
  border:1px solid #dce6ed;
  border-radius:9px;
  padding:15px;
}

.pf2-login > div:first-child strong{
  display:block;
  color:#243d52;
  font-size:12px;
}

.pf2-login > div:first-child span{
  display:block;
  margin-top:4px;
  color:#7a8d9d;
  font-size:9px;
}

.pf2-login form{
  display:flex;
  gap:7px;
  margin-top:12px;
  flex-wrap:wrap;
}

.pf2-login input{
  min-width:170px;
  flex:1;
  border:1px solid #d4e0e8;
  background:#fbfcfd;
  border-radius:6px;
  padding:7px 9px;
  font-size:10px;
}

.pf2-login-error{
  color:#b34353;
  font-size:9px;
  margin-top:7px;
}


.pf2-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px;
}

.pf2-toolbar > div:first-child{
  display:flex;
  align-items:center;
  gap:8px;
}

.pf2-toolbar strong{
  color:#233f55;
  font-size:12px;
}

.pf2-toolbar span{
  color:#8193a2;
  font-size:9px;
}

.pf2-toolbar-actions{
  display:flex;
  gap:5px;
}


.pf2-summary-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  border:1px solid #dce6ed;
  background:#fff;
  border-radius:8px;
  overflow:hidden;
  margin-bottom:10px;
}

.pf2-summary-grid > div{
  padding:9px 10px;
  border-left:1px solid #e8eef2;
  min-width:0;
}

.pf2-summary-grid > div:last-child{
  border-left:0;
}

.pf2-summary-grid span{
  display:block;
  color:#7a8e9e;
  font-size:8px;
  margin-bottom:4px;
}

.pf2-summary-grid strong{
  display:block;
  color:#243d52;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pf2-summary-grid .positive,
.pf2-pnl.positive{
  color:#18875f;
}

.pf2-summary-grid .negative,
.pf2-pnl.negative{
  color:#c0495b;
}

.pf2-summary-grid .warning{
  color:#a56b12;
}

.pf2-summary-main{
  background:#f4f9fc;
}


.pf2-actions-section,
.pf2-guardian,
.pf2-history{
  border:1px solid #dce6ed;
  background:#fff;
  border-radius:8px;
  margin-top:9px;
  overflow:hidden;
}

.pf2-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:9px 10px;
  border-bottom:1px solid #e8eef2;
}

.pf2-section-head strong{
  display:block;
  color:#263f54;
  font-size:11px;
}

.pf2-section-head > div > span{
  display:block;
  margin-top:2px;
  color:#8193a2;
  font-size:8px;
}

.pf2-statuses{
  display:flex;
  gap:5px;
}

.pf2-statuses span,
.pf2-unread{
  border-radius:999px;
  padding:3px 7px;
  font-size:8px;
}

.pf2-statuses .danger{
  color:#b8394f;
  background:#fff1f3;
  border:1px solid #f2c9d0;
}

.pf2-statuses .warning{
  color:#98640f;
  background:#fff8e8;
  border:1px solid #ebd39b;
}

.pf2-statuses .good{
  color:#197858;
  background:#edf9f5;
  border:1px solid #bde3d5;
}

.pf2-unread{
  color:#3d607b;
  background:#f3f7fa;
  border:1px solid #d6e1e9;
}


.pf2-card-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  padding:8px;
}

.pf2-card{
  position:relative;
  border:1px solid #dce5eb;
  border-top:3px solid #98afc0;
  border-radius:7px;
  padding:9px;
  min-width:0;
  background:#fbfcfd;
}

.pf2-card.pf2-danger{
  border-top-color:#d85065;
}

.pf2-card.pf2-warning{
  border-top-color:#dba53e;
}

.pf2-card.pf2-swap{
  border-top-color:#4c98cf;
}

.pf2-card.pf2-good{
  border-top-color:#43a87e;
}

.pf2-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
}

.pf2-card-head > div:first-child{
  display:flex;
  align-items:center;
  gap:6px;
}

.pf2-symbol{
  color:#203c52;
  font-size:12px;
}

.pf2-decision{
  padding:3px 6px;
  border-radius:999px;
  font-size:8px;
  border:1px solid #d7e0e7;
  color:#587083;
}

.pf2-decision-danger{
  color:#b6384e;
  border-color:#efc5cc;
  background:#fff1f3;
}

.pf2-decision-warning{
  color:#96620e;
  border-color:#ecd6a5;
  background:#fff8e9;
}

.pf2-decision-swap{
  color:#326f9d;
  border-color:#c5ddec;
  background:#f0f7fb;
}

.pf2-decision-good{
  color:#177556;
  border-color:#c1e2d6;
  background:#eff9f5;
}

.pf2-pnl{
  font-size:11px;
  font-weight:800;
}


.pf2-card-metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
  margin-top:8px;
}

.pf2-card-metrics > div{
  background:#fff;
  border:1px solid #e5ebef;
  border-radius:5px;
  padding:6px;
  min-width:0;
}

.pf2-card-metrics span{
  display:block;
  color:#8494a1;
  font-size:7.5px;
}

.pf2-card-metrics b{
  display:block;
  margin-top:2px;
  color:#334e62;
  font-size:9px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}


.pf2-plan{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:7px;
}

.pf2-plan > span{
  padding:3px 5px;
  border:1px solid #e1e8ed;
  background:#f7f9fb;
  border-radius:5px;
  color:#708493;
  font-size:8px;
}

.pf2-plan b{
  color:#405b70;
}


.pf2-reasons{
  margin-top:7px;
  padding:6px 7px;
  background:#f6f8fa;
  border-radius:5px;
  color:#617789;
  line-height:1.7;
  font-size:8.5px;
}


.pf2-swap{
  margin-top:7px;
  padding:7px;
  border:1px solid #cce4dc;
  background:#f1faf7;
  border-radius:6px;
}

.pf2-swap-head{
  display:flex;
  justify-content:space-between;
  color:#55766b;
  font-size:8px;
}

.pf2-swap-head strong{
  color:#147657;
  font-size:10px;
}

.pf2-swap-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
  margin-top:5px;
}

.pf2-swap-grid span{
  font-size:8px;
  color:#698279;
}

.pf2-swap-grid b{
  color:#365d50;
}


.pf2-alert-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  padding:8px;
}

.pf2-alert{
  border:1px solid #e0e7ec;
  border-right:3px solid #94aabd;
  background:#fbfcfd;
  border-radius:6px;
  padding:7px 8px;
}

.pf2-alert-warning{
  border-right-color:#d7a13b;
}

.pf2-alert-critical{
  border-right-color:#d95065;
}

.pf2-alert-success{
  border-right-color:#43a77e;
}

.pf2-alert > div:first-child{
  display:flex;
  justify-content:space-between;
  gap:7px;
}

.pf2-alert strong{
  color:#324e63;
  font-size:9px;
}

.pf2-alert > div:first-child span{
  color:#8293a0;
  font-size:7.5px;
}

.pf2-alert p{
  margin:5px 0;
  color:#667b8b;
  font-size:8px;
  line-height:1.7;
}

.pf2-alert small{
  color:#8a99a5;
  font-size:7.5px;
}

.pf2-alert button{
  float:left;
  margin-top:4px;
  font-size:7.5px;
  padding:3px 6px;
}


.pf2-history summary{
  cursor:pointer;
  padding:9px 10px;
  color:#344f64;
  font-size:10px;
  font-weight:700;
}

.pf2-history summary span{
  color:#8797a3;
  font-weight:400;
  margin-right:5px;
}

.pf2-history-wrap{
  overflow:auto;
  border-top:1px solid #e8eef2;
}

.pf2-history table{
  width:100%;
  border-collapse:collapse;
  font-size:8.5px !important;
}

.pf2-history th,
.pf2-history td{
  padding:6px 8px !important;
  text-align:right;
  border-bottom:1px solid #edf1f4;
}

.pf2-history th{
  color:#758998;
  background:#f8fafb;
}

.pf2-history td{
  color:#455e71;
}


.pf2-footnote{
  margin-top:7px;
  color:#8a99a5;
  font-size:7.5px;
  text-align:center;
}


@media(max-width:1050px){

  .pf2-summary-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .pf2-card-grid,
  .pf2-alert-list{
    grid-template-columns:1fr;
  }
}

@media(max-width:650px){

  .pf2-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .pf2-card-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}



/* === WORK_BROKER_CARD_V1 === */

.pf2-broker{
  margin:12px 0 14px;
  padding:14px 16px;
  border:1px solid rgba(15,23,42,.10);
  border-radius:12px;
  background:#fff;
}

.pf2-broker-main{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.pf2-broker-title{
  font-size:14px;
  font-weight:800;
  color:#0f172a;
}

.pf2-broker-desc{
  margin-top:4px;
  font-size:11px;
  color:#64748b;
}

.pf2-broker-state{
  flex:0 0 auto;
  padding:5px 9px;
  border-radius:999px;
  background:#f1f5f9;
  color:#475569;
  font-size:11px;
  font-weight:700;
}

.pf2-broker-state.is-ok{
  background:#ecfdf5;
  color:#047857;
}

.pf2-broker-state.is-pending{
  background:#fff7ed;
  color:#c2410c;
}

.pf2-broker-info{
  display:flex;
  flex-wrap:wrap;
  gap:8px 18px;
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid rgba(15,23,42,.06);
  font-size:11px;
  color:#64748b;
}

.pf2-broker-info b{
  color:#334155;
  font-weight:700;
}

.pf2-broker-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:11px;
}

.pf2-broker-btn{
  padding:7px 11px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
  color:#334155;
  font:inherit;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}

.pf2-broker-btn.primary{
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}

.pf2-broker-btn:disabled{
  cursor:not-allowed;
  opacity:.55;
}

.pf2-broker-note{
  font-size:10px;
  color:#94a3b8;
}

.pf2-broker-error{
  margin-top:10px;
  padding:7px 9px;
  border-radius:7px;
  background:#fef2f2;
  color:#b91c1c;
  font-size:10px;
}


/* ===== PERSONAL PORTFOLIO PLAN EDITOR V1 ===== */

.pf2-plan-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:12px;
}

.pf2-plan-edit-btn{
  border:1px solid var(--border,#d7e0ea);
  background:#fff;
  border-radius:10px;
  padding:8px 13px;
  cursor:pointer;
  font:inherit;
}

.pf2-plan-edit-btn:hover{
  background:#f5f8fc;
}

.pf2-plan-warnings{
  margin-top:10px;
}

.pf2-plan-editor-overlay{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(20,30,45,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.pf2-plan-editor{
  width:min(760px,100%);
  max-height:90vh;
  overflow:auto;
  background:#fff;
  border-radius:18px;
  padding:20px;
  box-shadow:0 24px 70px rgba(0,0,0,.18);
}

.pf2-plan-editor-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:18px;
}

.pf2-plan-editor-head strong{
  display:block;
  font-size:1.05rem;
}

.pf2-plan-editor-head small{
  display:block;
  margin-top:5px;
  opacity:.65;
}

.pf2-plan-editor-head button{
  border:0;
  background:transparent;
  font-size:26px;
  cursor:pointer;
}

.pf2-plan-editor-grid{
  display:grid;
  grid-template-columns:
    repeat(2,minmax(0,1fr));
  gap:14px;
}

.pf2-plan-editor label,
.pf2-plan-editor-wide{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.pf2-plan-editor input,
.pf2-plan-editor select,
.pf2-plan-editor textarea{
  width:100%;
  box-sizing:border-box;
  border:1px solid #d7e0ea;
  border-radius:10px;
  padding:10px 11px;
  font:inherit;
  background:#fff;
}

.pf2-plan-editor-wide{
  margin-top:14px;
}

.pf2-plan-editor-message{
  min-height:24px;
  margin-top:14px;
}

.pf2-plan-editor-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:14px;
}

.pf2-plan-editor-actions button{
  border:1px solid #d7e0ea;
  border-radius:10px;
  padding:9px 15px;
  background:#fff;
  cursor:pointer;
  font:inherit;
}

.pf2-plan-editor-actions button.primary{
  background:#132a44;
  color:#fff;
  border-color:#132a44;
}

@media(max-width:700px){
  .pf2-plan-editor-grid{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   UI POLISH V2
   - larger readable typography
   - softer light theme
   - lighter sidebar
   - stronger contrast
   - cleaner portfolio cards / modal
   ========================================================= */

:root{
  --bg-soft: #f4f7fb;
  --bg-card: #ffffff;
  --bg-sidebar: #eef4fb;
  --bg-sidebar-active: #dbeafe;
  --text-main: #17212f;
  --text-soft: #5f6f82;
  --text-faint: #7e8b99;
  --border-soft: #d8e2ee;
  --border-mid: #c6d4e3;
  --primary-soft: #1d4ed8;
  --primary-soft-2: #2563eb;
  --success-soft: #0f9d58;
  --warn-soft: #d97706;
  --danger-soft: #dc2626;
  --shadow-soft: 0 10px 30px rgba(17, 24, 39, .06);
}

html{
  font-size: 15px;
}

body{
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-main);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- global text ---------- */

h1,h2,h3,h4,h5,h6{
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.45;
}

p, span, div, label, small{
  color: inherit;
}

input, select, textarea, button{
  font: inherit;
}

/* ---------- main page ---------- */

main,
.page,
.app-content,
.content,
.content-area,
.dashboard-content{
  background: var(--bg-soft);
  color: var(--text-main);
}

/* ---------- cards / panels ---------- */

.card,
.panel,
.section,
.widget,
.module,
.pf2-card,
.pf2-broker,
.pf2-position,
.pf2-smart-watch,
.pf2-history,
.pf2-summary,
.pf2-health,
.pf2-broker-main{
  background: var(--bg-card) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: 16px !important;
  box-shadow: var(--shadow-soft);
}

.card-header,
.panel-header,
.section-header,
.widget-header{
  border-bottom: 1px solid #eef2f7;
}

/* ---------- typography sizing ---------- */

table,
th,
td{
  font-size: 14px;
}

.badge,
.tag,
.chip{
  font-size: 12px;
  font-weight: 600;
}

button,
.btn{
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea{
  font-size: 14px;
  color: var(--text-main);
}

/* ---------- generic form controls ---------- */

input,
select,
textarea{
  min-height: 42px;
  border: 1px solid var(--border-mid) !important;
  border-radius: 10px;
  background: #fff;
  color: var(--text-main);
  padding: 10px 12px;
  outline: none;
  box-shadow: none;
}

textarea{
  min-height: 92px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder{
  color: #8fa0b4;
}

input:focus,
select:focus,
textarea:focus{
  border-color: #8fb5ff !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ---------- light sidebar override ---------- */

.sidebar,
aside,
.app-sidebar,
.layout-sidebar,
.nav-sidebar,
.side-menu{
  background: var(--bg-sidebar) !important;
  color: var(--text-main) !important;
  border-left: 1px solid #d9e6f2;
  border-right: 1px solid #d9e6f2;
}

.sidebar *,
aside *,
.app-sidebar *,
.layout-sidebar *,
.nav-sidebar *,
.side-menu *{
  color: var(--text-main) !important;
}

.sidebar a,
aside a,
.app-sidebar a,
.layout-sidebar a,
.nav-sidebar a,
.side-menu a{
  color: var(--text-main) !important;
}

.sidebar .active,
.sidebar a.active,
.sidebar a:hover,
aside .active,
aside a.active,
aside a:hover,
.app-sidebar .active,
.app-sidebar a.active,
.app-sidebar a:hover,
.layout-sidebar .active,
.layout-sidebar a.active,
.layout-sidebar a:hover,
.nav-sidebar .active,
.nav-sidebar a.active,
.nav-sidebar a:hover,
.side-menu .active,
.side-menu a.active,
.side-menu a:hover{
  background: var(--bg-sidebar-active) !important;
  color: #0f3d99 !important;
  border-radius: 12px;
}

.sidebar .muted,
aside .muted,
.app-sidebar .muted,
.layout-sidebar .muted,
.nav-sidebar .muted,
.side-menu .muted{
  color: var(--text-soft) !important;
}

/* ---------- portfolio top summary ---------- */

.pf2-summary,
.pf2-broker,
.pf2-health{
  padding: 16px !important;
}

.pf2-summary strong,
.pf2-broker strong,
.pf2-health strong{
  font-size: 16px;
}

.pf2-summary small,
.pf2-broker small,
.pf2-health small{
  font-size: 13px;
  color: var(--text-soft);
}

/* ---------- position cards ---------- */

.pf2-position{
  padding: 16px !important;
  margin-bottom: 14px;
}

.pf2-position h3,
.pf2-position h4,
.pf2-position .title{
  font-size: 16px !important;
  font-weight: 700;
  color: var(--text-main);
}

.pf2-position .meta,
.pf2-position .sub,
.pf2-position .hint,
.pf2-position .caption{
  font-size: 13px !important;
  color: var(--text-soft) !important;
}

.pf2-position .value,
.pf2-position .number{
  font-size: 15px !important;
  font-weight: 600;
}

/* ---------- plan chips / info ---------- */

.pf2-position .chip,
.pf2-position .tag,
.pf2-position .badge{
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px !important;
}

.pf2-position .warning,
.pf2-plan-warnings,
.pf2-warning{
  color: var(--warn-soft);
}

.pf2-position .success,
.pf2-success{
  color: var(--success-soft);
}

.pf2-position .danger,
.pf2-danger{
  color: var(--danger-soft);
}

/* ---------- buttons ---------- */

button,
.btn,
.pf2-plan-edit-btn{
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
}

button.primary,
.btn-primary,
.pf2-plan-editor button.primary{
  background: var(--primary-soft) !important;
  color: #fff !important;
  border: 1px solid var(--primary-soft) !important;
}

button.primary:hover,
.btn-primary:hover,
.pf2-plan-editor button.primary:hover{
  background: var(--primary-soft-2) !important;
}

button.secondary,
.btn-secondary{
  background: #fff !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-mid) !important;
}

/* ---------- modal editor ---------- */

.pf2-plan-editor-overlay{
  backdrop-filter: blur(2px);
}

.pf2-plan-editor{
  width: min(860px, 96vw) !important;
  max-height: 90vh;
  padding: 24px !important;
  border-radius: 18px !important;
  border: 1px solid var(--border-soft);
}

.pf2-plan-editor-head{
  margin-bottom: 16px;
}

.pf2-plan-editor h3,
.pf2-plan-editor h4{
  font-size: 20px !important;
  margin: 0 0 6px;
  color: var(--text-main);
}

.pf2-plan-editor .muted,
.pf2-plan-editor small,
.pf2-plan-editor .hint{
  font-size: 13px !important;
  color: var(--text-soft) !important;
}

.pf2-plan-editor label{
  font-size: 14px !important;
  font-weight: 600;
  color: var(--text-main);
}

.pf2-plan-editor input,
.pf2-plan-editor select,
.pf2-plan-editor textarea{
  min-height: 46px;
  font-size: 14px !important;
}

.pf2-plan-editor textarea{
  min-height: 96px;
}

.pf2-plan-editor-actions,
.pf2-plan-actions{
  margin-top: 18px;
  gap: 10px;
}

/* ---------- news area ---------- */

.news-card,
.news-panel,
.news-widget,
.news-list{
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.news-card .title,
.news-widget .title,
.news-list .title{
  font-size: 15px;
  font-weight: 700;
}

.news-card .meta,
.news-widget .meta,
.news-list .meta{
  font-size: 13px;
  color: var(--text-soft);
}

/* ---------- tables ---------- */

table{
  border-collapse: collapse;
}

th{
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  background: #f8fbff;
}

td{
  font-size: 14px;
  color: var(--text-main);
}

th, td{
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
}

/* ---------- mobile / tighter screens ---------- */

@media (max-width: 1100px){
  html{
    font-size: 14px;
  }

  .pf2-plan-editor{
    width: min(96vw, 96vw) !important;
    padding: 18px !important;
  }
}


/* =========================================================
   PORTFOLIO CARD POLISH V3
   Bigger cards, stronger hierarchy, better readability
   ========================================================= */

/* صفحه کلی */
html{
  font-size: 16px;
}

body{
  font-size: 16px;
  line-height: 1.75;
}

/* ناحیه اصلی پرتفوی */
#portfolioBrokerCardV2,
#portfolioPageV2,
.pf2-root,
.pf2-page{
  max-width: 100%;
}

/* اگر گرید کارت‌ها وجود دارد */
.pf2-positions-grid,
.pf2-grid,
.portfolio-grid,
.positions-grid{
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch;
}

/* کارت اصلی هر سهم */
.pf2-position,
.pf2-card,
.portfolio-position-card,
.position-card{
  background: #ffffff !important;
  border: 1px solid #d4dfeb !important;
  border-radius: 18px !important;
  padding: 20px 20px 18px !important;
  min-height: 260px !important;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06) !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* هدر کارت */
.pf2-position-header,
.pf2-card-header,
.position-card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

/* نام نماد */
.pf2-position-title,
.pf2-position h3,
.pf2-position h4,
.pf2-card h3,
.pf2-card h4,
.position-card h3,
.position-card h4{
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
  color: #132238 !important;
  margin: 0 !important;
}

/* زیرعنوان / توضیحات */
.pf2-position .meta,
.pf2-position .sub,
.pf2-position .hint,
.pf2-position .caption,
.pf2-card .meta,
.pf2-card .sub,
.pf2-card .hint{
  font-size: 14px !important;
  color: #5f7288 !important;
  line-height: 1.8 !important;
}

/* بخش آمار و اعداد */
.pf2-position-stats,
.pf2-stats,
.pf2-position-metrics,
.position-card-metrics{
  display: grid !important;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) !important;
  gap: 12px !important;
  margin-top: 8px;
  margin-bottom: 8px;
}

/* باکس هر فیلد */
.pf2-stat,
.pf2-metric,
.metric-box,
.position-card .metric{
  background: #f8fbff !important;
  border: 1px solid #dce7f3 !important;
  border-radius: 12px !important;
  padding: 12px 12px 10px !important;
  min-height: 74px;
}

/* عنوان فیلد */
.pf2-stat label,
.pf2-metric label,
.metric-box label,
.position-card .metric label{
  display: block;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #6b7d90 !important;
  margin-bottom: 6px;
}

/* مقدار فیلد */
.pf2-stat .value,
.pf2-metric .value,
.metric-box .value,
.position-card .metric .value{
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #102033 !important;
  line-height: 1.4;
}

/* چیپ‌ها */
.pf2-position .chip,
.pf2-position .tag,
.pf2-position .badge,
.pf2-card .chip,
.pf2-card .tag,
.pf2-card .badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  background: #f3f7fb !important;
  border: 1px solid #d8e4ef !important;
  color: #334155 !important;
}

/* نوار هشدار / توضیحات برنامه */
.pf2-plan-warnings,
.pf2-position .warning-box,
.pf2-card .warning-box,
.position-card .warning-box{
  background: #fff8ed !important;
  border: 1px solid #f3d7a6 !important;
  color: #9a5b00 !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  line-height: 1.9 !important;
}

/* متن هشدار داخل کارت */
.pf2-position .warning,
.pf2-position .warn,
.pf2-card .warning,
.pf2-card .warn{
  color: #b45309 !important;
  font-size: 14px !important;
  font-weight: 600;
}

/* متن موفقیت */
.pf2-position .success,
.pf2-card .success{
  color: #0f9d58 !important;
  font-weight: 700;
}

/* متن خطر */
.pf2-position .danger,
.pf2-card .danger{
  color: #dc2626 !important;
  font-weight: 700;
}

/* دکمه ویرایش برنامه */
.pf2-plan-edit-btn,
.position-card .edit-plan-btn,
.pf2-position button{
  min-height: 44px !important;
  padding: 10px 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  border: 1px solid #b9cce2 !important;
  background: #f8fbff !important;
  color: #17365d !important;
}

.pf2-plan-edit-btn:hover,
.position-card .edit-plan-btn:hover,
.pf2-position button:hover{
  background: #eaf3ff !important;
  border-color: #8ab4ea !important;
}

/* سکشن اقدامات بعدی / نگهبان هوشمند */
.pf2-smart-watch,
.pf2-next-actions,
.pf2-history,
.pf2-health{
  background: #ffffff !important;
  border: 1px solid #d4dfeb !important;
  border-radius: 16px !important;
  padding: 18px !important;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
}

.pf2-smart-watch h3,
.pf2-next-actions h3,
.pf2-history h3,
.pf2-health h3{
  font-size: 18px !important;
  font-weight: 800 !important;
  margin-bottom: 10px !important;
  color: #132238 !important;
}

/* سطرهای اطلاعاتی داخل کارت‌ها */
.pf2-position table td,
.pf2-position table th,
.pf2-card table td,
.pf2-card table th{
  font-size: 14px !important;
  padding: 10px 8px !important;
}

/* کارت‌ها در مانیتور عریض، نفس بکشند */
@media (min-width: 1400px){
  .pf2-positions-grid,
  .pf2-grid,
  .portfolio-grid,
  .positions-grid{
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr)) !important;
  }

  .pf2-position,
  .pf2-card,
  .portfolio-position-card,
  .position-card{
    min-height: 285px !important;
  }
}

/* موبایل/عرض کمتر */
@media (max-width: 1100px){
  .pf2-positions-grid,
  .pf2-grid,
  .portfolio-grid,
  .positions-grid{
    grid-template-columns: 1fr !important;
  }

  .pf2-position-stats,
  .pf2-stats,
  .pf2-position-metrics,
  .position-card-metrics{
    grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
  }

  .pf2-position,
  .pf2-card,
  .portfolio-position-card,
  .position-card{
    padding: 16px !important;
  }
}


/* =========================================================
   UI BALANCE V4
   Final normalization pass
   ========================================================= */

/* ---------- global readable baseline ---------- */

body{
  font-size:15px !important;
  line-height:1.6 !important;
}

button,
input,
select,
textarea{
  font-size:14px !important;
}

small,
.muted,
.faint{
  font-size:12.5px !important;
}


/* ---------- section hierarchy ---------- */

.section-title,
.page-title,
.panel-title,
.widget-title,
h2{
  font-size:19px !important;
  line-height:1.45 !important;
  font-weight:800 !important;
}

h3{
  font-size:16.5px !important;
  font-weight:800 !important;
}


/* =========================================================
   PORTFOLIO CARDS
   ========================================================= */

.pf2-card{
  min-height:unset !important;
  padding:16px !important;
  gap:10px !important;
  border-radius:14px !important;
}

.pf2-card-head{
  margin-bottom:4px !important;
  padding-bottom:8px !important;
}

.pf2-symbol{
  font-size:18px !important;
  font-weight:900 !important;
  color:#10243b !important;
}

.pf2-decision{
  font-size:12.5px !important;
  font-weight:800 !important;
  padding:5px 10px !important;
}

.pf2-pnl{
  font-size:18px !important;
  font-weight:900 !important;
}


/* ---------- metrics ---------- */

.pf2-card-metrics{
  display:grid !important;
  grid-template-columns:
    repeat(4,minmax(0,1fr)) !important;
  gap:8px !important;
  margin:4px 0 6px !important;
}

.pf2-card-metrics > div{
  min-height:62px !important;
  padding:9px 10px !important;
  border:1px solid #dce5ef !important;
  background:#f8fbfe !important;
  border-radius:10px !important;
}

.pf2-card-metrics span{
  display:block !important;
  font-size:12px !important;
  font-weight:700 !important;
  color:#718096 !important;
  margin-bottom:5px !important;
}

.pf2-card-metrics b{
  display:block !important;
  font-size:15.5px !important;
  font-weight:900 !important;
  color:#15263b !important;
}


/* ---------- personal plan ---------- */

.pf2-plan{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:7px !important;
  margin-top:2px !important;
}

.pf2-plan > span{
  min-height:30px !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:4px !important;
  padding:5px 9px !important;
  border-radius:8px !important;
  border:1px solid #dde6ef !important;
  background:#f8fafc !important;
  font-size:12.5px !important;
  color:#52667d !important;
}

.pf2-plan > span b{
  font-size:13px !important;
  color:#172b43 !important;
}


/* ---------- warnings ---------- */

.pf2-plan-warnings,
.pf2-reasons{
  margin-top:7px !important;
  padding:10px 12px !important;
  border-radius:10px !important;
  line-height:1.75 !important;
}

.pf2-plan-warnings{
  background:#fff8ed !important;
  border:1px solid #f1cf94 !important;
  color:#8c5200 !important;
}

.pf2-plan-warnings > div{
  font-size:13px !important;
  line-height:1.75 !important;
  margin:0 !important;
}

.pf2-plan-warnings > div + div{
  margin-top:6px !important;
  padding-top:6px !important;
  border-top:1px dashed #edcf9c !important;
}

.pf2-reasons > div{
  font-size:13px !important;
}


/* ---------- card action ---------- */

.pf2-plan-actions{
  margin-top:8px !important;
}

.pf2-plan-edit-btn{
  min-height:38px !important;
  padding:7px 13px !important;
  font-size:13.5px !important;
  font-weight:800 !important;
  border-radius:9px !important;
}


/* =========================================================
   PORTFOLIO GUARDIAN
   ========================================================= */

.pf2-smart-watch,
.pf2-health,
.pf2-history{
  padding:14px !important;
}

.pf2-smart-watch h3,
.pf2-health h3,
.pf2-history h3{
  font-size:17px !important;
}

.pf2-smart-watch article,
.pf2-alert,
.guardian-alert{
  padding:11px 12px !important;
  min-height:unset !important;
}

.pf2-smart-watch article strong,
.pf2-alert strong,
.guardian-alert strong{
  font-size:13.5px !important;
}

.pf2-smart-watch article p,
.pf2-alert p,
.guardian-alert p{
  font-size:12.5px !important;
  line-height:1.7 !important;
}


/* =========================================================
   SUMMARY / DASHBOARD CARDS
   ========================================================= */

.summary-card,
.metric-card,
.health-card,
.score-card,
.stat-card{
  padding:12px 14px !important;
  min-height:unset !important;
}

.summary-card strong,
.metric-card strong,
.health-card strong,
.score-card strong,
.stat-card strong{
  font-size:17px !important;
  font-weight:900 !important;
}

.summary-card span,
.metric-card span,
.health-card span,
.score-card span,
.stat-card span{
  font-size:12.5px !important;
}


/* ---------- tables ---------- */

table{
  font-size:13.5px !important;
}

th{
  font-size:12.5px !important;
}

td{
  font-size:13.5px !important;
}

th,
td{
  padding-top:9px !important;
  padding-bottom:9px !important;
}


/* =========================================================
   NEWS / CODAL / RESULTS
   ========================================================= */

.news-card,
.news-item,
.codal-item,
.result-item{
  padding:11px 12px !important;
}

.news-card strong,
.news-item strong,
.codal-item strong,
.result-item strong{
  font-size:13.5px !important;
}

.news-card p,
.news-item p,
.codal-item p,
.result-item p{
  font-size:12.5px !important;
  line-height:1.7 !important;
}


/* =========================================================
   PLAN EDITOR
   ========================================================= */

.pf2-plan-editor{
  width:min(820px,94vw) !important;
  padding:20px !important;
}

.pf2-plan-editor-head strong{
  font-size:18px !important;
}

.pf2-plan-editor label{
  font-size:13px !important;
}

.pf2-plan-editor input,
.pf2-plan-editor select{
  min-height:42px !important;
}

.pf2-plan-editor textarea{
  min-height:84px !important;
}


/* =========================================================
   SIDEBAR HARMONY
   ========================================================= */

.sidebar,
.app-sidebar,
.nav-sidebar{
  background:#eef4fa !important;
  border-color:#d9e4ef !important;
}

.sidebar a,
.app-sidebar a,
.nav-sidebar a{
  font-size:13.5px !important;
  font-weight:600 !important;
}

.sidebar .active,
.app-sidebar .active,
.nav-sidebar .active{
  background:#dceafe !important;
  color:#164a8a !important;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media(max-width:1200px){

  .pf2-card-metrics{
    grid-template-columns:
      repeat(2,minmax(0,1fr)) !important;
  }

}


/* V2 UI clarity: scoped overrides for active components, September 2026. */
:root { --text:#172b43; --muted:#526278; --faint:#607086; }
body { font-family:Tahoma,"Segoe UI",Arial,sans-serif; font-size:15px!important; }
.main, .trust-grid, .trust-panel, .portfolio-shell-v2 { min-width:0; }
.section-heading p, .page-title p, .trust-panel p, .last-update span,
.summary-strip span, .summary-strip small, .market-ticker small,
.decision-table th, .decision-table td, .pf2-section-head span,
.pf2-toolbar span, .pf2-summary-grid span { font-size:13px!important; color:#526278; }
.pf2-card-grid { align-items:start!important; gap:12px!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; }
.pf2-card { min-width:0; height:auto!important; min-height:0!important; padding:16px!important; }
.pf2-card-head { padding-bottom:6px!important; }
.pf2-card-metrics { grid-template-columns:repeat(4,minmax(0,1fr))!important; gap:8px!important; }
.pf2-card-metrics>div { padding:10px 8px!important; min-width:0; }
.pf2-card-metrics span { font-size:12px!important; color:#526278!important; }
.pf2-card-metrics b { font-size:17px!important; overflow-wrap:anywhere; }
.pf2-card-metrics b .pf2-missing, .pf2-card-metrics b .pf2-skeleton { font-size:12px!important; }
.pf2-card-notice { font-size:13px; line-height:1.8; margin-top:10px; color:#684300; }
.pf2-card-notice:empty { display:none; }
.pf2-card-notice span { display:block; }
.pf2-card-detail { border-top:1px solid #dce5ef; margin-top:10px; }
.pf2-card-detail>summary, .pf2-alert-detail>summary { cursor:pointer; padding:10px 0; font-weight:600; color:#234e78; font-size:14px; }
.pf2-card-detail .pf2-plan { margin-top:6px; }
.pf2-broker.pf2-help { padding:10px 14px!important; margin:8px 0!important; border-radius:10px!important; box-shadow:none!important; }
.pf2-help>summary { cursor:pointer; font-size:14px; font-weight:600; }
.pf2-help>summary span { margin-inline-start:12px; font-weight:400; }
.pf2-help p { font-size:14px!important; margin:8px 0!important; }
.pf2-currency { font-size:12px; color:#526278; margin:8px 0; }
.pf2-stage { padding:10px 14px; border-radius:8px; background:#eef3f8; color:#334b62; font-size:14px; }
.pf2-stage-error { background:#fff3e2; color:#754500; }
.pf2-stage button { margin-inline-start:12px; }
.pf2-statuses .neutral { background:#edf2f7!important; color:#526278!important; border:1px solid #d3dce5!important; }
.pf2-skeleton { display:inline-block; background:#edf2f7; border-radius:5px; color:#526278; font-size:12px; padding:3px 6px; }
.pf2-missing { color:#64748b; font-size:12px; font-weight:400; }
.pf2-filter { display:flex; align-items:center; gap:8px; font-size:13px; }
.pf2-filter select { min-height:36px; border:1px solid #cedbea; border-radius:8px; padding:4px 8px; background:white; color:#172b43; }
.pf2-section-head { flex-wrap:wrap; gap:10px; }
.pf2-alert-list { align-items:start; }
.pf2-alert { min-width:0; }
.pf2-alert strong { font-size:15px!important; }
.pf2-alert p { font-size:14px!important; color:#334b62!important; }
.pf2-event-status { display:block; color:#526278; font-size:12px; margin:4px 0; }
.pf2-alert small { display:block; font-size:12px!important; color:#526278!important; }
.pf2-plan b, .pf2-pnl, .pf2-card-metrics b, .pf2-summary-grid strong { unicode-bidi:isolate; }
.market-ticker { display:grid!important; grid-template-columns:repeat(auto-fit,minmax(155px,1fr))!important; width:100%!important; max-width:100%; overflow:visible!important; }
.market-ticker>* { min-width:0!important; width:auto!important; overflow-wrap:anywhere; }
section[id], article[id] { scroll-margin-top:20px; }
button:focus-visible, summary:focus-visible, select:focus-visible { outline:3px solid #2563eb; outline-offset:3px; }
@media(max-width:1100px) {
  .pf2-card-grid { grid-template-columns:1fr!important; }
}
@media(max-width:650px) {
  .pf2-card-metrics { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  .pf2-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  .pf2-alert-list { grid-template-columns:1fr!important; }
  .pf2-toolbar, .pf2-section-head { flex-wrap:wrap!important; gap:10px; }
  .pf2-toolbar-actions { flex-wrap:wrap; }
  .pf2-card { padding:12px!important; }
  .market-ticker { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
}

/* Feed lists: one page scroll, explicit expansion of secondary items. */
#newsList, #codalList, .codal-analyzed-list {
  height:auto!important; max-height:none!important; overflow:visible!important;
}
#news, #codal { height:auto!important; max-height:none!important; overflow:visible!important; }
.pf2-feed-more { width:100%; margin-top:10px; padding:9px; border:1px solid #cbd9e8; border-radius:8px; background:#f3f7fc; color:#234e78; }
.market-ticker { width:auto!important; }

.market-card span, .brand-copy span, .pf2-footnote { font-size:12px!important; color:#526278!important; }
.pf2-summary-grid strong { overflow-wrap:anywhere; }
.pf2-stage-error button { min-height:36px; padding:5px 12px; border:1px solid #c99842; border-radius:6px; background:#fff; color:#754500; }


/* === P03 PORTFOLIO CARD HIERARCHY V1 ===
   Action > Position > Plan > Replacement
   Readability-only overrides. No decision semantics here.
*/

.pf2-symbol{
  font-size:16px !important;
  font-weight:800 !important;
  line-height:1.45;
}

.pf2-decision{
  font-size:13px !important;
  font-weight:800 !important;
  padding:5px 9px !important;
  line-height:1.35;
}

.pf2-pnl{
  font-size:16px !important;
  font-weight:800 !important;
  line-height:1.4;
}

.pf2-card-head > div:first-child{
  gap:9px !important;
  flex-wrap:wrap;
}

.pf2-plan{
  gap:8px !important;
  margin-top:8px !important;
}

.pf2-plan > span{
  font-size:13px !important;
  line-height:1.55;
  padding:6px 8px !important;
}

.pf2-plan b{
  font-size:13.5px !important;
  font-weight:800;
}

.pf2-swap{
  margin-top:10px !important;
  padding:10px 11px !important;
}

.pf2-swap-head{
  font-size:13px !important;
  line-height:1.5;
}

.pf2-swap-head strong{
  font-size:15px !important;
  font-weight:800;
}

.pf2-swap-grid{
  gap:8px !important;
  margin-top:8px !important;
}

.pf2-swap-grid span{
  font-size:13px !important;
  line-height:1.55;
}

.pf2-swap-grid b{
  font-size:13.5px !important;
  font-weight:800;
}

@media(max-width:650px){
  .pf2-symbol{
    font-size:15px !important;
  }

  .pf2-decision{
    font-size:12.5px !important;
  }

  .pf2-pnl{
    font-size:15px !important;
  }

  .pf2-swap-grid{
    grid-template-columns:1fr !important;
  }
}

/* F04H.18 — governed valuation explainability */
.valuation-explainability-f04h18 {
  margin-top: 12px;
}

.valuation-exp-headline-f04h18 {
  margin-bottom: 10px;
  font-weight: 700;
  line-height: 1.9;
}

.valuation-exp-item-f04h18 {
  margin-top: 10px;
}

.valuation-exp-item-f04h18 strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.valuation-exp-item-f04h18 p {
  margin: 0;
  line-height: 1.9;
  color: var(--text-secondary, #c5d3df);
}

.valuation-exp-limitations-f04h18 {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(150,170,190,.25);
  font-size: 11px;
  line-height: 1.9;
  opacity: .78;
}

/* F04H.26 — Persian fundamental context */
.fundamental-context-f04h26 {
  margin-top: 12px;
}

.context-level-f04h26,
.fund-context-level-f04h26 {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(120,150,180,.08);
  line-height: 1.8;
}

.context-level-f04h26 span {
  margin-left: 8px;
  opacity: .72;
}

.fund-context-section-f04h26 {
  margin-top: 12px;
}

.fund-context-section-f04h26 > strong {
  display: block;
  margin-bottom: 5px;
}

.fund-context-section-f04h26 p {
  margin: 0;
  line-height: 2;
}

.fund-context-facts-f04h26,
.fund-context-fact-f04h26 {
  line-height: 1.95;
  margin-top: 4px;
}

.fund-context-unknown-f04h26 {
  margin-top: 14px;
  padding: 10px;
  border: 1px dashed rgba(170,170,170,.25);
  border-radius: 9px;
}

.fund-context-boundary-f04h26 {
  margin-top: 12px;
  font-size: 11px;
  opacity: .76;
}

/* F04H.28 — causal-readiness presentation */
.causal-readiness-f04h28 {
  margin-top: 12px;
}

.causal-readiness-score-f04h28 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(120,150,180,.08);
}

.causal-readiness-section-f04h28 {
  margin-top: 12px;
  line-height: 1.9;
}

.causal-readiness-section-f04h28 > strong {
  display: block;
  margin-bottom: 5px;
}

.causal-readiness-missing-f04h28 {
  opacity: .9;
}

.causal-readiness-note-f04h28 {
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed rgba(170,170,170,.25);
  border-radius: 9px;
  line-height: 1.9;
}

.causal-readiness-conclusion-f04h28 {
  margin-top: 12px;
  line-height: 1.9;
}

.causal-readiness-conclusion-f04h28 p {
  margin: 5px 0 0;
}

.causal-readiness-boundary-f04h28 {
  margin-top: 12px;
  font-size: 11px;
  opacity: .72;
}

/* F04H.30 — historical readiness progress */
.historical-progress-f04h30 {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(170,170,170,.16);
}

.historical-progress-f04h30 > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
  line-height: 1.8;
}

.historical-progress-f04h30 span {
  opacity: .72;
}
