/* MARFA | Preview desktop | October 28 2026
  Fix: Signals readibility (two charts + seven-column paper-linked table)
  and Live Analysis layout consistency. Single palette source, no data edits.
*/
@media (min-width:1181px){
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals{
  --sgl-edge:color-mix(in srgb,var(--marfa-personal-accent,#e8c183) 32%,rgba(175,202,234,.26));
  --sgl-bg:linear-gradient(125deg,rgba(248,251,255,.18),transparent 37%),
   linear-gradient(157deg,
    color-mix(in srgb,var(--marfa-personal-lift,#344257) 37%,rgba(20,33,54,.45)),
    color-mix(in srgb,var(--marfa-personal-deep,#111722) 62%,rgba(9,16,28,.58)));
  --sgl-text:#e5effb;
  --sgl-muted:#b2c4d9;
  color:var(--sgl-text)!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals :is(
 .connected-head,.dk-bar,.connected-card,.connected-empty
 ){
  background:var(--sgl-bg)!important;
  color:var(--sgl-text)!important;
  border:1px solid var(--sgl-edge)!important;
  border-top-color:rgba(239,247,255,.61)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.18),
   0 3px 0 rgba(7,13,24,.67),0 17px 31px rgba(0,0,0,.26)!important;
  border-radius:15px!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-head {
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  padding:18px 21px!important;margin-bottom:15px!important;gap:16px!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-head :is(h1,h2){
  color:#f5f8ff!important;line-height:1.4!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-head p{
  color:var(--sgl-muted)!important;line-height:1.65!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-grid {
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:15px!important;align-items:stretch!important;margin:0 0 18px!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-grid>.connected-card{
  display:flex!important;flex-direction:column!important;
  min-width:0!important;min-height:278px!important;
  padding:17px 20px 14px!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-card h3{
  font-size:15px!important;font-weight:750!important;
  color:#f0f5ff!important;line-height:1.5!important;margin:0 0 15px!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-grid .equity-svg{
  width:100%!important;height:auto!important;min-height:175px!important;
  max-height:215px!important;flex:1!important;
  display:block!important;overflow:visible!important;
  background:rgba(14,24,40,.17)!important;border-radius:9px;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-grid .equity-grid{
  stroke:rgba(164,191,221,.22)!important;stroke-width:1!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-grid .signal-zero{
  stroke:rgba(172,195,222,.38)!important;stroke-width:1!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-grid .equity-line{
  stroke:var(--marfa-personal-accent,#e8c183)!important;
  stroke-width:3!important;stroke-linejoin:round!important;stroke-linecap:round!important;
  filter:none!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-grid .signal-bars{
  display:flex!important;align-items:flex-end!important;
  justify-content:space-evenly!important;gap:9px!important;
  height:185px!important;min-height:185px!important;
  padding:14px 10px 0!important;overflow-x:auto!important;overflow-y:hidden!important;
  background:rgba(14,24,40,.16)!important;border-radius:9px!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .signal-bars>span{
  min-width:42px!important;gap:7px!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .signal-bars :is(small,b){
  font-size:11px!important;color:#dce8f7!important;
  font-variant-numeric:tabular-nums!important;line-height:1.4!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .signal-bars b.up{color:#69e2b5!important}
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .signal-bars b.down{color:#f38ba4!important}
 /* Table: preserve all data, restore legible typography and stable column widths. */
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table-wrap{
  min-width:0!important;width:100%!important;max-width:100%!important;
  padding:0!important;margin-top:5px!important;overflow-x:auto!important;overflow-y:visible!important;
  overscroll-behavior-x:contain!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table{
  border-collapse:separate!important;border-spacing:0!important;
  table-layout:fixed!important;min-width:925px!important;width:100%!important;
  font:500 13px/1.55 Arial,Tahoma,sans-serif!important;
  font-variant-numeric:tabular-nums!important;
  direction:rtl!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table thead{
  background:rgba(90,119,157,.27)!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table :is(th,td){
  padding:13px 12px!important;border:0!important;
  border-bottom:1px solid rgba(179,208,241,.15)!important;
  vertical-align:middle!important;line-height:1.45!important;
  background:transparent!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table th{
  height:50px!important;color:#f0f5ff!important;
  font-size:13px!important;font-weight:750!important;
  text-align:right!important;
  background:rgba(78,105,145,.19)!important;
  position:sticky!important;top:0!important;z-index:2!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td{
  min-height:49px!important;height:49px!important;
  color:#dee8f6!important;font-size:13px!important;
  text-align:right!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table tr:nth-child(even) td{
  background:rgba(121,148,184,.060)!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table tbody tr:hover td{
  background:color-mix(in srgb,var(--marfa-personal-accent,#e8c183) 10%,rgba(55,78,112,.54))!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td.up{
  color:#63dcae!important;font-weight:750!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td.down{
  color:#fa889f!important;font-weight:750!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table th:nth-child(1),
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td:nth-child(1){width:14%!important}
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table th:nth-child(2),
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td:nth-child(2){width:19%!important}
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table th:nth-child(3),
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td:nth-child(3){width:10%!important}
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table th:nth-child(4),
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td:nth-child(4){width:10%!important}
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table th:nth-child(5),
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td:nth-child(5){width:17%!important}
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table th:nth-child(6),
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td:nth-child(6){width:14%!important}
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table th:nth-child(7),
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table td:nth-child(7){width:16%!important}
 /* Compact toolbar, still accessible after sidebar folding. */
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .dk-bar{
  padding:9px 12px!important;margin:0 0 14px!important;gap:9px!important;
  background:rgba(28,41,61,.58)!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-empty {
  color:var(--sgl-muted)!important;font-size:14px!important;line-height:1.7!important;
 }
 /* Keep signals chart/table accessible at narrower desktop widths with no global scroll. */
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table-wrap::-webkit-scrollbar{height:8px}
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #signals .connected-table-wrap::-webkit-scrollbar-thumb{
  background:rgba(156,182,217,.45);border-radius:12px;
 }
 /* Live Analysis screenshot: chart itself should have space; indicators kept separate. */
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #live .mr-market{
  min-height:490px!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #live .mr-market-plot{
  min-height:310px!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #live .mr-market-line{
  max-height:none!important;overflow:visible!important;
  display:flex!important;flex-wrap:wrap!important;
  align-items:center!important;gap:6px!important;
  padding:8px 0 9px!important;white-space:normal!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #live .mr-market-line .mr-data-item{
  font-size:12px!important;line-height:1.4!important;
  letter-spacing:0!important;
 }
 html[data-theme="dark"][data-marfa-palette] body.v7-ui #live .mr-order .mr-spark{
  background:rgba(19,34,54,.15)!important;
 }
}
/* A neutral silver/glass readable table for light mode, never brown/beige. */
@media(min-width:1181px){
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals :is(
 .connected-head,.dk-bar,.connected-card,.connected-empty
 ){
  background:linear-gradient(131deg,rgba(255,255,255,.96),
   color-mix(in srgb,var(--marfa-personal-accent,#e8c183) 9%,#eef3f9))!important;
  border:1px solid rgba(162,185,209,.53)!important;
  color:#22354b!important;
  box-shadow:0 2px 0 rgba(255,255,255,.88),0 12px 25px rgba(57,76,103,.11)!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals :is(h1,h3){color:#1c2f46!important}
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-head p{
  color:#53677e!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-grid {
  grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:15px!important;margin-bottom:18px!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-grid>.connected-card {
  display:flex!important;flex-direction:column!important;min-height:278px!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .equity-grid{
  stroke:rgba(91,116,150,.21)!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .signal-zero{
  stroke:rgba(91,116,150,.4)!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .equity-line{
  stroke:var(--marfa-personal-accent,#e8c183)!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-table-wrap {
  width:100%!important;overflow-x:auto!important;overflow-y:visible!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-table{
  width:100%!important;min-width:925px!important;table-layout:fixed!important;
  font-size:13px!important;border-collapse:separate!important;border-spacing:0!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-table :is(th,td){
  padding:13px 12px!important;height:48px!important;
  color:#24384f!important;border-bottom:1px solid #d7e0eb!important;
  background:transparent!important;white-space:nowrap!important;
  overflow:hidden!important;text-overflow:ellipsis!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-table th{
  position:sticky!important;top:0!important;z-index:2!important;
  color:#253c56!important;background:#e9f0f8!important;font-weight:750!important;
 }
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-table td.up{color:#127958!important}
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-table td.down{color:#b53e5a!important}
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-table tbody tr:nth-child(even) td{background:rgba(96,127,164,.055)!important}
 html[data-theme="light"][data-marfa-palette] body.v7-ui #signals .connected-table tbody tr:hover td{background:rgba(96,127,164,.12)!important}
 html[data-theme="light"][data-marfa-palette] body.v7-ui #live .mr-market-line{white-space:normal!important;overflow:visible!important;max-height:none!important}
 html[data-theme="light"][data-marfa-palette] body.v7-ui #live .mr-market{min-height:490px!important}
 html[data-theme="light"][data-marfa-palette] body.v7-ui #live .mr-market-plot{min-height:310px!important}
}