:root {
  --bg:#070b1a; --text:#e7eaf0; --link:#8ecbff; --card:rgba(18,26,45,.72); --border:rgba(103,149,255,.25);
  --input-bg:rgba(14,22,48,.85); --input-border:#3a4f78; --th:#b7d9ff; --small:#a8b3c9;
  --pos:#55e6a5; --neg:#ff7f96; --kpi-bg:rgba(14,22,48,.72); --kpi-border:#24406f; --canvas:#0a1226;
  --btn-primary-bg:#0095ff; --btn-font:'Montserrat',system-ui,sans-serif;
  --btn-primary-shadow:0 8px 18px rgba(0,149,255,.38), 0 2px 6px rgba(0,0,0,.1);
  --btn-primary-shadow-hover:0 12px 26px rgba(0,149,255,.48), 0 4px 12px rgba(0,0,0,.12);
  --btn-primary-shadow-soft:0 8px 16px rgba(0,149,255,.28);
  --btn-primary-shadow-strong:0 10px 22px rgba(0,149,255,.4);
  --btn-signup-bg:#1FBF1D;
  --btn-signup-shadow:0 8px 18px rgba(31,191,29,.38), 0 2px 6px rgba(0,0,0,.1);
  --btn-signup-shadow-hover:0 12px 26px rgba(31,191,29,.48), 0 4px 12px rgba(0,0,0,.12);
}
body.light, html[data-pre-theme='light'] body {
  --bg:#f3f7ff; --text:#0f172a; --link:#1d4ed8; --card:rgba(255,255,255,.88); --border:#d5deef;
  --input-bg:#ffffff; --input-border:#b9c7e6; --th:#1e40af; --small:#475569;
  --pos:#0f9d58; --neg:#d93025; --kpi-bg:#eef3ff; --kpi-border:#c6d4f5; --canvas:#ffffff;
  --btn-signup-bg:#1FBF1D;
  --btn-signup-shadow:0 8px 18px rgba(31,191,29,.32), 0 2px 6px rgba(0,0,0,.08);
  --btn-signup-shadow-hover:0 12px 26px rgba(31,191,29,.42), 0 4px 12px rgba(0,0,0,.1);
}
body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; margin: 24px; background: radial-gradient(circle at 10% 10%, rgba(41,121,255,.18), transparent 35%), radial-gradient(circle at 90% 0%, rgba(0,188,212,.14), transparent 30%), var(--bg); color:var(--text); }
a { color:var(--link); text-decoration:none; transition:all .2s ease; }
a:hover { opacity:.9; }
.download-link { text-decoration:underline; font-weight:600; }
/* Settings → Downloads: expandable folders */
.downloads-tree { margin-top:4px; }
.downloads-grid-head {
  display:grid;
  grid-template-columns: minmax(160px,1fr) 120px 160px 90px;
  gap:8px;
  align-items:center;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--small);
  padding:4px 8px 10px;
  border-bottom:1px solid var(--kpi-border);
}
.downloads-tree-body { display:flex; flex-direction:column; gap:2px; }
.downloads-folder { border-radius:10px; }
.downloads-folder-sum {
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  font-weight:700;
  font-size:13px;
  border-radius:10px;
  border:1px solid var(--kpi-border);
  background:var(--kpi-bg);
  transition:box-shadow .15s ease;
}
.downloads-folder-sum::-webkit-details-marker { display:none; }
.downloads-folder[open] > .downloads-folder-sum { box-shadow:0 4px 12px rgba(0,0,0,.1); }
.downloads-folder-ico { font-size:18px; line-height:1; }
.downloads-folder-body { padding:6px 0 8px 14px; margin:4px 0 6px 6px; border-left:2px solid var(--kpi-border); }
.downloads-folder-empty { font-size:12px; color:var(--small); font-style:italic; padding:4px 0 4px 8px; }
.downloads-file-row {
  display:grid;
  grid-template-columns: minmax(160px,1fr) 120px 160px 90px;
  gap:8px;
  align-items:center;
  padding:8px 10px;
  font-size:14px;
  border-radius:10px;
  border:1px solid transparent;
}
.downloads-file-row:hover { background:rgba(0,149,255,.06); border-color:rgba(0,149,255,.2); }
body.light .downloads-file-row:hover { background:rgba(0,149,255,.08); }
.downloads-file-name { display:flex; align-items:center; gap:8px; min-width:0; }
.downloads-file-ico { font-size:16px; line-height:1; flex-shrink:0; }
.downloads-file-size { font-variant-numeric:tabular-nums; font-size:13px; color:var(--small); }
.downloads-file-mtime { font-size:13px; color:var(--small); }
@media (max-width: 720px) {
  .downloads-grid-head, .downloads-file-row { grid-template-columns: 1fr; }
  .downloads-h-size, .downloads-h-mtime, .downloads-h-act { display:none; }
  .downloads-file-size, .downloads-file-mtime { display:none; }
}
.subtabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
/* Settings: keep subtab row readable when many pills; second row stays visible */
.profile-settings-subtabs { row-gap:10px; width:100%; min-width:0; }
.profile-settings-subtabs .subtab { flex:0 1 auto; white-space:nowrap; }
.subtab { padding:7px 10px; border-radius:10px; border:1px solid var(--kpi-border); background:var(--kpi-bg); color:var(--text); font-family:var(--btn-font); font-size:12px; font-weight:600; box-shadow:0 4px 12px rgba(0,0,0,.1); transition:transform .15s ease, box-shadow .2s ease; cursor:pointer; }
.subtab:hover { transform:translateY(-1px); box-shadow:0 8px 16px rgba(0,0,0,.15); }
.subtab.active { background:var(--btn-primary-bg); color:#fff; border-color:transparent; box-shadow:var(--btn-primary-shadow); }
.profile-form label { margin-bottom:10px; }
.profile-form-actions { display:flex; align-items:flex-start; gap:10px; margin-top:12px; flex-wrap:wrap; }
.profile-form-actions .apply-filters-btn { margin-top:0; }
.filters-compact.profile-form .profile-form-actions > button { flex:1 1 0; min-width:120px; width:auto; text-align:center; box-sizing:border-box; }
.profile-form-actions .profile-form-delete-account { margin-left:20px; }
.filters-compact.profile-form button { width:auto; }
.profile-form input[readonly] { color:var(--text); -webkit-text-fill-color:var(--text); opacity:1; }
.strategies-form label { margin-bottom:14px; }
.strategies-form .strategies-magic-known-group > label:not(.strategies-known-part-row) { margin-bottom:6px; }
.strategies-form .strategies-magic-known-group .strategies-known-part-row { margin-top:0; margin-bottom:12px; }
.strategies-form .apply-filters-btn { margin-top:14px; }
.alert { border-radius:10px; padding:10px 12px; margin-bottom:10px; display:flex; justify-content:space-between; gap:10px; align-items:center; }
.alert-info { background:rgba(52,120,246,.16); border:1px solid rgba(52,120,246,.45); color:#cfe0ff; }
body.light .alert-info { color:#163a8a; }
.alert-error { background:rgba(217,48,37,.18); border:1px solid rgba(217,48,37,.55); color:#ffd0cc; }
body.light .alert-error { color:#7f1d1d; }
.alert-close { font-family:var(--btn-font); background:transparent; border:1px solid currentColor; color:inherit; min-height:24px; padding:0 8px; box-shadow:none; }
.alert-close:hover { transform:none; filter:none; box-shadow:none; }

/* API Key card — flat pill actions (Montserrat), matches onboarding-style nav buttons */
.api-key-card .api-key-field-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.api-key-card .api-key-input { flex:1; min-width:min(100%,280px); }
.api-key-card .api-key-card-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.api-key-card .api-key-reset-form { margin:0; display:inline-flex; }
.api-key-card .api-key-pill-btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 20px; border-radius:14px; border:0; min-height:auto; width:auto !important;
  max-width:100%; box-sizing:border-box;
  background:var(--btn-primary-bg) !important; color:#fff !important;
  font-family:var(--btn-font); font-size:14px; font-weight:600;
  box-shadow:var(--btn-primary-shadow) !important;
  cursor:pointer;
  transition:box-shadow .2s ease, filter .2s ease;
}
.api-key-card .api-key-pill-btn:hover {
  transform:translateY(-1px) !important;
  filter:saturate(1.08) brightness(1.04);
  box-shadow:var(--btn-primary-shadow-hover) !important;
  animation:api-key-pill-wiggle .55s ease-in-out infinite;
}
.api-key-card .api-key-pill-btn:active {
  animation:none;
  transform:translateY(0) !important;
  filter:brightness(0.96);
  box-shadow:0 5px 14px rgba(0,149,255,.28), 0 1px 4px rgba(0,0,0,.08) !important;
}
@media (prefers-reduced-motion: reduce) {
  .api-key-card .api-key-pill-btn:hover { animation:none; }
}

.danger-btn { font-family:var(--btn-font); background:linear-gradient(135deg,#d93025,#ef5350); border:0; color:#fff; box-shadow:0 8px 18px rgba(217,48,37,.35); }
.danger-btn:hover { box-shadow:0 12px 24px rgba(217,48,37,.42); filter:saturate(1.08); }
.live-shell { display:grid; grid-template-columns: 200px minmax(0,1fr); gap:12px; }
.live-shell > div { min-width:0; }
.live-sidebar { position:sticky; top:10px; align-self:start; }
.live-menu a { display:flex; gap:8px; align-items:center; padding:8px 10px; border-radius:10px; margin-bottom:8px; border:1px solid var(--kpi-border); background:var(--kpi-bg); color:var(--text); font-family:var(--btn-font); font-size:12px; font-weight:600; box-shadow:0 4px 12px rgba(0,0,0,.1); transition:transform .15s ease, box-shadow .2s ease; }
.live-menu a:hover { transform:translateY(-1px); box-shadow:0 8px 16px rgba(0,0,0,.15); }
.live-menu a .ico { width:18px; min-width:18px; text-align:center; font-size:18px; line-height:1; }
.live-menu a.active { background:var(--btn-primary-bg); color:#fff; border-color:transparent; box-shadow:var(--btn-primary-shadow); }
.live-toggle { margin-bottom:10px; }
.live-shell.collapsed { grid-template-columns: 64px 1fr; }
.live-shell.collapsed .live-menu a { justify-content:center; align-items:center; width:42px; height:42px; padding:0; margin:0 auto 8px auto; aspect-ratio:1/1; border-radius:12px; }
.live-shell.collapsed .live-menu a .ico { width:22px; min-width:22px; height:22px; font-size:20px; line-height:22px; display:flex; align-items:center; justify-content:center; }
.live-shell.collapsed .live-menu .txt { display:none; }
@media (max-width: 1000px){ .live-shell{ grid-template-columns:1fr; } .live-sidebar{position:static;} }
.card { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px; margin-bottom:16px; box-shadow:0 12px 28px rgba(0,0,0,.16); backdrop-filter: blur(8px); animation: fadeUp .35s ease both; }
input, select, button { padding:8px; border-radius:8px; border:1px solid var(--input-border); background:var(--input-bg); color:var(--text); max-width:100%; }
input[type='date'] { max-width: 132px; width: 132px; padding-right:4px; }
select[multiple] { min-height: 220px; }
.backtest-multi { width:100%; min-height:220px; }
.backtests-pane-head { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:12px; }
.backtests-pane-head h3 { margin:0; }
.backtests-import-wrap { display:flex; flex-direction:column; align-items:flex-end; gap:6px; max-width:100%; }
.backtests-import-form { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:0; }
.backtest-file-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.backtest-import-client-err { font-size:13px; color:var(--neg); max-width:min(100%, 320px); text-align:right; line-height:1.35; }
.backtests-imported-table .backtests-col-trades { text-align: center; }
.backtests-imported-table .backtests-col-select { width:40px; text-align:center; vertical-align:middle; }
.backtests-tabbed-card .backtests-tabs { margin-bottom:14px; }
.backtests-tabbed-card .backtests-tab-panel { margin-top:4px; }
.backtests-portfolio-form .portfolio-add-bar {
  display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px 16px; margin-bottom:14px; padding-bottom:12px;
  border-bottom:1px solid var(--kpi-border);
}
.backtests-portfolio-form .portfolio-add-bar label { display:inline-flex; flex-direction:column; gap:4px; font-size:13px; color:var(--small); }
.backtests-portfolio-form .portfolio-target-select { min-width:180px; }
.backtests-portfolio-form .portfolio-new-name-input { min-width:200px; max-width:100%; }
.backtests-pf-details { border:1px solid var(--kpi-border); border-radius:12px; background:var(--kpi-bg); margin-bottom:10px; overflow:hidden; }
.backtests-pf-details[open] { box-shadow:0 4px 14px rgba(0,0,0,.08); }
.backtests-pf-summary {
  list-style:none; display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:12px 14px; cursor:pointer;
  font-weight:600; font-size:14px;
}
.backtests-pf-summary::-webkit-details-marker { display:none; }
.backtests-pf-chev { display:inline-block; transition:transform .2s ease; font-size:12px; opacity:.85; }
.backtests-pf-details[open] > .backtests-pf-summary .backtests-pf-chev { transform:rotate(90deg); }
.backtests-pf-title { flex:1; min-width:120px; }
.backtests-pf-count { font-size:12px; font-weight:500; color:var(--small); }
.backtests-pf-view { font-size:12px; font-weight:600; margin-left:auto; }
.backtests-pf-body { padding:0 14px 12px 14px; }
.backtests-pf-rename-row { margin-bottom:12px; display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:12px; }
.backtests-pf-rename-form { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; margin:0; flex:1; min-width:min(100%, 320px); }
.backtests-pf-delete-form { margin:0; flex-shrink:0; }
.backtests-pf-rename-form label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--small); }
.backtests-pf-rename-form input[type=text] { min-width:220px; max-width:100%; }
.backtests-pf-items { width:100%; font-size:13px; }
.backtests-pf-items th { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--small); }
.backtests-pf-action { white-space:nowrap; width:1%; }
.backtests-portfolios-list { min-height:40px; }
/* Backtest Lab — top analytics pane (large; ctx from list links below) */
.btlab-upper {
  margin-bottom:18px; min-height:min(62.4vh, 736px); max-height:min(62.4vh, 736px); display:flex; flex-direction:column;
  padding:20px 22px 22px; box-sizing:border-box; overflow:hidden;
}
.btlab-inner-tabs { margin-bottom:14px; flex-shrink:0; }
.btlab-inner-panel { margin-top:6px; flex:1; min-height:0; display:flex; flex-direction:column; }
.btlab-inner-panel > .card { flex:1; display:flex; flex-direction:column; min-height:0; }
.btlab-scroll { overflow:auto; flex:1; min-height:0; }
.btlab-trades-card { overflow:hidden; }
.btlab-trades-table-wrap { flex:1; min-height:0; overflow:auto; -webkit-overflow-scrolling:touch; }
.btlab-trades-table-wrap thead th { position:sticky; top:0; z-index:1; background:var(--kpi-bg); box-shadow:0 1px 0 var(--kpi-border); }
.btlab-overview { font-size:15px; }
.btlab-empty-hint { max-width:48em; line-height:1.55; font-size:14px; }
.btlab-pick-link { font-weight:600; color:var(--link); text-decoration:none; }
.btlab-pick-link:hover { text-decoration:underline; }
tr.btlab-imported-row.btlab-row-selected td { background:rgba(0,149,255,.1); }
body.light tr.btlab-imported-row.btlab-row-selected td { background:rgba(29,78,216,.08); }
.btlab-pf-selected { border-color:var(--btn-primary-bg) !important; box-shadow:0 0 0 2px rgba(0,149,255,.35); }
.btlab-eq-card { min-height:min(49.6vh, 560px); }
/* Backtest Lab Balance/Equity: same resize shell as analytics; default height matches prior vh-based chart */
.btlab-eq-card .eq-balance-chart-shell .eq-balance-chart-wrap {
  height:min(46.4vh, 544px);
  min-height:240px;
  position:relative;
}
.btlab-eq-card .eq-balance-chart-shell .eq-balance-chart-wrap canvas {
  height:100% !important;
  max-height:100% !important;
}
.btlab-hero-row { display:grid; grid-template-columns:1fr; gap:20px; margin-bottom:22px; }
@media (min-width:900px) { .btlab-hero-row { grid-template-columns:minmax(260px,1fr) minmax(0,2.2fr); align-items:start; } }
.btlab-hero-label { font-size:12px; font-weight:700; letter-spacing:.08em; color:var(--small); }
.btlab-hero-value { font-size:clamp(2rem, 5vw, 3.1rem); font-weight:800; line-height:1.08; margin:8px 0 12px; }
.btlab-hero-sub { display:flex; flex-wrap:wrap; gap:12px 22px; font-size:13px; color:var(--small); }
.btlab-metric-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(152px, 1fr)); gap:12px;
}
.btlab-metric {
  border:1px solid var(--kpi-border); border-radius:11px; background:var(--kpi-bg); padding:10px 12px;
  display:flex; flex-direction:column; gap:5px; min-height:58px;
}
.btlab-metric span { font-size:10px; font-weight:700; letter-spacing:.04em; color:var(--small); text-transform:uppercase; }
.btlab-metric b { font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; }
.btlab-stats-two { display:grid; grid-template-columns:1fr; gap:16px; margin:16px 0; }
@media (min-width:720px) { .btlab-stats-two { grid-template-columns:1fr 1fr; } }
.btlab-stats-h { margin:0 0 8px; font-size:13px; font-weight:700; color:var(--th); }
.btlab-kv { width:100%; font-size:13px; border-collapse:collapse; }
.btlab-kv td { padding:6px 8px; border-bottom:1px solid var(--kpi-border); }
.btlab-kv td:first-child { color:var(--small); width:45%; }
.btlab-monthly { width:100%; font-size:12px; border-collapse:collapse; margin-top:8px; }
.btlab-monthly th { background:var(--kpi-bg); padding:6px 4px; border:1px solid var(--kpi-border); text-align:right; font-size:10px; }
.btlab-monthly td { padding:6px 4px; border:1px solid var(--kpi-border); text-align:right; font-variant-numeric:tabular-nums; }
.btlab-monthly tr:nth-child(even) td { background:rgba(0,0,0,.03); }
body.light .btlab-monthly tr:nth-child(even) td { background:rgba(0,0,0,.04); }
button { font-family:var(--btn-font); background:var(--btn-primary-bg); border:0; color:#fff; font-weight:600; box-shadow:var(--btn-primary-shadow); transition:transform .15s ease, box-shadow .2s ease, filter .2s ease; }
button:hover { transform:translateY(-1px); box-shadow:var(--btn-primary-shadow-hover); filter:saturate(1.08); }
button:active { transform:translateY(0); }
button:disabled { opacity:.6; cursor:not-allowed; box-shadow:none; }
button.clear-filters-btn {
  font-family:var(--btn-font);
  background:var(--kpi-bg);
  color:var(--text);
  border:1px solid var(--kpi-border);
  box-shadow:none;
}
button.clear-filters-btn:hover {
  transform:translateY(-1px);
  filter:none;
  box-shadow:0 4px 12px rgba(0,0,0,.1);
}
.theme-buttons { display:flex; gap:8px; align-items:center; }
.theme-btn { font-family:var(--btn-font); min-width:40px; padding:8px 10px; border-radius:10px; border:1px solid var(--kpi-border); background:var(--kpi-bg); color:var(--text); box-shadow:none; font-weight:600; }
.theme-btn.active { background:var(--btn-primary-bg); color:#fff; border-color:transparent; box-shadow:var(--btn-primary-shadow-soft); }
.theme-btn:hover:not(.active) { transform:none; box-shadow:none; filter:none; }
.theme-btn.active:hover { transform:translateY(-1px); box-shadow:var(--btn-primary-shadow-hover); filter:saturate(1.08); }
table { border-collapse: collapse; width:100%; font-size:14px; display:block; overflow-x:auto; white-space:nowrap; }
th, td { border-bottom:1px solid var(--border); padding:8px; text-align:left; }
th { color:var(--th); }
th.sortable { cursor:pointer; user-select:none; }
th.sortable::after { content:' ↕'; font-size:11px; opacity:.65; }
.small { color:var(--small); font-size:12px; }
.pos { color:var(--pos); font-weight:700; }
.neg { color:var(--neg); font-weight:700; }
.kpi { display:inline-block; min-width:130px; margin:6px 10px 6px 0; padding:10px 12px; background:var(--kpi-bg); border-radius:12px; border:1px solid var(--kpi-border); box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.legend-dot { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; }
canvas { width:100%; height:320px; background:var(--canvas); border:1px solid var(--kpi-border); border-radius:12px; box-sizing:border-box; display:block; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; position:sticky; top:8px; z-index:5; }
.menu { display:flex; gap:10px; flex-wrap:wrap; }
.pill { padding:8px 12px; border:1px solid var(--kpi-border); border-radius:999px; background:var(--kpi-bg); font-family:var(--btn-font); font-size:13px; transition:all .18s ease; }
.pill:hover { transform:translateY(-1px); border-color:#4d72c7; }
.pill.active { background:var(--btn-primary-bg); color:#fff; border-color:transparent; box-shadow:var(--btn-primary-shadow-soft); }
.section-title { margin:0 0 10px 0; font-size:16px; }
.grid2 { display:grid; grid-template-columns: 1fr 1fr; gap:14px; }
.grid2 > .card { min-width:0; overflow:hidden; }
.top-pane { --left-pane:50%; display:grid; grid-template-columns: minmax(340px, var(--left-pane)) 8px minmax(340px, 1fr); gap:4px; align-items:stretch; }
.top-pane.no-overview { grid-template-columns: 1fr; }
.top-pane.no-overview .top-splitter { display:none; }
.top-pane > .card { min-width:0; overflow:hidden; }
.top-splitter { cursor: col-resize; border-radius:8px; background: transparent; position: relative; }
.top-splitter::after { content:''; position:absolute; inset:0; margin:auto; width:2px; height:36px; background: rgba(255,255,255,.9); border-radius:2px; }
.top-splitter:hover { background: transparent; }
.top-pane > .filters-compact { display:flex; }
.filters-compact form.top-filter-form { flex:1; min-height:100%; display:flex; flex-direction:row; gap:16px; align-items:stretch; overflow:visible; }
.top-filter-form .filter-fields { flex:1; min-width:0; display:flex; flex-direction:column; gap:10px; }
.top-filter-form .filter-row { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.top-filter-form .filter-row label { width:auto !important; min-width:0; }
.top-filter-form label.account { min-width:200px; flex:1; }
.top-filter-form label.symbol { min-width:100px; width:140px; }
.top-filter-form label.strategy { min-width:140px; flex:1; }
.top-filter-form label.comment { min-width:140px; flex:1; }
.top-filter-form .date-range { display:flex; align-items:center; gap:12px; min-width:0; flex-wrap:wrap; }
.top-filter-form .date-range label { margin:0; flex:0 0 auto; }
.top-filter-form .date-range label.from input, .top-filter-form .date-range label.to input { min-width:140px; }
.top-filter-form .filter-actions { flex:0 0 140px; width:140px; min-width:140px; max-width:140px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; }
.top-filter-form .filter-actions .apply-filters-btn,
.top-filter-form .filter-actions .clear-filters-btn { width:120px !important; min-width:120px; max-width:120px; margin-left:0 !important; margin-right:0 !important; padding:6px 12px; font-size:11px; box-sizing:border-box; }
@media (max-width: 1200px) {
  .top-filter-form { flex-wrap:wrap; }
  .top-filter-form .filter-actions { width:100%; flex-direction:row; justify-content:flex-start; }
  .top-filter-form .filter-actions .apply-filters-btn, .top-filter-form .filter-actions .clear-filters-btn { width:auto; min-width:90px; }
}
@media (max-width: 1100px) { .top-pane { grid-template-columns: 1fr; } .top-splitter { display:none; } }
/* Analytics: Balance / Equity main chart — drag bottom edge to change height */
.eq-balance-chart-shell { display:flex; flex-direction:column; }
.eq-balance-chart-wrap { height:480px; position:relative; min-height:240px; }
.eq-balance-chart-wrap canvas { height:100% !important; max-height:100% !important; }
.eq-balance-chart-resize {
  flex-shrink:0; min-height:12px; height:12px; cursor:ns-resize; border-radius:8px; background:transparent;
  margin:0; padding:0; touch-action:none;
  display:flex; align-items:center; justify-content:center;
  line-height:0; font-size:0;
}
.eq-balance-chart-resize::after {
  content:''; display:block; flex-shrink:0;
  width:48px; height:3px; background:var(--kpi-border); border-radius:2px; opacity:.85;
}
.compact-metrics table { font-size:12px; }
.compact-metrics table th { font-size:11px; font-weight:600; }
.compact-metrics table td { font-size:12px; }
/* Periods card: column 6 = Gain (%) — nth-child so cached period_rows HTML still picks up weight. */
.card.compact-metrics.periods-card table th:nth-child(6) { font-weight:800; }
.card.compact-metrics.periods-card table td:nth-child(6) { font-weight:700; }
.card.compact-metrics.strategy-card table th:nth-child(3) { font-weight:800; }
.card.compact-metrics.strategy-card table td:nth-child(3) { font-weight:700; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes api-key-pill-wiggle {
  0%, 100% { transform: translateY(-1px) rotate(0deg); }
  25% { transform: translateY(-1px) rotate(-2.2deg); }
  50% { transform: translateY(-1px) rotate(2.2deg); }
  75% { transform: translateY(-1px) rotate(-1.4deg); }
}
.big-actions { display:grid; grid-template-columns: repeat(3, minmax(220px,1fr)); gap:14px; }
.big-btn { display:flex; align-items:center; justify-content:center; min-height:96px; border-radius:14px; font-family:var(--btn-font); font-size:18px; font-weight:800; color:#fff; background:var(--btn-primary-bg); box-shadow:var(--btn-primary-shadow-strong); transition:transform .15s ease, box-shadow .2s ease, filter .2s ease; }
.big-btn:hover { transform:translateY(-2px); box-shadow:var(--btn-primary-shadow-hover); filter:saturate(1.06); }
.quick-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.nav-shell { display:grid; grid-template-columns: auto 1fr auto; align-items:center; gap:10px; padding:0; }
.nav-title { font-weight:800; font-size:20px; white-space:nowrap; }
.nav-status { grid-column: 1 / -1; margin-top: 2px; }
.nav-center { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; }
.nav-right { display:flex; justify-content:flex-end; align-items:center; gap:8px; padding-right:14px; }
/* Logout next to theme toggles: align height with .theme-btn (padding 8px 10px, radius 10px) */
.nav-right > a.quick-btn { min-height:unset; padding:8px 12px; border-radius:10px; font-size:12px; line-height:1.2; }
.quick-btn { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:0 12px; border-radius:12px; font-family:var(--btn-font); font-size:13px; font-weight:600; color:#fff; background:var(--btn-primary-bg); border:0; box-shadow:var(--btn-primary-shadow); transition:transform .15s ease, box-shadow .2s ease, filter .2s ease; }
.quick-btn:hover { transform:translateY(-1px); box-shadow:var(--btn-primary-shadow-hover); filter:saturate(1.08); }
.quick-btn.active { color:#fff; background:var(--btn-primary-bg); border-color:transparent; box-shadow:var(--btn-primary-shadow); }
.signup-btn { font-family:var(--btn-font); color:#fff; background:var(--btn-signup-bg); box-shadow:var(--btn-signup-shadow); }
.signup-btn:hover { box-shadow:var(--btn-signup-shadow-hover); filter:saturate(1.06); }

/* Help center — layout only (uses theme variables) */
.help-shell { display:grid; grid-template-columns:minmax(200px, 280px) minmax(0,1fr); gap:16px; align-items:start; }
.help-sidebar { position:sticky; top:10px; align-self:start; border:1px solid var(--kpi-border); border-radius:14px; background:var(--kpi-bg); padding:12px 14px; max-height:calc(100vh - 48px); overflow:auto; }
.help-sidebar .help-topic-list { list-style:none; margin:0; padding:0; }
.help-sidebar .help-topic-list > li { margin:0 0 10px 0; }
.help-sidebar .help-topic-list > li > a { font-weight:600; color:var(--link); text-decoration:none; }
.help-sidebar .help-topic-list > li > a:hover { text-decoration:underline; }
.help-sidebar .help-topic-active > a { color:var(--text); }

.help-topic-toc { margin:6px 0 0 0; padding-left:0; font-size:12px; color:var(--small); }
.help-topic-toc ul { list-style:none; margin:4px 0 0 0; padding:0 0 0 12px; }
.help-topic-toc li { margin:4px 0; }
.help-topic-toc a { color:var(--small); font-weight:500; }
.help-topic-toc a:hover { color:var(--link); }

.help-article { min-width:0; }
.help-article .help-prose { font-size:12px; line-height:1.6; }
.help-article .help-prose img { max-width:100%; height:auto; border-radius:8px; border:1px solid var(--kpi-border); }
@media (max-width:900px) { .help-shell { grid-template-columns:1fr; } .help-sidebar { position:static; max-height:none; } }

/* ── Landing navigation bar ── */
.landing-nav {
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  position:sticky; top:0; z-index:100;
  background:rgba(255,255,255,.92); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid #e2e8f0;
  padding:12px 32px; margin:-24px -24px 0 -24px;
}
.landing-nav .nav-logo { display:flex; align-items:center; flex-shrink:0; }
.landing-nav .nav-logo img { height:36px; }
.landing-nav .nav-links {
  display:flex; align-items:center; gap:4px;
  position:absolute; left:50%; transform:translateX(-50%);
}
.landing-nav .nav-link {
  padding:8px 16px; border-radius:8px; font-size:14px; font-weight:500;
  color:#334155; transition:all .18s ease; white-space:nowrap;
}
.landing-nav .nav-link:hover { background:#f1f5f9; color:#0f172a; }
.landing-nav .nav-link.has-dd { position:relative; cursor:pointer; user-select:none; }
.landing-nav .nav-link.has-dd::after { content:''; display:inline-block; width:0; height:0; border-left:4px solid transparent; border-right:4px solid transparent; border-top:5px solid #94a3b8; margin-left:6px; vertical-align:middle; transition:transform .2s ease; }
.landing-nav .nav-link.has-dd.open::after { transform:rotate(180deg); }
.nav-dropdown {
  display:none; position:absolute; top:calc(100% + 6px); left:50%; transform:translateX(-50%);
  background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:8px 0;
  min-width:200px; box-shadow:0 12px 32px rgba(0,0,0,.12);
  animation:fadeUp .2s ease both; z-index:110;
}
.nav-dropdown.show { display:block; }
.nav-dropdown a {
  display:block; padding:10px 18px; font-size:13px; font-weight:500; color:#334155; white-space:nowrap;
}
.nav-dropdown a:hover { background:#f1f5f9; color:#0f172a; }
.nav-dropdown a.active { background:#e2e8f0; color:#0f172a; font-weight:600; }
.landing-nav .nav-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }

/* FAQ page */
.faq-page { max-width:760px; margin:0 auto; padding:8px 0 48px; }
.faq-page h1 { font-size:28px; font-weight:800; color:#0f172a; margin:0 0 8px; text-align:center; }
.faq-page .faq-intro { text-align:center; color:#64748b; font-size:15px; margin:0 0 28px; line-height:1.5; }
.faq-list { display:flex; flex-direction:column; gap:10px; }
.faq-item { border:1px solid #e2e8f0; border-radius:12px; background:#fff; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,.04); }
.faq-item summary { list-style:none; cursor:pointer; padding:16px 18px; font-weight:600; font-size:15px; color:#0f172a; display:flex; align-items:center; justify-content:space-between; gap:12px; user-select:none; }
.faq-item summary::-webkit-details-marker { display:none; }
.faq-item summary::after { content:'+'; font-size:20px; font-weight:400; color:#64748b; flex-shrink:0; }
.faq-item[open] summary::after { content:'−'; }
.faq-item .faq-a { padding:0 18px 16px; font-size:14px; line-height:1.65; color:#334155; border-top:1px solid #f1f5f9; }
.faq-item .faq-a p { margin:12px 0 0; }
.faq-item .faq-a p:first-child { margin-top:14px; }
.faq-item .faq-a ul { margin:8px 0 0; padding-left:20px; }
.faq-item .faq-a li { margin:4px 0; }
.faq-back { text-align:center; margin-top:28px; }
.faq-back a { font-weight:600; font-size:14px; }

/* Contact modal */
.contact-overlay {
  display:none; position:fixed; inset:0; z-index:200;
  background:rgba(0,0,0,.45); backdrop-filter:blur(4px);
  align-items:center; justify-content:center;
}
.contact-overlay.show { display:flex; }
.contact-modal {
  background:#fff; border-radius:16px; padding:32px; width:100%; max-width:480px;
  box-shadow:0 24px 48px rgba(0,0,0,.18); animation:fadeUp .25s ease both; position:relative;
}
.contact-modal h3 { margin:0 0 4px; font-size:20px; color:#0f172a; }
.contact-modal .cm-sub { font-size:13px; color:#64748b; margin-bottom:20px; }
.contact-modal label { display:block; margin-bottom:14px; font-size:13px; font-weight:600; color:#334155; }
.contact-modal label input,
.contact-modal label textarea {
  display:block; width:100%; margin-top:5px; padding:10px 12px; border:1px solid #cbd5e1;
  border-radius:10px; font-size:14px; font-family:inherit; color:#0f172a; background:#f8fafc;
  box-sizing:border-box; transition:border-color .15s ease;
}
.contact-modal label input:focus,
.contact-modal label textarea:focus { border-color:#2979ff; outline:none; box-shadow:0 0 0 3px rgba(41,121,255,.15); }
.contact-modal textarea { resize:vertical; min-height:100px; }
.contact-modal .cm-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:8px; }
.contact-modal .cm-close {
  position:absolute; top:14px; right:16px; background:none; border:none; font-size:22px;
  color:#94a3b8; cursor:pointer; box-shadow:none; padding:4px 8px; min-height:auto;
}
.contact-modal .cm-close:hover { color:#0f172a; transform:none; box-shadow:none; }
.contact-modal .cm-send {
  padding:10px 24px; border-radius:10px; font-family:var(--btn-font); font-size:14px; font-weight:600; border:0;
  color:#fff; background:var(--btn-primary-bg); box-shadow:var(--btn-primary-shadow);
  cursor:pointer; transition:all .18s ease;
}
.contact-modal .cm-send:hover { transform:translateY(-1px); box-shadow:var(--btn-primary-shadow-hover); filter:saturate(1.06); }
.contact-modal .cm-send:disabled { opacity:.6; cursor:not-allowed; transform:none; box-shadow:none; }
.contact-modal .cm-msg {
  margin-top:10px; padding:10px 12px; border-radius:8px; font-size:13px; display:none;
}
.contact-modal .cm-msg.ok { display:block; background:rgba(16,185,129,.12); color:#065f46; border:1px solid rgba(16,185,129,.3); }
.contact-modal .cm-msg.err { display:block; background:rgba(217,48,37,.1); color:#7f1d1d; border:1px solid rgba(217,48,37,.25); }

/* Mobile: landing nav */
@media (max-width: 768px) {
  .landing-nav { padding:10px 16px; }
  .landing-nav .nav-links { position:static; transform:none; gap:0; }
  .landing-nav .nav-link { padding:6px 10px; font-size:13px; }
  .landing-nav .nav-actions .quick-btn { padding:0 10px; font-size:12px; min-height:36px; }
  .contact-modal { margin:16px; padding:24px; }
}
@media (max-width: 540px) {
  .landing-nav { flex-wrap:wrap; }
  .landing-nav .nav-links { order:3; width:100%; justify-content:center; }
  .landing-nav .nav-actions { order:2; }
}

.topbar.center { justify-content:center; text-align:center; }
.centered-landing .topbar { margin-bottom:22px; }
.centered-landing .topbar label { display:none; }
.centered-landing .card { margin-left:auto; margin-right:auto; }

/* MFA challenge: center the form card in the viewport below the nav */
.mfa-challenge-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 6rem);
  min-height: calc(100dvh - 6rem);
  box-sizing: border-box;
  padding: 8px 0 32px;
  width: 100%;
}
.mfa-challenge-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.mfa-challenge-actions a.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-sizing: border-box;
}
.login-form { max-width:420px; margin:0 auto; text-align:left; }
.login-row { display:block; margin-bottom:12px; }
.login-row label { display:block; text-align:left; font-weight:700; margin-bottom:6px; font-size:14px; }
.login-row input { width:100%; height:34px; font-size:14px; }
.login-submit { font-family:var(--btn-font); min-height:38px; min-width:124px; font-size:15px; border-radius:10px; }

 .filters-compact, .filters-compact input, .filters-compact select, .filters-compact button { font-size:12px; }
.filters-compact form { display:flex; flex-wrap:nowrap; gap:8px; align-items:flex-end; overflow-x:auto; }
@media (max-width: 1650px) {
  .filters-compact, .filters-compact input, .filters-compact select, .filters-compact button { font-size:11px; }
  .filters-compact form { flex-wrap:wrap; overflow-x:visible; gap:6px; }
  .filters-compact label.account { width:220px; }
  .filters-compact label.symbol { width:100px; }
  .filters-compact label.strategy, .filters-compact label.comment { width:130px; }
  .filters-compact label.from, .filters-compact label.to { width:142px; }
  .filters-compact label.minpnl, .filters-compact label.maxpnl { width:105px; }
  .filters-compact input, .filters-compact select, .filters-compact button { height:28px; padding:2px 6px; }
  .filters-compact .clear-filters-btn, .filters-compact .apply-filters-btn { margin-left:0; min-width:98px; }
  .kpi.smallkpi { min-width:98px; padding:6px 8px; font-size:11px; }
}
.filters-compact label { display:flex; flex-direction:column; gap:4px; min-width:auto; }
.filters-compact label.account { width:260px; }
.filters-compact label.symbol { width:120px; }
.filters-compact label.strategy, .filters-compact label.comment { width:150px; }
.filters-compact label.from, .filters-compact label.to { width:170px; }
.filters-compact label.minpnl, .filters-compact label.maxpnl { width:120px; }
.filters-compact input, .filters-compact select, .filters-compact button { height:30px; box-sizing:border-box; width:100%; padding:3px 8px; line-height:1.1; }
.filters-compact .apply-filters-btn { margin-left:6px; min-width:120px; width:auto; }
.filters-compact .clear-filters-btn { min-width:110px; width:auto; background:var(--kpi-bg); color:var(--text); border:1px solid var(--kpi-border); box-shadow:none; }
/* Admin → Dukascopy worker settings: grid (form has .filters-compact on itself, so generic .filters-compact form flex never applies) */
form.filters-compact.dukascopy-settings-form {
  display:grid !important;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px 14px;
  align-items:end;
  overflow:visible;
}
form.filters-compact.dukascopy-settings-form label { min-width:0; }
form.filters-compact.dukascopy-settings-form .apply-filters-btn {
  grid-column:1 / -1;
  justify-self:start;
  margin-left:0;
  margin-top:4px;
}
@media (max-width:900px) {
  form.filters-compact.dukascopy-settings-form { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width:480px) {
  form.filters-compact.dukascopy-settings-form { grid-template-columns:1fr; }
}
.kpi.smallkpi { min-width:112px; padding:8px 10px; font-size:12px; }
.accounts-overview .pos, .accounts-overview .neg { font-weight:400; }
.position-buckets-table th:not(:first-child),
.position-buckets-table td:not(:first-child) { text-align:center; }
.position-buckets-table th:first-child,
.position-buckets-table td:first-child { text-align:left; }
.position-buckets-table .pb-arrow { font-weight:800; }
.position-buckets-table .pb-dir-long { color:var(--pos); }
.position-buckets-table .pb-dir-short { color:var(--neg); }
.accounts-overview table { width:100%; table-layout:auto; }
.accounts-overview th, .accounts-overview td { padding-left: clamp(6px, 0.9vw, 14px); padding-right: clamp(6px, 0.9vw, 14px); }
.accounts-overview th:first-child, .accounts-overview td:first-child { width:30%; white-space:nowrap; }
.accounts-overview tr.account-select-row { cursor:pointer; transition: background .15s ease; }
.accounts-overview tr.account-select-row:hover td { background: rgba(41,121,255,.16); }
.week-strip { display:grid; grid-template-columns: repeat(7, minmax(120px,1fr)); gap:8px; }
.month-strip { display:grid; grid-template-columns: repeat(6, minmax(140px,1fr)); gap:8px; }
.dashboard-settings-form { max-width:560px; display:block !important; margin:0; }
.dashboard-settings-row { display:flex; align-items:center; justify-content:flex-start; gap:10px; padding:9px 12px; margin:6px 0; line-height:1.2; font-size:14px; white-space:nowrap; border-radius:12px; border:1px solid var(--kpi-border); background:var(--kpi-bg); color:var(--text); box-shadow:0 2px 8px rgba(0,0,0,.08); cursor:grab; transition:transform .15s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.dashboard-settings-row:hover { transform:translateY(-1px); border-color:var(--link); box-shadow:0 4px 14px rgba(0,0,0,.12); }
.dashboard-settings-row.dragging { opacity:.95; transform:scale(1.01); box-shadow:0 8px 24px rgba(0,0,0,.18); border-color:var(--link); background:var(--input-bg); }
.dashboard-settings-row .dash-handle { font-size:18px; opacity:.7; cursor:grab; user-select:none; flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; width:20px; }
.dashboard-settings-row .dash-main { display:flex; flex-direction:column; gap:2px; min-width:0; }
.dashboard-settings-row .dash-title { font-weight:600; }
.dashboard-settings-row .dash-sub { font-size:11px; color:var(--small); opacity:.9; white-space:normal; }
.dashboard-settings-row input[type='checkbox'] { width:auto !important; margin:0; transform:scale(1.05); flex:0 0 auto; }
.dashboard-settings-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; align-items:center; }
.dashboard-reset-btn { font-family:var(--btn-font) !important; background:linear-gradient(135deg,#e65100,#ff6f00) !important; border-color:rgba(230,81,0,.6) !important; box-shadow:0 6px 16px rgba(230,81,0,.35) !important; }
.dashboard-reset-btn:hover { box-shadow:0 8px 20px rgba(230,81,0,.45) !important; filter:saturate(1.08); }
.profile-toggle-row { display:flex !important; flex-direction:row !important; align-items:center !important; justify-content:flex-start !important; gap:10px; width:100%; max-width:560px; margin:8px 0; white-space:nowrap; }
.profile-toggle-row input[type='checkbox'] { width:auto !important; height:auto; margin:0; transform:scale(1.05); flex:0 0 auto; accent-color:var(--btn-primary-bg); cursor:pointer; border-radius:4px; }
.strategies-form label.strategies-known-part-row { white-space:normal; max-width:100%; align-items:flex-start; gap:10px; margin-bottom:14px; }
.strategies-form label.strategies-known-part-row input[type='checkbox'] { margin-top:2px; }
.strategies-form label.strategies-known-part-row span { font-size:inherit; line-height:inherit; color:var(--text); }
.day-card { border:1px solid var(--kpi-border); background:var(--kpi-bg); border-radius:10px; padding:8px 10px; display:block; transition: background .15s ease, border-color .15s ease; }
.day-card:hover { background: rgba(120,170,255,.18); border-color: rgba(120,170,255,.45); }
.day-card .dtop { font-weight:700; font-size:13px; line-height:1.1; }
.day-card .dsub { color:var(--small); font-size:10px; margin-bottom:6px; line-height:1.1; }
.day-card .dpnl { font-weight:700; line-height:1.15; }
.day-card .dpnl.zero { color:var(--small); }
.day-card .dtr { color:var(--small); font-size:11px; line-height:1.1; margin-top:2px; }
.news-sticky { position:sticky; top:8px; z-index:30; margin-top:0; }
.news-day { margin:14px 0 6px; font-weight:800; color:var(--th); }
.news-item { border:1px solid var(--kpi-border); background:var(--kpi-bg); border-radius:10px; padding:10px; margin-bottom:8px; }
.news-item .ntop { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:6px; }
.news-item .ntime { font-weight:700; }
.news-item .ntitle { font-weight:700; margin-bottom:6px; }
.news-item .nmeta { display:flex; gap:10px; flex-wrap:wrap; color:var(--small); font-size:12px; }
.news-row-high td { background:rgba(139,29,44,.10); }
.news-row-medium td { background:rgba(107,75,8,.12); }
.news-row-low td { background:rgba(27,63,122,.10); }
.financial-news-table th:nth-child(3),
.financial-news-table td:nth-child(3),
.financial-news-table th:nth-child(n+5),
.financial-news-table td:nth-child(n+5) {
  text-align: center;
}
.bar-status-warning td { background:rgba(217,48,37,.22); color:#ffe7e3; }
body.light .bar-status-warning td { background:rgba(217,48,37,.12); color:#7f1d1d; }
.news-filters form { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; }
.news-filters .nf { display:flex; flex-direction:column; gap:4px; min-width:140px; font-size:12px; color:var(--small); }
.news-filters .nf.keyword { min-width:180px; max-width:300px; flex:0 1 240px; }
.news-filters .nf input, .news-filters .nf select { font-size:12px; height:32px; line-height:32px; padding:0 10px; box-sizing:border-box; }
.news-filters .ncheck { display:inline-flex; align-items:center; gap:6px; min-width:auto; white-space:normal; font-size:12px; color:var(--small); height:32px; padding:0 2px; }
.news-filters .ncheck input { width:auto; height:auto; margin:0; }
.news-filters .apply-filters-btn, .news-filters .clear-filters-btn { font-size:12px; height:32px; line-height:32px; padding:0 12px; }
@media (max-width: 900px) { .news-filters .nf, .news-filters .nf.keyword { min-width:100%; } }
@media (max-width: 1200px) { .week-strip { grid-template-columns: repeat(4, minmax(120px,1fr)); } .month-strip { grid-template-columns: repeat(3, minmax(140px,1fr)); } }
@media (max-width: 760px) { .week-strip { grid-template-columns: repeat(2, minmax(120px,1fr)); } .month-strip { grid-template-columns: repeat(2, minmax(130px,1fr)); } }

/* Journal modal + trade-list icon */
.journal-col-header { text-align:center; width:42px; min-width:42px; }
.journal-cell { text-align:center; width:42px; min-width:42px; padding:0 !important; }
.journal-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:28px; border:none; background:none; cursor:pointer;
  font-size:16px; opacity:.55; transition:opacity .15s ease, transform .15s ease;
  padding:0; min-height:auto; box-shadow:none; border-radius:6px;
}
.journal-icon:hover { opacity:1; transform:scale(1.15); background:rgba(41,121,255,.10); }
.journal-icon.has-entry { opacity:.9; }

.journal-overlay {
  display:none; position:fixed; inset:0; z-index:210;
  background:rgba(0,0,0,.48); backdrop-filter:blur(4px);
  align-items:center; justify-content:center;
}
.journal-overlay.show { display:flex; }
.journal-modal {
  background:var(--card-bg, #fff); border-radius:16px; padding:28px 32px; width:100%; max-width:560px;
  box-shadow:0 24px 48px rgba(0,0,0,.22); animation:fadeUp .25s ease both; position:relative;
  max-height:90vh; overflow-y:auto; color:var(--text);
}
.jm-close {
  position:absolute; top:12px; right:14px; background:none; border:none; font-size:22px;
  color:var(--muted, #94a3b8); cursor:pointer; box-shadow:none; padding:4px 8px; min-height:auto;
}
.jm-close:hover { color:var(--text); transform:none; box-shadow:none; }
.jm-header h3 { margin:0 0 2px; font-size:18px; }
.jm-trade-info { font-size:13px; color:var(--small, #64748b); margin-bottom:16px; }
.jm-label { display:block; font-size:12px; font-weight:600; color:var(--small, #64748b); margin-bottom:6px; }
.jm-selects-row { display:flex; gap:12px; margin-bottom:14px; }
.jm-select-group { flex:1; min-width:0; }
.jm-select {
  display:block; width:100%; box-sizing:border-box; padding:8px 10px;
  border:1px solid var(--kpi-border, #cbd5e1); border-radius:10px;
  font-size:14px; font-family:inherit; color:var(--text);
  background:var(--input-bg, #f8fafc); cursor:pointer;
  transition:border-color .15s ease;
  -webkit-appearance:none; appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
  padding-right:28px;
}
.jm-select:focus { border-color:#2979ff; outline:none; box-shadow:0 0 0 3px rgba(41,121,255,.15); }
.jm-notes {
  display:block; width:100%; box-sizing:border-box; padding:10px 12px;
  border:1px solid var(--kpi-border, #cbd5e1); border-radius:10px;
  font-size:14px; font-family:inherit; color:var(--text);
  background:var(--input-bg, #f8fafc); resize:vertical; min-height:100px;
  transition:border-color .15s ease;
}
.jm-notes:focus { border-color:#2979ff; outline:none; box-shadow:0 0 0 3px rgba(41,121,255,.15); }
.jm-images-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(90px, 1fr)); gap:8px; margin-bottom:10px;
}
.jm-thumb {
  position:relative; border-radius:8px; overflow:hidden; border:1px solid var(--kpi-border, #e2e8f0);
  aspect-ratio:1; background:var(--bg2, #f1f5f9);
}
.jm-thumb a { display:block; width:100%; height:100%; }
.jm-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.jm-thumb-del {
  position:absolute; top:3px; right:3px; width:22px; height:22px;
  border-radius:50%; border:none; background:rgba(0,0,0,.55); color:#fff;
  font-size:14px; line-height:22px; text-align:center; cursor:pointer;
  opacity:0; transition:opacity .15s ease; padding:0; min-height:auto; box-shadow:none;
}
.jm-thumb:hover .jm-thumb-del { opacity:1; }
.jm-dropzone {
  display:flex; align-items:center; gap:8px; padding:14px;
  border:2px dashed var(--kpi-border, #cbd5e1); border-radius:10px;
  font-size:13px; color:var(--small, #64748b); transition:border-color .15s ease, background .15s ease;
}
.jm-dropzone.dragover { border-color:#2979ff; background:rgba(41,121,255,.06); }
.jm-file-label {
  display:inline-block; padding:4px 12px; border-radius:8px; font-size:13px; font-weight:600;
  color:var(--link, #2979ff); cursor:pointer; border:1px solid var(--link, #2979ff);
  background:transparent; transition:background .15s ease;
}
.jm-file-label:hover { background:rgba(41,121,255,.08); }
.jm-actions { display:flex; gap:10px; justify-content:flex-end; align-items:center; margin-top:14px; }
.jm-save {
  padding:9px 22px; border-radius:10px; font-family:var(--btn-font); font-size:14px; font-weight:600; border:0;
  color:#fff; background:var(--btn-primary-bg); box-shadow:var(--btn-primary-shadow);
  cursor:pointer; transition:all .18s ease; min-height:auto;
}
.jm-save:hover { transform:translateY(-1px); box-shadow:var(--btn-primary-shadow-hover); filter:saturate(1.06); }
.jm-msg { font-size:13px; padding:6px 12px; border-radius:8px; display:none; }
.jm-msg.ok { display:inline-block; background:rgba(16,185,129,.12); color:#065f46; border:1px solid rgba(16,185,129,.3); }
.jm-msg.err { display:inline-block; background:rgba(217,48,37,.1); color:#7f1d1d; border:1px solid rgba(217,48,37,.25); }

@media (max-width: 900px) {
  body { margin: 12px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .menu { gap: 8px; }
  .pill { font-size: 12px; padding: 7px 10px; }
  .big-actions { grid-template-columns: 1fr; }
  .nav-shell { grid-template-columns: 1fr; }
  .nav-title { font-size:18px; }
  .nav-center { justify-content:flex-start; }
  .nav-right { justify-content:flex-start; }
  .kpi { min-width: 46%; margin: 6px 2% 6px 0; }
  canvas { height: 240px; }
  input, select, button { width: 100%; box-sizing: border-box; }
  select[multiple] { min-height: 96px; }
  .backtest-multi { min-height: 96px; }
  .journal-modal { margin:12px; padding:20px; max-width:calc(100vw - 24px); }
  .jm-images-grid { grid-template-columns:repeat(auto-fill, minmax(70px, 1fr)); }
}

/* ── Landing page: hero ── */
.landing-hero {
  text-align:center; padding:56px 24px 0; max-width:780px; margin:0 auto;
}
.landing-hero-logo { max-width:300px; width:100%; margin:0 auto 24px; display:block; }
.landing-hero-h1 {
  font-family:'Montserrat',system-ui,sans-serif; font-size:42px; font-weight:800;
  line-height:1.15; color:#0f172a; margin:0 0 18px; text-align:center;
}
.landing-hero-sub {
  font-size:17px; line-height:1.7; color:#475569; margin:0 auto 28px; max-width:640px; text-align:center;
}
.landing-hero-cta { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.landing-hero-img {
  max-width:960px; margin:40px auto 0; border-radius:16px; overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);
  border:1px solid #e2e8f0;
}
.landing-hero-img img { width:100%; display:block; }

/* ── Landing page: alternating showcase sections ── */
.landing-section {
  display:grid; grid-template-columns:1fr 1fr; gap:48px; align-items:center;
  padding:72px 0; max-width:1100px; margin:0 auto;
}
.landing-section.reverse .landing-section-text { order:2; }
.landing-section.reverse .landing-section-img { order:1; }
.landing-section-text {}
.landing-badge {
  display:inline-block; padding:5px 14px; border-radius:20px; font-size:12px; font-weight:700;
  text-transform:uppercase; letter-spacing:.04em;
  background:linear-gradient(135deg,#dbeafe,#ede9fe); color:#3b47c7; margin-bottom:14px;
}
.landing-section-text h2 {
  font-family:'Montserrat',system-ui,sans-serif; font-size:28px; font-weight:800;
  line-height:1.2; color:#0f172a; margin:0 0 16px;
}
.landing-section-text p { font-size:15px; line-height:1.7; color:#475569; margin:0; }
.landing-section-img {
  border-radius:14px; overflow:hidden;
  box-shadow:0 16px 48px rgba(0,0,0,.10), 0 2px 12px rgba(0,0,0,.05);
  border:1px solid #e2e8f0;
}
.landing-section-img img { width:100%; display:block; }

/* ── Landing page: highlights grid ── */
.landing-highlights { max-width:1100px; margin:0 auto; padding:56px 0 64px; }
.landing-highlights-grid {
  display:grid; grid-template-columns:repeat(4,1fr); gap:24px;
}
.landing-highlight-card {
  background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:28px 22px;
  text-align:center; box-shadow:0 4px 16px rgba(0,0,0,.04);
  transition:transform .25s ease, box-shadow .25s ease;
}
.landing-highlight-card:hover { transform:translateY(-4px); box-shadow:0 12px 32px rgba(0,0,0,.08); }
.landing-highlight-icon { font-size:32px; margin-bottom:12px; }
.landing-highlight-card h4 {
  font-family:'Montserrat',system-ui,sans-serif; font-size:16px; font-weight:700;
  color:#0f172a; margin:0 0 8px;
}
.landing-highlight-card p { font-size:13px; line-height:1.6; color:#64748b; margin:0; }

/* ── Scroll reveal animation ── */
.reveal {
  opacity:0; transform:translateY(40px);
  transition:opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.reveal.visible { opacity:1; transform:translateY(0); }
.landing-section.reverse.reveal { transform:translateY(40px); }
.landing-section.reverse.reveal.visible { transform:translateY(0); }

/* ── Landing responsive ── */
@media (max-width:900px) {
  .landing-hero-h1 { font-size:32px; }
  .landing-section { grid-template-columns:1fr; gap:32px; padding:48px 0; }
  .landing-section.reverse .landing-section-text { order:1; }
  .landing-section.reverse .landing-section-img { order:2; }
  .landing-highlights-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:540px) {
  .landing-hero-h1 { font-size:26px; }
  .landing-hero-sub { font-size:15px; }
  .landing-section-text h2 { font-size:22px; }
  .landing-highlights-grid { grid-template-columns:1fr; }
}
