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

:root{
  --bg:#04140f;
  --bg-deep:#02100c;
  --panel:#0a2c22;
  --panel-strong:#0d382b;
  --line:rgba(159,220,85,.24);
  --line-soft:rgba(255,255,255,.09);
  --text:#f6f8f7;
  --muted:#a1b3ab;
  --green:#9fdc55;
  --green-strong:#75bf3d;
  --mint:#22d39b;
  --gold:#c7a64a;
  --red:#ff707b;
  --blue:#5f9df4;
  --orange:#ffbc5b;
  --white-panel:#f4f7f4;
  --white-text:#12352a;
  --shadow:0 24px 80px rgba(0,0,0,.28);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  color:var(--text);
  background:
    radial-gradient(circle at 10% 10%,rgba(31,130,91,.18),transparent 28%),
    radial-gradient(circle at 85% 0,rgba(159,220,85,.08),transparent 26%),
    var(--bg);
  font-family:"Tajawal",system-ui,sans-serif;
}
button,input,select,textarea{font:inherit}
button,a{transition:.2s ease}
button{cursor:pointer}
a{color:inherit;text-decoration:none}
[hidden]{display:none!important}
.public-header{
  min-height:94px;
  padding:18px clamp(24px,6vw,90px);
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  background:rgba(3,24,18,.82);
}
.public-brand,.sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.public-brand img,.sidebar-brand img{width:50px;height:50px}
.public-brand strong,.public-brand small,.sidebar-brand strong,.sidebar-brand small{display:block}
.public-brand strong{font-size:16px;letter-spacing:1.4px}
.public-brand small{margin-top:3px;color:var(--green);font-size:11px;letter-spacing:1.7px}
.public-actions{display:flex;gap:10px;align-items:center}
.security-chip,.support-link{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 14px;
  color:#d7e3dd;
  font-size:13px;
  font-weight:700;
}
.support-link:hover{background:rgba(159,220,85,.08)}
.auth-shell{
  min-height:calc(100vh - 130px);
  padding:42px clamp(24px,6vw,90px);
  display:grid;
  grid-template-columns:minmax(390px,.78fr) minmax(520px,1.22fr);
  gap:38px;
  direction:ltr;
}
.auth-card,.auth-hero{direction:rtl}
.auth-card{
  min-height:720px;
  padding:38px;
  border-radius:32px;
  background:linear-gradient(180deg,#f6f8f5,#eef3ef);
  color:var(--white-text);
  box-shadow:var(--shadow);
}
.auth-safe-heading{display:flex;align-items:center;gap:12px}
.auth-safe-heading strong,.auth-safe-heading small{display:block}
.auth-safe-heading small{color:#648078;margin-top:3px}
.auth-lock{
  width:46px;height:46px;border-radius:14px;
  display:grid;place-items:center;
  background:#e4efe9;color:#0c6a50;font-size:22px;font-weight:900
}
.auth-tabs{
  margin:30px 0 34px;
  padding:6px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  background:#e5ece8;
  border-radius:15px;
}
.auth-tabs button{
  border:0;border-radius:11px;padding:13px;
  background:transparent;color:#667d74;font-weight:800
}
.auth-tabs button.active{background:#0d674f;color:white;box-shadow:0 8px 22px rgba(13,103,79,.18)}
.auth-panel{display:none}
.auth-panel.active{display:block}
.auth-kicker{margin:0;color:#0d674f;font-size:12px;font-weight:900;letter-spacing:1px}
.auth-panel h1{font-size:34px;margin:9px 0 8px}
.auth-copy{color:#6c8179;line-height:1.75;margin:0 0 24px}
.auth-card label{display:grid;gap:8px;font-size:13px;font-weight:800;margin-bottom:16px}
.input-wrap{position:relative;display:block}
.auth-card input,.auth-card select,.auth-card textarea{
  width:100%;
  border:1px solid #c9d8d1;
  border-radius:13px;
  padding:14px 15px;
  background:#fff;
  color:#173b30;
  outline:0;
}
.input-wrap input{padding-left:44px}
.input-wrap i{position:absolute;left:15px;top:50%;transform:translateY(-50%);font-style:normal;color:#6e8a80}
.phone-field{position:relative;direction:ltr}
.phone-field input{padding-left:78px!important;text-align:left;direction:ltr}
.phone-dial-code{position:absolute;left:15px;top:50%;transform:translateY(-50%);z-index:2;color:#0d674f;font-weight:900;font-size:13px;padding-right:10px;border-right:1px solid #d6e0db;direction:ltr;unicode-bidi:isolate;text-align:left}
.auth-card input:focus,.auth-card select:focus,.auth-card textarea:focus{
  border-color:#0d7b5d;
  box-shadow:0 0 0 3px rgba(13,123,93,.09)
}
.auth-primary{
  width:100%;
  border:0;border-radius:13px;padding:15px 18px;
  display:flex;align-items:center;justify-content:center;gap:12px;
  background:#0d674f;color:white;font-weight:900;font-size:15px
}
.auth-primary:hover{background:#0a7355;transform:translateY(-1px)}
.form-status{min-height:24px;margin:12px 0 0;color:#a15e16;font-size:13px;font-weight:700}
.auth-divider{height:1px;background:#d6e0db;margin:22px 0}
.risk-note{color:#73867e;font-size:11px;line-height:1.7}
.auth-footer-line{display:flex;justify-content:space-between;gap:14px;color:#5b776d;font-size:11px}
.auth-footer-line a{color:#0d674f;font-weight:800}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}
.consent-row{display:flex!important;grid-template-columns:auto 1fr!important;align-items:flex-start;gap:9px!important;color:#657c73}
.consent-row input{width:18px!important;margin-top:2px}
.auth-hero{
  min-height:720px;
  padding:54px 46px 38px;
  border:1px solid var(--line);
  border-radius:32px;
  background:
    linear-gradient(140deg,rgba(159,220,85,.08),transparent 38%),
    linear-gradient(180deg,rgba(10,54,41,.96),rgba(5,34,26,.98));
  box-shadow:var(--shadow);
  overflow:hidden;
}
.hero-brand-line{display:flex;align-items:center;gap:8px;color:var(--green);font-weight:800;font-size:13px}
.hero-live-dot{width:10px;height:10px;border-radius:50%;background:var(--green);box-shadow:0 0 0 7px rgba(159,220,85,.12)}
.hero-product{margin:36px 0 10px;font-weight:800}
.auth-hero h2{max-width:840px;margin:0;font-size:clamp(42px,5vw,72px);line-height:1.18;letter-spacing:-1.8px}
.hero-description{
  margin:28px 0;
  padding:20px 22px;
  border:1px solid var(--line);
  border-radius:16px;
  color:#c0d0c8;
  line-height:1.9;
  font-size:16px
}
.hero-features{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.hero-features article{
  padding:19px;
  border:1px solid var(--line);
  border-radius:17px;
  background:rgba(0,0,0,.09)
}
.hero-features article>span{
  width:42px;height:42px;border-radius:12px;
  display:grid;place-items:center;
  background:rgba(159,220,85,.12);color:var(--green);font-size:20px
}
.hero-features strong{display:block;margin:15px 0 7px}
.hero-features p{margin:0;color:var(--muted);font-size:13px;line-height:1.7}
.hero-trust-row{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0}
.hero-trust-row span{
  padding:8px 11px;border:1px solid var(--line);border-radius:999px;
  color:#c7d5cf;font-size:11px
}
.hero-preview-window{
  margin-top:26px;padding:15px;border:1px solid var(--line);border-radius:18px;background:rgba(0,0,0,.1)
}
.window-top{display:flex;align-items:center;gap:7px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.window-top span{width:8px;height:8px;border-radius:50%;background:#7b9388}
.window-top span:first-child{background:#c7a64a}
.window-top span:nth-child(2){background:#9fdc55}
.window-top b{margin-right:auto;color:#789287;font-size:10px;letter-spacing:1.4px}
.window-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0}
.window-grid div{padding:15px;border:1px solid var(--line);border-radius:13px}
.window-grid small,.window-grid strong{display:block}
.window-grid small{color:#789287;font-size:9px}
.window-grid strong{margin-top:6px;color:var(--green)}
.window-chart{height:135px;border:1px solid var(--line);border-radius:13px;overflow:hidden}
.window-chart svg{width:100%;height:100%}

/* Platform */
.platform-layout{
  min-height:calc(100vh - 36px);
  display:grid;
  grid-template-columns:minmax(0,1fr) 270px;
  direction:ltr
}
.platform-sidebar{
  grid-column:2;grid-row:1;direction:rtl;
  padding:24px 20px;
  background:linear-gradient(180deg,#07271d,#041b14);
  border-left:1px solid var(--line);
  position:sticky;top:0;height:100vh;
  display:flex;flex-direction:column
}
.sidebar-brand{padding:0 4px 24px;border-bottom:1px solid var(--line)}
.sidebar-brand img{width:48px;height:48px}
.sidebar-brand small{color:var(--muted);margin-top:3px}
.sidebar-nav{display:flex;flex-direction:column;gap:8px;margin-top:25px}
.sidebar-nav button{
  border:1px solid transparent;border-radius:14px;padding:13px 14px;
  display:flex;align-items:center;gap:10px;
  background:transparent;color:#c3d0ca;text-align:right;font-weight:800
}
.sidebar-nav button:hover,.sidebar-nav button.active{
  background:rgba(159,220,85,.13);border-color:var(--line);color:var(--green)
}
.sidebar-nav button span{width:23px;text-align:center;font-size:17px}
.sidebar-bottom{margin-top:auto;padding-top:18px;border-top:1px solid var(--line)}
.sidebar-bottom p{color:var(--muted);font-size:12px;line-height:1.65}
.data-source-badge{
  display:flex;justify-content:center;padding:8px 10px;border-radius:999px;font-size:11px;font-weight:900
}
.data-source-badge.preview{color:#ffd078;border:1px solid rgba(255,188,91,.3);background:rgba(255,188,91,.08)}
.data-source-badge.live{color:#52e1b4;border:1px solid rgba(34,211,155,.3);background:rgba(34,211,155,.09)}
.sidebar-logout{
  width:100%;border:1px solid var(--line);border-radius:12px;padding:11px;
  background:transparent;color:#dbe5e0;font-weight:800
}
.platform-main{grid-column:1;grid-row:1;direction:rtl;padding:28px;min-width:0}
.platform-header{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:20px}
.platform-header p{margin:0;color:var(--green);font-size:12px;font-weight:900}
.platform-header h1{margin:4px 0 0;font-size:31px}
.platform-actions{display:flex;align-items:center;gap:10px}
.status-pill{padding:8px 11px;border-radius:999px;color:#51e1b4;background:rgba(34,211,155,.1);border:1px solid rgba(34,211,155,.26);font-size:12px;font-weight:900}
.primary-button,.secondary-button{
  border:0;border-radius:12px;padding:11px 17px;font-weight:900
}
.primary-button{background:linear-gradient(135deg,var(--green),var(--green-strong));color:#082017}
.primary-button:hover{filter:brightness(1.05);transform:translateY(-1px)}
.primary-button:disabled{opacity:.55;cursor:not-allowed;transform:none}
.secondary-button{background:rgba(255,255,255,.05);border:1px solid var(--line-soft);color:#dce6e1}
.full-width{width:100%}
.platform-view{display:none}
.platform-view.active{display:block;animation:fade .2s ease}
@keyframes fade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.panel,.loading-panel,.error-panel{
  border:1px solid var(--line);border-radius:20px;
  background:linear-gradient(180deg,rgba(10,45,35,.96),rgba(5,28,21,.98));
  box-shadow:var(--shadow)
}
.panel{padding:21px}
.loading-panel,.error-panel{
  min-height:320px;padding:24px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center
}
.loading-panel small,.error-panel p{color:var(--muted)}
.spinner{
  width:36px;height:36px;border-radius:50%;border:3px solid rgba(159,220,85,.18);border-top-color:var(--green);animation:spin .8s linear infinite
}
@keyframes spin{to{transform:rotate(360deg)}}
.portfolio-hero{
  margin-bottom:16px;display:flex;align-items:center;justify-content:space-between;gap:22px;
  background:
    linear-gradient(115deg,rgba(159,220,85,.1),transparent 38%),
    linear-gradient(180deg,rgba(10,45,35,.98),rgba(5,28,21,.98))
}
.portfolio-hero>div:first-child>span,.panel-heading>div>span{color:var(--green);font-size:12px;font-weight:900}
.portfolio-hero h2{font-size:27px;margin:6px 0}
.portfolio-hero p{max-width:760px;margin:0;color:var(--muted);line-height:1.8}
.plan-state-card{
  min-width:230px;padding:15px;border-radius:15px;background:rgba(0,0,0,.18);
  display:grid;grid-template-columns:17px 1fr;gap:4px 10px;align-items:center
}
.plan-state-card i{width:11px;height:11px;border-radius:50%;background:var(--red)}
.plan-state-card small{grid-column:2;color:var(--muted)}
.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;margin-bottom:16px}
.metric-grid article{
  padding:16px;border:1px solid var(--line-soft);border-radius:16px;background:rgba(6,35,26,.85)
}
.metric-grid span,.metric-grid small{display:block;color:var(--muted)}
.metric-grid strong{display:block;font-size:22px;margin:7px 0 2px}
.two-column{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}
.panel-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:18px}
.panel-heading h2,.panel-heading h3{margin:4px 0 0}
.panel-heading h3{font-size:20px}
.panel-heading em{
  font-style:normal;padding:7px 10px;border:1px solid var(--line-soft);border-radius:999px;color:#cbd6d1;font-size:11px
}
.allocation-list{display:grid;gap:16px}
.allocation-list label{font-weight:800}
.allocation-list label b{float:left}
.allocation-list progress{width:100%;height:10px;margin-top:8px;accent-color:var(--green)}
.target-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.target-grid div,.compound-grid div,.summary-grid div{
  padding:14px;border:1px solid var(--line-soft);border-radius:13px;background:rgba(0,0,0,.16)
}
.target-grid span,.target-grid small,.compound-grid span,.summary-grid span{display:block;color:var(--muted)}
.target-grid strong{display:block;font-size:22px;margin:8px 0}
.confirmed-profit-total{font-size:31px}
.profit-wallet-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}
.profit-wallet{
  padding:17px;border:1px solid rgba(199,166,74,.3);border-radius:17px;background:rgba(0,0,0,.15)
}
.user-wallet{border-color:rgba(34,211,155,.32)}
.profit-wallet>div:first-child{display:flex;justify-content:space-between;gap:12px}
.profit-wallet>div:first-child b{color:var(--gold)}
.user-wallet>div:first-child b{color:var(--mint)}
.profit-wallet h4{font-size:29px;margin:17px 0 5px}
.profit-wallet p,.profit-wallet>small{color:var(--muted)}
.threshold-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:15px}
.threshold-grid div{padding:10px;border:1px solid var(--line-soft);border-radius:11px;background:rgba(0,0,0,.17)}
.threshold-grid span,.threshold-grid b{display:block}
.threshold-grid span{font-size:10px;color:var(--muted);margin-bottom:4px}

.threshold-progress{display:grid;gap:8px;margin-top:12px}
.threshold-progress progress{width:100%;height:8px;accent-color:var(--green)}
.threshold-progress div{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:10px}
.threshold-progress b{color:#ffd078;font-size:10px}
.compound-grid,.summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.compound-grid{grid-template-columns:repeat(3,1fr)}
.compound-grid strong,.summary-grid strong{display:block;margin-top:7px}
.activity-list{list-style:none;padding:0;margin:0}
.activity-list li{padding:12px 0;border-bottom:1px solid var(--line-soft);font-weight:800}
.activity-list li:last-child{border-bottom:0}
.activity-list small{display:block;color:var(--muted);font-weight:500;margin-top:3px}
.page-panel{min-height:540px}
.page-lead{color:var(--muted);line-height:1.8}
.summary-grid{grid-template-columns:repeat(4,1fr);margin-top:22px}
.table-scroll{overflow:auto}
table{width:100%;border-collapse:collapse;min-width:680px}
th,td{text-align:right;padding:14px;border-bottom:1px solid var(--line-soft)}
th{color:var(--muted);font-size:12px}
.pnl-positive{color:var(--mint)}
.pnl-negative{color:var(--red)}
.broker-account-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin-top:20px}
.harvest-broker-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;max-width:none;margin:22px 0 0;align-items:stretch}
.harvest-broker-card{padding:20px 22px;background:linear-gradient(180deg,rgba(0,0,0,.18),rgba(0,0,0,.10));display:flex;flex-direction:column;height:100%}
.harvest-broker-card header{padding-bottom:14px;border-bottom:1px solid var(--line-soft);min-height:82px}
.harvest-broker-card h3{font-size:22px;letter-spacing:.3px}
.broker-account-card.harvest-broker-card dl.harvest-primary-balance-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}
.harvest-broker-card dl.harvest-primary-balance-row div{min-width:0;min-height:76px;padding:13px 12px;text-align:center;display:flex;flex-direction:column;justify-content:center}
.harvest-broker-card dt{font-size:11px}
.harvest-broker-card dd{font-size:16px;white-space:nowrap}
.harvest-account-detail-row{margin-top:10px;min-height:48px;padding:10px 12px;border:1px solid var(--line-soft);border-radius:12px;background:rgba(0,0,0,.12);display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;color:var(--muted)}
.harvest-account-detail-row strong{color:var(--text);font-size:13px;white-space:nowrap}

/* WEALTHIER_TRADING_HARVEST_OPEN_POSITIONS_VISUAL_V1 */
.harvest-open-positions-heading{margin-top:30px;padding-top:22px;border-top:1px solid var(--line-soft);align-items:flex-end}
.harvest-open-positions-heading>small{color:var(--muted);font-size:11px;font-weight:800;white-space:nowrap}
.harvest-live-summary{margin-top:14px;margin-bottom:2px}
.harvest-open-positions-shell{
  margin-top:20px;
  border:1px solid rgba(159,220,85,.18);
  border-radius:18px;
  background:linear-gradient(180deg,rgba(5,31,24,.82),rgba(2,18,14,.72));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
  overflow:auto;
}
.harvest-open-positions-table{min-width:1120px;border-collapse:separate;border-spacing:0}
.harvest-open-positions-table thead th{
  position:sticky;top:0;z-index:2;
  padding:13px 14px;
  background:rgba(6,38,30,.97);
  color:#9bb7ab;
  border-bottom:1px solid rgba(159,220,85,.18);
  font-size:11px;font-weight:900;white-space:nowrap;
  backdrop-filter:blur(8px)
}
.harvest-open-positions-table tbody td{
  padding:15px 14px;
  border-bottom:1px solid rgba(148,163,184,.10);
  vertical-align:middle;
  white-space:nowrap
}
.harvest-open-positions-table tbody tr:last-child td{border-bottom:0}
.harvest-position-row{transition:background .18s ease,box-shadow .18s ease}
.harvest-position-row:nth-child(even){background:rgba(255,255,255,.012)}
.harvest-position-row:hover{background:rgba(159,220,85,.045);box-shadow:inset 3px 0 0 rgba(159,220,85,.42)}
.position-ticket span{direction:ltr;unicode-bidi:isolate;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:#cbd5e1}
.position-account{min-width:210px}
.position-account strong,.position-account small{display:block}
.position-account strong{font-size:13px;color:#f1f5f9}
.position-account small{margin-top:4px;max-width:220px;overflow:hidden;text-overflow:ellipsis;color:#789287;font-size:10px}
.position-symbol strong{font-size:13px;letter-spacing:.2px;color:#fff}
.position-number{direction:ltr;unicode-bidi:isolate;text-align:right;font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.current-price{color:#72d8e7;font-weight:900}
.position-pnl{font-variant-numeric:tabular-nums;font-weight:900}
.trade-side,.stream-chip{display:inline-flex;align-items:center;justify-content:center;min-width:48px;padding:5px 9px;border-radius:999px;font-size:10px;font-weight:900}
.trade-side.buy{color:#65e5b6;background:rgba(34,211,155,.09);border:1px solid rgba(34,211,155,.20)}
.trade-side.sell{color:#ff8f97;background:rgba(255,112,123,.08);border:1px solid rgba(255,112,123,.20)}
.stream-chip{color:#9fe45d;background:rgba(159,220,85,.07);border:1px solid rgba(159,220,85,.22)}
.harvest-positions-note{margin:13px 2px 0;font-size:11px}
.harvest-open-positions-table .pnl-close-button{min-width:88px}

.broker-account-card{
  padding:17px;border:1px solid var(--line-soft);border-radius:16px;background:rgba(0,0,0,.15)
}
.broker-account-card header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.broker-account-card h3{margin:0}
.broker-account-card p{color:var(--muted);font-size:13px}
.broker-account-card dl{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0 0}
.broker-account-card dl div{padding:9px;border:1px solid var(--line-soft);border-radius:10px}
.broker-account-card dt{color:var(--muted);font-size:10px}
.broker-account-card dd{margin:4px 0 0;font-weight:800}
.connection-chip{
  padding:6px 9px;border-radius:999px;color:#52e1b4;background:rgba(34,211,155,.09);border:1px solid rgba(34,211,155,.26);font-size:10px;font-weight:900
}
.connection-chip.offline{color:#ff9098;background:rgba(255,112,123,.09);border-color:rgba(255,112,123,.25)}
.connection-chip.pending{color:#ffd978;background:rgba(245,185,66,.08);border-color:rgba(245,185,66,.26)}

#brokerAccountsGrid{
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  max-width:980px;margin:18px auto 0;gap:12px;align-items:start
}
#brokerAccountsGrid .broker-account-card{
  min-height:0;padding:14px 15px;border-radius:14px;background:rgba(0,0,0,.12)
}
#brokerAccountsGrid .broker-account-card header>div{min-width:0}
#brokerAccountsGrid .broker-account-card h3{font-size:16px;line-height:1.25}
#brokerAccountsGrid .broker-account-card p{
  margin:5px 0 0;font-size:11px;line-height:1.55;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
#brokerAccountsGrid .broker-primary-metrics{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:12px 0 0
}
#brokerAccountsGrid .broker-primary-metrics div{padding:8px 9px;border-radius:9px}
#brokerAccountsGrid .broker-primary-metrics dt{font-size:9px}
#brokerAccountsGrid .broker-primary-metrics dd{margin-top:3px;font-size:15px;line-height:1.25}
#brokerAccountsGrid .broker-account-meta{
  display:flex;align-items:center;gap:7px 12px;flex-wrap:wrap;
  margin-top:10px;padding-top:9px;border-top:1px solid var(--line-soft);
  color:var(--muted);font-size:9.5px
}
#brokerAccountsGrid .broker-account-meta span{display:inline-flex;align-items:center;gap:4px;min-width:0}
#brokerAccountsGrid .broker-account-meta b{color:#cfe0d8;font-size:10px;font-weight:800}
#brokerAccountsGrid .broker-source-meta{margin-inline-start:auto;max-width:48%}
#brokerAccountsGrid .broker-source-meta b{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:720px){
  #brokerAccountsGrid{grid-template-columns:1fr;max-width:none}
  #brokerAccountsGrid .broker-primary-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
  #brokerAccountsGrid .broker-source-meta{margin-inline-start:0;max-width:100%}
}

/* Dynamic connector dialog */
.connector-dialog{
  width:min(840px,calc(100vw - 28px));max-height:calc(100vh - 40px);
  padding:0;border:1px solid var(--line);border-radius:22px;color:var(--text);
  background:linear-gradient(180deg,#0a3025,#061d16);box-shadow:0 30px 100px rgba(0,0,0,.55)
}
.connector-dialog::backdrop{background:rgba(0,10,7,.72);backdrop-filter:blur(4px)}
.connector-dialog-shell{padding:22px}
.dialog-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.dialog-header span{color:var(--green);font-size:12px;font-weight:900}
.dialog-header h2{margin:5px 0 0}
.dialog-close{
  width:38px;height:38px;border:1px solid var(--line-soft);border-radius:11px;background:rgba(255,255,255,.04);color:white;font-size:24px
}
.connector-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:20px}
.connector-option{
  padding:16px;border:1px solid var(--line-soft);border-radius:15px;background:rgba(0,0,0,.14);color:var(--text);text-align:right
}
.connector-option:hover:not(:disabled){border-color:var(--line);background:rgba(159,220,85,.06)}
.connector-option:disabled{opacity:.55;cursor:not-allowed}
.connector-option strong,.connector-option small{display:block}
.connector-option small{margin-top:6px;color:var(--muted);line-height:1.5}
.connector-option em{display:inline-block;margin-top:10px;font-style:normal;color:var(--green);font-size:10px}
.connector-form-area{margin-top:20px;padding-top:20px;border-top:1px solid var(--line)}
.connector-selected-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.connector-selected-heading span{color:var(--green);font-size:11px;font-weight:900}
.connector-selected-heading h3{margin:4px 0 0}
.dynamic-fields{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.dynamic-fields label,.account-label-field{display:grid;gap:8px;color:#d4ded9;font-size:13px;font-weight:800}
.dynamic-fields input,.dynamic-fields select,.account-label-field input{
  width:100%;padding:13px;border-radius:11px;border:1px solid var(--line-soft);background:#04140f;color:white;outline:0
}
.dynamic-fields input:focus,.dynamic-fields select:focus,.account-label-field input:focus{border-color:var(--line);box-shadow:0 0 0 3px rgba(159,220,85,.07)}
.account-label-field{margin-top:13px}
.dialog-security-note{padding:11px;border:1px solid rgba(34,211,155,.2);border-radius:11px;background:rgba(34,211,155,.06);color:#b8d1c6;font-size:12px;line-height:1.7}
.form-status{min-height:22px;color:#ffd078;font-size:12px;font-weight:800}

/* Responsive */
@media(max-width:1100px){
  .auth-shell{grid-template-columns:1fr}
  .auth-hero{order:-1;min-height:auto}
  .hero-features{grid-template-columns:1fr}
  .profit-wallet-grid,.broker-account-grid{grid-template-columns:1fr}
}
@media(max-width:900px){
  .public-header{padding:14px 18px}
  .auth-shell{padding:18px}
  .auth-card,.auth-hero{padding:24px;border-radius:22px}
  .auth-hero h2{font-size:40px}
  .form-grid{grid-template-columns:1fr}
  .platform-layout{display:block}
  .platform-sidebar{position:relative;height:auto;padding:16px}
  .sidebar-nav{display:grid;grid-template-columns:repeat(3,1fr)}
  .sidebar-nav button{justify-content:center;font-size:12px;padding:10px 7px}
  .sidebar-bottom{display:none}
  .platform-main{padding:16px}
  .platform-header,.portfolio-hero{flex-direction:column;align-items:flex-start}
  .platform-actions{width:100%;justify-content:space-between}
  .metric-grid,.two-column,.target-grid,.profit-wallet-grid,.compound-grid,.summary-grid,.broker-account-grid,.threshold-grid{grid-template-columns:1fr}
  .dynamic-fields,.connector-list{grid-template-columns:1fr}
}
@media(max-width:620px){
  .public-actions{display:none}
  .auth-shell{padding:10px}
  .auth-card,.auth-hero{padding:20px}
  .auth-hero h2{font-size:32px}
  .hero-trust-row{display:grid}
  .sidebar-nav{grid-template-columns:repeat(2,1fr)}
  .platform-actions{align-items:stretch;flex-direction:column}
}


/* Canonical compound counters: preserve numeric order inside RTL surfaces. */
.canonical-counter {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.bidi-number{direction:ltr;unicode-bidi:isolate;display:inline-block;text-align:left}
.multi-account-metrics{margin-top:14px}

@media(max-width:1100px) and (min-width:901px){
  .harvest-broker-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
  .harvest-broker-grid{grid-template-columns:1fr}
  .broker-account-card.harvest-broker-card dl.harvest-primary-balance-row{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:620px){
  .broker-account-card.harvest-broker-card dl.harvest-primary-balance-row{grid-template-columns:1fr}
}

.auto-profit-capture-card{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 18px;padding:14px 16px;border:1px solid rgba(34,211,155,.18);border-radius:14px;background:rgba(3,21,18,.58)}
.auto-profit-capture-card>div{min-width:0}.auto-profit-capture-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.auto-profit-capture-title strong{font-size:13px}.auto-profit-capture-title span{font-size:11px;font-weight:900;color:#94a3b8;border:1px solid rgba(148,163,184,.18);padding:3px 8px;border-radius:999px}.auto-profit-capture-title span.enabled{color:#34d399;border-color:rgba(52,211,153,.28);background:rgba(52,211,153,.08)}
.auto-profit-capture-card p{margin:5px 0 2px;color:#94a3b8;font-size:11px}.auto-profit-capture-card small{color:#64748b;font-size:10px}.auto-profit-capture-card button{white-space:nowrap}@media(max-width:720px){.auto-profit-capture-card{align-items:stretch;flex-direction:column}.auto-profit-capture-card button{width:100%}}


.profit-exit-ready-center{margin:10px 0 12px;border-top:1px solid rgba(148,163,184,.14);padding-top:10px;display:grid;gap:7px}
.profit-exit-ready-heading,.profit-exit-ready-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.profit-exit-ready-heading{font-size:12px;color:#cbd5e1}.profit-exit-ready-heading span{border:1px solid rgba(245,158,11,.25);background:rgba(245,158,11,.08);color:#fcd34d;border-radius:999px;padding:2px 8px;font-weight:800}.profit-exit-ready-note,.profit-exit-ready-empty{color:#64748b;font-size:11px}.profit-exit-ready-row{border:1px solid rgba(148,163,184,.12);background:rgba(2,6,23,.35);border-radius:10px;padding:9px 10px}.profit-exit-ready-row>div{min-width:0}.profit-exit-ready-row strong{color:#e2e8f0;font-size:12px}.profit-exit-ready-row small{margin-inline-start:8px;color:#64748b}.profit-exit-ready-row em{display:block;margin-top:2px;color:#475569;font-size:10px;font-style:normal}#positionsTableBody tr:focus{outline:1px solid rgba(251,191,36,.55);outline-offset:-1px}
@media(max-width:720px){.profit-exit-ready-row{align-items:flex-start;flex-direction:column}.profit-exit-ready-row button{width:100%}}

/* PNL_CELL_GREEN_CLOSE_NO_ACTION_COLUMN_V1 */
.pnl-close-button{
  display:inline-flex;min-width:104px;flex-direction:column;align-items:center;justify-content:center;
  gap:2px;border:1px solid rgba(74,222,128,.58);border-radius:12px;padding:7px 12px;
  background:rgba(34,197,94,.14);color:#86efac;cursor:pointer;transition:.18s ease;
}
.pnl-close-button:hover{background:rgba(34,197,94,.24);border-color:rgba(134,239,172,.85)}
.pnl-close-button:disabled{opacity:.55;cursor:wait}
.pnl-close-button strong{font-size:11px;font-weight:900}
.pnl-close-button small{font-size:8px;font-weight:800}


/* WEALTHIER_TRADING_NUMERIC_ALIGNMENT_V1
   Visual-only alignment for high-value numeric KPIs on RTL surfaces.
   No trading, sizing, broker, risk, or counter semantics are changed. */
.kpi-balanced-value,
.threshold-balanced-value,
.money-balanced-value{
  direction:ltr;
  unicode-bidi:isolate;
  font-variant-numeric:tabular-nums lining-nums;
  font-feature-settings:"tnum" 1,"lnum" 1;
  white-space:nowrap;
  letter-spacing:-.015em;
}

.metric-grid article{
  display:flex;
  min-width:0;
  flex-direction:column;
}

.metric-grid article > strong.kpi-balanced-value{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:42px;
  margin:7px 0 2px;
  text-align:center;
  line-height:1;
}

#positionsSummary,
#brokerAccountCount,
#classificationEquity{
  font-size:24px;
  font-weight:900;
}

.target-grid > div{
  display:flex;
  min-width:0;
  flex-direction:column;
}

.target-grid strong.kpi-balanced-value{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:42px;
  margin:8px 0;
  text-align:center;
  line-height:1;
  font-size:24px;
  font-weight:900;
}

.threshold-grid{
  align-items:stretch;
}

.threshold-grid > div{
  display:grid;
  grid-template-rows:minmax(28px,auto) 34px;
  align-items:center;
  min-width:0;
  text-align:center;
}

.threshold-grid > div > span{
  display:flex;
  align-items:end;
  justify-content:center;
  min-height:28px;
  margin:0 0 4px;
  text-align:center;
  line-height:1.35;
}

.threshold-grid .threshold-balanced-value{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:34px;
  margin:0;
  text-align:center;
  line-height:1;
  font-size:20px;
  font-weight:900;
}

.money-balanced-value{
  direction:ltr;
  unicode-bidi:isolate;
}

@media(max-width:620px){
  #positionsSummary,
  #brokerAccountCount,
  #classificationEquity,
  .target-grid strong.kpi-balanced-value{
    font-size:22px;
  }
  .threshold-grid .threshold-balanced-value{
    font-size:19px;
  }
}

.position-scope-summary{margin:0 0 12px;color:#94a3b8;font-size:11px;font-weight:800;direction:ltr;text-align:right}
.position-scope-summary+.table-scroll table{min-width:980px}

.session-identity{display:flex;flex-direction:column;gap:3px;padding:10px 12px;border:1px solid rgba(82,225,180,.18);border-radius:12px;background:rgba(0,0,0,.12);margin-bottom:10px}
.session-identity span{font-size:11px;opacity:.68}
.session-identity strong{font-size:12px;color:#e9fff7;overflow-wrap:anywhere}
.session-identity small{font-size:11px;color:#52e1b4;overflow-wrap:anywhere}


/* WEALTHIER_TRADING_BROKER_EDIT_REPLACE_R20 — responsive no-overlap account actions */
#brokerAccountsGrid .broker-account-card header{align-items:flex-start}
#brokerAccountsGrid .broker-account-card h3{overflow-wrap:anywhere;word-break:normal}
#brokerAccountsGrid .connection-chip{flex:0 0 auto;max-width:46%;white-space:normal;text-align:center;line-height:1.35;overflow-wrap:anywhere}
.broker-card-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid var(--line-soft)}
.broker-edit-button{width:100%;min-height:40px;padding:9px 14px;border:1px solid rgba(159,220,85,.34);border-radius:11px;background:rgba(159,220,85,.08);color:#c9f49d;font:inherit;font-size:12px;font-weight:900;line-height:1.4;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
.broker-edit-button:hover{background:rgba(159,220,85,.14);border-color:rgba(159,220,85,.55)}
.connector-selected-heading>div,.dialog-header>div{min-width:0}
.connector-selected-heading h3,.dialog-header h2,.dynamic-fields label span{overflow-wrap:anywhere;word-break:normal}
@media(max-width:560px){
  #brokerAccountsGrid .broker-account-card header{flex-direction:column;align-items:stretch}
  #brokerAccountsGrid .connection-chip{align-self:flex-start;max-width:100%}
  .connector-selected-heading{align-items:stretch;flex-direction:column}
  .connector-selected-heading .secondary-button{width:100%}
}
