:root {
  color-scheme: dark;
  --bg: #031827;
  --panel: #052943;
  --panel-2: #073653;
  --line: #0d6fa9;
  --text: #f4f8ff;
  --muted: #b7d6f4;
  --blue: #45a2ff;
  --green: #39ef8d;
  --green-dark: #053d27;
  --red: #ff4d61;
  --amber: #ffb74a;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }

.dashboard {
  width: 100vw;
  height: 100dvh;
  min-height: 610px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(7px, .8vh, 12px);
  padding: clamp(8px, 1vw, 18px);
  background:
    radial-gradient(circle at 55% -30%, rgba(0, 112, 187, .35), transparent 45%),
    linear-gradient(135deg, #03111e, #04253c 55%, #03131f);
}

.topbar {
  min-height: clamp(48px, 6.5vh, 70px);
  margin: calc(clamp(8px, 1vw, 18px) * -1) calc(clamp(8px, 1vw, 18px) * -1) 0;
  padding: 0 clamp(14px, 1.7vw, 30px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid #124361;
  background: rgba(2, 24, 42, .72);
}

.brand, .topbar h1 { margin: 0; font-size: clamp(20px, 2vw, 37px); letter-spacing: .02em; }
.brand { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; color: inherit; background: transparent; font-family: inherit; text-align: left; cursor: pointer; transition: opacity .15s ease, transform .15s ease; }
.brand strong { color: var(--blue); }
.brand:focus-visible { border-radius: 5px; outline: 2px solid var(--blue); outline-offset: 4px; }
.site-logo { display: block; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; object-fit: contain; }
.brand .site-logo { width: clamp(30px, 3vw, 46px); height: clamp(30px, 3vw, 46px); }
.topbar h1 { font-size: clamp(18px, 1.65vw, 29px); text-align: center; }
.trading-fund-estimates { grid-column: 1 / -1; justify-self: center; width: clamp(320px, 33vw, 430px); height: clamp(38px, 5.2vh, 50px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid #289ee3; border-radius: 8px; background: linear-gradient(135deg, rgba(8,75,120,.98), rgba(5,53,88,.98)); box-shadow: 0 3px 12px rgba(0,103,170,.22); }
.trading-fund-estimates > div { min-width: 0; padding: 3px 7px; display: grid; grid-template-rows: 1fr auto; place-items: center; border-right: 1px solid rgba(22,119,174,.65); text-align: center; }
.trading-fund-estimates > div:last-child { border-right: 0; }
.trading-fund-estimates span { align-self: end; color: var(--muted); font-size: clamp(8px, .65vw, 11px); font-weight: 700; line-height: 1.05; }
.trading-fund-estimates strong { align-self: start; color: white; font-size: clamp(14px, 1.2vw, 20px); font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.trading-fund-estimates .fund-gain { color: var(--green); }
.trading-fund-estimates .fund-loss { color: var(--red); }
.dashboard.is-fund-view .trading-fund-estimates { display: none; }
.refresh-info { justify-self: end; display: flex; align-items: center; gap: clamp(7px, .8vw, 14px); font-size: clamp(11px, 1vw, 17px); white-space: nowrap; }
.refresh-info strong { font-size: 1.2em; }
.topbar-user { color: #c7def2; font-weight: 700; }
.topbar-separator { color: rgba(183,214,244,.62); }
.logout-form { margin: 0 0 0 clamp(3px, .35vw, 7px); }
.logout-button { padding: 5px 9px; border: 1px solid #2f91d3; border-radius: 5px; color: #d8ecff; background: rgba(7,87,150,.4); font: inherit; font-size: .78em; font-weight: 700; cursor: pointer; }
.logout-button:hover, .logout-button:focus-visible { border-color: var(--blue); background: rgba(15,112,184,.7); outline: none; }
.pin-manage-link { color: #8fc9ff; font-size: .72em; text-decoration: none; white-space: nowrap; }
.pin-manage-link:hover, .pin-manage-link:focus-visible { color: white; text-decoration: underline; outline: none; }
.live-dot { width: 16px; aspect-ratio: 1; margin-left: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 15px rgba(57,239,141,.6); }
.live-dot.offline { background: var(--red); }

.global-status { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(5px, .65vw, 10px); }
.global-status { position: sticky; top: 0; z-index: 20; align-self: start; background: var(--bg); }
.status-pill { min-width: 0; min-height: clamp(36px, 4.7vh, 48px); display: flex; justify-content: center; align-items: center; gap: clamp(5px, .7vw, 10px); padding-inline: 4px; border: 2px solid #00bc5d; border-radius: 8px; background: rgba(2, 67, 42, .55); font-size: clamp(11px, 1vw, 17px); font-weight: 750; text-align: center; }
.status-pill .check { display: grid; place-items: center; width: 27px; aspect-ratio: 1; border-radius: 50%; color: #063820; background: var(--green); font-weight: 900; }
.cross-alarm-label { line-height: 1.05; white-space: pre-line; }
.status-pill.is-ko { border-color: var(--red); background: rgba(100, 15, 28, .55); }
.status-pill.is-ko .check { color: white; background: var(--red); }
.status-pill.is-warning { border-color: var(--amber); background: rgba(105, 66, 8, .55); }
.status-pill.is-warning .check { color: #3d2600; background: var(--amber); }
.status-pill.is-pending { border-color: var(--line); background: rgba(7, 54, 83, .55); }
.status-pill.is-pending .check { color: var(--text); background: rgba(69, 162, 255, .55); }
.alarm-counter { min-width: 42px; padding: 2px 6px; border: 1px solid currentColor; border-radius: 10px; font-size: .7em; line-height: 1.15; text-align: center; white-space: nowrap; }
.status-pill.is-warning .alarm-counter { color: var(--amber); }
.status-pill.is-ko .alarm-counter { color: #ff9daa; }

.dashboard > [hidden] { display: none !important; }
.dashboard > .global-status,
.dashboard > .robots,
.dashboard > .history-workspace,
.dashboard > .fund-view,
.dashboard > .error-banner { transition: opacity .15s ease, transform .15s ease; }
.topbar > * { transition: opacity .28s ease, transform .28s ease; }
.dashboard.is-warping > :not(.topbar):not([hidden]) { opacity: 0; transform: scale(.985); }
.dashboard.is-warping .topbar > * { opacity: 0; transform: translateY(-5px); }
.fund-view { min-height: 0; align-self: stretch; }
.dashboard.is-fund-view { grid-template-rows: auto minmax(0, 1fr) auto; }
.dashboard.is-fund-view .fund-view { overflow-y: auto; }
.fund-overview-layout { width: 100%; margin-top: clamp(10px, 1vw, 16px); display: grid; grid-template-columns: minmax(340px, .62fr) minmax(0, 1.75fr); gap: clamp(8px, .8vw, 13px); }
.fund-estimates, .fund-overview { min-height: 82px; display: grid; border: 2px solid var(--line); border-radius: 9px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.fund-estimates { grid-template-columns: repeat(3, minmax(0, 1fr)); border-color: #289ee3; background: linear-gradient(135deg, rgba(8,75,120,.98), rgba(5,53,88,.98)); box-shadow: 0 6px 20px rgba(0,103,170,.28), inset 0 0 22px rgba(69,162,255,.08); }
.fund-overview { grid-template-columns: repeat(6, minmax(0, 1fr)); background: linear-gradient(105deg, rgba(4,36,59,.97), rgba(4,45,71,.97)); }
.fund-risk-overview { grid-column: 2; grid-template-columns: minmax(0, 3fr) minmax(90px, .8fr) minmax(0, 2fr); }
.fund-risk-overview .fund-overview-item { padding-top: 4px; padding-bottom: 4px; grid-template-rows: 34px minmax(28px, auto); }
.fund-risk-overview .fund-overview-item > span { height: 34px; }
.fund-drawdown { min-width: 0; display: grid; grid-template-rows: 26px minmax(0, 1fr); border-right: 1px solid rgba(22,119,174,.65); text-align: center; }
.fund-drawdown-title { display: flex; align-items: center; justify-content: center; border-bottom: 1px solid rgba(22,119,174,.65); color: var(--muted); font-size: clamp(11px, .9vw, 15px); font-weight: 700; }
.fund-drawdown-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fund-drawdown-item { min-width: 0; padding: 2px clamp(6px, .8vw, 13px); display: grid; grid-template-rows: 22px minmax(28px, auto); align-items: center; border-right: 1px solid rgba(22,119,174,.65); }
.fund-drawdown-item:last-child { border-right: 0; }
.fund-drawdown-item span { color: var(--muted); font-size: clamp(10px, .8vw, 13px); font-weight: 700; white-space: nowrap; }
.fund-drawdown-item strong { justify-self: center; font-size: clamp(17px, 1.45vw, 25px); font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.fund-fees { min-width: 0; display: grid; grid-template-rows: 26px minmax(0, 1fr); text-align: center; }
.fund-fees-title { display: flex; align-items: center; justify-content: center; border-bottom: 1px solid rgba(22,119,174,.65); color: var(--muted); font-size: clamp(11px, .9vw, 15px); font-weight: 700; }
.fund-fees-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fund-fees-item { min-width: 0; padding: 2px clamp(6px, .8vw, 13px); display: grid; grid-template-rows: 22px minmax(28px, auto); align-items: center; border-right: 1px solid rgba(22,119,174,.65); }
.fund-fees-item:last-child { border-right: 0; }
.fund-fees-item span { color: var(--muted); font-size: clamp(10px, .8vw, 13px); font-weight: 700; white-space: nowrap; }
.fund-fees-item strong { justify-self: center; font-size: clamp(17px, 1.45vw, 25px); font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.fund-market-evolution { padding-inline: 4px; }
.fund-market-evolution > span { font-size: clamp(9px, .75vw, 13px); }
.fund-market-evolution strong { font-size: clamp(15px, 1.25vw, 22px); }
.fund-overview-item { min-width: 0; padding: 7px clamp(8px, 1vw, 16px); display: grid; grid-template-rows: 40px minmax(30px, auto); align-items: center; justify-items: stretch; gap: 2px; border-right: 1px solid rgba(22,119,174,.65); text-align: center; }
.fund-overview-item:last-child { border-right: 0; }
.fund-overview-item > span { height: 40px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: clamp(11px, .9vw, 15px); font-weight: 700; line-height: 1.2; }
.fund-overview-item strong { justify-self: center; font-size: clamp(17px, 1.45vw, 25px); font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.fund-overview-values { width: 100%; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .75fr); align-items: center; white-space: nowrap; }
.fund-overview-values strong { font-size: clamp(15px, 1.15vw, 21px); }
.fund-overview-values em { min-height: 26px; padding-left: clamp(6px, .5vw, 10px); display: flex; align-items: center; justify-content: center; border-left: 1px solid rgba(69,162,255,.55); font-size: clamp(17px, 1.25vw, 22px); font-style: normal; font-weight: 900; }
.fund-performance { background: transparent; }
.fund-estimated { background: linear-gradient(180deg, rgba(10,88,139,.92), rgba(5,60,99,.94)); box-shadow: inset 0 0 22px rgba(69,162,255,.16); }
.fund-overview .fund-gain, .fund-estimates .fund-gain { color: var(--green); }
.fund-overview .fund-loss, .fund-estimates .fund-loss { color: var(--red); }
.fund-accounts { width: 100%; margin-top: clamp(12px, 1.4vw, 22px); border: 2px solid var(--line); border-radius: 9px; overflow: hidden; background: linear-gradient(105deg, rgba(4,36,59,.97), rgba(4,45,71,.97)); box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.fund-accounts-header { min-height: 58px; padding: 0 12px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.fund-accounts h2 { margin: 0; color: #acd3ff; font-size: clamp(16px, 1.3vw, 21px); }
.fund-accounts-heading { display: flex; align-items: baseline; gap: clamp(14px, 2vw, 30px); min-width: 0; }
.fund-investment-status { color: var(--muted); font-size: clamp(12px, 1vw, 15px); font-weight: 600; white-space: nowrap; }
.fund-investment-status strong { font-size: 1.08em; }
.fund-investment-status .fund-gain { color: var(--green); }
.fund-investment-status .fund-loss { color: var(--red); }
.fund-accounts-controls { display: flex; align-items: center; gap: 7px; }
.fund-history-controls { min-height: 42px; padding: 5px 18px; display: flex; align-items: center; justify-content: flex-start; gap: 7px; border-bottom: 1px solid var(--line); background: rgba(2,28,47,.42); }
.fund-column-toggle { width: 31px; height: 31px; padding: 5px; display: grid; place-items: center; border: 1px solid rgba(69,162,255,.75); border-radius: 6px; color: #9dceff; background: rgba(7,65,105,.65); cursor: pointer; }
.fund-column-toggle:hover, .fund-column-toggle:focus-visible { color: white; border-color: var(--blue); background: rgba(12,94,151,.8); outline: none; }
.fund-column-toggle:disabled { opacity: .32; cursor: default; }
.fund-column-toggle:disabled:hover { color: #9dceff; border-color: rgba(69,162,255,.75); background: rgba(7,65,105,.65); }
.fund-rows-toggle.has-hidden { color: var(--green); border-color: rgba(57,239,141,.8); }
.fund-column-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fund-column-toggle.is-visible .fund-eye-slash { display: none; }
.fund-table-wrap { overflow-x: auto; }
.fund-table { width: 100%; border-collapse: collapse; font-size: clamp(12px, 1.1vw, 17px); }
.fund-table.is-gp-hidden .fund-gp { display: none; }
.fund-table th, .fund-table td { padding: clamp(9px, 1vw, 16px) clamp(6px, 1.1vw, 18px); text-align: right; font-variant-numeric: tabular-nums; }
.fund-table th { color: var(--muted); background: rgba(7,54,83,.6); white-space: nowrap; }
.fund-table th:first-child, .fund-table td:first-child { text-align: left; overflow-wrap: anywhere; }
.fund-table td { border-top: 1px solid rgba(22,119,174,.4); }
.fund-table td:not(:first-child) { white-space: nowrap; }
.fund-account-identity { min-height: 30px; display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.fund-account-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.fund-account-update-date { margin-top: 3px; color: rgba(183,214,244,.72); font-size: .7em; font-weight: 400; }
.fund-account-update-alert { margin-top: 3px; padding: 1px 5px; border: 1px solid var(--red); border-radius: 8px; color: #ff9daa; background: rgba(100,15,28,.55); font-size: .68em; font-weight: 800; line-height: 1.15; }
#fund-accounts-table .fund-account-row.is-update-late { background: linear-gradient(90deg, rgba(120,18,34,.62), rgba(7,54,83,.72)); box-shadow: inset 4px 0 0 var(--red); }
#fund-accounts-table .fund-account-row.is-update-late > td { background: transparent; }
.fund-account-logo { width: 30px; height: 30px; flex: 0 0 30px; object-fit: contain; }
.fund-account-row[hidden] { display: none; }
.fund-row-hide { width: 23px; height: 23px; padding: 3px; flex: 0 0 23px; border: 0; border-radius: 4px; color: #83b9df; background: transparent; cursor: pointer; opacity: .72; }
.fund-row-hide:hover, .fund-row-hide:focus-visible { color: white; background: rgba(69,162,255,.2); opacity: 1; outline: none; }
.fund-row-hide svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fund-table .fund-gain { color: var(--green); }
.fund-table .fund-loss { color: var(--red); }
.fund-table .fund-total td { border-top: 2px solid var(--line); color: #d9ecff; background: rgba(7,54,83,.72); font-weight: 800; }
.fund-table .fund-total .fund-gain { color: var(--green); }
.fund-table .fund-total .fund-loss { color: var(--red); }
.fund-table .fund-calculation td { padding-top: 8px; padding-bottom: 8px; background: rgba(3,31,51,.78); }
.fund-table .fund-calculation td.fund-calculation-label { color: var(--muted); text-align: right; font-weight: 700; }
.fund-table .fund-calculation-value { font-weight: 800; }
.fund-table .fund-calculation-net td { border-top-color: rgba(69,162,255,.7); background: rgba(7,54,83,.6); }
.fund-table .fund-month-performance { width: 1%; padding-right: clamp(8px, .8vw, 14px); padding-left: clamp(8px, .8vw, 14px); white-space: nowrap; }
.fund-view .fund-loss { color: #ff7384; font-weight: 800; -webkit-text-stroke: 0; text-shadow: none; }
#fund-performance, #fund-performance-estimated, #fund-latent-performance, .fund-table .fund-month-performance { font-weight: 900; letter-spacing: .01em; }
#fund-performance.fund-gain, #fund-performance-estimated.fund-gain, #fund-latent-performance.fund-gain, .fund-table .fund-month-performance.fund-gain { -webkit-text-stroke: 0; text-shadow: none; }

@media (max-width: 620px) {
  .fund-overview-layout { grid-template-columns: 1fr; }
  .fund-risk-overview { grid-column: 1; }
  .fund-estimates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fund-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fund-overview.fund-risk-overview { grid-template-columns: minmax(0, 3fr) minmax(70px, .8fr) minmax(0, 2fr); }
  .fund-overview-item { border-bottom: 1px solid rgba(22,119,174,.65); }
  .fund-overview-item:nth-child(even) { border-right: 0; }
  .fund-overview-item:nth-last-child(-n+2) { border-bottom: 0; }
}

.warp-transition { position: fixed; inset: 0; z-index: 1000; overflow: hidden; pointer-events: all; background: rgba(3,24,39,0); transition: background-color .3s ease; }
.warp-transition.is-active { background: rgba(3,24,39,.98); }
.warp-stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.warp-logo-orb, .warp-title { position: fixed; z-index: 2; margin: 0; transform-origin: center; will-change: left, top, width, height, font-size, transform, opacity; }
.warp-logo-orb { overflow: hidden; border-radius: 50%; background: #eaf4f8; box-shadow: inset -12px -8px 22px rgba(0,14,34,.58), inset 7px 6px 14px rgba(255,255,255,.7), 0 0 20px rgba(69,162,255,.55); }
.warp-logo-orb::before, .warp-logo-orb::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; }
.warp-logo-orb::before { background: radial-gradient(circle at 28% 22%, rgba(255,255,255,.9) 0 4%, rgba(255,255,255,.28) 13%, transparent 38%); mix-blend-mode: screen; }
.warp-logo-orb::after { inset: -8% -24%; background: linear-gradient(100deg, rgba(0,20,46,.58), transparent 32%, rgba(255,255,255,.2) 49%, transparent 65%, rgba(0,12,34,.7)); animation: warp-sphere-shade 1.05s ease-in-out infinite alternate; }
.warp-logo { position: absolute; top: -13%; left: -13%; width: 126%; height: 126%; border-radius: 50%; object-fit: contain; animation: warp-sphere-surface 1.05s ease-in-out infinite alternate; }
.warp-title { color: var(--blue); font-family: inherit; font-weight: 700; line-height: 1; letter-spacing: .02em; white-space: nowrap; text-shadow: 0 0 18px rgba(69,162,255,.38); }

@keyframes warp-sphere-surface {
  from { transform: translateX(-3%) scaleX(.94); filter: brightness(1.08); }
  to { transform: translateX(4%) scaleX(.82); filter: brightness(.78) contrast(1.12); }
}

@keyframes warp-sphere-shade {
  from { transform: translateX(-12%); }
  to { transform: translateX(12%); }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard > *, .topbar > *, .brand { transition-duration: 0s !important; }
  .warp-logo-orb::after, .warp-logo { animation: none !important; }
}

.robots { --visible-robots: 4; position: relative; min-height: 0; display: grid; grid-template-rows: repeat(var(--visible-robots), minmax(0, 1fr)); gap: clamp(7px, .8vh, 12px); }
.robots-show-hidden { position: fixed; right: clamp(10px, 1vw, 18px); bottom: clamp(10px, 1vw, 18px); z-index: 20; width: 34px; height: 34px; padding: 6px; display: grid; place-items: center; border: 1px solid var(--blue); border-radius: 7px; color: #9dceff; background: rgba(7,87,150,.94); cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.robots-show-hidden:hover, .robots-show-hidden:focus-visible { background: rgba(15,112,184,.98); outline: none; }
.robots-show-hidden[hidden] { display: none; }
.robots-show-hidden svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.robot-card { min-height: 0; display: grid; grid-template-columns: minmax(175px, .82fr) minmax(190px, .88fr) minmax(390px, 1.92fr) minmax(210px, .88fr) minmax(325px, 1.35fr); border: 2px solid var(--line); border-radius: 9px; overflow: hidden; background: linear-gradient(105deg, rgba(4, 36, 59, .97), rgba(4, 45, 71, .97)); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); transition: background .3s ease, border-color .3s ease, box-shadow .3s ease; }
.mobile-summary, .mobile-show-all, .mobile-history-gauge { display: none; }
.robot-card.is-market-open { border-color: #168fd0; background: linear-gradient(105deg, rgba(5, 54, 84, .98), rgba(6, 67, 101, .98)); box-shadow: 0 7px 20px rgba(0, 112, 180, .27), inset 0 0 20px rgba(35, 157, 224, .05); }
.robot-card.is-market-closed { border-color: #687985; background: linear-gradient(105deg, rgba(39, 51, 60, .98), rgba(45, 61, 72, .98)); box-shadow: 0 5px 14px rgba(0, 0, 0, .25), inset 0 0 24px rgba(0, 0, 0, .08); }
.robot-card.is-market-closed .panel { border-color: rgba(126, 148, 161, .55); }
.robot-card.is-market-closed .panel h3,
.robot-card.is-market-closed .metric-grid,
.robot-card.is-market-closed .metrics-header,
.robot-card.is-market-closed .strategy-header { border-color: rgba(126, 148, 161, .55); }
.robot-card.is-market-closed .panel h3 { color: #c0ced7; }
.panel { min-width: 0; padding: clamp(8px, .72vw, 13px); border-right: 1px solid var(--line); }
.panel:last-child { border: 0; }
.panel h3 { margin: 0 0 clamp(6px, .7vh, 10px); padding-bottom: 5px; border-bottom: 1px solid rgba(22, 119, 174, .65); color: #acd3ff; font-size: clamp(13px, 1.14vw, 19px); }

.identity { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: clamp(7px, .8vh, 11px); }
.identity-title { min-height: 0; display: grid; grid-template-columns: clamp(52px, 4vw, 68px) minmax(0, 1fr); align-items: center; gap: clamp(10px, .85vw, 15px); }
.flag { display: flex; align-items: center; justify-content: center; width: 100%; }
.flag img { display: block; width: 100%; max-width: 68px; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid rgba(255,255,255,.65); border-radius: 5px; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.identity-title > div { min-width: 0; display: grid; align-content: center; gap: clamp(4px, .55vh, 8px); }
.identity h2 { margin: 0; white-space: nowrap; font-size: clamp(18px, 1.62vw, 29px); line-height: 1.05; }
.identity-title strong, .identity-title span:not(.flag) { display: block; margin: 0; color: #79b9ff; font-size: clamp(11px, .95vw, 16px); }
.identity-title strong { font-weight: 800; }
.identity-title span:not(.flag) { color: var(--muted); }
.market-state { padding: clamp(7px, .65vh, 10px) 4px; border: 2px solid #00d56b; border-radius: 7px; background: rgba(0, 89, 54, .6); text-align: center; font-size: clamp(11px, .95vw, 16px); font-weight: 800; }
.market-state span { display: block; }
.market-state.closed { border-color: var(--red); background: rgba(118, 15, 28, .62); }

.sync { display: flex; flex-direction: column; }
.sync-line { flex: 1; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: clamp(11px, .95vw, 16px); }
.sync-line b { display: block; font: inherit; }
.sync-short { display: none !important; }
.sync-line i { flex: 0 0 auto; width: 18px; aspect-ratio: 1; border-radius: 50%; }
.sync-line i.ok { background: var(--green); box-shadow: 0 0 12px rgba(57,239,141,.35); }
.sync-line i.ko { background: var(--red); box-shadow: 0 0 12px rgba(255,77,97,.45); }
.sync-line time { display: block; margin-top: 4px; color: white; font-size: .92em; white-space: nowrap; }
.sync-line time span { display: block; line-height: 1.18; }
.sync-line time span:last-child {
  margin-top: 3px;
  color: #fff;
  font-size: 1.35em;
  font-weight: 850;
  line-height: 1;
}

.metrics { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.metrics-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 clamp(6px, .7vh, 10px); padding-bottom: 5px; border-bottom: 1px solid rgba(22, 119, 174, .65); }
.metrics-header h3 { min-width: 0; margin: 0; padding: 0; border: 0; }
.metrics-heading { min-width: 0; display: flex; align-items: center; gap: 6px; }
.metrics-chart-button { flex: 0 0 auto; width: 22px; height: 22px; padding: 3px; display: grid; place-items: center; border: 1px solid rgba(143, 201, 255, .65); border-radius: 5px; color: #9dceff; background: rgba(7, 65, 105, .55); cursor: default; opacity: 1; }
.metrics-chart-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metrics-chart-button .metrics-chart-line { stroke: var(--green); }
.metric-grid { display: grid; grid-template-columns: .78fr 1fr 1fr 1.15fr; padding-bottom: clamp(6px, .65vh, 10px); border-bottom: 1px solid rgba(22, 119, 174, .75); }
.metric-grid > div { min-width: 0; padding: 0 clamp(6px, .8vw, 13px); border-right: 1px solid rgba(22, 119, 174, .75); }
.metric-grid > div:first-child { padding-left: 3px; }
.metric-grid > div:last-child { border: 0; }
.metric-grid span, .metric-grid small { display: block; color: var(--muted); font-size: clamp(9px, .82vw, 14px); white-space: nowrap; }
.metric-grid strong { display: block; margin-top: 3px; color: var(--blue); font-size: clamp(14px, 1.35vw, 22px); white-space: nowrap; }
.metric-grid > div:nth-child(2) strong { text-align: center; }
.metric-grid > div:nth-child(3) strong { text-align: center; }
.metric-grid small { color: #8ec9ff; font-weight: 650; }
.metric-grid > .coefficient-metric { padding-right: 0; padding-left: 0; }
.coefficient-metric > span { text-align: center; }
.coefficient-values { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2px; }
.coefficient-values > div { min-width: 0; text-align: center; }
.coefficient-values > div + div { border-left: 1px solid rgba(22,119,174,.75); }
.coefficient-values strong { margin-top: 0; text-align: center; }
.coefficient-values small { text-align: center; }
.coefficient-values strong.coefficient-warning { color: var(--amber); }
.coefficient-values strong.coefficient-danger { color: var(--red); }
.market-mode { flex: 0 0 auto; min-width: clamp(100px, 7.7vw, 130px); padding: clamp(3px, .35vh, 5px) 10px; border-radius: 7px; color: #00341b; background: var(--green); text-align: center; font-size: clamp(9px, .74vw, 13px); font-weight: 900; line-height: 1.1; letter-spacing: .035em; box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
.market-mode.is-crash { color: #2d0006; background: var(--red); box-shadow: 0 0 13px rgba(255, 77, 97, .42); }

.gauge { --low: 33%; --high: 67%; --value: 50%; position: relative; align-self: center; width: 100%; min-height: 52px; margin-top: 1px; padding-top: 23px; }
.gauge-track { position: relative; height: clamp(21px, 2.9vh, 29px); display: grid; grid-template-columns: var(--low) calc(var(--high) - var(--low)) calc(100% - var(--high)); border: 1px solid rgba(255,255,255,.2); border-radius: 7px; overflow: hidden; background: transparent; }
.gauge-track::after { content: ''; position: absolute; left: 50%; top: -6px; z-index: 2; transform: translateX(-50%); border: 6px solid transparent; border-bottom-color: white; filter: drop-shadow(0 1px 1px rgba(0,0,0,.7)); pointer-events: none; }
.gauge-track span { display: grid; place-items: center; min-width: 0; color: white; font-size: clamp(9px, .75vw, 13px); font-weight: 800; }
.gauge-track span:nth-child(1) { background: #db3148; }
.gauge-track span:nth-child(2) { background: #0757c6; }
.gauge-track span:nth-child(3) { background: #09a83e; }
.gauge-track span + span { border-left: 2px solid rgba(255,255,255,.9); }
.gauge-title { position: absolute; left: 0; top: -18px; color: var(--muted); font-size: clamp(9px, .75vw, 13px); font-weight: 700; line-height: 1; white-space: nowrap; }
.gauge-value { position: absolute; left: clamp(30px, var(--value), calc(100% - 30px)); top: 0; z-index: 2; transform: translateX(-50%); color: white; font-size: clamp(12px, 1vw, 17px); font-weight: 900; line-height: 1; text-shadow: 0 1px 3px #00101c; white-space: nowrap; }
.gauge-value::after { content: ''; position: absolute; left: 50%; top: 19px; transform: translateX(-50%); border: 7px solid transparent; border-top-color: white; }
.gauge-value.gauge-value-call,
.gauge-value.gauge-value-short { padding: 3px 8px; border-radius: 999px; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.gauge-value.gauge-value-call { background: #078f38; }
.gauge-value.gauge-value-short { background: #c62d43; }
.gauge-value.gauge-value-call::after,
.gauge-value.gauge-value-short::after { top: calc(100% - 1px); }
.gauge-value.gauge-value-call::after { border-top-color: #078f38; }
.gauge-value.gauge-value-short::after { border-top-color: #c62d43; }
.threshold { position: absolute; bottom: -3px; z-index: 2; transform: translate(-50%, 100%); color: white; font-size: clamp(11px, .9vw, 15px); font-weight: 900; line-height: 1; text-shadow: 0 1px 3px #00101c; }
.threshold::before { content: ''; position: absolute; left: 50%; bottom: calc(100% + 2px); width: 3px; height: clamp(22px, 2.7vh, 29px); transform: translateX(-50%); background: white; border-radius: 3px; }
.threshold-low { left: var(--low); }
.threshold-high { left: var(--high); }

.market { display: flex; flex-direction: column; }
.market dl, .strategy dl { margin: 0; display: grid; gap: clamp(5px, .75vh, 10px); }
.market dl { flex: 1; align-content: center; }
.market dl > div, .strategy dl > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
dt { color: var(--muted); font-size: clamp(10px, .85vw, 14px); white-space: nowrap; }
.label-compact { display: none; }
dd { margin: 0; text-align: right; font-size: clamp(14px, 1.35vw, 23px); font-weight: 750; white-space: nowrap; }

.strategy-content { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(118px, .7fr); gap: clamp(7px, .65vw, 11px); height: calc(100% - 28px); }
.strategy-content > * { min-width: 0; }
.strategy-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: clamp(6px, .7vh, 10px); padding-bottom: 5px; border-bottom: 1px solid rgba(22,119,174,.65); }
.strategy-header h3 { min-width: 0; margin: 0; padding: 0; border: 0; }
.strategy-actions { display: flex; align-items: center; gap: 5px; }
.strategy-main { min-width: 0; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr); }
.strategy dl { align-content: center; }
.strategy dl > div { min-width: 0; }
.strategy .entry-date { min-width: 0; max-width: 58%; display: grid; justify-items: end; gap: 2px; overflow: hidden; color: #eef8ff; font-size: clamp(12px, 1vw, 17px); font-weight: 800; line-height: 1; }
.strategy .entry-date span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.strategy .entry-date span:last-child { font-size: 1.1em; }
.strategy .entry-date.is-today { color: #ffd166; }
.strategy .entry-date.is-recent { color: #65f3ff; }
.position { min-width: 94px; padding: 8px 13px; border-radius: 7px; text-align: center; background: #0757c6; font-size: clamp(12px, 1.2vw, 20px); color: white; }
.position[data-position="1"] { background: var(--green); color: #06452f; }
.position[data-position="-1"] { background: var(--red); color: #fff; }
.history-link { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 3px 10px; border: 1px solid #2f91d3; border-radius: 6px; color: #d8ecff; background: rgba(7, 87, 150, .35); text-align: center; text-decoration: none; font: inherit; font-size: clamp(8px, .66vw, 11px); font-weight: 750; white-space: nowrap; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.history-link:hover, .history-link:focus-visible { border-color: var(--blue); background: rgba(15, 112, 184, .62); outline: none; }
.robot-hide { width: 25px; height: 25px; padding: 3px; display: grid; place-items: center; border: 1px solid rgba(143,201,255,.65); border-radius: 5px; color: #9dceff; background: rgba(7,65,105,.55); cursor: pointer; }
.robot-hide:hover, .robot-hide:focus-visible { color: white; border-color: var(--blue); background: rgba(15,112,184,.7); outline: none; }
.robot-hide svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profit-block { min-width: 0; max-width: 100%; overflow: hidden; display: grid; grid-template-rows: auto auto; align-content: center; border-left: 1px solid rgba(22,119,174,.75); padding-left: clamp(7px, .65vw, 11px); padding-right: 2px; box-sizing: border-box; }
.profit-block span { color: #d2e7ff; text-align: center; font-size: clamp(10px, .9vw, 15px); font-weight: 700; }
.profit-block strong { display: grid; grid-template-rows: auto auto auto; place-items: center; align-content: center; width: 100%; min-width: 0; max-width: 100%; height: clamp(82px, 10vh, 132px); margin-top: 7px; padding: 0 clamp(4px, .45vw, 8px); overflow: hidden; border: 2px solid currentColor; border-radius: 8px; background: rgba(0, 76, 45, .5); font-size: clamp(19px, 1.7vw, 30px); line-height: 1; white-space: nowrap; box-sizing: border-box; }
.profit-block strong b { align-self: end; font: inherit; line-height: 1; }
.profit-block strong small { align-self: start; margin-top: 5px; font-size: .5em; font-weight: 650; line-height: 1; transform: translateX(3px); }
.profit-block strong small.mm-drawdown { align-self: center; margin-top: 4px; color: #d2e7ff; font-size: .42em; transform: none; }
.mobile-profit .mm-drawdown { display: block; margin-top: 3px; color: #d2e7ff; font-size: 8px; font-weight: 700; line-height: 1.1; }
.mm-drawdown { cursor: help; border-radius: 2px; }
.mm-drawdown:focus-visible { outline: 1px solid var(--blue); outline-offset: 3px; }
.mm-drawdown-popup { position: fixed; z-index: 1100; width: min(310px, calc(100vw - 20px)); box-sizing: border-box; padding: 14px 16px; border: 1px solid #459fff; border-radius: 10px; color: #e8f3ff; background: rgba(3, 27, 46, .98); box-shadow: 0 8px 28px rgba(0, 0, 0, .5); font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; text-align: left; }
.mm-drawdown-popup[hidden], .mm-drawdown-popup [hidden] { display: none; }
.mm-drawdown-popup-title { display: block; margin-bottom: 10px; color: #a9d6ff; font-size: 14px; }
.mm-drawdown-popup-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mm-drawdown-popup-row b { white-space: nowrap; }
.mm-drawdown-popup-track { position: relative; height: 13px; margin-top: 9px; overflow: hidden; border: 1px solid rgba(142, 197, 240, .45); border-radius: 7px; background: rgba(91, 150, 193, .18); }
.mm-drawdown-popup-track::after { content: ""; position: absolute; inset: 2px 0; pointer-events: none; background: linear-gradient(var(--dd-tick-25, #e8f3ff), var(--dd-tick-25, #e8f3ff)) 25% 0 / 1px 100% no-repeat, linear-gradient(var(--dd-tick-50, #e8f3ff), var(--dd-tick-50, #e8f3ff)) 50% 0 / 1px 100% no-repeat, linear-gradient(var(--dd-tick-75, #e8f3ff), var(--dd-tick-75, #e8f3ff)) 75% 0 / 1px 100% no-repeat; }
.mm-drawdown-popup-track > span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .2s ease; }
.mm-drawdown-popup[data-level="warning"] .mm-drawdown-popup-track > span { background: var(--amber); }
.mm-drawdown-popup[data-level="danger"] .mm-drawdown-popup-track > span { background: var(--red); }
.mm-drawdown-popup-scale { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; color: #a9c9e1; font-size: 11px; }
.mm-drawdown-popup-increment { margin-top: 12px; padding-top: 9px; border-top: 1px solid rgba(142, 197, 240, .28); }
.mm-drawdown-popup-unavailable { margin: 9px 0 0; color: #a9c9e1; font-size: 12px; }
.mm-drawdown-popup-overrun { margin: 9px 0 0; color: var(--red); font-size: 12px; font-weight: 700; }
.profit-block strong.value-up { background: rgba(0, 76, 45, .5); }
.profit-block strong.value-down { background: rgba(118, 15, 28, .58); }
.profit-block strong.value-neutral { background: rgba(7, 87, 150, .38); }
.value-up { color: var(--green) !important; }
.value-down { color: var(--red) !important; }
.value-warning { color: var(--amber) !important; }
.value-neutral { color: var(--blue) !important; }

.error-banner { position: fixed; left: 50%; bottom: 18px; z-index: 10; transform: translateX(-50%); width: min(760px, calc(100vw - 30px)); padding: 12px 18px; border: 1px solid var(--red); border-radius: 8px; background: rgba(95, 11, 24, .94); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); }

body.history-active { overflow: auto; }
body.history-active .dashboard > .robots { display: none !important; }
.dashboard.is-history-mode { width: 100%; height: auto; min-height: 100dvh; grid-template-rows: auto auto auto auto; align-content: start; }
.robots.is-history-mode { display: block; height: auto; min-height: 0; align-self: start; margin: 0; }
.robots.is-history-mode .robot-card { min-height: clamp(220px, 26vh, 285px); }
.robots.is-history-mode .robot-hide { display: none; }
.robot-card[hidden], .history-workspace[hidden], .history-workspace [hidden] { display: none !important; }

.history-workspace { min-width: 0; padding: clamp(10px, 1vw, 17px); border: 2px solid var(--line); border-radius: 10px; background: linear-gradient(115deg, rgba(4, 38, 62, .99), rgba(5, 54, 83, .99)); box-shadow: 0 8px 24px rgba(0,0,0,.28); scroll-margin-top: var(--mc-scroll-offset, 0px); }
.history-workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 11px; padding-bottom: 9px; border-bottom: 1px solid rgba(22,119,174,.75); }
.history-workspace-header h2 { margin: 0; color: #d7eaff; font-size: clamp(18px, 1.6vw, 26px); }
.history-workspace-header > div:first-child span { display: block; margin-top: 4px; color: #82bcea; font-size: clamp(10px, .78vw, 13px); }
.history-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.history-toggle { display: inline-flex; overflow: hidden; border: 1px solid #287fad; border-radius: 6px; }
.history-toggle button, .history-close { min-height: 30px; padding: 5px 10px; border: 0; color: #c8e3f7; background: rgba(3,38,62,.82); font: inherit; font-size: clamp(9px, .73vw, 12px); font-weight: 750; cursor: pointer; }
.history-toggle button + button { border-left: 1px solid #287fad; }
.history-toggle button.active { color: #001e31; background: #55b7ef; }
.history-toggle button:hover, .history-toggle button:focus-visible, .history-close:hover, .history-close:focus-visible { outline: none; background: #2387bf; color: white; }
.history-toggle button.active:hover, .history-toggle button.active:focus-visible { color: #001e31; background: #78cbf7; }
.history-close { border: 1px solid #2f91d3; border-radius: 6px; background: rgba(7,87,150,.55); }
.history-loading, .history-inline-error { min-height: 190px; display: grid; place-items: center; color: #9fc9e8; font-size: 15px; }
.history-inline-error { min-height: 80px; border: 1px solid var(--red); border-radius: 7px; color: white; background: rgba(112,14,29,.65); }

.history-content { min-height: 470px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(470px, 1fr); gap: clamp(9px, .85vw, 14px); }
.history-chart-panel, .history-trades-panel { min-width: 0; overflow: hidden; border: 1px solid rgba(31,133,190,.85); border-radius: 8px; background: rgba(2,28,47,.66); }
.history-chart-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.history-chart-summary { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); border-bottom: 1px solid rgba(31,133,190,.65); }
.history-chart-summary > div { padding: 9px 13px; border-right: 1px solid rgba(31,133,190,.55); }
.history-chart-summary > div:last-child { border-right: 0; }
.history-chart-summary span { display: block; color: #8fbddd; font-size: clamp(9px, .78vw, 13px); }
.history-chart-summary strong { display: block; margin-top: 3px; color: var(--blue); font-size: clamp(16px, 1.25vw, 22px); }
.history-chart-summary strong.value-drawdown { color: var(--red); }
.history-chart-wrap { position: relative; min-height: clamp(400px, 60vh, 720px); padding: 5px 8px 1px; }
#history-chart { width: 100%; height: 100%; }
.history-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #93bad8; }
.chart-grid-line { stroke: rgba(112,166,201,.2); stroke-width: 1; }
.chart-time-grid-line { stroke: rgba(112,166,201,.25); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-zero-line { stroke: rgba(225,240,250,.65); stroke-width: 1.5; stroke-dasharray: 6 5; }
.chart-axis-label { fill: #8fb9d7; font-size: 13px; font-weight: 600; }
.chart-time-label { font-size: 13px; font-weight: 750; }
.chart-legend-label { fill: #c9e1f2; font-size: 12px; font-weight: 750; }
.chart-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.performance { stroke: var(--green); }
.chart-line.drawdown { stroke: var(--red); }
.chart-last-point { stroke: white; stroke-width: 2; }
.chart-last-point.performance { fill: var(--green); }
.chart-last-point.drawdown { fill: var(--red); }

.history-trades-panel { contain: size; display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-height: 0; }
.history-trades-panel h3 { margin: 0; padding: 9px 11px; border-bottom: 1px solid rgba(31,133,190,.65); color: #b8d9f5; font-size: clamp(13px, 1vw, 17px); }
.trade-list-head, .trade-list-row { display: grid; grid-template-columns: minmax(64px, .55fr) .82fr 1.45fr 1.45fr .82fr .55fr 1fr; align-items: stretch; }
.trade-list-head { min-height: 34px; padding-right: 7px; border-bottom: 1px solid rgba(31,133,190,.65); background: rgba(8,73,110,.72); }
.trade-list-head span { display: grid; place-items: center; min-width: 0; padding: 7px 2px; color: #e2f2ff; text-align: center; font-size: clamp(10px, .72vw, 13px); font-weight: 850; line-height: 1.08; }
.history-trade-list { min-height: 0; overflow-y: auto; scrollbar-color: #217eaf #031c2d; scrollbar-width: thin; }
.trade-list-row { min-height: 66px; border-bottom: 1px solid rgba(59,123,159,.38); background: rgba(4,40,64,.62); }
.trade-list-row:nth-child(even) { background: rgba(8,53,80,.7); }
.trade-list-row.is-open { box-shadow: inset 3px 0 var(--blue); background: rgba(9,78,112,.78); }
.trade-list-row.is-stop-selected { background: rgba(35,104,143,.85); box-shadow: inset 4px 0 #fff, inset 0 0 0 1px #fff; }
.trade-list-row > span:first-child strong { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.chart-stop-point { cursor: pointer; }
.chart-stop-point:hover, .chart-stop-point:focus { stroke: var(--blue); stroke-width: 3; outline: none; }
.trade-list-row > span { min-width: 0; display: grid; align-content: center; justify-items: center; padding: 6px 3px; border-right: 1px solid rgba(42,112,151,.4); text-align: center; }
.trade-list-row > span:last-child { border-right: 0; }
.trade-list-row strong { max-width: 100%; overflow: hidden; color: #eef8ff; font-size: clamp(11px, .82vw, 14px); line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.trade-list-row small { display: block; max-width: 100%; margin-top: 5px; overflow: hidden; color: #c1ddf0; font-size: clamp(11px, .76vw, 13px); font-weight: 650; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.trade-elite-mobile { display: none !important; }
.trade-list-row.is-open > span:nth-child(2) small { font-size: clamp(8px, .58vw, 10px); font-weight: 650; }
.trade-list-row.is-open > span:nth-child(4) strong { color: #bddbf0; font-size: clamp(9px, .65vw, 11px); font-weight: 700; }
.trade-list-row .trade-buy strong, .trade-list-row .trade-positive strong { color: var(--green); }
.trade-list-row .trade-sell strong, .trade-list-row .trade-negative strong { color: var(--red); }
.trade-list-row .trade-neutral strong { color: var(--blue); }
.trade-list-row .entry-today strong { color: #ffd166; }

.history-page { min-height: 100dvh; margin: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% -20%, rgba(0,112,187,.35), transparent 48%), linear-gradient(135deg, #03111e, #04253c 55%, #03131f); }
.history-shell { width: min(980px, 100%); min-height: min(620px, calc(100dvh - 48px)); display: grid; grid-template-rows: auto 1fr; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(4, 39, 63, .94); box-shadow: 0 18px 45px rgba(0,0,0,.35); }
.history-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: clamp(16px, 2vw, 26px); border-bottom: 1px solid var(--line); }
.history-title { margin: 0; color: white; font-size: clamp(21px, 2.2vw, 34px); }
.history-title span { display: block; margin-top: 6px; color: var(--blue); font-size: .55em; }
.history-back { flex: 0 0 auto; padding: 10px 16px; border: 1px solid #2f91d3; border-radius: 7px; color: white; background: #075796; text-decoration: none; font-weight: 750; }
.history-back:hover, .history-back:focus-visible { background: #0c70bc; outline: 2px solid var(--blue); outline-offset: 2px; }
.history-empty { min-height: 0; }

.login-page { min-height: 100dvh; margin: 0; display: grid; place-items: center; padding: 20px; overflow: auto; background: radial-gradient(circle at 50% -20%, rgba(0,112,187,.38), transparent 48%), linear-gradient(135deg, #03111e, #04253c 55%, #03131f); }
.login-card { width: min(430px, 100%); padding: clamp(24px, 4vw, 38px); border: 2px solid var(--line); border-radius: 12px; background: rgba(4,39,63,.97); box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.login-brand { margin-bottom: 24px; display: flex; justify-content: center; align-items: center; gap: 10px; color: white; text-align: center; font-size: clamp(24px, 4vw, 34px); letter-spacing: .03em; }
.login-brand strong { color: var(--blue); }
.login-brand .site-logo { width: clamp(54px, 10vw, 76px); height: clamp(54px, 10vw, 76px); }
.login-title { margin: 0 0 24px; color: #acd3ff; text-align: center; font-size: clamp(17px, 2.2vw, 22px); }
.login-form { display: grid; gap: 16px; }
.login-field { display: grid; gap: 6px; }
.login-field label { color: var(--muted); font-size: 14px; }
.login-field input { width: 100%; padding: 11px 12px; border: 1px solid #276d98; border-radius: 7px; color: white; background: #031d30; font: inherit; }
.login-field input:focus { border-color: var(--blue); outline: 2px solid rgba(69,162,255,.24); }
.login-remember { display: flex; align-items: center; gap: 9px; color: #c7def2; font-size: 14px; cursor: pointer; }
.login-remember input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); cursor: pointer; }
.login-submit { margin-top: 5px; padding: 11px 15px; border: 1px solid #19c56d; border-radius: 7px; color: #002c18; background: var(--green); font: inherit; font-weight: 850; cursor: pointer; }
.login-submit:hover, .login-submit:focus-visible { background: #67f5a7; outline: 2px solid rgba(57,239,141,.28); outline-offset: 2px; }
.login-error { margin: 0 0 17px; padding: 10px 12px; border: 1px solid var(--red); border-radius: 7px; color: white; background: rgba(112,14,29,.75); font-size: 14px; }
.login-success { margin: 0 0 17px; padding: 10px 12px; border: 1px solid var(--green); border-radius: 7px; color: white; background: rgba(0,89,54,.62); font-size: 14px; }
.login-link { display: block; margin-top: 17px; color: #8fc9ff; text-align: center; font-size: 14px; text-decoration: none; }
.login-link:hover, .login-link:focus-visible { color: white; text-decoration: underline; outline: none; }
.login-note { margin: 18px 0 0; color: #8fb9da; text-align: center; font-size: 12px; }
.pin-login-card { width: min(480px, 100%); }
.pin-instruction, .pin-status { margin: 0 0 12px; color: var(--muted); text-align: center; }
.pin-users { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pin-user, .login-mode-switch, .pin-disable { border: 1px solid #2f91d3; border-radius: 8px; color: white; background: rgba(7,87,150,.45); font: inherit; font-weight: 750; cursor: pointer; }
.pin-user { min-height: 54px; padding: 10px; font-size: 17px; }
.pin-user.is-selected { border-color: var(--green); color: #002c18; background: var(--green); }
.pin-form { margin-top: 16px; }
.pin-dots { min-height: 30px; display: flex; justify-content: center; align-items: center; gap: 13px; margin-bottom: 12px; }
.pin-dots i { width: 13px; height: 13px; border: 2px solid #78baf0; border-radius: 50%; }
.pin-dots i.is-filled { border-color: var(--green); background: var(--green); }
.pin-keypad { width: min(330px, 100%); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.pin-keypad button { min-height: 56px; border: 1px solid #347eae; border-radius: 10px; color: white; background: #073653; font: inherit; font-size: 22px; font-weight: 850; cursor: pointer; }
.pin-keypad button:active { background: #0d6092; }
.pin-keypad .pin-clear { color: #ffd166; }
.pin-keypad .pin-confirm { color: #00341b; background: var(--green); }
.pin-keypad .pin-confirm:disabled { opacity: .35; cursor: default; }
.login-mode-switch { width: 100%; margin-top: 16px; padding: 10px; color: #b9dcfa; background: transparent; }
.pin-disable { padding: 10px 15px; border-color: var(--red); color: #ffd9de; background: rgba(112,14,29,.55); }
.pin-management-card { width: min(470px, 100%); }
.history-header > .site-logo { width: clamp(42px, 5vw, 64px); height: clamp(42px, 5vw, 64px); }
.history-header > .history-title { flex: 1 1 auto; }
html.quick-login-device .login-page { place-items: start center; padding: 8px; }
html.quick-login-device .pin-login-card { width: min(430px, 100%); padding: 14px 18px; }
html.quick-login-device .pin-login-card .login-brand { margin-bottom: 10px; gap: 8px; font-size: 25px; }
html.quick-login-device .pin-login-card .login-brand .site-logo { width: 46px; height: 46px; }
html.quick-login-device .pin-login-card .login-title { margin-bottom: 10px; font-size: 16px; }
html.quick-login-device .pin-instruction { margin-bottom: 6px; font-size: 13px; }
html.quick-login-device .pin-users { gap: 6px; }
html.quick-login-device .pin-user { min-height: 40px; padding: 6px; font-size: 15px; }
html.quick-login-device .pin-form { margin-top: 8px; }
html.quick-login-device .pin-dots { min-height: 20px; gap: 10px; margin-bottom: 5px; }
html.quick-login-device .pin-dots i { width: 10px; height: 10px; }
html.quick-login-device .pin-keypad { width: min(230px, 100%); gap: 5px; }
html.quick-login-device .pin-keypad button { min-height: 36px; border-radius: 7px; font-size: 16px; }
html.quick-login-device .pin-login-card .login-mode-switch { margin-top: 8px; padding: 7px; }
html.quick-login-device .pin-login-card .login-note { margin-top: 7px; font-size: 10px; }
.diagnostic-card { width: min(620px, 100%); }
.diagnostic-grid { display: grid; gap: 0; margin: 0 0 22px; border: 1px solid #276d98; border-radius: 8px; overflow: hidden; }
.diagnostic-grid > div { display: grid; grid-template-columns: minmax(125px, .75fr) minmax(0, 1.6fr); gap: 12px; padding: 9px 11px; border-bottom: 1px solid rgba(39,109,152,.65); }
.diagnostic-grid > div:last-child { border-bottom: 0; }
.diagnostic-grid dt { color: #8fc9ff; white-space: normal; }
.diagnostic-grid dd { overflow-wrap: anywhere; color: white; text-align: left; font-size: 13px; font-weight: 650; white-space: normal; }
.diagnostic-detail { margin: -7px 0 17px; padding: 8px 10px; border-radius: 6px; color: #ffd3d9; background: rgba(112,14,29,.42); font-size: 12px; overflow-wrap: anywhere; }

/* Présentation compacte commune aux écrans PC et Tesla. */
@media (min-width: 821px),
       (min-width: 700px) and (min-height: 500px) and (max-height: 800px) and (orientation: landscape) {
  body { overflow: hidden; }
  .dashboard { width: 100vw; height: 100dvh; min-height: 560px; gap: 5px; padding: 5px 7px; }
  .topbar { min-height: 38px; margin: -5px -7px 0; padding-inline: 15px; }
  .brand { font-size: clamp(22px, 2.2vw, 31px); }
  .topbar h1 { font-size: clamp(17px, 1.7vw, 23px); }
  .refresh-info { gap: 7px; font-size: clamp(10px, 1vw, 14px); }
  .live-dot { width: 12px; margin-left: 4px; }
  .global-status { gap: 5px; }
  .status-pill { min-height: 34px; gap: 8px; border-width: 1px; font-size: clamp(11px, 1.08vw, 15px); }
  .status-pill .check { width: 24px; }
  .robots { grid-template: repeat(4, minmax(0, 1fr)) / 1fr; gap: 5px; }
  .robot-card { grid-template-columns: 12% 9% 35% 14% 30%; }
  .panel { min-height: 0; padding: 7px 9px; }
  .panel h3 { margin-bottom: 5px; padding-bottom: 4px; font-size: clamp(12px, 1.12vw, 16px); }

  .identity { grid-template-rows: minmax(0, 1fr) auto; gap: 4px; text-align: center; }
  .identity-title { grid-template: auto minmax(36px, 1fr) auto / 1fr; justify-items: center; gap: 2px; }
  .identity-title > div { display: contents; }
  .identity h2 { grid-row: 1; font-size: clamp(17px, 1.7vw, 23px); }
  .identity-title .flag { grid-row: 2; width: clamp(47px, 4.5vw, 62px); }
  .identity-title strong { grid-row: 3; font-size: clamp(9px, .84vw, 12px); }
  .identity-title span:not(.flag) { display: none; }
  .market-state { padding: 4px 2px; border-width: 1px; font-size: clamp(8px, .75vw, 11px); }

  .sync { justify-content: center; gap: 8px; }
  .sync > h3 { display: none; }
  .sync-line { flex: 0 0 auto; gap: 8px; font-size: clamp(9px, .8vw, 12px); }
  .sync-line i { width: 16px; }
  .sync-full { display: none !important; }
  .sync-short { display: block !important; color: #e8f5ff; font-weight: 700 !important; }
  .sync-line time { margin-top: 2px; color: #c9e7ff; font-size: clamp(8px, .7vw, 10px); font-weight: 650; }

  .metrics { grid-template-rows: auto auto minmax(43px, 1fr); }
  .metrics-header { margin-bottom: 5px; padding-bottom: 4px; }
  .market-mode { min-width: 92px; padding: 3px 7px; font-size: 9px; }
  .metric-grid { padding-bottom: 4px; }
  .metric-grid > div { padding-inline: 7px; }
  .metric-grid span, .metric-grid small { font-size: clamp(8px, .72vw, 10px); }
  .metric-grid strong { margin-top: 1px; font-size: clamp(13px, 1.28vw, 18px); }
  .gauge { min-height: 43px; padding-top: 19px; }
  .gauge-track { height: 20px; }
  .gauge-track span { font-size: 9px; }
  .gauge-value { font-size: 11px; }
  .gauge-value::after { top: 14px; border-width: 5px; }
  .threshold { bottom: 0; font-size: 10px; }
  .threshold::before { display: none; }

  .market dl, .strategy dl { gap: 5px; }
  dt { font-size: clamp(9px, .76vw, 11px); }
  dd { font-size: clamp(13px, 1.22vw, 17px); }
  .strategy-header { margin-bottom: 5px; padding-bottom: 4px; }
  .history-link { min-height: 23px; padding: 2px 7px; font-size: 8px; }
  .strategy-content { grid-template-columns: minmax(148px, 1fr) minmax(108px, .72fr); height: calc(100% - 25px); gap: 6px; }
  .strategy .entry-date { font-size: clamp(10px, .86vw, 12px); }
  .position { min-width: 82px; padding: 5px 7px; font-size: clamp(10px, 1vw, 14px); }
  .profit-block { padding-left: 7px; }
  .profit-block span { font-size: clamp(8px, .74vw, 10px); }
  .profit-block strong { height: clamp(62px, 8.5vh, 88px); margin-top: 5px; font-size: clamp(18px, 1.65vw, 23px); }
}

@media (max-width: 1180px) {
  .history-content { grid-template-columns: 1fr; }
  .history-trades-panel { contain: none; }
  .history-trade-list { max-height: 420px; }
  .history-workspace-header { align-items: flex-start; flex-direction: column; }
  .history-controls { justify-content: flex-start; }
}

@media (max-width: 1049px) and (min-width: 821px) {
  body { overflow: auto; }
  .dashboard { width: 100%; height: auto; }
  .robots { grid-template: repeat(2, auto) / repeat(2, minmax(0, 1fr)); }
  .robot-card { display: block; margin-bottom: 0; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .identity, .sync, .metrics, .market, .strategy { min-height: 145px; }
  .identity-title { display: grid; grid-template-columns: 58px minmax(0, 1fr); text-align: left; }
  .identity-title > div { display: grid; }
  .identity h2, .identity-title .flag, .identity-title strong { grid-row: auto; }
  .identity-title .flag { width: 100%; }
  .identity-title span:not(.flag) { display: block; }
  .sync > h3 { display: block; }
  .sync-full { display: block !important; }
  .sync-short { display: none !important; }
  .threshold::before { display: block; }
}

@media (max-width: 820px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar h1 { display: none; }
  .trading-fund-estimates { grid-row: 2; width: 100%; height: 42px; }
  .trading-fund-estimates span { font-size: 8px; }
  .trading-fund-estimates strong { font-size: clamp(13px, 3.2vw, 17px); }
  .refresh-info > span:first-child, .refresh-info .live-dot { display: none; }
  .logout-form { margin-left: 2px; }
  .logout-button { padding-inline: 6px; }
  .global-status { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .status-pill { gap: 4px; font-size: clamp(8px, 1.65vw, 12px); }
  .status-pill .check { width: 20px; }
  .history-chart-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-chart-summary > div { border-bottom: 1px solid rgba(31,133,190,.55); }
  .history-chart-summary > div:nth-child(2n) { border-right: 0; }
  .history-chart-summary > div:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .robots { display: block; }
  .robot-card { grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
  .identity, .sync, .metrics { min-height: 150px; }
  .metrics { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .market { grid-column: 1; }
  .strategy { grid-column: 2; }
}

@media (max-width: 560px) {
  .dashboard { min-height: 0; gap: 6px; padding: 6px; }
  .topbar { min-height: 44px; margin: -6px -6px 0; padding-inline: 8px; }
  .brand { gap: 5px; font-size: 17px; }
  .dashboard.is-fund-view .brand { font-size: clamp(12px, 3.2vw, 15px); }
  .brand .site-logo { width: 27px; height: 27px; }
  .brand small { font-size: 10px !important; }
  .refresh-info { font-size: 10px; gap: 5px; }
  .pin-manage-link, .refresh-info #next-refresh { display: none; }
  .logout-button { padding: 4px 6px; }
  .global-status { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
  .status-pill { min-width: 0; min-height: 32px; gap: 3px; padding: 2px; overflow: hidden; font-size: 8px; text-align: center; }
  .status-pill .check { width: 17px; }
  .robots { min-height: 0; display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .robot-card { display: block; min-height: 0; margin: 0; }
  .robot-card > .panel { display: none; }
  .mobile-summary { position: relative; height: 100%; display: grid; grid-template-rows: minmax(0, 1.32fr) minmax(0, .82fr); padding: 7px 8px; }
  .mobile-summary-main { min-height: 0; display: grid; grid-template-columns: .78fr .86fr 2.64fr 24px; align-items: center; }
  .mobile-summary-main > * { min-width: 0; }
  .mobile-summary-main > * + * { border-left: 1px solid rgba(77, 174, 223, .58); }
  .mobile-identity { display: grid; grid-template: auto auto auto / 1fr; align-content: center; justify-items: center; gap: 2px; padding-right: 4px; }
  .mobile-identity div { display: contents; }
  .mobile-identity strong { grid-row: 1; overflow: hidden; font-size: 14px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-flag { grid-row: 2; display: grid; place-items: center; }
  .mobile-flag img { display: block; width: 38px; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid rgba(255,255,255,.7); border-radius: 4px; }
  .mobile-identity div span, .mobile-identity div small { display: none; }
  .mobile-market-state { grid-row: 3; margin-top: 3px; padding: 2px 5px; border: 1px solid #00d56b; border-radius: 4px; color: var(--green); background: rgba(0,89,54,.62); font-size: 7.5px; font-weight: 850; line-height: 1; }
  .mobile-market-state.closed { border-color: var(--red); color: #fff; background: rgba(118,15,28,.72); }
  .mobile-sync { display: grid; gap: 7px; padding: 0 3px; }
  .mobile-sync > div { min-width: 0; display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; gap: 4px; }
  .mobile-sync i { width: 11px; aspect-ratio: 1; border-radius: 50%; }
  .mobile-sync i.ok { background: var(--green); box-shadow: 0 0 7px rgba(57,239,141,.4); }
  .mobile-sync i.ko { background: var(--red); }
  .mobile-sync b { display: block; color: #e7f5ff; font-size: 10px; line-height: 1; }
  .mobile-sync time { display: grid; gap: 1px; margin-top: 3px; color: var(--muted); font-size: 8.5px; line-height: 1; white-space: nowrap; }
  .mobile-gauge { --low: 33%; --high: 67%; --value: 50%; position: relative; padding: 23px 6px 16px; }
  .mobile-summary-metrics span.mobile-entry-label { display: flex; align-items: center; justify-content: center; gap: 3px; }
  .mobile-position { min-width: 15px; height: 15px; padding: 1px 4px; display: inline-grid; place-items: center; border-radius: 4px; color: white; font-size: 8.5px; font-style: normal; font-weight: 900; line-height: 1; }
  .mobile-position[data-position="1"] { background: #078f38; }
  .mobile-position[data-position="-1"] { background: #c62d43; }
  .mobile-position:not([data-position="1"]):not([data-position="-1"]) { background: #0757c6; }
  .mobile-gauge > div { position: relative; height: 20px; display: grid; grid-template-columns: var(--low) calc(var(--high) - var(--low)) calc(100% - var(--high)); overflow: hidden; border-radius: 5px; }
  .mobile-gauge > div::after { content: ''; position: absolute; left: 50%; top: -4px; z-index: 2; transform: translateX(-50%); border: 4px solid transparent; border-bottom-color: white; filter: drop-shadow(0 1px 1px rgba(0,0,0,.7)); pointer-events: none; }
  .mobile-gauge > div span:nth-child(1) { background: #db3148; }
  .mobile-gauge > div span:nth-child(2) { border-inline: 1px solid white; background: #0757c6; }
  .mobile-gauge > div span:nth-child(3) { background: #09a83e; }
  .mobile-gauge-mode { position: absolute; top: 4px; right: 5px; z-index: 3; padding: 2px 4px; border-radius: 4px; color: #00341b; background: var(--green); font-size: 6.5px; font-weight: 900; line-height: 1; }
  .mobile-gauge-mode.is-crash { color: #2d0006; background: var(--red); }
  .mobile-gauge > strong { position: absolute; top: -2px; left: clamp(22px, var(--value), calc(100% - 22px)); transform: translateX(-50%); font-size: 11px; white-space: nowrap; }
  .mobile-gauge > strong::after { content: ''; position: absolute; top: 13px; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: white; }
  .mobile-gauge > strong.gauge-value-call,
  .mobile-gauge > strong.gauge-value-short { padding: 2px 5px; border-radius: 999px; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
  .mobile-gauge > strong.gauge-value-call { background: #078f38; }
  .mobile-gauge > strong.gauge-value-short { background: #c62d43; }
  .mobile-gauge > strong.gauge-value-call::after,
  .mobile-gauge > strong.gauge-value-short::after { top: calc(100% - 1px); }
  .mobile-gauge > strong.gauge-value-call::after { border-top-color: #078f38; }
  .mobile-gauge > strong.gauge-value-short::after { border-top-color: #c62d43; }
  .mobile-gauge > small { position: absolute; bottom: 2px; transform: translateX(-50%); font-size: 8.5px; font-weight: 800; }
  .mobile-gauge > small:nth-of-type(1) { left: var(--low); }
  .mobile-gauge > small:nth-of-type(2) { left: var(--high); }
  .mobile-summary-main > .mobile-card-actions { position: relative; align-self: stretch; display: grid; grid-template-rows: 1fr 1fr; border-left: 0; }
  .mobile-card-actions::before { content: ''; position: absolute; top: 24px; bottom: 0; left: 0; width: 1px; background: rgba(77,174,223,.58); }
  .mobile-detail, .mobile-robot-hide { min-width: 0; padding: 0; border: 0; color: white; background: transparent; cursor: pointer; }
  .mobile-detail { font-size: 25px; line-height: 1; }
  .mobile-robot-hide { display: grid; place-items: center; color: #9dceff; border-top: 1px solid rgba(77,174,223,.42); }
  .mobile-robot-hide svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-summary-metrics { min-height: 0; display: grid; grid-template-columns: .56fr .54fr .58fr 1.05fr .88fr 1.02fr .86fr; align-items: stretch; border-top: 1px solid rgba(77,174,223,.58); }
  .mobile-summary-metrics > div { min-width: 0; display: grid; place-content: center; padding: 3px; text-align: center; }
  .mobile-summary-metrics > div + div { border-left: 1px solid rgba(77,174,223,.58); }
  .mobile-summary-metrics span { color: var(--muted); font-size: 8.5px; white-space: nowrap; }
  .mobile-summary-metrics strong { margin-top: 3px; overflow: hidden; color: var(--blue); font-size: 13px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-summary-metrics > div:nth-child(1) strong,
  .mobile-summary-metrics > div:nth-child(5) strong { overflow: visible; font-size: clamp(10px, 2.6vw, 12px); text-overflow: clip; }
  .mobile-summary-metrics strong.coefficient-warning { color: var(--amber); }
  .mobile-summary-metrics strong.coefficient-danger { color: var(--red); }
  .mobile-entry-date { display: grid; gap: 1px; color: white !important; }
  .mobile-entry-date span { color: inherit; font-size: 10px; font-weight: 800; }
  .mobile-entry-date.is-today { color: #ffd166 !important; }
  .mobile-entry-date.is-recent { color: #65f3ff !important; }
  .mobile-current-price > strong { font-size: 12px; }
  .mobile-current-price > em { margin-top: 2px; font-size: 9px; font-style: normal; font-weight: 800; }
  .mobile-profit strong { width: 100%; padding: 7px 2px; border: 1px solid currentColor; border-radius: 5px; background: rgba(0,76,45,.45); }
  .mobile-profit strong.value-down { background: rgba(118,15,28,.55); }

  .robots.is-history-mode { display: block; }
  .robots.is-history-mode .robot-card { min-height: 0; display: grid; grid-template-columns: .82fr 1.15fr .65fr; overflow: hidden; }
  .robots.is-history-mode .mobile-summary { display: none; }
  .robots.is-history-mode .robot-card > .identity { min-height: 108px; display: grid; grid-column: 1; gap: 3px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .robots.is-history-mode .identity-title { grid-template-columns: 35px minmax(0, 1fr); gap: 5px; text-align: left; }
  .robots.is-history-mode .identity-title .flag { width: 35px; }
  .robots.is-history-mode .identity h2 { font-size: 15px; }
  .robots.is-history-mode .identity-title strong,
  .robots.is-history-mode .identity-title span:not(.flag) { font-size: 8px; }
  .robots.is-history-mode .market-state { padding: 3px 2px; border-width: 1px; font-size: 9px; line-height: 1; }
  .robots.is-history-mode .market-state span:first-child { display: none; }
  .robots.is-history-mode .market-state span:last-child { display: block; }
  .robots.is-history-mode .robot-card > .sync { min-height: 108px; display: flex; grid-column: 2; padding: 7px; border-bottom: 1px solid var(--line); }
  .robots.is-history-mode .mobile-show-all { min-width: 0; display: grid; grid-column: 3; place-content: center; gap: 3px; margin: 7px; padding: 5px; border: 1px solid #45baff; border-radius: 6px; color: white; background: rgba(5,105,169,.9); box-shadow: 0 0 10px rgba(69,186,255,.32); font: inherit; font-size: 9px; font-weight: 750; line-height: 1.1; cursor: pointer; }
  .robots.is-history-mode .mobile-show-all strong { color: white; font-size: 13px; }
  .robots.is-history-mode .sync h3 { margin-bottom: 2px; padding-bottom: 3px; font-size: 11px; }
  .robots.is-history-mode .sync-line { gap: 7px; font-size: 10px; }
  .robots.is-history-mode .sync-line i { width: 12px; }
  .robots.is-history-mode .sync-line time { margin-top: 2px; font-size: 8px; }
  .robots.is-history-mode .sync-line time span { display: inline; }
  .robots.is-history-mode .sync-line time span + span { margin: 0 0 0 4px; font-size: 1em; }
  .robots.is-history-mode .robot-card > .metrics { min-height: 132px; display: grid; grid-column: 1 / -1; padding: 7px 9px; border-bottom: 1px solid var(--line); }
  .robots.is-history-mode .metrics-header { margin-bottom: 4px; padding-bottom: 3px; }
  .robots.is-history-mode .metrics-header h3 { font-size: 12px; }
  .robots.is-history-mode .market-mode { min-width: 76px; padding: 3px 6px; font-size: 8px; }
  .robots.is-history-mode .metric-grid { padding-bottom: 5px; }
  .robots.is-history-mode .metric-grid span,
  .robots.is-history-mode .metric-grid small { font-size: 8px; }
  .robots.is-history-mode .metric-grid strong { margin-top: 2px; font-size: 14px; }
  .robots.is-history-mode .gauge { display: none; }
  .robots.is-history-mode .mobile-history-gauge { --low: 33%; --high: 67%; --value: 50%; min-height: 48px; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 5px; margin-top: 4px; }
  .robots.is-history-mode .mobile-history-gauge-title { color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.05; }
  .robots.is-history-mode .mobile-history-gauge-scale { position: relative; min-width: 0; min-height: 48px; padding: 19px 0 12px; }
  .robots.is-history-mode .mobile-history-gauge-scale > div { position: relative; height: 20px; display: grid; grid-template-columns: var(--low) calc(var(--high) - var(--low)) calc(100% - var(--high)); overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; }
  .robots.is-history-mode .mobile-history-gauge-scale > div::after { content: ''; position: absolute; left: 50%; top: -4px; z-index: 2; transform: translateX(-50%); border: 4px solid transparent; border-bottom-color: white; filter: drop-shadow(0 1px 1px rgba(0,0,0,.7)); pointer-events: none; }
  .robots.is-history-mode .mobile-history-gauge-scale > div span { display: grid; place-items: center; color: white; font-size: 8px; font-weight: 800; }
  .robots.is-history-mode .mobile-history-gauge-scale > div span:nth-child(1) { background: #db3148; }
  .robots.is-history-mode .mobile-history-gauge-scale > div span:nth-child(2) { border-inline: 1px solid white; background: #0757c6; }
  .robots.is-history-mode .mobile-history-gauge-scale > div span:nth-child(3) { background: #09a83e; }
  .robots.is-history-mode .mobile-history-gauge-scale > strong { position: absolute; top: 1px; left: clamp(22px, var(--value), calc(100% - 22px)); transform: translateX(-50%); color: white; font-size: 11px; line-height: 1; white-space: nowrap; }
  .robots.is-history-mode .mobile-history-gauge-scale > strong::after { content: ''; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: white; }
  .robots.is-history-mode .mobile-history-gauge-scale > strong.gauge-value-call,
  .robots.is-history-mode .mobile-history-gauge-scale > strong.gauge-value-short { padding: 2px 5px; border-radius: 999px; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
  .robots.is-history-mode .mobile-history-gauge-scale > strong.gauge-value-call { background: #078f38; }
  .robots.is-history-mode .mobile-history-gauge-scale > strong.gauge-value-short { background: #c62d43; }
  .robots.is-history-mode .mobile-history-gauge-scale > strong.gauge-value-call::after,
  .robots.is-history-mode .mobile-history-gauge-scale > strong.gauge-value-short::after { top: calc(100% - 1px); }
  .robots.is-history-mode .mobile-history-gauge-scale > strong.gauge-value-call::after { border-top-color: #078f38; }
  .robots.is-history-mode .mobile-history-gauge-scale > strong.gauge-value-short::after { border-top-color: #c62d43; }
  .robots.is-history-mode .mobile-history-gauge-scale > small { position: absolute; bottom: 1px; transform: translateX(-50%); color: white; font-size: 9px; font-weight: 800; line-height: 1; }
  .robots.is-history-mode .mobile-history-gauge-scale > small:nth-of-type(1) { left: var(--low); }
  .robots.is-history-mode .mobile-history-gauge-scale > small:nth-of-type(2) { left: var(--high); }
  .robots.is-history-mode .robot-card > .market { min-height: 104px; display: flex; grid-column: 1; padding: 7px 9px; border-right: 1px solid var(--line); }
  .robots.is-history-mode .robot-card > .strategy { min-height: 104px; display: block; grid-column: 2 / -1; padding: 7px 9px; }
  .robots.is-history-mode .market > h3,
  .robots.is-history-mode .strategy-header { margin-bottom: 4px; padding-bottom: 3px; }
  .robots.is-history-mode .market > h3,
  .robots.is-history-mode .strategy-header h3 { font-size: 11px; }
  .robots.is-history-mode .market dl,
  .robots.is-history-mode .strategy dl { gap: 4px; }
  .robots.is-history-mode dt { font-size: 8px; }
  .robots.is-history-mode dd { font-size: 12px; }
  .robots.is-history-mode .history-link { display: none; }
  .robots.is-history-mode .strategy-content { height: 73px; grid-template-columns: minmax(0, 1.25fr) minmax(70px, .75fr); gap: 5px; }
  .robots.is-history-mode .position { min-width: 60px; padding: 4px; font-size: 9px; }
  .robots.is-history-mode .strategy .entry-date { font-size: 9px; }
  .robots.is-history-mode .profit-block { padding-left: 5px; }
  .robots.is-history-mode .profit-block span { font-size: 7px; }
  .robots.is-history-mode .profit-block strong { height: 51px; margin-top: 3px; font-size: 17px; }
  .metric-grid > div { padding-inline: 5px; }
  .history-header { align-items: flex-start; flex-direction: column; }
  .history-workspace { padding: 8px; }
  .history-workspace-header { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 6px; margin-bottom: 7px; padding-bottom: 6px; }
  .history-workspace-header > div:first-child { min-width: 0; }
  .history-workspace-header h2 { overflow: hidden; font-size: 16px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
  .history-workspace-header > div:first-child span { margin-top: 3px; overflow: hidden; font-size: 7.5px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
  .history-controls { flex-wrap: wrap; gap: 4px; }
  .history-toggle button,
  .history-close { min-height: 25px; padding: 3px 6px; font-size: 7px; }
  .history-chart-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .history-chart-summary > div,
  .history-chart-summary > div:nth-child(2n) { padding: 6px 3px; border-right: 1px solid rgba(31,133,190,.55); border-bottom: 0; }
  .history-chart-summary > div:last-child { grid-column: auto; border-right: 0; }
  .history-chart-summary span { font-size: 7px; line-height: 1.05; }
  .history-chart-summary strong { margin-top: 3px; font-size: 12px; line-height: 1; }
  .history-chart-wrap { min-height: 0; padding: 0; }
  #history-chart { display: block; height: auto; }
  .chart-legend-label { font-size: 17px; }
  .trade-list-head,
  .trade-list-row { width: 100%; min-width: 0; grid-template-columns: minmax(42px, .44fr) .44fr 1.08fr 1.08fr .46fr 1.1fr; }
  .trade-list-head > span,
  .trade-list-row > span { grid-row: 1; }
  .trade-list-head { padding-right: 5px; }
  .trade-list-head > span { padding-inline: 1px; font-size: 8px; }
  .trade-list-head > span:nth-child(5) { font-size: 0; }
  .trade-list-head > span:nth-child(5)::before { content: 'G/P'; display: block; font-size: 8px; }
  .trade-list-head > span:nth-child(5)::after { content: 'Pts / E'; display: block; font-size: 7px; }
  .trade-list-head > span:nth-child(5),
  .trade-list-row > span:nth-child(5) { grid-column: 6; }
  .trade-list-head > span:nth-child(6),
  .trade-list-row > span:nth-child(6) { grid-column: 5; }
  .trade-list-head > span:last-child,
  .trade-list-row > span:last-child { display: none; }
  .history-trades-panel { overflow-x: hidden; }
  .history-trade-list { width: 100%; min-width: 0; }
  .trade-list-row { min-height: 54px; }
  .trade-list-row > span { padding: 3px 2px; }
  .trade-list-row strong { font-size: 10px; }
  .trade-list-row small { margin-top: 3px; font-size: 8px; }
  .trade-list-row > span:nth-child(2) strong { font-size: 0; }
  .trade-list-row > span:nth-child(2) strong::after { content: attr(data-mobile-label); font-size: 13px; }
  .trade-list-row.is-open > span:nth-child(2) small { font-size: 6px; }
  .trade-elite-mobile { display: block !important; font-size: 10px !important; }
  .pin-login-card { padding: 20px; }
  .pin-keypad button { min-height: 52px; }
}

@media (max-height: 720px) and (min-width: 1281px) {
  .dashboard { gap: 5px; padding-top: 5px; padding-bottom: 5px; }
  .topbar { min-height: 42px; }
  .global-status .status-pill { min-height: 34px; }
  .panel { padding-top: 6px; padding-bottom: 6px; }
  .panel h3 { margin-bottom: 4px; }
  .gauge { min-height: 46px; padding-top: 23px; }
  .gauge-track { height: 20px; }
}

/* Cette disposition garde toujours les quatre robots sur quatre rangées. */
@media (min-width: 821px),
       (min-width: 700px) and (min-height: 500px) and (max-height: 800px) and (orientation: landscape) {
  body { overflow: hidden; }
  .dashboard { width: 100vw; height: 100dvh; min-height: 560px; }
  .topbar { grid-template-columns: 1fr auto; }
  .topbar h1 { display: none; }
  .refresh-info > span:first-child, .refresh-info .live-dot { display: none; }

  .global-status { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .status-pill { min-width: 0; }

  .robots { min-height: 0; display: grid; grid-template: repeat(4, minmax(0, 1fr)) / 1fr; gap: 5px; }
  .robot-card { display: grid; grid-template-columns: 12% 9% 35% 14% 30%; margin: 0; }
  .panel { min-height: 0; border-right: 1px solid var(--line); border-bottom: 0; }
  .panel:last-child { border-right: 0; }

  .identity { min-height: 0; grid-template-rows: minmax(0, 1fr) auto; text-align: center; }
  .identity-title { grid-template: auto minmax(30px, 1fr) auto / 1fr; justify-items: center; text-align: center; }
  .identity-title > div { display: contents; }
  .identity h2 { grid-row: 1; }
  .identity-title .flag { grid-row: 2; width: clamp(42px, 5vw, 52px); }
  .identity-title strong { grid-row: 3; }
  .identity-title span:not(.flag) { display: none; }

  .sync { min-height: 0; justify-content: center; }
  .sync > h3 { display: none; }
  .sync-full { display: none !important; }
  .sync-short { display: block !important; }

  .metrics, .market, .strategy { min-height: 0; grid-column: auto; }
  .threshold::before { display: none; }
  .strategy-content { grid-template-columns: minmax(112px, 1fr) minmax(82px, .72fr); }
}

/* Organisation interne identique sur PC et Tesla. */
@media (min-width: 821px),
       (min-width: 700px) and (min-height: 500px) and (max-height: 800px) and (orientation: landscape) {
  .identity-title { grid-template: auto auto auto / 1fr; align-content: center; row-gap: 1px; }

  .sync { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 1px; align-items: stretch; }
  .sync-line { min-height: 0; flex-direction: column; justify-content: center; gap: 1px; overflow: hidden; text-align: center; font-size: 8px; line-height: 1; }
  .sync-line i { width: 10px; }
  .sync-line time { margin-top: 1px; font-size: 7px; line-height: 1; }
  .sync-line time span { line-height: 1.05; }

  .metrics-header,
  .strategy-header,
  .market > h3 { height: 22px; min-height: 22px; margin: 0 0 3px; padding: 0 0 3px; align-items: center; }
  .market > h3 { display: flex; }
  .metrics-header h3,
  .strategy-header h3,
  .market > h3 { font-size: 10px; line-height: 1; }
  .metrics-chart-button { width: 18px; height: 18px; padding: 2px; }

  .market-mode { min-width: 53px; padding: 2px 5px; font-size: 0; line-height: 1; }
  .market-mode::after { content: attr(data-short); font-size: 7px; }
  .history-link { min-height: 16px; padding: 1px 4px; border-radius: 4px; font-size: 6.5px; line-height: 1; }
  .position { min-width: 62px; max-width: 68px; padding: 3px 4px; border-radius: 5px; font-size: 9px; line-height: 1; }

  .market dl { gap: 2px; }
  .market dl > div { gap: 4px; }
  .market dt { line-height: .95; white-space: normal; }
  .market dd { font-size: clamp(12px, 1.45vw, 15px); }
  .label-full { display: none; }
  .label-compact { display: inline; }

  .metrics { grid-template-rows: auto auto minmax(39px, 1fr); }
  .gauge { align-self: start; min-height: 39px; margin-top: clamp(3px, 1vh, 10px); padding-top: 16px; }
  .gauge-track { height: 18px; }
  .gauge-value::after { top: 13px; }
  .gauge-title { top: 1px; font-size: 7px; }
  .threshold { bottom: 4px; }
}

/* Sur PC, le pointeur précis distingue une fenêtre Windows rétrécie de la
   tablette tactile Tesla. Les tailles évoluent progressivement avec la largeur. */
@media (min-width: 821px) and (hover: hover) and (pointer: fine) {
  html:not(.tesla-browser) .dashboard { gap: 8px; padding: 10px 12px; }
  html:not(.tesla-browser) .topbar { min-height: 58px; margin: -10px -12px 0; padding-inline: 24px; }
  html:not(.tesla-browser) .brand { font-size: clamp(28px, 2.5vw, 36px); }
  html:not(.tesla-browser) .refresh-info { gap: 12px; font-size: clamp(12px, 1.1vw, 16px); }
  html:not(.tesla-browser) .global-status { gap: 8px; }
  html:not(.tesla-browser) .status-pill { min-height: 46px; font-size: clamp(14px, 1.25vw, 18px); }
  html:not(.tesla-browser) .status-pill .check { width: 29px; }
  html:not(.tesla-browser) .robots { gap: 8px; }

  html:not(.tesla-browser) .panel { padding: 11px 13px; }
  html:not(.tesla-browser) .identity h2 { font-size: clamp(22px, 2vw, 29px); }
  html:not(.tesla-browser) .identity-title .flag { width: clamp(54px, 4.6vw, 68px); }
  html:not(.tesla-browser) .identity-title strong { font-size: clamp(11px, 1vw, 15px); }
  html:not(.tesla-browser) .market-state { padding: 7px 3px; font-size: clamp(10px, .9vw, 14px); }

  html:not(.tesla-browser) .sync-line { font-size: clamp(10px, 1vw, 14px); }
  html:not(.tesla-browser) .sync-line i { width: clamp(14px, 1.2vw, 18px); }
  html:not(.tesla-browser) .sync-line time { font-size: clamp(8px, .85vw, 12px); }

  html:not(.tesla-browser) .metrics-header,
  html:not(.tesla-browser) .strategy-header,
  html:not(.tesla-browser) .market > h3 { height: 30px; min-height: 30px; margin-bottom: 7px; padding-bottom: 6px; }
  html:not(.tesla-browser) .metrics-header h3,
  html:not(.tesla-browser) .strategy-header h3,
  html:not(.tesla-browser) .market > h3 { font-size: clamp(13px, 1.25vw, 18px); }
  html:not(.tesla-browser) .metrics-chart-button { width: 22px; height: 22px; padding: 3px; }
  html:not(.tesla-browser) .market-mode { min-width: clamp(72px, 7vw, 100px); padding: 4px 9px; }
  html:not(.tesla-browser) .market-mode::after { font-size: clamp(8px, .75vw, 11px); }
  html:not(.tesla-browser) .history-link { min-height: 25px; padding: 3px 9px; font-size: clamp(8px, .7vw, 10px); }

  html:not(.tesla-browser) .metric-grid { padding-bottom: 8px; }
  html:not(.tesla-browser) .metric-grid > div { padding-inline: 10px; }
  html:not(.tesla-browser) .metric-grid span,
  html:not(.tesla-browser) .metric-grid small { font-size: clamp(10px, .9vw, 13px); }
  html:not(.tesla-browser) .metric-grid strong { margin-top: 3px; font-size: clamp(17px, 1.55vw, 22px); }

  html:not(.tesla-browser) .market dl,
  html:not(.tesla-browser) .strategy dl { gap: 8px; }
  html:not(.tesla-browser) dt { font-size: clamp(10px, .9vw, 14px); }
  html:not(.tesla-browser) dd { font-size: clamp(16px, 1.6vw, 23px); }
  html:not(.tesla-browser) .position { min-width: clamp(68px, 7vw, 94px); max-width: 108px; padding: 8px 10px; font-size: clamp(12px, 1.2vw, 18px); }
  html:not(.tesla-browser) .strategy .entry-date { font-size: clamp(11px, 1.1vw, 16px); }
  html:not(.tesla-browser) .profit-block span { font-size: clamp(10px, .9vw, 14px); }
  html:not(.tesla-browser) .profit-block strong { height: clamp(82px, 8vw, 112px); font-size: clamp(22px, 2.1vw, 30px); }

  html:not(.tesla-browser) .metrics { grid-template-rows: auto auto minmax(82px, 1fr); }
  html:not(.tesla-browser) .gauge { min-height: 82px; margin-top: 0; padding-top: 30px; }
  html:not(.tesla-browser) .gauge-title { top: 3px; font-size: clamp(10px, .9vw, 13px); }
  html:not(.tesla-browser) .gauge-track { height: clamp(20px, 1.5vw, 22px); }
  html:not(.tesla-browser) .gauge-track span { font-size: clamp(10px, .9vw, 13px); }
  html:not(.tesla-browser) .gauge-value { top: 4px; font-size: clamp(13px, 1.2vw, 17px); }
  html:not(.tesla-browser) .gauge-value::after { top: 20px; border-width: 7px; }
  html:not(.tesla-browser) .threshold { top: 54px; bottom: auto; transform: translateX(-50%); font-size: clamp(11px, 1vw, 14px); }
}

/* Ajustements verticaux propres à l'écran tactile Tesla. */
@media (min-width: 700px) and (orientation: landscape) {
  html.tesla-browser .topbar { min-height: 34px; }
  html.tesla-browser .global-status { gap: 4px; }
  html.tesla-browser .status-pill { min-height: 30px; }
  html.tesla-browser .robots { gap: 4px; }
  html.tesla-browser .panel { padding: 4px 7px; }
  html.tesla-browser .panel h3 { margin-bottom: 2px; padding-bottom: 2px; }
  html.tesla-browser .sync { gap: 5px; padding-top: 8px; padding-bottom: 8px; }
  html.tesla-browser .sync-line { overflow: visible; }
  html.tesla-browser .sync-line i { width: 10px; }
  html.tesla-browser .sync-line time span:last-child { margin-top: 2px; font-size: 1.25em; }

  html.tesla-browser .dashboard { min-height: 0; gap: 4px; padding: 4px 6px; }
  html.tesla-browser .metrics-header,
  html.tesla-browser .strategy-header,
  html.tesla-browser .market > h3 { height: 18px; min-height: 18px; margin-bottom: 2px; padding-bottom: 2px; }
  html.tesla-browser .metrics-chart-button { width: 16px; height: 16px; padding: 1px; }
  html.tesla-browser .metric-grid { padding-bottom: 2px; }
  html.tesla-browser .metric-grid > div { padding: 3px 5px; }
  html.tesla-browser .metric-grid span,
  html.tesla-browser .metric-grid small { font-size: 7px; line-height: 1; }
  html.tesla-browser .metric-grid strong { margin-top: 1px; font-size: 12px; line-height: 1; }
  html.tesla-browser .metrics { grid-template-rows: 18px auto minmax(46px, 1fr); }
  html.tesla-browser .gauge { height: 46px; min-height: 46px; margin-top: 0; padding-top: 23px; }
  html.tesla-browser .gauge-title { top: 3px; font-size: 8px; }
  html.tesla-browser .gauge-value { top: 10px; font-size: 9px; }
  html.tesla-browser .gauge-track { height: 12px; }
  html.tesla-browser .gauge-track span { font-size: 7px; }
  html.tesla-browser .gauge-value::after { top: 9px; border-width: 4px; }
  html.tesla-browser .threshold { top: 38px; bottom: auto; font-size: 8px; line-height: 1; transform: translateX(-50%); }

  html.tesla-browser .market dl,
  html.tesla-browser .strategy dl { gap: 2px; }
  html.tesla-browser dt { font-size: 8px; }
  html.tesla-browser dd { font-size: 12px; }
  html.tesla-browser .position { padding: 3px 4px; font-size: 9px; }
  html.tesla-browser .profit-block strong { height: clamp(48px, 7vh, 66px); margin-top: 3px; font-size: 18px; }

  html.tesla-browser .strategy { display: grid; grid-template-rows: 18px minmax(0, 1fr); }
  html.tesla-browser .strategy-content { height: auto; min-height: 0; }

  html.tesla-browser:not(.tesla-fullscreen) .fund-overview-layout { margin-top: 5px; grid-template-columns: minmax(270px, .48fr) minmax(0, 1.95fr); gap: 5px; }
  html.tesla-browser:not(.tesla-fullscreen) .fund-estimates,
  html.tesla-browser:not(.tesla-fullscreen) .fund-overview { min-height: 62px; }
  html.tesla-browser:not(.tesla-fullscreen) .fund-overview:not(.fund-risk-overview) { grid-template-columns: .8fr .9fr .8fr 1.5fr minmax(78px, .9fr) minmax(95px, 1fr); }
  html.tesla-browser:not(.tesla-fullscreen) .fund-overview.fund-risk-overview { grid-template-columns: minmax(0, 3fr) minmax(70px, .8fr) minmax(0, 2fr); }
  html.tesla-browser:not(.tesla-fullscreen) .fund-overview-item { padding: 3px 4px; grid-template-rows: 30px minmax(22px, auto); gap: 1px; }
  html.tesla-browser:not(.tesla-fullscreen) .fund-overview-item > span { height: 30px; font-size: 9px; line-height: 1.05; }
  html.tesla-browser:not(.tesla-fullscreen) .fund-overview-item strong { max-width: 100%; overflow: hidden; font-size: 14px; line-height: 1.05; }
  html.tesla-browser:not(.tesla-fullscreen) .fund-estimates .fund-overview-item { padding-inline: 2px; }
  html.tesla-browser:not(.tesla-fullscreen) .fund-overview .fund-overview-item:nth-child(n+4) { padding-inline: 2px; }

  html.tesla-browser.tesla-fullscreen .dashboard { gap: 5px; padding: 5px 7px; }
  html.tesla-browser.tesla-fullscreen .topbar { min-height: 38px; }
  html.tesla-browser.tesla-fullscreen .status-pill { min-height: 34px; font-size: clamp(11px, 1.08vw, 15px); }
  html.tesla-browser.tesla-fullscreen .panel { padding: 6px 8px; }
  html.tesla-browser.tesla-fullscreen .panel h3 { margin-bottom: 4px; padding-bottom: 3px; }
  html.tesla-browser.tesla-fullscreen .metrics-header,
  html.tesla-browser.tesla-fullscreen .strategy-header,
  html.tesla-browser.tesla-fullscreen .market > h3 { height: 22px; min-height: 22px; margin-bottom: 3px; padding-bottom: 3px; }
  html.tesla-browser.tesla-fullscreen .metrics-header h3,
  html.tesla-browser.tesla-fullscreen .strategy-header h3,
  html.tesla-browser.tesla-fullscreen .market > h3 { font-size: 11px; }
  html.tesla-browser.tesla-fullscreen .metrics-chart-button { width: 20px; height: 20px; padding: 2px; }
  html.tesla-browser.tesla-fullscreen .metric-grid { padding-bottom: 4px; }
  html.tesla-browser.tesla-fullscreen .metric-grid > div { padding: 4px 7px; }
  html.tesla-browser.tesla-fullscreen .metric-grid span,
  html.tesla-browser.tesla-fullscreen .metric-grid small { font-size: 9px; }
  html.tesla-browser.tesla-fullscreen .metric-grid strong { font-size: 15px; }
  html.tesla-browser.tesla-fullscreen .sync-line time { font-size: 9px; }
  html.tesla-browser.tesla-fullscreen .sync-line time span:last-child { font-size: 1.2em; }
  html.tesla-browser.tesla-fullscreen .metrics { grid-template-rows: 22px auto minmax(48px, 1fr); }
  html.tesla-browser.tesla-fullscreen .gauge { height: 48px; min-height: 48px; padding-top: 24px; }
  html.tesla-browser.tesla-fullscreen .gauge-title { top: 4px; font-size: 9px; }
  html.tesla-browser.tesla-fullscreen .gauge-value { top: 10px; font-size: 10px; }
  html.tesla-browser.tesla-fullscreen .gauge-track { height: 14px; }
  html.tesla-browser.tesla-fullscreen .gauge-track span { font-size: 8px; }
  html.tesla-browser.tesla-fullscreen .threshold { top: 40px; font-size: 8px; }
  html.tesla-browser.tesla-fullscreen .market dl,
  html.tesla-browser.tesla-fullscreen .strategy dl { gap: 4px; }
  html.tesla-browser.tesla-fullscreen dt { font-size: 9px; }
  html.tesla-browser.tesla-fullscreen dd { font-size: 14px; }
  html.tesla-browser.tesla-fullscreen .position { padding: 5px 7px; font-size: 11px; }
  html.tesla-browser.tesla-fullscreen .profit-block strong { height: clamp(58px, 8vh, 78px); font-size: 21px; }
  html.tesla-browser.tesla-fullscreen .strategy { grid-template-rows: 22px minmax(0, 1fr); }
}

/* Compact trade layout: static preview from the supplied sheet. */
.fund-trades { margin-top: 12px; border: 2px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.fund-trades-header { min-height: 34px; padding: 5px 12px; display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.fund-trades-header h2 { margin: 0; color: #acd3ff; font-size: 16px; }
.fund-trades-header-tools { display: flex; align-items: center; gap: 10px; }
.fund-trades-header-tools > span { color: var(--amber); font-size: 11px; }
.fund-trades-detail-toggle { height: 31px; padding: 5px 8px; display: inline-flex; align-items: center; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--panel-2); cursor: pointer; }
.fund-trades-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.fund-trades-scroll { min-width: 0; overflow-x: auto; }
.fund-trades-summary { border-left: 2px solid var(--line); }
.fund-trades-table { width: 100%; height: 100%; border-collapse: collapse; font-size: clamp(11px, .86vw, 14px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fund-trades-table th, .fund-trades-table td { padding: 5px 9px; text-align: right; }
.fund-trades-table th:first-child { text-align: left; }
.fund-trades-table thead { color: var(--muted); background: var(--panel-2); }
.fund-trades-table thead th { height: 28px; }
.fund-trades-table tbody th, .fund-trades-table tbody td { height: 38px; border-top: 1px solid rgba(22,119,174,.4); }
.fund-trades-table tbody td { font-weight: 700; }
.fund-trades-table small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 400; }
.fund-trades-table thead small { display: inline-block; margin-left: 4px; font-size: 9px; }
.fund-trades-table .trade-buy { color: var(--green); }
.fund-trades-table .trade-sell { color: #ff7384; }
.fund-trades-table .trade-next { color: var(--muted); font-size: 11px; font-weight: 400; }
.fund-trades-table .trade-leverage-current.coefficient-warning,
.fund-trades-table .trade-leverage-next-value.coefficient-warning { color: var(--amber); }
.fund-trades-table .trade-leverage-current.coefficient-danger,
.fund-trades-table .trade-leverage-next-value.coefficient-danger { color: var(--red); }
.fund-trades-table .trade-eu { background: rgba(69,162,255,.06); border-left: 1px solid rgba(22,119,174,.4); border-right: 1px solid rgba(22,119,174,.4); }
.fund-trades-table .trade-total { background: rgba(69,162,255,.12); border-left: 1px solid var(--line); }
@media (max-width: 1150px) {
  .fund-trades-layout { grid-template-columns: 1fr; }
  .fund-trades-summary { border-left: 0; border-top: 2px solid var(--line); overflow-x: auto; }
  .fund-trades-summary .fund-trades-table { height: auto; }
  .fund-trades-summary .fund-trades-table tbody th, .fund-trades-summary .fund-trades-table tbody td { height: auto; }
  .fund-trades-summary .fund-trades-table small { display: inline; margin-left: 8px; }
}
@media (min-width: 1151px) {
  .fund-trades-header h2 { font-size: 18px; }
  .fund-trades-header-tools > span { font-size: 12px; }
  .fund-trades-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .fund-trades-table { font-size: clamp(15px, 1.3vw, 21px); }
  .fund-trades-table th, .fund-trades-table td { padding: 4px 6px; }
  .fund-trades-table small { font-size: clamp(12px, .95vw, 15px); }
  .fund-trades-table thead small { display: block; margin-left: 0; font-size: 11px; }
  .fund-trades-table .trade-next { font-size: clamp(13px, 1.05vw, 17px); }
  .fund-trades-table .trade-total { width: 140px; min-width: 140px; }
  .fund-trades-table tbody .trade-total small { margin: 1px 0 0; line-height: 1.05; white-space: nowrap; }
  .fund-trades-table { height: auto; line-height: 1.2; }
  .fund-trades-table thead th { height: 48px; }
  .fund-trades-table tbody th, .fund-trades-table tbody td { height: 54px; vertical-align: top; }
  .fund-trades-table tbody tr:last-child th, .fund-trades-table tbody tr:last-child td { height: 68px; }
}

.fund-table.is-stake-hidden .fund-stake-detail { display: none; }
.fund-stake-heading { display: inline-flex; align-items: center; gap: 8px; }
.fund-table .fund-stake-total { border-left: 1px solid var(--line); background: rgba(69,162,255,.08); }
.fund-table .fund-stake-detail { width: 9%; min-width: 105px; background: rgba(69,162,255,.04); }
#fund-stake-toggle { width: 25px; height: 25px; padding: 0; font-size: 20px; line-height: 1; }
.fund-stake-preview { color: var(--amber); font-size: 10px; font-weight: 400; }

.fund-table.is-virement-hidden .fund-virement { display: none; }
.fund-table .fund-equity { display: block; margin-top: 3px; color: var(--muted); }
.fund-virement-toggle { width: auto; padding: 4px 8px; font-size: 12px; }
.fund-mobile-stakes-toggle { display: none; }
.fund-transfers-toggle { width: auto; grid-auto-flow: column; gap: 5px; padding: 4px 8px; font-size: 12px; }
.fund-transfers-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fund-transfers-toggle.is-active { color: #05243a; border-color: var(--green); background: var(--green); }
.fund-transfers-view { min-height: 250px; }
.fund-transfers-toolbar { min-height: 42px; padding: 6px 12px 6px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.fund-transfers-toolbar button, .fund-transfer-editor button { padding: 6px 9px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--panel-2); cursor: pointer; }
.fund-transfers-toolbar span { color: var(--amber); font-size: 11px; }
.fund-vni-toolbar-settings { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.fund-vni-display-toggle { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid rgba(69,162,255,.75); border-radius: 6px; }
.fund-transfers-toolbar .fund-vni-display-toggle { color: #9dceff; font-size: 12px; }
.fund-vni-display-toggle button { min-width: 82px; border: 0; border-radius: 0; color: #9dceff; background: rgba(7,65,105,.45); }
.fund-vni-display-toggle button + button { border-left: 1px solid rgba(69,162,255,.75); }
.fund-vni-display-toggle button.is-active { color: #05243a; background: var(--green); }
.fund-transfers-table { width: 100%; border-collapse: collapse; font-size: clamp(13px, 1.1vw, 17px); font-variant-numeric: tabular-nums; }
.fund-transfers-table th, .fund-transfers-table td { padding: 10px 14px; border-bottom: 1px solid rgba(22,119,174,.4); text-align: right; }
.fund-transfers-table th { color: var(--muted); background: rgba(7,54,83,.6); }
.fund-transfers-table th:nth-child(-n+3), .fund-transfers-table td:nth-child(-n+3) { text-align: left; }
.fund-transfers-table:not(.fund-stakes-history-table) thead th { text-align: center; }
.fund-transfers-table:not(.fund-stakes-history-table) tbody td:nth-child(2),
.fund-transfers-table:not(.fund-stakes-history-table) tbody td:nth-child(5) { text-align: center; }
.fund-transfers-table .fund-transfer-user { width: 7%; padding-left: 10px; padding-right: 6px; color: rgba(183,214,244,.62); font-size: .72em; font-weight: 400; white-space: nowrap; }
.fund-transfers-table:not(.fund-stakes-history-table) td.fund-transfer-movement { text-align: center; }
.fund-transfers-table .fund-transfer-appro { color: var(--green); }
.fund-transfers-table .fund-transfer-withdrawal { color: var(--red); }
.fund-transfers-table th:last-child, .fund-transfers-table td:last-child { width: 52px; padding-left: 5px; padding-right: 5px; text-align: center; }
.fund-transfers-table .fund-empty { height: 90px; text-align: center; }
.fund-stakes-history-table { table-layout: fixed; }
.fund-stakes-history-table col.fund-stake-history-date-column { width: 11%; }
.fund-stakes-history-table col.fund-stake-history-account-column { width: 15%; }
.fund-stakes-history-table th:last-child, .fund-stakes-history-table td:last-child { width: auto; padding: 10px 14px; text-align: right; }
.fund-stakes-history-table th:nth-child(n+3):nth-child(-n+7),
.fund-stakes-history-table td:nth-child(n+3):nth-child(-n+7) { text-align: right; white-space: nowrap; }
.fund-stakes-history-table td.fund-stake-history-robot-cell { text-align: right; white-space: nowrap; }
.fund-stake-history-before { color: rgba(183,214,244,.7); }
.fund-stakes-history-table strong { color: var(--text); font-weight: 700; }
.fund-stake-history-unchanged { color: var(--text); }
.fund-stake-history-percentage { display: block; margin-top: 2px; color: var(--muted); font-size: .8em; font-weight: 400; line-height: 1.05; }
.fund-stake-history-group-start > td { border-top: 2px solid var(--blue); }
.fund-stake-history-group-date { position: relative; vertical-align: top; padding-top: 13px !important; background: rgba(69,162,255,.07); font-weight: 700; white-space: nowrap; }
.fund-stake-history-group-date small { display: block; margin-top: 3px; color: var(--muted); font-size: .78em; font-weight: 400; }
.fund-stake-history-group-date .fund-stake-history-delete { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.fund-stakes-history-table td.fund-stake-history-total-cell { border-left: 1px solid var(--line); background: rgba(69,162,255,.05); text-align: right; white-space: nowrap; }
.fund-stake-history-group-total > td { border-top: 1px solid rgba(69,162,255,.75); background: rgba(69,162,255,.08); font-weight: 800; }
.fund-stake-history-group-total .fund-stake-history-percentage { font-weight: 400; }
.fund-transfer-account { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.fund-transfer-route { text-align: left; white-space: nowrap; }
.fund-transfer-route-content { display: grid; grid-template-columns: 145px 28px 145px; align-items: center; justify-content: center; width: 100%; }
.fund-transfer-route-account { min-width: 0; text-align: left; }
.fund-transfer-route-content > .fund-transfer-route-account:last-child { padding-left: 12px; }
.fund-transfer-route-arrow { color: var(--blue); font-size: 1.15em; font-weight: 800; text-align: center; }
.fund-transfer-route-heading > span:first-child { padding-right: 7px; text-align: right; }
.fund-transfer-route-heading > span:last-child { padding-left: 14px; text-align: left; }
.fund-transfer-account img, .fund-transfer-cash-logo { width: 25px; height: 25px; flex: 0 0 25px; object-fit: contain; }
.fund-transfer-cash-logo { display: grid; place-items: center; border: 1px solid var(--green); border-radius: 50%; color: var(--green); background: rgba(57,239,141,.1); font-size: 14px; font-weight: 900; }
.fund-transfer-editor { padding: 12px; display: grid; grid-template-columns: 1.1fr 1fr 1fr .8fr auto; align-items: end; gap: 10px; border-top: 1px solid var(--line); background: rgba(69,162,255,.04); }
.fund-stake-history-editor { padding: 10px 12px; border-top: 1px solid var(--line); background: rgba(69,162,255,.04); }
.fund-stake-history-editor[hidden] { display: none; }
.fund-stake-history-editor-heading { margin-bottom: 8px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.fund-stake-history-editor-heading label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.fund-stake-history-editor-heading input { height: 32px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--bg); font: inherit; }
.fund-stake-history-entry-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fund-stake-history-entry-table th, .fund-stake-history-entry-table td { padding: 5px 8px; border-top: 1px solid rgba(22,119,174,.4); text-align: right; }
.fund-stake-history-entry-table th { color: var(--muted); background: rgba(7,54,83,.6); }
.fund-stake-history-entry-table th:first-child, .fund-stake-history-entry-table td:first-child { text-align: left; }
.fund-stake-history-entry-table input { box-sizing: border-box; width: 100%; max-width: 180px; height: 29px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: var(--bg); text-align: right; font: inherit; }
.fund-stake-history-entry-table input:focus { border-color: var(--blue); outline: 2px solid rgba(69,162,255,.24); }
.fund-stake-history-editor button { padding: 6px 9px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--panel-2); cursor: pointer; }
.fund-stake-history-chart-panel { padding: 7px 12px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(2,28,47,.42); }
.fund-stake-history-chart-legend { display: flex; justify-content: center; gap: 18px; color: var(--muted); font-size: 11px; }
.fund-stake-history-chart-legend label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.fund-stake-history-chart-legend input { margin: 0; accent-color: var(--series-color); }
.fund-stake-history-chart-legend span::before { content: ''; display: inline-block; width: 14px; height: 3px; margin-right: 5px; border-radius: 2px; vertical-align: middle; background: var(--series-color); }
.fund-stake-history-chart-legend [data-series="total"] { --series-color: #f4f8ff; }
.fund-stake-history-chart-legend [data-series="cac"] { --series-color: #ff5b75; }
.fund-stake-history-chart-legend [data-series="dax"] { --series-color: #39ef8d; }
.fund-stake-history-chart-legend [data-series="sp"] { --series-color: #ffc94d; }
.fund-stake-history-chart-legend [data-series="aus"] { --series-color: #55c7ff; }
#fund-stake-history-chart { display: block; width: 100%; height: 185px; overflow: visible; }
#fund-stake-history-chart .chart-grid { stroke: rgba(143,189,221,.2); stroke-width: 1; }
#fund-stake-history-chart .chart-axis-label { fill: #8fbddd; font-size: 11px; }
#fund-stake-history-chart .chart-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
#fund-stake-history-chart .chart-line-total { stroke-width: 3; }
#fund-stake-history-chart .chart-point { stroke-width: 1.5; }
#fund-stake-history-chart .chart-empty { fill: #8fbddd; font-size: 15px; text-anchor: middle; }
.fund-stake-history-chart-tooltip { position: fixed; z-index: 1000; min-width: 145px; padding: 7px 9px; border: 1px solid var(--blue); border-radius: 5px; color: var(--text); background: rgba(2,28,47,.96); box-shadow: 0 4px 12px rgba(0,0,0,.38); font-size: 12px; line-height: 1.35; font-variant-numeric: tabular-nums; pointer-events: none; }
.fund-stake-history-chart-tooltip[hidden] { display: none; }
.fund-stake-history-tooltip-date { display: block; padding-bottom: 4px; margin-bottom: 3px; border-bottom: 1px solid rgba(69,162,255,.45); text-align: center; }
.fund-stake-history-tooltip-grid { display: grid; grid-template-columns: auto auto; column-gap: 18px; row-gap: 1px; }
.fund-stake-history-tooltip-grid > span:nth-child(odd) { text-align: left; }
.fund-stake-history-tooltip-grid > span:nth-child(even) { text-align: right; }
.fund-stake-history-editor button:disabled { opacity: .42; cursor: default; }
.fund-vni-history-editor { padding: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(69,162,255,.04); }
.fund-invoice-editor { padding: 12px; display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); align-items: end; gap: 10px; border-top: 1px solid var(--line); background: rgba(69,162,255,.04); }
.fund-invoice-editor[hidden] { display: none; }
.fund-invoice-editor label[hidden] { display: none; }
.fund-invoice-editor .fund-transfer-editor-actions { justify-content: flex-end; margin-top: 10px; }.fund-invoice-editor .fund-transfer-editor-actions button { padding: 6px 9px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--panel-2); cursor: pointer; }
.fund-invoice-editor label:has(#fund-invoice-payment-date) { order: 9; }.fund-invoice-editor #fund-invoice-drop { order: 10; }.fund-invoice-editor .fund-transfer-editor-actions { order: 11; }
.fund-invoice-editor label, .fund-supplier-panel label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.fund-invoice-editor #fund-invoice-entry-date:disabled { border-color: transparent; color: var(--text); background: transparent; cursor: default; opacity: 1; }
#fund-supplier-editor > label:nth-child(2),
#fund-supplier-editor > label:nth-child(3),
#fund-supplier-editor > label:nth-child(12),
#fund-supplier-editor > .fund-transfer-modal-actions { grid-column: 1 / -1; }
#fund-supplier-editor > label:nth-child(10),
#fund-supplier-editor > label:nth-child(11) { grid-column: 1 / span 2; }
#fund-supplier-editor > .fund-transfer-modal-actions { width: 100%; box-sizing: border-box; }
#fund-supplier-list select { box-sizing: border-box; width: 100%; min-height: 36px; padding: 6px 9px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--bg); font: inherit; }
#fund-supplier-list .fund-supplier-existing-picker { width: 100%; min-width: 0; }
#fund-supplier-list .fund-transfer-picker-menu { overflow-x: hidden; }
#fund-supplier-list .fund-transfer-picker-menu button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fund-invoices-table { font-size: 14px; }
.fund-invoices-table th, .fund-invoices-table td { padding: 8px 6px; }
.fund-invoices-table th:first-child, .fund-invoices-table td:first-child { width: 39px; padding-right: 2px; padding-left: 12px; }
.fund-invoices-table th:nth-child(2), .fund-invoices-table td:nth-child(2) { padding-left: 4px; }
.fund-invoices-table th:nth-child(3), .fund-invoices-table td:nth-child(3) { width: 1%; white-space: nowrap; }
.fund-invoices-table th:nth-child(4), .fund-invoices-table td:nth-child(4), .fund-invoices-table th:nth-child(6), .fund-invoices-table td:nth-child(6) { text-align: left; }
.fund-invoices-table th:nth-child(9) small { display: block; margin-top: 2px; font-size: .65em; font-weight: 500; line-height: 1; }
.fund-invoices-table th:last-child, .fund-invoices-table td:last-child { box-sizing: border-box; width: 210px; min-width: 210px; padding-right: 10px; padding-left: 11px; }
.fund-invoice-payment-panel { width: min(390px, calc(100vw - 28px)); }
.fund-invoice-payment-panel label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.fund-invoice-payment-panel input { box-sizing: border-box; width: 100%; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--bg); font: inherit; }
.fund-supplier-phone-field, .fund-supplier-country-field { position: relative; display: block; }.fund-supplier-phone-flag, .fund-country-flag { position: absolute; z-index: 1; left: 8px; top: 50%; width: 24px; height: 18px; transform: translateY(-50%); border-radius: 2px; background-position: center; background-repeat: no-repeat; background-size: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.18); }.fund-supplier-phone-field:not(.has-flag) .fund-supplier-phone-flag, .fund-supplier-country-field:not(.has-flag) .fund-country-flag { display: none; }.fund-supplier-phone-field.has-flag #fund-supplier-phone, .fund-supplier-country-field.has-flag #fund-supplier-country { padding-left: 40px; }
.fund-supplier-logo-editor { grid-column: 1 / -1; display: grid; gap: 5px; color: var(--muted); font-size: 11px; outline: none; }.fund-supplier-logo-drop { min-height: 72px; padding: 8px 12px; display: flex; align-items: center; gap: 12px; border: 1px dashed var(--blue); border-radius: 6px; background: rgba(69,162,255,.06); cursor: pointer; }.fund-supplier-logo-drop img { display: none; width: 58px; height: 58px; flex: 0 0 58px; object-fit: contain; border-radius: 6px; background: white; }.fund-supplier-logo-editor.has-logo .fund-supplier-logo-drop img { display: block; }.fund-supplier-logo-drop span { display: grid; gap: 3px; }.fund-supplier-logo-drop b { color: var(--text); }.fund-supplier-logo-drop small { color: var(--amber); }.fund-supplier-logo-editor:focus-within .fund-supplier-logo-drop { border-color: var(--green); }.fund-supplier-logo-editor > button { justify-self: start; padding: 5px 8px; border: 1px solid var(--red); border-radius: 5px; color: var(--text); background: var(--panel); cursor: pointer; }
.fund-invoice-supplier-picker .fund-transfer-picker-button, .fund-invoice-supplier-picker .fund-transfer-picker-menu button { box-sizing: border-box; width: 100%; min-height: 32px; padding: 4px 7px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--bg); font: inherit; cursor: pointer; }.fund-invoice-supplier-picker .fund-transfer-picker-menu button { border: 0; background: transparent; }.fund-invoice-supplier-picker .fund-transfer-picker-menu button:hover { background: rgba(69,162,255,.18); }.fund-supplier-logo { width: 25px; height: 25px; flex: 0 0 25px; object-fit: contain; border-radius: 4px; background: white; }
#fund-invoice-editor .fund-invoice-supplier-picker .fund-transfer-picker-menu { max-height: min(480px, calc(100vh - 220px)); }
.fund-invoice-reference-actions { display: inline-flex; align-items: center; gap: 7px; }
.fund-invoice-primary-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.fund-invoice-primary-actions > button, #fund-invoice-company-filter, #fund-invoice-supplier-filter { box-sizing: border-box; height: 36px; min-height: 36px; }
#fund-invoice-company-filter, #fund-invoice-supplier-filter { padding: 5px 28px 5px 8px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--panel-2); font: inherit; cursor: pointer; }
.fund-invoice-company-picker .fund-transfer-picker-button, .fund-invoice-company-picker .fund-transfer-picker-menu button { box-sizing: border-box; width: 100%; min-height: 32px; padding: 4px 7px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--bg); font: inherit; cursor: pointer; }
.fund-invoice-company-picker .fund-transfer-picker-menu button { border: 0; background: transparent; }
.fund-invoice-company-picker .fund-transfer-picker-menu button:hover { background: rgba(69,162,255,.18); }
.fund-company-logo { width: 25px; height: 25px; flex: 0 0 25px; object-fit: contain; border-radius: 4px; background: white; }
.fund-company-logo[role="button"], .fund-supplier-logo[role="button"] { cursor: zoom-in; transition: transform .15s ease, box-shadow .15s ease; }
.fund-company-logo[role="button"]:hover, .fund-company-logo[role="button"]:focus-visible, .fund-supplier-logo[role="button"]:hover, .fund-supplier-logo[role="button"]:focus-visible { transform: scale(1.12); box-shadow: 0 0 0 2px var(--blue); outline: none; }
.fund-invoice-company-cell .fund-company-logo { margin-right: 8px; vertical-align: middle; }
.fund-invoice-company-cell span { vertical-align: middle; }
.fund-logo-preview-panel { width: min(650px, calc(100vw - 28px)); }
.fund-logo-preview-panel > img { box-sizing: border-box; width: 100%; height: min(58vh, 500px); margin-top: 15px; padding: 18px; display: block; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: white; }
.fund-company-panel { width: min(720px, calc(100vw - 28px)); }
#fund-company-logo-list { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fund-company-logo-card { padding: 12px; display: grid; gap: 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(2,28,47,.45); }
.fund-company-logo-title { min-height: 28px; display: flex; align-items: center; gap: 8px; }
.fund-company-logo-drop { min-height: 86px; padding: 9px; display: flex; align-items: center; gap: 11px; border: 1px dashed var(--blue); border-radius: 6px; background: rgba(69,162,255,.06); cursor: pointer; outline: none; }
.fund-company-logo-drop:focus { border-color: var(--green); background: rgba(57,239,141,.08); }
.fund-company-logo-drop > img { width: 66px; height: 66px; flex: 0 0 66px; object-fit: contain; border-radius: 6px; background: white; }
.fund-company-logo-drop > img:not([src]) { display: none; }
.fund-company-logo-drop > span { min-width: 0; display: grid; gap: 4px; }
.fund-company-logo-drop b { color: var(--text); }
.fund-company-logo-drop small { color: var(--amber); }
.fund-company-logo-delete { justify-self: start; padding: 5px 8px; border: 1px solid var(--red); border-radius: 5px; color: #ffb2bc; background: rgba(120,20,38,.35); cursor: pointer; }
@media (max-width: 650px) { #fund-company-logo-list { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  #fund-supplier-editor > label:nth-child(2), #fund-supplier-editor > label:nth-child(3), #fund-supplier-editor > label:nth-child(10), #fund-supplier-editor > label:nth-child(11), #fund-supplier-editor > label:nth-child(12), #fund-supplier-editor > .fund-transfer-modal-actions { grid-column: 1 / -1; }
}
.fund-invoice-editor input, .fund-invoice-editor select, .fund-supplier-panel input, .fund-supplier-panel select, .fund-supplier-panel textarea { box-sizing: border-box; width: 100%; min-height: 32px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--bg); font: inherit; }
.fund-invoice-pdf { min-height: 67px; padding: 7px; border: 1px dashed var(--blue); border-radius: 6px; cursor: pointer; background: rgba(69,162,255,.06); }.fund-invoice-pdf.is-dragging { border-color: var(--green); background: rgba(57,239,141,.12); }.fund-invoice-pdf strong { color: var(--text); }.fund-invoice-pdf span, .fund-invoice-pdf small { color: var(--amber); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.fund-invoices-table td:nth-child(6) { font-weight: 700; white-space: nowrap; }.fund-invoice-actions { display: flex; justify-content: center; gap: 5px; }.fund-invoice-actions button, .fund-invoice-pdf-link { padding: 4px 7px; border: 1px solid var(--blue); border-radius: 5px; color: var(--text); background: var(--panel-2); cursor: pointer; text-decoration: none; }.fund-supplier-panel { width: min(800px, calc(100vw - 28px)); max-height: 90vh; overflow: auto; }#fund-supplier-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }#fund-supplier-list button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--panel-2); cursor: pointer; }#fund-supplier-editor { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 9px; }#fund-supplier-editor label:nth-child(3), #fund-supplier-editor label:last-of-type { grid-column: span 3; }#fund-supplier-editor .fund-supplier-postcode { grid-column: auto; }#fund-supplier-editor .fund-supplier-city, #fund-supplier-editor .fund-supplier-country { grid-column: span 1; }#fund-supplier-editor textarea { min-height: 58px; resize: vertical; }#fund-supplier-phone-country { min-height: 14px; color: var(--muted); font-size: 10px; }@media (max-width: 800px) { .fund-invoice-editor { grid-template-columns: repeat(2, 1fr); } #fund-supplier-editor { grid-template-columns: repeat(2, 1fr); } #fund-supplier-editor label:nth-child(3), #fund-supplier-editor label:last-of-type { grid-column: span 2; } }
.fund-invoice-supplier-cell .fund-supplier-logo { margin-right: 8px; vertical-align: middle; }
.fund-invoice-supplier-cell span { vertical-align: middle; }
.fund-invoice-actions { align-items: center; white-space: nowrap; }
.fund-invoice-actions > button, .fund-invoice-actions > a, .fund-invoice-delete-button { box-sizing: border-box; height: 29px; min-height: 29px; padding: 4px 6px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--blue); border-radius: 5px; color: var(--text); background: var(--panel-2); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.fund-invoice-actions > button[data-invoice-action="payment"] { width: 88px; flex: 0 0 88px; }
.fund-invoice-actions > button[data-invoice-action="payment"].is-paid { border-color: var(--green); color: #bfffdc; background: rgba(26, 139, 88, .35); }
.fund-invoice-actions > button[data-invoice-action="payment"].is-paid:hover, .fund-invoice-actions > button[data-invoice-action="payment"].is-paid:focus-visible { background: rgba(26, 169, 103, .52); outline: none; }
.fund-invoice-actions .fund-invoice-action-icon, .fund-invoice-delete-button { width: 29px; padding: 4px; flex: 0 0 29px; }
.fund-invoice-delete-cell { text-align: center; }
.fund-invoice-delete-button, .fund-invoice-confirm-delete { border-color: var(--red) !important; color: #ffb2bc !important; background: rgba(120,20,38,.35) !important; }
.fund-invoice-delete-button:hover, .fund-invoice-delete-button:focus-visible, .fund-invoice-confirm-delete:hover, .fund-invoice-confirm-delete:focus-visible { color: white !important; background: rgba(180,25,48,.65) !important; outline: none; }
.fund-invoice-delete-button svg, .fund-invoice-payment-clear svg { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fund-invoice-payment-date { white-space: nowrap; }
.fund-invoice-unpaid-row > td { background: rgba(205, 232, 255, .16); }
.fund-invoice-unpaid-row > td:first-child { box-shadow: inset 4px 0 0 #bfe8ff; }
.fund-invoice-unpaid-row:hover > td { background: rgba(225, 242, 255, .22); }
.fund-invoice-unpaid-badge { padding: 3px 6px; display: inline-block; border: 1px solid #bfe8ff; border-radius: 10px; color: #e8f7ff; background: rgba(137, 202, 247, .18); font-size: 10px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.fund-invoice-payment-clear { box-sizing: border-box; width: 18px; height: 18px; margin-left: 5px; padding: 3px; display: inline-grid; place-items: center; vertical-align: middle; border: 1px solid var(--red); border-radius: 50%; color: #ff8796; background: rgba(120,20,38,.3); cursor: pointer; }
.fund-invoice-payment-clear svg { width: 10px; height: 10px; }
.fund-invoice-payment-clear:hover, .fund-invoice-payment-clear:focus-visible { color: white; background: rgba(180,25,48,.7); outline: none; }
.fund-invoice-documents-field { order: 10; grid-column: span 2; min-width: 0; display: grid; gap: 8px; }
.fund-invoice-editor > .fund-transfer-editor-actions { grid-column: span 2; }
.fund-invoice-documents-field .fund-invoice-pdf span, .fund-invoice-documents-field .fund-invoice-pdf small { white-space: normal; overflow-wrap: anywhere; }
.fund-invoice-document-list { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.fund-invoice-document-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-size: 12px; }
.fund-invoice-document-label, .fund-invoice-document-name { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.fund-invoice-document-name { color: var(--text); }
.fund-invoice-document-label small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.fund-invoice-document-row.is-removed .fund-invoice-document-name { color: var(--muted); text-decoration: line-through; }
.fund-invoice-document-row.is-removed small { color: var(--amber); }
.fund-invoice-document-row button, .fund-invoice-document-open { flex-shrink: 0; padding: 5px 8px; border: 1px solid var(--blue); border-radius: 5px; color: var(--text); background: var(--panel-2); font: inherit; text-decoration: none; cursor: pointer; }
.fund-invoice-document-row button:disabled { opacity: .5; cursor: wait; }
.fund-vni-statement-panel.fund-invoice-documents-panel { box-sizing: border-box; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.fund-invoice-documents-panel .fund-invoice-document-list { max-height: 55vh; }
.fund-invoice-actions [data-document-count] { position: relative; }
.fund-invoice-actions [data-document-count]::after { content: attr(data-document-count); position: absolute; top: -6px; right: -4px; min-width: 13px; padding: 1px 2px; border-radius: 8px; color: var(--bg); background: var(--green); font-size: 9px; font-weight: 700; line-height: 12px; text-align: center; }
.fund-vni-history-editor[hidden] { display: none; }
.fund-vni-history-view.is-vni-history-mode .fund-vni-data-content { display: none; }
.fund-vni-history-chart-panel { padding: 9px 12px 3px; border-bottom: 1px solid var(--line); background: rgba(2,28,47,.42); }
.fund-vni-history-chart-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 12px; }
.fund-vni-history-chart-controls strong { color: #cbe5ff; font-size: 13px; }
.fund-vni-history-chart-controls label { cursor: pointer; white-space: nowrap; }
.fund-vni-history-chart-controls input { accent-color: var(--blue); vertical-align: middle; }
.fund-vni-history-chart-mode { display: inline-flex; gap: 7px; padding-left: 12px; border-left: 1px solid rgba(69,162,255,.35); }
.fund-vni-history-chart-legend { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.fund-vni-history-chart-legend span::before { content: ''; display: inline-block; width: 14px; height: 3px; margin-right: 5px; border-radius: 2px; vertical-align: middle; background: var(--series-color); }
.fund-vni-history-chart-legend [data-series="vni"] { --series-color: #65f3ff; }
.fund-vni-history-chart-legend [data-series="parts"] { --series-color: #ffc94d; }
.fund-vni-history-chart-legend [data-series="aum"] { --series-color: #62f3a1; }
.fund-vni-history-chart-legend small { color: rgba(183,214,244,.65); }
#fund-vni-history-chart { display: block; width: 100%; height: 185px; overflow: visible; }
#fund-vni-history-chart .chart-grid { stroke: rgba(143,189,221,.2); stroke-width: 1; }
#fund-vni-history-chart .chart-axis-label { fill: #8fbddd; font-size: 11px; }
#fund-vni-history-chart .chart-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; }
#fund-vni-history-chart .chart-point { stroke-width: 1.5; cursor: crosshair; }
#fund-vni-history-chart .chart-empty { fill: #8fbddd; font-size: 15px; text-anchor: middle; }
.fund-vni-year-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fund-vni-year-summary > div { min-width: 118px; padding: 7px 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border: 1px solid rgba(69,162,255,.7); border-radius: 6px; background: rgba(7,54,83,.68); }
.fund-vni-year-summary span { color: #cbe5ff; font-size: 13px; font-weight: 800; }
.fund-vni-year-summary span small { margin-left: 4px; color: #8fbddd; font-size: 10px; font-weight: 700; }
.fund-vni-year-summary strong { color: var(--text); font-size: 14px; }
.fund-vni-year-summary strong.fund-vni-positive { color: var(--green); }
.fund-vni-year-summary strong.fund-vni-negative { color: var(--red); }
.fund-vni-summary-table-wrap { margin-top: 10px; overflow-x: auto; border: 1px solid rgba(31,133,190,.8); border-radius: 7px; }
.fund-vni-summary-table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.fund-vni-summary-table th, .fund-vni-summary-table td { padding: 9px 11px; border-bottom: 1px solid rgba(22,119,174,.4); text-align: right; white-space: nowrap; }
.fund-vni-summary-table th { color: var(--muted); background: rgba(7,54,83,.7); font-weight: 800; }
.fund-vni-summary-table th:first-child, .fund-vni-summary-table td:first-child { text-align: left; }
.fund-vni-summary-table tbody tr:nth-child(even) { background: rgba(7,54,83,.26); }
.fund-vni-summary-table tbody tr:last-child td { border-bottom: 0; }
.fund-vni-summary-table tbody tr.fund-vni-year-separator td { border-top: 3px solid #45baff; background: rgba(10,78,116,.52); }
.fund-vni-summary-table .fund-vni-vni-value { color: #fff; font-weight: 800; }
.fund-vni-summary-table .fund-vni-positive { color: var(--green); font-weight: 800; }
.fund-vni-summary-table .fund-vni-negative { color: var(--red); font-weight: 800; }
.fund-vni-editor-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #cbe5ff; }
.fund-vni-editor-heading strong { font-size: 18px; }
.fund-vni-editor-heading span { color: var(--muted); font-size: 13px; }
.fund-vni-summary-editor { display: grid; grid-template-columns: repeat(8, minmax(105px, 1fr)); gap: 8px; margin-bottom: 12px; }
.fund-vni-summary-editor label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 700; }
.fund-vni-summary-editor input, .fund-vni-summary-editor output { box-sizing: border-box; min-width: 0; height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--bg); text-align: right; font: inherit; font-size: 16px; }
.fund-vni-summary-editor output { display: flex; align-items: center; justify-content: flex-end; color: var(--blue); font-weight: 800; }
.fund-vni-summary-editor #fund-vni-monthly-performance.fund-vni-positive { color: var(--green); }
.fund-vni-summary-editor #fund-vni-monthly-performance.fund-vni-negative { color: var(--red); }
.fund-vni-summary-editor input:focus, .fund-vni-account-table input:focus { border-color: var(--blue); outline: 2px solid rgba(69,162,255,.24); }
.fund-vni-estimator { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 12px; padding: 9px; border: 1px solid rgba(69,162,255,.55); border-radius: 7px; background: rgba(7,54,83,.42); }
.fund-vni-fixed-fees { display: flex; align-items: end; gap: 7px; }
.fund-vni-fixed-fees label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.fund-vni-fixed-fees input { box-sizing: border-box; width: 130px; height: 33px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--bg); text-align: right; font: inherit; }
.fund-vni-fixed-fees #fund-vni-fixed-fees-save { min-height: 25px; padding: 3px 6px; border-color: rgba(143,189,221,.55); color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.fund-vni-fixed-fees #fund-vni-fixed-fees-save:hover, .fund-vni-fixed-fees #fund-vni-fixed-fees-save:focus-visible { color: #05243a; background: #cbe5ff; outline: none; }
.fund-vni-fixed-fees #fund-vni-fixed-fees-save { min-height: 25px; padding: 3px 6px; border-color: rgba(143,189,221,.55); color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.fund-vni-fixed-fees #fund-vni-fixed-fees-save:hover, .fund-vni-fixed-fees #fund-vni-fixed-fees-save:focus-visible { color: #05243a; background: #cbe5ff; outline: none; }
.fund-vni-estimator button { align-self: end; min-height: 33px; padding: 6px 10px; border: 1px solid var(--green); border-radius: 5px; color: var(--green); background: rgba(57,239,141,.08); font: inherit; font-weight: 800; cursor: pointer; }
.fund-vni-estimator button:hover, .fund-vni-estimator button:focus-visible { color: #05243a; background: var(--green); outline: none; }
.fund-vni-estimator-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 7px; }
.fund-vni-estimator-actions > span { flex-basis: 100%; }
.fund-vni-estimator-actions #fund-vni-save { color: #05243a; background: var(--green); }
.fund-vni-estimator-actions #fund-vni-save:disabled { opacity: .42; cursor: default; }
.fund-vni-estimator-actions #fund-vni-cancel { border-color: var(--blue); color: var(--text); background: var(--panel-2); }
.fund-vni-estimator-actions #fund-vni-cancel:hover, .fund-vni-estimator-actions #fund-vni-cancel:focus-visible { color: #05243a; background: #cbe5ff; }
.fund-vni-estimator-actions span { color: var(--muted); font-size: 11px; }
.fund-vni-estimator-values { display: flex; flex: 1 1 390px; align-items: stretch; justify-content: flex-end; overflow: hidden; border: 1px solid rgba(31,133,190,.65); border-radius: 5px; }
.fund-vni-estimator-values > div { min-width: 115px; padding: 5px 10px; display: grid; gap: 2px; border-left: 1px solid rgba(31,133,190,.55); text-align: right; }
.fund-vni-estimator-values > div:first-child { border-left: 0; }
.fund-vni-estimator-values span { color: var(--muted); font-size: 11px; font-weight: 700; }
.fund-vni-estimator-values strong { color: var(--green); font-size: 16px; }
.fund-vni-account-scroll { overflow-x: auto; }
.fund-vni-account-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.fund-vni-account-table th, .fund-vni-account-table td { padding: 9px 10px; border: 1px solid rgba(22,119,174,.4); text-align: right; }
.fund-vni-account-table th { color: var(--muted); background: rgba(7,54,83,.65); }
.fund-vni-account-table th:first-child, .fund-vni-account-table td:first-child { text-align: left; }
.fund-vni-account-table input { box-sizing: border-box; width: 100%; min-width: 105px; height: 35px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: var(--bg); text-align: right; font: inherit; }
.fund-vni-account-table input[readonly] { color: var(--muted); border-color: transparent; background: transparent; }
.fund-vni-account-table output { color: var(--text); font-weight: 700; }
.fund-vni-account-table td.fund-vni-account-cell { white-space: nowrap; }
.fund-vni-account-cell .fund-transfer-account { vertical-align: middle; }
.fund-vni-statement-control { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px 0 0; vertical-align: middle; }
.fund-vni-statement-upload, .fund-vni-statement-delete { width: 25px; min-height: 25px; padding: 3px; display: grid; place-items: center; border: 1px solid var(--blue); border-radius: 4px; color: var(--text); background: rgba(7,87,150,.38); font: inherit; font-size: 11px; cursor: pointer; }
.fund-vni-statement-upload svg, .fund-vni-statement-delete svg { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fund-vni-statement-upload.is-attached { border-color: var(--green); color: var(--green); background: rgba(57,239,141,.1); }
.fund-vni-statement-upload:hover, .fund-vni-statement-upload:focus-visible { background: rgba(69,162,255,.3); outline: none; }
.fund-vni-statement-delete { border-color: var(--red); color: #ffb2bc; background: rgba(120,20,38,.35); }
.fund-vni-statement-delete:hover, .fund-vni-statement-delete:focus-visible { color: white; background: rgba(180,25,48,.65); outline: none; }
.fund-vni-statement-status { display: none; }
.fund-vni-statement-status.is-attached { color: var(--green); }
.fund-vni-statement-modal { position: fixed; inset: 0; z-index: 1150; display: grid; place-items: center; padding: 20px; }
.fund-vni-statement-modal[hidden] { display: none; }
.fund-vni-statement-backdrop { position: absolute; inset: 0; background: rgba(0,10,19,.82); backdrop-filter: blur(2px); }
.fund-vni-statement-panel { position: relative; width: min(460px, 100%); padding: 22px; border: 1px solid var(--blue); border-radius: 10px; color: var(--text); background: var(--panel-2); box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.fund-vni-statement-panel h2 { margin: 0; color: #cbe5ff; font-size: 21px; }
.fund-vni-statement-panel > p { margin: 7px 0 14px; color: var(--muted); }
.fund-vni-confirm-modal .fund-vni-statement-panel { width: min(430px, 100%); }
.fund-vni-recognition-panel { width: min(680px, 100%); }
.fund-vni-recognition-rules { display: grid; gap: 10px; }
.fund-vni-recognition-rules fieldset { margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 1px solid rgba(31,133,190,.7); border-radius: 7px; }
.fund-vni-recognition-rules legend { padding: 0 5px; color: #cbe5ff; font-weight: 800; }
.fund-vni-recognition-rules label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.fund-vni-recognition-rules input { width: 100%; box-sizing: border-box; padding: 7px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--bg); font: inherit; }
.fund-vni-recognition-rules input:focus { border-color: var(--blue); outline: 2px solid rgba(69,162,255,.24); }
.fund-vni-statement-drop { min-height: 145px; padding: 18px; display: grid; place-content: center; gap: 7px; border: 2px dashed #2f91d3; border-radius: 8px; color: #d7eaff; background: rgba(7,87,150,.18); text-align: center; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.fund-vni-statement-drop:hover, .fund-vni-statement-drop.is-dragging { border-color: var(--green); background: rgba(57,239,141,.1); }
.fund-vni-statement-drop strong { font-size: 16px; }
.fund-vni-statement-drop span { color: var(--muted); font-size: 12px; }
.fund-vni-statement-message { min-height: 18px; font-size: 12px; }
.fund-vni-statement-message.is-error { color: #ff9daa; }
.fund-vni-account-table .fund-vni-positive { color: var(--green); }
.fund-vni-account-table .fund-vni-negative { color: var(--red); }
.fund-vni-account-table tfoot th, .fund-vni-account-table tfoot td { color: var(--text); background: rgba(69,162,255,.1); font-weight: 800; }
.fund-vni-account-table .fund-vni-cash-row td { color: var(--muted); background: rgba(57,239,141,.05); }
.fund-vni-account-table .fund-vni-cash-row td:first-child { color: var(--green); font-weight: 800; }
.fund-vni-formula { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.fund-vni-editor-actions { justify-content: flex-end; margin-top: 10px; }
.fund-vni-editor-actions button { padding: 6px 9px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--panel-2); cursor: pointer; }
.fund-vni-editor-actions button:disabled { opacity: .42; cursor: default; }
.fund-vni-history-list { display: grid; gap: 10px; padding: 10px; }
.fund-vni-history-list[hidden] { display: none; }
.fund-vni-history-list[hidden] { display: none; }
.fund-vni-history-card { overflow: hidden; border: 1px solid rgba(31,133,190,.8); border-radius: 7px; background: rgba(2,28,47,.5); }
.fund-vni-history-card-header { padding: 8px 10px; display: grid; grid-template-columns: auto repeat(7, minmax(80px, 1fr)) auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.fund-vni-history-card-header > div { min-width: 0; text-align: right; }
.fund-vni-history-card-header > div:first-child { text-align: left; }
.fund-vni-history-card-header span { display: block; color: var(--muted); font-size: 12px; }
.fund-vni-history-card-header strong { display: block; margin-top: 3px; color: var(--text); font-size: 16px; white-space: nowrap; }
.fund-vni-history-card-header .fund-vni-history-date strong { color: var(--blue); font-size: 19px; }
.fund-vni-history-card-header small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.fund-vni-history-actions { display: flex; align-items: center; gap: 6px; }
.fund-vni-history-edit { padding: 6px 9px; border: 1px solid var(--blue); border-radius: 5px; color: var(--text); background: var(--panel-2); font: inherit; font-size: 13px; cursor: pointer; }
.fund-vni-history-edit:hover, .fund-vni-history-edit:focus-visible { background: rgba(69,162,255,.2); outline: none; }
.fund-vni-history-report { width: 32px; height: 32px; padding: 5px; display: grid; place-items: center; border: 1px solid var(--green); border-radius: 5px; color: var(--green); background: rgba(57,239,141,.08); cursor: pointer; }
.fund-vni-history-report:hover, .fund-vni-history-report:focus-visible { color: #05243a; background: var(--green); outline: none; }
.fund-vni-history-report svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fund-vni-report-modal { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 20px; }
.fund-vni-report-modal[hidden] { display: none; }
.fund-vni-report-backdrop { position: absolute; inset: 0; background: rgba(0,10,19,.86); backdrop-filter: blur(3px); }
.fund-vni-report-panel { position: relative; width: min(1180px, 100%); max-height: calc(100dvh - 40px); overflow: hidden; border: 1px solid var(--blue); border-radius: 10px; background: var(--panel-2); box-shadow: 0 22px 60px rgba(0,0,0,.65); }
.fund-vni-report-toolbar { padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.fund-vni-report-toolbar h2 { margin: 0; color: #cbe5ff; font-size: 20px; }
.fund-vni-report-toolbar > div { display: flex; gap: 8px; }
.fund-vni-report-toolbar button { padding: 7px 11px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--panel); font: inherit; cursor: pointer; }
.fund-vni-report-toolbar button[data-vni-report-action="capture"] { border-color: var(--green); color: var(--green); }
.fund-vni-report-toolbar button:hover, .fund-vni-report-toolbar button:focus-visible { color: #05243a; background: var(--blue); outline: none; }
.fund-vni-report-toolbar button[data-vni-report-action="capture"]:hover, .fund-vni-report-toolbar button[data-vni-report-action="capture"]:focus-visible { background: var(--green); }
.fund-vni-report-scroll { max-height: calc(100dvh - 110px); padding: 22px; overflow: auto; background: #031a2c; }
.fund-vni-report-pdf-check { margin: 0 0 14px; padding: 10px 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; border: 1px solid #a77b22; border-radius: 7px; color: #ffe3a3; background: rgba(117,77,4,.22); font-size: 13px; }
.fund-vni-report-pdf-check.is-complete { border-color: #28b879; color: #d9ffe8; background: rgba(22,125,81,.22); }
.fund-vni-report-pdf-check strong { margin-right: 5px; }
.fund-vni-report-pdf-check span { padding: 4px 7px; border-radius: 4px; font-weight: 700; }
.fund-vni-report-pdf-check .is-present { color: #aaffcf; background: rgba(57,239,141,.13); }
.fund-vni-report-pdf-check .is-missing { color: #ffd0d6; background: rgba(255,91,112,.16); }
.fund-vni-report-sheet { box-sizing: border-box; min-width: 920px; padding: 18px; color: #d7eaff; border: 1px solid #1677ae; background: linear-gradient(135deg, #052d49, #031c2f); font-family: Arial, sans-serif; box-shadow: inset 0 0 28px rgba(69,162,255,.08); }
.fund-vni-report-sheet table { width: 100%; overflow: hidden; border: 1px solid #1677ae; border-radius: 10px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 15px; font-variant-numeric: tabular-nums; }
.fund-vni-report-sheet th, .fund-vni-report-sheet td { height: 38px; padding: 5px 9px; border: 0; border-right: 1px solid #1677ae; border-bottom: 1px solid #1677ae; text-align: right; }
.fund-vni-report-sheet tr > :last-child { border-right: 0; }
.fund-vni-report-sheet tfoot tr:last-child > * { border-bottom: 0; }
.fund-vni-report-sheet th { color: #cbe5ff; background: #07507f; text-align: center; font-weight: 700; }
.fund-vni-report-sheet tbody td { background: rgba(3,38,62,.82); }
.fund-vni-report-sheet tbody td.fund-vni-report-account { color: #fff; background: #06446d; text-align: left; font-weight: 700; }
.fund-vni-report-sheet .fund-vni-report-account .fund-transfer-account { gap: 10px; font-size: 15px; }
.fund-vni-report-sheet .fund-vni-report-account .fund-transfer-account img { width: 29px; height: 29px; flex-basis: 29px; }
.fund-vni-report-sheet tbody td.fund-vni-report-transfer,
.fund-vni-report-sheet tfoot #fund-vni-report-total-transfer,
.fund-vni-report-sheet tbody td.fund-vni-report-balance,
.fund-vni-report-sheet tfoot #fund-vni-report-total-balance,
.fund-vni-report-sheet tbody td.fund-vni-report-latent,
.fund-vni-report-sheet tfoot #fund-vni-report-total-latent { color: #04253c; background: #def4ff; }
.fund-vni-report-sheet tbody td:nth-child(n+5) { font-weight: 700; }
.fund-vni-report-sheet tbody tr.fund-vni-report-spacer td { height: 20px; background: #042a45; }
#fund-vni-report-date { color: #ff7384; background: #063b61; }
.fund-vni-report-sheet tfoot th, .fund-vni-report-sheet tfoot td { color: #fff; background: #06446d; font-weight: 700; }
.fund-vni-report-gains { width: 480px; height: 42px; margin-top: 24px; display: grid; grid-template-columns: 260px 220px; align-items: center; font-size: 20px; font-weight: 800; }
.fund-vni-report-gains strong, .fund-vni-report-gains span { height: 100%; display: grid; place-items: center; border: 1px solid #1677ae; background: #07507f; }
.fund-vni-report-gains span { justify-content: end; padding: 0 10px; color: #62f3a1; background: #03263e; }
@media (max-width: 700px) {
  .fund-vni-report-modal { padding: 8px; }
  .fund-vni-report-toolbar { align-items: flex-start; flex-direction: column; }
  .fund-vni-report-scroll { max-height: calc(100dvh - 135px); padding: 8px; }
}
.fund-vni-history-card .fund-vni-account-table { min-width: 760px; }
.fund-vni-history-card .fund-vni-account-table th, .fund-vni-history-card .fund-vni-account-table td { border-top: 0; }
@media (max-width: 1100px) {
  .fund-vni-summary-editor { grid-template-columns: repeat(4, minmax(110px, 1fr)); }
  .fund-vni-history-card-header { grid-template-columns: repeat(4, minmax(90px, 1fr)); }
}
@media (max-width: 620px) {
  .fund-vni-summary-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fund-vni-editor-heading { align-items: flex-start; flex-direction: column; }
  .fund-vni-history-card-header { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.fund-transfer-editor[hidden] { display: none; }
.fund-transfer-editor label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.fund-transfer-editor input, .fund-transfer-editor select { min-width: 0; height: 32px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--bg); font: inherit; }
.fund-transfer-picker { position: relative; display: block; }
.fund-transfer-editor .fund-transfer-picker-button { width: 100%; height: 32px; padding: 3px 7px; display: flex; align-items: center; justify-content: flex-start; border-color: var(--line); background: var(--bg); font: inherit; }
.fund-transfer-picker-menu { position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 20; max-height: 210px; padding: 4px; overflow-y: auto; border: 1px solid var(--blue); border-radius: 6px; background: var(--panel-2); box-shadow: 0 8px 18px rgba(0,0,0,.45); }
.fund-transfer-picker-menu[hidden] { display: none; }
.fund-transfer-editor .fund-transfer-picker-option { width: 100%; padding: 5px 6px; display: flex; justify-content: flex-start; border: 0; background: transparent; }
.fund-transfer-editor .fund-transfer-picker-option:hover, .fund-transfer-editor .fund-transfer-picker-option:focus-visible { background: rgba(69,162,255,.18); outline: none; }
.fund-transfer-picker .fund-transfer-account { gap: 6px; color: var(--text); font-size: 12px; }
.fund-transfer-picker .fund-transfer-account img, .fund-transfer-picker .fund-transfer-cash-logo { width: 21px; height: 21px; flex-basis: 21px; }
.fund-transfer-editor-actions { display: flex; gap: 6px; }
.fund-transfer-editor button:disabled { opacity: .42; cursor: default; }
.fund-transfer-delete { width: 29px; height: 29px; padding: 4px; border: 1px solid var(--red); border-radius: 5px; color: #ff9daa; background: rgba(100,15,28,.45); cursor: pointer; }
.fund-transfer-delete:hover, .fund-transfer-delete:focus-visible { color: white; background: rgba(150,20,40,.75); outline: none; }
.fund-transfer-delete svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fund-transfer-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; }
.fund-transfer-modal[hidden] { display: none; }
.fund-transfer-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 10, 19, .78); backdrop-filter: blur(2px); }
.fund-transfer-modal-panel { position: relative; width: min(430px, 100%); padding: 22px; border: 1px solid var(--blue); border-radius: 10px; color: var(--text); background: var(--panel-2); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.fund-transfer-modal-panel h2 { margin: 0 0 10px; color: #cbe5ff; font-size: 21px; }
.fund-transfer-modal-panel p { margin: 0; color: var(--muted); line-height: 1.45; }
.fund-transfer-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.fund-transfer-modal-actions button { padding: 7px 13px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--panel); cursor: pointer; }
.fund-transfer-modal-actions button:hover, .fund-transfer-modal-actions button:focus-visible { background: rgba(69, 162, 255, .2); outline: none; }
.fund-transfer-modal-actions .is-danger { border-color: var(--red); color: white; background: rgba(150, 20, 40, .75); }
.fund-transfer-modal-actions .is-danger:hover, .fund-transfer-modal-actions .is-danger:focus-visible { background: rgba(205, 32, 56, .9); }
.fund-transfer-modal-actions button:disabled { opacity: .5; cursor: wait; }
.fund-transfer-status-error { color: var(--red) !important; }
#fund-accounts-table th, #fund-accounts-table td { padding-left: clamp(6px, .65vw, 12px); padding-right: clamp(6px, .65vw, 12px); }
#fund-accounts-table tbody td { padding-top: 5px; padding-bottom: 5px; }
#fund-accounts-table tbody .fund-account-identity { min-height: 25px; }
#fund-accounts-table tbody .fund-account-logo { width: 25px; height: 25px; flex-basis: 25px; }
#fund-accounts-table tbody .fund-row-hide { width: 20px; height: 20px; flex-basis: 20px; }
#fund-accounts-table tbody .fund-account-update-date,
#fund-accounts-table tbody .fund-account-update-alert { margin-top: 1px; line-height: 1; }
.fund-table .fund-stake-percentage { display: block; margin-top: 2px; color: var(--muted); font-size: .8em; font-weight: 400; line-height: 1.15; }
.fund-table .fund-stake-total.is-zero, .fund-table .fund-stake-detail.is-zero { color: rgba(203, 229, 255, .48); }
.fund-table .fund-stake-detail.is-zero .fund-stake-input { color: rgba(203, 229, 255, .58); }

#fund-accounts-table .fund-stake-mismatch { background: rgba(140,25,43,.45); color: #ffb6bf; box-shadow: inset 0 0 0 1px var(--red); }
.fund-stake-applied { display: block; margin-top: 3px; color: #fff; font-size: .85em; font-weight: 600; }
/* Keep primary values and their secondary lines aligned across FUND tables. */
.fund-view .fund-table th, .fund-view .fund-table td,
.fund-view .fund-trades-table th, .fund-view .fund-trades-table td { vertical-align: top; }
.fund-view .fund-table .fund-equity,
.fund-view .fund-table .fund-stake-percentage,
.fund-view .fund-table .fund-stake-applied { margin-top: 2px; line-height: 1.15; }
.fund-view .fund-trades-table tbody small,
.fund-view .fund-trades-table tbody .trade-total small { margin-top: 2px; line-height: 1.15; }
.fund-stake-editor-controls { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fund-stake-editor-controls button { padding: 6px 9px; border: 1px solid var(--blue); border-radius: 6px; color: var(--text); background: var(--panel-2); cursor: pointer; }
.fund-stake-editor-controls button:disabled { opacity: .45; cursor: default; }
.fund-stake-editor-controls button[data-stake-action="save"] { border-color: var(--green); color: var(--green); }
.fund-stake-edit-status { max-width: 320px; color: var(--amber); font-size: 11px; }
.fund-stake-last-date { color: rgba(183,214,244,.72); font-weight: 400; }
.fund-stake-input { box-sizing: border-box; width: 100%; min-width: 85px; max-width: 130px; padding: 4px; border: 1px solid var(--blue); border-radius: 4px; background: var(--bg); color: var(--text); text-align: right; font: inherit; }
.fund-stake-input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.fund-stake-input[aria-invalid="true"] { border-color: var(--red); outline-color: var(--red); }
.fund-trades-table #fund-exposure-direction { font-size: inherit; font-weight: inherit; }

.fund-table .fund-stake-actions { text-align: left; white-space: normal; }

.fund-trade-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-right: 5px; border: 1px solid currentColor; border-radius: 4px; font-size: 10px; font-weight: 800; vertical-align: middle; }
.fund-trade-badge.is-buy { color: var(--green); background: rgba(57,239,141,.1); }
.fund-trade-badge.is-sell { color: #ff7384; background: rgba(255,77,97,.1); }
.fund-trade-badge.is-neutral { color: var(--muted); background: rgba(183,214,244,.08); }
.fund-stake-detail .fund-stake-input { width: 100%; }

.fund-trades-detail { border-top: 2px solid var(--line); }
.fund-trades-detail-scroll { overflow-x: hidden; }
.fund-trades-detail-mobile { display: none; }
.fund-trades-detail-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: clamp(11px, .88vw, 15px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fund-trades-detail-table col.trade-account-col { width: 7%; }
.fund-trades-detail-table col.trade-type-col { width: 2.25%; }
.fund-trades-detail-table col.trade-lots-col { width: 3.5%; }
.fund-trades-detail-table col.trade-points-col { width: 4.5%; }
.fund-trades-detail-table col:not(.trade-account-col):not(.trade-type-col):not(.trade-lots-col):not(.trade-points-col) { width: 6.5%; }
.fund-trades-detail-table th, .fund-trades-detail-table td { padding: 5px 4px; overflow: hidden; border-right: 1px solid rgba(22,119,174,.35); border-top: 1px solid rgba(22,119,174,.35); text-align: right; text-overflow: ellipsis; }
.fund-trades-detail-table thead th { color: var(--muted); background: var(--panel-2); text-align: center; }
.fund-trades-detail-table thead tr:first-child th { color: #acd3ff; font-size: 14px; }
.fund-trades-detail-table thead tr:first-child th:not(:first-child),
.fund-trades-detail-table thead tr:nth-child(2) th:nth-child(5n+1),
.fund-trades-detail-table tbody td:nth-child(5n+2) { border-left: 2px solid var(--line); }
.fund-trades-detail-table th:first-child, .fund-trades-detail-table td:first-child { background: var(--panel); text-align: left; }
.fund-trades-detail-table thead th:first-child { z-index: 2; background: var(--panel-2); }
.fund-trades-detail-table .fund-account-identity { gap: 3px; font-size: 11px; }
.fund-trades-detail-table .fund-account-logo { width: 20px; height: 20px; flex-basis: 20px; }
.fund-trades-detail-table .fund-trade-type-cell { overflow: visible; text-align: center; }
.fund-trades-detail-table .fund-trade-badge { min-width: 18px; width: 18px; height: 18px; margin: 0; font-size: 10px; }
.fund-robot-trade-heading { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; vertical-align: middle; }
.fund-robot-profit { white-space: nowrap; }
.fund-robot-theoretical { display: inline-flex; align-items: center; gap: 5px; }
.fund-robot-trade-heading .fund-trade-badge { margin: 0; line-height: 1; flex-shrink: 0; }
.fund-trade-detail-primary { display: block; font-weight: 700; }
.fund-trade-detail-secondary { display: block; margin-top: 2px; color: var(--muted); font-size: .82em; line-height: 1.15; }
.fund-trade-detail-primary.trade-buy { color: var(--green); font-weight: 800; }
.fund-trade-detail-primary.trade-sell { color: #ff7384; font-weight: 800; }
#fund-accounts-table .fund-stake-detail { position: relative; padding-right: calc(clamp(6px, .65vw, 12px) + 25px); line-height: 18px; }
#fund-accounts-table .fund-trade-badge { position: absolute; right: clamp(6px, .65vw, 12px); top: 6px; width: 18px; margin: 0; }

.fund-vni-email-panel { width: min(900px, calc(100vw - 32px)); }
.fund-vni-email-compose-panel { max-height: calc(100vh - 28px); overflow-y: auto; padding: 16px 20px; overscroll-behavior: contain; }
.fund-vni-email-compose-panel h2 { margin: 0 0 3px; font-size: 20px; }
.fund-vni-email-compose-panel .fund-vni-email-intro { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.fund-vni-email-compose-fields { display: grid; grid-template-columns: 1fr 1.35fr; gap: 6px 10px; }
.fund-vni-email-panel .fund-vni-email-compose-fields label { margin: 0; gap: 3px; font-size: 11px; }
.fund-vni-email-panel .fund-vni-email-compose-fields input { min-height: 31px; padding: 5px 8px; }
.fund-vni-email-compose-fields label:last-child { grid-column: 1 / -1; }
.fund-vni-email-address-note { grid-column: 1 / -1; margin-top: -2px; color: var(--amber); font-size: 10px; }
.fund-vni-email-compose-panel .fund-vni-email-drop { min-height: 68px; margin: 8px 0; padding: 8px; }
.fund-vni-email-compose-panel > label { margin: 7px 0; gap: 4px; font-size: 11px; }
.fund-vni-email-compose-panel #fund-vni-email-body { min-height: 245px; }
.fund-vni-email-compose-help { margin: 6px 0; padding: 7px 10px; }
@media (max-width: 650px) { .fund-vni-email-compose-fields { grid-template-columns: 1fr; }.fund-vni-email-compose-fields label:last-child { grid-column: auto; } }
.fund-vni-email-template-panel { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 36px); overflow-y: auto; overscroll-behavior: contain; }
.fund-vni-email-template-panel h2 { margin: 0 0 8px; font-size: 19px; }
.fund-vni-template-fields { display: grid; grid-template-columns: 1fr 1.35fr; gap: 6px 10px; }
.fund-vni-email-panel .fund-vni-template-fields label { margin: 0; gap: 3px; font-size: 11px; }
.fund-vni-email-panel .fund-vni-template-fields input { padding: 6px 8px; min-height: 32px; }
.fund-vni-template-fields label:last-child { grid-column: 1 / -1; }
@media (max-width: 650px) { .fund-vni-template-fields { grid-template-columns: 1fr; }.fund-vni-template-fields label:last-child { grid-column: auto; } }
.fund-vni-email-panel label { display: grid; gap: 6px; margin: 12px 0; color: var(--muted); font-weight: 700; }
.fund-vni-email-panel input, .fund-vni-email-panel textarea { width: 100%; box-sizing: border-box; padding: 9px; border: 1px solid var(--line); border-radius: 5px; color: #fff; background: var(--panel); font: inherit; }
.fund-vni-email-panel textarea { resize: vertical; line-height: 1.42; }
.fund-vni-email-panel .fund-vni-email-drop { min-height: 105px; padding: 14px; place-content: center; border: 2px dashed #2f91d3; border-radius: 8px; background: rgba(7,87,150,.18); text-align: center; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.fund-vni-email-drop:hover, .fund-vni-email-drop.is-dragging { border-color: var(--green); background: rgba(57,239,141,.1); }
.fund-vni-email-drop strong { color: var(--text); font-size: 15px; }
.fund-vni-email-drop span { color: var(--muted); font-size: 12px; }
.fund-vni-email-drop small { max-width: 100%; color: var(--amber); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fund-vni-email-panel.fund-vni-email-compose-panel .fund-vni-email-drop { min-height: 48px; margin: 6px 0; padding: 4px 8px; gap: 1px; }
.fund-vni-email-panel .fund-vni-email-tags { color: #9fc7eb; font-weight: 400; line-height: 1.4; }
.fund-vni-alpha-documents { display: grid; grid-template-columns: minmax(170px, .65fr) minmax(300px, 1.35fr); gap: 10px; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7,87,150,.12); }
.fund-vni-alpha-documents > div:first-child { display: grid; align-content: center; gap: 4px; }
.fund-vni-alpha-documents > div:first-child span { color: var(--muted); font-size: 11px; }
.fund-vni-alpha-drop { min-height: 92px; padding: 12px; display: grid; place-content: center; gap: 4px; border: 2px dashed #2f91d3; border-radius: 8px; background: rgba(7,87,150,.18); text-align: center; cursor: pointer; }
.fund-vni-alpha-drop:hover, .fund-vni-alpha-drop.is-dragging { border-color: var(--green); background: rgba(57,239,141,.1); }
.fund-vni-alpha-drop span { color: var(--muted); font-size: 11px; }.fund-vni-alpha-drop small { color: var(--amber); }
.fund-vni-alpha-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fund-vni-alpha-document { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid rgba(47,145,211,.55); border-radius: 7px; }
.fund-vni-alpha-document > span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.fund-vni-alpha-document [data-vni-statement-upload] { display: none; }
@media (max-width: 900px) { .fund-vni-alpha-documents { grid-template-columns: 1fr; }.fund-vni-alpha-list { grid-template-columns: 1fr; } }
.fund-vni-template-help { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: rgba(69,162,255,.06); }
.fund-vni-template-help summary { color: var(--text); font-weight: 700; cursor: pointer; }
.fund-vni-template-help dl { display: grid; grid-template-columns: 1fr; gap: 5px; margin: 10px 0 0; }
.fund-vni-template-help dl div { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 10px; align-items: start; padding: 3px 0; border-bottom: 1px solid rgba(69,162,255,.12); }
.fund-vni-template-help dt { min-width: 0; color: var(--amber); font-family: Consolas, monospace; font-size: 11px !important; line-height: 1.35; overflow-wrap: anywhere; }
.fund-vni-template-help dd { min-width: 0; margin: 0; color: var(--muted); font-size: 11px !important; font-weight: 400 !important; line-height: 1.35; overflow-wrap: anywhere; }
@media (max-width: 600px) { .fund-vni-template-help dl div { grid-template-columns: 1fr; gap: 2px; } }
.fund-vni-template-editor { position: relative; display: block; min-height: 230px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); overflow: hidden; }
.fund-vni-template-editor pre, .fund-vni-email-panel .fund-vni-template-editor textarea { position: absolute; inset: 0; box-sizing: border-box; width: 100%; height: 100%; margin: 0; padding: 9px; border: 0; border-radius: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: break-word; font: inherit; line-height: 1.42; tab-size: 2; }
.fund-vni-template-editor pre { z-index: 1; color: var(--text); background: transparent; pointer-events: none; }
.fund-vni-email-panel .fund-vni-template-editor textarea { z-index: 2; color: transparent; caret-color: #fff; background: transparent; resize: none; }
.fund-vni-template-editor textarea::selection { color: transparent; background: rgba(69,162,255,.35); }
.fund-vni-template-editor .is-template-tag { color: var(--amber); font-weight: 700; }
.fund-vni-email-body-editor { min-height: 300px; font-size: 16px; }
.fund-vni-history-mail { display: inline-grid; place-items: center; width: 34px; height: 30px; margin-left: 10px; padding: 0; border: 1px solid #45a2ff; border-radius: 6px; cursor: pointer; }
.fund-vni-history-mail.is-sent { color: #08753f; background: #e3f8ec; }
.fund-vni-history-mail.is-not-sent { color: #fff; border-color: #ff4d61; background: #c92f43; cursor: pointer; opacity: 1; }
.fund-vni-history-mail svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.fund-vni-email-history-panel { width: min(680px, calc(100vw - 28px)); }
#fund-vni-email-history-modal { z-index: 1200; }
#fund-vni-email-history-list { display: grid; gap: 10px; max-height: 60vh; overflow: auto; }
.fund-vni-email-history-entry { padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: rgba(69,162,255,.07); }
.fund-vni-email-history-entry dl { display: grid; grid-template-columns: 120px 1fr; gap: 5px 10px; margin: 0; }
.fund-vni-email-history-entry dt { color: var(--muted); }.fund-vni-email-history-entry dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

.pull-refresh { display: none; }

/* Smartphone: keep both dashboards dense and readable without horizontal scrolling. */
@media (max-width: 560px) {
  html.pull-refresh-enabled, html.pull-refresh-enabled body { overscroll-behavior-y: contain; }
  html.pull-refresh-enabled .fund-view { overscroll-behavior-y: contain; }
  .pull-refresh {
    --pull-distance: 0px;
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: 50%;
    z-index: 1500;
    min-height: 34px;
    padding: 6px 11px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(69,162,255,.85);
    border-radius: 18px;
    color: #dceeff;
    background: rgba(5,41,67,.96);
    box-shadow: 0 5px 15px rgba(0,0,0,.38);
    font-size: 10px;
    font-weight: 750;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-52px + min(var(--pull-distance), 52px)));
    transition: opacity .12s ease, transform .12s ease, border-color .12s ease;
  }
  .pull-refresh.is-visible { opacity: 1; }
  .pull-refresh.is-ready { border-color: var(--green); color: var(--green); }
  .pull-refresh-icon { font-size: 18px; line-height: 1; transition: transform .15s ease; }
  .pull-refresh.is-ready .pull-refresh-icon { transform: rotate(180deg); }
  .pull-refresh.is-loading .pull-refresh-icon { animation: pull-refresh-spin .7s linear infinite; }

  .mobile-summary-metrics { grid-template-columns: .56fr .54fr .58fr 1.05fr .88fr 1.02fr 66px; }
  .mobile-profit strong {
    width: 58px;
    margin-inline: auto;
    padding: 4px 1px;
    overflow: visible;
    font-size: 11px;
    letter-spacing: -.035em;
    text-overflow: clip;
  }

  .fund-overview-layout { gap: 6px; margin-top: 6px; }
  .fund-estimates, .fund-overview { min-height: 0; }
  .fund-estimates .fund-overview-item,
  .fund-overview:not(.fund-risk-overview) .fund-overview-item {
    min-height: 45px;
    padding: 2px;
    grid-template-rows: 19px minmax(19px, auto);
    gap: 0;
  }
  .fund-estimates .fund-overview-item > span,
  .fund-overview:not(.fund-risk-overview) .fund-overview-item > span {
    height: 19px;
    font-size: 8px;
    line-height: 1;
  }
  .fund-estimates .fund-overview-item strong,
  .fund-overview:not(.fund-risk-overview) .fund-overview-item strong { font-size: clamp(12px, 3.5vw, 15px); line-height: 1; }
  .fund-overview:not(.fund-risk-overview) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fund-overview:not(.fund-risk-overview) .fund-overview-item { border-right: 1px solid rgba(22,119,174,.65); border-bottom: 1px solid rgba(22,119,174,.65); }
  .fund-overview:not(.fund-risk-overview) .fund-overview-item:nth-child(3n) { border-right: 0; }
  .fund-overview:not(.fund-risk-overview) .fund-overview-item:nth-last-child(-n+3) { border-bottom: 0; }

  .fund-overview.fund-risk-overview { grid-template-columns: minmax(0, 2.3fr) minmax(54px, .65fr) minmax(0, 1.45fr); }
  .fund-risk-overview .fund-overview-item { padding: 2px; grid-template-rows: 23px minmax(24px, auto); border-right: 1px solid rgba(22,119,174,.65); border-bottom: 0; }
  .fund-risk-overview .fund-overview-item > span { height: 23px; font-size: 8px; }
  .fund-drawdown, .fund-fees { grid-template-rows: 22px minmax(0, 1fr); }
  .fund-drawdown-title, .fund-fees-title { font-size: 9px; }
  .fund-drawdown-item, .fund-fees-item { padding: 2px 1px; grid-template-rows: 18px minmax(22px, auto); }
  .fund-drawdown-item span, .fund-fees-item span { overflow: hidden; font-size: 7.5px; text-overflow: ellipsis; }
  .fund-drawdown-item strong, .fund-fees-item strong,
  .fund-market-evolution strong { max-width: 100%; overflow: hidden; font-size: clamp(10px, 2.8vw, 12px); letter-spacing: -.03em; text-overflow: clip; }
  .fund-market-evolution { border-right: 1px solid rgba(22,119,174,.65) !important; }
  .fund-market-evolution strong { align-self: center; line-height: 1; }

  .fund-accounts, .fund-trades { margin-top: 8px; }
  .fund-accounts-header { min-height: 0; padding: 6px; flex-wrap: wrap; gap: 5px; }
  .fund-accounts-heading { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; }
  .fund-accounts h2 { font-size: 15px; white-space: nowrap; }
  .fund-investment-status { min-width: 0; overflow: hidden; font-size: 8.5px; text-align: right; text-overflow: ellipsis; }
  .fund-accounts-controls { width: 100%; justify-content: flex-end; gap: 4px; }
  .fund-column-toggle { width: 26px; height: 26px; padding: 4px; }
  .fund-column-toggle svg { width: 16px; height: 16px; }
  .fund-virement-toggle { width: auto; min-width: 42px; padding: 3px 6px; font-size: 9px; }
  .fund-mobile-stakes-toggle { display: grid; min-width: 70px; }
  #fund-virement-toggle, #fund-gp-toggle { display: none; }
  #fund-virement-toggle { font-size: 0; }
  #fund-virement-toggle::after { content: 'Vir. +'; font-size: 9px; }
  .fund-history-controls { min-height: 0; padding: 5px 6px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .fund-transfers-toggle { width: 100%; height: 27px; padding: 3px; gap: 3px; font-size: 9px; }
  .fund-transfers-toggle svg { width: 14px; height: 14px; }

  .fund-table-wrap, .fund-trades-scroll, .fund-trades-summary { overflow-x: hidden; }
  #fund-accounts-table { width: 100%; table-layout: fixed; font-size: 11.5px; }
  #fund-accounts-table .fund-stake-total,
  #fund-accounts-table .fund-stake-detail { display: none; }
  #fund-accounts-table .fund-month-performance { display: none; }
  #fund-accounts-table th, #fund-accounts-table td { padding: 4px 1px; overflow: hidden; line-height: 1.08; text-overflow: clip; }
  #fund-accounts-table th:nth-child(1) { width: 25%; }
  #fund-accounts-table th:nth-child(3) { width: 27%; }
  #fund-accounts-table th:nth-child(4) { width: 23%; }
  #fund-accounts-table th:nth-child(6) { width: 25%; font-size: 0; }
  #fund-accounts-table th:nth-child(6)::after { content: 'G/P mois'; font-size: 9px; }
  #fund-accounts-table th:nth-child(6),
  #fund-accounts-table td:nth-child(6) { padding-right: 7px; }
  #fund-accounts-table td:not(:first-child) { white-space: nowrap; }
  #fund-accounts-table tbody .fund-account-identity { min-height: 22px; gap: 3px; }
  #fund-accounts-table tbody .fund-account-logo { width: 18px; height: 18px; flex-basis: 18px; }
  #fund-accounts-table tbody .fund-row-hide { width: 14px; height: 18px; flex-basis: 14px; padding: 1px; }
  #fund-accounts-table tbody .fund-row-hide svg { width: 13px; height: 13px; }
  #fund-accounts-table .fund-account-update-date { display: grid; gap: 1px; font-size: 7px; }
  #fund-accounts-table .fund-equity { margin-top: 1px; font-size: .9em; }
  #fund-accounts-table .fund-mobile-month-performance { display: block; margin-top: 2px; font-size: 9px; font-weight: 800; line-height: 1; }
  #fund-accounts-table.mobile-stakes-view th:nth-child(n+2):nth-child(-n+7),
  #fund-accounts-table.mobile-stakes-view td:nth-child(n+2):nth-child(-n+7) { display: none; }
  #fund-accounts-table.mobile-stakes-view .fund-stake-total,
  #fund-accounts-table.mobile-stakes-view .fund-stake-detail { display: table-cell; padding-right: 1px; padding-left: 1px; vertical-align: top; text-align: center; line-height: 1.1; }
  #fund-accounts-table.mobile-stakes-view th:nth-child(1) { width: 25%; }
  #fund-accounts-table.mobile-stakes-view th:nth-child(8),
  #fund-accounts-table.mobile-stakes-view th:nth-child(n+9):nth-child(-n+11) { width: 18.75%; }
  #fund-accounts-table.mobile-stakes-view th:nth-child(12),
  #fund-accounts-table.mobile-stakes-view td:nth-child(12) { display: none; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes th:nth-child(12),
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes td:nth-child(12) { display: table-cell; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes th:nth-child(1) { width: 22%; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes th:nth-child(8),
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes th:nth-child(n+9):nth-child(-n+12) { width: 15.6%; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes th,
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes td { padding-right: 2px; padding-left: 2px; font-size: 9px; letter-spacing: -.025em; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes th:nth-child(n+8),
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes td:nth-child(n+8) { border-left: 1px solid rgba(22,119,174,.28); }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes .fund-total td { font-size: 9.25px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes .fund-account-identity { gap: 2px; font-size: 9.5px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes .fund-account-logo { width: 14px; height: 14px; flex-basis: 14px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes .fund-row-hide { width: 11px; height: 15px; flex-basis: 11px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes .fund-row-hide svg { width: 10px; height: 10px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes .fund-account-update-date { font-size: 6px; letter-spacing: 0; }
  #fund-accounts-table.mobile-stakes-view th:nth-child(11),
  #fund-accounts-table.mobile-stakes-view td:nth-child(11) { padding-right: 7px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes th:nth-child(11),
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes td:nth-child(11) { padding-right: 1px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes th:nth-child(12),
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes td:nth-child(12) { padding-right: 7px; }
  #fund-accounts-table.mobile-stakes-view .fund-calculation-net { display: none; }
  #fund-accounts-table.mobile-stakes-view .fund-stake-percentage { padding-right: 15px; font-size: 7px; line-height: 9px; }
  #fund-accounts-table.mobile-stakes-view .fund-stake-detail .fund-trade-badge {
    top: auto;
    right: 3px;
    bottom: 4px;
    min-width: 10px;
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 2px;
    font-size: 6px;
    line-height: 8px;
  }
  #fund-accounts-table.mobile-stakes-view td:nth-child(11) .fund-stake-percentage { padding-right: 21px; }
  #fund-accounts-table.mobile-stakes-view td:nth-child(11) .fund-trade-badge { right: 7px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes td:nth-child(11) .fund-stake-percentage { padding-right: 15px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes td:nth-child(11) .fund-trade-badge { right: 3px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes td:nth-child(12) .fund-stake-percentage { padding-right: 21px; }
  #fund-accounts-table.mobile-stakes-view.show-zero-stakes td:nth-child(12) .fund-trade-badge { right: 7px; }
  #fund-stake-toggle { display: none; }
  .fund-table .fund-calculation td { padding-top: 5px; padding-bottom: 5px; }
  .fund-table .fund-calculation td.fund-calculation-label { white-space: normal; }

  .fund-trades-header { min-height: 0; padding: 5px 7px; }
  .fund-trades-header h2 { font-size: 15px; }
  .fund-trades-header-tools { gap: 4px; }
  .fund-trades-detail-toggle { height: 27px; padding: 3px 6px; font-size: 9px; }
  .fund-trades-layout { grid-template-columns: 1fr; }
  .fund-trades-table { width: 100%; table-layout: fixed; font-size: 9px; line-height: 1.05; white-space: nowrap; }
  .fund-trades-table th, .fund-trades-table td { padding: 4px 2px; overflow: hidden; text-overflow: clip; }
  .fund-trades-scroll .fund-trades-table th:first-child { width: 68px; }
  .fund-trades-table thead th { height: 25px; }
  .fund-trades-table tbody th, .fund-trades-table tbody td { height: 34px; }
  .fund-trades-table small { margin-top: 1px; font-size: 7.5px; }
  .fund-trades-table thead small { display: block; margin-left: 0; font-size: 7px; }
  .fund-trades-table .trade-next { display: block; font-size: 7.5px; }
  .fund-trades-summary { border-top-width: 1px; }
  .fund-trades-summary .fund-trades-table { font-size: 10px; }
  .fund-trades-detail-table { display: none; }
  .fund-trades-detail-mobile { padding: 5px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .fund-mobile-trade-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: rgba(4,45,71,.75); }
  .fund-mobile-trade-card h3 { margin: 0; padding: 3px; border-bottom: 1px solid var(--line); color: #acd3ff; background: rgba(7,54,83,.72); font-size: 12px; text-align: center; }
  .fund-mobile-trade-account { padding: 3px; border-top: 1px solid rgba(22,119,174,.36); }
  .fund-mobile-trade-account:first-of-type { border-top: 0; }
  .fund-mobile-trade-account-heading { min-width: 0; display: flex; align-items: center; gap: 3px; margin-bottom: 2px; }
  .fund-mobile-trade-account-heading img { width: 13px; height: 13px; flex: 0 0 13px; object-fit: contain; }
  .fund-mobile-trade-account-heading strong { min-width: 0; overflow: hidden; font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
  .fund-mobile-trade-conversion { margin-left: auto; color: #9dceff; font-size: 7px; font-weight: 800; line-height: 1; white-space: nowrap; }
  .fund-mobile-trade-account-heading .fund-trade-badge { position: static; min-width: 11px; width: 11px; height: 11px; margin: 0 0 0 auto; padding: 0; flex: 0 0 11px; border-radius: 3px; font-size: 6px; line-height: 1; }
  .fund-mobile-trade-conversion + .fund-trade-badge { margin-left: 2px; }
  .fund-mobile-trade-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .fund-mobile-trade-values > span { min-width: 0; padding: 2px; display: grid; align-content: start; gap: 2px; border-radius: 3px; background: rgba(69,162,255,.06); }
  .fund-mobile-trade-value-line { min-width: 0; display: grid; gap: 1px; }
  .fund-mobile-trade-values small { color: var(--muted); font-size: 6px; line-height: 1; }
  .fund-mobile-trade-values strong { overflow: hidden; font-size: 9.5px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
  .fund-mobile-trade-values .trade-buy { color: var(--green); }
  .fund-mobile-trade-values .trade-sell { color: #ff7384; }
  .fund-trades-detail-mobile-empty { grid-column: 1 / -1; margin: 0; padding: 18px; color: var(--muted); text-align: center; }
  .fund-view.show-inactive-fund-robots .fund-trades-scroll .fund-trades-table { font-size: 8px; letter-spacing: -.025em; }
  .fund-view.show-inactive-fund-robots .fund-trades-scroll .fund-trades-table th,
  .fund-view.show-inactive-fund-robots .fund-trades-scroll .fund-trades-table td { padding-right: 1px; padding-left: 1px; }
  .fund-view.show-inactive-fund-robots .fund-trades-scroll .fund-trades-table th:first-child { width: 60px; }
  .fund-view.show-inactive-fund-robots .fund-trades-scroll .fund-trades-table th:last-child,
  .fund-view.show-inactive-fund-robots .fund-trades-scroll .fund-trades-table td:last-child { padding-right: 4px; }
}

@keyframes pull-refresh-spin { to { transform: rotate(360deg); } }
