/* ==========================================================================
   TraderPemula — app.css
   Styles for the user web app pages (auth + dashboard). Builds on style.css
   design tokens (colors, radius, shadows, fonts).
   ========================================================================== */

.auth-wrap {
  max-width: 460px;
  margin: 2.5rem auto;
}

.auth-wrap .card {
  padding: 2rem;
}

.auth-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
}

.auth-sub {
  margin: 0 0 1.5rem;
  color: var(--text-mute);
  font-size: 0.92rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-actions {
  margin-top: 0.4rem;
}

.auth-actions .btn {
  width: 100%;
  justify-content: center;
}

.auth-links {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-mute);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.alert {
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1.5px solid transparent;
}

.alert-error {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

.alert-success {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--success);
}

.alert-info {
  background: var(--primary-soft);
  border-color: var(--border-strong);
  color: var(--text-dim);
}

.hidden { display: none !important; }

/* Dashboard */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.dash-header .who {
  font-size: 0.9rem;
  color: var(--text-mute);
}

.copy-account-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
  flex-wrap: nowrap;
  margin-top: 0.85rem;
}

.copy-account-row .field {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.copy-account-row .field select {
  width: 100%;
  box-sizing: border-box;
}

.copy-account-row .btn {
  flex: 0 0 auto;
  min-width: 6.5rem;
  justify-content: center;
}

.master-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
}

@media (max-width: 560px) {
  .master-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .master-card { padding: 1rem; }
}

.master-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* Soft brand glow that warms up on hover — gives the card depth. */
.master-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 220px;
  height: 220px;
  background: radial-gradient(closest-side, rgba(124, 58, 237, 0.16), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.master-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.master-card:hover::after { opacity: 1; }

.master-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  position: relative;
  z-index: 1;
}

.master-id {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.master-id-text { min-width: 0; }

.master-avatar {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.master-avatar .av-check {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--bg-elev);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.5);
}

.master-card .name {
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.06rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-card .acct {
  font-size: 0.78rem;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

.master-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
}

.master-metrics .k { color: var(--text-mute); display: inline-flex; align-items: center; gap: 0.3rem; min-width: 0; }
.master-metrics .v { font-weight: 700; min-width: 0; }
.master-metrics .k .help-icon { flex: 0 0 auto; }

.tier-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--grad-primary);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 5px 16px rgba(124, 58, 237, 0.4);
}

/* ---------------------------------------------- verified trust panel */
.master-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  position: relative;
  z-index: 1;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg-soft);
  white-space: nowrap;
  line-height: 1.3;
}

/* Verified REAL is the headline trust signal — give it a solid gradient fill. */
.trust-badge.real {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.trust-badge.other { background: var(--secondary-soft); color: var(--secondary); border-color: transparent; }
.trust-badge.age { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); border-color: transparent; }
.trust-badge.follower { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
/* Data-confidence chip: colour keyed to how solid the sample is. */
.trust-badge.confidence { border-color: transparent; cursor: help; }
.trust-badge.confidence.high { background: rgba(16, 185, 129, 0.14); color: var(--success); }
.trust-badge.confidence.mid { background: rgba(245, 158, 11, 0.14); color: var(--accent-amber); }
.trust-badge.confidence.low { background: rgba(139, 129, 176, 0.16); color: var(--text-mute); }
.trust-badge.master {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Risk-behaviour pills carry a leading status dot for an at-a-glance read. */
.trust-badge.behavior::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 7px;
}
.trust-badge.behavior.conservative { background: rgba(16, 185, 129, 0.14); color: var(--success); border-color: transparent; }
.trust-badge.behavior.moderate { background: rgba(245, 158, 11, 0.16); color: var(--accent-amber); border-color: transparent; }
.trust-badge.behavior.aggressive { background: rgba(239, 68, 68, 0.14); color: var(--danger); border-color: transparent; }

.trust-section { margin-top: 1rem; }
.trust-note { font-size: 0.75rem; margin: 0.5rem 0 0; }

/* ---- Find Traders directory ---- */
.ft-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.ft-search { flex: 1 1 240px; }
.ft-search input {
  width: 100%;
  height: 42px;
  padding: 0 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.9rem;
}
.ft-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.ft-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.ft-filters select {
  height: 42px;
  padding: 0 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}
.ft-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
@media (max-width: 560px) {
  .ft-toolbar { flex-direction: column; align-items: stretch; }
  .ft-filters { width: 100%; }
  .ft-filters select { flex: 1 1 auto; min-width: 0; }
  .ft-search { flex: 1 1 auto; }
}
.ft-legend {
  margin: 0 0 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  padding: 0.35rem 0.9rem;
}
.ft-legend summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  padding: 0.45rem 0;
  list-style-position: inside;
}
.ft-legend[open] summary { margin-bottom: 0.35rem; }
.ft-legend-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 0.85rem;
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
}
.ft-legend-list dt { font-weight: 700; color: var(--text); white-space: nowrap; }
.ft-legend-list dd { margin: 0; color: var(--text-dim); }
@media (max-width: 520px) {
  .ft-legend-list { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .ft-legend-list dd { margin: 0 0 0.5rem; }
}

/* Freshness note under the popup's live open orders table. */
.ft-pos-fresh { margin-top: 0.5rem; font-size: 0.8rem; font-weight: 600; }
.ft-pos-fresh.fresh-ok { color: var(--success); }
.ft-pos-fresh.fresh-stale { color: var(--danger); }

/* Chart-free monthly net-profit bars inside the profile popup. */
.ft-mbars { display: flex; flex-direction: column; gap: 0.4rem; }
.ft-mbar-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr 5rem;
  align-items: center;
  gap: 0.6rem;
}
.ft-mbar-label { font-size: 0.78rem; color: var(--text-mute); font-weight: 600; }
.ft-mbar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.ft-mbar-fill { display: block; height: 100%; border-radius: 999px; background: var(--text-mute); }
.ft-mbar-fill.pos { background: var(--success); }
.ft-mbar-fill.neg { background: var(--danger); }
.ft-mbar-val { font-size: 0.82rem; font-weight: 700; text-align: right; }
.ft-mbar-val.pos { color: var(--success); }
.ft-mbar-val.neg { color: var(--danger); }

.ft-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-dim); }
.ft-more-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.4rem;
}
.master-actions a.btn { flex: 1; justify-content: center; text-decoration: none; }

/* ---------------------------------------------------------- Leaderboard
   The leaderboard reuses .master-grid / .master-card / .trust-badge wholesale;
   these lb-* rules only add what a ranked board needs on top: the category tab
   strip, the period selector, the rank medal, and the "Why ranked?" panel. */
.lb-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.9rem;
  scrollbar-width: thin;
}
.lb-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lb-tab:hover { border-color: var(--border-strong); color: var(--text); }
.lb-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.lb-periods { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.lb-period {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  border-radius: 9px;
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
}
.lb-period.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

.lb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.lb-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.lb-filters select,
.lb-filters input[type="number"] {
  height: 38px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.83rem;
}
.lb-filters input[type="number"] { width: 92px; }
.lb-check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.83rem; }

/* Rank medal, absolutely placed so it never pushes the card's own layout. */
.lb-rank {
  position: absolute;
  top: 0.75rem;
  left: 0.85rem;
  z-index: 2;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.lb-rank.top1 { background: linear-gradient(135deg, #f7d774, #d9a521); color: #3a2a00; border-color: #d9a521; }
.lb-rank.top2 { background: linear-gradient(135deg, #e3e7ee, #b3bcc9); color: #2c3340; border-color: #b3bcc9; }
.lb-rank.top3 { background: linear-gradient(135deg, #e6b389, #bd7f4c); color: #3a2110; border-color: #bd7f4c; }
/* The medal occupies the card's top-left, so shift the identity block clear. */
.lb-card .top { padding-left: 2.4rem; }

.lb-meta { font-size: 0.8rem; color: var(--text-mute); }
.lb-note {
  margin: 0 0 1rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--warn, #d9a521);
  background: var(--bg-soft);
  border-radius: 0 10px 10px 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.lb-why-btn { flex: 0 0 auto; }
.lb-why-list { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; }
.lb-why-list li { margin-bottom: 0.3rem; }
.lb-why-caveats { margin-top: 0.9rem; font-size: 0.8rem; color: var(--text-mute); }
.lb-why-bars { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.9rem; }
.lb-why-bar-h {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.lb-why-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}
.lb-why-bar-fill { height: 100%; background: var(--primary); }

.lb-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

/* ----- Compare traders ----- */

/* Opposite corner from the rank medal, which owns the top-left. */
.lb-pick {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  z-index: 2;
  display: inline-flex;
  padding: 0.25rem;
  cursor: pointer;
}
.lb-pick input { cursor: pointer; width: 1.05rem; height: 1.05rem; accent-color: var(--primary); }
.lb-pick input:disabled { cursor: not-allowed; opacity: 0.4; }
/* Clear the tier badge, which sits at the same height. */
.lb-card .top { padding-right: 1.9rem; }

.lb-compare-bar {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 60;
  width: min(940px, calc(100% - 2rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card, var(--bg-soft));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.lb-compare-picked { display: flex; flex-wrap: wrap; gap: 0.4rem; min-width: 0; }
.lb-compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.3rem 0.22rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.8rem;
}
.lb-compare-drop {
  border: 0;
  background: none;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
}
.lb-compare-drop:hover { color: var(--text); }
.lb-compare-actions { display: flex; gap: 0.5rem; flex: 0 0 auto; }

.lb-compare-card { max-width: 980px; }
.lb-compare-scroll { overflow-x: auto; margin-top: 0.75rem; }
.lb-compare-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.lb-compare-table th,
.lb-compare-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
.lb-compare-table thead th { text-align: center; vertical-align: bottom; }
.lb-compare-table tbody th[scope="row"] {
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  white-space: normal;
}
.lb-compare-table td { text-align: center; }
/* The winning cell per row; max DD wins by being smallest, which the note explains. */
.lb-compare-table td.is-best {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  font-weight: 700;
}
.lb-compare-name { font-weight: 700; }
.lb-compare-acct { font-size: 0.75rem; color: var(--text-mute); }

.lb-compare-spark { display: flex; gap: 0.5rem; justify-content: center; }
.lb-compare-spark-item { display: flex; flex-direction: column; align-items: center; }
.lb-compare-spark-item em {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--text-mute);
}
.lb-compare-spark-item b { font-size: 0.78rem; }
.lb-compare-spark-item b.pos { color: var(--ok, #2ea36b); }
.lb-compare-spark-item b.neg { color: var(--danger, #d9534f); }

.lb-compare-note {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-mute);
  line-height: 1.5;
}

@media (max-width: 560px) {
  .lb-compare-bar { flex-direction: column; align-items: stretch; }
  .lb-compare-actions { justify-content: flex-end; }
}

.trust-tiles-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}
@media (max-width: 560px) { .trust-tiles-row { grid-template-columns: 1fr; } }

.trust-scores { margin-top: 1rem; }
.trust-behavior {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.82rem;
}

.positions-table.pos-readonly th,
.positions-table.pos-readonly td { white-space: nowrap; }

.btn-follow[data-following="true"] {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

/* Smart Follow matrix: per-account follow chips on each master card. */
.follow-accounts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.follow-accounts-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-mute);
  margin-right: 0.1rem;
}
.follow-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.follow-chip:hover { border-color: var(--primary); transform: translateY(-1px); }
.follow-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.follow-chip[data-following="true"] {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--success);
}
.follow-chip[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }
.follow-empty { font-size: 0.78rem; }

/* Detail modal: account selector + follow button live on one row. */
.modal-follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.follow-account-label { font-size: 0.82rem; font-weight: 700; color: var(--text-mute); }
.follow-account-select {
  flex: 1 1 140px;
  min-width: 120px;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.86rem;
}
.modal-follow .btn-follow { flex: 1 1 140px; }

/* ==========================================================================
   Dashboard workspace (tabs + sections)
   ========================================================================== */
.dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 1.75rem;
}

.dash-tab {
  padding: 0.7rem 1.05rem;
  border-radius: 12px 12px 0 0;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-mute);
  text-decoration: none;
  border: 1.5px solid transparent;
  border-bottom: none;
  margin-bottom: -1.5px;
  transition: color 0.15s ease, background 0.15s ease;
}

.dash-tab:hover { color: var(--text); text-decoration: none; }

.dash-tab.active {
  color: var(--primary);
  background: var(--bg-elev);
  border-color: var(--border);
  border-bottom: 1.5px solid var(--bg-elev);
}

.dash-section { animation: dash-fade 0.2s ease; }

@keyframes dash-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.section-head { margin-bottom: 1.25rem; }
.section-head h2 { margin: 0 0 0.25rem; font-family: var(--font-display); }
.section-head p { margin: 0; font-size: 0.92rem; }
.section-head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.stats-refresh-ico { display: inline-block; font-size: 1rem; line-height: 1; }
.stats-refresh-ico.spin { animation: stats-spin 0.8s linear infinite; }
@keyframes stats-spin { to { transform: rotate(360deg); } }

.skeleton-text {
  color: var(--text-mute);
  font-size: 0.9rem;
  padding: 0.75rem 0;
}

.mono { font-family: var(--font-mono); }

.btn-ghost {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  background: transparent;
}

/* --------------------------------------------------------------- Licenses */
.license-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
}

.license-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.4rem;
}

.lic-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.lic-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.lic-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  border: 1.5px solid transparent;
}

.lic-badge.st-active { background: rgba(16, 185, 129, 0.14); color: var(--success); }
.lic-badge.st-pending { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.lic-badge.st-expired,
.lic-badge.st-revoked,
.lic-badge.st-banned,
.lic-badge.st-disabled { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
.lic-badge.st-edition { background: var(--primary-soft); color: var(--primary); }

.lic-expiry { font-size: 0.82rem; }

.lic-key-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lic-key {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--text);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.lic-copy { flex-shrink: 0; }

.lic-meta { font-size: 0.82rem; }

.lic-accounts-h {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-mute);
  margin-bottom: 0.35rem;
}

.lic-accounts ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.lic-accounts li { font-size: 0.86rem; }

/* Each bound account is a self-contained nested card so it is obvious where
   one account ends and the next begins (no ambiguous dividers between rows). */
.lic-acct {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}
.lic-acct.editing { gap: 0.6rem; }
.lic-acct-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lic-acct-id { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.lic-acct-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.lic-acct-name.is-empty { font-weight: 500; font-style: italic; color: var(--text-mute); }
.lic-acct-meta { font-size: 0.82rem; }
.lic-acct-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--text-mute);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.lic-acct-edit:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--border);
}
.lic-acct-edit-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.lic-acct-input {
  flex: 1 1 160px;
  min-width: 140px;
  padding: 0.35rem 0.55rem;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: 8px;
}
.lic-acct-input:focus { outline: none; border-color: var(--primary); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }

.overview-name { font-weight: 700; font-size: 0.92rem; color: var(--text); margin-top: 0.15rem; }

/* -------------------------------------------------------------- Statistics */
.stats-controls { margin-bottom: 1.25rem; max-width: 460px; }
.dash-account-bar { margin-top: 0; margin-bottom: 1.25rem; }

.picker-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted, #6b7280);
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.stat-tile {
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.st-label {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-mute);
  margin-bottom: 0.3rem;
}

/* Keep the info "i" glued beside its label (flex handles the spacing) so it can
   never orphan onto its own line in a tight tile. */
.st-label .help-icon { margin-left: 0; flex-shrink: 0; }

.st-value {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-display);
}

.stat-chart-card { padding: 1.25rem; margin-bottom: 1.25rem; }
.stat-more { padding: 1.25rem; }

.stat-chart-h {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-mute);
  margin-bottom: 0.75rem;
}

/* Small caption under a chart (e.g. deposit/withdrawal marker legend). */
.chart-note {
  font-size: 0.68rem;
  color: var(--text-mute);
  margin-top: 0.4rem;
}

/* Inline SVG sparkline */
.spark { width: 100%; height: 120px; display: block; }
.spark-bar.up { fill: var(--success); }
.spark-bar.down { fill: var(--danger); }
.spark-axis { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.spark-empty { font-size: 0.9rem; padding: 1.5rem 0; }

/* Cumulative profit curve (area + line) */
.cumline.up { color: var(--success); }
.cumline.down { color: var(--danger); }
.cum-area { fill: currentColor; opacity: 0.14; }
.cum-path { stroke: currentColor; stroke-width: 2; }

/* Two-up chart row */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.chart-grid .stat-chart-card { margin-bottom: 0; }
@media (max-width: 720px) { .chart-grid { grid-template-columns: 1fr; } }

/* ApexCharts placeholders (see assets/js/tp-charts.js) */
.tp-chart { width: 100%; min-width: 0; min-height: 150px; }
.tp-chart.journal-chart { min-height: 172px; }
.apexcharts-canvas { margin: 0 auto; }
.apexcharts-tooltip { font-family: var(--font-sans); }
.apx-tip { padding: 0.5rem 0.65rem; font-size: 0.78rem; line-height: 1.4; }

/* Calendar year heatmap (ApexCharts) */
.cal-year-heat-card { padding: 1rem 1rem 0.6rem; }
.cal-year-heat { min-height: 240px; }
.cal-heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 0.7rem; color: var(--text-mute); margin-top: 0.25rem; }
.cal-heat-legend .chl { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-heat-legend .sw-d4 { background: var(--danger); }
.cal-heat-legend .sw-d2 { background: color-mix(in srgb, var(--danger) 48%, transparent); }
.cal-heat-legend .sw-0 { background: color-mix(in srgb, var(--border) 85%, transparent); }
.cal-heat-legend .sw-u2 { background: color-mix(in srgb, var(--success) 48%, transparent); }
.cal-heat-legend .sw-u4 { background: var(--success); }

/* P/L sign colours (scoped to the stats tab) */
#stats-detail .pos { color: var(--success); }
#stats-detail .neg { color: var(--danger); }

/* Account balance / equity snapshot card */
.balance-card { padding: 1.25rem; margin-bottom: 1.25rem; }
.balance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 560px) { .balance-grid { grid-template-columns: 1fr; gap: 0.6rem; } }
.bal-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 0.25rem;
}
.acct-type {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.acct-type.real { background: var(--primary-soft); color: var(--success); }
.acct-type.other {
  background: var(--bg-elev);
  color: var(--text-mute);
  border: 1px solid var(--border);
}
.balance-upd { font-size: 0.78rem; margin-top: 0.75rem; }

/* TRS meter */
.trs-card { padding: 1.25rem; margin-bottom: 1.25rem; }
.trs-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.trs-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 0.15rem;
}
.trs-tier { font-size: 0.85rem; font-weight: 700; color: var(--primary); margin-left: 0.35rem; }
.elig {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.elig.ok { background: var(--primary-soft); color: var(--success); }
.elig.warn { background: var(--primary-soft); color: var(--danger); }
.trs-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  overflow: hidden;
}
.trs-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--success)); }
.trs-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-mute);
  margin-top: 0.3rem;
}

/* Monthly breakdown table */
.month-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.month-table th,
.month-table td { padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--border); text-align: left; }
.month-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-mute);
  font-weight: 700;
}
.month-table td.num,
.month-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.month-table tbody tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------- Strategy Hub */
.copy-account-card {
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  border-width: 1px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.copy-account-card:hover {
  box-shadow: var(--shadow);
}

.copy-account-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.copy-account-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  line-height: 0;
}

.copy-account-head-text {
  min-width: 0;
  flex: 1;
}

.copy-account-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.copy-account-desc {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.copy-info-list {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.copy-info-list li {
  position: relative;
  padding-left: 1.1rem;
}

.copy-info-list li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.5em;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--primary);
}

.copy-info-list strong { color: var(--text); }
.copy-info-list b { color: var(--text); font-weight: 700; }

.copy-account-card .alert {
  margin-top: 0.75rem;
}

.hub-heading { font-family: var(--font-display); margin: 1.5rem 0 0.75rem; }

.master-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.master-actions .btn { flex: 1; justify-content: center; }

.master-rule { font-size: 0.85rem; }
.master-desc {
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.master-rules-box {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.06));
}
.mrb-head {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  margin-bottom: 0.6rem;
}
.mrb-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.mrb-chip {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--primary);
}
.mrb-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border-strong);
  white-space: pre-wrap;
}

/* Detail modal — performance summary as bordered stat cards. */
.detail-stats { margin-top: 1.25rem; }
.ds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}
@media (max-width: 640px) { .ds-grid { grid-template-columns: repeat(2, 1fr); } }
.ds-item {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.ds-item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.ds-k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-mute);
  margin-bottom: 0.25rem;
}
.ds-v {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-display);
}
.ds-v.pos { color: var(--success); }
.ds-v.neg { color: var(--danger); }

.sizing-box {
  margin-top: 1.25rem;
  min-width: 0;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elev);
}
.sizing-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.sizing-row .field { min-width: 0; }
.sizing-box .field { margin-bottom: 0.75rem; }
.sizing-box .field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}
.sizing-box .field input,
.sizing-box .field select {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font-mono);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sizing-box .field input:focus,
.sizing-box .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.sizing-hint {
  font-size: 0.8rem;
  color: var(--text-mute);
  margin: 0.5rem 0 0;
}

/* Live, plain-language explanation of the selected lot-sizing mode. */
.sizing-mode-desc {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-dim);
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
}

/* Fields not used by the current mode are de-emphasised (still editable). */
.sizing-box .field.is-muted { opacity: 0.5; }

/* Custom hover/focus/tap tooltip bubble (see assets/js/tp-tooltip.js). One
   shared node lives on <body> and is positioned with position:fixed, so it is
   never clipped by an overflow:hidden card/modal and paints above them. */
.tp-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2000;
  max-width: 260px;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1.5px solid var(--border-strong, var(--border));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.tp-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.tp-tooltip-arrow {
  position: absolute;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: var(--bg-elev);
  border-right: 1.5px solid var(--border-strong, var(--border));
  border-bottom: 1.5px solid var(--border-strong, var(--border));
  transform: translateX(-50%) rotate(45deg);
}
.tp-tooltip.below .tp-tooltip-arrow {
  bottom: auto;
  top: -6px;
  border: 0;
  border-left: 1.5px solid var(--border-strong, var(--border));
  border-top: 1.5px solid var(--border-strong, var(--border));
}

/* Reusable "i" info badge; text now shown via the custom tooltip engine. */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 0.25rem;
  border-radius: 50%;
  font-size: 0.66rem;
  font-weight: 800;
  font-style: normal;
  font-family: var(--font-display);
  background: var(--border);
  color: var(--text-mute);
  cursor: help;
  vertical-align: middle;
}
.help-icon:hover,
.help-icon:focus {
  background: var(--primary);
  color: #fff;
  outline: none;
}

/* Detail modal follow button — prominent gradient CTA. */
#master-modal .modal-actions .btn-follow {
  background: var(--grad-primary);
  color: #fff;
  font-weight: 800;
  border: none;
  padding: 0.9rem;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
#master-modal .modal-actions .btn-follow:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.04);
}
#master-modal .modal-actions .btn-follow[data-following="true"] {
  background: rgba(16, 185, 129, 0.14);
  color: var(--success);
  box-shadow: none;
}

/* Consistency pass: the top-of-modal Verified Performance tiles and the trust
   tiles row adopt the same soft, hover-lift card look as the lower stat cards.
   Scoped to #master-modal so the Statistik tab's tiles keep their own style. */
#master-modal .stat-tile {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
#master-modal .stat-tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
#master-modal .st-value { font-size: 1.15rem; }
.detail-stats .ds-v { font-size: 1.15rem; }

/* The Risk & Consistency panel matches the sizing/rules panels: flat bordered
   card, not the elevated shadowed .card. */
#master-modal .trs-card.trust-scores {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: none;
  border-radius: 16px;
  margin-top: 1.25rem;
}
#master-modal .trust-section { margin-top: 1.25rem; }

@media (max-width: 560px) {
  .sizing-row { grid-template-columns: 1fr; }
}

/* My master accounts (rules editor) */
.my-masters {
  margin-bottom: 1.5rem;
  min-width: 0;
}

.my-masters-head {
  margin-bottom: 0.65rem;
}

.my-masters-head h3 {
  font-family: var(--font-display);
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.my-masters-head .text-mute {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.my-master-list {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin-top: 0;
  min-width: 0;
}

.my-master-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-width: 1px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  min-width: 0;
}

.my-master-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

/* Gradient accent strip at the very top; amber when rules are incomplete. */
.my-master-card .mm-accent {
  height: 4px;
  width: 100%;
  background: var(--grad-primary);
}

.my-master-card.is-incomplete .mm-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

.my-master-card .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--primary) 6%, var(--bg-elev)) 0%, var(--bg-elev) 100%);
  border-bottom: 1px solid var(--border);
}

.my-master-card .mm-ident {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
}

/* Crown avatar marking this as a master account. */
.my-master-card .mm-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent);
}

.my-master-card.is-incomplete .mm-avatar {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.32);
}

.my-master-card .top-main {
  min-width: 0;
  flex: 1;
}

.my-master-card .name {
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.my-master-card .mm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.mm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.mm-chip.status {
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
}

.mm-chip.status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.mm-chip.followers {
  color: var(--primary);
  background: var(--primary-soft);
}

.mm-chip.followers svg { opacity: 0.85; }

.my-master-card .mm-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem 1.1rem 0;
  min-width: 0;
}

.my-master-card .field {
  min-width: 0;
  margin: 0;
}

.mm-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.my-master-card .field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 0.35rem;
}

.mm-label-row label { margin-bottom: 0; }

.mm-count {
  font-size: 0.7rem;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

.my-master-card .field textarea,
.my-master-card .field input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.my-master-card .mm-desc {
  resize: vertical;
  min-height: 76px;
}

/* Combined money input: number + editable currency addon share one box. */
.mm-money {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mm-money:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.my-master-card .mm-money .mm-min {
  flex: 1;
  width: auto;
  border: none;
  background: transparent;
  border-radius: 0;
  font-weight: 600;
}

.my-master-card .mm-money .mm-ccy {
  width: 5.5rem;
  flex-shrink: 0;
  border: none;
  border-left: 1.5px solid var(--border);
  border-radius: 0;
  background: color-mix(in srgb, var(--primary) 5%, var(--bg));
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary);
}

.my-master-card .mm-money .mm-min:focus,
.my-master-card .mm-money .mm-ccy:focus {
  outline: none;
  box-shadow: none;
  border-color: var(--border);
}

.mm-help {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--text-mute);
  line-height: 1.4;
}

.mm-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.1rem 1.1rem;
}

/* "Unsaved changes" pill, revealed when the form is dirty. */
.mm-dirty {
  display: none;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--warn);
  margin-right: auto;
}

.mm-dirty::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.my-master-card.is-dirty .mm-dirty { display: inline-flex; }

.mm-actions {
  display: flex;
  justify-content: flex-end;
}

.mm-save {
  min-width: 9.5rem;
  gap: 0.45rem;
  justify-content: center;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent);
}

.mm-save svg { flex-shrink: 0; }

.rule-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.3;
}

.rule-flag svg { flex-shrink: 0; }

.rule-flag.ok {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.28);
}

.rule-flag.warn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.28);
}

@media (max-width: 560px) {
  .copy-account-row {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-account-row .btn {
    width: 100%;
  }

  .my-master-card .top {
    flex-direction: column;
  }

  .rule-flag { align-self: flex-start; }

  .mm-foot {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .mm-dirty {
    margin-right: 0;
    justify-content: center;
  }

  .mm-actions {
    justify-content: stretch;
  }

  .mm-save {
    width: 100%;
  }
}

/* ------------------------------------------------------------- Master modal */

/* --------------------------------------------------------------- Community */
.community-soon { padding: 2.5rem 2rem; text-align: center; }
.community-soon h3 { margin: 0.75rem 0 0.5rem; font-family: var(--font-display); }
.community-soon p { margin: 0 auto; max-width: 480px; }

.soon-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--grad-primary);
  color: #fff;
}

/* ---------------------------------------------------------------- Settings */
.settings-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

.settings-card { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; }
.settings-card h3 { margin: 0; font-family: var(--font-display); }
.settings-card .btn-primary { align-self: flex-start; }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.verify-status { font-size: 0.86rem; font-weight: 600; }
.verify-status.ok { color: var(--success); }
.verify-status.warn { color: #b45309; }

/* ------------------------------------------------------------- Master modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 10, 30, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin: auto;
}

/* The master detail is data-dense (equity curve, monthly table, 7-column live
   positions), so give it a noticeably wider canvas than the default modal. The
   shared public-profile popup (Find Traders + Leaderboard) shows the same trust
   panels + charts, so match its width. Both stay full-width on small screens via
   the shared .modal-card. */
#master-modal .modal-card,
.tpv-profile-card {
  max-width: 1040px;
}

@media (max-width: 640px) {
  .modal-overlay { padding: 0.75rem 0.5rem; }
  .modal-card { padding: 1.1rem; }
  #master-modal .modal-card,
  .tpv-profile-card { max-width: 100%; }
  .profile-viewer .profile-id h2 { padding-right: 2.25rem; }
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-mute);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { color: var(--text); background: var(--primary-soft); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-right: 2rem;
}

.modal-head .acct {
  font-size: 0.8rem;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

.modal-actions { margin-top: 1.25rem; }
.modal-actions .btn { width: 100%; justify-content: center; }

/* Toast notifications (above modal overlay z-index: 1000) */
.toast-stack {
  position: fixed;
  z-index: 1100;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.toast.toast-in { opacity: 1; transform: translateY(0); }
.toast.toast-out { opacity: 0; transform: translateY(-8px); }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--info); }
.toast-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.toast-success .toast-icon { background: rgba(16, 185, 129, 0.14); color: var(--success); }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.toast-info .toast-icon { background: var(--primary-soft); color: var(--info); }
.toast-msg {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
.toast-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.toast-close:hover { color: var(--text); background: var(--primary-soft); }

@media (min-width: 721px) {
  .toast-stack {
    left: auto;
    right: 1.25rem;
    bottom: 1.25rem;
    transform: none;
    width: min(380px, calc(100vw - 2.5rem));
  }
}

/* Confirmation dialog (reusable) */
.confirm-overlay { align-items: center; }
.confirm-card { max-width: 440px; }
.confirm-title { margin: 0 0 0.5rem; font-family: var(--font-display); }
.confirm-message { margin: 0 0 1.25rem; color: var(--text-mute); line-height: 1.55; }
.confirm-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; }
.confirm-actions .btn { min-width: 120px; justify-content: center; }

/* ------------------------------------------------------------- Download EA */
.download-ea-card {
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.download-ea-head h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.download-ea-head p {
  margin: 0;
  font-size: 0.92rem;
}

.download-ea-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.download-ea-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.download-ea-help {
  margin: 0.85rem 0 0;
  font-size: 0.84rem;
}

/* ----------------------------------------------------------------- Control */
.control-card { padding: 1.25rem; margin-bottom: 1.25rem; }

.control-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.control-card-head h3 { margin: 0; font-family: var(--font-display); }
.control-note { font-size: 0.8rem; }

.ctrl-head-right {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary, #2f6df0);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover { opacity: 0.8; }
.link-btn[aria-disabled="true"] { opacity: 0.5; cursor: default; text-decoration: none; }

.control-block { padding: 0.9rem 0; border-top: 1.5px solid var(--border); }
.control-block:first-of-type { border-top: 0; padding-top: 0.4rem; }

.control-block-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-mute);
  margin-bottom: 0.55rem;
}

.control-btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.control-inline {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  max-width: 360px;
}

.control-inline input { flex: 1; min-width: 0; }
.control-hint { font-size: 0.8rem; margin: 0.4rem 0 0; }

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.control-grid .field { margin: 0; }

.control-danger .control-block-label { color: var(--danger); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1.5px solid var(--danger);
}

.btn-danger:hover { filter: brightness(0.94); }

.control-effective {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.eff-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
}

.eff-k { color: var(--text-mute); font-weight: 600; }
.eff-v { font-weight: 700; }

.control-toggle {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0;
  border-top: 1.5px solid var(--border);
}

.control-toggle-label { font-weight: 700; }

/* Mini panel: 2-up toggles, no divider lines */
.mini-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.5rem 1.5rem;
}

.mini-toggles .control-toggle { border-top: 0; padding: 0.5rem 0; }

/* SMART TRAIL block (mirrors the EA panel: State toggle + mode segments) */
.smart-trail {
  margin-top: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1.5px solid var(--border);
}

.st-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.st-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--primary);
}

.st-state { display: inline-flex; align-items: center; gap: 0.55rem; }
.st-state-lbl { color: var(--text-mute); font-weight: 600; font-size: 0.85rem; }

.st-state-val { font-weight: 800; font-size: 0.85rem; }
.st-state-val.on { color: var(--success); }
.st-state-val.off { color: var(--text-mute); }

.st-modes { flex-wrap: wrap; }

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex: none;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background 0.15s ease;
}

.switch-track::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Segmented control (bot status / direction) */
.control-seg {
  display: inline-flex;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elev);
}

.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 700;
  padding: 0.5rem 1.05rem;
  cursor: pointer;
  border-right: 1.5px solid var(--border);
  transition: background 0.12s ease, color 0.12s ease;
}

.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--primary-soft); }

.seg-btn.active {
  background: var(--primary);
  color: #fff;
}

.seg-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.control-current {
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--primary);
  margin-left: 0.35rem;
}

/* Live status tiles */
.control-live {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
}

.live-tile {
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.live-val {
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--font-display);
}

.live-val.pos { color: var(--success); }
.live-val.neg { color: var(--danger); }

.control-empty { font-size: 0.9rem; padding: 0.5rem 0; }

.fresh-ok { color: var(--success); font-weight: 600; font-size: 0.8rem; }
.fresh-stale { color: var(--danger); font-weight: 600; font-size: 0.8rem; }

/* VPS health badge */
.vps-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.vps-badge.ok   { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.vps-badge.warn { background: color-mix(in srgb, var(--warning, #d97706) 20%, transparent); color: var(--warning, #d97706); }
.vps-badge.crit { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }

/* RAM usage meter (inside a VPS tile) */
.ram-bar {
  margin-top: 0.4rem;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.ram-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.ram-bar.warn > span { background: var(--warning, #d97706); }
.ram-bar.crit > span { background: var(--danger); }

/* Positions + journal tables (horizontally scrollable on narrow screens) */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--bg-elev) 30%, transparent) left center / 22px 100% no-repeat local,
    linear-gradient(to left, var(--bg-elev) 30%, transparent) right center / 22px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.14), transparent) left center / 9px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.14), transparent) right center / 9px 100% no-repeat scroll;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th,
.data-table td { padding: 0.5rem 0.55rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.data-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute, #64748b);
  font-weight: 700;
}
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: none; }
.data-table .pos { color: var(--success); }
.data-table .neg { color: var(--danger); }
@media (max-width: 560px) {
  .data-table, .month-table { font-size: 0.82rem; }
  .data-table th, .data-table td,
  .month-table th, .month-table td { padding: 0.4rem 0.4rem; }
}
.side-pill {
  display: inline-block; padding: 0.05rem 0.45rem; border-radius: 6px;
  font-size: 0.72rem; font-weight: 700;
}
.side-pill.buy  { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.side-pill.sell { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.row-modify { padding: 0.2rem 0.5rem; font-size: 0.76rem; }
.journal-periods { max-width: 320px; }
.journal-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* ----- Dashboard enhancements (overview, polling, compare, journal range) ----- */

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dash-fresh {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mute);
  white-space: nowrap;
}
.dash-fresh.fresh-ok { color: var(--success); }
.dash-fresh.fresh-stale { color: var(--warn); }

.dash-account-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dash-account-row select { flex: 1; min-width: 180px; }
.dash-acct-badge { flex-shrink: 0; }

.acct-type.demo { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
}
.overview-card {
  text-align: left;
  cursor: pointer;
  padding: 1.1rem 1.25rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  border: 1px solid var(--border);
  width: 100%;
  font: inherit;
  color: inherit;
}
.overview-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.overview-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.overview-acct { font-weight: 800; font-family: var(--font-display); }
.overview-broker { font-size: 0.82rem; margin-bottom: 0.5rem; }
.overview-lic { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.75rem; font-size: 0.82rem; }
.overview-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem 0.85rem;
  margin-top: 0.15rem;
  padding: 0.85rem 0.95rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.overview-metric {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.overview-metric .st-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin-bottom: 0;
  line-height: 1.2;
}
.overview-metric .st-value {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.overview-metric .st-value.pos { color: var(--success); }
.overview-metric .st-value.neg { color: var(--danger); }
.overview-top .trs-tier {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  margin-left: 0;
  line-height: 1.35;
}
.overview-seen { font-size: 0.75rem; margin-top: 0.75rem; }
.overview-no-stats {
  grid-column: 1 / -1;
  font-size: 0.88rem;
  padding: 0.15rem 0;
}
@media (max-width: 560px) {
  .overview-metrics {
    gap: 0.55rem 0.65rem;
    padding: 0.75rem 0.8rem;
  }
  .overview-metric .st-value { font-size: 0.98rem; }
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.online-dot.on { background: var(--success); box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 30%, transparent); }
.online-dot.off { background: var(--text-mute); opacity: 0.5; }

.spark-label {
  font-size: 9px;
  fill: var(--text-mute);
  font-family: var(--font-sans);
}
.cum-dot { fill: currentColor; opacity: 0.85; }

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.data-table th.sortable:hover { color: var(--text); }
.data-table th.sortable.active { color: var(--primary); }
.pos-comment { font-size: 0.75rem; opacity: 0.7; cursor: help; }
.pos-load-more-wrap { margin-top: 0.75rem; text-align: center; }

.journal-head { flex-wrap: wrap; gap: 0.75rem; }
.journal-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}
.journal-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.journal-range input[type="date"] {
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text);
}
.journal-range-sep { color: var(--text-mute); }
.journal-toolbar { margin-bottom: 0.5rem; }
.journal-chart-wrap { margin-bottom: 1rem; }
.journal-chart { width: 100%; height: auto; max-height: 190px; display: block; }

/* P&L calendar (year view) */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
.cal-nav {
  background: var(--bg-elev); border: 1.5px solid var(--border); border-radius: 10px;
  width: 36px; height: 36px; cursor: pointer; color: inherit; font-size: 1.1rem; line-height: 1;
}
.cal-nav:hover { border-color: var(--accent-cyan); }
.cal-year { font-size: 1.15rem; font-weight: 700; min-width: 4ch; text-align: center; }
.cal-top {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem;
}
.cal-goal-bar {
  height: 8px; border-radius: 6px; background: var(--border);
  overflow: hidden; margin: 0.6rem 0 0.4rem;
}
.cal-goal-fill { height: 100%; background: var(--success); border-radius: 6px; }
.cal-goal-row { display: flex; justify-content: space-between; font-size: 0.85rem; }
.cal-goal-edit { background: none; border: none; cursor: pointer; color: var(--accent-cyan); font-size: 0.85rem; }
.cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.cal-month { background: var(--bg-elev); border: 1.5px solid var(--border); border-radius: 14px; padding: 0.85rem; container-type: inline-size; }
.cal-month-name { text-align: center; font-weight: 600; margin-bottom: 0.6rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1; border-radius: 4px; background: var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cal-cell.up { background: var(--success); }
.cal-cell.down { background: var(--danger); }
.cal-cell.flat { background: var(--accent-cyan); opacity: 0.55; }
/* Heatmap intensity by |net|: deeper shade = bigger P&L (i1 small .. i4 large) */
.cal-cell.up.i1 { background: color-mix(in srgb, var(--success) 32%, transparent); }
.cal-cell.up.i2 { background: color-mix(in srgb, var(--success) 52%, transparent); }
.cal-cell.up.i3 { background: color-mix(in srgb, var(--success) 76%, transparent); }
.cal-cell.up.i4 { background: var(--success); }
.cal-cell.down.i1 { background: color-mix(in srgb, var(--danger) 32%, transparent); }
.cal-cell.down.i2 { background: color-mix(in srgb, var(--danger) 52%, transparent); }
.cal-cell.down.i3 { background: color-mix(in srgb, var(--danger) 76%, transparent); }
.cal-cell.down.i4 { background: var(--danger); }
.cal-cell-val {
  font-size: 0.6rem; font-weight: 800; line-height: 1; color: #fff;
  padding: 0 1px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.cal-cell-day {
  position: absolute; top: 1px; left: 3px;
  font-size: 0.5rem; font-weight: 700; line-height: 1; color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
@container (max-width: 130px) { .cal-cell-val { font-size: 0.5rem; } .cal-cell-day { display: none; } }
.cal-month-net { text-align: center; margin-top: 0.6rem; font-weight: 700; }
@media (max-width: 640px) {
  .cal-top { grid-template-columns: 1fr; }
  .cal-months { grid-template-columns: repeat(2, 1fr); }
}

/* Dedicated Kalender tab: scope toggle + day-card grids */
.cal-scope-seg { margin-bottom: 1rem; width: 100%; }
[data-tab="calendar"] .cal-top { grid-template-columns: 1fr; }
#calendar-wrap { position: relative; }
.cal-cell { cursor: pointer; }
.cal-cell:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.cal-tip {
  position: absolute; z-index: 30; pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
  background: var(--bg-elev); border: 1.5px solid var(--accent-cyan);
  color: var(--text); border-radius: 8px; padding: 0.35rem 0.55rem;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.cal-days-head {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem; margin-bottom: 0.5rem;
}
.cal-days {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem;
}
.cal-days-head.week7, .cal-days.week7 { grid-template-columns: repeat(7, 1fr); }
.cal-weekday-head {
  text-align: center; font-size: 0.72rem; font-weight: 600;
  color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.04em;
}
.cal-day {
  background: var(--bg-elev); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0.55rem 0.5rem; min-height: 84px;
  display: flex; flex-direction: column; gap: 0.1rem;
}
.cal-day.blank { background: transparent; border-color: transparent; }
.cal-day.up { background: color-mix(in srgb, var(--success) 20%, var(--bg-elev)); border-color: var(--success); }
.cal-day.down { background: color-mix(in srgb, var(--danger) 20%, var(--bg-elev)); border-color: var(--danger); }
.cal-day.up.i1 { background: color-mix(in srgb, var(--success) 12%, var(--bg-elev)); }
.cal-day.up.i2 { background: color-mix(in srgb, var(--success) 22%, var(--bg-elev)); }
.cal-day.up.i3 { background: color-mix(in srgb, var(--success) 34%, var(--bg-elev)); }
.cal-day.up.i4 { background: color-mix(in srgb, var(--success) 48%, var(--bg-elev)); }
.cal-day.down.i1 { background: color-mix(in srgb, var(--danger) 12%, var(--bg-elev)); }
.cal-day.down.i2 { background: color-mix(in srgb, var(--danger) 22%, var(--bg-elev)); }
.cal-day.down.i3 { background: color-mix(in srgb, var(--danger) 34%, var(--bg-elev)); }
.cal-day.down.i4 { background: color-mix(in srgb, var(--danger) 48%, var(--bg-elev)); }
.cal-day.flat { border-color: var(--accent-cyan); }
.cal-day.empty { opacity: 0.55; }
.cal-day[data-date] { cursor: pointer; transition: transform 0.08s ease, box-shadow 0.12s ease; }
.cal-day[data-date]:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }
.cal-day[data-date]:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.cal-daynum { font-weight: 700; font-size: 0.9rem; }
.cal-daynet { font-weight: 700; font-size: 0.95rem; }
.cal-day.up .cal-daynet { color: var(--success); }
.cal-day.down .cal-daynet { color: var(--danger); }
.cal-daytrades { font-size: 0.72rem; color: var(--text-mute); }
.cal-years { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.cal-year-card {
  text-align: left; cursor: pointer; color: inherit;
  background: var(--bg-elev); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.cal-year-card:hover { border-color: var(--accent-cyan); }
.cal-year-card.up { border-color: var(--success); }
.cal-year-card.down { border-color: var(--danger); }
.cal-year-name { font-weight: 700; font-size: 1.05rem; }
.cal-year-card.up .cal-daynet { color: var(--success); }
.cal-year-card.down .cal-daynet { color: var(--danger); }
@media (max-width: 640px) {
  .cal-days-head, .cal-days { grid-template-columns: repeat(5, 1fr); }
  .cal-years { grid-template-columns: repeat(2, 1fr); }
  .cal-day { min-height: 70px; padding: 0.45rem 0.35rem; }
}

/* Calendar day-detail popup: summary tiles + symbol/side/session breakdowns */
.cd-tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.65rem; margin: 1rem 0 1.15rem;
}
.cd-tile {
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0.65rem 0.75rem; min-height: 4.25rem;
}
.cd-tile-l {
  flex: 1 0 auto; min-height: 2.4em; line-height: 1.25;
  font-size: 0.72rem; color: var(--text-mute); text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cd-tile-v {
  margin-top: auto; font-weight: 800; font-size: 1.05rem;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.cd-tile-v.pos { color: var(--success); }
.cd-tile-v.neg { color: var(--danger); }
.cd-blocks {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; margin-top: 0.25rem;
}
.cd-block {
  background: var(--bg-elev); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0.85rem 0.9rem;
}
.cd-block-h {
  font-weight: 700; font-size: 0.78rem; margin: 0 0 0.65rem; padding-bottom: 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.05em;
}
.cd-brow {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  column-gap: 0.65rem; row-gap: 0.2rem;
  padding: 0.55rem 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.cd-brow:first-of-type { border-top: none; padding-top: 0; }
.cd-blabel {
  grid-column: 1 / -1; grid-row: 1;
  font-weight: 600; font-size: 0.875rem; line-height: 1.35;
  color: var(--text); word-break: break-word;
}
.cd-bnet {
  grid-column: 1; grid-row: 2; align-self: center;
  font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums;
}
.cd-bnet.pos { color: var(--success); }
.cd-bnet.neg { color: var(--danger); }
.cd-btrades {
  grid-column: 2; grid-row: 2; align-self: center; justify-self: end;
  font-size: 0.72rem; color: var(--text-mute); white-space: nowrap;
}
@media (max-width: 640px) {
  .cd-tiles { grid-template-columns: repeat(2, 1fr); gap: 0.55rem; }
  .cd-blocks { grid-template-columns: 1fr; gap: 0.75rem; }
  .cd-tile { min-height: 3.85rem; padding: 0.6rem 0.65rem; }
  .cd-block { padding: 0.8rem 0.85rem; }
}

.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.82rem; }

/* Dashboard ebook catalog */
.ebook-dash-grouphead {
  margin: 1.75rem 0 0.85rem; font-size: 1.05rem; font-weight: 800;
  padding-bottom: 0.5rem; border-bottom: 1.5px solid var(--border);
}
.ebook-dash-grouphead:first-child { margin-top: 0.25rem; }
.ebook-dash-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem;
}
.ebook-dash-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-elev); border: 1.5px solid var(--border); border-radius: 14px;
}
.ebook-dash-cover {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 92px; font-size: 2.6rem;
  background: linear-gradient(135deg, var(--primary-soft), var(--bg-elev));
}
.ebook-dash-badge {
  position: absolute; top: 0.5rem; left: 0.5rem;
  font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px;
  background: rgba(0, 0, 0, 0.35); color: #fff;
}
.ebook-dash-body { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.85rem 0.95rem 1rem; flex: 1; }
.ebook-dash-body h4 { margin: 0; font-size: 0.98rem; font-weight: 700; line-height: 1.3; }
.ebook-dash-body p { margin: 0; font-size: 0.85rem; line-height: 1.5; }
.ebook-dash-cta {
  margin-top: auto; padding-top: 0.6rem; display: flex; align-items: center;
  justify-content: space-between; gap: 0.75rem;
}
.ebook-dash-price { font-weight: 800; color: var(--success); }

/* ============================ Manajemen Risiko (risk tools) ============================ */
.risk-bar {
  padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--primary-soft), transparent 55%),
    var(--bg-elev);
  border: 1.5px solid var(--border);
}

/* toolbar top row: segmented account type + presets */
.risk-bar-top {
  display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: flex-end;
  padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1.5px solid var(--border);
}
.risk-seg-group { display: flex; flex-direction: column; gap: 0.4rem; }
.risk-seg-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-mute);
}
.risk-seg {
  display: inline-flex; gap: 0.25rem; padding: 0.28rem;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 999px;
}
.risk-seg-btn {
  cursor: pointer; border: none; background: none; color: var(--text-mute);
  font: inherit; font-size: 0.85rem; font-weight: 600; line-height: 1;
  padding: 0.45rem 0.95rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 0.35rem;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.risk-seg-btn small { font-size: 0.68rem; font-weight: 700; opacity: 0.75; }
.risk-seg-btn:hover { color: var(--text); }
.risk-seg-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  box-shadow: var(--shadow-sm);
}
.risk-seg-btn.active small { opacity: 0.85; }

.risk-bar-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.85rem;
}
.risk-ico { font-size: 0.95em; opacity: 0.85; }
.risk-acct-hint {
  margin: 0.85rem 0 0; font-size: 0.8rem; line-height: 1.5;
  color: var(--text-mute); padding: 0.55rem 0.75rem;
  background: var(--primary-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.risk-bar-prefill { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 0.9rem; margin-top: 0.95rem; }
.risk-bar-prefill select { max-width: 220px; }
.risk-bar-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.risk-prefill-note { font-size: 0.82rem; }
.risk-acct-readout {
  font-size: 0.85rem; font-weight: 600; color: var(--accent-cyan);
  padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--primary-soft);
}
.risk-acct-readout strong { color: var(--primary); }

/* custom-styled selects */
.risk-bar select, .field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-color: var(--bg-elev);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.5rem 2rem 0.5rem 0.7rem; color: inherit; font: inherit; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.risk-bar select:hover, .field select:hover { border-color: var(--accent-cyan); }
.risk-bar select:focus, .field select:focus {
  outline: none; border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* number stepper (- input +) */
.risk-stepper {
  display: flex; align-items: stretch; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-elev);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.risk-stepper:focus-within { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px var(--primary-soft); }
.risk-stepper input {
  border: none !important; background: transparent !important; text-align: center;
  box-shadow: none !important; width: 100%; min-width: 0; -moz-appearance: textfield;
}
.risk-stepper input::-webkit-outer-spin-button,
.risk-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.risk-step-btn {
  flex: 0 0 auto; width: 2.1rem; cursor: pointer; border: none; color: var(--text-mute);
  background: var(--bg); font-size: 1.05rem; font-weight: 700; line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.risk-step-btn:hover { background: var(--primary-soft); color: var(--primary); }
.risk-step-btn:active { transform: scale(0.94); }

.risk-layout { display: grid; grid-template-columns: 264px 1fr; gap: 1.1rem; align-items: start; }
.risk-subnav {
  display: flex; flex-direction: column; gap: 0.25rem;
  background: var(--bg-elev); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 0.65rem; position: sticky; top: 1rem;
}
.risk-subnav-group {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-mute); padding: 0.65rem 0.5rem 0.3rem;
}
.risk-subnav-btn {
  position: relative; display: flex; flex-direction: column; gap: 0.1rem; text-align: left;
  cursor: pointer; background: none; border: 1.5px solid transparent; border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem; color: inherit; width: 100%;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.risk-subnav-btn::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; border-radius: 999px;
  background: linear-gradient(var(--primary), var(--accent-cyan)); transition: height 0.18s;
}
.risk-subnav-btn:hover { background: var(--primary-soft); transform: translateX(2px); }
.risk-subnav-btn.active { border-color: var(--border-strong); background: var(--primary-soft); }
.risk-subnav-btn.active::before { height: 60%; }
.risk-subnav-name { font-weight: 700; font-size: 0.9rem; }
.risk-subnav-desc { font-size: 0.75rem; color: var(--text-mute); line-height: 1.3; }
.risk-tool { background: var(--bg-elev); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.risk-tool-head h3 { margin: 0 0 0.15rem; font-size: 1.2rem; }
.risk-tool-head p { margin: 0 0 1.1rem; }
.risk-inputs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.85rem;
  margin-bottom: 1.1rem;
}
.field-check { display: flex; align-items: flex-end; }
.field-check label { display: flex; align-items: center; gap: 0.4rem; font-weight: 500; }
.risk-out { display: flex; flex-direction: column; gap: 0.95rem; }

/* gauges */
.risk-gauge {
  text-align: center; padding: 1rem 0.5rem; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
}
.risk-gauge-num { font-size: 2.7rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.risk-gauge-num span { font-size: 1rem; font-weight: 600; color: var(--text-mute); }
.risk-gauge-bar { height: 12px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 0.7rem auto 0.5rem; max-width: 320px; }
.risk-gauge-fill { height: 100%; border-radius: 999px; transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.risk-gauge-label { font-weight: 700; font-size: 0.95rem; }
.risk-gauge.ok .risk-gauge-num, .risk-gauge.ok .risk-gauge-label { color: var(--success); }
.risk-gauge.ok .risk-gauge-fill { background: linear-gradient(90deg, #34d399, var(--success)); box-shadow: 0 0 12px rgba(16, 185, 129, 0.5); }
.risk-gauge.warn .risk-gauge-num, .risk-gauge.warn .risk-gauge-label { color: #f59e0b; }
.risk-gauge.warn .risk-gauge-fill { background: linear-gradient(90deg, #fbbf24, #f59e0b); box-shadow: 0 0 12px rgba(245, 158, 11, 0.5); }
.risk-gauge.bad .risk-gauge-num, .risk-gauge.bad .risk-gauge-label { color: var(--danger); }
.risk-gauge.bad .risk-gauge-fill { background: linear-gradient(90deg, #f87171, var(--danger)); box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }

.risk-factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.65rem; }
@media (max-width: 480px) {
  .stat-tiles { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .risk-factors { grid-template-columns: 1fr; }
}
.risk-factor {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem; transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.risk-factor:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.risk-factor-head { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; }
.risk-factor-head .ok { color: var(--success); }
.risk-factor-head .warn { color: #f59e0b; }
.risk-factor-head .bad { color: var(--danger); }
.risk-factor-bar { height: 7px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 0.4rem 0; }
.risk-factor-bar > div { height: 100%; border-radius: 999px; transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.risk-factor-bar .ok { background: var(--success); }
.risk-factor-bar .warn { background: #f59e0b; }
.risk-factor-bar .bad { background: var(--danger); }
.risk-factor-detail { font-size: 0.75rem; }

.risk-result {
  text-align: center; padding: 1rem; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
}
.risk-result-num { font-size: 2.3rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.risk-result-num.ok { color: var(--success); }
.risk-result-num.warn { color: #f59e0b; }
.risk-result-num.bad { color: var(--danger); }
.risk-usd { font-size: 0.8rem; font-weight: 600; color: var(--text-mute); white-space: nowrap; }

.risk-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.risk-table th, .risk-table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); }
.risk-table th { color: var(--text-mute); font-weight: 600; }
.risk-table tbody tr:hover td { background: var(--primary-soft); }
.risk-table td.ok { color: var(--success); font-weight: 700; }
.risk-table td.warn { color: #f59e0b; font-weight: 700; }
.risk-table td.bad { color: var(--danger); font-weight: 700; }

.risk-steps { margin: 0; padding-left: 1.2rem; line-height: 1.7; }
.risk-warn { border-radius: var(--radius-sm); padding: 0.65rem 0.85rem; font-size: 0.88rem; line-height: 1.5; border: 1px solid var(--border); }
.risk-warn.info { background: var(--primary-soft); border-color: var(--accent-cyan); }
.risk-warn.ok { background: rgba(16, 185, 129, 0.12); border-color: var(--success); }
.risk-warn.warn { background: rgba(245, 158, 11, 0.12); border-color: #f59e0b; }
.risk-warn.bad { background: rgba(239, 68, 68, 0.12); border-color: var(--danger); }

/* overview landing */
.risk-overview {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.9rem;
}
.risk-ov-cell {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem; transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.risk-ov-cell:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.risk-ov-cell h4 { margin: 0 0 0.7rem; font-size: 0.82rem; text-align: center; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.04em; }
.risk-ov-cell .risk-gauge { padding: 0.4rem 0; border: none; background: none; }
.risk-ov-cell .risk-gauge-num { font-size: 2.2rem; }

/* per-input help hints + info icon */
.risk-help { display: block; font-size: 0.72rem; color: var(--text-mute); line-height: 1.4; margin-top: 0.35rem; }
.risk-help-icon {
  display: inline-flex; align-items: center; justify-content: center; cursor: help;
  width: 15px; height: 15px; border-radius: 50%; font-size: 0.68rem; font-weight: 700;
  background: var(--border); color: var(--text-mute); vertical-align: middle;
}
.risk-help-icon:hover { background: var(--accent-cyan); color: #fff; }
.risk-disclaimer {
  margin: 1.1rem 0 0; font-size: 0.78rem; line-height: 1.5; text-align: center;
  padding-top: 0.9rem; border-top: 1px solid var(--border);
}

@media (max-width: 820px) {
  .risk-layout { grid-template-columns: 1fr; }
  .risk-subnav { flex-direction: row; flex-wrap: wrap; position: static; top: auto; }
  .risk-subnav-group { width: 100%; }
  .risk-subnav-btn { flex: 1 1 45%; }
  .risk-subnav-btn:hover { transform: none; }
  .risk-bar-top { gap: 1rem; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  /* Tab bar: horizontal scroll (7 tabs) */
  .dash-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.25rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  .dash-tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
  }

  /* Header row: freshness + theme toggle */
  .dash-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .dash-fresh {
    white-space: normal;
    min-width: 0;
  }

  /* Global account picker */
  .stats-controls,
  .dash-account-bar {
    max-width: none;
  }
  .dash-account-row {
    width: 100%;
  }
  .dash-account-row select {
    min-width: 0;
    flex: 1 1 100%;
    width: 100%;
  }

  /* Overview cards */
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .license-grid {
    grid-template-columns: 1fr;
  }

  /* Positions "load more" */
  .pos-load-more-wrap .btn {
    width: 100%;
    justify-content: center;
  }
  .data-table th.sortable {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  /* Journal toolbar + range */
  .journal-controls { align-items: stretch; width: 100%; }
  .journal-periods { max-width: none; width: 100%; }
  .journal-periods.control-seg {
    display: flex;
  }
  .journal-periods .seg-btn {
    flex: 1;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    font-size: 0.82rem;
  }
  .control-card-head.journal-head {
    flex-direction: column;
    align-items: stretch;
  }
  .journal-range {
    width: 100%;
  }
  .journal-range input[type="date"] {
    min-width: 0;
    flex: 1 1 calc(50% - 1.5rem);
  }
}

/* ------------------------------------------- Public profile publish panel */
/* Compact per-account status strip (chips + an "Atur" button that opens the
   settings modal), so the license list stays short instead of stacking a full
   form under every account. */
.lic-pub-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.pub-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg);
  white-space: nowrap;
}
.pub-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-mute);
}
.pub-chip.on {
  color: color-mix(in srgb, var(--success) 70%, var(--text));
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
  background: color-mix(in srgb, var(--success) 12%, var(--bg));
}
.pub-chip.on::before { background: var(--success); }
.pub-chip.off::before { background: var(--text-mute); }
.pub-chip.warn {
  color: color-mix(in srgb, var(--warning, #d99a1a) 78%, var(--text));
  border-color: color-mix(in srgb, var(--warning, #d99a1a) 45%, var(--border));
  background: color-mix(in srgb, var(--warning, #d99a1a) 12%, var(--bg));
}
.pub-chip.warn::before { background: var(--warning, #d99a1a); }
.pub-settings-btn { flex: 0 0 auto; }

/* ===================== Buy licenses (QRIS self-service) ===================== */
.buy-license-card,
.orders-history-card {
  margin: 1.25rem 0;
  padding: 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg, 20px);
  background: var(--bg-elev);
}
.buy-license-head h3,
.orders-history-card .section-head h3 { margin: 0; font-family: var(--font-display); }
.buy-license-head p { margin: 0.25rem 0 0; font-size: 0.85rem; }
.package-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  margin-top: 1rem;
}
.package-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.2rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.package-card:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  transform: translateY(-2px);
}
/* Featured/recommended plan: accent border + subtle glow. */
.package-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset,
    0 8px 28px color-mix(in srgb, var(--primary) 20%, transparent);
}
.package-badge {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  margin-bottom: 0.2rem;
}
.package-card.featured .package-badge { color: #fff; background: var(--primary); }
.package-name { font-weight: 700; font-family: var(--font-display); font-size: 1.05rem; }
.package-price {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.package-permonth { font-size: 0.78rem; margin-top: -0.05rem; }
.package-meta { font-size: 0.8rem; }
.package-tagline {
  font-size: 0.8rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--primary) 70%, var(--text));
}
.package-features {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.package-features li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text);
}
.package-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 800;
}
.package-buy { margin-top: auto; }
.package-features + .package-buy { margin-top: 0.9rem; }
.lic-badge.st-trial {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #b45309;
}

.orders-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.75rem; }
.order-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.order-main { display: flex; align-items: baseline; gap: 0.75rem; }
.order-pkg { font-weight: 700; }
.order-amount { color: var(--primary); font-weight: 700; }
.order-meta { display: flex; align-items: center; gap: 0.6rem; font-size: 0.78rem; }

/* QRIS payment modal */
.qr-card { max-width: 420px; text-align: center; }
.qr-title { margin: 0 0 0.25rem; font-family: var(--font-display); }
.qr-sub { margin: 0 0 1rem; font-weight: 600; }
.qr-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 1rem;
  background: #fff;
  border-radius: 14px;
}
.qr-image { width: 240px; height: 240px; object-fit: contain; }
.qr-string {
  font-size: 0.68rem;
  word-break: break-all;
  color: #111;
  max-height: 220px;
  overflow: auto;
}
.qr-paid { font-size: 1.1rem; font-weight: 800; color: var(--success); }
.qr-help { font-size: 0.78rem; margin: 0.85rem 0; }
.qr-status { margin-top: 0.5rem; }

/* Settings modal content */
.pub-settings-title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; }
.pub-settings-sub { font-size: 0.82rem; margin-top: 0.15rem; }
.pub-settings-groups {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.pub-settings-groups.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}
.pub-group { display: flex; flex-direction: column; gap: 0.6rem; }
.pub-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.pub-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pub-pill { position: relative; cursor: pointer; }
.pub-pill input { position: absolute; opacity: 0; pointer-events: none; }
.pub-pill-face {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pub-pill input:checked + .pub-pill-face {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, var(--bg));
  color: var(--text);
}
.pub-pill input:focus-visible + .pub-pill-face {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Switch-style toggle (main publish + visibility options) */
.pub-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}
.pub-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pub-switch-track {
  flex: 0 0 auto;
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-mute) 45%, var(--bg));
  transition: background 0.15s;
}
.pub-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s;
}
.pub-switch input:checked + .pub-switch-track { background: var(--primary); }
.pub-switch input:checked + .pub-switch-track::after { transform: translateX(18px); }
.pub-switch input:focus-visible + .pub-switch-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.pub-switch-label { font-size: 0.9rem; font-weight: 600; }
.pub-switch-main {
  margin-top: 1.1rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.pub-link { background: var(--bg); }

/* --------------------------------------------- Public profile viewer page */
.profile-viewer .profile-head {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

/* Breathing room between the stacked section cards in the profile popup/viewer
   (child combinator so the score cards inside .pub-scores are not affected). */
.profile-viewer > .card,
#profile-viewer-body > .card {
  margin-bottom: 1.5rem;
}
.profile-viewer > .card:last-child,
#profile-viewer-body > .card:last-child {
  margin-bottom: 0;
}
.profile-viewer .profile-id h2 {
  margin: 0.25rem 0 0.15rem;
  font-family: var(--font-display);
}
.verif-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  color: #fff;
  background: var(--text-mute);
}
.verif-badge.lvl1 { background: var(--text-mute); }
.verif-badge.lvl2 { background: var(--primary); }
.verif-badge.lvl3 { background: var(--success); }

/* Header badge row for the profile popup: verification level + tier + TRS. */
.profile-head-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.profile-head-badges .verif-badge,
.profile-head-badges .tier-badge { margin-top: 0; }
.profile-trs {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 999px;
  color: var(--text);
  background: var(--primary-soft);
}

.pub-scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.pub-score-hint { margin-top: 0.5rem; font-size: 0.82rem; }
.pub-active-period { margin-top: 0.6rem; font-size: 0.82rem; }

/* "Kepercayaan komunitas" — accented follower + AUC stat blocks. */
.trust-community .tc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.tc-stat {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.tc-follower {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--bg));
}
.tc-auc {
  border-color: color-mix(in srgb, var(--accent-cyan) 32%, var(--border));
  background: color-mix(in srgb, var(--accent-cyan) 6%, var(--bg));
}
.tc-ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
}
.tc-follower .tc-ico { background: var(--grad-primary); }
.tc-auc .tc-ico { background: var(--grad-cyan); }
.tc-body { min-width: 0; }
.tc-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--text-mute);
}
.tc-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 1.1;
  margin-top: 0.15rem;
}
.tc-ccy { font-size: 0.9rem; font-weight: 700; color: var(--text-mute); }
.tc-sub { font-size: 0.72rem; margin-top: 0.1rem; }

@media (max-width: 640px) {
  .trust-community .tc-grid { grid-template-columns: 1fr; }
}

.pub-cal-caption { margin-bottom: 0.5rem; }
.pub-cal-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}
.pub-cal-cell {
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  text-align: center;
}
.pub-cal-cell.up { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.pub-cal-cell.down { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.pub-cal-m { font-size: 0.72rem; color: var(--text-mute); font-weight: 600; }
.pub-cal-net { font-size: 0.82rem; font-weight: 700; margin-top: 0.15rem; }

/* Months with traded activity are clickable and open the daily-detail dialog. */
.pub-cal-cell.clickable {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.pub-cal-cell.clickable:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.18);
}
.pub-cal-cell.clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Stacked drill-down dialog (sits above an open profile modal). Holds both the
   month view and the day detail, which reuses the dashboard's .cd-* tiles and
   needs the wider card to lay them out. */
.modal-overlay.tpt-stacked { z-index: 1200; }
.tpt-cal-card { max-width: 720px; }
.tpt-cal-sub { font-size: 0.82rem; margin-bottom: 0.85rem; }
.tpt-cal-empty { font-size: 0.85rem; padding: 0.5rem 0; }
.tpt-cal-hint { font-size: 0.75rem; margin-top: 0.75rem; }
.tpt-cal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.tpt-cal-back:hover { color: var(--primary); border-color: var(--primary); }
.tpt-cal-back:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tpt-calday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.5rem;
}
.tpt-calday-cell {
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  text-align: center;
}
.tpt-calday-cell.up { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.tpt-calday-cell.down { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.tpt-calday-d { font-size: 0.72rem; color: var(--text-mute); font-weight: 600; }
.tpt-calday-net { font-size: 0.8rem; font-weight: 700; margin-top: 0.1rem; }
.tpt-calday-t { font-size: 0.68rem; margin-top: 0.1rem; }

/* Traded days are clickable and drill into the day detail. */
.tpt-calday-cell.clickable {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.tpt-calday-cell.clickable:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.18);
}
.tpt-calday-cell.clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .pub-scores { grid-template-columns: 1fr; }
  .pub-cal-grid { grid-template-columns: repeat(3, 1fr); }
}
