/* FNTradeLink client app: dark navy shell, blue accent. Loaded after the legacy theme so it wins. */
.fx-app {
    --fx-bg: #030B16; --fx-side: #040C17; --fx-card: #0A1420; --fx-card2: #0D1828; --fx-line: #15233A; --fx-line2: #1F3050;
    --fx-blue: #0B5FFF; --fx-blue2: #2F7BFF; --fx-sky: #38BDF8;
    --fx-text: #EAF1FB; --fx-muted: #8FA0B8; --fx-dim: #5B6B82; --fx-green: #22C55E; --fx-red: #F0505C; --fx-amber: #F5A524;
    display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh;
    background: var(--fx-bg); color: var(--fx-text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased;
}
body:has(.fx-app) { background: #030B16 !important; margin: 0; }
.fx-app *, .fx-app *::before, .fx-app *::after { box-sizing: border-box; }
.fx-app a { color: inherit; text-decoration: none; }
.fx-grow { flex: 1; }

/* ---- icons (CSS masks) ---- */
.fx-i { display: inline-block; width: 20px; height: 20px; flex: none; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.fx-i.big { width: 30px; height: 30px; }
.i-home { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 12h3v8h5v-6h4v6h5v-8h3z'/%3E%3C/svg%3E"); }
.i-crown { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 16 3 6l5 4 4-6 4 6 5-4-2 10zm0 2h14v2H5z'/%3E%3C/svg%3E"); }
.i-link { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.6 13.4a3 3 0 0 0 4.2 0l3.5-3.5a3 3 0 0 0-4.2-4.2l-1 1 1.4 1.4 1-1a1 1 0 0 1 1.4 1.4l-3.5 3.5a1 1 0 0 1-1.4 0zm2.8-2.8a3 3 0 0 0-4.2 0l-3.5 3.5a3 3 0 1 0 4.2 4.2l1-1-1.4-1.4-1 1a1 1 0 0 1-1.4-1.4l3.5-3.5a1 1 0 0 1 1.4 0z'/%3E%3C/svg%3E"); }
.i-pos { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3h2v3h2v8H9v3H7v-3H5V6h2zm8 5h2v3h2v7h-2v2h-2v-2h-2v-7h2z'/%3E%3C/svg%3E"); }
.i-book { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h13a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H6a2 2 0 0 1-2-2V4a1 1 0 0 1 1-1zm1 2v12.2A2 2 0 0 1 7 17h10V5zm1 14h10v-1H7a1 1 0 0 0 0 1z'/%3E%3C/svg%3E"); }
.i-cal { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h3v18H4V4h3zM6 9v11h12V9z'/%3E%3C/svg%3E"); }
.i-chart { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20V4h2v14h14v2zm4-4V9h3v7zm5 0V5h3v11zm5 0v-5h3v5z'/%3E%3C/svg%3E"); }
.i-gear { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M19.4 13a7.7 7.7 0 0 0 0-2l2-1.6-2-3.4-2.4 1a7 7 0 0 0-1.7-1L15 3h-4l-.4 3a7 7 0 0 0-1.7 1l-2.4-1-2 3.4 2 1.6a7.7 7.7 0 0 0 0 2l-2 1.6 2 3.4 2.4-1c.5.4 1.1.7 1.7 1L11 21h4l.4-3c.6-.3 1.2-.6 1.7-1l2.4 1 2-3.4zM13 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/%3E%3C/svg%3E"); }
.i-help { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a8 8 0 0 0-8 8v6a3 3 0 0 0 3 3h1v-7H6v-2a6 6 0 0 1 12 0v2h-2v7h2a2 2 0 0 1-2 2h-4v2h4a4 4 0 0 0 4-4v-8a8 8 0 0 0-8-8z'/%3E%3C/svg%3E"); }
.i-search { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 1 0 5 14.3l5 5 1.4-1.4-5-5A8 8 0 0 0 10 2zm0 2a6 6 0 1 1 0 12 6 6 0 0 1 0-12z'/%3E%3C/svg%3E"); }
.i-bell { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a6 6 0 0 0-6 6v4l-2 3v1h16v-1l-2-3V8a6 6 0 0 0-6-6zm-2 17a2 2 0 0 0 4 0z'/%3E%3C/svg%3E"); }
.i-chev { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); }
.i-trend { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17 9 11l4 4 8-9v4h2V4h-6v2h2l-6.4 7.2L9 9l-7 7z'/%3E%3C/svg%3E"); }
.i-doc { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h8l6 6v14H6zm8 1.5V9h5.5zM8 13h8v2H8zm0 4h8v2H8z'/%3E%3C/svg%3E"); }
.i-left { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 6l-6 6 6 6z'/%3E%3C/svg%3E"); }
.i-right { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6z'/%3E%3C/svg%3E"); }

/* ---- sidebar ---- */
.fx-nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.fx-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--fx-side); border-right: 1px solid var(--fx-line); padding: 18px 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.fx-logo { display: block; text-align: center; padding: 4px 0 6px; }
.fx-logo img { width: 170px; max-width: 100%; height: auto; }
.fx-nav { display: grid; gap: 4px; }
.fx-nav a { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 10px; color: #A9B6C9; font-size: 14.5px; font-weight: 500; transition: background .15s, color .15s; }
.fx-nav a:hover { background: rgba(47, 123, 255, .1); color: #fff; }
.fx-nav a.active { background: var(--fx-blue); color: #fff; box-shadow: 0 8px 24px -10px rgba(11, 95, 255, .8); }
.fx-upgrade { margin-top: auto; padding: 16px; border: 1px solid var(--fx-line2); background: #071327; border-radius: 14px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.fx-upgrade .fx-i.big { color: #7FB0FF; }
.fx-upgrade b { font-size: 14.5px; }
.fx-upgrade p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--fx-muted); }
.fx-scrim { display: none; }

/* ---- top bar ---- */
.fx-main { min-width: 0; display: flex; flex-direction: column; }
.fx-top { display: flex; align-items: center; gap: 14px; padding: 12px 22px; background: #04121F; border-bottom: 1px solid var(--fx-line); position: sticky; top: 0; z-index: 30; }
.fx-burger { display: none; width: 40px; height: 40px; border-radius: 10px; flex-direction: column; justify-content: center; gap: 4px; align-items: center; cursor: pointer; border: 1px solid var(--fx-line2); }
.fx-burger span { width: 18px; height: 2px; background: #fff; display: block; }
.fx-search { display: flex; align-items: center; gap: 10px; width: min(520px, 100%); padding: 0 14px; height: 42px; background: #0A1626; border: 1px solid var(--fx-line2); border-radius: 10px; color: var(--fx-muted); }
.fx-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--fx-text); font: inherit; font-size: 13.5px; }
.fx-search input::placeholder { color: var(--fx-dim); }
.fx-bell { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: #C7D3E6; }
.fx-bell:hover { background: rgba(255, 255, 255, .06); }
.fx-user { position: relative; }
.fx-user summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 12px; }
.fx-user summary::-webkit-details-marker { display: none; }
.fx-user summary:hover { background: rgba(255, 255, 255, .05); }
.fx-user img { width: 40px; height: 40px; border-radius: 50% !important; object-fit: cover; }
.fx-user-t { display: grid; line-height: 1.25; }
.fx-user-t b { font-size: 14px; }
.fx-user-t small { color: var(--fx-muted); font-size: 12px; }
.fx-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: #0A1626; border: 1px solid var(--fx-line2); border-radius: 12px; padding: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); display: grid; z-index: 40; }
.fx-menu a, .fx-menu button { text-align: left; padding: 10px 12px; border-radius: 8px; color: #D5DFEE; font-size: 13.5px; background: none; border: 0; cursor: pointer; font-family: inherit; width: 100%; }
.fx-menu a:hover, .fx-menu button:hover { background: rgba(47, 123, 255, .14); color: #fff; }
.fx-menu form { margin: 0; }

.fx-content { padding: 20px 22px 40px; min-width: 0; }

/* ---- buttons ---- */
.fx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 0; border-radius: 9px; background: var(--fx-blue); color: #fff !important; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: filter .15s, transform .15s; }
.fx-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.fx-btn.ghost { background: transparent; border: 1px solid var(--fx-line2); color: var(--fx-text) !important; }
.fx-btn.sm { padding: 7px 12px; font-size: 12.5px; }
.fx-btn-block { width: 100%; }

/* ---- dashboard widgets ---- */
.fx-dash { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.fx-left { display: grid; gap: 16px; min-width: 0; }
.fx-row-a { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; }
.fx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fx-card { background: var(--fx-card); border: 1px solid var(--fx-line); border-radius: 14px; padding: 18px 20px; min-width: 0; }
.fx-card h3, .fx-card h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--fx-text); }

.fx-hero { position: relative; overflow: hidden; min-height: 168px; padding: 24px 28px; border: 1px solid var(--fx-line2); border-radius: 14px; background: #040E1E; display: flex; flex-direction: column; justify-content: center; }
.fx-hero::before { content: ""; position: absolute; inset: 0; background: url("../images/dash-hero.jpg") right center / auto 118% no-repeat; opacity: .95; -webkit-mask-image: linear-gradient(90deg, transparent 22%, #000 62%); mask-image: linear-gradient(90deg, transparent 22%, #000 62%); }
.fx-hero > * { position: relative; }
.fx-hero small { font-size: 22px; color: #D3DEEE; font-weight: 400; }
.fx-hero h1 { margin: 2px 0 10px; font-size: 38px; line-height: 1.1; letter-spacing: -.02em; color: #fff; }
.fx-hero p { margin: 0; max-width: 340px; font-size: 14px; line-height: 1.55; color: #B7C4D8; }
.fx-badge { position: absolute !important; top: 16px; right: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; border-radius: 8px; background: rgba(8, 24, 40, .85); border: 1px solid var(--fx-line2); }
.fx-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--fx-green); box-shadow: 0 0 10px var(--fx-green); }
.fx-badge.idle i { background: var(--fx-amber); box-shadow: 0 0 10px var(--fx-amber); }

.fx-equity { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.fx-equity .t { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #D0DBEC; font-weight: 600; }
.fx-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(47, 123, 255, .16); color: #6EA2FF; flex: none; }
.fx-ico.green { background: rgba(34, 197, 94, .14); color: #4ADE80; }
.fx-ico.red { background: rgba(240, 80, 92, .14); color: #FF7A85; }
.fx-ico.purple { background: rgba(139, 92, 246, .16); color: #B79CFF; }
.fx-equity b { font-size: 34px; letter-spacing: -.02em; margin-top: 8px; }
.fx-delta { font-size: 14px; font-weight: 700; }
.fx-delta.pos, .pos { color: var(--fx-green); }
.fx-delta.neg, .neg { color: var(--fx-red); }
.fx-equity small, .fx-sub { color: var(--fx-muted); font-size: 12.5px; }

.fx-stat { display: flex; align-items: center; gap: 14px; position: relative; }
.fx-stat .v { font-size: 28px; font-weight: 700; line-height: 1.05; }
.fx-stat .v em { font-style: normal; font-size: 18px; color: var(--fx-dim); font-weight: 500; }
.fx-stat .l { font-size: 13px; color: #C2CEDF; margin-bottom: 2px; }
.fx-stat .chev { position: absolute; right: 0; color: var(--fx-dim); }

.fx-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.fx-panel-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fx-panel-h h3 { flex: 1; font-size: 16px; }
.fx-link { font-size: 13px; color: #5C98FF !important; font-weight: 600; }
.fx-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.fx-tbl th { text-align: left; padding: 9px 10px; font-weight: 500; font-size: 12px; color: var(--fx-muted); background: #0A1626; }
.fx-tbl th:first-child { border-radius: 8px 0 0 8px; } .fx-tbl th:last-child { border-radius: 0 8px 8px 0; }
.fx-tbl td { padding: 11px 10px; border-bottom: 1px solid var(--fx-line); color: #D5DFEE; }
.fx-tbl tr:last-child td { border-bottom: 0; }
.fx-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.fx-tag { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: rgba(47, 123, 255, .16); color: #7FB0FF; }
.fx-tag.ok { background: rgba(34, 197, 94, .14); color: #4ADE80; } .fx-tag.bad { background: rgba(240, 80, 92, .14); color: #FF7A85; } .fx-tag.warn { background: rgba(245, 165, 36, .14); color: #F7BE5C; } .fx-tag.dim { background: rgba(143, 160, 184, .14); color: var(--fx-muted); }
.fx-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 26px 12px 14px; color: var(--fx-muted); }
.fx-empty .fx-i { width: 34px; height: 34px; color: #4C6288; }
.fx-empty b { color: var(--fx-text); font-size: 15px; }
.fx-empty p { margin: 0 0 6px; font-size: 12.5px; }

/* ---- calendar ---- */
.fx-cal { padding: 14px 14px 16px; }
.fx-cal-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fx-cal-h h3 { flex: 1; font-size: 14.5px; }
.fx-cal-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.fx-cal-nav button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--fx-line2); background: #0A1626; color: #C7D3E6; cursor: pointer; display: grid; place-items: center; }
.fx-cal-nav button:hover { background: #10213a; }
.fx-cal-nav .m { flex: 1; text-align: center; padding: 6px 0; border-radius: 8px; background: #0A1626; border: 1px solid var(--fx-line2); font-size: 13.5px; font-weight: 600; }
.fx-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.fx-cal-dow { text-align: center; font-size: 10.5px; letter-spacing: .06em; color: var(--fx-muted); padding: 2px 0 4px; }
.fx-d { aspect-ratio: 1 / 1; border-radius: 8px; background: #0E1A2A; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 4px 2px; font-size: 11.5px; color: #C2CEDF; border: 1px solid transparent; line-height: 1.15; overflow: hidden; }
.fx-d.out { background: transparent; color: #3E4E66; }
.fx-d.win { background: rgba(34, 197, 94, .13); border-color: rgba(34, 197, 94, .55); }
.fx-d.loss { background: rgba(240, 80, 92, .13); border-color: rgba(240, 80, 92, .55); }
.fx-d.today { box-shadow: inset 0 0 0 1.5px #2F7BFF; }
.fx-d .p { font-size: 10px; font-weight: 700; margin-top: 2px; }
.fx-d.win .p { color: #4ADE80; } .fx-d.loss .p { color: #FF7A85; }
.fx-d .n { font-size: 9px; color: var(--fx-muted); }
.fx-cal.big .fx-d { aspect-ratio: auto; min-height: 92px; padding: 8px 8px; align-items: flex-start; font-size: 13px; border-radius: 10px; }
.fx-cal.big .fx-d .p { font-size: 15px; margin-top: 6px; }
.fx-cal.big .fx-d .n { font-size: 11.5px; }
.fx-cal.big .fx-cal-grid { gap: 8px; }
.fx-cal.big .fx-cal-dow { font-size: 12px; padding-bottom: 8px; }

/* ---- page header used by the new pages ---- */
.fx-pg-h { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.fx-pg-h h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.fx-pg-h p { margin: 2px 0 0; color: var(--fx-muted); font-size: 14px; }
.fx-sumrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.fx-sum .l { font-size: 12.5px; color: var(--fx-muted); }
.fx-sum .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.fx-sel { background: #0A1626; border: 1px solid var(--fx-line2); color: var(--fx-text); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 13.5px; }

/* ---- responsive ---- */
@media (max-width: 1180px) {
    .fx-dash { grid-template-columns: minmax(0, 1fr); }
    .fx-cal-wrap { order: 3; }
}
@media (max-width: 900px) {
    .fx-app { grid-template-columns: minmax(0, 1fr); }
    .fx-side { position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
    .fx-nav-toggle:checked ~ .fx-side { transform: none; }
    .fx-nav-toggle:checked ~ .fx-scrim { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); }
    .fx-burger { display: flex; }
    .fx-user-t { display: none; }
    .fx-row-a { grid-template-columns: minmax(0, 1fr); }
    .fx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fx-panels { grid-template-columns: minmax(0, 1fr); }
    .fx-sumrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fx-hero h1 { font-size: 30px; }
    .fx-content { padding: 16px 14px 36px; }
}
@media (max-width: 520px) {
    .fx-stats { grid-template-columns: minmax(0, 1fr); }
    .fx-cal-grid { gap: 3px; }
}

/* stat cards: keep labels on one line like the design */
.fx-stat { padding: 16px 14px; gap: 11px; }
.fx-stat .fx-ico { width: 36px; height: 36px; }
.fx-stat .l { font-size: 12.5px; white-space: nowrap; }
.fx-stat .chev { right: 8px; width: 16px; height: 16px; }

/* The legacy theme squares everything with !important; the new shell is rounded on purpose. */
html body .fx-card, html body .fx-hero, html body .fx-upgrade, html body .fx-menu { border-radius: 14px !important; }
html body .fx-nav a, html body .fx-search, html body .fx-burger, html body .fx-bell, html body .fx-btn, html body .fx-sel, html body .fx-cal-nav button, html body .fx-cal-nav .m, html body .fx-badge { border-radius: 10px !important; }
html body .fx-d { border-radius: 9px !important; }
html body .fx-ico { border-radius: 11px !important; }
html body .fx-tag { border-radius: 6px !important; }
html body .fx-user summary, html body .fx-menu a, html body .fx-menu button { border-radius: 10px !important; }
html body .fx-tbl th:first-child { border-radius: 8px 0 0 8px !important; }
html body .fx-tbl th:last-child { border-radius: 0 8px 8px 0 !important; }
html body .fx-user img { border-radius: 50% !important; }

/* no sideways scrolling on phones */
body:has(.fx-app) { overflow-x: hidden; }
.fx-main { overflow-x: clip; }
.fx-top { min-width: 0; }
.fx-search { flex: 1 1 auto; min-width: 0; width: auto; max-width: 520px; }
.fx-search input { width: 100%; min-width: 0; }
.fx-card { overflow-x: auto; }
@media (max-width: 900px) {
    .fx-bell { display: none; }
    .fx-hero::before { opacity: .5; -webkit-mask-image: linear-gradient(90deg, transparent 5%, #000 85%); mask-image: linear-gradient(90deg, transparent 5%, #000 85%); }
    .fx-top { padding: 10px 14px; gap: 10px; }
}

/* ---- phone "app" view: dashboard header + tabs, list rows, bottom tab bar (desktop is unchanged) ---- */
.fx-mhead, .fx-seg, .fx-mlist, .fx-tabbar { display: none; }
@media (max-width: 900px) {
    .fx-content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

    .fx-mhead { display: block; position: relative; overflow: hidden; margin-bottom: 14px; padding: 18px 18px 14px; border: 1px solid var(--fx-line2); background: #071327; }
    .fx-mhead > small { color: var(--fx-muted); font-size: 13px; }
    .fx-mhead-name { display: block; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
    .fx-mhead-eq { margin-top: 14px; display: grid; gap: 2px; }
    .fx-mhead-eq small { color: var(--fx-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
    .fx-mhead-eq strong { font-size: 32px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
    .fx-mhead-eq .fx-delta { font-size: 13px; font-weight: 600; }
    .fx-mhead-stats { margin-top: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .fx-mhead-stats a { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; background: rgba(255, 255, 255, .04); border: 1px solid var(--fx-line2); }
    .fx-mhead-stats b { font-size: 17px; font-variant-numeric: tabular-nums; }
    .fx-mhead-stats em { font-style: normal; font-size: 12px; color: var(--fx-dim); font-weight: 500; }
    .fx-mhead-stats span { font-size: 11px; color: var(--fx-muted); }

    .fx-seg { display: flex; gap: 4px; position: sticky; top: 60px; z-index: 20; margin: 0 0 14px; padding: 4px; background: #0A1626; border: 1px solid var(--fx-line2); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .8); }
    .fx-seg button { flex: 1; min-width: 0; padding: 9px 4px; border: 0; background: transparent; color: var(--fx-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
    .fx-seg button.on { background: var(--fx-blue); color: #fff; }
    .fx-seg em { font-style: normal; margin-left: 4px; padding: 0 6px; font-size: 11px; background: rgba(255, 255, 255, .18); }

    .fx-dash .fx-left { display: none; }
    .fx-dash, .fx-panels { gap: 14px; }
    .fx-tabp:not(.on) { display: none; }
    .fx-panels .fx-tbl { display: none; }
    .fx-panels .fx-card { padding: 14px; }
    .fx-panel-h .fx-btn.sm { padding: 7px 12px; font-size: 12px; }

    .fx-mlist { display: grid; }
    .fx-li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--fx-line); min-width: 0; }
    .fx-li:last-of-type { border-bottom: 0; }
    .fx-li-m { flex: 1; min-width: 0; display: grid; gap: 2px; }
    .fx-li-m b, .fx-li-m small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .fx-li-m b { font-size: 14px; }
    .fx-li-m small, .fx-li-v small { font-size: 12px; color: var(--fx-muted); }
    .fx-li-v { display: grid; justify-items: end; gap: 2px; text-align: right; font-variant-numeric: tabular-nums; }
    .fx-li-v b { font-size: 14px; }
    .fx-li-dot { width: 10px; height: 10px; flex: none; background: var(--fx-dim); }
    .fx-li-dot.ok { background: var(--fx-green); box-shadow: 0 0 8px var(--fx-green); }
    .fx-li-side { width: 34px; height: 34px; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
    .fx-li-side.ok { background: rgba(34, 197, 94, .14); color: #4ADE80; }
    .fx-li-side.bad { background: rgba(240, 80, 92, .14); color: #FF7A85; }
    .fx-li-more { display: block; padding: 12px 0 2px; text-align: center; font-size: 13px; font-weight: 600; color: var(--fx-sky) !important; }

    .fx-tabbar { display: flex; position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(4, 12, 23, .96); border-top: 1px solid var(--fx-line); backdrop-filter: blur(10px); }
    .fx-tabbar a, .fx-tabbar label { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; color: var(--fx-dim); font-size: 11px; font-weight: 600; cursor: pointer; }
    .fx-tabbar a.active { color: #fff; }
    .fx-tabbar a.active .fx-i { color: var(--fx-blue2); }
    .fx-tabbar-dots { height: 20px; display: flex; align-items: center; gap: 3px; }
    .fx-tabbar-dots i { width: 4px; height: 4px; background: currentColor; }
}
html body .fx-mhead, html body .fx-seg { border-radius: 16px !important; }
html body .fx-mhead-stats a { border-radius: 12px !important; }
html body .fx-seg button { border-radius: 12px !important; }
html body .fx-seg em { border-radius: 999px !important; }
html body .fx-li-side { border-radius: 10px !important; }
html body .fx-li-dot, html body .fx-tabbar-dots i { border-radius: 50% !important; }

/* ---------------------------------------------------------------- analytics (account report, myfxbook-style panels) */
.fxa-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.fxa-title h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.fxa-title p { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--fx-text); font-size: 14px; }
.fxa-dim { color: var(--fx-muted); font-weight: 400; }
.fxa .pos { color: var(--fx-green) !important; }
.fxa .neg { color: var(--fx-red) !important; }
.fxa-loading { display: flex; align-items: center; gap: 12px; padding: 18px; color: var(--fx-muted); }
.fxa-spin { width: 18px; height: 18px; border: 2px solid var(--fx-line2); border-top-color: var(--fx-blue2); border-radius: 50%; animation: fxa-spin .8s linear infinite; }
@keyframes fxa-spin { to { transform: rotate(360deg); } }
.fxa-empty { display: grid; place-items: center; height: 300px; color: var(--fx-muted); font-size: 14px; text-align: center; }

/* panel: a header strip with a bold title followed by tabs; the open tab takes the panel's own colour */
.fxp { background: var(--fx-card); border: 1px solid var(--fx-line2); margin-bottom: 18px; min-width: 0; font-size: 13.5px; }
.fxp-bar { display: flex; align-items: stretch; flex-wrap: wrap; gap: 2px; background: var(--fx-card2); border-bottom: 1px solid var(--fx-line2); }
.fxp-bar b { display: flex; align-items: center; padding: 0 14px; min-height: 38px; font-size: 14.5px; font-weight: 700; color: var(--fx-text); }
.fxp-bar button { padding: 0 14px; min-height: 38px; border: 0; background: var(--fx-line); color: var(--fx-muted); font: inherit; font-size: 14px; cursor: pointer; }
.fxp-bar button:hover { color: var(--fx-text); }
.fxp-bar button.on { background: var(--fx-card); color: var(--fx-text); }
.fxp-body { padding: 12px 14px 6px; }
.fxp-scroll { overflow-x: auto; }
.fxp-none { padding: 22px; text-align: center; color: var(--fx-muted); }
.fxp-tip { border-bottom: 1px dotted var(--fx-muted); cursor: help; }
.fxp-i { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--fx-dim); color: var(--fx-card); font-size: 10px; font-weight: 700; cursor: help; }

.fxa-top { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.fxp-dl { display: grid; grid-template-columns: 1fr auto; margin: 0; padding: 0 8px; }
.fxp-dl dt, .fxp-dl dd { margin: 0; padding: 5px 0; color: var(--fx-text); font-weight: 400; }
.fxp-dl dd { text-align: right; font-variant-numeric: tabular-nums; }
.fxp-dl dd.big { font-weight: 700; }
.fxp-dl .gap { border-top: 1px solid var(--fx-line2); margin-top: 4px; padding-top: 9px; }
.fxp-dl dt:first-child { font-weight: 700; }

.fxp-grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fxp-grid th { padding: 10px 8px; font-size: 12.5px; font-weight: 500; color: var(--fx-text); text-align: center; border-bottom: 1px solid var(--fx-line2); white-space: nowrap; }
.fxp-grid td { padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--fx-line); white-space: nowrap; }
.fxp-grid th:first-child, .fxp-grid td:first-child { text-align: left; padding-left: 12px; }
.fxp-grid tbody tr:hover td { background: var(--fx-card2); }
.fxp-grid tr:last-child td { border-bottom: 0; }
.fxp-diff { color: var(--fx-muted); }
.fxp-diff .pos, .fxp-diff .neg { opacity: .8; }
.fxp-sum tr.grp th { border-bottom: 0; padding-bottom: 0; color: var(--fx-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.fxp-cal td { min-width: 62px; }

.fxp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fxp-stats dl { display: grid; grid-template-columns: 1fr auto; margin: 0; align-content: start; }
.fxp-stats dl + dl { border-left: 1px solid var(--fx-line2); }
.fxp-stats dt, .fxp-stats dd { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--fx-line); font-weight: 400; color: var(--fx-text); }
.fxp-stats dd { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fxp-prof { display: inline-block; width: 100px; height: 10px; vertical-align: middle; background: var(--fx-red); }
.fxp-prof i { display: block; height: 100%; background: var(--fx-green); }
.fxp-hist { padding: 8px; }

.fxa-buckets, .fxa-monthly { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fxa-buckets > div, .fxa-monthly > div { padding: 12px 14px; min-width: 0; }
.fxa-buckets > div + div, .fxa-monthly > div + div { border-left: 1px solid var(--fx-line2); }
.fxa-buckets h4, .fxa-monthly h4 { margin: 0 0 6px; font-size: 13px; font-weight: 700; text-align: center; color: var(--fx-text); }
.fxa-pick { display: grid; place-items: center; height: 100%; min-height: 260px; font-weight: 700; }
.fxa-click .rz-series-item, .fxa-click path { cursor: pointer; }
.fxa-rz .rz-axis text, .fxa-rz text { fill: var(--fx-muted) !important; font-size: 11px; }
.fxa-rz .rz-series-data-label text, .fxa-rz text.rz-series-data-label { fill: var(--fx-text) !important; }
.fxa-rz .rz-grid-line line, .fxa-rz .rz-axis line, .fxa-rz .rz-axis path { stroke: var(--fx-line) !important; }
.fxa-rz .rz-legend-item-text { color: var(--fx-text); font-size: 12px; }

/* profit / loss calendar */
.fxa-cal { padding: 12px 14px 16px; }
.fxa-cal-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 12px; }
.fxa-cal-head > b { min-width: 150px; text-align: center; font-size: 15px; font-weight: 700; color: var(--fx-text); }
.fxa-cal-head button { width: 32px; height: 32px; border: 1px solid var(--fx-line2); background: var(--fx-card2); color: var(--fx-text); font-size: 18px; line-height: 1; cursor: pointer; }
.fxa-cal-head button:hover:not(:disabled) { border-color: var(--fx-blue2); }
.fxa-cal-head button:disabled { opacity: .35; cursor: default; }
.fxa-cal-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-left: auto; font-size: 13px; color: var(--fx-muted); }
.fxa-cal-sum b { color: var(--fx-text); font-variant-numeric: tabular-nums; }
.fxa-cal-sum em { font-style: normal; color: var(--fx-dim); font-size: 12px; }
.fxa-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.05fr); gap: 4px; }
.fxa-cal-dow { padding: 4px 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--fx-muted); text-align: center; }
.fxa-cal-day, .fxa-cal-week { display: flex; flex-direction: column; gap: 2px; min-height: 86px; padding: 7px 8px; background: var(--fx-card2); border: 1px solid var(--fx-line); font-variant-numeric: tabular-nums; min-width: 0; }
.fxa-cal-day .n, .fxa-cal-week .n { font-size: 12px; color: var(--fx-muted); font-weight: 600; }
.fxa-cal-day b, .fxa-cal-week b { margin-top: auto; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fxa-cal-day small { font-size: 12px; font-weight: 600; }
.fxa-cal-day em, .fxa-cal-week em { font-style: normal; font-size: 11px; color: var(--fx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fxa-cal-day.up, .fxa-cal-week.up { background: #0C2A1E; border-color: #165A3A; }
.fxa-cal-day.up b, .fxa-cal-day.up small, .fxa-cal-week.up b { color: var(--fx-green); }
.fxa-cal-day.down, .fxa-cal-week.down { background: #2C1218; border-color: #6A2530; }
.fxa-cal-day.down b, .fxa-cal-day.down small, .fxa-cal-week.down b { color: var(--fx-red); }
.fxa-cal-day.other { opacity: .35; background: transparent; }
.fxa-cal-day.today { border-color: var(--fx-blue2); }
.fxa-cal-week { background: var(--fx-card); border-style: dashed; }
.fxa-cal .pos { color: var(--fx-green) !important; }
.fxa-cal .neg { color: var(--fx-red) !important; }
.fx-cal.fxa-cal { padding: 14px 14px 16px; }
/* dashboard card: 7 columns, compact cells, summary under the month */
.fxa-cal-sm .fxa-cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.fxa-cal-sm .fxa-cal-head > b { flex: 1; min-width: 0; }
.fxa-cal-sm .fxa-cal-sum { margin-left: 0; width: 100%; gap: 4px 14px; font-size: 12.5px; }
.fxa-cal-sm .fxa-cal-day { min-height: 58px; padding: 5px 6px; }
.fxa-cal-sm .fxa-cal-day b { font-size: 12px; }
.fxa-cal-sm .fxa-cal-day em { font-size: 10.5px; }
.fxa-cal-sm .fxa-cal-dow { padding: 2px 0 4px; font-size: 10.5px; }
html body .fxa-cal-day, html body .fxa-cal-week, html body .fxa-cal-head button { border-radius: 6px !important; }
@media (max-width: 800px) {
    .fxa-cal { padding: 10px 8px 12px; }
    .fxa-cal-sum { margin-left: 0; width: 100%; }
    .fxa-cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
    .fxa-cal-dow:nth-child(8), .fxa-cal-week { display: none; }
    .fxa-cal-day { min-height: 58px; padding: 4px 5px; }
    .fxa-cal-day b { font-size: 11px; }
    .fxa-cal-day small, .fxa-cal-day em { display: none; }
}

html body .fxp { border-radius: 4px !important; overflow: hidden; }
html body .fxp-bar button, html body .fxp-prof, html body .fxp-prof i { border-radius: 0 !important; }

@media (max-width: 1100px) {
    .fxa-top { grid-template-columns: minmax(0, 1fr); }
    .fxp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fxp-stats dl:nth-child(3) { grid-column: 1 / -1; border-left: 0; }
}
@media (max-width: 800px) {
    .fxa-head .rz-dropdown { width: 100%; min-width: 0 !important; }
    .fxp-stats, .fxa-buckets, .fxa-monthly { grid-template-columns: minmax(0, 1fr); }
    .fxp-stats dl + dl, .fxa-buckets > div + div, .fxa-monthly > div + div { border-left: 0; border-top: 1px solid var(--fx-line2); }
    .fxp-stats dl:nth-child(3) { grid-column: auto; }
    .fxp-bar b { width: 100%; min-height: 34px; }
    .fxp-bar button { min-height: 34px; padding: 0 11px; font-size: 13px; }
}
